1
1
import "hardhat-deploy" ;
2
2
import hre from "hardhat" ;
3
3
import { L2_ADDRESS_MAP } from "./consts" ;
4
- import { getContractFactory } from "../utils" ;
4
+ import { deployNewProxy } from "../utils" ;
5
5
6
6
const func = async function ( ) {
7
- const { upgrades, companionNetworks, run, getChainId, getNamedAccounts } = hre ;
8
-
9
- // Grab L1 addresses:
10
- const { deployments : l1Deployments } = companionNetworks . l1 ;
11
- const hubPool = await l1Deployments . get ( "HubPool" ) ;
12
- console . log ( `Using l1 hub pool @ ${ hubPool . address } ` ) ;
13
-
14
- const chainId = parseInt ( await getChainId ( ) ) ;
15
- const { deployer } = await getNamedAccounts ( ) ;
7
+ const hubPool = await hre . companionNetworks . l1 . deployments . get ( "HubPool" ) ;
8
+ const chainId = await hre . getChainId ( ) ;
9
+ console . log ( `Using L1 (chainId ${ chainId } ) hub pool @ ${ hubPool . address } ` ) ;
16
10
17
11
// Initialize deposit counter to very high number of deposits to avoid duplicate deposit ID's
18
12
// with deprecated spoke pool.
@@ -24,25 +18,7 @@ const func = async function () {
24
18
hubPool . address ,
25
19
L2_ADDRESS_MAP [ chainId ] . l2Weth ,
26
20
] ;
27
- const spokePool = await upgrades . deployProxy (
28
- await getContractFactory ( "Arbitrum_SpokePool" , deployer ) ,
29
- constructorArgs ,
30
- {
31
- kind : "uups" ,
32
- }
33
- ) ;
34
- const instance = await spokePool . deployed ( ) ;
35
- console . log ( `SpokePool deployed @ ${ instance . address } ` ) ;
36
- const implementationAddress = await upgrades . erc1967 . getImplementationAddress ( instance . address ) ;
37
- console . log ( `Implementation deployed @ ${ implementationAddress } ` ) ;
38
-
39
- // hardhat-upgrades overrides the `verify` task that ships with `hardhat` so that if the address passed
40
- // is a proxy, hardhat will first verify the implementation and then the proxy and also link the proxy
41
- // to the implementation's ABI on etherscan.
42
- // https://docs.openzeppelin.com/upgrades-plugins/1.x/api-hardhat-upgrades#verify
43
- await run ( "verify:verify" , {
44
- address : instance . address ,
45
- } ) ;
21
+ await deployNewProxy ( "Arbitrum_SpokePool" , constructorArgs ) ;
46
22
} ;
47
23
module . exports = func ;
48
24
func . tags = [ "ArbitrumSpokePool" , "arbitrum" ] ;
0 commit comments