Skip to content

feat: add Rosen Bridge FIRO ↔ rsFIRO swaps - #1445

Draft
reubenyap wants to merge 19 commits into
cypherstack:stagingfrom
reubenyap:codex/rosen-firo-swap
Draft

reubenyap wants to merge 19 commits into
cypherstack:stagingfrom
reubenyap:codex/rosen-firo-swap

Conversation

@reubenyap

@reubenyap reubenyap commented Sep 17, 2026

Copy link
Copy Markdown
Contributor

Adds Rosen Bridge to the existing Swap flow for native FIRO ↔ rsFIRO on Ethereum mainnet. Users can create, fund, refresh, and resume swaps through the existing mobile/desktop confirmation screens and trade history.

Includes the rsFIRO and Campfire commits from #1444. Campfire can add FIRO, ETH, rsFIRO, USDC, and USDT wallets. The bridge and Add wallet share one rsFIRO contract definition.

Implementation

  • Reuses Exchange, trade persistence, wallet signing/broadcast, FIRO coin selection, and ERC-20 transaction history. Uses existing coinlib address/hex helpers and web3dart ABI encoding.
  • FIRO funding uses transparent funds with the required OP_RETURN; rsFIRO funding appends Rosen metadata to the ERC-20 transfer and pays gas in ETH. Signed transaction contents, mainnet, balances, fees, and nonce are checked before broadcast.
  • Changed bridge fees require a refreshed quote and another confirmation. Concurrent funding and stale trade updates cannot erase a recorded deposit.
  • Desktop wallet selection retains the selected wallet ID. Token registration preserves existing contract records.
  • Keeps the existing flutter test --coverage workflow and prebuild configuration stubs. Fee regressions use normal test discovery. No new dependencies or workflows.

Protocol configuration and pinned upstream references are documented in docs/rosen_bridge.md.

Validation

  • Passed 16 focused Flutter tests on macOS using the configured application dependencies: fee boundaries, protocol metadata, signed FIRO and ERC-20 transactions, Hive trade refresh/persistence, and Campfire token filtering.
  • Targeted analysis found no compile errors; existing warnings/lints remain.
  • Dart 3.12.2 formatting and git diff --check pass.

The full GitHub CI run must still pass. This remains a draft until the application flows and live transfers in both directions are validated; no funds were sent during testing.

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