feat: add token approval revocation permission type#232
Merged
mj-kiwi merged 6 commits intoMay 18, 2026
Merged
Conversation
54b8c0d to
26f37ce
Compare
jeffsmale90
added a commit
that referenced
this pull request
May 18, 2026
* Add create / decode terms functions to @metamask/delegation-core for ApprovalRevocationEnforcer * Add caveat builder for ApprovalRevocation enforcer * Convert decodeCaveat function to use CaveatType rather than string literals. * Add changelog * Bump delegatable-framework to d0ebab5 Merge pull request #177 from MetaMask/feat/erc20-allowance-revocation-enforcer * Add ApprovalRevocationEnforcer abis * Add e2e test for approval revocation enforcer * Add ApprovalRevocationEnforcer to environment, and contract deployments * Tweak nativeTokenStreaming e2e test to make likelihood of false positive lower The test occasionally succeeds, likely because the streaming amount probably accumulates sufficiently for the transfer amount. We decrease the amountPerSecond, and increase the transferAmount * Changelogs * fix approval revocation reserved-bit messaging Co-authored-by: jeffsmale90 <jeffsmale90@users.noreply.github.com> * Checksum ApprovalRevocationEnforcer address in deployments package * Use CaveatType.AllowedCalldata instead of 'allowedCalldata' in decodeCaveat function * feat: add token approval revocation permission type (#232) * Add token-approval-revocation permission type and related RPC conversion * feat: add token approval revocation permission type * Revert "Add token-approval-revocation permission type and related RPC conversion" This reverts commit 086175b. * fix: link changelog entries to PR * feat: deprecate erc20-token-revocation in favor of token-approval-revocation * Tweak changelogs - all changes point to #226 --------- Co-authored-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: jeffsmale90 <jeffsmale90@users.noreply.github.com> Co-authored-by: MJ Kiwi <mj.liang@consensys.net>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📝 Description
Adds ERC-7715
token-approval-revocationpermission type support to@metamask/7715-permission-typesand@metamask/smart-accounts-kit.🔄 What Changed?
TokenApprovalRevocationPermissionto@metamask/7715-permission-typesfalsevalues🚀 Why?
ApprovalRevocationTerms🧪 How to Test?
TokenApprovalRevocationPermissionfrom the package API.token-approval-revocationpermission with mixedtrueandfalseflags.Automated verification run locally:
yarn workspace @metamask/smart-accounts-kit exec vitest run test/actions/erc7715Mapping.test.tsyarn workspace @metamask/7715-permission-types buildyarn workspace @metamask/smart-accounts-kit typecheck📋 Checklist
🔗 Related Issues
Related to #
📚 Additional Notes
Changelog entries added for:
@metamask/7715-permission-types: New permission typetoken-approval-revocation@metamask/smart-accounts-kit: ERC-7715token-approval-revocationpermission typeNote
Medium Risk
Extends the public ERC-7715 permission type union and request/RPC mapping; incorrect flag serialization could lead to unexpected revocation behavior or wallet rejections, but changes are additive and covered by targeted tests.
Overview
Adds a new ERC-7715 permission type,
token-approval-revocation, to@metamask/7715-permission-typesand@metamask/smart-accounts-kit, with a structured data payload containing explicit boolean flags for different approval revocation actions.Updates the smart-accounts-kit request→RPC conversion to support the new type and preserve all boolean fields including
falsevalues, and markserc20-token-revocationas deprecated in favor of the new permission. Changelogs and mapping tests are updated accordingly.Reviewed by Cursor Bugbot for commit 56a4a80. Bugbot is set up for automated code reviews on this repo. Configure here.