Skip to content

fix: hardware wallet eip 7702 issue (cp-7.71.0)#27615

Merged
khanti42 merged 50 commits into
mainfrom
fix/hardware-wallet-eip-7702-issue
Mar 24, 2026
Merged

fix: hardware wallet eip 7702 issue (cp-7.71.0)#27615
khanti42 merged 50 commits into
mainfrom
fix/hardware-wallet-eip-7702-issue

Conversation

@khanti42
Copy link
Copy Markdown
Contributor

@khanti42 khanti42 commented Mar 18, 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.

@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-networks Networks team label Mar 18, 2026
@github-actions github-actions Bot added size-M risk-high Extensive testing required · High bug introduction risk labels Mar 18, 2026
@khanti42 khanti42 changed the title Fix/hardware wallet eip 7702 issue fix: hardware wallet eip 7702 issue Mar 18, 2026
@github-actions github-actions Bot added risk-high Extensive testing required · High bug introduction risk risk-medium Moderate testing recommended · Possible bug introduction risk and removed risk-high Extensive testing required · High bug introduction risk labels Mar 18, 2026
@github-actions github-actions Bot added risk-medium Moderate testing recommended · Possible bug introduction risk and removed risk-medium Moderate testing recommended · Possible bug introduction risk labels Mar 18, 2026
@github-actions github-actions Bot added size-L risk-high Extensive testing required · High bug introduction risk and removed size-M risk-medium Moderate testing recommended · Possible bug introduction risk labels Mar 18, 2026
@khanti42 khanti42 changed the title fix: hardware wallet eip 7702 issue fix: cp-7.70.0 hardware wallet eip 7702 issue Mar 18, 2026
@github-actions github-actions Bot added risk-medium Moderate testing recommended · Possible bug introduction risk risk-high Extensive testing required · High bug introduction risk and removed risk-high Extensive testing required · High bug introduction risk risk-medium Moderate testing recommended · Possible bug introduction risk labels Mar 18, 2026
@khanti42 khanti42 force-pushed the fix/hardware-wallet-eip-7702-issue branch from f786fca to 274ac4c Compare March 18, 2026 19:57
@github-actions github-actions Bot removed the risk-high Extensive testing required · High bug introduction risk label Mar 18, 2026
matthewwalsh0
matthewwalsh0 previously approved these changes Mar 23, 2026
wachunei
wachunei previously approved these changes Mar 23, 2026
infiniteflower
infiniteflower previously approved these changes Mar 23, 2026
weitingsun
weitingsun previously approved these changes Mar 23, 2026
Copy link
Copy Markdown
Contributor

@weitingsun weitingsun left a comment

Choose a reason for hiding this comment

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

platform codeowner files lgtm

shane-t
shane-t previously approved these changes Mar 23, 2026
abretonc7s
abretonc7s previously approved these changes Mar 24, 2026
Copy link
Copy Markdown
Contributor

@abretonc7s abretonc7s left a comment

Choose a reason for hiding this comment

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

LGTM - doesn't seem to touch perps flows.

vinistevam
vinistevam previously approved these changes Mar 24, 2026
Copy link
Copy Markdown
Contributor

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Copy link
Copy Markdown
Contributor

@dawnseeker8 dawnseeker8 left a comment

Choose a reason for hiding this comment

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

LGTM

@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. 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. 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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release-7.72.0 Issue or pull request that will be included in release 7.72.0 risk-high Extensive testing required · High bug introduction risk size-L team-networks Networks team

Projects

None yet

Development

Successfully merging this pull request may close these issues.