chore: removes LogicalOrWrapperEnforcer decoding for payee rule#8709
Merged
mj-kiwi merged 2 commits intofeat/payee-rulefrom May 5, 2026
Merged
chore: removes LogicalOrWrapperEnforcer decoding for payee rule#8709mj-kiwi merged 2 commits intofeat/payee-rulefrom
LogicalOrWrapperEnforcer decoding for payee rule#8709mj-kiwi merged 2 commits intofeat/payee-rulefrom
Conversation
- Only allow a single allowedCalldata caveat to encode a single payee for erc20 token permissions - Disallow payee rule decoding for erc20-token-revocation - Removes tests related to logical OR enforcer, but does not add any additional coverage
80c7922 to
b1369e5
Compare
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.
Explanation
Updates permission decoding logic, disallowing multiple
payeeaddresses forerc20token type permissions.The
LogicalOrEnforcerimplementation requires thecaveatGroupIndexto be passed as an argument at redemption time. This means that the enforcer is not EIP-7710 compliant - the redeemer must be able to decode, and understand thepermissionContext.This PR removes
LogicalOrEnforcerdecoding logic, and allows only a singlepayeeaddress to be specified via theAllowedCalldataEnforcer.References
MetaMask/snap-7715-permissions#313
Checklist
Note
Medium Risk
Changes permission decoding semantics for
payeerules (removing multi-payee support and tightening caveat validation), which could affect clients relying on previously accepted caveat shapes. Risk is mitigated by updated unit tests covering new acceptance/rejection cases.Overview
Updates
gator-permissions-controllerpermission decoding to removeLogicalOrWrapperEnforcersupport when extractingpayeerules, effectively limiting ERC-20 payee decoding to a single address viaAllowedCalldataEnforcerand simplifying payee rule documentation.makePermissionRulenow enforces stricter payee caveat rules (e.g., rejects multiple single-payee caveats and disallows configuring the single-payee enforcer as required) and temporarily suppresses emittingpayeerules forerc20-token-revocation. Tests are rewritten/added to reflect the new decoding behavior and error messages, andLogicalOrWrapperEnforceris removed from enforcer/type plumbing.Reviewed by Cursor Bugbot for commit b1369e5. Bugbot is set up for automated code reviews on this repo. Configure here.