-
Notifications
You must be signed in to change notification settings - Fork 4
Unshielded Access Control #182
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
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.
Great start, @emnul! The design looks good. I left some comments
Co-authored-by: Andrew Fleming <[email protected]> Signed-off-by: ⟣ €₥ℵ∪ℓ ⟢ <[email protected]>
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.
Initial review of changes
@andrew-fleming after playing around with the contract it seems that setting the |
Co-authored-by: Andrew Fleming <[email protected]> Signed-off-by: ⟣ €₥ℵ∪ℓ ⟢ <[email protected]>
Co-authored-by: Andrew Fleming <[email protected]> Signed-off-by: ⟣ €₥ℵ∪ℓ ⟢ <[email protected]>
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.
Improvements look outstanding! I left a few more suggestions (super minor, with the code examples). Otherwise, I think we're good to go 🚀
Co-authored-by: Andrew Fleming <[email protected]> Signed-off-by: ⟣ €₥ℵ∪ℓ ⟢ <[email protected]>
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.
Completed review of most recent changes
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.
LGTM!
Types of changes
Fixes #89
This pull request adds an unshielded AccessControl module to the Compact contracts library. Some notable design decisions:
_unsafeGrantRole
function to allow users to grant roles to aContractAddress
_unsafeRevokeRole
function since I didn't see any major security concerns with implementingrevokeRole
and_revokeRole
as isRoleData
struct. Sincestruct
types in Compact cannot contain ledger data types I decided to instead create a_operatorRoles
ledger variable and_adminRoles
ledger variable to Map roles -> accounts -> permissions and roles -> admin roles respectively.PR Checklist