FlashFi
  • ⚡ FlashFi
  • ⚒️Technical Deep Dive
    • 🔄 Swapping
    • Bridging
    • 🔗Staking
  • Privy Implementation
  • Contribution To Covalent Agent Kit
  • 🚀Future Plans
Powered by GitBook
On this page
  • Overview
  • Approving USDC for Bridging
  • Burning USDC on Ethereum
  • Fetching Attestation from Circle
  • Receiving USDC on Avalanche
  • Why Use FlashFi for Bridging?
  1. Technical Deep Dive

Bridging

Overview

FlashFi enables cross-chain bridging of USDC between Ethereum and Avalanche using Circle’s CCTP (Cross-Chain Transfer Protocol).

How It Works

  1. Approve USDC Transfer – Authorize the bridge contract to spend USDC.

  2. Burn USDC on Source Chain – The token is burned before transfer.

  3. Get Attestation – Circle verifies the burn and issues proof.

  4. 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.

Previous🔄 SwappingNext🔗Staking

Last updated 3 months ago

⚒️