diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index a4751b6f9..d14e2933a 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -79,7 +79,7 @@ jobs: run: node evm/deploy-contract.js -c Create3Deployer -m create2 -y - name: Deploy AxelarGateway - run: node evm/deploy-gateway-v6.2.x.js -m create3 -s "AxelarGateway v6.2" -g 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 -m 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 --keyID 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 -y + run: node evm/deploy-gateway-v6.2.x.js -m create3 -s "AxelarGateway v6.2" --governance 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 --mintLimiter 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 --keyID 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 -y - name: Call Method on Gateway run: node evm/gateway.js --action callContract --destinationChain test2 -y diff --git a/axelar-chains-config/info/mainnet.json b/axelar-chains-config/info/mainnet.json index c4e14e50a..aa624841f 100644 --- a/axelar-chains-config/info/mainnet.json +++ b/axelar-chains-config/info/mainnet.json @@ -36,7 +36,11 @@ "deployer": "0xd55cd98cdE61c3CcE1286F9aF50cDbF16f5dba5b" }, "ConstAddressDeployer": { - "address": "0x98B2920D53612483F91F12Ed7754E51b4A77919e" + "address": "0x98B2920D53612483F91F12Ed7754E51b4A77919e", + "deployer": "0xE86375704CDb8491a5Ed82D90DceCE02Ee0ac25F", + "deploymentMethod": "create", + "codehash": "0x8fda47a596dfba923270da84e0c32a2d0312f1c03389f83e16f2b5a35ed37fbe", + "predeployCodehash": "0x8fda47a596dfba923270da84e0c32a2d0312f1c03389f83e16f2b5a35ed37fbe" }, "Create3Deployer": { "address": "0x6513Aedb4D1593BA12e50644401D976aebDc90d8", diff --git a/axelar-chains-config/info/stagenet.json b/axelar-chains-config/info/stagenet.json index b28ea40e5..d901d5aa2 100644 --- a/axelar-chains-config/info/stagenet.json +++ b/axelar-chains-config/info/stagenet.json @@ -33,7 +33,11 @@ "refundIssuer": "0x2517bA7a3E2cef54c1CD8618e7B0B661A7623817" }, "ConstAddressDeployer": { - "address": "0x98B2920D53612483F91F12Ed7754E51b4A77919e" + "address": "0x98B2920D53612483F91F12Ed7754E51b4A77919e", + "deployer": "0xE86375704CDb8491a5Ed82D90DceCE02Ee0ac25F", + "deploymentMethod": "create", + "codehash": "0x8fda47a596dfba923270da84e0c32a2d0312f1c03389f83e16f2b5a35ed37fbe", + "predeployCodehash": "0x8fda47a596dfba923270da84e0c32a2d0312f1c03389f83e16f2b5a35ed37fbe" }, "Create3Deployer": { "salt": "Create3Deployer", @@ -647,7 +651,8 @@ } }, "explorer": { - "url": "https://explorer.evm-alpha.kava.io" + "url": "https://explorer.evm-alpha.kava.io", + "api": "" } }, "optimism": { @@ -906,6 +911,206 @@ "predeployCodehash": "0xe2de43b29f2387b6f3575a1b50d566908fc00e03a8d88ad6be74b674a70874d2", "salt": "InterchainGovernance v5.5" } + }, + "explorer": { + "url": "", + "api": "" + } + }, + "ethereum-sepolia": { + "name": "Ethereum-Sepolia", + "id": "ethereum-sepolia", + "chainId": 11155111, + "rpc": "https://1rpc.io/sepolia", + "tokenSymbol": "ETH", + "confirmations": 2, + "contracts": { + "ConstAddressDeployer": { + "address": "0x98B2920D53612483F91F12Ed7754E51b4A77919e", + "deployer": "0xE86375704CDb8491a5Ed82D90DceCE02Ee0ac25F", + "deploymentMethod": "create", + "codehash": "0x8fda47a596dfba923270da84e0c32a2d0312f1c03389f83e16f2b5a35ed37fbe", + "predeployCodehash": "0x8fda47a596dfba923270da84e0c32a2d0312f1c03389f83e16f2b5a35ed37fbe" + }, + "Create3Deployer": { + "address": "0x6513Aedb4D1593BA12e50644401D976aebDc90d8", + "deployer": "0x6f24A47Fc8AE5441Eb47EFfC3665e70e69Ac3F05", + "deploymentMethod": "create2", + "codehash": "0xf0ad66defbe082df243d4d274e626f557f97579c5c9e19f33d8093d6160808b7", + "predeployCodehash": "0x73fc31262c4bad113c79439fd231281201c7c7d45b50328bd86bccf37684bf92", + "salt": "Create3Deployer" + }, + "AxelarGateway": { + "startingKeyIDs": [ + "evm-ethereum-sepolia-genesis" + ], + "authModule": "0x68681A28772177ceEd5519A5f52Bf965c3e112E3", + "tokenDeployer": "0x42dBF20686794C1a82A95A629373ed2E8CFb5fEb", + "deployer": "0x9D97cf3AC20b73c81d8A5233d9FBe09618d4F8bd", + "address": "0x6aF9C075d8C11b9A2CD66bbA801481b3c7A96488", + "implementation": "0x21BB37D5e02Ef479E34f6806C36a506c63741cc1", + "implementationCodehash": "0xd598b518b39d1ff405642adf3da87ba9b6bbdf26b2dbcecc013beaa360ed2874", + "deploymentMethod": "create3", + "salt": "AxelarGateway v6.2" + }, + "InterchainGovernance": { + "address": "0x9D97cf3AC20b73c81d8A5233d9FBe09618d4F8bd" + }, + "Multisig": { + "address": "0x9D97cf3AC20b73c81d8A5233d9FBe09618d4F8bd" + }, + "Operators": { + "owner": "0x9D97cf3AC20b73c81d8A5233d9FBe09618d4F8bd", + "address": "0xB77A61a241a756E4817c845BEDE7e213a319b1DD", + "deployer": "0x9D97cf3AC20b73c81d8A5233d9FBe09618d4F8bd", + "deploymentMethod": "create2", + "codehash": "0xc561dc32ef670c929db9d7fbf6b5f6c074a62a30602481ba3b88912ca6d79feb", + "predeployCodehash": "0xc561dc32ef670c929db9d7fbf6b5f6c074a62a30602481ba3b88912ca6d79feb", + "salt": "Operators" + }, + "AxelarGasService": { + "collector": "0xB77A61a241a756E4817c845BEDE7e213a319b1DD", + "salt": "AxelarGasService", + "address": "0x47E840B35e0eca3E7C0577835DD78d95574873e7", + "implementation": "0x488E54121f7995feF259d15bE688C68142F9a146", + "deployer": "0x9D97cf3AC20b73c81d8A5233d9FBe09618d4F8bd" + } + }, + "explorer": { + "url": "https://sepolia.etherscan.io", + "api": "https://api-sepolia.etherscan.io/api" + }, + "gasOptions": { + "maxFeePerGas": 110000000, + "maxPriorityFeePerGas": 100000000 + } + }, + "arbitrum-sepolia": { + "name": "Arbitrum-Sepolia", + "id": "arbitrum-sepolia", + "chainId": 421614, + "rpc": "https://sepolia-rollup.arbitrum.io/rpc", + "tokenSymbol": "ETH", + "confirmations": 2, + "contracts": { + "AxelarGateway": { + "startingKeyIDs": [ + "evm-arbitrum-sepolia-genesis" + ], + "address": "0x6aF9C075d8C11b9A2CD66bbA801481b3c7A96488", + "authModule": "0x027A6E4fF748109FFB6F7BC93774e733cA75Faae", + "tokenDeployer": "0x42dBF20686794C1a82A95A629373ed2E8CFb5fEb", + "implementation": "0x21BB37D5e02Ef479E34f6806C36a506c63741cc1", + "deployer": "0x9D97cf3AC20b73c81d8A5233d9FBe09618d4F8bd", + "implementationCodehash": "0x3bc4c63fa8e285249f882b5b0b3d567a9d8c9c4b8efbb624f59ddcb074e908e2", + "deploymentMethod": "create3", + "salt": "AxelarGateway v6.2" + }, + "ConstAddressDeployer": { + "address": "0x98B2920D53612483F91F12Ed7754E51b4A77919e", + "deployer": "0xE86375704CDb8491a5Ed82D90DceCE02Ee0ac25F", + "deploymentMethod": "create", + "codehash": "0x8fda47a596dfba923270da84e0c32a2d0312f1c03389f83e16f2b5a35ed37fbe", + "predeployCodehash": "0x8fda47a596dfba923270da84e0c32a2d0312f1c03389f83e16f2b5a35ed37fbe" + }, + "Create3Deployer": { + "address": "0x6513Aedb4D1593BA12e50644401D976aebDc90d8", + "deployer": "0x6f24A47Fc8AE5441Eb47EFfC3665e70e69Ac3F05", + "deploymentMethod": "create2", + "codehash": "0xf0ad66defbe082df243d4d274e626f557f97579c5c9e19f33d8093d6160808b7", + "predeployCodehash": "0x73fc31262c4bad113c79439fd231281201c7c7d45b50328bd86bccf37684bf92", + "salt": "Create3Deployer" + }, + "InterchainGovernance": { + "address": "0x9D97cf3AC20b73c81d8A5233d9FBe09618d4F8bd" + }, + "Multisig": { + "address": "0x9D97cf3AC20b73c81d8A5233d9FBe09618d4F8bd" + }, + "Operators": { + "owner": "0x9D97cf3AC20b73c81d8A5233d9FBe09618d4F8bd", + "address": "0xB77A61a241a756E4817c845BEDE7e213a319b1DD", + "deployer": "0x9D97cf3AC20b73c81d8A5233d9FBe09618d4F8bd", + "deploymentMethod": "create2", + "codehash": "0xc561dc32ef670c929db9d7fbf6b5f6c074a62a30602481ba3b88912ca6d79feb", + "predeployCodehash": "0xc561dc32ef670c929db9d7fbf6b5f6c074a62a30602481ba3b88912ca6d79feb", + "salt": "Operators" + }, + "AxelarGasService": { + "collector": "0xB77A61a241a756E4817c845BEDE7e213a319b1DD", + "salt": "AxelarGasService", + "address": "0x47E840B35e0eca3E7C0577835DD78d95574873e7", + "implementation": "0xe0Ad88660B5B09fE9FF8bA6f1dba1A826b1C7583", + "deployer": "0x9D97cf3AC20b73c81d8A5233d9FBe09618d4F8bd" + } + }, + "explorer": { + "url": "https://sepolia.arbiscan.io", + "api": "https://api-sepolia.arbiscan.io/api" + } + }, + "centrifuge": { + "name": "Centrifuge", + "id": "centrifuge-2", + "chainId": 2090, + "rpc": "https://node-7118620155331796992.gx.onfinality.io/rpc?apikey=00538f2d-6297-44e3-8812-4b9d579524b2", + "tokenSymbol": "CFG", + "confirmations": 1, + "contracts": { + "ConstAddressDeployer": { + "address": "0x98B2920D53612483F91F12Ed7754E51b4A77919e", + "deployer": "0xE86375704CDb8491a5Ed82D90DceCE02Ee0ac25F", + "deploymentMethod": "create", + "codehash": "0x8fda47a596dfba923270da84e0c32a2d0312f1c03389f83e16f2b5a35ed37fbe", + "predeployCodehash": "0x8fda47a596dfba923270da84e0c32a2d0312f1c03389f83e16f2b5a35ed37fbe" + }, + "Create3Deployer": { + "address": "0x6513Aedb4D1593BA12e50644401D976aebDc90d8", + "deployer": "0x6f24A47Fc8AE5441Eb47EFfC3665e70e69Ac3F05", + "deploymentMethod": "create2", + "codehash": "0xf0ad66defbe082df243d4d274e626f557f97579c5c9e19f33d8093d6160808b7", + "predeployCodehash": "0x73fc31262c4bad113c79439fd231281201c7c7d45b50328bd86bccf37684bf92", + "salt": "Create3Deployer" + }, + "AxelarGateway": { + "deployer": "0x9D97cf3AC20b73c81d8A5233d9FBe09618d4F8bd", + "startingKeyIDs": [ + "evm-centrifuge-2-genesis" + ], + "address": "0x6aF9C075d8C11b9A2CD66bbA801481b3c7A96488", + "implementation": "0x21BB37D5e02Ef479E34f6806C36a506c63741cc1", + "implementationCodehash": "0x3bc4c63fa8e285249f882b5b0b3d567a9d8c9c4b8efbb624f59ddcb074e908e2", + "authModule": "0x027A6E4fF748109FFB6F7BC93774e733cA75Faae", + "tokenDeployer": "0x42dBF20686794C1a82A95A629373ed2E8CFb5fEb", + "deploymentMethod": "create3", + "salt": "AxelarGateway v6.2" + }, + "InterchainGovernance": { + "address": "0x9D97cf3AC20b73c81d8A5233d9FBe09618d4F8bd" + }, + "Multisig": { + "address": "0x9D97cf3AC20b73c81d8A5233d9FBe09618d4F8bd" + }, + "Operators": { + "owner": "0x9D97cf3AC20b73c81d8A5233d9FBe09618d4F8bd", + "address": "0xB77A61a241a756E4817c845BEDE7e213a319b1DD", + "deployer": "0x9D97cf3AC20b73c81d8A5233d9FBe09618d4F8bd", + "deploymentMethod": "create2", + "codehash": "0xc561dc32ef670c929db9d7fbf6b5f6c074a62a30602481ba3b88912ca6d79feb", + "predeployCodehash": "0xc561dc32ef670c929db9d7fbf6b5f6c074a62a30602481ba3b88912ca6d79feb", + "salt": "Operators" + }, + "AxelarGasService": { + "collector": "0xB77A61a241a756E4817c845BEDE7e213a319b1DD", + "salt": "AxelarGasService", + "address": "0x47E840B35e0eca3E7C0577835DD78d95574873e7", + "implementation": "0x488E54121f7995feF259d15bE688C68142F9a146", + "deployer": "0x9D97cf3AC20b73c81d8A5233d9FBe09618d4F8bd" + } + }, + "explorer": { + "url": "", + "api": "" } } }, diff --git a/axelar-chains-config/info/testnet.json b/axelar-chains-config/info/testnet.json index e93a4f460..61e95e9b9 100644 --- a/axelar-chains-config/info/testnet.json +++ b/axelar-chains-config/info/testnet.json @@ -34,7 +34,11 @@ "refundIssuer": "0x4f671f34d2d23fec3eE3087E3A0221f8D314D9dF" }, "ConstAddressDeployer": { - "address": "0x98B2920D53612483F91F12Ed7754E51b4A77919e" + "address": "0x98B2920D53612483F91F12Ed7754E51b4A77919e", + "deployer": "0xE86375704CDb8491a5Ed82D90DceCE02Ee0ac25F", + "deploymentMethod": "create", + "codehash": "0x8fda47a596dfba923270da84e0c32a2d0312f1c03389f83e16f2b5a35ed37fbe", + "predeployCodehash": "0x8fda47a596dfba923270da84e0c32a2d0312f1c03389f83e16f2b5a35ed37fbe" }, "Create3Deployer": { "salt": "Create3Deployer", diff --git a/axelar-chains-config/package-lock.json b/axelar-chains-config/package-lock.json index 9dae020ed..b99af5367 100644 --- a/axelar-chains-config/package-lock.json +++ b/axelar-chains-config/package-lock.json @@ -1252,9 +1252,9 @@ } }, "node_modules/get-func-name": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.0.tgz", - "integrity": "sha512-Hm0ixYtaSZ/V7C8FJrtZIuBBI+iSgL+1Aq82zSu8VQNB4S3Gk8e7Qs3VwBDJAhmRZcFqkl3tQu36g/Foh5I5ig==", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.2.tgz", + "integrity": "sha512-8vXOvuE167CtIc3OyItco7N/dpRtBbYOsPsXCz7X/PMnlGjYjSGuZJgM1Y7mmew7BKf9BqvLX2tnOVy1BBUsxQ==", "dev": true, "engines": { "node": "*" @@ -1732,9 +1732,9 @@ } }, "node_modules/postcss": { - "version": "8.4.29", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.29.tgz", - "integrity": "sha512-cbI+jaqIeu/VGqXEarWkRCCffhjgXc0qjBtXpqJhTBohMUjUQnbBr0xqX3vEKudc4iviTewcJo5ajcec5+wdJw==", + "version": "8.4.31", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.31.tgz", + "integrity": "sha512-PS08Iboia9mts/2ygV3eLpY5ghnUcfLV/EXTOW1E2qYxJKGGBUtNjN76FYHnMs36RmARn41bC0AZmn+rR0OVpQ==", "dev": true, "funding": [ { diff --git a/evm/deploy-contract.js b/evm/deploy-contract.js index 1655c8a47..27d44849a 100644 --- a/evm/deploy-contract.js +++ b/evm/deploy-contract.js @@ -296,7 +296,18 @@ async function processCommand(config, chain, options) { const existingAddress = config.chains.ethereum?.contracts?.[contractName]?.address; if (existingAddress !== undefined && predictedAddress !== existingAddress) { - printWarn(`Predicted address ${predictedAddress} does not match existing deployment ${existingAddress} on chain ${chain.name}.`); + printWarn( + `Predicted address ${predictedAddress} does not match existing deployment ${existingAddress} on chain ${config.chains.ethereum.name}.`, + ); + + const existingCodeHash = config.chains.ethereum.contracts[contractName].predeployCodehash; + + if (predeployCodehash !== existingCodeHash) { + printWarn( + `Pre-deploy bytecode hash ${predeployCodehash} does not match existing deployment's predeployCodehash ${existingCodeHash} on chain ${config.chains.ethereum.name}.`, + ); + } + printWarn('For official deployment, recheck the deployer, salt, args, or contract bytecode.'); } diff --git a/evm/deploy-gateway-v6.2.x.js b/evm/deploy-gateway-v6.2.x.js index 7c0839d23..f9dbf8c6b 100644 --- a/evm/deploy-gateway-v6.2.x.js +++ b/evm/deploy-gateway-v6.2.x.js @@ -115,18 +115,30 @@ async function deploy(config, chain, options) { throw new Error('mintLimiter address is required'); } - if (!(await isContract(governance, provider))) { - printWarn('Governance address is not a contract. This is optional for test deployments'); + if (governance !== wallet.address) { + printWarn( + 'Governance address is not set to the wallet address. This is needed for official deployment and is transferred after deployment', + ); } - if (!(await isContract(mintLimiter, provider))) { - printWarn('MintLimiter address is not a contract. This is optional for test deployments'); + if (mintLimiter !== wallet.address) { + printWarn( + 'MintLimiter address is not set to the wallet address. This is needed for official deployment and is transferred after deployment', + ); } printInfo('Governance address', governance); printInfo('MintLimiter address', mintLimiter); } + const gasOptions = JSON.parse(JSON.stringify(contractConfig.gasOptions || chain.gasOptions || {})); + + // Some chains require a gas adjustment + if (env === 'mainnet' && !gasOptions.gasPrice && (chain.name === 'Fantom' || chain.name === 'Binance' || chain.name === 'Polygon')) { + gasOptions.gasPrice = Math.floor((await provider.getGasPrice()) * 1.6); + } + + printInfo('Gas override', JSON.stringify(gasOptions, null, 2)); const gatewayFactory = new ContractFactory(AxelarGateway.abi, AxelarGateway.bytecode, wallet); const authFactory = new ContractFactory(AxelarAuthWeighted.abi, AxelarAuthWeighted.bytecode, wallet); const tokenDeployerFactory = new ContractFactory(TokenDeployer.abi, TokenDeployer.bytecode, wallet); @@ -139,28 +151,30 @@ async function deploy(config, chain, options) { let auth; let tokenDeployer; const contractsToVerify = []; + let proxyAddress; if (reuseProxy) { - const gatewayProxy = chain.contracts.AxelarGateway?.address || (await getProxy(config, chain.id)); - printInfo('Reusing Gateway Proxy address', gatewayProxy); - gateway = gatewayFactory.attach(gatewayProxy); + proxyAddress = chain.contracts.AxelarGateway?.address || (await getProxy(config, chain.id)); + printInfo('Reusing Gateway Proxy address', proxyAddress); + gateway = gatewayFactory.attach(proxyAddress); } else { const transactionCount = await wallet.getTransactionCount(); - const proxyAddress = getContractAddress({ + proxyAddress = getContractAddress({ from: wallet.address, nonce: transactionCount + 3, }); printInfo('Predicted proxy address', proxyAddress, chalk.cyan); } - const gasOptions = JSON.parse(JSON.stringify(contractConfig.gasOptions || chain.gasOptions || {})); + const existingAddress = config.chains.ethereum?.contracts?.[contractName]?.address; - // Some chains require a gas adjustment - if (env === 'mainnet' && !gasOptions.gasPrice && (chain.name === 'Fantom' || chain.name === 'Binance' || chain.name === 'Polygon')) { - gasOptions.gasPrice = Math.floor((await provider.getGasPrice()) * 1.6); + if (existingAddress !== undefined && proxyAddress !== existingAddress) { + printWarn( + `Predicted address ${proxyAddress} does not match existing deployment ${existingAddress} on chain ${config.chains.ethereum.name}.`, + ); + printWarn('For official deployment, recheck the deployer, salt, args, or contract bytecode.'); } - printInfo('Gas override', JSON.stringify(gasOptions, null, 2)); printInfo('Is verification enabled?', verify ? 'y' : 'n'); if (prompt(`Does derived address match existing gateway deployments? Proceed with deployment on ${chain.name}?`, yes)) { @@ -190,6 +204,8 @@ async function deploy(config, chain, options) { }); } + printInfo('Auth address', auth.address); + if (options.skipExisting && contractConfig.tokenDeployer) { tokenDeployer = tokenDeployerFactory.attach(contractConfig.tokenDeployer); } else if (reuseProxy && reuseHelpers) { @@ -216,7 +232,6 @@ async function deploy(config, chain, options) { }); } - printInfo('Auth address', auth.address); printInfo('Token Deployer address', tokenDeployer.address); printInfo(`Deploying gateway implementation contract`); @@ -224,16 +239,22 @@ async function deploy(config, chain, options) { const salt = 'AxelarGateway v6.2' + (options.salt || ''); - const implementation = await deployContract( - options.deployMethod, - wallet, - AxelarGateway, - [auth.address, tokenDeployer.address], - { salt, deployerContract }, - gasOptions, - {}, - chain, - ); + let implementation; + + if (options.skipExisting && contractConfig.implementation) { + implementation = gatewayFactory.attach(contractConfig.implementation); + } else { + implementation = await deployContract( + options.deployMethod, + wallet, + AxelarGateway, + [auth.address, tokenDeployer.address], + { salt, deployerContract }, + gasOptions, + {}, + chain, + ); + } printInfo('Gateway Implementation', implementation.address); @@ -245,7 +266,10 @@ async function deploy(config, chain, options) { params: [auth.address, tokenDeployer.address], }); - if (!reuseProxy) { + if (options.skipExisting && contractConfig.address) { + proxyAddress = chain.contracts.AxelarGateway?.address; + gateway = gatewayFactory.attach(proxyAddress); + } else if (!reuseProxy) { const params = getProxyParams(governance, mintLimiter); printInfo('Deploying gateway proxy contract'); @@ -515,7 +539,7 @@ async function programHandler() { program.addOption(new Option('-r, --rpc ', 'chain rpc url').env('URL')); program.addOption( - new Option('--deployMethod ', 'deployment method').choices(['create', 'create2', 'create3']).default('create'), + new Option('-m, --deployMethod ', 'deployment method').choices(['create', 'create2', 'create3']).default('create'), ); program.addOption(new Option('-r, --reuseProxy', 'reuse proxy contract modules for new implementation deployment').env('REUSE_PROXY')); program.addOption( @@ -524,8 +548,8 @@ async function programHandler() { ), ); program.addOption(new Option('--ignoreError', 'Ignore deployment errors and proceed to next chain')); - program.addOption(new Option('-g, --governance ', 'governance address').env('GOVERNANCE')); - program.addOption(new Option('-m, --mintLimiter ', 'mint limiter address').env('MINT_LIMITER')); + program.addOption(new Option('--governance ', 'governance address').env('GOVERNANCE')); + program.addOption(new Option('--mintLimiter ', 'mint limiter address').env('MINT_LIMITER')); program.addOption(new Option('-k, --keyID ', 'key ID').env('KEY_ID')); program.addOption(new Option('-a, --amplifier', 'deploy amplifier gateway').env('AMPLIFIER')); program.addOption(new Option('--prevKeyIDs ', 'previous key IDs to be used for auth contract')); diff --git a/evm/deploy-upgradable.js b/evm/deploy-upgradable.js index 7179e2683..3f6298cbb 100644 --- a/evm/deploy-upgradable.js +++ b/evm/deploy-upgradable.js @@ -2,6 +2,7 @@ require('dotenv').config(); +const chalk = require('chalk'); const { ethers } = require('hardhat'); const { Contract, @@ -199,7 +200,7 @@ async function deploy(options, chain) { printInfo('Deployment method', deployMethod); printInfo('Deployer contract', deployerContract); - printInfo(`${contractName} will be deployed to`, predictedAddress); + printInfo(`${contractName} will be deployed to`, predictedAddress, chalk.cyan); if (prompt(`Does derived address match existing deployments? Proceed with deployment on ${chain.name}?`, yes)) { return; diff --git a/evm/sign-utils.js b/evm/sign-utils.js index 60ae0c0df..b1991cb53 100644 --- a/evm/sign-utils.js +++ b/evm/sign-utils.js @@ -126,10 +126,11 @@ const signTransaction = async (wallet, chain, tx, options = {}) => { const sendTransaction = async (tx, provider, confirmations = undefined) => { const response = await provider.sendTransaction(tx); - const receipt = await response.wait(confirmations); printInfo('Broadcasted tx', response.hash); + const receipt = await response.wait(confirmations); + return { response, receipt }; }; diff --git a/evm/utils.js b/evm/utils.js index 6d4489896..df41db9fb 100644 --- a/evm/utils.js +++ b/evm/utils.js @@ -713,6 +713,8 @@ const mainProcessor = async (options, processCommand, save = true, catchErr = fa throw new Error('Chain names were not provided'); } + printInfo('Environment', options.env); + const config = loadConfig(options.env); let chains = options.chainName ? [options.chainName] : options.chainNames.split(',').map((str) => str.trim()); const chainsToSkip = (options.skipChains || '').split(',').map((str) => str.trim());