1+ // SPDX-License-Identifier: MIT
2+ // OpenZeppelin Contracts v4.4.1 (access/IAccessControl.sol)
3+
4+ pragma solidity ^ 0.8.0 ;
5+
6+ /**
7+ * @dev External interface of AccessControl declared to support ERC165 detection.
8+ */
9+ interface IPermissions {
10+ /**
11+ * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`
12+ *
13+ * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite
14+ * {RoleAdminChanged} not being emitted signaling this.
15+ *
16+ * _Available since v3.1._
17+ */
18+ event RoleAdminChanged (bytes32 indexed role , bytes32 indexed previousAdminRole , bytes32 indexed newAdminRole );
19+
20+ /**
21+ * @dev Emitted when `account` is granted `role`.
22+ *
23+ * `sender` is the account that originated the contract call, an admin role
24+ * bearer except when using {AccessControl-_setupRole}.
25+ */
26+ event RoleGranted (bytes32 indexed role , address indexed account , address indexed sender );
27+
28+ /**
29+ * @dev Emitted when `account` is revoked `role`.
30+ *
31+ * `sender` is the account that originated the contract call:
32+ * - if using `revokeRole`, it is the admin role bearer
33+ * - if using `renounceRole`, it is the role bearer (i.e. `account`)
34+ */
35+ event RoleRevoked (bytes32 indexed role , address indexed account , address indexed sender );
36+
37+ /**
38+ * @dev Returns `true` if `account` has been granted `role`.
39+ */
40+ function hasRole (bytes32 role , address account ) external view returns (bool );
41+
42+ /**
43+ * @dev Returns the admin role that controls `role`. See {grantRole} and
44+ * {revokeRole}.
45+ *
46+ * To change a role's admin, use {AccessControl-_setRoleAdmin}.
47+ */
48+ function getRoleAdmin (bytes32 role ) external view returns (bytes32 );
49+
50+ /**
51+ * @dev Grants `role` to `account`.
52+ *
53+ * If `account` had not been already granted `role`, emits a {RoleGranted}
54+ * event.
55+ *
56+ * Requirements:
57+ *
58+ * - the caller must have ``role``'s admin role.
59+ */
60+ function grantRole (bytes32 role , address account ) external ;
61+
62+ /**
63+ * @dev Revokes `role` from `account`.
64+ *
65+ * If `account` had been granted `role`, emits a {RoleRevoked} event.
66+ *
67+ * Requirements:
68+ *
69+ * - the caller must have ``role``'s admin role.
70+ */
71+ function revokeRole (bytes32 role , address account ) external ;
72+
73+ /**
74+ * @dev Revokes `role` from the calling account.
75+ *
76+ * Roles are often managed via {grantRole} and {revokeRole}: this function's
77+ * purpose is to provide a mechanism for accounts to lose their privileges
78+ * if they are compromised (such as when a trusted device is misplaced).
79+ *
80+ * If the calling account had been granted `role`, emits a {RoleRevoked}
81+ * event.
82+ *
83+ * Requirements:
84+ *
85+ * - the caller must be `account`.
86+ */
87+ function renounceRole (bytes32 role , address account ) external ;
88+ }
0 commit comments