Skip to content

Commit d6c16e4

Browse files
authored
NO-JIRA [fix] remove accesscontrolenumerable from oalenforced (#224)
1 parent 24dc024 commit d6c16e4

File tree

4 files changed

+10
-47
lines changed

4 files changed

+10
-47
lines changed

contracts/allowlist/OperatorAllowlistEnforced.sol

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ pragma solidity 0.8.19;
66
// Allowlist Registry
77
import {IOperatorAllowlist} from "./IOperatorAllowlist.sol";
88

9-
// Access Control
10-
import {AccessControlEnumerable, IERC165} from "@openzeppelin/contracts/access/AccessControlEnumerable.sol";
9+
// Interface
10+
import {IERC165} from "@openzeppelin/contracts/utils/introspection/ERC165.sol";
1111

1212
// Errors
1313
import {OperatorAllowlistEnforcementErrors} from "../errors/Errors.sol";
@@ -19,7 +19,7 @@ import {OperatorAllowlistEnforcementErrors} from "../errors/Errors.sol";
1919
OperatorAllowlistEnforced is not designed to be upgradeable or extended.
2020
*/
2121

22-
abstract contract OperatorAllowlistEnforced is AccessControlEnumerable, OperatorAllowlistEnforcementErrors {
22+
abstract contract OperatorAllowlistEnforced is OperatorAllowlistEnforcementErrors {
2323
/// ===== State Variables =====
2424

2525
/// @notice Interface that implements the `IOperatorAllowlist` interface
@@ -88,14 +88,6 @@ abstract contract OperatorAllowlistEnforced is AccessControlEnumerable, Operator
8888

8989
/// ===== External functions =====
9090

91-
/**
92-
* @notice ERC-165 interface support
93-
* @param interfaceId The interface identifier, which is a 4-byte selector.
94-
*/
95-
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
96-
return super.supportsInterface(interfaceId);
97-
}
98-
9991
/**
10092
* @notice Internal function to set the operator allowlist the calling contract will interface with
10193
* @param _operatorAllowlist the address of the Allowlist registry

contracts/token/erc1155/abstract/ImmutableERC1155Base.sol

Lines changed: 5 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,16 @@ import {ERC1155, ERC1155Permit} from "../../../token/erc1155/abstract/ERC1155Per
88
import {ERC2981} from "@openzeppelin/contracts/token/common/ERC2981.sol";
99
import {OperatorAllowlistEnforced} from "../../../allowlist/OperatorAllowlistEnforced.sol";
1010

11-
abstract contract ImmutableERC1155Base is OperatorAllowlistEnforced, ERC1155Permit, ERC2981 {
11+
import {AccessControlEnumerable, MintingAccessControl} from "../../../access/MintingAccessControl.sol";
12+
13+
14+
abstract contract ImmutableERC1155Base is OperatorAllowlistEnforced, ERC1155Permit, ERC2981, MintingAccessControl {
1215
/// @dev Contract level metadata
1316
string public contractURI;
1417

1518
/// @dev Common URIs for individual token URIs
1619
string private _baseURI;
1720

18-
/// @dev Only MINTER_ROLE can invoke permissioned mint.
19-
bytes32 public constant MINTER_ROLE = bytes32("MINTER_ROLE");
20-
2121
/// @dev mapping of each token id supply
2222
mapping(uint256 tokenId => uint256 totalSupply) private _totalSupply;
2323

@@ -92,22 +92,6 @@ abstract contract ImmutableERC1155Base is OperatorAllowlistEnforced, ERC1155Perm
9292
}
9393
}
9494

95-
/**
96-
* @notice Grants minter role to the user
97-
* @param user The address to grant the MINTER_ROLE to
98-
*/
99-
function grantMinterRole(address user) public onlyRole(DEFAULT_ADMIN_ROLE) {
100-
grantRole(MINTER_ROLE, user);
101-
}
102-
103-
/**
104-
* @notice Allows admin to revoke `MINTER_ROLE` role from `user`
105-
* @param user The address to revoke the MINTER_ROLE from
106-
*/
107-
function revokeMinterRole(address user) public onlyRole(DEFAULT_ADMIN_ROLE) {
108-
revokeRole(MINTER_ROLE, user);
109-
}
110-
11195
/**
11296
* @notice Override of setApprovalForAll from {ERC721}, with added Allowlist approval validation
11397
* @param operator The address to approve as an operator for the caller.
@@ -154,7 +138,7 @@ abstract contract ImmutableERC1155Base is OperatorAllowlistEnforced, ERC1155Perm
154138
*/
155139
function supportsInterface(
156140
bytes4 interfaceId
157-
) public view virtual override(ERC1155Permit, ERC2981, OperatorAllowlistEnforced) returns (bool) {
141+
) public view virtual override(ERC1155Permit, ERC2981, AccessControlEnumerable) returns (bool) {
158142
return super.supportsInterface(interfaceId);
159143
}
160144

@@ -190,19 +174,6 @@ abstract contract ImmutableERC1155Base is OperatorAllowlistEnforced, ERC1155Perm
190174
return _baseURI;
191175
}
192176

193-
/**
194-
* @notice Returns the addresses which have DEFAULT_ADMIN_ROLE
195-
* @return admins The addresses which have DEFAULT_ADMIN_ROLE
196-
*/
197-
function getAdmins() public view returns (address[] memory) {
198-
uint256 adminCount = getRoleMemberCount(DEFAULT_ADMIN_ROLE);
199-
address[] memory admins = new address[](adminCount);
200-
for (uint256 i; i < adminCount; i++) {
201-
admins[i] = getRoleMember(DEFAULT_ADMIN_ROLE, i);
202-
}
203-
return admins;
204-
}
205-
206177
/**
207178
* @notice See Openzepplin ERC1155._beforeTokenTransfer.
208179
* @param operator The address performing the transfer.

contracts/token/erc721/abstract/ImmutableERC721Base.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ abstract contract ImmutableERC721Base is OperatorAllowlistEnforced, MintingAcces
201201
public
202202
view
203203
virtual
204-
override(ERC721Permit, ERC2981, OperatorAllowlistEnforced, AccessControlEnumerable)
204+
override(ERC721Permit, ERC2981, AccessControlEnumerable)
205205
returns (bool)
206206
{
207207
return super.supportsInterface(interfaceId);

contracts/token/erc721/abstract/ImmutableERC721HybridBase.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ abstract contract ImmutableERC721HybridBase is
5757
public
5858
view
5959
virtual
60-
override(ERC721HybridPermit, ERC2981, OperatorAllowlistEnforced, AccessControlEnumerable)
60+
override(ERC721HybridPermit, ERC2981, AccessControlEnumerable)
6161
returns (bool)
6262
{
6363
return super.supportsInterface(interfaceId);

0 commit comments

Comments
 (0)