编译器
0.8.17+commit.8df45f5f
文件 1 的 41:Address.sol
pragma solidity ^0.8.1;
library Address {
function isContract(address account) internal view returns (bool) {
return account.code.length > 0;
}
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
(bool success, ) = recipient.call{value: amount}("");
require(success, "Address: unable to send value, recipient may have reverted");
}
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, "Address: low-level call failed");
}
function functionCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, errorMessage);
}
function functionCallWithValue(
address target,
bytes memory data,
uint256 value
) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
function functionCallWithValue(
address target,
bytes memory data,
uint256 value,
string memory errorMessage
) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
(bool success, bytes memory returndata) = target.call{value: value}(data);
return verifyCallResultFromTarget(target, success, returndata, errorMessage);
}
function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
return functionStaticCall(target, data, "Address: low-level static call failed");
}
function functionStaticCall(
address target,
bytes memory data,
string memory errorMessage
) internal view returns (bytes memory) {
(bool success, bytes memory returndata) = target.staticcall(data);
return verifyCallResultFromTarget(target, success, returndata, errorMessage);
}
function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
return functionDelegateCall(target, data, "Address: low-level delegate call failed");
}
function functionDelegateCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
(bool success, bytes memory returndata) = target.delegatecall(data);
return verifyCallResultFromTarget(target, success, returndata, errorMessage);
}
function verifyCallResultFromTarget(
address target,
bool success,
bytes memory returndata,
string memory errorMessage
) internal view returns (bytes memory) {
if (success) {
if (returndata.length == 0) {
require(isContract(target), "Address: call to non-contract");
}
return returndata;
} else {
_revert(returndata, errorMessage);
}
}
function verifyCallResult(
bool success,
bytes memory returndata,
string memory errorMessage
) internal pure returns (bytes memory) {
if (success) {
return returndata;
} else {
_revert(returndata, errorMessage);
}
}
function _revert(bytes memory returndata, string memory errorMessage) private pure {
if (returndata.length > 0) {
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
文件 2 的 41:Allowable.sol
pragma solidity ^0.8.17;
import "operator-filter-registry/src/DefaultOperatorFilterer.sol";
import "./EIP712Allowlisting.sol";
import "./Phaseable.sol";
import "./FlexibleMetadata.sol";
import "./Nameable.sol";
import "./LockableTransferrable.sol";
import { Phase, PhaseNotActiveYet, PhaseExhausted, WalletMintsFilled } from "./SetPhaseable.sol";
abstract contract Allowable is EIP712Allowlisting, DefaultOperatorFilterer {
address constant defaultPayable = 0x5aE09f46967A92f3cF976e98f82B6FDd00784815;
address payable internal TREASURY = payable(defaultPayable);
uint256 PRIVATE = 0;
uint256 ALLOWED = 1;
uint256 OPEN = 2;
constructor(string memory name, string memory symbol) FlexibleMetadata(name,symbol) {
setSigningAddress(msg.sender);
setDomainSeparator(name, symbol);
initializePhases();
}
function initializePhases() internal virtual;
function canMint(uint256 phase, uint256 quantity) internal override virtual returns(bool) {
uint256 activePhase = activePhase();
if (phase > activePhase) {
revert PhaseNotActiveYet();
}
uint256 requestedSupply = minted()+quantity;
Phase memory requestedPhase = findPhase(phase);
if (requestedSupply > requestedPhase.highestSupply) {
revert PhaseExhausted();
}
uint16[4] memory aux = retrieveMintQuantities(msg.sender);
uint256 requestedMints = quantity + aux[phase];
if (requestedMints > requestedPhase.maxPerWallet) {
revert WalletMintsFilled(requestedMints);
}
return true;
}
function setApprovalForAll(address operator, bool approved) public override onlyAllowedOperatorApproval(operator) {
LockableTransferrable.setApprovalForAll(operator, approved);
}
function approve(address operator, uint256 tokenId) public override onlyAllowedOperatorApproval(operator) {
LockableTransferrable.approve(operator, tokenId);
}
function transferFrom(address from, address to, uint256 tokenId) public override onlyAllowedOperator(from) {
LockableTransferrable.transferFrom(from, to, tokenId);
}
function safeTransferFrom(address from, address to, uint256 tokenId) public override onlyAllowedOperator(from) {
LockableTransferrable.safeTransferFrom(from, to, tokenId);
}
function safeTransferFrom(address from, address to, uint256 tokenId, bytes memory data)
public
override
onlyAllowedOperator(from)
{
LockableTransferrable.safeTransferFrom(from, to, tokenId, data);
}
}
文件 3 的 41:Approvable.sol
pragma solidity ^0.8.17;
import "./Ownable.sol";
import "./Nameable.sol";
import { TokenNonOwner } from "./SetOwnerEnumerable.sol";
import { OwnerEnumerable } from "./OwnerEnumerable.sol";
import { SetApprovable, ApprovableData, TokenNonExistent } from "./SetApprovable.sol";
abstract contract Approvable is OwnerEnumerable {
using SetApprovable for ApprovableData;
ApprovableData approvable;
uint256 tokenCount;
function _checkTokenOwner(uint256 tokenId) internal view virtual {
if (ownerOf(tokenId) != msg.sender) {
revert TokenNonOwner(msg.sender, tokenId);
}
}
function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) {
return approvable.isApprovedForAll(owner,operator);
}
function approve(address to, uint256 tokenId) public virtual override {
_checkTokenOwner(tokenId);
approvable.approveForToken(to, tokenId);
emit Approval(ownerOf(tokenId), to, tokenId);
}
function setApprovalForAll(address operator, bool approved) public virtual override {
approved ? approvable.approveForContract(operator): approvable.revokeApprovalForContract(operator, msg.sender);
}
function validateApprovedOrOwner(address spender, uint256 tokenId) internal view {
if (!(spender == ownerOf(tokenId) || isApprovedForAll(ownerOf(tokenId), spender) || approvable.getApproved(tokenId) == spender)) {
revert TokenNonOwner(spender, tokenId);
}
}
function getApproved(uint256 tokenId) public view virtual override returns (address) {
requireMinted(tokenId);
return approvable.tokens[tokenId].approval;
}
function revokeTokenApproval(uint256 tokenId) internal {
approvable.revokeTokenApproval(tokenId);
}
function revokeApprovals(address holder) internal {
approvable.revokeApprovals(holder,tokensOwnedBy(holder));
}
function requireMinted(uint256 tokenId) internal view virtual {
if (tokenId <= tokenCount) {
revert TokenNonExistent(tokenId);
}
}
}
文件 4 的 41:Assignable.sol
pragma solidity ^0.8.17;
import { SetAssignable, AssignableData, NotTokenOwner, NotAssigned } from "./SetAssignable.sol";
import { OwnerEnumerable } from "./OwnerEnumerable.sol";
import "./Phaseable.sol";
abstract contract Assignable is Phaseable {
using SetAssignable for AssignableData;
AssignableData assignables;
function assignColdStorage(uint256 tokenId) public {
if (msg.sender != ownerOf(tokenId)) {
revert NotTokenOwner();
}
assignables.addAssignment(msg.sender,tokenId);
}
function revokeColdStorage(uint256 tokenId) public {
if (assignables.findAssignment(msg.sender) != tokenId) {
revert NotAssigned(msg.sender);
}
assignables.removeAssignment(msg.sender);
}
function revokeAssignments(uint256 tokenId) public {
if (msg.sender != ownerOf(tokenId)) {
revert NotTokenOwner();
}
assignables.revokeAll(tokenId);
}
function findAssignments(uint256 tokenId) public view returns (address[] memory){
return assignables.findAssignees(tokenId);
}
function balanceOf(address seekingContract, address owner) external view returns (uint256) {
uint256 guardianBalance = balanceOf(owner);
if (guardianBalance > 0) {
uint256[] memory guardians = tokensOwnedBy(owner);
return assignables.iterateGuardiansBalance(guardians, seekingContract, 0);
}
return 0;
}
}
文件 5 的 41:Base64.sol
pragma solidity ^0.8.0;
library Base64 {
string internal constant _TABLE = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
function encode(bytes memory data) internal pure returns (string memory) {
if (data.length == 0) return "";
string memory table = _TABLE;
string memory result = new string(4 * ((data.length + 2) / 3));
assembly {
let tablePtr := add(table, 1)
let resultPtr := add(result, 32)
for {
let dataPtr := data
let endPtr := add(data, mload(data))
} lt(dataPtr, endPtr) {
} {
dataPtr := add(dataPtr, 3)
let input := mload(dataPtr)
mstore8(resultPtr, mload(add(tablePtr, and(shr(18, input), 0x3F))))
resultPtr := add(resultPtr, 1)
mstore8(resultPtr, mload(add(tablePtr, and(shr(12, input), 0x3F))))
resultPtr := add(resultPtr, 1)
mstore8(resultPtr, mload(add(tablePtr, and(shr(6, input), 0x3F))))
resultPtr := add(resultPtr, 1)
mstore8(resultPtr, mload(add(tablePtr, and(input, 0x3F))))
resultPtr := add(resultPtr, 1)
}
switch mod(mload(data), 3)
case 1 {
mstore8(sub(resultPtr, 1), 0x3d)
mstore8(sub(resultPtr, 2), 0x3d)
}
case 2 {
mstore8(sub(resultPtr, 1), 0x3d)
}
}
return result;
}
}
文件 6 的 41:Constants.sol
pragma solidity ^0.8.13;
address constant CANONICAL_OPERATOR_FILTER_REGISTRY_ADDRESS = 0x000000000000AAeB6D7670E522A718067333cd4E;
address constant CANONICAL_CORI_SUBSCRIPTION = 0x3cc6CddA760b79bAfa08dF41ECFA224f810dCeB6;
文件 7 的 41:Context.sol
pragma solidity ^0.8.0;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
}
文件 8 的 41:DefaultOperatorFilterer.sol
pragma solidity ^0.8.13;
import {OperatorFilterer} from "./OperatorFilterer.sol";
import {CANONICAL_CORI_SUBSCRIPTION} from "./lib/Constants.sol";
abstract contract DefaultOperatorFilterer is OperatorFilterer {
constructor() OperatorFilterer(CANONICAL_CORI_SUBSCRIPTION, true) {}
}
文件 9 的 41:ECDSA.sol
pragma solidity ^0.8.0;
import "../Strings.sol";
library ECDSA {
enum RecoverError {
NoError,
InvalidSignature,
InvalidSignatureLength,
InvalidSignatureS,
InvalidSignatureV
}
function _throwError(RecoverError error) private pure {
if (error == RecoverError.NoError) {
return;
} else if (error == RecoverError.InvalidSignature) {
revert("ECDSA: invalid signature");
} else if (error == RecoverError.InvalidSignatureLength) {
revert("ECDSA: invalid signature length");
} else if (error == RecoverError.InvalidSignatureS) {
revert("ECDSA: invalid signature 's' value");
}
}
function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError) {
if (signature.length == 65) {
bytes32 r;
bytes32 s;
uint8 v;
assembly {
r := mload(add(signature, 0x20))
s := mload(add(signature, 0x40))
v := byte(0, mload(add(signature, 0x60)))
}
return tryRecover(hash, v, r, s);
} else {
return (address(0), RecoverError.InvalidSignatureLength);
}
}
function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {
(address recovered, RecoverError error) = tryRecover(hash, signature);
_throwError(error);
return recovered;
}
function tryRecover(
bytes32 hash,
bytes32 r,
bytes32 vs
) internal pure returns (address, RecoverError) {
bytes32 s = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff);
uint8 v = uint8((uint256(vs) >> 255) + 27);
return tryRecover(hash, v, r, s);
}
function recover(
bytes32 hash,
bytes32 r,
bytes32 vs
) internal pure returns (address) {
(address recovered, RecoverError error) = tryRecover(hash, r, vs);
_throwError(error);
return recovered;
}
function tryRecover(
bytes32 hash,
uint8 v,
bytes32 r,
bytes32 s
) internal pure returns (address, RecoverError) {
if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) {
return (address(0), RecoverError.InvalidSignatureS);
}
address signer = ecrecover(hash, v, r, s);
if (signer == address(0)) {
return (address(0), RecoverError.InvalidSignature);
}
return (signer, RecoverError.NoError);
}
function recover(
bytes32 hash,
uint8 v,
bytes32 r,
bytes32 s
) internal pure returns (address) {
(address recovered, RecoverError error) = tryRecover(hash, v, r, s);
_throwError(error);
return recovered;
}
function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32) {
return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n32", hash));
}
function toEthSignedMessageHash(bytes memory s) internal pure returns (bytes32) {
return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n", Strings.toString(s.length), s));
}
function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32) {
return keccak256(abi.encodePacked("\x19\x01", domainSeparator, structHash));
}
}
文件 10 的 41:EIP712Allowlisting.sol
pragma solidity ^0.8.17;
import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
import "./EIP712Listable.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
bytes32 constant ALLOW_MINT_TYPE =
keccak256("Minter(address wallet)");
bytes32 constant BAG_MINT_TYPE =
keccak256("Minter(string genesisBagAddress)");
bytes32 constant FREE_MINT_TYPE =
keccak256("Minter(string genesisStakedAddress)");
abstract contract EIP712Allowlisting is EIP712Listable {
using ECDSA for bytes32;
using Strings for uint256;
using Strings for uint160;
using Strings for address;
struct recovered {
address receipient;
bytes signature;
address recovered;
address signingKey;
}
uint256[] empty;
function recoverAllowAddress(bytes calldata sig, address recip) public view returns (recovered memory) {
bytes32 digest = _hashTypedDataV4(keccak256(abi.encode(ALLOW_MINT_TYPE, recip)));
address recoveredAddress = digest.recover(sig);
return recovered(recip, sig, recoveredAddress, sigKey);
}
modifier requiresAllowSig(bytes calldata sig, address recip) {
require(sigKey != address(0), "allowlist not enabled");
bytes32 digest = keccak256(
abi.encodePacked(
"\x19\x01",
DOM_SEP,
keccak256(abi.encode(ALLOW_MINT_TYPE, recip))
)
);
address recovery = digest.recover(sig);
require(recovery == sigKey, "invalid signature");
require(msg.sender == recip, "invalid signature");
_;
}
struct recoveredBag {
address receipient;
bytes signature;
address recovered;
address signingKey;
string bagging;
uint256 total;
}
function recoverClaimSig(bytes calldata sig, address recip, uint256[] memory bag) public view returns (recoveredBag memory) {
return recoverClaimSig(sig, recip, bag, empty);
}
function recoverClaimSig(bytes calldata sig, address recip, uint256[] memory bag, uint256[] memory staked) public view returns (recoveredBag memory) {
require(sigKey != address(0), "allowlist not enabled");
uint total = uint(uint160(recip));
for (uint i; i < bag.length; i++) {
total += bag[i];
}
for (uint i; i < staked.length; i++) {
total += staked[i];
}
string memory bagged = total.toString();
bytes32 digest = keccak256(
abi.encodePacked(
"\x19\x01",
DOM_SEP,
keccak256(abi.encode(FREE_MINT_TYPE,keccak256(abi.encodePacked(bagged))))
)
);
address recovery = digest.recover(sig);
return recoveredBag(recip, sig, recovery, sigKey, bagged, total);
}
modifier requiresBagSig(bytes calldata sig, address recip, uint256[] memory bag) {
require(sigKey != address(0), "allowlist not enabled");
uint total = uint(uint160(recip));
for (uint i; i < bag.length; i++) {
total += bag[i];
}
string memory bagged = total.toString();
bytes32 digest = keccak256(
abi.encodePacked(
"\x19\x01",
DOM_SEP,
keccak256(abi.encode(FREE_MINT_TYPE,keccak256(abi.encodePacked(bagged))))
)
);
address recovery = digest.recover(sig);
require(recovery == sigKey, "invalid signature");
require(msg.sender == recip, "invalid signature");
_;
}
modifier requiresClaimSig(bytes calldata sig, address recip, uint256[] memory bag, uint256[] memory staked) {
require(sigKey != address(0), "allowlist not enabled");
uint total = uint(uint160(recip));
for (uint i; i < bag.length; i++) {
total += bag[i];
}
for (uint i; i < staked.length; i++) {
total += staked[i];
}
string memory bagged = total.toString();
bytes32 digest = keccak256(
abi.encodePacked(
"\x19\x01",
DOM_SEP,
keccak256(abi.encode(FREE_MINT_TYPE,keccak256(abi.encodePacked(bagged))))
)
);
address recovery = digest.recover(sig);
require(recovery == sigKey, "invalid signature");
require(msg.sender == recip, "invalid signature");
_;
}
}
文件 11 的 41:EIP712Listable.sol
pragma solidity ^0.8.17;
import "./Assignable.sol";
import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
abstract contract EIP712Listable is Assignable {
using ECDSA for bytes32;
address internal sigKey = address(0);
bytes32 internal DOM_SEP;
uint256 chainid = 420;
function setDomainSeparator(string memory _name, string memory _version) internal {
DOM_SEP = keccak256(
abi.encode(
keccak256(
"EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)"
),
keccak256(bytes(_name)),
keccak256(bytes(_version)),
chainid,
address(this)
)
);
}
function _hashTypedDataV4(bytes32 structHash) internal view virtual returns (bytes32) {
return ECDSA.toTypedDataHash(DOM_SEP, structHash);
}
function getSigningAddress() public view returns (address) {
return sigKey;
}
function setSigningAddress(address _sigKey) public onlyOwner {
sigKey = _sigKey;
}
function isOwner() public view returns (bool) {
return msg.sender == owner();
}
}
文件 12 的 41:ERC165.sol
pragma solidity ^0.8.0;
import "./IERC165.sol";
abstract contract ERC165 is IERC165 {
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
return interfaceId == type(IERC165).interfaceId;
}
}
文件 13 的 41:FlexibleMetadata.sol
pragma solidity ^0.8.17;
import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol";
import "@openzeppelin/contracts/utils/introspection/ERC165.sol";
import "@openzeppelin/contracts/utils/introspection/IERC165.sol";
import "@openzeppelin/contracts/utils/Context.sol";
import "./Ownable.sol";
import "./Nameable.sol";
import { DEFAULT, FLAG, PRE, Supplement, SetFlexibleMetadata, FlexibleMetadataData } from "./SetFlexibleMetadata.sol";
abstract contract FlexibleMetadata is Ownable, Context, ERC165, IERC721, Nameable {
using SetFlexibleMetadata for FlexibleMetadataData;
FlexibleMetadataData flexible;
constructor(string memory _name, string memory _symbol) Nameable(_name,_symbol) {
}
function setContractUri(string memory uri) external onlyOwner {
flexible.setContractMetadataURI(uri);
}
function reveal(bool _reveal) external onlyOwner {
flexible.reveal(_reveal);
}
function setTokenUri(string memory uri, uint256 tokenType) public onlyOwner {
tokenType == FLAG ?
flexible.setFlaggedTokenMetadataURI(uri):
(tokenType == PRE) ?
flexible.setPrerevealTokenMetadataURI(uri):
flexible.setDefaultTokenMetadataURI(uri);
}
function setSupplementalTokenUri(string memory key, string memory uri) external onlyOwner {
flexible.setSupplementalTokenMetadataURI(key,uri);
}
function flagToken(uint256 tokenId, bool isFlagged) external onlyOwner {
flexible.flagToken(tokenId,isFlagged);
}
function setSupplemental(uint256 tokenId, bool isSupplemental, string memory key) internal {
if (isSupplemental) {
flexible.supplemental[tokenId] = Supplement(key,true);
} else {
delete flexible.supplemental[tokenId];
}
}
function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165,IERC165) returns (bool) {
return
interfaceId == type(IERC721).interfaceId ||
interfaceId == type(IERC721Metadata).interfaceId ||
super.supportsInterface(interfaceId);
}
function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
return flexible.getTokenMetadata(tokenId);
}
function contractURI() external view virtual returns (string memory) {
return flexible.getContractMetadata();
}
}
文件 14 的 41:IERC1155.sol
pragma solidity ^0.8.0;
import "../../utils/introspection/IERC165.sol";
interface IERC1155 is IERC165 {
event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value);
event TransferBatch(
address indexed operator,
address indexed from,
address indexed to,
uint256[] ids,
uint256[] values
);
event ApprovalForAll(address indexed account, address indexed operator, bool approved);
event URI(string value, uint256 indexed id);
function balanceOf(address account, uint256 id) external view returns (uint256);
function balanceOfBatch(address[] calldata accounts, uint256[] calldata ids)
external
view
returns (uint256[] memory);
function setApprovalForAll(address operator, bool approved) external;
function isApprovedForAll(address account, address operator) external view returns (bool);
function safeTransferFrom(
address from,
address to,
uint256 id,
uint256 amount,
bytes calldata data
) external;
function safeBatchTransferFrom(
address from,
address to,
uint256[] calldata ids,
uint256[] calldata amounts,
bytes calldata data
) external;
}
文件 15 的 41:IERC165.sol
pragma solidity ^0.8.0;
interface IERC165 {
function supportsInterface(bytes4 interfaceId) external view returns (bool);
}
文件 16 的 41:IERC721.sol
pragma solidity ^0.8.0;
import "../../utils/introspection/IERC165.sol";
interface IERC721 is IERC165 {
event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);
event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);
event ApprovalForAll(address indexed owner, address indexed operator, bool approved);
function balanceOf(address owner) external view returns (uint256 balance);
function ownerOf(uint256 tokenId) external view returns (address owner);
function safeTransferFrom(
address from,
address to,
uint256 tokenId,
bytes calldata data
) external;
function safeTransferFrom(
address from,
address to,
uint256 tokenId
) external;
function transferFrom(
address from,
address to,
uint256 tokenId
) external;
function approve(address to, uint256 tokenId) external;
function setApprovalForAll(address operator, bool _approved) external;
function getApproved(uint256 tokenId) external view returns (address operator);
function isApprovedForAll(address owner, address operator) external view returns (bool);
}
文件 17 的 41:IERC721Metadata.sol
pragma solidity ^0.8.0;
import "../IERC721.sol";
interface IERC721Metadata is IERC721 {
function name() external view returns (string memory);
function symbol() external view returns (string memory);
function tokenURI(uint256 tokenId) external view returns (string memory);
}
文件 18 的 41:IERC721Receiver.sol
pragma solidity ^0.8.0;
interface IERC721Receiver {
function onERC721Received(
address operator,
address from,
uint256 tokenId,
bytes calldata data
) external returns (bytes4);
}
文件 19 的 41:IOperatorFilterRegistry.sol
pragma solidity ^0.8.13;
interface IOperatorFilterRegistry {
function isOperatorAllowed(address registrant, address operator) external view returns (bool);
function register(address registrant) external;
function registerAndSubscribe(address registrant, address subscription) external;
function registerAndCopyEntries(address registrant, address registrantToCopy) external;
function unregister(address addr) external;
function updateOperator(address registrant, address operator, bool filtered) external;
function updateOperators(address registrant, address[] calldata operators, bool filtered) external;
function updateCodeHash(address registrant, bytes32 codehash, bool filtered) external;
function updateCodeHashes(address registrant, bytes32[] calldata codeHashes, bool filtered) external;
function subscribe(address registrant, address registrantToSubscribe) external;
function unsubscribe(address registrant, bool copyExistingEntries) external;
function subscriptionOf(address addr) external returns (address registrant);
function subscribers(address registrant) external returns (address[] memory);
function subscriberAt(address registrant, uint256 index) external returns (address);
function copyEntriesOf(address registrant, address registrantToCopy) external;
function isOperatorFiltered(address registrant, address operator) external returns (bool);
function isCodeHashOfFiltered(address registrant, address operatorWithCode) external returns (bool);
function isCodeHashFiltered(address registrant, bytes32 codeHash) external returns (bool);
function filteredOperators(address addr) external returns (address[] memory);
function filteredCodeHashes(address addr) external returns (bytes32[] memory);
function filteredOperatorAt(address registrant, uint256 index) external returns (address);
function filteredCodeHashAt(address registrant, uint256 index) external returns (bytes32);
function isRegistered(address addr) external returns (bool);
function codeHashOf(address addr) external returns (bytes32);
}
文件 20 的 41:Lockable.sol
pragma solidity ^0.8.17;
import "./Approvable.sol";
import { SetLockable, LockableStatus, LockableData, WalletLockedByOwner } from "./SetLockable.sol";
abstract contract Lockable is Approvable {
using SetLockable for LockableData;
LockableData lockable;
bool soulBound = false;
function custodianOf(uint256 id)
public
view
returns (address)
{
return lockable.findCustodian(ownerOf(id));
}
function lockWallet(uint256 id) public {
revokeApprovals(ownerOf(id));
lockable.lockWallet(ownerOf(id));
}
function unlockWallet(uint256 id) public {
lockable.unlockWallet(ownerOf(id));
}
function _forceUnlock(uint256 id) internal {
lockable.forceUnlock(ownerOf(id));
}
function setCustodian(uint256 id, address custodianAddress) public {
lockable.setCustodian(custodianAddress,ownerOf(id));
}
function isLocked(uint256 id) public view returns (bool) {
if (enumerationExists(id)) {
return lockable.lockableStatus[ownerOf(id)].isLocked || soulBound;
}
return soulBound;
}
function lockedSince(uint256 id) public view returns (uint256) {
return lockable.lockableStatus[ownerOf(id)].lockedAt;
}
function validateLock(uint256 tokenId) internal view {
if (isLocked(tokenId)) {
revert WalletLockedByOwner();
}
}
function soulBind() internal {
soulBound = true;
}
function releaseSoul() internal {
soulBound = false;
}
}
文件 21 的 41:LockableTransferrable.sol
pragma solidity ^0.8.17;
import "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol";
import "@openzeppelin/contracts/utils/Address.sol";
import "./Lockable.sol";
import { LockableStatus,InvalidTransferRecipient,TokenIsSoulBound,ContractIsNot721Receiver } from "./SetLockable.sol";
abstract contract LockableTransferrable is Lockable {
using Address for address;
function approve(address to, uint256 tokenId) public virtual override {
validateLock(tokenId);
super.approve(to,tokenId);
}
function setApprovalForAll(address operator, bool approved) public virtual override {
if (tokensOwnedBy(msg.sender).length > 0) {
validateLock(tokensOwnedBy(msg.sender)[0]);
} else if (soulBound) {
revert TokenIsSoulBound();
}
super.setApprovalForAll(operator,approved);
}
function transferFrom(
address from,
address to,
uint256 tokenId
) public virtual override {
validateApprovedOrOwner(msg.sender, tokenId);
validateLock(tokenId);
_transfer(from,to,tokenId);
}
function _transfer(
address from,
address to,
uint256 tokenId
) internal {
if(to == address(0)) {
revert InvalidTransferRecipient();
}
revokeTokenApproval(tokenId);
if (enumerationExists(tokenId)) {
swapOwner(from,to,tokenId);
}
packedTransferFrom(from, to, tokenId);
completeTransfer(from,to,tokenId);
}
function completeTransfer(
address from,
address to,
uint256 tokenId) internal {
emit Transfer(from, to, tokenId);
}
function safeTransferFrom(
address from,
address to,
uint256 tokenId
) public virtual override {
safeTransferFrom(from, to, tokenId, "");
}
function safeTransferFrom(
address from,
address to,
uint256 tokenId,
bytes memory data
) public virtual override {
validateApprovedOrOwner(msg.sender, tokenId);
validateLock(tokenId);
_safeTransfer(from, to, tokenId, data);
}
function _safeTransfer(
address from,
address to,
uint256 tokenId,
bytes memory data
) internal virtual {
if (!_checkOnERC721Received(from, to, tokenId, data)) {
revert ContractIsNot721Receiver();
}
_transfer(from, to, tokenId);
}
function _checkOnERC721Received(
address from,
address to,
uint256 tokenId,
bytes memory data
) private returns (bool) {
if (to.isContract()) {
try IERC721Receiver(to).onERC721Received(msg.sender, from, tokenId, data) returns (bytes4 retval) {
return retval == IERC721Receiver.onERC721Received.selector;
} catch (bytes memory reason) {
if (reason.length == 0) {
revert InvalidTransferRecipient();
} else {
assembly {
revert(add(32, reason), mload(reason))
}
}
}
} else {
return true;
}
}
}
文件 22 的 41:Math.sol
pragma solidity ^0.8.0;
library Math {
enum Rounding {
Down,
Up,
Zero
}
function max(uint256 a, uint256 b) internal pure returns (uint256) {
return a > b ? a : b;
}
function min(uint256 a, uint256 b) internal pure returns (uint256) {
return a < b ? a : b;
}
function average(uint256 a, uint256 b) internal pure returns (uint256) {
return (a & b) + (a ^ b) / 2;
}
function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {
return a == 0 ? 0 : (a - 1) / b + 1;
}
function mulDiv(
uint256 x,
uint256 y,
uint256 denominator
) internal pure returns (uint256 result) {
unchecked {
uint256 prod0;
uint256 prod1;
assembly {
let mm := mulmod(x, y, not(0))
prod0 := mul(x, y)
prod1 := sub(sub(mm, prod0), lt(mm, prod0))
}
if (prod1 == 0) {
return prod0 / denominator;
}
require(denominator > prod1);
uint256 remainder;
assembly {
remainder := mulmod(x, y, denominator)
prod1 := sub(prod1, gt(remainder, prod0))
prod0 := sub(prod0, remainder)
}
uint256 twos = denominator & (~denominator + 1);
assembly {
denominator := div(denominator, twos)
prod0 := div(prod0, twos)
twos := add(div(sub(0, twos), twos), 1)
}
prod0 |= prod1 * twos;
uint256 inverse = (3 * denominator) ^ 2;
inverse *= 2 - denominator * inverse;
inverse *= 2 - denominator * inverse;
inverse *= 2 - denominator * inverse;
inverse *= 2 - denominator * inverse;
inverse *= 2 - denominator * inverse;
inverse *= 2 - denominator * inverse;
result = prod0 * inverse;
return result;
}
}
function mulDiv(
uint256 x,
uint256 y,
uint256 denominator,
Rounding rounding
) internal pure returns (uint256) {
uint256 result = mulDiv(x, y, denominator);
if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) {
result += 1;
}
return result;
}
function sqrt(uint256 a) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 result = 1 << (log2(a) >> 1);
unchecked {
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
return min(result, a / result);
}
}
function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = sqrt(a);
return result + (rounding == Rounding.Up && result * result < a ? 1 : 0);
}
}
function log2(uint256 value) internal pure returns (uint256) {
uint256 result = 0;
unchecked {
if (value >> 128 > 0) {
value >>= 128;
result += 128;
}
if (value >> 64 > 0) {
value >>= 64;
result += 64;
}
if (value >> 32 > 0) {
value >>= 32;
result += 32;
}
if (value >> 16 > 0) {
value >>= 16;
result += 16;
}
if (value >> 8 > 0) {
value >>= 8;
result += 8;
}
if (value >> 4 > 0) {
value >>= 4;
result += 4;
}
if (value >> 2 > 0) {
value >>= 2;
result += 2;
}
if (value >> 1 > 0) {
result += 1;
}
}
return result;
}
function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = log2(value);
return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0);
}
}
function log10(uint256 value) internal pure returns (uint256) {
uint256 result = 0;
unchecked {
if (value >= 10**64) {
value /= 10**64;
result += 64;
}
if (value >= 10**32) {
value /= 10**32;
result += 32;
}
if (value >= 10**16) {
value /= 10**16;
result += 16;
}
if (value >= 10**8) {
value /= 10**8;
result += 8;
}
if (value >= 10**4) {
value /= 10**4;
result += 4;
}
if (value >= 10**2) {
value /= 10**2;
result += 2;
}
if (value >= 10**1) {
result += 1;
}
}
return result;
}
function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = log10(value);
return result + (rounding == Rounding.Up && 10**result < value ? 1 : 0);
}
}
function log256(uint256 value) internal pure returns (uint256) {
uint256 result = 0;
unchecked {
if (value >> 128 > 0) {
value >>= 128;
result += 16;
}
if (value >> 64 > 0) {
value >>= 64;
result += 8;
}
if (value >> 32 > 0) {
value >>= 32;
result += 4;
}
if (value >> 16 > 0) {
value >>= 16;
result += 2;
}
if (value >> 8 > 0) {
result += 1;
}
}
return result;
}
function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = log256(value);
return result + (rounding == Rounding.Up && 1 << (result * 8) < value ? 1 : 0);
}
}
}
文件 23 的 41:Mintable.sol
pragma solidity ^0.8.17;
import "./LockableTransferrable.sol";
import { SetMintable, MintableData } from "./SetMintable.sol";
import { TokenOwnership } from "./SetOwnerEnumerable.sol";
error InvalidRecipient(address zero);
error TokenAlreadyMinted(uint256 tokenId);
error InvalidToken(uint256 tokenId);
error MintIsNotLive();
abstract contract Mintable is LockableTransferrable {
using SetMintable for MintableData;
MintableData mintables;
mapping(address => mapping(uint256 => bool)) claimed;
bool isLive;
function setMintLive(bool _isLive) public onlyOwner {
isLive = _isLive;
}
function hasBeenClaimed(uint256 tokenId, address addressed) public view returns (bool) {
return claimed[addressed][tokenId];
}
function claim(uint256 tokenId, address addressed) internal {
claimed[addressed][tokenId] = true;
}
function getSenderMints() internal view returns (uint256) {
return numberMinted(msg.sender);
}
function _mint(address to, uint256 quantity, bool enumerate) internal virtual returns (uint256) {
if (!isLive) {
revert MintIsNotLive();
}
if (to == address(0)) {
revert InvalidRecipient(to);
}
return enumerate ? enumerateMint(to, quantity) : packedMint(to, quantity);
}
}
文件 24 的 41:Nameable.sol
pragma solidity ^0.8.17;
import "@openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol";
import { SetNameable, NameableData } from "./SetNameable.sol";
abstract contract Nameable is IERC721Metadata {
using SetNameable for NameableData;
NameableData nameable;
constructor(string memory _name, string memory _symbol) {
nameable.setNamed(_name, _symbol);
}
function name() public virtual override view returns (string memory) {
return nameable.getName();
}
function symbol() public virtual override view returns (string memory) {
return nameable.getSymbol();
}
}
文件 25 的 41:OperatorFilterer.sol
pragma solidity ^0.8.13;
import {IOperatorFilterRegistry} from "./IOperatorFilterRegistry.sol";
import {CANONICAL_OPERATOR_FILTER_REGISTRY_ADDRESS} from "./lib/Constants.sol";
abstract contract OperatorFilterer {
error OperatorNotAllowed(address operator);
IOperatorFilterRegistry public constant OPERATOR_FILTER_REGISTRY =
IOperatorFilterRegistry(CANONICAL_OPERATOR_FILTER_REGISTRY_ADDRESS);
constructor(address subscriptionOrRegistrantToCopy, bool subscribe) {
if (address(OPERATOR_FILTER_REGISTRY).code.length > 0) {
if (subscribe) {
OPERATOR_FILTER_REGISTRY.registerAndSubscribe(address(this), subscriptionOrRegistrantToCopy);
} else {
if (subscriptionOrRegistrantToCopy != address(0)) {
OPERATOR_FILTER_REGISTRY.registerAndCopyEntries(address(this), subscriptionOrRegistrantToCopy);
} else {
OPERATOR_FILTER_REGISTRY.register(address(this));
}
}
}
}
modifier onlyAllowedOperator(address from) virtual {
if (from != msg.sender) {
_checkFilterOperator(msg.sender);
}
_;
}
modifier onlyAllowedOperatorApproval(address operator) virtual {
_checkFilterOperator(operator);
_;
}
function _checkFilterOperator(address operator) internal view virtual {
if (address(OPERATOR_FILTER_REGISTRY).code.length > 0) {
if (!OPERATOR_FILTER_REGISTRY.isOperatorAllowed(address(this), operator)) {
revert OperatorNotAllowed(operator);
}
}
}
}
文件 26 的 41:Ownable.sol
pragma solidity ^0.8.17;
abstract contract Ownable {
address private _owner;
error CallerIsNotOwner(address caller);
error OwnerCannotBeZeroAddress();
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor() {
_transferOwnership(msg.sender);
}
modifier onlyOwner() {
_checkOwner();
_;
}
function owner() public view virtual returns (address) {
return _owner;
}
function _checkOwner() internal view virtual {
if (owner() != msg.sender) {
revert CallerIsNotOwner(msg.sender);
}
}
function renounceOwnership() public virtual onlyOwner {
_transferOwnership(address(0));
}
function transferOwnership(address newOwner) public virtual onlyOwner {
if(newOwner == address(0)) {
revert OwnerCannotBeZeroAddress();
}
_transferOwnership(newOwner);
}
function _transferOwnership(address newOwner) internal virtual {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}
文件 27 的 41:OwnerEnumerable.sol
pragma solidity ^0.8.17;
import { SetOwnerEnumerable, OwnerEnumerableData, TokenNonOwner, InvalidOwner, TokenOwnership } from "./SetOwnerEnumerable.sol";
import { PackableOwnership } from "./PackableOwnership.sol";
abstract contract OwnerEnumerable is PackableOwnership {
using SetOwnerEnumerable for OwnerEnumerableData;
OwnerEnumerableData enumerable;
function tokensOwnedBy(address holder) public view returns (uint256[] memory) {
uint256[] memory empty;
if (enumerable.isOwnerEnumerated(holder)) {
return enumerable.findTokensOwned(holder);
}
return empty;
}
function enumeratedBalanceOf(address owner) public view virtual returns (uint256) {
validateNonZeroAddress(owner);
return enumerable.ownedTokens[owner].length;
}
function validateNonZeroAddress(address owner) internal pure {
if(owner == address(0)) {
revert InvalidOwner();
}
}
function enumerateToken(address to, uint256 tokenId) internal {
enumerable.addTokenToEnumeration(to, tokenId);
}
function enumerateMint(address to, uint256 quantity) internal returns (uint256) {
uint256 start = minted()+1;
uint256 end = packedMint(to,quantity);
for (uint256 i = start; i <= end; i++) {
enumerateToken(to, i);
}
return end;
}
function enumerateBurn(address from, uint256 tokenId) internal {
enumerable.addBurnToEnumeration(from, tokenId);
enumerable.removeTokenFromEnumeration(from, tokenId);
}
function swapOwner(address from, address to, uint256 tokenId) internal {
enumerable.removeTokenFromEnumeration(from, tokenId);
enumerable.addTokenToEnumeration(to, tokenId);
}
function enumerationExists(uint256 tokenId) internal view virtual returns (bool) {
return enumerable.tokens[tokenId].exists;
}
function selfDestruct(uint256 tokenId) internal {
delete enumerable.tokens[tokenId];
}
}
文件 28 的 41:PackableOwnership.sol
pragma solidity ^0.8.17;
import { FlexibleMetadata } from "./FlexibleMetadata.sol";
import { PackableData, SetPackable } from "./SetPackable.sol";
struct TokenApproval {
address approval;
bool exists;
}
abstract contract PackableOwnership is FlexibleMetadata {
using SetPackable for PackableData;
PackableData packable;
constructor() {
packable._currentIndex = packable._startTokenId();
}
function numberMinted(address minter) public view returns (uint256) {
return packable._numberMinted(minter);
}
function ownerOf(uint256 tokenId) public view returns (address) {
return packable.ownerOf(tokenId);
}
function balanceOf(address owner) public view virtual override returns (uint256) {
return packable.balanceOf(owner);
}
function totalSupply() public view virtual returns (uint256) {
return packable.totalSupply();
}
function minted() internal view virtual returns (uint256) {
return packable._currentIndex;
}
function exists(uint256 tokenId) internal view returns (bool) {
return packable._exists(tokenId);
}
function packedTransferFrom(
address from,
address to,
uint256 tokenId
) internal {
packable.transferFrom(from,to,tokenId);
}
function packedMint(address to, uint256 quantity) internal returns (uint256) {
return packable._mint(to,quantity);
}
function packedBurn(uint256 tokenId) internal {
packable._burn(tokenId);
}
function retrieveMintQuantities(address owner) internal view returns (uint16[4] memory) {
return packable.getAux16(owner);
}
function setAux32(address owner, uint16[4] memory aux) internal {
packable._setAux(owner,packable.pack64(packable.pack32(aux[0],aux[1]),packable.pack32(aux[2],aux[3])));
}
function recordMintQuantity(uint256 phase, uint256 quantity) internal {
uint16[4] memory aux = retrieveMintQuantities(msg.sender);
aux[phase] = uint16(quantity)+aux[phase];
setAux32(msg.sender,aux);
}
}
文件 29 的 41:Phaseable.sol
pragma solidity ^0.8.17;
import { SetPhaseable, PhaseableData, MintIsNotAllowedRightNow, ExceedsMaxSupply, Phase } from "./SetPhaseable.sol";
import { OwnerEnumerable } from "./OwnerEnumerable.sol";
import "./Mintable.sol";
abstract contract Phaseable is Mintable {
using SetPhaseable for PhaseableData;
PhaseableData phaseables;
function canMint(uint256 phase, uint256 quantity) internal virtual returns(bool);
function initialize(Phase[] storage phases, uint256 maxSupply) internal {
phaseables.initialize(phases,maxSupply);
}
function phasedMint(uint256 phase, uint256 quantity, bool enumerate) internal returns (uint256) {
if (!canMint(phase, quantity)) {
revert MintIsNotAllowedRightNow();
}
if (minted()+quantity > phaseables.getMaxSupply()) {
revert ExceedsMaxSupply();
}
recordMintQuantity(phase, quantity);
return _mint(msg.sender,quantity,enumerate);
}
function airdrop(address recipient, uint256 quantity, bool enumerate) public virtual onlyOwner {
if (minted()+quantity > phaseables.getMaxSupply()) {
revert ExceedsMaxSupply();
}
_mint(recipient,quantity, enumerate);
}
function activePhase() internal view returns (uint256) {
return phaseables.getActivePhase();
}
function nextPhase() public onlyOwner {
phaseables.startNextPhase();
}
function previousPhase() public onlyOwner {
phaseables.revertPhase();
}
function getPhases() internal view returns (Phase[] storage) {
return phaseables.getPhases();
}
function findPhase(uint256 phaseId) internal view returns (Phase memory) {
return phaseables.findPhase(phaseId);
}
function mintedInPhase(uint256 phaseId, address minter) external view returns (uint16) {
return retrieveMintQuantities(minter)[phaseId];
}
function updatePhase(uint256 phaseId, Phase memory phase) internal {
Phase[] storage existing = phaseables.getPhases();
existing[phaseId] = phase;
}
function getMaxSupply() internal view returns (uint256) {
return phaseables.getMaxSupply();
}
function setMaxSupply(uint256 newMax) internal {
phaseables.setMaxSupply(newMax);
}
}
文件 30 的 41:QueenApiens.sol
pragma solidity ^0.8.17;
import "./Allowable.sol";
import "./PackableOwnership.sol";
import { SetContractMetadataRenderable, RenderableData } from "./SetContractMetadataRenderable.sol";
import { DEFAULT, FLAG, PRE } from "./SetFlexibleMetadata.sol";
error ApienAlreadyClaimed(uint256 id);
error BagAlreadyClaimed(uint256 id);
error InvalidPayment(uint256 cost, uint256 amount);
error Unphased();
error NotInTreasury(uint256 tokenId);
contract QueenApiens is Allowable {
using SetContractMetadataRenderable for RenderableData;
RenderableData renderings;
uint256 ALLOW_PHASE = 0;
uint256 ALLOW_BAG_PHASE = 1;
uint256 CLAIM_PHASE = 2;
uint256 PUBLIC_PHASE = 3;
address GENESIS_BAG = 0xD2C83498882AfF028E18aF5FB46120342c5129bD;
address APIENS = 0xcf8896D28B905cEfd5fFbDDD5Dbfa0eEfF8d938B;
address GENESIS_BAG_ALLOW = address(0x0);
uint256 MAX_SUPPLY = 8888;
uint256 ALLOW_PER = 5;
uint256 ALLOW_SUPPLY = 8600;
uint256 ALLOW_PRICE = .03 ether;
uint256 FREE_PER = 3000;
uint256 FREE_SUPPLY = 3000;
uint256 FREE_PRICE = 0 ether;
uint256 PUBLIC_PER = 5;
uint256 PUBLIC_PRICE = 0.049 ether;
bytes prerevealUri = "ipfs://QmTkQej4rqQrKEQd7fQrHQwYH2fRDHAo8xJPinUuJv4Lx1";
bytes contractProfileURI = "ipfs://bafybeifrzbmi4icjrwdsypqqxlxkb27oyzlqf2372eq55t3kn7nidnmagq";
uint256 royaltyBasis = 500;
address feeRecipient = 0xb9d8a142F6fC69dD1B38a33eD123C895870A42e8;
mapping(address=>bool) freeClaimed;
constructor(string memory name, string memory symbol) Allowable(name,symbol) {
soulBind();
initializePhases();
}
function initializePhases() internal virtual override {
Phase[] storage phases = getPhases();
phases.push(Phase("allowed", ALLOW_PER, ALLOW_SUPPLY, ALLOW_PRICE));
phases.push(Phase("allowedBags", FREE_PER, ALLOW_SUPPLY, ALLOW_PRICE));
phases.push(Phase("claim", FREE_PER, FREE_SUPPLY, FREE_PRICE));
phases.push(Phase("public", PUBLIC_PER, MAX_SUPPLY, PUBLIC_PRICE));
initialize(phases,MAX_SUPPLY);
}
function contractURI() external view virtual override returns (string memory) {
return renderings.encodedContractURI(contractProfileURI, royaltyBasis, feeRecipient);
}
function freeClaimMint(uint256[] memory stakedApiens, uint256[] memory genesisBags, bytes calldata signature)
external requiresClaimSig(signature,msg.sender,genesisBags,stakedApiens) {
if (freeClaimed[msg.sender]) revert ApienAlreadyClaimed(0);
for (uint i = 0; i < genesisBags.length; i++) {
if (hasBeenClaimed(genesisBags[i], GENESIS_BAG)) {
revert BagAlreadyClaimed(genesisBags[i]);
}
claim(genesisBags[i], GENESIS_BAG);
}
for (uint i; i < stakedApiens.length; i++) {
if (hasBeenClaimed(stakedApiens[i], APIENS)) {
revert ApienAlreadyClaimed(stakedApiens[i]);
}
claim(stakedApiens[i], APIENS);
}
phasedMint(CLAIM_PHASE, stakedApiens.length, false);
}
function bagAllowMint(uint256[] memory genesisBags, bytes calldata signature)
external payable requiresBagSig(signature,msg.sender,genesisBags) {
for (uint i = 0; i < genesisBags.length; i++) {
if (hasBeenClaimed(genesisBags[i], GENESIS_BAG)) {
revert BagAlreadyClaimed(genesisBags[i]);
}
claim(genesisBags[i], GENESIS_BAG);
}
Phase memory phased = findPhase(ALLOW_BAG_PHASE);
isValidPayment(phased.cost, genesisBags.length);
phasedMint(ALLOW_BAG_PHASE, genesisBags.length, false);
}
function allowlistMint(uint64 quantity, bytes calldata signature)
external payable requiresAllowSig(signature,msg.sender) {
Phase memory phased = findPhase(ALLOW_PHASE);
isValidPayment(phased.cost, quantity);
phasedMint(ALLOW_PHASE, quantity, false);
}
function publicMint(uint64 quantity)
external payable {
Phase memory phased = findPhase(PUBLIC_PHASE);
isValidPayment(phased.cost, quantity);
phasedMint(PUBLIC_PHASE, quantity, false);
}
function empower(uint256 tokenId) external {
validateApprovedOrOwner(msg.sender, tokenId);
if (!enumerationExists(tokenId)) {
enumerateToken(msg.sender, tokenId);
}
}
function burn(uint256 tokenId) external {
validateApprovedOrOwner(msg.sender, tokenId);
validateLock(tokenId);
if (enumerationExists(tokenId)) {
enumerateBurn(msg.sender,tokenId);
selfDestruct(tokenId);
}
packedBurn(tokenId);
}
function setRoyaltyBasis(uint256 royalty_basis) external onlyOwner {
royaltyBasis = royalty_basis;
}
function setContractRoyaltyRecipient(address recipient) external onlyOwner {
feeRecipient = recipient;
}
function setContractProfileImage(bytes calldata imageUri) external onlyOwner {
contractProfileURI = imageUri;
}
function withdrawFunds() external onlyOwner {
TREASURY.transfer(address(this).balance);
}
function assignFundRecipient(address treasury) external onlyOwner {
TREASURY = payable(treasury);
}
function enableSecondarySales() external onlyOwner {
releaseSoul();
}
function setMintPrice(uint256 phase, uint256 price) external onlyOwner {
Phase memory existing = findPhase(phase);
existing.cost = price;
updatePhase(phase, existing);
}
function getMintPrice(uint256 phase) external view returns (uint256) {
Phase memory existing = findPhase(phase);
return existing.cost;
}
function airdropToTreasury(uint256 quantity) public onlyOwner {
if (minted()+quantity > getMaxSupply()) {
revert ExceedsMaxSupply();
}
_mint(TREASURY, quantity, false);
}
function airdropFromTreasury(uint256 tokenId, address recipient) public onlyOwner {
if (ownerOf(tokenId) != TREASURY) {
revert NotInTreasury(tokenId);
}
if (!enumerationExists(tokenId)) {
enumerateToken(TREASURY, tokenId);
}
transferFrom(TREASURY, recipient, tokenId);
}
function bulkAirdrop(address recipient, uint256 quantity) public virtual onlyOwner {
super.airdrop(recipient,quantity,false);
freeClaimed[msg.sender] = true;
}
function maxSupply() external view returns (uint256) {
return getMaxSupply();
}
function isValidPayment(uint256 cost, uint256 quantity) internal view {
if (msg.value != (cost*quantity)) {
revert InvalidPayment(cost*quantity, msg.value);
}
}
}
文件 31 的 41:SetApprovable.sol
pragma solidity ^0.8.17;
struct ApprovableData {
mapping(address => uint256) contractApprovals;
mapping(address => address[]) approvedForAll;
mapping(address => mapping(address => uint256)) approvedForAllIndex;
mapping(uint256 => uint256) tokenApprovals;
mapping(uint256 => TokenApproval[]) approvedForToken;
mapping(uint256 => mapping(address => uint256)) approvedForTokenIndex;
mapping(uint256 => TokenApproval) tokens;
bool exists;
}
struct TokenApproval {
address approval;
bool exists;
}
error AlreadyApproved(address operator, uint256 tokenId);
error AlreadyApprovedContract(address operator);
error AlreadyRevoked(address operator, uint256 tokenId);
error AlreadyRevokedContract(address operator);
error TokenNonExistent(uint256 tokenId);
library SetApprovable {
event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);
event ApprovalForAll(address indexed owner, address indexed operator, bool approved);
function isApprovedForAll(ApprovableData storage self, address owner, address operator) public view returns (bool) {
return self.approvedForAll[owner].length > self.approvedForAllIndex[owner][operator] ?
(self.approvedForAll[owner][self.approvedForAllIndex[owner][operator]] != address(0)) :
false;
}
function revokeApprovals(ApprovableData storage self, address owner, uint256[] memory ownedTokens) public {
for (uint256 i = 0; i < ownedTokens.length; i++) {
revokeTokenApproval(self,ownedTokens[i]);
}
address[] memory contractApprovals = self.approvedForAll[owner];
for (uint256 i = 0; i < contractApprovals.length; i++) {
address approved = contractApprovals[i];
revokeApprovalForContract(self, approved, owner);
}
}
function revokeTokenApproval(ApprovableData storage self, uint256 token) public {
TokenApproval[] memory approvals = self.approvedForToken[token];
for (uint256 j = 0; j < approvals.length; j++) {
revokeApprovalForToken(self, approvals[j].approval, token);
}
}
function getApproved(ApprovableData storage self, uint256 tokenId) public view returns (address) {
return self.approvedForToken[tokenId].length > 0 ? self.approvedForToken[tokenId][0].approval : address(0);
}
function approveForToken(ApprovableData storage self, address operator, uint256 tokenId) public {
uint256 index = self.approvedForTokenIndex[tokenId][operator];
if (index < self.approvedForToken[tokenId].length) {
if (self.approvedForToken[tokenId][index].exists) {
revert AlreadyApproved(operator, tokenId);
}
}
self.approvedForToken[tokenId].push(TokenApproval(operator,true));
self.approvedForTokenIndex[tokenId][operator] = self.approvedForToken[tokenId].length-1;
self.tokenApprovals[tokenId]++;
emit Approval(msg.sender, operator, tokenId);
}
function revokeApprovalForToken(ApprovableData storage self, address revoked, uint256 tokenId) public {
uint256 index = self.approvedForTokenIndex[tokenId][revoked];
if (!self.approvedForToken[tokenId][index].exists) {
revert AlreadyRevoked(revoked,tokenId);
}
if (index != self.approvedForToken[tokenId].length - 1) {
TokenApproval storage tmp = self.approvedForToken[tokenId][self.approvedForToken[tokenId].length - 1];
self.approvedForToken[tokenId][self.approvedForToken[tokenId].length - 1] = self.approvedForToken[tokenId][index];
self.approvedForToken[tokenId][index] = tmp;
self.approvedForTokenIndex[tokenId][tmp.approval] = index;
}
delete self.approvedForTokenIndex[tokenId][revoked];
self.approvedForToken[tokenId].pop();
self.tokenApprovals[tokenId]--;
}
function approveForContract(ApprovableData storage self, address operator) public {
uint256 index = self.approvedForAllIndex[msg.sender][operator];
if (self.approvedForAll[msg.sender].length > index) {
if (self.approvedForAll[msg.sender][index] != address(0)) {
revert AlreadyApprovedContract(self.approvedForAll[msg.sender][index]);
}
}
self.approvedForAll[msg.sender].push(operator);
self.approvedForAllIndex[msg.sender][operator] = self.approvedForAll[msg.sender].length-1;
self.contractApprovals[msg.sender]++;
emit ApprovalForAll(msg.sender, operator, true);
}
function revokeApprovalForContract(ApprovableData storage self, address revoked, address owner) public {
uint256 index = self.approvedForAllIndex[owner][revoked];
address revokee = self.approvedForAll[owner][index];
if (revokee != revoked) {
revert AlreadyRevokedContract(revoked);
}
if (index != self.approvedForAll[owner].length - 1) {
address tmp = self.approvedForAll[owner][self.approvedForAll[owner].length - 1];
self.approvedForAll[owner][self.approvedForAll[owner].length - 1] = self.approvedForAll[owner][index];
self.approvedForAll[owner][index] = tmp;
self.approvedForAllIndex[owner][tmp] = index;
}
delete self.approvedForAllIndex[owner][revoked];
self.approvedForAll[owner].pop();
self.contractApprovals[owner]--;
emit ApprovalForAll(owner, revoked, false);
}
}
文件 32 的 41:SetAssignable.sol
pragma solidity ^0.8.17;
import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import "@openzeppelin/contracts/token/ERC1155/IERC1155.sol";
struct AssignableData {
mapping(uint256 => address[]) assignments;
mapping(address => mapping(uint256 => uint256)) assignmentIndex;
mapping(address => uint256) assigned;
}
error AlreadyAssigned(uint256 tokenId);
error NotAssigned(address to);
error NotTokenOwner();
interface Supportable {
function supportsInterface(bytes4 interfaceId) external view returns (bool);
function balanceOf(address owner) external view returns (uint256);
function ownerOf(uint256 tokenId) external view returns (address);
function balanceOf(address owner, uint256 tokenId) external view returns (uint256);
}
library SetAssignable {
function findAssignees(AssignableData storage self, uint256 tokenId) public view returns (address[] memory) {
return self.assignments[tokenId];
}
function revokeAll(AssignableData storage self, uint256 tokenId) public {
for (uint256 iterator = 0; iterator < self.assignments[tokenId].length; iterator++) {
address target = self.assignments[tokenId][iterator];
delete self.assignmentIndex[target][tokenId];
delete self.assigned[target];
}
while ( self.assignments[tokenId].length > 0) {
self.assignments[tokenId].pop();
}
}
function iterateGuardiansBalance(AssignableData storage self, uint256[] memory guardians, address seeking, uint256 tokenId) public view returns (uint256) {
uint256 balance = 0;
for (uint256 iterator = 0; iterator < guardians.length; iterator++) {
uint256 guardian = guardians[iterator];
balance += iterateAssignmentsBalance(self,guardian,seeking,tokenId);
}
return balance;
}
function iterateAssignmentsBalance(AssignableData storage self, uint256 guardian, address seeking, uint256 tokenId) public view returns (uint256) {
uint256 balance = 0;
for (uint256 iterator = 0; iterator < self.assignments[guardian].length; iterator++) {
address assignment =self.assignments[guardian][iterator];
Supportable supporting = Supportable(seeking);
if (supporting.supportsInterface(type(IERC721).interfaceId)) {
balance += supporting.balanceOf(assignment);
}
if (supporting.supportsInterface(type(IERC1155).interfaceId)) {
balance += supporting.balanceOf(assignment, tokenId);
}
}
return balance;
}
function addAssignment(AssignableData storage self, address to, uint256 tokenId) public {
uint256 assigned = findAssignment(self, to);
if (assigned > 0) {
revert AlreadyAssigned(assigned);
}
self.assignments[tokenId].push(to);
uint256 length = self.assignments[tokenId].length;
self.assignmentIndex[to][tokenId] = length-1;
self.assigned[to] = tokenId;
}
function removeAssignment(AssignableData storage self, address to) public {
uint256 assigned = findAssignment(self, to);
if (assigned > 0) {
uint256 existingAddressIndex = self.assignmentIndex[to][assigned];
uint256 lastAssignmentIndex = self.assignments[assigned].length-1;
if (existingAddressIndex != lastAssignmentIndex) {
address lastAssignment = self.assignments[assigned][lastAssignmentIndex];
self.assignments[assigned][existingAddressIndex] = lastAssignment;
self.assignmentIndex[lastAssignment][assigned] = existingAddressIndex;
}
delete self.assignmentIndex[to][assigned];
self.assignments[assigned].pop();
} else {
revert NotAssigned(to);
}
}
function findAssignment(AssignableData storage self, address to) public view returns (uint256) {
return self.assigned[to];
}
}
文件 33 的 41:SetContractMetadataRenderable.sol
pragma solidity ^0.8.17;
import "@openzeppelin/contracts/utils/Strings.sol";
import "@openzeppelin/contracts/utils/Base64.sol";
bytes constant description = abi.encodePacked(unicode"Female Apiens, born from the heart of the Apiens community, carry a powerful mission: to uplift and empower women. By giving them wings to build businesses centered around their unique strengths, these cherished collections not only unlock exciting possibilities but also offer incredible opportunities for female Apiens to soar.");
struct RenderableData {
uint256 num;
}
library SetContractMetadataRenderable {
using Strings for uint256;
function encodedContractURI(RenderableData storage, bytes memory imageUri, uint256 royalty_basis, address recipient) public pure returns (string memory) {
bytes memory dataURI = abi.encodePacked(
'{',
'"name": "Queen Apiens"',
',"description": "',string(description),'"',
',"image":"',string(imageUri),'"',
',"external_link":"https://theapiens.com/"',
',"seller_fee_basis_points":', royalty_basis.toString(),
',"fee_recipient":"', Strings.toHexString(uint160(recipient), 20),'"'
'}'
);
return string(
abi.encodePacked(
"data:application/json;base64,",
Base64.encode(dataURI)
)
);
}
}
文件 34 的 41:SetFlexibleMetadata.sol
pragma solidity ^0.8.17;
struct FlexibleMetadataData {
string defaultTokenMetadata;
string prerevealTokenMetadata;
string flaggedTokenMetadata;
mapping(string => string) supplementalTokenMetadata;
string contractMetadata;
mapping(uint256 => bool) tokenFlag;
mapping(uint256 => Supplement) supplemental;
bool tokenReveal;
}
struct Supplement {
string key;
bool exists;
}
bytes16 constant _SYMBOLS = "0123456789abcdef";
uint256 constant DEFAULT = 1;
uint256 constant FLAG = 2;
uint256 constant PRE = 3;
library SetFlexibleMetadata {
function setDefaultTokenMetadataURI(FlexibleMetadataData storage self, string memory uri) public {
self.defaultTokenMetadata = uri;
}
function setPrerevealTokenMetadataURI(FlexibleMetadataData storage self, string memory uri) public {
self.prerevealTokenMetadata = uri;
}
function setFlaggedTokenMetadataURI(FlexibleMetadataData storage self, string memory uri) public {
self.flaggedTokenMetadata = uri;
}
function setSupplementalTokenMetadataURI(FlexibleMetadataData storage self, string memory key, string memory uri) public {
self.supplementalTokenMetadata[key] = uri;
}
function setContractMetadataURI(FlexibleMetadataData storage self, string memory uri) public {
self.contractMetadata = uri;
}
function reveal(FlexibleMetadataData storage self, bool revealed) public {
self.tokenReveal = revealed;
}
function flagToken(FlexibleMetadataData storage self, uint256 tokenId, bool flagged) public {
self.tokenFlag[tokenId] = flagged;
}
function getTokenMetadata(FlexibleMetadataData storage self, uint256 tokenId) public view returns (string memory) {
if (self.tokenFlag[tokenId]) {
return encodeURI(self.flaggedTokenMetadata,tokenId);
}
if (!self.tokenReveal) {
return encodeURI(self.prerevealTokenMetadata,tokenId);
}
if (self.supplemental[tokenId].exists) {
return encodeURI(self.supplementalTokenMetadata[self.supplemental[tokenId].key],tokenId);
}
return encodeURI(self.defaultTokenMetadata,tokenId);
}
function getContractMetadata(FlexibleMetadataData storage self) public view returns (string memory) {
return self.contractMetadata;
}
function encodeURI(string storage uri, uint256 tokenId) public pure returns (string memory) {
return string(abi.encodePacked(uri, "/", toString(tokenId)));
}
function toString(uint256 value) public pure returns (string memory) {
unchecked {
uint256 length = log10(value) + 1;
string memory buffer = new string(length);
uint256 ptr;
assembly {
ptr := add(buffer, add(32, length))
}
while (true) {
ptr--;
assembly {
mstore8(ptr, byte(mod(value, 10), _SYMBOLS))
}
value /= 10;
if (value == 0) break;
}
return buffer;
}
}
function log10(uint256 value) public pure returns (uint256) {
uint256 result = 0;
unchecked {
if (value >= 10**64) {
value /= 10**64;
result += 64;
}
if (value >= 10**32) {
value /= 10**32;
result += 32;
}
if (value >= 10**16) {
value /= 10**16;
result += 16;
}
if (value >= 10**8) {
value /= 10**8;
result += 8;
}
if (value >= 10**4) {
value /= 10**4;
result += 4;
}
if (value >= 10**2) {
value /= 10**2;
result += 2;
}
if (value >= 10**1) {
result += 1;
}
}
return result;
}
}
文件 35 的 41:SetLockable.sol
pragma solidity ^0.8.17;
import { InvalidOwner } from "./SetOwnerEnumerable.sol";
struct LockableData {
mapping(address => uint256) lockableStatusIndex;
mapping(address => LockableStatus) lockableStatus;
}
struct LockableStatus {
bool isLocked;
uint256 lockedAt;
address custodian;
uint256 balance;
address[] approvedAll;
bool exists;
}
uint64 constant MAX_INT = 2**64 - 1;
error OnlyCustodianCanLock();
error OnlyOwnerCanSetCustodian();
error InvalidTransferRecipient();
error ContractIsNot721Receiver();
error WalletLockedByOwner();
error TokenIsSoulBound();
library SetLockable {
function lockWallet(LockableData storage self, address holder) public {
LockableStatus storage status = self.lockableStatus[holder];
if (msg.sender != status.custodian) {
revert OnlyCustodianCanLock();
}
status.isLocked = true;
status.lockedAt = block.timestamp;
}
function unlockWallet(LockableData storage self, address holder) public {
LockableStatus storage status = self.lockableStatus[holder];
if (msg.sender != status.custodian) {
revert OnlyCustodianCanLock();
}
status.isLocked = false;
status.lockedAt = MAX_INT;
}
function setCustodian(LockableData storage self, address custodianAddress, address holder) public {
if (msg.sender != holder) {
revert OnlyOwnerCanSetCustodian();
}
LockableStatus storage status = self.lockableStatus[holder];
status.custodian = custodianAddress;
}
function findCustodian(LockableData storage self, address wallet) public view returns (address) {
return self.lockableStatus[wallet].custodian;
}
function forceUnlock(LockableData storage self, address owner) public {
LockableStatus storage status = self.lockableStatus[owner];
status.isLocked = false;
status.lockedAt = MAX_INT;
}
}
文件 36 的 41:SetMintable.sol
pragma solidity ^0.8.17;
struct MintableData {
mapping(address => mapping(uint256 => bool)) claimed;
}
error OnlyOwnerCanClaim();
library SetMintable {
function isClaimed(MintableData storage self, address addressed, uint256 tokenId) public view returns (bool) {
return self.claimed[addressed][tokenId];
}
function claim(MintableData storage self, address addressed, uint256 tokenId) public {
self.claimed[addressed][tokenId] = true;
}
}
文件 37 的 41:SetNameable.sol
pragma solidity ^0.8.17;
struct NameableData {
string name;
string symbol;
}
library SetNameable {
function getName(NameableData storage self) public view returns (string memory) {
return self.name;
}
function getSymbol(NameableData storage self) public view returns (string memory) {
return self.symbol;
}
function setName(NameableData storage self, string calldata named) public {
self.name = named;
}
function setSymbol(NameableData storage self, string calldata symbol) public {
self.symbol = symbol;
}
function setNamed(NameableData storage self, string memory named, string memory symbol) public {
self.name = named;
self.symbol = symbol;
}
}
文件 38 的 41:SetOwnerEnumerable.sol
pragma solidity ^0.8.17;
struct OwnerEnumerableData {
mapping(uint256 => TokenOwnership) tokens;
mapping(address => bool) ownerEnumerated;
mapping(address => uint256[]) ownedTokens;
mapping(address => mapping(uint256 => uint256)) ownedTokensIndex;
mapping(address => uint256[]) burnedTokens;
mapping(address => mapping(uint256 => uint256)) burnedTokensIndex;
}
struct TokenOwnership {
address ownedBy;
bool exists;
}
error TokenNonOwner(address requester, uint256 tokenId);
error InvalidOwner();
library SetOwnerEnumerable {
function addTokenToEnumeration(OwnerEnumerableData storage self, address to, uint256 tokenId) public {
self.ownedTokens[to].push(tokenId);
uint256 length = self.ownedTokens[to].length;
self.ownedTokensIndex[to][tokenId] = length-1;
self.tokens[tokenId] = TokenOwnership(to,true);
self.ownerEnumerated[to] = true;
}
function addBurnToEnumeration(OwnerEnumerableData storage self, address to, uint256 tokenId) public {
self.burnedTokens[to].push(tokenId);
uint256 length = self.burnedTokens[to].length;
self.burnedTokensIndex[to][tokenId] = length-1;
}
function removeTokenFromEnumeration(OwnerEnumerableData storage self, address to, uint256 tokenId) public {
uint256 length = self.ownedTokens[to].length;
if (self.ownedTokensIndex[to][tokenId] > 0) {
if (self.ownedTokensIndex[to][tokenId] != length - 1) {
uint256 lastTokenId = self.ownedTokens[to][length - 1];
self.ownedTokens[to][self.ownedTokensIndex[to][tokenId]] = lastTokenId;
self.ownedTokensIndex[to][lastTokenId] = self.ownedTokensIndex[to][tokenId];
}
}
delete self.ownedTokensIndex[to][tokenId];
if (self.ownedTokens[to].length > 0) {
self.ownedTokens[to].pop();
}
}
function isOwnerEnumerated(OwnerEnumerableData storage self, address wallet) public view returns (bool) {
return self.ownerEnumerated[wallet];
}
function findTokensOwned(OwnerEnumerableData storage self, address wallet) public view returns (uint256[] storage) {
return self.ownedTokens[wallet];
}
function tokenIndex(OwnerEnumerableData storage self, address wallet, uint256 index) public view returns (uint256) {
return self.ownedTokens[wallet][index];
}
function ownerOf(OwnerEnumerableData storage self, uint256 tokenId) public view returns (address) {
address owner = self.tokens[tokenId].ownedBy;
if (owner == address(0)) {
revert TokenNonOwner(owner,tokenId);
}
return owner;
}
}
文件 39 的 41:SetPackable.sol
pragma solidity ^0.8.17;
error ApprovalCallerNotOwnerNorApproved();
error ApprovalQueryForNonexistentToken();
error BalanceQueryForZeroAddress();
error MintToZeroAddress();
error MintZeroQuantity();
error OwnerQueryForNonexistentToken();
error TransferCallerNotOwnerNorApproved();
error TransferFromIncorrectOwner();
error TransferToNonERC721ReceiverImplementer();
error TransferToZeroAddress();
error URIQueryForNonexistentToken();
error MintERC2309QuantityExceedsLimit();
error OwnershipNotInitializedForExtraData();
struct TokenOwnership {
address addr;
uint64 startTimestamp;
bool burned;
uint24 extraData;
}
struct DualAuxData {
uint32 data1;
uint32 data2;
}
struct QuadAuxData {
uint16 data1;
uint16 data2;
uint16 data3;
uint16 data4;
}
struct OctAuxData {
uint8 data1;
uint8 data2;
uint8 data3;
uint8 data4;
uint8 data5;
uint8 data6;
uint8 data7;
uint8 data8;
}
struct PackableData {
mapping(uint256 => uint256) _packedOwnerships;
mapping(address => uint256) _packedAddressData;
uint256 _currentIndex;
uint256 _burnCounter;
}
library SetPackable {
uint256 private constant _BITMASK_ADDRESS_DATA_ENTRY = (1 << 64) - 1;
uint256 private constant _BITPOS_NUMBER_MINTED = 64;
uint256 private constant _BITPOS_NUMBER_BURNED = 128;
uint256 private constant _BITPOS_AUX = 192;
uint256 private constant _BITMASK_AUX_COMPLEMENT = (1 << 192) - 1;
uint256 private constant _BITPOS_START_TIMESTAMP = 160;
uint256 private constant _BITMASK_BURNED = 1 << 224;
uint256 private constant _BITPOS_NEXT_INITIALIZED = 225;
uint256 private constant _BITMASK_NEXT_INITIALIZED = 1 << 225;
uint256 private constant _BITPOS_EXTRA_DATA = 232;
uint256 private constant _BITMASK_EXTRA_DATA_COMPLEMENT = (1 << 232) - 1;
uint256 private constant _BITMASK_ADDRESS = (1 << 160) - 1;
uint256 private constant _MAX_MINT_ERC2309_QUANTITY_LIMIT = 5000;
bytes32 private constant _TRANSFER_EVENT_SIGNATURE =
0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef;
function balanceOf(PackableData storage self, address owner) public view returns (uint256) {
if (owner == address(0)) revert BalanceQueryForZeroAddress();
return self._packedAddressData[owner] & _BITMASK_ADDRESS_DATA_ENTRY;
}
function _numberMinted(PackableData storage self,address owner) public view returns (uint256) {
return (self._packedAddressData[owner] >> _BITPOS_NUMBER_MINTED) & _BITMASK_ADDRESS_DATA_ENTRY;
}
function _numberBurned(PackableData storage self,address owner) public view returns (uint256) {
return (self._packedAddressData[owner] >> _BITPOS_NUMBER_BURNED) & _BITMASK_ADDRESS_DATA_ENTRY;
}
function _getAux(PackableData storage self,address owner) public view returns (uint64 aux) {
return uint64(self._packedAddressData[owner] >> _BITPOS_AUX);
}
function _setAux(PackableData storage self, address owner, uint64 aux) public {
uint256 packed = self._packedAddressData[owner];
uint256 auxCasted;
assembly {
auxCasted := aux
}
packed = (packed & _BITMASK_AUX_COMPLEMENT) | (auxCasted << _BITPOS_AUX);
self._packedAddressData[owner] = packed;
}
function getAux16(PackableData storage self, address owner) public view returns (uint16[4] memory) {
uint32[2] memory packed32 = unpack64(self,_getAux(self,owner));
uint16[2] memory pack16a = unpack32(self,packed32[0]);
uint16[2] memory pack16b = unpack32(self,packed32[1]);
return [pack16a[0],pack16a[1],pack16b[0],pack16b[1]];
}
function pack16(PackableData storage, uint8 pack1, uint8 pack2) public pure returns (uint16) {
return (uint16(pack2) << 8) | pack1;
}
function pack32(PackableData storage, uint16 pack1, uint16 pack2) public pure returns (uint32) {
return (uint32(pack2) << 16) | pack1;
}
function pack64(PackableData storage, uint32 pack1, uint32 pack2) public pure returns (uint64) {
return (uint64(pack2) << 32) | pack1;
}
function unpack64(PackableData storage, uint64 packed) public pure returns (uint32[2] memory unpacked){
uint32 pack2 = uint32(packed >> 32);
uint32 pack1 = uint32(packed);
return [pack1, pack2];
}
function unpack32(PackableData storage, uint32 packed) public pure returns (uint16[2] memory unpacked){
uint16 pack2 = uint16(packed >> 16);
uint16 pack1 = uint16(packed);
return [pack1, pack2];
}
function unpack16(PackableData storage, uint16 packed) public pure returns (uint8[2] memory unpacked){
uint8 pack2 = uint8(packed >> 8);
uint8 pack1 = uint8(packed);
return [pack1, pack2];
}
function ownerOf(PackableData storage self, uint256 tokenId) public view returns (address) {
return address(uint160(_packedOwnershipOf(self,tokenId)));
}
function _ownershipOf(PackableData storage self, uint256 tokenId) internal view returns (TokenOwnership memory) {
return _unpackedOwnership(_packedOwnershipOf(self,tokenId));
}
function _ownershipAt(PackableData storage self, uint256 index) internal view returns (TokenOwnership memory) {
return _unpackedOwnership(self._packedOwnerships[index]);
}
function _initializeOwnershipAt(PackableData storage self, uint256 index) internal {
if (self._packedOwnerships[index] == 0) {
self._packedOwnerships[index] = _packedOwnershipOf(self,index);
}
}
function _packedOwnershipOf(PackableData storage self, uint256 tokenId) private view returns (uint256) {
uint256 curr = tokenId;
unchecked {
if (_startTokenId(self) <= curr)
if (curr < self._currentIndex) {
uint256 packed = self._packedOwnerships[curr];
if (packed & _BITMASK_BURNED == 0) {
while (packed == 0) {
packed = self._packedOwnerships[--curr];
}
return packed;
}
}
}
revert OwnerQueryForNonexistentToken();
}
function _unpackedOwnership(uint256 packed) private pure returns (TokenOwnership memory ownership) {
ownership.addr = address(uint160(packed));
ownership.startTimestamp = uint64(packed >> _BITPOS_START_TIMESTAMP);
ownership.burned = packed & _BITMASK_BURNED != 0;
ownership.extraData = uint24(packed >> _BITPOS_EXTRA_DATA);
}
function _packOwnershipData(address owner, uint256 flags) private view returns (uint256 result) {
assembly {
owner := and(owner, _BITMASK_ADDRESS)
result := or(owner, or(shl(_BITPOS_START_TIMESTAMP, timestamp()), flags))
}
}
function _nextInitializedFlag(uint256 quantity) private pure returns (uint256 result) {
assembly {
result := shl(_BITPOS_NEXT_INITIALIZED, eq(quantity, 1))
}
}
function _startTokenId(PackableData storage) internal pure returns (uint256) {
return 0;
}
function _nextTokenId(PackableData storage self) public view returns (uint256) {
return self._currentIndex;
}
function totalSupply(PackableData storage self) public view returns (uint256) {
unchecked {
return self._currentIndex - self._burnCounter;
}
}
function _totalMinted(PackableData storage self) public view returns (uint256) {
unchecked {
return self._currentIndex;
}
}
function _totalBurned(PackableData storage self) public view returns (uint256) {
return self._burnCounter;
}
function _exists(PackableData storage self, uint256 tokenId) public view returns (bool) {
return
_startTokenId(self) <= tokenId &&
tokenId < self._currentIndex &&
self._packedOwnerships[tokenId] & _BITMASK_BURNED == 0;
}
function transferFrom(
PackableData storage self,
address from,
address to,
uint256 tokenId
) public {
uint256 prevOwnershipPacked = _packedOwnershipOf(self,tokenId);
if (address(uint160(prevOwnershipPacked)) != from) revert TransferFromIncorrectOwner();
if (to == address(0)) revert TransferToZeroAddress();
unchecked {
--self._packedAddressData[from];
++self._packedAddressData[to];
self._packedOwnerships[tokenId] = _packOwnershipData(
to,
_BITMASK_NEXT_INITIALIZED | _nextExtraData(from, to, prevOwnershipPacked)
);
if (prevOwnershipPacked & _BITMASK_NEXT_INITIALIZED == 0) {
uint256 nextTokenId = tokenId + 1;
if (self._packedOwnerships[nextTokenId] == 0) {
if (nextTokenId != self._currentIndex) {
self._packedOwnerships[nextTokenId] = prevOwnershipPacked;
}
}
}
}
}
function _mint(PackableData storage self, address to, uint256 quantity) public returns (uint256) {
uint256 startTokenId = self._currentIndex;
if (quantity == 0) revert MintZeroQuantity();
unchecked {
self._packedAddressData[to] += quantity * ((1 << _BITPOS_NUMBER_MINTED) | 1);
self._packedOwnerships[startTokenId] = _packOwnershipData(
to,
_nextInitializedFlag(quantity) | _nextExtraData(address(0), to, 0)
);
uint256 toMasked;
uint256 end = startTokenId + quantity;
assembly {
toMasked := and(to, _BITMASK_ADDRESS)
log4(
0,
0,
_TRANSFER_EVENT_SIGNATURE,
0,
toMasked,
startTokenId
)
for {
let tokenId := add(startTokenId, 1)
} iszero(eq(tokenId, end)) {
tokenId := add(tokenId, 1)
} {
log4(0, 0, _TRANSFER_EVENT_SIGNATURE, 0, toMasked, tokenId)
}
}
if (toMasked == 0) revert MintToZeroAddress();
self._currentIndex = end;
}
return self._currentIndex;
}
function _burn(PackableData storage self, uint256 tokenId) public {
uint256 prevOwnershipPacked = _packedOwnershipOf(self,tokenId);
address from = address(uint160(prevOwnershipPacked));
unchecked {
self._packedAddressData[from] += (1 << _BITPOS_NUMBER_BURNED) - 1;
self._packedOwnerships[tokenId] = _packOwnershipData(
from,
(_BITMASK_BURNED | _BITMASK_NEXT_INITIALIZED) | _nextExtraData(from, address(0), prevOwnershipPacked)
);
if (prevOwnershipPacked & _BITMASK_NEXT_INITIALIZED == 0) {
uint256 nextTokenId = tokenId + 1;
if (self._packedOwnerships[nextTokenId] == 0) {
if (nextTokenId != self._currentIndex) {
self._packedOwnerships[nextTokenId] = prevOwnershipPacked;
}
}
}
}
unchecked {
self._burnCounter++;
}
}
function _setExtraDataAt(PackableData storage self, uint256 index, uint24 extraData) public {
uint256 packed = self._packedOwnerships[index];
if (packed == 0) revert OwnershipNotInitializedForExtraData();
uint256 extraDataCasted;
assembly {
extraDataCasted := extraData
}
packed = (packed & _BITMASK_EXTRA_DATA_COMPLEMENT) | (extraDataCasted << _BITPOS_EXTRA_DATA);
self._packedOwnerships[index] = packed;
}
function _extraData(
address from,
address to,
uint24 previousExtraData
) public view returns (uint24) {}
function _nextExtraData(
address from,
address to,
uint256 prevOwnershipPacked
) private view returns (uint256) {
uint24 extraData = uint24(prevOwnershipPacked >> _BITPOS_EXTRA_DATA);
return uint256(_extraData(from, to, extraData)) << _BITPOS_EXTRA_DATA;
}
function _toString(uint256 value) public pure returns (string memory str) {
assembly {
let m := add(mload(0x40), 0xa0)
mstore(0x40, m)
str := sub(m, 0x20)
mstore(str, 0)
let end := str
for { let temp := value } 1 {} {
str := sub(str, 1)
mstore8(str, add(48, mod(temp, 10)))
temp := div(temp, 10)
if iszero(temp) { break }
}
let length := sub(end, str)
str := sub(str, 0x20)
mstore(str, length)
}
}
}
文件 40 的 41:SetPhaseable.sol
pragma solidity ^0.8.17;
import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import "@openzeppelin/contracts/token/ERC1155/IERC1155.sol";
struct PhaseableData {
Phase[] phases;
uint256 activePhase;
uint256 maxSupply;
}
struct Phase {
string name;
uint256 maxPerWallet;
uint256 highestSupply;
uint256 cost;
}
error MintIsNotAllowedRightNow();
error ExceedsMaxSupply();
error PhaseNotActiveYet();
error PhaseExhausted();
error WalletMintsFilled(uint256 requested);
library SetPhaseable {
function initialize(PhaseableData storage self, Phase[] storage phases, uint256 maxSupply) public {
self.phases = phases;
self.activePhase = 0;
self.maxSupply = maxSupply;
}
function getMaxSupply(PhaseableData storage self) public view returns (uint256) {
return self.maxSupply;
}
function setMaxSupply(PhaseableData storage self, uint256 newMax) public {
self.maxSupply = newMax;
}
function getPhases(PhaseableData storage self) public view returns (Phase[] storage) {
return self.phases;
}
function getActivePhase(PhaseableData storage self) public view returns (uint256) {
return self.activePhase;
}
function findPhase(PhaseableData storage self, uint256 phaseId) public view returns (Phase memory) {
return self.phases[phaseId];
}
function startNextPhase(PhaseableData storage self) public {
self.activePhase += 1;
}
function revertPhase(PhaseableData storage self) public {
self.activePhase -= 1;
}
function addPhase(PhaseableData storage self,Phase calldata nextPhase) public {
self.phases.push(nextPhase);
}
}
文件 41 的 41:Strings.sol
pragma solidity ^0.8.0;
import "./math/Math.sol";
library Strings {
bytes16 private constant _SYMBOLS = "0123456789abcdef";
uint8 private constant _ADDRESS_LENGTH = 20;
function toString(uint256 value) internal pure returns (string memory) {
unchecked {
uint256 length = Math.log10(value) + 1;
string memory buffer = new string(length);
uint256 ptr;
assembly {
ptr := add(buffer, add(32, length))
}
while (true) {
ptr--;
assembly {
mstore8(ptr, byte(mod(value, 10), _SYMBOLS))
}
value /= 10;
if (value == 0) break;
}
return buffer;
}
}
function toHexString(uint256 value) internal pure returns (string memory) {
unchecked {
return toHexString(value, Math.log256(value) + 1);
}
}
function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {
bytes memory buffer = new bytes(2 * length + 2);
buffer[0] = "0";
buffer[1] = "x";
for (uint256 i = 2 * length + 1; i > 1; --i) {
buffer[i] = _SYMBOLS[value & 0xf];
value >>= 4;
}
require(value == 0, "Strings: hex length insufficient");
return string(buffer);
}
function toHexString(address addr) internal pure returns (string memory) {
return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);
}
}
{
"compilationTarget": {
"contracts/QueenApiens.sol": "QueenApiens"
},
"evmVersion": "london",
"libraries": {
"contracts/SetApprovable.sol:SetApprovable": "0x7fa62fbfadec6d3ef2466a2099c2ce2a3eab5054",
"contracts/SetAssignable.sol:SetAssignable": "0xd73931ea2ef71befb834db0c8080600de34b1d65",
"contracts/SetContractMetadataRenderable.sol:SetContractMetadataRenderable": "0xcaa55cf132dd96c6c6bcda8fd0e7dc7a9c2cf76b",
"contracts/SetFlexibleMetadata.sol:SetFlexibleMetadata": "0x8b7ca5ee8a73d7af9d0f7a9ecce560c1dadcdd4c",
"contracts/SetLockable.sol:SetLockable": "0x909f083384fe7348018feb48d5f75649754926c9",
"contracts/SetNameable.sol:SetNameable": "0x01f10576fcfa88b364d560e43a6a6179930d35f2",
"contracts/SetOwnerEnumerable.sol:SetOwnerEnumerable": "0x07d6f8f1ce76826703e01c265c82db49816cf25f",
"contracts/SetPackable.sol:SetPackable": "0x6c4aedeae04e78c8f0d45b8c2a24e9a297ca69a7",
"contracts/SetPhaseable.sol:SetPhaseable": "0x1cec8c525a588e22716216aa50afee49d61146e8"
},
"metadata": {
"bytecodeHash": "ipfs",
"useLiteralContent": true
},
"optimizer": {
"enabled": true,
"runs": 1
},
"remappings": []
}
[{"inputs":[{"internalType":"string","name":"name","type":"string"},{"internalType":"string","name":"symbol","type":"string"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"}],"name":"ApienAlreadyClaimed","type":"error"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"}],"name":"BagAlreadyClaimed","type":"error"},{"inputs":[{"internalType":"address","name":"caller","type":"address"}],"name":"CallerIsNotOwner","type":"error"},{"inputs":[],"name":"ContractIsNot721Receiver","type":"error"},{"inputs":[],"name":"ExceedsMaxSupply","type":"error"},{"inputs":[],"name":"InvalidOwner","type":"error"},{"inputs":[{"internalType":"uint256","name":"cost","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"InvalidPayment","type":"error"},{"inputs":[{"internalType":"address","name":"zero","type":"address"}],"name":"InvalidRecipient","type":"error"},{"inputs":[],"name":"InvalidTransferRecipient","type":"error"},{"inputs":[],"name":"MintIsNotAllowedRightNow","type":"error"},{"inputs":[],"name":"MintIsNotLive","type":"error"},{"inputs":[{"internalType":"address","name":"to","type":"address"}],"name":"NotAssigned","type":"error"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"NotInTreasury","type":"error"},{"inputs":[],"name":"NotTokenOwner","type":"error"},{"inputs":[{"internalType":"address","name":"operator","type":"address"}],"name":"OperatorNotAllowed","type":"error"},{"inputs":[],"name":"OwnerCannotBeZeroAddress","type":"error"},{"inputs":[],"name":"PhaseExhausted","type":"error"},{"inputs":[],"name":"PhaseNotActiveYet","type":"error"},{"inputs":[],"name":"TokenIsSoulBound","type":"error"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"TokenNonExistent","type":"error"},{"inputs":[{"internalType":"address","name":"requester","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"TokenNonOwner","type":"error"},{"inputs":[],"name":"WalletLockedByOwner","type":"error"},{"inputs":[{"internalType":"uint256","name":"requested","type":"uint256"}],"name":"WalletMintsFilled","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"approved","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"inputs":[],"name":"OPERATOR_FILTER_REGISTRY","outputs":[{"internalType":"contract IOperatorFilterRegistry","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"quantity","type":"uint256"},{"internalType":"bool","name":"enumerate","type":"bool"}],"name":"airdrop","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"address","name":"recipient","type":"address"}],"name":"airdropFromTreasury","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"quantity","type":"uint256"}],"name":"airdropToTreasury","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint64","name":"quantity","type":"uint64"},{"internalType":"bytes","name":"signature","type":"bytes"}],"name":"allowlistMint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"assignColdStorage","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"treasury","type":"address"}],"name":"assignFundRecipient","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"genesisBags","type":"uint256[]"},{"internalType":"bytes","name":"signature","type":"bytes"}],"name":"bagAllowMint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"seekingContract","type":"address"},{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"quantity","type":"uint256"}],"name":"bulkAirdrop","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"burn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"contractURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"}],"name":"custodianOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"empower","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"enableSecondarySales","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"enumeratedBalanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"findAssignments","outputs":[{"internalType":"address[]","name":"","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bool","name":"isFlagged","type":"bool"}],"name":"flagToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"stakedApiens","type":"uint256[]"},{"internalType":"uint256[]","name":"genesisBags","type":"uint256[]"},{"internalType":"bytes","name":"signature","type":"bytes"}],"name":"freeClaimMint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"phase","type":"uint256"}],"name":"getMintPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getSigningAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"address","name":"addressed","type":"address"}],"name":"hasBeenClaimed","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"}],"name":"isLocked","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isOwner","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"}],"name":"lockWallet","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"}],"name":"lockedSince","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"phaseId","type":"uint256"},{"internalType":"address","name":"minter","type":"address"}],"name":"mintedInPhase","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"nextPhase","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"minter","type":"address"}],"name":"numberMinted","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"previousPhase","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint64","name":"quantity","type":"uint64"}],"name":"publicMint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"bytes","name":"sig","type":"bytes"},{"internalType":"address","name":"recip","type":"address"}],"name":"recoverAllowAddress","outputs":[{"components":[{"internalType":"address","name":"receipient","type":"address"},{"internalType":"bytes","name":"signature","type":"bytes"},{"internalType":"address","name":"recovered","type":"address"},{"internalType":"address","name":"signingKey","type":"address"}],"internalType":"struct EIP712Allowlisting.recovered","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes","name":"sig","type":"bytes"},{"internalType":"address","name":"recip","type":"address"},{"internalType":"uint256[]","name":"bag","type":"uint256[]"}],"name":"recoverClaimSig","outputs":[{"components":[{"internalType":"address","name":"receipient","type":"address"},{"internalType":"bytes","name":"signature","type":"bytes"},{"internalType":"address","name":"recovered","type":"address"},{"internalType":"address","name":"signingKey","type":"address"},{"internalType":"string","name":"bagging","type":"string"},{"internalType":"uint256","name":"total","type":"uint256"}],"internalType":"struct EIP712Allowlisting.recoveredBag","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes","name":"sig","type":"bytes"},{"internalType":"address","name":"recip","type":"address"},{"internalType":"uint256[]","name":"bag","type":"uint256[]"},{"internalType":"uint256[]","name":"staked","type":"uint256[]"}],"name":"recoverClaimSig","outputs":[{"components":[{"internalType":"address","name":"receipient","type":"address"},{"internalType":"bytes","name":"signature","type":"bytes"},{"internalType":"address","name":"recovered","type":"address"},{"internalType":"address","name":"signingKey","type":"address"},{"internalType":"string","name":"bagging","type":"string"},{"internalType":"uint256","name":"total","type":"uint256"}],"internalType":"struct EIP712Allowlisting.recoveredBag","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"_reveal","type":"bool"}],"name":"reveal","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"revokeAssignments","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"revokeColdStorage","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes","name":"imageUri","type":"bytes"}],"name":"setContractProfileImage","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"recipient","type":"address"}],"name":"setContractRoyaltyRecipient","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"uri","type":"string"}],"name":"setContractUri","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"address","name":"custodianAddress","type":"address"}],"name":"setCustodian","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"_isLive","type":"bool"}],"name":"setMintLive","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"phase","type":"uint256"},{"internalType":"uint256","name":"price","type":"uint256"}],"name":"setMintPrice","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"royalty_basis","type":"uint256"}],"name":"setRoyaltyBasis","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_sigKey","type":"address"}],"name":"setSigningAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"key","type":"string"},{"internalType":"string","name":"uri","type":"string"}],"name":"setSupplementalTokenUri","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"uri","type":"string"},{"internalType":"uint256","name":"tokenType","type":"uint256"}],"name":"setTokenUri","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"holder","type":"address"}],"name":"tokensOwnedBy","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"}],"name":"unlockWallet","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"withdrawFunds","outputs":[],"stateMutability":"nonpayable","type":"function"}]