Bridging
Overview
FlashFi enables cross-chain bridging of USDC between Ethereum and Avalanche using Circle’s CCTP (Cross-Chain Transfer Protocol).
How It Works
Approve USDC Transfer – Authorize the bridge contract to spend USDC.
Burn USDC on Source Chain – The token is burned before transfer.
Get Attestation – Circle verifies the burn and issues proof.
Receive on Destination Chain – USDC is minted on the target blockchain.
Approving USDC for Bridging
Before bridging, FlashFi approves the Token Messenger contract to spend USDC.
tsCopyEditconst approveTx = await usdcContract.methods
.approve(ETH_TOKEN_MESSENGER, amount)
.send({ from: ethSigner.address });
await approveTx.wait();
Burning USDC on Ethereum
After approval, the contract burns USDC and sends a message to Avalanche.
tsCopyEditconst burnTx = await tokenMessengerContract.methods
.depositForBurn(amount, AVAX_DEST_DOMAIN, recipient, USDC_ETH)
.send({ from: ethSigner.address });
await burnTx.wait();
Fetching Attestation from Circle
Circle provides an attestation to prove the transaction is valid.
tsCopyEditconst response = await fetch(
`https://iris-api-sandbox.circle.com/attestations/${messageHash}`
);
const attestation = (await response.json()).attestation;
Receiving USDC on Avalanche
After verification, the message is processed on the destination chain.
tsCopyEditconst receiveTx = await messageTransmitterContract.methods
.receiveMessage(messageBytes, attestation)
.send({ from: avaxSigner.address });
await receiveTx.wait();
Why Use FlashFi for Bridging?
✅ Seamless Cross-Chain Transfers – Move USDC between Ethereum and Avalanche. ✅ Circle’s CCTP Security – Ensures trustless and verified transfers. ✅ Optimized for Speed – Fully automated transaction flow.
Last updated