Overview
TheChain struct represents a blockchain configuration for CCTP V2. It contains all the necessary information to interact with a specific blockchain, including contract addresses, RPC endpoints, and chain-specific settings.
Type Definition
Fields
The human-readable name of the blockchain (e.g., “Ethereum”, “Base”, “Arbitrum”)
The chain ID as defined in EIP-155. Used for transaction signing and network identification.
The CCTP domain identifier for this chain. Each blockchain supported by CCTP has a unique domain number.
The RPC endpoint URL for connecting to the blockchain network.
The contract address of the TokenMessengerV2 contract on this chain. This contract handles USDC burning.
The contract address of the MessageTransmitterV2 contract on this chain. This contract handles message receiving and USDC minting.
The contract address of the USDC token on this chain.
The base URL of the blockchain explorer (e.g., “https://etherscan.io”).
Indicates whether this chain is a testnet (true) or mainnet (false).
Indicates whether the chain has instant finality. Chains with instant finality don’t need Fast Transfer distinction as they already provide quick transaction finality.Examples of chains with instant finality:
- Avalanche
- Polygon PoS
- Sonic
- Sei
- XDC
- HyperEVM
Usage Examples
Getting a Chain by Domain
Getting a Chain by Name
Getting All Chains
Applying Custom RPC Overrides
Checking Instant Finality
Related Functions
GetChains(testnet bool) []Chain- Returns all configured chainsGetMainnetChains() []Chain- Returns all mainnet chain configurationsGetTestnetChains() []Chain- Returns all testnet chain configurationsGetChainByDomain(domain uint32, testnet bool) (*Chain, error)- Returns a chain by its domain IDGetChainByName(name string, testnet bool) (*Chain, error)- Returns a chain by its nameApplyRPCOverrides(chains []Chain, overrides map[string]string) []Chain- Applies custom RPC URL overrides
Supported Chains
Mainnet Chains
| Chain Name | Domain | Chain ID | Instant Finality |
|---|---|---|---|
| Ethereum | 0 | 1 | No |
| Avalanche | 1 | 43114 | Yes |
| OP Mainnet | 2 | 10 | No |
| Arbitrum | 3 | 42161 | No |
| Base | 6 | 8453 | No |
| Polygon PoS | 7 | 137 | Yes |
| Unichain | 10 | 1301 | No |
| Linea | 11 | 59144 | No |
| Codex | 12 | 5115 | No |
| Sonic | 13 | 146 | Yes |
| World Chain | 14 | 480 | No |
| Sei | 16 | 1329 | Yes |
| XDC | 18 | 50 | Yes |
| HyperEVM | 19 | 998 | Yes |
| Ink | 21 | 57073 | No |
| Plume | 22 | 98865 | No |
All V2 mainnet chains use the same contract addresses:
- TokenMessengerV2:
0x28b5a0e9C621a5BadaA536219b3a228C8168cf5d - MessageTransmitterV2:
0x81D40F21F12A8F0E3252Bccb954D722d4c464B64
See Also
- TransferParams - Parameters for initiating a transfer
- TransferOrchestrator - Orchestrates the complete transfer workflow