11// Copyright Immutable Pty Ltd 2018 - 2023
22// SPDX-License-Identifier: Apache 2.0
3- pragma solidity 0.8.19 ;
3+ pragma solidity ^ 0.8.24 ;
44
55// Access Control
66
7- import {Role} from "../../../Role.sol " ;
7+ import {Role} from "../../../../src/ Role.sol " ;
88import {OwnableRoles} from "@solady/auth/OwnableRoles.sol " ;
99
1010// Interfaces
@@ -19,7 +19,7 @@ interface IProxy {
1919
2020}
2121
22- interface IERC165 {
22+ interface ERC165 {
2323
2424 function supportsInterface (bytes4 interfaceId ) external view returns (bool );
2525
@@ -32,7 +32,7 @@ interface IERC165 {
3232 OperatorAllowlist is not designed to be upgradeable or extended.
3333*/
3434
35- contract OperatorAllowlist is ERC165 , AccessControl , IOperatorAllowlist {
35+ contract OperatorAllowlist is ERC165 , OwnableRoles , IOperatorAllowlist {
3636
3737 /// @notice Mapping of Allowlisted addresses
3838 mapping (address aContract = > bool allowed ) private addressAllowlist;
@@ -54,11 +54,11 @@ contract OperatorAllowlist is ERC165, AccessControl, IOperatorAllowlist {
5454 /// ===== Constructor =====
5555
5656 /**
57- * @notice Grants `_MANAGER_ROLE` to the supplied `admin` address
58- * @param admin the address to grant `_MANAGER_ROLE` to
57+ * @notice Grants `Role. _MANAGER_ROLE` to the supplied `admin` address
58+ * @param admin the address to grant `Role. _MANAGER_ROLE` to
5959 */
6060 constructor (address admin ) {
61- _grantRoles (admin, _MANAGER_ROLE);
61+ _grantRoles (admin, Role. _MANAGER_ROLE);
6262 }
6363
6464 /// ===== External functions =====
@@ -67,7 +67,7 @@ contract OperatorAllowlist is ERC165, AccessControl, IOperatorAllowlist {
6767 * @notice Add a target address to Allowlist
6868 * @param addressTargets the addresses to be added to the allowlist
6969 */
70- function addAddressToAllowlist (address [] calldata addressTargets ) external onlyRoles (_REGISTRAR_ROLE) {
70+ function addAddressToAllowlist (address [] calldata addressTargets ) external onlyRoles (Role. _REGISTRAR_ROLE) {
7171 for (uint256 i; i < addressTargets.length ; i++ ) {
7272 addressAllowlist[addressTargets[i]] = true ;
7373 emit AddressAllowlistChanged (addressTargets[i], true );
@@ -78,7 +78,7 @@ contract OperatorAllowlist is ERC165, AccessControl, IOperatorAllowlist {
7878 * @notice Remove a target address from Allowlist
7979 * @param addressTargets the addresses to be removed from the allowlist
8080 */
81- function removeAddressFromAllowlist (address [] calldata addressTargets ) external onlyRoles (_REGISTRAR_ROLE) {
81+ function removeAddressFromAllowlist (address [] calldata addressTargets ) external onlyRoles (Role. _REGISTRAR_ROLE) {
8282 for (uint256 i; i < addressTargets.length ; i++ ) {
8383 delete addressAllowlist[addressTargets[i]];
8484 emit AddressAllowlistChanged (addressTargets[i], false );
@@ -93,7 +93,7 @@ contract OperatorAllowlist is ERC165, AccessControl, IOperatorAllowlist {
9393 * implementation address allowlist.
9494 * @param walletAddr the wallet address to be added to the allowlist
9595 */
96- function addWalletToAllowlist (address walletAddr ) external onlyRoles (_REGISTRAR_ROLE) {
96+ function addWalletToAllowlist (address walletAddr ) external onlyRoles (Role. _REGISTRAR_ROLE) {
9797 // get bytecode of wallet
9898 bytes32 codeHash;
9999 // solhint-disable-next-line no-inline-assembly
@@ -113,7 +113,7 @@ contract OperatorAllowlist is ERC165, AccessControl, IOperatorAllowlist {
113113 * This will remove the proxy bytecode hash and implementation contract address pair from the allowlist
114114 * @param walletAddr the wallet address to be removed from the allowlist
115115 */
116- function removeWalletFromAllowlist (address walletAddr ) external onlyRoles (_REGISTRAR_ROLE) {
116+ function removeWalletFromAllowlist (address walletAddr ) external onlyRoles (Role. _REGISTRAR_ROLE) {
117117 // get bytecode of wallet
118118 bytes32 codeHash;
119119 // solhint-disable-next-line no-inline-assembly
@@ -129,19 +129,19 @@ contract OperatorAllowlist is ERC165, AccessControl, IOperatorAllowlist {
129129 }
130130
131131 /**
132- * @notice Allows admin to grant `user` `_REGISTRAR_ROLE` role
133- * @param user the address that `_REGISTRAR_ROLE` will be granted to
132+ * @notice Allows admin to grant `user` `Role. _REGISTRAR_ROLE` role
133+ * @param user the address that `Role. _REGISTRAR_ROLE` will be granted to
134134 */
135- function grantRegistrarRole (address user ) external onlyRoles (_MANAGER_ROLE) {
136- grantRoles (user, _REGISTRAR_ROLE);
135+ function grantRegistrarRole (address user ) external onlyRoles (Role. _MANAGER_ROLE) {
136+ grantRoles (user, Role. _REGISTRAR_ROLE);
137137 }
138138
139139 /**
140- * @notice Allows admin to revoke `_REGISTRAR_ROLE` role from `user`
141- * @param user the address that `_REGISTRAR_ROLE` will be revoked from
140+ * @notice Allows admin to revoke `Role. _REGISTRAR_ROLE` role from `user`
141+ * @param user the address that `Role. _REGISTRAR_ROLE` will be revoked from
142142 */
143- function revokeRegistrarRole (address user ) external onlyRoles (_MANAGER_ROLE) {
144- revokeRole (user, _REGISTRAR_ROLE);
143+ function revokeRegistrarRole (address user ) external onlyRoles (Role. _MANAGER_ROLE) {
144+ revokeRoles (user, Role. _REGISTRAR_ROLE);
145145 }
146146
147147 /// ===== View functions =====
@@ -175,8 +175,8 @@ contract OperatorAllowlist is ERC165, AccessControl, IOperatorAllowlist {
175175 * @notice ERC-165 interface support
176176 * @param interfaceId The interface identifier, which is a 4-byte selector.
177177 */
178- function supportsInterface (bytes4 interfaceId ) public view virtual override (ERC165 , AccessControl ) returns (bool ) {
179- return interfaceId == type (IOperatorAllowlist).interfaceId || super . supportsInterface (interfaceId) ;
178+ function supportsInterface (bytes4 interfaceId ) public view virtual override (ERC165 ) returns (bool ) {
179+ return interfaceId == type (IOperatorAllowlist).interfaceId;
180180 }
181181
182182}
0 commit comments