Skip to content

Commit ca6f8f9

Browse files
Update AccessControl.sol
In the renouncRole() function, It needs to also check if the caller already has been assigned a role previously and also send them a custom error message if this is not the case
1 parent 48bd286 commit ca6f8f9

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

contracts/access/AccessControl.sol

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,9 @@ abstract contract AccessControl is Context, IAccessControl, ERC165 {
156156
if (callerConfirmation != _msgSender()) {
157157
revert AccessControlBadConfirmation();
158158
}
159-
159+
if (!hasRole(role, callerConfirmation)){
160+
revert AccessControlUnauthorizedAccount(callerConfirmation, role);
161+
}
160162
_revokeRole(role, callerConfirmation);
161163
}
162164

0 commit comments

Comments
 (0)