Skip to content

Commit

Permalink
Add mention of events possibly emitted (#3421)
Browse files Browse the repository at this point in the history
  • Loading branch information
Amxx committed May 19, 2022
1 parent 46db8a9 commit 6339027
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions contracts/access/AccessControl.sol
Expand Up @@ -138,6 +138,8 @@ abstract contract AccessControl is Context, IAccessControl, ERC165 {
* Requirements:
*
* - the caller must have ``role``'s admin role.
*
* May emit a {RoleGranted} event.
*/
function grantRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {
_grantRole(role, account);
Expand All @@ -151,6 +153,8 @@ abstract contract AccessControl is Context, IAccessControl, ERC165 {
* Requirements:
*
* - the caller must have ``role``'s admin role.
*
* May emit a {RoleRevoked} event.
*/
function revokeRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {
_revokeRole(role, account);
Expand All @@ -169,6 +173,8 @@ abstract contract AccessControl is Context, IAccessControl, ERC165 {
* Requirements:
*
* - the caller must be `account`.
*
* May emit a {RoleRevoked} event.
*/
function renounceRole(bytes32 role, address account) public virtual override {
require(account == _msgSender(), "AccessControl: can only renounce roles for self");
Expand All @@ -183,6 +189,8 @@ abstract contract AccessControl is Context, IAccessControl, ERC165 {
* event. Note that unlike {grantRole}, this function doesn't perform any
* checks on the calling account.
*
* May emit a {RoleGranted} event.
*
* [WARNING]
* ====
* This function should only be called from the constructor when setting
Expand Down Expand Up @@ -213,6 +221,8 @@ abstract contract AccessControl is Context, IAccessControl, ERC165 {
* @dev Grants `role` to `account`.
*
* Internal function without access restriction.
*
* May emit a {RoleGranted} event.
*/
function _grantRole(bytes32 role, address account) internal virtual {
if (!hasRole(role, account)) {
Expand All @@ -225,6 +235,8 @@ abstract contract AccessControl is Context, IAccessControl, ERC165 {
* @dev Revokes `role` from `account`.
*
* Internal function without access restriction.
*
* May emit a {RoleRevoked} event.
*/
function _revokeRole(bytes32 role, address account) internal virtual {
if (hasRole(role, account)) {
Expand Down

0 comments on commit 6339027

Please sign in to comment.