Blog

Understanding DEFAULT_ADMIN_ROLE in OpenZeppelin's AccessControl Contract: The Pitfalls of Unset Role Admins

Did you know why the DEFAULT_ADMIN_ROLE is actually the default admin in @OpenZeppelin 's AccessControl contract?

See the onlyRole modifier:

.. which is only allowing the corresponding roleAdmin to grant a role .. but the roleAdmin is by default actually …

unset, which means it is 0x00.... and therefore it matches with:

A funny bug is actually when devs forget to set an initial admin, you should look out for that when auditing contracts with this RBAC.