-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor and advance core framework capabilities #9
base: dev
Are you sure you want to change the base?
Conversation
…es in one gatekeeper x gate
BaseChecker public immutable BASE_CHECKER; | ||
|
||
/// @dev Tracks whether the check has been enforced for a subject. | ||
mapping(address => mapping(address => bool)) public enforced; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what's the reasoning behind storing addresses as a base? imagine a ERC721 policy, they could transfer the token id to another wallet and pass again? wouldn't the type of data to be stored need to be custom for each policy?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The base address-to-address mapping serves as a fundamental tracking mechanism for policy enforcement. While this may seem simple, it's intentionally designed this way for two reasons:
- The policy's primary role is binary - tracking whether a subject has enforced evidence for an address. Complex validation logic (like NFT ownership changes) belongs in policy checker extensions - not at core functionality level (the gatekeeper must enforce and keep track, based on the checks).
- Additional checks and restrictions are implemented at the Checker level, not the Policy level. For example,
AdvancedERC721Checker
under thetest/advanced
folder can track usedtokenIds
to prevent reuse - this is where such specific validation belongs.
This design maintains clean separation between basic enforcement tracking and policy-specific validation rules. Let me know if this makes sense!
This PR extends the core framework's functionality based on #5 conversations and more.
Base
andAdvanced
gatekeeper division with reusableChecker
contracts. This is a huge breaking change compared to previous prototype implementation on zk-kit.mapping(address => mapping(address => bool))
can make us able to simulate different deployed instances of Excubiae Gatekeeper and maintain a reference like 1 contract <> N independent states (who already passed the gatekeeper). This will allow us to get rid of the non-determinism in deployments and maintain a structure where navigating and managing the different gatekeepers smoothly.The change will allow for other changes, as:
Checker
independent contract instead ofcheck()
methodBase
andAdvanced
separation of concerns forExcubia
andChecker
contractsAlreadyPassed
checks & logicbool
Excubia
extensions (FreeForAllExcubia
)_internal
vsexternal
methods