Request form
Cookbook may introduce a token in the future. Share and contribute to be eligible for future airdrops.
close icon
relevant tag icon
Cross-chain Token Transfer
copy icon
Axelar
• version 1.0.0
crosschain
token
relay

Cross-chain Token Transfer

Mints some amount of ERC-20 tokens at a source chain and sends it using the callContract function to a destination chain. Tokens are burned on the source-chain contract and minted on the destination-chain contract. Get more info: https://github.com/axelarnetwork/axelar-examples/tree/main/examples/evm/cross-chain-token

*Visit desktop site to download or deploy

Version

1.0.0

Creator

Axelar

Last Publish

2/28/2023
Any contract you deploy is yours.
Fully owned and controlled by your wallet.
Documentation
Source Code
_setup() :
This function sets up the name and symbol of a token contract. It takes in two strings as parameters, which are decoded using the ABI. If the name is not empty, it reverts the transaction. Otherwise, it sets the name and symbol of the token contract to the two strings passed in as parameters. (autogenerated documentation)
giveMe(uint256) :
This function is an external function that allows a user to mint a given amount of tokens. It takes in a uint256 amount as an argument and uses the _mint() function to mint the given amount of tokens to the sender of the transaction. (autogenerated documentation)
transferRemote(string,address,uint256) :
This function is used to transfer tokens from one chain to another. It takes three parameters: the destination chain, the destination address, and the amount of tokens to be transferred. The function first burns the amount of tokens from the sender's account, then encodes the destination address and amount into a payload. It then checks if there is a value in the msg.value, and if so, it pays the native gas for the contract call. Finally, it calls the gateway contract with the destination chain, the address of the contract, the payload, and the sender's address. (autogenerated documentation)
_execute(string,string) :
This function is an internal override function that is used to mint tokens. It takes in three parameters: calldata, sourceAddress, and payload. It then checks to make sure that the sourceAddress is the same as the address of the contract. If it is, it decodes the payload to get the address of the recipient and the amount of tokens to be minted. Finally, it calls the _mint function to mint the tokens. (autogenerated documentation)
contractId() :
This function returns a bytes32 value that is the result of the keccak256 hashing algorithm applied to the string 'example'. The keccak256 algorithm is a cryptographic hashing algorithm that takes an input of any length and produces a fixed-length output. This output is a unique identifier that can be used to identify the input data. In this case, the output is a bytes32 value that can be used to uniquely identify the string 'example'. (autogenerated documentation)

Get Cookin'
share iconShare

copy iconDownload Source
copy iconnpx cookbookdev i Cross-chain-Token-Transfer
copy icon

Last Publish

2/28/2023

Version

1.0.0

Creator

Axelar

Cookbook is free.
Any contract you deploy is yours.
Your contract is owned and controlled by you.