Skip to content

Add support for ApprovalRevocationEnforcer#226

Merged
jeffsmale90 merged 15 commits into
mainfrom
feat/approval-revocation-enforcer
May 18, 2026
Merged

Add support for ApprovalRevocationEnforcer#226
jeffsmale90 merged 15 commits into
mainfrom
feat/approval-revocation-enforcer

Conversation

@jeffsmale90
Copy link
Copy Markdown
Collaborator

@jeffsmale90 jeffsmale90 commented May 8, 2026

📝 Description

Adds support for ApprovalRevocationEnforcer throughout packages. The enforcer was added to the framework in MetaMask/delegation-framework#177

🔄 What Changed?

  • Abis added to @metamask/delegation-abis
  • Contract address added to @metamask/delegation-deployments
  • Deployment address added to SmartAccountsEnvironment in @metamask/smart-accounts-kit
  • CaveatBuilder added to @metamask/smart-accounts-kit

End-to-end tests added for the new enforcer.

Deployments verified (I also tested with an incorrect contract address for the new enforcer, and it failed as expected):

Testing version 1.3.0

Ethereum succeeded
Unichain succeeded
Unichain Sepolia succeeded
BNB Smart Chain Testnet succeeded
Gnosis succeeded
Polygon succeeded
Arbitrum Sepolia succeeded
Sonic succeeded
Ronin succeeded
Monad Mainnet succeeded
Katana Bokuto succeeded
Tempo Testnet Moderato succeeded
Gnosis Chiado succeeded
Monad Testnet succeeded
Base Sepolia succeeded
Citrea Mainnet succeeded
Linea Mainnet succeeded
Celo succeeded
Citrea Testnet succeeded
Linea Sepolia Testnet succeeded
Berachain Bepolia succeeded
Sei Testnet succeeded
Arbitrum One succeeded
Mantle succeeded
BNB Smart Chain succeeded
Hoodi succeeded
Ink succeeded
Ronin Saigon succeeded
Sonic Testnet succeeded
Tempo Mainnet succeeded
Mantle Sepolia Testnet succeeded
OP Sepolia succeeded
Base succeeded
Berachain succeeded
OP Mainnet succeeded
Arbitrum Nova succeeded
Polygon Amoy succeeded
MegaEth Mainnet succeeded
MegaEth Testnet succeeded
Sei Network succeeded
Celo Sepolia succeeded
Ink Sepolia succeeded
Katana Mainnet succeeded
Sepolia succeeded

Successfully validated contract deployments
  • Manual testing steps:
  • Automated tests added/updated
  • All existing tests pass

⚠️ Breaking Changes

List any breaking changes:

  • No breaking changes
  • Breaking changes (describe below):

📋 Checklist

Check off completed items:

  • Code follows the project's coding standards
  • Self-review completed
  • Documentation updated (if needed)
  • Tests added/updated
  • Changelog updated (if needed)
  • All CI checks pass

🔗 Related Issues

Link to related issues:
Closes #
Related to #

📚 Additional Notes

Any additional information, concerns, or context:


Note

Medium Risk
Medium risk: introduces a new enforcer type with new ABI/bytecode/address wiring plus new permission/caveat encoding paths, which could affect delegation/caveat construction and decoding if misconfigured.

Overview
Adds first-class support for approval revocation delegations via ApprovalRevocationEnforcer across delegation-abis, delegation-core, delegation-deployments, and smart-accounts-kit.

This introduces a new ERC-7715 permission type token-approval-revocation (and deprecates erc20-token-revocation), adds delegation-core term encode/decode utilities for the enforcer’s 1-byte bitmask, and wires a new approvalRevocation CaveatBuilder/CaveatType plus decodeCaveat support and environment/deployment address entries.

Includes new ABI/bytecode exports for ApprovalRevocationEnforcer and adds unit + e2e coverage for term round-tripping, permission mapping, caveat building/decoding, and an ERC-20 approval revocation flow.

Reviewed by Cursor Bugbot for commit 0bafc0c. Bugbot is set up for automated code reviews on this repo. Configure here.

@jeffsmale90 jeffsmale90 force-pushed the feat/approval-revocation-enforcer branch from 7328ec5 to 0e5b25c Compare May 12, 2026 23:28
@jeffsmale90 jeffsmale90 changed the title Add create / decode terms functions to @metamask/delegation-core for ApprovalRevocationEnforcer Add ApprovalRevocationEnforcer May 15, 2026
@jeffsmale90 jeffsmale90 changed the title Add ApprovalRevocationEnforcer Add support for ApprovalRevocationEnforcer May 15, 2026
@jeffsmale90 jeffsmale90 force-pushed the feat/approval-revocation-enforcer branch from 744e6fb to 89622a8 Compare May 15, 2026 03:25
@jeffsmale90 jeffsmale90 marked this pull request as ready for review May 15, 2026 04:07
@jeffsmale90 jeffsmale90 requested a review from a team as a code owner May 15, 2026 04:07
Comment thread packages/delegation-core/src/caveats/approvalRevocationEnforcer.ts Outdated
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Fix All in Cursor

❌ 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 5e43b65. Configure here.

Comment thread packages/delegation-deployments/src/contractAddresses.ts Outdated
Comment thread packages/smart-accounts-kit/src/caveats.ts
@jeffsmale90 jeffsmale90 force-pushed the feat/approval-revocation-enforcer branch from 523428e to a4d34a0 Compare May 17, 2026 22:42
@jeffsmale90 jeffsmale90 force-pushed the feat/approval-revocation-enforcer branch from a4d34a0 to 26f37ce Compare May 17, 2026 22:47
mj-kiwi
mj-kiwi previously approved these changes May 18, 2026
Copy link
Copy Markdown
Contributor

@mj-kiwi mj-kiwi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

mj-kiwi
mj-kiwi previously approved these changes May 18, 2026
@jeffsmale90 jeffsmale90 force-pushed the feat/approval-revocation-enforcer branch from 54b8c0d to 26f37ce Compare May 18, 2026 07:34
* 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
mj-kiwi
mj-kiwi previously approved these changes May 18, 2026
@jeffsmale90 jeffsmale90 merged commit 41c89ef into main May 18, 2026
19 checks passed
@jeffsmale90 jeffsmale90 deleted the feat/approval-revocation-enforcer branch May 18, 2026 20:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants