Circle Cross-chain USDC Transfer Protocol(CCTP)
Last updated
Last updated
For Circle Cross-Chain USDC Protocol supported chains, 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.
Also you can get the related contract addressed from cBridge gateway api
https://cbridge-prod2.celer.app/v1/circleUsdcConfig
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.
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
Once this depositForBurn happened on the source chain, you can get the source chain Deposited event.
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.
API reference
Field | Des |
---|---|
Chain
Address
Ethereum 1
Avalanche 43114
Arbitrum One 42161
Optimism 10
Base 8453
Polygon PoS 137
amount
Bridging amount with decimal
dstChid
Bridging destination chain id
mintRecipient
Receiver address
burnToken
USDC token address in source chain, you can read the token address from this configuration: https://cbridge-prod2.celer.app/v1/circleUsdcConfig