Skip to content

Latest commit

 

History

History
162 lines (98 loc) · 6.72 KB

File metadata and controls

162 lines (98 loc) · 6.72 KB

curve-dao-contracts/scripts/deployment

Deployment scripts for the Curve DAO.

Dependencies

Process Overview

1. Initial Setup

deployment_config.py holds configurable / sensitive values related to the deployment. Before starting, you must set the following variables:

  • Modify the get_live_admin function to return the primary admin Account object and four funding admin accounts. See the Brownie account management documentation for information on how to unlock local accounts.
  • Set vesting information in STANDARD_ESCROWS and FACTORY_ESCROWS. The structure of each variable is outlined in the comments.
  • Confirm that LP_VESTING_JSON points to the JSON which defines the percentages each historic LP will receive.

2. Deploying the Curve DAO

  1. If you haven't already, install Brownie:

    pip install eth-brownie
  2. Verify deploy_dao by testing in on a forked mainnet:

    brownie run deploy_dao development --network mainnet-fork
  3. Run the first stage of the deploy_dao script:

    Live deployment this is split into two calls. The first action deploys only ERC20CRV and VotingEscrow:

    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.

  4. 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.

3. Deploying the Aragon DAO

  1. If you haven't already, install the Aragon CLI:

    npm install --global @aragon/cli

Aragon: Custom Deploy

Deploy Aragon DAO

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

4. Transferring Ownership of Curve DAO to Aragon

  1. Verify transfer_dao_ownership by testing it on a forked mainnet:

    brownie run transfer_dao_ownership development --network mainnet-fork
    
  2. Run the transfer_dao_ownership script:

    If you haven't yet, modify deployment_config so that ARAGON_AGENT points to the Aragon Ownership Agent deployment address. Then:

    brownie run transfer_dao_ownership live --network mainnet

    This transfers the ownership of GaugeController, PoolProxy, VotingEscrow and ERC20CRV from the main admin account to the Aragon Ownership Agent.

5. Distributing Vested Tokens

Vesting distribution is split between historic liquidity providers and other accounts (shareholders, team, etc).

  1. Configure deployment_config for this stage:

    • Set the funding admins within the get_live_admin function. 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_ESCROWS and FACTORY_ESCROWS. The structure is outlined within the comments in the config file.
  2. Verify vest_lp_tokens by testing it locally:

    brownie run vest_lp_tokens development
  3. Run the vest_lp_tokens script:

    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.

  4. Verify vest_other_tokens by testing it locally:

    brownie run vest_other_tokens development
  5. Run the vest_other_tokens script:

    brownie run vest_other_tokens live --network mainnet
  6. Transfer reserve vesting escrow admin to Aragon Ownership Agent

6. Transferring Ownership of Curve Pools to Aragon

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.

  1. Verify transfer_pool_ownership by 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.

  2. Run the transfer_pool_ownership script 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
  3. Three days later, run transfer_pool_ownership again to apply the transfer:

    brownie run transfer_pool_ownership live --network mainnet

Subgraph setup for UI

Deploy connect-thegraph-voting

Deploy votingescrow-subgraph