-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add instructions to upgrade TokenStaking
Ideally, this should be automated, but this is a start
- Loading branch information
Showing
3 changed files
with
45 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# Instructions to upgrade TokenStaking | ||
Tested with: | ||
|
||
* hardhat: 2.19.1 | ||
* @openzeppelin/hardhat-upgrades: 1.28.0 | ||
* @nomicfoundation/hardhat-verify: 2.0.1 | ||
|
||
## Summary | ||
|
||
### Setup | ||
|
||
git remote update | ||
git checkout <branch> | ||
|
||
export CHAIN_API_URL=<...> | ||
export CONTRACT_OWNER_ACCOUNT_PRIVATE_KEY=<...> | ||
export KEEP_CONTRACT_OWNER_ACCOUNT_PRIVATE_KEY=<...> | ||
export ETHERSCAN_API_KEY=<...> | ||
|
||
### Validate and deploy implementation contract | ||
|
||
yarn hardhat deploy --tags ValidateUpgradeTokenStaking --network mainnet | ||
yarn hardhat deploy --tags PrepareUpgradeTokenStaking --network mainnet | ||
|
||
This will modify this OZ manifest file: | ||
.openzeppelin/mainnet.json | ||
|
||
### Post-deployment stuff | ||
|
||
unset CONTRACT_OWNER_ACCOUNT_PRIVATE_KEY | ||
unset KEEP_CONTRACT_OWNER_ACCOUNT_PRIVATE_KEY | ||
|
||
cp TokenStaking_implementation_0x<IMPLEMENTATION_ADDRESS>.json deployments/mainnet/TokenStaking.json | ||
|
||
Edit deployments/mainnet/TokenStaking.json to keep proxy address instead of new implementation address | ||
|
||
### Contract verification | ||
|
||
Verify implementation contract using @nomicfoundation/hardhat-verify: | ||
|
||
yarn hardhat verify --network mainnet <CONTRACT_ADDRESS> <CONSTRUCTOR_PARAM_1> <CONSTRUCTOR_PARAM_2> ... |