Add decoders for token-approval-revocation permission type#8823
Add decoders for token-approval-revocation permission type#8823jeffsmale90 wants to merge 5 commits into
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
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 b8dc019. Configure here.
| 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
| 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.

Explanation
Adds decoding logic for new
token-approval-revocationpermission type.Bumps delegation dependencies:
References
Checklist
Note
Medium Risk
Adds a new permission decoder and expands enforcer-address resolution, plus bumps delegation-related dependencies; mistakes could misclassify or mis-decode on-chain permission caveats.
Overview
Adds support for decoding the new
token-approval-revocationpermission type ingator-permissions-controller, including wiring a new decoder into the canonical decoder list and extending enforcer resolution/types to includeApprovalRevocationEnforcer.The new decoder validates and decodes an approval-revocation bitmask from caveat terms (rejecting empty/zero/out-of-range masks) and is covered by new/updated unit tests for both caveat-address matching and term decoding.
Bumps dependencies to pick up the new enforcer and permission type support (
@metamask/7715-permission-types^0.7.0,@metamask/delegation-core^2.2.0,@metamask/delegation-deployments^1.4.0), with matching changelog updates (also inmoney-account-upgrade-controller).Reviewed by Cursor Bugbot for commit 4c87d7f. Bugbot is set up for automated code reviews on this repo. Configure here.