Granite Upgrade Activates in06d:02h:04m:27s
Interchain Token Transfers

Deployment Methods

deployERC20Token

Deploys a new ERC20 token on the source chain.

Parameters

ParameterTypeRequiredDescription
walletClientWalletClientYesWallet client for signing
sourceChainChainConfigYes*Source chain configuration
namestringYesToken name
symbolstringYesToken symbol
initialSupplynumberYesInitial token supply
recipientAddressNoRecipient of initial supply (defaults to wallet address)

* Required if not set in client constructor

Returns

TypeDescription
Promise<{ txHash: 0x${string}, contractAddress: 0x${string} }>Transaction hash and contract address

Example

const { txHash, contractAddress } = await ictt.deployERC20Token({
  walletClient: wallet,
  sourceChain: avalancheFuji,
  name: "My Token",
  symbol: "MTK",
  initialSupply: 1000000,
});

deployTokenHomeContract

Deploys a token home contract on the source chain.

Parameters

ParameterTypeRequiredDescription
walletClientWalletClientYesWallet client for signing
sourceChainChainConfigYes*Source chain configuration
erc20TokenAddressAddressYesERC20 token address
minimumTeleporterVersionnumberYesMinimum Teleporter version
tokenHomeCustomByteCodestringNoCustom bytecode
tokenHomeCustomABIABINoCustom ABI

Returns

TypeDescription
Promise<{ txHash: 0x${string}, contractAddress: 0x${string} }>Transaction hash and contract address

Example

const { txHash, contractAddress } = await ictt.deployTokenHomeContract({
  walletClient: wallet,
  sourceChain: avalancheFuji,
  erc20TokenAddress: tokenAddress,
  minimumTeleporterVersion: 1,
});

deployTokenRemoteContract

Deploys a token remote contract on the destination chain.

Parameters

ParameterTypeRequiredDescription
walletClientWalletClientYesWallet client for signing
sourceChainChainConfigYes*Source chain configuration
destinationChainChainConfigYes*Destination chain configuration
tokenHomeContractAddressYesToken home contract address
tokenRemoteCustomByteCodestringNoCustom bytecode
tokenRemoteCustomABIABINoCustom ABI

Returns

TypeDescription
Promise<{ txHash: 0x${string}, contractAddress: 0x${string} }>Transaction hash and contract address

Example

const { txHash, contractAddress } = await ictt.deployTokenRemoteContract({
  walletClient: wallet,
  sourceChain: avalancheFuji,
  destinationChain: dispatch,
  tokenHomeContract: tokenHomeAddress,
});

registerRemoteWithHome

Registers the token remote contract with the token home contract.

Parameters

ParameterTypeRequiredDescription
walletClientWalletClientYesWallet client for signing
sourceChainChainConfigYes*Source chain configuration
destinationChainChainConfigYes*Destination chain configuration
tokenRemoteContractAddressYesToken remote contract address
feeTokenAddressAddressNoFee token address
feeAmountnumberNoFee amount

Returns

TypeDescription
Promise<{ txHash: 0x${string} }>Transaction hash

Example

const { txHash } = await ictt.registerRemoteWithHome({
  walletClient: wallet,
  sourceChain: avalancheFuji,
  destinationChain: dispatch,
  tokenRemoteContract: tokenRemoteAddress,
});

Is this guide helpful?