Skip to content

feat(gator-permissions-controller): Added redeemer rule#8537

Merged
mj-kiwi merged 10 commits intomainfrom
feat/execution-permissions-redeemer-rule
Apr 30, 2026
Merged

feat(gator-permissions-controller): Added redeemer rule#8537
mj-kiwi merged 10 commits intomainfrom
feat/execution-permissions-redeemer-rule

Conversation

@mj-kiwi
Copy link
Copy Markdown
Contributor

@mj-kiwi mj-kiwi commented Apr 21, 2026

Explanation

Add a redeemer rule
{
"type": "redeemer",
"data: {
"addresses": Address[]
}
}

References

Checklist

  • I've updated the test suite for new or updated code as appropriate
  • I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate
  • I've communicated my changes to consumers by updating changelogs for packages I've changed
  • I've introduced breaking changes in this PR and have prepared draft pull requests for clients and consumer packages to resolve them

Note

Medium Risk
Extends execution-permission decoding to accept an additional caveat and to emit a new rules field, which can affect downstream consumers that assume a fixed decoded shape or strict caveat matching.

Overview
Adds support for RedeemerEnforcer as an optional caveat across all execution permission types, decoding its packed-address terms into a redeemer rule (exported via new EXECUTION_PERMISSION_REDEEMER_RULE_TYPE and RedeemerRule).

Updates permission decoding to propagate decoded rules through makePermissionRulevalidateAndDecodeResultreconstructDecodedPermission → controller output, and expands tests (including wallet_getSupportedExecutionPermissions) to advertise/verify the new redeemer rule type and decoding behavior.

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

@mj-kiwi mj-kiwi changed the title feat: Implement redeemer rule for execution permissions and update re… feat: Implement redeemer rule for execution permissions Apr 21, 2026
@mj-kiwi mj-kiwi marked this pull request as ready for review April 27, 2026 08:51
@mj-kiwi mj-kiwi requested review from a team as code owners April 27, 2026 08:51
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 94a0871. Configure here.

@mj-kiwi mj-kiwi changed the title feat: Implement redeemer rule for execution permissions feat(gator-permissions-controller): Implement redeemer rule Apr 27, 2026
@mj-kiwi mj-kiwi changed the title feat(gator-permissions-controller): Implement redeemer rule feat(gator-permissions-controller): Added redeemer rule Apr 27, 2026
@mj-kiwi mj-kiwi requested a review from a team as a code owner April 27, 2026 22:39
Copy link
Copy Markdown
Contributor

@jeffsmale90 jeffsmale90 left a comment

Choose a reason for hiding this comment

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

Nice one!

];
}

return { isValid: true, expiry, data, rules };
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

You had asked about why expiry is not in rules, and suggested that we move it there. I agree it makes sense, but is going to be a breaking change, so let's defer it for now (maybe raise a GH issue).

},
expiry,
origin: specifiedOrigin,
...(rules === undefined ? {} : { rules }),
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

no change needed, but I wish there was a nicer way to do this natively in javascript. Maybe at some stage we can create a shared util (somewhere - @metamask/utils???) that we can use in all our codebases.

Comment thread packages/gator-permissions-controller/src/decodePermission/redeemer.ts Outdated
@socket-security
Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Updated@​metamask/​delegation-core@​0.2.0 ⏵ 1.1.0100 +1100100 +194100

View full report

### Changed

- Bump `@metamask/transaction-controller` from `^64.2.0` to `^64.4.0` ([#8482](https://github.com/MetaMask/core/pull/8482), [#8585](https://github.com/MetaMask/core/pull/8585))
- Use `decodeRedeemerTerms` from `@metamask/delegation-core` instead of a local implementation ([#8537](https://github.com/MetaMask/core/pull/8537))
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nit: this is an internal consideration and probably doesn't need to appear in the changelog.

Copy link
Copy Markdown
Contributor

@jeffsmale90 jeffsmale90 left a comment

Choose a reason for hiding this comment

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

Great!

@mj-kiwi mj-kiwi enabled auto-merge April 30, 2026 06:27
Copy link
Copy Markdown
Contributor

@wenfix wenfix left a comment

Choose a reason for hiding this comment

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

approving changes on packages/eth-json-rpc-middleware/src/methods/wallet-get-supported-execution-permissions.test.ts

@mj-kiwi mj-kiwi added this pull request to the merge queue Apr 30, 2026
Merged via the queue into main with commit f38ffba Apr 30, 2026
366 checks passed
@mj-kiwi mj-kiwi deleted the feat/execution-permissions-redeemer-rule branch April 30, 2026 09:49
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