Skip to main content

Contract responsibilities

  • TokenMessengerV2: Entrypoint for crosschain USDC transfer. Routes messages to burn USDC on a source chain, and mint USDC on a destination chain.
  • MessageTransmitterV2: Generic message passing. Sends all messages on the source chain, and receives all messages on the destination chain.
  • TokenMinterV2: Responsible for minting and burning USDC. Contains chain-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 chains. These conversions are simple: prepend 12 zero bytes to an EVM address, or strip them to convert back.
Note: If you’re writing your own integration, it’s more gas-efficient to include this logic directly in your contract rather than calling an external one.
Full contract source code is available on GitHub.

Mainnet contract addresses

TokenMessengerV2: Mainnet

MessageTransmitterV2: Mainnet

TokenMinterV2: Mainnet

MessageV2: Mainnet

Testnet contract addresses

TokenMessengerV2: Testnet

MessageTransmitterV2: Testnet

TokenMinterV2: Testnet

MessageV2: Testnet

CCTP Interface

This section provides the Smart Contract Interface exposed by CCTP, outlining the available functions, and their parameters. The interface below serves as a reference for permissionless messaging functions exposed by the TokenMessengerV2 and MessageTransmitterV2 functions.

TokenMessengerV2

depositForBurn

Deposits and burns tokens from sender to be minted on destination domain, and emits a crosschain message by calling MessageTransmitter’s sendMessage function. 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
maxFeeuint256Max fee paid for fast burn, specified in units of burnToken
minFinalityThresholduint32Minimum finality threshold at which burn will be attested

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 the caller to include additional metadata to the attested message, which can be used to trigger custom logic on the destination chain.
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
maxFeeuint256Max fee paid for fast burn, specified in units of burnToken
minFinalityThresholduint32Minimum finality threshold at which burn will be attested
hookDatabytesAdditional metadata attached to the attested message, which can be used to trigger custom logic on the destination chain

getMinFeeAmount

Calculates and returns the minimum fee required for a given amount in a Standard Transfer. If the minFee (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, and takes the appropriate action. 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. Parameters
FieldTypeDescription
remoteDomainuint32The domain where the message originated from
senderbytes32The sender of the message (remote TokenMessenger)
finalityThresholdExecuteduint32Specifies the level of finality Iris signed the message with
messageBodybytes (dynamic length)The message body bytes

handleReceiveUnfinalizedMessage

Handles incoming message received by the local MessageTransmitter, and takes the appropriate action. 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. Similar to handleReceiveFinalizedMessage, but is called for messages which are not finalized (finalityThresholdExecuted < 2000). Unlike handleReceiveFinalizedMessage, handleReceiveUnfinalizedMessage has the following messageBody parameters:
  • 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 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 Iris signed the message with
messageBodybytes (dynamic length)The message body bytes (see Message format)

MessageTransmitterV2

receiveMessage

Receive message on destination chain 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 attestation service (Iris)

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.

Initially, supported values for minFinalityThreshold are [1, 2000]. A value outside of the support values range will be interpreted as 2000 (finalized) by the attestation service (Iris).

For a value within the supported range, the attestation service (Iris) will attest the message with a finalityThresholdExecuted >= minFinalityThreshold.

Initial thresholds supported:

1000: Confirmed
2000: Finalized
messageBodybytesApp-specific message to be handled by recipient