Skip to main content
This page documents the public methods and events exposed by CCTP smart contracts on EVM-compatible blockchains.

Contract responsibilities

  • TokenMessengerV2: Entrypoint for crosschain USDC transfer. Routes messages to burn USDC on a source blockchain and mint USDC on a destination blockchain.
  • MessageTransmitterV2: Generic message passing. Sends all messages on the source blockchain and receives all messages on the destination blockchain.
  • TokenMinterV2: Responsible for minting and burning USDC. Contains blockchain-specific settings used by burners and minters.
  • MessageV2: Provides helper functions for crosschain transfers, such as bytes32ToAddress and addressToBytes32, which are commonly used when bridging between EVM and non-EVM blockchains.
Gas optimization tip: If you’re writing your own integration, it’s more gas-efficient to include address conversion logic directly in your contract rather than calling an external contract.
Full contract source code is available on GitHub.

TokenMessengerV2

depositForBurn

Deposits and burns tokens from sender to be minted on destination domain. Minted tokens will be transferred to mintRecipient.
Note: There is a $10 million limit on the amount of USDC that can be burned in a single CCTP transaction. If the amount exceeds this limit, the transaction will revert. If you need to transfer more than this limit, break up your transfers into multiple transactions.For Fast Transfers, you should always check the remaining allowance before initiating a transfer to ensure there is enough to complete your transfer.
Parameters
FieldTypeDescription
amountuint256Amount of tokens to deposit and burn
destinationDomainuint32Destination domain ID to send the message to
mintRecipientbytes32Address of mint recipient on destination domain (must be converted to 32 byte array, that is, prefix with zeros if needed)
burnTokenaddressAddress of contract to burn deposited tokens on local domain
destinationCallerbytes32Address as bytes32 which can call receiveMessage on destination domain. If set to bytes32(0), any address can call receiveMessage
maxFeeuint256Maximum fee paid for transfer, specified in units of burnToken
minFinalityThresholduint32Minimum finality threshold at which burn will be attested
Example
Solidity
// Burn 100 USDC on Ethereum for minting on Avalanche
uint256 amount = 100 * 10**6; // 100 USDC
uint32 destinationDomain = 1; // Avalanche
bytes32 mintRecipient = bytes32(uint256(uint160(recipientAddress)));
address burnToken = 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48; // USDC on Ethereum
bytes32 destinationCaller = bytes32(0); // Anyone can call receiveMessage
uint256 maxFee = 1000; // 0.001 USDC max fee
uint32 minFinalityThreshold = 1000; // Fast Transfer

tokenMessenger.depositForBurn(
  amount,
  destinationDomain,
  mintRecipient,
  burnToken,
  destinationCaller,
  maxFee,
  minFinalityThreshold
);

depositForBurnWithHook

Deposits and burns tokens from sender to be minted on destination domain, and emits a crosschain message with additional hook data appended. In addition to the standard depositForBurn parameters, depositForBurnWithHook accepts a dynamic-length hookData parameter, allowing you to include additional metadata that can trigger custom logic on the destination blockchain.
Note: There is a $10 million limit on the amount of USDC that can be burned in a single CCTP transaction. If the amount exceeds this limit, the transaction will revert. If you need to transfer more than this limit, break up your transfers into multiple transactions.For Fast Transfers, you should always check the remaining allowance before initiating a transfer to ensure there is enough to complete your transfer.
Parameters
FieldTypeDescription
amountuint256Amount of tokens to burn
destinationDomainuint32Destination domain to send the message to
mintRecipientbytes32Address of mint recipient on destination domain (must be converted to 32 byte array, that is, prefix with zeros if needed)
burnTokenaddressAddress of contract to burn deposited tokens on local domain
destinationCallerbytes32Address as bytes32 which can call receiveMessage on destination domain. If set to bytes32(0), any address can call receiveMessage
maxFeeuint256Maximum fee paid for transfer, specified in units of burnToken
minFinalityThresholduint32Minimum finality threshold at which burn will be attested
hookDatabytesAdditional metadata attached to the attested message, used to trigger custom logic on the destination blockchain

getMinFeeAmount

Calculates and returns the minimum fee required for a given amount in a Standard Transfer. If the minimum fee (per unit of burnToken) is non-zero, the specified maxFee must be at least the returned minimum fee. Otherwise, the burn will revert onchain. Parameters
FieldTypeDescription
amountuint256The amount used to compute the minimum fee. Must be greater than 1 if standard fee is applied

handleReceiveFinalizedMessage

Handles incoming message received by the local MessageTransmitter. For a burn message, mints the associated token to the requested recipient on the local domain. Validates the function sender is the local MessageTransmitter, and the remote sender is a registered remote TokenMessenger for remoteDomain. This method is called for messages where finalityThresholdExecuted ≥ 2000 (Standard Transfer). Parameters
FieldTypeDescription
remoteDomainuint32The domain where the message originated from
senderbytes32The sender of the message (remote TokenMessenger)
finalityThresholdExecuteduint32Specifies the level of finality Circle signed the message with
messageBodybytes (dynamic length)The message body bytes

handleReceiveUnfinalizedMessage

Handles incoming message received by the local MessageTransmitter. For a burn message, mints the associated token to the requested recipient on the local domain. Similar to handleReceiveFinalizedMessage, but is called for messages which are not finalized (finalityThresholdExecuted < 2000) such as Fast Transfers. Unlike handleReceiveFinalizedMessage, handleReceiveUnfinalizedMessage processes messages with:
  • expirationBlock: If expirationBlockblockNumber on the destination domain, the message will revert and must be re-signed without the expiration block.
  • feeExecuted: If nonzero, the feeExecuted amount is minted to the feeRecipient.
Parameters
FieldTypeDescription
remoteDomainuint32The domain where the message originated from
senderbytes32The sender of the message (remote TokenMessenger)
finalityThresholdExecuteduint32Specifies the level of finality Circle signed the message with
messageBodybytes (dynamic length)The message body bytes (see Message format)

MessageTransmitterV2

receiveMessage

Receives message on destination blockchain by passing message and attestation. Emits MessageReceived event. Messages with a given nonce can only be broadcast successfully once for a pair of domains. The message body of a valid message is passed to the specified recipient for further processing. Parameters
FieldTypeDescription
messagebytesEncoded message (see Message format)
attestationbytesSigned attestation received from Circle’s attestation service
Example
Solidity
// Mint USDC on destination chain
bytes memory message = attestationData.message;
bytes memory attestation = attestationData.attestation;

messageTransmitter.receiveMessage(message, attestation);

sendMessage

Sends a message to the recipient on the destination domain. Emits a MessageSent event which will be attested by Circle’s attestation service. Parameters
FieldTypeDescription
destinationDomainuint32Destination domain ID to send the message to
recipientbytes32Address of recipient on destination domain
destinationCallerbytes32Address as bytes32 which can call receiveMessage on destination domain. If set to bytes32(0), any address can call receiveMessage
minFinalityThresholduint32Minimum finality threshold requested. A value greater than 2000 is interpreted as 2000 (finalized). Thresholds: 1000 for Fast Transfer (confirmed), 2000 for Standard Transfer (finalized)
messageBodybytesapplication-specific message to be handled by recipient

Events

DepositForBurn

Emitted when USDC is burned on the source blockchain. Parameters
FieldTypeIndexedDescription
nonceuint64YesUnique message identifier
burnTokenaddressYesAddress of token burned
amountuint256NoBurn amount
depositoraddressYesAddress of depositor
mintRecipientbytes32NoMint recipient address on destination domain
destinationDomainuint32NoDestination domain identifier
destinationTokenMessengerbytes32NoAddress of TokenMessenger contract on destination domain
destinationCallerbytes32NoAuthorized caller of receiveMessage on destination domain
maxFeeuint256NoMaximum fee for the transfer
minFinalityThresholduint32NoMinimum finality threshold at which burn will be attested

MessageSent

Emitted when a message is sent from the source blockchain. Parameters
FieldTypeIndexedDescription
messagebytesNoRaw bytes of message

MessageReceived

Emitted when a message is received on the destination blockchain. Parameters
FieldTypeIndexedDescription
calleraddressYesAddress that called receiveMessage
sourceDomainuint32YesSource domain identifier
nonceuint64YesUnique message identifier
senderbytes32NoAddress of message sender on source domain
messageBodybytesNoMessage body

MintAndWithdraw

Emitted when USDC is minted on the destination blockchain. Parameters
FieldTypeIndexedDescription
mintRecipientaddressYesAddress receiving minted USDC
amountuint256NoAmount minted
mintTokenaddressYesAddress of token minted