From 487b32cb347349f9e022bf5ae697f0c534a0bdcc Mon Sep 17 00:00:00 2001 From: Milap Sheth Date: Sat, 30 Sep 2023 13:59:11 -0400 Subject: [PATCH] fix: support gateway deployment to multiple chains --- evm/deploy-gateway-v5.0.x.js | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/evm/deploy-gateway-v5.0.x.js b/evm/deploy-gateway-v5.0.x.js index 9f9e3293..6f00d454 100644 --- a/evm/deploy-gateway-v5.0.x.js +++ b/evm/deploy-gateway-v5.0.x.js @@ -66,13 +66,12 @@ function getProxyParams(governance, mintLimiter) { return defaultAbiCoder.encode(['address', 'address', 'bytes'], [governance, mintLimiter, '0x']); } -async function deploy(config, options) { +async function deploy(config, chain, options) { const { privateKey, reuseProxy, reuseHelpers, verify, yes } = options; - const chainName = options.chainName.toLowerCase(); + const chainName = chain.name.toLowerCase(); const contractName = 'AxelarGateway'; - const chain = config.chains[chainName] || { contracts: {}, name: chainName, id: chainName, rpc: options.rpc, tokenSymbol: 'ETH' }; const rpc = options.rpc || chain.rpc; const provider = getDefaultProvider(rpc); @@ -300,11 +299,11 @@ async function deploy(config, options) { } } -async function upgrade(config, options) { - const { chainName, privateKey, yes, offline, env } = options; +async function upgrade(config, chain, options) { + const { privateKey, yes, offline, env } = options; const contractName = 'AxelarGateway'; + const chainName = chain.name.toLowerCase(); - const chain = config.chains[chainName] || { contracts: {}, name: chainName, id: chainName, rpc: options.rpc, tokenSymbol: 'ETH' }; const rpc = options.rpc || chain.rpc; const provider = getDefaultProvider(rpc); @@ -397,9 +396,9 @@ async function upgrade(config, options) { async function processCommand(config, chain, options) { if (!options.upgrade) { - await deploy(config, options); + await deploy(config, chain, options); } else { - await upgrade(config, options); + await upgrade(config, chain, options); } }