Skip to content

Commit

Permalink
Remove outdated comments in AccessControl.sol (#4475)
Browse files Browse the repository at this point in the history
Co-authored-by: Ernesto García <[email protected]>
  • Loading branch information
allwin199 and ernestognw authored Jul 25, 2023
1 parent f347b41 commit 19293f3
Showing 1 changed file with 3 additions and 12 deletions.
15 changes: 3 additions & 12 deletions contracts/access/AccessControl.sol
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,8 @@ abstract contract AccessControl is Context, IAccessControl, ERC165 {

/**
* @dev Modifier that checks that an account has a specific role. Reverts
* with a standardized message including the required role.
* with a custom error including the required role.
*
* The format of the revert reason is given by the following regular expression:
*
* /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/
*/
modifier onlyRole(bytes32 role) {
_checkRole(role);
Expand All @@ -84,21 +81,15 @@ abstract contract AccessControl is Context, IAccessControl, ERC165 {
}

/**
* @dev Revert with a standard message if `_msgSender()` is missing `role`.
* @dev Revert with a custom error if `_msgSender()` is missing `role`.
* Overriding this function changes the behavior of the {onlyRole} modifier.
*
* Format of the revert message is described in {_checkRole}.
*/
function _checkRole(bytes32 role) internal view virtual {
_checkRole(role, _msgSender());
}

/**
* @dev Revert with a standard message if `account` is missing `role`.
*
* The format of the revert reason is given by the following regular expression:
*
* /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/
* @dev Revert with a custom error if `account` is missing `role`.
*/
function _checkRole(bytes32 role, address account) internal view virtual {
if (!hasRole(role, account)) {
Expand Down

0 comments on commit 19293f3

Please sign in to comment.