Add decoders for token-approval-revocation permission type#8823
Conversation
aa81108 to
17d77a9
Compare
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
d15bbcb to
4b4531e
Compare
4b4531e to
e90a225
Compare
- @metamask/7715-permission-types from ^0.6.0 to ^0.7.0 - @metamask/delegation-core from ^2.0.0 to ^2.2.0 - @metamask/delegation-deployments from ^1.3.0 to ^1.4.0
e90a225 to
b8dc019
Compare
| erc20Approve: boolean; | ||
| erc721Approve: boolean; | ||
| erc721SetApprovalForAll: boolean; | ||
| permit2Approve: boolean; |
There was a problem hiding this comment.
The @metamask/7715-permission-types defines the same permission type with permit2ApproveZero, not permit2Approve
There was a problem hiding this comment.
I have updated both @metamask/delegation-core and @metamask/7715-permission-types with permit2ApproveZero renamed to permit2Approve
| mask, | ||
| ApprovalRevocationFlag.Erc721SetApprovalForAll, | ||
| ), | ||
| permit2Approve: isFlagEnabled(mask, ApprovalRevocationFlag.Permit2Approve), |
There was a problem hiding this comment.
Same question here, the name of Permit2Approve is different between @metamask/7715-permission-types and here
| * | ||
| * Not yet defined in `@metamask/7715-permission-types`, so declared locally. | ||
| */ | ||
| type TokenApprovalRevocationPermission = BasePermission & { |
There was a problem hiding this comment.
Should we redefine the permissions type here? it has been exported from @metamask/7715-permission-types, same question to the other permission types in this file.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 7ea9ad2. Configure here.
@metamask/delegation-core from ^2.2.0 to ^2.2.1
7ea9ad2 to
cecc5c0
Compare

Explanation
Adds decoding logic for new
token-approval-revocationpermission type.Bumps delegation dependencies:
References
Checklist
Note
Medium Risk
Adds a new permission-type decoder and updates enforcer address resolution, which can change how on-chain permission caveats are classified/decoded. Dependency bumps to
@metamask/delegation-*and@metamask/7715-permission-typesmay also subtly affect decoding behavior across consumers.Overview
Adds support for decoding the new
token-approval-revocationexecution permission type in@metamask/gator-permissions-controller, including a new decoder that validates anApprovalRevocationEnforcerbitmask and exposes the decoded capability flags (plus optional expiry viaTimestampEnforcer).Updates enforcer-address plumbing and types to include
ApprovalRevocationEnforcer, expands the canonical decoder set (and matching logic tests) to recognize this permission, and adds dedicated unit coverage for validation/error cases and full-flag decoding.Bumps dependencies (
@metamask/7715-permission-types,@metamask/delegation-core,@metamask/delegation-deployments) and updates changelogs;money-account-upgrade-controlleris bumped to the newer delegation packages as well.Reviewed by Cursor Bugbot for commit bbef885. Bugbot is set up for automated code reviews on this repo. Configure here.