Skip to content

fix: wait for approval confirmation before swap on mobile HW#8268

Open
khanti42 wants to merge 2 commits intomainfrom
fix/bridge-status-wait-approval-hw-mobile
Open

fix: wait for approval confirmation before swap on mobile HW#8268
khanti42 wants to merge 2 commits intomainfrom
fix/bridge-status-wait-approval-hw-mobile

Conversation

@khanti42
Copy link
Contributor

@khanti42 khanti42 commented Mar 23, 2026

Explanation

QA on MetaMask Mobile saw approve + swap (two on-chain txs) fail on Monad when using a hardware wallet: the swap step could run before the approval was confirmed, so gas estimation / simulation failed (allowance not set yet).

Problem

On Mobile + HW, approve → swap could run the swap before the approval was confirmed, so gas estimation failed (e.g. Monad).

Fix

If Mobile + HW and an approval tx exists, wait for that tx to confirm before submitting the swap; otherwise unchanged.

Mobile PR (see PR#27615)

Yarn patch on @metamask/bridge-status-controller@68.1.0 so QA can verify and cherry pick happen before a core release bumps the dependency.

References

Related to MetaMask/metamask-mobile#27615

Checklist

  • I've updated the test suite for new or updated code as appropriate
  • I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate
  • I've communicated my changes to consumers by updating changelogs for packages I've changed
  • I've introduced breaking changes in this PR and have prepared draft pull requests for clients and consumer packages to resolve them

Note

Medium Risk
Changes EVM non-batch submission sequencing by blocking on approval confirmation for mobile hardware wallets, which could affect transaction timing and error handling in the submission path. Scope is limited and covered by updated unit tests/snapshots.

Overview
Ensures mobile hardware-wallet non-batch EVM flows don’t submit the swap/bridge transaction until the preceding ERC-20 approval tx is confirmed, preventing gas estimation/simulation from running before on-chain allowance is set.

Updates unit tests and snapshots to assert the new waitForTxConfirmation behavior (instead of handleMobileHardwareWalletDelay) and documents the fix in the package changelog.

Written by Cursor Bugbot for commit 3b78762. This will update automatically on new commits. Configure here.

@khanti42 khanti42 requested review from a team as code owners March 23, 2026 08:32
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