Browse Source

Add mention of events possibly emitted (#3421)

Hadrien Croubois 3 years ago
parent
commit
6339027a7a
1 changed files with 12 additions and 0 deletions
  1. 12 0
      contracts/access/AccessControl.sol

+ 12 - 0
contracts/access/AccessControl.sol

@@ -138,6 +138,8 @@ abstract contract AccessControl is Context, IAccessControl, ERC165 {
      * Requirements:
      * Requirements:
      *
      *
      * - the caller must have ``role``'s admin role.
      * - 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)) {
     function grantRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {
         _grantRole(role, account);
         _grantRole(role, account);
@@ -151,6 +153,8 @@ abstract contract AccessControl is Context, IAccessControl, ERC165 {
      * Requirements:
      * Requirements:
      *
      *
      * - the caller must have ``role``'s admin role.
      * - 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)) {
     function revokeRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {
         _revokeRole(role, account);
         _revokeRole(role, account);
@@ -169,6 +173,8 @@ abstract contract AccessControl is Context, IAccessControl, ERC165 {
      * Requirements:
      * Requirements:
      *
      *
      * - the caller must be `account`.
      * - the caller must be `account`.
+     *
+     * May emit a {RoleRevoked} event.
      */
      */
     function renounceRole(bytes32 role, address account) public virtual override {
     function renounceRole(bytes32 role, address account) public virtual override {
         require(account == _msgSender(), "AccessControl: can only renounce roles for self");
         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
      * event. Note that unlike {grantRole}, this function doesn't perform any
      * checks on the calling account.
      * checks on the calling account.
      *
      *
+     * May emit a {RoleGranted} event.
+     *
      * [WARNING]
      * [WARNING]
      * ====
      * ====
      * This function should only be called from the constructor when setting
      * 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`.
      * @dev Grants `role` to `account`.
      *
      *
      * Internal function without access restriction.
      * Internal function without access restriction.
+     *
+     * May emit a {RoleGranted} event.
      */
      */
     function _grantRole(bytes32 role, address account) internal virtual {
     function _grantRole(bytes32 role, address account) internal virtual {
         if (!hasRole(role, account)) {
         if (!hasRole(role, account)) {
@@ -225,6 +235,8 @@ abstract contract AccessControl is Context, IAccessControl, ERC165 {
      * @dev Revokes `role` from `account`.
      * @dev Revokes `role` from `account`.
      *
      *
      * Internal function without access restriction.
      * Internal function without access restriction.
+     *
+     * May emit a {RoleRevoked} event.
      */
      */
     function _revokeRole(bytes32 role, address account) internal virtual {
     function _revokeRole(bytes32 role, address account) internal virtual {
         if (hasRole(role, account)) {
         if (hasRole(role, account)) {