Skip to content

Latest commit

 

History

History
68 lines (50 loc) · 2.26 KB

v2.1_upgrade.md

File metadata and controls

68 lines (50 loc) · 2.26 KB

V2.1 Upgrade

Prerequisites

  1. Truffle Deployer Key ("Deployer Key")
  2. Proxy Admin Key ("Admin Key")

Steps

  1. Ensure that the config.js file in the project root folder is configured with the correct values. The environment variables PROXY_ADMIN_ADDRESS, PROXY_CONTRACT_ADDRESS, and LOST_AND_FOUND_ADDRESS must be defined.

  2. Set the NETWORK variable to the network that you will like to deploy to in your terminal. Ensure that the NETWORK that the contracts are to be deployed to are defined in ./truffle-config.js.

    $ NETWORK=<mainnet|ropsten>;
  3. Look for the deploy_v2_1 and deploy_v2_1_upgrader scripts in ./migrations/. Set the MIGRATION_START and MIGRATION_END variables based off the migration numbers of these scripts.

    $ MIGRATION_START=<first_migration_number>
    $ MIGRATION_END=<last_migration_number>
  4. Run Truffle migrations using the Deployer Key, and get the address of the newly deployed V2_1Upgrader contract.

    $ yarn migrate --network ${NETWORK} --f ${MIGRATION_START} --to ${MIGRATION_END}
    ...
    ...
    Dry-run successful. Do you want to proceed with real deployment?  >> (y/n): y
    ...
    ...
    >>>>>>> Deployed V2_1Upgrader at 0x12345678 <<<<<<<
  5. Verify that the upgrader contract is deployed correctly. Verify that the values returned by proxy(), implementation(), newProxyAdmin(), and lostAndFound() on the V2_1Upgrader contract are correct.

  6. Using the Admin Key, transfer the proxy admin role to the V2_1Upgrader contract address by calling changeAdmin(address) method on the FiatTokenProxy contract.

  7. Send 0.20 FiatToken (eg USDC) to the V2_1Upgrader contract address. (200,000 tokens)

  8. Using the Deployer Key, call upgrade() (0xd55ec697) method on the V2_1Upgrader.

IF THE UPGRADE TRANSACTION SUCCEEDS

  • Verify that the proxy admin role is transferred back to the Admin Key.
  • No further action needed.

IF THE UPGRADE TRANSACTION FAILS

  • If the transaction fails, any state change that happened during the upgrade function call will be reverted.
  • Call abortUpgrade() (0xd8f6a8f6) method on the V2_1Upgrader contract to tear it down.