From a7856159a7ebffb08931406c2f73518081f9c576 Mon Sep 17 00:00:00 2001 From: benjamin852 Date: Mon, 22 Sep 2025 15:08:38 -0400 Subject: [PATCH 01/22] git add evm/interchainTokenFactory.jschore: added contract id script its factory --- evm/interchainTokenFactory.js | 127 ++++++++++++++++------------------ 1 file changed, 61 insertions(+), 66 deletions(-) diff --git a/evm/interchainTokenFactory.js b/evm/interchainTokenFactory.js index 1e7401182..5bf7fe47d 100644 --- a/evm/interchainTokenFactory.js +++ b/evm/interchainTokenFactory.js @@ -19,8 +19,11 @@ const { printTokenInfo, isTrustedChain, encodeITSDestination, + scaleGasValue, + loadConfig, } = require('./utils'); -const { validateChain, estimateITSFee, encodeITSDestinationToken } = require('../common/utils'); +const { addOptionsToCommands } = require('../common'); +const { validateChain, estimateITSFee } = require('../common/utils'); const { addEvmOptions } = require('./cli-utils'); const { getDeploymentSalt, handleTx } = require('./its'); const { getWallet } = require('./sign-utils'); @@ -37,8 +40,9 @@ const IInterchainTokenServiceV211 = getContractJSON( '@axelar-network/interchain-token-service-v2.1.1/artifacts/contracts/interfaces/IInterchainTokenService.sol/IInterchainTokenService.json', ); -async function processCommand(_axelar, chain, chains, options) { - const { privateKey, address, action, yes } = options; +async function processCommand(_axelar, chain, chains, action, options) { + const { privateKey, address, yes, args } = options; + const config = loadConfig(options.env); const contracts = chain.contracts; const contractName = 'InterchainTokenFactory'; @@ -77,21 +81,23 @@ async function processCommand(_axelar, chain, chains, options) { } switch (action) { - case 'contractId': { + // EX: node evm/interchainTokenFactory.js contract-id --chainNames avalanche --env testnet --yes + case 'contract-id': { const contractId = await interchainTokenFactory.contractId(); printInfo('InterchainTokenFactory contract ID', contractId); break; } - case 'interchainTokenDeploySalt': { - const { deployer } = options; + case 'interchain-token-deploy-salt': { + const [deployer] = args; const deploymentSalt = getDeploymentSalt(options); - validateParameters({ isValidAddress: { deployer } }); + validateParameters({ isValidAddress: { deployer }, isValidString: { salt } }); const interchainTokenDeploySalt = await interchainTokenFactory.interchainTokenDeploySalt(deployer, deploymentSalt); + printInfo( `interchainTokenDeploySalt for deployer ${deployer} and deployment salt: ${deploymentSalt}`, interchainTokenDeploySalt, @@ -100,19 +106,18 @@ async function processCommand(_axelar, chain, chains, options) { break; } - case 'canonicalinterchainTokenDeploySalt': { - const { tokenAddress } = options; + case 'canonical-interchain-token-deploy-salt': { + const [tokenAddress] = args; validateParameters({ isValidAddress: { tokenAddress } }); - - const canonicalinterchainTokenDeploySalt = await interchainTokenFactory.canonicalinterchainTokenDeploySalt(tokenAddress); - printInfo(`canonicalinterchainTokenDeploySalt for token address: ${tokenAddress}`, canonicalinterchainTokenDeploySalt); + const canonicalInterchainTokenDeploySalt = await interchainTokenFactory.canonicalInterchainTokenDeploySalt(tokenAddress); + printInfo(`canonicalInterchainTokenDeploySalt for token address: ${tokenAddress}`, canonicalInterchainTokenDeploySalt); break; } - case 'interchainTokenId': { - const { deployer } = options; + case 'interchain-token-id': { + const [deployer] = args; const deploymentSalt = getDeploymentSalt(options); @@ -124,8 +129,8 @@ async function processCommand(_axelar, chain, chains, options) { break; } - case 'canonicalInterchainTokenId': { - const { tokenAddress } = options; + case 'canonical-interchain-token-id': { + const [tokenAddress] = args; validateParameters({ isValidAddress: { tokenAddress } }); @@ -134,22 +139,8 @@ async function processCommand(_axelar, chain, chains, options) { break; } - - case 'interchainTokenAddress': { - const { deployer } = options; - - const deploymentSalt = getDeploymentSalt(options); - - validateParameters({ isValidAddress: { deployer } }); - - const interchainTokenAddress = await interchainTokenFactory.interchainTokenAddress(deployer, deploymentSalt); - printInfo(`interchainTokenAddress for deployer ${deployer} and deployment salt: ${deploymentSalt}`, interchainTokenAddress); - - break; - } - - case 'deployInterchainToken': { - const { name, symbol, decimals, initialSupply, minter } = options; + case 'deploy-interchain-token': { + const [name, symbol, decimals, initialSupply, minter] = args; const deploymentSalt = getDeploymentSalt(options); @@ -173,7 +164,7 @@ async function processCommand(_axelar, chain, chains, options) { const tokenId = await interchainTokenFactory.interchainTokenId(wallet.address, deploymentSalt); printInfo('tokenId', tokenId); - await handleTx(tx, chain, interchainTokenService, options.action, 'TokenManagerDeployed', 'InterchainTokenDeploymentStarted'); + await handleTx(tx, chain, interchainTokenService, action, 'TokenManagerDeployed', 'InterchainTokenDeploymentStarted'); printInfo('Token address', await interchainTokenService.registeredTokenAddress(tokenId)); break; @@ -214,13 +205,13 @@ async function processCommand(_axelar, chain, chains, options) { const tokenId = await interchainTokenFactory.interchainTokenId(wallet.address, deploymentSalt); printInfo('tokenId', tokenId); - await handleTx(tx, chain, interchainTokenService, options.action, 'TokenManagerDeployed', 'InterchainTokenDeploymentStarted'); + await handleTx(tx, chain, interchainTokenService, action, 'TokenManagerDeployed', 'InterchainTokenDeploymentStarted'); break; } - case 'registerCanonicalInterchainToken': { - const { tokenAddress } = options; + case 'register-canonical-interchain-token': { + const [tokenAddress] = args; validateParameters({ isValidAddress: { tokenAddress } }); @@ -230,7 +221,7 @@ async function processCommand(_axelar, chain, chains, options) { printInfo('tokenId', tokenId); await printTokenInfo(tokenAddress, provider); - await handleTx(tx, chain, interchainTokenService, options.action, 'TokenManagerDeployed', 'TokenManagerDeploymentStarted'); + await handleTx(tx, chain, interchainTokenService, action, 'TokenManagerDeployed', 'TokenManagerDeploymentStarted'); break; } @@ -266,13 +257,13 @@ async function processCommand(_axelar, chain, chains, options) { printInfo('tokenId', tokenId); await printTokenInfo(tokenAddress, provider); - await handleTx(tx, chain, interchainTokenService, options.action, 'TokenManagerDeployed', 'InterchainTokenDeploymentStarted'); + await handleTx(tx, chain, interchainTokenService, action, 'TokenManagerDeployed', 'InterchainTokenDeploymentStarted'); break; } - case 'registerCustomToken': { - const { tokenAddress, tokenManagerType, operator } = options; + case 'register-custom-token': { + const [tokenAddress, tokenManagerType, operator] = args; const deploymentSalt = getDeploymentSalt(options); @@ -293,7 +284,7 @@ async function processCommand(_axelar, chain, chains, options) { printInfo('tokenId', tokenId); await printTokenInfo(tokenAddress, provider); - await handleTx(tx, chain, interchainTokenService, options.action, 'TokenManagerDeployed', 'InterchainTokenDeploymentStarted'); + await handleTx(tx, chain, interchainTokenService, action, 'TokenManagerDeployed', 'InterchainTokenDeploymentStarted'); break; } @@ -308,8 +299,7 @@ async function processCommand(_axelar, chain, chains, options) { if (!(await isTrustedChain(destinationChain, interchainTokenService, itsVersion))) { throw new Error(`Destination chain ${destinationChain} is not trusted by ITS`); } - - const itsDestinationTokenAddress = encodeITSDestinationToken(chains, destinationChain, destinationTokenAddress); + const itsDestinationTokenAddress = encodeITSDestination(chains, destinationChain, destinationTokenAddress); printInfo('Human-readable destination token address', destinationTokenAddress); validateParameters({ @@ -331,7 +321,7 @@ async function processCommand(_axelar, chain, chains, options) { const tokenId = await interchainTokenFactory.linkedTokenId(wallet.address, deploymentSalt); printInfo('tokenId', tokenId); - await handleTx(tx, chain, interchainTokenService, options.action, 'LinkTokenStarted'); + await handleTx(tx, chain, interchainTokenService, action, 'LinkTokenStarted'); break; } @@ -342,8 +332,13 @@ async function processCommand(_axelar, chain, chains, options) { } } -async function main(options) { - await mainProcessor(options, processCommand); +// async function main(options) { +// await mainProcessor(options, processCommand); +// } + +async function main(action, args, options) { + options.args = args; + return mainProcessor(options, (axelar, chain, chains, options) => processCommand(axelar, chain, chains, action, options)); } if (require.main === module) { @@ -351,26 +346,24 @@ if (require.main === module) { program.name('InterchainTokenFactory').description('Script to perform interchain token factory commands'); - addEvmOptions(program, { address: true, salt: true }); - - program.addOption( - new Option('--action ', 'interchain token factory action') - .choices([ - 'contractId', - 'interchainTokenDeploySalt', - 'canonicalinterchainTokenDeploySalt', - 'interchainTokenId', - 'canonicalInterchainTokenId', - 'interchainTokenAddress', - 'deployInterchainToken', - 'deployRemoteInterchainToken', - 'registerCanonicalInterchainToken', - 'deployRemoteCanonicalInterchainToken', - 'registerCustomToken', - 'linkToken', - ]) - .makeOptionMandatory(true), - ); + // program.addOption( + // new Option('--action ', 'interchain token factory action') + // .choices([ + // 'contractId', + // 'interchainTokenDeploySalt', + // 'canonicalinterchainTokenDeploySalt', + // 'interchainTokenId', + // 'canonicalInterchainTokenId', + // 'interchainTokenAddress', + // 'deployInterchainToken', + // 'deployRemoteInterchainToken', + // 'registerCanonicalInterchainToken', + // 'deployRemoteCanonicalInterchainToken', + // 'registerCustomToken', + // 'linkToken', + // ]) + // .makeOptionMandatory(true), + // ); program.addOption(new Option('--tokenId ', 'ID of the token')); program.addOption(new Option('--sender ', 'TokenManager deployer address')); @@ -396,3 +389,5 @@ if (require.main === module) { program.parse(); } + +module.exports = { interchainTokenFactory: main }; From 0b8f2b49660e2280fb542fc6086b50b333091634 Mon Sep 17 00:00:00 2001 From: benjamin852 Date: Wed, 24 Sep 2025 17:46:33 -0400 Subject: [PATCH 02/22] chore: refactored remaining its factory functionality, todo still interchain-token-deploy-salt --- evm/interchainTokenFactory.js | 192 +++++++++++++++++++++------------- 1 file changed, 118 insertions(+), 74 deletions(-) diff --git a/evm/interchainTokenFactory.js b/evm/interchainTokenFactory.js index 5bf7fe47d..af8d42557 100644 --- a/evm/interchainTokenFactory.js +++ b/evm/interchainTokenFactory.js @@ -19,7 +19,6 @@ const { printTokenInfo, isTrustedChain, encodeITSDestination, - scaleGasValue, loadConfig, } = require('./utils'); const { addOptionsToCommands } = require('../common'); @@ -42,7 +41,6 @@ const IInterchainTokenServiceV211 = getContractJSON( async function processCommand(_axelar, chain, chains, action, options) { const { privateKey, address, yes, args } = options; - const config = loadConfig(options.env); const contracts = chain.contracts; const contractName = 'InterchainTokenFactory'; @@ -81,7 +79,6 @@ async function processCommand(_axelar, chain, chains, action, options) { } switch (action) { - // EX: node evm/interchainTokenFactory.js contract-id --chainNames avalanche --env testnet --yes case 'contract-id': { const contractId = await interchainTokenFactory.contractId(); printInfo('InterchainTokenFactory contract ID', contractId); @@ -94,7 +91,7 @@ async function processCommand(_axelar, chain, chains, action, options) { const deploymentSalt = getDeploymentSalt(options); - validateParameters({ isValidAddress: { deployer }, isValidString: { salt } }); + validateParameters({ isValidAddress: { deployer } }); const interchainTokenDeploySalt = await interchainTokenFactory.interchainTokenDeploySalt(deployer, deploymentSalt); @@ -170,19 +167,13 @@ async function processCommand(_axelar, chain, chains, action, options) { break; } - case 'deployRemoteInterchainToken': { - const { destinationChain, env } = options; + case 'deploy-remote-interchain-token': { + const [destinationChain] = args; + const { env } = options; const deploymentSalt = getDeploymentSalt(options); - const { gasValue, gasFeeValue } = await estimateITSFee( - chain, - destinationChain, - env, - 'InterchainTokenDeployment', - options.gasValue, - _axelar, - ); + const gasValue = await estimateITSFee(chain, destinationChain, env, 'InterchainTokenDeployment', options.gasValue, _axelar); validateParameters({ isNonEmptyString: { destinationChain }, @@ -198,7 +189,7 @@ async function processCommand(_axelar, chain, chains, action, options) { destinationChain, gasValue, { - value: gasFeeValue, + value: gasValue, ...gasOptions, }, ); @@ -226,17 +217,11 @@ async function processCommand(_axelar, chain, chains, action, options) { break; } - case 'deployRemoteCanonicalInterchainToken': { - const { tokenAddress, destinationChain, env } = options; + case 'deploy-remote-canonical-interchain-token': { + const [tokenAddress, destinationChain] = args; - const { gasValue, gasFeeValue } = await estimateITSFee( - chain, - destinationChain, - env, - 'InterchainTokenDeployment', - options.gasValue, - _axelar, - ); + const { env } = options; + const gasValue = await estimateITSFee(chain, destinationChain, env, 'InterchainTokenDeployment', options.gasValue, _axelar); validateParameters({ isValidAddress: { tokenAddress }, @@ -250,7 +235,7 @@ async function processCommand(_axelar, chain, chains, action, options) { tokenAddress, destinationChain, gasValue, - { value: gasFeeValue, ...gasOptions }, + { value: gasValue, ...gasOptions }, ); const tokenId = await interchainTokenFactory.canonicalInterchainTokenId(tokenAddress); @@ -289,10 +274,12 @@ async function processCommand(_axelar, chain, chains, action, options) { break; } - case 'linkToken': { - const { destinationChain, destinationTokenAddress, tokenManagerType, linkParams, env } = options; + case 'link-token': { + const [destinationChain, destinationTokenAddress, tokenManagerType, linkParams] = args; + + const { env } = options; - const { gasValue, gasFeeValue } = await estimateITSFee(chain, destinationChain, env, 'LinkToken', options.gasValue, _axelar); + const gasValue = await estimateITSFee(chain, destinationChain, env, 'LinkToken', options.gasValue, _axelar); const deploymentSalt = getDeploymentSalt(options); @@ -315,7 +302,7 @@ async function processCommand(_axelar, chain, chains, action, options) { tokenManagerType, linkParams, gasValue, - { value: gasFeeValue, ...gasOptions }, + { value: gasValue, ...gasOptions }, ); const tokenId = await interchainTokenFactory.linkedTokenId(wallet.address, deploymentSalt); @@ -332,10 +319,6 @@ async function processCommand(_axelar, chain, chains, action, options) { } } -// async function main(options) { -// await mainProcessor(options, processCommand); -// } - async function main(action, args, options) { options.args = args; return mainProcessor(options, (axelar, chain, chains, options) => processCommand(axelar, chain, chains, action, options)); @@ -346,46 +329,107 @@ if (require.main === module) { program.name('InterchainTokenFactory').description('Script to perform interchain token factory commands'); - // program.addOption( - // new Option('--action ', 'interchain token factory action') - // .choices([ - // 'contractId', - // 'interchainTokenDeploySalt', - // 'canonicalinterchainTokenDeploySalt', - // 'interchainTokenId', - // 'canonicalInterchainTokenId', - // 'interchainTokenAddress', - // 'deployInterchainToken', - // 'deployRemoteInterchainToken', - // 'registerCanonicalInterchainToken', - // 'deployRemoteCanonicalInterchainToken', - // 'registerCustomToken', - // 'linkToken', - // ]) - // .makeOptionMandatory(true), - // ); - - program.addOption(new Option('--tokenId ', 'ID of the token')); - program.addOption(new Option('--sender ', 'TokenManager deployer address')); - program.addOption(new Option('--deployer ', 'deployer address')); - program.addOption(new Option('--tokenAddress ', 'token address')); - program.addOption(new Option('--name ', 'token name')); - program.addOption(new Option('--symbol ', 'token symbol')); - program.addOption(new Option('--decimals ', 'token decimals')); - program.addOption(new Option('--minter ', 'token minter').default(AddressZero)); - program.addOption(new Option('--operator ', 'token manager operator').default(AddressZero)); - program.addOption(new Option('--tokenManagerType ', 'token manager type')); - program.addOption(new Option('--initialSupply ', 'initial supply').default(1e9)); - program.addOption(new Option('--destinationChain ', 'destination chain')); - program.addOption(new Option('--destinationAddress ', 'destination address')); - program.addOption(new Option('--gasValue ', 'gas value').default('auto')); - program.addOption(new Option('--rawSalt ', 'raw deployment salt').env('RAW_SALT')); - program.addOption(new Option('--destinationTokenAddress ', 'destination token address')); - program.addOption(new Option('--linkParams ', 'parameters to use for linking')); - - program.action((options) => { - main(options); - }); + program + .command('contract-id') + .description('Get contract ID') + .action((options, cmd) => { + main(cmd.name(), [], options); + }); + + program + .command('interchain-token-deploy-salt') + .argument('', 'Deployer') + .description('Get interchain token deploy salt') + .action((deployer, options, cmd) => { + main(cmd.name(), [deployer], options); + }); + + program + .command('canonical-interchain-token-deploy-salt') + .description('Get canonical interchain token deploy salt') + .argument('', 'Token address') + .action((tokenAddress, options, cmd) => { + main(cmd.name(), [tokenAddress], options); + }); + + program + .command('canonical-interchain-token-id') + .description('Get canonical interchain token id') + .argument('', 'Token address') + .action((tokenAddress, options, cmd) => { + main(cmd.name(), [tokenAddress], options); + }); + + program + .command('interchain-token-id') + .description('Get interchain token id') + .argument('', 'Deployer') + .action((deployer, options, cmd) => { + main(cmd.name(), [deployer], options); + }); + + program + .command('deploy-interchain-token') + .description('Deploy interchain token') + .argument('', 'Name') + .argument('', 'Symbol') + .argument('', 'Decimals') + .argument('', 'Initial supply') + .argument('', 'Minter') + .action((name, symbol, decimals, initialSupply, minter, options, cmd) => { + main(cmd.name(), [name, symbol, decimals, initialSupply, minter], options); + }); + + program + .command('deploy-remote-interchain-token') + .description('Deploy remote interchain token') + .argument('', 'Destination chain') + .addOption(new Option('--gasValue ', 'gas value').default('auto')) + .action((destinationChain, options, cmd) => { + main(cmd.name(), [destinationChain], options); + }); + + program + .command('register-canonical-interchain-token') + .description('Register canonical interchain token') + .argument('', 'Token address') + .action((tokenAddress, options, cmd) => { + main(cmd.name(), [tokenAddress], options); + }); + + program + .command('deploy-remote-canonical-interchain-token') + .description('Deploy remote canonical interchain token') + .argument('', 'Token address') + .argument('', 'Destination chain') + .addOption(new Option('--gasValue ', 'gas value').default('auto')) + .action((tokenAddress, destinationChain, options, cmd) => { + main(cmd.name(), [tokenAddress, destinationChain], options); + }); + + program + .command('register-custom-token') + .description('Register custom token') + .argument('', 'Token address') + .argument('', 'Token manager type') + .argument('', 'Operator') + .action((tokenAddress, tokenManagerType, operator, options, cmd) => { + main(cmd.name(), [tokenAddress, tokenManagerType, operator], options); + }); + + program + .command('link-token') + .description('Link token to token on destination chain') + .argument('', 'Destination chain') + .argument('', 'Destination token address') + .argument('', 'Token manager type') + .argument('', 'Link params') + .addOption(new Option('--gasValue ', 'gas value').default('auto')) + .action((destinationChain, destinationTokenAddress, tokenManagerType, linkParams, options, cmd) => { + main(cmd.name(), [destinationChain, destinationTokenAddress, tokenManagerType, linkParams], options); + }); + + addOptionsToCommands(program, addEvmOptions, { address: true, salt: true }); program.parse(); } From dbe71bef874da5ad5b50eaa2764a91d975ff5913 Mon Sep 17 00:00:00 2001 From: benjamin852 Date: Thu, 25 Sep 2025 17:18:45 -0400 Subject: [PATCH 03/22] chore: added note on interchain token deploy salt --- evm/interchainTokenFactory.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/evm/interchainTokenFactory.js b/evm/interchainTokenFactory.js index af8d42557..9f0b24ec6 100644 --- a/evm/interchainTokenFactory.js +++ b/evm/interchainTokenFactory.js @@ -91,6 +91,7 @@ async function processCommand(_axelar, chain, chains, action, options) { const deploymentSalt = getDeploymentSalt(options); + validateParameters({ isValidAddress: { deployer } }); validateParameters({ isValidAddress: { deployer } }); const interchainTokenDeploySalt = await interchainTokenFactory.interchainTokenDeploySalt(deployer, deploymentSalt); @@ -336,6 +337,7 @@ if (require.main === module) { main(cmd.name(), [], options); }); + // ts-node evm/interchainTokenFactory.js interchain-token-deploy-salt 0x03555aA97c7Ece30Afe93DAb67224f3adA79A60f --chainNames ethereum-sepolia --env testnet --salt 0x4ab94b9bf7e0a1c793d3ff3716b18bb3200a224832e16d1d161bb73a698c8253 program .command('interchain-token-deploy-salt') .argument('', 'Deployer') @@ -368,6 +370,7 @@ if (require.main === module) { main(cmd.name(), [deployer], options); }); + //ts-node node evm/interchainTokenFactory.js deploy-interchain-token btest11 btest11 18 12345 0x312dba807EAE77f01EF3dd21E885052f8F617c5B --chainNames ethereum-sepolia --env testnet --yes --salt 0x7abda5c65fc2720ee1970bbf2a761f6d5b599065283d3c184cb655066950e44a program .command('deploy-interchain-token') .description('Deploy interchain token') From 36c39893682b43bab7887e3f2ff70622ef17e8fe Mon Sep 17 00:00:00 2001 From: benjamin852 Date: Fri, 26 Sep 2025 13:32:16 -0400 Subject: [PATCH 04/22] chore: added readme and fixed logging bug for actions --- evm/README.md | 223 ++++++++++++++++++++++++++++++++++ evm/interchainTokenFactory.js | 2 - 2 files changed, 223 insertions(+), 2 deletions(-) diff --git a/evm/README.md b/evm/README.md index 2a3298253..0ef249587 100644 --- a/evm/README.md +++ b/evm/README.md @@ -488,3 +488,226 @@ ts-node evm/its.js link-token --salt [deploy-salt] [token-id] [destination-chain ``` The raw `bytes32` salt can be provided via `--rawSalt [raw-salt]` instead of hashing the provided salt string. + +## Interchain Token Factory + +The Interchain Token Factory is responsible for deploying new interchain tokens and managing their token managers. It has the following functionality: + +### Contract-Id + +Getter for the contract id. + +```bash +ts-node evm/interchainTokenFactory.js contract-id --chainNames --env +``` + +Example: + +```bash +ts-node evm/interchainTokenFactory.js contract-id --chainNames avalanche --env testnet +``` + +Example Response: + +```bash +InterchainTokenFactory contract ID: 0x80547d63ed663962b99f8ed432bff3879a35b5418af92258aa171feef14cc3cc +``` + +### Interchain Token Deploy Salt + +Computes the deploy salt for an interchain token. + +```bash +ts-node evm/interchainTokenFactory.js interchain-token-deploy-salt --chainNames --env --salt +``` + +Example: + +```bash +ts-node evm/interchainTokenFactory.js interchain-token-deploy-salt 0x03555aA97c7Ece30Afe93DAb67224f3adA79A60f --chainNames ethereum-sepolia --env testnet --salt 0x4ab94b9bf7e0a1c793d3ff3716b18bb3200a224832e16d1d161bb73a698c8253 +``` + +Example Response: + +```bash +interchainTokenDeploySalt for deployer 0x03555aA97c7Ece30Afe93DAb67224f3adA79A60f and deployment salt: 0x511cf8ffa226b88f7412a8d05960efcedb6526849eff5932bf063e008ece393b +``` + +### Canonical Interchain Token Deploy Salt + +Computes the deploy salt for a canonical interchain token. + +```bash +ts-node evm/interchainTokenFactory.js canonical-interchain-token-deploy-salt --chainNames --env +``` + +Example: + +```bash +ts-node evm/interchainTokenFactory.js canonical-interchain-token-deploy-salt 0x8A80b16621e4a14Cb98B64Fd2504b8CFe0Bf5AF1 --chainNames ethereum-sepolia --env testnet +``` + +Example Response: + +```bash +canonicalInterchainTokenDeploySalt for token address: 0x8A80b16621e4a14Cb98B64Fd2504b8CFe0Bf5AF1: 0xe513f2267d22ff732afa2c2ffacbea3d620a1aaf56ff2da43364e50580a74db5 +``` + +### Canonical Interchain Token Id + +Computes the ID for a canonical interchain token based on its address. + +```bash +ts-node evm/interchainTokenFactory.js canonical-interchain-token-id --chainNames --env + +``` + +Example: + +```bash +ts-node evm/interchainTokenFactory.js canonical-interchain-token-id 0x8A80b16621e4a14Cb98B64Fd2504b8CFe0Bf5AF1 --chainNames ethereum-sepolia --env testnet +``` + +Example Response: + +```bash +canonicalInterchainTokenId for token address: 0x8A80b16621e4a14Cb98B64Fd2504b8CFe0Bf5AF1: 0x578a3eef4bdf76cad3cc2aba334341759c02a9c233dece18ed64ba32c2e0f67f +``` + +### Interchain Token Id + +Computes the ID for an interchain token based on the deployer and a salt. + +```bash +ts-node evm/interchainTokenFactory.js interchain-token-id --chainNames --env --salt +``` + +Example: + +```bash +ts-node evm/interchainTokenFactory.js interchain-token-id 0x312dba807EAE77f01EF3dd21E885052f8F617c5B --chainNames avalanche --env testnet --salt 0x48d1c8f6106b661dfe16d1ccc0624c463e11e44a838e6b1f00117c5c74a2cd82 +``` + +Example Response: +```bash +InterchainTokenId for deployer 0x312dba807EAE77f01EF3dd21E885052f8F617c5B and deployment salt: 0x28cdf5de538ba9ca6dde00c89f20e0de32f63c9a3052295cb162daf4cf3cb358: 0xd162c4aec6dca05d0c3be25937a4e8743c144000818f952b2199b29cd69e41c7 +``` + +### Deploy Interchain Token + +Creates a new token and optionally mints an initial amount to a specified minter + +```bash +ts-node evm/interchainTokenFactory.js deploy-interchain-token --chainNames --env --salt +``` + + +Example: + +```bash +ts-node evm/interchainTokenFactory.js deploy-interchain-token Test_Token TT 18 12345 0x312dba807EAE77f01EF3dd21E885052f8F617c5B --chainNames ethereum-sepolia --env testnet --salt 0x7abda5c65fc2720ee1970bbf2a761f6d5b599065283d3c184cb655066950e51a +``` + +Example Response: + +```bash +Token address: 0x5330f9bA7F231F7fe1aC8b7e6bC880a4ebC7Ff8d +``` + +### Deploy Remote Interchain Token + +Deploys a remote interchain token on a specified destination chain. No additional minter is set on the deployed token. + +```bash +ts-node evm/interchainTokenFactory.js deploy-remote-interchain-token --chainNames --env --salt +``` + +Example: + +```bash +ts-node evm/interchainTokenFactory.js deploy-remote-interchain-token Avalanche 10000000000000000 --chainNames ethereum-sepolia --env testnet --salt 0x7abda5c65fc2720ee1970bbf2a761f6d5b599065283d3c184cb655066950e51a +``` + + +### Register Canonical Interchain Token + +Registers a canonical token as an interchain token and deploys its token manager. + +```bash +ts-node evm/interchainTokenFactory.js register-canonical-interchain-token --chainNames --env +``` + +Example: + +```bash +ts-node evm/interchainTokenFactory.js register-canonical-interchain-token 0xff0021D9201B51C681d26799A338f98741fBBB6a --chainNames ethereum-sepolia --env testnet +``` + +Example Response: + +```bash +register-canonical-interchain-token tx: 0x18a5cb3a1095b0963fa3110ee9efce9c0640fbb9a4338d6aa12f788a43ffa4aa +``` + + +### Deploy Remote Canonical Interchain Token + +Deploys a canonical interchain token on a remote chain. + +```bash +ts-node evm/interchainTokenFactory.js deploy-remote-canonical-interchain-token --chainNames --env +``` + +Example: + +```bash +ts-node evm/interchainTokenFactory.js deploy-remote-canonical-interchain-token 0x4a895FB659aAD3082535Aa193886D7501650685b Avalanche 100000000000 --chainNames ethereum-sepolia --env testnet +``` + +Example Response: + +```bash +deploy-remote-canonical-interchain-token tx: 0xf23e2b939c2af373bb4db004f96cacbfcbdb0e4c6acfa97b42ede309cbfbca65 +``` + + +### Register Custom Token + +Register an existing ERC20 token under a `tokenId` computed from the provided `salt`. + +```bash +ts-node evm/interchainTokenFactory.js register-custom-token --chainNames --env --salt +``` + + +Example: + +```bash +ts-node evm/interchainTokenFactory.js register-custom-token 0x0F6814301C0DA51bFddA9D2A6Dd877950aa0F912 4 0x03555aA97c7Ece30Afe93DAb67224f3adA79A60f --chainNames ethereum-sepolia --env testnet --salt 0x3c39e5b65a730b26afa28238de20f2302c2cdb00f614f652274df74c88d4bb50 +``` + +Example Response: + +```bash +register-custom-token tx: 0xeab6d934a487e1242d8fe2704bf59e59e456b9db2d736d98dca5a54fc93a2877 +``` + +### Link Token + +Links a remote token on `destinationChain` to a local token corresponding to the `tokenId` computed from the provided `salt`. + +```bash +ts-node evm/interchainTokenFactory.js link-token --chainNames --env --salt +``` + +Example: + +```bash +ts-node evm/interchainTokenFactory.js link-token Avalanche 0xB98cF318A3cB1DEBA42a5c50c365B887cA00133C 4 0x03555aA97c7Ece30Afe93DAb67224f3adA79A60f 1000000 --chainNames ethereum-sepolia --env testnet --yes --salt 0x3c39e5b65a730b26afa28238de20f2302c2cdb00f614f652274df74c88d4bb40 +``` + +Example Response: + +```bash +link-token tx: 0xbc5feb02b1af05c8ad2aceae63edafd02cd74d8cb4976181e091d4c8cacd2505 +``` \ No newline at end of file diff --git a/evm/interchainTokenFactory.js b/evm/interchainTokenFactory.js index 9f0b24ec6..5c5a0f48f 100644 --- a/evm/interchainTokenFactory.js +++ b/evm/interchainTokenFactory.js @@ -337,7 +337,6 @@ if (require.main === module) { main(cmd.name(), [], options); }); - // ts-node evm/interchainTokenFactory.js interchain-token-deploy-salt 0x03555aA97c7Ece30Afe93DAb67224f3adA79A60f --chainNames ethereum-sepolia --env testnet --salt 0x4ab94b9bf7e0a1c793d3ff3716b18bb3200a224832e16d1d161bb73a698c8253 program .command('interchain-token-deploy-salt') .argument('', 'Deployer') @@ -370,7 +369,6 @@ if (require.main === module) { main(cmd.name(), [deployer], options); }); - //ts-node node evm/interchainTokenFactory.js deploy-interchain-token btest11 btest11 18 12345 0x312dba807EAE77f01EF3dd21E885052f8F617c5B --chainNames ethereum-sepolia --env testnet --yes --salt 0x7abda5c65fc2720ee1970bbf2a761f6d5b599065283d3c184cb655066950e44a program .command('deploy-interchain-token') .description('Deploy interchain token') From 7fef7d3de958eccc34f30923583cec36340d3249 Mon Sep 17 00:00:00 2001 From: benjamin852 Date: Fri, 26 Sep 2025 13:39:16 -0400 Subject: [PATCH 05/22] chore: fixed description for get interchain token deploy salt --- evm/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/evm/README.md b/evm/README.md index 0ef249587..10a232b05 100644 --- a/evm/README.md +++ b/evm/README.md @@ -710,4 +710,4 @@ Example Response: ```bash link-token tx: 0xbc5feb02b1af05c8ad2aceae63edafd02cd74d8cb4976181e091d4c8cacd2505 -``` \ No newline at end of file +``` From 1c88a5736e1043ccfef8548416bb0df1de4c1ab2 Mon Sep 17 00:00:00 2001 From: benjamin852 Date: Fri, 26 Sep 2025 15:38:27 -0400 Subject: [PATCH 06/22] chore: resolved conflicts --- evm/README.md | 37 ++++++++++++++++++++++++++++--------- 1 file changed, 28 insertions(+), 9 deletions(-) diff --git a/evm/README.md b/evm/README.md index 10a232b05..7a94b32c3 100644 --- a/evm/README.md +++ b/evm/README.md @@ -611,7 +611,11 @@ ts-node evm/interchainTokenFactory.js deploy-interchain-token Test_Token TT 18 1 Example Response: ```bash -Token address: 0x5330f9bA7F231F7fe1aC8b7e6bC880a4ebC7Ff8d +tokenId: 0x782e0c9fbe864b324a5d35b6b62249176517139d1b9a7cd015b0c96f25bc5670 + +deploy-interchain-token tx: 0xf92c9570174d76e5c86db9b1f62fea0591b320438982d61117efc223d984711b + +Token address: 0xec6FEd3f823fD8fbc2805Ade8FBb610264B903ce ``` ### Deploy Remote Interchain Token @@ -619,13 +623,21 @@ Token address: 0x5330f9bA7F231F7fe1aC8b7e6bC880a4ebC7Ff8d Deploys a remote interchain token on a specified destination chain. No additional minter is set on the deployed token. ```bash -ts-node evm/interchainTokenFactory.js deploy-remote-interchain-token --chainNames --env --salt +ts-node evm/interchainTokenFactory.js deploy-remote-interchain-token --chainNames --env --salt ``` Example: ```bash -ts-node evm/interchainTokenFactory.js deploy-remote-interchain-token Avalanche 10000000000000000 --chainNames ethereum-sepolia --env testnet --salt 0x7abda5c65fc2720ee1970bbf2a761f6d5b599065283d3c184cb655066950e51a +ts-node evm/interchainTokenFactory.js deploy-remote-interchain-token Avalanche --chainNames ethereum-sepolia --env testnet --salt 0x7abda5c65fc2720ee1970bbf2a761f6d5b599065283d3c184cb655066950e51a +``` + + +Example Response: + +```bash +tokenId: 0x782e0c9fbe864b324a5d35b6b62249176517139d1b9a7cd015b0c96f25bc5670 +deploy-remote-interchain-token tx: 0xbc4773d47a2d824e0dea7016cd8d4cee7d049fe186f3978810ce7d3987c81018 ``` @@ -655,20 +667,27 @@ register-canonical-interchain-token tx: 0x18a5cb3a1095b0963fa3110ee9efce9c0640fb Deploys a canonical interchain token on a remote chain. ```bash -ts-node evm/interchainTokenFactory.js deploy-remote-canonical-interchain-token --chainNames --env +ts-node evm/interchainTokenFactory.js deploy-remote-canonical-interchain-token --chainNames --env ``` Example: ```bash -ts-node evm/interchainTokenFactory.js deploy-remote-canonical-interchain-token 0x4a895FB659aAD3082535Aa193886D7501650685b Avalanche 100000000000 --chainNames ethereum-sepolia --env testnet +ts-node evm/interchainTokenFactory.js deploy-remote-canonical-interchain-token 0x4a895FB659aAD3082535Aa193886D7501650685b Avalanche --chainNames ethereum-sepolia --env testnet ``` Example Response: ```bash -deploy-remote-canonical-interchain-token tx: 0xf23e2b939c2af373bb4db004f96cacbfcbdb0e4c6acfa97b42ede309cbfbca65 -``` +tokenId: 0x96d9a34512abea0b206c91ff7b3e27af65a58455ded4cd098296ce5674716b01 + +Token name: SimpleCustomToken + +Token symbol: SCT + +Token decimals: 18 + +deploy-remote-canonical-interchain-token tx: 0xf23e2b939c2af373bb4db004f96cacbfcbdb0e4c6acfa97b42ede309cbfbca65``` ### Register Custom Token @@ -697,13 +716,13 @@ register-custom-token tx: 0xeab6d934a487e1242d8fe2704bf59e59e456b9db2d736d98dca5 Links a remote token on `destinationChain` to a local token corresponding to the `tokenId` computed from the provided `salt`. ```bash -ts-node evm/interchainTokenFactory.js link-token --chainNames --env --salt +ts-node evm/interchainTokenFactory.js link-token --chainNames --env --salt ``` Example: ```bash -ts-node evm/interchainTokenFactory.js link-token Avalanche 0xB98cF318A3cB1DEBA42a5c50c365B887cA00133C 4 0x03555aA97c7Ece30Afe93DAb67224f3adA79A60f 1000000 --chainNames ethereum-sepolia --env testnet --yes --salt 0x3c39e5b65a730b26afa28238de20f2302c2cdb00f614f652274df74c88d4bb40 +ts-node evm/interchainTokenFactory.js link-token Avalanche 0xB98cF318A3cB1DEBA42a5c50c365B887cA00133C 4 0x03555aA97c7Ece30Afe93DAb67224f3adA79A60f --chainNames ethereum-sepolia --env testnet --yes --salt 0x3c39e5b65a730b26afa28238de20f2302c2cdb00f614f652274df74c88d4bb40 ``` Example Response: From 79442d3c59e287f2cfeb06c368038e8bafe04e08 Mon Sep 17 00:00:00 2001 From: benjamin852 Date: Fri, 26 Sep 2025 15:46:00 -0400 Subject: [PATCH 07/22] chore: update github action for its factory command names --- .github/workflows/test-evm.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test-evm.yaml b/.github/workflows/test-evm.yaml index dcfb03ff2..1e552f650 100644 --- a/.github/workflows/test-evm.yaml +++ b/.github/workflows/test-evm.yaml @@ -166,23 +166,23 @@ jobs: run: ts-node evm/its.js is-trusted-chain remote -y - name: InterchainTokenFactory deploy interchain token on current chain - run: ts-node evm/interchainTokenFactory.js --action deployInterchainToken --name "test" --symbol "TST" --decimals 18 --minter 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 --salt "salt" -y + run: ts-node evm/interchainTokenFactory.js --action deploy-interchain-token --name "test" --symbol "TST" --decimals 18 --minter 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 --salt "salt" -y - name: InterchainTokenFactory deploy interchain token to destination chain - run: ts-node evm/interchainTokenFactory.js --action deployRemoteInterchainToken --destinationChain remote --salt "salt" -y + run: ts-node evm/interchainTokenFactory.js --action deploy-remote-interchain-token --destinationChain remote --salt "salt" -y # Note that tokenAddress is hardcoded since it's derivation must always be the same - name: InterchainTokenService register token metadata run: ts-node evm/its.js register-token-metadata 0x49c06259B42540a025A73a32eF2Fd183c0FDB1D2 -y - name: InterchainTokenFactory register custom token - run: ts-node evm/interchainTokenFactory.js --action registerCustomToken --tokenAddress 0x49c06259B42540a025A73a32eF2Fd183c0FDB1D2 --tokenManagerType 4 --operator 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 --salt "salt" -y + run: ts-node evm/interchainTokenFactory.js --action register-custom-token --tokenAddress 0x49c06259B42540a025A73a32eF2Fd183c0FDB1D2 --tokenManagerType 4 --operator 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 --salt "salt" -y - name: Transfer mintership of token to token manager run: ts-node evm/its.js transfer-mintership 0x49c06259B42540a025A73a32eF2Fd183c0FDB1D2 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 -y - name: InterchainTokenFactory link token - run: ts-node evm/interchainTokenFactory.js --action linkToken --destinationChain remote --destinationTokenAddress "0x1234" --tokenManagerType 4 --linkParams "0x5678" --salt "salt" -y + run: ts-node evm/interchainTokenFactory.js --action link-token --destinationChain remote --destinationTokenAddress "0x1234" --tokenManagerType 4 --linkParams "0x5678" --salt "salt" -y # Note that tokenId is hardcoded since it's derivation must always be the same - name: InterchainTokenService interchain transfer to destination chain From 63913f920c603c87cae52e9edd3fc350d093085f Mon Sep 17 00:00:00 2001 From: benjamin852 Date: Fri, 26 Sep 2025 15:53:53 -0400 Subject: [PATCH 08/22] chore: remove action and param names on its factory actions --- .github/workflows/test-evm.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test-evm.yaml b/.github/workflows/test-evm.yaml index 1e552f650..5a67e80be 100644 --- a/.github/workflows/test-evm.yaml +++ b/.github/workflows/test-evm.yaml @@ -166,23 +166,23 @@ jobs: run: ts-node evm/its.js is-trusted-chain remote -y - name: InterchainTokenFactory deploy interchain token on current chain - run: ts-node evm/interchainTokenFactory.js --action deploy-interchain-token --name "test" --symbol "TST" --decimals 18 --minter 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 --salt "salt" -y + run: ts-node evm/interchainTokenFactory.js deploy-interchain-token "test" "TST" 18 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 --salt "salt" -y - name: InterchainTokenFactory deploy interchain token to destination chain - run: ts-node evm/interchainTokenFactory.js --action deploy-remote-interchain-token --destinationChain remote --salt "salt" -y + run: ts-node evm/interchainTokenFactory.js deploy-remote-interchain-token remote --salt "salt" -y # Note that tokenAddress is hardcoded since it's derivation must always be the same - name: InterchainTokenService register token metadata run: ts-node evm/its.js register-token-metadata 0x49c06259B42540a025A73a32eF2Fd183c0FDB1D2 -y - name: InterchainTokenFactory register custom token - run: ts-node evm/interchainTokenFactory.js --action register-custom-token --tokenAddress 0x49c06259B42540a025A73a32eF2Fd183c0FDB1D2 --tokenManagerType 4 --operator 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 --salt "salt" -y + run: ts-node evm/interchainTokenFactory.js register-custom-token 0x49c06259B42540a025A73a32eF2Fd183c0FDB1D2 4 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 --salt "salt" -y - name: Transfer mintership of token to token manager run: ts-node evm/its.js transfer-mintership 0x49c06259B42540a025A73a32eF2Fd183c0FDB1D2 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 -y - name: InterchainTokenFactory link token - run: ts-node evm/interchainTokenFactory.js --action link-token --destinationChain remote --destinationTokenAddress "0x1234" --tokenManagerType 4 --linkParams "0x5678" --salt "salt" -y + run: ts-node evm/interchainTokenFactory.js link-token remote "0x1234" 4 "0x5678" --salt "salt" -y # Note that tokenId is hardcoded since it's derivation must always be the same - name: InterchainTokenService interchain transfer to destination chain From d87020831e373a10c0e76e4332f9b12a7bf3c1c5 Mon Sep 17 00:00:00 2001 From: benjamin852 Date: Fri, 26 Sep 2025 16:02:00 -0400 Subject: [PATCH 09/22] chore: fixed args on deploy-interchain-token and link-token for github action --- .github/workflows/test-evm.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-evm.yaml b/.github/workflows/test-evm.yaml index 5a67e80be..abd511a4a 100644 --- a/.github/workflows/test-evm.yaml +++ b/.github/workflows/test-evm.yaml @@ -166,7 +166,7 @@ jobs: run: ts-node evm/its.js is-trusted-chain remote -y - name: InterchainTokenFactory deploy interchain token on current chain - run: ts-node evm/interchainTokenFactory.js deploy-interchain-token "test" "TST" 18 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 --salt "salt" -y + run: ts-node evm/interchainTokenFactory.js deploy-interchain-token "test" "TST" 18 12345 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 --salt "salt" -y - name: InterchainTokenFactory deploy interchain token to destination chain run: ts-node evm/interchainTokenFactory.js deploy-remote-interchain-token remote --salt "salt" -y @@ -182,7 +182,7 @@ jobs: run: ts-node evm/its.js transfer-mintership 0x49c06259B42540a025A73a32eF2Fd183c0FDB1D2 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 -y - name: InterchainTokenFactory link token - run: ts-node evm/interchainTokenFactory.js link-token remote "0x1234" 4 "0x5678" --salt "salt" -y + run: ts-node evm/interchainTokenFactory.js link-token remote remote "0x1234" 4 "0x5678" --salt "salt" -y # Note that tokenId is hardcoded since it's derivation must always be the same - name: InterchainTokenService interchain transfer to destination chain From 2c4e2bca7aa34dcc2fb158d53988881fbc9dab19 Mon Sep 17 00:00:00 2001 From: benjamin852 Date: Mon, 29 Sep 2025 12:49:45 -0400 Subject: [PATCH 10/22] fix: removed typo in github action and fixed typo in readme --- .github/workflows/test-evm.yaml | 2 +- evm/README.md | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-evm.yaml b/.github/workflows/test-evm.yaml index abd511a4a..512d6a260 100644 --- a/.github/workflows/test-evm.yaml +++ b/.github/workflows/test-evm.yaml @@ -182,7 +182,7 @@ jobs: run: ts-node evm/its.js transfer-mintership 0x49c06259B42540a025A73a32eF2Fd183c0FDB1D2 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 -y - name: InterchainTokenFactory link token - run: ts-node evm/interchainTokenFactory.js link-token remote remote "0x1234" 4 "0x5678" --salt "salt" -y + run: ts-node evm/interchainTokenFactory.js link-token remote "0x1234" 4 "0x5678" --salt "salt" -y # Note that tokenId is hardcoded since it's derivation must always be the same - name: InterchainTokenService interchain transfer to destination chain diff --git a/evm/README.md b/evm/README.md index 7a94b32c3..e92034279 100644 --- a/evm/README.md +++ b/evm/README.md @@ -687,7 +687,8 @@ Token symbol: SCT Token decimals: 18 -deploy-remote-canonical-interchain-token tx: 0xf23e2b939c2af373bb4db004f96cacbfcbdb0e4c6acfa97b42ede309cbfbca65``` +deploy-remote-canonical-interchain-token tx: 0xf23e2b939c2af373bb4db004f96cacbfcbdb0e4c6acfa97b42ede309cbfbca65 +``` ### Register Custom Token From 3d9f83a89adf63181641efafb15cc0b3c3203691 Mon Sep 17 00:00:00 2001 From: benjamin852 Date: Mon, 6 Oct 2025 09:37:44 -0400 Subject: [PATCH 11/22] doc: add itsFactory deploy commands to release template --- releases/evm/EVM-ITS-Release-Template.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/releases/evm/EVM-ITS-Release-Template.md b/releases/evm/EVM-ITS-Release-Template.md index 099342fcb..33673bd07 100644 --- a/releases/evm/EVM-ITS-Release-Template.md +++ b/releases/evm/EVM-ITS-Release-Template.md @@ -96,10 +96,10 @@ ts-node evm/its.js checks -n $CHAIN -y ```bash # Create a token on `` -ts-node evm/interchainTokenFactory.js --action deployInterchainToken --minter [minter-address] --name "test" --symbol "TST" --decimals 6 --initialSupply 10000 --salt "salt1234" -n $CHAIN +ts-node evm/interchainTokenFactory.js deploy-interchain-token [name] [symbol] [decimals] [initial-supply] [minter] --salt "salt1234" -n $CHAIN # Deploy token to a remote chain -ts-node evm/interchainTokenFactory.js --action deployRemoteInterchainToken --destinationChain [destination-chain] --salt "salt1234" --gasValue [gas-value] -y -n $CHAIN +node evm/interchainTokenFactory.js deploy-remote-interchain-token [destination-chain] --salt "salt1234" -n $CHAIN # Transfer token to remote chain ts-node evm/its.js interchain-transfer [destination-chain] [token-id] [recipient] 1 --gasValue [gas-value] -n $CHAIN From bb20646e613dbf56cf56a5057d8fe633054c1851 Mon Sep 17 00:00:00 2001 From: benjamin852 Date: Mon, 6 Oct 2025 13:01:03 -0400 Subject: [PATCH 12/22] chore: added the gasValue destructuring and fixed conflicts --- evm/interchainTokenFactory.js | 39 +++++++++++++++++++++++++++-------- 1 file changed, 30 insertions(+), 9 deletions(-) diff --git a/evm/interchainTokenFactory.js b/evm/interchainTokenFactory.js index 5c5a0f48f..8a6ffb53a 100644 --- a/evm/interchainTokenFactory.js +++ b/evm/interchainTokenFactory.js @@ -19,7 +19,6 @@ const { printTokenInfo, isTrustedChain, encodeITSDestination, - loadConfig, } = require('./utils'); const { addOptionsToCommands } = require('../common'); const { validateChain, estimateITSFee } = require('../common/utils'); @@ -174,8 +173,18 @@ async function processCommand(_axelar, chain, chains, action, options) { const deploymentSalt = getDeploymentSalt(options); - const gasValue = await estimateITSFee(chain, destinationChain, env, 'InterchainTokenDeployment', options.gasValue, _axelar); + const { gasValue, gasFeeValue } = await estimateITSFee( + chain, + destinationChain, + env, + 'InterchainTokenDeployment', + options.gasValue, + _axelar, + ); + + console.log('gasValue', gasValue); + validateParameters({ isNonEmptyString: { destinationChain }, isValidNumber: { gasValue }, @@ -190,7 +199,7 @@ async function processCommand(_axelar, chain, chains, action, options) { destinationChain, gasValue, { - value: gasValue, + value: gasFeeValue, ...gasOptions, }, ); @@ -222,8 +231,14 @@ async function processCommand(_axelar, chain, chains, action, options) { const [tokenAddress, destinationChain] = args; const { env } = options; - const gasValue = await estimateITSFee(chain, destinationChain, env, 'InterchainTokenDeployment', options.gasValue, _axelar); - + const { gasValue, gasFeeValue } = await estimateITSFee( + chain, + destinationChain, + env, + 'InterchainTokenDeployment', + options.gasValue, + _axelar, + ); validateParameters({ isValidAddress: { tokenAddress }, isNonEmptyString: { destinationChain }, @@ -236,7 +251,7 @@ async function processCommand(_axelar, chain, chains, action, options) { tokenAddress, destinationChain, gasValue, - { value: gasValue, ...gasOptions }, + { value: gasFeeValue, ...gasOptions }, ); const tokenId = await interchainTokenFactory.canonicalInterchainTokenId(tokenAddress); @@ -280,8 +295,14 @@ async function processCommand(_axelar, chain, chains, action, options) { const { env } = options; - const gasValue = await estimateITSFee(chain, destinationChain, env, 'LinkToken', options.gasValue, _axelar); - + const { gasValue, gasFeeValue } = await estimateITSFee( + chain, + destinationChain, + env, + 'LinkToken', + options.gasValue, + _axelar, + ); const deploymentSalt = getDeploymentSalt(options); if (!(await isTrustedChain(destinationChain, interchainTokenService, itsVersion))) { @@ -303,7 +324,7 @@ async function processCommand(_axelar, chain, chains, action, options) { tokenManagerType, linkParams, gasValue, - { value: gasValue, ...gasOptions }, + { value: gasFeeValue, ...gasOptions }, ); const tokenId = await interchainTokenFactory.linkedTokenId(wallet.address, deploymentSalt); From 6480f8795a47b2e9a7a7815871711315f5716049 Mon Sep 17 00:00:00 2001 From: benjamin852 Date: Mon, 6 Oct 2025 13:02:39 -0400 Subject: [PATCH 13/22] chore: linter --- evm/interchainTokenFactory.js | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/evm/interchainTokenFactory.js b/evm/interchainTokenFactory.js index 8a6ffb53a..49081e344 100644 --- a/evm/interchainTokenFactory.js +++ b/evm/interchainTokenFactory.js @@ -182,9 +182,8 @@ async function processCommand(_axelar, chain, chains, action, options) { _axelar, ); - console.log('gasValue', gasValue); - + validateParameters({ isNonEmptyString: { destinationChain }, isValidNumber: { gasValue }, @@ -295,14 +294,7 @@ async function processCommand(_axelar, chain, chains, action, options) { const { env } = options; - const { gasValue, gasFeeValue } = await estimateITSFee( - chain, - destinationChain, - env, - 'LinkToken', - options.gasValue, - _axelar, - ); + const { gasValue, gasFeeValue } = await estimateITSFee(chain, destinationChain, env, 'LinkToken', options.gasValue, _axelar); const deploymentSalt = getDeploymentSalt(options); if (!(await isTrustedChain(destinationChain, interchainTokenService, itsVersion))) { From de8f0ba629c4b3c60a846d21b545511955ee8513 Mon Sep 17 00:00:00 2001 From: benjamin852 Date: Mon, 6 Oct 2025 13:23:23 -0400 Subject: [PATCH 14/22] chore: removed ex response from readme --- evm/README.md | 79 --------------------------------------------------- 1 file changed, 79 deletions(-) diff --git a/evm/README.md b/evm/README.md index e92034279..3207c7e72 100644 --- a/evm/README.md +++ b/evm/README.md @@ -507,11 +507,6 @@ Example: ts-node evm/interchainTokenFactory.js contract-id --chainNames avalanche --env testnet ``` -Example Response: - -```bash -InterchainTokenFactory contract ID: 0x80547d63ed663962b99f8ed432bff3879a35b5418af92258aa171feef14cc3cc -``` ### Interchain Token Deploy Salt @@ -527,12 +522,6 @@ Example: ts-node evm/interchainTokenFactory.js interchain-token-deploy-salt 0x03555aA97c7Ece30Afe93DAb67224f3adA79A60f --chainNames ethereum-sepolia --env testnet --salt 0x4ab94b9bf7e0a1c793d3ff3716b18bb3200a224832e16d1d161bb73a698c8253 ``` -Example Response: - -```bash -interchainTokenDeploySalt for deployer 0x03555aA97c7Ece30Afe93DAb67224f3adA79A60f and deployment salt: 0x511cf8ffa226b88f7412a8d05960efcedb6526849eff5932bf063e008ece393b -``` - ### Canonical Interchain Token Deploy Salt Computes the deploy salt for a canonical interchain token. @@ -547,12 +536,6 @@ Example: ts-node evm/interchainTokenFactory.js canonical-interchain-token-deploy-salt 0x8A80b16621e4a14Cb98B64Fd2504b8CFe0Bf5AF1 --chainNames ethereum-sepolia --env testnet ``` -Example Response: - -```bash -canonicalInterchainTokenDeploySalt for token address: 0x8A80b16621e4a14Cb98B64Fd2504b8CFe0Bf5AF1: 0xe513f2267d22ff732afa2c2ffacbea3d620a1aaf56ff2da43364e50580a74db5 -``` - ### Canonical Interchain Token Id Computes the ID for a canonical interchain token based on its address. @@ -568,12 +551,6 @@ Example: ts-node evm/interchainTokenFactory.js canonical-interchain-token-id 0x8A80b16621e4a14Cb98B64Fd2504b8CFe0Bf5AF1 --chainNames ethereum-sepolia --env testnet ``` -Example Response: - -```bash -canonicalInterchainTokenId for token address: 0x8A80b16621e4a14Cb98B64Fd2504b8CFe0Bf5AF1: 0x578a3eef4bdf76cad3cc2aba334341759c02a9c233dece18ed64ba32c2e0f67f -``` - ### Interchain Token Id Computes the ID for an interchain token based on the deployer and a salt. @@ -588,11 +565,6 @@ Example: ts-node evm/interchainTokenFactory.js interchain-token-id 0x312dba807EAE77f01EF3dd21E885052f8F617c5B --chainNames avalanche --env testnet --salt 0x48d1c8f6106b661dfe16d1ccc0624c463e11e44a838e6b1f00117c5c74a2cd82 ``` -Example Response: -```bash -InterchainTokenId for deployer 0x312dba807EAE77f01EF3dd21E885052f8F617c5B and deployment salt: 0x28cdf5de538ba9ca6dde00c89f20e0de32f63c9a3052295cb162daf4cf3cb358: 0xd162c4aec6dca05d0c3be25937a4e8743c144000818f952b2199b29cd69e41c7 -``` - ### Deploy Interchain Token Creates a new token and optionally mints an initial amount to a specified minter @@ -608,15 +580,6 @@ Example: ts-node evm/interchainTokenFactory.js deploy-interchain-token Test_Token TT 18 12345 0x312dba807EAE77f01EF3dd21E885052f8F617c5B --chainNames ethereum-sepolia --env testnet --salt 0x7abda5c65fc2720ee1970bbf2a761f6d5b599065283d3c184cb655066950e51a ``` -Example Response: - -```bash -tokenId: 0x782e0c9fbe864b324a5d35b6b62249176517139d1b9a7cd015b0c96f25bc5670 - -deploy-interchain-token tx: 0xf92c9570174d76e5c86db9b1f62fea0591b320438982d61117efc223d984711b - -Token address: 0xec6FEd3f823fD8fbc2805Ade8FBb610264B903ce -``` ### Deploy Remote Interchain Token @@ -633,14 +596,6 @@ ts-node evm/interchainTokenFactory.js deploy-remote-interchain-token Avalanche ``` -Example Response: - -```bash -tokenId: 0x782e0c9fbe864b324a5d35b6b62249176517139d1b9a7cd015b0c96f25bc5670 -deploy-remote-interchain-token tx: 0xbc4773d47a2d824e0dea7016cd8d4cee7d049fe186f3978810ce7d3987c81018 -``` - - ### Register Canonical Interchain Token Registers a canonical token as an interchain token and deploys its token manager. @@ -655,13 +610,6 @@ Example: ts-node evm/interchainTokenFactory.js register-canonical-interchain-token 0xff0021D9201B51C681d26799A338f98741fBBB6a --chainNames ethereum-sepolia --env testnet ``` -Example Response: - -```bash -register-canonical-interchain-token tx: 0x18a5cb3a1095b0963fa3110ee9efce9c0640fbb9a4338d6aa12f788a43ffa4aa -``` - - ### Deploy Remote Canonical Interchain Token Deploys a canonical interchain token on a remote chain. @@ -676,21 +624,6 @@ Example: ts-node evm/interchainTokenFactory.js deploy-remote-canonical-interchain-token 0x4a895FB659aAD3082535Aa193886D7501650685b Avalanche --chainNames ethereum-sepolia --env testnet ``` -Example Response: - -```bash -tokenId: 0x96d9a34512abea0b206c91ff7b3e27af65a58455ded4cd098296ce5674716b01 - -Token name: SimpleCustomToken - -Token symbol: SCT - -Token decimals: 18 - -deploy-remote-canonical-interchain-token tx: 0xf23e2b939c2af373bb4db004f96cacbfcbdb0e4c6acfa97b42ede309cbfbca65 -``` - - ### Register Custom Token Register an existing ERC20 token under a `tokenId` computed from the provided `salt`. @@ -706,12 +639,6 @@ Example: ts-node evm/interchainTokenFactory.js register-custom-token 0x0F6814301C0DA51bFddA9D2A6Dd877950aa0F912 4 0x03555aA97c7Ece30Afe93DAb67224f3adA79A60f --chainNames ethereum-sepolia --env testnet --salt 0x3c39e5b65a730b26afa28238de20f2302c2cdb00f614f652274df74c88d4bb50 ``` -Example Response: - -```bash -register-custom-token tx: 0xeab6d934a487e1242d8fe2704bf59e59e456b9db2d736d98dca5a54fc93a2877 -``` - ### Link Token Links a remote token on `destinationChain` to a local token corresponding to the `tokenId` computed from the provided `salt`. @@ -725,9 +652,3 @@ Example: ```bash ts-node evm/interchainTokenFactory.js link-token Avalanche 0xB98cF318A3cB1DEBA42a5c50c365B887cA00133C 4 0x03555aA97c7Ece30Afe93DAb67224f3adA79A60f --chainNames ethereum-sepolia --env testnet --yes --salt 0x3c39e5b65a730b26afa28238de20f2302c2cdb00f614f652274df74c88d4bb40 ``` - -Example Response: - -```bash -link-token tx: 0xbc5feb02b1af05c8ad2aceae63edafd02cd74d8cb4976181e091d4c8cacd2505 -``` From cfc1f9c186df50bcf1832d4efac452e31f073f91 Mon Sep 17 00:00:00 2001 From: benjamin852 Date: Tue, 14 Oct 2025 14:59:35 -0400 Subject: [PATCH 15/22] chore: remove debug console.log --- evm/interchainTokenFactory.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/evm/interchainTokenFactory.js b/evm/interchainTokenFactory.js index 49081e344..f1aa77c22 100644 --- a/evm/interchainTokenFactory.js +++ b/evm/interchainTokenFactory.js @@ -182,8 +182,6 @@ async function processCommand(_axelar, chain, chains, action, options) { _axelar, ); - console.log('gasValue', gasValue); - validateParameters({ isNonEmptyString: { destinationChain }, isValidNumber: { gasValue }, From 14f76a823ec49bb1ac5c2a2e44af6ebf1e5a9a77 Mon Sep 17 00:00:00 2001 From: benjamin852 Date: Wed, 15 Oct 2025 10:53:17 -0400 Subject: [PATCH 16/22] chore: removed double param verification in interchain token deploy salt call --- evm/interchainTokenFactory.js | 1 - 1 file changed, 1 deletion(-) diff --git a/evm/interchainTokenFactory.js b/evm/interchainTokenFactory.js index f1aa77c22..c8ef15a15 100644 --- a/evm/interchainTokenFactory.js +++ b/evm/interchainTokenFactory.js @@ -90,7 +90,6 @@ async function processCommand(_axelar, chain, chains, action, options) { const deploymentSalt = getDeploymentSalt(options); - validateParameters({ isValidAddress: { deployer } }); validateParameters({ isValidAddress: { deployer } }); const interchainTokenDeploySalt = await interchainTokenFactory.interchainTokenDeploySalt(deployer, deploymentSalt); From 1d79bdd75ba910e0a0aa86a900d8f0283a76a4e0 Mon Sep 17 00:00:00 2001 From: benjamin852 Date: Wed, 15 Oct 2025 21:33:04 -0400 Subject: [PATCH 17/22] chore: refactored ITS factory evm commands to have flagged inputs --- evm/interchainTokenFactory.js | 84 ++++++++++++++++++----------------- 1 file changed, 44 insertions(+), 40 deletions(-) diff --git a/evm/interchainTokenFactory.js b/evm/interchainTokenFactory.js index c8ef15a15..9b5271633 100644 --- a/evm/interchainTokenFactory.js +++ b/evm/interchainTokenFactory.js @@ -349,95 +349,99 @@ if (require.main === module) { program .command('interchain-token-deploy-salt') - .argument('', 'Deployer') .description('Get interchain token deploy salt') - .action((deployer, options, cmd) => { - main(cmd.name(), [deployer], options); + .requiredOption('--deployer ', 'Deployer address') + .action((options, cmd) => { + main(cmd.name(), [options.deployer], options); }); program .command('canonical-interchain-token-deploy-salt') .description('Get canonical interchain token deploy salt') - .argument('', 'Token address') - .action((tokenAddress, options, cmd) => { - main(cmd.name(), [tokenAddress], options); + .requiredOption('--tokenAddress ', 'Token address') + .action((options, cmd) => { + main(cmd.name(), [options.tokenAddress], options); }); program .command('canonical-interchain-token-id') .description('Get canonical interchain token id') - .argument('', 'Token address') - .action((tokenAddress, options, cmd) => { - main(cmd.name(), [tokenAddress], options); + .requiredOption('--tokenAddress ', 'Token address') + .action((options, cmd) => { + main(cmd.name(), [options.tokenAddress], options); }); program .command('interchain-token-id') .description('Get interchain token id') - .argument('', 'Deployer') - .action((deployer, options, cmd) => { - main(cmd.name(), [deployer], options); + .requiredOption('--deployer ', 'Deployer') + .action((options, cmd) => { + main(cmd.name(), [options.deployer], options); }); program .command('deploy-interchain-token') .description('Deploy interchain token') - .argument('', 'Name') - .argument('', 'Symbol') - .argument('', 'Decimals') - .argument('', 'Initial supply') - .argument('', 'Minter') - .action((name, symbol, decimals, initialSupply, minter, options, cmd) => { - main(cmd.name(), [name, symbol, decimals, initialSupply, minter], options); + .requiredOption('--name ', 'Name') + .requiredOption('--symbol ', 'Symbol') + .requiredOption('--decimals ', 'Decimals') + .requiredOption('--initialSupply ', 'Initial supply') + .requiredOption('--minter ', 'Minter') + .action((options, cmd) => { + main(cmd.name(), [options.name, options.symbol, options.decimals, options.initialSupply, options.minter], options); }); program .command('deploy-remote-interchain-token') .description('Deploy remote interchain token') - .argument('', 'Destination chain') + .requiredOption('--destinationChain ', 'Destination chain') .addOption(new Option('--gasValue ', 'gas value').default('auto')) - .action((destinationChain, options, cmd) => { - main(cmd.name(), [destinationChain], options); + .action((options, cmd) => { + main(cmd.name(), [options.destinationChain], options); }); program .command('register-canonical-interchain-token') .description('Register canonical interchain token') - .argument('', 'Token address') - .action((tokenAddress, options, cmd) => { - main(cmd.name(), [tokenAddress], options); + .requiredOption('--tokenAddress ', 'Token address') + .action((options, cmd) => { + main(cmd.name(), [options.tokenAddress], options); }); program .command('deploy-remote-canonical-interchain-token') .description('Deploy remote canonical interchain token') - .argument('', 'Token address') - .argument('', 'Destination chain') + .requiredOption('--tokenAddress ', 'Token address') + .requiredOption('--destinationChain ', 'Destination chain') .addOption(new Option('--gasValue ', 'gas value').default('auto')) - .action((tokenAddress, destinationChain, options, cmd) => { - main(cmd.name(), [tokenAddress, destinationChain], options); + .action((options, cmd) => { + main(cmd.name(), [options.tokenAddress, options.destinationChain], options); }); program .command('register-custom-token') .description('Register custom token') - .argument('', 'Token address') - .argument('', 'Token manager type') - .argument('', 'Operator') - .action((tokenAddress, tokenManagerType, operator, options, cmd) => { - main(cmd.name(), [tokenAddress, tokenManagerType, operator], options); + .requiredOption('--tokenAddress ', 'Token address') + .requiredOption('--tokenManagerType ', 'Token manager type') + .requiredOption('--operator ', 'Operator') + .action((options, cmd) => { + main(cmd.name(), [options.tokenAddress, options.tokenManagerType, options.operator], options); }); program .command('link-token') .description('Link token to token on destination chain') - .argument('', 'Destination chain') - .argument('', 'Destination token address') - .argument('', 'Token manager type') - .argument('', 'Link params') + .requiredOption('--destinationChain ', 'Destination chain') + .requiredOption('--destinationTokenAddress ', 'Destination token address') + .requiredOption('--tokenManagerType ', 'Token manager type') + .requiredOption('--linkParams ', 'Link params') .addOption(new Option('--gasValue ', 'gas value').default('auto')) - .action((destinationChain, destinationTokenAddress, tokenManagerType, linkParams, options, cmd) => { - main(cmd.name(), [destinationChain, destinationTokenAddress, tokenManagerType, linkParams], options); + .action((options, cmd) => { + main( + cmd.name(), + [options.destinationChain, options.destinationTokenAddress, options.tokenManagerType, options.linkParams], + options, + ); }); addOptionsToCommands(program, addEvmOptions, { address: true, salt: true }); From eb45251153e94d5590481683e1b608b173bc2fb6 Mon Sep 17 00:00:00 2001 From: benjamin852 Date: Wed, 15 Oct 2025 21:46:57 -0400 Subject: [PATCH 18/22] chore: fixed up release templates to account for new its factory actions --- .github/workflows/test-evm.yaml | 8 ++++---- releases/evm/EVM-ITS-Release-Template.md | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/test-evm.yaml b/.github/workflows/test-evm.yaml index 512d6a260..7622a9bd8 100644 --- a/.github/workflows/test-evm.yaml +++ b/.github/workflows/test-evm.yaml @@ -166,23 +166,23 @@ jobs: run: ts-node evm/its.js is-trusted-chain remote -y - name: InterchainTokenFactory deploy interchain token on current chain - run: ts-node evm/interchainTokenFactory.js deploy-interchain-token "test" "TST" 18 12345 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 --salt "salt" -y + run: ts-node evm/interchainTokenFactory.js deploy-interchain-token --name "test" --symbol "TST" --decimals 18 --initialSupply 12345 --minter 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 --salt "salt" -y - name: InterchainTokenFactory deploy interchain token to destination chain - run: ts-node evm/interchainTokenFactory.js deploy-remote-interchain-token remote --salt "salt" -y + run: ts-node evm/interchainTokenFactory.js deploy-remote-interchain-token --destinationChain remote --salt "salt" -y # Note that tokenAddress is hardcoded since it's derivation must always be the same - name: InterchainTokenService register token metadata run: ts-node evm/its.js register-token-metadata 0x49c06259B42540a025A73a32eF2Fd183c0FDB1D2 -y - name: InterchainTokenFactory register custom token - run: ts-node evm/interchainTokenFactory.js register-custom-token 0x49c06259B42540a025A73a32eF2Fd183c0FDB1D2 4 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 --salt "salt" -y + run: ts-node evm/interchainTokenFactory.js register-custom-token --tokenAddress 0x49c06259B42540a025A73a32eF2Fd183c0FDB1D2 --tokenManagerType 4 --operator 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 --salt "salt" -y - name: Transfer mintership of token to token manager run: ts-node evm/its.js transfer-mintership 0x49c06259B42540a025A73a32eF2Fd183c0FDB1D2 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 -y - name: InterchainTokenFactory link token - run: ts-node evm/interchainTokenFactory.js link-token remote "0x1234" 4 "0x5678" --salt "salt" -y + run: ts-node evm/interchainTokenFactory.js link-token --destinationChain remote --destinationTokenAddress "0x1234" --tokenManagerType 4 --linkParams "0x5678" --salt "salt" -y # Note that tokenId is hardcoded since it's derivation must always be the same - name: InterchainTokenService interchain transfer to destination chain diff --git a/releases/evm/EVM-ITS-Release-Template.md b/releases/evm/EVM-ITS-Release-Template.md index 33673bd07..026c64eae 100644 --- a/releases/evm/EVM-ITS-Release-Template.md +++ b/releases/evm/EVM-ITS-Release-Template.md @@ -96,10 +96,10 @@ ts-node evm/its.js checks -n $CHAIN -y ```bash # Create a token on `` -ts-node evm/interchainTokenFactory.js deploy-interchain-token [name] [symbol] [decimals] [initial-supply] [minter] --salt "salt1234" -n $CHAIN +ts-node evm/interchainTokenFactory.js deploy-interchain-token --name [name] --symbol [symbol] --decimals [decimals] --initialSupply [initial-supply] --minter [minter] --salt "salt1234" -n $CHAIN # Deploy token to a remote chain -node evm/interchainTokenFactory.js deploy-remote-interchain-token [destination-chain] --salt "salt1234" -n $CHAIN +node evm/interchainTokenFactory.js deploy-remote-interchain-token --destinationChain [destination-chain] --salt "salt1234" -n $CHAIN # Transfer token to remote chain ts-node evm/its.js interchain-transfer [destination-chain] [token-id] [recipient] 1 --gasValue [gas-value] -n $CHAIN From 22bb548fd30dd8448599dd993436af5f4e05e0e1 Mon Sep 17 00:00:00 2001 From: benjamin852 Date: Wed, 15 Oct 2025 21:55:20 -0400 Subject: [PATCH 19/22] doc: adjusted readme for its factory to match new actions --- evm/README.md | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/evm/README.md b/evm/README.md index 3207c7e72..0e14b7434 100644 --- a/evm/README.md +++ b/evm/README.md @@ -513,13 +513,13 @@ ts-node evm/interchainTokenFactory.js contract-id --chainNames avalanche --env t Computes the deploy salt for an interchain token. ```bash -ts-node evm/interchainTokenFactory.js interchain-token-deploy-salt --chainNames --env --salt +ts-node evm/interchainTokenFactory.js interchain-token-deploy-salt --deployer --chainNames --env --salt ``` Example: ```bash -ts-node evm/interchainTokenFactory.js interchain-token-deploy-salt 0x03555aA97c7Ece30Afe93DAb67224f3adA79A60f --chainNames ethereum-sepolia --env testnet --salt 0x4ab94b9bf7e0a1c793d3ff3716b18bb3200a224832e16d1d161bb73a698c8253 +ts-node evm/interchainTokenFactory.js interchain-token-deploy-salt --deployer 0x03555aA97c7Ece30Afe93DAb67224f3adA79A60f --chainNames ethereum-sepolia --env testnet --salt 0x4ab94b9bf7e0a1c793d3ff3716b18bb3200a224832e16d1d161bb73a698c8253 ``` ### Canonical Interchain Token Deploy Salt @@ -527,13 +527,13 @@ ts-node evm/interchainTokenFactory.js interchain-token-deploy-salt 0x03555aA97c7 Computes the deploy salt for a canonical interchain token. ```bash -ts-node evm/interchainTokenFactory.js canonical-interchain-token-deploy-salt --chainNames --env +ts-node evm/interchainTokenFactory.js canonical-interchain-token-deploy-salt --tokenAddress --chainNames --env ``` Example: ```bash -ts-node evm/interchainTokenFactory.js canonical-interchain-token-deploy-salt 0x8A80b16621e4a14Cb98B64Fd2504b8CFe0Bf5AF1 --chainNames ethereum-sepolia --env testnet +ts-node evm/interchainTokenFactory.js canonical-interchain-token-deploy-salt --tokenAddress 0x8A80b16621e4a14Cb98B64Fd2504b8CFe0Bf5AF1 --chainNames ethereum-sepolia --env testnet ``` ### Canonical Interchain Token Id @@ -541,14 +541,14 @@ ts-node evm/interchainTokenFactory.js canonical-interchain-token-deploy-salt 0x8 Computes the ID for a canonical interchain token based on its address. ```bash -ts-node evm/interchainTokenFactory.js canonical-interchain-token-id --chainNames --env +ts-node evm/interchainTokenFactory.js canonical-interchain-token-id --tokenAddress --chainNames --env ``` Example: ```bash -ts-node evm/interchainTokenFactory.js canonical-interchain-token-id 0x8A80b16621e4a14Cb98B64Fd2504b8CFe0Bf5AF1 --chainNames ethereum-sepolia --env testnet +ts-node evm/interchainTokenFactory.js canonical-interchain-token-id --tokenAddress 0x8A80b16621e4a14Cb98B64Fd2504b8CFe0Bf5AF1 --chainNames ethereum-sepolia --env testnet ``` ### Interchain Token Id @@ -556,13 +556,13 @@ ts-node evm/interchainTokenFactory.js canonical-interchain-token-id 0x8A80b16621 Computes the ID for an interchain token based on the deployer and a salt. ```bash -ts-node evm/interchainTokenFactory.js interchain-token-id --chainNames --env --salt +ts-node evm/interchainTokenFactory.js interchain-token-id --deployer --chainNames --env --salt ``` Example: ```bash -ts-node evm/interchainTokenFactory.js interchain-token-id 0x312dba807EAE77f01EF3dd21E885052f8F617c5B --chainNames avalanche --env testnet --salt 0x48d1c8f6106b661dfe16d1ccc0624c463e11e44a838e6b1f00117c5c74a2cd82 +ts-node evm/interchainTokenFactory.js interchain-token-id --deployer 0x312dba807EAE77f01EF3dd21E885052f8F617c5B --chainNames avalanche --env testnet --salt 0x48d1c8f6106b661dfe16d1ccc0624c463e11e44a838e6b1f00117c5c74a2cd82 ``` ### Deploy Interchain Token @@ -570,14 +570,14 @@ ts-node evm/interchainTokenFactory.js interchain-token-id 0x312dba807EAE77f01EF3 Creates a new token and optionally mints an initial amount to a specified minter ```bash -ts-node evm/interchainTokenFactory.js deploy-interchain-token --chainNames --env --salt +ts-node evm/interchainTokenFactory.js deploy-interchain-token --name --symbol --decimals --initialSupply --minter --chainNames --env --salt ``` Example: ```bash -ts-node evm/interchainTokenFactory.js deploy-interchain-token Test_Token TT 18 12345 0x312dba807EAE77f01EF3dd21E885052f8F617c5B --chainNames ethereum-sepolia --env testnet --salt 0x7abda5c65fc2720ee1970bbf2a761f6d5b599065283d3c184cb655066950e51a +ts-node evm/interchainTokenFactory.js deploy-interchain-token --name Test_Token --symbol TT --decimals 18 --initialSupply 12345 --minter 0x312dba807EAE77f01EF3dd21E885052f8F617c5B --chainNames ethereum-sepolia --env testnet --salt 0x7abda5c65fc2720ee1970bbf2a761f6d5b599065283d3c184cb655066950e51a ``` @@ -586,13 +586,13 @@ ts-node evm/interchainTokenFactory.js deploy-interchain-token Test_Token TT 18 1 Deploys a remote interchain token on a specified destination chain. No additional minter is set on the deployed token. ```bash -ts-node evm/interchainTokenFactory.js deploy-remote-interchain-token --chainNames --env --salt +ts-node evm/interchainTokenFactory.js deploy-remote-interchain-token --destinationChain --chainNames --env --salt ``` Example: ```bash -ts-node evm/interchainTokenFactory.js deploy-remote-interchain-token Avalanche --chainNames ethereum-sepolia --env testnet --salt 0x7abda5c65fc2720ee1970bbf2a761f6d5b599065283d3c184cb655066950e51a +ts-node evm/interchainTokenFactory.js deploy-remote-interchain-token --destinationChain Avalanche --chainNames ethereum-sepolia --env testnet --salt 0x7abda5c65fc2720ee1970bbf2a761f6d5b599065283d3c184cb655066950e51a ``` @@ -601,13 +601,13 @@ ts-node evm/interchainTokenFactory.js deploy-remote-interchain-token Avalanche Registers a canonical token as an interchain token and deploys its token manager. ```bash -ts-node evm/interchainTokenFactory.js register-canonical-interchain-token --chainNames --env +ts-node evm/interchainTokenFactory.js register-canonical-interchain-token --tokenAddress --chainNames --env ``` Example: ```bash -ts-node evm/interchainTokenFactory.js register-canonical-interchain-token 0xff0021D9201B51C681d26799A338f98741fBBB6a --chainNames ethereum-sepolia --env testnet +ts-node evm/interchainTokenFactory.js register-canonical-interchain-token --tokenAddress 0xff0021D9201B51C681d26799A338f98741fBBB6a --chainNames ethereum-sepolia --env testnet ``` ### Deploy Remote Canonical Interchain Token @@ -615,13 +615,13 @@ ts-node evm/interchainTokenFactory.js register-canonical-interchain-token 0xff00 Deploys a canonical interchain token on a remote chain. ```bash -ts-node evm/interchainTokenFactory.js deploy-remote-canonical-interchain-token --chainNames --env +ts-node evm/interchainTokenFactory.js deploy-remote-canonical-interchain-token --tokenAddress --destinationChain --chainNames --env ``` Example: ```bash -ts-node evm/interchainTokenFactory.js deploy-remote-canonical-interchain-token 0x4a895FB659aAD3082535Aa193886D7501650685b Avalanche --chainNames ethereum-sepolia --env testnet +ts-node evm/interchainTokenFactory.js deploy-remote-canonical-interchain-token --tokenAddress 0x4a895FB659aAD3082535Aa193886D7501650685b --destinationChain Avalanche --chainNames ethereum-sepolia --env testnet ``` ### Register Custom Token @@ -629,14 +629,14 @@ ts-node evm/interchainTokenFactory.js deploy-remote-canonical-interchain-token 0 Register an existing ERC20 token under a `tokenId` computed from the provided `salt`. ```bash -ts-node evm/interchainTokenFactory.js register-custom-token --chainNames --env --salt +ts-node evm/interchainTokenFactory.js register-custom-token --tokenAddress --tokenManagerType --operator --chainNames --env --salt ``` Example: ```bash -ts-node evm/interchainTokenFactory.js register-custom-token 0x0F6814301C0DA51bFddA9D2A6Dd877950aa0F912 4 0x03555aA97c7Ece30Afe93DAb67224f3adA79A60f --chainNames ethereum-sepolia --env testnet --salt 0x3c39e5b65a730b26afa28238de20f2302c2cdb00f614f652274df74c88d4bb50 +ts-node evm/interchainTokenFactory.js register-custom-token --tokenAddress 0x0F6814301C0DA51bFddA9D2A6Dd877950aa0F912 --tokenManagerType 4 --operator 0x03555aA97c7Ece30Afe93DAb67224f3adA79A60f --chainNames ethereum-sepolia --env testnet --salt 0x3c39e5b65a730b26afa28238de20f2302c2cdb00f614f652274df74c88d4bb50 ``` ### Link Token @@ -644,11 +644,11 @@ ts-node evm/interchainTokenFactory.js register-custom-token 0x0F6814301C0DA51bFd Links a remote token on `destinationChain` to a local token corresponding to the `tokenId` computed from the provided `salt`. ```bash -ts-node evm/interchainTokenFactory.js link-token --chainNames --env --salt +ts-node evm/interchainTokenFactory.js link-token --destinationChain --destinationTokenAddress --tokenManagerType --linkParams --chainNames --env --salt ``` Example: ```bash -ts-node evm/interchainTokenFactory.js link-token Avalanche 0xB98cF318A3cB1DEBA42a5c50c365B887cA00133C 4 0x03555aA97c7Ece30Afe93DAb67224f3adA79A60f --chainNames ethereum-sepolia --env testnet --yes --salt 0x3c39e5b65a730b26afa28238de20f2302c2cdb00f614f652274df74c88d4bb40 +ts-node evm/interchainTokenFactory.js link-token --destinationChain Avalanche --destinationTokenAddress 0xB98cF318A3cB1DEBA42a5c50c365B887cA00133C --tokenManagerType 4 --linkParams 0x03555aA97c7Ece30Afe93DAb67224f3adA79A60f --chainNames ethereum-sepolia --env testnet --yes --salt 0x3c39e5b65a730b26afa28238de20f2302c2cdb00f614f652274df74c88d4bb40 ``` From b83640462f1930e3bc64c11504e78c7302734606 Mon Sep 17 00:00:00 2001 From: benjamin852 Date: Thu, 16 Oct 2025 09:51:11 -0400 Subject: [PATCH 20/22] chore: added ts-node in release template --- releases/evm/EVM-ITS-Release-Template.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/releases/evm/EVM-ITS-Release-Template.md b/releases/evm/EVM-ITS-Release-Template.md index 026c64eae..0db57fbcc 100644 --- a/releases/evm/EVM-ITS-Release-Template.md +++ b/releases/evm/EVM-ITS-Release-Template.md @@ -99,7 +99,7 @@ ts-node evm/its.js checks -n $CHAIN -y ts-node evm/interchainTokenFactory.js deploy-interchain-token --name [name] --symbol [symbol] --decimals [decimals] --initialSupply [initial-supply] --minter [minter] --salt "salt1234" -n $CHAIN # Deploy token to a remote chain -node evm/interchainTokenFactory.js deploy-remote-interchain-token --destinationChain [destination-chain] --salt "salt1234" -n $CHAIN +ts-node evm/interchainTokenFactory.js deploy-remote-interchain-token --destinationChain [destination-chain] --salt "salt1234" -n $CHAIN # Transfer token to remote chain ts-node evm/its.js interchain-transfer [destination-chain] [token-id] [recipient] 1 --gasValue [gas-value] -n $CHAIN From a73b69b69ad904390cb1ee305e24d1201d8aefcc Mon Sep 17 00:00:00 2001 From: benjamin852 Date: Fri, 17 Oct 2025 10:18:48 -0400 Subject: [PATCH 21/22] chore: refactor args to options --- evm/interchainTokenFactory.js | 52 +++++++++++++++++------------------ 1 file changed, 25 insertions(+), 27 deletions(-) diff --git a/evm/interchainTokenFactory.js b/evm/interchainTokenFactory.js index 9b5271633..42954e0c9 100644 --- a/evm/interchainTokenFactory.js +++ b/evm/interchainTokenFactory.js @@ -86,7 +86,7 @@ async function processCommand(_axelar, chain, chains, action, options) { } case 'interchain-token-deploy-salt': { - const [deployer] = args; + const { deployer } = options; const deploymentSalt = getDeploymentSalt(options); @@ -103,7 +103,7 @@ async function processCommand(_axelar, chain, chains, action, options) { } case 'canonical-interchain-token-deploy-salt': { - const [tokenAddress] = args; + const { tokenAddress } = options; validateParameters({ isValidAddress: { tokenAddress } }); const canonicalInterchainTokenDeploySalt = await interchainTokenFactory.canonicalInterchainTokenDeploySalt(tokenAddress); @@ -113,7 +113,7 @@ async function processCommand(_axelar, chain, chains, action, options) { } case 'interchain-token-id': { - const [deployer] = args; + const { deployer } = options; const deploymentSalt = getDeploymentSalt(options); @@ -126,7 +126,7 @@ async function processCommand(_axelar, chain, chains, action, options) { } case 'canonical-interchain-token-id': { - const [tokenAddress] = args; + const { tokenAddress } = options; validateParameters({ isValidAddress: { tokenAddress } }); @@ -135,8 +135,10 @@ async function processCommand(_axelar, chain, chains, action, options) { break; } + case 'deploy-interchain-token': { - const [name, symbol, decimals, initialSupply, minter] = args; + // const [name, symbol, decimals, initialSupply, minter] = args; + const { name, symbol, decimals, initialSupply, minter } = options; const deploymentSalt = getDeploymentSalt(options); @@ -167,7 +169,7 @@ async function processCommand(_axelar, chain, chains, action, options) { } case 'deploy-remote-interchain-token': { - const [destinationChain] = args; + const { destinationChain } = options; const { env } = options; const deploymentSalt = getDeploymentSalt(options); @@ -208,7 +210,7 @@ async function processCommand(_axelar, chain, chains, action, options) { } case 'register-canonical-interchain-token': { - const [tokenAddress] = args; + const { tokenAddress } = options; validateParameters({ isValidAddress: { tokenAddress } }); @@ -224,7 +226,7 @@ async function processCommand(_axelar, chain, chains, action, options) { } case 'deploy-remote-canonical-interchain-token': { - const [tokenAddress, destinationChain] = args; + const { tokenAddress, destinationChain } = options; const { env } = options; const { gasValue, gasFeeValue } = await estimateITSFee( @@ -260,7 +262,7 @@ async function processCommand(_axelar, chain, chains, action, options) { } case 'register-custom-token': { - const [tokenAddress, tokenManagerType, operator] = args; + const { tokenAddress, tokenManagerType, operator } = options; const deploymentSalt = getDeploymentSalt(options); @@ -287,7 +289,7 @@ async function processCommand(_axelar, chain, chains, action, options) { } case 'link-token': { - const [destinationChain, destinationTokenAddress, tokenManagerType, linkParams] = args; + const { destinationChain, destinationTokenAddress, tokenManagerType, linkParams } = options; const { env } = options; @@ -330,8 +332,8 @@ async function processCommand(_axelar, chain, chains, action, options) { } } -async function main(action, args, options) { - options.args = args; +async function main(action, options) { + // options.args = args; return mainProcessor(options, (axelar, chain, chains, options) => processCommand(axelar, chain, chains, action, options)); } @@ -344,7 +346,7 @@ if (require.main === module) { .command('contract-id') .description('Get contract ID') .action((options, cmd) => { - main(cmd.name(), [], options); + main(cmd.name(), options); }); program @@ -352,7 +354,7 @@ if (require.main === module) { .description('Get interchain token deploy salt') .requiredOption('--deployer ', 'Deployer address') .action((options, cmd) => { - main(cmd.name(), [options.deployer], options); + main(cmd.name(), options); }); program @@ -360,7 +362,7 @@ if (require.main === module) { .description('Get canonical interchain token deploy salt') .requiredOption('--tokenAddress ', 'Token address') .action((options, cmd) => { - main(cmd.name(), [options.tokenAddress], options); + main(cmd.name(), options); }); program @@ -368,7 +370,7 @@ if (require.main === module) { .description('Get canonical interchain token id') .requiredOption('--tokenAddress ', 'Token address') .action((options, cmd) => { - main(cmd.name(), [options.tokenAddress], options); + main(cmd.name(), options); }); program @@ -376,7 +378,7 @@ if (require.main === module) { .description('Get interchain token id') .requiredOption('--deployer ', 'Deployer') .action((options, cmd) => { - main(cmd.name(), [options.deployer], options); + main(cmd.name(), options); }); program @@ -388,7 +390,7 @@ if (require.main === module) { .requiredOption('--initialSupply ', 'Initial supply') .requiredOption('--minter ', 'Minter') .action((options, cmd) => { - main(cmd.name(), [options.name, options.symbol, options.decimals, options.initialSupply, options.minter], options); + main(cmd.name(), options); }); program @@ -397,7 +399,7 @@ if (require.main === module) { .requiredOption('--destinationChain ', 'Destination chain') .addOption(new Option('--gasValue ', 'gas value').default('auto')) .action((options, cmd) => { - main(cmd.name(), [options.destinationChain], options); + main(cmd.name(), options); }); program @@ -405,7 +407,7 @@ if (require.main === module) { .description('Register canonical interchain token') .requiredOption('--tokenAddress ', 'Token address') .action((options, cmd) => { - main(cmd.name(), [options.tokenAddress], options); + main(cmd.name(), options); }); program @@ -415,7 +417,7 @@ if (require.main === module) { .requiredOption('--destinationChain ', 'Destination chain') .addOption(new Option('--gasValue ', 'gas value').default('auto')) .action((options, cmd) => { - main(cmd.name(), [options.tokenAddress, options.destinationChain], options); + main(cmd.name(), options); }); program @@ -425,7 +427,7 @@ if (require.main === module) { .requiredOption('--tokenManagerType ', 'Token manager type') .requiredOption('--operator ', 'Operator') .action((options, cmd) => { - main(cmd.name(), [options.tokenAddress, options.tokenManagerType, options.operator], options); + main(cmd.name(), options); }); program @@ -437,11 +439,7 @@ if (require.main === module) { .requiredOption('--linkParams ', 'Link params') .addOption(new Option('--gasValue ', 'gas value').default('auto')) .action((options, cmd) => { - main( - cmd.name(), - [options.destinationChain, options.destinationTokenAddress, options.tokenManagerType, options.linkParams], - options, - ); + main(cmd.name(), options); }); addOptionsToCommands(program, addEvmOptions, { address: true, salt: true }); From 16461987186bf70719ce0809a0147a660ddc9f7a Mon Sep 17 00:00:00 2001 From: benjamin852 Date: Fri, 17 Oct 2025 10:31:35 -0400 Subject: [PATCH 22/22] chore: removed commented code --- evm/interchainTokenFactory.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/evm/interchainTokenFactory.js b/evm/interchainTokenFactory.js index 42954e0c9..930a8aff4 100644 --- a/evm/interchainTokenFactory.js +++ b/evm/interchainTokenFactory.js @@ -137,7 +137,6 @@ async function processCommand(_axelar, chain, chains, action, options) { } case 'deploy-interchain-token': { - // const [name, symbol, decimals, initialSupply, minter] = args; const { name, symbol, decimals, initialSupply, minter } = options; const deploymentSalt = getDeploymentSalt(options); @@ -333,7 +332,6 @@ async function processCommand(_axelar, chain, chains, action, options) { } async function main(action, options) { - // options.args = args; return mainProcessor(options, (axelar, chain, chains, options) => processCommand(axelar, chain, chains, action, options)); }