File tree Expand file tree Collapse file tree 3 files changed +46
-0
lines changed Expand file tree Collapse file tree 3 files changed +46
-0
lines changed Original file line number Diff line number Diff line change
1
+ // See deploy/TokenStaking_upgrade_instructions.md
2
+
1
3
import { HardhatRuntimeEnvironment } from "hardhat/types"
2
4
import { DeployFunction } from "hardhat-deploy/types"
3
5
Original file line number Diff line number Diff line change
1
+ // See deploy/TokenStaking_upgrade_instructions.md
2
+
1
3
import { HardhatRuntimeEnvironment } from "hardhat/types"
2
4
import { DeployFunction } from "hardhat-deploy/types"
3
5
Original file line number Diff line number Diff line change
1
+ # Instructions to upgrade TokenStaking
2
+
3
+ Tested with:
4
+
5
+ - hardhat: 2.19.1
6
+ - @openzeppelin/hardhat-upgrades : 1.28.0
7
+ - @nomicfoundation/hardhat-verify : 2.0.1
8
+
9
+ ## Summary
10
+
11
+ ### Setup
12
+
13
+ git remote update
14
+ git checkout <branch >
15
+
16
+ export CHAIN_API_URL=<...>
17
+ export CONTRACT_OWNER_ACCOUNT_PRIVATE_KEY=<...>
18
+ export KEEP_CONTRACT_OWNER_ACCOUNT_PRIVATE_KEY=<...>
19
+ export ETHERSCAN_API_KEY=<...>
20
+
21
+ ### Validate and deploy implementation contract
22
+
23
+ yarn hardhat deploy --tags ValidateUpgradeTokenStaking --network mainnet
24
+ yarn hardhat deploy --tags PrepareUpgradeTokenStaking --network mainnet
25
+
26
+ This will modify this OZ manifest file:
27
+ .openzeppelin/mainnet.json
28
+
29
+ ### Post-deployment stuff
30
+
31
+ unset CONTRACT_OWNER_ACCOUNT_PRIVATE_KEY
32
+ unset KEEP_CONTRACT_OWNER_ACCOUNT_PRIVATE_KEY
33
+
34
+ cp TokenStaking_implementation_0x<IMPLEMENTATION_ADDRESS>.json deployments/mainnet/TokenStaking.json
35
+
36
+ Edit deployments/mainnet/TokenStaking.json to keep proxy address instead of new implementation address
37
+
38
+ ### Contract verification
39
+
40
+ Verify implementation contract using @nomicfoundation/hardhat-verify :
41
+
42
+ yarn hardhat verify --network mainnet <CONTRACT_ADDRESS> <CONSTRUCTOR_PARAM_1> <CONSTRUCTOR_PARAM_2> ...
You can’t perform that action at this time.
0 commit comments