- Truffle Deployer Key ("Deployer Key")
- Proxy Admin Key ("Admin Key")
-
Ensure
config.js
file in the project root folder is configured correctly with correct values. -
Set the
NETWORK
variable to the network that you will like to deploy to in your terminal. Ensure that theNETWORK
that the contracts are to be deployed to are defined in./truffle-config.js
.$ NETWORK=<mainnet|ropsten>;
-
Look for the
deploy_v2
anddeploy_v2_upgrader
scripts in./migrations/
. Set theMIGRATION_START
andMIGRATION_END
variables 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
V2Upgrader
contract. 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 <<<<<<<
-
Verify that the upgrader contract is deployed correctly. Verify that the values returned by
proxy()
,implementation()
,newProxyAdmin()
, andnewName()
on theV2Upgrader
contract are correct. -
Using the Admin Key, transfer the proxy admin role to the
V2Upgrader
contract address by callingchangeAdmin(address)
method on theFiatTokenProxy
contract. -
Send 0.20 FiatToken (eg USDC) to the
V2Upgrader
contract address. (200,000 tokens) -
Using the Deployer Key, call
upgrade()
(0xd55ec697
) method on theV2Upgrader
.
- 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
upgrade
function call will be reverted. - Call
abortUpgrade()
(0xd8f6a8f6
) method on theV2Upgrader
contract to tear it down.