Deployment
Prerequisites
- Foundry
- An
.envfile (see.env.example)
Scripts
| Script | Wrapper | Purpose |
|---|---|---|
DeployToken.s.sol | deploy-token.sh | Deploy YellowToken |
DeployFaucet.s.sol | deploy-faucet.sh | Deploy Faucet (testnet only) |
DeployTreasury.s.sol | — | Deploy Treasury |
DeployRegistry.s.sol | — | Deploy registries + governance |
Deployment Order
- YellowToken — deploy first, get the token address
- Registry + Governance — needs token address; deploys NodeRegistry, AppRegistry, TimelockController, YellowGovernor in one script
- Treasury — independent; can be owned by Foundation or transferred to TimelockController
Configuration
cp .env.example .env
Token
| Variable | Description |
|---|---|
FOUNDATION_ADDRESS | Receives the initial 10B YELLOW supply |
Registry + Governance
| Variable | Default | Description |
|---|---|---|
TOKEN_ADDRESS | — | Deployed YellowToken address |
ADJUDICATOR_ADDRESS | — | Initial adjudicator for AppRegistry |
PROPOSAL_GUARDIAN | — | Foundation multisig for emergency cancel |
VOTING_DELAY | 7200 | Blocks before voting starts (~1 day) |
VOTING_PERIOD | 50400 | Blocks vote stays open (~1 week) |
PROPOSAL_THRESHOLD | 10M YELLOW | Min voting power to propose |
QUORUM_NUMERATOR | 4 | Quorum as % of locked supply |
QUORUM_FLOOR | 100M YELLOW | Minimum absolute quorum |
VOTE_EXTENSION | 14400 | Late quorum extension (~2 days) |
NODE_UNLOCK_PERIOD | 14 days | NodeRegistry withdrawal delay |
APP_UNLOCK_PERIOD | 14 days | AppRegistry withdrawal delay |
TIMELOCK_DELAY | 172800 | Seconds before execution (2 days) |
Treasury
| Variable | Default | Description |
|---|---|---|
FOUNDATION_ADDRESS | — | Treasury owner |
TREASURY_NAME | "Treasury" | Human-readable label |
Faucet (Sepolia only)
| Variable | Default | Description |
|---|---|---|
TOKEN_ADDRESS | — | Deployed YellowToken address |
DRIP_AMOUNT | 1000 YELLOW | Amount per drip |
DRIP_COOLDOWN | 86400 (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:
- Grants
ADJUDICATOR_ROLEto the specified adjudicator - Transfers AppRegistry
DEFAULT_ADMIN_ROLEto the TimelockController - 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