Overview
The SDK provides Go bindings for CCTP V2 smart contracts, generated using Ethereum’sabigen tool with v2 library support. These bindings enable type-safe interaction with TokenMessengerV2, MessageTransmitterV2, and IERC20 contracts.
Abigen V2 Pattern
The bindings follow the abigen v2 pattern, separating ABI packaging from contract interaction:TokenMessengerV2
Handles USDC burn operations on the source chain.Creating an Instance
tokenmessenger/tokenmessenger.go:4085
DepositForBurn
Burn USDC on source chain to initiate a transfer:tokenmessenger/tokenmessenger.go:4279
Amount of USDC to burn (6 decimals)
CCTP domain of destination chain
Recipient address on destination chain (bytes32 format)
USDC token address on source chain
Authorized caller on destination (use
[32]byte{} for any caller)Maximum fee willing to pay (in USDC)
Finality threshold: 1000 (Fast), 2000 (Standard)
MessageTransmitterV2
Handles message reception and USDC minting on the destination chain.Creating an Instance
messagetransmitter/messagetransmitter.go:3584
ReceiveMessage
Receive a cross-chain message and mint USDC:messagetransmitter/messagetransmitter.go:4150
Encoded CCTP message from burn transaction
Attestation signature from Circle’s Iris service
IERC20
Standard ERC-20 interface for token approvals and balance checks.Creating an Instance
tokenmessenger/tokenmessenger.go:2109
Allowance
Check token allowance for a spender:tokenmessenger/tokenmessenger.go:2133
Approve
Approve token spending:tokenmessenger/tokenmessenger.go:2168
Helper Functions
The SDK includes utility functions for common operations:AddressToBytes32
Convert Ethereum address to bytes32 format for cross-chain messaging:GetUSDCBalance
Fetch USDC balance for an address:Complete Transfer Example
Next Steps
Transfer Orchestrator
See how bindings are used in the complete workflow
Iris Client
Learn about attestation retrieval