From 6339027a7ae783dcb462f6bd6a5be189e46ea449 Mon Sep 17 00:00:00 2001 From: Hadrien Croubois Date: Thu, 19 May 2022 18:35:42 +0200 Subject: [PATCH] Add mention of events possibly emitted (#3421) --- contracts/access/AccessControl.sol | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/contracts/access/AccessControl.sol b/contracts/access/AccessControl.sol index 8274bb55c11..2103be9144b 100644 --- a/contracts/access/AccessControl.sol +++ b/contracts/access/AccessControl.sol @@ -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); @@ -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); @@ -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"); @@ -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 @@ -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)) { @@ -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)) {