-
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
Fix bug allowing anyone to cancel an admin renounce #4238
Conversation
|
We should have an additional unit test for this scenario. |
@@ -639,6 +642,15 @@ function shouldBehaveLikeAccessControlDefaultAdminRules(errorPrefix, delay, defa | |||
); | |||
}); | |||
|
|||
it('no op if renouncing when not having the role', async function () { |
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.
Small NIT:
it('no op if renouncing when not having the role', async function () { | |
it('no-ops if renouncing when not having the role', async function () { |
I personally like to read the tests as it('<verb> ...
(eg. it('does something ...')
)
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
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.
Note that the test description was updated but is still not following Ernesto's suggestion. But IMO we should come back to this later, there are many tests throughout that are following a different format.
Agree, it's a minor readability improvement but a suggestion as well, not mandatory. Will try to enforce this in my reviews but don't feel we need to update every test written the same way |
Co-authored-by: Francisco Giordano <fg@frang.io> (cherry picked from commit 3ec4307)
Changes introduced in #4230 include a bug allowing anyone to reset the schedule of an admin renounce:
if (role == DEFAULT_ADMIN_ROLE)
passesnewDefaultAdmin == address(0)
is truedelete _pendingDefaultAdminSchedule
So Bob was able to
delete _pendingDefaultAdminSchedule
, which shouldn't have been possible