Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Circle Cross-chain USDC Transfer Protocol V2 (CCTP V2)

For Circle Cross-Chain USDC Transfer Protocol V2 supported networks, the USDC flow is going through Circle bridge contracts and its attestation service instead of cBridge or peg bridge contracts and SGN.

The following content is an integration tutorial from frontend perspective.

CCTP V2 now supports both Fast Transfer and Standard Transfer, you can read more about how they work and differ in this doc https://developers.circle.com/cctp.

Proxy Contracts

Supported NetworkAddress
Ethereum 10xC75fdd24820ddCdADeE9BB653aE6cD73BA8f0e80
Avalanche 431140x358234B325EF9eA8115291A8b81b7d33A2Fa762D
Arbitrum One 421610x90811d8Ea6499D3e5CbfBa3B279FB4387EbDfce9
Optimism 10 0xcfA5906d71e057BE50f4CF2a5bc41FF7bD0f0B91
Base 84530xCD086225f47155937cc57b320f8D37933B683197
Polygon PoS 1370x04869755Da6E3F6eE5D190b8C6E56E1c33604cf2
Plume Mainnet 988660x9B36f165baB9ebe611d491180418d8De4b8f3a1f

Also you can get the related contract addressed from cBridge gateway api

https://cbridge-prod2.celer.app/v1/circleUsdcConfig

Quote Fee

Note that the CCTP quote the fees from the proxy contract instead of the cBridge gateway APIs.

For example, bridging USDC from Ethereum to Avalanch by totalFee method.

Inputs

amount: Your bridging amount with decimal, for example, 3000000 = 30USDC

dstChid: The destination chain you wanna send, in this case is 43114

Outputs

Output data is an array of fees [fee, txFee, percFe].

fee: total fee, txFee+percFee

txFee: transaction fee

percFee: percentage fee

For this bridging mode, the bridge rate is 1.

Bridge by depositForBurn

From the front-end side, lock the USDC to source proxy contract by the method depositForBurn. Circle attestation will bridge the assets to the destination chain in a trustless way. For more details refer to this:https://developers.circle.com/stablecoin/docs/cctp-protocol-contract

Contract Parameters

FieldDes
amountBridging amount with decimal
dstChidBridging destination chain id
mintRecipientReceiver address
burnTokenUSDC token address in source chain, you can read the token address from this configuration: https://cbridge-prod2.celer.app/v1/circleUsdcConfig

Once this depositForBurn happened on the source chain, you can get the source chain Deposited event.

event Deposited(address sender, bytes32 recipient, uint64 dstChid, uint256 amount, uint256 txFee, uint256 percFee, uint64 nonce);

Searching destination transaction status

Searching the final destination chain status by the gateway API: GetTransferStatus.

The API requires a tracking field transferId for the status quering, here is an example with ether.js.

getTransferId(): string {
      return ethers.utils.solidityKeccak256(
          ["string", "address", "uint64", "uint64"],
          [
            "CircleTransfer", // fixed string
            walletAddress, // wallet address of user
            fromChainId, // source chain Id
            nonce, // can be retrived from the Deposited event
          ],
      );
    }  

API reference

Link gateway-gettransferstatus.md