File tree Expand file tree Collapse file tree 3 files changed +45
-0
lines changed Expand file tree Collapse file tree 3 files changed +45
-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
+ Tested with:
3
+
4
+ * hardhat: 2.19.1
5
+ * @openzeppelin/hardhat-upgrades : 1.28.0
6
+ * @nomicfoundation/hardhat-verify : 2.0.1
7
+
8
+ ## Summary
9
+
10
+ ### Setup
11
+
12
+ git remote update
13
+ git checkout <branch >
14
+
15
+ export CHAIN_API_URL=<...>
16
+ export CONTRACT_OWNER_ACCOUNT_PRIVATE_KEY=<...>
17
+ export KEEP_CONTRACT_OWNER_ACCOUNT_PRIVATE_KEY=<...>
18
+ export ETHERSCAN_API_KEY=<...>
19
+
20
+ ### Validate and deploy implementation contract
21
+
22
+ yarn hardhat deploy --tags ValidateUpgradeTokenStaking --network mainnet
23
+ yarn hardhat deploy --tags PrepareUpgradeTokenStaking --network mainnet
24
+
25
+ This will modify this OZ manifest file:
26
+ .openzeppelin/mainnet.json
27
+
28
+ ### Post-deployment stuff
29
+
30
+ unset CONTRACT_OWNER_ACCOUNT_PRIVATE_KEY
31
+ unset KEEP_CONTRACT_OWNER_ACCOUNT_PRIVATE_KEY
32
+
33
+ cp TokenStaking_implementation_0x<IMPLEMENTATION_ADDRESS>.json deployments/mainnet/TokenStaking.json
34
+
35
+ Edit deployments/mainnet/TokenStaking.json to keep proxy address instead of new implementation address
36
+
37
+ ### Contract verification
38
+
39
+ Verify implementation contract using @nomicfoundation/hardhat-verify :
40
+
41
+ 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