- Truffle Deployer Key ("Deployer Key")
- Proxy Admin Key ("Admin Key")
-
Ensure that the
config.jsfile in the project root folder is configured with the correct values. The environment variablesPROXY_ADMIN_ADDRESS,PROXY_CONTRACT_ADDRESS, andLOST_AND_FOUND_ADDRESSmust be defined. -
Set the
NETWORKvariable to the network that you will like to deploy to in your terminal. Ensure that theNETWORKthat the contracts are to be deployed to are defined in./truffle-config.js.$ NETWORK=<mainnet|ropsten>;
-
Look for the
deploy_v2_1anddeploy_v2_1_upgraderscripts in./migrations/. Set theMIGRATION_STARTandMIGRATION_ENDvariables based off the migration numbers of these scripts.$ MIGRATION_START=<first_migration_number> $ MIGRATION_END=<last_migration_number>
-
Run Truffle migrations using the Deployer Key, and get the address of the newly deployed
V2_1Upgradercontract.$ 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 <<<<<<<
-
Verify that the upgrader contract is deployed correctly. Verify that the values returned by
proxy(),implementation(),newProxyAdmin(), andlostAndFound()on theV2_1Upgradercontract are correct. -
Using the Admin Key, transfer the proxy admin role to the
V2_1Upgradercontract address by callingchangeAdmin(address)method on theFiatTokenProxycontract. -
Send 0.20 FiatToken (eg USDC) to the
V2_1Upgradercontract address. (200,000 tokens) -
Using the Deployer Key, call
upgrade()(0xd55ec697) method on theV2_1Upgrader.
- Verify that the proxy admin role is transferred back to the Admin Key.
- No further action needed.
- If the transaction fails, any state change that happened during the
upgradefunction call will be reverted. - Call
abortUpgrade()(0xd8f6a8f6) method on theV2_1Upgradercontract to tear it down.