A basic ERC677 compatible token contract with burn and minting roles.
The Cross-Chain Token (CCT) standard offers a streamlined and decentralized approach to enabling token transfers across blockchains using Chainlink's Cross-Chain Interoperability Protocol (CCIP). With the introduction of CCTs, token developers now have the power to deploy, configure, and manage their own token pools in CCIP via a simple interface. Learn more at the Official Chainlink Documentation
Before enabling an ERC20-compatible token in CCIP, it's important to understand the requirements it must fulfill to integrate with CCIP.
A token can utilize either of these supported function signatures to register permissionlessly:
owner()
: This function returns the token contract owner's address.
getCCIPAdmin()
: This function returns the token administrator's address and is recommended for new tokens, as it allows for abstraction of the CCIP Token Administrator role from other common roles, like owner()
.
The token's smart contract must meet minimum requirements to integrate with CCIP.
mint(address account, uint256 amount)
: This function is used to mint the amount of tokens to a given account on the destination blockchain.burn(uint256 amount)
: This function is used to burn the amount of tokens on the source blockchain.decimals()
: Returns the token's number of decimals.balanceOf(address account)
: Returns the current token balance of the specified account.burnFrom(address account, uint256 amount)
: This function burns a specified number of tokens from the provided account on the source blockchain. Note: This is an optional function. We generally recommend using the burn
function, but if you use a tokenPool
that calls burnFrom
, your token contract will need to implement this function.mint
and burn
permissions. The token developers or another role (such as the token administrator) will grant these permissions to the token pool.decimals()
: Returns the token's number of decimals.balanceOf(address account)
: Returns the current token balance of the specified account.The BurnMintERC677
token is CCT compatible!
Whether you're working with an Externally Owned Account (EOA) or a Smart Account (such as one using a multisig scheme), the overall logic remains the same.
BurnMintERC677
token on each blockchainBurnMintTokenPool
by calling the grantMintAndBurnRoles(address(burnMintTokenPool))
function of the BurnMintERC677
token on each blockchainregisterAdminViaOwner(address(myToken))
function of the RegistryModuleOwnerCustom smart contract on each blockchainacceptAdminRole(address(myToken))
function of the TokenAdminRegistry smart contract on each blockchainsetPool(address(myToken), address(burnMintTokenPool))
function of the TokenAdminRegistry smart contract on each blockchainapplyChainUpdates
function of the BurnMintTokenPool smart contract and provide:chainSelector
,true
ifthe chain should be enabled, false
otherwise. We will put true
here.isEnabled
- true
/false
capacity
rate
isEnabled
- true
/false
capacity
rate