Skip to content

Commit

Permalink
fix address prediction comparison
Browse files Browse the repository at this point in the history
  • Loading branch information
João Sousa authored and João Sousa committed Aug 28, 2024
1 parent b0fc268 commit 14b5916
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions evm/deploy-amplifier-gateway.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ async function deploy(config, chain, options) {
let proxyAddress;

if (reuseProxy) {
proxyAddress = chain.contracts.AxelarGateway?.address;
proxyAddress = chain.contracts[contractName]?.address;

if (proxyAddress === undefined) {
throw new Error('Proxy address is missing in the config file');
Expand All @@ -112,15 +112,7 @@ async function deploy(config, chain, options) {
printInfo('Predicted gateway proxy address', proxyAddress, chalk.cyan);
}

let existingAddress;

for (const chainConfig of Object.values(config.chains)) {
existingAddress = chainConfig.contracts?.[contractName]?.address;

if (existingAddress !== undefined) {
break;
}
}
const existingAddress = chain.contracts[contractName]?.address

if (existingAddress !== undefined && proxyAddress !== existingAddress) {
printWarn(`Predicted address ${proxyAddress} does not match existing deployment ${existingAddress} in chain configs.`);
Expand Down

0 comments on commit 14b5916

Please sign in to comment.