ETH Price: $2,390.99 (+0.07%)

Youtopia (YTPA)
 

Overview

TokenID

96

Total Transfers

-

Market

Onchain Market Cap

$0.00

Circulating Supply Market Cap

-

Other Info

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:
Youtopia

Compiler Version
v0.8.11+commit.d7f03943

Optimization Enabled:
Yes with 10000 runs

Other Settings:
default evmVersion
File 1 of 16 : Youtopia.sol
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.4;

import "@openzeppelin/contracts/utils/Strings.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts/utils/Address.sol";
import "@openzeppelin/contracts/utils/cryptography/draft-EIP712.sol";
import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
import "erc721a/contracts/ERC721A.sol";

error ErrorOnlyAllowEOA();
error ErrorSaleNotStarted();
error ErrorInsufficientFund();
error ErrorExceedMaxAllowed();
error ErrorExceedTransactionLimit();
error ErrorExceedWalletLimit();
error ErrorExceedMaxSupply();
error ErrorExceedReserveSupply();
error ErrorInvalidSignature();
error ErrorInvalidMintAmount();
error ErrorPendingAuction();

contract Youtopia is ERC721A, EIP712, Ownable {
    using Address for address payable;
    using ECDSA for bytes32;
    using Strings for uint256;

    bytes32 private constant MINT_FUNC_DIGEST = keccak256("mint(address minter,uint32 maxAllowed)");
    uint256 public constant PRICE_MULTIPLIER = 0.0000001 ether;

    address public immutable _vault;
    uint256 public immutable _publicMintPrice;
    uint256 public immutable _allowlistPrice;

    uint32 public immutable _maxSupply;
    uint32 public immutable _publicSupply;
    uint32 public immutable _auctionSupply;
    uint32 public immutable _reservedSupply;
    uint32 public immutable _mintTxLimit;
    uint32 public immutable _mintWalletLimit;

    enum SaleState {
        NotStarted,
        Auction,
        Allowlist,
        Public,
        End,
        Max
    }

    struct Bid {
        address bidder;
        uint32 price;
        uint32 amount;
    }

    struct AuctionConfig {
        uint32 startingPrice;
        uint32 endingPrice;
        uint32 startTime;
        uint32 duration;
        uint32 discountPerInterval;
        uint32 interval;
    }

    struct SaleConfig {
        uint32 auctionBids;
        uint32 reservedMinted;
        SaleState saleState;
    }

    Bid[] public _bids;
    SaleConfig public _config;
    AuctionConfig public _auctionConfig;
    uint256 public _processedBids;
    string public _metadataURI = "https://assets.youtopia.space/metadata/placeholder/json/";

    constructor(
        uint256 publicMintPrice,
        uint256 allowlistPrice,
        uint32 maxSupply,
        uint32 auctionSupply,
        uint32 reservedSupply,
        uint32 mintTxLimit,
        uint32 mintWalletLimit,
        address vault
    ) ERC721A("Youtopia", "YTPA") EIP712("Youtopia", "1") {
        require(maxSupply >= auctionSupply + reservedSupply);

        _publicMintPrice = publicMintPrice;
        _allowlistPrice = allowlistPrice;

        _maxSupply = maxSupply;
        _auctionSupply = auctionSupply;
        _reservedSupply = reservedSupply;
        _mintTxLimit = mintTxLimit;
        _mintWalletLimit = mintWalletLimit;
        _publicSupply = _maxSupply - _reservedSupply;

        _vault = vault;
    }

    // ===== Modifier

    modifier ensureEOA() {
        if (tx.origin != msg.sender) revert ErrorOnlyAllowEOA();
        _;
    }

    modifier ensureValidateAmount(uint32 amount) {
        if (amount == 0) revert ErrorInvalidMintAmount();
        _;
    }

    modifier verifyAndExtractMaxAmount(
        uint32 maxAllowed,
        bytes32 r,
        bytes32 s,
        uint8 v
    ) {
        bytes32 funcCallDigest = keccak256(abi.encode(
            MINT_FUNC_DIGEST,
            msg.sender,
            maxAllowed
        ));

        bytes32 digest = keccak256(abi.encodePacked(
            "\x19Ethereum Signed Message:\n32",
            _domainSeparatorV4().toTypedDataHash(funcCallDigest))
        );

        if (ecrecover(digest, v, r, s) != address(owner())) revert ErrorInvalidSignature();
        _;
    }

    function ensureSaleState(SaleState desired, SaleState actual) internal pure {
        if (desired != actual) revert ErrorSaleNotStarted();
    }

    // ===== Mint functions

    function youtopiaPlaceBid(uint16 amount) external payable ensureEOA ensureValidateAmount(amount) {
        SaleConfig memory config = _config;
        AuctionConfig memory auctionConfig = _auctionConfig;

        if (SaleState.Auction != config.saleState
            || auctionConfig.startTime == 0
            || block.timestamp < auctionConfig.startTime) {
            revert ErrorSaleNotStarted();
        }

        config.auctionBids += amount;
        if (config.auctionBids > _auctionSupply) revert ErrorExceedMaxSupply();
        if (amount > _mintTxLimit) revert ErrorExceedTransactionLimit();
        if (incrementAuctionBid(amount) > _mintWalletLimit) revert ErrorExceedWalletLimit();

        uint32 price = internalAuctionPrice(auctionConfig);
        uint256 requiredValue = price * PRICE_MULTIPLIER * amount;
        if (msg.value < requiredValue) revert ErrorInsufficientFund();

        _config = config;
        _bids.push(Bid(msg.sender, price, amount));

        _safeMint(msg.sender, amount);
        refundIfOver(requiredValue);
    }

    function youtopiaAllowlistMint(
        uint16 amount,
        uint32 maxAllowed,
        bytes32 r,
        bytes32 s,
        uint8 v
    ) external payable verifyAndExtractMaxAmount(maxAllowed, r, s, v) ensureValidateAmount(amount) {
        ensureSaleState(SaleState.Allowlist, _config.saleState);

        if (_totalMinted() + amount > _publicSupply) revert ErrorExceedMaxSupply();
        if (incrementAllowlistMinted(amount) > maxAllowed) revert ErrorExceedMaxAllowed();
        if (_allowlistPrice * amount != msg.value) revert ErrorInsufficientFund();

        _safeMint(msg.sender, amount);
    }

    function youtopiaPublicMint(uint16 amount) external payable ensureEOA ensureValidateAmount(amount) {
        ensureSaleState(SaleState.Public, _config.saleState);

        if (_totalMinted() + amount > _publicSupply) revert ErrorExceedMaxSupply();
        if (amount > _mintTxLimit) revert ErrorExceedTransactionLimit();
        if (incrementPublicMinted(amount) > _mintWalletLimit) revert ErrorExceedWalletLimit();

        uint256 requiredValue = _publicMintPrice * amount;
        if (msg.value < requiredValue) revert ErrorInsufficientFund();

        _safeMint(msg.sender, amount);
        refundIfOver(requiredValue);
    }

    function youtopiaReservedMint(address to, uint16 amount) external onlyOwner {
        _config.reservedMinted += amount;
        if (_config.reservedMinted > _reservedSupply) revert ErrorExceedReserveSupply();

        _safeMint(to, amount);
    }

    // ===== View functions

    function _minted() external view returns(uint256) {
        return ERC721A._totalMinted();
    }

    function internalAuctionPrice(AuctionConfig memory config) internal view returns (uint32) {
        // [startTime, endTime)
        uint32 price;

        if (block.timestamp < config.startTime) {
            price = config.startingPrice;
        } else if (block.timestamp > config.startTime + config.duration) {
            price = config.endingPrice;
        } else {
            uint32 elapsedInterval = (uint32(block.timestamp) - config.startTime) / config.interval;
            price = config.startingPrice - elapsedInterval * config.discountPerInterval;
        }

        return price;
    }

    function _auctionPrice() public view returns (uint256) {
        return internalAuctionPrice(_auctionConfig) * PRICE_MULTIPLIER;
    }

    function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
        if (!_exists(tokenId)) revert URIQueryForNonexistentToken();

        string memory baseURI = _metadataURI;
        return string(abi.encodePacked(baseURI, tokenId.toString(), ".json"));
    }

    // ===== Admin functions

    function setMetadataURI(string memory uri) external onlyOwner {
        _metadataURI = uri;
    }

    function setSaleState(SaleState saleState) external onlyOwner {
        _config.saleState = saleState;
    }

    function setAuctionState(
        uint32 startingPrice,
        uint32 endingPrice,
        uint32 startTime,
        uint32 duration,
        uint32 interval
    ) external onlyOwner {
        require(startingPrice >= endingPrice, "Starting Price too low");
        require(duration % interval == 0, "Duration % Interval != 0");

        uint32 priceDifference = startingPrice - endingPrice;
        uint32 step = duration / interval;
        require(priceDifference % step == 0, "PriceDiff % Step != 0");

        _auctionConfig = AuctionConfig({
            startingPrice: startingPrice,
            endingPrice: endingPrice,
            startTime: startTime,
            duration: duration,
            interval: interval,
            discountPerInterval: priceDifference / step
        });
    }

    function finalizeAuction(uint256 count) external onlyOwner {
        if (_config.saleState == SaleState.Auction) revert ErrorPendingAuction();
        if (_bids.length == 0) return;

        uint256 processedBids = _processedBids;
        uint256 biddersLength = _bids.length;
        uint256 counter = 0;
        uint32 lowestBid = _bids[_bids.length - 1].price;

        for (; counter < count && counter + processedBids < biddersLength; ++counter) {
            Bid memory bid = _bids[counter + processedBids];

            uint32 delta = bid.price - lowestBid;
            if (delta > 0) {
                payable(bid.bidder).sendValue(delta * PRICE_MULTIPLIER * bid.amount);
            }
        }

        _processedBids += counter;
    }

    function _bidsLength() external view returns(uint256) {
        return _bids.length;
    }

    function withdraw() external onlyOwner {
        if (_processedBids != _bids.length) revert ErrorPendingAuction();
        payable(_vault).sendValue(address(this).balance);
    }

    // ===== Utility functions

    function refundIfOver(uint256 requiredValue) internal {
        if (msg.value > requiredValue) {
            payable(msg.sender).sendValue(msg.value - requiredValue);
        }
    }

    function _aux(address minter) public view returns (uint64) {
        return _getAux(minter);
    }

    function getMintedNumberInAux(uint64 aux, uint8 index) internal pure returns (uint16) {
        return uint16((aux >> (index * 16)) & 0xFFFF);
    }

    function incrementMintedNumberInAux(uint8 index, uint16 amount) internal returns (uint16) {
        uint64 offset = index * 16;
        uint64 mask = ~(uint64(0xFFFFFFFF) << offset);
        uint64 aux = _getAux(msg.sender);
        uint16 newMintedAmount = getMintedNumberInAux(aux, index) + amount;
        _setAux(msg.sender, (aux & mask) | (uint64(newMintedAmount) << offset));
        return newMintedAmount;
    }

    function _allowlistMinted(address minter) public view returns (uint16) {
        return getMintedNumberInAux(_getAux(minter), 0);
    }

    function incrementAllowlistMinted(uint16 amount) internal returns (uint16) {
        return incrementMintedNumberInAux(0, amount);
    }

    function _auctionBid(address minter) public view returns (uint16) {
        return getMintedNumberInAux(_getAux(minter), 1);
    }

    function incrementAuctionBid(uint16 amount) internal returns (uint16) {
        return incrementMintedNumberInAux(1, amount);
    }

    function _publicSaleMinted(address minter) public view returns (uint16) {
        return getMintedNumberInAux(_getAux(minter), 2);
    }

    function incrementPublicMinted(uint16 amount) internal returns (uint16) {
        return incrementMintedNumberInAux(2, amount);
    }
}

File 2 of 16 : 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 3 of 16 : 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 4 of 16 : ERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC20/ERC20.sol)

pragma solidity ^0.8.0;

import "./IERC20.sol";
import "./extensions/IERC20Metadata.sol";
import "../../utils/Context.sol";

/**
 * @dev Implementation of the {IERC20} interface.
 *
 * This implementation is agnostic to the way tokens are created. This means
 * that a supply mechanism has to be added in a derived contract using {_mint}.
 * For a generic mechanism see {ERC20PresetMinterPauser}.
 *
 * TIP: For a detailed writeup see our guide
 * https://forum.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How
 * to implement supply mechanisms].
 *
 * We have followed general OpenZeppelin Contracts guidelines: functions revert
 * instead returning `false` on failure. This behavior is nonetheless
 * conventional and does not conflict with the expectations of ERC20
 * applications.
 *
 * Additionally, an {Approval} event is emitted on calls to {transferFrom}.
 * This allows applications to reconstruct the allowance for all accounts just
 * by listening to said events. Other implementations of the EIP may not emit
 * these events, as it isn't required by the specification.
 *
 * Finally, the non-standard {decreaseAllowance} and {increaseAllowance}
 * functions have been added to mitigate the well-known issues around setting
 * allowances. See {IERC20-approve}.
 */
contract ERC20 is Context, IERC20, IERC20Metadata {
    mapping(address => uint256) private _balances;

    mapping(address => mapping(address => uint256)) private _allowances;

    uint256 private _totalSupply;

    string private _name;
    string private _symbol;

    /**
     * @dev Sets the values for {name} and {symbol}.
     *
     * The default value of {decimals} is 18. To select a different value for
     * {decimals} you should overload it.
     *
     * All two of these values are immutable: they can only be set once during
     * construction.
     */
    constructor(string memory name_, string memory symbol_) {
        _name = name_;
        _symbol = symbol_;
    }

    /**
     * @dev Returns the name of the token.
     */
    function name() public view virtual override returns (string memory) {
        return _name;
    }

    /**
     * @dev Returns the symbol of the token, usually a shorter version of the
     * name.
     */
    function symbol() public view virtual override returns (string memory) {
        return _symbol;
    }

    /**
     * @dev Returns the number of decimals used to get its user representation.
     * For example, if `decimals` equals `2`, a balance of `505` tokens should
     * be displayed to a user as `5.05` (`505 / 10 ** 2`).
     *
     * Tokens usually opt for a value of 18, imitating the relationship between
     * Ether and Wei. This is the value {ERC20} uses, unless this function is
     * overridden;
     *
     * NOTE: This information is only used for _display_ purposes: it in
     * no way affects any of the arithmetic of the contract, including
     * {IERC20-balanceOf} and {IERC20-transfer}.
     */
    function decimals() public view virtual override returns (uint8) {
        return 18;
    }

    /**
     * @dev See {IERC20-totalSupply}.
     */
    function totalSupply() public view virtual override returns (uint256) {
        return _totalSupply;
    }

    /**
     * @dev See {IERC20-balanceOf}.
     */
    function balanceOf(address account) public view virtual override returns (uint256) {
        return _balances[account];
    }

    /**
     * @dev See {IERC20-transfer}.
     *
     * Requirements:
     *
     * - `to` cannot be the zero address.
     * - the caller must have a balance of at least `amount`.
     */
    function transfer(address to, uint256 amount) public virtual override returns (bool) {
        address owner = _msgSender();
        _transfer(owner, to, amount);
        return true;
    }

    /**
     * @dev See {IERC20-allowance}.
     */
    function allowance(address owner, address spender) public view virtual override returns (uint256) {
        return _allowances[owner][spender];
    }

    /**
     * @dev See {IERC20-approve}.
     *
     * NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on
     * `transferFrom`. This is semantically equivalent to an infinite approval.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     */
    function approve(address spender, uint256 amount) public virtual override returns (bool) {
        address owner = _msgSender();
        _approve(owner, spender, amount);
        return true;
    }

    /**
     * @dev See {IERC20-transferFrom}.
     *
     * Emits an {Approval} event indicating the updated allowance. This is not
     * required by the EIP. See the note at the beginning of {ERC20}.
     *
     * NOTE: Does not update the allowance if the current allowance
     * is the maximum `uint256`.
     *
     * Requirements:
     *
     * - `from` and `to` cannot be the zero address.
     * - `from` must have a balance of at least `amount`.
     * - the caller must have allowance for ``from``'s tokens of at least
     * `amount`.
     */
    function transferFrom(
        address from,
        address to,
        uint256 amount
    ) public virtual override returns (bool) {
        address spender = _msgSender();
        _spendAllowance(from, spender, amount);
        _transfer(from, to, amount);
        return true;
    }

    /**
     * @dev Atomically increases the allowance granted to `spender` by the caller.
     *
     * This is an alternative to {approve} that can be used as a mitigation for
     * problems described in {IERC20-approve}.
     *
     * Emits an {Approval} event indicating the updated allowance.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     */
    function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
        address owner = _msgSender();
        _approve(owner, spender, _allowances[owner][spender] + addedValue);
        return true;
    }

    /**
     * @dev Atomically decreases the allowance granted to `spender` by the caller.
     *
     * This is an alternative to {approve} that can be used as a mitigation for
     * problems described in {IERC20-approve}.
     *
     * Emits an {Approval} event indicating the updated allowance.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     * - `spender` must have allowance for the caller of at least
     * `subtractedValue`.
     */
    function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
        address owner = _msgSender();
        uint256 currentAllowance = _allowances[owner][spender];
        require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero");
        unchecked {
            _approve(owner, spender, currentAllowance - subtractedValue);
        }

        return true;
    }

    /**
     * @dev Moves `amount` of tokens from `sender` to `recipient`.
     *
     * This internal function is equivalent to {transfer}, and can be used to
     * e.g. implement automatic token fees, slashing mechanisms, etc.
     *
     * Emits a {Transfer} event.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `from` must have a balance of at least `amount`.
     */
    function _transfer(
        address from,
        address to,
        uint256 amount
    ) internal virtual {
        require(from != address(0), "ERC20: transfer from the zero address");
        require(to != address(0), "ERC20: transfer to the zero address");

        _beforeTokenTransfer(from, to, amount);

        uint256 fromBalance = _balances[from];
        require(fromBalance >= amount, "ERC20: transfer amount exceeds balance");
        unchecked {
            _balances[from] = fromBalance - amount;
        }
        _balances[to] += amount;

        emit Transfer(from, to, amount);

        _afterTokenTransfer(from, to, amount);
    }

    /** @dev Creates `amount` tokens and assigns them to `account`, increasing
     * the total supply.
     *
     * Emits a {Transfer} event with `from` set to the zero address.
     *
     * Requirements:
     *
     * - `account` cannot be the zero address.
     */
    function _mint(address account, uint256 amount) internal virtual {
        require(account != address(0), "ERC20: mint to the zero address");

        _beforeTokenTransfer(address(0), account, amount);

        _totalSupply += amount;
        _balances[account] += amount;
        emit Transfer(address(0), account, amount);

        _afterTokenTransfer(address(0), account, amount);
    }

    /**
     * @dev Destroys `amount` tokens from `account`, reducing the
     * total supply.
     *
     * Emits a {Transfer} event with `to` set to the zero address.
     *
     * Requirements:
     *
     * - `account` cannot be the zero address.
     * - `account` must have at least `amount` tokens.
     */
    function _burn(address account, uint256 amount) internal virtual {
        require(account != address(0), "ERC20: burn from the zero address");

        _beforeTokenTransfer(account, address(0), amount);

        uint256 accountBalance = _balances[account];
        require(accountBalance >= amount, "ERC20: burn amount exceeds balance");
        unchecked {
            _balances[account] = accountBalance - amount;
        }
        _totalSupply -= amount;

        emit Transfer(account, address(0), amount);

        _afterTokenTransfer(account, address(0), amount);
    }

    /**
     * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.
     *
     * This internal function is equivalent to `approve`, and can be used to
     * e.g. set automatic allowances for certain subsystems, etc.
     *
     * Emits an {Approval} event.
     *
     * Requirements:
     *
     * - `owner` cannot be the zero address.
     * - `spender` cannot be the zero address.
     */
    function _approve(
        address owner,
        address spender,
        uint256 amount
    ) internal virtual {
        require(owner != address(0), "ERC20: approve from the zero address");
        require(spender != address(0), "ERC20: approve to the zero address");

        _allowances[owner][spender] = amount;
        emit Approval(owner, spender, amount);
    }

    /**
     * @dev Spend `amount` form the allowance of `owner` toward `spender`.
     *
     * Does not update the allowance amount in case of infinite allowance.
     * Revert if not enough allowance is available.
     *
     * Might emit an {Approval} event.
     */
    function _spendAllowance(
        address owner,
        address spender,
        uint256 amount
    ) internal virtual {
        uint256 currentAllowance = allowance(owner, spender);
        if (currentAllowance != type(uint256).max) {
            require(currentAllowance >= amount, "ERC20: insufficient allowance");
            unchecked {
                _approve(owner, spender, currentAllowance - amount);
            }
        }
    }

    /**
     * @dev Hook that is called before any transfer of tokens. This includes
     * minting and burning.
     *
     * Calling conditions:
     *
     * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens
     * will be transferred to `to`.
     * - when `from` is zero, `amount` tokens will be minted for `to`.
     * - when `to` is zero, `amount` of ``from``'s tokens will be burned.
     * - `from` and `to` are never both zero.
     *
     * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
     */
    function _beforeTokenTransfer(
        address from,
        address to,
        uint256 amount
    ) internal virtual {}

    /**
     * @dev Hook that is called after any transfer of tokens. This includes
     * minting and burning.
     *
     * Calling conditions:
     *
     * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens
     * has been transferred to `to`.
     * - when `from` is zero, `amount` tokens have been minted for `to`.
     * - when `to` is zero, `amount` of ``from``'s tokens have been burned.
     * - `from` and `to` are never both zero.
     *
     * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
     */
    function _afterTokenTransfer(
        address from,
        address to,
        uint256 amount
    ) internal virtual {}
}

File 5 of 16 : 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 6 of 16 : draft-EIP712.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/cryptography/draft-EIP712.sol)

pragma solidity ^0.8.0;

import "./ECDSA.sol";

/**
 * @dev https://eips.ethereum.org/EIPS/eip-712[EIP 712] is a standard for hashing and signing of typed structured data.
 *
 * The encoding specified in the EIP is very generic, and such a generic implementation in Solidity is not feasible,
 * thus this contract does not implement the encoding itself. Protocols need to implement the type-specific encoding
 * they need in their contracts using a combination of `abi.encode` and `keccak256`.
 *
 * This contract implements the EIP 712 domain separator ({_domainSeparatorV4}) that is used as part of the encoding
 * scheme, and the final step of the encoding to obtain the message digest that is then signed via ECDSA
 * ({_hashTypedDataV4}).
 *
 * The implementation of the domain separator was designed to be as efficient as possible while still properly updating
 * the chain id to protect against replay attacks on an eventual fork of the chain.
 *
 * NOTE: This contract implements the version of the encoding known as "v4", as implemented by the JSON RPC method
 * https://docs.metamask.io/guide/signing-data.html[`eth_signTypedDataV4` in MetaMask].
 *
 * _Available since v3.4._
 */
abstract contract EIP712 {
    /* solhint-disable var-name-mixedcase */
    // Cache the domain separator as an immutable value, but also store the chain id that it corresponds to, in order to
    // invalidate the cached domain separator if the chain id changes.
    bytes32 private immutable _CACHED_DOMAIN_SEPARATOR;
    uint256 private immutable _CACHED_CHAIN_ID;
    address private immutable _CACHED_THIS;

    bytes32 private immutable _HASHED_NAME;
    bytes32 private immutable _HASHED_VERSION;
    bytes32 private immutable _TYPE_HASH;

    /* solhint-enable var-name-mixedcase */

    /**
     * @dev Initializes the domain separator and parameter caches.
     *
     * The meaning of `name` and `version` is specified in
     * https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator[EIP 712]:
     *
     * - `name`: the user readable name of the signing domain, i.e. the name of the DApp or the protocol.
     * - `version`: the current major version of the signing domain.
     *
     * NOTE: These parameters cannot be changed except through a xref:learn::upgrading-smart-contracts.adoc[smart
     * contract upgrade].
     */
    constructor(string memory name, string memory version) {
        bytes32 hashedName = keccak256(bytes(name));
        bytes32 hashedVersion = keccak256(bytes(version));
        bytes32 typeHash = keccak256(
            "EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)"
        );
        _HASHED_NAME = hashedName;
        _HASHED_VERSION = hashedVersion;
        _CACHED_CHAIN_ID = block.chainid;
        _CACHED_DOMAIN_SEPARATOR = _buildDomainSeparator(typeHash, hashedName, hashedVersion);
        _CACHED_THIS = address(this);
        _TYPE_HASH = typeHash;
    }

    /**
     * @dev Returns the domain separator for the current chain.
     */
    function _domainSeparatorV4() internal view returns (bytes32) {
        if (address(this) == _CACHED_THIS && block.chainid == _CACHED_CHAIN_ID) {
            return _CACHED_DOMAIN_SEPARATOR;
        } else {
            return _buildDomainSeparator(_TYPE_HASH, _HASHED_NAME, _HASHED_VERSION);
        }
    }

    function _buildDomainSeparator(
        bytes32 typeHash,
        bytes32 nameHash,
        bytes32 versionHash
    ) private view returns (bytes32) {
        return keccak256(abi.encode(typeHash, nameHash, versionHash, block.chainid, address(this)));
    }

    /**
     * @dev Given an already https://eips.ethereum.org/EIPS/eip-712#definition-of-hashstruct[hashed struct], this
     * function returns the hash of the fully encoded EIP712 message for this domain.
     *
     * This hash can be used together with {ECDSA-recover} to obtain the signer of a message. For example:
     *
     * ```solidity
     * bytes32 digest = _hashTypedDataV4(keccak256(abi.encode(
     *     keccak256("Mail(address to,string contents)"),
     *     mailTo,
     *     keccak256(bytes(mailContents))
     * )));
     * address signer = ECDSA.recover(digest, signature);
     * ```
     */
    function _hashTypedDataV4(bytes32 structHash) internal view virtual returns (bytes32) {
        return ECDSA.toTypedDataHash(_domainSeparatorV4(), structHash);
    }
}

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

pragma solidity ^0.8.0;

import "../Strings.sol";

/**
 * @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations.
 *
 * These functions can be used to verify that a message was signed by the holder
 * of the private keys of a given address.
 */
library ECDSA {
    enum RecoverError {
        NoError,
        InvalidSignature,
        InvalidSignatureLength,
        InvalidSignatureS,
        InvalidSignatureV
    }

    function _throwError(RecoverError error) private pure {
        if (error == RecoverError.NoError) {
            return; // no error: do nothing
        } else if (error == RecoverError.InvalidSignature) {
            revert("ECDSA: invalid signature");
        } else if (error == RecoverError.InvalidSignatureLength) {
            revert("ECDSA: invalid signature length");
        } else if (error == RecoverError.InvalidSignatureS) {
            revert("ECDSA: invalid signature 's' value");
        } else if (error == RecoverError.InvalidSignatureV) {
            revert("ECDSA: invalid signature 'v' value");
        }
    }

    /**
     * @dev Returns the address that signed a hashed message (`hash`) with
     * `signature` or error string. This address can then be used for verification purposes.
     *
     * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:
     * this function rejects them by requiring the `s` value to be in the lower
     * half order, and the `v` value to be either 27 or 28.
     *
     * IMPORTANT: `hash` _must_ be the result of a hash operation for the
     * verification to be secure: it is possible to craft signatures that
     * recover to arbitrary addresses for non-hashed data. A safe way to ensure
     * this is by receiving a hash of the original message (which may otherwise
     * be too long), and then calling {toEthSignedMessageHash} on it.
     *
     * Documentation for signature generation:
     * - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js]
     * - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers]
     *
     * _Available since v4.3._
     */
    function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError) {
        // Check the signature length
        // - case 65: r,s,v signature (standard)
        // - case 64: r,vs signature (cf https://eips.ethereum.org/EIPS/eip-2098) _Available since v4.1._
        if (signature.length == 65) {
            bytes32 r;
            bytes32 s;
            uint8 v;
            // ecrecover takes the signature parameters, and the only way to get them
            // currently is to use assembly.
            assembly {
                r := mload(add(signature, 0x20))
                s := mload(add(signature, 0x40))
                v := byte(0, mload(add(signature, 0x60)))
            }
            return tryRecover(hash, v, r, s);
        } else if (signature.length == 64) {
            bytes32 r;
            bytes32 vs;
            // ecrecover takes the signature parameters, and the only way to get them
            // currently is to use assembly.
            assembly {
                r := mload(add(signature, 0x20))
                vs := mload(add(signature, 0x40))
            }
            return tryRecover(hash, r, vs);
        } else {
            return (address(0), RecoverError.InvalidSignatureLength);
        }
    }

    /**
     * @dev Returns the address that signed a hashed message (`hash`) with
     * `signature`. This address can then be used for verification purposes.
     *
     * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:
     * this function rejects them by requiring the `s` value to be in the lower
     * half order, and the `v` value to be either 27 or 28.
     *
     * IMPORTANT: `hash` _must_ be the result of a hash operation for the
     * verification to be secure: it is possible to craft signatures that
     * recover to arbitrary addresses for non-hashed data. A safe way to ensure
     * this is by receiving a hash of the original message (which may otherwise
     * be too long), and then calling {toEthSignedMessageHash} on it.
     */
    function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {
        (address recovered, RecoverError error) = tryRecover(hash, signature);
        _throwError(error);
        return recovered;
    }

    /**
     * @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately.
     *
     * See https://eips.ethereum.org/EIPS/eip-2098[EIP-2098 short signatures]
     *
     * _Available since v4.3._
     */
    function tryRecover(
        bytes32 hash,
        bytes32 r,
        bytes32 vs
    ) internal pure returns (address, RecoverError) {
        bytes32 s = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff);
        uint8 v = uint8((uint256(vs) >> 255) + 27);
        return tryRecover(hash, v, r, s);
    }

    /**
     * @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately.
     *
     * _Available since v4.2._
     */
    function recover(
        bytes32 hash,
        bytes32 r,
        bytes32 vs
    ) internal pure returns (address) {
        (address recovered, RecoverError error) = tryRecover(hash, r, vs);
        _throwError(error);
        return recovered;
    }

    /**
     * @dev Overload of {ECDSA-tryRecover} that receives the `v`,
     * `r` and `s` signature fields separately.
     *
     * _Available since v4.3._
     */
    function tryRecover(
        bytes32 hash,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) internal pure returns (address, RecoverError) {
        // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature
        // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines
        // the valid range for s in (301): 0 < s < secp256k1n ÷ 2 + 1, and for v in (302): v ∈ {27, 28}. Most
        // signatures from current libraries generate a unique signature with an s-value in the lower half order.
        //
        // If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value
        // with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or
        // vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept
        // these malleable signatures as well.
        if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) {
            return (address(0), RecoverError.InvalidSignatureS);
        }
        if (v != 27 && v != 28) {
            return (address(0), RecoverError.InvalidSignatureV);
        }

        // If the signature is valid (and not malleable), return the signer address
        address signer = ecrecover(hash, v, r, s);
        if (signer == address(0)) {
            return (address(0), RecoverError.InvalidSignature);
        }

        return (signer, RecoverError.NoError);
    }

    /**
     * @dev Overload of {ECDSA-recover} that receives the `v`,
     * `r` and `s` signature fields separately.
     */
    function recover(
        bytes32 hash,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) internal pure returns (address) {
        (address recovered, RecoverError error) = tryRecover(hash, v, r, s);
        _throwError(error);
        return recovered;
    }

    /**
     * @dev Returns an Ethereum Signed Message, created from a `hash`. This
     * produces hash corresponding to the one signed with the
     * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]
     * JSON-RPC method as part of EIP-191.
     *
     * See {recover}.
     */
    function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32) {
        // 32 is the length in bytes of hash,
        // enforced by the type signature above
        return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n32", hash));
    }

    /**
     * @dev Returns an Ethereum Signed Message, created from `s`. This
     * produces hash corresponding to the one signed with the
     * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]
     * JSON-RPC method as part of EIP-191.
     *
     * See {recover}.
     */
    function toEthSignedMessageHash(bytes memory s) internal pure returns (bytes32) {
        return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n", Strings.toString(s.length), s));
    }

    /**
     * @dev Returns an Ethereum Signed Typed Data, created from a
     * `domainSeparator` and a `structHash`. This produces hash corresponding
     * to the one signed with the
     * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`]
     * JSON-RPC method as part of EIP-712.
     *
     * See {recover}.
     */
    function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32) {
        return keccak256(abi.encodePacked("\x19\x01", domainSeparator, structHash));
    }
}

File 8 of 16 : ERC721A.sol
// SPDX-License-Identifier: MIT
// Creator: Chiru Labs

pragma solidity ^0.8.4;

import '@openzeppelin/contracts/token/ERC721/IERC721.sol';
import '@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol';
import '@openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.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';

error ApprovalCallerNotOwnerNorApproved();
error ApprovalQueryForNonexistentToken();
error ApproveToCaller();
error ApprovalToCurrentOwner();
error BalanceQueryForZeroAddress();
error MintToZeroAddress();
error MintZeroQuantity();
error OwnerQueryForNonexistentToken();
error TransferCallerNotOwnerNorApproved();
error TransferFromIncorrectOwner();
error TransferToNonERC721ReceiverImplementer();
error TransferToZeroAddress();
error URIQueryForNonexistentToken();

/**
 * @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, IERC721, IERC721Metadata {
    using Address for address;
    using Strings for uint256;

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

    // 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 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 && 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 && !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() && !_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;
    }

    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 {
        _mint(to, quantity, _data, true);
    }

    /**
     * @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,
        bytes memory _data,
        bool safe
    ) 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 (safe && 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 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 This is 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 9 of 16 : 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 10 of 16 : IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC20/IERC20.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20 {
    /**
     * @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);

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

File 11 of 16 : IERC20Metadata.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)

pragma solidity ^0.8.0;

import "../IERC20.sol";

/**
 * @dev Interface for the optional metadata functions from the ERC20 standard.
 *
 * _Available since v4.1._
 */
interface IERC20Metadata is IERC20 {
    /**
     * @dev Returns the name of the token.
     */
    function name() external view returns (string memory);

    /**
     * @dev Returns the symbol of the token.
     */
    function symbol() external view returns (string memory);

    /**
     * @dev Returns the decimals places of the token.
     */
    function decimals() external view returns (uint8);
}

File 12 of 16 : IERC721.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (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`, 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 Returns the account approved for `tokenId` token.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function getApproved(uint256 tokenId) external view returns (address operator);

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

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

File 13 of 16 : IERC721Receiver.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (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 `IERC721.onERC721Received.selector`.
     */
    function onERC721Received(
        address operator,
        address from,
        uint256 tokenId,
        bytes calldata data
    ) external returns (bytes4);
}

File 14 of 16 : 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 15 of 16 : 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 16 of 16 : 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);
}

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

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"uint256","name":"publicMintPrice","type":"uint256"},{"internalType":"uint256","name":"allowlistPrice","type":"uint256"},{"internalType":"uint32","name":"maxSupply","type":"uint32"},{"internalType":"uint32","name":"auctionSupply","type":"uint32"},{"internalType":"uint32","name":"reservedSupply","type":"uint32"},{"internalType":"uint32","name":"mintTxLimit","type":"uint32"},{"internalType":"uint32","name":"mintWalletLimit","type":"uint32"},{"internalType":"address","name":"vault","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":"ErrorExceedMaxAllowed","type":"error"},{"inputs":[],"name":"ErrorExceedMaxSupply","type":"error"},{"inputs":[],"name":"ErrorExceedReserveSupply","type":"error"},{"inputs":[],"name":"ErrorExceedTransactionLimit","type":"error"},{"inputs":[],"name":"ErrorExceedWalletLimit","type":"error"},{"inputs":[],"name":"ErrorInsufficientFund","type":"error"},{"inputs":[],"name":"ErrorInvalidMintAmount","type":"error"},{"inputs":[],"name":"ErrorInvalidSignature","type":"error"},{"inputs":[],"name":"ErrorOnlyAllowEOA","type":"error"},{"inputs":[],"name":"ErrorPendingAuction","type":"error"},{"inputs":[],"name":"ErrorSaleNotStarted","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":"PRICE_MULTIPLIER","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"minter","type":"address"}],"name":"_allowlistMinted","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"_allowlistPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"minter","type":"address"}],"name":"_auctionBid","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"_auctionConfig","outputs":[{"internalType":"uint32","name":"startingPrice","type":"uint32"},{"internalType":"uint32","name":"endingPrice","type":"uint32"},{"internalType":"uint32","name":"startTime","type":"uint32"},{"internalType":"uint32","name":"duration","type":"uint32"},{"internalType":"uint32","name":"discountPerInterval","type":"uint32"},{"internalType":"uint32","name":"interval","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"_auctionPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"_auctionSupply","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"minter","type":"address"}],"name":"_aux","outputs":[{"internalType":"uint64","name":"","type":"uint64"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"_bids","outputs":[{"internalType":"address","name":"bidder","type":"address"},{"internalType":"uint32","name":"price","type":"uint32"},{"internalType":"uint32","name":"amount","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"_bidsLength","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"_config","outputs":[{"internalType":"uint32","name":"auctionBids","type":"uint32"},{"internalType":"uint32","name":"reservedMinted","type":"uint32"},{"internalType":"enum Youtopia.SaleState","name":"saleState","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"_maxSupply","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"_metadataURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"_mintTxLimit","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"_mintWalletLimit","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"_minted","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"_processedBids","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"_publicMintPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"minter","type":"address"}],"name":"_publicSaleMinted","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"_publicSupply","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"_reservedSupply","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"_vault","outputs":[{"internalType":"address","name":"","type":"address"}],"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":[{"internalType":"uint256","name":"count","type":"uint256"}],"name":"finalizeAuction","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","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":[],"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":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint32","name":"startingPrice","type":"uint32"},{"internalType":"uint32","name":"endingPrice","type":"uint32"},{"internalType":"uint32","name":"startTime","type":"uint32"},{"internalType":"uint32","name":"duration","type":"uint32"},{"internalType":"uint32","name":"interval","type":"uint32"}],"name":"setAuctionState","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"uri","type":"string"}],"name":"setMetadataURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"enum Youtopia.SaleState","name":"saleState","type":"uint8"}],"name":"setSaleState","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":[],"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":[],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"amount","type":"uint16"},{"internalType":"uint32","name":"maxAllowed","type":"uint32"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"},{"internalType":"uint8","name":"v","type":"uint8"}],"name":"youtopiaAllowlistMint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint16","name":"amount","type":"uint16"}],"name":"youtopiaPlaceBid","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint16","name":"amount","type":"uint16"}],"name":"youtopiaPublicMint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint16","name":"amount","type":"uint16"}],"name":"youtopiaReservedMint","outputs":[],"stateMutability":"nonpayable","type":"function"}]

6102c06040526038610260818152906200465b6102803980516200002c91600d9160209091019062000285565b503480156200003a57600080fd5b5060405162004693380380620046938339810160408190526200005d9162000345565b60405180604001604052806008815260200167596f75746f70696160c01b815250604051806040016040528060018152602001603160f81b81525060405180604001604052806008815260200167596f75746f70696160c01b815250604051806040016040528060048152602001635954504160e01b8152508160029080519060200190620000ee92919062000285565b5080516200010490600390602084019062000285565b50506000805550815160209283012081519183019190912060e08290526101008190524660a0818152604080517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f818801819052818301969096526060810194909452608080850193909352308483018190528151808603909301835260c09485019091528151919095012090529190915261012052620001a53362000233565b620001b1848662000401565b63ffffffff168663ffffffff161015620001ca57600080fd5b61016088905261018087905263ffffffff8087166101a08190528682166101e05285821661020081905285831661022052918416610240526200020e91906200042c565b63ffffffff166101c0526001600160a01b031661014052506200049195505050505050565b600880546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b828054620002939062000454565b90600052602060002090601f016020900481019282620002b7576000855562000302565b82601f10620002d257805160ff191683800117855562000302565b8280016001018555821562000302579182015b8281111562000302578251825591602001919060010190620002e5565b506200031092915062000314565b5090565b5b8082111562000310576000815560010162000315565b805163ffffffff811681146200034057600080fd5b919050565b600080600080600080600080610100898b0312156200036357600080fd5b88519750602089015196506200037c60408a016200032b565b95506200038c60608a016200032b565b94506200039c60808a016200032b565b9350620003ac60a08a016200032b565b9250620003bc60c08a016200032b565b60e08a01519092506001600160a01b0381168114620003da57600080fd5b809150509295985092959890939650565b634e487b7160e01b600052601160045260246000fd5b600063ffffffff808316818516808303821115620004235762000423620003eb565b01949350505050565b600063ffffffff838116908316818110156200044c576200044c620003eb565b039392505050565b600181811c908216806200046957607f821691505b602082108114156200048b57634e487b7160e01b600052602260045260246000fd5b50919050565b60805160a05160c05160e05161010051610120516101405161016051610180516101a0516101c0516101e0516102005161022051610240516140ca62000591600039600081816107d801528181611a560152612093015260008181610590015281816119f2015261202f015260008181610a6e0152610c6401526000818161078f01526119930152600081816108c00152818161144c0152611fb8015260006104db015260008181610381015261151801526000818161084c0152612109015260008181610aa201526116ab0152600061296f015260006129be01526000612999015260006128f20152600061291c0152600061294601526140ca6000f3fe6080604052600436106103135760003560e01c80636352211e1161019a578063b88d4fde116100e1578063e985e9c51161008a578063f8da7b6211610064578063f8da7b6214610a5c578063fd243da314610a90578063fd5f644e14610ac457600080fd5b8063e985e9c5146109d3578063e9f4028614610a1c578063f2fde38b14610a3c57600080fd5b8063d04b1a91116100bb578063d04b1a91146108e2578063d4a676231461099e578063e8083863146109b357600080fd5b8063b88d4fde1461086e578063c87b56dd1461088e578063ccd5f6a2146108ae57600080fd5b80638f7e39ee11610143578063a174e8031161011d578063a174e803146107fa578063a22cb4651461081a578063b551e3661461083a57600080fd5b80638f7e39ee1461077d57806395d89b41146107b157806399afa9d0146107c657600080fd5b8063750521f511610174578063750521f51461072c5780638da5cb5b1461074c5780638de1ce5e1461076a57600080fd5b80636352211e146106d757806370a08231146106f7578063715018a61461071757600080fd5b806323b872dd1161025e5780633ccfd60b116102075780635ae0f276116101e15780635ae0f2761461067c5780635f5676781461068f5780635fedbc53146106a457600080fd5b80633ccfd60b1461062757806342842e0e1461063c5780635a67de071461065c57600080fd5b80632c19b7f3116102385780632c19b7f3146105b25780632e44086e146105c75780632ed42bf7146105dd57600080fd5b806323b872dd146105125780632712b2e5146105325780632ac98c311461057e57600080fd5b80630e26bac5116102c0578063113990b81161029a578063113990b81461049757806318160ddd146104b057806322f4596f146104c957600080fd5b80630e26bac51461042b57806310b9ddbd1461046457806310d554f91461048457600080fd5b806306fdde03116102f157806306fdde03146103b1578063081812fc146103d3578063095ea7b31461040b57600080fd5b806301ffc9a714610318578063039b126c1461034d5780630559c2dc1461036f575b600080fd5b34801561032457600080fd5b50610338610333366004613806565b610ad9565b60405190151581526020015b60405180910390f35b34801561035957600080fd5b5061036d610368366004613858565b610bbe565b005b34801561037b57600080fd5b506103a37f000000000000000000000000000000000000000000000000000000000000000081565b604051908152602001610344565b3480156103bd57600080fd5b506103c6610cef565b6040516103449190613901565b3480156103df57600080fd5b506103f36103ee366004613914565b610d81565b6040516001600160a01b039091168152602001610344565b34801561041757600080fd5b5061036d61042636600461392d565b610dde565b34801561043757600080fd5b5061044b610446366004613957565b610e9e565b60405167ffffffffffffffff9091168152602001610344565b34801561047057600080fd5b5061036d61047f366004613986565b610ee2565b61036d6104923660046139eb565b611219565b3480156104a357600080fd5b506103a364174876e80081565b3480156104bc57600080fd5b50600154600054036103a3565b3480156104d557600080fd5b506104fd7f000000000000000000000000000000000000000000000000000000000000000081565b60405163ffffffff9091168152602001610344565b34801561051e57600080fd5b5061036d61052d366004613a4c565b61158f565b34801561053e57600080fd5b5061055261054d366004613914565b61159a565b604080516001600160a01b03909416845263ffffffff9283166020850152911690820152606001610344565b34801561058a57600080fd5b506104fd7f000000000000000000000000000000000000000000000000000000000000000081565b3480156105be57600080fd5b506000546103a3565b3480156105d357600080fd5b506103a3600c5481565b3480156105e957600080fd5b50600a546106189063ffffffff8082169164010000000081049091169068010000000000000000900460ff1683565b60405161034493929190613ab7565b34801561063357600080fd5b5061036d611607565b34801561064857600080fd5b5061036d610657366004613a4c565b6116d3565b34801561066857600080fd5b5061036d610677366004613b11565b6116ee565b61036d61068a366004613b32565b611795565b34801561069b57600080fd5b506103a3611cde565b3480156106b057600080fd5b506106c46106bf366004613957565b611d8e565b60405161ffff9091168152602001610344565b3480156106e357600080fd5b506103f36106f2366004613914565b611dd8565b34801561070357600080fd5b506103a3610712366004613957565b611dea565b34801561072357600080fd5b5061036d611e52565b34801561073857600080fd5b5061036d610747366004613c10565b611eb6565b34801561075857600080fd5b506008546001600160a01b03166103f3565b61036d610778366004613b32565b611f23565b34801561078957600080fd5b506104fd7f000000000000000000000000000000000000000000000000000000000000000081565b3480156107bd57600080fd5b506103c6612180565b3480156107d257600080fd5b506104fd7f000000000000000000000000000000000000000000000000000000000000000081565b34801561080657600080fd5b506106c4610815366004613957565b61218f565b34801561082657600080fd5b5061036d610835366004613c59565b6121d9565b34801561084657600080fd5b506103a37f000000000000000000000000000000000000000000000000000000000000000081565b34801561087a57600080fd5b5061036d610889366004613c95565b6122a6565b34801561089a57600080fd5b506103c66108a9366004613914565b612310565b3480156108ba57600080fd5b506104fd7f000000000000000000000000000000000000000000000000000000000000000081565b3480156108ee57600080fd5b50600b5461095f9063ffffffff8082169164010000000081048216916801000000000000000082048116916c01000000000000000000000000810482169170010000000000000000000000000000000082048116917401000000000000000000000000000000000000000090041686565b6040805163ffffffff978816815295871660208701529386169385019390935290841660608401528316608083015290911660a082015260c001610344565b3480156109aa57600080fd5b506103c6612412565b3480156109bf57600080fd5b5061036d6109ce366004613914565b6124a0565b3480156109df57600080fd5b506103386109ee366004613d11565b6001600160a01b03918216600090815260076020908152604080832093909416825291909152205460ff1690565b348015610a2857600080fd5b506106c4610a37366004613957565b6126ea565b348015610a4857600080fd5b5061036d610a57366004613957565b612734565b348015610a6857600080fd5b506104fd7f000000000000000000000000000000000000000000000000000000000000000081565b348015610a9c57600080fd5b506103f37f000000000000000000000000000000000000000000000000000000000000000081565b348015610ad057600080fd5b506009546103a3565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f80ac58cd000000000000000000000000000000000000000000000000000000001480610b6c57507fffffffff0000000000000000000000000000000000000000000000000000000082167f5b5e139f00000000000000000000000000000000000000000000000000000000145b80610bb857507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316145b92915050565b6008546001600160a01b03163314610c1d5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064015b60405180910390fd5b600a805461ffff83169190600490610c44908490640100000000900463ffffffff16613d6a565b92506101000a81548163ffffffff021916908363ffffffff1602179055507f000000000000000000000000000000000000000000000000000000000000000063ffffffff16600a60000160049054906101000a900463ffffffff1663ffffffff161115610cdd576040517feefe8d1600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610ceb828261ffff16612813565b5050565b606060028054610cfe90613d92565b80601f0160208091040260200160405190810160405280929190818152602001828054610d2a90613d92565b8015610d775780601f10610d4c57610100808354040283529160200191610d77565b820191906000526020600020905b815481529060010190602001808311610d5a57829003601f168201915b5050505050905090565b6000610d8c8261282d565b610dc2576040517fcf4700e400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b506000908152600660205260409020546001600160a01b031690565b6000610de982611dd8565b9050806001600160a01b0316836001600160a01b03161415610e37576040517f943f7b8c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b336001600160a01b03821614801590610e575750610e5581336109ee565b155b15610e8e576040517fcfb3b94200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610e99838383612871565b505050565b6001600160a01b0381166000908152600560205260408120547801000000000000000000000000000000000000000000000000900467ffffffffffffffff16610bb8565b6008546001600160a01b03163314610f3c5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610c14565b8363ffffffff168563ffffffff161015610f985760405162461bcd60e51b815260206004820152601660248201527f5374617274696e6720507269636520746f6f206c6f77000000000000000000006044820152606401610c14565b610fa28183613e15565b63ffffffff1615610ff55760405162461bcd60e51b815260206004820152601860248201527f4475726174696f6e202520496e74657276616c20213d203000000000000000006044820152606401610c14565b60006110018587613e38565b9050600061100f8385613e5d565b905061101b8183613e15565b63ffffffff161561106e5760405162461bcd60e51b815260206004820152601560248201527f5072696365446966662025205374657020213d203000000000000000000000006044820152606401610c14565b6040518060c001604052808863ffffffff1681526020018763ffffffff1681526020018663ffffffff1681526020018563ffffffff16815260200182846110b59190613e5d565b63ffffffff90811682529485166020918201528151600b80549284015160408501516060860151608087015160a0909701518a1674010000000000000000000000000000000000000000027fffffffffffffffff00000000ffffffffffffffffffffffffffffffffffffffff978b1670010000000000000000000000000000000002979097167fffffffffffffffff0000000000000000ffffffffffffffffffffffffffffffff918b166c01000000000000000000000000027fffffffffffffffffffffffffffffffff00000000ffffffffffffffffffffffff938c166801000000000000000002939093167fffffffffffffffffffffffffffffffff0000000000000000ffffffffffffffff948c16640100000000027fffffffffffffffffffffffffffffffffffffffffffffffff000000000000000090981696909b169590951795909517919091169790971796909617919091161717909255505050505050565b604080517f8c71ef8ea783f9c32d98972bf6438ab01768ab8333d95686d34941dc468640676020820152339181019190915263ffffffff85166060820152849084908490849060009060800160405160208183030381529060405280519060200120905060006112e18261128b6128e5565b604080517f19010000000000000000000000000000000000000000000000000000000000006020808301919091526022820193909352604280820194909452815180820390940184526062019052815191012090565b6040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c810191909152605c0160405160208183030381529060405280519060200120905061133f6008546001600160a01b031690565b6001600160a01b031660018285888860405160008152602001604052604051611384949392919093845260ff9290921660208401526040830152606082015260800190565b6020604051602081039080840390855afa1580156113a6573d6000803e3d6000fd5b505050602060405103516001600160a01b0316146113f0576040517f3f88fec700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61ffff8b168061142c576040517fbbe716d400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600a5461144a9060029068010000000000000000900460ff16612a0c565b7f000000000000000000000000000000000000000000000000000000000000000063ffffffff168c61ffff1661147f60005490565b6114899190613e80565b11156114c1576040517f57bb669800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8a63ffffffff166114d18d612a67565b61ffff16111561150d576040517ff5e1c78600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b3461153c61ffff8e167f0000000000000000000000000000000000000000000000000000000000000000613e98565b14611573576040517f9cb10c3c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b611581338d61ffff16612813565b505050505050505050505050565b610e99838383612a74565b600981815481106115aa57600080fd5b6000918252602090912001546001600160a01b038116915063ffffffff740100000000000000000000000000000000000000008204811691780100000000000000000000000000000000000000000000000090041683565b905090565b6008546001600160a01b031633146116615760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610c14565b600954600c541461169e576040517f912d7e9400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6116d16001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001647612d37565b565b610e99838383604051806020016040528060008152506122a6565b6008546001600160a01b031633146117485760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610c14565b600a80548291907fffffffffffffffffffffffffffffffffffffffffffffff00ffffffffffffffff166801000000000000000083600581111561178d5761178d613a88565b021790555050565b3233146117ce576040517fbfd0f3c400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61ffff81168061180a576040517fbbe716d400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60408051606081018252600a805463ffffffff8082168452640100000000820416602084015260009383019068010000000000000000900460ff16600581111561185657611856613a88565b600581111561186757611867613a88565b9052506040805160c081018252600b5463ffffffff80821683526401000000008204811660208401526801000000000000000082048116838501526c01000000000000000000000000820481166060840152700100000000000000000000000000000000820481166080840152740100000000000000000000000000000000000000009091041660a08201529082015191925090600581111561190c5761190c613a88565b60011415806119235750604081015163ffffffff16155b806119375750806040015163ffffffff1642105b1561196e576040517f1e3177ee00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8361ffff16826000018181516119849190613d6a565b63ffffffff90811690915283517f000000000000000000000000000000000000000000000000000000000000000082169116111590506119f0576040517f57bb669800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b7f000000000000000000000000000000000000000000000000000000000000000063ffffffff168461ffff161115611a54576040517f552d9c8300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b7f000000000000000000000000000000000000000000000000000000000000000063ffffffff16611a8485612e50565b61ffff161115611ac0576040517f171b8e9400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000611acb82612e5d565b9050600061ffff8616611ae964174876e80063ffffffff8516613e98565b611af39190613e98565b905080341015611b2f576040517f9cb10c3c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8351600a8054602087015163ffffffff908116640100000000027fffffffffffffffffffffffffffffffffffffffffffffffff000000000000000090921693169290921791909117808255604086015186929182907fffffffffffffffffffffffffffffffffffffffffffffff00ffffffffffffffff1668010000000000000000836005811115611bc257611bc2613a88565b021790555050604080516060810182523380825263ffffffff8087166020840190815261ffff8c169484018581526009805460018101825560009190915294517f6e1540171b6c0c960b71a7020d9f60077f6af931a8bbf590da0223dacf75c7af90950180549251915184167801000000000000000000000000000000000000000000000000027fffffffff00000000ffffffffffffffffffffffffffffffffffffffffffffffff9290941674010000000000000000000000000000000000000000027fffffffffffffffff0000000000000000000000000000000000000000000000009093166001600160a01b039690961695909517919091171617909155611ccd925090612813565b611cd681612eed565b505050505050565b6040805160c081018252600b5463ffffffff80821683526401000000008204811660208401526801000000000000000082048116938301939093526c0100000000000000000000000081048316606083015270010000000000000000000000000000000081048316608083015274010000000000000000000000000000000000000000900490911660a082015260009064174876e80090611d7e90612e5d565b63ffffffff166116029190613e98565b6001600160a01b038116600090815260056020526040812054610bb8907801000000000000000000000000000000000000000000000000900467ffffffffffffffff166001612f09565b6000611de382612f32565b5192915050565b60006001600160a01b038216611e2c576040517f8f4eb60400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b506001600160a01b031660009081526005602052604090205467ffffffffffffffff1690565b6008546001600160a01b03163314611eac5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610c14565b6116d160006130d9565b6008546001600160a01b03163314611f105760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610c14565b8051610ceb90600d90602084019061373f565b323314611f5c576040517fbfd0f3c400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61ffff811680611f98576040517fbbe716d400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600a54611fb69060039068010000000000000000900460ff16612a0c565b7f000000000000000000000000000000000000000000000000000000000000000063ffffffff168261ffff16611feb60005490565b611ff59190613e80565b111561202d576040517f57bb669800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b7f000000000000000000000000000000000000000000000000000000000000000063ffffffff168261ffff161115612091576040517f552d9c8300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b7f000000000000000000000000000000000000000000000000000000000000000063ffffffff166120c183613143565b61ffff1611156120fd576040517f171b8e9400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600061212d61ffff84167f0000000000000000000000000000000000000000000000000000000000000000613e98565b905080341015612169576040517f9cb10c3c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b612177338461ffff16612813565b610e9981612eed565b606060038054610cfe90613d92565b6001600160a01b038116600090815260056020526040812054610bb8907801000000000000000000000000000000000000000000000000900467ffffffffffffffff166002612f09565b6001600160a01b03821633141561221c576040517fb06307db00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b3360008181526007602090815260408083206001600160a01b0387168085529083529281902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b6122b1848484612a74565b6001600160a01b0383163b151580156122d357506122d184848484613150565b155b1561230a576040517fd1a57ed600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b50505050565b606061231b8261282d565b612351576040517fa14c4b5000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000600d805461236090613d92565b80601f016020809104026020016040519081016040528092919081815260200182805461238c90613d92565b80156123d95780601f106123ae576101008083540402835291602001916123d9565b820191906000526020600020905b8154815290600101906020018083116123bc57829003601f168201915b50505050509050806123ea846132b9565b6040516020016123fb929190613ed5565b604051602081830303815290604052915050919050565b600d805461241f90613d92565b80601f016020809104026020016040519081016040528092919081815260200182805461244b90613d92565b80156124985780601f1061246d57610100808354040283529160200191612498565b820191906000526020600020905b81548152906001019060200180831161247b57829003601f168201915b505050505081565b6008546001600160a01b031633146124fa5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610c14565b6001600a5468010000000000000000900460ff16600581111561251f5761251f613a88565b1415612557576040517f912d7e9400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6009546125615750565b600c5460098054906000908190612579600185613f2c565b8154811061258957612589613f43565b60009182526020909120015474010000000000000000000000000000000000000000900463ffffffff1690505b84821080156125cd5750826125cb8584613e80565b105b156126cb57600060096125e08685613e80565b815481106125f0576125f0613f43565b600091825260208083206040805160608101825293909101546001600160a01b038116845263ffffffff74010000000000000000000000000000000000000000820481169385018490527801000000000000000000000000000000000000000000000000909104169083015290925061266a908490613e38565b905063ffffffff8116156126b8576126b8826040015163ffffffff1664174876e8008363ffffffff1661269d9190613e98565b6126a79190613e98565b83516001600160a01b031690612d37565b5050816126c490613f72565b91506125b6565b81600c60008282546126dd9190613e80565b9091555050505050505b50565b6001600160a01b038116600090815260056020526040812054610bb8907801000000000000000000000000000000000000000000000000900467ffffffffffffffff166000612f09565b6008546001600160a01b0316331461278e5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610c14565b6001600160a01b03811661280a5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152608401610c14565b6126e7816130d9565b610ceb8282604051806020016040528060008152506133eb565b6000805482108015610bb85750506000908152600460205260409020547c0100000000000000000000000000000000000000000000000000000000900460ff161590565b60008281526006602052604080822080547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0387811691821790925591518593918516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591a4505050565b6000306001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614801561293e57507f000000000000000000000000000000000000000000000000000000000000000046145b1561296857507f000000000000000000000000000000000000000000000000000000000000000090565b50604080517f00000000000000000000000000000000000000000000000000000000000000006020808301919091527f0000000000000000000000000000000000000000000000000000000000000000828401527f000000000000000000000000000000000000000000000000000000000000000060608301524660808301523060a0808401919091528351808403909101815260c0909201909252805191012090565b806005811115612a1e57612a1e613a88565b826005811115612a3057612a30613a88565b14610ceb576040517f1e3177ee00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000610bb86000836133f8565b6000612a7f82612f32565b9050836001600160a01b031681600001516001600160a01b031614612ad0576040517fa114810000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000336001600160a01b0386161480612aee5750612aee85336109ee565b80612b09575033612afe84610d81565b6001600160a01b0316145b905080612b42576040517f59c896be00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b038416612b82576040517fea553b3400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b612b8e60008487612871565b6001600160a01b03858116600090815260056020908152604080832080547fffffffffffffffffffffffffffffffffffffffffffffffff000000000000000080821667ffffffffffffffff9283167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff01831617909255898616808652838620805493841693831660019081018416949094179055898652600490945282852080547fffffffff00000000000000000000000000000000000000000000000000000000169094177401000000000000000000000000000000000000000042909216919091021783558701808452922080549193909116612ceb576000548214612ceb578054602086015167ffffffffffffffff1674010000000000000000000000000000000000000000027fffffffff000000000000000000000000000000000000000000000000000000009091166001600160a01b038a16171781555b50505082846001600160a01b0316866001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a45b5050505050565b80471015612d875760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e63650000006044820152606401610c14565b6000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114612dd4576040519150601f19603f3d011682016040523d82523d6000602084013e612dd9565b606091505b5050905080610e995760405162461bcd60e51b815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c207260448201527f6563697069656e74206d617920686176652072657665727465640000000000006064820152608401610c14565b6000610bb86001836133f8565b600080826040015163ffffffff16421015612e7a57508151610bb8565b82606001518360400151612e8e9190613d6a565b63ffffffff16421115612ea657506020820151610bb8565b60008360a00151846040015142612ebd9190613e38565b612ec79190613e5d565b9050836080015181612ed99190613fab565b8451612ee59190613e38565b949350505050565b803411156126e7576126e7612f028234613f2c565b3390612d37565b6000612f16826010613fd7565b60ff168367ffffffffffffffff16901c61ffff16905092915050565b6040805160608101825260008082526020820181905291810191909152816000548110156130a757600081815260046020908152604091829020825160608101845290546001600160a01b038116825274010000000000000000000000000000000000000000810467ffffffffffffffff16928201929092527c010000000000000000000000000000000000000000000000000000000090910460ff161515918101829052906130a55780516001600160a01b031615612ff3579392505050565b507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff01600081815260046020908152604091829020825160608101845290546001600160a01b03811680835274010000000000000000000000000000000000000000820467ffffffffffffffff16938301939093527c0100000000000000000000000000000000000000000000000000000000900460ff16151592810192909252156130a0579392505050565b612ff3565b505b6040517fdf2d9b4200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600880546001600160a01b038381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6000610bb86002836133f8565b6040517f150b7a020000000000000000000000000000000000000000000000000000000081526000906001600160a01b0385169063150b7a029061319e903390899088908890600401614000565b6020604051808303816000875af19250505080156131f7575060408051601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01682019092526131f491810190614032565b60015b61326b573d808015613225576040519150601f19603f3d011682016040523d82523d6000602084013e61322a565b606091505b508051613263576040517fd1a57ed600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b805181602001fd5b7fffffffff00000000000000000000000000000000000000000000000000000000167f150b7a0200000000000000000000000000000000000000000000000000000000149050949350505050565b6060816132f957505060408051808201909152600181527f3000000000000000000000000000000000000000000000000000000000000000602082015290565b8160005b8115613323578061330d81613f72565b915061331c9050600a8361404f565b91506132fd565b60008167ffffffffffffffff81111561333e5761333e613b4d565b6040519080825280601f01601f191660200182016040528015613368576020820181803683370190505b5090505b8415612ee55761337d600183613f2c565b915061338a600a86614063565b613395906030613e80565b60f81b8183815181106133aa576133aa613f43565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053506133e4600a8661404f565b945061336c565b610e9983838360016134d3565b600080613406846010613fd7565b3360009081526005602052604081205460ff92909216925063ffffffff831b19917801000000000000000000000000000000000000000000000000900467ffffffffffffffff1690856134598389612f09565b6134639190614077565b336000908152600560205260409020805477ffffffffffffffffffffffffffffffffffffffffffffffff16780100000000000000000000000000000000000000000000000061ffff841667ffffffffffffffff8981169190911b88881617160217905590505b9695505050505050565b6000546001600160a01b038516613516576040517f2e07630000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8361354d576040517fb562e8dd00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b038516600081815260056020908152604080832080547fffffffffffffffffffffffffffffffff00000000000000000000000000000000811667ffffffffffffffff8083168c018116918217680100000000000000007fffffffffffffffffffffffffffffffffffffffffffffffff000000000000000090941690921783900481168c01811690920217909155858452600490925290912080547fffffffff00000000000000000000000000000000000000000000000000000000169092177401000000000000000000000000000000000000000042909216919091021790558080850183801561364e57506001600160a01b0387163b15155b156136f0575b60405182906001600160a01b038916906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a461369f6000888480600101955088613150565b6136d5576040517fd1a57ed600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b808214156136545782600054146136eb57600080fd5b613736565b5b6040516001830192906001600160a01b038916906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a4808214156136f1575b50600055612d30565b82805461374b90613d92565b90600052602060002090601f01602090048101928261376d57600085556137b3565b82601f1061378657805160ff19168380011785556137b3565b828001600101855582156137b3579182015b828111156137b3578251825591602001919060010190613798565b506137bf9291506137c3565b5090565b5b808211156137bf57600081556001016137c4565b7fffffffff00000000000000000000000000000000000000000000000000000000811681146126e757600080fd5b60006020828403121561381857600080fd5b8135613823816137d8565b9392505050565b80356001600160a01b038116811461384157600080fd5b919050565b803561ffff8116811461384157600080fd5b6000806040838503121561386b57600080fd5b6138748361382a565b915061388260208401613846565b90509250929050565b60005b838110156138a657818101518382015260200161388e565b8381111561230a5750506000910152565b600081518084526138cf81602086016020860161388b565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b60208152600061382360208301846138b7565b60006020828403121561392657600080fd5b5035919050565b6000806040838503121561394057600080fd5b6139498361382a565b946020939093013593505050565b60006020828403121561396957600080fd5b6138238261382a565b803563ffffffff8116811461384157600080fd5b600080600080600060a0868803121561399e57600080fd5b6139a786613972565b94506139b560208701613972565b93506139c360408701613972565b92506139d160608701613972565b91506139df60808701613972565b90509295509295909350565b600080600080600060a08688031215613a0357600080fd5b613a0c86613846565b9450613a1a60208701613972565b93506040860135925060608601359150608086013560ff81168114613a3e57600080fd5b809150509295509295909350565b600080600060608486031215613a6157600080fd5b613a6a8461382a565b9250613a786020850161382a565b9150604084013590509250925092565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b63ffffffff8481168252831660208201526060810160068310613b03577f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b826040830152949350505050565b600060208284031215613b2357600080fd5b81356006811061382357600080fd5b600060208284031215613b4457600080fd5b61382382613846565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600067ffffffffffffffff80841115613b9757613b97613b4d565b604051601f85017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f01168101908282118183101715613bdd57613bdd613b4d565b81604052809350858152868686011115613bf657600080fd5b858560208301376000602087830101525050509392505050565b600060208284031215613c2257600080fd5b813567ffffffffffffffff811115613c3957600080fd5b8201601f81018413613c4a57600080fd5b612ee584823560208401613b7c565b60008060408385031215613c6c57600080fd5b613c758361382a565b915060208301358015158114613c8a57600080fd5b809150509250929050565b60008060008060808587031215613cab57600080fd5b613cb48561382a565b9350613cc26020860161382a565b925060408501359150606085013567ffffffffffffffff811115613ce557600080fd5b8501601f81018713613cf657600080fd5b613d0587823560208401613b7c565b91505092959194509250565b60008060408385031215613d2457600080fd5b613d2d8361382a565b91506138826020840161382a565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600063ffffffff808316818516808303821115613d8957613d89613d3b565b01949350505050565b600181811c90821680613da657607f821691505b60208210811415613de0577f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b600063ffffffff80841680613e2c57613e2c613de6565b92169190910692915050565b600063ffffffff83811690831681811015613e5557613e55613d3b565b039392505050565b600063ffffffff80841680613e7457613e74613de6565b92169190910492915050565b60008219821115613e9357613e93613d3b565b500190565b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615613ed057613ed0613d3b565b500290565b60008351613ee781846020880161388b565b835190830190613efb81836020880161388b565b7f2e6a736f6e0000000000000000000000000000000000000000000000000000009101908152600501949350505050565b600082821015613f3e57613f3e613d3b565b500390565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415613fa457613fa4613d3b565b5060010190565b600063ffffffff80831681851681830481118215151615613fce57613fce613d3b565b02949350505050565b600060ff821660ff84168160ff0481118215151615613ff857613ff8613d3b565b029392505050565b60006001600160a01b038087168352808616602084015250836040830152608060608301526134c960808301846138b7565b60006020828403121561404457600080fd5b8151613823816137d8565b60008261405e5761405e613de6565b500490565b60008261407257614072613de6565b500690565b600061ffff808316818516808303821115613d8957613d89613d3b56fea264697066735822122097afadc295168ad136109aae52123b82d4ae1e73b235bbd44d8c4f7ca5f1d1e964736f6c634300080b003368747470733a2f2f6173736574732e796f75746f7069612e73706163652f6d657461646174612f706c616365686f6c6465722f6a736f6e2f00000000000000000000000000000000000000000000000003782dace9d9000000000000000000000000000000000000000000000000000002c68af0bb140000000000000000000000000000000000000000000000000000000000000000138800000000000000000000000000000000000000000000000000000000000008fc00000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000005000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000c1355ad0913006f24132beca1fb540a5b09fdcce

Deployed Bytecode

0x6080604052600436106103135760003560e01c80636352211e1161019a578063b88d4fde116100e1578063e985e9c51161008a578063f8da7b6211610064578063f8da7b6214610a5c578063fd243da314610a90578063fd5f644e14610ac457600080fd5b8063e985e9c5146109d3578063e9f4028614610a1c578063f2fde38b14610a3c57600080fd5b8063d04b1a91116100bb578063d04b1a91146108e2578063d4a676231461099e578063e8083863146109b357600080fd5b8063b88d4fde1461086e578063c87b56dd1461088e578063ccd5f6a2146108ae57600080fd5b80638f7e39ee11610143578063a174e8031161011d578063a174e803146107fa578063a22cb4651461081a578063b551e3661461083a57600080fd5b80638f7e39ee1461077d57806395d89b41146107b157806399afa9d0146107c657600080fd5b8063750521f511610174578063750521f51461072c5780638da5cb5b1461074c5780638de1ce5e1461076a57600080fd5b80636352211e146106d757806370a08231146106f7578063715018a61461071757600080fd5b806323b872dd1161025e5780633ccfd60b116102075780635ae0f276116101e15780635ae0f2761461067c5780635f5676781461068f5780635fedbc53146106a457600080fd5b80633ccfd60b1461062757806342842e0e1461063c5780635a67de071461065c57600080fd5b80632c19b7f3116102385780632c19b7f3146105b25780632e44086e146105c75780632ed42bf7146105dd57600080fd5b806323b872dd146105125780632712b2e5146105325780632ac98c311461057e57600080fd5b80630e26bac5116102c0578063113990b81161029a578063113990b81461049757806318160ddd146104b057806322f4596f146104c957600080fd5b80630e26bac51461042b57806310b9ddbd1461046457806310d554f91461048457600080fd5b806306fdde03116102f157806306fdde03146103b1578063081812fc146103d3578063095ea7b31461040b57600080fd5b806301ffc9a714610318578063039b126c1461034d5780630559c2dc1461036f575b600080fd5b34801561032457600080fd5b50610338610333366004613806565b610ad9565b60405190151581526020015b60405180910390f35b34801561035957600080fd5b5061036d610368366004613858565b610bbe565b005b34801561037b57600080fd5b506103a37f00000000000000000000000000000000000000000000000002c68af0bb14000081565b604051908152602001610344565b3480156103bd57600080fd5b506103c6610cef565b6040516103449190613901565b3480156103df57600080fd5b506103f36103ee366004613914565b610d81565b6040516001600160a01b039091168152602001610344565b34801561041757600080fd5b5061036d61042636600461392d565b610dde565b34801561043757600080fd5b5061044b610446366004613957565b610e9e565b60405167ffffffffffffffff9091168152602001610344565b34801561047057600080fd5b5061036d61047f366004613986565b610ee2565b61036d6104923660046139eb565b611219565b3480156104a357600080fd5b506103a364174876e80081565b3480156104bc57600080fd5b50600154600054036103a3565b3480156104d557600080fd5b506104fd7f000000000000000000000000000000000000000000000000000000000000138881565b60405163ffffffff9091168152602001610344565b34801561051e57600080fd5b5061036d61052d366004613a4c565b61158f565b34801561053e57600080fd5b5061055261054d366004613914565b61159a565b604080516001600160a01b03909416845263ffffffff9283166020850152911690820152606001610344565b34801561058a57600080fd5b506104fd7f000000000000000000000000000000000000000000000000000000000000000581565b3480156105be57600080fd5b506000546103a3565b3480156105d357600080fd5b506103a3600c5481565b3480156105e957600080fd5b50600a546106189063ffffffff8082169164010000000081049091169068010000000000000000900460ff1683565b60405161034493929190613ab7565b34801561063357600080fd5b5061036d611607565b34801561064857600080fd5b5061036d610657366004613a4c565b6116d3565b34801561066857600080fd5b5061036d610677366004613b11565b6116ee565b61036d61068a366004613b32565b611795565b34801561069b57600080fd5b506103a3611cde565b3480156106b057600080fd5b506106c46106bf366004613957565b611d8e565b60405161ffff9091168152602001610344565b3480156106e357600080fd5b506103f36106f2366004613914565b611dd8565b34801561070357600080fd5b506103a3610712366004613957565b611dea565b34801561072357600080fd5b5061036d611e52565b34801561073857600080fd5b5061036d610747366004613c10565b611eb6565b34801561075857600080fd5b506008546001600160a01b03166103f3565b61036d610778366004613b32565b611f23565b34801561078957600080fd5b506104fd7f00000000000000000000000000000000000000000000000000000000000008fc81565b3480156107bd57600080fd5b506103c6612180565b3480156107d257600080fd5b506104fd7f000000000000000000000000000000000000000000000000000000000000000a81565b34801561080657600080fd5b506106c4610815366004613957565b61218f565b34801561082657600080fd5b5061036d610835366004613c59565b6121d9565b34801561084657600080fd5b506103a37f00000000000000000000000000000000000000000000000003782dace9d9000081565b34801561087a57600080fd5b5061036d610889366004613c95565b6122a6565b34801561089a57600080fd5b506103c66108a9366004613914565b612310565b3480156108ba57600080fd5b506104fd7f000000000000000000000000000000000000000000000000000000000000138781565b3480156108ee57600080fd5b50600b5461095f9063ffffffff8082169164010000000081048216916801000000000000000082048116916c01000000000000000000000000810482169170010000000000000000000000000000000082048116917401000000000000000000000000000000000000000090041686565b6040805163ffffffff978816815295871660208701529386169385019390935290841660608401528316608083015290911660a082015260c001610344565b3480156109aa57600080fd5b506103c6612412565b3480156109bf57600080fd5b5061036d6109ce366004613914565b6124a0565b3480156109df57600080fd5b506103386109ee366004613d11565b6001600160a01b03918216600090815260076020908152604080832093909416825291909152205460ff1690565b348015610a2857600080fd5b506106c4610a37366004613957565b6126ea565b348015610a4857600080fd5b5061036d610a57366004613957565b612734565b348015610a6857600080fd5b506104fd7f000000000000000000000000000000000000000000000000000000000000000181565b348015610a9c57600080fd5b506103f37f000000000000000000000000c1355ad0913006f24132beca1fb540a5b09fdcce81565b348015610ad057600080fd5b506009546103a3565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f80ac58cd000000000000000000000000000000000000000000000000000000001480610b6c57507fffffffff0000000000000000000000000000000000000000000000000000000082167f5b5e139f00000000000000000000000000000000000000000000000000000000145b80610bb857507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316145b92915050565b6008546001600160a01b03163314610c1d5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064015b60405180910390fd5b600a805461ffff83169190600490610c44908490640100000000900463ffffffff16613d6a565b92506101000a81548163ffffffff021916908363ffffffff1602179055507f000000000000000000000000000000000000000000000000000000000000000163ffffffff16600a60000160049054906101000a900463ffffffff1663ffffffff161115610cdd576040517feefe8d1600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610ceb828261ffff16612813565b5050565b606060028054610cfe90613d92565b80601f0160208091040260200160405190810160405280929190818152602001828054610d2a90613d92565b8015610d775780601f10610d4c57610100808354040283529160200191610d77565b820191906000526020600020905b815481529060010190602001808311610d5a57829003601f168201915b5050505050905090565b6000610d8c8261282d565b610dc2576040517fcf4700e400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b506000908152600660205260409020546001600160a01b031690565b6000610de982611dd8565b9050806001600160a01b0316836001600160a01b03161415610e37576040517f943f7b8c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b336001600160a01b03821614801590610e575750610e5581336109ee565b155b15610e8e576040517fcfb3b94200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610e99838383612871565b505050565b6001600160a01b0381166000908152600560205260408120547801000000000000000000000000000000000000000000000000900467ffffffffffffffff16610bb8565b6008546001600160a01b03163314610f3c5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610c14565b8363ffffffff168563ffffffff161015610f985760405162461bcd60e51b815260206004820152601660248201527f5374617274696e6720507269636520746f6f206c6f77000000000000000000006044820152606401610c14565b610fa28183613e15565b63ffffffff1615610ff55760405162461bcd60e51b815260206004820152601860248201527f4475726174696f6e202520496e74657276616c20213d203000000000000000006044820152606401610c14565b60006110018587613e38565b9050600061100f8385613e5d565b905061101b8183613e15565b63ffffffff161561106e5760405162461bcd60e51b815260206004820152601560248201527f5072696365446966662025205374657020213d203000000000000000000000006044820152606401610c14565b6040518060c001604052808863ffffffff1681526020018763ffffffff1681526020018663ffffffff1681526020018563ffffffff16815260200182846110b59190613e5d565b63ffffffff90811682529485166020918201528151600b80549284015160408501516060860151608087015160a0909701518a1674010000000000000000000000000000000000000000027fffffffffffffffff00000000ffffffffffffffffffffffffffffffffffffffff978b1670010000000000000000000000000000000002979097167fffffffffffffffff0000000000000000ffffffffffffffffffffffffffffffff918b166c01000000000000000000000000027fffffffffffffffffffffffffffffffff00000000ffffffffffffffffffffffff938c166801000000000000000002939093167fffffffffffffffffffffffffffffffff0000000000000000ffffffffffffffff948c16640100000000027fffffffffffffffffffffffffffffffffffffffffffffffff000000000000000090981696909b169590951795909517919091169790971796909617919091161717909255505050505050565b604080517f8c71ef8ea783f9c32d98972bf6438ab01768ab8333d95686d34941dc468640676020820152339181019190915263ffffffff85166060820152849084908490849060009060800160405160208183030381529060405280519060200120905060006112e18261128b6128e5565b604080517f19010000000000000000000000000000000000000000000000000000000000006020808301919091526022820193909352604280820194909452815180820390940184526062019052815191012090565b6040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c810191909152605c0160405160208183030381529060405280519060200120905061133f6008546001600160a01b031690565b6001600160a01b031660018285888860405160008152602001604052604051611384949392919093845260ff9290921660208401526040830152606082015260800190565b6020604051602081039080840390855afa1580156113a6573d6000803e3d6000fd5b505050602060405103516001600160a01b0316146113f0576040517f3f88fec700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61ffff8b168061142c576040517fbbe716d400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600a5461144a9060029068010000000000000000900460ff16612a0c565b7f000000000000000000000000000000000000000000000000000000000000138763ffffffff168c61ffff1661147f60005490565b6114899190613e80565b11156114c1576040517f57bb669800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8a63ffffffff166114d18d612a67565b61ffff16111561150d576040517ff5e1c78600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b3461153c61ffff8e167f00000000000000000000000000000000000000000000000002c68af0bb140000613e98565b14611573576040517f9cb10c3c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b611581338d61ffff16612813565b505050505050505050505050565b610e99838383612a74565b600981815481106115aa57600080fd5b6000918252602090912001546001600160a01b038116915063ffffffff740100000000000000000000000000000000000000008204811691780100000000000000000000000000000000000000000000000090041683565b905090565b6008546001600160a01b031633146116615760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610c14565b600954600c541461169e576040517f912d7e9400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6116d16001600160a01b037f000000000000000000000000c1355ad0913006f24132beca1fb540a5b09fdcce1647612d37565b565b610e99838383604051806020016040528060008152506122a6565b6008546001600160a01b031633146117485760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610c14565b600a80548291907fffffffffffffffffffffffffffffffffffffffffffffff00ffffffffffffffff166801000000000000000083600581111561178d5761178d613a88565b021790555050565b3233146117ce576040517fbfd0f3c400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61ffff81168061180a576040517fbbe716d400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60408051606081018252600a805463ffffffff8082168452640100000000820416602084015260009383019068010000000000000000900460ff16600581111561185657611856613a88565b600581111561186757611867613a88565b9052506040805160c081018252600b5463ffffffff80821683526401000000008204811660208401526801000000000000000082048116838501526c01000000000000000000000000820481166060840152700100000000000000000000000000000000820481166080840152740100000000000000000000000000000000000000009091041660a08201529082015191925090600581111561190c5761190c613a88565b60011415806119235750604081015163ffffffff16155b806119375750806040015163ffffffff1642105b1561196e576040517f1e3177ee00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8361ffff16826000018181516119849190613d6a565b63ffffffff90811690915283517f00000000000000000000000000000000000000000000000000000000000008fc82169116111590506119f0576040517f57bb669800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b7f000000000000000000000000000000000000000000000000000000000000000563ffffffff168461ffff161115611a54576040517f552d9c8300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b7f000000000000000000000000000000000000000000000000000000000000000a63ffffffff16611a8485612e50565b61ffff161115611ac0576040517f171b8e9400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000611acb82612e5d565b9050600061ffff8616611ae964174876e80063ffffffff8516613e98565b611af39190613e98565b905080341015611b2f576040517f9cb10c3c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8351600a8054602087015163ffffffff908116640100000000027fffffffffffffffffffffffffffffffffffffffffffffffff000000000000000090921693169290921791909117808255604086015186929182907fffffffffffffffffffffffffffffffffffffffffffffff00ffffffffffffffff1668010000000000000000836005811115611bc257611bc2613a88565b021790555050604080516060810182523380825263ffffffff8087166020840190815261ffff8c169484018581526009805460018101825560009190915294517f6e1540171b6c0c960b71a7020d9f60077f6af931a8bbf590da0223dacf75c7af90950180549251915184167801000000000000000000000000000000000000000000000000027fffffffff00000000ffffffffffffffffffffffffffffffffffffffffffffffff9290941674010000000000000000000000000000000000000000027fffffffffffffffff0000000000000000000000000000000000000000000000009093166001600160a01b039690961695909517919091171617909155611ccd925090612813565b611cd681612eed565b505050505050565b6040805160c081018252600b5463ffffffff80821683526401000000008204811660208401526801000000000000000082048116938301939093526c0100000000000000000000000081048316606083015270010000000000000000000000000000000081048316608083015274010000000000000000000000000000000000000000900490911660a082015260009064174876e80090611d7e90612e5d565b63ffffffff166116029190613e98565b6001600160a01b038116600090815260056020526040812054610bb8907801000000000000000000000000000000000000000000000000900467ffffffffffffffff166001612f09565b6000611de382612f32565b5192915050565b60006001600160a01b038216611e2c576040517f8f4eb60400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b506001600160a01b031660009081526005602052604090205467ffffffffffffffff1690565b6008546001600160a01b03163314611eac5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610c14565b6116d160006130d9565b6008546001600160a01b03163314611f105760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610c14565b8051610ceb90600d90602084019061373f565b323314611f5c576040517fbfd0f3c400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61ffff811680611f98576040517fbbe716d400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600a54611fb69060039068010000000000000000900460ff16612a0c565b7f000000000000000000000000000000000000000000000000000000000000138763ffffffff168261ffff16611feb60005490565b611ff59190613e80565b111561202d576040517f57bb669800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b7f000000000000000000000000000000000000000000000000000000000000000563ffffffff168261ffff161115612091576040517f552d9c8300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b7f000000000000000000000000000000000000000000000000000000000000000a63ffffffff166120c183613143565b61ffff1611156120fd576040517f171b8e9400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600061212d61ffff84167f00000000000000000000000000000000000000000000000003782dace9d90000613e98565b905080341015612169576040517f9cb10c3c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b612177338461ffff16612813565b610e9981612eed565b606060038054610cfe90613d92565b6001600160a01b038116600090815260056020526040812054610bb8907801000000000000000000000000000000000000000000000000900467ffffffffffffffff166002612f09565b6001600160a01b03821633141561221c576040517fb06307db00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b3360008181526007602090815260408083206001600160a01b0387168085529083529281902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b6122b1848484612a74565b6001600160a01b0383163b151580156122d357506122d184848484613150565b155b1561230a576040517fd1a57ed600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b50505050565b606061231b8261282d565b612351576040517fa14c4b5000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000600d805461236090613d92565b80601f016020809104026020016040519081016040528092919081815260200182805461238c90613d92565b80156123d95780601f106123ae576101008083540402835291602001916123d9565b820191906000526020600020905b8154815290600101906020018083116123bc57829003601f168201915b50505050509050806123ea846132b9565b6040516020016123fb929190613ed5565b604051602081830303815290604052915050919050565b600d805461241f90613d92565b80601f016020809104026020016040519081016040528092919081815260200182805461244b90613d92565b80156124985780601f1061246d57610100808354040283529160200191612498565b820191906000526020600020905b81548152906001019060200180831161247b57829003601f168201915b505050505081565b6008546001600160a01b031633146124fa5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610c14565b6001600a5468010000000000000000900460ff16600581111561251f5761251f613a88565b1415612557576040517f912d7e9400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6009546125615750565b600c5460098054906000908190612579600185613f2c565b8154811061258957612589613f43565b60009182526020909120015474010000000000000000000000000000000000000000900463ffffffff1690505b84821080156125cd5750826125cb8584613e80565b105b156126cb57600060096125e08685613e80565b815481106125f0576125f0613f43565b600091825260208083206040805160608101825293909101546001600160a01b038116845263ffffffff74010000000000000000000000000000000000000000820481169385018490527801000000000000000000000000000000000000000000000000909104169083015290925061266a908490613e38565b905063ffffffff8116156126b8576126b8826040015163ffffffff1664174876e8008363ffffffff1661269d9190613e98565b6126a79190613e98565b83516001600160a01b031690612d37565b5050816126c490613f72565b91506125b6565b81600c60008282546126dd9190613e80565b9091555050505050505b50565b6001600160a01b038116600090815260056020526040812054610bb8907801000000000000000000000000000000000000000000000000900467ffffffffffffffff166000612f09565b6008546001600160a01b0316331461278e5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610c14565b6001600160a01b03811661280a5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152608401610c14565b6126e7816130d9565b610ceb8282604051806020016040528060008152506133eb565b6000805482108015610bb85750506000908152600460205260409020547c0100000000000000000000000000000000000000000000000000000000900460ff161590565b60008281526006602052604080822080547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0387811691821790925591518593918516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591a4505050565b6000306001600160a01b037f0000000000000000000000008813d469e11d169b4bb06af865460a1acceffb351614801561293e57507f000000000000000000000000000000000000000000000000000000000000000146145b1561296857507fea7f6e6cfa69efc3250048cd2d158d0ea756fa88dc3f80ceef04e8e3ae307c7090565b50604080517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f6020808301919091527f286774aaad019f4db14b4de7b34a74e6adc32e42b85cf0e2ab8f823b28c076ed828401527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc660608301524660808301523060a0808401919091528351808403909101815260c0909201909252805191012090565b806005811115612a1e57612a1e613a88565b826005811115612a3057612a30613a88565b14610ceb576040517f1e3177ee00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000610bb86000836133f8565b6000612a7f82612f32565b9050836001600160a01b031681600001516001600160a01b031614612ad0576040517fa114810000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000336001600160a01b0386161480612aee5750612aee85336109ee565b80612b09575033612afe84610d81565b6001600160a01b0316145b905080612b42576040517f59c896be00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b038416612b82576040517fea553b3400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b612b8e60008487612871565b6001600160a01b03858116600090815260056020908152604080832080547fffffffffffffffffffffffffffffffffffffffffffffffff000000000000000080821667ffffffffffffffff9283167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff01831617909255898616808652838620805493841693831660019081018416949094179055898652600490945282852080547fffffffff00000000000000000000000000000000000000000000000000000000169094177401000000000000000000000000000000000000000042909216919091021783558701808452922080549193909116612ceb576000548214612ceb578054602086015167ffffffffffffffff1674010000000000000000000000000000000000000000027fffffffff000000000000000000000000000000000000000000000000000000009091166001600160a01b038a16171781555b50505082846001600160a01b0316866001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a45b5050505050565b80471015612d875760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e63650000006044820152606401610c14565b6000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114612dd4576040519150601f19603f3d011682016040523d82523d6000602084013e612dd9565b606091505b5050905080610e995760405162461bcd60e51b815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c207260448201527f6563697069656e74206d617920686176652072657665727465640000000000006064820152608401610c14565b6000610bb86001836133f8565b600080826040015163ffffffff16421015612e7a57508151610bb8565b82606001518360400151612e8e9190613d6a565b63ffffffff16421115612ea657506020820151610bb8565b60008360a00151846040015142612ebd9190613e38565b612ec79190613e5d565b9050836080015181612ed99190613fab565b8451612ee59190613e38565b949350505050565b803411156126e7576126e7612f028234613f2c565b3390612d37565b6000612f16826010613fd7565b60ff168367ffffffffffffffff16901c61ffff16905092915050565b6040805160608101825260008082526020820181905291810191909152816000548110156130a757600081815260046020908152604091829020825160608101845290546001600160a01b038116825274010000000000000000000000000000000000000000810467ffffffffffffffff16928201929092527c010000000000000000000000000000000000000000000000000000000090910460ff161515918101829052906130a55780516001600160a01b031615612ff3579392505050565b507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff01600081815260046020908152604091829020825160608101845290546001600160a01b03811680835274010000000000000000000000000000000000000000820467ffffffffffffffff16938301939093527c0100000000000000000000000000000000000000000000000000000000900460ff16151592810192909252156130a0579392505050565b612ff3565b505b6040517fdf2d9b4200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600880546001600160a01b038381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6000610bb86002836133f8565b6040517f150b7a020000000000000000000000000000000000000000000000000000000081526000906001600160a01b0385169063150b7a029061319e903390899088908890600401614000565b6020604051808303816000875af19250505080156131f7575060408051601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01682019092526131f491810190614032565b60015b61326b573d808015613225576040519150601f19603f3d011682016040523d82523d6000602084013e61322a565b606091505b508051613263576040517fd1a57ed600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b805181602001fd5b7fffffffff00000000000000000000000000000000000000000000000000000000167f150b7a0200000000000000000000000000000000000000000000000000000000149050949350505050565b6060816132f957505060408051808201909152600181527f3000000000000000000000000000000000000000000000000000000000000000602082015290565b8160005b8115613323578061330d81613f72565b915061331c9050600a8361404f565b91506132fd565b60008167ffffffffffffffff81111561333e5761333e613b4d565b6040519080825280601f01601f191660200182016040528015613368576020820181803683370190505b5090505b8415612ee55761337d600183613f2c565b915061338a600a86614063565b613395906030613e80565b60f81b8183815181106133aa576133aa613f43565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053506133e4600a8661404f565b945061336c565b610e9983838360016134d3565b600080613406846010613fd7565b3360009081526005602052604081205460ff92909216925063ffffffff831b19917801000000000000000000000000000000000000000000000000900467ffffffffffffffff1690856134598389612f09565b6134639190614077565b336000908152600560205260409020805477ffffffffffffffffffffffffffffffffffffffffffffffff16780100000000000000000000000000000000000000000000000061ffff841667ffffffffffffffff8981169190911b88881617160217905590505b9695505050505050565b6000546001600160a01b038516613516576040517f2e07630000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8361354d576040517fb562e8dd00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b038516600081815260056020908152604080832080547fffffffffffffffffffffffffffffffff00000000000000000000000000000000811667ffffffffffffffff8083168c018116918217680100000000000000007fffffffffffffffffffffffffffffffffffffffffffffffff000000000000000090941690921783900481168c01811690920217909155858452600490925290912080547fffffffff00000000000000000000000000000000000000000000000000000000169092177401000000000000000000000000000000000000000042909216919091021790558080850183801561364e57506001600160a01b0387163b15155b156136f0575b60405182906001600160a01b038916906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a461369f6000888480600101955088613150565b6136d5576040517fd1a57ed600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b808214156136545782600054146136eb57600080fd5b613736565b5b6040516001830192906001600160a01b038916906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a4808214156136f1575b50600055612d30565b82805461374b90613d92565b90600052602060002090601f01602090048101928261376d57600085556137b3565b82601f1061378657805160ff19168380011785556137b3565b828001600101855582156137b3579182015b828111156137b3578251825591602001919060010190613798565b506137bf9291506137c3565b5090565b5b808211156137bf57600081556001016137c4565b7fffffffff00000000000000000000000000000000000000000000000000000000811681146126e757600080fd5b60006020828403121561381857600080fd5b8135613823816137d8565b9392505050565b80356001600160a01b038116811461384157600080fd5b919050565b803561ffff8116811461384157600080fd5b6000806040838503121561386b57600080fd5b6138748361382a565b915061388260208401613846565b90509250929050565b60005b838110156138a657818101518382015260200161388e565b8381111561230a5750506000910152565b600081518084526138cf81602086016020860161388b565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b60208152600061382360208301846138b7565b60006020828403121561392657600080fd5b5035919050565b6000806040838503121561394057600080fd5b6139498361382a565b946020939093013593505050565b60006020828403121561396957600080fd5b6138238261382a565b803563ffffffff8116811461384157600080fd5b600080600080600060a0868803121561399e57600080fd5b6139a786613972565b94506139b560208701613972565b93506139c360408701613972565b92506139d160608701613972565b91506139df60808701613972565b90509295509295909350565b600080600080600060a08688031215613a0357600080fd5b613a0c86613846565b9450613a1a60208701613972565b93506040860135925060608601359150608086013560ff81168114613a3e57600080fd5b809150509295509295909350565b600080600060608486031215613a6157600080fd5b613a6a8461382a565b9250613a786020850161382a565b9150604084013590509250925092565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b63ffffffff8481168252831660208201526060810160068310613b03577f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b826040830152949350505050565b600060208284031215613b2357600080fd5b81356006811061382357600080fd5b600060208284031215613b4457600080fd5b61382382613846565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600067ffffffffffffffff80841115613b9757613b97613b4d565b604051601f85017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f01168101908282118183101715613bdd57613bdd613b4d565b81604052809350858152868686011115613bf657600080fd5b858560208301376000602087830101525050509392505050565b600060208284031215613c2257600080fd5b813567ffffffffffffffff811115613c3957600080fd5b8201601f81018413613c4a57600080fd5b612ee584823560208401613b7c565b60008060408385031215613c6c57600080fd5b613c758361382a565b915060208301358015158114613c8a57600080fd5b809150509250929050565b60008060008060808587031215613cab57600080fd5b613cb48561382a565b9350613cc26020860161382a565b925060408501359150606085013567ffffffffffffffff811115613ce557600080fd5b8501601f81018713613cf657600080fd5b613d0587823560208401613b7c565b91505092959194509250565b60008060408385031215613d2457600080fd5b613d2d8361382a565b91506138826020840161382a565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600063ffffffff808316818516808303821115613d8957613d89613d3b565b01949350505050565b600181811c90821680613da657607f821691505b60208210811415613de0577f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b600063ffffffff80841680613e2c57613e2c613de6565b92169190910692915050565b600063ffffffff83811690831681811015613e5557613e55613d3b565b039392505050565b600063ffffffff80841680613e7457613e74613de6565b92169190910492915050565b60008219821115613e9357613e93613d3b565b500190565b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615613ed057613ed0613d3b565b500290565b60008351613ee781846020880161388b565b835190830190613efb81836020880161388b565b7f2e6a736f6e0000000000000000000000000000000000000000000000000000009101908152600501949350505050565b600082821015613f3e57613f3e613d3b565b500390565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415613fa457613fa4613d3b565b5060010190565b600063ffffffff80831681851681830481118215151615613fce57613fce613d3b565b02949350505050565b600060ff821660ff84168160ff0481118215151615613ff857613ff8613d3b565b029392505050565b60006001600160a01b038087168352808616602084015250836040830152608060608301526134c960808301846138b7565b60006020828403121561404457600080fd5b8151613823816137d8565b60008261405e5761405e613de6565b500490565b60008261407257614072613de6565b500690565b600061ffff808316818516808303821115613d8957613d89613d3b56fea264697066735822122097afadc295168ad136109aae52123b82d4ae1e73b235bbd44d8c4f7ca5f1d1e964736f6c634300080b0033

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

00000000000000000000000000000000000000000000000003782dace9d9000000000000000000000000000000000000000000000000000002c68af0bb140000000000000000000000000000000000000000000000000000000000000000138800000000000000000000000000000000000000000000000000000000000008fc00000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000005000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000c1355ad0913006f24132beca1fb540a5b09fdcce

-----Decoded View---------------
Arg [0] : publicMintPrice (uint256): 250000000000000000
Arg [1] : allowlistPrice (uint256): 200000000000000000
Arg [2] : maxSupply (uint32): 5000
Arg [3] : auctionSupply (uint32): 2300
Arg [4] : reservedSupply (uint32): 1
Arg [5] : mintTxLimit (uint32): 5
Arg [6] : mintWalletLimit (uint32): 10
Arg [7] : vault (address): 0xc1355AD0913006f24132beCA1fb540a5b09FDcce

-----Encoded View---------------
8 Constructor Arguments found :
Arg [0] : 00000000000000000000000000000000000000000000000003782dace9d90000
Arg [1] : 00000000000000000000000000000000000000000000000002c68af0bb140000
Arg [2] : 0000000000000000000000000000000000000000000000000000000000001388
Arg [3] : 00000000000000000000000000000000000000000000000000000000000008fc
Arg [4] : 0000000000000000000000000000000000000000000000000000000000000001
Arg [5] : 0000000000000000000000000000000000000000000000000000000000000005
Arg [6] : 000000000000000000000000000000000000000000000000000000000000000a
Arg [7] : 000000000000000000000000c1355ad0913006f24132beca1fb540a5b09fdcce


Loading...
Loading
Loading...
Loading
[ 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.