Skip to content

fix: cp-7.60.2 overwrite account upgrade in metamask pay - #23521

Merged
matthewwalsh0 merged 5 commits into
mainfrom
fix/overwrite-delegation
Dec 2, 2025
Merged

matthewwalsh0 merged 5 commits into
mainfrom
fix/overwrite-delegation

Conversation

@matthewwalsh0

@matthewwalsh0 matthewwalsh0 commented Dec 2, 2025 •

Copy link
Copy Markdown
Member

Description

When generating delegation data for the TransactionPayController, overwrite any existing EIP-7702 delegation if not supported.

Also bump the controller version to include missing authorization lists on Predict deposit source transactions, when payment token is on Polygon.

Changelog

CHANGELOG entry: Fixed bugs causing failed Perps and Predict deposits due to unsupported or missing account upgrades

Related issues

Fixes: #23494 #23514

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

Refactors delegation to correctly build/overwrite EIP-7702 authorizations with validation, integrates Transaction Pay and Delegation 7702 hooks into publish flow, and bumps transaction-related controllers.

  • Engine/TransactionController init:
    • Integrates TransactionPayPublishHook and Delegation7702PublishHook with fallback logic before smart transactions.
    • Adds isEIP7702GasFeeTokensEnabled, publicKeyEIP7702, and getNextNonce helper.
    • Exposes getNetworkState via networkController.state.
  • Delegation utils (app/util/transactions/delegation.ts):
    • Refactors buildAuthorizationList to use isAtomicBatchSupported result per-chain, throwing on unsupported chains and missing upgradeContractAddress.
    • Skips authorization if already upgraded; overwrites authorization when upgraded to a different contract.
    • Signs EIP-7702 authorization using nonce lock and builds AuthorizationList.
  • Tests:
    • Expands delegation.test.ts with cases for already upgraded, different upgrade target, signing calls, and error paths; updates snapshot name.
  • Dependencies:
    • Bumps @metamask/transaction-controller to 62.4.0 and @metamask/transaction-pay-controller to ^10.3.0 (and associated @metamask/network-controller peer to ^27).

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

@metamaskbot metamaskbot added the team-confirmations Push issues to confirmations team label Dec 2, 2025
@github-actions github-actions Bot added the size-M label Dec 2, 2025
@matthewwalsh0
matthewwalsh0 marked this pull request as ready for review December 2, 2025 12:16
OGPoyraz
OGPoyraz previously approved these changes Dec 2, 2025
@socket-security

socket-security Bot commented Dec 2, 2025 •

Copy link
Copy Markdown

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-controller@​62.3.1 ⏵ 62.4.0100 +4100100 +20100 +3100
Updatednpm/​@​metamask/​transaction-pay-controller@​10.2.0 ⏵ 10.3.0100 +22100100 +23100 +4100

View full report

OGPoyraz
OGPoyraz previously approved these changes Dec 2, 2025
@github-actions

github-actions Bot commented Dec 2, 2025

Copy link
Copy Markdown
Contributor

🔍 Smart E2E Test Selection

  • Selected E2E tags: SmokeAccounts, SmokeCore, SmokeConfirmationsRedesigned, SmokeIdentity, SmokeNetworkAbstractions, SmokeNetworkExpansion, SmokeTrade, SmokeWalletPlatform, SmokeWalletUX, SmokeAssets, SmokeSwaps, SmokeStake, SmokeCard, SmokeNotifications, SmokeRewards, SmokePerps, SmokeRamps, SmokeMultiChainPermissions, SmokeAnalytics, SmokeMultiChainAPI, SmokePredictions
  • Risk Level: high
  • AI Confidence: %
click to see 🤖 AI reasoning details

Fallback: AI analysis did not complete successfully. Running all tests.

View GitHub Actions results

@sonarqubecloud

sonarqubecloud Bot commented Dec 2, 2025

Copy link
Copy Markdown

@matthewwalsh0
matthewwalsh0 added this pull request to the merge queue Dec 2, 2025
Merged via the queue into main with commit 509b61d Dec 2, 2025
99 checks passed
@matthewwalsh0
matthewwalsh0 deleted the fix/overwrite-delegation branch December 2, 2025 14:39
@github-actions github-actions Bot locked and limited conversation to collaborators Dec 2, 2025
@metamaskbot metamaskbot added the release-7.62.0 Issue or pull request that will be included in release 7.62.0 label Dec 2, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release-7.62.0 Issue or pull request that will be included in release 7.62.0 size-M team-confirmations Push issues to confirmations team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Predict deposits fail from Polygon when no proxy account and no SCA

3 participants