mirror of
https://github.com/zoo-apps/fund.git
synced 2026-10-30 14:57:02 +00:00
- 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
206 lines
5.8 KiB
Solidity
206 lines
5.8 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;
|
|
|
|
import "./IHatsIdUtilities.sol";
|
|
import "./HatsErrors.sol";
|
|
import "./HatsEvents.sol";
|
|
|
|
interface IHats is IHatsIdUtilities, HatsErrors, HatsEvents {
|
|
function mintTopHat(
|
|
address _target,
|
|
string memory _details,
|
|
string memory _imageURI
|
|
) external returns (uint256 topHatId);
|
|
|
|
function createHat(
|
|
uint256 _admin,
|
|
string calldata _details,
|
|
uint32 _maxSupply,
|
|
address _eligibility,
|
|
address _toggle,
|
|
bool _mutable,
|
|
string calldata _imageURI
|
|
) external returns (uint256 newHatId);
|
|
|
|
function batchCreateHats(
|
|
uint256[] calldata _admins,
|
|
string[] calldata _details,
|
|
uint32[] calldata _maxSupplies,
|
|
address[] memory _eligibilityModules,
|
|
address[] memory _toggleModules,
|
|
bool[] calldata _mutables,
|
|
string[] calldata _imageURIs
|
|
) external returns (bool success);
|
|
|
|
function getNextId(uint256 _admin) external view returns (uint256 nextId);
|
|
|
|
function mintHat(
|
|
uint256 _hatId,
|
|
address _wearer
|
|
) external returns (bool success);
|
|
|
|
function batchMintHats(
|
|
uint256[] calldata _hatIds,
|
|
address[] calldata _wearers
|
|
) external returns (bool success);
|
|
|
|
function setHatStatus(
|
|
uint256 _hatId,
|
|
bool _newStatus
|
|
) external returns (bool toggled);
|
|
|
|
function checkHatStatus(uint256 _hatId) external returns (bool toggled);
|
|
|
|
function setHatWearerStatus(
|
|
uint256 _hatId,
|
|
address _wearer,
|
|
bool _eligible,
|
|
bool _standing
|
|
) external returns (bool updated);
|
|
|
|
function checkHatWearerStatus(
|
|
uint256 _hatId,
|
|
address _wearer
|
|
) external returns (bool updated);
|
|
|
|
function renounceHat(uint256 _hatId) external;
|
|
|
|
function transferHat(uint256 _hatId, address _from, address _to) external;
|
|
|
|
/*//////////////////////////////////////////////////////////////
|
|
HATS ADMIN FUNCTIONS
|
|
//////////////////////////////////////////////////////////////*/
|
|
|
|
function makeHatImmutable(uint256 _hatId) external;
|
|
|
|
function changeHatDetails(
|
|
uint256 _hatId,
|
|
string memory _newDetails
|
|
) external;
|
|
|
|
function changeHatEligibility(
|
|
uint256 _hatId,
|
|
address _newEligibility
|
|
) external;
|
|
|
|
function changeHatToggle(uint256 _hatId, address _newToggle) external;
|
|
|
|
function changeHatImageURI(
|
|
uint256 _hatId,
|
|
string memory _newImageURI
|
|
) external;
|
|
|
|
function changeHatMaxSupply(uint256 _hatId, uint32 _newMaxSupply) external;
|
|
|
|
function requestLinkTopHatToTree(
|
|
uint32 _topHatId,
|
|
uint256 _newAdminHat
|
|
) external;
|
|
|
|
function approveLinkTopHatToTree(
|
|
uint32 _topHatId,
|
|
uint256 _newAdminHat,
|
|
address _eligibility,
|
|
address _toggle,
|
|
string calldata _details,
|
|
string calldata _imageURI
|
|
) external;
|
|
|
|
function unlinkTopHatFromTree(uint32 _topHatId, address _wearer) external;
|
|
|
|
function relinkTopHatWithinTree(
|
|
uint32 _topHatDomain,
|
|
uint256 _newAdminHat,
|
|
address _eligibility,
|
|
address _toggle,
|
|
string calldata _details,
|
|
string calldata _imageURI
|
|
) external;
|
|
|
|
/*//////////////////////////////////////////////////////////////
|
|
VIEW FUNCTIONS
|
|
//////////////////////////////////////////////////////////////*/
|
|
|
|
function viewHat(
|
|
uint256 _hatId
|
|
)
|
|
external
|
|
view
|
|
returns (
|
|
string memory details,
|
|
uint32 maxSupply,
|
|
uint32 supply,
|
|
address eligibility,
|
|
address toggle,
|
|
string memory imageURI,
|
|
uint16 lastHatId,
|
|
bool mutable_,
|
|
bool active
|
|
);
|
|
|
|
function isWearerOfHat(
|
|
address _user,
|
|
uint256 _hatId
|
|
) external view returns (bool isWearer);
|
|
|
|
function isAdminOfHat(
|
|
address _user,
|
|
uint256 _hatId
|
|
) external view returns (bool isAdmin);
|
|
|
|
function isInGoodStanding(
|
|
address _wearer,
|
|
uint256 _hatId
|
|
) external view returns (bool standing);
|
|
|
|
function isEligible(
|
|
address _wearer,
|
|
uint256 _hatId
|
|
) external view returns (bool eligible);
|
|
|
|
function getHatEligibilityModule(
|
|
uint256 _hatId
|
|
) external view returns (address eligibility);
|
|
|
|
function getHatToggleModule(
|
|
uint256 _hatId
|
|
) external view returns (address toggle);
|
|
|
|
function getHatMaxSupply(
|
|
uint256 _hatId
|
|
) external view returns (uint32 maxSupply);
|
|
|
|
function hatSupply(uint256 _hatId) external view returns (uint32 supply);
|
|
|
|
function getImageURIForHat(
|
|
uint256 _hatId
|
|
) external view returns (string memory _uri);
|
|
|
|
function balanceOf(
|
|
address wearer,
|
|
uint256 hatId
|
|
) external view returns (uint256 balance);
|
|
|
|
function balanceOfBatch(
|
|
address[] calldata _wearers,
|
|
uint256[] calldata _hatIds
|
|
) external view returns (uint256[] memory);
|
|
|
|
function uri(uint256 id) external view returns (string memory _uri);
|
|
}
|