Skip to content
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

Add modifier & internal function with standard revert message in AccessControl #2609

Merged
merged 18 commits into from
Apr 16, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
use _checkRole in onlyRoleorOpenRole
  • Loading branch information
frangio authored Apr 13, 2021
commit e0480a4556dab04a38c875a6142bf28f91251a5c
4 changes: 3 additions & 1 deletion contracts/governance/TimelockController.sol
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,9 @@ contract TimelockController is AccessControl {
* this role for everyone.
*/
modifier onlyRoleOrOpenRole(bytes32 role) {
Amxx marked this conversation as resolved.
Show resolved Hide resolved
require(hasRole(role, _msgSender()) || hasRole(role, address(0)), "TimelockController: sender requires permission");
if (!hasRole(role, address(0))) {
_checkRole(role, _msgSender());
}
_;
}

Expand Down