Skip to content

[Feature] Integrate Circle CCTP cross-chain USDC bridging into the app (replace informational bridge page) #253

Description

@Sendi0011

Summary

Replace the currently informational bridge page (a static step-by-step guide to using CCTP manually) with an integrated cross-chain USDC deposit bridge so users can fund a pool from an external chain without leaving the app.

The existing page at frontend/app/[locale]/bridge/page.tsx only renders explanatory CCTP/Stellar-USDC steps — it performs no on-chain or wallet actions.

Requirements

  1. Chain/token selector — pick source chain (Ethereum, Base, Arbitrum, Optimism, Polygon) and confirm USDC amount to bridge.
  2. CCTP contract integration — call Circle's CCTP depositForBurn from a Solana/stellar-aware wallet (or via a relayer/API) on the source chain, and verify MessageSent events.
  3. Attestation polling — poll Circle's Attestation Service until complete, then submit receiveMessage on Stellar to mint USDC.
  4. Pool deposit hand-off — after funds arrive, prefill or trigger the existing deposit flow (/api/pools/deposit) so the bridged USDC lands in the user's pool.
  5. Status tracking — persist bridge transactions in Supabase so the UI shows progress (pending → attested → received → deposited) and survives page refresh.
  6. Error + refund handling — surface instantaneous Failure attestation statuses and link to Circle's block-explorer refund flow.

Notes / context

  • The Stellar side of CCTP uses the Circle Mint/Redeem anchor; USDC arrives on Stellar as the native USDC asset.
  • Reuse the existing web3-provider and the frontend/lib/csv-export.ts-style pure-logic convention where possible; keep wallet/network code testable behind a thin seam.
  • Add unit tests for the attestation-state machine (pending → complete/failure) and the amount/rounding/balance logic, following frontend/lib/deposit-calendar.test.ts conventions.

Acceptance criteria

  • Bridging USDC from at least one EVM chain to Stellar completes end-to-end
  • Deposited funds are credited to the user's pool via the existing deposit route
  • Bridge status persists and resumes across page refreshes
  • Unit tests cover the attestation state machine and amount handling
  • Linting, format, and all CI checks pass

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

GrantFox OSSIssue tracked in GrantFox OSSMaybe RewardedIssue may be eligible for a GrantFox rewardThird CampaignCampaign: Third CampaignfeatureNew functionality to addfrontendhigh-complexityLarge scope, multiple systems/files. Needs planningpriority: highMajor impact, breaks key feature. fix next after P0smart-contract

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions