Source Code
EVM
More Info
Private Name Tags
ContractCreator
TokenTracker
Latest 25 from a total of 2,706 transactions
| Transaction Hash |
|
Block
|
From
|
To
|
|||||
|---|---|---|---|---|---|---|---|---|---|
| Set Approval For... | 32075847 | 31 days ago | IN | 0 ETH | 0.00000752 | ||||
| Set Approval For... | 32025208 | 31 days ago | IN | 0 ETH | 0.00000531 | ||||
| Set Approval For... | 32025200 | 31 days ago | IN | 0 ETH | 0.00000544 | ||||
| Set Approval For... | 31996913 | 31 days ago | IN | 0 ETH | 0.00000544 | ||||
| Set Approval For... | 31981490 | 31 days ago | IN | 0 ETH | 0.00000597 | ||||
| Set Approval For... | 31739543 | 33 days ago | IN | 0 ETH | 0.00000752 | ||||
| Set Approval For... | 30091727 | 44 days ago | IN | 0 ETH | 0.00000544 | ||||
| Set Approval For... | 26246215 | 66 days ago | IN | 0 ETH | 0.00000526 | ||||
| Set Approval For... | 26246196 | 66 days ago | IN | 0 ETH | 0.00000749 | ||||
| Set Approval For... | 23182361 | 82 days ago | IN | 0 ETH | 0.00000544 | ||||
| Set Approval For... | 21862240 | 92 days ago | IN | 0 ETH | 0.00000706 | ||||
| Set Approval For... | 20264622 | 117 days ago | IN | 0 ETH | 0.00000621 | ||||
| Set Approval For... | 19968813 | 122 days ago | IN | 0 ETH | 0.00000594 | ||||
| Set Approval For... | 19952330 | 122 days ago | IN | 0 ETH | 0.00000655 | ||||
| Set Approval For... | 19321142 | 132 days ago | IN | 0 ETH | 0.00000654 | ||||
| Set Approval For... | 18955927 | 138 days ago | IN | 0 ETH | 0.00000576 | ||||
| Set Approval For... | 18674863 | 141 days ago | IN | 0 ETH | 0.00000643 | ||||
| Set Approval For... | 17566277 | 155 days ago | IN | 0 ETH | 0.00000717 | ||||
| Set Approval For... | 17458843 | 156 days ago | IN | 0 ETH | 0.00000643 | ||||
| Set Approval For... | 17391756 | 157 days ago | IN | 0 ETH | 0.00000667 | ||||
| Set Approval For... | 17210930 | 159 days ago | IN | 0 ETH | 0.00000596 | ||||
| Set Approval For... | 17182459 | 160 days ago | IN | 0 ETH | 0.00000655 | ||||
| Safe Transfer Fr... | 16865066 | 163 days ago | IN | 0 ETH | 0.00000861 | ||||
| Set Approval For... | 16858598 | 163 days ago | IN | 0 ETH | 0.00000594 | ||||
| Set Approval For... | 16238389 | 171 days ago | IN | 0 ETH | 0.00000575 |
Latest 25 internal transactions (View All)
Advanced mode:
| Parent Transaction Hash | Block | From | To | |||
|---|---|---|---|---|---|---|
| 9307764 | 254 days ago | 0.02 ETH | ||||
| 9307697 | 254 days ago | 0.025 ETH | ||||
| 9307564 | 254 days ago | 0.05 ETH | ||||
| 9307337 | 254 days ago | 0.005 ETH | ||||
| 9307164 | 254 days ago | 0.005 ETH | ||||
| 9307106 | 254 days ago | 0.015 ETH | ||||
| 9307100 | 254 days ago | 0.01 ETH | ||||
| 9307076 | 254 days ago | 0.005 ETH | ||||
| 9306966 | 254 days ago | 0.02 ETH | ||||
| 9306893 | 254 days ago | 0.005 ETH | ||||
| 9306732 | 254 days ago | 0.005 ETH | ||||
| 9306606 | 254 days ago | 0.025 ETH | ||||
| 9306553 | 254 days ago | 0.005 ETH | ||||
| 9306535 | 254 days ago | 0.01 ETH | ||||
| 9306508 | 254 days ago | 0.005 ETH | ||||
| 9306457 | 254 days ago | 0.015 ETH | ||||
| 9306318 | 254 days ago | 0.005 ETH | ||||
| 9306157 | 254 days ago | 0.01 ETH | ||||
| 9306026 | 254 days ago | 0.005 ETH | ||||
| 9306014 | 254 days ago | 0.025 ETH | ||||
| 9305970 | 254 days ago | 0.005 ETH | ||||
| 9305943 | 254 days ago | 0.005 ETH | ||||
| 9305840 | 254 days ago | 0.02 ETH | ||||
| 9305722 | 254 days ago | 0.01 ETH | ||||
| 9305629 | 254 days ago | 0.09 ETH |
Cross-Chain Transactions
Loading...
Loading
Contract Name:
TheForsakenOnes
Compiler Version
v0.8.22+commit.4fc1097e
Optimization Enabled:
Yes with 200 runs
Other Settings:
paris EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
pragma solidity ^0.8.22;
import "erc721a/contracts/ERC721A.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol";
contract TheForsakenOnes is ERC721A, Ownable {
bytes32 private STAGE_0_MERKLE;
bytes32 private STAGE_1_MERKLE;
uint256 public immutable TOTAL_SUPPLY = 8000;
uint256 public PRICE = 0.005 ether;
string public BASE_URI;
uint8 MAX_MINT_PER_WALLET = 20;
bool public MINT_ENABLED;
uint8 public CURRENT_STAGE;
mapping(address => uint8) public minted_wl_0;
mapping(address => uint8) public minted_wl_1;
mapping(address => uint8) public minted_public;
constructor(address initialOwner) ERC721A("The Forsaken Ones", "TFO") Ownable(initialOwner) {
MINT_ENABLED = false;
CURRENT_STAGE = 0;
}
function mint_wl(
uint8 quantity,
uint8 max_quantity,
bytes32[] calldata merkleProof
) external payable {
require(MINT_ENABLED,"MINT_DISABLED");
require((totalSupply() + quantity) <= TOTAL_SUPPLY, "EXCEED_SUPPLY");
bytes32 leaf = keccak256(abi.encode(msg.sender, max_quantity));
bool stage_0_holder = MerkleProof.verify(merkleProof, STAGE_0_MERKLE, leaf);
bool stage_1_holder = MerkleProof.verify(merkleProof, STAGE_1_MERKLE, leaf);
if(CURRENT_STAGE == 0) {
require(stage_0_holder, "STAGE_1_DNQ");
require(minted_wl_0[msg.sender] + quantity <= max_quantity, "MAX_MINTED");
minted_wl_0[msg.sender] += quantity;
}
else if(CURRENT_STAGE == 1) {
require(stage_1_holder, "STAGE_2_DNQ");
require(minted_wl_1[msg.sender] + quantity <= max_quantity, "MAX_MINTED");
minted_wl_1[msg.sender] += quantity;
} else {
require(stage_0_holder || stage_1_holder, "STAGE_3_DNQ");
if(stage_0_holder) {
require(minted_wl_0[msg.sender] + quantity <= max_quantity, "MAX_MINTED");
minted_wl_0[msg.sender] += quantity;
} else {
require(minted_wl_1[msg.sender] + quantity <= max_quantity, "MAX_MINTED");
minted_wl_1[msg.sender] += quantity;
}
}
_mint(msg.sender, quantity);
}
function mint(
uint8 quantity
) external payable {
require(MINT_ENABLED,"MINT_DISABLED");
require(CURRENT_STAGE == 2, "MINT_DISABLED");
require((minted_public[msg.sender]+quantity <= MAX_MINT_PER_WALLET),"MAX_MINTED");
require((totalSupply() + quantity) <= TOTAL_SUPPLY, "EXCEED_SUPPLY");
require(msg.value >= PRICE * quantity, "INSUFFICIENT_FUNDS");
minted_public[msg.sender] += quantity;
_mint(msg.sender, quantity);
}
function set_stage(uint8 _stage) external onlyOwner {
require((_stage <= 2 && _stage >= 0),"INVALID_STAGE");
CURRENT_STAGE = _stage;
}
function toggle_mint() external onlyOwner {
MINT_ENABLED = !MINT_ENABLED;
}
function set_base_uri(string memory _base_uri) external onlyOwner {
BASE_URI = _base_uri;
}
function reserve(uint256 num) external onlyOwner {
require((totalSupply() + num) <= TOTAL_SUPPLY, "EXCEED_SUPPLY");
_safeMint(msg.sender, num);
}
function _baseURI() override internal view virtual returns (string memory) {
return BASE_URI;
}
function wallet_minted_stage_0() external view returns (uint8) {
return minted_wl_0[msg.sender];
}
function wallet_minted_stage_1() external view returns (uint8) {
return minted_wl_1[msg.sender];
}
function wallet_minted_public() external view returns (uint8) {
return minted_public[msg.sender];
}
function set_stage_0_merkle(bytes32 _merkle) external onlyOwner {
STAGE_0_MERKLE = _merkle;
}
function set_stage_1_merkle(bytes32 _merkle) external onlyOwner {
STAGE_1_MERKLE = _merkle;
}
function set_price(uint256 _price) external onlyOwner {
PRICE = _price;
}
function set_max_mint_per_wallet(uint8 _max_mint_per_wallet) external onlyOwner {
MAX_MINT_PER_WALLET = _max_mint_per_wallet;
}
function _startTokenId() internal pure override returns (uint256) {
return 1;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol)
pragma solidity ^0.8.20;
import {Context} from "../utils/Context.sol";
/**
* @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);
}
}// SPDX-License-Identifier: MIT
// 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;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.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) private pure returns (bytes32 value) {
assembly ("memory-safe") {
mstore(0x00, a)
mstore(0x20, b)
value := keccak256(0x00, 0x40)
}
}
}// SPDX-License-Identifier: MIT
// 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;
import {Hashes} from "./Hashes.sol";
/**
* @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];
}
}
}// SPDX-License-Identifier: MIT
// ERC721A Contracts v4.3.0
// Creator: Chiru Labs
pragma solidity ^0.8.4;
import './IERC721A.sol';
/**
* @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))) : '';
}
/**
* @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)
}
}
}// SPDX-License-Identifier: MIT
// 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);
}{
"optimizer": {
"enabled": true,
"runs": 200
},
"evmVersion": "paris",
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
},
"libraries": {}
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[{"internalType":"address","name":"initialOwner","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"ApprovalCallerNotOwnerNorApproved","type":"error"},{"inputs":[],"name":"ApprovalQueryForNonexistentToken","type":"error"},{"inputs":[],"name":"BalanceQueryForZeroAddress","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":"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":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"inputs":[],"name":"BASE_URI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"CURRENT_STAGE","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MINT_ENABLED","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PRICE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"TOTAL_SUPPLY","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","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":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","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":"uint8","name":"quantity","type":"uint8"}],"name":"mint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint8","name":"quantity","type":"uint8"},{"internalType":"uint8","name":"max_quantity","type":"uint8"},{"internalType":"bytes32[]","name":"merkleProof","type":"bytes32[]"}],"name":"mint_wl","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"minted_public","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"minted_wl_0","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"minted_wl_1","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","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":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"num","type":"uint256"}],"name":"reserve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"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":"_base_uri","type":"string"}],"name":"set_base_uri","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint8","name":"_max_mint_per_wallet","type":"uint8"}],"name":"set_max_mint_per_wallet","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_price","type":"uint256"}],"name":"set_price","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint8","name":"_stage","type":"uint8"}],"name":"set_stage","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_merkle","type":"bytes32"}],"name":"set_stage_0_merkle","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_merkle","type":"bytes32"}],"name":"set_stage_1_merkle","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":[],"name":"toggle_mint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"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":[],"name":"wallet_minted_public","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"wallet_minted_stage_0","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"wallet_minted_stage_1","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"}]Contract Creation Code
60a0604052611f406080526611c37937e08000600c55600e805460ff191660141790553480156200002f57600080fd5b506040516200221638038062002216833981016040819052620000529162000161565b806040518060400160405280601181526020017054686520466f7273616b656e204f6e657360781b8152506040518060400160405280600381526020016254464f60e81b8152508160029081620000aa91906200023a565b506003620000b982826200023a565b50600160005550506001600160a01b038116620000f057604051631e4fbdf760e01b81526000600482015260240160405180910390fd5b620000fb816200010f565b5050600e805462ffff001916905562000306565b600980546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6000602082840312156200017457600080fd5b81516001600160a01b03811681146200018c57600080fd5b9392505050565b634e487b7160e01b600052604160045260246000fd5b600181811c90821680620001be57607f821691505b602082108103620001df57634e487b7160e01b600052602260045260246000fd5b50919050565b601f82111562000235576000816000526020600020601f850160051c81016020861015620002105750805b601f850160051c820191505b8181101562000231578281556001016200021c565b5050505b505050565b81516001600160401b0381111562000256576200025662000193565b6200026e81620002678454620001a9565b84620001e5565b602080601f831160018114620002a657600084156200028d5750858301515b600019600386901b1c1916600185901b17855562000231565b600085815260208120601f198616915b82811015620002d757888601518255948401946001909101908401620002b6565b5085821015620002f65787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b608051611edf62000337600039600081816104fe0152818161086201528181610e640152610fc30152611edf6000f3fe6080604052600436106102255760003560e01c8063819b25ba11610123578063a8596209116100ab578063dbddb26a1161006f578063dbddb26a1461065c578063e81daa4a14610671578063e985e9c5146106a1578063eaff182b146106c1578063f2fde38b146106e157600080fd5b8063a8596209146105c4578063a8c7c336146105e4578063af1c521114610609578063b88d4fde14610629578063c87b56dd1461063c57600080fd5b806395d89b41116100f257806395d89b41146105205780639db65263146105355780639fbca28c14610555578063a22cb46514610574578063a27274ca1461059457600080fd5b8063819b25ba146104985780638d859f3e146104b85780638da5cb5b146104ce578063902d55a5146104ec57600080fd5b8063327661e1116101b15780636d46957c116101755780636d46957c146104005780636ecd23061461042057806370a0823114610433578063715018a61461045357806371b1ddee1461046857600080fd5b8063327661e11461037357806342842e0e146103935780636352211e146103a657806364c96dcb146103c65780636679b711146103eb57600080fd5b806309c470de116101f857806309c470de146102ce57806312ec0dab146102e157806318160ddd1461031457806323b872dd1461034057806328bf794d1461035357600080fd5b806301ffc9a71461022a57806306fdde031461025f578063081812fc14610281578063095ea7b3146102b9575b600080fd5b34801561023657600080fd5b5061024a610245366004611830565b610701565b60405190151581526020015b60405180910390f35b34801561026b57600080fd5b50610274610753565b604051610256919061189d565b34801561028d57600080fd5b506102a161029c3660046118b0565b6107e5565b6040516001600160a01b039091168152602001610256565b6102cc6102c73660046118e0565b610820565b005b6102cc6102dc36600461191b565b610830565b3480156102ed57600080fd5b503360009081526010602052604090205460ff165b60405160ff9091168152602001610256565b34801561032057600080fd5b50610332600154600054036000190190565b604051908152602001610256565b6102cc61034e3660046119ac565b610bfe565b34801561035f57600080fd5b506102cc61036e3660046118b0565b610d5f565b34801561037f57600080fd5b50600e546103029062010000900460ff1681565b6102cc6103a13660046119ac565b610d6c565b3480156103b257600080fd5b506102a16103c13660046118b0565b610d8c565b3480156103d257600080fd5b503360009081526011602052604090205460ff16610302565b3480156103f757600080fd5b506102cc610d97565b34801561040c57600080fd5b506102cc61041b3660046118b0565b610dbc565b6102cc61042e3660046119e8565b610dc9565b34801561043f57600080fd5b5061033261044e366004611a03565b610f5f565b34801561045f57600080fd5b506102cc610fa5565b34801561047457600080fd5b50610302610483366004611a03565b60106020526000908152604090205460ff1681565b3480156104a457600080fd5b506102cc6104b33660046118b0565b610fb9565b3480156104c457600080fd5b50610332600c5481565b3480156104da57600080fd5b506009546001600160a01b03166102a1565b3480156104f857600080fd5b506103327f000000000000000000000000000000000000000000000000000000000000000081565b34801561052c57600080fd5b50610274611026565b34801561054157600080fd5b506102cc6105503660046119e8565b611035565b34801561056157600080fd5b50600e5461024a90610100900460ff1681565b34801561058057600080fd5b506102cc61058f366004611a1e565b611053565b3480156105a057600080fd5b506103026105af366004611a03565b60116020526000908152604090205460ff1681565b3480156105d057600080fd5b506102cc6105df3660046118b0565b6110bf565b3480156105f057600080fd5b50336000908152600f602052604090205460ff16610302565b34801561061557600080fd5b506102cc610624366004611ae6565b6110cc565b6102cc610637366004611b2f565b6110e0565b34801561064857600080fd5b506102746106573660046118b0565b611121565b34801561066857600080fd5b5061027461119c565b34801561067d57600080fd5b5061030261068c366004611a03565b600f6020526000908152604090205460ff1681565b3480156106ad57600080fd5b5061024a6106bc366004611bab565b61122a565b3480156106cd57600080fd5b506102cc6106dc3660046119e8565b611258565b3480156106ed57600080fd5b506102cc6106fc366004611a03565b6112cc565b60006301ffc9a760e01b6001600160e01b03198316148061073257506380ac58cd60e01b6001600160e01b03198316145b8061074d5750635b5e139f60e01b6001600160e01b03198316145b92915050565b60606002805461076290611bde565b80601f016020809104026020016040519081016040528092919081815260200182805461078e90611bde565b80156107db5780601f106107b0576101008083540402835291602001916107db565b820191906000526020600020905b8154815290600101906020018083116107be57829003601f168201915b5050505050905090565b60006107f082611307565b610804576108046333d1c03960e21b611355565b506000908152600660205260409020546001600160a01b031690565b61082c8282600161135f565b5050565b600e54610100900460ff166108605760405162461bcd60e51b815260040161085790611c18565b60405180910390fd5b7f00000000000000000000000000000000000000000000000000000000000000008460ff16610896600154600054036000190190565b6108a09190611c55565b11156108be5760405162461bcd60e51b815260040161085790611c68565b6040805133602082015260ff851691810191909152600090606001604051602081830303815290604052805190602001209050600061093484848080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525050600a549150859050611402565b9050600061097985858080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525050600b549150869050611402565b600e5490915062010000900460ff16600003610a4c57816109ca5760405162461bcd60e51b815260206004820152600b60248201526a53544147455f315f444e5160a81b6044820152606401610857565b336000908152600f602052604090205460ff808816916109ec918a9116611c8f565b60ff161115610a0d5760405162461bcd60e51b815260040161085790611ca8565b336000908152600f602052604081208054899290610a2f90849060ff16611c8f565b92506101000a81548160ff021916908360ff160217905550610be8565b600e5462010000900460ff16600103610aff5780610a9a5760405162461bcd60e51b815260206004820152600b60248201526a53544147455f325f444e5160a81b6044820152606401610857565b3360009081526010602052604090205460ff80881691610abc918a9116611c8f565b60ff161115610add5760405162461bcd60e51b815260040161085790611ca8565b3360009081526010602052604081208054899290610a2f90849060ff16611c8f565b8180610b085750805b610b425760405162461bcd60e51b815260206004820152600b60248201526a53544147455f335f444e5160a81b6044820152606401610857565b8115610b6a57336000908152600f602052604090205460ff808816916109ec918a9116611c8f565b3360009081526010602052604090205460ff80881691610b8c918a9116611c8f565b60ff161115610bad5760405162461bcd60e51b815260040161085790611ca8565b3360009081526010602052604081208054899290610bcf90849060ff16611c8f565b92506101000a81548160ff021916908360ff1602179055505b610bf5338860ff16611418565b50505050505050565b6000610c09826114d7565b6001600160a01b039485169490915081168414610c2f57610c2f62a1148160e81b611355565b60008281526006602052604090208054338082146001600160a01b03881690911417610c7357610c5f863361122a565b610c7357610c73632ce44b5f60e11b611355565b8015610c7e57600082555b6001600160a01b038681166000908152600560205260408082208054600019019055918716808252919020805460010190554260a01b17600160e11b17600085815260046020526040812091909155600160e11b84169003610d1057600184016000818152600460205260408120549003610d0e576000548114610d0e5760008181526004602052604090208490555b505b6001600160a01b0385168481887fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef600080a480600003610d5a57610d5a633a954ecd60e21b611355565b610bf5565b610d67611578565b600c55565b610d87838383604051806020016040528060008152506110e0565b505050565b600061074d826114d7565b610d9f611578565b600e805461ff001981166101009182900460ff1615909102179055565b610dc4611578565b600b55565b600e54610100900460ff16610df05760405162461bcd60e51b815260040161085790611c18565b600e5460ff6201000090910416600214610e1c5760405162461bcd60e51b815260040161085790611c18565b600e543360009081526011602052604090205460ff91821691610e4191849116611c8f565b60ff161115610e625760405162461bcd60e51b815260040161085790611ca8565b7f00000000000000000000000000000000000000000000000000000000000000008160ff16610e98600154600054036000190190565b610ea29190611c55565b1115610ec05760405162461bcd60e51b815260040161085790611c68565b8060ff16600c54610ed19190611ccc565b341015610f155760405162461bcd60e51b8152602060048201526012602482015271494e53554646494349454e545f46554e445360701b6044820152606401610857565b3360009081526011602052604081208054839290610f3790849060ff16611c8f565b92506101000a81548160ff021916908360ff160217905550610f5c338260ff16611418565b50565b60006001600160a01b038216610f7f57610f7f6323d3ad8160e21b611355565b506001600160a01b031660009081526005602052604090205467ffffffffffffffff1690565b610fad611578565b610fb760006115a5565b565b610fc1611578565b7f000000000000000000000000000000000000000000000000000000000000000081610ff4600154600054036000190190565b610ffe9190611c55565b111561101c5760405162461bcd60e51b815260040161085790611c68565b610f5c33826115f7565b60606003805461076290611bde565b61103d611578565b600e805460ff191660ff92909216919091179055565b3360008181526007602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b6110c7611578565b600a55565b6110d4611578565b600d61082c8282611d33565b6110eb848484610bfe565b6001600160a01b0383163b1561111b5761110784848484611611565b61111b5761111b6368d2bf6b60e11b611355565b50505050565b606061112c82611307565b61114057611140630a14c4b560e41b611355565b600061114a6116f4565b9050805160000361116a5760405180602001604052806000815250611195565b8061117484611703565b604051602001611185929190611df3565b6040516020818303038152906040525b9392505050565b600d80546111a990611bde565b80601f01602080910402602001604051908101604052809291908181526020018280546111d590611bde565b80156112225780601f106111f757610100808354040283529160200191611222565b820191906000526020600020905b81548152906001019060200180831161120557829003601f168201915b505050505081565b6001600160a01b03918216600090815260076020908152604080832093909416825291909152205460ff1690565b611260611578565b60028160ff1611158015611272575060015b6112ae5760405162461bcd60e51b815260206004820152600d60248201526c494e56414c49445f535441474560981b6044820152606401610857565b600e805460ff909216620100000262ff000019909216919091179055565b6112d4611578565b6001600160a01b0381166112fe57604051631e4fbdf760e01b815260006004820152602401610857565b610f5c816115a5565b600081600111611350576000548210156113505760005b50600082815260046020526040812054908190036113465761133f83611e22565b925061131e565b600160e01b161590505b919050565b8060005260046000fd5b600061136a83610d8c565b90508180156113825750336001600160a01b03821614155b156113a557611391813361122a565b6113a5576113a56367d9dca160e11b611355565b60008381526006602052604080822080546001600160a01b0319166001600160a01b0388811691821790925591518693918516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591a450505050565b60008261140f8584611747565b14949350505050565b60008054908290036114345761143463b562e8dd60e01b611355565b60008181526004602090815260408083206001600160a01b0387164260a01b6001881460e11b1781179091558084526005909252822080546801000000000000000186020190559081900361149257611492622e076360e81b611355565b818301825b808360007fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef600080a4818160010191508103611497575060005550505050565b60008160011161156857506000818152600460205260409020548060000361155557600054821061151257611512636f96cda160e11b611355565b5b5060001901600081815260046020526040902054801561151357600160e01b811660000361154057919050565b611550636f96cda160e11b611355565b611513565b600160e01b811660000361156857919050565b611350636f96cda160e11b611355565b6009546001600160a01b03163314610fb75760405163118cdaa760e01b8152336004820152602401610857565b600980546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b61082c82826040518060200160405280600081525061178a565b604051630a85bd0160e11b81526000906001600160a01b0385169063150b7a0290611646903390899088908890600401611e39565b6020604051808303816000875af1925050508015611681575060408051601f3d908101601f1916820190925261167e91810190611e76565b60015b6116d6573d8080156116af576040519150601f19603f3d011682016040523d82523d6000602084013e6116b4565b606091505b5080516000036116ce576116ce6368d2bf6b60e11b611355565b805181602001fd5b6001600160e01b031916630a85bd0160e11b1490505b949350505050565b6060600d805461076290611bde565b606060a06040510180604052602081039150506000815280825b600183039250600a81066030018353600a90048061171d5750819003601f19909101908152919050565b600081815b8451811015611782576117788286838151811061176b5761176b611e93565b60200260200101516117ee565b915060010161174c565b509392505050565b6117948383611418565b6001600160a01b0383163b15610d87576000548281035b6117be6000868380600101945086611611565b6117d2576117d26368d2bf6b60e11b611355565b8181106117ab5781600054146117e757600080fd5b5050505050565b600081831061180a576000828152602084905260409020611195565b5060009182526020526040902090565b6001600160e01b031981168114610f5c57600080fd5b60006020828403121561184257600080fd5b81356111958161181a565b60005b83811015611868578181015183820152602001611850565b50506000910152565b6000815180845261188981602086016020860161184d565b601f01601f19169290920160200192915050565b6020815260006111956020830184611871565b6000602082840312156118c257600080fd5b5035919050565b80356001600160a01b038116811461135057600080fd5b600080604083850312156118f357600080fd5b6118fc836118c9565b946020939093013593505050565b803560ff8116811461135057600080fd5b6000806000806060858703121561193157600080fd5b61193a8561190a565b93506119486020860161190a565b9250604085013567ffffffffffffffff8082111561196557600080fd5b818701915087601f83011261197957600080fd5b81358181111561198857600080fd5b8860208260051b850101111561199d57600080fd5b95989497505060200194505050565b6000806000606084860312156119c157600080fd5b6119ca846118c9565b92506119d8602085016118c9565b9150604084013590509250925092565b6000602082840312156119fa57600080fd5b6111958261190a565b600060208284031215611a1557600080fd5b611195826118c9565b60008060408385031215611a3157600080fd5b611a3a836118c9565b915060208301358015158114611a4f57600080fd5b809150509250929050565b634e487b7160e01b600052604160045260246000fd5b600067ffffffffffffffff80841115611a8b57611a8b611a5a565b604051601f8501601f19908116603f01168101908282118183101715611ab357611ab3611a5a565b81604052809350858152868686011115611acc57600080fd5b858560208301376000602087830101525050509392505050565b600060208284031215611af857600080fd5b813567ffffffffffffffff811115611b0f57600080fd5b8201601f81018413611b2057600080fd5b6116ec84823560208401611a70565b60008060008060808587031215611b4557600080fd5b611b4e856118c9565b9350611b5c602086016118c9565b925060408501359150606085013567ffffffffffffffff811115611b7f57600080fd5b8501601f81018713611b9057600080fd5b611b9f87823560208401611a70565b91505092959194509250565b60008060408385031215611bbe57600080fd5b611bc7836118c9565b9150611bd5602084016118c9565b90509250929050565b600181811c90821680611bf257607f821691505b602082108103611c1257634e487b7160e01b600052602260045260246000fd5b50919050565b6020808252600d908201526c1352539517d11254d050931151609a1b604082015260600190565b634e487b7160e01b600052601160045260246000fd5b8082018082111561074d5761074d611c3f565b6020808252600d908201526c4558434545445f535550504c5960981b604082015260600190565b60ff818116838216019081111561074d5761074d611c3f565b6020808252600a908201526913505617d3525395115160b21b604082015260600190565b808202811582820484141761074d5761074d611c3f565b601f821115610d87576000816000526020600020601f850160051c81016020861015611d0c5750805b601f850160051c820191505b81811015611d2b57828155600101611d18565b505050505050565b815167ffffffffffffffff811115611d4d57611d4d611a5a565b611d6181611d5b8454611bde565b84611ce3565b602080601f831160018114611d965760008415611d7e5750858301515b600019600386901b1c1916600185901b178555611d2b565b600085815260208120601f198616915b82811015611dc557888601518255948401946001909101908401611da6565b5085821015611de35787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b60008351611e0581846020880161184d565b835190830190611e1981836020880161184d565b01949350505050565b600081611e3157611e31611c3f565b506000190190565b6001600160a01b0385811682528416602082015260408101839052608060608201819052600090611e6c90830184611871565b9695505050505050565b600060208284031215611e8857600080fd5b81516111958161181a565b634e487b7160e01b600052603260045260246000fdfea264697066735822122054572505e60a4c66479368817eeb1a67b46c5a2817b317836d607e629bea472a64736f6c63430008160033000000000000000000000000298b590b52723248848d2cc85f83e65ea7a68663
Deployed Bytecode
0x6080604052600436106102255760003560e01c8063819b25ba11610123578063a8596209116100ab578063dbddb26a1161006f578063dbddb26a1461065c578063e81daa4a14610671578063e985e9c5146106a1578063eaff182b146106c1578063f2fde38b146106e157600080fd5b8063a8596209146105c4578063a8c7c336146105e4578063af1c521114610609578063b88d4fde14610629578063c87b56dd1461063c57600080fd5b806395d89b41116100f257806395d89b41146105205780639db65263146105355780639fbca28c14610555578063a22cb46514610574578063a27274ca1461059457600080fd5b8063819b25ba146104985780638d859f3e146104b85780638da5cb5b146104ce578063902d55a5146104ec57600080fd5b8063327661e1116101b15780636d46957c116101755780636d46957c146104005780636ecd23061461042057806370a0823114610433578063715018a61461045357806371b1ddee1461046857600080fd5b8063327661e11461037357806342842e0e146103935780636352211e146103a657806364c96dcb146103c65780636679b711146103eb57600080fd5b806309c470de116101f857806309c470de146102ce57806312ec0dab146102e157806318160ddd1461031457806323b872dd1461034057806328bf794d1461035357600080fd5b806301ffc9a71461022a57806306fdde031461025f578063081812fc14610281578063095ea7b3146102b9575b600080fd5b34801561023657600080fd5b5061024a610245366004611830565b610701565b60405190151581526020015b60405180910390f35b34801561026b57600080fd5b50610274610753565b604051610256919061189d565b34801561028d57600080fd5b506102a161029c3660046118b0565b6107e5565b6040516001600160a01b039091168152602001610256565b6102cc6102c73660046118e0565b610820565b005b6102cc6102dc36600461191b565b610830565b3480156102ed57600080fd5b503360009081526010602052604090205460ff165b60405160ff9091168152602001610256565b34801561032057600080fd5b50610332600154600054036000190190565b604051908152602001610256565b6102cc61034e3660046119ac565b610bfe565b34801561035f57600080fd5b506102cc61036e3660046118b0565b610d5f565b34801561037f57600080fd5b50600e546103029062010000900460ff1681565b6102cc6103a13660046119ac565b610d6c565b3480156103b257600080fd5b506102a16103c13660046118b0565b610d8c565b3480156103d257600080fd5b503360009081526011602052604090205460ff16610302565b3480156103f757600080fd5b506102cc610d97565b34801561040c57600080fd5b506102cc61041b3660046118b0565b610dbc565b6102cc61042e3660046119e8565b610dc9565b34801561043f57600080fd5b5061033261044e366004611a03565b610f5f565b34801561045f57600080fd5b506102cc610fa5565b34801561047457600080fd5b50610302610483366004611a03565b60106020526000908152604090205460ff1681565b3480156104a457600080fd5b506102cc6104b33660046118b0565b610fb9565b3480156104c457600080fd5b50610332600c5481565b3480156104da57600080fd5b506009546001600160a01b03166102a1565b3480156104f857600080fd5b506103327f0000000000000000000000000000000000000000000000000000000000001f4081565b34801561052c57600080fd5b50610274611026565b34801561054157600080fd5b506102cc6105503660046119e8565b611035565b34801561056157600080fd5b50600e5461024a90610100900460ff1681565b34801561058057600080fd5b506102cc61058f366004611a1e565b611053565b3480156105a057600080fd5b506103026105af366004611a03565b60116020526000908152604090205460ff1681565b3480156105d057600080fd5b506102cc6105df3660046118b0565b6110bf565b3480156105f057600080fd5b50336000908152600f602052604090205460ff16610302565b34801561061557600080fd5b506102cc610624366004611ae6565b6110cc565b6102cc610637366004611b2f565b6110e0565b34801561064857600080fd5b506102746106573660046118b0565b611121565b34801561066857600080fd5b5061027461119c565b34801561067d57600080fd5b5061030261068c366004611a03565b600f6020526000908152604090205460ff1681565b3480156106ad57600080fd5b5061024a6106bc366004611bab565b61122a565b3480156106cd57600080fd5b506102cc6106dc3660046119e8565b611258565b3480156106ed57600080fd5b506102cc6106fc366004611a03565b6112cc565b60006301ffc9a760e01b6001600160e01b03198316148061073257506380ac58cd60e01b6001600160e01b03198316145b8061074d5750635b5e139f60e01b6001600160e01b03198316145b92915050565b60606002805461076290611bde565b80601f016020809104026020016040519081016040528092919081815260200182805461078e90611bde565b80156107db5780601f106107b0576101008083540402835291602001916107db565b820191906000526020600020905b8154815290600101906020018083116107be57829003601f168201915b5050505050905090565b60006107f082611307565b610804576108046333d1c03960e21b611355565b506000908152600660205260409020546001600160a01b031690565b61082c8282600161135f565b5050565b600e54610100900460ff166108605760405162461bcd60e51b815260040161085790611c18565b60405180910390fd5b7f0000000000000000000000000000000000000000000000000000000000001f408460ff16610896600154600054036000190190565b6108a09190611c55565b11156108be5760405162461bcd60e51b815260040161085790611c68565b6040805133602082015260ff851691810191909152600090606001604051602081830303815290604052805190602001209050600061093484848080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525050600a549150859050611402565b9050600061097985858080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525050600b549150869050611402565b600e5490915062010000900460ff16600003610a4c57816109ca5760405162461bcd60e51b815260206004820152600b60248201526a53544147455f315f444e5160a81b6044820152606401610857565b336000908152600f602052604090205460ff808816916109ec918a9116611c8f565b60ff161115610a0d5760405162461bcd60e51b815260040161085790611ca8565b336000908152600f602052604081208054899290610a2f90849060ff16611c8f565b92506101000a81548160ff021916908360ff160217905550610be8565b600e5462010000900460ff16600103610aff5780610a9a5760405162461bcd60e51b815260206004820152600b60248201526a53544147455f325f444e5160a81b6044820152606401610857565b3360009081526010602052604090205460ff80881691610abc918a9116611c8f565b60ff161115610add5760405162461bcd60e51b815260040161085790611ca8565b3360009081526010602052604081208054899290610a2f90849060ff16611c8f565b8180610b085750805b610b425760405162461bcd60e51b815260206004820152600b60248201526a53544147455f335f444e5160a81b6044820152606401610857565b8115610b6a57336000908152600f602052604090205460ff808816916109ec918a9116611c8f565b3360009081526010602052604090205460ff80881691610b8c918a9116611c8f565b60ff161115610bad5760405162461bcd60e51b815260040161085790611ca8565b3360009081526010602052604081208054899290610bcf90849060ff16611c8f565b92506101000a81548160ff021916908360ff1602179055505b610bf5338860ff16611418565b50505050505050565b6000610c09826114d7565b6001600160a01b039485169490915081168414610c2f57610c2f62a1148160e81b611355565b60008281526006602052604090208054338082146001600160a01b03881690911417610c7357610c5f863361122a565b610c7357610c73632ce44b5f60e11b611355565b8015610c7e57600082555b6001600160a01b038681166000908152600560205260408082208054600019019055918716808252919020805460010190554260a01b17600160e11b17600085815260046020526040812091909155600160e11b84169003610d1057600184016000818152600460205260408120549003610d0e576000548114610d0e5760008181526004602052604090208490555b505b6001600160a01b0385168481887fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef600080a480600003610d5a57610d5a633a954ecd60e21b611355565b610bf5565b610d67611578565b600c55565b610d87838383604051806020016040528060008152506110e0565b505050565b600061074d826114d7565b610d9f611578565b600e805461ff001981166101009182900460ff1615909102179055565b610dc4611578565b600b55565b600e54610100900460ff16610df05760405162461bcd60e51b815260040161085790611c18565b600e5460ff6201000090910416600214610e1c5760405162461bcd60e51b815260040161085790611c18565b600e543360009081526011602052604090205460ff91821691610e4191849116611c8f565b60ff161115610e625760405162461bcd60e51b815260040161085790611ca8565b7f0000000000000000000000000000000000000000000000000000000000001f408160ff16610e98600154600054036000190190565b610ea29190611c55565b1115610ec05760405162461bcd60e51b815260040161085790611c68565b8060ff16600c54610ed19190611ccc565b341015610f155760405162461bcd60e51b8152602060048201526012602482015271494e53554646494349454e545f46554e445360701b6044820152606401610857565b3360009081526011602052604081208054839290610f3790849060ff16611c8f565b92506101000a81548160ff021916908360ff160217905550610f5c338260ff16611418565b50565b60006001600160a01b038216610f7f57610f7f6323d3ad8160e21b611355565b506001600160a01b031660009081526005602052604090205467ffffffffffffffff1690565b610fad611578565b610fb760006115a5565b565b610fc1611578565b7f0000000000000000000000000000000000000000000000000000000000001f4081610ff4600154600054036000190190565b610ffe9190611c55565b111561101c5760405162461bcd60e51b815260040161085790611c68565b610f5c33826115f7565b60606003805461076290611bde565b61103d611578565b600e805460ff191660ff92909216919091179055565b3360008181526007602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b6110c7611578565b600a55565b6110d4611578565b600d61082c8282611d33565b6110eb848484610bfe565b6001600160a01b0383163b1561111b5761110784848484611611565b61111b5761111b6368d2bf6b60e11b611355565b50505050565b606061112c82611307565b61114057611140630a14c4b560e41b611355565b600061114a6116f4565b9050805160000361116a5760405180602001604052806000815250611195565b8061117484611703565b604051602001611185929190611df3565b6040516020818303038152906040525b9392505050565b600d80546111a990611bde565b80601f01602080910402602001604051908101604052809291908181526020018280546111d590611bde565b80156112225780601f106111f757610100808354040283529160200191611222565b820191906000526020600020905b81548152906001019060200180831161120557829003601f168201915b505050505081565b6001600160a01b03918216600090815260076020908152604080832093909416825291909152205460ff1690565b611260611578565b60028160ff1611158015611272575060015b6112ae5760405162461bcd60e51b815260206004820152600d60248201526c494e56414c49445f535441474560981b6044820152606401610857565b600e805460ff909216620100000262ff000019909216919091179055565b6112d4611578565b6001600160a01b0381166112fe57604051631e4fbdf760e01b815260006004820152602401610857565b610f5c816115a5565b600081600111611350576000548210156113505760005b50600082815260046020526040812054908190036113465761133f83611e22565b925061131e565b600160e01b161590505b919050565b8060005260046000fd5b600061136a83610d8c565b90508180156113825750336001600160a01b03821614155b156113a557611391813361122a565b6113a5576113a56367d9dca160e11b611355565b60008381526006602052604080822080546001600160a01b0319166001600160a01b0388811691821790925591518693918516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591a450505050565b60008261140f8584611747565b14949350505050565b60008054908290036114345761143463b562e8dd60e01b611355565b60008181526004602090815260408083206001600160a01b0387164260a01b6001881460e11b1781179091558084526005909252822080546801000000000000000186020190559081900361149257611492622e076360e81b611355565b818301825b808360007fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef600080a4818160010191508103611497575060005550505050565b60008160011161156857506000818152600460205260409020548060000361155557600054821061151257611512636f96cda160e11b611355565b5b5060001901600081815260046020526040902054801561151357600160e01b811660000361154057919050565b611550636f96cda160e11b611355565b611513565b600160e01b811660000361156857919050565b611350636f96cda160e11b611355565b6009546001600160a01b03163314610fb75760405163118cdaa760e01b8152336004820152602401610857565b600980546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b61082c82826040518060200160405280600081525061178a565b604051630a85bd0160e11b81526000906001600160a01b0385169063150b7a0290611646903390899088908890600401611e39565b6020604051808303816000875af1925050508015611681575060408051601f3d908101601f1916820190925261167e91810190611e76565b60015b6116d6573d8080156116af576040519150601f19603f3d011682016040523d82523d6000602084013e6116b4565b606091505b5080516000036116ce576116ce6368d2bf6b60e11b611355565b805181602001fd5b6001600160e01b031916630a85bd0160e11b1490505b949350505050565b6060600d805461076290611bde565b606060a06040510180604052602081039150506000815280825b600183039250600a81066030018353600a90048061171d5750819003601f19909101908152919050565b600081815b8451811015611782576117788286838151811061176b5761176b611e93565b60200260200101516117ee565b915060010161174c565b509392505050565b6117948383611418565b6001600160a01b0383163b15610d87576000548281035b6117be6000868380600101945086611611565b6117d2576117d26368d2bf6b60e11b611355565b8181106117ab5781600054146117e757600080fd5b5050505050565b600081831061180a576000828152602084905260409020611195565b5060009182526020526040902090565b6001600160e01b031981168114610f5c57600080fd5b60006020828403121561184257600080fd5b81356111958161181a565b60005b83811015611868578181015183820152602001611850565b50506000910152565b6000815180845261188981602086016020860161184d565b601f01601f19169290920160200192915050565b6020815260006111956020830184611871565b6000602082840312156118c257600080fd5b5035919050565b80356001600160a01b038116811461135057600080fd5b600080604083850312156118f357600080fd5b6118fc836118c9565b946020939093013593505050565b803560ff8116811461135057600080fd5b6000806000806060858703121561193157600080fd5b61193a8561190a565b93506119486020860161190a565b9250604085013567ffffffffffffffff8082111561196557600080fd5b818701915087601f83011261197957600080fd5b81358181111561198857600080fd5b8860208260051b850101111561199d57600080fd5b95989497505060200194505050565b6000806000606084860312156119c157600080fd5b6119ca846118c9565b92506119d8602085016118c9565b9150604084013590509250925092565b6000602082840312156119fa57600080fd5b6111958261190a565b600060208284031215611a1557600080fd5b611195826118c9565b60008060408385031215611a3157600080fd5b611a3a836118c9565b915060208301358015158114611a4f57600080fd5b809150509250929050565b634e487b7160e01b600052604160045260246000fd5b600067ffffffffffffffff80841115611a8b57611a8b611a5a565b604051601f8501601f19908116603f01168101908282118183101715611ab357611ab3611a5a565b81604052809350858152868686011115611acc57600080fd5b858560208301376000602087830101525050509392505050565b600060208284031215611af857600080fd5b813567ffffffffffffffff811115611b0f57600080fd5b8201601f81018413611b2057600080fd5b6116ec84823560208401611a70565b60008060008060808587031215611b4557600080fd5b611b4e856118c9565b9350611b5c602086016118c9565b925060408501359150606085013567ffffffffffffffff811115611b7f57600080fd5b8501601f81018713611b9057600080fd5b611b9f87823560208401611a70565b91505092959194509250565b60008060408385031215611bbe57600080fd5b611bc7836118c9565b9150611bd5602084016118c9565b90509250929050565b600181811c90821680611bf257607f821691505b602082108103611c1257634e487b7160e01b600052602260045260246000fd5b50919050565b6020808252600d908201526c1352539517d11254d050931151609a1b604082015260600190565b634e487b7160e01b600052601160045260246000fd5b8082018082111561074d5761074d611c3f565b6020808252600d908201526c4558434545445f535550504c5960981b604082015260600190565b60ff818116838216019081111561074d5761074d611c3f565b6020808252600a908201526913505617d3525395115160b21b604082015260600190565b808202811582820484141761074d5761074d611c3f565b601f821115610d87576000816000526020600020601f850160051c81016020861015611d0c5750805b601f850160051c820191505b81811015611d2b57828155600101611d18565b505050505050565b815167ffffffffffffffff811115611d4d57611d4d611a5a565b611d6181611d5b8454611bde565b84611ce3565b602080601f831160018114611d965760008415611d7e5750858301515b600019600386901b1c1916600185901b178555611d2b565b600085815260208120601f198616915b82811015611dc557888601518255948401946001909101908401611da6565b5085821015611de35787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b60008351611e0581846020880161184d565b835190830190611e1981836020880161184d565b01949350505050565b600081611e3157611e31611c3f565b506000190190565b6001600160a01b0385811682528416602082015260408101839052608060608201819052600090611e6c90830184611871565b9695505050505050565b600060208284031215611e8857600080fd5b81516111958161181a565b634e487b7160e01b600052603260045260246000fdfea264697066735822122054572505e60a4c66479368817eeb1a67b46c5a2817b317836d607e629bea472a64736f6c63430008160033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000298b590b52723248848d2cc85f83e65ea7a68663
-----Decoded View---------------
Arg [0] : initialOwner (address): 0x298B590B52723248848D2cC85f83e65eA7A68663
-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 000000000000000000000000298b590b52723248848d2cc85f83e65ea7a68663
Loading...
Loading
Loading...
Loading
Loading...
Loading
Net Worth in USD
$3,016.70
Net Worth in ETH
1.025638
Token Allocations
ETH
100.00%
Multichain Portfolio | 35 Chains
| Chain | Token | Portfolio % | Price | Amount | Value |
|---|---|---|---|---|---|
| ABSTRACT | 100.00% | $2,943.13 | 1.025 | $3,016.7 |
Loading...
Loading
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
[ 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.