Commit 74b9399
chore(runway): cherry-pick fix: hardware wallet eip 7702 issue () (#27892)
- fix: hardware wallet eip 7702 issue (cp-7.71.0) (#27615)
<!--
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.
-->
## **Description**
<!--
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
## **Changelog**
<!--
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.
## **Related issues**
Fixes:
## **Manual testing steps**
```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
```
## **Screenshots/Recordings**
<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->
### **Before**
<!-- [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"
/>
### **After**
> 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] -->
## **Pre-merge author checklist**
- [ ] 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.
## **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.
<!-- 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>
[c4b93de](c4b93de)
---------
Co-authored-by: khanti42 <florin.dzeladini@consensys.net>
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>1 parent 6c47666 commit 74b9399
20 files changed
Lines changed: 575 additions & 20 deletions
File tree
- .yarn/patches
- app
- components
- UI
- Bridge
- hooks
- useBridgeQuoteRequest
- useIsGasIncluded7702Supported
- useIsHardwareWalletForBridge
- utils
- NetworkMultiSelectorList
- Views
- NetworkSelector
- Settings/NetworksSettings/NetworkSettings/CustomNetworkView
- confirmations
- components/rows/transactions/gas-fee-details-row
- hooks/gas
- core/Engine/controllers/transaction-controller
- util/transactions
Lines changed: 38 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
Lines changed: 38 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
Lines changed: 44 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
484 | 484 | | |
485 | 485 | | |
486 | 486 | | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
487 | 531 | | |
488 | 532 | | |
489 | 533 | | |
| |||
Lines changed: 6 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
16 | | - | |
| 17 | + | |
17 | 18 | | |
| 19 | + | |
18 | 20 | | |
19 | 21 | | |
20 | 22 | | |
| |||
40 | 42 | | |
41 | 43 | | |
42 | 44 | | |
| 45 | + | |
| 46 | + | |
43 | 47 | | |
44 | 48 | | |
45 | | - | |
| 49 | + | |
46 | 50 | | |
47 | 51 | | |
48 | 52 | | |
| |||
app/components/UI/Bridge/hooks/useIsGasIncluded7702Supported/useIsGasIncluded7702Supported.test.ts
Lines changed: 37 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
10 | 13 | | |
11 | 14 | | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
12 | 22 | | |
13 | 23 | | |
14 | 24 | | |
| |||
28 | 38 | | |
29 | 39 | | |
30 | 40 | | |
| 41 | + | |
31 | 42 | | |
32 | 43 | | |
33 | 44 | | |
| |||
147 | 158 | | |
148 | 159 | | |
149 | 160 | | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
150 | 187 | | |
151 | 188 | | |
152 | 189 | | |
| |||
Lines changed: 56 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
Lines changed: 18 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
15 | 17 | | |
16 | 18 | | |
17 | 19 | | |
| |||
Lines changed: 21 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
34 | 55 | | |
35 | 56 | | |
36 | 57 | | |
| |||
Lines changed: 21 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
| 62 | + | |
| 63 | + | |
62 | 64 | | |
63 | 65 | | |
64 | 66 | | |
| |||
106 | 108 | | |
107 | 109 | | |
108 | 110 | | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
109 | 117 | | |
110 | 118 | | |
111 | 119 | | |
| |||
269 | 277 | | |
270 | 278 | | |
271 | 279 | | |
272 | | - | |
| 280 | + | |
| 281 | + | |
273 | 282 | | |
274 | 283 | | |
275 | 284 | | |
| |||
342 | 351 | | |
343 | 352 | | |
344 | 353 | | |
| 354 | + | |
345 | 355 | | |
346 | 356 | | |
347 | 357 | | |
| |||
351 | 361 | | |
352 | 362 | | |
353 | 363 | | |
354 | | - | |
355 | | - | |
356 | | - | |
357 | | - | |
| 364 | + | |
358 | 365 | | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
359 | 375 | | |
360 | 376 | | |
361 | 377 | | |
| |||
0 commit comments