You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: cp-7.60.2 overwrite account upgrade in metamask pay (MetaMask#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: MetaMask#23494MetaMask#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 -->
0 commit comments