Interchain Token Service Executable
You can use the Axelar Interchain Token Service (ITS) to create a new Interchain Token or integrate an existing ERC-20 token to ITS to give your token bridging functionality.
ITS also allows you to send GMP messages when making a cross-chain transfer for an ITS token.
If you are looking to have an ITS compatible token that can send GMP messages, the token must inherit from the InterchainExecutable contract.
Once the token has been deployed and integrated with ITS you can use the executable functionality to send messages along with your cross-chain token transfer.
Send Token + Message from Source Chain
Send a message alongside a token using the callContractWithInterchainToken()
function from the Interchain Token Service. You should provide the tokenId
, destinationChain
, destinationAddress
, amount
, message
, and gasValue
as parameters.
The destinationAddress
should be an address encoded as bytes. Use the toBytes()
method to quickly accomplish this on-chain.
Execute on Destination Chain
The InterchainTokenExecutable
contains an _executeWithInterchainToken()
function that is triggered on the destination chain after the callContractWithInterchainToken()
function is executed on the source chain. The purpose of this function is to validate the contract call and then invoke your _executeWithInterchainToken()
method. You can write any custom logic inside this method.
What’s next
To find more examples of how to utilize the Interchain Token Service and test the Interchain Token Service Executable, please refer to the axelar-examples
repository on GitHub.