Skip to content

Commit 9de2027

Browse files
authored
Update PolygonAccessControlUpgradeable.md
1 parent 8b77d32 commit 9de2027

File tree

1 file changed

+13
-15
lines changed

1 file changed

+13
-15
lines changed

docs/zkEVM/architecture/high-level/smart-contracts/api/lib/PolygonAccessControlUpgradeable.md

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
A contract that inherits `AccessControlUpgradeable` from Openzeppelin, but with the following modifications:
22

3-
- Delete `ERC165Upgradeable` dependencies to save us the "gap" variables and let us have consistent storage.
4-
- Add the legacy `Owner` variable, to be consistent with the previous.
5-
- Add custom errors.
6-
- Replace `_msgSender()` with `msg.sender`.
3+
- Deleted `ERC165Upgradeable` dependencies to save us the "gap" variables and let us have consistent storage.
4+
- Added the legacy `Owner` variable, to be consistent with the previous.
5+
- Added custom errors.
6+
- Replaced `_msgSender()` with `msg.sender`.
77

88
## Functions
99

@@ -59,27 +59,25 @@ To change a role's admin, use `_setRoleAdmin`.
5959

6060
### `grantRole`
6161

62-
Grants `role` to `account`. If `account` had not been already granted `role`, it emits a `RoleGranted` event.
62+
Grants `role` to `account`. If `account` had not been granted `role`, it emits a `RoleGranted` event.
6363

6464
```solidity
6565
function grantRole(
6666
) public
6767
```
6868

69-
- The caller must have `role`'s admin role.
69+
- The caller must have the `role` as the admin role.
7070
- May emit a `RoleGranted` event.
7171

7272
### `revokeRole`
7373

74-
Revokes `role` from `account`. If `account` had been granted `role`, emits a `RoleRevoked` event.
74+
Revokes `role` from `account`. If `account` had been granted `role`, this function emits a `RoleRevoked` event.
7575

7676
```solidity
7777
function revokeRole(
7878
) public
7979
```
8080

81-
82-
8381
### `renounceRole`
8482

8583
Revokes `role` from the calling account.
@@ -89,12 +87,12 @@ Revokes `role` from the calling account.
8987
) public
9088
```
9189

92-
- The caller must have `account`'s admin role.
90+
- The caller must have the admin role `account`.
9391
- May emit a `RoleRevoked` event.
9492

9593
Roles are often managed via `grantRole` and `revokeRole`. The purpose of this function is to provide a mechanism for accounts to lose their privileges if they are compromised (such as when a trusted device is misplaced).
9694

97-
Emits a `RoleRevoked`event if the calling account had `role` revoked.
95+
Emits a `RoleRevoked`event if the calling account had its `role` revoked.
9896

9997
### `_setupRole`
10098

@@ -103,23 +101,23 @@ Emits a `RoleRevoked`event if the calling account had `role` revoked.
103101
) internal
104102
```
105103

106-
Grants `role` to `account`.
104+
Grants `role` to an `account`.
107105

108-
Emits a `RoleGranted`event if `account` had not been already granted `role`.
106+
Emits a `RoleGranted` event if `account` had not been granted `role` before.
109107
Note that unlike `grantRole`, this function doesn't perform any checks on the calling account.
110108

111109
May emit a `RoleGranted` event.
112110

113111
!!! warn
114-
- This function should only be called from the constructor when setting up the initial roles for the system.
112+
- This function should only be called from the constructor, when setting up the initial roles for the system.
115113
- Using this function in any other way is effectively circumventing the admin system imposed by `AccessControl`.
116114

117115
!!! note
118116
- This function is deprecated in favor of `_grantRole`.
119117

120118
### `_setRoleAdmin`
121119

122-
Sets `adminRole` as `role`'s admin role.
120+
Sets `adminRole` as the admin `role`.
123121

124122
```solidity
125123
function _setRoleAdmin(

0 commit comments

Comments
 (0)