/hats-auth

Hats Protocol-enabled auth and ownable contract mix-ins

Primary LanguageSolidityCreative Commons Zero v1.0 UniversalCC0-1.0

hats-auth

Hats Protocol-enabled auth and ownable contract mix-ins

HatsOwned

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.

HatsAccessControl

A fork of OpenZeppelin's AccessControl.sol that grants access to various roles within an inheriting contract to the wearer of given hats.

Differences compared to AccessControl.sol

  1. Assigns roles to uint256 hat rather than address member.

  2. Since a single hat can have multiple wearers (up to hat.maxSupply, only a single hat can be granted a given role.

  3. No support for renounceRole. To renounce a role, the wearer of a given hat should renounce the hat itself.

TODO

  • contracts
  • tests