File tree 2 files changed +29
-7
lines changed
2 files changed +29
-7
lines changed Original file line number Diff line number Diff line change @@ -31,13 +31,6 @@ const func = async function () {
31
31
const implementationAddress = await upgrades . erc1967 . getImplementationAddress ( instance . address ) ;
32
32
console . log ( `Implementation deployed @ ${ implementationAddress } ` ) ;
33
33
34
- // Deploy new implementation and validate that it can be used in upgrade.
35
- const newImplementation = await upgrades . prepareUpgrade (
36
- instance . address ,
37
- await getContractFactory ( "Arbitrum_SpokePool" )
38
- ) ;
39
- console . log ( `Can upgrade to new implementation @ ${ newImplementation } ` ) ;
40
-
41
34
// hardhat-upgrades overrides the `verify` task that ships with `hardhat` so that if the address passed
42
35
// is a proxy, hardhat will first verify the implementation and then the proxy and also link the proxy
43
36
// to the implementation's ABI on etherscan.
Original file line number Diff line number Diff line change
1
+ import "hardhat-deploy" ;
2
+ import hre from "hardhat" ;
3
+ import { getContractFactory } from "../utils" ;
4
+ import * as deployments from "../deployments/deployments.json" ;
5
+
6
+ const func = async function ( ) {
7
+ const { upgrades, run, getChainId } = hre ;
8
+
9
+ const chainId = await getChainId ( ) ;
10
+ const spokePool = await deployments [ chainId ] . SpokePool ;
11
+ console . log ( `Using spoke pool @ ${ spokePool . address } ` ) ;
12
+
13
+ // Deploy new implementation and validate that it can be used in upgrade, without actually upgrading it.
14
+ const newImplementation = await upgrades . prepareUpgrade (
15
+ spokePool . address ,
16
+ await getContractFactory ( "Arbitrum_SpokePool" )
17
+ ) ;
18
+ console . log ( `Can upgrade to new implementation @ ${ newImplementation } ` ) ;
19
+
20
+ // hardhat-upgrades overrides the `verify` task that ships with `hardhat` so that if the address passed
21
+ // is a proxy, hardhat will first verify the implementation and then the proxy and also link the proxy
22
+ // to the implementation's ABI on etherscan.
23
+ // https://docs.openzeppelin.com/upgrades-plugins/1.x/api-hardhat-upgrades#verify
24
+ await run ( "verify:verify" , {
25
+ address : newImplementation ,
26
+ } ) ;
27
+ } ;
28
+ module . exports = func ;
29
+ func . tags = [ "UpgradeSpokePool" ] ;
You can’t perform that action at this time.
0 commit comments