Overview
TheITokenMinter interface defines the contract for managing tokens that are mintable, burnable, and transferable across domains. This interface is central to CCTP’s token transfer mechanism, handling the burn on source chains and mint on destination chains.
Interface Definition
ITokenMinter (V1)
src/interfaces/ITokenMinter.sol:23
ITokenMinterV2
V2 extends the base interface with multi-recipient minting:src/interfaces/v2/ITokenMinterV2.sol:27
Functions
mint
sourceDomain- The domain ID where the tokens were burnedburnToken- The address of the burned token on the source domain (as bytes32)to- The address to receive the minted tokens on this domainamount- The amount of tokens to mint
mintToken- The address of the token contract that was minted
- The (
sourceDomain,burnToken) pair does not map to a valid local token - The amount exceeds the minter’s allowance for the token
- The mint operation fails
burn
burnToken- The address of the token contract to burn fromamount- The amount of tokens to burn
- The amount exceeds the TokenMinter’s balance of the token
- The burn operation fails
getLocalToken
remoteDomain- The remote domain IDremoteToken- The token address on the remote domain (as bytes32)
- The local token address, or address(0) if no mapping exists
setTokenController
newTokenController- The address of the new token controller
Token Management
Token Mappings
The TokenMinter maintains bidirectional mappings between local and remote tokens:Minter Allowances
Each token has a per-minter allowance that limits the amount that can be minted:- Prevents unlimited minting even if the minter is compromised
- Set by the token controller based on liquidity and risk parameters
- Must be sufficient to cover the mint amount
Token Controller
The token controller is responsible for:- Mapping local tokens to remote tokens across domains
- Setting and managing per-minter allowances
- Configuring token-specific transfer limits
- Managing token-related permissions
V2 Enhancements
Multi-Recipient Minting
V2 introduces the ability to mint to multiple recipients in a single operation:sourceDomain- The domain where tokens were burnedburnToken- The burned token address (as bytes32)recipientOne- First recipient addressrecipientTwo- Second recipient addressamountOne- Amount to mint to first recipientamountTwo- Amount to mint to second recipient
- The address of the minted token contract
- Fee splitting between recipient and relayer
- Atomic distribution to multiple parties
- Gas-efficient multi-party settlements
Usage in CCTP Flow
Burn Flow (Source Chain)
- User approves TokenMessenger to spend tokens
- TokenMessenger transfers tokens to TokenMinter
- TokenMinter burns the tokens:
src/TokenMessenger.sol:444
Mint Flow (Destination Chain)
- MessageReceiver validates and forwards message to TokenMessenger
- TokenMessenger calls TokenMinter to mint tokens:
src/TokenMessenger.sol:534
Implementation Requirements
Security Considerations
- Access Control - Only authorized contracts (e.g., TokenMessenger) should call mint/burn
- Token Validation - Verify token mappings exist before minting
- Allowance Checks - Ensure mint amounts don’t exceed minter allowances
- Balance Verification - Confirm sufficient balance before burning
Example Implementation Pattern
Related Interfaces
- IMessageHandler - Handles messages that trigger mint operations
- IMintBurnToken - Token contract interface for mint/burn operations
- TokenMessenger - Primary user of ITokenMinter interface