feat: add payee rule and LogicalOrWrapper enforcer#219
Open
Conversation
jeffsmale90
reviewed
Apr 30, 2026
Comment on lines
+148
to
+151
| /** | ||
| * When set, adds a `payee` execution rule: only these addresses may receive funds from the permission. | ||
| */ | ||
| payee?: readonly Address[] | undefined | null; |
Collaborator
There was a problem hiding this comment.
The payee rule is only applicable for allowance type permissions (allowance / stream / periodic).
We could either make PermissionRequestParameter generic and extract the supported rule types (seems difficult and maybe over-engineered) or update the comment on this parameter to indicate that it's only supported on allowance type permissions.
Contributor
Author
There was a problem hiding this comment.
I updated the comment for the payee for now.
Comment on lines
+12
to
+14
| - feat: add payee rule | ||
| - Optional `payee` on `PermissionRequestParameter` maps to a `payee` execution rule; granted permission responses checksum-normalize payee addresses in `rules`. | ||
|
|
Collaborator
There was a problem hiding this comment.
This can be merged into a single line - and needs the PR link
jeffsmale90
reviewed
May 1, 2026
| * Terms for configuring a LogicalOrWrapper caveat. | ||
| */ | ||
| export type LogicalOrWrapperTerms<TBytesLike extends BytesLike = BytesLike> = { | ||
| /** An array of caveat groups — redemption succeeds if any single group passes. */ |
Collaborator
There was a problem hiding this comment.
I think actually, the caveat is successful if any of the caveats in the CaveatGroup specified by index by args is successful.
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
Add optional
payeeexecution rule toPermissionRequestParameterfor allowance-type permissions, and addLogicalOrWrapperEnforcerencoding/decoding support todelegation-core.🔄 What Changed?
payeefield onPermissionRequestParameterthat maps to apayeeexecution rule (allowance, stream, periodic permissions only)LogicalOrWrapperEnforcercaveat todelegation-corewithcreateLogicalOrWrapperTerms,decodeLogicalOrWrapperTerms,createLogicalOrWrapperArgs, anddecodeLogicalOrWrapperArgs🚀 Why?
🧪 How to Test?
📋 Checklist
CHANGELOG entry
Note
Medium Risk
Adds a new execution rule (
payee) that affects how permission requests are serialized/validated and how returned rules are normalized, plus introduces a new caveat encoding format (LogicalOrWrapper) where incorrect ABI packing could break interoperability.Overview
Adds support for a new
LogicalOrWrapperEnforcercaveat indelegation-core, including ABI encode/decode helpers for both terms (OR over caveat groups) and redemption args (selected group + per-caveat args), and exports these helpers from the package.Extends ERC-7715 permission requests in
smart-accounts-kitwith an optionalpayeefield that is validated, checksummed, and mapped into apayeerule for wallet RPC requests; granted permission responses now checksum-normalize addresses for bothredeemerandpayeerules. Tests and the changelog/docs are updated accordingly.Reviewed by Cursor Bugbot for commit b0cbf55. Bugbot is set up for automated code reviews on this repo. Configure here.