- Truffle Deployer Key ("Deployer Key")
- Proxy Admin Key ("Admin Key")
-
Ensure that the
config.js
file in the project root folder is configured with the correct values. The environment variablesPROXY_ADMIN_ADDRESS
,PROXY_CONTRACT_ADDRESS
, andLOST_AND_FOUND_ADDRESS
must be defined. -
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_1
anddeploy_v2_1_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
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 <<<<<<<
-
Verify that the upgrader contract is deployed correctly. Verify that the values returned by
proxy()
,implementation()
,newProxyAdmin()
, andlostAndFound()
on theV2_1Upgrader
contract are correct. -
Using the Admin Key, transfer the proxy admin role to the
V2_1Upgrader
contract address by callingchangeAdmin(address)
method on theFiatTokenProxy
contract. -
Send 0.20 FiatToken (eg USDC) to the
V2_1Upgrader
contract 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
upgrade
function call will be reverted. - Call
abortUpgrade()
(0xd8f6a8f6
) method on theV2_1Upgrader
contract to tear it down.