Is there a OZ helper contract or recommendation for when I want my smart contract to both support DefaultAdminRules and Enumerable? Currently because both contracts are built off of the base AccessControlUpgradeable, both define functions such as grantRole, revokeRole, and supportsInterface.
I would need to write some glue code that properly routes functions in order to have something like this:
contract MyContract is AccessControlDefaultAdminRulesUpgradeable, AccessControlEnumerableUpgradeable, UUPSUpgradeable
Is there any helper library that gives me access to functions like getRoleMember / getRoleMemberCount without writing code that routes duplicate functions?
Currently the only option I see is to do something like this:
function _grantRole(bytes32 role, address account)
internal
override(AccessControlDefaultAdminRulesUpgradeable, AccessControlEnumerableUpgradeable)
returns (bool)
{
return super._grantRole(role, account);
}
// --- glue: DefaultAdminRules and the base both define these four ---
function grantRole(bytes32 role, address account)
public
override(AccessControlUpgradeable, AccessControlDefaultAdminRulesUpgradeable, IAccessControl)
{
super.grantRole(role, account);
}
```
across my contracts.