Skip to content

Conversation

@matthewwalsh0
Copy link
Member

@matthewwalsh0 matthewwalsh0 commented Nov 20, 2025

Description

Support EIP-7702 gas station when depositing with MetaMask Pay.

Changelog

CHANGELOG entry: null

Related issues

Fixes: #6150

Manual testing steps

Screenshots/Recordings

Before

After

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

Adds gas fee token awareness to insufficient balance alerts, simplifies available token selection logic, delegates getGasFeeTokens, and upgrades transaction-pay-controller to v10.

  • Confirmations / Alerts:
    • Consider fees.isSourceGasFeeToken in fee/amount calculations and source network checks within useInsufficientPayTokenBalanceAlert.
    • Add tests covering gas fee token scenarios and adjust mocks accordingly.
  • Utils (transaction-pay):
    • Simplify getAvailableTokens: remove "no native gas" disablement and related i18n; return tokens based on balance/selection/required status only.
    • Update tests to drop disabled-message case.
  • Engine / Messenger:
    • Delegate TransactionController:getGasFeeTokens to the Transaction Pay controller messenger.
  • Dependencies:
    • Bump @metamask/transaction-pay-controller to ^10.0.0 (lockfile updated).

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

@metamaskbot metamaskbot added the team-confirmations Push issues to confirmations team label Nov 20, 2025
@matthewwalsh0 matthewwalsh0 added the no-changelog no-changelog Indicates no external facing user changes, therefore no changelog documentation needed label Nov 20, 2025
@matthewwalsh0 matthewwalsh0 force-pushed the feat/mm-pay-gas-station-source branch from daf60c6 to 5a0d198 Compare November 20, 2025 16:14
@matthewwalsh0 matthewwalsh0 marked this pull request as ready for review November 20, 2025 16:15
@matthewwalsh0 matthewwalsh0 requested review from a team as code owners November 20, 2025 16:15
@socket-security
Copy link

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Updatednpm/​@​metamask/​transaction-pay-controller@​9.0.0 ⏵ 10.0.079 +110078 +196 +1100

View full report

@github-actions
Copy link
Contributor

🔍 Smart E2E Test Selection

  • Selected E2E tags: SmokeCore, SmokeConfirmationsRedesigned, SmokeWalletPlatform
  • Risk Level: high
  • AI Confidence: 85%
click to see 🤖 AI reasoning details

This PR introduces changes to the transaction-pay functionality with the following impacts:

  1. Core Engine Changes (HIGH RISK):

    • Modified app/core/Engine/messengers/transaction-pay-controller-messenger/transaction-pay-controller-messenger.ts to add TransactionController:getGasFeeTokens action
    • This is a critical file in the Engine core that manages controller communication
    • Any changes to Engine messengers can affect multiple parts of the application
  2. Major Dependency Update (HIGH RISK):

    • Bumped @metamask/transaction-pay-controller from v9 to v10 (major version)
    • Major version bumps typically include breaking changes
    • This controller is central to transaction payment logic
  3. Transaction Confirmation Flow Changes (MEDIUM-HIGH RISK):

    • Modified useInsufficientPayTokenBalanceAlert hook to handle isSourceGasFeeToken flag
    • Modified transaction-pay.ts utils to remove disabled token logic for gas checks
    • These changes affect how insufficient balance alerts are displayed and how payment tokens are validated
    • This is part of the confirmation redesigned flow
  4. Feature Impact:

    • The changes enable paying transaction fees with gas fee tokens (not just native tokens)
    • This affects the core transaction confirmation UX and fee calculation
    • Impacts how users see and interact with transaction confirmations

Selected Tags Rationale:

  • SmokeCore: Engine messenger changes and core transaction controller integration warrant testing core wallet functionality
  • SmokeConfirmationsRedesigned: Direct changes to confirmation hooks, alerts, and transaction payment utilities require comprehensive confirmation flow testing
  • SmokeWalletPlatform: Core wallet operations involving transaction creation, fee calculation, and network interactions need validation

The combination of Engine changes, major dependency updates, and modifications to transaction confirmation logic presents significant risk to core wallet operations.

View GitHub Actions results

@sonarqubecloud
Copy link

Copy link
Contributor

@tommasini tommasini left a comment

Choose a reason for hiding this comment

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

Hey team, can we have approve that the miss aligned peer dependencies are not actually blockers?

  • assets-controllers needs to be at v91 currently at 89
  • bridge-controller needs to be at v63 currently at 61
  • gas fee controller, but that is owned by confirmations team right?
  • Network-controller needs to be at v26

Copy link
Contributor

@tommasini tommasini left a comment

Choose a reason for hiding this comment

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

Confirmed with @matthewwalsh0 that peer deps are safe. LGTM!

@matthewwalsh0 matthewwalsh0 added this pull request to the merge queue Nov 20, 2025
Merged via the queue into main with commit b5472e1 Nov 20, 2025
93 checks passed
@matthewwalsh0 matthewwalsh0 deleted the feat/mm-pay-gas-station-source branch November 20, 2025 18:04
@github-actions github-actions bot locked and limited conversation to collaborators Nov 20, 2025
@metamaskbot metamaskbot added the release-7.61.0 Issue or pull request that will be included in release 7.61.0 label Nov 20, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

no-changelog no-changelog Indicates no external facing user changes, therefore no changelog documentation needed release-7.61.0 Issue or pull request that will be included in release 7.61.0 size-M team-confirmations Push issues to confirmations team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants