Source Code
Overview
ETH Balance
0 ETH
Eth Value
$0.00More Info
Private Name Tags
ContractCreator
TokenTracker
Latest 25 from a total of 284 transactions
| Transaction Hash |
Method
|
Block
|
From
|
|
To
|
||||
|---|---|---|---|---|---|---|---|---|---|
| Set Approval For... | 24012769 | 4 days ago | IN | 0 ETH | 0.00000235 | ||||
| Set Approval For... | 23419231 | 87 days ago | IN | 0 ETH | 0.00003301 | ||||
| Mint | 23414016 | 88 days ago | IN | 0 ETH | 0.00001975 | ||||
| Mint | 23413338 | 88 days ago | IN | 0 ETH | 0.00003579 | ||||
| Mint | 23412688 | 88 days ago | IN | 0 ETH | 0.0000845 | ||||
| Mint | 23412684 | 88 days ago | IN | 0 ETH | 0.00009534 | ||||
| Transfer From | 23401321 | 90 days ago | IN | 0 ETH | 0.0000135 | ||||
| Transfer From | 23401319 | 90 days ago | IN | 0 ETH | 0.00002638 | ||||
| Set Approval For... | 23308447 | 103 days ago | IN | 0 ETH | 0.00000738 | ||||
| Set Approval For... | 23256563 | 110 days ago | IN | 0 ETH | 0.00001029 | ||||
| Set Approval For... | 23253830 | 110 days ago | IN | 0 ETH | 0.00001424 | ||||
| Set Approval For... | 23251577 | 111 days ago | IN | 0 ETH | 0.00000922 | ||||
| Mint | 23251561 | 111 days ago | IN | 0 ETH | 0.00002359 | ||||
| Set Approval For... | 23251474 | 111 days ago | IN | 0 ETH | 0.00000795 | ||||
| Mint | 23251470 | 111 days ago | IN | 0 ETH | 0.00002158 | ||||
| Set Approval For... | 23251156 | 111 days ago | IN | 0 ETH | 0.00001157 | ||||
| Mint | 23251146 | 111 days ago | IN | 0 ETH | 0.0000296 | ||||
| Set Approval For... | 23251058 | 111 days ago | IN | 0 ETH | 0.00001107 | ||||
| Mint | 23251057 | 111 days ago | IN | 0 ETH | 0.00002241 | ||||
| Mint | 23251051 | 111 days ago | IN | 0 ETH | 0.0000283 | ||||
| Mint | 23250461 | 111 days ago | IN | 0 ETH | 0.00005817 | ||||
| Set Approval For... | 23250011 | 111 days ago | IN | 0 ETH | 0.00001245 | ||||
| Mint | 23249946 | 111 days ago | IN | 0 ETH | 0.00003774 | ||||
| Mint | 23249330 | 111 days ago | IN | 0 ETH | 0.00004767 | ||||
| Mint | 23248545 | 111 days ago | IN | 0 ETH | 0.00006016 |
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
Cross-Chain Transactions
Loading...
Loading
Contract Name:
ANAGLYPHPUNKS
Compiler Version
v0.8.26+commit.8a97fa7a
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// File: @openzeppelin/contracts/utils/cryptography/Hashes.sol
// OpenZeppelin Contracts (last updated v5.3.0) (utils/cryptography/Hashes.sol)
pragma solidity ^0.8.20;
/**
* @dev Library of standard hash functions.
*
* _Available since v5.1._
*/
library Hashes {
/**
* @dev Commutative Keccak256 hash of a sorted pair of bytes32. Frequently used when working with merkle proofs.
*
* NOTE: Equivalent to the `standardNodeHash` in our https://github.com/OpenZeppelin/merkle-tree[JavaScript library].
*/
function commutativeKeccak256(bytes32 a, bytes32 b) internal pure returns (bytes32) {
return a < b ? efficientKeccak256(a, b) : efficientKeccak256(b, a);
}
/**
* @dev Implementation of keccak256(abi.encode(a, b)) that doesn't allocate or expand memory.
*/
function efficientKeccak256(bytes32 a, bytes32 b) internal pure returns (bytes32 value) {
assembly ("memory-safe") {
mstore(0x00, a)
mstore(0x20, b)
value := keccak256(0x00, 0x40)
}
}
}
// File: @openzeppelin/contracts/utils/cryptography/MerkleProof.sol
// OpenZeppelin Contracts (last updated v5.1.0) (utils/cryptography/MerkleProof.sol)
// This file was procedurally generated from scripts/generate/templates/MerkleProof.js.
pragma solidity ^0.8.20;
/**
* @dev These functions deal with verification of Merkle Tree proofs.
*
* The tree and the proofs can be generated using our
* https://github.com/OpenZeppelin/merkle-tree[JavaScript library].
* You will find a quickstart guide in the readme.
*
* WARNING: You should avoid using leaf values that are 64 bytes long prior to
* hashing, or use a hash function other than keccak256 for hashing leaves.
* This is because the concatenation of a sorted pair of internal nodes in
* the Merkle tree could be reinterpreted as a leaf value.
* OpenZeppelin's JavaScript library generates Merkle trees that are safe
* against this attack out of the box.
*
* IMPORTANT: Consider memory side-effects when using custom hashing functions
* that access memory in an unsafe way.
*
* NOTE: This library supports proof verification for merkle trees built using
* custom _commutative_ hashing functions (i.e. `H(a, b) == H(b, a)`). Proving
* leaf inclusion in trees built using non-commutative hashing functions requires
* additional logic that is not supported by this library.
*/
library MerkleProof {
/**
*@dev The multiproof provided is not valid.
*/
error MerkleProofInvalidMultiproof();
/**
* @dev Returns true if a `leaf` can be proved to be a part of a Merkle tree
* defined by `root`. For this, a `proof` must be provided, containing
* sibling hashes on the branch from the leaf to the root of the tree. Each
* pair of leaves and each pair of pre-images are assumed to be sorted.
*
* This version handles proofs in memory with the default hashing function.
*/
function verify(bytes32[] memory proof, bytes32 root, bytes32 leaf) internal pure returns (bool) {
return processProof(proof, leaf) == root;
}
/**
* @dev Returns the rebuilt hash obtained by traversing a Merkle tree up
* from `leaf` using `proof`. A `proof` is valid if and only if the rebuilt
* hash matches the root of the tree. When processing the proof, the pairs
* of leaves & pre-images are assumed to be sorted.
*
* This version handles proofs in memory with the default hashing function.
*/
function processProof(bytes32[] memory proof, bytes32 leaf) internal pure returns (bytes32) {
bytes32 computedHash = leaf;
for (uint256 i = 0; i < proof.length; i++) {
computedHash = Hashes.commutativeKeccak256(computedHash, proof[i]);
}
return computedHash;
}
/**
* @dev Returns true if a `leaf` can be proved to be a part of a Merkle tree
* defined by `root`. For this, a `proof` must be provided, containing
* sibling hashes on the branch from the leaf to the root of the tree. Each
* pair of leaves and each pair of pre-images are assumed to be sorted.
*
* This version handles proofs in memory with a custom hashing function.
*/
function verify(
bytes32[] memory proof,
bytes32 root,
bytes32 leaf,
function(bytes32, bytes32) view returns (bytes32) hasher
) internal view returns (bool) {
return processProof(proof, leaf, hasher) == root;
}
/**
* @dev Returns the rebuilt hash obtained by traversing a Merkle tree up
* from `leaf` using `proof`. A `proof` is valid if and only if the rebuilt
* hash matches the root of the tree. When processing the proof, the pairs
* of leaves & pre-images are assumed to be sorted.
*
* This version handles proofs in memory with a custom hashing function.
*/
function processProof(
bytes32[] memory proof,
bytes32 leaf,
function(bytes32, bytes32) view returns (bytes32) hasher
) internal view returns (bytes32) {
bytes32 computedHash = leaf;
for (uint256 i = 0; i < proof.length; i++) {
computedHash = hasher(computedHash, proof[i]);
}
return computedHash;
}
/**
* @dev Returns true if a `leaf` can be proved to be a part of a Merkle tree
* defined by `root`. For this, a `proof` must be provided, containing
* sibling hashes on the branch from the leaf to the root of the tree. Each
* pair of leaves and each pair of pre-images are assumed to be sorted.
*
* This version handles proofs in calldata with the default hashing function.
*/
function verifyCalldata(bytes32[] calldata proof, bytes32 root, bytes32 leaf) internal pure returns (bool) {
return processProofCalldata(proof, leaf) == root;
}
/**
* @dev Returns the rebuilt hash obtained by traversing a Merkle tree up
* from `leaf` using `proof`. A `proof` is valid if and only if the rebuilt
* hash matches the root of the tree. When processing the proof, the pairs
* of leaves & pre-images are assumed to be sorted.
*
* This version handles proofs in calldata with the default hashing function.
*/
function processProofCalldata(bytes32[] calldata proof, bytes32 leaf) internal pure returns (bytes32) {
bytes32 computedHash = leaf;
for (uint256 i = 0; i < proof.length; i++) {
computedHash = Hashes.commutativeKeccak256(computedHash, proof[i]);
}
return computedHash;
}
/**
* @dev Returns true if a `leaf` can be proved to be a part of a Merkle tree
* defined by `root`. For this, a `proof` must be provided, containing
* sibling hashes on the branch from the leaf to the root of the tree. Each
* pair of leaves and each pair of pre-images are assumed to be sorted.
*
* This version handles proofs in calldata with a custom hashing function.
*/
function verifyCalldata(
bytes32[] calldata proof,
bytes32 root,
bytes32 leaf,
function(bytes32, bytes32) view returns (bytes32) hasher
) internal view returns (bool) {
return processProofCalldata(proof, leaf, hasher) == root;
}
/**
* @dev Returns the rebuilt hash obtained by traversing a Merkle tree up
* from `leaf` using `proof`. A `proof` is valid if and only if the rebuilt
* hash matches the root of the tree. When processing the proof, the pairs
* of leaves & pre-images are assumed to be sorted.
*
* This version handles proofs in calldata with a custom hashing function.
*/
function processProofCalldata(
bytes32[] calldata proof,
bytes32 leaf,
function(bytes32, bytes32) view returns (bytes32) hasher
) internal view returns (bytes32) {
bytes32 computedHash = leaf;
for (uint256 i = 0; i < proof.length; i++) {
computedHash = hasher(computedHash, proof[i]);
}
return computedHash;
}
/**
* @dev Returns true if the `leaves` can be simultaneously proven to be a part of a Merkle tree defined by
* `root`, according to `proof` and `proofFlags` as described in {processMultiProof}.
*
* This version handles multiproofs in memory with the default hashing function.
*
* CAUTION: Not all Merkle trees admit multiproofs. See {processMultiProof} for details.
*
* NOTE: Consider the case where `root == proof[0] && leaves.length == 0` as it will return `true`.
* The `leaves` must be validated independently. See {processMultiProof}.
*/
function multiProofVerify(
bytes32[] memory proof,
bool[] memory proofFlags,
bytes32 root,
bytes32[] memory leaves
) internal pure returns (bool) {
return processMultiProof(proof, proofFlags, leaves) == root;
}
/**
* @dev Returns the root of a tree reconstructed from `leaves` and sibling nodes in `proof`. The reconstruction
* proceeds by incrementally reconstructing all inner nodes by combining a leaf/inner node with either another
* leaf/inner node or a proof sibling node, depending on whether each `proofFlags` item is true or false
* respectively.
*
* This version handles multiproofs in memory with the default hashing function.
*
* CAUTION: Not all Merkle trees admit multiproofs. To use multiproofs, it is sufficient to ensure that: 1) the tree
* is complete (but not necessarily perfect), 2) the leaves to be proven are in the opposite order they are in the
* tree (i.e., as seen from right to left starting at the deepest layer and continuing at the next layer).
*
* NOTE: The _empty set_ (i.e. the case where `proof.length == 1 && leaves.length == 0`) is considered a no-op,
* and therefore a valid multiproof (i.e. it returns `proof[0]`). Consider disallowing this case if you're not
* validating the leaves elsewhere.
*/
function processMultiProof(
bytes32[] memory proof,
bool[] memory proofFlags,
bytes32[] memory leaves
) internal pure returns (bytes32 merkleRoot) {
// This function rebuilds the root hash by traversing the tree up from the leaves. The root is rebuilt by
// consuming and producing values on a queue. The queue starts with the `leaves` array, then goes onto the
// `hashes` array. At the end of the process, the last hash in the `hashes` array should contain the root of
// the Merkle tree.
uint256 leavesLen = leaves.length;
uint256 proofFlagsLen = proofFlags.length;
// Check proof validity.
if (leavesLen + proof.length != proofFlagsLen + 1) {
revert MerkleProofInvalidMultiproof();
}
// The xxxPos values are "pointers" to the next value to consume in each array. All accesses are done using
// `xxx[xxxPos++]`, which return the current value and increment the pointer, thus mimicking a queue's "pop".
bytes32[] memory hashes = new bytes32[](proofFlagsLen);
uint256 leafPos = 0;
uint256 hashPos = 0;
uint256 proofPos = 0;
// At each step, we compute the next hash using two values:
// - a value from the "main queue". If not all leaves have been consumed, we get the next leaf, otherwise we
// get the next hash.
// - depending on the flag, either another value from the "main queue" (merging branches) or an element from the
// `proof` array.
for (uint256 i = 0; i < proofFlagsLen; i++) {
bytes32 a = leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++];
bytes32 b = proofFlags[i]
? (leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++])
: proof[proofPos++];
hashes[i] = Hashes.commutativeKeccak256(a, b);
}
if (proofFlagsLen > 0) {
if (proofPos != proof.length) {
revert MerkleProofInvalidMultiproof();
}
unchecked {
return hashes[proofFlagsLen - 1];
}
} else if (leavesLen > 0) {
return leaves[0];
} else {
return proof[0];
}
}
/**
* @dev Returns true if the `leaves` can be simultaneously proven to be a part of a Merkle tree defined by
* `root`, according to `proof` and `proofFlags` as described in {processMultiProof}.
*
* This version handles multiproofs in memory with a custom hashing function.
*
* CAUTION: Not all Merkle trees admit multiproofs. See {processMultiProof} for details.
*
* NOTE: Consider the case where `root == proof[0] && leaves.length == 0` as it will return `true`.
* The `leaves` must be validated independently. See {processMultiProof}.
*/
function multiProofVerify(
bytes32[] memory proof,
bool[] memory proofFlags,
bytes32 root,
bytes32[] memory leaves,
function(bytes32, bytes32) view returns (bytes32) hasher
) internal view returns (bool) {
return processMultiProof(proof, proofFlags, leaves, hasher) == root;
}
/**
* @dev Returns the root of a tree reconstructed from `leaves` and sibling nodes in `proof`. The reconstruction
* proceeds by incrementally reconstructing all inner nodes by combining a leaf/inner node with either another
* leaf/inner node or a proof sibling node, depending on whether each `proofFlags` item is true or false
* respectively.
*
* This version handles multiproofs in memory with a custom hashing function.
*
* CAUTION: Not all Merkle trees admit multiproofs. To use multiproofs, it is sufficient to ensure that: 1) the tree
* is complete (but not necessarily perfect), 2) the leaves to be proven are in the opposite order they are in the
* tree (i.e., as seen from right to left starting at the deepest layer and continuing at the next layer).
*
* NOTE: The _empty set_ (i.e. the case where `proof.length == 1 && leaves.length == 0`) is considered a no-op,
* and therefore a valid multiproof (i.e. it returns `proof[0]`). Consider disallowing this case if you're not
* validating the leaves elsewhere.
*/
function processMultiProof(
bytes32[] memory proof,
bool[] memory proofFlags,
bytes32[] memory leaves,
function(bytes32, bytes32) view returns (bytes32) hasher
) internal view returns (bytes32 merkleRoot) {
// This function rebuilds the root hash by traversing the tree up from the leaves. The root is rebuilt by
// consuming and producing values on a queue. The queue starts with the `leaves` array, then goes onto the
// `hashes` array. At the end of the process, the last hash in the `hashes` array should contain the root of
// the Merkle tree.
uint256 leavesLen = leaves.length;
uint256 proofFlagsLen = proofFlags.length;
// Check proof validity.
if (leavesLen + proof.length != proofFlagsLen + 1) {
revert MerkleProofInvalidMultiproof();
}
// The xxxPos values are "pointers" to the next value to consume in each array. All accesses are done using
// `xxx[xxxPos++]`, which return the current value and increment the pointer, thus mimicking a queue's "pop".
bytes32[] memory hashes = new bytes32[](proofFlagsLen);
uint256 leafPos = 0;
uint256 hashPos = 0;
uint256 proofPos = 0;
// At each step, we compute the next hash using two values:
// - a value from the "main queue". If not all leaves have been consumed, we get the next leaf, otherwise we
// get the next hash.
// - depending on the flag, either another value from the "main queue" (merging branches) or an element from the
// `proof` array.
for (uint256 i = 0; i < proofFlagsLen; i++) {
bytes32 a = leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++];
bytes32 b = proofFlags[i]
? (leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++])
: proof[proofPos++];
hashes[i] = hasher(a, b);
}
if (proofFlagsLen > 0) {
if (proofPos != proof.length) {
revert MerkleProofInvalidMultiproof();
}
unchecked {
return hashes[proofFlagsLen - 1];
}
} else if (leavesLen > 0) {
return leaves[0];
} else {
return proof[0];
}
}
/**
* @dev Returns true if the `leaves` can be simultaneously proven to be a part of a Merkle tree defined by
* `root`, according to `proof` and `proofFlags` as described in {processMultiProof}.
*
* This version handles multiproofs in calldata with the default hashing function.
*
* CAUTION: Not all Merkle trees admit multiproofs. See {processMultiProof} for details.
*
* NOTE: Consider the case where `root == proof[0] && leaves.length == 0` as it will return `true`.
* The `leaves` must be validated independently. See {processMultiProofCalldata}.
*/
function multiProofVerifyCalldata(
bytes32[] calldata proof,
bool[] calldata proofFlags,
bytes32 root,
bytes32[] memory leaves
) internal pure returns (bool) {
return processMultiProofCalldata(proof, proofFlags, leaves) == root;
}
/**
* @dev Returns the root of a tree reconstructed from `leaves` and sibling nodes in `proof`. The reconstruction
* proceeds by incrementally reconstructing all inner nodes by combining a leaf/inner node with either another
* leaf/inner node or a proof sibling node, depending on whether each `proofFlags` item is true or false
* respectively.
*
* This version handles multiproofs in calldata with the default hashing function.
*
* CAUTION: Not all Merkle trees admit multiproofs. To use multiproofs, it is sufficient to ensure that: 1) the tree
* is complete (but not necessarily perfect), 2) the leaves to be proven are in the opposite order they are in the
* tree (i.e., as seen from right to left starting at the deepest layer and continuing at the next layer).
*
* NOTE: The _empty set_ (i.e. the case where `proof.length == 1 && leaves.length == 0`) is considered a no-op,
* and therefore a valid multiproof (i.e. it returns `proof[0]`). Consider disallowing this case if you're not
* validating the leaves elsewhere.
*/
function processMultiProofCalldata(
bytes32[] calldata proof,
bool[] calldata proofFlags,
bytes32[] memory leaves
) internal pure returns (bytes32 merkleRoot) {
// This function rebuilds the root hash by traversing the tree up from the leaves. The root is rebuilt by
// consuming and producing values on a queue. The queue starts with the `leaves` array, then goes onto the
// `hashes` array. At the end of the process, the last hash in the `hashes` array should contain the root of
// the Merkle tree.
uint256 leavesLen = leaves.length;
uint256 proofFlagsLen = proofFlags.length;
// Check proof validity.
if (leavesLen + proof.length != proofFlagsLen + 1) {
revert MerkleProofInvalidMultiproof();
}
// The xxxPos values are "pointers" to the next value to consume in each array. All accesses are done using
// `xxx[xxxPos++]`, which return the current value and increment the pointer, thus mimicking a queue's "pop".
bytes32[] memory hashes = new bytes32[](proofFlagsLen);
uint256 leafPos = 0;
uint256 hashPos = 0;
uint256 proofPos = 0;
// At each step, we compute the next hash using two values:
// - a value from the "main queue". If not all leaves have been consumed, we get the next leaf, otherwise we
// get the next hash.
// - depending on the flag, either another value from the "main queue" (merging branches) or an element from the
// `proof` array.
for (uint256 i = 0; i < proofFlagsLen; i++) {
bytes32 a = leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++];
bytes32 b = proofFlags[i]
? (leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++])
: proof[proofPos++];
hashes[i] = Hashes.commutativeKeccak256(a, b);
}
if (proofFlagsLen > 0) {
if (proofPos != proof.length) {
revert MerkleProofInvalidMultiproof();
}
unchecked {
return hashes[proofFlagsLen - 1];
}
} else if (leavesLen > 0) {
return leaves[0];
} else {
return proof[0];
}
}
/**
* @dev Returns true if the `leaves` can be simultaneously proven to be a part of a Merkle tree defined by
* `root`, according to `proof` and `proofFlags` as described in {processMultiProof}.
*
* This version handles multiproofs in calldata with a custom hashing function.
*
* CAUTION: Not all Merkle trees admit multiproofs. See {processMultiProof} for details.
*
* NOTE: Consider the case where `root == proof[0] && leaves.length == 0` as it will return `true`.
* The `leaves` must be validated independently. See {processMultiProofCalldata}.
*/
function multiProofVerifyCalldata(
bytes32[] calldata proof,
bool[] calldata proofFlags,
bytes32 root,
bytes32[] memory leaves,
function(bytes32, bytes32) view returns (bytes32) hasher
) internal view returns (bool) {
return processMultiProofCalldata(proof, proofFlags, leaves, hasher) == root;
}
/**
* @dev Returns the root of a tree reconstructed from `leaves` and sibling nodes in `proof`. The reconstruction
* proceeds by incrementally reconstructing all inner nodes by combining a leaf/inner node with either another
* leaf/inner node or a proof sibling node, depending on whether each `proofFlags` item is true or false
* respectively.
*
* This version handles multiproofs in calldata with a custom hashing function.
*
* CAUTION: Not all Merkle trees admit multiproofs. To use multiproofs, it is sufficient to ensure that: 1) the tree
* is complete (but not necessarily perfect), 2) the leaves to be proven are in the opposite order they are in the
* tree (i.e., as seen from right to left starting at the deepest layer and continuing at the next layer).
*
* NOTE: The _empty set_ (i.e. the case where `proof.length == 1 && leaves.length == 0`) is considered a no-op,
* and therefore a valid multiproof (i.e. it returns `proof[0]`). Consider disallowing this case if you're not
* validating the leaves elsewhere.
*/
function processMultiProofCalldata(
bytes32[] calldata proof,
bool[] calldata proofFlags,
bytes32[] memory leaves,
function(bytes32, bytes32) view returns (bytes32) hasher
) internal view returns (bytes32 merkleRoot) {
// This function rebuilds the root hash by traversing the tree up from the leaves. The root is rebuilt by
// consuming and producing values on a queue. The queue starts with the `leaves` array, then goes onto the
// `hashes` array. At the end of the process, the last hash in the `hashes` array should contain the root of
// the Merkle tree.
uint256 leavesLen = leaves.length;
uint256 proofFlagsLen = proofFlags.length;
// Check proof validity.
if (leavesLen + proof.length != proofFlagsLen + 1) {
revert MerkleProofInvalidMultiproof();
}
// The xxxPos values are "pointers" to the next value to consume in each array. All accesses are done using
// `xxx[xxxPos++]`, which return the current value and increment the pointer, thus mimicking a queue's "pop".
bytes32[] memory hashes = new bytes32[](proofFlagsLen);
uint256 leafPos = 0;
uint256 hashPos = 0;
uint256 proofPos = 0;
// At each step, we compute the next hash using two values:
// - a value from the "main queue". If not all leaves have been consumed, we get the next leaf, otherwise we
// get the next hash.
// - depending on the flag, either another value from the "main queue" (merging branches) or an element from the
// `proof` array.
for (uint256 i = 0; i < proofFlagsLen; i++) {
bytes32 a = leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++];
bytes32 b = proofFlags[i]
? (leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++])
: proof[proofPos++];
hashes[i] = hasher(a, b);
}
if (proofFlagsLen > 0) {
if (proofPos != proof.length) {
revert MerkleProofInvalidMultiproof();
}
unchecked {
return hashes[proofFlagsLen - 1];
}
} else if (leavesLen > 0) {
return leaves[0];
} else {
return proof[0];
}
}
}
// File: contract.sol
/**
*Submitted for verification at basescan.org on 2025-03-01
*/
/**
*Submitted for verification at basescan.org on 2025-02-21
*/
// File: @openzeppelin/contracts/utils/Context.sol
// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)
pragma solidity ^0.8.20;
/**
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
function _contextSuffixLength() internal view virtual returns (uint256) {
return 0;
}
}
// File: .deps/github/limitbreakinc/creator-token-contracts/contracts/access/OwnablePermissions.sol
pragma solidity ^0.8.4;
abstract contract OwnablePermissions is Context {
function _requireCallerIsContractOwner() internal view virtual;
}
// File: @openzeppelin/contracts/access/Ownable.sol
// OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol)
pragma solidity ^0.8.20;
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* The initial owner is set to the address provided by the deployer. This can
* later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
abstract contract Ownable is Context {
address private _owner;
/**
* @dev The caller account is not authorized to perform an operation.
*/
error OwnableUnauthorizedAccount(address account);
/**
* @dev The owner is not a valid owner account. (eg. `address(0)`)
*/
error OwnableInvalidOwner(address owner);
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the address provided by the deployer as the initial owner.
*/
constructor(address initialOwner) {
if (initialOwner == address(0)) {
revert OwnableInvalidOwner(address(0));
}
_transferOwnership(initialOwner);
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
_checkOwner();
_;
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
return _owner;
}
/**
* @dev Throws if the sender is not the owner.
*/
function _checkOwner() internal view virtual {
if (owner() != _msgSender()) {
revert OwnableUnauthorizedAccount(_msgSender());
}
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby disabling any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
_transferOwnership(address(0));
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
if (newOwner == address(0)) {
revert OwnableInvalidOwner(address(0));
}
_transferOwnership(newOwner);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Internal function without access restriction.
*/
function _transferOwnership(address newOwner) internal virtual {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}
// File: .deps/github/limitbreakinc/creator-token-contracts/contracts/access/OwnableBasic.sol
pragma solidity ^0.8.4;
abstract contract OwnableBasic is OwnablePermissions, Ownable(0x4c08Fc1070eee577E8E9Ab8dd87D033857bd7b10) {
function _requireCallerIsContractOwner() internal view virtual override {
_checkOwner();
}
}
// File: @openzeppelin/contracts/utils/introspection/IERC165.sol
// OpenZeppelin Contracts (last updated v5.1.0) (utils/introspection/IERC165.sol)
pragma solidity ^0.8.20;
/**
* @dev Interface of the ERC-165 standard, as defined in the
* https://eips.ethereum.org/EIPS/eip-165[ERC].
*
* Implementers can declare support of contract interfaces, which can then be
* queried by others ({ERC165Checker}).
*
* For an implementation, see {ERC165}.
*/
interface IERC165 {
/**
* @dev Returns true if this contract implements the interface defined by
* `interfaceId`. See the corresponding
* https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[ERC section]
* to learn more about how these ids are created.
*
* This function call must use less than 30 000 gas.
*/
function supportsInterface(bytes4 interfaceId) external view returns (bool);
}
// File: .deps/github/limitbreakinc/creator-token-contracts/contracts/interfaces/IEOARegistry.sol
pragma solidity ^0.8.4;
interface IEOARegistry is IERC165 {
function isVerifiedEOA(address account) external view returns (bool);
}
// File: .deps/github/limitbreakinc/creator-token-contracts/contracts/utils/TransferPolicy.sol
pragma solidity ^0.8.4;
enum AllowlistTypes {
Operators,
PermittedContractReceivers
}
enum ReceiverConstraints {
None,
NoCode,
EOA
}
enum CallerConstraints {
None,
OperatorWhitelistEnableOTC,
OperatorWhitelistDisableOTC
}
enum StakerConstraints {
None,
CallerIsTxOrigin,
EOA
}
enum TransferSecurityLevels {
Zero,
One,
Two,
Three,
Four,
Five,
Six
}
struct TransferSecurityPolicy {
CallerConstraints callerConstraints;
ReceiverConstraints receiverConstraints;
}
struct CollectionSecurityPolicy {
TransferSecurityLevels transferSecurityLevel;
uint120 operatorWhitelistId;
uint120 permittedContractReceiversId;
}
// File: .deps/github/limitbreakinc/creator-token-contracts/contracts/interfaces/ITransferSecurityRegistry.sol
pragma solidity ^0.8.4;
interface ITransferSecurityRegistry {
event AddedToAllowlist(AllowlistTypes indexed kind, uint256 indexed id, address indexed account);
event CreatedAllowlist(AllowlistTypes indexed kind, uint256 indexed id, string indexed name);
event ReassignedAllowlistOwnership(AllowlistTypes indexed kind, uint256 indexed id, address indexed newOwner);
event RemovedFromAllowlist(AllowlistTypes indexed kind, uint256 indexed id, address indexed account);
event SetAllowlist(AllowlistTypes indexed kind, address indexed collection, uint120 indexed id);
event SetTransferSecurityLevel(address indexed collection, TransferSecurityLevels level);
function createOperatorWhitelist(string calldata name) external returns (uint120);
function createPermittedContractReceiverAllowlist(string calldata name) external returns (uint120);
function reassignOwnershipOfOperatorWhitelist(uint120 id, address newOwner) external;
function reassignOwnershipOfPermittedContractReceiverAllowlist(uint120 id, address newOwner) external;
function renounceOwnershipOfOperatorWhitelist(uint120 id) external;
function renounceOwnershipOfPermittedContractReceiverAllowlist(uint120 id) external;
function setTransferSecurityLevelOfCollection(address collection, TransferSecurityLevels level) external;
function setOperatorWhitelistOfCollection(address collection, uint120 id) external;
function setPermittedContractReceiverAllowlistOfCollection(address collection, uint120 id) external;
function addOperatorToWhitelist(uint120 id, address operator) external;
function addPermittedContractReceiverToAllowlist(uint120 id, address receiver) external;
function removeOperatorFromWhitelist(uint120 id, address operator) external;
function removePermittedContractReceiverFromAllowlist(uint120 id, address receiver) external;
function getCollectionSecurityPolicy(address collection) external view returns (CollectionSecurityPolicy memory);
function getWhitelistedOperators(uint120 id) external view returns (address[] memory);
function getPermittedContractReceivers(uint120 id) external view returns (address[] memory);
function isOperatorWhitelisted(uint120 id, address operator) external view returns (bool);
function isContractReceiverPermitted(uint120 id, address receiver) external view returns (bool);
}
// File: .deps/github/limitbreakinc/creator-token-contracts/contracts/interfaces/ITransferValidator.sol
pragma solidity ^0.8.4;
interface ITransferValidator {
function applyCollectionTransferPolicy(address caller, address from, address to) external view;
}
// File: .deps/github/limitbreakinc/creator-token-contracts/contracts/interfaces/ICreatorTokenTransferValidator.sol
pragma solidity ^0.8.4;
interface ICreatorTokenTransferValidator is ITransferSecurityRegistry, ITransferValidator, IEOARegistry {}
// File: .deps/github/limitbreakinc/creator-token-contracts/contracts/interfaces/ICreatorToken.sol
pragma solidity ^0.8.4;
interface ICreatorToken {
event TransferValidatorUpdated(address oldValidator, address newValidator);
function getTransferValidator() external view returns (ICreatorTokenTransferValidator);
function getSecurityPolicy() external view returns (CollectionSecurityPolicy memory);
function getWhitelistedOperators() external view returns (address[] memory);
function getPermittedContractReceivers() external view returns (address[] memory);
function isOperatorWhitelisted(address operator) external view returns (bool);
function isContractReceiverPermitted(address receiver) external view returns (bool);
function isTransferAllowed(address caller, address from, address to) external view returns (bool);
}
// File: .deps/github/limitbreakinc/creator-token-contracts/contracts/utils/TransferValidation.sol
pragma solidity ^0.8.4;
/**
* @title TransferValidation
* @author Limit Break, Inc.
* @notice A mix-in that can be combined with ERC-721 contracts to provide more granular hooks.
* Openzeppelin's ERC721 contract only provides hooks for before and after transfer. This allows
* developers to validate or customize transfers within the context of a mint, a burn, or a transfer.
*/
abstract contract TransferValidation is Context {
error ShouldNotMintToBurnAddress();
/// @dev Inheriting contracts should call this function in the _beforeTokenTransfer function to get more granular hooks.
function _validateBeforeTransfer(address from, address to, uint256 tokenId) internal virtual {
bool fromZeroAddress = from == address(0);
bool toZeroAddress = to == address(0);
if(fromZeroAddress && toZeroAddress) {
revert ShouldNotMintToBurnAddress();
} else if(fromZeroAddress) {
_preValidateMint(_msgSender(), to, tokenId, msg.value);
} else if(toZeroAddress) {
_preValidateBurn(_msgSender(), from, tokenId, msg.value);
} else {
_preValidateTransfer(_msgSender(), from, to, tokenId, msg.value);
}
}
/// @dev Inheriting contracts should call this function in the _afterTokenTransfer function to get more granular hooks.
function _validateAfterTransfer(address from, address to, uint256 tokenId) internal virtual {
bool fromZeroAddress = from == address(0);
bool toZeroAddress = to == address(0);
if(fromZeroAddress && toZeroAddress) {
revert ShouldNotMintToBurnAddress();
} else if(fromZeroAddress) {
_postValidateMint(_msgSender(), to, tokenId, msg.value);
} else if(toZeroAddress) {
_postValidateBurn(_msgSender(), from, tokenId, msg.value);
} else {
_postValidateTransfer(_msgSender(), from, to, tokenId, msg.value);
}
}
/// @dev Optional validation hook that fires before a mint
function _preValidateMint(address caller, address to, uint256 tokenId, uint256 value) internal virtual {}
/// @dev Optional validation hook that fires after a mint
function _postValidateMint(address caller, address to, uint256 tokenId, uint256 value) internal virtual {}
/// @dev Optional validation hook that fires before a burn
function _preValidateBurn(address caller, address from, uint256 tokenId, uint256 value) internal virtual {}
/// @dev Optional validation hook that fires after a burn
function _postValidateBurn(address caller, address from, uint256 tokenId, uint256 value) internal virtual {}
/// @dev Optional validation hook that fires before a transfer
function _preValidateTransfer(address caller, address from, address to, uint256 tokenId, uint256 value) internal virtual {}
/// @dev Optional validation hook that fires after a transfer
function _postValidateTransfer(address caller, address from, address to, uint256 tokenId, uint256 value) internal virtual {}
}
// File: @openzeppelin/contracts/interfaces/IERC165.sol
// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC165.sol)
pragma solidity ^0.8.20;
// File: .deps/github/limitbreakinc/creator-token-contracts/contracts/utils/CreatorTokenBase.sol
pragma solidity ^0.8.4;
/**
* @title CreatorTokenBase
* @author Limit Break, Inc.
* @notice CreatorTokenBase is an abstract contract that provides basic functionality for managing token
* transfer policies through an implementation of ICreatorTokenTransferValidator. This contract is intended to be used
* as a base for creator-specific token contracts, enabling customizable transfer restrictions and security policies.
*
* <h4>Features:</h4>
* <ul>Ownable: This contract can have an owner who can set and update the transfer validator.</ul>
* <ul>TransferValidation: Implements the basic token transfer validation interface.</ul>
* <ul>ICreatorToken: Implements the interface for creator tokens, providing view functions for token security policies.</ul>
*
* <h4>Benefits:</h4>
* <ul>Provides a flexible and modular way to implement custom token transfer restrictions and security policies.</ul>
* <ul>Allows creators to enforce policies such as whitelisted operators and permitted contract receivers.</ul>
* <ul>Can be easily integrated into other token contracts as a base contract.</ul>
*
* <h4>Intended Usage:</h4>
* <ul>Use as a base contract for creator token implementations that require advanced transfer restrictions and
* security policies.</ul>
* <ul>Set and update the ICreatorTokenTransferValidator implementation contract to enforce desired policies for the
* creator token.</ul>
*/
abstract contract CreatorTokenBase is OwnablePermissions, TransferValidation, ICreatorToken {
error CreatorTokenBase__InvalidTransferValidatorContract();
error CreatorTokenBase__SetTransferValidatorFirst();
address public constant DEFAULT_TRANSFER_VALIDATOR = address(0x0000721C310194CcfC01E523fc93C9cCcFa2A0Ac);
TransferSecurityLevels public constant DEFAULT_TRANSFER_SECURITY_LEVEL = TransferSecurityLevels.One;
uint120 public constant DEFAULT_OPERATOR_WHITELIST_ID = uint120(1);
ICreatorTokenTransferValidator private transferValidator;
/**
* @notice Allows the contract owner to set the transfer validator to the official validator contract
* and set the security policy to the recommended default settings.
* @dev May be overridden to change the default behavior of an individual collection.
*/
function setToDefaultSecurityPolicy() public virtual {
_requireCallerIsContractOwner();
setTransferValidator(DEFAULT_TRANSFER_VALIDATOR);
ICreatorTokenTransferValidator(DEFAULT_TRANSFER_VALIDATOR).setTransferSecurityLevelOfCollection(address(this), DEFAULT_TRANSFER_SECURITY_LEVEL);
ICreatorTokenTransferValidator(DEFAULT_TRANSFER_VALIDATOR).setOperatorWhitelistOfCollection(address(this), DEFAULT_OPERATOR_WHITELIST_ID);
}
/**
* @notice Allows the contract owner to set the transfer validator to a custom validator contract
* and set the security policy to their own custom settings.
*/
function setToCustomValidatorAndSecurityPolicy(
address validator,
TransferSecurityLevels level,
uint120 operatorWhitelistId,
uint120 permittedContractReceiversAllowlistId) public {
_requireCallerIsContractOwner();
setTransferValidator(validator);
ICreatorTokenTransferValidator(validator).
setTransferSecurityLevelOfCollection(address(this), level);
ICreatorTokenTransferValidator(validator).
setOperatorWhitelistOfCollection(address(this), operatorWhitelistId);
ICreatorTokenTransferValidator(validator).
setPermittedContractReceiverAllowlistOfCollection(address(this), permittedContractReceiversAllowlistId);
}
/**
* @notice Allows the contract owner to set the security policy to their own custom settings.
* @dev Reverts if the transfer validator has not been set.
*/
function setToCustomSecurityPolicy(
TransferSecurityLevels level,
uint120 operatorWhitelistId,
uint120 permittedContractReceiversAllowlistId) public {
_requireCallerIsContractOwner();
ICreatorTokenTransferValidator validator = getTransferValidator();
if (address(validator) == address(0)) {
revert CreatorTokenBase__SetTransferValidatorFirst();
}
validator.setTransferSecurityLevelOfCollection(address(this), level);
validator.setOperatorWhitelistOfCollection(address(this), operatorWhitelistId);
validator.setPermittedContractReceiverAllowlistOfCollection(address(this), permittedContractReceiversAllowlistId);
}
/**
* @notice Sets the transfer validator for the token contract.
*
* @dev Throws when provided validator contract is not the zero address and doesn't support
* the ICreatorTokenTransferValidator interface.
* @dev Throws when the caller is not the contract owner.
*
* @dev <h4>Postconditions:</h4>
* 1. The transferValidator address is updated.
* 2. The `TransferValidatorUpdated` event is emitted.
*
* @param transferValidator_ The address of the transfer validator contract.
*/
function setTransferValidator(address transferValidator_) public {
_requireCallerIsContractOwner();
bool isValidTransferValidator = false;
if(transferValidator_.code.length > 0) {
try IERC165(transferValidator_).supportsInterface(type(ICreatorTokenTransferValidator).interfaceId)
returns (bool supportsInterface) {
isValidTransferValidator = supportsInterface;
} catch {}
}
if(transferValidator_ != address(0) && !isValidTransferValidator) {
revert CreatorTokenBase__InvalidTransferValidatorContract();
}
emit TransferValidatorUpdated(address(transferValidator), transferValidator_);
transferValidator = ICreatorTokenTransferValidator(transferValidator_);
}
/**
* @notice Returns the transfer validator contract address for this token contract.
*/
function getTransferValidator() public view override returns (ICreatorTokenTransferValidator) {
return transferValidator;
}
/**
* @notice Returns the security policy for this token contract, which includes:
* Transfer security level, operator whitelist id, permitted contract receiver allowlist id.
*/
function getSecurityPolicy() public view override returns (CollectionSecurityPolicy memory) {
if (address(transferValidator) != address(0)) {
return transferValidator.getCollectionSecurityPolicy(address(this));
}
return CollectionSecurityPolicy({
transferSecurityLevel: TransferSecurityLevels.Zero,
operatorWhitelistId: 0,
permittedContractReceiversId: 0
});
}
/**
* @notice Returns the list of all whitelisted operators for this token contract.
* @dev This can be an expensive call and should only be used in view-only functions.
*/
function getWhitelistedOperators() public view override returns (address[] memory) {
if (address(transferValidator) != address(0)) {
return transferValidator.getWhitelistedOperators(
transferValidator.getCollectionSecurityPolicy(address(this)).operatorWhitelistId);
}
return new address[](0);
}
/**
* @notice Returns the list of permitted contract receivers for this token contract.
* @dev This can be an expensive call and should only be used in view-only functions.
*/
function getPermittedContractReceivers() public view override returns (address[] memory) {
if (address(transferValidator) != address(0)) {
return transferValidator.getPermittedContractReceivers(
transferValidator.getCollectionSecurityPolicy(address(this)).permittedContractReceiversId);
}
return new address[](0);
}
/**
* @notice Checks if an operator is whitelisted for this token contract.
* @param operator The address of the operator to check.
*/
function isOperatorWhitelisted(address operator) public view override returns (bool) {
if (address(transferValidator) != address(0)) {
return transferValidator.isOperatorWhitelisted(
transferValidator.getCollectionSecurityPolicy(address(this)).operatorWhitelistId, operator);
}
return false;
}
/**
* @notice Checks if a contract receiver is permitted for this token contract.
* @param receiver The address of the receiver to check.
*/
function isContractReceiverPermitted(address receiver) public view override returns (bool) {
if (address(transferValidator) != address(0)) {
return transferValidator.isContractReceiverPermitted(
transferValidator.getCollectionSecurityPolicy(address(this)).permittedContractReceiversId, receiver);
}
return false;
}
/**
* @notice Determines if a transfer is allowed based on the token contract's security policy. Use this function
* to simulate whether or not a transfer made by the specified `caller` from the `from` address to the `to`
* address would be allowed by this token's security policy.
*
* @notice This function only checks the security policy restrictions and does not check whether token ownership
* or approvals are in place.
*
* @param caller The address of the simulated caller.
* @param from The address of the sender.
* @param to The address of the receiver.
* @return True if the transfer is allowed, false otherwise.
*/
function isTransferAllowed(address caller, address from, address to) public view override returns (bool) {
if (address(transferValidator) != address(0)) {
try transferValidator.applyCollectionTransferPolicy(caller, from, to) {
return true;
} catch {
return false;
}
}
return true;
}
/**
* @dev Pre-validates a token transfer, reverting if the transfer is not allowed by this token's security policy.
* Inheriting contracts are responsible for overriding the _beforeTokenTransfer function, or its equivalent
* and calling _validateBeforeTransfer so that checks can be properly applied during token transfers.
*
* @dev Throws when the transfer doesn't comply with the collection's transfer policy, if the transferValidator is
* set to a non-zero address.
*
* @param caller The address of the caller.
* @param from The address of the sender.
* @param to The address of the receiver.
*/
function _preValidateTransfer(
address caller,
address from,
address to,
uint256 /*tokenId*/,
uint256 /*value*/) internal virtual override {
if (address(transferValidator) != address(0)) {
transferValidator.applyCollectionTransferPolicy(caller, from, to);
}
}
}
// File: erc721a/contracts/IERC721A.sol
// ERC721A Contracts v4.3.0
// Creator: Chiru Labs
pragma solidity ^0.8.4;
/**
* @dev Interface of ERC721A.
*/
interface IERC721A {
/**
* The caller must own the token or be an approved operator.
*/
error ApprovalCallerNotOwnerNorApproved();
/**
* The token does not exist.
*/
error ApprovalQueryForNonexistentToken();
/**
* Cannot query the balance for the zero address.
*/
error BalanceQueryForZeroAddress();
/**
* Cannot mint to the zero address.
*/
error MintToZeroAddress();
/**
* The quantity of tokens minted must be more than zero.
*/
error MintZeroQuantity();
/**
* The token does not exist.
*/
error OwnerQueryForNonexistentToken();
/**
* The caller must own the token or be an approved operator.
*/
error TransferCallerNotOwnerNorApproved();
/**
* The token must be owned by `from`.
*/
error TransferFromIncorrectOwner();
/**
* Cannot safely transfer to a contract that does not implement the
* ERC721Receiver interface.
*/
error TransferToNonERC721ReceiverImplementer();
/**
* Cannot transfer to the zero address.
*/
error TransferToZeroAddress();
/**
* The token does not exist.
*/
error URIQueryForNonexistentToken();
/**
* The `quantity` minted with ERC2309 exceeds the safety limit.
*/
error MintERC2309QuantityExceedsLimit();
/**
* The `extraData` cannot be set on an unintialized ownership slot.
*/
error OwnershipNotInitializedForExtraData();
/**
* `_sequentialUpTo()` must be greater than `_startTokenId()`.
*/
error SequentialUpToTooSmall();
/**
* The `tokenId` of a sequential mint exceeds `_sequentialUpTo()`.
*/
error SequentialMintExceedsLimit();
/**
* Spot minting requires a `tokenId` greater than `_sequentialUpTo()`.
*/
error SpotMintTokenIdTooSmall();
/**
* Cannot mint over a token that already exists.
*/
error TokenAlreadyExists();
/**
* The feature is not compatible with spot mints.
*/
error NotCompatibleWithSpotMints();
// =============================================================
// STRUCTS
// =============================================================
struct TokenOwnership {
// The address of the owner.
address addr;
// Stores the start time of ownership with minimal overhead for tokenomics.
uint64 startTimestamp;
// Whether the token has been burned.
bool burned;
// Arbitrary data similar to `startTimestamp` that can be set via {_extraData}.
uint24 extraData;
}
// =============================================================
// TOKEN COUNTERS
// =============================================================
/**
* @dev Returns the total number of tokens in existence.
* Burned tokens will reduce the count.
* To get the total number of tokens minted, please see {_totalMinted}.
*/
function totalSupply() external view returns (uint256);
// =============================================================
// IERC165
// =============================================================
/**
* @dev Returns true if this contract implements the interface defined by
* `interfaceId`. See the corresponding
* [EIP section](https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified)
* to learn more about how these ids are created.
*
* This function call must use less than 30000 gas.
*/
function supportsInterface(bytes4 interfaceId) external view returns (bool);
// =============================================================
// IERC721
// =============================================================
/**
* @dev Emitted when `tokenId` token is transferred from `from` to `to`.
*/
event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);
/**
* @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.
*/
event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);
/**
* @dev Emitted when `owner` enables or disables
* (`approved`) `operator` to manage all of its assets.
*/
event ApprovalForAll(address indexed owner, address indexed operator, bool approved);
/**
* @dev Returns the number of tokens in `owner`'s account.
*/
function balanceOf(address owner) external view returns (uint256 balance);
/**
* @dev Returns the owner of the `tokenId` token.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function ownerOf(uint256 tokenId) external view returns (address owner);
/**
* @dev Safely transfers `tokenId` token from `from` to `to`,
* checking first that contract recipients are aware of the ERC721 protocol
* to prevent tokens from being forever locked.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must exist and be owned by `from`.
* - If the caller is not `from`, it must be have been allowed to move
* this token by either {approve} or {setApprovalForAll}.
* - If `to` refers to a smart contract, it must implement
* {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function safeTransferFrom(
address from,
address to,
uint256 tokenId,
bytes calldata data
) external payable;
/**
* @dev Equivalent to `safeTransferFrom(from, to, tokenId, '')`.
*/
function safeTransferFrom(
address from,
address to,
uint256 tokenId
) external payable;
/**
* @dev Transfers `tokenId` from `from` to `to`.
*
* WARNING: Usage of this method is discouraged, use {safeTransferFrom}
* whenever possible.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must be owned by `from`.
* - If the caller is not `from`, it must be approved to move this token
* by either {approve} or {setApprovalForAll}.
*
* Emits a {Transfer} event.
*/
function transferFrom(
address from,
address to,
uint256 tokenId
) external payable;
/**
* @dev Gives permission to `to` to transfer `tokenId` token to another account.
* The approval is cleared when the token is transferred.
*
* Only a single account can be approved at a time, so approving the
* zero address clears previous approvals.
*
* Requirements:
*
* - The caller must own the token or be an approved operator.
* - `tokenId` must exist.
*
* Emits an {Approval} event.
*/
function approve(address to, uint256 tokenId) external payable;
/**
* @dev Approve or remove `operator` as an operator for the caller.
* Operators can call {transferFrom} or {safeTransferFrom}
* for any token owned by the caller.
*
* Requirements:
*
* - The `operator` cannot be the caller.
*
* Emits an {ApprovalForAll} event.
*/
function setApprovalForAll(address operator, bool _approved) external;
/**
* @dev Returns the account approved for `tokenId` token.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function getApproved(uint256 tokenId) external view returns (address operator);
/**
* @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.
*
* See {setApprovalForAll}.
*/
function isApprovedForAll(address owner, address operator) external view returns (bool);
// =============================================================
// IERC721Metadata
// =============================================================
/**
* @dev Returns the token collection name.
*/
function name() external view returns (string memory);
/**
* @dev Returns the token collection symbol.
*/
function symbol() external view returns (string memory);
/**
* @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token.
*/
function tokenURI(uint256 tokenId) external view returns (string memory);
// =============================================================
// IERC2309
// =============================================================
/**
* @dev Emitted when tokens in `fromTokenId` to `toTokenId`
* (inclusive) is transferred from `from` to `to`, as defined in the
* [ERC2309](https://eips.ethereum.org/EIPS/eip-2309) standard.
*
* See {_mintERC2309} for more details.
*/
event ConsecutiveTransfer(uint256 indexed fromTokenId, uint256 toTokenId, address indexed from, address indexed to);
}
// File: erc721a/contracts/ERC721A.sol
// ERC721A Contracts v4.3.0
// Creator: Chiru Labs
pragma solidity ^0.8.4;
/**
* @dev Interface of ERC721 token receiver.
*/
interface ERC721A__IERC721Receiver {
function onERC721Received(
address operator,
address from,
uint256 tokenId,
bytes calldata data
) external returns (bytes4);
}
/**
* @title ERC721A
*
* @dev Implementation of the [ERC721](https://eips.ethereum.org/EIPS/eip-721)
* Non-Fungible Token Standard, including the Metadata extension.
* Optimized for lower gas during batch mints.
*
* Token IDs are minted in sequential order (e.g. 0, 1, 2, 3, ...)
* starting from `_startTokenId()`.
*
* The `_sequentialUpTo()` function can be overriden to enable spot mints
* (i.e. non-consecutive mints) for `tokenId`s greater than `_sequentialUpTo()`.
*
* Assumptions:
*
* - An owner cannot have more than 2**64 - 1 (max value of uint64) of supply.
* - The maximum token ID cannot exceed 2**256 - 1 (max value of uint256).
*/
contract ERC721A is IERC721A {
// Bypass for a `--via-ir` bug (https://github.com/chiru-labs/ERC721A/pull/364).
struct TokenApprovalRef {
address value;
}
// =============================================================
// CONSTANTS
// =============================================================
// Mask of an entry in packed address data.
uint256 private constant _BITMASK_ADDRESS_DATA_ENTRY = (1 << 64) - 1;
// The bit position of `numberMinted` in packed address data.
uint256 private constant _BITPOS_NUMBER_MINTED = 64;
// The bit position of `numberBurned` in packed address data.
uint256 private constant _BITPOS_NUMBER_BURNED = 128;
// The bit position of `aux` in packed address data.
uint256 private constant _BITPOS_AUX = 192;
// Mask of all 256 bits in packed address data except the 64 bits for `aux`.
uint256 private constant _BITMASK_AUX_COMPLEMENT = (1 << 192) - 1;
// The bit position of `startTimestamp` in packed ownership.
uint256 private constant _BITPOS_START_TIMESTAMP = 160;
// The bit mask of the `burned` bit in packed ownership.
uint256 private constant _BITMASK_BURNED = 1 << 224;
// The bit position of the `nextInitialized` bit in packed ownership.
uint256 private constant _BITPOS_NEXT_INITIALIZED = 225;
// The bit mask of the `nextInitialized` bit in packed ownership.
uint256 private constant _BITMASK_NEXT_INITIALIZED = 1 << 225;
// The bit position of `extraData` in packed ownership.
uint256 private constant _BITPOS_EXTRA_DATA = 232;
// Mask of all 256 bits in a packed ownership except the 24 bits for `extraData`.
uint256 private constant _BITMASK_EXTRA_DATA_COMPLEMENT = (1 << 232) - 1;
// The mask of the lower 160 bits for addresses.
uint256 private constant _BITMASK_ADDRESS = (1 << 160) - 1;
// The maximum `quantity` that can be minted with {_mintERC2309}.
// This limit is to prevent overflows on the address data entries.
// For a limit of 5000, a total of 3.689e15 calls to {_mintERC2309}
// is required to cause an overflow, which is unrealistic.
uint256 private constant _MAX_MINT_ERC2309_QUANTITY_LIMIT = 5000;
// The `Transfer` event signature is given by:
// `keccak256(bytes("Transfer(address,address,uint256)"))`.
bytes32 private constant _TRANSFER_EVENT_SIGNATURE =
0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef;
// =============================================================
// STORAGE
// =============================================================
// The next token ID to be minted.
uint256 private _currentIndex;
// The number of tokens burned.
uint256 private _burnCounter;
// Token name
string private _name;
// Token symbol
string private _symbol;
// Mapping from token ID to ownership details
// An empty struct value does not necessarily mean the token is unowned.
// See {_packedOwnershipOf} implementation for details.
//
// Bits Layout:
// - [0..159] `addr`
// - [160..223] `startTimestamp`
// - [224] `burned`
// - [225] `nextInitialized`
// - [232..255] `extraData`
mapping(uint256 => uint256) private _packedOwnerships;
// Mapping owner address to address data.
//
// Bits Layout:
// - [0..63] `balance`
// - [64..127] `numberMinted`
// - [128..191] `numberBurned`
// - [192..255] `aux`
mapping(address => uint256) private _packedAddressData;
// Mapping from token ID to approved address.
mapping(uint256 => TokenApprovalRef) private _tokenApprovals;
// Mapping from owner to operator approvals
mapping(address => mapping(address => bool)) private _operatorApprovals;
// The amount of tokens minted above `_sequentialUpTo()`.
// We call these spot mints (i.e. non-sequential mints).
uint256 private _spotMinted;
// =============================================================
// CONSTRUCTOR
// =============================================================
constructor(string memory name_, string memory symbol_) {
_name = name_;
_symbol = symbol_;
_currentIndex = _startTokenId();
if (_sequentialUpTo() < _startTokenId()) _revert(SequentialUpToTooSmall.selector);
}
// =============================================================
// TOKEN COUNTING OPERATIONS
// =============================================================
/**
* @dev Returns the starting token ID for sequential mints.
*
* Override this function to change the starting token ID for sequential mints.
*
* Note: The value returned must never change after any tokens have been minted.
*/
function _startTokenId() internal view virtual returns (uint256) {
return 0;
}
/**
* @dev Returns the maximum token ID (inclusive) for sequential mints.
*
* Override this function to return a value less than 2**256 - 1,
* but greater than `_startTokenId()`, to enable spot (non-sequential) mints.
*
* Note: The value returned must never change after any tokens have been minted.
*/
function _sequentialUpTo() internal view virtual returns (uint256) {
return type(uint256).max;
}
/**
* @dev Returns the next token ID to be minted.
*/
function _nextTokenId() internal view virtual returns (uint256) {
return _currentIndex;
}
/**
* @dev Returns the total number of tokens in existence.
* Burned tokens will reduce the count.
* To get the total number of tokens minted, please see {_totalMinted}.
*/
function totalSupply() public view virtual override returns (uint256 result) {
// Counter underflow is impossible as `_burnCounter` cannot be incremented
// more than `_currentIndex + _spotMinted - _startTokenId()` times.
unchecked {
// With spot minting, the intermediate `result` can be temporarily negative,
// and the computation must be unchecked.
result = _currentIndex - _burnCounter - _startTokenId();
if (_sequentialUpTo() != type(uint256).max) result += _spotMinted;
}
}
/**
* @dev Returns the total amount of tokens minted in the contract.
*/
function _totalMinted() internal view virtual returns (uint256 result) {
// Counter underflow is impossible as `_currentIndex` does not decrement,
// and it is initialized to `_startTokenId()`.
unchecked {
result = _currentIndex - _startTokenId();
if (_sequentialUpTo() != type(uint256).max) result += _spotMinted;
}
}
/**
* @dev Returns the total number of tokens burned.
*/
function _totalBurned() internal view virtual returns (uint256) {
return _burnCounter;
}
/**
* @dev Returns the total number of tokens that are spot-minted.
*/
function _totalSpotMinted() internal view virtual returns (uint256) {
return _spotMinted;
}
// =============================================================
// ADDRESS DATA OPERATIONS
// =============================================================
/**
* @dev Returns the number of tokens in `owner`'s account.
*/
function balanceOf(address owner) public view virtual override returns (uint256) {
if (owner == address(0)) _revert(BalanceQueryForZeroAddress.selector);
return _packedAddressData[owner] & _BITMASK_ADDRESS_DATA_ENTRY;
}
/**
* Returns the number of tokens minted by `owner`.
*/
function _numberMinted(address owner) internal view returns (uint256) {
return (_packedAddressData[owner] >> _BITPOS_NUMBER_MINTED) & _BITMASK_ADDRESS_DATA_ENTRY;
}
/**
* Returns the number of tokens burned by or on behalf of `owner`.
*/
function _numberBurned(address owner) internal view returns (uint256) {
return (_packedAddressData[owner] >> _BITPOS_NUMBER_BURNED) & _BITMASK_ADDRESS_DATA_ENTRY;
}
/**
* Returns the auxiliary data for `owner`. (e.g. number of whitelist mint slots used).
*/
function _getAux(address owner) internal view returns (uint64) {
return uint64(_packedAddressData[owner] >> _BITPOS_AUX);
}
/**
* Sets the auxiliary data for `owner`. (e.g. number of whitelist mint slots used).
* If there are multiple variables, please pack them into a uint64.
*/
function _setAux(address owner, uint64 aux) internal virtual {
uint256 packed = _packedAddressData[owner];
uint256 auxCasted;
// Cast `aux` with assembly to avoid redundant masking.
assembly {
auxCasted := aux
}
packed = (packed & _BITMASK_AUX_COMPLEMENT) | (auxCasted << _BITPOS_AUX);
_packedAddressData[owner] = packed;
}
// =============================================================
// IERC165
// =============================================================
/**
* @dev Returns true if this contract implements the interface defined by
* `interfaceId`. See the corresponding
* [EIP section](https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified)
* to learn more about how these ids are created.
*
* This function call must use less than 30000 gas.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
// The interface IDs are constants representing the first 4 bytes
// of the XOR of all function selectors in the interface.
// See: [ERC165](https://eips.ethereum.org/EIPS/eip-165)
// (e.g. `bytes4(i.functionA.selector ^ i.functionB.selector ^ ...)`)
return
interfaceId == 0x01ffc9a7 || // ERC165 interface ID for ERC165.
interfaceId == 0x80ac58cd || // ERC165 interface ID for ERC721.
interfaceId == 0x5b5e139f; // ERC165 interface ID for ERC721Metadata.
}
// =============================================================
// IERC721Metadata
// =============================================================
/**
* @dev Returns the token collection name.
*/
function name() public view virtual override returns (string memory) {
return _name;
}
/**
* @dev Returns the token collection symbol.
*/
function symbol() public view virtual override returns (string memory) {
return _symbol;
}
/**
* @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token.
*/
function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
if (!_exists(tokenId)) _revert(URIQueryForNonexistentToken.selector);
string memory baseURI = _baseURI();
return bytes(baseURI).length != 0 ? string(abi.encodePacked(baseURI, _toString(tokenId), ".json")) : '';
}
/**
* @dev Base URI for computing {tokenURI}. If set, the resulting URI for each
* token will be the concatenation of the `baseURI` and the `tokenId`. Empty
* by default, it can be overridden in child contracts.
*/
function _baseURI() internal view virtual returns (string memory) {
return '';
}
// =============================================================
// OWNERSHIPS OPERATIONS
// =============================================================
/**
* @dev Returns the owner of the `tokenId` token.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function ownerOf(uint256 tokenId) public view virtual override returns (address) {
return address(uint160(_packedOwnershipOf(tokenId)));
}
/**
* @dev Gas spent here starts off proportional to the maximum mint batch size.
* It gradually moves to O(1) as tokens get transferred around over time.
*/
function _ownershipOf(uint256 tokenId) internal view virtual returns (TokenOwnership memory) {
return _unpackedOwnership(_packedOwnershipOf(tokenId));
}
/**
* @dev Returns the unpacked `TokenOwnership` struct at `index`.
*/
function _ownershipAt(uint256 index) internal view virtual returns (TokenOwnership memory) {
return _unpackedOwnership(_packedOwnerships[index]);
}
/**
* @dev Returns whether the ownership slot at `index` is initialized.
* An uninitialized slot does not necessarily mean that the slot has no owner.
*/
function _ownershipIsInitialized(uint256 index) internal view virtual returns (bool) {
return _packedOwnerships[index] != 0;
}
/**
* @dev Initializes the ownership slot minted at `index` for efficiency purposes.
*/
function _initializeOwnershipAt(uint256 index) internal virtual {
if (_packedOwnerships[index] == 0) {
_packedOwnerships[index] = _packedOwnershipOf(index);
}
}
/**
* @dev Returns the packed ownership data of `tokenId`.
*/
function _packedOwnershipOf(uint256 tokenId) private view returns (uint256 packed) {
if (_startTokenId() <= tokenId) {
packed = _packedOwnerships[tokenId];
if (tokenId > _sequentialUpTo()) {
if (_packedOwnershipExists(packed)) return packed;
_revert(OwnerQueryForNonexistentToken.selector);
}
// If the data at the starting slot does not exist, start the scan.
if (packed == 0) {
if (tokenId >= _currentIndex) _revert(OwnerQueryForNonexistentToken.selector);
// Invariant:
// There will always be an initialized ownership slot
// (i.e. `ownership.addr != address(0) && ownership.burned == false`)
// before an unintialized ownership slot
// (i.e. `ownership.addr == address(0) && ownership.burned == false`)
// Hence, `tokenId` will not underflow.
//
// We can directly compare the packed value.
// If the address is zero, packed will be zero.
for (;;) {
unchecked {
packed = _packedOwnerships[--tokenId];
}
if (packed == 0) continue;
if (packed & _BITMASK_BURNED == 0) return packed;
// Otherwise, the token is burned, and we must revert.
// This handles the case of batch burned tokens, where only the burned bit
// of the starting slot is set, and remaining slots are left uninitialized.
_revert(OwnerQueryForNonexistentToken.selector);
}
}
// Otherwise, the data exists and we can skip the scan.
// This is possible because we have already achieved the target condition.
// This saves 2143 gas on transfers of initialized tokens.
// If the token is not burned, return `packed`. Otherwise, revert.
if (packed & _BITMASK_BURNED == 0) return packed;
}
_revert(OwnerQueryForNonexistentToken.selector);
}
/**
* @dev Returns the unpacked `TokenOwnership` struct from `packed`.
*/
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);
}
/**
* @dev Packs ownership data into a single uint256.
*/
function _packOwnershipData(address owner, uint256 flags) private view returns (uint256 result) {
assembly {
// Mask `owner` to the lower 160 bits, in case the upper bits somehow aren't clean.
owner := and(owner, _BITMASK_ADDRESS)
// `owner | (block.timestamp << _BITPOS_START_TIMESTAMP) | flags`.
result := or(owner, or(shl(_BITPOS_START_TIMESTAMP, timestamp()), flags))
}
}
/**
* @dev Returns the `nextInitialized` flag set if `quantity` equals 1.
*/
function _nextInitializedFlag(uint256 quantity) private pure returns (uint256 result) {
// For branchless setting of the `nextInitialized` flag.
assembly {
// `(quantity == 1) << _BITPOS_NEXT_INITIALIZED`.
result := shl(_BITPOS_NEXT_INITIALIZED, eq(quantity, 1))
}
}
// =============================================================
// APPROVAL OPERATIONS
// =============================================================
/**
* @dev Gives permission to `to` to transfer `tokenId` token to another account. See {ERC721A-_approve}.
*
* Requirements:
*
* - The caller must own the token or be an approved operator.
*/
function approve(address to, uint256 tokenId) public payable virtual override {
_approve(to, tokenId, true);
}
/**
* @dev Returns the account approved for `tokenId` token.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function getApproved(uint256 tokenId) public view virtual override returns (address) {
if (!_exists(tokenId)) _revert(ApprovalQueryForNonexistentToken.selector);
return _tokenApprovals[tokenId].value;
}
/**
* @dev Approve or remove `operator` as an operator for the caller.
* Operators can call {transferFrom} or {safeTransferFrom}
* for any token owned by the caller.
*
* Requirements:
*
* - The `operator` cannot be the caller.
*
* Emits an {ApprovalForAll} event.
*/
function setApprovalForAll(address operator, bool approved) public virtual override {
_operatorApprovals[_msgSenderERC721A()][operator] = approved;
emit ApprovalForAll(_msgSenderERC721A(), operator, approved);
}
/**
* @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.
*
* See {setApprovalForAll}.
*/
function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) {
return _operatorApprovals[owner][operator];
}
/**
* @dev Returns whether `tokenId` exists.
*
* Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}.
*
* Tokens start existing when they are minted. See {_mint}.
*/
function _exists(uint256 tokenId) internal view virtual returns (bool result) {
if (_startTokenId() <= tokenId) {
if (tokenId > _sequentialUpTo()) return _packedOwnershipExists(_packedOwnerships[tokenId]);
if (tokenId < _currentIndex) {
uint256 packed;
while ((packed = _packedOwnerships[tokenId]) == 0) --tokenId;
result = packed & _BITMASK_BURNED == 0;
}
}
}
/**
* @dev Returns whether `packed` represents a token that exists.
*/
function _packedOwnershipExists(uint256 packed) private pure returns (bool result) {
assembly {
// The following is equivalent to `owner != address(0) && burned == false`.
// Symbolically tested.
result := gt(and(packed, _BITMASK_ADDRESS), and(packed, _BITMASK_BURNED))
}
}
/**
* @dev Returns whether `msgSender` is equal to `approvedAddress` or `owner`.
*/
function _isSenderApprovedOrOwner(
address approvedAddress,
address owner,
address msgSender
) private pure returns (bool result) {
assembly {
// Mask `owner` to the lower 160 bits, in case the upper bits somehow aren't clean.
owner := and(owner, _BITMASK_ADDRESS)
// Mask `msgSender` to the lower 160 bits, in case the upper bits somehow aren't clean.
msgSender := and(msgSender, _BITMASK_ADDRESS)
// `msgSender == owner || msgSender == approvedAddress`.
result := or(eq(msgSender, owner), eq(msgSender, approvedAddress))
}
}
/**
* @dev Returns the storage slot and value for the approved address of `tokenId`.
*/
function _getApprovedSlotAndAddress(uint256 tokenId)
private
view
returns (uint256 approvedAddressSlot, address approvedAddress)
{
TokenApprovalRef storage tokenApproval = _tokenApprovals[tokenId];
// The following is equivalent to `approvedAddress = _tokenApprovals[tokenId].value`.
assembly {
approvedAddressSlot := tokenApproval.slot
approvedAddress := sload(approvedAddressSlot)
}
}
// =============================================================
// TRANSFER OPERATIONS
// =============================================================
/**
* @dev Transfers `tokenId` from `from` to `to`.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must be owned by `from`.
* - If the caller is not `from`, it must be approved to move this token
* by either {approve} or {setApprovalForAll}.
*
* Emits a {Transfer} event.
*/
function transferFrom(
address from,
address to,
uint256 tokenId
) public payable virtual override {
uint256 prevOwnershipPacked = _packedOwnershipOf(tokenId);
// Mask `from` to the lower 160 bits, in case the upper bits somehow aren't clean.
from = address(uint160(uint256(uint160(from)) & _BITMASK_ADDRESS));
if (address(uint160(prevOwnershipPacked)) != from) _revert(TransferFromIncorrectOwner.selector);
(uint256 approvedAddressSlot, address approvedAddress) = _getApprovedSlotAndAddress(tokenId);
// The nested ifs save around 20+ gas over a compound boolean condition.
if (!_isSenderApprovedOrOwner(approvedAddress, from, _msgSenderERC721A()))
if (!isApprovedForAll(from, _msgSenderERC721A())) _revert(TransferCallerNotOwnerNorApproved.selector);
_beforeTokenTransfers(from, to, tokenId, 1);
// Clear approvals from the previous owner.
assembly {
if approvedAddress {
// This is equivalent to `delete _tokenApprovals[tokenId]`.
sstore(approvedAddressSlot, 0)
}
}
// Underflow of the sender's balance is impossible because we check for
// ownership above and the recipient's balance can't realistically overflow.
// Counter overflow is incredibly unrealistic as `tokenId` would have to be 2**256.
unchecked {
// We can directly increment and decrement the balances.
--_packedAddressData[from]; // Updates: `balance -= 1`.
++_packedAddressData[to]; // Updates: `balance += 1`.
// Updates:
// - `address` to the next owner.
// - `startTimestamp` to the timestamp of transfering.
// - `burned` to `false`.
// - `nextInitialized` to `true`.
_packedOwnerships[tokenId] = _packOwnershipData(
to,
_BITMASK_NEXT_INITIALIZED | _nextExtraData(from, to, prevOwnershipPacked)
);
// If the next slot may not have been initialized (i.e. `nextInitialized == false`) .
if (prevOwnershipPacked & _BITMASK_NEXT_INITIALIZED == 0) {
uint256 nextTokenId = tokenId + 1;
// If the next slot's address is zero and not burned (i.e. packed value is zero).
if (_packedOwnerships[nextTokenId] == 0) {
// If the next slot is within bounds.
if (nextTokenId != _currentIndex) {
// Initialize the next slot to maintain correctness for `ownerOf(tokenId + 1)`.
_packedOwnerships[nextTokenId] = prevOwnershipPacked;
}
}
}
}
// Mask `to` to the lower 160 bits, in case the upper bits somehow aren't clean.
uint256 toMasked = uint256(uint160(to)) & _BITMASK_ADDRESS;
assembly {
// Emit the `Transfer` event.
log4(
0, // Start of data (0, since no data).
0, // End of data (0, since no data).
_TRANSFER_EVENT_SIGNATURE, // Signature.
from, // `from`.
toMasked, // `to`.
tokenId // `tokenId`.
)
}
if (toMasked == 0) _revert(TransferToZeroAddress.selector);
_afterTokenTransfers(from, to, tokenId, 1);
}
/**
* @dev Equivalent to `safeTransferFrom(from, to, tokenId, '')`.
*/
function safeTransferFrom(
address from,
address to,
uint256 tokenId
) public payable virtual override {
safeTransferFrom(from, to, tokenId, '');
}
/**
* @dev Safely transfers `tokenId` token from `from` to `to`.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must exist and be owned by `from`.
* - If the caller is not `from`, it must be approved to move this token
* by either {approve} or {setApprovalForAll}.
* - If `to` refers to a smart contract, it must implement
* {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function safeTransferFrom(
address from,
address to,
uint256 tokenId,
bytes memory _data
) public payable virtual override {
transferFrom(from, to, tokenId);
if (to.code.length != 0)
if (!_checkContractOnERC721Received(from, to, tokenId, _data)) {
_revert(TransferToNonERC721ReceiverImplementer.selector);
}
}
/**
* @dev Hook that is called before a set of serially-ordered token IDs
* are about to be transferred. This includes minting.
* And also called before burning one token.
*
* `startTokenId` - the first token ID to be transferred.
* `quantity` - the amount to be transferred.
*
* Calling conditions:
*
* - When `from` and `to` are both non-zero, `from`'s `tokenId` will be
* transferred to `to`.
* - When `from` is zero, `tokenId` will be minted for `to`.
* - When `to` is zero, `tokenId` will be burned by `from`.
* - `from` and `to` are never both zero.
*/
function _beforeTokenTransfers(
address from,
address to,
uint256 startTokenId,
uint256 quantity
) internal virtual {}
/**
* @dev Hook that is called after a set of serially-ordered token IDs
* have been transferred. This includes minting.
* And also called after one token has been burned.
*
* `startTokenId` - the first token ID to be transferred.
* `quantity` - the amount to be transferred.
*
* Calling conditions:
*
* - When `from` and `to` are both non-zero, `from`'s `tokenId` has been
* transferred to `to`.
* - When `from` is zero, `tokenId` has been minted for `to`.
* - When `to` is zero, `tokenId` has been burned by `from`.
* - `from` and `to` are never both zero.
*/
function _afterTokenTransfers(
address from,
address to,
uint256 startTokenId,
uint256 quantity
) internal virtual {}
/**
* @dev Private function to invoke {IERC721Receiver-onERC721Received} on a target contract.
*
* `from` - Previous owner of the given token ID.
* `to` - Target address that will receive the token.
* `tokenId` - Token ID to be transferred.
* `_data` - Optional data to send along with the call.
*
* Returns whether the call correctly returned the expected magic value.
*/
function _checkContractOnERC721Received(
address from,
address to,
uint256 tokenId,
bytes memory _data
) private returns (bool) {
try ERC721A__IERC721Receiver(to).onERC721Received(_msgSenderERC721A(), from, tokenId, _data) returns (
bytes4 retval
) {
return retval == ERC721A__IERC721Receiver(to).onERC721Received.selector;
} catch (bytes memory reason) {
if (reason.length == 0) {
_revert(TransferToNonERC721ReceiverImplementer.selector);
}
assembly {
revert(add(32, reason), mload(reason))
}
}
}
// =============================================================
// MINT OPERATIONS
// =============================================================
/**
* @dev Mints `quantity` tokens and transfers them to `to`.
*
* Requirements:
*
* - `to` cannot be the zero address.
* - `quantity` must be greater than 0.
*
* Emits a {Transfer} event for each mint.
*/
function _mint(address to, uint256 quantity) internal virtual {
uint256 startTokenId = _currentIndex;
if (quantity == 0) _revert(MintZeroQuantity.selector);
_beforeTokenTransfers(address(0), to, startTokenId, quantity);
// Overflows are incredibly unrealistic.
// `balance` and `numberMinted` have a maximum limit of 2**64.
// `tokenId` has a maximum limit of 2**256.
unchecked {
// Updates:
// - `address` to the owner.
// - `startTimestamp` to the timestamp of minting.
// - `burned` to `false`.
// - `nextInitialized` to `quantity == 1`.
_packedOwnerships[startTokenId] = _packOwnershipData(
to,
_nextInitializedFlag(quantity) | _nextExtraData(address(0), to, 0)
);
// Updates:
// - `balance += quantity`.
// - `numberMinted += quantity`.
//
// We can directly add to the `balance` and `numberMinted`.
_packedAddressData[to] += quantity * ((1 << _BITPOS_NUMBER_MINTED) | 1);
// Mask `to` to the lower 160 bits, in case the upper bits somehow aren't clean.
uint256 toMasked = uint256(uint160(to)) & _BITMASK_ADDRESS;
if (toMasked == 0) _revert(MintToZeroAddress.selector);
uint256 end = startTokenId + quantity;
uint256 tokenId = startTokenId;
if (end - 1 > _sequentialUpTo()) _revert(SequentialMintExceedsLimit.selector);
do {
assembly {
// Emit the `Transfer` event.
log4(
0, // Start of data (0, since no data).
0, // End of data (0, since no data).
_TRANSFER_EVENT_SIGNATURE, // Signature.
0, // `address(0)`.
toMasked, // `to`.
tokenId // `tokenId`.
)
}
// The `!=` check ensures that large values of `quantity`
// that overflows uint256 will make the loop run out of gas.
} while (++tokenId != end);
_currentIndex = end;
}
_afterTokenTransfers(address(0), to, startTokenId, quantity);
}
/**
* @dev Mints `quantity` tokens and transfers them to `to`.
*
* This function is intended for efficient minting only during contract creation.
*
* It emits only one {ConsecutiveTransfer} as defined in
* [ERC2309](https://eips.ethereum.org/EIPS/eip-2309),
* instead of a sequence of {Transfer} event(s).
*
* Calling this function outside of contract creation WILL make your contract
* non-compliant with the ERC721 standard.
* For full ERC721 compliance, substituting ERC721 {Transfer} event(s) with the ERC2309
* {ConsecutiveTransfer} event is only permissible during contract creation.
*
* Requirements:
*
* - `to` cannot be the zero address.
* - `quantity` must be greater than 0.
*
* Emits a {ConsecutiveTransfer} event.
*/
function _mintERC2309(address to, uint256 quantity) internal virtual {
uint256 startTokenId = _currentIndex;
if (to == address(0)) _revert(MintToZeroAddress.selector);
if (quantity == 0) _revert(MintZeroQuantity.selector);
if (quantity > _MAX_MINT_ERC2309_QUANTITY_LIMIT) _revert(MintERC2309QuantityExceedsLimit.selector);
_beforeTokenTransfers(address(0), to, startTokenId, quantity);
// Overflows are unrealistic due to the above check for `quantity` to be below the limit.
unchecked {
// Updates:
// - `balance += quantity`.
// - `numberMinted += quantity`.
//
// We can directly add to the `balance` and `numberMinted`.
_packedAddressData[to] += quantity * ((1 << _BITPOS_NUMBER_MINTED) | 1);
// Updates:
// - `address` to the owner.
// - `startTimestamp` to the timestamp of minting.
// - `burned` to `false`.
// - `nextInitialized` to `quantity == 1`.
_packedOwnerships[startTokenId] = _packOwnershipData(
to,
_nextInitializedFlag(quantity) | _nextExtraData(address(0), to, 0)
);
if (startTokenId + quantity - 1 > _sequentialUpTo()) _revert(SequentialMintExceedsLimit.selector);
emit ConsecutiveTransfer(startTokenId, startTokenId + quantity - 1, address(0), to);
_currentIndex = startTokenId + quantity;
}
_afterTokenTransfers(address(0), to, startTokenId, quantity);
}
/**
* @dev Safely mints `quantity` tokens and transfers them to `to`.
*
* Requirements:
*
* - If `to` refers to a smart contract, it must implement
* {IERC721Receiver-onERC721Received}, which is called for each safe transfer.
* - `quantity` must be greater than 0.
*
* See {_mint}.
*
* Emits a {Transfer} event for each mint.
*/
function _safeMint(
address to,
uint256 quantity,
bytes memory _data
) internal virtual {
_mint(to, quantity);
unchecked {
if (to.code.length != 0) {
uint256 end = _currentIndex;
uint256 index = end - quantity;
do {
if (!_checkContractOnERC721Received(address(0), to, index++, _data)) {
_revert(TransferToNonERC721ReceiverImplementer.selector);
}
} while (index < end);
// This prevents reentrancy to `_safeMint`.
// It does not prevent reentrancy to `_safeMintSpot`.
if (_currentIndex != end) revert();
}
}
}
/**
* @dev Equivalent to `_safeMint(to, quantity, '')`.
*/
function _safeMint(address to, uint256 quantity) internal virtual {
_safeMint(to, quantity, '');
}
/**
* @dev Mints a single token at `tokenId`.
*
* Note: A spot-minted `tokenId` that has been burned can be re-minted again.
*
* Requirements:
*
* - `to` cannot be the zero address.
* - `tokenId` must be greater than `_sequentialUpTo()`.
* - `tokenId` must not exist.
*
* Emits a {Transfer} event for each mint.
*/
function _mintSpot(address to, uint256 tokenId) internal virtual {
if (tokenId <= _sequentialUpTo()) _revert(SpotMintTokenIdTooSmall.selector);
uint256 prevOwnershipPacked = _packedOwnerships[tokenId];
if (_packedOwnershipExists(prevOwnershipPacked)) _revert(TokenAlreadyExists.selector);
_beforeTokenTransfers(address(0), to, tokenId, 1);
// Overflows are incredibly unrealistic.
// The `numberMinted` for `to` is incremented by 1, and has a max limit of 2**64 - 1.
// `_spotMinted` is incremented by 1, and has a max limit of 2**256 - 1.
unchecked {
// Updates:
// - `address` to the owner.
// - `startTimestamp` to the timestamp of minting.
// - `burned` to `false`.
// - `nextInitialized` to `true` (as `quantity == 1`).
_packedOwnerships[tokenId] = _packOwnershipData(
to,
_nextInitializedFlag(1) | _nextExtraData(address(0), to, prevOwnershipPacked)
);
// Updates:
// - `balance += 1`.
// - `numberMinted += 1`.
//
// We can directly add to the `balance` and `numberMinted`.
_packedAddressData[to] += (1 << _BITPOS_NUMBER_MINTED) | 1;
// Mask `to` to the lower 160 bits, in case the upper bits somehow aren't clean.
uint256 toMasked = uint256(uint160(to)) & _BITMASK_ADDRESS;
if (toMasked == 0) _revert(MintToZeroAddress.selector);
assembly {
// Emit the `Transfer` event.
log4(
0, // Start of data (0, since no data).
0, // End of data (0, since no data).
_TRANSFER_EVENT_SIGNATURE, // Signature.
0, // `address(0)`.
toMasked, // `to`.
tokenId // `tokenId`.
)
}
++_spotMinted;
}
_afterTokenTransfers(address(0), to, tokenId, 1);
}
/**
* @dev Safely mints a single token at `tokenId`.
*
* Note: A spot-minted `tokenId` that has been burned can be re-minted again.
*
* Requirements:
*
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}.
* - `tokenId` must be greater than `_sequentialUpTo()`.
* - `tokenId` must not exist.
*
* See {_mintSpot}.
*
* Emits a {Transfer} event.
*/
function _safeMintSpot(
address to,
uint256 tokenId,
bytes memory _data
) internal virtual {
_mintSpot(to, tokenId);
unchecked {
if (to.code.length != 0) {
uint256 currentSpotMinted = _spotMinted;
if (!_checkContractOnERC721Received(address(0), to, tokenId, _data)) {
_revert(TransferToNonERC721ReceiverImplementer.selector);
}
// This prevents reentrancy to `_safeMintSpot`.
// It does not prevent reentrancy to `_safeMint`.
if (_spotMinted != currentSpotMinted) revert();
}
}
}
/**
* @dev Equivalent to `_safeMintSpot(to, tokenId, '')`.
*/
function _safeMintSpot(address to, uint256 tokenId) internal virtual {
_safeMintSpot(to, tokenId, '');
}
// =============================================================
// APPROVAL OPERATIONS
// =============================================================
/**
* @dev Equivalent to `_approve(to, tokenId, false)`.
*/
function _approve(address to, uint256 tokenId) internal virtual {
_approve(to, tokenId, false);
}
/**
* @dev Gives permission to `to` to transfer `tokenId` token to another account.
* The approval is cleared when the token is transferred.
*
* Only a single account can be approved at a time, so approving the
* zero address clears previous approvals.
*
* Requirements:
*
* - `tokenId` must exist.
*
* Emits an {Approval} event.
*/
function _approve(
address to,
uint256 tokenId,
bool approvalCheck
) internal virtual {
address owner = ownerOf(tokenId);
if (approvalCheck && _msgSenderERC721A() != owner)
if (!isApprovedForAll(owner, _msgSenderERC721A())) {
_revert(ApprovalCallerNotOwnerNorApproved.selector);
}
_tokenApprovals[tokenId].value = to;
emit Approval(owner, to, tokenId);
}
// =============================================================
// BURN OPERATIONS
// =============================================================
/**
* @dev Equivalent to `_burn(tokenId, false)`.
*/
function _burn(uint256 tokenId) internal virtual {
_burn(tokenId, false);
}
/**
* @dev Destroys `tokenId`.
* The approval is cleared when the token is burned.
*
* Requirements:
*
* - `tokenId` must exist.
*
* Emits a {Transfer} event.
*/
function _burn(uint256 tokenId, bool approvalCheck) internal virtual {
uint256 prevOwnershipPacked = _packedOwnershipOf(tokenId);
address from = address(uint160(prevOwnershipPacked));
(uint256 approvedAddressSlot, address approvedAddress) = _getApprovedSlotAndAddress(tokenId);
if (approvalCheck) {
// The nested ifs save around 20+ gas over a compound boolean condition.
if (!_isSenderApprovedOrOwner(approvedAddress, from, _msgSenderERC721A()))
if (!isApprovedForAll(from, _msgSenderERC721A())) _revert(TransferCallerNotOwnerNorApproved.selector);
}
_beforeTokenTransfers(from, address(0), tokenId, 1);
// Clear approvals from the previous owner.
assembly {
if approvedAddress {
// This is equivalent to `delete _tokenApprovals[tokenId]`.
sstore(approvedAddressSlot, 0)
}
}
// Underflow of the sender's balance is impossible because we check for
// ownership above and the recipient's balance can't realistically overflow.
// Counter overflow is incredibly unrealistic as `tokenId` would have to be 2**256.
unchecked {
// Updates:
// - `balance -= 1`.
// - `numberBurned += 1`.
//
// We can directly decrement the balance, and increment the number burned.
// This is equivalent to `packed -= 1; packed += 1 << _BITPOS_NUMBER_BURNED;`.
_packedAddressData[from] += (1 << _BITPOS_NUMBER_BURNED) - 1;
// Updates:
// - `address` to the last owner.
// - `startTimestamp` to the timestamp of burning.
// - `burned` to `true`.
// - `nextInitialized` to `true`.
_packedOwnerships[tokenId] = _packOwnershipData(
from,
(_BITMASK_BURNED | _BITMASK_NEXT_INITIALIZED) | _nextExtraData(from, address(0), prevOwnershipPacked)
);
// If the next slot may not have been initialized (i.e. `nextInitialized == false`) .
if (prevOwnershipPacked & _BITMASK_NEXT_INITIALIZED == 0) {
uint256 nextTokenId = tokenId + 1;
// If the next slot's address is zero and not burned (i.e. packed value is zero).
if (_packedOwnerships[nextTokenId] == 0) {
// If the next slot is within bounds.
if (nextTokenId != _currentIndex) {
// Initialize the next slot to maintain correctness for `ownerOf(tokenId + 1)`.
_packedOwnerships[nextTokenId] = prevOwnershipPacked;
}
}
}
}
emit Transfer(from, address(0), tokenId);
_afterTokenTransfers(from, address(0), tokenId, 1);
// Overflow not possible, as `_burnCounter` cannot be exceed `_currentIndex + _spotMinted` times.
unchecked {
_burnCounter++;
}
}
// =============================================================
// EXTRA DATA OPERATIONS
// =============================================================
/**
* @dev Directly sets the extra data for the ownership data `index`.
*/
function _setExtraDataAt(uint256 index, uint24 extraData) internal virtual {
uint256 packed = _packedOwnerships[index];
if (packed == 0) _revert(OwnershipNotInitializedForExtraData.selector);
uint256 extraDataCasted;
// Cast `extraData` with assembly to avoid redundant masking.
assembly {
extraDataCasted := extraData
}
packed = (packed & _BITMASK_EXTRA_DATA_COMPLEMENT) | (extraDataCasted << _BITPOS_EXTRA_DATA);
_packedOwnerships[index] = packed;
}
/**
* @dev Called during each token transfer to set the 24bit `extraData` field.
* Intended to be overridden by the cosumer contract.
*
* `previousExtraData` - the value of `extraData` before transfer.
*
* Calling conditions:
*
* - When `from` and `to` are both non-zero, `from`'s `tokenId` will be
* transferred to `to`.
* - When `from` is zero, `tokenId` will be minted for `to`.
* - When `to` is zero, `tokenId` will be burned by `from`.
* - `from` and `to` are never both zero.
*/
function _extraData(
address from,
address to,
uint24 previousExtraData
) internal view virtual returns (uint24) {}
/**
* @dev Returns the next extra data for the packed ownership data.
* The returned result is shifted into position.
*/
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;
}
// =============================================================
// OTHER OPERATIONS
// =============================================================
/**
* @dev Returns the message sender (defaults to `msg.sender`).
*
* If you are writing GSN compatible contracts, you need to override this function.
*/
function _msgSenderERC721A() internal view virtual returns (address) {
return msg.sender;
}
/**
* @dev Converts a uint256 to its ASCII string decimal representation.
*/
function _toString(uint256 value) internal pure virtual returns (string memory str) {
assembly {
// The maximum value of a uint256 contains 78 digits (1 byte per digit), but
// we allocate 0xa0 bytes to keep the free memory pointer 32-byte word aligned.
// We will need 1 word for the trailing zeros padding, 1 word for the length,
// and 3 words for a maximum of 78 digits. Total: 5 * 0x20 = 0xa0.
let m := add(mload(0x40), 0xa0)
// Update the free memory pointer to allocate.
mstore(0x40, m)
// Assign the `str` to the end.
str := sub(m, 0x20)
// Zeroize the slot after the string.
mstore(str, 0)
// Cache the end of the memory to calculate the length later.
let end := str
// We write the string from rightmost digit to leftmost digit.
// The following is essentially a do-while loop that also handles the zero case.
// prettier-ignore
for { let temp := value } 1 {} {
str := sub(str, 1)
// Write the character to the pointer.
// The ASCII index of the '0' character is 48.
mstore8(str, add(48, mod(temp, 10)))
// Keep dividing `temp` until zero.
temp := div(temp, 10)
// prettier-ignore
if iszero(temp) { break }
}
let length := sub(end, str)
// Move the pointer 32 bytes leftwards to make room for the length.
str := sub(str, 0x20)
// Store the length.
mstore(str, length)
}
}
/**
* @dev For more efficient reverts.
*/
function _revert(bytes4 errorSelector) internal pure {
assembly {
mstore(0x00, errorSelector)
revert(0x00, 0x04)
}
}
}
// File: .deps/github/limitbreakinc/creator-token-contracts/contracts/erc721c/ERC721AC.sol
pragma solidity ^0.8.4;
/**
* @title ERC721AC
* @author Limit Break, Inc.
* @notice Extends Azuki's ERC721-A implementation with Creator Token functionality, which
* allows the contract owner to update the transfer validation logic by managing a security policy in
* an external transfer validation security policy registry. See {CreatorTokenTransferValidator}.
*/
abstract contract ERC721AC is ERC721A, CreatorTokenBase {
constructor(string memory name_, string memory symbol_) CreatorTokenBase() ERC721A(name_, symbol_) {}
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
return interfaceId == type(ICreatorToken).interfaceId || super.supportsInterface(interfaceId);
}
/// @dev Ties the erc721a _beforeTokenTransfers hook to more granular transfer validation logic
function _beforeTokenTransfers(
address from,
address to,
uint256 startTokenId,
uint256 quantity
) internal virtual override {
for (uint256 i = 0; i < quantity;) {
_validateBeforeTransfer(from, to, startTokenId + i);
unchecked {
++i;
}
}
}
/// @dev Ties the erc721a _afterTokenTransfer hook to more granular transfer validation logic
function _afterTokenTransfers(
address from,
address to,
uint256 startTokenId,
uint256 quantity
) internal virtual override {
for (uint256 i = 0; i < quantity;) {
_validateAfterTransfer(from, to, startTokenId + i);
unchecked {
++i;
}
}
}
function _msgSenderERC721A() internal view virtual override returns (address) {
return _msgSender();
}
}
// File: @openzeppelin/contracts/interfaces/IERC2981.sol
// OpenZeppelin Contracts (last updated v5.1.0) (interfaces/IERC2981.sol)
pragma solidity ^0.8.20;
/**
* @dev Interface for the NFT Royalty Standard.
*
* A standardized way to retrieve royalty payment information for non-fungible tokens (NFTs) to enable universal
* support for royalty payments across all NFT marketplaces and ecosystem participants.
*/
interface IERC2981 is IERC165 {
/**
* @dev Returns how much royalty is owed and to whom, based on a sale price that may be denominated in any unit of
* exchange. The royalty amount is denominated and should be paid in that same unit of exchange.
*
* NOTE: ERC-2981 allows setting the royalty to 100% of the price. In that case all the price would be sent to the
* royalty receiver and 0 tokens to the seller. Contracts dealing with royalty should consider empty transfers.
*/
function royaltyInfo(
uint256 tokenId,
uint256 salePrice
) external view returns (address receiver, uint256 royaltyAmount);
}
// File: @openzeppelin/contracts/utils/introspection/ERC165.sol
// OpenZeppelin Contracts (last updated v5.1.0) (utils/introspection/ERC165.sol)
pragma solidity ^0.8.20;
/**
* @dev Implementation of the {IERC165} interface.
*
* Contracts that want to implement ERC-165 should inherit from this contract and override {supportsInterface} to check
* for the additional interface id that will be supported. For example:
*
* ```solidity
* function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
* return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);
* }
* ```
*/
abstract contract ERC165 is IERC165 {
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual returns (bool) {
return interfaceId == type(IERC165).interfaceId;
}
}
// File: @openzeppelin/contracts/token/common/ERC2981.sol
// OpenZeppelin Contracts (last updated v5.1.0) (token/common/ERC2981.sol)
pragma solidity ^0.8.20;
/**
* @dev Implementation of the NFT Royalty Standard, a standardized way to retrieve royalty payment information.
*
* Royalty information can be specified globally for all token ids via {_setDefaultRoyalty}, and/or individually for
* specific token ids via {_setTokenRoyalty}. The latter takes precedence over the first.
*
* Royalty is specified as a fraction of sale price. {_feeDenominator} is overridable but defaults to 10000, meaning the
* fee is specified in basis points by default.
*
* IMPORTANT: ERC-2981 only specifies a way to signal royalty information and does not enforce its payment. See
* https://eips.ethereum.org/EIPS/eip-2981#optional-royalty-payments[Rationale] in the ERC. Marketplaces are expected to
* voluntarily pay royalties together with sales, but note that this standard is not yet widely supported.
*/
abstract contract ERC2981 is IERC2981, ERC165 {
struct RoyaltyInfo {
address receiver;
uint96 royaltyFraction;
}
RoyaltyInfo private _defaultRoyaltyInfo;
mapping(uint256 tokenId => RoyaltyInfo) private _tokenRoyaltyInfo;
/**
* @dev The default royalty set is invalid (eg. (numerator / denominator) >= 1).
*/
error ERC2981InvalidDefaultRoyalty(uint256 numerator, uint256 denominator);
/**
* @dev The default royalty receiver is invalid.
*/
error ERC2981InvalidDefaultRoyaltyReceiver(address receiver);
/**
* @dev The royalty set for an specific `tokenId` is invalid (eg. (numerator / denominator) >= 1).
*/
error ERC2981InvalidTokenRoyalty(uint256 tokenId, uint256 numerator, uint256 denominator);
/**
* @dev The royalty receiver for `tokenId` is invalid.
*/
error ERC2981InvalidTokenRoyaltyReceiver(uint256 tokenId, address receiver);
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override(IERC165, ERC165) returns (bool) {
return interfaceId == type(IERC2981).interfaceId || super.supportsInterface(interfaceId);
}
/**
* @inheritdoc IERC2981
*/
function royaltyInfo(
uint256 tokenId,
uint256 salePrice
) public view virtual returns (address receiver, uint256 amount) {
RoyaltyInfo storage _royaltyInfo = _tokenRoyaltyInfo[tokenId];
address royaltyReceiver = _royaltyInfo.receiver;
uint96 royaltyFraction = _royaltyInfo.royaltyFraction;
if (royaltyReceiver == address(0)) {
royaltyReceiver = _defaultRoyaltyInfo.receiver;
royaltyFraction = _defaultRoyaltyInfo.royaltyFraction;
}
uint256 royaltyAmount = (salePrice * royaltyFraction) / _feeDenominator();
return (royaltyReceiver, royaltyAmount);
}
/**
* @dev The denominator with which to interpret the fee set in {_setTokenRoyalty} and {_setDefaultRoyalty} as a
* fraction of the sale price. Defaults to 10000 so fees are expressed in basis points, but may be customized by an
* override.
*/
function _feeDenominator() internal pure virtual returns (uint96) {
return 10000;
}
/**
* @dev Sets the royalty information that all ids in this contract will default to.
*
* Requirements:
*
* - `receiver` cannot be the zero address.
* - `feeNumerator` cannot be greater than the fee denominator.
*/
function _setDefaultRoyalty(address receiver, uint96 feeNumerator) internal virtual {
uint256 denominator = _feeDenominator();
if (feeNumerator > denominator) {
// Royalty fee will exceed the sale price
revert ERC2981InvalidDefaultRoyalty(feeNumerator, denominator);
}
if (receiver == address(0)) {
revert ERC2981InvalidDefaultRoyaltyReceiver(address(0));
}
_defaultRoyaltyInfo = RoyaltyInfo(receiver, feeNumerator);
}
/**
* @dev Removes default royalty information.
*/
function _deleteDefaultRoyalty() internal virtual {
delete _defaultRoyaltyInfo;
}
/**
* @dev Sets the royalty information for a specific token id, overriding the global default.
*
* Requirements:
*
* - `receiver` cannot be the zero address.
* - `feeNumerator` cannot be greater than the fee denominator.
*/
function _setTokenRoyalty(uint256 tokenId, address receiver, uint96 feeNumerator) internal virtual {
uint256 denominator = _feeDenominator();
if (feeNumerator > denominator) {
// Royalty fee will exceed the sale price
revert ERC2981InvalidTokenRoyalty(tokenId, feeNumerator, denominator);
}
if (receiver == address(0)) {
revert ERC2981InvalidTokenRoyaltyReceiver(tokenId, address(0));
}
_tokenRoyaltyInfo[tokenId] = RoyaltyInfo(receiver, feeNumerator);
}
/**
* @dev Resets royalty information for the token id back to the global default.
*/
function _resetTokenRoyalty(uint256 tokenId) internal virtual {
delete _tokenRoyaltyInfo[tokenId];
}
}
// File: .deps/github/limitbreakinc/creator-token-contracts/contracts/programmable-royalties/BasicRoyalties.sol
pragma solidity ^0.8.4;
/**
* @title BasicRoyaltiesBase
* @author Limit Break, Inc.
* @dev Base functionality of an NFT mix-in contract implementing the most basic form of programmable royalties.
*/
abstract contract BasicRoyaltiesBase is ERC2981 {
event DefaultRoyaltySet(address indexed receiver, uint96 feeNumerator);
event TokenRoyaltySet(uint256 indexed tokenId, address indexed receiver, uint96 feeNumerator);
function _setDefaultRoyalty(address receiver, uint96 feeNumerator) internal virtual override {
super._setDefaultRoyalty(receiver, feeNumerator);
emit DefaultRoyaltySet(receiver, feeNumerator);
}
function _setTokenRoyalty(uint256 tokenId, address receiver, uint96 feeNumerator) internal virtual override {
super._setTokenRoyalty(tokenId, receiver, feeNumerator);
emit TokenRoyaltySet(tokenId, receiver, feeNumerator);
}
}
/**
* @title BasicRoyalties
* @author Limit Break, Inc.
* @notice Constructable BasicRoyalties Contract implementation.
*/
abstract contract BasicRoyalties is BasicRoyaltiesBase {
constructor(address receiver, uint96 feeNumerator) {
_setDefaultRoyalty(receiver, feeNumerator);
}
}
/**
* @title BasicRoyaltiesInitializable
* @author Limit Break, Inc.
* @notice Initializable BasicRoyalties Contract implementation to allow for EIP-1167 clones.
*/
abstract contract BasicRoyaltiesInitializable is BasicRoyaltiesBase {}
// File: .deps/github/limitbreakinc/creator-token-contracts/contracts/examples/erc721ac/ERC721ACWithBasicRoyalties.sol
pragma solidity ^0.8.4;
/**
* @title ERC721ACWithBasicRoyalties
* @author Limit Break, Inc.
* @notice Extension of ERC721AC that adds basic royalties support.
* @dev These contracts are intended for example use and are not intended for production deployments as-is.
*/
contract ERC721ACWithBasicRoyalties is OwnableBasic, ERC721AC, BasicRoyalties {
constructor(
address initialOwner_,
address royaltyReceiver_,
uint96 royaltyFeeNumerator_,
string memory name_,
string memory symbol_)
ERC721AC(name_, symbol_)
BasicRoyalties(royaltyReceiver_, royaltyFeeNumerator_) {
}
function supportsInterface(bytes4 interfaceId) public view virtual override(ERC721AC, ERC2981) returns (bool) {
return super.supportsInterface(interfaceId);
}
function setDefaultRoyalty(address receiver, uint96 feeNumerator) public {
_requireCallerIsContractOwner();
_setDefaultRoyalty(receiver, feeNumerator);
}
function setTokenRoyalty(uint256 tokenId, address receiver, uint96 feeNumerator) public {
_requireCallerIsContractOwner();
_setTokenRoyalty(tokenId, receiver, feeNumerator);
}
}
contract ANAGLYPHPUNKS is ERC721ACWithBasicRoyalties {
string private _baseTokenURI = "ipfs://QmdKNnsSiAmX4XkFjqpx2Rc91fpYbQogSgR631Cip3NTwC/";
uint256 public MINT_PRICE = 601000000000000;
uint256 public MAX_SUPPLY = 10000;
// Sale phases
enum SalePhase { CLOSED, WHITELIST, PUBLIC }
SalePhase public currentPhase = SalePhase.CLOSED;
// Whitelist configuration
bytes32 public merkleRoot=0x812b15b4b66a402dd7979c4e3a3c9260fae9a5e9aa001d9c15eb0b0078f0a8f2;
uint256 public whitelistStartTime;
uint256 public publicSaleStartTime;
// Mint limits per phase
uint256 public WHITELIST_MINT_LIMIT = 5;
uint256 public PUBLIC_MINT_LIMIT = 10000;
// Payment settings - default to free (false)
bool public whitelistPaid = false;
bool public publicPaid = true;
function setMintLimit(uint256 whitelist, uint256 _public) public {
_requireCallerIsContractOwner();
WHITELIST_MINT_LIMIT= whitelist;
PUBLIC_MINT_LIMIT= _public;
}
// Tracking mints per address per phase
mapping(address => uint256) public whitelistMinted;
mapping(address => uint256) public publicMinted;
constructor() ERC721ACWithBasicRoyalties(
0x4c08Fc1070eee577E8E9Ab8dd87D033857bd7b10,
0x4c08Fc1070eee577E8E9Ab8dd87D033857bd7b10,
10000, // 10% royalty
"ANAGLYPH PUNKS",
"AP"
) {
}
// Owner functions
function setBaseURI(string memory baseURI) external {
_requireCallerIsContractOwner();
_baseTokenURI = baseURI;
}
function setMintPrice(uint256 price) external {
_requireCallerIsContractOwner();
MINT_PRICE = price;
}
function setMerkleRoot(bytes32 _merkleRoot) external {
_requireCallerIsContractOwner();
merkleRoot = _merkleRoot;
}
function setSalePhase(SalePhase _phase) external {
_requireCallerIsContractOwner();
currentPhase = _phase;
if (_phase == SalePhase.WHITELIST && whitelistStartTime == 0) {
whitelistStartTime = block.timestamp;
} else if (_phase == SalePhase.PUBLIC && publicSaleStartTime == 0) {
publicSaleStartTime = block.timestamp;
}
}
function setWhitelistStartTime(uint256 _startTime) external {
_requireCallerIsContractOwner();
whitelistStartTime = _startTime;
}
function setPublicSaleStartTime(uint256 _startTime) external {
_requireCallerIsContractOwner();
publicSaleStartTime = _startTime;
}
function setWhitelistPaid(bool _isPaid) external {
_requireCallerIsContractOwner();
whitelistPaid = _isPaid;
}
function setPublicPaid(bool _isPaid) external {
_requireCallerIsContractOwner();
publicPaid = _isPaid;
}
function withdraw() external {
_requireCallerIsContractOwner();
payable(msg.sender).transfer(address(this).balance);
}
function setTotalSupply(uint256 total) public{
_requireCallerIsContractOwner();
MAX_SUPPLY= total;
}
// Single mint function handling both phases
function mint(uint256 quantity, bytes32[] calldata merkleProof) external payable {
require(currentPhase != SalePhase.CLOSED);
require(_totalMinted() + quantity <= MAX_SUPPLY);
require(quantity > 0);
if (currentPhase == SalePhase.WHITELIST) {
_handleWhitelistMint(quantity, merkleProof);
} else if (currentPhase == SalePhase.PUBLIC) {
_handlePublicMint(quantity);
}
_safeMint(msg.sender, quantity);
}
function _handleWhitelistMint(uint256 quantity, bytes32[] calldata merkleProof) internal {
require(block.timestamp >= whitelistStartTime);
require(_verifyWhitelist(msg.sender, merkleProof));
require(whitelistMinted[msg.sender] + quantity <= WHITELIST_MINT_LIMIT);
whitelistMinted[msg.sender] += quantity;
if (whitelistPaid) {
require(msg.value >= MINT_PRICE * quantity);
// Transfer payment to contract owner
(bool success, ) = payable(owner()).call{value: msg.value}("");
require(success);
}
}
function _handlePublicMint(uint256 quantity) internal {
require(block.timestamp >= publicSaleStartTime);
require(publicMinted[msg.sender] + quantity <= PUBLIC_MINT_LIMIT);
publicMinted[msg.sender] += quantity;
if (publicPaid) {
require(msg.value >= MINT_PRICE * quantity);
// Transfer payment to contract owner
(bool success, ) = payable(owner()).call{value: msg.value}("");
require(success);
}
}
function _verifyWhitelist(address user, bytes32[] calldata merkleProof) internal view returns (bool) {
if (merkleRoot == bytes32(0)) return false;
bytes32 leaf = keccak256(abi.encodePacked(user));
return MerkleProof.verify(merkleProof, merkleRoot, leaf);
}
// View functions
function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
if (!_exists(tokenId)) _revert(URIQueryForNonexistentToken.selector);
string memory baseURI = _baseURI();
return bytes(baseURI).length != 0 ? string(abi.encodePacked(baseURI, _toString(tokenId), "")) : '';
}
function _baseURI() internal view override returns (string memory) {
return _baseTokenURI;
}
function totalMinted() public view returns (uint256) {
return _totalMinted();
}
function tokensOfOwner(address owner) public view returns (uint256[] memory) {
uint256 tokenCount = balanceOf(owner);
uint256[] memory tokens = new uint256[](tokenCount);
for (uint256 i = 0; i < tokenCount; i++) {
tokens[i] = tokenOfOwnerByIndex(owner, i);
}
return tokens;
}
function tokenOfOwnerByIndex(address owner, uint256 index) public view returns (uint256) {
require(index < balanceOf(owner));
uint256 numMinted = _totalMinted();
uint256 tokenIdsIdx;
// Counter overflow is impossible as the loop breaks when tokenIdsIdx = numMinted
unchecked {
for (uint256 i = 0; i < numMinted; i++) {
address ownership = ownerOf(i);
if (ownership == owner) {
if (tokenIdsIdx == index) {
return i;
}
tokenIdsIdx++;
}
}
}
revert();
}
// Get current sale phase info
function getSaleInfo() public view returns (
SalePhase phase,
uint256 whitelistStart,
uint256 publicStart,
bool whitelistRequiresPayment,
bool publicRequiresPayment,
uint256 mintPrice
) {
phase = currentPhase;
whitelistStart = whitelistStartTime;
publicStart = publicSaleStartTime;
whitelistRequiresPayment = whitelistPaid;
publicRequiresPayment = publicPaid;
mintPrice = MINT_PRICE;
}
/**
* @notice Allows the contract owner to airdrop tokens to multiple addresses
* @param addresses Array of addresses to receive tokens
* @param quantities Array of quantities to mint for each address (optional)
* @dev If quantities array is empty, each address will receive 1 token
*/
function airdrop(address[] calldata addresses, uint256[] calldata quantities) external {
_requireCallerIsContractOwner();
uint256 addressesLength = addresses.length;
require(addressesLength > 0);
// Calculate total quantity and validate arrays
uint256 totalQuantity;
bool isUniformMint = quantities.length == 0;
if (isUniformMint) {
totalQuantity = addressesLength;
} else {
require(addressesLength == quantities.length);
for (uint256 i = 0; i < addressesLength;) {
totalQuantity += quantities[i];
unchecked { ++i; }
}
}
require(_totalMinted() + totalQuantity <= MAX_SUPPLY);
// Perform minting
for (uint256 i = 0; i < addressesLength;) {
address recipient = addresses[i];
require(recipient != address(0));
uint256 mintAmount = isUniformMint ? 1 : quantities[i];
_safeMint(recipient, mintAmount);
unchecked { ++i; }
}
}
}{
"optimizer": {
"enabled": true,
"runs": 200
},
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
},
"remappings": []
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"ApprovalCallerNotOwnerNorApproved","type":"error"},{"inputs":[],"name":"ApprovalQueryForNonexistentToken","type":"error"},{"inputs":[],"name":"BalanceQueryForZeroAddress","type":"error"},{"inputs":[],"name":"CreatorTokenBase__InvalidTransferValidatorContract","type":"error"},{"inputs":[],"name":"CreatorTokenBase__SetTransferValidatorFirst","type":"error"},{"inputs":[{"internalType":"uint256","name":"numerator","type":"uint256"},{"internalType":"uint256","name":"denominator","type":"uint256"}],"name":"ERC2981InvalidDefaultRoyalty","type":"error"},{"inputs":[{"internalType":"address","name":"receiver","type":"address"}],"name":"ERC2981InvalidDefaultRoyaltyReceiver","type":"error"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"numerator","type":"uint256"},{"internalType":"uint256","name":"denominator","type":"uint256"}],"name":"ERC2981InvalidTokenRoyalty","type":"error"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"address","name":"receiver","type":"address"}],"name":"ERC2981InvalidTokenRoyaltyReceiver","type":"error"},{"inputs":[],"name":"MintERC2309QuantityExceedsLimit","type":"error"},{"inputs":[],"name":"MintToZeroAddress","type":"error"},{"inputs":[],"name":"MintZeroQuantity","type":"error"},{"inputs":[],"name":"NotCompatibleWithSpotMints","type":"error"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"OwnableInvalidOwner","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"OwnableUnauthorizedAccount","type":"error"},{"inputs":[],"name":"OwnerQueryForNonexistentToken","type":"error"},{"inputs":[],"name":"OwnershipNotInitializedForExtraData","type":"error"},{"inputs":[],"name":"SequentialMintExceedsLimit","type":"error"},{"inputs":[],"name":"SequentialUpToTooSmall","type":"error"},{"inputs":[],"name":"ShouldNotMintToBurnAddress","type":"error"},{"inputs":[],"name":"SpotMintTokenIdTooSmall","type":"error"},{"inputs":[],"name":"TokenAlreadyExists","type":"error"},{"inputs":[],"name":"TransferCallerNotOwnerNorApproved","type":"error"},{"inputs":[],"name":"TransferFromIncorrectOwner","type":"error"},{"inputs":[],"name":"TransferToNonERC721ReceiverImplementer","type":"error"},{"inputs":[],"name":"TransferToZeroAddress","type":"error"},{"inputs":[],"name":"URIQueryForNonexistentToken","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":"uint256","name":"fromTokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"toTokenId","type":"uint256"},{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"}],"name":"ConsecutiveTransfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"receiver","type":"address"},{"indexed":false,"internalType":"uint96","name":"feeNumerator","type":"uint96"}],"name":"DefaultRoyaltySet","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":"uint256","name":"tokenId","type":"uint256"},{"indexed":true,"internalType":"address","name":"receiver","type":"address"},{"indexed":false,"internalType":"uint96","name":"feeNumerator","type":"uint96"}],"name":"TokenRoyaltySet","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"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"oldValidator","type":"address"},{"indexed":false,"internalType":"address","name":"newValidator","type":"address"}],"name":"TransferValidatorUpdated","type":"event"},{"inputs":[],"name":"DEFAULT_OPERATOR_WHITELIST_ID","outputs":[{"internalType":"uint120","name":"","type":"uint120"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DEFAULT_TRANSFER_SECURITY_LEVEL","outputs":[{"internalType":"enum TransferSecurityLevels","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DEFAULT_TRANSFER_VALIDATOR","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_SUPPLY","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MINT_PRICE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PUBLIC_MINT_LIMIT","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"WHITELIST_MINT_LIMIT","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"addresses","type":"address[]"},{"internalType":"uint256[]","name":"quantities","type":"uint256[]"}],"name":"airdrop","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","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":[],"name":"currentPhase","outputs":[{"internalType":"enum ANAGLYPHPUNKS.SalePhase","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getPermittedContractReceivers","outputs":[{"internalType":"address[]","name":"","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getSaleInfo","outputs":[{"internalType":"enum ANAGLYPHPUNKS.SalePhase","name":"phase","type":"uint8"},{"internalType":"uint256","name":"whitelistStart","type":"uint256"},{"internalType":"uint256","name":"publicStart","type":"uint256"},{"internalType":"bool","name":"whitelistRequiresPayment","type":"bool"},{"internalType":"bool","name":"publicRequiresPayment","type":"bool"},{"internalType":"uint256","name":"mintPrice","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getSecurityPolicy","outputs":[{"components":[{"internalType":"enum TransferSecurityLevels","name":"transferSecurityLevel","type":"uint8"},{"internalType":"uint120","name":"operatorWhitelistId","type":"uint120"},{"internalType":"uint120","name":"permittedContractReceiversId","type":"uint120"}],"internalType":"struct CollectionSecurityPolicy","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getTransferValidator","outputs":[{"internalType":"contract ICreatorTokenTransferValidator","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getWhitelistedOperators","outputs":[{"internalType":"address[]","name":"","type":"address[]"}],"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":"address","name":"receiver","type":"address"}],"name":"isContractReceiverPermitted","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"}],"name":"isOperatorWhitelisted","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"caller","type":"address"},{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"}],"name":"isTransferAllowed","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"merkleRoot","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"quantity","type":"uint256"},{"internalType":"bytes32[]","name":"merkleProof","type":"bytes32[]"}],"name":"mint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"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":[{"internalType":"address","name":"","type":"address"}],"name":"publicMinted","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"publicPaid","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"publicSaleStartTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"salePrice","type":"uint256"}],"name":"royaltyInfo","outputs":[{"internalType":"address","name":"receiver","type":"address"},{"internalType":"uint256","name":"amount","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":"safeTransferFrom","outputs":[],"stateMutability":"payable","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":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"baseURI","type":"string"}],"name":"setBaseURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"receiver","type":"address"},{"internalType":"uint96","name":"feeNumerator","type":"uint96"}],"name":"setDefaultRoyalty","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_merkleRoot","type":"bytes32"}],"name":"setMerkleRoot","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"whitelist","type":"uint256"},{"internalType":"uint256","name":"_public","type":"uint256"}],"name":"setMintLimit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"price","type":"uint256"}],"name":"setMintPrice","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"_isPaid","type":"bool"}],"name":"setPublicPaid","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_startTime","type":"uint256"}],"name":"setPublicSaleStartTime","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"enum ANAGLYPHPUNKS.SalePhase","name":"_phase","type":"uint8"}],"name":"setSalePhase","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"enum TransferSecurityLevels","name":"level","type":"uint8"},{"internalType":"uint120","name":"operatorWhitelistId","type":"uint120"},{"internalType":"uint120","name":"permittedContractReceiversAllowlistId","type":"uint120"}],"name":"setToCustomSecurityPolicy","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"validator","type":"address"},{"internalType":"enum TransferSecurityLevels","name":"level","type":"uint8"},{"internalType":"uint120","name":"operatorWhitelistId","type":"uint120"},{"internalType":"uint120","name":"permittedContractReceiversAllowlistId","type":"uint120"}],"name":"setToCustomValidatorAndSecurityPolicy","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"setToDefaultSecurityPolicy","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"address","name":"receiver","type":"address"},{"internalType":"uint96","name":"feeNumerator","type":"uint96"}],"name":"setTokenRoyalty","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"total","type":"uint256"}],"name":"setTotalSupply","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"transferValidator_","type":"address"}],"name":"setTransferValidator","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"_isPaid","type":"bool"}],"name":"setWhitelistPaid","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_startTime","type":"uint256"}],"name":"setWhitelistStartTime","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":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenOfOwnerByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"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":"owner","type":"address"}],"name":"tokensOfOwner","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalMinted","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"result","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":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"whitelistMinted","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"whitelistPaid","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"whitelistStartTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"}]Contract Creation Code
60e060405260366080818152906137f760a039600d9061001f9082610352565b506602229b37829000600e55612710600f8190556010805460ff191690557f812b15b4b66a402dd7979c4e3a3c9260fae9a5e9aa001d9c15eb0b0078f0a8f260115560056014556015556016805461ffff1916610100179055348015610083575f80fd5b50734c08fc1070eee577e8e9ab8dd87d033857bd7b10806127106040518060400160405280600e81526020016d414e41474c5950482050554e4b5360901b81525060405180604001604052806002815260200161041560f41b81525083838383734c08fc1070eee577e8e9ab8dd87d033857bd7b10828281600290816101099190610352565b5060036101168282610352565b50505f8055506001600160a01b03811661014a57604051631e4fbdf760e01b81525f60048201526024015b60405180910390fd5b61015381610172565b50505061016682826101c360201b60201c565b5050505050505061040c565b600980546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0905f90a35050565b6101cd8282610218565b6040516001600160601b03821681526001600160a01b038316907f8a8bae378cb731c5c40b632330c6836c2f916f48edb967699c86736f9a6a76ef9060200160405180910390a25050565b6127106001600160601b03821681101561025757604051636f483d0960e01b81526001600160601b038316600482015260248101829052604401610141565b6001600160a01b03831661028057604051635b6cc80560e11b81525f6004820152602401610141565b50604080518082019091526001600160a01b039092168083526001600160601b039091166020909201829052600160a01b90910217600b55565b634e487b7160e01b5f52604160045260245ffd5b600181811c908216806102e257607f821691505b60208210810361030057634e487b7160e01b5f52602260045260245ffd5b50919050565b601f82111561034d57805f5260205f20601f840160051c8101602085101561032b5750805b601f840160051c820191505b8181101561034a575f8155600101610337565b50505b505050565b81516001600160401b0381111561036b5761036b6102ba565b61037f8161037984546102ce565b84610306565b6020601f8211600181146103b1575f831561039a5750848201515b5f19600385901b1c1916600184901b17845561034a565b5f84815260208120601f198516915b828110156103e057878501518255602094850194600190920191016103c0565b50848210156103fd57868401515f19600387901b60f8161c191681555b50505050600190811b01905550565b6133de806104195f395ff3fe6080604052600436106103a8575f3560e01c80636c3b8699116101e9578063a9fc664e11610108578063d007af5c1161009d578063f2fde38b1161006d578063f2fde38b14610ae0578063f4a0a52814610aff578063f7ea7a3d14610b1e578063fd762d9214610b3d575f80fd5b8063d007af5c14610a29578063db83694c14610a3d578063e730738014610a7a578063e985e9c514610a99575f80fd5b8063bceae77b116100d8578063bceae77b146109bf578063be537f43146109d4578063c002d23d146109f5578063c87b56dd14610a0a575f80fd5b8063a9fc664e1461095b578063b88d4fde1461097a578063b950c9a51461098d578063ba41b0c6146109ac575f80fd5b80638462151c1161017e57806398a8cffe1161014e57806398a8cffe146108de5780639d645a4414610909578063a22cb46514610928578063a2309ff814610947575f80fd5b80638462151c1461086c5780638da5cb5b146108985780639292caaf146108b557806395d89b41146108ca575f80fd5b8063715018a6116101b9578063715018a614610805578063790b2f00146108195780637ad594311461082e5780637cb647591461084d575f80fd5b80636c3b8699146107945780636d5d40c6146107a85780636fad40d5146107c757806370a08231146107e6575f80fd5b80632a55205a116102d557806355f804b31161026a5780636352211e1161023a5780636352211e14610728578063672434821461074757806367b661d9146107665780636bb7b1d91461077f575f80fd5b806355f804b31461069f5780635944c753146106be5780635d4c1d46146106dd5780636134716214610709575f80fd5b806332cb6b0c116102a557806332cb6b0c146106425780633ccfd60b1461065757806342842e0e1461066b578063495c8bf91461067e575f80fd5b80632a55205a146105b15780632e8da829146105ef5780632eb4a7ab1461060e5780632f745c5914610623575f80fd5b8063095ea7b31161034b5780631b25b0771161031b5780631b25b0771461053f5780631c0ce3d31461055e5780631c33b3281461057d57806323b872dd1461059e575f80fd5b8063095ea7b3146104c2578063098144d4146104d55780631015805b146104f257806318160ddd1461052b575f80fd5b8063055ad42e11610386578063055ad42e1461043e57806306fdde0314610464578063081812fc146104855780630862854a146104a4575f80fd5b806301463546146103ac57806301ffc9a7146103ee57806304634d8d1461041d575b5f80fd5b3480156103b7575f80fd5b506103d171721c310194ccfc01e523fc93c9cccfa2a0ac81565b6040516001600160a01b0390911681526020015b60405180910390f35b3480156103f9575f80fd5b5061040d610408366004612902565b610b5c565b60405190151581526020016103e5565b348015610428575f80fd5b5061043c610437366004612947565b610b6c565b005b348015610449575f80fd5b506010546104579060ff1681565b6040516103e591906129a2565b34801561046f575f80fd5b50610478610b82565b6040516103e591906129de565b348015610490575f80fd5b506103d161049f3660046129f0565b610c12565b3480156104af575f80fd5b5060165461040d90610100900460ff1681565b61043c6104d0366004612a07565b610c4b565b3480156104e0575f80fd5b50600a546001600160a01b03166103d1565b3480156104fd575f80fd5b5061051d61050c366004612a31565b60186020525f908152604090205481565b6040519081526020016103e5565b348015610536575f80fd5b5061051d610c57565b34801561054a575f80fd5b5061040d610559366004612a4c565b610c6e565b348015610569575f80fd5b5061043c6105783660046129f0565b610d03565b348015610588575f80fd5b50610591600181565b6040516103e59190612aa4565b61043c6105ac366004612ab2565b610d10565b3480156105bc575f80fd5b506105d06105cb366004612af0565b610e84565b604080516001600160a01b0390931683526020830191909152016103e5565b3480156105fa575f80fd5b5061040d610609366004612a31565b610f09565b348015610619575f80fd5b5061051d60115481565b34801561062e575f80fd5b5061051d61063d366004612a07565b61100f565b34801561064d575f80fd5b5061051d600f5481565b348015610662575f80fd5b5061043c611080565b61043c610679366004612ab2565b6110b4565b348015610689575f80fd5b506106926110d3565b6040516103e59190612b10565b3480156106aa575f80fd5b5061043c6106b9366004612bf7565b6111dd565b3480156106c9575f80fd5b5061043c6106d8366004612c3b565b6111f1565b3480156106e8575f80fd5b506106f1600181565b6040516001600160781b0390911681526020016103e5565b348015610714575f80fd5b5061043c610723366004612c96565b611204565b348015610733575f80fd5b506103d16107423660046129f0565b61135f565b348015610752575f80fd5b5061043c610761366004612d13565b611369565b348015610771575f80fd5b5060165461040d9060ff1681565b34801561078a575f80fd5b5061051d60135481565b34801561079f575f80fd5b5061043c611474565b3480156107b3575f80fd5b5061043c6107c23660046129f0565b611563565b3480156107d2575f80fd5b5061043c6107e1366004612af0565b611570565b3480156107f1575f80fd5b5061051d610800366004612a31565b611583565b348015610810575f80fd5b5061043c6115c6565b348015610824575f80fd5b5061051d60145481565b348015610839575f80fd5b5061043c610848366004612d7d565b6115d9565b348015610858575f80fd5b5061043c6108673660046129f0565b61165f565b348015610877575f80fd5b5061088b610886366004612a31565b61166c565b6040516103e59190612d9b565b3480156108a3575f80fd5b506009546001600160a01b03166103d1565b3480156108c0575f80fd5b5061051d60125481565b3480156108d5575f80fd5b50610478611700565b3480156108e9575f80fd5b5061051d6108f8366004612a31565b60176020525f908152604090205481565b348015610914575f80fd5b5061040d610923366004612a31565b61170f565b348015610933575f80fd5b5061043c610942366004612ddf565b6117d4565b348015610952575f80fd5b5061051d61184c565b348015610966575f80fd5b5061043c610975366004612a31565b611855565b61043c610988366004612e16565b611974565b348015610998575f80fd5b5061043c6109a7366004612e90565b6119af565b61043c6109ba366004612eab565b6119ca565b3480156109ca575f80fd5b5061051d60155481565b3480156109df575f80fd5b506109e8611a75565b6040516103e59190612ef2565b348015610a00575f80fd5b5061051d600e5481565b348015610a15575f80fd5b50610478610a243660046129f0565b611b2c565b348015610a34575f80fd5b50610692611ba3565b348015610a48575f80fd5b50601054601254601354601654600e546040516103e59560ff9081169594938181169361010090910490911691612f30565b348015610a85575f80fd5b5061043c610a94366004612e90565b611c5a565b348015610aa4575f80fd5b5061040d610ab3366004612f68565b6001600160a01b039182165f90815260076020908152604080832093909416825291909152205460ff1690565b348015610aeb575f80fd5b5061043c610afa366004612a31565b611c7c565b348015610b0a575f80fd5b5061043c610b193660046129f0565b611cbb565b348015610b29575f80fd5b5061043c610b383660046129f0565b611cc8565b348015610b48575f80fd5b5061043c610b57366004612f94565b611cd5565b5f610b6682611dca565b92915050565b610b74611dfe565b610b7e8282611e06565b5050565b606060028054610b9190612fed565b80601f0160208091040260200160405190810160405280929190818152602001828054610bbd90612fed565b8015610c085780601f10610bdf57610100808354040283529160200191610c08565b820191905f5260205f20905b815481529060010190602001808311610beb57829003601f168201915b5050505050905090565b5f610c1c82611e5b565b610c3057610c306333d1c03960e21b611e9d565b505f908152600660205260409020546001600160a01b031690565b610b7e82826001611ea5565b6001545f54035f19805b14610c6b57600854015b90565b600a545f906001600160a01b031615610cf857600a5460405163050bf71960e31b81526001600160a01b038681166004830152858116602483015284811660448301529091169063285fb8c8906064015f6040518083038186803b158015610cd4575f80fd5b505afa925050508015610ce5575060015b610cf057505f610cfc565b506001610cfc565b5060015b9392505050565b610d0b611dfe565b601255565b5f610d1a82611f46565b6001600160a01b039485169490915081168414610d4057610d4062a1148160e81b611e9d565b5f8281526006602052604090208054338082146001600160a01b03881690911417610d8357610d6f8633610ab3565b610d8357610d83632ce44b5f60e11b611e9d565b610d908686866001611fd5565b8015610d9a575f82555b6001600160a01b038681165f9081526005602052604080822080545f19019055918716808252919020805460010190554260a01b17600160e11b175f85815260046020526040812091909155600160e11b84169003610e2657600184015f818152600460205260408120549003610e24575f548114610e24575f8181526004602052604090208490555b505b6001600160a01b0385168481887fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef5f80a4805f03610e6e57610e6e633a954ecd60e21b611e9d565b610e7b8787876001612002565b50505050505050565b5f828152600c6020526040812080548291906001600160a01b03811690600160a01b90046001600160601b031681610ed7575050600b546001600160a01b03811690600160a01b90046001600160601b03165b5f612710610eee6001600160601b03841689613039565b610ef89190613050565b9295509193505050505b9250929050565b600a545f906001600160a01b03161561100857600a54604051635caaa2a960e11b81523060048201526001600160a01b039091169063d72dde5e90829063b955455290602401606060405180830381865afa158015610f6a573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610f8e919061306f565b602001516040516001600160e01b031960e084901b1681526001600160781b0390911660048201526001600160a01b03851660248201526044015b602060405180830381865afa158015610fe4573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610b6691906130e0565b505f919050565b5f61101983611583565b8210611023575f80fd5b5f61102c612028565b90505f805b828110156103a8575f6110438261135f565b9050866001600160a01b0316816001600160a01b0316036110775785830361107057509250610b66915050565b6001909201915b50600101611031565b611088611dfe565b60405133904780156108fc02915f818181858888f193505050501580156110b1573d5f803e3d5ffd5b50565b6110ce83838360405180602001604052805f815250611974565b505050565b600a546060906001600160a01b0316156111cb57600a54604051635caaa2a960e11b81523060048201526001600160a01b0390911690633fe5df9990829063b955455290602401606060405180830381865afa158015611135573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611159919061306f565b602001516040516001600160e01b031960e084901b1681526001600160781b0390911660048201526024015b5f60405180830381865afa15801561119f573d5f803e3d5ffd5b505050506040513d5f823e601f3d908101601f191682016040526111c691908101906130fb565b905090565b50604080515f81526020810190915290565b6111e5611dfe565b600d610b7e82826131f1565b6111f9611dfe565b6110ce838383612032565b61120c611dfe565b5f61121f600a546001600160a01b031690565b90506001600160a01b03811661124857604051631cffe3dd60e11b815260040160405180910390fd5b604051630368065360e61b81526001600160a01b0382169063da0194c09061127690309088906004016132ab565b5f604051808303815f87803b15801561128d575f80fd5b505af115801561129f573d5f803e3d5ffd5b5050604051631182550160e11b81526001600160a01b0384169250632304aa0291506112d190309087906004016132c8565b5f604051808303815f87803b1580156112e8575f80fd5b505af11580156112fa573d5f803e3d5ffd5b505060405163235d10c560e21b81526001600160a01b0384169250638d744314915061132c90309086906004016132c8565b5f604051808303815f87803b158015611343575f80fd5b505af1158015611355573d5f803e3d5ffd5b5050505050505050565b5f610b6682611f46565b611371611dfe565b828061137b575f80fd5b5f8215801561138c578291506113d1565b828414611397575f80fd5b5f5b838110156113cf578585828181106113b3576113b36132ea565b90506020020135836113c591906132fe565b9250600101611399565b505b600f54826113dd612028565b6113e791906132fe565b11156113f1575f80fd5b5f5b83811015611355575f88888381811061140e5761140e6132ea565b90506020020160208101906114239190612a31565b90506001600160a01b038116611437575f80fd5b5f8361145b5787878481811061144f5761144f6132ea565b9050602002013561145e565b60015b905061146a828261208b565b50506001016113f3565b61147c611dfe565b61149771721c310194ccfc01e523fc93c9cccfa2a0ac611855565b604051630368065360e61b815271721c310194ccfc01e523fc93c9cccfa2a0ac9063da0194c0906114cf9030906001906004016132ab565b5f604051808303815f87803b1580156114e6575f80fd5b505af11580156114f8573d5f803e3d5ffd5b5050604051631182550160e11b815271721c310194ccfc01e523fc93c9cccfa2a0ac9250632304aa0291506115349030906001906004016132c8565b5f604051808303815f87803b15801561154b575f80fd5b505af115801561155d573d5f803e3d5ffd5b50505050565b61156b611dfe565b601355565b611578611dfe565b601491909155601555565b5f6001600160a01b0382166115a2576115a26323d3ad8160e21b611e9d565b506001600160a01b03165f908152600560205260409020546001600160401b031690565b6115ce6120a4565b6115d75f6120d1565b565b6115e1611dfe565b6010805482919060ff191660018360028111156116005761160061297a565b021790555060018160028111156116195761161961297a565b1480156116265750601254155b15611632574260125550565b60028160028111156116465761164661297a565b1480156116535750601354155b156110b1574260135550565b611667611dfe565b601155565b60605f61167883611583565b90505f816001600160401b0381111561169357611693612b5b565b6040519080825280602002602001820160405280156116bc578160200160208202803683370190505b5090505f5b828110156116f8576116d3858261100f565b8282815181106116e5576116e56132ea565b60209081029190910101526001016116c1565b509392505050565b606060038054610b9190612fed565b600a545f906001600160a01b03161561100857600a54604051635caaa2a960e11b81523060048201526001600160a01b0390911690639445f53090829063b955455290602401606060405180830381865afa158015611770573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611794919061306f565b60409081015190516001600160e01b031960e084901b1681526001600160781b0390911660048201526001600160a01b0385166024820152604401610fc9565b335f8181526007602090815260408083206001600160a01b0387168085529252909120805460ff1916841515179055906001600160a01b03167f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c3183604051611840911515815260200190565b60405180910390a35050565b5f6111c6612028565b61185d611dfe565b5f6001600160a01b0382163b156118d6576040516301ffc9a760e01b81525f60048201526001600160a01b038316906301ffc9a790602401602060405180830381865afa9250505080156118ce575060408051601f3d908101601f191682019092526118cb918101906130e0565b60015b156118d65790505b6001600160a01b038216158015906118ec575080155b1561190a576040516332483afb60e01b815260040160405180910390fd5b600a54604080516001600160a01b03928316815291841660208301527fcc5dc080ff977b3c3a211fa63ab74f90f658f5ba9d3236e92c8f59570f442aac910160405180910390a150600a80546001600160a01b0319166001600160a01b0392909216919091179055565b61197f848484610d10565b6001600160a01b0383163b1561155d5761199b84848484612122565b61155d5761155d6368d2bf6b60e11b611e9d565b6119b7611dfe565b6016805460ff1916911515919091179055565b5f60105460ff1660028111156119e2576119e261297a565b036119eb575f80fd5b600f54836119f7612028565b611a0191906132fe565b1115611a0b575f80fd5b5f8311611a16575f80fd5b600160105460ff166002811115611a2f57611a2f61297a565b03611a4457611a3f838383612201565b611a6b565b600260105460ff166002811115611a5d57611a5d61297a565b03611a6b57611a6b836122fc565b6110ce338461208b565b604080516060810182525f8082526020820181905291810191909152600a546001600160a01b031615611b0c57600a54604051635caaa2a960e11b81523060048201526001600160a01b039091169063b955455290602401606060405180830381865afa158015611ae8573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906111c6919061306f565b50604080516060810182525f808252602082018190529181019190915290565b6060611b3782611e5b565b611b4b57611b4b630a14c4b560e41b611e9d565b5f611b546123e9565b905080515f03611b725760405180602001604052805f815250610cfc565b80611b7c846123f8565b604051602001611b8d929190613328565b6040516020818303038152906040529392505050565b600a546060906001600160a01b0316156111cb57600a54604051635caaa2a960e11b81523060048201526001600160a01b03909116906317e94a6c90829063b955455290602401606060405180830381865afa158015611c05573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611c29919061306f565b60409081015190516001600160e01b031960e084901b1681526001600160781b039091166004820152602401611185565b611c62611dfe565b601680549115156101000261ff0019909216919091179055565b611c846120a4565b6001600160a01b038116611cb257604051631e4fbdf760e01b81525f60048201526024015b60405180910390fd5b6110b1816120d1565b611cc3611dfe565b600e55565b611cd0611dfe565b600f55565b611cdd611dfe565b611ce684611855565b604051630368065360e61b81526001600160a01b0385169063da0194c090611d1490309087906004016132ab565b5f604051808303815f87803b158015611d2b575f80fd5b505af1158015611d3d573d5f803e3d5ffd5b5050604051631182550160e11b81526001600160a01b0387169250632304aa029150611d6f90309086906004016132c8565b5f604051808303815f87803b158015611d86575f80fd5b505af1158015611d98573d5f803e3d5ffd5b505060405163235d10c560e21b81526001600160a01b0387169250638d744314915061132c90309085906004016132c8565b5f6001600160e01b0319821663152a902d60e11b1480610b6657506301ffc9a760e01b6001600160e01b0319831614610b66565b6115d76120a4565b611e10828261243b565b6040516001600160601b03821681526001600160a01b038316907f8a8bae378cb731c5c40b632330c6836c2f916f48edb967699c86736f9a6a76ef9060200160405180910390a25050565b5f8054821015611e98575f5b505f8281526004602052604081205490819003611e8e57611e878361333c565b9250611e67565b600160e01b161590505b919050565b805f5260045ffd5b5f611eaf8361135f565b9050818015611ec75750336001600160a01b03821614155b15611eea57611ed68133610ab3565b611eea57611eea6367d9dca160e11b611e9d565b5f8381526006602052604080822080546001600160a01b0319166001600160a01b0388811691821790925591518693918516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591a450505050565b5f81815260046020526040902054805f03611fb3575f548210611f7357611f73636f96cda160e11b611e9d565b5b505f19015f818152600460205260409020548015611f7457600160e01b81165f03611f9e57919050565b611fae636f96cda160e11b611e9d565b611f74565b600160e01b81165f03611fc557919050565b611e98636f96cda160e11b611e9d565b5f5b81811015611ffb57611ff38585611fee84876132fe565b6124dd565b600101611fd7565b5050505050565b5f5b81811015611ffb57612020858561201b84876132fe565b612533565b600101612004565b5f545f1980610c61565b61203d83838361257a565b6040516001600160601b03821681526001600160a01b0383169084907f7f5b076c952c0ec86e5425963c1326dd0f03a3595c19f81d765e8ff559a6e33c9060200160405180910390a3505050565b610b7e828260405180602001604052805f81525061263a565b6009546001600160a01b031633146115d75760405163118cdaa760e01b8152336004820152602401611ca9565b600980546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0905f90a35050565b604051630a85bd0160e11b81525f906001600160a01b0385169063150b7a0290612156903390899088908890600401613351565b6020604051808303815f875af1925050508015612190575060408051601f3d908101601f1916820190925261218d9181019061338d565b60015b6121e3573d8080156121bd576040519150601f19603f3d011682016040523d82523d5f602084013e6121c2565b606091505b5080515f036121db576121db6368d2bf6b60e11b611e9d565b805181602001fd5b6001600160e01b031916630a85bd0160e11b1490505b949350505050565b60125442101561220f575f80fd5b61221a338383612693565b612222575f80fd5b601454335f9081526017602052604090205461223f9085906132fe565b1115612249575f80fd5b335f90815260176020526040812080548592906122679084906132fe565b909155505060165460ff16156110ce5782600e546122859190613039565b341015612290575f80fd5b5f6122a36009546001600160a01b031690565b6001600160a01b0316346040515f6040518083038185875af1925050503d805f81146122ea576040519150601f19603f3d011682016040523d82523d5f602084013e6122ef565b606091505b505090508061155d575f80fd5b60135442101561230a575f80fd5b601554335f908152601860205260409020546123279083906132fe565b1115612331575f80fd5b335f908152601860205260408120805483929061234f9084906132fe565b9091555050601654610100900460ff16156110b15780600e546123729190613039565b34101561237d575f80fd5b5f6123906009546001600160a01b031690565b6001600160a01b0316346040515f6040518083038185875af1925050503d805f81146123d7576040519150601f19603f3d011682016040523d82523d5f602084013e6123dc565b606091505b5050905080610b7e575f80fd5b6060600d8054610b9190612fed565b606060a06040510180604052602081039150505f815280825b600183039250600a81066030018353600a9004806124115750819003601f19909101908152919050565b6127106001600160601b03821681101561247a57604051636f483d0960e01b81526001600160601b038316600482015260248101829052604401611ca9565b6001600160a01b0383166124a357604051635b6cc80560e11b81525f6004820152602401611ca9565b50604080518082019091526001600160a01b039092168083526001600160601b039091166020909201829052600160a01b90910217600b55565b6001600160a01b0383811615908316158180156124f75750805b1561251557604051635cbd944160e01b815260040160405180910390fd5b8115612521575b611ffb565b8061251c57611ffb3386868634612725565b6001600160a01b03838116159083161581801561254d5750805b1561256b57604051635cbd944160e01b815260040160405180910390fd5b8161251c578061251c57611ffb565b6127106001600160601b0382168110156125c05760405163dfd1fc1b60e01b8152600481018590526001600160601b038316602482015260448101829052606401611ca9565b6001600160a01b0383166125f057604051634b4f842960e11b8152600481018590525f6024820152604401611ca9565b506040805180820182526001600160a01b0393841681526001600160601b0392831660208083019182525f968752600c90529190942093519051909116600160a01b029116179055565b61264483836127a6565b6001600160a01b0383163b156110ce575f548281035b61266c5f868380600101945086612122565b612680576126806368d2bf6b60e11b611e9d565b81811061265a57815f5414611ffb575f80fd5b6011545f906126a357505f610cfc565b6040516bffffffffffffffffffffffff19606086901b1660208201525f9060340160405160208183030381529060405280519060200120905061271c8484808060200260200160405190810160405280939291908181526020018383602002808284375f92019190915250506011549150849050612875565b95945050505050565b600a546001600160a01b031615611ffb57600a5460405163050bf71960e31b81526001600160a01b038781166004830152868116602483015285811660448301529091169063285fb8c8906064015f6040518083038186803b158015612789575f80fd5b505afa15801561279b573d5f803e3d5ffd5b505050505050505050565b5f8054908290036127c1576127c163b562e8dd60e01b611e9d565b6127cd5f848385611fd5565b5f8181526004602090815260408083206001600160a01b0387164260a01b6001881460e11b1781179091558084526005909252822080546801000000000000000186020190559081900361282a5761282a622e076360e81b611e9d565b818301825b80835f7fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef5f80a481816001019150810361282f57505f9081556110ce9150848385612002565b5f82612881858461288a565b14949350505050565b5f81815b84518110156116f8576128ba828683815181106128ad576128ad6132ea565b60200260200101516128c4565b915060010161288e565b5f8183106128de575f828152602084905260409020610cfc565b505f9182526020526040902090565b6001600160e01b0319811681146110b1575f80fd5b5f60208284031215612912575f80fd5b8135610cfc816128ed565b6001600160a01b03811681146110b1575f80fd5b80356001600160601b0381168114611e98575f80fd5b5f8060408385031215612958575f80fd5b82356129638161291d565b915061297160208401612931565b90509250929050565b634e487b7160e01b5f52602160045260245ffd5b6003811061299e5761299e61297a565b9052565b60208101610b66828461298e565b5f81518084528060208401602086015e5f602082860101526020601f19601f83011685010191505092915050565b602081525f610cfc60208301846129b0565b5f60208284031215612a00575f80fd5b5035919050565b5f8060408385031215612a18575f80fd5b8235612a238161291d565b946020939093013593505050565b5f60208284031215612a41575f80fd5b8135610cfc8161291d565b5f805f60608486031215612a5e575f80fd5b8335612a698161291d565b92506020840135612a798161291d565b91506040840135612a898161291d565b809150509250925092565b6007811061299e5761299e61297a565b60208101610b668284612a94565b5f805f60608486031215612ac4575f80fd5b8335612acf8161291d565b92506020840135612adf8161291d565b929592945050506040919091013590565b5f8060408385031215612b01575f80fd5b50508035926020909101359150565b602080825282518282018190525f918401906040840190835b81811015612b505783516001600160a01b0316835260209384019390920191600101612b29565b509095945050505050565b634e487b7160e01b5f52604160045260245ffd5b604051601f8201601f191681016001600160401b0381118282101715612b9757612b97612b5b565b604052919050565b5f806001600160401b03841115612bb857612bb8612b5b565b50601f8301601f1916602001612bcd81612b6f565b915050828152838383011115612be1575f80fd5b828260208301375f602084830101529392505050565b5f60208284031215612c07575f80fd5b81356001600160401b03811115612c1c575f80fd5b8201601f81018413612c2c575f80fd5b6121f984823560208401612b9f565b5f805f60608486031215612c4d575f80fd5b833592506020840135612c5f8161291d565b9150612c6d60408501612931565b90509250925092565b600781106110b1575f80fd5b6001600160781b03811681146110b1575f80fd5b5f805f60608486031215612ca8575f80fd5b8335612cb381612c76565b92506020840135612cc381612c82565b91506040840135612a8981612c82565b5f8083601f840112612ce3575f80fd5b5081356001600160401b03811115612cf9575f80fd5b6020830191508360208260051b8501011115610f02575f80fd5b5f805f8060408587031215612d26575f80fd5b84356001600160401b03811115612d3b575f80fd5b612d4787828801612cd3565b90955093505060208501356001600160401b03811115612d65575f80fd5b612d7187828801612cd3565b95989497509550505050565b5f60208284031215612d8d575f80fd5b813560038110610cfc575f80fd5b602080825282518282018190525f918401906040840190835b81811015612b50578351835260209384019390920191600101612db4565b80151581146110b1575f80fd5b5f8060408385031215612df0575f80fd5b8235612dfb8161291d565b91506020830135612e0b81612dd2565b809150509250929050565b5f805f8060808587031215612e29575f80fd5b8435612e348161291d565b93506020850135612e448161291d565b92506040850135915060608501356001600160401b03811115612e65575f80fd5b8501601f81018713612e75575f80fd5b612e8487823560208401612b9f565b91505092959194509250565b5f60208284031215612ea0575f80fd5b8135610cfc81612dd2565b5f805f60408486031215612ebd575f80fd5b8335925060208401356001600160401b03811115612ed9575f80fd5b612ee586828701612cd3565b9497909650939450505050565b5f606082019050612f04828451612a94565b6001600160781b0360208401511660208301526001600160781b03604084015116604083015292915050565b60c08101612f3e828961298e565b6020820196909652604081019490945291151560608401521515608083015260a090910152919050565b5f8060408385031215612f79575f80fd5b8235612f848161291d565b91506020830135612e0b8161291d565b5f805f8060808587031215612fa7575f80fd5b8435612fb28161291d565b93506020850135612fc281612c76565b92506040850135612fd281612c82565b91506060850135612fe281612c82565b939692955090935050565b600181811c9082168061300157607f821691505b60208210810361301f57634e487b7160e01b5f52602260045260245ffd5b50919050565b634e487b7160e01b5f52601160045260245ffd5b8082028115828204841417610b6657610b66613025565b5f8261306a57634e487b7160e01b5f52601260045260245ffd5b500490565b5f6060828403128015613080575f80fd5b50604051606081016001600160401b03811182821017156130a3576130a3612b5b565b60405282516130b181612c76565b815260208301516130c181612c82565b602082015260408301516130d481612c82565b60408201529392505050565b5f602082840312156130f0575f80fd5b8151610cfc81612dd2565b5f6020828403121561310b575f80fd5b81516001600160401b03811115613120575f80fd5b8201601f81018413613130575f80fd5b80516001600160401b0381111561314957613149612b5b565b8060051b61315960208201612b6f565b91825260208184018101929081019087841115613174575f80fd5b6020850194505b838510156131a257845192506131908361291d565b8282526020948501949091019061317b565b979650505050505050565b601f8211156110ce57805f5260205f20601f840160051c810160208510156131d25750805b601f840160051c820191505b81811015611ffb575f81556001016131de565b81516001600160401b0381111561320a5761320a612b5b565b61321e816132188454612fed565b846131ad565b6020601f821160018114613250575f83156132395750848201515b5f19600385901b1c1916600184901b178455611ffb565b5f84815260208120601f198516915b8281101561327f578785015182556020948501946001909201910161325f565b508482101561329c57868401515f19600387901b60f8161c191681555b50505050600190811b01905550565b6001600160a01b038316815260408101610cfc6020830184612a94565b6001600160a01b039290921682526001600160781b0316602082015260400190565b634e487b7160e01b5f52603260045260245ffd5b80820180821115610b6657610b66613025565b5f81518060208401855e5f93019283525090919050565b5f6121f96133368386613311565b84613311565b5f8161334a5761334a613025565b505f190190565b6001600160a01b03858116825284166020820152604081018390526080606082018190525f90613383908301846129b0565b9695505050505050565b5f6020828403121561339d575f80fd5b8151610cfc816128ed56fea2646970667358221220c5f26a5eb723b37d514a8bfd93a94af2a9670e145bf7715b384fc56fa9cf73c164736f6c634300081a0033697066733a2f2f516d644b4e6e735369416d5834586b466a717078325263393166705962516f67536752363331436970334e5477432f
Deployed Bytecode
0x6080604052600436106103a8575f3560e01c80636c3b8699116101e9578063a9fc664e11610108578063d007af5c1161009d578063f2fde38b1161006d578063f2fde38b14610ae0578063f4a0a52814610aff578063f7ea7a3d14610b1e578063fd762d9214610b3d575f80fd5b8063d007af5c14610a29578063db83694c14610a3d578063e730738014610a7a578063e985e9c514610a99575f80fd5b8063bceae77b116100d8578063bceae77b146109bf578063be537f43146109d4578063c002d23d146109f5578063c87b56dd14610a0a575f80fd5b8063a9fc664e1461095b578063b88d4fde1461097a578063b950c9a51461098d578063ba41b0c6146109ac575f80fd5b80638462151c1161017e57806398a8cffe1161014e57806398a8cffe146108de5780639d645a4414610909578063a22cb46514610928578063a2309ff814610947575f80fd5b80638462151c1461086c5780638da5cb5b146108985780639292caaf146108b557806395d89b41146108ca575f80fd5b8063715018a6116101b9578063715018a614610805578063790b2f00146108195780637ad594311461082e5780637cb647591461084d575f80fd5b80636c3b8699146107945780636d5d40c6146107a85780636fad40d5146107c757806370a08231146107e6575f80fd5b80632a55205a116102d557806355f804b31161026a5780636352211e1161023a5780636352211e14610728578063672434821461074757806367b661d9146107665780636bb7b1d91461077f575f80fd5b806355f804b31461069f5780635944c753146106be5780635d4c1d46146106dd5780636134716214610709575f80fd5b806332cb6b0c116102a557806332cb6b0c146106425780633ccfd60b1461065757806342842e0e1461066b578063495c8bf91461067e575f80fd5b80632a55205a146105b15780632e8da829146105ef5780632eb4a7ab1461060e5780632f745c5914610623575f80fd5b8063095ea7b31161034b5780631b25b0771161031b5780631b25b0771461053f5780631c0ce3d31461055e5780631c33b3281461057d57806323b872dd1461059e575f80fd5b8063095ea7b3146104c2578063098144d4146104d55780631015805b146104f257806318160ddd1461052b575f80fd5b8063055ad42e11610386578063055ad42e1461043e57806306fdde0314610464578063081812fc146104855780630862854a146104a4575f80fd5b806301463546146103ac57806301ffc9a7146103ee57806304634d8d1461041d575b5f80fd5b3480156103b7575f80fd5b506103d171721c310194ccfc01e523fc93c9cccfa2a0ac81565b6040516001600160a01b0390911681526020015b60405180910390f35b3480156103f9575f80fd5b5061040d610408366004612902565b610b5c565b60405190151581526020016103e5565b348015610428575f80fd5b5061043c610437366004612947565b610b6c565b005b348015610449575f80fd5b506010546104579060ff1681565b6040516103e591906129a2565b34801561046f575f80fd5b50610478610b82565b6040516103e591906129de565b348015610490575f80fd5b506103d161049f3660046129f0565b610c12565b3480156104af575f80fd5b5060165461040d90610100900460ff1681565b61043c6104d0366004612a07565b610c4b565b3480156104e0575f80fd5b50600a546001600160a01b03166103d1565b3480156104fd575f80fd5b5061051d61050c366004612a31565b60186020525f908152604090205481565b6040519081526020016103e5565b348015610536575f80fd5b5061051d610c57565b34801561054a575f80fd5b5061040d610559366004612a4c565b610c6e565b348015610569575f80fd5b5061043c6105783660046129f0565b610d03565b348015610588575f80fd5b50610591600181565b6040516103e59190612aa4565b61043c6105ac366004612ab2565b610d10565b3480156105bc575f80fd5b506105d06105cb366004612af0565b610e84565b604080516001600160a01b0390931683526020830191909152016103e5565b3480156105fa575f80fd5b5061040d610609366004612a31565b610f09565b348015610619575f80fd5b5061051d60115481565b34801561062e575f80fd5b5061051d61063d366004612a07565b61100f565b34801561064d575f80fd5b5061051d600f5481565b348015610662575f80fd5b5061043c611080565b61043c610679366004612ab2565b6110b4565b348015610689575f80fd5b506106926110d3565b6040516103e59190612b10565b3480156106aa575f80fd5b5061043c6106b9366004612bf7565b6111dd565b3480156106c9575f80fd5b5061043c6106d8366004612c3b565b6111f1565b3480156106e8575f80fd5b506106f1600181565b6040516001600160781b0390911681526020016103e5565b348015610714575f80fd5b5061043c610723366004612c96565b611204565b348015610733575f80fd5b506103d16107423660046129f0565b61135f565b348015610752575f80fd5b5061043c610761366004612d13565b611369565b348015610771575f80fd5b5060165461040d9060ff1681565b34801561078a575f80fd5b5061051d60135481565b34801561079f575f80fd5b5061043c611474565b3480156107b3575f80fd5b5061043c6107c23660046129f0565b611563565b3480156107d2575f80fd5b5061043c6107e1366004612af0565b611570565b3480156107f1575f80fd5b5061051d610800366004612a31565b611583565b348015610810575f80fd5b5061043c6115c6565b348015610824575f80fd5b5061051d60145481565b348015610839575f80fd5b5061043c610848366004612d7d565b6115d9565b348015610858575f80fd5b5061043c6108673660046129f0565b61165f565b348015610877575f80fd5b5061088b610886366004612a31565b61166c565b6040516103e59190612d9b565b3480156108a3575f80fd5b506009546001600160a01b03166103d1565b3480156108c0575f80fd5b5061051d60125481565b3480156108d5575f80fd5b50610478611700565b3480156108e9575f80fd5b5061051d6108f8366004612a31565b60176020525f908152604090205481565b348015610914575f80fd5b5061040d610923366004612a31565b61170f565b348015610933575f80fd5b5061043c610942366004612ddf565b6117d4565b348015610952575f80fd5b5061051d61184c565b348015610966575f80fd5b5061043c610975366004612a31565b611855565b61043c610988366004612e16565b611974565b348015610998575f80fd5b5061043c6109a7366004612e90565b6119af565b61043c6109ba366004612eab565b6119ca565b3480156109ca575f80fd5b5061051d60155481565b3480156109df575f80fd5b506109e8611a75565b6040516103e59190612ef2565b348015610a00575f80fd5b5061051d600e5481565b348015610a15575f80fd5b50610478610a243660046129f0565b611b2c565b348015610a34575f80fd5b50610692611ba3565b348015610a48575f80fd5b50601054601254601354601654600e546040516103e59560ff9081169594938181169361010090910490911691612f30565b348015610a85575f80fd5b5061043c610a94366004612e90565b611c5a565b348015610aa4575f80fd5b5061040d610ab3366004612f68565b6001600160a01b039182165f90815260076020908152604080832093909416825291909152205460ff1690565b348015610aeb575f80fd5b5061043c610afa366004612a31565b611c7c565b348015610b0a575f80fd5b5061043c610b193660046129f0565b611cbb565b348015610b29575f80fd5b5061043c610b383660046129f0565b611cc8565b348015610b48575f80fd5b5061043c610b57366004612f94565b611cd5565b5f610b6682611dca565b92915050565b610b74611dfe565b610b7e8282611e06565b5050565b606060028054610b9190612fed565b80601f0160208091040260200160405190810160405280929190818152602001828054610bbd90612fed565b8015610c085780601f10610bdf57610100808354040283529160200191610c08565b820191905f5260205f20905b815481529060010190602001808311610beb57829003601f168201915b5050505050905090565b5f610c1c82611e5b565b610c3057610c306333d1c03960e21b611e9d565b505f908152600660205260409020546001600160a01b031690565b610b7e82826001611ea5565b6001545f54035f19805b14610c6b57600854015b90565b600a545f906001600160a01b031615610cf857600a5460405163050bf71960e31b81526001600160a01b038681166004830152858116602483015284811660448301529091169063285fb8c8906064015f6040518083038186803b158015610cd4575f80fd5b505afa925050508015610ce5575060015b610cf057505f610cfc565b506001610cfc565b5060015b9392505050565b610d0b611dfe565b601255565b5f610d1a82611f46565b6001600160a01b039485169490915081168414610d4057610d4062a1148160e81b611e9d565b5f8281526006602052604090208054338082146001600160a01b03881690911417610d8357610d6f8633610ab3565b610d8357610d83632ce44b5f60e11b611e9d565b610d908686866001611fd5565b8015610d9a575f82555b6001600160a01b038681165f9081526005602052604080822080545f19019055918716808252919020805460010190554260a01b17600160e11b175f85815260046020526040812091909155600160e11b84169003610e2657600184015f818152600460205260408120549003610e24575f548114610e24575f8181526004602052604090208490555b505b6001600160a01b0385168481887fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef5f80a4805f03610e6e57610e6e633a954ecd60e21b611e9d565b610e7b8787876001612002565b50505050505050565b5f828152600c6020526040812080548291906001600160a01b03811690600160a01b90046001600160601b031681610ed7575050600b546001600160a01b03811690600160a01b90046001600160601b03165b5f612710610eee6001600160601b03841689613039565b610ef89190613050565b9295509193505050505b9250929050565b600a545f906001600160a01b03161561100857600a54604051635caaa2a960e11b81523060048201526001600160a01b039091169063d72dde5e90829063b955455290602401606060405180830381865afa158015610f6a573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610f8e919061306f565b602001516040516001600160e01b031960e084901b1681526001600160781b0390911660048201526001600160a01b03851660248201526044015b602060405180830381865afa158015610fe4573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610b6691906130e0565b505f919050565b5f61101983611583565b8210611023575f80fd5b5f61102c612028565b90505f805b828110156103a8575f6110438261135f565b9050866001600160a01b0316816001600160a01b0316036110775785830361107057509250610b66915050565b6001909201915b50600101611031565b611088611dfe565b60405133904780156108fc02915f818181858888f193505050501580156110b1573d5f803e3d5ffd5b50565b6110ce83838360405180602001604052805f815250611974565b505050565b600a546060906001600160a01b0316156111cb57600a54604051635caaa2a960e11b81523060048201526001600160a01b0390911690633fe5df9990829063b955455290602401606060405180830381865afa158015611135573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611159919061306f565b602001516040516001600160e01b031960e084901b1681526001600160781b0390911660048201526024015b5f60405180830381865afa15801561119f573d5f803e3d5ffd5b505050506040513d5f823e601f3d908101601f191682016040526111c691908101906130fb565b905090565b50604080515f81526020810190915290565b6111e5611dfe565b600d610b7e82826131f1565b6111f9611dfe565b6110ce838383612032565b61120c611dfe565b5f61121f600a546001600160a01b031690565b90506001600160a01b03811661124857604051631cffe3dd60e11b815260040160405180910390fd5b604051630368065360e61b81526001600160a01b0382169063da0194c09061127690309088906004016132ab565b5f604051808303815f87803b15801561128d575f80fd5b505af115801561129f573d5f803e3d5ffd5b5050604051631182550160e11b81526001600160a01b0384169250632304aa0291506112d190309087906004016132c8565b5f604051808303815f87803b1580156112e8575f80fd5b505af11580156112fa573d5f803e3d5ffd5b505060405163235d10c560e21b81526001600160a01b0384169250638d744314915061132c90309086906004016132c8565b5f604051808303815f87803b158015611343575f80fd5b505af1158015611355573d5f803e3d5ffd5b5050505050505050565b5f610b6682611f46565b611371611dfe565b828061137b575f80fd5b5f8215801561138c578291506113d1565b828414611397575f80fd5b5f5b838110156113cf578585828181106113b3576113b36132ea565b90506020020135836113c591906132fe565b9250600101611399565b505b600f54826113dd612028565b6113e791906132fe565b11156113f1575f80fd5b5f5b83811015611355575f88888381811061140e5761140e6132ea565b90506020020160208101906114239190612a31565b90506001600160a01b038116611437575f80fd5b5f8361145b5787878481811061144f5761144f6132ea565b9050602002013561145e565b60015b905061146a828261208b565b50506001016113f3565b61147c611dfe565b61149771721c310194ccfc01e523fc93c9cccfa2a0ac611855565b604051630368065360e61b815271721c310194ccfc01e523fc93c9cccfa2a0ac9063da0194c0906114cf9030906001906004016132ab565b5f604051808303815f87803b1580156114e6575f80fd5b505af11580156114f8573d5f803e3d5ffd5b5050604051631182550160e11b815271721c310194ccfc01e523fc93c9cccfa2a0ac9250632304aa0291506115349030906001906004016132c8565b5f604051808303815f87803b15801561154b575f80fd5b505af115801561155d573d5f803e3d5ffd5b50505050565b61156b611dfe565b601355565b611578611dfe565b601491909155601555565b5f6001600160a01b0382166115a2576115a26323d3ad8160e21b611e9d565b506001600160a01b03165f908152600560205260409020546001600160401b031690565b6115ce6120a4565b6115d75f6120d1565b565b6115e1611dfe565b6010805482919060ff191660018360028111156116005761160061297a565b021790555060018160028111156116195761161961297a565b1480156116265750601254155b15611632574260125550565b60028160028111156116465761164661297a565b1480156116535750601354155b156110b1574260135550565b611667611dfe565b601155565b60605f61167883611583565b90505f816001600160401b0381111561169357611693612b5b565b6040519080825280602002602001820160405280156116bc578160200160208202803683370190505b5090505f5b828110156116f8576116d3858261100f565b8282815181106116e5576116e56132ea565b60209081029190910101526001016116c1565b509392505050565b606060038054610b9190612fed565b600a545f906001600160a01b03161561100857600a54604051635caaa2a960e11b81523060048201526001600160a01b0390911690639445f53090829063b955455290602401606060405180830381865afa158015611770573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611794919061306f565b60409081015190516001600160e01b031960e084901b1681526001600160781b0390911660048201526001600160a01b0385166024820152604401610fc9565b335f8181526007602090815260408083206001600160a01b0387168085529252909120805460ff1916841515179055906001600160a01b03167f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c3183604051611840911515815260200190565b60405180910390a35050565b5f6111c6612028565b61185d611dfe565b5f6001600160a01b0382163b156118d6576040516301ffc9a760e01b81525f60048201526001600160a01b038316906301ffc9a790602401602060405180830381865afa9250505080156118ce575060408051601f3d908101601f191682019092526118cb918101906130e0565b60015b156118d65790505b6001600160a01b038216158015906118ec575080155b1561190a576040516332483afb60e01b815260040160405180910390fd5b600a54604080516001600160a01b03928316815291841660208301527fcc5dc080ff977b3c3a211fa63ab74f90f658f5ba9d3236e92c8f59570f442aac910160405180910390a150600a80546001600160a01b0319166001600160a01b0392909216919091179055565b61197f848484610d10565b6001600160a01b0383163b1561155d5761199b84848484612122565b61155d5761155d6368d2bf6b60e11b611e9d565b6119b7611dfe565b6016805460ff1916911515919091179055565b5f60105460ff1660028111156119e2576119e261297a565b036119eb575f80fd5b600f54836119f7612028565b611a0191906132fe565b1115611a0b575f80fd5b5f8311611a16575f80fd5b600160105460ff166002811115611a2f57611a2f61297a565b03611a4457611a3f838383612201565b611a6b565b600260105460ff166002811115611a5d57611a5d61297a565b03611a6b57611a6b836122fc565b6110ce338461208b565b604080516060810182525f8082526020820181905291810191909152600a546001600160a01b031615611b0c57600a54604051635caaa2a960e11b81523060048201526001600160a01b039091169063b955455290602401606060405180830381865afa158015611ae8573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906111c6919061306f565b50604080516060810182525f808252602082018190529181019190915290565b6060611b3782611e5b565b611b4b57611b4b630a14c4b560e41b611e9d565b5f611b546123e9565b905080515f03611b725760405180602001604052805f815250610cfc565b80611b7c846123f8565b604051602001611b8d929190613328565b6040516020818303038152906040529392505050565b600a546060906001600160a01b0316156111cb57600a54604051635caaa2a960e11b81523060048201526001600160a01b03909116906317e94a6c90829063b955455290602401606060405180830381865afa158015611c05573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611c29919061306f565b60409081015190516001600160e01b031960e084901b1681526001600160781b039091166004820152602401611185565b611c62611dfe565b601680549115156101000261ff0019909216919091179055565b611c846120a4565b6001600160a01b038116611cb257604051631e4fbdf760e01b81525f60048201526024015b60405180910390fd5b6110b1816120d1565b611cc3611dfe565b600e55565b611cd0611dfe565b600f55565b611cdd611dfe565b611ce684611855565b604051630368065360e61b81526001600160a01b0385169063da0194c090611d1490309087906004016132ab565b5f604051808303815f87803b158015611d2b575f80fd5b505af1158015611d3d573d5f803e3d5ffd5b5050604051631182550160e11b81526001600160a01b0387169250632304aa029150611d6f90309086906004016132c8565b5f604051808303815f87803b158015611d86575f80fd5b505af1158015611d98573d5f803e3d5ffd5b505060405163235d10c560e21b81526001600160a01b0387169250638d744314915061132c90309085906004016132c8565b5f6001600160e01b0319821663152a902d60e11b1480610b6657506301ffc9a760e01b6001600160e01b0319831614610b66565b6115d76120a4565b611e10828261243b565b6040516001600160601b03821681526001600160a01b038316907f8a8bae378cb731c5c40b632330c6836c2f916f48edb967699c86736f9a6a76ef9060200160405180910390a25050565b5f8054821015611e98575f5b505f8281526004602052604081205490819003611e8e57611e878361333c565b9250611e67565b600160e01b161590505b919050565b805f5260045ffd5b5f611eaf8361135f565b9050818015611ec75750336001600160a01b03821614155b15611eea57611ed68133610ab3565b611eea57611eea6367d9dca160e11b611e9d565b5f8381526006602052604080822080546001600160a01b0319166001600160a01b0388811691821790925591518693918516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591a450505050565b5f81815260046020526040902054805f03611fb3575f548210611f7357611f73636f96cda160e11b611e9d565b5b505f19015f818152600460205260409020548015611f7457600160e01b81165f03611f9e57919050565b611fae636f96cda160e11b611e9d565b611f74565b600160e01b81165f03611fc557919050565b611e98636f96cda160e11b611e9d565b5f5b81811015611ffb57611ff38585611fee84876132fe565b6124dd565b600101611fd7565b5050505050565b5f5b81811015611ffb57612020858561201b84876132fe565b612533565b600101612004565b5f545f1980610c61565b61203d83838361257a565b6040516001600160601b03821681526001600160a01b0383169084907f7f5b076c952c0ec86e5425963c1326dd0f03a3595c19f81d765e8ff559a6e33c9060200160405180910390a3505050565b610b7e828260405180602001604052805f81525061263a565b6009546001600160a01b031633146115d75760405163118cdaa760e01b8152336004820152602401611ca9565b600980546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0905f90a35050565b604051630a85bd0160e11b81525f906001600160a01b0385169063150b7a0290612156903390899088908890600401613351565b6020604051808303815f875af1925050508015612190575060408051601f3d908101601f1916820190925261218d9181019061338d565b60015b6121e3573d8080156121bd576040519150601f19603f3d011682016040523d82523d5f602084013e6121c2565b606091505b5080515f036121db576121db6368d2bf6b60e11b611e9d565b805181602001fd5b6001600160e01b031916630a85bd0160e11b1490505b949350505050565b60125442101561220f575f80fd5b61221a338383612693565b612222575f80fd5b601454335f9081526017602052604090205461223f9085906132fe565b1115612249575f80fd5b335f90815260176020526040812080548592906122679084906132fe565b909155505060165460ff16156110ce5782600e546122859190613039565b341015612290575f80fd5b5f6122a36009546001600160a01b031690565b6001600160a01b0316346040515f6040518083038185875af1925050503d805f81146122ea576040519150601f19603f3d011682016040523d82523d5f602084013e6122ef565b606091505b505090508061155d575f80fd5b60135442101561230a575f80fd5b601554335f908152601860205260409020546123279083906132fe565b1115612331575f80fd5b335f908152601860205260408120805483929061234f9084906132fe565b9091555050601654610100900460ff16156110b15780600e546123729190613039565b34101561237d575f80fd5b5f6123906009546001600160a01b031690565b6001600160a01b0316346040515f6040518083038185875af1925050503d805f81146123d7576040519150601f19603f3d011682016040523d82523d5f602084013e6123dc565b606091505b5050905080610b7e575f80fd5b6060600d8054610b9190612fed565b606060a06040510180604052602081039150505f815280825b600183039250600a81066030018353600a9004806124115750819003601f19909101908152919050565b6127106001600160601b03821681101561247a57604051636f483d0960e01b81526001600160601b038316600482015260248101829052604401611ca9565b6001600160a01b0383166124a357604051635b6cc80560e11b81525f6004820152602401611ca9565b50604080518082019091526001600160a01b039092168083526001600160601b039091166020909201829052600160a01b90910217600b55565b6001600160a01b0383811615908316158180156124f75750805b1561251557604051635cbd944160e01b815260040160405180910390fd5b8115612521575b611ffb565b8061251c57611ffb3386868634612725565b6001600160a01b03838116159083161581801561254d5750805b1561256b57604051635cbd944160e01b815260040160405180910390fd5b8161251c578061251c57611ffb565b6127106001600160601b0382168110156125c05760405163dfd1fc1b60e01b8152600481018590526001600160601b038316602482015260448101829052606401611ca9565b6001600160a01b0383166125f057604051634b4f842960e11b8152600481018590525f6024820152604401611ca9565b506040805180820182526001600160a01b0393841681526001600160601b0392831660208083019182525f968752600c90529190942093519051909116600160a01b029116179055565b61264483836127a6565b6001600160a01b0383163b156110ce575f548281035b61266c5f868380600101945086612122565b612680576126806368d2bf6b60e11b611e9d565b81811061265a57815f5414611ffb575f80fd5b6011545f906126a357505f610cfc565b6040516bffffffffffffffffffffffff19606086901b1660208201525f9060340160405160208183030381529060405280519060200120905061271c8484808060200260200160405190810160405280939291908181526020018383602002808284375f92019190915250506011549150849050612875565b95945050505050565b600a546001600160a01b031615611ffb57600a5460405163050bf71960e31b81526001600160a01b038781166004830152868116602483015285811660448301529091169063285fb8c8906064015f6040518083038186803b158015612789575f80fd5b505afa15801561279b573d5f803e3d5ffd5b505050505050505050565b5f8054908290036127c1576127c163b562e8dd60e01b611e9d565b6127cd5f848385611fd5565b5f8181526004602090815260408083206001600160a01b0387164260a01b6001881460e11b1781179091558084526005909252822080546801000000000000000186020190559081900361282a5761282a622e076360e81b611e9d565b818301825b80835f7fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef5f80a481816001019150810361282f57505f9081556110ce9150848385612002565b5f82612881858461288a565b14949350505050565b5f81815b84518110156116f8576128ba828683815181106128ad576128ad6132ea565b60200260200101516128c4565b915060010161288e565b5f8183106128de575f828152602084905260409020610cfc565b505f9182526020526040902090565b6001600160e01b0319811681146110b1575f80fd5b5f60208284031215612912575f80fd5b8135610cfc816128ed565b6001600160a01b03811681146110b1575f80fd5b80356001600160601b0381168114611e98575f80fd5b5f8060408385031215612958575f80fd5b82356129638161291d565b915061297160208401612931565b90509250929050565b634e487b7160e01b5f52602160045260245ffd5b6003811061299e5761299e61297a565b9052565b60208101610b66828461298e565b5f81518084528060208401602086015e5f602082860101526020601f19601f83011685010191505092915050565b602081525f610cfc60208301846129b0565b5f60208284031215612a00575f80fd5b5035919050565b5f8060408385031215612a18575f80fd5b8235612a238161291d565b946020939093013593505050565b5f60208284031215612a41575f80fd5b8135610cfc8161291d565b5f805f60608486031215612a5e575f80fd5b8335612a698161291d565b92506020840135612a798161291d565b91506040840135612a898161291d565b809150509250925092565b6007811061299e5761299e61297a565b60208101610b668284612a94565b5f805f60608486031215612ac4575f80fd5b8335612acf8161291d565b92506020840135612adf8161291d565b929592945050506040919091013590565b5f8060408385031215612b01575f80fd5b50508035926020909101359150565b602080825282518282018190525f918401906040840190835b81811015612b505783516001600160a01b0316835260209384019390920191600101612b29565b509095945050505050565b634e487b7160e01b5f52604160045260245ffd5b604051601f8201601f191681016001600160401b0381118282101715612b9757612b97612b5b565b604052919050565b5f806001600160401b03841115612bb857612bb8612b5b565b50601f8301601f1916602001612bcd81612b6f565b915050828152838383011115612be1575f80fd5b828260208301375f602084830101529392505050565b5f60208284031215612c07575f80fd5b81356001600160401b03811115612c1c575f80fd5b8201601f81018413612c2c575f80fd5b6121f984823560208401612b9f565b5f805f60608486031215612c4d575f80fd5b833592506020840135612c5f8161291d565b9150612c6d60408501612931565b90509250925092565b600781106110b1575f80fd5b6001600160781b03811681146110b1575f80fd5b5f805f60608486031215612ca8575f80fd5b8335612cb381612c76565b92506020840135612cc381612c82565b91506040840135612a8981612c82565b5f8083601f840112612ce3575f80fd5b5081356001600160401b03811115612cf9575f80fd5b6020830191508360208260051b8501011115610f02575f80fd5b5f805f8060408587031215612d26575f80fd5b84356001600160401b03811115612d3b575f80fd5b612d4787828801612cd3565b90955093505060208501356001600160401b03811115612d65575f80fd5b612d7187828801612cd3565b95989497509550505050565b5f60208284031215612d8d575f80fd5b813560038110610cfc575f80fd5b602080825282518282018190525f918401906040840190835b81811015612b50578351835260209384019390920191600101612db4565b80151581146110b1575f80fd5b5f8060408385031215612df0575f80fd5b8235612dfb8161291d565b91506020830135612e0b81612dd2565b809150509250929050565b5f805f8060808587031215612e29575f80fd5b8435612e348161291d565b93506020850135612e448161291d565b92506040850135915060608501356001600160401b03811115612e65575f80fd5b8501601f81018713612e75575f80fd5b612e8487823560208401612b9f565b91505092959194509250565b5f60208284031215612ea0575f80fd5b8135610cfc81612dd2565b5f805f60408486031215612ebd575f80fd5b8335925060208401356001600160401b03811115612ed9575f80fd5b612ee586828701612cd3565b9497909650939450505050565b5f606082019050612f04828451612a94565b6001600160781b0360208401511660208301526001600160781b03604084015116604083015292915050565b60c08101612f3e828961298e565b6020820196909652604081019490945291151560608401521515608083015260a090910152919050565b5f8060408385031215612f79575f80fd5b8235612f848161291d565b91506020830135612e0b8161291d565b5f805f8060808587031215612fa7575f80fd5b8435612fb28161291d565b93506020850135612fc281612c76565b92506040850135612fd281612c82565b91506060850135612fe281612c82565b939692955090935050565b600181811c9082168061300157607f821691505b60208210810361301f57634e487b7160e01b5f52602260045260245ffd5b50919050565b634e487b7160e01b5f52601160045260245ffd5b8082028115828204841417610b6657610b66613025565b5f8261306a57634e487b7160e01b5f52601260045260245ffd5b500490565b5f6060828403128015613080575f80fd5b50604051606081016001600160401b03811182821017156130a3576130a3612b5b565b60405282516130b181612c76565b815260208301516130c181612c82565b602082015260408301516130d481612c82565b60408201529392505050565b5f602082840312156130f0575f80fd5b8151610cfc81612dd2565b5f6020828403121561310b575f80fd5b81516001600160401b03811115613120575f80fd5b8201601f81018413613130575f80fd5b80516001600160401b0381111561314957613149612b5b565b8060051b61315960208201612b6f565b91825260208184018101929081019087841115613174575f80fd5b6020850194505b838510156131a257845192506131908361291d565b8282526020948501949091019061317b565b979650505050505050565b601f8211156110ce57805f5260205f20601f840160051c810160208510156131d25750805b601f840160051c820191505b81811015611ffb575f81556001016131de565b81516001600160401b0381111561320a5761320a612b5b565b61321e816132188454612fed565b846131ad565b6020601f821160018114613250575f83156132395750848201515b5f19600385901b1c1916600184901b178455611ffb565b5f84815260208120601f198516915b8281101561327f578785015182556020948501946001909201910161325f565b508482101561329c57868401515f19600387901b60f8161c191681555b50505050600190811b01905550565b6001600160a01b038316815260408101610cfc6020830184612a94565b6001600160a01b039290921682526001600160781b0316602082015260400190565b634e487b7160e01b5f52603260045260245ffd5b80820180821115610b6657610b66613025565b5f81518060208401855e5f93019283525090919050565b5f6121f96133368386613311565b84613311565b5f8161334a5761334a613025565b505f190190565b6001600160a01b03858116825284166020820152604081018390526080606082018190525f90613383908301846129b0565b9695505050505050565b5f6020828403121561339d575f80fd5b8151610cfc816128ed56fea2646970667358221220c5f26a5eb723b37d514a8bfd93a94af2a9670e145bf7715b384fc56fa9cf73c164736f6c634300081a0033
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 34 Chains
| Chain | Token | Portfolio % | Price | Amount | Value |
|---|
Loading...
Loading
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.