@@ -26,30 +26,40 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
2626 // Construct this spokepool with a:
2727 // * A WETH address of the WETH address
2828 // * A depositQuoteTimeBuffer of 1 hour
29- // * A fillDeadlineBuffer of 9 hours
30- const constructorArgs = [ L2_ADDRESS_MAP [ spokeChainId ] . l2Weth , 3600 , 32400 ] ;
31-
32- const proxy = await zkUpgrades . deployProxy ( deployer . zkWallet , artifact , initArgs , {
33- initializer : "initialize" ,
34- kind : "uups" ,
35- constructorArgs,
36- unsafeAllow : [ "delegatecall" ] , // Remove after upgrading openzeppelin-contracts-upgradeable post v4.9.3.
37- } ) ;
38- console . log ( `Deployment transaction hash: ${ proxy . deployTransaction . hash } .` ) ;
39- await proxy . deployed ( ) ;
40- console . log ( `${ contractName } deployed to chain ID ${ spokeChainId } @ ${ proxy . address } .` ) ;
29+ // * A fillDeadlineBuffer of 8 hours
30+ const constructorArgs = [ L2_ADDRESS_MAP [ spokeChainId ] . l2Weth , 3600 , 28800 ] ;
31+
32+ let newAddress ;
33+ // On production, we'll rarely want to deploy a new proxy contract so we'll default to deploying a new implementation
34+ // contract.
35+ if ( spokeChainId === 324 ) {
36+ const _deployment = await deployer . deploy ( artifact , constructorArgs ) ;
37+ newAddress = _deployment . address ;
38+ console . log ( `New ${ contractName } implementation deployed @ ${ newAddress } ` ) ;
39+ } else {
40+ const proxy = await zkUpgrades . deployProxy ( deployer . zkWallet , artifact , initArgs , {
41+ initializer : "initialize" ,
42+ kind : "uups" ,
43+ constructorArgs,
44+ unsafeAllow : [ "delegatecall" ] , // Remove after upgrading openzeppelin-contracts-upgradeable post v4.9.3.
45+ } ) ;
46+ console . log ( `Deployment transaction hash: ${ proxy . deployTransaction . hash } .` ) ;
47+ await proxy . deployed ( ) ;
48+ console . log ( `${ contractName } deployed to chain ID ${ spokeChainId } @ ${ proxy . address } .` ) ;
49+ newAddress = proxy . address ;
50+ }
4151
4252 // Save the deployment manually because OZ's hardhat-upgrades packages bypasses hardhat-deploy.
4353 // See also: https://stackoverflow.com/questions/74870472
4454 const extendedArtifact = await deployments . getExtendedArtifact ( contractName ) ;
4555 const deployment : DeploymentSubmission = {
46- address : proxy . address ,
56+ address : newAddress ,
4757 ...extendedArtifact ,
4858 } ;
4959 await deployments . save ( contractName , deployment ) ;
5060
5161 // Verify the proxy + implementation contract.
52- await hre . run ( "verify:verify" , { address : proxy . address } ) ;
62+ await hre . run ( "verify:verify" , { address : newAddress , constructorArguments : constructorArgs } ) ;
5363} ;
5464
5565module . exports = func ;
0 commit comments