Files
zeekay c778d7405b feat: Extract zoo.fund from monorepo
- Full app extraction from zoo monorepo (source only)
- Configured for GitHub Pages deployment
- Static export enabled
- Custom domain: zoo.fund
- Excludes node_modules and build artifacts
2025-11-02 12:13:55 -08:00

87 lines
3.9 KiB
Solidity

// SPDX-License-Identifier: AGPL-3.0
// Copyright (C) 2023 Haberdasher Labs
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
pragma solidity >=0.8.13;
interface HatsErrors {
/// @notice Emitted when `user` is attempting to perform an action on `hatId` but is not wearing one of `hatId`'s admin hats
/// @dev Can be equivalent to `NotHatWearer(buildHatId(hatId))`, such as when emitted by `approveLinkTopHatToTree` or `relinkTopHatToTree`
error NotAdmin(address user, uint256 hatId);
/// @notice Emitted when attempting to perform an action as or for an account that is not a wearer of a given hat
error NotHatWearer();
/// @notice Emitted when attempting to perform an action that requires being either an admin or wearer of a given hat
error NotAdminOrWearer();
/// @notice Emitted when attempting to mint `hatId` but `hatId`'s maxSupply has been reached
error AllHatsWorn(uint256 hatId);
/// @notice Emitted when attempting to create a hat with a level 14 hat as its admin
error MaxLevelsReached();
/// @notice Emitted when an attempted hat id has empty intermediate level(s)
error InvalidHatId();
/// @notice Emitted when attempting to mint `hatId` to a `wearer` who is already wearing the hat
error AlreadyWearingHat(address wearer, uint256 hatId);
/// @notice Emitted when attempting to mint a non-existant hat
error HatDoesNotExist(uint256 hatId);
/// @notice Emmitted when attempting to mint or transfer a hat that is not active
error HatNotActive();
/// @notice Emitted when attempting to mint or transfer a hat to an ineligible wearer
error NotEligible();
/// @notice Emitted when attempting to check or set a hat's status from an account that is not that hat's toggle module
error NotHatsToggle();
/// @notice 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();
/// @notice Emitted when array arguments to a batch function have mismatching lengths
error BatchArrayLengthMismatch();
/// @notice Emitted when attempting to mutate or transfer an immutable hat
error Immutable();
/// @notice Emitted when attempting to change a hat's maxSupply to a value lower than its current supply
error NewMaxSupplyTooLow();
/// @notice Emitted when attempting to link a tophat to a new admin for which the tophat serves as an admin
error CircularLinkage();
/// @notice Emitted when attempting to link or relink a tophat to a separate tree
error CrossTreeLinkage();
/// @notice Emitted when attempting to link a tophat without a request
error LinkageNotRequested();
/// @notice Emitted when attempting to unlink a tophat that does not have a wearer
/// @dev This ensures that unlinking never results in a bricked tophat
error InvalidUnlink();
/// @notice Emmited when attempting to change a hat's eligibility or toggle module to the zero address
error ZeroAddress();
/// @notice Emmitted when attempting to change a hat's details or imageURI to a string with over 7000 bytes (~characters)
/// @dev 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();
}