-
Notifications
You must be signed in to change notification settings - Fork 6
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
Initial proposal for excubiae
framework
#3
Conversation
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.
Left some comments, good stuff
…d; conform to natspec
|
||
/// @notice Tracks whether an address has successfully passed the gate check. | ||
/// @dev Maps an address to a boolean indicating pass status. | ||
mapping(address => bool) public checked; |
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.
so here's the tricky part, given this is supposed to be the abstract contract everyone inherits from, I think it's best that either this mapping is as generalized as possible, so instead of address
you store the encoded data like bytes
(which not sure if it always works), or you omit this mapping from this contract and make it clear that each gate contract should implement this mapping to prevent double signups. Just thinking along the lines of: a user comes to the gate with something they own, and that something that owns is what grants them access, like in a door you grant access to anyone that has a key. If you then keep an image of their face to prevent entering once, they could give the key to someone else to enter, but if you prevent the same key from entering, even if they give the key to someone else they won't be able to enter. If someone though gives you their unused key then you could enter twice which is a problem, but they wouldn't be able to enter themselves (so maybe this needs even a bit more thinking, and storing both what you own and who you are if both make sense for the specific gate). This assumes the "key" can be transferred which might not always be the case in something like EAS, Zupass, etc. but just trying to make this as general as possible if that makes sense
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.
TLDR I think in general it might be easier if a specific gate decides the data type of this mapping
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.
OK, all clear. To stop someone else (a passerby) from using the same data, regardless of protocol, to try to pass the gatekeeper check twice but with a different address, we need to save two mappings: one for the passerby and one for the data.
In short, we have two options:
- Do nothing and let the abstract contract implementer decide what information to save in the pass + check logic to avoid sibyl.
- Make sure everyone saves the address and data in mappings.
As we discussed in the chat, let's stick with the first option for now until we come up with a registry or logic that can be merged into a single solution. Therefore, people need to implement their own method based on their own "credentials" to potentially avoid:
- different addresses using the same data to pass the check.
- the same address passing the check twice with the same data (can be useful for some protocols, for others not).
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.
btw, reflected these decisions in the usage section of the README, specifying that the developer needs to provide their own logic for gatekeeping + preventing unwanted access.
f552677
to
f10bd6d
Compare
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.
Awesome!
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.
…heck; add unit test
Add basic `EASExcubia` implementation
Description
This PR proposes a framework for general purpose on-chain gatekeepers. You can find more at the following HackMD document.
Related Issue(s)
None.
Other information
None.
Checklist
yarn format
andyarn compile
without getting any errors