Skip to content

Commit

Permalink
add support for deploying the axelarnet-gateway contract
Browse files Browse the repository at this point in the history
  • Loading branch information
João Sousa authored and João Sousa committed Aug 27, 2024
1 parent f62d3e2 commit 00a3fa6
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions cosmwasm/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -420,6 +420,28 @@ const makeMultisigProverInstantiateMsg = (config, chainName) => {
};
};

const makeAxelarnetGatewayInstantiateMsg = (config, chainName) => {
const {
axelar: { contracts },
} = config;
const chainConfig = getChainConfig(config, chainName);

const { axelarId: chainId } = chainConfig;

const {
Router: { address: routerAddress },
} = contracts;

if (!validateAddress(routerAddress)) {
throw new Error('Missing or invalid Router.address in axelar info');
}

return {
router_address: routerAddress,
chain_name: chainId,
};
};

const makeInstantiateMsg = (contractName, chainName, config) => {
const {
axelar: { contracts },
Expand Down Expand Up @@ -500,6 +522,14 @@ const makeInstantiateMsg = (contractName, chainName, config) => {

return makeMultisigProverInstantiateMsg(config, chainName);
}

case 'AxelarnetGateway': {
if (!chainConfig) {
throw new Error('AxelarnetGateway requires chainNames option');
}

return makeAxelarnetGatewayInstantiateMsg(config, chainName);
}
}

throw new Error(`${contractName} is not supported.`);
Expand Down

0 comments on commit 00a3fa6

Please sign in to comment.