Skip to content

Latest commit

 

History

History
68 lines (50 loc) · 2.21 KB

v2_upgrade.md

File metadata and controls

68 lines (50 loc) · 2.21 KB

V2 Upgrade

Prerequisites

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

Steps

  1. Ensure config.js file in the project root folder is configured correctly with correct values.

  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 and deploy_v2_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 deployedV2Upgradercontract. The address is highlighted (>>><<<) to prevent accidental copying-and-pasting of an incorrect address.

    $ 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 V2Upgrader at 0x12345678 <<<<<<<
  5. Verify that the upgrader contract is deployed correctly. Verify that the values returned by proxy(), implementation(), newProxyAdmin(), and newName() on the V2Upgrader contract are correct.

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

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

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

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 V2Upgrader contract to tear it down.