Skip to content
Lattice

ITokenMessengerV2

Git Source

Title: ITokenMessengerV2

Author: Vendored minimal subset of Circle's CCTP v2 TokenMessengerV2

(https://github.com/circlefin/evm-cctp-contracts). Upstream license: Apache-2.0. Upstream compiles at Solidity 0.7.6 — this subset is REDECLARED at pragma ^0.8.30. Only the depositForBurn / depositForBurnWithHook methods the CCTPBridgeAdapter calls are re-declared; do NOT add an evm-cctp-contracts dependency.

Source-side entrypoint of CCTP v2: burns amount of burnToken (USDC) on the local chain and emits the burn message an off-chain Circle attestation service (Iris) later attests for minting on the destination domain. CCTP is a TOKEN BRIDGE, not an ERC-7786 message gateway.

Functions

depositForBurn

Burns amount of burnToken and signals a mint of the same amount on destinationDomain.

function depositForBurn(
        uint256 amount,
        uint32 destinationDomain,
        bytes32 mintRecipient,
        address burnToken,
        bytes32 destinationCaller,
        uint256 maxFee,
        uint32 minFinalityThreshold
    ) external;

Parameters

NameTypeDescription
amountuint256Amount of burnToken to burn (pulled from the caller — the adapter).
destinationDomainuint32CCTP domain id of the destination chain (admin-registered, e.g. Eth 0).
mintRecipientbytes32Recipient on the destination domain, as a right-aligned bytes32.
burnTokenaddressLocal token to burn (USDC).
destinationCallerbytes32If non-zero, the only address permitted to call receiveMessage on the
destination; bytes32(0) makes the mint permissionless.
maxFeeuint256Maximum fee (in burnToken units) payable to CCTP for the transfer.
minFinalityThresholduint32Minimum finality (1000 = fast-eligible / soft finality, 2000 = standard /
finalized) before Iris attests.

depositForBurnWithHook

Same as depositForBurn but additionally carries hookData in the burn message. CCTP does NOT execute the hook — it is emitted verbatim in the BurnMessageV2 body and the DESTINATION recipient (here, the adapter's inbound relay via CCTPHookExecutor) is what interprets it.

function depositForBurnWithHook(
        uint256 amount,
        uint32 destinationDomain,
        bytes32 mintRecipient,
        address burnToken,
        bytes32 destinationCaller,
        uint256 maxFee,
        uint32 minFinalityThreshold,
        bytes calldata hookData
    ) external;

Parameters

NameTypeDescription
amountuint256Amount of burnToken to burn (pulled from the caller — the adapter).
destinationDomainuint32CCTP domain id of the destination chain (admin-registered, e.g. Eth 0).
mintRecipientbytes32Recipient on the destination domain, as a right-aligned bytes32.
burnTokenaddressLocal token to burn (USDC).
destinationCallerbytes32If non-zero, the only address permitted to call receiveMessage on the
destination; bytes32(0) makes the mint permissionless.
maxFeeuint256Maximum fee (in burnToken units) payable to CCTP for the transfer.
minFinalityThresholduint32Minimum finality (1000 = fast-eligible / soft finality, 2000 = standard /
finalized) before Iris attests.
hookDatabytesOpaque hook bytes appended to the burn message for the destination recipient.