HatsErrors

Git Source

Errors

NotAdmin

Emitted when user is attempting to perform an action on hatId but is not wearing one of hatId's admin hats

Can be equivalent to NotHatWearer(buildHatId(hatId)), such as when emitted by approveLinkTopHatToTree or relinkTopHatToTree

error NotAdmin(address user, uint256 hatId);

NotHatWearer

Emitted when attempting to perform an action as or for an account that is not a wearer of a given hat

error NotHatWearer();

NotAdminOrWearer

Emitted when attempting to perform an action that requires being either an admin or wearer of a given hat

error NotAdminOrWearer();

AllHatsWorn

Emitted when attempting to mint hatId but hatId's maxSupply has been reached

error AllHatsWorn(uint256 hatId);

MaxLevelsReached

Emitted when attempting to create a hat with a level 14 hat as its admin

error MaxLevelsReached();

InvalidHatId

Emitted when an attempted hat id has empty intermediate level(s)

error InvalidHatId();

AlreadyWearingHat

Emitted when attempting to mint hatId to a wearer who is already wearing the hat

error AlreadyWearingHat(address wearer, uint256 hatId);

HatDoesNotExist

Emitted when attempting to mint a non-existant hat

error HatDoesNotExist(uint256 hatId);

HatNotActive

Emmitted when attempting to mint or transfer a hat that is not active

error HatNotActive();

NotEligible

Emitted when attempting to mint or transfer a hat to an ineligible wearer

error NotEligible();

NotHatsToggle

Emitted when attempting to check or set a hat's status from an account that is not that hat's toggle module

error NotHatsToggle();

NotHatsEligibility

Emitted when attempting to check or set a hat wearer's status from an account that is not that hat's eligibility module

error NotHatsEligibility();

BatchArrayLengthMismatch

Emitted when array arguments to a batch function have mismatching lengths

error BatchArrayLengthMismatch();

Immutable

Emitted when attempting to mutate or transfer an immutable hat

error Immutable();

NewMaxSupplyTooLow

Emitted when attempting to change a hat's maxSupply to a value lower than its current supply

error NewMaxSupplyTooLow();

CircularLinkage

Emitted when attempting to link a tophat to a new admin for which the tophat serves as an admin

error CircularLinkage();

CrossTreeLinkage

Emitted when attempting to link or relink a tophat to a separate tree

error CrossTreeLinkage();

LinkageNotRequested

Emitted when attempting to link a tophat without a request

error LinkageNotRequested();

Emitted when attempting to unlink a tophat that does not have a wearer

This ensures that unlinking never results in a bricked tophat

error InvalidUnlink();

ZeroAddress

Emmited when attempting to change a hat's eligibility or toggle module to the zero address

error ZeroAddress();

StringTooLong

Emmitted when attempting to change a hat's details or imageURI to a string with over 7000 bytes (~characters)

This protects against a DOS attack where an admin iteratively extend's a hat's details or imageURI to be so long that reading it exceeds the block gas limit, breaking uri() and viewHat()

error StringTooLong();