IAccessControlEnumerable.sol 1.2 KB

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