Skip to content

🐛 app: avoid chain mismatch on bridge transfer#978

Open
dieguezguille wants to merge 1 commit intobasefrom
base-fixes
Open

🐛 app: avoid chain mismatch on bridge transfer#978
dieguezguille wants to merge 1 commit intobasefrom
base-fixes

Conversation

@dieguezguille
Copy link
Copy Markdown
Member

@dieguezguille dieguezguille commented Apr 27, 2026

Summary by CodeRabbit

  • Bug Fixes
    • Fixed chain mismatch during bridge transfers: the app now explicitly switches to the transfer's source network and ensures non-native token transfers are submitted and confirmed on the correct blockchain, preventing confirmation failures and improving transfer reliability.

@dieguezguille dieguezguille self-assigned this Apr 27, 2026
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Apr 27, 2026

🦋 Changeset detected

Latest commit: e552420

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 27, 2026

Walkthrough

Explicitly switch the wagmi client to the source chain before submitting a bridge transfer; for non-native ERC-20 transfers include chainId: source.chain on the transfer write and use the same chainId when waiting for the transaction receipt to avoid chain mismatch.

Changes

Cohort / File(s) Summary
Changeset metadata
.changeset/sour-items-enjoy.md
Adds a new changeset entry for @exactly/mobile declaring a patch release and noting the chain-mismatch bugfix.
Bridge transfer logic
src/components/add-funds/Bridge.tsx
Before submitting transfers, performs an explicit wagmi client switch to source.chain; for ERC-20 writes includes chainId: source.chain, and passes the same chainId to the receipt/wait logic.

Sequence Diagram(s)

sequenceDiagram
  participant User as User
  participant UI as Bridge UI
  participant Wagmi as Wagmi Client
  participant Chain as Source Chain (RPC)
  participant Receipt as Receipt Watcher

  User->>UI: Initiate transfer
  UI->>Wagmi: switchNetwork(source.chain)
  Wagmi-->>UI: network switched
  UI->>Wagmi: submit transfer (write, chainId: source.chain)
  Wagmi->>Chain: broadcast tx
  Chain-->>Wagmi: tx hash
  UI->>Receipt: waitForReceipt(hash, chainId: source.chain)
  Receipt->>Chain: query receipt
  Chain-->>Receipt: receipt
  Receipt-->>UI: receipt resolved
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Suggested reviewers

  • cruzdanilo
  • franm91
🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The PR title specifically references avoiding 'chain mismatch on bridge transfer', which directly aligns with the main code change in Bridge.tsx that performs explicit network switching and adds chainId parameters.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch base-fixes

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

gemini-code-assist[bot]

This comment was marked as resolved.

@sentry
Copy link
Copy Markdown

sentry Bot commented Apr 27, 2026

✅ All tests passed.

@dieguezguille dieguezguille marked this pull request as ready for review April 27, 2026 16:29
Copy link
Copy Markdown

@devin-ai-integration devin-ai-integration Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 2 additional findings.

Open in Devin Review

@dieguezguille
Copy link
Copy Markdown
Member Author

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 27, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@dieguezguille dieguezguille changed the title 🐛 app: misc base fixes 🐛 app: avoid chain mismatch on bridge transfer Apr 28, 2026
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