Make more functions virtual (#3078)
Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
This commit is contained in:
@ -81,7 +81,7 @@ abstract contract AccessControl is Context, IAccessControl, ERC165 {
|
||||
/**
|
||||
* @dev Returns `true` if `account` has been granted `role`.
|
||||
*/
|
||||
function hasRole(bytes32 role, address account) public view override returns (bool) {
|
||||
function hasRole(bytes32 role, address account) public view virtual override returns (bool) {
|
||||
return _roles[role].members[account];
|
||||
}
|
||||
|
||||
@ -92,7 +92,7 @@ abstract contract AccessControl is Context, IAccessControl, ERC165 {
|
||||
*
|
||||
* /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/
|
||||
*/
|
||||
function _checkRole(bytes32 role, address account) internal view {
|
||||
function _checkRole(bytes32 role, address account) internal view virtual {
|
||||
if (!hasRole(role, account)) {
|
||||
revert(
|
||||
string(
|
||||
@ -113,7 +113,7 @@ abstract contract AccessControl is Context, IAccessControl, ERC165 {
|
||||
*
|
||||
* To change a role's admin, use {_setRoleAdmin}.
|
||||
*/
|
||||
function getRoleAdmin(bytes32 role) public view override returns (bytes32) {
|
||||
function getRoleAdmin(bytes32 role) public view virtual override returns (bytes32) {
|
||||
return _roles[role].adminRole;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user