Skip to content

Conversation

@Jesse-Sawa
Copy link
Member

@Jesse-Sawa Jesse-Sawa commented Jan 6, 2026

Problem

Most teams using Predicate only need simple WHO-based access control (KYC, allowlists, time restrictions), but today they're forced to encode function signatures and handle parameters they don't actually use.

Solution

Split into two implementations:

  • BasicPredicateClient: For the majority of use cases that only validate WHO can call. No encoding onchain needed.
  • AdvancedPredicateClient: For complex policies that validate WHAT function, HOW MUCH value, or specific parameters.

Decision guide: "Do I need different rules based on WHAT users are doing, or just WHO is doing it?"

  • Just WHO → Basic
  • WHAT/HOW MUCH → Advanced

Note: to simplify the entire flow, we will need to modify the attestation API to ignore the data and msg_value fields


Note

Introduces a reusable PredicateClient abstract mixin to validate attestations via a PredicateRegistry, with namespaced (ERC-7201) storage.

  • New PredicateClient mixin: init via _initPredicateClient, manage policy/registry with _setPolicyID, _setRegistry, getters, PredicateRegistryUpdated/PredicatePolicyIDUpdated events, and onlyPredicateRegistry modifier
  • Core auth flow: _authorizeTransaction builds a Statement and calls IPredicateRegistry.validateAttestation
  • Adds IPredicateClient and IPredicateRegistry interfaces, including Statement and Attestation structs and policy/validation methods
  • Updates pragma to ^0.8.4 across new/modified files

Written by Cursor Bugbot for commit dea67aa. This will update automatically on new commits. Configure here.

@openzeppelin-code
Copy link

openzeppelin-code bot commented Jan 6, 2026

Adds Basic and Advanced PredicateClient implementations

Generated at commit: 2e71ceb18397f37a577c9633fd1c4eb005728eaf

🚨 Report Summary

Severity Level Results
Contracts Critical
High
Medium
Low
Note
Total
1
0
0
4
23
28
Dependencies Critical
High
Medium
Low
Note
Total
0
0
0
0
0
0

For more details view the full report in OpenZeppelin Code Inspector

Copy link

@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.

This PR is being reviewed by Cursor Bugbot

Details

Your team is on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle for each member of your team.

To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.

@Jesse-Sawa Jesse-Sawa changed the title Adds Basic and Advanced PredicateClient implementations Adds a Basic PredicateClient implementation Jan 17, 2026
@Jesse-Sawa
Copy link
Member Author

Wondering if we should rename PredicateClient to AdvancedPredicateClient

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.

1 participant