11import "hardhat-deploy" ;
22import hre from "hardhat" ;
33import { L2_ADDRESS_MAP } from "./consts" ;
4- import { getContractFactory } from "../utils" ;
4+ import { deployNewProxy } from "../utils" ;
55
66const 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 } ` ) ;
1610
1711 // Initialize deposit counter to very high number of deposits to avoid duplicate deposit ID's
1812 // with deprecated spoke pool.
@@ -24,25 +18,7 @@ const func = async function () {
2418 hubPool . address ,
2519 L2_ADDRESS_MAP [ chainId ] . l2Weth ,
2620 ] ;
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 ) ;
4622} ;
4723module . exports = func ;
4824func . tags = [ "ArbitrumSpokePool" , "arbitrum" ] ;
0 commit comments