Authority
Background
OpenZeppelin is an industry standard offering low-level building blocks to help developers quickly scaffold out common smart contracts and functionality.
However, for many new developers using even the most basic OZ contracts can be confusing and setting up common functionality becomes frustrating.
While not every contract needs authority; many do. In this situations, I find it easier to start with Authority over AccessControl since it gives me a collection of common roles that I use, sets up the the constructor correctly, and with how cheap most blockchains are at this point the extra weight should be negligible in most cases.
Using Authority
API
Solidity API
Authority
A contract that defines various roles for access control
This contract inherits from the OpenZeppelin AccessControl contract
BLACKLIST_ROLE
Role for contracts that need to blacklist users
CONTRACT_ROLE
Role for contracts to call other contracts
CREATOR_ROLE
Role for creators of new assets in NFT-based contracts
MANAGER_ROLE
Role for key manual management of smart contracts
MINTER_ROLE
Role for token-based contracts that have a growing supply
SERVER_ROLE
Role for contracts that have server’s managing functions
WHITELIST_ROLE
Role for contracts that need to whitelist users
constructor
Constructor that grants all defined roles to the deployer