ETH Price: $3,895.63 (-0.64%)

Token

WhiteRussian (WHITERUSSIAN)
 

Overview

Max Total Supply

1,552 WHITERUSSIAN

Holders

337

Market

Volume (24H)

N/A

Min Price (24H)

N/A

Max Price (24H)

N/A
Balance
3 WHITERUSSIAN
0xa1d243ed5faf4ee5ad1e1ad13012c3a3e1b8adc2
Loading...
Loading
Loading...
Loading
Loading...
Loading

Click here to update the token information / general information
# Exchange Pair Price  24H Volume % Volume

Contract Source Code Verified (Exact Match)

Contract Name:
CryptoDudesGlassNFT

Compiler Version
v0.8.4+commit.c7e474f2

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
File 1 of 19 : CryptoDudesGlassNFT.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;

//@author Mia Dude
//@title CryptoDudes NFT

import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
import "./ERC721A.sol";
import "./extensions/ERC721AQueryable.sol";
import "./CryptoDudesNFT.sol";

contract CryptoDudesGlassNFT is Ownable, ERC721A, ERC721AQueryable {

    using Strings for uint;

    //URI of the NFTs when revealed
    string public baseURI;

    //start mint time
    uint public saleStartTime = 1659888000;

     //the current max supply
    uint public MAX_SUPPLY = 2222;

    // tokenId already minted ? => bool
   
    //mapping (uint => bool) isGlassMinted keep track of tokenid used, by nft contract;
    mapping(address => mapping(uint => bool)) public isGlassMinted;

    //nft contracts allowed to claim some free glass of white russian
    mapping(address => bool) isNFTContractAllowed;

    // **********************************************************************************
    // *********** CONSTRUCTOR 
    // **********************************************************************************

    constructor(string memory _baseURI, address _nft) ERC721A("WhiteRussian", "WHITERUSSIAN")  {
        baseURI = _baseURI;
        isNFTContractAllowed[_nft] = true;
    }
     
    modifier callerIsUser() {
        require(tx.origin == msg.sender, "The caller is another contract");
        _;
    }


    // **********************************************************************************
    // *********** PUBLIC MINT  
    // **********************************************************************************

    function publicMint(address _account, uint[] calldata tokenIds, address _nftContract) external callerIsUser {
        uint quantity = 0;
        uint tokenId;
        CryptoDudesNFT nft;

        require(currentTime() >= saleStartTime, "Public mint has not started yet");
        require(tokenIds.length > 0, "No CryptoDudesNFT token Ids provided");
        require(isNFTContractAllowed[_nftContract] == true, "NFT Contract not allowed");

        nft = CryptoDudesNFT(payable(_nftContract));

        for(uint i = 0; i < tokenIds.length ; i++){
            tokenId = tokenIds[i];
            if ( (nft.ownerOf(tokenId) == msg.sender) && (isGlassMinted[_nftContract][tokenId] == false) ) {
                isGlassMinted[_nftContract][tokenId] = true;
                quantity += 1;
            }
        }

        require (quantity > 0, "Ooops, no glass to mint for you");
        require(totalSupply() + quantity <= MAX_SUPPLY, "Max supply exceeded");   

        _safeMint(_account, quantity);
    }

    // **********************************************************************************
    // *********** settings 
    // **********************************************************************************

    function setBaseURI(string memory _baseURI) external onlyOwner {
        baseURI = _baseURI;
    }

    // we can update the max supply (ex: for a second collection, we could mint extra glasses of white russians for the cryptodudes)
   
    function updateMaxSupply(uint _maxSupply) external onlyOwner {
        MAX_SUPPLY = _maxSupply;
    }

    //add or remove authorized collection
    function updateAllowedContract(address _nftContract, bool _allowed) external onlyOwner {
        isNFTContractAllowed[_nftContract] = _allowed;
    }


    function currentTime() internal view returns(uint) {
        return block.timestamp;
    }

    //we can update this if we need to stop the glass mint, for a futur drop
    function setSaleStartTime(uint _saleStartTime) external onlyOwner {
        saleStartTime = _saleStartTime;
    }


    // **********************************************************************************

    function tokenURI(uint _tokenId) public view virtual override returns (string memory) {
        require(_exists(_tokenId), "URI query for nonexistent token");
        
        // uniq base uri, same glass
        return baseURI;
    }

}

File 2 of 19 : IERC165.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC165 standard, as defined in the
 * https://eips.ethereum.org/EIPS/eip-165[EIP].
 *
 * Implementers can declare support of contract interfaces, which can then be
 * queried by others ({ERC165Checker}).
 *
 * For an implementation, see {ERC165}.
 */
interface IERC165 {
    /**
     * @dev Returns true if this contract implements the interface defined by
     * `interfaceId`. See the corresponding
     * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]
     * to learn more about how these ids are created.
     *
     * This function call must use less than 30 000 gas.
     */
    function supportsInterface(bytes4 interfaceId) external view returns (bool);
}

File 3 of 19 : ERC165.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)

pragma solidity ^0.8.0;

import "./IERC165.sol";

/**
 * @dev Implementation of the {IERC165} interface.
 *
 * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check
 * for the additional interface id that will be supported. For example:
 *
 * ```solidity
 * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
 *     return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);
 * }
 * ```
 *
 * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.
 */
abstract contract ERC165 is IERC165 {
    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
        return interfaceId == type(IERC165).interfaceId;
    }
}

File 4 of 19 : MerkleProof.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (utils/cryptography/MerkleProof.sol)

pragma solidity ^0.8.0;

/**
 * @dev These functions deal with verification of Merkle Trees proofs.
 *
 * The proofs can be generated using the JavaScript library
 * https://github.com/miguelmota/merkletreejs[merkletreejs].
 * Note: the hashing algorithm should be keccak256 and pair sorting should be enabled.
 *
 * See `test/utils/cryptography/MerkleProof.test.js` for some examples.
 *
 * 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.
 */
library MerkleProof {
    /**
     * @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.
     */
    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 leafs & pre-images are assumed to be sorted.
     *
     * _Available since v4.4._
     */
    function processProof(bytes32[] memory proof, bytes32 leaf) internal pure returns (bytes32) {
        bytes32 computedHash = leaf;
        for (uint256 i = 0; i < proof.length; i++) {
            bytes32 proofElement = proof[i];
            if (computedHash <= proofElement) {
                // Hash(current computed hash + current element of the proof)
                computedHash = _efficientHash(computedHash, proofElement);
            } else {
                // Hash(current element of the proof + current computed hash)
                computedHash = _efficientHash(proofElement, computedHash);
            }
        }
        return computedHash;
    }

    function _efficientHash(bytes32 a, bytes32 b) private pure returns (bytes32 value) {
        assembly {
            mstore(0x00, a)
            mstore(0x20, b)
            value := keccak256(0x00, 0x40)
        }
    }
}

File 5 of 19 : Strings.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Strings.sol)

pragma solidity ^0.8.0;

/**
 * @dev String operations.
 */
library Strings {
    bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef";

    /**
     * @dev Converts a `uint256` to its ASCII `string` decimal representation.
     */
    function toString(uint256 value) internal pure returns (string memory) {
        // Inspired by OraclizeAPI's implementation - MIT licence
        // https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol

        if (value == 0) {
            return "0";
        }
        uint256 temp = value;
        uint256 digits;
        while (temp != 0) {
            digits++;
            temp /= 10;
        }
        bytes memory buffer = new bytes(digits);
        while (value != 0) {
            digits -= 1;
            buffer[digits] = bytes1(uint8(48 + uint256(value % 10)));
            value /= 10;
        }
        return string(buffer);
    }

    /**
     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.
     */
    function toHexString(uint256 value) internal pure returns (string memory) {
        if (value == 0) {
            return "0x00";
        }
        uint256 temp = value;
        uint256 length = 0;
        while (temp != 0) {
            length++;
            temp >>= 8;
        }
        return toHexString(value, length);
    }

    /**
     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.
     */
    function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {
        bytes memory buffer = new bytes(2 * length + 2);
        buffer[0] = "0";
        buffer[1] = "x";
        for (uint256 i = 2 * length + 1; i > 1; --i) {
            buffer[i] = _HEX_SYMBOLS[value & 0xf];
            value >>= 4;
        }
        require(value == 0, "Strings: hex length insufficient");
        return string(buffer);
    }
}

File 6 of 19 : Context.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)

pragma solidity ^0.8.0;

/**
 * @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;
    }
}

File 7 of 19 : Address.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (utils/Address.sol)

pragma solidity ^0.8.1;

/**
 * @dev Collection of functions related to the address type
 */
library Address {
    /**
     * @dev Returns true if `account` is a contract.
     *
     * [IMPORTANT]
     * ====
     * It is unsafe to assume that an address for which this function returns
     * false is an externally-owned account (EOA) and not a contract.
     *
     * Among others, `isContract` will return false for the following
     * types of addresses:
     *
     *  - an externally-owned account
     *  - a contract in construction
     *  - an address where a contract will be created
     *  - an address where a contract lived, but was destroyed
     * ====
     *
     * [IMPORTANT]
     * ====
     * You shouldn't rely on `isContract` to protect against flash loan attacks!
     *
     * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
     * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
     * constructor.
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies on extcodesize/address.code.length, which returns 0
        // for contracts in construction, since the code is only stored at the end
        // of the constructor execution.

        return account.code.length > 0;
    }

    /**
     * @dev Replacement for Solidity's `transfer`: sends `amount` wei to
     * `recipient`, forwarding all available gas and reverting on errors.
     *
     * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
     * of certain opcodes, possibly making contracts go over the 2300 gas limit
     * imposed by `transfer`, making them unable to receive funds via
     * `transfer`. {sendValue} removes this limitation.
     *
     * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
     *
     * IMPORTANT: because control is transferred to `recipient`, care must be
     * taken to not create reentrancy vulnerabilities. Consider using
     * {ReentrancyGuard} or the
     * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
     */
    function sendValue(address payable recipient, uint256 amount) internal {
        require(address(this).balance >= amount, "Address: insufficient balance");

        (bool success, ) = recipient.call{value: amount}("");
        require(success, "Address: unable to send value, recipient may have reverted");
    }

    /**
     * @dev Performs a Solidity function call using a low level `call`. A
     * plain `call` is an unsafe replacement for a function call: use this
     * function instead.
     *
     * If `target` reverts with a revert reason, it is bubbled up by this
     * function (like regular Solidity function calls).
     *
     * Returns the raw returned data. To convert to the expected return value,
     * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
     *
     * Requirements:
     *
     * - `target` must be a contract.
     * - calling `target` with `data` must not revert.
     *
     * _Available since v3.1._
     */
    function functionCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionCall(target, data, "Address: low-level call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
     * `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal returns (bytes memory) {
        return functionCallWithValue(target, data, 0, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but also transferring `value` wei to `target`.
     *
     * Requirements:
     *
     * - the calling contract must have an ETH balance of at least `value`.
     * - the called Solidity function must be `payable`.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(
        address target,
        bytes memory data,
        uint256 value
    ) internal returns (bytes memory) {
        return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
    }

    /**
     * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
     * with `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(
        address target,
        bytes memory data,
        uint256 value,
        string memory errorMessage
    ) internal returns (bytes memory) {
        require(address(this).balance >= value, "Address: insufficient balance for call");
        require(isContract(target), "Address: call to non-contract");

        (bool success, bytes memory returndata) = target.call{value: value}(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
        return functionStaticCall(target, data, "Address: low-level static call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal view returns (bytes memory) {
        require(isContract(target), "Address: static call to non-contract");

        (bool success, bytes memory returndata) = target.staticcall(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionDelegateCall(target, data, "Address: low-level delegate call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal returns (bytes memory) {
        require(isContract(target), "Address: delegate call to non-contract");

        (bool success, bytes memory returndata) = target.delegatecall(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the
     * revert reason using the provided one.
     *
     * _Available since v4.3._
     */
    function verifyCallResult(
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) internal pure returns (bytes memory) {
        if (success) {
            return returndata;
        } else {
            // Look for revert reason and bubble it up if present
            if (returndata.length > 0) {
                // The easiest way to bubble the revert reason is using memory via assembly

                assembly {
                    let returndata_size := mload(returndata)
                    revert(add(32, returndata), returndata_size)
                }
            } else {
                revert(errorMessage);
            }
        }
    }
}

File 8 of 19 : IERC721Metadata.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/IERC721Metadata.sol)

pragma solidity ^0.8.0;

import "../IERC721.sol";

/**
 * @title ERC-721 Non-Fungible Token Standard, optional metadata extension
 * @dev See https://eips.ethereum.org/EIPS/eip-721
 */
interface IERC721Metadata is IERC721 {
    /**
     * @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);
}

File 9 of 19 : IERC721Receiver.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC721/IERC721Receiver.sol)

pragma solidity ^0.8.0;

/**
 * @title ERC721 token receiver interface
 * @dev Interface for any contract that wants to support safeTransfers
 * from ERC721 asset contracts.
 */
interface IERC721Receiver {
    /**
     * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom}
     * by `operator` from `from`, this function is called.
     *
     * It must return its Solidity selector to confirm the token transfer.
     * If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted.
     *
     * The selector can be obtained in Solidity with `IERC721Receiver.onERC721Received.selector`.
     */
    function onERC721Received(
        address operator,
        address from,
        uint256 tokenId,
        bytes calldata data
    ) external returns (bytes4);
}

File 10 of 19 : IERC721.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC721/IERC721.sol)

pragma solidity ^0.8.0;

import "../../utils/introspection/IERC165.sol";

/**
 * @dev Required interface of an ERC721 compliant contract.
 */
interface IERC721 is IERC165 {
    /**
     * @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`.
     *
     * 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 calldata data
    ) external;

    /**
     * @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
    ) external;

    /**
     * @dev Transfers `tokenId` token 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;

    /**
     * @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;

    /**
     * @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);
}

File 11 of 19 : SafeERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/utils/SafeERC20.sol)

pragma solidity ^0.8.0;

import "../IERC20.sol";
import "../../../utils/Address.sol";

/**
 * @title SafeERC20
 * @dev Wrappers around ERC20 operations that throw on failure (when the token
 * contract returns false). Tokens that return no value (and instead revert or
 * throw on failure) are also supported, non-reverting calls are assumed to be
 * successful.
 * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,
 * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
 */
library SafeERC20 {
    using Address for address;

    function safeTransfer(
        IERC20 token,
        address to,
        uint256 value
    ) internal {
        _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
    }

    function safeTransferFrom(
        IERC20 token,
        address from,
        address to,
        uint256 value
    ) internal {
        _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
    }

    /**
     * @dev Deprecated. This function has issues similar to the ones found in
     * {IERC20-approve}, and its usage is discouraged.
     *
     * Whenever possible, use {safeIncreaseAllowance} and
     * {safeDecreaseAllowance} instead.
     */
    function safeApprove(
        IERC20 token,
        address spender,
        uint256 value
    ) internal {
        // safeApprove should only be called when setting an initial allowance,
        // or when resetting it to zero. To increase and decrease it, use
        // 'safeIncreaseAllowance' and 'safeDecreaseAllowance'
        require(
            (value == 0) || (token.allowance(address(this), spender) == 0),
            "SafeERC20: approve from non-zero to non-zero allowance"
        );
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
    }

    function safeIncreaseAllowance(
        IERC20 token,
        address spender,
        uint256 value
    ) internal {
        uint256 newAllowance = token.allowance(address(this), spender) + value;
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
    }

    function safeDecreaseAllowance(
        IERC20 token,
        address spender,
        uint256 value
    ) internal {
        unchecked {
            uint256 oldAllowance = token.allowance(address(this), spender);
            require(oldAllowance >= value, "SafeERC20: decreased allowance below zero");
            uint256 newAllowance = oldAllowance - value;
            _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
        }
    }

    /**
     * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
     * on the return value: the return value is optional (but if data is returned, it must not be false).
     * @param token The token targeted by the call.
     * @param data The call data (encoded using abi.encode or one of its variants).
     */
    function _callOptionalReturn(IERC20 token, bytes memory data) private {
        // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
        // we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that
        // the target address contains contract code and also asserts for success in the low-level call.

        bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed");
        if (returndata.length > 0) {
            // Return data is optional
            require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
        }
    }
}

File 12 of 19 : IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20 {
    /**
     * @dev Emitted when `value` tokens are moved from one account (`from`) to
     * another (`to`).
     *
     * Note that `value` may be zero.
     */
    event Transfer(address indexed from, address indexed to, uint256 value);

    /**
     * @dev Emitted when the allowance of a `spender` for an `owner` is set by
     * a call to {approve}. `value` is the new allowance.
     */
    event Approval(address indexed owner, address indexed spender, uint256 value);

    /**
     * @dev Returns the amount of tokens in existence.
     */
    function totalSupply() external view returns (uint256);

    /**
     * @dev Returns the amount of tokens owned by `account`.
     */
    function balanceOf(address account) external view returns (uint256);

    /**
     * @dev Moves `amount` tokens from the caller's account to `to`.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transfer(address to, uint256 amount) external returns (bool);

    /**
     * @dev Returns the remaining number of tokens that `spender` will be
     * allowed to spend on behalf of `owner` through {transferFrom}. This is
     * zero by default.
     *
     * This value changes when {approve} or {transferFrom} are called.
     */
    function allowance(address owner, address spender) external view returns (uint256);

    /**
     * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * IMPORTANT: Beware that changing an allowance with this method brings the risk
     * that someone may use both the old and the new allowance by unfortunate
     * transaction ordering. One possible solution to mitigate this race
     * condition is to first reduce the spender's allowance to 0 and set the
     * desired value afterwards:
     * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
     *
     * Emits an {Approval} event.
     */
    function approve(address spender, uint256 amount) external returns (bool);

    /**
     * @dev Moves `amount` tokens from `from` to `to` using the
     * allowance mechanism. `amount` is then deducted from the caller's
     * allowance.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(
        address from,
        address to,
        uint256 amount
    ) external returns (bool);
}

File 13 of 19 : PaymentSplitter.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (finance/PaymentSplitter.sol)

pragma solidity ^0.8.0;

import "../token/ERC20/utils/SafeERC20.sol";
import "../utils/Address.sol";
import "../utils/Context.sol";

/**
 * @title PaymentSplitter
 * @dev This contract allows to split Ether payments among a group of accounts. The sender does not need to be aware
 * that the Ether will be split in this way, since it is handled transparently by the contract.
 *
 * The split can be in equal parts or in any other arbitrary proportion. The way this is specified is by assigning each
 * account to a number of shares. Of all the Ether that this contract receives, each account will then be able to claim
 * an amount proportional to the percentage of total shares they were assigned.
 *
 * `PaymentSplitter` follows a _pull payment_ model. This means that payments are not automatically forwarded to the
 * accounts but kept in this contract, and the actual transfer is triggered as a separate step by calling the {release}
 * function.
 *
 * NOTE: This contract assumes that ERC20 tokens will behave similarly to native tokens (Ether). Rebasing tokens, and
 * tokens that apply fees during transfers, are likely to not be supported as expected. If in doubt, we encourage you
 * to run tests before sending real value to this contract.
 */
contract PaymentSplitter is Context {
    event PayeeAdded(address account, uint256 shares);
    event PaymentReleased(address to, uint256 amount);
    event ERC20PaymentReleased(IERC20 indexed token, address to, uint256 amount);
    event PaymentReceived(address from, uint256 amount);

    uint256 private _totalShares;
    uint256 private _totalReleased;

    mapping(address => uint256) private _shares;
    mapping(address => uint256) private _released;
    address[] private _payees;

    mapping(IERC20 => uint256) private _erc20TotalReleased;
    mapping(IERC20 => mapping(address => uint256)) private _erc20Released;

    /**
     * @dev Creates an instance of `PaymentSplitter` where each account in `payees` is assigned the number of shares at
     * the matching position in the `shares` array.
     *
     * All addresses in `payees` must be non-zero. Both arrays must have the same non-zero length, and there must be no
     * duplicates in `payees`.
     */
    constructor(address[] memory payees, uint256[] memory shares_) payable {
        require(payees.length == shares_.length, "PaymentSplitter: payees and shares length mismatch");
        require(payees.length > 0, "PaymentSplitter: no payees");

        for (uint256 i = 0; i < payees.length; i++) {
            _addPayee(payees[i], shares_[i]);
        }
    }

    /**
     * @dev The Ether received will be logged with {PaymentReceived} events. Note that these events are not fully
     * reliable: it's possible for a contract to receive Ether without triggering this function. This only affects the
     * reliability of the events, and not the actual splitting of Ether.
     *
     * To learn more about this see the Solidity documentation for
     * https://solidity.readthedocs.io/en/latest/contracts.html#fallback-function[fallback
     * functions].
     */
    receive() external payable virtual {
        emit PaymentReceived(_msgSender(), msg.value);
    }

    /**
     * @dev Getter for the total shares held by payees.
     */
    function totalShares() public view returns (uint256) {
        return _totalShares;
    }

    /**
     * @dev Getter for the total amount of Ether already released.
     */
    function totalReleased() public view returns (uint256) {
        return _totalReleased;
    }

    /**
     * @dev Getter for the total amount of `token` already released. `token` should be the address of an IERC20
     * contract.
     */
    function totalReleased(IERC20 token) public view returns (uint256) {
        return _erc20TotalReleased[token];
    }

    /**
     * @dev Getter for the amount of shares held by an account.
     */
    function shares(address account) public view returns (uint256) {
        return _shares[account];
    }

    /**
     * @dev Getter for the amount of Ether already released to a payee.
     */
    function released(address account) public view returns (uint256) {
        return _released[account];
    }

    /**
     * @dev Getter for the amount of `token` tokens already released to a payee. `token` should be the address of an
     * IERC20 contract.
     */
    function released(IERC20 token, address account) public view returns (uint256) {
        return _erc20Released[token][account];
    }

    /**
     * @dev Getter for the address of the payee number `index`.
     */
    function payee(uint256 index) public view returns (address) {
        return _payees[index];
    }

    /**
     * @dev Triggers a transfer to `account` of the amount of Ether they are owed, according to their percentage of the
     * total shares and their previous withdrawals.
     */
    function release(address payable account) public virtual {
        require(_shares[account] > 0, "PaymentSplitter: account has no shares");

        uint256 totalReceived = address(this).balance + totalReleased();
        uint256 payment = _pendingPayment(account, totalReceived, released(account));

        require(payment != 0, "PaymentSplitter: account is not due payment");

        _released[account] += payment;
        _totalReleased += payment;

        Address.sendValue(account, payment);
        emit PaymentReleased(account, payment);
    }

    /**
     * @dev Triggers a transfer to `account` of the amount of `token` tokens they are owed, according to their
     * percentage of the total shares and their previous withdrawals. `token` must be the address of an IERC20
     * contract.
     */
    function release(IERC20 token, address account) public virtual {
        require(_shares[account] > 0, "PaymentSplitter: account has no shares");

        uint256 totalReceived = token.balanceOf(address(this)) + totalReleased(token);
        uint256 payment = _pendingPayment(account, totalReceived, released(token, account));

        require(payment != 0, "PaymentSplitter: account is not due payment");

        _erc20Released[token][account] += payment;
        _erc20TotalReleased[token] += payment;

        SafeERC20.safeTransfer(token, account, payment);
        emit ERC20PaymentReleased(token, account, payment);
    }

    /**
     * @dev internal logic for computing the pending payment of an `account` given the token historical balances and
     * already released amounts.
     */
    function _pendingPayment(
        address account,
        uint256 totalReceived,
        uint256 alreadyReleased
    ) private view returns (uint256) {
        return (totalReceived * _shares[account]) / _totalShares - alreadyReleased;
    }

    /**
     * @dev Add a new payee to the contract.
     * @param account The address of the payee to add.
     * @param shares_ The number of shares owned by the payee.
     */
    function _addPayee(address account, uint256 shares_) private {
        require(account != address(0), "PaymentSplitter: account is the zero address");
        require(shares_ > 0, "PaymentSplitter: shares are 0");
        require(_shares[account] == 0, "PaymentSplitter: account already has shares");

        _payees.push(account);
        _shares[account] = shares_;
        _totalShares = _totalShares + shares_;
        emit PayeeAdded(account, shares_);
    }
}

File 14 of 19 : Ownable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)

pragma solidity ^0.8.0;

import "../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.
 *
 * By default, the owner account will be the one that deploys the contract. 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;

    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);

    /**
     * @dev Initializes the contract setting the deployer as the initial owner.
     */
    constructor() {
        _transferOwnership(_msgSender());
    }

    /**
     * @dev Returns the address of the current owner.
     */
    function owner() public view virtual returns (address) {
        return _owner;
    }

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        require(owner() == _msgSender(), "Ownable: caller is not the owner");
        _;
    }

    /**
     * @dev Leaves the contract without owner. It will not be possible to call
     * `onlyOwner` functions anymore. Can only be called by the current owner.
     *
     * NOTE: Renouncing ownership will leave the contract without an owner,
     * thereby removing 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 {
        require(newOwner != address(0), "Ownable: new owner is the zero address");
        _transferOwnership(newOwner);
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Internal function without access restriction.
     */
    function _transferOwnership(address newOwner) internal virtual {
        address oldOwner = _owner;
        _owner = newOwner;
        emit OwnershipTransferred(oldOwner, newOwner);
    }
}

File 15 of 19 : IERC721AQueryable.sol
// SPDX-License-Identifier: MIT
// ERC721A Contracts v3.3.0
// Creator: Chiru Labs

pragma solidity ^0.8.4;

import '../IERC721A.sol';

/**
 * @dev Interface of an ERC721AQueryable compliant contract.
 */
interface IERC721AQueryable is IERC721A {
    /**
     * Invalid query range (`start` >= `stop`).
     */
    error InvalidQueryRange();

    /**
     * @dev Returns the `TokenOwnership` struct at `tokenId` without reverting.
     *
     * If the `tokenId` is out of bounds:
     *   - `addr` = `address(0)`
     *   - `startTimestamp` = `0`
     *   - `burned` = `false`
     *
     * If the `tokenId` is burned:
     *   - `addr` = `<Address of owner before token was burned>`
     *   - `startTimestamp` = `<Timestamp when token was burned>`
     *   - `burned = `true`
     *
     * Otherwise:
     *   - `addr` = `<Address of owner>`
     *   - `startTimestamp` = `<Timestamp of start of ownership>`
     *   - `burned = `false`
     */
    function explicitOwnershipOf(uint256 tokenId) external view returns (TokenOwnership memory);

    /**
     * @dev Returns an array of `TokenOwnership` structs at `tokenIds` in order.
     * See {ERC721AQueryable-explicitOwnershipOf}
     */
    function explicitOwnershipsOf(uint256[] memory tokenIds) external view returns (TokenOwnership[] memory);

    /**
     * @dev Returns an array of token IDs owned by `owner`,
     * in the range [`start`, `stop`)
     * (i.e. `start <= tokenId < stop`).
     *
     * This function allows for tokens to be queried if the collection
     * grows too big for a single call of {ERC721AQueryable-tokensOfOwner}.
     *
     * Requirements:
     *
     * - `start` < `stop`
     */
    function tokensOfOwnerIn(
        address owner,
        uint256 start,
        uint256 stop
    ) external view returns (uint256[] memory);

    /**
     * @dev Returns an array of token IDs owned by `owner`.
     *
     * This function scans the ownership mapping and is O(totalSupply) in complexity.
     * It is meant to be called off-chain.
     *
     * See {ERC721AQueryable-tokensOfOwnerIn} for splitting the scan into
     * multiple smaller scans if the collection is large enough to cause
     * an out-of-gas error (10K pfp collections should be fine).
     */
    function tokensOfOwner(address owner) external view returns (uint256[] memory);
}

File 16 of 19 : ERC721AQueryable.sol
// SPDX-License-Identifier: MIT
// ERC721A Contracts v3.3.0
// Creator: Chiru Labs

pragma solidity ^0.8.4;


import './IERC721AQueryable.sol';
import '../ERC721A.sol';


/**
 * @title ERC721A Queryable
 * @dev ERC721A subclass with convenience query functions.
 */
abstract contract ERC721AQueryable is ERC721A, IERC721AQueryable {
    /**
     * @dev Returns the `TokenOwnership` struct at `tokenId` without reverting.
     *
     * If the `tokenId` is out of bounds:
     *   - `addr` = `address(0)`
     *   - `startTimestamp` = `0`
     *   - `burned` = `false`
     *
     * If the `tokenId` is burned:
     *   - `addr` = `<Address of owner before token was burned>`
     *   - `startTimestamp` = `<Timestamp when token was burned>`
     *   - `burned = `true`
     *
     * Otherwise:
     *   - `addr` = `<Address of owner>`
     *   - `startTimestamp` = `<Timestamp of start of ownership>`
     *   - `burned = `false`
     */
    function explicitOwnershipOf(uint256 tokenId) public view override returns (TokenOwnership memory) {
        TokenOwnership memory ownership;
        if (tokenId < _startTokenId() || tokenId >= _currentIndex) {
            return ownership;
        }
        ownership = _ownerships[tokenId];
        if (ownership.burned) {
            return ownership;
        }
        return _ownershipOf(tokenId);
    }

    /**
     * @dev Returns an array of `TokenOwnership` structs at `tokenIds` in order.
     * See {ERC721AQueryable-explicitOwnershipOf}
     */
    function explicitOwnershipsOf(uint256[] memory tokenIds) external view override returns (TokenOwnership[] memory) {
        unchecked {
            uint256 tokenIdsLength = tokenIds.length;
            TokenOwnership[] memory ownerships = new TokenOwnership[](tokenIdsLength);
            for (uint256 i; i != tokenIdsLength; ++i) {
                ownerships[i] = explicitOwnershipOf(tokenIds[i]);
            }
            return ownerships;
        }
    }

    /**
     * @dev Returns an array of token IDs owned by `owner`,
     * in the range [`start`, `stop`)
     * (i.e. `start <= tokenId < stop`).
     *
     * This function allows for tokens to be queried if the collection
     * grows too big for a single call of {ERC721AQueryable-tokensOfOwner}.
     *
     * Requirements:
     *
     * - `start` < `stop`
     */
    function tokensOfOwnerIn(
        address owner,
        uint256 start,
        uint256 stop
    ) external view override returns (uint256[] memory) {
        unchecked {
            if (start >= stop) revert InvalidQueryRange();
            uint256 tokenIdsIdx;
            uint256 stopLimit = _currentIndex;
            // Set `start = max(start, _startTokenId())`.
            if (start < _startTokenId()) {
                start = _startTokenId();
            }
            // Set `stop = min(stop, _currentIndex)`.
            if (stop > stopLimit) {
                stop = stopLimit;
            }
            uint256 tokenIdsMaxLength = balanceOf(owner);
            // Set `tokenIdsMaxLength = min(balanceOf(owner), stop - start)`,
            // to cater for cases where `balanceOf(owner)` is too big.
            if (start < stop) {
                uint256 rangeLength = stop - start;
                if (rangeLength < tokenIdsMaxLength) {
                    tokenIdsMaxLength = rangeLength;
                }
            } else {
                tokenIdsMaxLength = 0;
            }
            uint256[] memory tokenIds = new uint256[](tokenIdsMaxLength);
            if (tokenIdsMaxLength == 0) {
                return tokenIds;
            }
            // We need to call `explicitOwnershipOf(start)`,
            // because the slot at `start` may not be initialized.
            TokenOwnership memory ownership = explicitOwnershipOf(start);
            address currOwnershipAddr;
            // If the starting slot exists (i.e. not burned), initialize `currOwnershipAddr`.
            // `ownership.address` will not be zero, as `start` is clamped to the valid token ID range.
            if (!ownership.burned) {
                currOwnershipAddr = ownership.addr;
            }
            for (uint256 i = start; i != stop && tokenIdsIdx != tokenIdsMaxLength; ++i) {
                ownership = _ownerships[i];
                if (ownership.burned) {
                    continue;
                }
                if (ownership.addr != address(0)) {
                    currOwnershipAddr = ownership.addr;
                }
                if (currOwnershipAddr == owner) {
                    tokenIds[tokenIdsIdx++] = i;
                }
            }
            // Downsize the array to fit.
            assembly {
                mstore(tokenIds, tokenIdsIdx)
            }
            return tokenIds;
        }
    }

    /**
     * @dev Returns an array of token IDs owned by `owner`.
     *
     * This function scans the ownership mapping and is O(totalSupply) in complexity.
     * It is meant to be called off-chain.
     *
     * See {ERC721AQueryable-tokensOfOwnerIn} for splitting the scan into
     * multiple smaller scans if the collection is large enough to cause
     * an out-of-gas error (10K pfp collections should be fine).
     */
    function tokensOfOwner(address owner) external view override returns (uint256[] memory) {
        unchecked {
            uint256 tokenIdsIdx;
            address currOwnershipAddr;
            uint256 tokenIdsLength = balanceOf(owner);
            uint256[] memory tokenIds = new uint256[](tokenIdsLength);
            TokenOwnership memory ownership;
            for (uint256 i = _startTokenId(); tokenIdsIdx != tokenIdsLength; ++i) {
                ownership = _ownerships[i];
                if (ownership.burned) {
                    continue;
                }
                if (ownership.addr != address(0)) {
                    currOwnershipAddr = ownership.addr;
                }
                if (currOwnershipAddr == owner) {
                    tokenIds[tokenIdsIdx++] = i;
                }
            }
            return tokenIds;
        }
    }
}

File 17 of 19 : IERC721A.sol
// SPDX-License-Identifier: MIT
// ERC721A Contracts v3.3.0
// Creator: Chiru Labs

pragma solidity ^0.8.4;

import '@openzeppelin/contracts/token/ERC721/IERC721.sol';
import '@openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol';

/**
 * @dev Interface of an ERC721A compliant contract.
 */
interface IERC721A is IERC721, IERC721Metadata {
    /**
     * The caller must own the token or be an approved operator.
     */
    error ApprovalCallerNotOwnerNorApproved();

    /**
     * The token does not exist.
     */
    error ApprovalQueryForNonexistentToken();

    /**
     * The caller cannot approve to their own address.
     */
    error ApproveToCaller();

    /**
     * The caller cannot approve to the current owner.
     */
    error ApprovalToCurrentOwner();

    /**
     * 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();

    // Compiler will pack this into a single 256bit word.
    struct TokenOwnership {
        // The address of the owner.
        address addr;
        // Keeps track of the start time of ownership with minimal overhead for tokenomics.
        uint64 startTimestamp;
        // Whether the token has been burned.
        bool burned;
    }

    // Compiler will pack this into a single 256bit word.
    struct AddressData {
        // Realistically, 2**64-1 is more than enough.
        uint64 balance;
        // Keeps track of mint count with minimal overhead for tokenomics.
        uint64 numberMinted;
        // Keeps track of burn count with minimal overhead for tokenomics.
        uint64 numberBurned;
        // For miscellaneous variable(s) pertaining to the address
        // (e.g. number of whitelist mint slots used).
        // If there are multiple variables, please pack them into a uint64.
        uint64 aux;
    }

    /**
     * @dev Returns the total amount of tokens stored by the contract.
     * 
     * Burned tokens are calculated here, use `_totalMinted()` if you want to count just minted tokens.
     */
    function totalSupply() external view returns (uint256);
}

File 18 of 19 : ERC721A.sol
// SPDX-License-Identifier: MIT
// ERC721A Contracts v3.3.0
// Creator: Chiru Labs

pragma solidity ^0.8.4;

import './IERC721A.sol';
import '@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol';
import '@openzeppelin/contracts/utils/Address.sol';
import '@openzeppelin/contracts/utils/Context.sol';
import '@openzeppelin/contracts/utils/Strings.sol';
import '@openzeppelin/contracts/utils/introspection/ERC165.sol';

/**
 * @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including
 * the Metadata extension. Built to optimize for lower gas during batch mints.
 *
 * Assumes serials are sequentially minted starting at _startTokenId() (defaults to 0, e.g. 0, 1, 2, 3..).
 *
 * Assumes that an owner cannot have more than 2**64 - 1 (max value of uint64) of supply.
 *
 * Assumes that the maximum token id cannot exceed 2**256 - 1 (max value of uint256).
 */
contract ERC721A is Context, ERC165, IERC721A {
    using Address for address;
    using Strings for uint256;

    // The tokenId of the next token to be minted.
    uint256 internal _currentIndex;

    // The number of tokens burned.
    uint256 internal _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 _ownershipOf implementation for details.
    mapping(uint256 => TokenOwnership) internal _ownerships;

    // Mapping owner address to address data
    mapping(address => AddressData) private _addressData;

    // Mapping from token ID to approved address
    mapping(uint256 => address) private _tokenApprovals;

    // Mapping from owner to operator approvals
    mapping(address => mapping(address => bool)) private _operatorApprovals;

    constructor(string memory name_, string memory symbol_) {
        _name = name_;
        _symbol = symbol_;
        _currentIndex = _startTokenId();
    }

    /**
     * To change the starting tokenId, please override this function.
     */
    function _startTokenId() internal view virtual returns (uint256) {
        return 0;
    }

    /**
     * @dev Burned tokens are calculated here, use _totalMinted() if you want to count just minted tokens.
     */
    function totalSupply() public view override returns (uint256) {
        // Counter underflow is impossible as _burnCounter cannot be incremented
        // more than _currentIndex - _startTokenId() times
        unchecked {
            return _currentIndex - _burnCounter - _startTokenId();
        }
    }

    /**
     * Returns the total amount of tokens minted in the contract.
     */
    function _totalMinted() internal view returns (uint256) {
        // Counter underflow is impossible as _currentIndex does not decrement,
        // and it is initialized to _startTokenId()
        unchecked {
            return _currentIndex - _startTokenId();
        }
    }

    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) {
        return
            interfaceId == type(IERC721).interfaceId ||
            interfaceId == type(IERC721Metadata).interfaceId ||
            super.supportsInterface(interfaceId);
    }

    /**
     * @dev See {IERC721-balanceOf}.
     */
    function balanceOf(address owner) public view override returns (uint256) {
        if (owner == address(0)) revert BalanceQueryForZeroAddress();
        return uint256(_addressData[owner].balance);
    }

    /**
     * Returns the number of tokens minted by `owner`.
     */
    function _numberMinted(address owner) internal view returns (uint256) {
        return uint256(_addressData[owner].numberMinted);
    }

    /**
     * Returns the number of tokens burned by or on behalf of `owner`.
     */
    function _numberBurned(address owner) internal view returns (uint256) {
        return uint256(_addressData[owner].numberBurned);
    }

    /**
     * Returns the auxillary data for `owner`. (e.g. number of whitelist mint slots used).
     */
    function _getAux(address owner) internal view returns (uint64) {
        return _addressData[owner].aux;
    }

    /**
     * Sets the auxillary 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 {
        _addressData[owner].aux = aux;
    }

    /**
     * Gas spent here starts off proportional to the maximum mint batch size.
     * It gradually moves to O(1) as tokens get transferred around in the collection over time.
     */
    function _ownershipOf(uint256 tokenId) internal view returns (TokenOwnership memory) {
        uint256 curr = tokenId;

        unchecked {
            if (_startTokenId() <= curr) if (curr < _currentIndex) {
                TokenOwnership memory ownership = _ownerships[curr];
                if (!ownership.burned) {
                    if (ownership.addr != address(0)) {
                        return ownership;
                    }
                    // Invariant:
                    // There will always be an ownership that has an address and is not burned
                    // before an ownership that does not have an address and is not burned.
                    // Hence, curr will not underflow.
                    while (true) {
                        curr--;
                        ownership = _ownerships[curr];
                        if (ownership.addr != address(0)) {
                            return ownership;
                        }
                    }
                }
            }
        }
        revert OwnerQueryForNonexistentToken();
    }

    /**
     * @dev See {IERC721-ownerOf}.
     */
    function ownerOf(uint256 tokenId) public view override returns (address) {
        return _ownershipOf(tokenId).addr;
    }

    /**
     * @dev See {IERC721Metadata-name}.
     */
    function name() public view virtual override returns (string memory) {
        return _name;
    }

    /**
     * @dev See {IERC721Metadata-symbol}.
     */
    function symbol() public view virtual override returns (string memory) {
        return _symbol;
    }

    /**
     * @dev See {IERC721Metadata-tokenURI}.
     */
    function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
        if (!_exists(tokenId)) revert URIQueryForNonexistentToken();

        string memory baseURI = _baseURI();
        return bytes(baseURI).length != 0 ? string(abi.encodePacked(baseURI, tokenId.toString())) : '';
    }

    /**
     * @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, can be overriden in child contracts.
     */
    function _baseURI() internal view virtual returns (string memory) {
        return '';
    }

    /**
     * @dev See {IERC721-approve}.
     */
    function approve(address to, uint256 tokenId) public override {
        address owner = ERC721A.ownerOf(tokenId);
        if (to == owner) revert ApprovalToCurrentOwner();

        if (_msgSender() != owner) if(!isApprovedForAll(owner, _msgSender())) {
            revert ApprovalCallerNotOwnerNorApproved();
        }

        _approve(to, tokenId, owner);
    }

    /**
     * @dev See {IERC721-getApproved}.
     */
    function getApproved(uint256 tokenId) public view override returns (address) {
        if (!_exists(tokenId)) revert ApprovalQueryForNonexistentToken();

        return _tokenApprovals[tokenId];
    }

    /**
     * @dev See {IERC721-setApprovalForAll}.
     */
    function setApprovalForAll(address operator, bool approved) public virtual override {
        if (operator == _msgSender()) revert ApproveToCaller();

        _operatorApprovals[_msgSender()][operator] = approved;
        emit ApprovalForAll(_msgSender(), operator, approved);
    }

    /**
     * @dev See {IERC721-isApprovedForAll}.
     */
    function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) {
        return _operatorApprovals[owner][operator];
    }

    /**
     * @dev See {IERC721-transferFrom}.
     */
    function transferFrom(
        address from,
        address to,
        uint256 tokenId
    ) public virtual override {
        _transfer(from, to, tokenId);
    }

    /**
     * @dev See {IERC721-safeTransferFrom}.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 tokenId
    ) public virtual override {
        safeTransferFrom(from, to, tokenId, '');
    }

    /**
     * @dev See {IERC721-safeTransferFrom}.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 tokenId,
        bytes memory _data
    ) public virtual override {
        _transfer(from, to, tokenId);
        if (to.isContract()) if(!_checkContractOnERC721Received(from, to, tokenId, _data)) {
            revert TransferToNonERC721ReceiverImplementer();
        }
    }

    /**
     * @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 (`_mint`),
     */
    function _exists(uint256 tokenId) internal view returns (bool) {
        return _startTokenId() <= tokenId && tokenId < _currentIndex && !_ownerships[tokenId].burned;
    }

    /**
     * @dev Equivalent to `_safeMint(to, quantity, '')`.
     */
    function _safeMint(address to, uint256 quantity) internal {
        _safeMint(to, 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.
     *
     * Emits a {Transfer} event.
     */
    function _safeMint(
        address to,
        uint256 quantity,
        bytes memory _data
    ) internal {
        uint256 startTokenId = _currentIndex;
        if (to == address(0)) revert MintToZeroAddress();
        if (quantity == 0) revert MintZeroQuantity();

        _beforeTokenTransfers(address(0), to, startTokenId, quantity);

        // Overflows are incredibly unrealistic.
        // balance or numberMinted overflow if current value of either + quantity > 1.8e19 (2**64) - 1
        // updatedIndex overflows if _currentIndex + quantity > 1.2e77 (2**256) - 1
        unchecked {
            _addressData[to].balance += uint64(quantity);
            _addressData[to].numberMinted += uint64(quantity);

            _ownerships[startTokenId].addr = to;
            _ownerships[startTokenId].startTimestamp = uint64(block.timestamp);

            uint256 updatedIndex = startTokenId;
            uint256 end = updatedIndex + quantity;

            if (to.isContract()) {
                do {
                    emit Transfer(address(0), to, updatedIndex);
                    if (!_checkContractOnERC721Received(address(0), to, updatedIndex++, _data)) {
                        revert TransferToNonERC721ReceiverImplementer();
                    }
                } while (updatedIndex < end);
                // Reentrancy protection
                if (_currentIndex != startTokenId) revert();
            } else {
                do {
                    emit Transfer(address(0), to, updatedIndex++);
                } while (updatedIndex < end);
            }
            _currentIndex = updatedIndex;
        }
        _afterTokenTransfers(address(0), to, startTokenId, quantity);
    }

    /**
     * @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.
     */
    function _mint(address to, uint256 quantity) internal {
        uint256 startTokenId = _currentIndex;
        if (to == address(0)) revert MintToZeroAddress();
        if (quantity == 0) revert MintZeroQuantity();

        _beforeTokenTransfers(address(0), to, startTokenId, quantity);

        // Overflows are incredibly unrealistic.
        // balance or numberMinted overflow if current value of either + quantity > 1.8e19 (2**64) - 1
        // updatedIndex overflows if _currentIndex + quantity > 1.2e77 (2**256) - 1
        unchecked {
            _addressData[to].balance += uint64(quantity);
            _addressData[to].numberMinted += uint64(quantity);

            _ownerships[startTokenId].addr = to;
            _ownerships[startTokenId].startTimestamp = uint64(block.timestamp);

            uint256 updatedIndex = startTokenId;
            uint256 end = updatedIndex + quantity;

            do {
                emit Transfer(address(0), to, updatedIndex++);
            } while (updatedIndex < end);

            _currentIndex = updatedIndex;
        }
        _afterTokenTransfers(address(0), to, startTokenId, quantity);
    }

    /**
     * @dev Transfers `tokenId` from `from` to `to`.
     *
     * Requirements:
     *
     * - `to` cannot be the zero address.
     * - `tokenId` token must be owned by `from`.
     *
     * Emits a {Transfer} event.
     */
    function _transfer(
        address from,
        address to,
        uint256 tokenId
    ) private {
        TokenOwnership memory prevOwnership = _ownershipOf(tokenId);

        if (prevOwnership.addr != from) revert TransferFromIncorrectOwner();

        bool isApprovedOrOwner = (_msgSender() == from ||
            isApprovedForAll(from, _msgSender()) ||
            getApproved(tokenId) == _msgSender());

        if (!isApprovedOrOwner) revert TransferCallerNotOwnerNorApproved();
        if (to == address(0)) revert TransferToZeroAddress();

        _beforeTokenTransfers(from, to, tokenId, 1);

        // Clear approvals from the previous owner
        _approve(address(0), tokenId, from);

        // 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 {
            _addressData[from].balance -= 1;
            _addressData[to].balance += 1;

            TokenOwnership storage currSlot = _ownerships[tokenId];
            currSlot.addr = to;
            currSlot.startTimestamp = uint64(block.timestamp);

            // If the ownership slot of tokenId+1 is not explicitly set, that means the transfer initiator owns it.
            // Set the slot of tokenId+1 explicitly in storage to maintain correctness for ownerOf(tokenId+1) calls.
            uint256 nextTokenId = tokenId + 1;
            TokenOwnership storage nextSlot = _ownerships[nextTokenId];
            if (nextSlot.addr == address(0)) {
                // This will suffice for checking _exists(nextTokenId),
                // as a burned slot cannot contain the zero address.
                if (nextTokenId != _currentIndex) {
                    nextSlot.addr = from;
                    nextSlot.startTimestamp = prevOwnership.startTimestamp;
                }
            }
        }

        emit Transfer(from, to, tokenId);
        _afterTokenTransfers(from, to, tokenId, 1);
    }

    /**
     * @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 {
        TokenOwnership memory prevOwnership = _ownershipOf(tokenId);

        address from = prevOwnership.addr;

        if (approvalCheck) {
            bool isApprovedOrOwner = (_msgSender() == from ||
                isApprovedForAll(from, _msgSender()) ||
                getApproved(tokenId) == _msgSender());

            if (!isApprovedOrOwner) revert TransferCallerNotOwnerNorApproved();
        }

        _beforeTokenTransfers(from, address(0), tokenId, 1);

        // Clear approvals from the previous owner
        _approve(address(0), tokenId, from);

        // 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 {
            AddressData storage addressData = _addressData[from];
            addressData.balance -= 1;
            addressData.numberBurned += 1;

            // Keep track of who burned the token, and the timestamp of burning.
            TokenOwnership storage currSlot = _ownerships[tokenId];
            currSlot.addr = from;
            currSlot.startTimestamp = uint64(block.timestamp);
            currSlot.burned = true;

            // If the ownership slot of tokenId+1 is not explicitly set, that means the burn initiator owns it.
            // Set the slot of tokenId+1 explicitly in storage to maintain correctness for ownerOf(tokenId+1) calls.
            uint256 nextTokenId = tokenId + 1;
            TokenOwnership storage nextSlot = _ownerships[nextTokenId];
            if (nextSlot.addr == address(0)) {
                // This will suffice for checking _exists(nextTokenId),
                // as a burned slot cannot contain the zero address.
                if (nextTokenId != _currentIndex) {
                    nextSlot.addr = from;
                    nextSlot.startTimestamp = prevOwnership.startTimestamp;
                }
            }
        }

        emit Transfer(from, address(0), tokenId);
        _afterTokenTransfers(from, address(0), tokenId, 1);

        // Overflow not possible, as _burnCounter cannot be exceed _currentIndex times.
        unchecked {
            _burnCounter++;
        }
    }

    /**
     * @dev Approve `to` to operate on `tokenId`
     *
     * Emits a {Approval} event.
     */
    function _approve(
        address to,
        uint256 tokenId,
        address owner
    ) private {
        _tokenApprovals[tokenId] = to;
        emit Approval(owner, to, tokenId);
    }

    /**
     * @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target contract.
     *
     * @param from address representing the previous owner of the given token ID
     * @param to target address that will receive the tokens
     * @param tokenId uint256 ID of the token to be transferred
     * @param _data bytes optional data to send along with the call
     * @return bool whether the call correctly returned the expected magic value
     */
    function _checkContractOnERC721Received(
        address from,
        address to,
        uint256 tokenId,
        bytes memory _data
    ) private returns (bool) {
        try IERC721Receiver(to).onERC721Received(_msgSender(), from, tokenId, _data) returns (bytes4 retval) {
            return retval == IERC721Receiver(to).onERC721Received.selector;
        } catch (bytes memory reason) {
            if (reason.length == 0) {
                revert TransferToNonERC721ReceiverImplementer();
            } else {
                assembly {
                    revert(add(32, reason), mload(reason))
                }
            }
        }
    }

    /**
     * @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 {}
}

File 19 of 19 : CryptoDudesNFT.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;

//@author Mia Dude
//@title CryptoDudes NFT

import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol";
import "@openzeppelin/contracts/finance/PaymentSplitter.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
import "./ERC721A.sol";
import "./extensions/ERC721AQueryable.sol";

contract CryptoDudesNFT is Ownable, ERC721A, ERC721AQueryable, PaymentSplitter {

    using Strings for uint;

    // *************** selling steps
    // Gift: Reserved for the team and gifts
    // Sale: whitelist and public sale
    // End: mint finished, we can call the setRevealedURI
    // Revealed: ! \o/

    


    enum Step {
        Gift,
        Sale,
        End,
        Revealed,
        Frozen
    }

    Step public sellingStep;

    //settings ----
    uint public MAX_SUPPLY = 2222;
    uint public MAX_WHITELIST = 200;
    uint public MAX_PUBLIC = 2000;
    uint public MAX_GIFT = 22;

    uint public MAX_MINT_PER_TRANSACTION = 20;
    uint public MAX_NFT_PER_WALLET_WHITELIST = 1;

    uint public WHITELIST_DURATION = 1440 minutes;

    uint public wlSalePrice = 0.11 ether;
    uint public publicSalePrice = 0.11 ether;

    uint public saleStartTime = 1655568000;

    bytes32 public merkleRoot;

    //URI of the NFTs when revealed
    string public baseURI;

    //URI of the NFTs when not revealed
    string public notRevealedURI;

    //keep track of whitelisted mint
    mapping(address => uint) public amountNFTsperWalletWhitelistSale;

    //team share length
    uint private teamLength;

    // **********************************************************************************
    // *********** CONSTRUCTOR 
    // **********************************************************************************

    constructor(address[] memory _team, uint[] memory _teamShares, bytes32 _merkleRoot, string memory _notRevealedURI, uint _startTime) ERC721A("CryptoDudes", "CRYPTODUDES") PaymentSplitter(_team, _teamShares) {
        merkleRoot = _merkleRoot;
        notRevealedURI = _notRevealedURI;
        teamLength = _team.length;
        saleStartTime = _startTime;
    }

    modifier callerIsUser() {
        require(tx.origin == msg.sender, "The caller is another contract");
        _;
    }


    // **********************************************************************************
    // *********** WHITE LIST MINT 
    // **********************************************************************************

    function whitelistMint(address _account, uint _quantity, bytes32[] calldata _proof) external payable callerIsUser {
        uint price = wlSalePrice;
        require(price != 0, "Price is 0");

        // check times after startime and before starttime + whitelist duration
        require(currentTime() >= saleStartTime, "Whitelist mint has not started yet");
        require(currentTime() <= saleStartTime + WHITELIST_DURATION, "Whitelist Sale is finished");

        // are we in step sale, whitelisted, and trying to mint only MAX_NFT_PER_WALLET_WHITELIST
        require(sellingStep == Step.Sale, "Whitelist mint is not activated");
        require(isWhiteListed(msg.sender, _quantity, _proof), "You are not whitelisted");
        require(amountNFTsperWalletWhitelistSale[msg.sender] + _quantity <= MAX_NFT_PER_WALLET_WHITELIST, "You can only get 1 NFT during the Whitelist mint");

        // allow mint up to MAX_WHITELIST
        require(totalSupply() + _quantity <= MAX_WHITELIST + MAX_GIFT, "Max supply whitelist exceeded");

        // are you sending enough eth
        require(msg.value >= price * _quantity, "Not enought funds");

        // mint 
        amountNFTsperWalletWhitelistSale[msg.sender] += _quantity;
        _safeMint(_account, _quantity);
    }

    // **********************************************************************************
    // *********** PUBLIC MINT  
    // **********************************************************************************

    function publicSaleMint(address _account, uint _quantity) external payable callerIsUser {
        uint price = publicSalePrice;
        require(price != 0, "Price is 0");

        // check times after the whitelist phase only
        require(currentTime() > saleStartTime + WHITELIST_DURATION, "Public mint has not started yet");

        // are we in step sale, and trying to mint too many nft
        require(sellingStep == Step.Sale, "Public mint is not activated");
        require(_quantity <= MAX_MINT_PER_TRANSACTION, "You tried to mint too many NFT in a single transaction");
        

        // allow mint up to MAX_WHITELIST + MAX_PUBLIC during public mint
        require(totalSupply() + _quantity <= MAX_SUPPLY, "Max supply exceeded");   

        // are you sending enough eth
        require(msg.value >= price * _quantity, "Not enought funds");

        // if we reach the max minted here, automatically switch to the End Step (team and gift mint)
        if (totalSupply() + _quantity == MAX_SUPPLY) {
            sellingStep = Step.End;
        }
        _safeMint(_account, _quantity);
    }

    // **********************************************************************************
    // *********** TEAM AND GIFTS MINT 
    // **********************************************************************************

    function gift(address _to, uint _quantity) external onlyOwner {
        require(sellingStep == Step.Gift, "No Gift during the public sale");
        require(totalSupply() + _quantity <= MAX_GIFT, "Can't gift more than MAX_GIFT");

        if (totalSupply() + _quantity == MAX_GIFT) {
            sellingStep = Step.Sale;
        }
        _safeMint(_to, _quantity);
    }


    // **********************************************************************************
    // *********** BASE URI SETTINGS  
    // **********************************************************************************

    function setRevealedURI(string memory _baseURI) external onlyOwner {
        require(sellingStep == Step.End, "You can only update the revealed URI after the sales");
        sellingStep = Step.Revealed;
        baseURI = _baseURI;
    }

    function currentTime() internal view returns(uint) {
        return block.timestamp;
    }

    // Owner can update manually the steps (ex, if not sold out, switch to sellingStep 'End' allows to do the reveal, or if URI needs an emergency update)
    // Setting the step 'frozen' means that we can't go back to another step (setRevealedURI works only for the 'End' Step, so when frozen, nobody can change the metadatas URI)
    // as we are on IPFS, it's fully decentralized, and nobody will change the NFTs traits and images
    function setStep(uint _step) external onlyOwner {
        require(sellingStep != Step.Frozen, "Set selling steps is now frozen!");
        sellingStep = Step(_step);
    }

    function setNotRevealedURI(string memory _notRevealedURI) external onlyOwner {
        notRevealedURI = _notRevealedURI;
    }

    function tokenURI(uint _tokenId) public view virtual override returns (string memory) {
        require(_exists(_tokenId), "URI query for nonexistent token");

        if(sellingStep < Step.Revealed) {
            return notRevealedURI;
        }
        
        return string(abi.encodePacked(baseURI, _tokenId.toString(), ".json"));

    }

    // **********************************************************************************
    // *********** merkle tree functions
    // **********************************************************************************
    function isWhiteListed(address _account, uint256 _amount,  bytes32[] calldata _proof) internal view returns(bool) {
        return _verify(leaf(_account, _amount), _proof);
    }

    function leaf(address _account, uint256 _amount) internal pure returns(bytes32) {
        return keccak256(abi.encodePacked(_account,_amount));
    }

    function _verify(bytes32 _leaf, bytes32[] memory _proof) internal view returns(bool) {
        return MerkleProof.verify(_proof, merkleRoot, _leaf);
    }

    // **********************************************************************************
    // *********** settings can ONLY be changed before the sale start time 
    // **********************************************************************************

    function setSaleStartTime(uint _saleStartTime) external onlyOwner {
        require(currentTime() < saleStartTime,"Sale has already started");
        saleStartTime = _saleStartTime;
    }

    function setMerkleRoot(bytes32 _merkleRoot) external onlyOwner {
        require(currentTime() < saleStartTime,"Sale is already started");
        merkleRoot = _merkleRoot;
    }


    function setSupply(uint _maxSupply, uint _maxWhitelist, uint _maxPublic, uint _maxGift) external onlyOwner {
        require(currentTime() < saleStartTime,"Sale is already started");
        require(_maxSupply == _maxWhitelist + _maxPublic + _maxGift,"Wrong supply count" );
        MAX_SUPPLY = _maxSupply;                // 2222
        MAX_WHITELIST = _maxWhitelist;          //  200
        MAX_PUBLIC = _maxPublic;                // 2000
        MAX_GIFT = _maxGift;                    //   22   (2222 = 200 + 2000 + 22)
    }
   
    function setMaxMintPerTransaction(uint _maxMintPerTransaction) external onlyOwner {
        require(currentTime() < saleStartTime,"Sale is already started");
        MAX_MINT_PER_TRANSACTION = _maxMintPerTransaction;
    }
   
    function setMaxNFTPerWalletWhitelist(uint _maxNFTperWhitelist) external onlyOwner {
        require(currentTime() < saleStartTime,"Sale is already started");
        MAX_NFT_PER_WALLET_WHITELIST = _maxNFTperWhitelist;
    }

    function setWhitelistDuration(uint _duration) external onlyOwner {
        require(currentTime() < saleStartTime,"Sale is already started");
        WHITELIST_DURATION = _duration;
    }

    function setWhitelistPrice(uint _wlPrice) external onlyOwner {
        require(currentTime() < saleStartTime,"Sale is already started");
        wlSalePrice = _wlPrice;
    }
   
    function setPublicPrice(uint _price) external onlyOwner {
        require(currentTime() < saleStartTime,"Sale is already started");
        publicSalePrice = _price;
    }

    // ********** end settings **********************************************************



    // ReleaseALL sale funds
    function releaseAll() external {
        for(uint i = 0 ; i < teamLength ; i++) {
            release(payable(payee(i)));
        }
    }

    receive() override external payable {
        revert('Only if you mint');
    }

}

Settings
{
  "remappings": [],
  "optimizer": {
    "enabled": true,
    "runs": 200
  },
  "evmVersion": "istanbul",
  "libraries": {},
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  }
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"string","name":"_baseURI","type":"string"},{"internalType":"address","name":"_nft","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"ApprovalCallerNotOwnerNorApproved","type":"error"},{"inputs":[],"name":"ApprovalQueryForNonexistentToken","type":"error"},{"inputs":[],"name":"ApprovalToCurrentOwner","type":"error"},{"inputs":[],"name":"ApproveToCaller","type":"error"},{"inputs":[],"name":"BalanceQueryForZeroAddress","type":"error"},{"inputs":[],"name":"InvalidQueryRange","type":"error"},{"inputs":[],"name":"MintToZeroAddress","type":"error"},{"inputs":[],"name":"MintZeroQuantity","type":"error"},{"inputs":[],"name":"OwnerQueryForNonexistentToken","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":"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":"MAX_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":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"baseURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"explicitOwnershipOf","outputs":[{"components":[{"internalType":"address","name":"addr","type":"address"},{"internalType":"uint64","name":"startTimestamp","type":"uint64"},{"internalType":"bool","name":"burned","type":"bool"}],"internalType":"struct IERC721A.TokenOwnership","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"}],"name":"explicitOwnershipsOf","outputs":[{"components":[{"internalType":"address","name":"addr","type":"address"},{"internalType":"uint64","name":"startTimestamp","type":"uint64"},{"internalType":"bool","name":"burned","type":"bool"}],"internalType":"struct IERC721A.TokenOwnership[]","name":"","type":"tuple[]"}],"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":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"isGlassMinted","outputs":[{"internalType":"bool","name":"","type":"bool"}],"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":[{"internalType":"address","name":"_account","type":"address"},{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"},{"internalType":"address","name":"_nftContract","type":"address"}],"name":"publicMint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"saleStartTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"_baseURI","type":"string"}],"name":"setBaseURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_saleStartTime","type":"uint256"}],"name":"setSaleStartTime","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"tokensOfOwner","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"start","type":"uint256"},{"internalType":"uint256","name":"stop","type":"uint256"}],"name":"tokensOfOwnerIn","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_nftContract","type":"address"},{"internalType":"bool","name":"_allowed","type":"bool"}],"name":"updateAllowedContract","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_maxSupply","type":"uint256"}],"name":"updateMaxSupply","outputs":[],"stateMutability":"nonpayable","type":"function"}]

60806040526362efe180600a556108ae600b553480156200001f57600080fd5b50604051620024cd380380620024cd83398101604081905262000042916200022f565b6040518060400160405280600c81526020016b2bb434ba32a93ab9b9b4b0b760a11b8152506040518060400160405280600c81526020016b2ba424aa22a92aa9a9a4a0a760a11b815250620000a6620000a06200011860201b60201c565b6200011c565b8151620000bb9060039060208501906200016c565b508051620000d19060049060208401906200016c565b50600060015550508151620000ee9060099060208501906200016c565b506001600160a01b03166000908152600d60205260409020805460ff19166001179055506200036d565b3390565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b8280546200017a906200031a565b90600052602060002090601f0160209004810192826200019e5760008555620001e9565b82601f10620001b957805160ff1916838001178555620001e9565b82800160010185558215620001e9579182015b82811115620001e9578251825591602001919060010190620001cc565b50620001f7929150620001fb565b5090565b5b80821115620001f75760008155600101620001fc565b80516001600160a01b03811681146200022a57600080fd5b919050565b6000806040838503121562000242578182fd5b82516001600160401b038082111562000259578384fd5b818501915085601f8301126200026d578384fd5b81518181111562000282576200028262000357565b604051601f8201601f19908116603f01168101908382118183101715620002ad57620002ad62000357565b81604052828152602093508884848701011115620002c9578687fd5b8691505b82821015620002ec5784820184015181830185015290830190620002cd565b82821115620002fd57868484830101525b95506200030f91505085820162000212565b925050509250929050565b600181811c908216806200032f57607f821691505b602082108114156200035157634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052604160045260246000fd5b612150806200037d6000396000f3fe608060405234801561001057600080fd5b50600436106101da5760003560e01c8063715018a611610104578063b88d4fde116100a2578063e497e85b11610071578063e497e85b146103f1578063e985e9c51461041f578063f103b43314610432578063f2fde38b1461044557600080fd5b8063b88d4fde14610398578063c23dc68f146103ab578063c87b56dd146103cb578063e29cd178146103de57600080fd5b80638da5cb5b116100de5780638da5cb5b1461035957806395d89b411461036a57806399a2557a14610372578063a22cb4651461038557600080fd5b8063715018a61461031e57806377cc38ad146103265780638462151c1461033957600080fd5b806332cb6b0c1161017c5780635bbb21771161014b5780635bbb2177146102d05780636352211e146102f05780636c0360eb1461030357806370a082311461030b57600080fd5b806332cb6b0c1461028e57806342842e0e14610297578063525f8a5c146102aa57806355f804b3146102bd57600080fd5b8063095ea7b3116101b8578063095ea7b31461024757806318160ddd1461025c5780631cbaee2d1461027257806323b872dd1461027b57600080fd5b806301ffc9a7146101df57806306fdde0314610207578063081812fc1461021c575b600080fd5b6101f26101ed366004611de9565b610458565b60405190151581526020015b60405180910390f35b61020f6104aa565b6040516101fe9190611fa8565b61022f61022a366004611e66565b61053c565b6040516001600160a01b0390911681526020016101fe565b61025a610255366004611ce3565b610580565b005b600254600154035b6040519081526020016101fe565b610264600a5481565b61025a610289366004611b61565b610607565b610264600b5481565b61025a6102a5366004611b61565b610612565b61025a6102b8366004611e66565b61062d565b61025a6102cb366004611e21565b610665565b6102e36102de366004611d42565b6106a6565b6040516101fe9190611f06565b61022f6102fe366004611e66565b610796565b61020f6107a8565b610264610319366004611af1565b610836565b61025a610884565b61025a610334366004611c1d565b6108ba565b61034c610347366004611af1565b610c3b565b6040516101fe9190611f70565b6000546001600160a01b031661022f565b61020f610da4565b61034c610380366004611d0e565b610db3565b61025a610393366004611cb2565b610f89565b61025a6103a6366004611ba1565b61101f565b6103be6103b9366004611e66565b611069565b6040516101fe9190611ff0565b61020f6103d9366004611e66565b611117565b61025a6103ec366004611cb2565b611200565b6101f26103ff366004611ce3565b600c60209081526000928352604080842090915290825290205460ff1681565b6101f261042d366004611b29565b611255565b61025a610440366004611e66565b611283565b61025a610453366004611af1565b6112b2565b60006001600160e01b031982166380ac58cd60e01b148061048957506001600160e01b03198216635b5e139f60e01b145b806104a457506301ffc9a760e01b6001600160e01b03198316145b92915050565b6060600380546104b99061206d565b80601f01602080910402602001604051908101604052809291908181526020018280546104e59061206d565b80156105325780601f1061050757610100808354040283529160200191610532565b820191906000526020600020905b81548152906001019060200180831161051557829003601f168201915b5050505050905090565b60006105478261134d565b610564576040516333d1c03960e21b815260040160405180910390fd5b506000908152600760205260409020546001600160a01b031690565b600061058b82610796565b9050806001600160a01b0316836001600160a01b031614156105c05760405163250fdee360e21b815260040160405180910390fd5b336001600160a01b038216146105f7576105da8133611255565b6105f7576040516367d9dca160e11b815260040160405180910390fd5b610602838383611379565b505050565b6106028383836113d5565b6106028383836040518060200160405280600081525061101f565b6000546001600160a01b031633146106605760405162461bcd60e51b815260040161065790611fbb565b60405180910390fd5b600a55565b6000546001600160a01b0316331461068f5760405162461bcd60e51b815260040161065790611fbb565b80516106a2906009906020840190611a01565b5050565b80516060906000816001600160401b038111156106d357634e487b7160e01b600052604160045260246000fd5b60405190808252806020026020018201604052801561071e57816020015b60408051606081018252600080825260208083018290529282015282526000199092019101816106f15790505b50905060005b82811461078e5761075b85828151811061074e57634e487b7160e01b600052603260045260246000fd5b6020026020010151611069565b82828151811061077b57634e487b7160e01b600052603260045260246000fd5b6020908102919091010152600101610724565b509392505050565b60006107a1826115c2565b5192915050565b600980546107b59061206d565b80601f01602080910402602001604051908101604052809291908181526020018280546107e19061206d565b801561082e5780601f106108035761010080835404028352916020019161082e565b820191906000526020600020905b81548152906001019060200180831161081157829003601f168201915b505050505081565b60006001600160a01b03821661085f576040516323d3ad8160e21b815260040160405180910390fd5b506001600160a01b03166000908152600660205260409020546001600160401b031690565b6000546001600160a01b031633146108ae5760405162461bcd60e51b815260040161065790611fbb565b6108b860006116dc565b565b3233146109095760405162461bcd60e51b815260206004820152601e60248201527f5468652063616c6c657220697320616e6f7468657220636f6e747261637400006044820152606401610657565b60008080600a546109174290565b10156109655760405162461bcd60e51b815260206004820152601f60248201527f5075626c6963206d696e7420686173206e6f74207374617274656420796574006044820152606401610657565b846109be5760405162461bcd60e51b8152602060048201526024808201527f4e6f2043727970746f44756465734e465420746f6b656e204964732070726f766044820152631a59195960e21b6064820152608401610657565b6001600160a01b0384166000908152600d602052604090205460ff161515600114610a2b5760405162461bcd60e51b815260206004820152601860248201527f4e465420436f6e7472616374206e6f7420616c6c6f77656400000000000000006044820152606401610657565b508260005b85811015610b7857868682818110610a5857634e487b7160e01b600052603260045260246000fd5b905060200201359250336001600160a01b0316826001600160a01b0316636352211e856040518263ffffffff1660e01b8152600401610a9991815260200190565b60206040518083038186803b158015610ab157600080fd5b505afa158015610ac5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ae99190611b0d565b6001600160a01b0316148015610b2357506001600160a01b0385166000908152600c6020908152604080832086845290915290205460ff16155b15610b66576001600160a01b0385166000908152600c602090815260408083208684529091529020805460ff19166001908117909155610b639085612055565b93505b80610b70816120a8565b915050610a30565b5060008311610bc95760405162461bcd60e51b815260206004820152601f60248201527f4f6f6f70732c206e6f20676c61737320746f206d696e7420666f7220796f75006044820152606401610657565b600b5483610bda6002546001540390565b610be49190612055565b1115610c285760405162461bcd60e51b815260206004820152601360248201527213585e081cdd5c1c1b1e48195e18d959591959606a1b6044820152606401610657565b610c32878461172c565b50505050505050565b60606000806000610c4b85610836565b90506000816001600160401b03811115610c7557634e487b7160e01b600052604160045260246000fd5b604051908082528060200260200182016040528015610c9e578160200160208202803683370190505b509050610cc4604080516060810182526000808252602082018190529181019190915290565b60005b838614610d9857600081815260056020908152604091829020825160608101845290546001600160a01b0381168252600160a01b81046001600160401b031692820192909252600160e01b90910460ff16158015928201929092529250610d2d57610d90565b81516001600160a01b031615610d4257815194505b876001600160a01b0316856001600160a01b03161415610d905780838780600101985081518110610d8357634e487b7160e01b600052603260045260246000fd5b6020026020010181815250505b600101610cc7565b50909695505050505050565b6060600480546104b99061206d565b6060818310610dd557604051631960ccad60e11b815260040160405180910390fd5b60015460009080841115610de7578093505b6000610df287610836565b905084861015610e115785850381811015610e0b578091505b50610e15565b5060005b6000816001600160401b03811115610e3d57634e487b7160e01b600052604160045260246000fd5b604051908082528060200260200182016040528015610e66578160200160208202803683370190505b50905081610e79579350610f8292505050565b6000610e8488611069565b905060008160400151610e95575080515b885b888114158015610ea75750848714155b15610f7657600081815260056020908152604091829020825160608101845290546001600160a01b0381168252600160a01b81046001600160401b031692820192909252600160e01b90910460ff16158015928201929092529350610f0b57610f6e565b82516001600160a01b031615610f2057825191505b8a6001600160a01b0316826001600160a01b03161415610f6e5780848880600101995081518110610f6157634e487b7160e01b600052603260045260246000fd5b6020026020010181815250505b600101610e97565b50505092835250909150505b9392505050565b6001600160a01b038216331415610fb35760405163b06307db60e01b815260040160405180910390fd5b3360008181526008602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b61102a8484846113d5565b6001600160a01b0383163b156110635761104684848484611746565b611063576040516368d2bf6b60e11b815260040160405180910390fd5b50505050565b60408051606080820183526000808352602080840182905283850182905284519283018552818352820181905292810183905290915060015483106110ae5792915050565b50600082815260056020908152604091829020825160608101845290546001600160a01b0381168252600160a01b81046001600160401b031692820192909252600160e01b90910460ff16158015928201929092529061110e5792915050565b610f82836115c2565b60606111228261134d565b61116e5760405162461bcd60e51b815260206004820152601f60248201527f55524920717565727920666f72206e6f6e6578697374656e7420746f6b656e006044820152606401610657565b6009805461117b9061206d565b80601f01602080910402602001604051908101604052809291908181526020018280546111a79061206d565b80156111f45780601f106111c9576101008083540402835291602001916111f4565b820191906000526020600020905b8154815290600101906020018083116111d757829003601f168201915b50505050509050919050565b6000546001600160a01b0316331461122a5760405162461bcd60e51b815260040161065790611fbb565b6001600160a01b03919091166000908152600d60205260409020805460ff1916911515919091179055565b6001600160a01b03918216600090815260086020908152604080832093909416825291909152205460ff1690565b6000546001600160a01b031633146112ad5760405162461bcd60e51b815260040161065790611fbb565b600b55565b6000546001600160a01b031633146112dc5760405162461bcd60e51b815260040161065790611fbb565b6001600160a01b0381166113415760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610657565b61134a816116dc565b50565b6000600154821080156104a4575050600090815260056020526040902054600160e01b900460ff161590565b60008281526007602052604080822080546001600160a01b0319166001600160a01b0387811691821790925591518593918516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591a4505050565b60006113e0826115c2565b9050836001600160a01b031681600001516001600160a01b0316146114175760405162a1148160e81b815260040160405180910390fd5b6000336001600160a01b038616148061143557506114358533611255565b806114505750336114458461053c565b6001600160a01b0316145b90508061147057604051632ce44b5f60e11b815260040160405180910390fd5b6001600160a01b03841661149757604051633a954ecd60e21b815260040160405180910390fd5b6114a360008487611379565b6001600160a01b038581166000908152600660209081526040808320805467ffffffffffffffff198082166001600160401b0392831660001901831617909255898616808652838620805493841693831660019081018416949094179055898652600590945282852080546001600160e01b031916909417600160a01b4290921691909102178355870180845292208054919390911661157757600154821461157757805460208601516001600160401b0316600160a01b026001600160e01b03199091166001600160a01b038a16171781555b50505082846001600160a01b0316866001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a45050505050565b6040805160608101825260008082526020820181905291810191909152816001548110156116c357600081815260056020908152604091829020825160608101845290546001600160a01b0381168252600160a01b81046001600160401b031692820192909252600160e01b90910460ff161515918101829052906116c15780516001600160a01b031615611658579392505050565b5060001901600081815260056020908152604091829020825160608101845290546001600160a01b038116808352600160a01b82046001600160401b031693830193909352600160e01b900460ff16151592810192909252156116bc579392505050565b611658565b505b604051636f96cda160e11b815260040160405180910390fd5b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6106a282826040518060200160405280600081525061183e565b604051630a85bd0160e11b81526000906001600160a01b0385169063150b7a029061177b903390899088908890600401611ec9565b602060405180830381600087803b15801561179557600080fd5b505af19250505080156117c5575060408051601f3d908101601f191682019092526117c291810190611e05565b60015b611820573d8080156117f3576040519150601f19603f3d011682016040523d82523d6000602084013e6117f8565b606091505b508051611818576040516368d2bf6b60e11b815260040160405180910390fd5b805181602001fd5b6001600160e01b031916630a85bd0160e11b1490505b949350505050565b6001546001600160a01b03841661186757604051622e076360e81b815260040160405180910390fd5b826118855760405163b562e8dd60e01b815260040160405180910390fd5b6001600160a01b038416600081815260066020908152604080832080546fffffffffffffffffffffffffffffffff1981166001600160401b038083168b0181169182176801000000000000000067ffffffffffffffff1990941690921783900481168b01811690920217909155858452600590925290912080546001600160e01b0319168317600160a01b42909316929092029190911790558190818501903b156119ad575b60405182906001600160a01b038816906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a46119766000878480600101955087611746565b611993576040516368d2bf6b60e11b815260040160405180910390fd5b80821061192b5782600154146119a857600080fd5b6119f2565b5b6040516001830192906001600160a01b038816906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a48082106119ae575b50600155611063600085838684565b828054611a0d9061206d565b90600052602060002090601f016020900481019282611a2f5760008555611a75565b82601f10611a4857805160ff1916838001178555611a75565b82800160010185558215611a75579182015b82811115611a75578251825591602001919060010190611a5a565b50611a81929150611a85565b5090565b5b80821115611a815760008155600101611a86565b60006001600160401b03831115611ab357611ab36120d9565b611ac6601f8401601f1916602001612025565b9050828152838383011115611ada57600080fd5b828260208301376000602084830101529392505050565b600060208284031215611b02578081fd5b8135610f82816120ef565b600060208284031215611b1e578081fd5b8151610f82816120ef565b60008060408385031215611b3b578081fd5b8235611b46816120ef565b91506020830135611b56816120ef565b809150509250929050565b600080600060608486031215611b75578081fd5b8335611b80816120ef565b92506020840135611b90816120ef565b929592945050506040919091013590565b60008060008060808587031215611bb6578081fd5b8435611bc1816120ef565b93506020850135611bd1816120ef565b92506040850135915060608501356001600160401b03811115611bf2578182fd5b8501601f81018713611c02578182fd5b611c1187823560208401611a9a565b91505092959194509250565b60008060008060608587031215611c32578384fd5b8435611c3d816120ef565b935060208501356001600160401b0380821115611c58578485fd5b818701915087601f830112611c6b578485fd5b813581811115611c79578586fd5b8860208260051b8501011115611c8d578586fd5b6020830195508094505050506040850135611ca7816120ef565b939692955090935050565b60008060408385031215611cc4578182fd5b8235611ccf816120ef565b915060208301358015158114611b56578182fd5b60008060408385031215611cf5578182fd5b8235611d00816120ef565b946020939093013593505050565b600080600060608486031215611d22578283fd5b8335611d2d816120ef565b95602085013595506040909401359392505050565b60006020808385031215611d54578182fd5b82356001600160401b0380821115611d6a578384fd5b818501915085601f830112611d7d578384fd5b813581811115611d8f57611d8f6120d9565b8060051b9150611da0848301612025565b8181528481019084860184860187018a1015611dba578788fd5b8795505b83861015611ddc578035835260019590950194918601918601611dbe565b5098975050505050505050565b600060208284031215611dfa578081fd5b8135610f8281612104565b600060208284031215611e16578081fd5b8151610f8281612104565b600060208284031215611e32578081fd5b81356001600160401b03811115611e47578182fd5b8201601f81018413611e57578182fd5b61183684823560208401611a9a565b600060208284031215611e77578081fd5b5035919050565b60008151808452815b81811015611ea357602081850181015186830182015201611e87565b81811115611eb45782602083870101525b50601f01601f19169290920160200192915050565b6001600160a01b0385811682528416602082015260408101839052608060608201819052600090611efc90830184611e7e565b9695505050505050565b6020808252825182820181905260009190848201906040850190845b81811015610d9857611f5d83855180516001600160a01b031682526020808201516001600160401b0316908301526040908101511515910152565b9284019260609290920191600101611f22565b6020808252825182820181905260009190848201906040850190845b81811015610d9857835183529284019291840191600101611f8c565b602081526000610f826020830184611e7e565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b81516001600160a01b031681526020808301516001600160401b031690820152604080830151151590820152606081016104a4565b604051601f8201601f191681016001600160401b038111828210171561204d5761204d6120d9565b604052919050565b60008219821115612068576120686120c3565b500190565b600181811c9082168061208157607f821691505b602082108114156120a257634e487b7160e01b600052602260045260246000fd5b50919050565b60006000198214156120bc576120bc6120c3565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461134a57600080fd5b6001600160e01b03198116811461134a57600080fdfea264697066735822122044195e821274aa50b774a9f6aea9857686bf0421c147592c1b5903be1959171364736f6c634300080400330000000000000000000000000000000000000000000000000000000000000040000000000000000000000000f62519cc5c275f790713898e90ca54c78160d6ed0000000000000000000000000000000000000000000000000000000000000054697066733a2f2f62616679626569677275377534346368376f636b6c666b79347267727868647a3535636f6a75713276766c676a68793636793372776f7535346b792f77686974657275737369616e2e6a736f6e000000000000000000000000

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106101da5760003560e01c8063715018a611610104578063b88d4fde116100a2578063e497e85b11610071578063e497e85b146103f1578063e985e9c51461041f578063f103b43314610432578063f2fde38b1461044557600080fd5b8063b88d4fde14610398578063c23dc68f146103ab578063c87b56dd146103cb578063e29cd178146103de57600080fd5b80638da5cb5b116100de5780638da5cb5b1461035957806395d89b411461036a57806399a2557a14610372578063a22cb4651461038557600080fd5b8063715018a61461031e57806377cc38ad146103265780638462151c1461033957600080fd5b806332cb6b0c1161017c5780635bbb21771161014b5780635bbb2177146102d05780636352211e146102f05780636c0360eb1461030357806370a082311461030b57600080fd5b806332cb6b0c1461028e57806342842e0e14610297578063525f8a5c146102aa57806355f804b3146102bd57600080fd5b8063095ea7b3116101b8578063095ea7b31461024757806318160ddd1461025c5780631cbaee2d1461027257806323b872dd1461027b57600080fd5b806301ffc9a7146101df57806306fdde0314610207578063081812fc1461021c575b600080fd5b6101f26101ed366004611de9565b610458565b60405190151581526020015b60405180910390f35b61020f6104aa565b6040516101fe9190611fa8565b61022f61022a366004611e66565b61053c565b6040516001600160a01b0390911681526020016101fe565b61025a610255366004611ce3565b610580565b005b600254600154035b6040519081526020016101fe565b610264600a5481565b61025a610289366004611b61565b610607565b610264600b5481565b61025a6102a5366004611b61565b610612565b61025a6102b8366004611e66565b61062d565b61025a6102cb366004611e21565b610665565b6102e36102de366004611d42565b6106a6565b6040516101fe9190611f06565b61022f6102fe366004611e66565b610796565b61020f6107a8565b610264610319366004611af1565b610836565b61025a610884565b61025a610334366004611c1d565b6108ba565b61034c610347366004611af1565b610c3b565b6040516101fe9190611f70565b6000546001600160a01b031661022f565b61020f610da4565b61034c610380366004611d0e565b610db3565b61025a610393366004611cb2565b610f89565b61025a6103a6366004611ba1565b61101f565b6103be6103b9366004611e66565b611069565b6040516101fe9190611ff0565b61020f6103d9366004611e66565b611117565b61025a6103ec366004611cb2565b611200565b6101f26103ff366004611ce3565b600c60209081526000928352604080842090915290825290205460ff1681565b6101f261042d366004611b29565b611255565b61025a610440366004611e66565b611283565b61025a610453366004611af1565b6112b2565b60006001600160e01b031982166380ac58cd60e01b148061048957506001600160e01b03198216635b5e139f60e01b145b806104a457506301ffc9a760e01b6001600160e01b03198316145b92915050565b6060600380546104b99061206d565b80601f01602080910402602001604051908101604052809291908181526020018280546104e59061206d565b80156105325780601f1061050757610100808354040283529160200191610532565b820191906000526020600020905b81548152906001019060200180831161051557829003601f168201915b5050505050905090565b60006105478261134d565b610564576040516333d1c03960e21b815260040160405180910390fd5b506000908152600760205260409020546001600160a01b031690565b600061058b82610796565b9050806001600160a01b0316836001600160a01b031614156105c05760405163250fdee360e21b815260040160405180910390fd5b336001600160a01b038216146105f7576105da8133611255565b6105f7576040516367d9dca160e11b815260040160405180910390fd5b610602838383611379565b505050565b6106028383836113d5565b6106028383836040518060200160405280600081525061101f565b6000546001600160a01b031633146106605760405162461bcd60e51b815260040161065790611fbb565b60405180910390fd5b600a55565b6000546001600160a01b0316331461068f5760405162461bcd60e51b815260040161065790611fbb565b80516106a2906009906020840190611a01565b5050565b80516060906000816001600160401b038111156106d357634e487b7160e01b600052604160045260246000fd5b60405190808252806020026020018201604052801561071e57816020015b60408051606081018252600080825260208083018290529282015282526000199092019101816106f15790505b50905060005b82811461078e5761075b85828151811061074e57634e487b7160e01b600052603260045260246000fd5b6020026020010151611069565b82828151811061077b57634e487b7160e01b600052603260045260246000fd5b6020908102919091010152600101610724565b509392505050565b60006107a1826115c2565b5192915050565b600980546107b59061206d565b80601f01602080910402602001604051908101604052809291908181526020018280546107e19061206d565b801561082e5780601f106108035761010080835404028352916020019161082e565b820191906000526020600020905b81548152906001019060200180831161081157829003601f168201915b505050505081565b60006001600160a01b03821661085f576040516323d3ad8160e21b815260040160405180910390fd5b506001600160a01b03166000908152600660205260409020546001600160401b031690565b6000546001600160a01b031633146108ae5760405162461bcd60e51b815260040161065790611fbb565b6108b860006116dc565b565b3233146109095760405162461bcd60e51b815260206004820152601e60248201527f5468652063616c6c657220697320616e6f7468657220636f6e747261637400006044820152606401610657565b60008080600a546109174290565b10156109655760405162461bcd60e51b815260206004820152601f60248201527f5075626c6963206d696e7420686173206e6f74207374617274656420796574006044820152606401610657565b846109be5760405162461bcd60e51b8152602060048201526024808201527f4e6f2043727970746f44756465734e465420746f6b656e204964732070726f766044820152631a59195960e21b6064820152608401610657565b6001600160a01b0384166000908152600d602052604090205460ff161515600114610a2b5760405162461bcd60e51b815260206004820152601860248201527f4e465420436f6e7472616374206e6f7420616c6c6f77656400000000000000006044820152606401610657565b508260005b85811015610b7857868682818110610a5857634e487b7160e01b600052603260045260246000fd5b905060200201359250336001600160a01b0316826001600160a01b0316636352211e856040518263ffffffff1660e01b8152600401610a9991815260200190565b60206040518083038186803b158015610ab157600080fd5b505afa158015610ac5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ae99190611b0d565b6001600160a01b0316148015610b2357506001600160a01b0385166000908152600c6020908152604080832086845290915290205460ff16155b15610b66576001600160a01b0385166000908152600c602090815260408083208684529091529020805460ff19166001908117909155610b639085612055565b93505b80610b70816120a8565b915050610a30565b5060008311610bc95760405162461bcd60e51b815260206004820152601f60248201527f4f6f6f70732c206e6f20676c61737320746f206d696e7420666f7220796f75006044820152606401610657565b600b5483610bda6002546001540390565b610be49190612055565b1115610c285760405162461bcd60e51b815260206004820152601360248201527213585e081cdd5c1c1b1e48195e18d959591959606a1b6044820152606401610657565b610c32878461172c565b50505050505050565b60606000806000610c4b85610836565b90506000816001600160401b03811115610c7557634e487b7160e01b600052604160045260246000fd5b604051908082528060200260200182016040528015610c9e578160200160208202803683370190505b509050610cc4604080516060810182526000808252602082018190529181019190915290565b60005b838614610d9857600081815260056020908152604091829020825160608101845290546001600160a01b0381168252600160a01b81046001600160401b031692820192909252600160e01b90910460ff16158015928201929092529250610d2d57610d90565b81516001600160a01b031615610d4257815194505b876001600160a01b0316856001600160a01b03161415610d905780838780600101985081518110610d8357634e487b7160e01b600052603260045260246000fd5b6020026020010181815250505b600101610cc7565b50909695505050505050565b6060600480546104b99061206d565b6060818310610dd557604051631960ccad60e11b815260040160405180910390fd5b60015460009080841115610de7578093505b6000610df287610836565b905084861015610e115785850381811015610e0b578091505b50610e15565b5060005b6000816001600160401b03811115610e3d57634e487b7160e01b600052604160045260246000fd5b604051908082528060200260200182016040528015610e66578160200160208202803683370190505b50905081610e79579350610f8292505050565b6000610e8488611069565b905060008160400151610e95575080515b885b888114158015610ea75750848714155b15610f7657600081815260056020908152604091829020825160608101845290546001600160a01b0381168252600160a01b81046001600160401b031692820192909252600160e01b90910460ff16158015928201929092529350610f0b57610f6e565b82516001600160a01b031615610f2057825191505b8a6001600160a01b0316826001600160a01b03161415610f6e5780848880600101995081518110610f6157634e487b7160e01b600052603260045260246000fd5b6020026020010181815250505b600101610e97565b50505092835250909150505b9392505050565b6001600160a01b038216331415610fb35760405163b06307db60e01b815260040160405180910390fd5b3360008181526008602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b61102a8484846113d5565b6001600160a01b0383163b156110635761104684848484611746565b611063576040516368d2bf6b60e11b815260040160405180910390fd5b50505050565b60408051606080820183526000808352602080840182905283850182905284519283018552818352820181905292810183905290915060015483106110ae5792915050565b50600082815260056020908152604091829020825160608101845290546001600160a01b0381168252600160a01b81046001600160401b031692820192909252600160e01b90910460ff16158015928201929092529061110e5792915050565b610f82836115c2565b60606111228261134d565b61116e5760405162461bcd60e51b815260206004820152601f60248201527f55524920717565727920666f72206e6f6e6578697374656e7420746f6b656e006044820152606401610657565b6009805461117b9061206d565b80601f01602080910402602001604051908101604052809291908181526020018280546111a79061206d565b80156111f45780601f106111c9576101008083540402835291602001916111f4565b820191906000526020600020905b8154815290600101906020018083116111d757829003601f168201915b50505050509050919050565b6000546001600160a01b0316331461122a5760405162461bcd60e51b815260040161065790611fbb565b6001600160a01b03919091166000908152600d60205260409020805460ff1916911515919091179055565b6001600160a01b03918216600090815260086020908152604080832093909416825291909152205460ff1690565b6000546001600160a01b031633146112ad5760405162461bcd60e51b815260040161065790611fbb565b600b55565b6000546001600160a01b031633146112dc5760405162461bcd60e51b815260040161065790611fbb565b6001600160a01b0381166113415760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610657565b61134a816116dc565b50565b6000600154821080156104a4575050600090815260056020526040902054600160e01b900460ff161590565b60008281526007602052604080822080546001600160a01b0319166001600160a01b0387811691821790925591518593918516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591a4505050565b60006113e0826115c2565b9050836001600160a01b031681600001516001600160a01b0316146114175760405162a1148160e81b815260040160405180910390fd5b6000336001600160a01b038616148061143557506114358533611255565b806114505750336114458461053c565b6001600160a01b0316145b90508061147057604051632ce44b5f60e11b815260040160405180910390fd5b6001600160a01b03841661149757604051633a954ecd60e21b815260040160405180910390fd5b6114a360008487611379565b6001600160a01b038581166000908152600660209081526040808320805467ffffffffffffffff198082166001600160401b0392831660001901831617909255898616808652838620805493841693831660019081018416949094179055898652600590945282852080546001600160e01b031916909417600160a01b4290921691909102178355870180845292208054919390911661157757600154821461157757805460208601516001600160401b0316600160a01b026001600160e01b03199091166001600160a01b038a16171781555b50505082846001600160a01b0316866001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a45050505050565b6040805160608101825260008082526020820181905291810191909152816001548110156116c357600081815260056020908152604091829020825160608101845290546001600160a01b0381168252600160a01b81046001600160401b031692820192909252600160e01b90910460ff161515918101829052906116c15780516001600160a01b031615611658579392505050565b5060001901600081815260056020908152604091829020825160608101845290546001600160a01b038116808352600160a01b82046001600160401b031693830193909352600160e01b900460ff16151592810192909252156116bc579392505050565b611658565b505b604051636f96cda160e11b815260040160405180910390fd5b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6106a282826040518060200160405280600081525061183e565b604051630a85bd0160e11b81526000906001600160a01b0385169063150b7a029061177b903390899088908890600401611ec9565b602060405180830381600087803b15801561179557600080fd5b505af19250505080156117c5575060408051601f3d908101601f191682019092526117c291810190611e05565b60015b611820573d8080156117f3576040519150601f19603f3d011682016040523d82523d6000602084013e6117f8565b606091505b508051611818576040516368d2bf6b60e11b815260040160405180910390fd5b805181602001fd5b6001600160e01b031916630a85bd0160e11b1490505b949350505050565b6001546001600160a01b03841661186757604051622e076360e81b815260040160405180910390fd5b826118855760405163b562e8dd60e01b815260040160405180910390fd5b6001600160a01b038416600081815260066020908152604080832080546fffffffffffffffffffffffffffffffff1981166001600160401b038083168b0181169182176801000000000000000067ffffffffffffffff1990941690921783900481168b01811690920217909155858452600590925290912080546001600160e01b0319168317600160a01b42909316929092029190911790558190818501903b156119ad575b60405182906001600160a01b038816906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a46119766000878480600101955087611746565b611993576040516368d2bf6b60e11b815260040160405180910390fd5b80821061192b5782600154146119a857600080fd5b6119f2565b5b6040516001830192906001600160a01b038816906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a48082106119ae575b50600155611063600085838684565b828054611a0d9061206d565b90600052602060002090601f016020900481019282611a2f5760008555611a75565b82601f10611a4857805160ff1916838001178555611a75565b82800160010185558215611a75579182015b82811115611a75578251825591602001919060010190611a5a565b50611a81929150611a85565b5090565b5b80821115611a815760008155600101611a86565b60006001600160401b03831115611ab357611ab36120d9565b611ac6601f8401601f1916602001612025565b9050828152838383011115611ada57600080fd5b828260208301376000602084830101529392505050565b600060208284031215611b02578081fd5b8135610f82816120ef565b600060208284031215611b1e578081fd5b8151610f82816120ef565b60008060408385031215611b3b578081fd5b8235611b46816120ef565b91506020830135611b56816120ef565b809150509250929050565b600080600060608486031215611b75578081fd5b8335611b80816120ef565b92506020840135611b90816120ef565b929592945050506040919091013590565b60008060008060808587031215611bb6578081fd5b8435611bc1816120ef565b93506020850135611bd1816120ef565b92506040850135915060608501356001600160401b03811115611bf2578182fd5b8501601f81018713611c02578182fd5b611c1187823560208401611a9a565b91505092959194509250565b60008060008060608587031215611c32578384fd5b8435611c3d816120ef565b935060208501356001600160401b0380821115611c58578485fd5b818701915087601f830112611c6b578485fd5b813581811115611c79578586fd5b8860208260051b8501011115611c8d578586fd5b6020830195508094505050506040850135611ca7816120ef565b939692955090935050565b60008060408385031215611cc4578182fd5b8235611ccf816120ef565b915060208301358015158114611b56578182fd5b60008060408385031215611cf5578182fd5b8235611d00816120ef565b946020939093013593505050565b600080600060608486031215611d22578283fd5b8335611d2d816120ef565b95602085013595506040909401359392505050565b60006020808385031215611d54578182fd5b82356001600160401b0380821115611d6a578384fd5b818501915085601f830112611d7d578384fd5b813581811115611d8f57611d8f6120d9565b8060051b9150611da0848301612025565b8181528481019084860184860187018a1015611dba578788fd5b8795505b83861015611ddc578035835260019590950194918601918601611dbe565b5098975050505050505050565b600060208284031215611dfa578081fd5b8135610f8281612104565b600060208284031215611e16578081fd5b8151610f8281612104565b600060208284031215611e32578081fd5b81356001600160401b03811115611e47578182fd5b8201601f81018413611e57578182fd5b61183684823560208401611a9a565b600060208284031215611e77578081fd5b5035919050565b60008151808452815b81811015611ea357602081850181015186830182015201611e87565b81811115611eb45782602083870101525b50601f01601f19169290920160200192915050565b6001600160a01b0385811682528416602082015260408101839052608060608201819052600090611efc90830184611e7e565b9695505050505050565b6020808252825182820181905260009190848201906040850190845b81811015610d9857611f5d83855180516001600160a01b031682526020808201516001600160401b0316908301526040908101511515910152565b9284019260609290920191600101611f22565b6020808252825182820181905260009190848201906040850190845b81811015610d9857835183529284019291840191600101611f8c565b602081526000610f826020830184611e7e565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b81516001600160a01b031681526020808301516001600160401b031690820152604080830151151590820152606081016104a4565b604051601f8201601f191681016001600160401b038111828210171561204d5761204d6120d9565b604052919050565b60008219821115612068576120686120c3565b500190565b600181811c9082168061208157607f821691505b602082108114156120a257634e487b7160e01b600052602260045260246000fd5b50919050565b60006000198214156120bc576120bc6120c3565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461134a57600080fd5b6001600160e01b03198116811461134a57600080fdfea264697066735822122044195e821274aa50b774a9f6aea9857686bf0421c147592c1b5903be1959171364736f6c63430008040033

Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)

0000000000000000000000000000000000000000000000000000000000000040000000000000000000000000f62519cc5c275f790713898e90ca54c78160d6ed0000000000000000000000000000000000000000000000000000000000000054697066733a2f2f62616679626569677275377534346368376f636b6c666b79347267727868647a3535636f6a75713276766c676a68793636793372776f7535346b792f77686974657275737369616e2e6a736f6e000000000000000000000000

-----Decoded View---------------
Arg [0] : _baseURI (string): ipfs://bafybeigru7u44ch7ocklfky4rgrxhdz55cojuq2vvlgjhy66y3rwou54ky/whiterussian.json
Arg [1] : _nft (address): 0xf62519cc5c275f790713898e90ca54c78160d6ED

-----Encoded View---------------
6 Constructor Arguments found :
Arg [0] : 0000000000000000000000000000000000000000000000000000000000000040
Arg [1] : 000000000000000000000000f62519cc5c275f790713898e90ca54c78160d6ed
Arg [2] : 0000000000000000000000000000000000000000000000000000000000000054
Arg [3] : 697066733a2f2f62616679626569677275377534346368376f636b6c666b7934
Arg [4] : 7267727868647a3535636f6a75713276766c676a68793636793372776f753534
Arg [5] : 6b792f77686974657275737369616e2e6a736f6e000000000000000000000000


Loading...
Loading
Loading...
Loading
[ Download: CSV Export  ]
[ Download: CSV Export  ]

A token is a representation of an on-chain or off-chain asset. The token page shows information such as price, total supply, holders, transfers and social links. Learn more about this page in our Knowledge Base.