Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(evm): address prediction comparison #352

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading