Documentation Index
Fetch the complete documentation index at: https://mintlify.com/circlefin/evm-cctp-contracts/llms.txt
Use this file to discover all available pages before exploring further.
IMintBurnToken Interface
TheIMintBurnToken interface defines the contract interface for ERC20 tokens that support both minting and burning operations. This interface is implemented by USDC and other tokens that integrate with CCTP’s TokenMinter contract.
Source: IMintBurnToken.sol
Overview
IMintBurnToken extends the standard ERC20 interface (IERC20) with additional mint and burn functions. These functions are called by the TokenMinter contract during cross-chain transfers:
mint()is called when receiving USDC on the destination chainburn()is called when sending USDC from the source chain
Interface Definition
Functions
mint
Mints new tokens to a specified address.Parameters
to(address): The address that will receive the minted tokensamount(uint256): The amount of tokens to mint (must be less than or equal to the minter’s allowance)
Returns
bool: Returnstrueif the operation was successful
Requirements
- Caller must have minter role
- Caller must have sufficient minter allowance
- Recipient address must not be blacklisted
- Amount must be greater than 0
Usage in CCTP
The TokenMinter contract calls this function when processing a cross-chain transfer on the destination chain. After verifying the attestation, TokenMinter mints the specified amount of USDC to the recipient. Reference:src/TokenMinter.sol:111
burn
Burns tokens from the caller’s balance.Parameters
amount(uint256): The amount of tokens to burn from the caller’s balance
Requirements
- Caller must have minter role
- Caller must not be blacklisted
- Amount must be less than or equal to the caller’s balance
- Amount must be greater than 0
Usage in CCTP
The TokenMinter contract calls this function when processing adepositForBurn request on the source chain. The USDC is burned before the cross-chain message is sent.
Reference: src/TokenMinter.sol:86
Implementation Example
Here’s how a token contract might implement this interface:Integration with CCTP
Token Registration
For a token to be used with CCTP, it must:- Implement the
IMintBurnTokeninterface - Grant minter role to the TokenMinter contract
- Set appropriate minter allowance for the TokenMinter
- Be registered via
TokenController.linkTokenPair()
Burn-and-Mint Flow
-
Source Chain: User calls
TokenMessenger.depositForBurn()- TokenMessenger calls
TokenMinter.burn() - TokenMinter calls
IMintBurnToken.burn()on USDC contract - USDC is burned from user’s balance
- TokenMessenger calls
- Attestation: Circle attesters sign the message hash
-
Destination Chain: Relayer calls
MessageTransmitter.receiveMessage()- MessageTransmitter calls
TokenMessenger.handleReceiveMessage() - TokenMessenger calls
TokenMinter.mint() - TokenMinter calls
IMintBurnToken.mint()on USDC contract - USDC is minted to recipient’s address
- MessageTransmitter calls
Security Considerations
Access Control
- Minter Role: Only authorized minters (like TokenMinter) should be able to call
mint()andburn() - Allowance Limits: Implement minter allowances to cap the maximum amount that can be minted
- Blacklisting: Support address blacklisting to comply with regulatory requirements
Validation
- Amount Checks: Always validate that amounts are greater than zero
- Balance Checks: Ensure sufficient balance before burning
- Overflow Protection: Use SafeMath or Solidity 0.8+ to prevent overflows
Related Interfaces
- ITokenMinter - Uses IMintBurnToken to manage token supply
- TokenMinter - Contract that calls these functions
- TokenController - Manages token pair configurations
External Resources
- Circle USDC Implementation - Reference implementation
- ERC20 Standard - Base token standard