Hats Protocol-enabled auth and ownable contract mix-ins
A fork of solmate's Owned.sol
that grants ownership of an inheriting contract to the wearer of a given hat.
HatsOwned.sol
preserves the name of the onlyOwner
modifier, so switching from Owned.sol
only requires inhereting the new contract and adjusting the constructor to set uint256 ownerHat
rather than address owner
. No other code changes required.
A fork of OpenZeppelin's AccessControl.sol
that grants access to various roles within an inheriting contract to the wearer of given hats.
-
Assigns roles to
uint256 hat
rather thanaddress member
. -
Since a single hat can have multiple wearers (up to
hat.maxSupply
, only a single hat can be granted a given role. -
No support for
renounceRole
. To renounce a role, the wearer of a given hat should renounce the hat itself.
TODO
- contracts
- tests