Repository navigation
chore(runway): cherry-pick fix: cp-7.60.2 overwrite account upgrade in metamask pay - #23542
Conversation
…n metamask pay (#23521) ## **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** - [x] 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). - [x] I've completed the PR template to the best of my ability - [x] I’ve included tests if applicable - [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [x] 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] > 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`). > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 923e879. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
|
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. |
|
All alerts resolved. Learn more about Socket for GitHub. This PR previously contained dependency changes with security issues that have been resolved, removed, or ignored. Ignoring alerts on:
|
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsChange AnalysisFiles Changed:
Impact Assessment:Core Functionality Affected:
Integration Points:
Why Medium Risk:
Why SmokeConfirmationsRedesigned Tag:
Confidence Notes (75%):
Not Selected:
|
|
@SocketSecurity ignore npm/@metamask/network-controller@27.0.0 |
|
|
No release label on PR. Adding release label release-7.60.2 on PR, as PR was cherry-picked in branch 7.60.2. |



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
Docs and MetaMask Mobile
Coding
Standards.
if applicable
guidelines).
Not required for external contributors.
Pre-merge reviewer checklist
app, test code being changed).
in the ticket it closes and includes the necessary testing evidence such
as recordings and or screenshots.
Note
Updates delegation transaction to conditionally include EIP-7702 authorization with new error handling, expands tests, and bumps transaction-related controllers.
app/util/transactions/delegation.ts):TransactionController.isAtomicBatchSupportedper-chain result; skip ifisSupported.upgradeContractAddress.getNonceLocknonce andKeyringController:signEip7702Authorizationto constructauthorizationList.delegationAddresswhen upgrade target differs; logging adjustments.app/util/transactions/delegation.test.ts+ snapshot):@metamask/transaction-controllerto62.4.0and@metamask/transaction-pay-controllerto10.3.0(with lockfile updates).Written by Cursor Bugbot for commit 310fa44. This will update automatically on new commits. Configure here.
509b61d