Skip to content

DelegatedAccessControlEnumerable

DelegatedAccessControlEnumerable

Extension of {DelegatedAccessControl} that allows enumerating the members of each role.

__DelegatedAccessControlEnumerable_init

function __DelegatedAccessControlEnumerable_init() internal

__DelegatedAccessControlEnumerable_init_unchained

function __DelegatedAccessControlEnumerable_init_unchained() internal

_roleMembers

mapping(address => mapping(bytes32 => struct EnumerableSetUpgradeable.AddressSet)) _roleMembers

delegate to role members mapping

_accountDelegates

mapping(address => struct EnumerableSetUpgradeable.AddressSet) _accountDelegates

maps account to set of delegates

_accountDelegateRoles

mapping(address => mapping(address => struct EnumerableSetUpgradeable.Bytes32Set)) _accountDelegateRoles

maps account to delegate to set of roles

supportsInterface

function supportsInterface(bytes4 interfaceId) public view virtual returns (bool)

See {IERC165-supportsInterface}.

getRoleMember

function getRoleMember(address delegate, string role, uint256 index) external view returns (address)

_Returns one of the accounts that have `role`. `index` must be a value between 0 and {getRoleMemberCount}, non-inclusive.

Role bearers are not sorted in any particular way, and their ordering may change at any point.

WARNING: When using {getRoleMember}, {getRoleMemberCount}, {getDelegates} and {getDelegateRoles} make sure you perform all queries on the same block. See the following https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post] for more information._

getRoleMemberCount

function getRoleMemberCount(address delegate, string role) public view returns (uint256)

Returns the number of accounts that have `role`. Can be used together with {getRoleMember} to enumerate all bearers of a role.

getDelegates

function getDelegates(address account, uint256 offset, uint256 limit) external view returns (address[] delegates, uint256 total)

Returns list of delegates where account has any role

getDelegateRoles

function getDelegateRoles(address delegate, address account, uint256 offset, uint256 limit) external view returns (string[] roles, uint256 total)

_grantRole

function _grantRole(address delegate, string role, address account) internal virtual

Overload {_grantRole} to track enumerable memberships

_revokeRole

function _revokeRole(address delegate, string role, address account) internal virtual

Overload {_revokeRole} to track enumerable memberships

__gap

uint256[47] __gap

This empty reserved space is put in place to allow future versions to add new variables without shifting down storage in the inheritance chain. See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps