Skip to content

chore(runway): cherry-pick fix: hardware wallet eip 7702 issue ()#27892

Merged
chloeYue merged 3 commits into
release/7.71.0from
cherry-pick-7-71-0-c4b93de
Mar 25, 2026
Merged

chore(runway): cherry-pick fix: hardware wallet eip 7702 issue ()#27892
chloeYue merged 3 commits into
release/7.71.0from
cherry-pick-7-71-0-c4b93de

Conversation

@runway-github
Copy link
Copy Markdown
Contributor

@runway-github runway-github Bot commented Mar 24, 2026

Description

This PR will provide a fix for hardware wallet to gas free network like
Monad and Sei.
Due to currently Hardware wallet is not supported for EIP 7702 gas
sponsorship, and Swap feature is not working for hardware wallet user.

This fix will fall back the Gasless transaction to User pay gas previous
model so that user can still do the swap and sign transaction like
bfore.

This is temporately fix for current version of extensions, and we will
do a proper support in the future.

Similar to extension PR:
MetaMask/metamask-extension#40915
Ticket:
https://consensyssoftware.atlassian.net/jira/software/c/projects/NEB/boards/3738/backlog?selectedIssue=NEB-767

Changelog

CHANGELOG entry: Hardware wallet user will fall back to use User pay gas for those Gasless network due to hardware wallet not supported in
Gasless network like Sei and Monad.

Related issues

Fixes:

Manual testing steps

Feature: Gas sponsorship disabled for hardware wallet accounts

  Scenario: Hardware wallet user does not use gas sponsorship on sponsored network
    Given the user has added a hardware wallet account (Ledger or QR-based)
    And the hardware wallet account is selected as the active account
    And the user has added a gas-sponsored network (e.g. Monad)

    When the user attempts to perform a swap a dapp interaction or send a transaction on the sponsored network
    Then the transaction should not use gas sponsorship
    And the UI should not display any gas sponsorship labels (e.g. "No network fee", "Paid by MetaMask")
    And the user should see the normal network gas fee
    And the transaction should follow the standard user-pays-gas flow

Screenshots/Recordings

Before

With HW account:

Network list:
Screenshot 2026-03-18 at 16 05 48

Tx flow:
Screenshot 2026-03-18 at 15 53 04
Screenshot 2026-03-18 at 15 55 20
Screenshot 2026-03-18 at 15 55 47

After

With HW account:

Network list:
Screenshot 2026-03-18 at 16 06 19

Tx flow:
Screenshot 2026-03-18 at 15 49 55
Screenshot 2026-03-18 at 15 50 29

Pre-merge author checklist

Pre-merge reviewer checklist

  • I've manually tested the PR (e.g. pull and build branch, run the
    app, test code being changed).
  • I confirm that this PR addresses all acceptance criteria described
    in the ticket it closes and includes the necessary testing evidence such
    as recordings and or screenshots.

Note

Medium Risk
Touches gasless sponsorship and transaction publishing paths
(including 7702 delegation), which can affect whether transactions are
sponsored vs user-paid and could change behavior on supported chains.
Changes are scoped to hardware-wallet detection gates with added tests,
reducing regression risk.

Overview
Hardware wallet accounts now opt out of gasless / EIP-7702
sponsorship
, forcing swaps/bridge and confirmations to use the normal
user-pays-gas path.

This adds an accountSupports7702 gate to TransactionControllerInit
so Delegation7702PublishHook and isEIP7702GasFeeTokensEnabled only
activate for keyrings that support 7702, and updates
useIsGaslessSupported/useIsGasIncluded7702Supported (via new
useIsHardwareWalletForBridge) to report unsupported for hardware
signers.

Network selection UI (NetworkSelector, NetworkMultiSelectorList,
CustomNetwork) now hides the “No network fee” sponsored label for
hardware wallets, and a patched @metamask/bridge-status-controller
waits for approval tx confirmation when required. Tests were
added/updated to cover the new hardware-wallet gating behavior.

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


Co-authored-by: metamaskbot metamaskbot@users.noreply.github.com
Co-authored-by: Julien Fontanel julien.fontanel@consensys.net
Co-authored-by: Frederic HENG frederic.heng@consensys.net
Co-authored-by: Arafet (CN - Hong Kong) 52028926+arafetbenmakhlouf@users.noreply.github.com
Co-authored-by: tommasini 46944231+tommasini@users.noreply.github.com c4b93de

<!--
Please submit this PR as a draft initially.
Do not mark it as "Ready for review" until the template has been
completely filled out, and PR status checks have passed at least once.
-->

<!--
Write a short description of the changes included in this pull request,
also include relevant motivation and context. Have in mind the following
questions:
1. What is the reason for the change?
2. What is the improvement/solution?
-->

This PR will provide a fix for hardware wallet to gas free network like
Monad and Sei.
Due to currently Hardware wallet is not supported for EIP 7702 gas
sponsorship, and Swap feature is not working for hardware wallet user.

This fix will fall back the Gasless transaction to User pay gas previous
model so that user can still do the swap and sign transaction like
bfore.

This is temporately fix for current version of extensions, and we will
do a proper support in the future.

Similar to extension PR:
MetaMask/metamask-extension#40915
Ticket:
https://consensyssoftware.atlassian.net/jira/software/c/projects/NEB/boards/3738/backlog?selectedIssue=NEB-767

<!--
If this PR is not End-User-Facing and should not show up in the
CHANGELOG, you can choose to either:
1. Write `CHANGELOG entry: null`
2. Label with `no-changelog`

If this PR is End-User-Facing, please write a short User-Facing
description in the past tense like:
`CHANGELOG entry: Added a new tab for users to see their NFTs`
`CHANGELOG entry: Fixed a bug that was causing some NFTs to flicker`

(This helps the Release Engineer do their job more quickly and
accurately)
-->

CHANGELOG entry: Hardware wallet user will fall back to use `User pay
gas` for those Gasless network due to hardware wallet not supported in
Gasless network like Sei and Monad.

Fixes:

```gherkin
Feature: Gas sponsorship disabled for hardware wallet accounts

  Scenario: Hardware wallet user does not use gas sponsorship on sponsored network
    Given the user has added a hardware wallet account (Ledger or QR-based)
    And the hardware wallet account is selected as the active account
    And the user has added a gas-sponsored network (e.g. Monad)

    When the user attempts to perform a swap a dapp interaction or send a transaction on the sponsored network
    Then the transaction should not use gas sponsorship
    And the UI should not display any gas sponsorship labels (e.g. "No network fee", "Paid by MetaMask")
    And the user should see the normal network gas fee
    And the transaction should follow the standard user-pays-gas flow
```

<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->

<!-- [screenshots/recordings] -->

> With HW account:

Network list:
<img width="392" height="800" alt="Screenshot 2026-03-18 at 16 05 48"
src="https://github.com/user-attachments/assets/601c30cc-fd78-456e-87b5-cc70e7ce3433"
/>

Tx flow:
<img width="392" height="800" alt="Screenshot 2026-03-18 at 15 53 04"
src="https://github.com/user-attachments/assets/7c7b60cf-3f79-4701-a1e5-1fbba2bfe84e"
/>
<img width="392" height="800" alt="Screenshot 2026-03-18 at 15 55 20"
src="https://github.com/user-attachments/assets/a3258815-f1d2-4abf-8b22-209b73a0fbba"
/>
<img width="392" height="800" alt="Screenshot 2026-03-18 at 15 55 47"
src="https://github.com/user-attachments/assets/9275c82c-e56a-47ad-a203-a34f67ed6ed9"
/>

> With HW account:

Network list:
<img width="392" height="800" alt="Screenshot 2026-03-18 at 16 06 19"
src="https://github.com/user-attachments/assets/03a296be-17fe-4387-baa0-23bae3ba00eb"
/>

Tx flow:
<img width="392" height="800" alt="Screenshot 2026-03-18 at 15 49 55"
src="https://github.com/user-attachments/assets/b39bc1b0-4b28-4e06-ae06-a381458ba7f6"
/>
<img width="392" height="800" alt="Screenshot 2026-03-18 at 15 50 29"
src="https://github.com/user-attachments/assets/76a31213-9ecd-4290-b407-58ffb8d82f48"
/>

<!-- [screenshots/recordings] -->

- [ ] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile
Coding
Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [ ] I've completed the PR template to the best of my ability
- [ ] I've included tests if applicable
- [ ] I've documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [ ] I've applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

- [ ] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [ ] I confirm that this PR addresses all acceptance criteria described
in the ticket it closes and includes the necessary testing evidence such
as recordings and or screenshots.

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Medium Risk**
> Touches gasless sponsorship and transaction publishing paths
(including 7702 delegation), which can affect whether transactions are
sponsored vs user-paid and could change behavior on supported chains.
Changes are scoped to hardware-wallet detection gates with added tests,
reducing regression risk.
>
> **Overview**
> Hardware wallet accounts now **opt out of gasless / EIP-7702
sponsorship**, forcing swaps/bridge and confirmations to use the normal
*user-pays-gas* path.
>
> This adds an `accountSupports7702` gate to `TransactionControllerInit`
so `Delegation7702PublishHook` and `isEIP7702GasFeeTokensEnabled` only
activate for keyrings that support 7702, and updates
`useIsGaslessSupported`/`useIsGasIncluded7702Supported` (via new
`useIsHardwareWalletForBridge`) to report unsupported for hardware
signers.
>
> Network selection UI (`NetworkSelector`, `NetworkMultiSelectorList`,
`CustomNetwork`) now hides the “No network fee” sponsored label for
hardware wallets, and a patched `@metamask/bridge-status-controller`
waits for approval tx confirmation when required. Tests were
added/updated to cover the new hardware-wallet gating behavior.
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
83f66fc. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->

---------

Co-authored-by: metamaskbot <metamaskbot@users.noreply.github.com>
Co-authored-by: Julien Fontanel <julien.fontanel@consensys.net>
Co-authored-by: Frederic HENG <frederic.heng@consensys.net>
Co-authored-by: Arafet (CN - Hong Kong) <52028926+arafetbenmakhlouf@users.noreply.github.com>
Co-authored-by: tommasini <46944231+tommasini@users.noreply.github.com>
@runway-github runway-github Bot requested review from a team as code owners March 24, 2026 21:23
@github-actions
Copy link
Copy Markdown
Contributor

CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes.

@metamaskbot metamaskbot added the team-bots Bot team (for MetaMask Bot, Runway Bot, etc.) label Mar 24, 2026
@github-actions github-actions Bot added risk-high Extensive testing required · High bug introduction risk size-L labels Mar 24, 2026
@github-actions github-actions Bot added risk-high Extensive testing required · High bug introduction risk and removed risk-high Extensive testing required · High bug introduction risk labels Mar 25, 2026
@github-actions
Copy link
Copy Markdown
Contributor

🔍 Smart E2E Test Selection

  • Selected E2E tags: SmokeAccounts, SmokeConfirmations, SmokeIdentity, SmokeNetworkAbstractions, SmokeNetworkExpansion, SmokeTrade, SmokeWalletPlatform, SmokeCard, SmokePerps, SmokeRamps, SmokeMultiChainAPI, SmokePredictions, FlaskBuildTests
  • Selected Performance tags: @PerformanceAccountList, @PerformanceOnboarding, @PerformanceLogin, @PerformanceSwaps, @PerformanceLaunch, @PerformanceAssetLoading, @PerformancePredict, @PerformancePreps
  • Risk Level: high
  • AI Confidence: 100%
click to see 🤖 AI reasoning details

E2E Test Selection:
Hard rule (controller-version-update): @MetaMask controller package version updated in package.json: @metamask/bridge-status-controller@npm:^69.0.0, @metamask/bridge-status-controller@npm:^68.1.0, @metamask/bridge-status-controller. Running all tests.

Performance Test Selection:
Hard rule (controller-version-update): @MetaMask controller package version updated in package.json: @metamask/bridge-status-controller@npm:^69.0.0, @metamask/bridge-status-controller@npm:^68.1.0, @metamask/bridge-status-controller. Running all tests.

View GitHub Actions results

@sonarqubecloud
Copy link
Copy Markdown

@github-actions
Copy link
Copy Markdown
Contributor

E2E Fixture Validation — Schema is up to date
16 value mismatches detected (expected — fixture represents an existing user).
View details

@arafetbenmakhlouf arafetbenmakhlouf self-requested a review March 25, 2026 10:40
Copy link
Copy Markdown
Contributor

@chloeYue chloeYue left a comment

Choose a reason for hiding this comment

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

LGTM

@chloeYue chloeYue merged commit 74b9399 into release/7.71.0 Mar 25, 2026
187 of 191 checks passed
@chloeYue chloeYue deleted the cherry-pick-7-71-0-c4b93de branch March 25, 2026 11:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk-high Extensive testing required · High bug introduction risk size-L team-bots Bot team (for MetaMask Bot, Runway Bot, etc.)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants