Skip to content

feat(bridge): fund the launch chains from Ethereum, Arbitrum and Optimism - #120

Closed
Vasanthdev2004 wants to merge 2 commits into
feat/bridge-routesfrom
feat/bridge-funding-chains
Closed

Vasanthdev2004 wants to merge 2 commits into
feat/bridge-routesfrom
feat/bridge-funding-chains

Conversation

@Vasanthdev2004

Copy link
Copy Markdown
Collaborator

Stacked on #119 (USDG), which is stacked on #118 (Relay router fix). Base is feat/bridge-routes so this diff shows only the funding change; GitHub retargets it as the lower PRs merge.

What

People can now fund Base, Robinhood Chain and Arc from Ethereum, Arbitrum and Optimism. The three are sources only: money comes in from them, nothing is ever bridged to them.

Each funding network sends ETH or Circle's native USDC, checked on-chain (symbol USDC, name USD Coin, 6 decimals):

Network USDC
Ethereum (1) 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48
Arbitrum (42161) 0xaf88d065e77c8cC2239327C5EDb3A432268e5831
Optimism (10) 0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85

Bridged USDC.e is not offered.

How

  • No validation rule loosened. Relay's /chains lists all three with protocol.v2 names ethereum / arbitrum / optimism, the pinned depository and the v3.2 router. Their quotes are the same direct-deposit orders (depositNative, or an exact approval then depositErc20) settled through the Base solver hub. The validator checks a funding network's catalogue entry exactly as it checks a launch chain's.
  • Sources only, enforced on both sides. A request, quote, fee rejection, saved transfer or Relay status naming a funding network as the destination is refused. The reverse button is disabled while one is the source. The destination picker lists the launch chains only. Picking the destination as the source moves the destination to another launch chain instead of swapping a funding network into it.
  • Wallet and reads. wagmi.ts adds the three chains so the wallet can switch to them. Their reads (balance, allowance, gas, receipts) go through /api/rpc?chain=ethereum|arbitrum|optimism with the same read-only allowlist and per-IP budget. Upstreams are ETHEREUM_RPC_URL / ARBITRUM_RPC_URL / OPTIMISM_RPC_URL; unset, they fall back to public nodes. No CSP change.
  • Panel. The source picker has a "Fund from" group. A wallet already on a funding network gets a one-tap "Send from" shortcut. The wallet menu names the network and links its explorer, without the unsupported-network warning.

For Kevin

  • Optional but recommended for production: set ETHEREUM_RPC_URL, ARBITRUM_RPC_URL and OPTIMISM_RPC_URL. The same Alchemy key covers all three.

Checks

  • tsc clean, eslint clean on the touched files
  • Bridge unit tests and RPC proxy tests: all pass. The new tests cover:
    • all 30 funding routes verifying, each approving only its own network's USDC
    • another network's USDC refused even when rehashed
    • a funding network refused as a destination
    • catalogue drift (missing chain, unknown router, renamed chain) failing closed
    • proxy upstreams, env override, and unknown chain keys refused before any upstream call
  • Full suite: no new failures (the only failures on Windows are the existing CRLF regex ones)
  • Live Relay suite (RUN_BRIDGE_LIVE_TESTS=1, unsigned, example address): 46/46 routes verify (16 between launch chains, 30 from funding networks)
  • Browser check:
    • the source picker shows the "Fund from" group (Ethereum, Arbitrum, Optimism)
    • the destination picker shows Base, Robinhood and Arc only
    • with Arbitrum as the source, the reverse button is locked ("Arbitrum only sends funds here")

No wallet signed anything. A small real transfer from each funding network is still needed before calling this exercised.

…mism

The bridge now takes money in from Ethereum (1), Arbitrum (42161) and
Optimism (10) to Base, Robinhood Chain and Arc. The three are funding
sources only: nothing is ever bridged to them.

- types: funding networks with ETH and Circle's native USDC (checked
  on-chain, never USDC.e); BRIDGE_DESTINATION_IDS, BRIDGE_FUNDING_IDS,
  isBridgeDestination(), isBridgeFundingChain()
- validation and client: a request, quote, fee rejection, saved transfer
  or status naming a funding network as destination is refused
- route changes: no reverse from a funding network; picking the
  destination as the source moves the destination to another launch
  chain instead of swapping a funding network into it
- wallet config adds the three chains; their reads go through
  /api/rpc?chain=ethereum|arbitrum|optimism (ETHEREUM_RPC_URL etc., else
  public nodes) with the same read-only allowlist and per-IP budget
- panel: "Fund from" group in the source picker, launch chains only in
  the destination picker, a "Send from" shortcut when the wallet sits on
  a funding network; wallet menu shows no unsupported warning for them
- tests: 30 new routes verify (46 in all) with exact approvals of each
  network's own USDC, token substitution refused, catalogue drift fails
  closed, proxy upstreams and unknown keys; live suite 46/46
- docs/bridge.md and .env.example
@coderabbitai

coderabbitai Bot commented Nov 10, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Essentials
  • Run ID: 8436ff14-8ee1-4fa8-a749-54e0c3d0b7c0

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

@Vasanthdev2004

Copy link
Copy Markdown
Collaborator Author

Closed in favour of #135, which holds the whole bridge update in one PR. The commits from this PR are in it unchanged.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant