solidstate-network / solidstate-solidity

💠 Upgradeable-first Solidity smart contract development library 💠
https://discord.gg/BnvwfM6bRe
MIT License
437 stars 89 forks source link

Add enumerable functions to AccessControl #216

Closed tess3rac7 closed 1 year ago

tess3rac7 commented 1 year ago

We add two new function, getRoleMember(role, index) and getRoleMemberCount(role) to AccessControl. The function and parameter names are borrowed from OpenZeppelin to make them familiar. These are quite lightweight, and AccessControlStorage already uses EnumerableSet, so it made sense to just add them to AccessControl instead of creating a new AccessControlEnumerable contract. We also add tests for positive and revert cases.

tess3rac7 commented 1 year ago

Updated :slightly_smiling_face: