Deployment scripts for the Curve DAO.
deployment_config.py holds configurable / sensitive values related to the deployment. Before starting, you must set the following variables:
- Modify the
get_live_adminfunction to return the primary adminAccountobject and four funding admin accounts. See the Brownie account management documentation for information on how to unlock local accounts. - Set vesting information in
STANDARD_ESCROWSandFACTORY_ESCROWS. The structure of each variable is outlined in the comments. - Confirm that
LP_VESTING_JSONpoints to the JSON which defines the percentages each historic LP will receive.
-
If you haven't already, install Brownie:
pip install eth-brownie
-
Verify
deploy_daoby testing in on a forked mainnet:brownie run deploy_dao development --network mainnet-fork
-
Run the first stage of the
deploy_daoscript:Live deployment this is split into two calls. The first action deploys only
ERC20CRVandVotingEscrow:brownie run deploy_dao live_part_one --network mainnet
With these contracts deployed, the Aragon DAO setup can begin while the rest of Curve DAO is deployed.
-
Run the second stage of
deploy_dao:brownie run deploy_dao live_part_two --network mainnet
This deploys and links all of the core Curve DAO contracts. A JSON is generated containing the address of each deployed contract. DO NOT MOVE OR DELETE THIS FILE. It is required in later deployment stages.
-
If you haven't already, install the Aragon CLI:
npm install --global @aragon/cli
Aragon: Custom Deploy
Deploy the Curve Aragon Voting App
Read instructions in Deploy Aragon DAO README
Once the DAO is successfully deployed, modify deployment_config so that ARAGON_AGENT points to the Aragon Ownership Agent deployment.
Deploy subgraphs for Curve Voting App and VotingEscrow
-
Verify
transfer_dao_ownershipby testing it on a forked mainnet:brownie run transfer_dao_ownership development --network mainnet-fork -
Run the
transfer_dao_ownershipscript:If you haven't yet, modify
deployment_configso thatARAGON_AGENTpoints to the Aragon Ownership Agent deployment address. Then:brownie run transfer_dao_ownership live --network mainnet
This transfers the ownership of
GaugeController,PoolProxy,VotingEscrowandERC20CRVfrom the main admin account to the Aragon Ownership Agent.
Vesting distribution is split between historic liquidity providers and other accounts (shareholders, team, etc).
-
Configure
deployment_configfor this stage:- Set the funding admins within the
get_live_adminfunction. Funding admins are temporary admin accounts that may only be used to create new vestings. They are used to distribute the workload and complete this job more quickly - the script makes over 100 transactions! - Add info about vested accounts to
STANDARD_ESCROWSandFACTORY_ESCROWS. The structure is outlined within the comments in the config file.
- Set the funding admins within the
-
Verify
vest_lp_tokensby testing it locally:brownie run vest_lp_tokens development
-
Run the
vest_lp_tokensscript:Confirm that the admin and funding accounts have sufficient ether to pay for the required gas costs. Then:
brownie run vest_lp_tokens live --network mainnet
This script generates a JSON logging file in case it fails during execution, so you know exactly which transactions were completed.
-
Verify
vest_other_tokensby testing it locally:brownie run vest_other_tokens development
-
Run the
vest_other_tokensscript:brownie run vest_other_tokens live --network mainnet
-
Transfer reserve vesting escrow admin to Aragon Ownership Agent
Transferring ownership of pools requires a three day delay between the first call and the second. Calls must be made from the pool owner address.
-
Verify
transfer_pool_ownershipby testing it against a forked mainnet:Ganache allows us to broadcast from the pool owner without unlocking the account - no setup is required here.
brownie run transfer_pool_ownership development --network mainnet-fork
This test verifies both the initial commit and the final transfer.
-
Run the
transfer_pool_ownershipscript to initiate the ownership transfer:Before running this script, make sure the pool owner account has been unlocked.
brownie run transfer_pool_ownership live --network mainnet
-
Three days later, run
transfer_pool_ownershipagain to apply the transfer:brownie run transfer_pool_ownership live --network mainnet
Subgraph setup for UI
Deploy connect-thegraph-voting
Deploy votingescrow-subgraph