-
Notifications
You must be signed in to change notification settings - Fork 11.8k
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
Feature/Adding RoleAdminChanged event in AccessControl #2214
Feature/Adding RoleAdminChanged event in AccessControl #2214
Conversation
I see 2 potential changes worth discussing:
Looking forward for your comments! |
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.
Sorry for the delay @julianmrodri! We were a bit busy with the release of v3.0 and the Solidity Summity last week.
This looks great, thanks! I love how you followed our style for the docs and tests - I only left a small suggestion for further clarity.
Regarding only emitting on change, AccessControl
is a bit special in that no-ops in grantRole
and revokeRole
don't emit events. This is to prevent confusion: RoleRevoked
seems to imply the role had been previously granted, so we wanted to avoid revokes not preceeded by grants.
This case however seems more similar to an ERC20
transfer of 0. What if instead we added the previous role admin in the event? @frangio WDYT?
I agree we should include the current admin role in the event as well, similar to the |
Co-authored-by: Nicolás Venturo <[email protected]>
Sounds good! Thanks! Will implement the change to add the current Admin Role and let you know. |
0214dbf
to
fe474fb
Compare
@nventuro @frangio I have implemented the changes you suggested.
Let me know what you think thanks for your support! |
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.
Thank you very much @julianmrodri! I went ahead and adjusted the overly long line to a style that is more congruent with what we tend to use, and added an entry to the changelog for this improvement.
Hope to see more contributions from you soon! :)
Thanks for your time and patience! for sure! |
#2210
Fixes #2210
Adding a new event named "RoleAdminChanged" when the adminRole of a Role is changed. This event is emitted from with the _setRoleAdmin function.