Skip to main content

Deployment

Prerequisites

  • Foundry
  • An .env file (see .env.example)

Scripts

ScriptWrapperPurpose
DeployToken.s.soldeploy-token.shDeploy YellowToken
DeployFaucet.s.soldeploy-faucet.shDeploy Faucet (testnet only)
DeployTreasury.s.solDeploy Treasury
DeployRegistry.s.solDeploy registries + governance

Deployment Order

  1. YellowToken — deploy first, get the token address
  2. Registry + Governance — needs token address; deploys NodeRegistry, AppRegistry, TimelockController, YellowGovernor in one script
  3. Treasury — independent; can be owned by Foundation or transferred to TimelockController

Configuration

cp .env.example .env

Token

VariableDescription
FOUNDATION_ADDRESSReceives the initial 10B YELLOW supply

Registry + Governance

VariableDefaultDescription
TOKEN_ADDRESSDeployed YellowToken address
ADJUDICATOR_ADDRESSInitial adjudicator for AppRegistry
PROPOSAL_GUARDIANFoundation multisig for emergency cancel
VOTING_DELAY7200Blocks before voting starts (~1 day)
VOTING_PERIOD50400Blocks vote stays open (~1 week)
PROPOSAL_THRESHOLD10M YELLOWMin voting power to propose
QUORUM_NUMERATOR4Quorum as % of locked supply
QUORUM_FLOOR100M YELLOWMinimum absolute quorum
VOTE_EXTENSION14400Late quorum extension (~2 days)
NODE_UNLOCK_PERIOD14 daysNodeRegistry withdrawal delay
APP_UNLOCK_PERIOD14 daysAppRegistry withdrawal delay
TIMELOCK_DELAY172800Seconds before execution (2 days)

Treasury

VariableDefaultDescription
FOUNDATION_ADDRESSTreasury owner
TREASURY_NAME"Treasury"Human-readable label

Faucet (Sepolia only)

VariableDefaultDescription
TOKEN_ADDRESSDeployed YellowToken address
DRIP_AMOUNT1000 YELLOWAmount per drip
DRIP_COOLDOWN86400 (1 day)Seconds between drips

Running

Sepolia

./script/deploy-token.sh
./script/deploy-faucet.sh

Mainnet

Set NETWORK="mainnet" in .env, then:

./script/deploy-token.sh

For registry and treasury, run forge directly:

forge script script/DeployRegistry.s.sol --rpc-url $RPC --broadcast --verify
forge script script/DeployTreasury.s.sol --rpc-url $RPC --broadcast --verify

Post-Deployment

After deploying the registry + governance stack, the script automatically:

  1. Grants ADJUDICATOR_ROLE to the specified adjudicator
  2. Transfers AppRegistry DEFAULT_ADMIN_ROLE to the TimelockController
  3. Renounces the deployer's admin roles on both AppRegistry and TimelockController

No manual role setup is needed.

Updating the SDK

After deploying new contracts, addresses are extracted automatically from the Forge broadcast artifacts:

make sdk-build   # extracts ABIs + addresses, builds SDK
make docs # regenerates docs (including addresses page)

Then publish a new SDK version:

make release v=1.1.0
git push origin master --tags
cd sdk && npm publish