Deployment guide - percent-finance/percent-dev GitHub Wiki

Overview

To deploy Percent, we need to:

  1. Deploy PCT token contract
  2. Deploy oracle proxy contract
  3. Deploy Unitroller (Comptroller's storage)
  4. Deploy Comptroller (Comptroller's implementation)
  5. Config Unitroller and Comptroller
  6. Deploy pTokens

Deploy PCT token contract

Deploy oracle proxy contract

Deploy Unitroller (Comptroller's storage)

Deploy Comptroller (Comptroller's implementation)

Note: The PCT token address is hard coded in the source code (at the bottom). If you have a new PCT token address (for example when you've just deployed a new PCT token contract on testnet), you must modify the code before deploying.

  • Compiler Version: v0.5.16+commit.9c3226ce
  • Optimization Enabled: Yes with 200 runs
  • Constructor: Empty

Config Unitroller and Comptroller

  1. Unitroller: Call _setPendingImplementation(<Comptroller's address>)
  2. Comptroller: Call _become(<Unitroller's address>)

Note: The following functions are proxy functions (defined in comptroller's implementation), you can call them even they are not in Unitroller's source code.

  1. Unitroller: Call _setPriceOracle(<ChainlinkPriceOracleProxy's address>)
  2. Unitroller: Call _setCloseFactor(500000000000000000) (set close factor to 50%)
  3. Unitroller: Call _setMaxAssets(20) (set max assets to 20)
  4. Unitroller: Call _setLiquidationIncentive(1080000000000000000) (set liquidation incentive to 108%)

Deploy pTokens