IAccessControlEnumerable.sol 1.1 KB

123456789101112131415161718192021222324252627282930
  1. // SPDX-License-Identifier: MIT
  2. pragma solidity ^0.8.0;
  3. import "./IAccessControl.sol";
  4. /**
  5. * @dev External interface of AccessControlEnumerable declared to support ERC165 detection.
  6. */
  7. interface IAccessControlEnumerable is IAccessControl {
  8. /**
  9. * @dev Returns one of the accounts that have `role`. `index` must be a
  10. * value between 0 and {getRoleMemberCount}, non-inclusive.
  11. *
  12. * Role bearers are not sorted in any particular way, and their ordering may
  13. * change at any point.
  14. *
  15. * WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure
  16. * you perform all queries on the same block. See the following
  17. * https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post]
  18. * for more information.
  19. */
  20. function getRoleMember(bytes32 role, uint256 index) external view returns (address);
  21. /**
  22. * @dev Returns the number of accounts that have `role`. Can be used
  23. * together with {getRoleMember} to enumerate all bearers of a role.
  24. */
  25. function getRoleMemberCount(bytes32 role) external view returns (uint256);
  26. }