false
false
0
The new Blockscout UI is now open source! Learn how to deploy it here

Contract Address Details

0x1c77A475dBB977747bF3262c933a7865cf160091

Contract Name
ApetimismLaunchpadNFT
Creator
0x17eafd–d03516 at 0x287197–1fe3f7
Balance
0 ETH
Tokens
Fetching tokens...
Transactions
0 Transactions
Transfers
0 Transfers
Gas Used
Fetching gas used...
Last Balance Update
5123788
Warning! Contract bytecode has been changed and doesn't match the verified one. Therefore, interaction with this smart contract may be risky.
Contract name:
ApetimismLaunchpadNFT




Optimization enabled
true
Compiler version
v0.8.9+commit.e5eed63a




Optimization runs
160
EVM Version
default




Verified at
2023-10-31T23:50:32.258538Z

Contract source code

// Sources flattened with hardhat v2.9.9 https://hardhat.org

// File @openzeppelin/contracts/utils/[email protected]

// 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 @openzeppelin/contracts/access/[email protected]

// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)

pragma solidity ^0.8.0;

/**
 * @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 Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        _checkOwner();
        _;
    }

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

    /**
     * @dev Throws if the sender is not the owner.
     */
    function _checkOwner() internal view virtual {
        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 @openzeppelin/contracts/security/[email protected]

// OpenZeppelin Contracts (last updated v4.8.0) (security/ReentrancyGuard.sol)

pragma solidity ^0.8.0;

/**
 * @dev Contract module that helps prevent reentrant calls to a function.
 *
 * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
 * available, which can be applied to functions to make sure there are no nested
 * (reentrant) calls to them.
 *
 * Note that because there is a single `nonReentrant` guard, functions marked as
 * `nonReentrant` may not call one another. This can be worked around by making
 * those functions `private`, and then adding `external` `nonReentrant` entry
 * points to them.
 *
 * TIP: If you would like to learn more about reentrancy and alternative ways
 * to protect against it, check out our blog post
 * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
 */
abstract contract ReentrancyGuard {
    // Booleans are more expensive than uint256 or any type that takes up a full
    // word because each write operation emits an extra SLOAD to first read the
    // slot's contents, replace the bits taken up by the boolean, and then write
    // back. This is the compiler's defense against contract upgrades and
    // pointer aliasing, and it cannot be disabled.

    // The values being non-zero value makes deployment a bit more expensive,
    // but in exchange the refund on every call to nonReentrant will be lower in
    // amount. Since refunds are capped to a percentage of the total
    // transaction's gas, it is best to keep them low in cases like this one, to
    // increase the likelihood of the full refund coming into effect.
    uint256 private constant _NOT_ENTERED = 1;
    uint256 private constant _ENTERED = 2;

    uint256 private _status;

    constructor() {
        _status = _NOT_ENTERED;
    }

    /**
     * @dev Prevents a contract from calling itself, directly or indirectly.
     * Calling a `nonReentrant` function from another `nonReentrant`
     * function is not supported. It is possible to prevent this from happening
     * by making the `nonReentrant` function external, and making it call a
     * `private` function that does the actual work.
     */
    modifier nonReentrant() {
        _nonReentrantBefore();
        _;
        _nonReentrantAfter();
    }

    function _nonReentrantBefore() private {
        // On the first call to nonReentrant, _status will be _NOT_ENTERED
        require(_status != _ENTERED, "ReentrancyGuard: reentrant call");

        // Any calls to nonReentrant after this point will fail
        _status = _ENTERED;
    }

    function _nonReentrantAfter() private {
        // By storing the original value once again, a refund is triggered (see
        // https://eips.ethereum.org/EIPS/eip-2200)
        _status = _NOT_ENTERED;
    }
}


// File @openzeppelin/contracts/utils/math/[email protected]

// OpenZeppelin Contracts (last updated v4.8.0) (utils/math/Math.sol)

pragma solidity ^0.8.0;

/**
 * @dev Standard math utilities missing in the Solidity language.
 */
library Math {
    enum Rounding {
        Down, // Toward negative infinity
        Up, // Toward infinity
        Zero // Toward zero
    }

    /**
     * @dev Returns the largest of two numbers.
     */
    function max(uint256 a, uint256 b) internal pure returns (uint256) {
        return a > b ? a : b;
    }

    /**
     * @dev Returns the smallest of two numbers.
     */
    function min(uint256 a, uint256 b) internal pure returns (uint256) {
        return a < b ? a : b;
    }

    /**
     * @dev Returns the average of two numbers. The result is rounded towards
     * zero.
     */
    function average(uint256 a, uint256 b) internal pure returns (uint256) {
        // (a + b) / 2 can overflow.
        return (a & b) + (a ^ b) / 2;
    }

    /**
     * @dev Returns the ceiling of the division of two numbers.
     *
     * This differs from standard division with `/` in that it rounds up instead
     * of rounding down.
     */
    function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {
        // (a + b - 1) / b can overflow on addition, so we distribute.
        return a == 0 ? 0 : (a - 1) / b + 1;
    }

    /**
     * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0
     * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv)
     * with further edits by Uniswap Labs also under MIT license.
     */
    function mulDiv(
        uint256 x,
        uint256 y,
        uint256 denominator
    ) internal pure returns (uint256 result) {
        unchecked {
            // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use
            // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256
            // variables such that product = prod1 * 2^256 + prod0.
            uint256 prod0; // Least significant 256 bits of the product
            uint256 prod1; // Most significant 256 bits of the product
            assembly {
                let mm := mulmod(x, y, not(0))
                prod0 := mul(x, y)
                prod1 := sub(sub(mm, prod0), lt(mm, prod0))
            }

            // Handle non-overflow cases, 256 by 256 division.
            if (prod1 == 0) {
                return prod0 / denominator;
            }

            // Make sure the result is less than 2^256. Also prevents denominator == 0.
            require(denominator > prod1);

            ///////////////////////////////////////////////
            // 512 by 256 division.
            ///////////////////////////////////////////////

            // Make division exact by subtracting the remainder from [prod1 prod0].
            uint256 remainder;
            assembly {
                // Compute remainder using mulmod.
                remainder := mulmod(x, y, denominator)

                // Subtract 256 bit number from 512 bit number.
                prod1 := sub(prod1, gt(remainder, prod0))
                prod0 := sub(prod0, remainder)
            }

            // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1.
            // See https://cs.stackexchange.com/q/138556/92363.

            // Does not overflow because the denominator cannot be zero at this stage in the function.
            uint256 twos = denominator & (~denominator + 1);
            assembly {
                // Divide denominator by twos.
                denominator := div(denominator, twos)

                // Divide [prod1 prod0] by twos.
                prod0 := div(prod0, twos)

                // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.
                twos := add(div(sub(0, twos), twos), 1)
            }

            // Shift in bits from prod1 into prod0.
            prod0 |= prod1 * twos;

            // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such
            // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for
            // four bits. That is, denominator * inv = 1 mod 2^4.
            uint256 inverse = (3 * denominator) ^ 2;

            // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works
            // in modular arithmetic, doubling the correct bits in each step.
            inverse *= 2 - denominator * inverse; // inverse mod 2^8
            inverse *= 2 - denominator * inverse; // inverse mod 2^16
            inverse *= 2 - denominator * inverse; // inverse mod 2^32
            inverse *= 2 - denominator * inverse; // inverse mod 2^64
            inverse *= 2 - denominator * inverse; // inverse mod 2^128
            inverse *= 2 - denominator * inverse; // inverse mod 2^256

            // Because the division is now exact we can divide by multiplying with the modular inverse of denominator.
            // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is
            // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1
            // is no longer required.
            result = prod0 * inverse;
            return result;
        }
    }

    /**
     * @notice Calculates x * y / denominator with full precision, following the selected rounding direction.
     */
    function mulDiv(
        uint256 x,
        uint256 y,
        uint256 denominator,
        Rounding rounding
    ) internal pure returns (uint256) {
        uint256 result = mulDiv(x, y, denominator);
        if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) {
            result += 1;
        }
        return result;
    }

    /**
     * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down.
     *
     * Inspired by Henry S. Warren, Jr.'s "Hacker's Delight" (Chapter 11).
     */
    function sqrt(uint256 a) internal pure returns (uint256) {
        if (a == 0) {
            return 0;
        }

        // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.
        //
        // We know that the "msb" (most significant bit) of our target number `a` is a power of 2 such that we have
        // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.
        //
        // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`
        // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`
        // → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`
        //
        // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.
        uint256 result = 1 << (log2(a) >> 1);

        // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,
        // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at
        // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision
        // into the expected uint128 result.
        unchecked {
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            return min(result, a / result);
        }
    }

    /**
     * @notice Calculates sqrt(a), following the selected rounding direction.
     */
    function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = sqrt(a);
            return result + (rounding == Rounding.Up && result * result < a ? 1 : 0);
        }
    }

    /**
     * @dev Return the log in base 2, rounded down, of a positive value.
     * Returns 0 if given 0.
     */
    function log2(uint256 value) internal pure returns (uint256) {
        uint256 result = 0;
        unchecked {
            if (value >> 128 > 0) {
                value >>= 128;
                result += 128;
            }
            if (value >> 64 > 0) {
                value >>= 64;
                result += 64;
            }
            if (value >> 32 > 0) {
                value >>= 32;
                result += 32;
            }
            if (value >> 16 > 0) {
                value >>= 16;
                result += 16;
            }
            if (value >> 8 > 0) {
                value >>= 8;
                result += 8;
            }
            if (value >> 4 > 0) {
                value >>= 4;
                result += 4;
            }
            if (value >> 2 > 0) {
                value >>= 2;
                result += 2;
            }
            if (value >> 1 > 0) {
                result += 1;
            }
        }
        return result;
    }

    /**
     * @dev Return the log in base 2, following the selected rounding direction, of a positive value.
     * Returns 0 if given 0.
     */
    function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = log2(value);
            return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0);
        }
    }

    /**
     * @dev Return the log in base 10, rounded down, of a positive value.
     * Returns 0 if given 0.
     */
    function log10(uint256 value) internal pure returns (uint256) {
        uint256 result = 0;
        unchecked {
            if (value >= 10**64) {
                value /= 10**64;
                result += 64;
            }
            if (value >= 10**32) {
                value /= 10**32;
                result += 32;
            }
            if (value >= 10**16) {
                value /= 10**16;
                result += 16;
            }
            if (value >= 10**8) {
                value /= 10**8;
                result += 8;
            }
            if (value >= 10**4) {
                value /= 10**4;
                result += 4;
            }
            if (value >= 10**2) {
                value /= 10**2;
                result += 2;
            }
            if (value >= 10**1) {
                result += 1;
            }
        }
        return result;
    }

    /**
     * @dev Return the log in base 10, following the selected rounding direction, of a positive value.
     * Returns 0 if given 0.
     */
    function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = log10(value);
            return result + (rounding == Rounding.Up && 10**result < value ? 1 : 0);
        }
    }

    /**
     * @dev Return the log in base 256, rounded down, of a positive value.
     * Returns 0 if given 0.
     *
     * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.
     */
    function log256(uint256 value) internal pure returns (uint256) {
        uint256 result = 0;
        unchecked {
            if (value >> 128 > 0) {
                value >>= 128;
                result += 16;
            }
            if (value >> 64 > 0) {
                value >>= 64;
                result += 8;
            }
            if (value >> 32 > 0) {
                value >>= 32;
                result += 4;
            }
            if (value >> 16 > 0) {
                value >>= 16;
                result += 2;
            }
            if (value >> 8 > 0) {
                result += 1;
            }
        }
        return result;
    }

    /**
     * @dev Return the log in base 10, following the selected rounding direction, of a positive value.
     * Returns 0 if given 0.
     */
    function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = log256(value);
            return result + (rounding == Rounding.Up && 1 << (result * 8) < value ? 1 : 0);
        }
    }
}


// File @openzeppelin/contracts/utils/[email protected]

// OpenZeppelin Contracts (last updated v4.8.0) (utils/Strings.sol)

pragma solidity ^0.8.0;

/**
 * @dev String operations.
 */
library Strings {
    bytes16 private constant _SYMBOLS = "0123456789abcdef";
    uint8 private constant _ADDRESS_LENGTH = 20;

    /**
     * @dev Converts a `uint256` to its ASCII `string` decimal representation.
     */
    function toString(uint256 value) internal pure returns (string memory) {
        unchecked {
            uint256 length = Math.log10(value) + 1;
            string memory buffer = new string(length);
            uint256 ptr;
            /// @solidity memory-safe-assembly
            assembly {
                ptr := add(buffer, add(32, length))
            }
            while (true) {
                ptr--;
                /// @solidity memory-safe-assembly
                assembly {
                    mstore8(ptr, byte(mod(value, 10), _SYMBOLS))
                }
                value /= 10;
                if (value == 0) break;
            }
            return buffer;
        }
    }

    /**
     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.
     */
    function toHexString(uint256 value) internal pure returns (string memory) {
        unchecked {
            return toHexString(value, Math.log256(value) + 1);
        }
    }

    /**
     * @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] = _SYMBOLS[value & 0xf];
            value >>= 4;
        }
        require(value == 0, "Strings: hex length insufficient");
        return string(buffer);
    }

    /**
     * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.
     */
    function toHexString(address addr) internal pure returns (string memory) {
        return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);
    }
}


// File @openzeppelin/contracts/token/ERC20/[email protected]

// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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


// File erc721a/contracts/[email protected]

// ERC721A Contracts v4.2.3
// Creator: Chiru Labs

pragma solidity ^0.8.4;

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

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

    /**
     * Cannot query the balance for the zero address.
     */
    error BalanceQueryForZeroAddress();

    /**
     * Cannot mint to the zero address.
     */
    error MintToZeroAddress();

    /**
     * The quantity of tokens minted must be more than zero.
     */
    error MintZeroQuantity();

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

    /**
     * The caller must own the token or be an approved operator.
     */
    error TransferCallerNotOwnerNorApproved();

    /**
     * The token must be owned by `from`.
     */
    error TransferFromIncorrectOwner();

    /**
     * Cannot safely transfer to a contract that does not implement the
     * ERC721Receiver interface.
     */
    error TransferToNonERC721ReceiverImplementer();

    /**
     * Cannot transfer to the zero address.
     */
    error TransferToZeroAddress();

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

    /**
     * The `quantity` minted with ERC2309 exceeds the safety limit.
     */
    error MintERC2309QuantityExceedsLimit();

    /**
     * The `extraData` cannot be set on an unintialized ownership slot.
     */
    error OwnershipNotInitializedForExtraData();

    // =============================================================
    //                            STRUCTS
    // =============================================================

    struct TokenOwnership {
        // The address of the owner.
        address addr;
        // Stores the start time of ownership with minimal overhead for tokenomics.
        uint64 startTimestamp;
        // Whether the token has been burned.
        bool burned;
        // Arbitrary data similar to `startTimestamp` that can be set via {_extraData}.
        uint24 extraData;
    }

    // =============================================================
    //                         TOKEN COUNTERS
    // =============================================================

    /**
     * @dev Returns the total number of tokens in existence.
     * Burned tokens will reduce the count.
     * To get the total number of tokens minted, please see {_totalMinted}.
     */
    function totalSupply() external view returns (uint256);

    // =============================================================
    //                            IERC165
    // =============================================================

    /**
     * @dev Returns true if this contract implements the interface defined by
     * `interfaceId`. See the corresponding
     * [EIP section](https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified)
     * to learn more about how these ids are created.
     *
     * This function call must use less than 30000 gas.
     */
    function supportsInterface(bytes4 interfaceId) external view returns (bool);

    // =============================================================
    //                            IERC721
    // =============================================================

    /**
     * @dev Emitted when `tokenId` token is transferred from `from` to `to`.
     */
    event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);

    /**
     * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.
     */
    event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);

    /**
     * @dev Emitted when `owner` enables or disables
     * (`approved`) `operator` to manage all of its assets.
     */
    event ApprovalForAll(address indexed owner, address indexed operator, bool approved);

    /**
     * @dev Returns the number of tokens in `owner`'s account.
     */
    function balanceOf(address owner) external view returns (uint256 balance);

    /**
     * @dev Returns the owner of the `tokenId` token.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function ownerOf(uint256 tokenId) external view returns (address owner);

    /**
     * @dev Safely transfers `tokenId` token from `from` to `to`,
     * checking first that contract recipients are aware of the ERC721 protocol
     * to prevent tokens from being forever locked.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must exist and be owned by `from`.
     * - If the caller is not `from`, it must be have been allowed to move
     * this token by either {approve} or {setApprovalForAll}.
     * - If `to` refers to a smart contract, it must implement
     * {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
     *
     * Emits a {Transfer} event.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 tokenId,
        bytes calldata data
    ) external payable;

    /**
     * @dev Equivalent to `safeTransferFrom(from, to, tokenId, '')`.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 tokenId
    ) external payable;

    /**
     * @dev Transfers `tokenId` from `from` to `to`.
     *
     * WARNING: Usage of this method is discouraged, use {safeTransferFrom}
     * whenever possible.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must be owned by `from`.
     * - If the caller is not `from`, it must be approved to move this token
     * by either {approve} or {setApprovalForAll}.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(
        address from,
        address to,
        uint256 tokenId
    ) external payable;

    /**
     * @dev Gives permission to `to` to transfer `tokenId` token to another account.
     * The approval is cleared when the token is transferred.
     *
     * Only a single account can be approved at a time, so approving the
     * zero address clears previous approvals.
     *
     * Requirements:
     *
     * - The caller must own the token or be an approved operator.
     * - `tokenId` must exist.
     *
     * Emits an {Approval} event.
     */
    function approve(address to, uint256 tokenId) external payable;

    /**
     * @dev Approve or remove `operator` as an operator for the caller.
     * Operators can call {transferFrom} or {safeTransferFrom}
     * for any token owned by the caller.
     *
     * Requirements:
     *
     * - The `operator` cannot be the caller.
     *
     * Emits an {ApprovalForAll} event.
     */
    function setApprovalForAll(address operator, bool _approved) external;

    /**
     * @dev Returns the account approved for `tokenId` token.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function getApproved(uint256 tokenId) external view returns (address operator);

    /**
     * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.
     *
     * See {setApprovalForAll}.
     */
    function isApprovedForAll(address owner, address operator) external view returns (bool);

    // =============================================================
    //                        IERC721Metadata
    // =============================================================

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

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

    /**
     * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token.
     */
    function tokenURI(uint256 tokenId) external view returns (string memory);

    // =============================================================
    //                           IERC2309
    // =============================================================

    /**
     * @dev Emitted when tokens in `fromTokenId` to `toTokenId`
     * (inclusive) is transferred from `from` to `to`, as defined in the
     * [ERC2309](https://eips.ethereum.org/EIPS/eip-2309) standard.
     *
     * See {_mintERC2309} for more details.
     */
    event ConsecutiveTransfer(uint256 indexed fromTokenId, uint256 toTokenId, address indexed from, address indexed to);
}


// File erc721a/contracts/extensions/[email protected]

// ERC721A Contracts v4.2.3
// Creator: Chiru Labs

pragma solidity ^0.8.4;

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

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

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

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

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


// File erc721a/contracts/[email protected]

// ERC721A Contracts v4.2.3
// Creator: Chiru Labs

pragma solidity ^0.8.4;

/**
 * @dev Interface of ERC721 token receiver.
 */
interface ERC721A__IERC721Receiver {
    function onERC721Received(
        address operator,
        address from,
        uint256 tokenId,
        bytes calldata data
    ) external returns (bytes4);
}

/**
 * @title ERC721A
 *
 * @dev Implementation of the [ERC721](https://eips.ethereum.org/EIPS/eip-721)
 * Non-Fungible Token Standard, including the Metadata extension.
 * Optimized for lower gas during batch mints.
 *
 * Token IDs are minted in sequential order (e.g. 0, 1, 2, 3, ...)
 * starting from `_startTokenId()`.
 *
 * Assumptions:
 *
 * - An owner cannot have more than 2**64 - 1 (max value of uint64) of supply.
 * - The maximum token ID cannot exceed 2**256 - 1 (max value of uint256).
 */
contract ERC721A is IERC721A {
    // Bypass for a `--via-ir` bug (https://github.com/chiru-labs/ERC721A/pull/364).
    struct TokenApprovalRef {
        address value;
    }

    // =============================================================
    //                           CONSTANTS
    // =============================================================

    // Mask of an entry in packed address data.
    uint256 private constant _BITMASK_ADDRESS_DATA_ENTRY = (1 << 64) - 1;

    // The bit position of `numberMinted` in packed address data.
    uint256 private constant _BITPOS_NUMBER_MINTED = 64;

    // The bit position of `numberBurned` in packed address data.
    uint256 private constant _BITPOS_NUMBER_BURNED = 128;

    // The bit position of `aux` in packed address data.
    uint256 private constant _BITPOS_AUX = 192;

    // Mask of all 256 bits in packed address data except the 64 bits for `aux`.
    uint256 private constant _BITMASK_AUX_COMPLEMENT = (1 << 192) - 1;

    // The bit position of `startTimestamp` in packed ownership.
    uint256 private constant _BITPOS_START_TIMESTAMP = 160;

    // The bit mask of the `burned` bit in packed ownership.
    uint256 private constant _BITMASK_BURNED = 1 << 224;

    // The bit position of the `nextInitialized` bit in packed ownership.
    uint256 private constant _BITPOS_NEXT_INITIALIZED = 225;

    // The bit mask of the `nextInitialized` bit in packed ownership.
    uint256 private constant _BITMASK_NEXT_INITIALIZED = 1 << 225;

    // The bit position of `extraData` in packed ownership.
    uint256 private constant _BITPOS_EXTRA_DATA = 232;

    // Mask of all 256 bits in a packed ownership except the 24 bits for `extraData`.
    uint256 private constant _BITMASK_EXTRA_DATA_COMPLEMENT = (1 << 232) - 1;

    // The mask of the lower 160 bits for addresses.
    uint256 private constant _BITMASK_ADDRESS = (1 << 160) - 1;

    // The maximum `quantity` that can be minted with {_mintERC2309}.
    // This limit is to prevent overflows on the address data entries.
    // For a limit of 5000, a total of 3.689e15 calls to {_mintERC2309}
    // is required to cause an overflow, which is unrealistic.
    uint256 private constant _MAX_MINT_ERC2309_QUANTITY_LIMIT = 5000;

    // The `Transfer` event signature is given by:
    // `keccak256(bytes("Transfer(address,address,uint256)"))`.
    bytes32 private constant _TRANSFER_EVENT_SIGNATURE =
        0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef;

    // =============================================================
    //                            STORAGE
    // =============================================================

    // The next token ID to be minted.
    uint256 private _currentIndex;

    // The number of tokens burned.
    uint256 private _burnCounter;

    // Token name
    string private _name;

    // Token symbol
    string private _symbol;

    // Mapping from token ID to ownership details
    // An empty struct value does not necessarily mean the token is unowned.
    // See {_packedOwnershipOf} implementation for details.
    //
    // Bits Layout:
    // - [0..159]   `addr`
    // - [160..223] `startTimestamp`
    // - [224]      `burned`
    // - [225]      `nextInitialized`
    // - [232..255] `extraData`
    mapping(uint256 => uint256) private _packedOwnerships;

    // Mapping owner address to address data.
    //
    // Bits Layout:
    // - [0..63]    `balance`
    // - [64..127]  `numberMinted`
    // - [128..191] `numberBurned`
    // - [192..255] `aux`
    mapping(address => uint256) private _packedAddressData;

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

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

    // =============================================================
    //                          CONSTRUCTOR
    // =============================================================

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

    // =============================================================
    //                   TOKEN COUNTING OPERATIONS
    // =============================================================

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

    /**
     * @dev Returns the next token ID to be minted.
     */
    function _nextTokenId() internal view virtual returns (uint256) {
        return _currentIndex;
    }

    /**
     * @dev Returns the total number of tokens in existence.
     * Burned tokens will reduce the count.
     * To get the total number of tokens minted, please see {_totalMinted}.
     */
    function totalSupply() public view virtual override returns (uint256) {
        // Counter underflow is impossible as _burnCounter cannot be incremented
        // more than `_currentIndex - _startTokenId()` times.
        unchecked {
            return _currentIndex - _burnCounter - _startTokenId();
        }
    }

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

    /**
     * @dev Returns the total number of tokens burned.
     */
    function _totalBurned() internal view virtual returns (uint256) {
        return _burnCounter;
    }

    // =============================================================
    //                    ADDRESS DATA OPERATIONS
    // =============================================================

    /**
     * @dev Returns the number of tokens in `owner`'s account.
     */
    function balanceOf(address owner) public view virtual override returns (uint256) {
        if (owner == address(0)) revert BalanceQueryForZeroAddress();
        return _packedAddressData[owner] & _BITMASK_ADDRESS_DATA_ENTRY;
    }

    /**
     * Returns the number of tokens minted by `owner`.
     */
    function _numberMinted(address owner) internal view returns (uint256) {
        return (_packedAddressData[owner] >> _BITPOS_NUMBER_MINTED) & _BITMASK_ADDRESS_DATA_ENTRY;
    }

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

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

    /**
     * Sets the auxiliary data for `owner`. (e.g. number of whitelist mint slots used).
     * If there are multiple variables, please pack them into a uint64.
     */
    function _setAux(address owner, uint64 aux) internal virtual {
        uint256 packed = _packedAddressData[owner];
        uint256 auxCasted;
        // Cast `aux` with assembly to avoid redundant masking.
        assembly {
            auxCasted := aux
        }
        packed = (packed & _BITMASK_AUX_COMPLEMENT) | (auxCasted << _BITPOS_AUX);
        _packedAddressData[owner] = packed;
    }

    // =============================================================
    //                            IERC165
    // =============================================================

    /**
     * @dev Returns true if this contract implements the interface defined by
     * `interfaceId`. See the corresponding
     * [EIP section](https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified)
     * to learn more about how these ids are created.
     *
     * This function call must use less than 30000 gas.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
        // The interface IDs are constants representing the first 4 bytes
        // of the XOR of all function selectors in the interface.
        // See: [ERC165](https://eips.ethereum.org/EIPS/eip-165)
        // (e.g. `bytes4(i.functionA.selector ^ i.functionB.selector ^ ...)`)
        return
            interfaceId == 0x01ffc9a7 || // ERC165 interface ID for ERC165.
            interfaceId == 0x80ac58cd || // ERC165 interface ID for ERC721.
            interfaceId == 0x5b5e139f; // ERC165 interface ID for ERC721Metadata.
    }

    // =============================================================
    //                        IERC721Metadata
    // =============================================================

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

    /**
     * @dev Returns the token collection symbol.
     */
    function symbol() public view virtual override returns (string memory) {
        return _symbol;
    }

    /**
     * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token.
     */
    function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
        if (!_exists(tokenId)) revert URIQueryForNonexistentToken();

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

    /**
     * @dev Base URI for computing {tokenURI}. If set, the resulting URI for each
     * token will be the concatenation of the `baseURI` and the `tokenId`. Empty
     * by default, it can be overridden in child contracts.
     */
    function _baseURI() internal view virtual returns (string memory) {
        return '';
    }

    // =============================================================
    //                     OWNERSHIPS OPERATIONS
    // =============================================================

    /**
     * @dev Returns the owner of the `tokenId` token.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function ownerOf(uint256 tokenId) public view virtual override returns (address) {
        return address(uint160(_packedOwnershipOf(tokenId)));
    }

    /**
     * @dev Gas spent here starts off proportional to the maximum mint batch size.
     * It gradually moves to O(1) as tokens get transferred around over time.
     */
    function _ownershipOf(uint256 tokenId) internal view virtual returns (TokenOwnership memory) {
        return _unpackedOwnership(_packedOwnershipOf(tokenId));
    }

    /**
     * @dev Returns the unpacked `TokenOwnership` struct at `index`.
     */
    function _ownershipAt(uint256 index) internal view virtual returns (TokenOwnership memory) {
        return _unpackedOwnership(_packedOwnerships[index]);
    }

    /**
     * @dev Initializes the ownership slot minted at `index` for efficiency purposes.
     */
    function _initializeOwnershipAt(uint256 index) internal virtual {
        if (_packedOwnerships[index] == 0) {
            _packedOwnerships[index] = _packedOwnershipOf(index);
        }
    }

    /**
     * Returns the packed ownership data of `tokenId`.
     */
    function _packedOwnershipOf(uint256 tokenId) private view returns (uint256) {
        uint256 curr = tokenId;

        unchecked {
            if (_startTokenId() <= curr)
                if (curr < _currentIndex) {
                    uint256 packed = _packedOwnerships[curr];
                    // If not burned.
                    if (packed & _BITMASK_BURNED == 0) {
                        // Invariant:
                        // There will always be an initialized ownership slot
                        // (i.e. `ownership.addr != address(0) && ownership.burned == false`)
                        // before an unintialized ownership slot
                        // (i.e. `ownership.addr == address(0) && ownership.burned == false`)
                        // Hence, `curr` will not underflow.
                        //
                        // We can directly compare the packed value.
                        // If the address is zero, packed will be zero.
                        while (packed == 0) {
                            packed = _packedOwnerships[--curr];
                        }
                        return packed;
                    }
                }
        }
        revert OwnerQueryForNonexistentToken();
    }

    /**
     * @dev Returns the unpacked `TokenOwnership` struct from `packed`.
     */
    function _unpackedOwnership(uint256 packed) private pure returns (TokenOwnership memory ownership) {
        ownership.addr = address(uint160(packed));
        ownership.startTimestamp = uint64(packed >> _BITPOS_START_TIMESTAMP);
        ownership.burned = packed & _BITMASK_BURNED != 0;
        ownership.extraData = uint24(packed >> _BITPOS_EXTRA_DATA);
    }

    /**
     * @dev Packs ownership data into a single uint256.
     */
    function _packOwnershipData(address owner, uint256 flags) private view returns (uint256 result) {
        assembly {
            // Mask `owner` to the lower 160 bits, in case the upper bits somehow aren't clean.
            owner := and(owner, _BITMASK_ADDRESS)
            // `owner | (block.timestamp << _BITPOS_START_TIMESTAMP) | flags`.
            result := or(owner, or(shl(_BITPOS_START_TIMESTAMP, timestamp()), flags))
        }
    }

    /**
     * @dev Returns the `nextInitialized` flag set if `quantity` equals 1.
     */
    function _nextInitializedFlag(uint256 quantity) private pure returns (uint256 result) {
        // For branchless setting of the `nextInitialized` flag.
        assembly {
            // `(quantity == 1) << _BITPOS_NEXT_INITIALIZED`.
            result := shl(_BITPOS_NEXT_INITIALIZED, eq(quantity, 1))
        }
    }

    // =============================================================
    //                      APPROVAL OPERATIONS
    // =============================================================

    /**
     * @dev Gives permission to `to` to transfer `tokenId` token to another account.
     * 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) public payable virtual override {
        address owner = ownerOf(tokenId);

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

        _tokenApprovals[tokenId].value = to;
        emit Approval(owner, to, tokenId);
    }

    /**
     * @dev Returns the account approved for `tokenId` token.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function getApproved(uint256 tokenId) public view virtual override returns (address) {
        if (!_exists(tokenId)) revert ApprovalQueryForNonexistentToken();

        return _tokenApprovals[tokenId].value;
    }

    /**
     * @dev Approve or remove `operator` as an operator for the caller.
     * Operators can call {transferFrom} or {safeTransferFrom}
     * for any token owned by the caller.
     *
     * Requirements:
     *
     * - The `operator` cannot be the caller.
     *
     * Emits an {ApprovalForAll} event.
     */
    function setApprovalForAll(address operator, bool approved) public virtual override {
        _operatorApprovals[_msgSenderERC721A()][operator] = approved;
        emit ApprovalForAll(_msgSenderERC721A(), operator, approved);
    }

    /**
     * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.
     *
     * See {setApprovalForAll}.
     */
    function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) {
        return _operatorApprovals[owner][operator];
    }

    /**
     * @dev Returns whether `tokenId` exists.
     *
     * Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}.
     *
     * Tokens start existing when they are minted. See {_mint}.
     */
    function _exists(uint256 tokenId) internal view virtual returns (bool) {
        return
            _startTokenId() <= tokenId &&
            tokenId < _currentIndex && // If within bounds,
            _packedOwnerships[tokenId] & _BITMASK_BURNED == 0; // and not burned.
    }

    /**
     * @dev Returns whether `msgSender` is equal to `approvedAddress` or `owner`.
     */
    function _isSenderApprovedOrOwner(
        address approvedAddress,
        address owner,
        address msgSender
    ) private pure returns (bool result) {
        assembly {
            // Mask `owner` to the lower 160 bits, in case the upper bits somehow aren't clean.
            owner := and(owner, _BITMASK_ADDRESS)
            // Mask `msgSender` to the lower 160 bits, in case the upper bits somehow aren't clean.
            msgSender := and(msgSender, _BITMASK_ADDRESS)
            // `msgSender == owner || msgSender == approvedAddress`.
            result := or(eq(msgSender, owner), eq(msgSender, approvedAddress))
        }
    }

    /**
     * @dev Returns the storage slot and value for the approved address of `tokenId`.
     */
    function _getApprovedSlotAndAddress(uint256 tokenId)
        private
        view
        returns (uint256 approvedAddressSlot, address approvedAddress)
    {
        TokenApprovalRef storage tokenApproval = _tokenApprovals[tokenId];
        // The following is equivalent to `approvedAddress = _tokenApprovals[tokenId].value`.
        assembly {
            approvedAddressSlot := tokenApproval.slot
            approvedAddress := sload(approvedAddressSlot)
        }
    }

    // =============================================================
    //                      TRANSFER OPERATIONS
    // =============================================================

    /**
     * @dev Transfers `tokenId` from `from` to `to`.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must be owned by `from`.
     * - If the caller is not `from`, it must be approved to move this token
     * by either {approve} or {setApprovalForAll}.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(
        address from,
        address to,
        uint256 tokenId
    ) public payable virtual override {
        uint256 prevOwnershipPacked = _packedOwnershipOf(tokenId);

        if (address(uint160(prevOwnershipPacked)) != from) revert TransferFromIncorrectOwner();

        (uint256 approvedAddressSlot, address approvedAddress) = _getApprovedSlotAndAddress(tokenId);

        // The nested ifs save around 20+ gas over a compound boolean condition.
        if (!_isSenderApprovedOrOwner(approvedAddress, from, _msgSenderERC721A()))
            if (!isApprovedForAll(from, _msgSenderERC721A())) revert TransferCallerNotOwnerNorApproved();

        if (to == address(0)) revert TransferToZeroAddress();

        _beforeTokenTransfers(from, to, tokenId, 1);

        // Clear approvals from the previous owner.
        assembly {
            if approvedAddress {
                // This is equivalent to `delete _tokenApprovals[tokenId]`.
                sstore(approvedAddressSlot, 0)
            }
        }

        // Underflow of the sender's balance is impossible because we check for
        // ownership above and the recipient's balance can't realistically overflow.
        // Counter overflow is incredibly unrealistic as `tokenId` would have to be 2**256.
        unchecked {
            // We can directly increment and decrement the balances.
            --_packedAddressData[from]; // Updates: `balance -= 1`.
            ++_packedAddressData[to]; // Updates: `balance += 1`.

            // Updates:
            // - `address` to the next owner.
            // - `startTimestamp` to the timestamp of transfering.
            // - `burned` to `false`.
            // - `nextInitialized` to `true`.
            _packedOwnerships[tokenId] = _packOwnershipData(
                to,
                _BITMASK_NEXT_INITIALIZED | _nextExtraData(from, to, prevOwnershipPacked)
            );

            // If the next slot may not have been initialized (i.e. `nextInitialized == false`) .
            if (prevOwnershipPacked & _BITMASK_NEXT_INITIALIZED == 0) {
                uint256 nextTokenId = tokenId + 1;
                // If the next slot's address is zero and not burned (i.e. packed value is zero).
                if (_packedOwnerships[nextTokenId] == 0) {
                    // If the next slot is within bounds.
                    if (nextTokenId != _currentIndex) {
                        // Initialize the next slot to maintain correctness for `ownerOf(tokenId + 1)`.
                        _packedOwnerships[nextTokenId] = prevOwnershipPacked;
                    }
                }
            }
        }

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

    /**
     * @dev Equivalent to `safeTransferFrom(from, to, tokenId, '')`.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 tokenId
    ) public payable virtual override {
        safeTransferFrom(from, to, tokenId, '');
    }

    /**
     * @dev Safely transfers `tokenId` token from `from` to `to`.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must exist and be owned by `from`.
     * - If the caller is not `from`, it must be approved to move this token
     * by either {approve} or {setApprovalForAll}.
     * - If `to` refers to a smart contract, it must implement
     * {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
     *
     * Emits a {Transfer} event.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 tokenId,
        bytes memory _data
    ) public payable virtual override {
        transferFrom(from, to, tokenId);
        if (to.code.length != 0)
            if (!_checkContractOnERC721Received(from, to, tokenId, _data)) {
                revert TransferToNonERC721ReceiverImplementer();
            }
    }

    /**
     * @dev Hook that is called before a set of serially-ordered token IDs
     * are about to be transferred. This includes minting.
     * And also called before burning one token.
     *
     * `startTokenId` - the first token ID to be transferred.
     * `quantity` - the amount to be transferred.
     *
     * Calling conditions:
     *
     * - When `from` and `to` are both non-zero, `from`'s `tokenId` will be
     * transferred to `to`.
     * - When `from` is zero, `tokenId` will be minted for `to`.
     * - When `to` is zero, `tokenId` will be burned by `from`.
     * - `from` and `to` are never both zero.
     */
    function _beforeTokenTransfers(
        address from,
        address to,
        uint256 startTokenId,
        uint256 quantity
    ) internal virtual {}

    /**
     * @dev Hook that is called after a set of serially-ordered token IDs
     * have been transferred. This includes minting.
     * And also called after one token has been burned.
     *
     * `startTokenId` - the first token ID to be transferred.
     * `quantity` - the amount to be transferred.
     *
     * Calling conditions:
     *
     * - When `from` and `to` are both non-zero, `from`'s `tokenId` has been
     * transferred to `to`.
     * - When `from` is zero, `tokenId` has been minted for `to`.
     * - When `to` is zero, `tokenId` has been burned by `from`.
     * - `from` and `to` are never both zero.
     */
    function _afterTokenTransfers(
        address from,
        address to,
        uint256 startTokenId,
        uint256 quantity
    ) internal virtual {}

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

    // =============================================================
    //                        MINT OPERATIONS
    // =============================================================

    /**
     * @dev Mints `quantity` tokens and transfers them to `to`.
     *
     * Requirements:
     *
     * - `to` cannot be the zero address.
     * - `quantity` must be greater than 0.
     *
     * Emits a {Transfer} event for each mint.
     */
    function _mint(address to, uint256 quantity) internal virtual {
        uint256 startTokenId = _currentIndex;
        if (quantity == 0) revert MintZeroQuantity();

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

        // Overflows are incredibly unrealistic.
        // `balance` and `numberMinted` have a maximum limit of 2**64.
        // `tokenId` has a maximum limit of 2**256.
        unchecked {
            // Updates:
            // - `balance += quantity`.
            // - `numberMinted += quantity`.
            //
            // We can directly add to the `balance` and `numberMinted`.
            _packedAddressData[to] += quantity * ((1 << _BITPOS_NUMBER_MINTED) | 1);

            // Updates:
            // - `address` to the owner.
            // - `startTimestamp` to the timestamp of minting.
            // - `burned` to `false`.
            // - `nextInitialized` to `quantity == 1`.
            _packedOwnerships[startTokenId] = _packOwnershipData(
                to,
                _nextInitializedFlag(quantity) | _nextExtraData(address(0), to, 0)
            );

            uint256 toMasked;
            uint256 end = startTokenId + quantity;

            // Use assembly to loop and emit the `Transfer` event for gas savings.
            // The duplicated `log4` removes an extra check and reduces stack juggling.
            // The assembly, together with the surrounding Solidity code, have been
            // delicately arranged to nudge the compiler into producing optimized opcodes.
            assembly {
                // Mask `to` to the lower 160 bits, in case the upper bits somehow aren't clean.
                toMasked := and(to, _BITMASK_ADDRESS)
                // Emit the `Transfer` event.
                log4(
                    0, // Start of data (0, since no data).
                    0, // End of data (0, since no data).
                    _TRANSFER_EVENT_SIGNATURE, // Signature.
                    0, // `address(0)`.
                    toMasked, // `to`.
                    startTokenId // `tokenId`.
                )

                // The `iszero(eq(,))` check ensures that large values of `quantity`
                // that overflows uint256 will make the loop run out of gas.
                // The compiler will optimize the `iszero` away for performance.
                for {
                    let tokenId := add(startTokenId, 1)
                } iszero(eq(tokenId, end)) {
                    tokenId := add(tokenId, 1)
                } {
                    // Emit the `Transfer` event. Similar to above.
                    log4(0, 0, _TRANSFER_EVENT_SIGNATURE, 0, toMasked, tokenId)
                }
            }
            if (toMasked == 0) revert MintToZeroAddress();

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

    /**
     * @dev Mints `quantity` tokens and transfers them to `to`.
     *
     * This function is intended for efficient minting only during contract creation.
     *
     * It emits only one {ConsecutiveTransfer} as defined in
     * [ERC2309](https://eips.ethereum.org/EIPS/eip-2309),
     * instead of a sequence of {Transfer} event(s).
     *
     * Calling this function outside of contract creation WILL make your contract
     * non-compliant with the ERC721 standard.
     * For full ERC721 compliance, substituting ERC721 {Transfer} event(s) with the ERC2309
     * {ConsecutiveTransfer} event is only permissible during contract creation.
     *
     * Requirements:
     *
     * - `to` cannot be the zero address.
     * - `quantity` must be greater than 0.
     *
     * Emits a {ConsecutiveTransfer} event.
     */
    function _mintERC2309(address to, uint256 quantity) internal virtual {
        uint256 startTokenId = _currentIndex;
        if (to == address(0)) revert MintToZeroAddress();
        if (quantity == 0) revert MintZeroQuantity();
        if (quantity > _MAX_MINT_ERC2309_QUANTITY_LIMIT) revert MintERC2309QuantityExceedsLimit();

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

        // Overflows are unrealistic due to the above check for `quantity` to be below the limit.
        unchecked {
            // Updates:
            // - `balance += quantity`.
            // - `numberMinted += quantity`.
            //
            // We can directly add to the `balance` and `numberMinted`.
            _packedAddressData[to] += quantity * ((1 << _BITPOS_NUMBER_MINTED) | 1);

            // Updates:
            // - `address` to the owner.
            // - `startTimestamp` to the timestamp of minting.
            // - `burned` to `false`.
            // - `nextInitialized` to `quantity == 1`.
            _packedOwnerships[startTokenId] = _packOwnershipData(
                to,
                _nextInitializedFlag(quantity) | _nextExtraData(address(0), to, 0)
            );

            emit ConsecutiveTransfer(startTokenId, startTokenId + quantity - 1, address(0), to);

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

    /**
     * @dev Safely mints `quantity` tokens and transfers them to `to`.
     *
     * Requirements:
     *
     * - If `to` refers to a smart contract, it must implement
     * {IERC721Receiver-onERC721Received}, which is called for each safe transfer.
     * - `quantity` must be greater than 0.
     *
     * See {_mint}.
     *
     * Emits a {Transfer} event for each mint.
     */
    function _safeMint(
        address to,
        uint256 quantity,
        bytes memory _data
    ) internal virtual {
        _mint(to, quantity);

        unchecked {
            if (to.code.length != 0) {
                uint256 end = _currentIndex;
                uint256 index = end - quantity;
                do {
                    if (!_checkContractOnERC721Received(address(0), to, index++, _data)) {
                        revert TransferToNonERC721ReceiverImplementer();
                    }
                } while (index < end);
                // Reentrancy protection.
                if (_currentIndex != end) revert();
            }
        }
    }

    /**
     * @dev Equivalent to `_safeMint(to, quantity, '')`.
     */
    function _safeMint(address to, uint256 quantity) internal virtual {
        _safeMint(to, quantity, '');
    }

    // =============================================================
    //                        BURN OPERATIONS
    // =============================================================

    /**
     * @dev Equivalent to `_burn(tokenId, false)`.
     */
    function _burn(uint256 tokenId) internal virtual {
        _burn(tokenId, false);
    }

    /**
     * @dev Destroys `tokenId`.
     * The approval is cleared when the token is burned.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     *
     * Emits a {Transfer} event.
     */
    function _burn(uint256 tokenId, bool approvalCheck) internal virtual {
        uint256 prevOwnershipPacked = _packedOwnershipOf(tokenId);

        address from = address(uint160(prevOwnershipPacked));

        (uint256 approvedAddressSlot, address approvedAddress) = _getApprovedSlotAndAddress(tokenId);

        if (approvalCheck) {
            // The nested ifs save around 20+ gas over a compound boolean condition.
            if (!_isSenderApprovedOrOwner(approvedAddress, from, _msgSenderERC721A()))
                if (!isApprovedForAll(from, _msgSenderERC721A())) revert TransferCallerNotOwnerNorApproved();
        }

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

        // Clear approvals from the previous owner.
        assembly {
            if approvedAddress {
                // This is equivalent to `delete _tokenApprovals[tokenId]`.
                sstore(approvedAddressSlot, 0)
            }
        }

        // Underflow of the sender's balance is impossible because we check for
        // ownership above and the recipient's balance can't realistically overflow.
        // Counter overflow is incredibly unrealistic as `tokenId` would have to be 2**256.
        unchecked {
            // Updates:
            // - `balance -= 1`.
            // - `numberBurned += 1`.
            //
            // We can directly decrement the balance, and increment the number burned.
            // This is equivalent to `packed -= 1; packed += 1 << _BITPOS_NUMBER_BURNED;`.
            _packedAddressData[from] += (1 << _BITPOS_NUMBER_BURNED) - 1;

            // Updates:
            // - `address` to the last owner.
            // - `startTimestamp` to the timestamp of burning.
            // - `burned` to `true`.
            // - `nextInitialized` to `true`.
            _packedOwnerships[tokenId] = _packOwnershipData(
                from,
                (_BITMASK_BURNED | _BITMASK_NEXT_INITIALIZED) | _nextExtraData(from, address(0), prevOwnershipPacked)
            );

            // If the next slot may not have been initialized (i.e. `nextInitialized == false`) .
            if (prevOwnershipPacked & _BITMASK_NEXT_INITIALIZED == 0) {
                uint256 nextTokenId = tokenId + 1;
                // If the next slot's address is zero and not burned (i.e. packed value is zero).
                if (_packedOwnerships[nextTokenId] == 0) {
                    // If the next slot is within bounds.
                    if (nextTokenId != _currentIndex) {
                        // Initialize the next slot to maintain correctness for `ownerOf(tokenId + 1)`.
                        _packedOwnerships[nextTokenId] = prevOwnershipPacked;
                    }
                }
            }
        }

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

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

    // =============================================================
    //                     EXTRA DATA OPERATIONS
    // =============================================================

    /**
     * @dev Directly sets the extra data for the ownership data `index`.
     */
    function _setExtraDataAt(uint256 index, uint24 extraData) internal virtual {
        uint256 packed = _packedOwnerships[index];
        if (packed == 0) revert OwnershipNotInitializedForExtraData();
        uint256 extraDataCasted;
        // Cast `extraData` with assembly to avoid redundant masking.
        assembly {
            extraDataCasted := extraData
        }
        packed = (packed & _BITMASK_EXTRA_DATA_COMPLEMENT) | (extraDataCasted << _BITPOS_EXTRA_DATA);
        _packedOwnerships[index] = packed;
    }

    /**
     * @dev Called during each token transfer to set the 24bit `extraData` field.
     * Intended to be overridden by the cosumer contract.
     *
     * `previousExtraData` - the value of `extraData` before transfer.
     *
     * Calling conditions:
     *
     * - When `from` and `to` are both non-zero, `from`'s `tokenId` will be
     * transferred to `to`.
     * - When `from` is zero, `tokenId` will be minted for `to`.
     * - When `to` is zero, `tokenId` will be burned by `from`.
     * - `from` and `to` are never both zero.
     */
    function _extraData(
        address from,
        address to,
        uint24 previousExtraData
    ) internal view virtual returns (uint24) {}

    /**
     * @dev Returns the next extra data for the packed ownership data.
     * The returned result is shifted into position.
     */
    function _nextExtraData(
        address from,
        address to,
        uint256 prevOwnershipPacked
    ) private view returns (uint256) {
        uint24 extraData = uint24(prevOwnershipPacked >> _BITPOS_EXTRA_DATA);
        return uint256(_extraData(from, to, extraData)) << _BITPOS_EXTRA_DATA;
    }

    // =============================================================
    //                       OTHER OPERATIONS
    // =============================================================

    /**
     * @dev Returns the message sender (defaults to `msg.sender`).
     *
     * If you are writing GSN compatible contracts, you need to override this function.
     */
    function _msgSenderERC721A() internal view virtual returns (address) {
        return msg.sender;
    }

    /**
     * @dev Converts a uint256 to its ASCII string decimal representation.
     */
    function _toString(uint256 value) internal pure virtual returns (string memory str) {
        assembly {
            // The maximum value of a uint256 contains 78 digits (1 byte per digit), but
            // we allocate 0xa0 bytes to keep the free memory pointer 32-byte word aligned.
            // We will need 1 word for the trailing zeros padding, 1 word for the length,
            // and 3 words for a maximum of 78 digits. Total: 5 * 0x20 = 0xa0.
            let m := add(mload(0x40), 0xa0)
            // Update the free memory pointer to allocate.
            mstore(0x40, m)
            // Assign the `str` to the end.
            str := sub(m, 0x20)
            // Zeroize the slot after the string.
            mstore(str, 0)

            // Cache the end of the memory to calculate the length later.
            let end := str

            // We write the string from rightmost digit to leftmost digit.
            // The following is essentially a do-while loop that also handles the zero case.
            // prettier-ignore
            for { let temp := value } 1 {} {
                str := sub(str, 1)
                // Write the character to the pointer.
                // The ASCII index of the '0' character is 48.
                mstore8(str, add(48, mod(temp, 10)))
                // Keep dividing `temp` until zero.
                temp := div(temp, 10)
                // prettier-ignore
                if iszero(temp) { break }
            }

            let length := sub(end, str)
            // Move the pointer 32 bytes leftwards to make room for the length.
            str := sub(str, 0x20)
            // Store the length.
            mstore(str, length)
        }
    }
}


// File erc721a/contracts/extensions/[email protected]

// ERC721A Contracts v4.2.3
// Creator: Chiru Labs

pragma solidity ^0.8.4;


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

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

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

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


// File contracts/ApetimismLaunchpadNFT.sol

pragma solidity ^0.8.9;

contract ApetimismLaunchpadNFT is ERC721AQueryable, Ownable, ReentrancyGuard {
  event RoundChanged(uint256 indexed);
  event TotalMintedChanged(uint256 indexed);

  ///////////
  // Errors
  ///////////

  error InvalidSignature();
  error DuplicatedNonce();
  error HitMaximum();
  error InvalidAmount();
  error RunOut();
  error NotEligible();
  error NotStarted();
  error RoleNotExisted();
  error MetadataFrozen();
  error NonExistentToken();
  error UnmatchedEther();
  error EtherNotSent();

  //////////////
  // Constants
  //////////////

  uint256 public constant MAX_SUPPLY = 5466;
  uint256 private constant START_TOKEN_ID = 1;
  string private constant TOKEN_NAME = "ggasawefrqe";
  string private constant TOKEN_SYMBOL = "hhtrrwehrt";

  //////////////
  // Internal
  //////////////

  mapping(address => uint256) private _addressTokenMinted;
  mapping(address => mapping(uint256 => mapping(int256 => uint256))) private _addressTokenMintedInRoundByRole;
  mapping(address => mapping(int256 => uint256)) private _addressTokenMintedInRole;

  mapping(uint256 => uint256) private _nonces;

  mapping(uint256 => mapping(uint256 => mapping(int256 => Role))) private allowedRolesInRound;
  mapping(uint256 => mapping(uint256 => uint256)) private allowedRolesInRoundCount;
  mapping(uint256 => mapping(uint256 => int256[])) private allowedRolesInRoundArr;
  uint256[] private availableAllowedRounds;
  uint256[] private availableRounds;
  mapping(uint256 => mapping(uint256 => uint256)) private roundAllocations;
  mapping(uint256 => mapping(int256 => uint256)) private roleAllocations;
  int256[] private availableRoles;

  mapping(uint256 => uint256) private totalMintedInRound;

  uint256 private allowedRolesInRoundSetId;
  uint256 private roundAllocationsSetId;
  uint256 private roleAllocationsSetId;

  bool private metadataFrozen;
  uint256 private maxMintPerTx = 2;
  uint256 private maxMintPerAddress = 4;
  string private baseURIExtended;
  bool private isSingleMetadata = false;
  bool private metadataHasExtension = true;

  /////////////////////
  // Public Variables
  /////////////////////

  address public signerAddress = 0x4702190d69AD7155ED34cEcE8D916d69B12e9C7d;

  uint256 public currentRound;

  struct Role {
    uint256 round_id;
    int256 role_id;
    uint256 max_mint;
    uint256 mint_price;
    bool exists;
  }

  address public currencyAddress;

  ////////////////
  // Parameters
  ////////////////

  struct RoleInRoundParams {
    uint256 round;
    int256 role;
    uint256 maxMint;
    uint256 mintPrice;
  }
  struct RoundAllocationParams {
    uint256 round;
    uint256 allocation;
  }
  struct RoleAllocationParams {
    int256 role;
    uint256 allocation;
  }

  ////////////////
  // Actual Code
  ////////////////

  constructor() ERC721A(TOKEN_NAME, TOKEN_SYMBOL) {
  }

  function _startTokenId() internal view virtual override returns (uint256) {
    return START_TOKEN_ID;
  }

  //////////////////////
  // Setters for Owner
  //////////////////////

  function setCurrentRound(uint256 round_) public onlyOwner {
    currentRound = round_;
    emit RoundChanged(round_);
  }

  function setMaxMintPerTx(uint256 count) external onlyOwner {
    maxMintPerTx = count;
  }

  function setMaxMintPerAddress(uint256 count) external onlyOwner {
    maxMintPerAddress = count;
  }

  function setBaseURI(string memory baseURI) external onlyOwner {
    if (metadataFrozen)
      revert MetadataFrozen();
    baseURIExtended = baseURI;
  }

  function setMetadataHasExtension(bool hasExtension) external onlyOwner {
    metadataHasExtension = hasExtension;
  }

  function setIsSingleMetadata(bool _isSingleMetadata) external onlyOwner {
    isSingleMetadata = _isSingleMetadata;
  }

  function setCurrencyAddress(address addr) external onlyOwner {
    currencyAddress = addr;
  }

  function addAllowedRolesInRound(RoleInRoundParams[] memory params, bool replace) public onlyOwner {
    if (replace) {
      allowedRolesInRoundSetId++;
      delete availableAllowedRounds;
    }

    mapping(uint256 => mapping(int256 => Role)) storage _currentAllowedRolesInRound = allowedRolesInRound[allowedRolesInRoundSetId];
    mapping(uint256 => uint256) storage _currentAllowedRolesInRoundCount = allowedRolesInRoundCount[allowedRolesInRoundSetId];
    mapping(uint256 => int256[]) storage _currentAllowedRolesInRoundArr = allowedRolesInRoundArr[allowedRolesInRoundSetId];

    unchecked {
      for (uint i; i < params.length; ++i) {
        RoleInRoundParams memory param = params[i];
        uint256 round = param.round;

        Role storage allowedRole = _currentAllowedRolesInRound[round][param.role];

        allowedRole.round_id = round;
        allowedRole.role_id = param.role;
        allowedRole.max_mint = param.maxMint;
        allowedRole.mint_price = param.mintPrice;
        if (allowedRole.exists) // Role already existed
          continue;
        allowedRole.exists = true;

        _currentAllowedRolesInRoundCount[round]++;

        _currentAllowedRolesInRoundArr[round].push(param.role);

        if (!_existedInUint256Array(availableAllowedRounds, round))
          availableAllowedRounds.push(round);
      }
    }
  }

  function removeAllowedRoleInRound(uint256 round, int256 role) public onlyOwner {
    Role storage allowedRole = allowedRolesInRound[allowedRolesInRoundSetId][round][role];
    mapping(uint256 => uint256) storage _allowedRolesInRoundCount =
      allowedRolesInRoundCount[allowedRolesInRoundSetId];

    if (!allowedRole.exists)
      revert RoleNotExisted();
    allowedRole.round_id = 0;
    allowedRole.role_id = 0;
    allowedRole.max_mint = 0;
    allowedRole.mint_price = 0;
    allowedRole.exists = false;
    _allowedRolesInRoundCount[round]--;

    // Remove available role
    int256[] storage _allowedRolesInRound = allowedRolesInRoundArr[allowedRolesInRoundSetId][round];
    uint256 len = _allowedRolesInRound.length;
    for (uint i = 0; i < len; i++) {
      if (_allowedRolesInRound[i] == role) {
        removeArrayAtInt256Index(_allowedRolesInRound, i);
        break;
      }
    }

    if (_allowedRolesInRoundCount[round] == 0) {
      // Remove available round
      len = availableRounds.length;
      for (uint i = 0; i < len; i++) {
        if (availableRounds[i] == round) {
          removeArrayAtUint256Index(availableRounds, i);
          break;
        }
      }
    }
  }

  function addRoundsAllocation(RoundAllocationParams[] memory params, bool replace) public onlyOwner {
    if (replace) {
      roundAllocationsSetId++;
      delete availableRounds;
    }

    mapping(uint256 => uint256) storage _currentRoundAllocations = roundAllocations[roundAllocationsSetId];

    unchecked {
      for (uint i = 0; i < params.length; i++) {
        RoundAllocationParams memory param = params[i];
        uint256 round = param.round;

        _currentRoundAllocations[round] = param.allocation;

        if (!_existedInUint256Array(availableRounds, round))
          availableRounds.push(round);
      }
    }
  }

  function addRolesAllocation(RoleAllocationParams[] memory params, bool replace) public onlyOwner {
    if (replace) {
      roleAllocationsSetId++;
      delete availableRoles;
    }

    mapping(int256 => uint256) storage _currentRoleAllocations = roleAllocations[roleAllocationsSetId];

    unchecked {
      for (uint i = 0; i < params.length; i++) {
        RoleAllocationParams memory param = params[i];

        _currentRoleAllocations[param.role] = param.allocation;

        bool existed = false;
        uint256 len = availableRoles.length;
        for (uint j = 0; j < len; j++)
          if (availableRoles[j] == param.role)
            existed = true;

        if (!existed)
          availableRoles.push(param.role);
      }
    }
  }

  function addRolesRounds(
    RoleInRoundParams[] memory _rolesInRound,
    bool _replaceRoleInRound,
    RoundAllocationParams[] memory _roundAllocations,
    bool _replaceRoundAllocations,
    RoleAllocationParams[] memory _roleAllocations,
    bool _replaceRoleAllocations
  ) external onlyOwner {
    addAllowedRolesInRound(_rolesInRound, _replaceRoleInRound);
    addRoundsAllocation(_roundAllocations, _replaceRoundAllocations);
    addRolesAllocation(_roleAllocations, _replaceRoleAllocations);
  }

  function freezeMetadata() external onlyOwner {
    metadataFrozen = true;
  }

  ////////////
  // Minting
  ////////////

  function mint(uint256 quantity, int256 role, uint256 apetimismFee, address apetimismAddress, uint256 nonce, uint8 v, bytes32 r, bytes32 s) external payable nonReentrant {
    if (currentRound == 0)
      revert NotStarted();

    uint256 combined_nonce = nonce;
    if (role >= 0)
      combined_nonce = (nonce << 16) + uint256(role);

    _validateNonceAndSignature(combined_nonce, abi.encodePacked(combined_nonce, apetimismFee, apetimismAddress), v, r, s);

    mapping(int256 => Role) storage allowedRolesInCurrentRound =
      allowedRolesInRound[allowedRolesInRoundSetId][currentRound];

    int256 selected_role = 0;
    if (role >= 0)
      selected_role = role;

    if (!allowedRolesInCurrentRound[selected_role].exists) {
      if (!allowedRolesInCurrentRound[0].exists) // Revert if Public Role is NOT allowed in this round
        revert NotEligible();
      selected_role = 0;
    }

    _validateQuantity(quantity);

    // Check for Role Quota
    {
      int256 _roleToCheck = 0;
      if (role >= 0)
        _roleToCheck = role;
      if (maxMintableForTxForRole(msg.sender, _roleToCheck) < quantity)
        revert HitMaximum();
    }

    uint256 cost = quantity * allowedRolesInCurrentRound[selected_role].mint_price;
    _nonces[combined_nonce] = 1;

    // Check the Ether value
    {
      uint256 _expectedValue = cost;
      // Pay by Token
      if (currencyAddress != address(0))
        _expectedValue = 0;
      if (msg.value != _expectedValue)
        revert UnmatchedEther();
    }

    _safeMint(msg.sender, quantity);

    totalMintedInRound[currentRound] += quantity;

    _addressTokenMinted[msg.sender] += quantity;
    _addressTokenMintedInRoundByRole[msg.sender][currentRound][selected_role] += quantity;
    _addressTokenMintedInRole[msg.sender][selected_role] += quantity;

    uint256 to_apetimism = cost * apetimismFee / 10000;
    if (currencyAddress != address(0)) {
      // Pay by Token
      IERC20 tokenContract = IERC20(currencyAddress);
      tokenContract.transferFrom(msg.sender, address(this), cost);
      tokenContract.transfer(apetimismAddress, to_apetimism);
    } else {
      // Pay by Native Coin
      _transferEth(payable(apetimismAddress), to_apetimism);
    }
  }

  function adminMintTo(address to, uint256 quantity) external onlyOwner {
    _validateQuantity(quantity);

    _safeMint(to, quantity);
  }

  //////////////
  // Apetimism
  //////////////

  function setCurrentRoundFromSignature(uint256 nonce, uint256 round, uint8 v, bytes32 r, bytes32 s) public {
    _validateNonceAndSignature(nonce, abi.encodePacked(nonce, round), v, r, s);

    _nonces[nonce] = 1;
    setCurrentRound(round);
  }

  function setSignerAddressFromSignature(uint256 nonce, address addr, uint8 v, bytes32 r, bytes32 s) public {
    _validateNonceAndSignature(nonce, abi.encodePacked(nonce, addr), v, r, s);

    _nonces[nonce] = 1;
    signerAddress = addr;
  }

  ///////////////
  // Validators
  ///////////////

  function _validateQuantity(uint256 quantity) private view {
    if (quantity <= 0)
      revert InvalidAmount();
    if (mintableLeft() < quantity)
      revert RunOut();
  }

  function _validateNonceAndSignature(uint256 nonce, bytes memory data, uint8 v, bytes32 r, bytes32 s) private view {
    if (_nonces[nonce] != 0)
      revert DuplicatedNonce();
    if (_recoverAddress(data, v, r, s) != signerAddress)
      revert InvalidSignature();
  }

  ////////////////
  // Transfering
  ////////////////

  function transfersFrom(
    address from,
    address to,
    uint256[] memory tokenIds
  ) public virtual {
    for (uint i = 0; i < tokenIds.length; i++)
      transferFrom(from, to, tokenIds[i]);
  }

  function safeTransfersFrom(
    address from,
    address to,
    uint256[] memory tokenIds,
    bytes memory _data
  ) public virtual {
    for (uint i = 0; i < tokenIds.length; i++)
      safeTransferFrom(from, to, tokenIds[i], _data);
  }

  /////////////////
  // Public Views
  /////////////////

  function getConfigs() public view returns (bool, uint256, uint256, string memory, bool, bool) {
    return (metadataFrozen, maxMintPerTx, maxMintPerAddress, baseURIExtended, metadataHasExtension, isSingleMetadata);
  }

  function getAllowedRolesInRoundArr(uint256 round) public view returns (int256[] memory) {
    int256[] storage _allowedRolesInRound = allowedRolesInRoundArr[allowedRolesInRoundSetId][round];
    uint256 len = _allowedRolesInRound.length;
    int256[] memory ret = new int256[](len);
    for (uint i = 0; i < len; i++)
      ret[i] = _allowedRolesInRound[i];
    return ret;
  }

  function getAllAllowedRolesInRounds() public view returns (RoleInRoundParams[] memory) {
    mapping(uint256 => uint256) storage _currentAllowedRolesInRoundCount =
      allowedRolesInRoundCount[allowedRolesInRoundSetId];

    uint256 len = 0;
    for (uint i = 0; i < availableAllowedRounds.length; i++)
      len += _currentAllowedRolesInRoundCount[ availableAllowedRounds[i] ];

    RoleInRoundParams[] memory ret = new RoleInRoundParams[](len);
    uint256 index = 0;
    for (uint i = 0; i < availableAllowedRounds.length; i++) {
      uint256 round = availableAllowedRounds[i];
      uint256 count = _currentAllowedRolesInRoundCount[round];
      for (uint j = 0; j < count; j++) {
        int256 role = allowedRolesInRoundArr[allowedRolesInRoundSetId][round][j];
        Role storage allowedRole = allowedRolesInRound[allowedRolesInRoundSetId][round][role];
        RoleInRoundParams memory retAtCurrentIndex = ret[index];
        retAtCurrentIndex.round = round;
        retAtCurrentIndex.role = role;
        retAtCurrentIndex.maxMint = allowedRole.max_mint;
        retAtCurrentIndex.mintPrice = allowedRole.mint_price;
        index++;
      }
    }
    return ret;
  }

  function getAllRoundAllocations() public view returns (RoundAllocationParams[] memory) {
    uint256 len = availableRounds.length;
    RoundAllocationParams[] memory ret = new RoundAllocationParams[](len);
    mapping(uint256 => uint256) storage _currentRoundAllocations = roundAllocations[roundAllocationsSetId];
    for (uint i = 0; i < len; i++) {
      RoundAllocationParams memory retAtCurrentIndex = ret[i];
      retAtCurrentIndex.round = availableRounds[i];
      retAtCurrentIndex.allocation = _currentRoundAllocations[retAtCurrentIndex.round];
    }
    return ret;
  }

  function getAllRoleAllocations() public view returns (RoleAllocationParams[] memory) {
    uint256 len = availableRoles.length;
    RoleAllocationParams[] memory ret = new RoleAllocationParams[](len);
    mapping(int256 => uint256) storage _currentRoleAllocations = roleAllocations[roleAllocationsSetId];
    for (uint i = 0; i < len; i++) {
      RoleAllocationParams memory retAtCurrentIndex = ret[i];
      retAtCurrentIndex.role = availableRoles[i];
      retAtCurrentIndex.allocation = _currentRoleAllocations[retAtCurrentIndex.role];
    }
    return ret;
  }

  function mintPriceForCurrentRoundForRole(int256 role) public view returns (uint256) {
    return allowedRolesInRound[allowedRolesInRoundSetId][currentRound][role].mint_price;
  }

  function maxMintableForRole(address addr, int256 role) public view virtual returns (uint256) {
    uint256 minted = _addressTokenMinted[addr];
    uint256 max_mint = 0;

    uint256 _currentRoundAllocation = roundAllocations[roundAllocationsSetId][currentRound];
    uint256 _currentRoleAllocation = roleAllocations[roleAllocationsSetId][role];
    uint256 _addressMintedInRoundByRole = _addressTokenMintedInRoundByRole[addr][currentRound][role];
    uint256 _addressMintedInRole = _addressTokenMintedInRole[addr][role];
    uint256 _currentTotalMintedInRound = totalMintedInRound[currentRound];

    if (
      // Not yet started
      currentRound == 0
      // Total minted in this round reach the maximum allocated
      || _currentTotalMintedInRound >= _currentRoundAllocation
      // Cannot mint more than allocated for role
      || _addressMintedInRole >= _currentRoleAllocation
      // Hit the maximum per wallet
      || minted >= maxMintPerAddress
      // Prevent underflow
      || _currentTotalMintedInRound >= _currentRoundAllocation
      )
      return 0;

    Role storage _allowedRoleInRound = allowedRolesInRound[allowedRolesInRoundSetId][currentRound][role];
    if (_allowedRoleInRound.exists)
      max_mint = _allowedRoleInRound.max_mint;

    // Cannot mint more for this round
    if (_addressMintedInRoundByRole >= max_mint)
      return 0;

    uint256 wallet_quota_left = maxMintPerAddress - minted;
    uint256 round_quota_left = max_mint - _addressMintedInRoundByRole;
    uint256 round_allocation_quota_left = _currentRoundAllocation - _currentTotalMintedInRound;
    uint256 role_quota_left = _currentRoleAllocation - _addressMintedInRole;

    return Math.min(
      Math.min(
        Math.min(
          Math.min(
            wallet_quota_left,
            round_quota_left
          ),
          round_allocation_quota_left
        ),
        role_quota_left
      ),
      mintableLeft());
  }

  function maxMintableForTxForRole(address addr, int256 role) public view virtual returns (uint256) {
    return Math.min(maxMintableForRole(addr, role), maxMintPerTx);
  }

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

    if (bytes(baseURIExtended).length == 0)
      return '';

    if (isSingleMetadata)
      return baseURIExtended;

    string memory extension = "";
    if (metadataHasExtension)
      extension = ".json";

    return string(abi.encodePacked(baseURIExtended, Strings.toString(tokenId), extension));
  }

  function totalMinted() public view returns (uint256) {
    return _totalMinted();
  }

  function mintableLeft() public view returns (uint256) {
    return MAX_SUPPLY - totalMinted();
  }

  ////////////
  // Helpers
  ////////////

  function removeArrayAtUint256Index(uint256[] storage array, uint256 index) private {
    array[index] = array[array.length - 1];
    array.pop();
  }

  function removeArrayAtInt256Index(int256[] storage array, uint256 index) private {
    array[index] = array[array.length - 1];
    array.pop();
  }

  function _existedInUint256Array(uint256[] storage array, uint256 value) private view returns (bool) {
    uint256 len = array.length;
    for (uint i = 0; i < len; i++)
      if (array[i] == value)
        return true;
    return false;
  }

  function _recoverAddress(bytes memory data, uint8 v, bytes32 r, bytes32 s) private pure returns (address) {
    return ecrecover(keccak256(
      abi.encodePacked(
        "\x19Ethereum Signed Message:\n32",
        keccak256(data)
      )
    ), v, r, s);
  }

  function _transferEth(address payable to, uint256 amount) private {
    if (amount == 0)
      return;
    (bool sent,) = to.call{ value: amount }("");
    if (!sent)
      revert EtherNotSent();
  }

  function supportsInterface(bytes4 interfaceId) public view virtual override(ERC721A) returns (bool) {
    return super.supportsInterface(interfaceId) || ERC721A.supportsInterface(interfaceId);
  }

  ///////////////
  // Withdrawal
  ///////////////

  function withdraw() public onlyOwner {
    _transferEth(payable(msg.sender), address(this).balance);
  }

  function withdrawToken(address tokenAddress) public onlyOwner {
    IERC20 tokenContract = IERC20(tokenAddress);
    tokenContract.transfer(msg.sender, tokenContract.balanceOf(address(this)));
  }

  /////////////
  // Fallback
  /////////////

  receive() external payable {
  }
}
        

Contract ABI

[{"type":"constructor","stateMutability":"nonpayable","inputs":[]},{"type":"error","name":"ApprovalCallerNotOwnerNorApproved","inputs":[]},{"type":"error","name":"ApprovalQueryForNonexistentToken","inputs":[]},{"type":"error","name":"BalanceQueryForZeroAddress","inputs":[]},{"type":"error","name":"DuplicatedNonce","inputs":[]},{"type":"error","name":"EtherNotSent","inputs":[]},{"type":"error","name":"HitMaximum","inputs":[]},{"type":"error","name":"InvalidAmount","inputs":[]},{"type":"error","name":"InvalidQueryRange","inputs":[]},{"type":"error","name":"InvalidSignature","inputs":[]},{"type":"error","name":"MetadataFrozen","inputs":[]},{"type":"error","name":"MintERC2309QuantityExceedsLimit","inputs":[]},{"type":"error","name":"MintToZeroAddress","inputs":[]},{"type":"error","name":"MintZeroQuantity","inputs":[]},{"type":"error","name":"NonExistentToken","inputs":[]},{"type":"error","name":"NotEligible","inputs":[]},{"type":"error","name":"NotStarted","inputs":[]},{"type":"error","name":"OwnerQueryForNonexistentToken","inputs":[]},{"type":"error","name":"OwnershipNotInitializedForExtraData","inputs":[]},{"type":"error","name":"RoleNotExisted","inputs":[]},{"type":"error","name":"RunOut","inputs":[]},{"type":"error","name":"TransferCallerNotOwnerNorApproved","inputs":[]},{"type":"error","name":"TransferFromIncorrectOwner","inputs":[]},{"type":"error","name":"TransferToNonERC721ReceiverImplementer","inputs":[]},{"type":"error","name":"TransferToZeroAddress","inputs":[]},{"type":"error","name":"URIQueryForNonexistentToken","inputs":[]},{"type":"error","name":"UnmatchedEther","inputs":[]},{"type":"event","name":"Approval","inputs":[{"type":"address","name":"owner","internalType":"address","indexed":true},{"type":"address","name":"approved","internalType":"address","indexed":true},{"type":"uint256","name":"tokenId","internalType":"uint256","indexed":true}],"anonymous":false},{"type":"event","name":"ApprovalForAll","inputs":[{"type":"address","name":"owner","internalType":"address","indexed":true},{"type":"address","name":"operator","internalType":"address","indexed":true},{"type":"bool","name":"approved","internalType":"bool","indexed":false}],"anonymous":false},{"type":"event","name":"ConsecutiveTransfer","inputs":[{"type":"uint256","name":"fromTokenId","internalType":"uint256","indexed":true},{"type":"uint256","name":"toTokenId","internalType":"uint256","indexed":false},{"type":"address","name":"from","internalType":"address","indexed":true},{"type":"address","name":"to","internalType":"address","indexed":true}],"anonymous":false},{"type":"event","name":"OwnershipTransferred","inputs":[{"type":"address","name":"previousOwner","internalType":"address","indexed":true},{"type":"address","name":"newOwner","internalType":"address","indexed":true}],"anonymous":false},{"type":"event","name":"RoundChanged","inputs":[{"type":"uint256","name":"","internalType":"uint256","indexed":true}],"anonymous":false},{"type":"event","name":"TotalMintedChanged","inputs":[{"type":"uint256","name":"","internalType":"uint256","indexed":true}],"anonymous":false},{"type":"event","name":"Transfer","inputs":[{"type":"address","name":"from","internalType":"address","indexed":true},{"type":"address","name":"to","internalType":"address","indexed":true},{"type":"uint256","name":"tokenId","internalType":"uint256","indexed":true}],"anonymous":false},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"MAX_SUPPLY","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"addAllowedRolesInRound","inputs":[{"type":"tuple[]","name":"params","internalType":"struct ApetimismLaunchpadNFT.RoleInRoundParams[]","components":[{"type":"uint256","name":"round","internalType":"uint256"},{"type":"int256","name":"role","internalType":"int256"},{"type":"uint256","name":"maxMint","internalType":"uint256"},{"type":"uint256","name":"mintPrice","internalType":"uint256"}]},{"type":"bool","name":"replace","internalType":"bool"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"addRolesAllocation","inputs":[{"type":"tuple[]","name":"params","internalType":"struct ApetimismLaunchpadNFT.RoleAllocationParams[]","components":[{"type":"int256","name":"role","internalType":"int256"},{"type":"uint256","name":"allocation","internalType":"uint256"}]},{"type":"bool","name":"replace","internalType":"bool"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"addRolesRounds","inputs":[{"type":"tuple[]","name":"_rolesInRound","internalType":"struct ApetimismLaunchpadNFT.RoleInRoundParams[]","components":[{"type":"uint256","name":"round","internalType":"uint256"},{"type":"int256","name":"role","internalType":"int256"},{"type":"uint256","name":"maxMint","internalType":"uint256"},{"type":"uint256","name":"mintPrice","internalType":"uint256"}]},{"type":"bool","name":"_replaceRoleInRound","internalType":"bool"},{"type":"tuple[]","name":"_roundAllocations","internalType":"struct ApetimismLaunchpadNFT.RoundAllocationParams[]","components":[{"type":"uint256","name":"round","internalType":"uint256"},{"type":"uint256","name":"allocation","internalType":"uint256"}]},{"type":"bool","name":"_replaceRoundAllocations","internalType":"bool"},{"type":"tuple[]","name":"_roleAllocations","internalType":"struct ApetimismLaunchpadNFT.RoleAllocationParams[]","components":[{"type":"int256","name":"role","internalType":"int256"},{"type":"uint256","name":"allocation","internalType":"uint256"}]},{"type":"bool","name":"_replaceRoleAllocations","internalType":"bool"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"addRoundsAllocation","inputs":[{"type":"tuple[]","name":"params","internalType":"struct ApetimismLaunchpadNFT.RoundAllocationParams[]","components":[{"type":"uint256","name":"round","internalType":"uint256"},{"type":"uint256","name":"allocation","internalType":"uint256"}]},{"type":"bool","name":"replace","internalType":"bool"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"adminMintTo","inputs":[{"type":"address","name":"to","internalType":"address"},{"type":"uint256","name":"quantity","internalType":"uint256"}]},{"type":"function","stateMutability":"payable","outputs":[],"name":"approve","inputs":[{"type":"address","name":"to","internalType":"address"},{"type":"uint256","name":"tokenId","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"balanceOf","inputs":[{"type":"address","name":"owner","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"currencyAddress","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"currentRound","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"tuple","name":"","internalType":"struct IERC721A.TokenOwnership","components":[{"type":"address","name":"addr","internalType":"address"},{"type":"uint64","name":"startTimestamp","internalType":"uint64"},{"type":"bool","name":"burned","internalType":"bool"},{"type":"uint24","name":"extraData","internalType":"uint24"}]}],"name":"explicitOwnershipOf","inputs":[{"type":"uint256","name":"tokenId","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"tuple[]","name":"","internalType":"struct IERC721A.TokenOwnership[]","components":[{"type":"address","name":"addr","internalType":"address"},{"type":"uint64","name":"startTimestamp","internalType":"uint64"},{"type":"bool","name":"burned","internalType":"bool"},{"type":"uint24","name":"extraData","internalType":"uint24"}]}],"name":"explicitOwnershipsOf","inputs":[{"type":"uint256[]","name":"tokenIds","internalType":"uint256[]"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"freezeMetadata","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"tuple[]","name":"","internalType":"struct ApetimismLaunchpadNFT.RoleInRoundParams[]","components":[{"type":"uint256","name":"round","internalType":"uint256"},{"type":"int256","name":"role","internalType":"int256"},{"type":"uint256","name":"maxMint","internalType":"uint256"},{"type":"uint256","name":"mintPrice","internalType":"uint256"}]}],"name":"getAllAllowedRolesInRounds","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"tuple[]","name":"","internalType":"struct ApetimismLaunchpadNFT.RoleAllocationParams[]","components":[{"type":"int256","name":"role","internalType":"int256"},{"type":"uint256","name":"allocation","internalType":"uint256"}]}],"name":"getAllRoleAllocations","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"tuple[]","name":"","internalType":"struct ApetimismLaunchpadNFT.RoundAllocationParams[]","components":[{"type":"uint256","name":"round","internalType":"uint256"},{"type":"uint256","name":"allocation","internalType":"uint256"}]}],"name":"getAllRoundAllocations","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"int256[]","name":"","internalType":"int256[]"}],"name":"getAllowedRolesInRoundArr","inputs":[{"type":"uint256","name":"round","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"getApproved","inputs":[{"type":"uint256","name":"tokenId","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"},{"type":"uint256","name":"","internalType":"uint256"},{"type":"uint256","name":"","internalType":"uint256"},{"type":"string","name":"","internalType":"string"},{"type":"bool","name":"","internalType":"bool"},{"type":"bool","name":"","internalType":"bool"}],"name":"getConfigs","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"isApprovedForAll","inputs":[{"type":"address","name":"owner","internalType":"address"},{"type":"address","name":"operator","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"maxMintableForRole","inputs":[{"type":"address","name":"addr","internalType":"address"},{"type":"int256","name":"role","internalType":"int256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"maxMintableForTxForRole","inputs":[{"type":"address","name":"addr","internalType":"address"},{"type":"int256","name":"role","internalType":"int256"}]},{"type":"function","stateMutability":"payable","outputs":[],"name":"mint","inputs":[{"type":"uint256","name":"quantity","internalType":"uint256"},{"type":"int256","name":"role","internalType":"int256"},{"type":"uint256","name":"apetimismFee","internalType":"uint256"},{"type":"address","name":"apetimismAddress","internalType":"address"},{"type":"uint256","name":"nonce","internalType":"uint256"},{"type":"uint8","name":"v","internalType":"uint8"},{"type":"bytes32","name":"r","internalType":"bytes32"},{"type":"bytes32","name":"s","internalType":"bytes32"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"mintPriceForCurrentRoundForRole","inputs":[{"type":"int256","name":"role","internalType":"int256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"mintableLeft","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"string","name":"","internalType":"string"}],"name":"name","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"owner","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"ownerOf","inputs":[{"type":"uint256","name":"tokenId","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"removeAllowedRoleInRound","inputs":[{"type":"uint256","name":"round","internalType":"uint256"},{"type":"int256","name":"role","internalType":"int256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"renounceOwnership","inputs":[]},{"type":"function","stateMutability":"payable","outputs":[],"name":"safeTransferFrom","inputs":[{"type":"address","name":"from","internalType":"address"},{"type":"address","name":"to","internalType":"address"},{"type":"uint256","name":"tokenId","internalType":"uint256"}]},{"type":"function","stateMutability":"payable","outputs":[],"name":"safeTransferFrom","inputs":[{"type":"address","name":"from","internalType":"address"},{"type":"address","name":"to","internalType":"address"},{"type":"uint256","name":"tokenId","internalType":"uint256"},{"type":"bytes","name":"_data","internalType":"bytes"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"safeTransfersFrom","inputs":[{"type":"address","name":"from","internalType":"address"},{"type":"address","name":"to","internalType":"address"},{"type":"uint256[]","name":"tokenIds","internalType":"uint256[]"},{"type":"bytes","name":"_data","internalType":"bytes"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setApprovalForAll","inputs":[{"type":"address","name":"operator","internalType":"address"},{"type":"bool","name":"approved","internalType":"bool"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setBaseURI","inputs":[{"type":"string","name":"baseURI","internalType":"string"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setCurrencyAddress","inputs":[{"type":"address","name":"addr","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setCurrentRound","inputs":[{"type":"uint256","name":"round_","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setCurrentRoundFromSignature","inputs":[{"type":"uint256","name":"nonce","internalType":"uint256"},{"type":"uint256","name":"round","internalType":"uint256"},{"type":"uint8","name":"v","internalType":"uint8"},{"type":"bytes32","name":"r","internalType":"bytes32"},{"type":"bytes32","name":"s","internalType":"bytes32"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setIsSingleMetadata","inputs":[{"type":"bool","name":"_isSingleMetadata","internalType":"bool"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setMaxMintPerAddress","inputs":[{"type":"uint256","name":"count","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setMaxMintPerTx","inputs":[{"type":"uint256","name":"count","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setMetadataHasExtension","inputs":[{"type":"bool","name":"hasExtension","internalType":"bool"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setSignerAddressFromSignature","inputs":[{"type":"uint256","name":"nonce","internalType":"uint256"},{"type":"address","name":"addr","internalType":"address"},{"type":"uint8","name":"v","internalType":"uint8"},{"type":"bytes32","name":"r","internalType":"bytes32"},{"type":"bytes32","name":"s","internalType":"bytes32"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"signerAddress","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"supportsInterface","inputs":[{"type":"bytes4","name":"interfaceId","internalType":"bytes4"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"string","name":"","internalType":"string"}],"name":"symbol","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"string","name":"","internalType":"string"}],"name":"tokenURI","inputs":[{"type":"uint256","name":"tokenId","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256[]","name":"","internalType":"uint256[]"}],"name":"tokensOfOwner","inputs":[{"type":"address","name":"owner","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256[]","name":"","internalType":"uint256[]"}],"name":"tokensOfOwnerIn","inputs":[{"type":"address","name":"owner","internalType":"address"},{"type":"uint256","name":"start","internalType":"uint256"},{"type":"uint256","name":"stop","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"totalMinted","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"totalSupply","inputs":[]},{"type":"function","stateMutability":"payable","outputs":[],"name":"transferFrom","inputs":[{"type":"address","name":"from","internalType":"address"},{"type":"address","name":"to","internalType":"address"},{"type":"uint256","name":"tokenId","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"transferOwnership","inputs":[{"type":"address","name":"newOwner","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"transfersFrom","inputs":[{"type":"address","name":"from","internalType":"address"},{"type":"address","name":"to","internalType":"address"},{"type":"uint256[]","name":"tokenIds","internalType":"uint256[]"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"withdraw","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"withdrawToken","inputs":[{"type":"address","name":"tokenAddress","internalType":"address"}]},{"type":"receive","stateMutability":"payable"}]
              

Contract Creation Code

Verify & Publish
0x60806040526002601b556004601c55601e80546001600160b01b031916754702190d69ad7155ed34cece8d916d69b12e9c7d01001790553480156200004357600080fd5b50604080518082018252600b81526a676761736177656672716560a81b60208083019182528351808501909452600a8452691a1a1d1c9c9dd95a1c9d60b21b90840152815191929162000099916002916200011f565b508051620000af9060039060208401906200011f565b5050600160005550620000c233620000cd565b600160095562000202565b600880546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b8280546200012d90620001c5565b90600052602060002090601f0160209004810192826200015157600085556200019c565b82601f106200016c57805160ff19168380011785556200019c565b828001600101855582156200019c579182015b828111156200019c5782518255916020019190600101906200017f565b50620001aa929150620001ae565b5090565b5b80821115620001aa5760008155600101620001af565b600181811c90821680620001da57607f821691505b60208210811415620001fc57634e487b7160e01b600052602260045260246000fd5b50919050565b613f0080620002126000396000f3fe6080604052600436106102ee5760003560e01c8063715018a611610186578063ac7dc68d116100d7578063d111515d11610085578063d111515d146108fd578063dd06555914610912578063ddddefc714610932578063e985e9c514610952578063f2fde38b1461099b578063f4d40a9c146109bb578063fb0c402b14610a0257600080fd5b8063ac7dc68d14610828578063b88d4fde1461083d578063be4f182c14610850578063c23dc68f14610870578063c2873f041461089d578063c87b56dd146108bd578063c9d48579146108dd57600080fd5b80638da5cb5b116101345780638da5cb5b1461075557806395d89b411461077357806399a2557a14610788578063a22cb465146107a8578063a2309ff8146107c8578063a4fb233c146107e1578063abdc30331461080157600080fd5b8063715018a614610688578063748a500a1461069d578063796b89ec146106b25780638462151c146106d257806389476069146106ff57806389b5a8c21461071f5780638a19c8bc1461073f57600080fd5b80633bc91e28116102405780635b7633d0116101ee5780635b7633d0146105a25780635bbb2177146105c8578063616cdb1e146105f55780636352211e146106155780636c22e06e146106355780636e453d621461064857806370a082311461066857600080fd5b80633bc91e28146104d85780633ccfd60b146104f85780633d6a57451461050d5780633e9dbed01461052d57806342842e0e1461054f578063511e1d511461056257806355f804b31461058257600080fd5b80631c1cb3231161029d5780631c1cb3231461040f5780631e14d44b1461042f57806323b872dd1461044f5780632fdea6541461046257806332ab9bbe1461048257806332cb6b0c146104a25780633aeb7501146104b857600080fd5b80620319df146102fa57806301ffc9a71461032557806306fdde0314610355578063081812fc14610377578063095ea7b3146103af5780630ebbb09c146103c457806318160ddd146103f257600080fd5b366102f557005b600080fd5b34801561030657600080fd5b5061030f610a22565b60405161031c9190613196565b60405180910390f35b34801561033157600080fd5b506103456103403660046131fb565b610b10565b604051901515815260200161031c565b34801561036157600080fd5b5061036a610b30565b60405161031c9190613270565b34801561038357600080fd5b50610397610392366004613283565b610bc2565b6040516001600160a01b03909116815260200161031c565b6103c26103bd3660046132b8565b610c06565b005b3480156103d057600080fd5b506103e46103df3660046132b8565b610ca6565b60405190815260200161031c565b3480156103fe57600080fd5b5060015460005403600019016103e4565b34801561041b57600080fd5b50602054610397906001600160a01b031681565b34801561043b57600080fd5b506103c261044a366004613283565b610cc4565b6103c261045d3660046132e2565b610cd1565b34801561046e57600080fd5b506103c261047d36600461346e565b610e63565b34801561048e57600080fd5b506103c261049d366004613591565b610f3e565b3480156104ae57600080fd5b506103e461155a81565b3480156104c457600080fd5b506103c26104d33660046136a8565b610f88565b3480156104e457600080fd5b506103c26104f3366004613283565b610fae565b34801561050457600080fd5b506103c2610fe9565b34801561051957600080fd5b506103c26105283660046132b8565b610ffd565b34801561053957600080fd5b5061054261101c565b60405161031c919061376c565b6103c261055d3660046132e2565b611231565b34801561056e57600080fd5b506103c261057d3660046137c3565b611251565b34801561058e57600080fd5b506103c261059d3660046137f8565b6113b3565b3480156105ae57600080fd5b50601e54610397906201000090046001600160a01b031681565b3480156105d457600080fd5b506105e86105e3366004613840565b6113f2565b60405161031c91906138f0565b34801561060157600080fd5b506103c2610610366004613283565b6114a4565b34801561062157600080fd5b50610397610630366004613283565b6114b1565b6103c2610643366004613943565b6114bc565b34801561065457600080fd5b506103c26106633660046139b0565b611891565b34801561067457600080fd5b506103e46106833660046139cd565b6118b3565b34801561069457600080fd5b506103c2611901565b3480156106a957600080fd5b5061030f611913565b3480156106be57600080fd5b506103c26106cd3660046139cd565b6119f8565b3480156106de57600080fd5b506106f26106ed3660046139cd565b611a22565b60405161031c91906139e8565b34801561070b57600080fd5b506103c261071a3660046139cd565b611b0f565b34801561072b57600080fd5b506103c261073a366004613a20565b611c18565b34801561074b57600080fd5b506103e4601f5481565b34801561076157600080fd5b506008546001600160a01b0316610397565b34801561077f57600080fd5b5061036a611c5a565b34801561079457600080fd5b506106f26107a3366004613a7d565b611c69565b3480156107b457600080fd5b506103c26107c3366004613ab0565b611df2565b3480156107d457600080fd5b50600054600019016103e4565b3480156107ed57600080fd5b506103c26107fc366004613adc565b611e63565b34801561080d57600080fd5b50610816611eb5565b60405161031c96959493929190613b23565b34801561083457600080fd5b506103e4611f84565b6103c261084b366004613b64565b611f98565b34801561085c57600080fd5b506103c261086b366004613bbf565b611fdc565b34801561087c57600080fd5b5061089061088b366004613283565b61215b565b60405161031c9190613be1565b3480156108a957600080fd5b506103c26108b83660046139b0565b6121ab565b3480156108c957600080fd5b5061036a6108d8366004613283565b6121c6565b3480156108e957600080fd5b506103c26108f8366004613bef565b612326565b34801561090957600080fd5b506103c2612393565b34801561091e57600080fd5b506103c261092d36600461346e565b6123aa565b34801561093e57600080fd5b506103e461094d3660046132b8565b6124b5565b34801561095e57600080fd5b5061034561096d366004613c25565b6001600160a01b03918216600090815260076020908152604080832093909416825291909152205460ff1690565b3480156109a757600080fd5b506103c26109b63660046139cd565b612655565b3480156109c757600080fd5b506103e46109d6366004613283565b6017546000908152600e60209081526040808320601f5484528252808320938352929052206003015490565b348015610a0e57600080fd5b506106f2610a1d366004613283565b6126d3565b6012546060906000816001600160401b03811115610a4257610a4261331e565b604051908082528060200260200182016040528015610a8757816020015b6040805180820190915260008082526020820152815260200190600190039081610a605790505b5060185460009081526013602052604081209192505b83811015610b07576000838281518110610ab957610ab9613c58565b6020026020010151905060128281548110610ad657610ad6613c58565b6000918252602080832090910154808452825284815260409091205491015280610aff81613c84565b915050610a9d565b50909392505050565b6000610b1b8261278f565b80610b2a5750610b2a8261278f565b92915050565b606060028054610b3f90613c9f565b80601f0160208091040260200160405190810160405280929190818152602001828054610b6b90613c9f565b8015610bb85780601f10610b8d57610100808354040283529160200191610bb8565b820191906000526020600020905b815481529060010190602001808311610b9b57829003601f168201915b5050505050905090565b6000610bcd826127dd565b610bea576040516333d1c03960e21b815260040160405180910390fd5b506000908152600660205260409020546001600160a01b031690565b6000610c11826114b1565b9050336001600160a01b03821614610c4a57610c2d813361096d565b610c4a576040516367d9dca160e11b815260040160405180910390fd5b60008281526006602052604080822080546001600160a01b0319166001600160a01b0387811691821790925591518593918516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591a4505050565b6000610cbd610cb584846124b5565b601b54612812565b9392505050565b610ccc612828565b601c55565b6000610cdc82612882565b9050836001600160a01b0316816001600160a01b031614610d0f5760405162a1148160e81b815260040160405180910390fd5b60008281526006602052604090208054338082146001600160a01b03881690911417610d5c57610d3f863361096d565b610d5c57604051632ce44b5f60e11b815260040160405180910390fd5b6001600160a01b038516610d8357604051633a954ecd60e21b815260040160405180910390fd5b8015610d8e57600082555b6001600160a01b038681166000908152600560205260408082208054600019019055918716808252919020805460010190554260a01b17600160e11b17600085815260046020526040902055600160e11b8316610e195760018401600081815260046020526040902054610e17576000548114610e175760008181526004602052604090208490555b505b83856001600160a01b0316876001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a45b505050505050565b610e6b612828565b8015610e935760188054906000610e8183613c84565b90915550610e939050601260006130b8565b6018546000908152601360205260408120905b8351811015610f38576000848281518110610ec357610ec3613c58565b6020908102919091018101518051818301516000828152938790526040909320929092559150610ef46012826128eb565b610f2e57601280546001810182556000919091527fbb8a6a4669ba250d26cd7a459eca9d215f8307e33aebe50379bc5a3617ec3444018190555b5050600101610ea6565b50505050565b60005b8251811015610f8157610f6f8585858481518110610f6157610f61613c58565b602002602001015185611f98565b80610f7981613c84565b915050610f41565b5050505050565b610f90612828565b610f9a8686611251565b610fa48484610e63565b610e5b82826123aa565b610fb6612828565b601f81905560405181907fe13ec1fa9c3ede43997fc070c234a83909ba45575dd0ad079ea7138418cc846590600090a250565b610ff1612828565b610ffb3347612946565b565b611005612828565b61100e816129c3565b6110188282612a0c565b5050565b6017546000908152600f60205260408120606091805b60115481101561108b578260006011838154811061105257611052613c58565b9060005260206000200154815260200190815260200160002054826110779190613cda565b91508061108381613c84565b915050611032565b506000816001600160401b038111156110a6576110a661331e565b60405190808252806020026020018201604052801561110257816020015b6110ef6040518060800160405280600081526020016000815260200160008152602001600081525090565b8152602001906001900390816110c45790505b5090506000805b6011548110156112275760006011828154811061112857611128613c58565b6000918252602080832090910154808352908890526040822054909250905b81811015611211576017546000908152601060209081526040808320868452909152812080548390811061117d5761117d613c58565b60009182526020808320909101546017548352600e825260408084208885528352808420828552909252908220895191935091908990899081106111c3576111c3613c58565b60209081029190910181015187815290810184905260028301546040820152600383015460608201529050876111f881613c84565b985050505050808061120990613c84565b915050611147565b505050808061121f90613c84565b915050611109565b5090949350505050565b61124c83838360405180602001604052806000815250611f98565b505050565b611259612828565b8015611281576017805490600061126f83613c84565b909155506112819050601160006130b8565b6017546000908152600e60209081526040808320600f8352818420601090935290832090925b8551811015610e5b5760008682815181106112c4576112c4613c58565b60209081029190910181015180516000818152888452604080822084860180518452955290819020828155935160018501558201516002840155606082015160038401556004830154919350919060ff1615611322575050506113ab565b60048101805460ff191660019081179091556000838152602088815260408083208054850190558882528220868201518154948501825590835291209091015561136d6011836128eb565b6113a757601180546001810182556000919091527f31ecc21a745e3968a04e9570e4425bc18fa8019c68028196b546d1669c200c68018290555b5050505b6001016112a7565b6113bb612828565b601a5460ff16156113df5760405163777821ff60e11b815260040160405180910390fd5b805161101890601d9060208401906130d6565b6060816000816001600160401b0381111561140f5761140f61331e565b60405190808252806020026020018201604052801561144857816020015b61143561315a565b81526020019060019003908161142d5790505b50905060005b82811461149b5761147686868381811061146a5761146a613c58565b9050602002013561215b565b82828151811061148857611488613c58565b602090810291909101015260010161144e565b50949350505050565b6114ac612828565b601b55565b6000610b2a82612882565b6114c4612a26565b601f546114e457604051636f312cbd60e01b815260040160405180910390fd5b83600088126114fe576114fb88601087901b613cda565b90505b61154c8182898960405160200161153593929190928352602083019190915260601b6001600160601b031916604082015260540190565b604051602081830303815290604052868686612a80565b6017546000908152600e60209081526040808320601f548452909152812090808a126115755750885b60008181526020839052604090206004015460ff166115c45760008080526020839052604090206004015460ff166115c057604051637c75aa6f60e11b815260040160405180910390fd5b5060005b6115cd8b6129c3565b6000808b126115d95750895b8b6115e43383610ca6565b101561160357604051633ce4251960e01b815260040160405180910390fd5b50600081815260208390526040812060030154611620908d613cf2565b6000858152600d60209081526040909120600190555490915081906001600160a01b03161561164d575060005b80341461166d57604051630551cf2960e01b815260040160405180910390fd5b50611678338d612a0c565b601f54600090815260166020526040812080548e9290611699908490613cda565b9091555050336000908152600a6020526040812080548e92906116bd908490613cda565b9091555050336000908152600b60209081526040808320601f5484528252808320858452909152812080548e92906116f6908490613cda565b9091555050336000908152600c60209081526040808320858452909152812080548e9290611725908490613cda565b909155506000905061271061173a8c84613cf2565b6117449190613d11565b6020549091506001600160a01b03161561186e576020546040516323b872dd60e01b8152336004820152306024820152604481018490526001600160a01b039091169081906323b872dd90606401602060405180830381600087803b1580156117ac57600080fd5b505af11580156117c0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117e49190613d33565b5060405163a9059cbb60e01b81526001600160a01b038c811660048301526024820184905282169063a9059cbb90604401602060405180830381600087803b15801561182f57600080fd5b505af1158015611843573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118679190613d33565b5050611878565b6118788a82612946565b50505050506118876001600955565b5050505050505050565b611899612828565b601e80549115156101000261ff0019909216919091179055565b60006001600160a01b0382166118dc576040516323d3ad8160e21b815260040160405180910390fd5b506001600160a01b03166000908152600560205260409020546001600160401b031690565b611909612828565b610ffb6000612af2565b6015546060906000816001600160401b038111156119335761193361331e565b60405190808252806020026020018201604052801561197857816020015b60408051808201909152600080825260208201528152602001906001900390816119515790505b5060195460009081526014602052604081209192505b83811015610b075760008382815181106119aa576119aa613c58565b60200260200101519050601582815481106119c7576119c7613c58565b60009182526020808320909101548084528252848152604090912054910152806119f081613c84565b91505061198e565b611a00612828565b602080546001600160a01b0319166001600160a01b0392909216919091179055565b60606000806000611a32856118b3565b90506000816001600160401b03811115611a4e57611a4e61331e565b604051908082528060200260200182016040528015611a77578160200160208202803683370190505b509050611a8261315a565b60015b838614611b0357611a9581612b44565b9150816040015115611aa657611afb565b81516001600160a01b031615611abb57815194505b876001600160a01b0316856001600160a01b03161415611afb5780838780600101985081518110611aee57611aee613c58565b6020026020010181815250505b600101611a85565b50909695505050505050565b611b17612828565b6040516370a0823160e01b815230600482015281906001600160a01b0382169063a9059cbb90339083906370a082319060240160206040518083038186803b158015611b6257600080fd5b505afa158015611b76573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b9a9190613d50565b6040516001600160e01b031960e085901b1681526001600160a01b0390921660048301526024820152604401602060405180830381600087803b158015611be057600080fd5b505af1158015611bf4573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061124c9190613d33565b60005b8151811015610f3857611c488484848481518110611c3b57611c3b613c58565b6020026020010151610cd1565b80611c5281613c84565b915050611c1b565b606060038054610b3f90613c9f565b6060818310611c8b57604051631960ccad60e11b815260040160405180910390fd5b600080611c9760005490565b90506001851015611ca757600194505b80841115611cb3578093505b6000611cbe876118b3565b905084861015611cdd5785850381811015611cd7578091505b50611ce1565b5060005b6000816001600160401b03811115611cfb57611cfb61331e565b604051908082528060200260200182016040528015611d24578160200160208202803683370190505b50905081611d37579350610cbd92505050565b6000611d428861215b565b905060008160400151611d53575080515b885b888114158015611d655750848714155b15611de157611d7381612b44565b9250826040015115611d8457611dd9565b82516001600160a01b031615611d9957825191505b8a6001600160a01b0316826001600160a01b03161415611dd95780848880600101995081518110611dcc57611dcc613c58565b6020026020010181815250505b600101611d55565b505050928352509095945050505050565b3360008181526007602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b905090565b611e9a858686604051602001611e83929190918252602082015260400190565b604051602081830303815290604052858585612a80565b6000858152600d6020526040902060019055610f8184610fae565b601a54601b54601c54601e54601d8054600095869586956060958795869560ff958616959192610100810483169216908390611ef090613c9f565b80601f0160208091040260200160405190810160405280929190818152602001828054611f1c90613c9f565b8015611f695780601f10611f3e57610100808354040283529160200191611f69565b820191906000526020600020905b815481529060010190602001808311611f4c57829003601f168201915b50505050509250955095509550955095509550909192939495565b6000805460001901611e5e9061155a613d69565b611fa3848484610cd1565b6001600160a01b0383163b15610f3857611fbf84848484612b64565b610f38576040516368d2bf6b60e11b815260040160405180910390fd5b611fe4612828565b6017546000818152600e6020908152604080832086845282528083208584528252808320938352600f9091529020600482015460ff166120375760405163d73251d760e01b815260040160405180910390fd5b600080835560018301819055600283018190556003830181905560048301805460ff1916905584815260208290526040812080549161207583613d80565b909155505060175460009081526010602090815260408083208784529091528120805490915b818110156120e857858382815481106120b6576120b6613c58565b906000526020600020015414156120d6576120d18382612c5c565b6120e8565b806120e081613c84565b91505061209b565b50600086815260208490526040902054610e5b575060125460005b8181101561215257866012828154811061211f5761211f613c58565b906000526020600020015414156121405761213b601282612c5c565b612152565b8061214a81613c84565b915050612103565b50505050505050565b61216361315a565b61216b61315a565b600183108061217c57506000548310155b156121875792915050565b61219083612b44565b90508060400151156121a25792915050565b610cbd83612cd1565b6121b3612828565b601e805460ff1916911515919091179055565b60606121d1826127dd565b6121ee57604051634a1850bf60e11b815260040160405180910390fd5b601d80546121fb90613c9f565b1515905061221757505060408051602081019091526000815290565b601e5460ff16156122b457601d805461222f90613c9f565b80601f016020809104026020016040519081016040528092919081815260200182805461225b90613c9f565b80156122a85780601f1061227d576101008083540402835291602001916122a8565b820191906000526020600020905b81548152906001019060200180831161228b57829003601f168201915b50505050509050919050565b604080516020810190915260008152601e54610100900460ff16156122f15750604080518082019091526005815264173539b7b760d91b60208201525b601d6122fc84612cea565b8260405160200161230f93929190613db3565b604051602081830303815290604052915050919050565b612353858686604051602001611e8392919091825260601b6001600160601b031916602082015260340190565b5050506000918252600d602052604090912060019055601e80546001600160a01b03909216620100000262010000600160b01b0319909216919091179055565b61239b612828565b601a805460ff19166001179055565b6123b2612828565b80156123da57601980549060006123c883613c84565b909155506123da9050601560006130b8565b6019546000908152601460205260408120905b8351811015610f3857600084828151811061240a5761240a613c58565b6020908102919091018101518082015181516000908152928690526040832055601554909250815b8181101561246e578351601580548390811061245057612450613c58565b9060005260206000200154141561246657600192505b600101612432565b50816124aa578251601580546001810182556000919091527f55f448fdea98c4d29eb340757ef0a66cd03dbb9538908a6a81d96026b71ec47501555b5050506001016123ed565b6001600160a01b0382166000818152600a6020908152604080832054601854845260138352818420601f5480865290845282852054601954865260148552838620888752855283862054878752600b86528487208388528652848720898852865284872054978752600c865284872089885286528487205483885260169096529386205495969295879591949392158061254f5750848110155b8061255a5750838210155b806125675750601c548710155b806125725750848110155b15612587576000975050505050505050610b2a565b6017546000908152600e60209081526040808320601f54845282528083208c84529091529020600481015460ff16156125c257806002015496505b8684106125da57600098505050505050505050610b2a565b600088601c546125ea9190613d69565b905060006125f8868a613d69565b90506000612606858a613d69565b90506000612614878a613d69565b905061264261263561262f6126298787612812565b85612812565b83612812565b61263d611f84565b612812565b9f9e505050505050505050505050505050565b61265d612828565b6001600160a01b0381166126c75760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084015b60405180910390fd5b6126d081612af2565b50565b601754600090815260106020908152604080832084845290915281208054606092816001600160401b0381111561270c5761270c61331e565b604051908082528060200260200182016040528015612735578160200160208202803683370190505b50905060005b8281101561149b5783818154811061275557612755613c58565b906000526020600020015482828151811061277257612772613c58565b60209081029190910101528061278781613c84565b91505061273b565b60006301ffc9a760e01b6001600160e01b0319831614806127c057506380ac58cd60e01b6001600160e01b03198316145b80610b2a5750506001600160e01b031916635b5e139f60e01b1490565b6000816001111580156127f1575060005482105b8015610b2a575050600090815260046020526040902054600160e01b161590565b60008183106128215781610cbd565b5090919050565b6008546001600160a01b03163314610ffb5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016126be565b600081806001116128d2576000548110156128d257600081815260046020526040902054600160e01b81166128d0575b80610cbd5750600019016000818152600460205260409020546128b2565b505b604051636f96cda160e11b815260040160405180910390fd5b8154600090815b8181101561293b578385828154811061290d5761290d613c58565b9060005260206000200154141561292957600192505050610b2a565b8061293381613c84565b9150506128f2565b506000949350505050565b8061294f575050565b6000826001600160a01b03168260405160006040518083038185875af1925050503d806000811461299c576040519150601f19603f3d011682016040523d82523d6000602084013e6129a1565b606091505b505090508061124c576040516328316c4d60e11b815260040160405180910390fd5b600081116129e45760405163162908e360e11b815260040160405180910390fd5b806129ed611f84565b10156126d05760405163671317e960e11b815260040160405180910390fd5b611018828260405180602001604052806000815250612d86565b60026009541415612a795760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016126be565b6002600955565b6000858152600d602052604090205415612aad5760405163256f5cdd60e11b815260040160405180910390fd5b601e546201000090046001600160a01b0316612acb85858585612dec565b6001600160a01b031614610f8157604051638baa579f60e01b815260040160405180910390fd5b600880546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b612b4c61315a565b600082815260046020526040902054610b2a90612ea6565b604051630a85bd0160e11b81526000906001600160a01b0385169063150b7a0290612b99903390899088908890600401613e64565b602060405180830381600087803b158015612bb357600080fd5b505af1925050508015612be3575060408051601f3d908101601f19168201909252612be091810190613e97565b60015b612c3e573d808015612c11576040519150601f19603f3d011682016040523d82523d6000602084013e612c16565b606091505b508051612c36576040516368d2bf6b60e11b815260040160405180910390fd5b805181602001fd5b6001600160e01b031916630a85bd0160e11b1490505b949350505050565b81548290612c6c90600190613d69565b81548110612c7c57612c7c613c58565b9060005260206000200154828281548110612c9957612c99613c58565b906000526020600020018190555081805480612cb757612cb7613eb4565b600190038181906000526020600020016000905590555050565b612cd961315a565b610b2a612ce583612882565b612ea6565b60606000612cf783612ee9565b60010190506000816001600160401b03811115612d1657612d1661331e565b6040519080825280601f01601f191660200182016040528015612d40576020820181803683370190505b5090508181016020015b600019016f181899199a1a9b1b9c1cb0b131b232b360811b600a86061a8153600a8504945084612d7957612d7e565b612d4a565b509392505050565b612d908383612fc1565b6001600160a01b0383163b1561124c576000548281035b612dba6000868380600101945086612b64565b612dd7576040516368d2bf6b60e11b815260040160405180910390fd5b818110612da7578160005414610f8157600080fd5b600060018580519060200120604051602001612e3491907f19457468657265756d205369676e6564204d6573736167653a0a3332000000008152601c810191909152603c0190565b60408051601f198184030181528282528051602091820120600084529083018083525260ff871690820152606081018590526080810184905260a0016020604051602081039080840390855afa158015612e92573d6000803e3d6000fd5b5050604051601f1901519695505050505050565b612eae61315a565b6001600160a01b03821681526001600160401b0360a083901c166020820152600160e01b82161515604082015260e89190911c606082015290565b60008072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b8310612f285772184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b830492506040015b6d04ee2d6d415b85acef81000000008310612f54576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc100008310612f7257662386f26fc10000830492506010015b6305f5e1008310612f8a576305f5e100830492506008015b6127108310612f9e57612710830492506004015b60648310612fb0576064830492506002015b600a8310610b2a5760010192915050565b60005481612fe25760405163b562e8dd60e01b815260040160405180910390fd5b6001600160a01b03831660008181526005602090815260408083208054680100000000000000018802019055848352600490915281206001851460e11b4260a01b178317905582840190839083907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8180a4600183015b81811461309157808360007fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef600080a4600101613059565b50816130af57604051622e076360e81b815260040160405180910390fd5b60005550505050565b50805460008255906000526020600020908101906126d09190613181565b8280546130e290613c9f565b90600052602060002090601f016020900481019282613104576000855561314a565b82601f1061311d57805160ff191683800117855561314a565b8280016001018555821561314a579182015b8281111561314a57825182559160200191906001019061312f565b50613156929150613181565b5090565b60408051608081018252600080825260208201819052918101829052606081019190915290565b5b808211156131565760008155600101613182565b602080825282518282018190526000919060409081850190868401855b828110156131d8578151805185528601518685015292840192908501906001016131b3565b5091979650505050505050565b6001600160e01b0319811681146126d057600080fd5b60006020828403121561320d57600080fd5b8135610cbd816131e5565b60005b8381101561323357818101518382015260200161321b565b83811115610f385750506000910152565b6000815180845261325c816020860160208601613218565b601f01601f19169290920160200192915050565b602081526000610cbd6020830184613244565b60006020828403121561329557600080fd5b5035919050565b80356001600160a01b03811681146132b357600080fd5b919050565b600080604083850312156132cb57600080fd5b6132d48361329c565b946020939093013593505050565b6000806000606084860312156132f757600080fd5b6133008461329c565b925061330e6020850161329c565b9150604084013590509250925092565b634e487b7160e01b600052604160045260246000fd5b604080519081016001600160401b03811182821017156133565761335661331e565b60405290565b604051608081016001600160401b03811182821017156133565761335661331e565b604051601f8201601f191681016001600160401b03811182821017156133a6576133a661331e565b604052919050565b60006001600160401b038211156133c7576133c761331e565b5060051b60200190565b600082601f8301126133e257600080fd5b813560206133f76133f2836133ae565b61337e565b82815260069290921b8401810191818101908684111561341657600080fd5b8286015b8481101561345557604081890312156134335760008081fd5b61343b613334565b81358152848201358582015283529183019160400161341a565b509695505050505050565b80151581146126d057600080fd5b6000806040838503121561348157600080fd5b82356001600160401b0381111561349757600080fd5b6134a3858286016133d1565b92505060208301356134b481613460565b809150509250929050565b600082601f8301126134d057600080fd5b813560206134e06133f2836133ae565b82815260059290921b840181019181810190868411156134ff57600080fd5b8286015b848110156134555780358352918301918301613503565b60006001600160401b038311156135335761353361331e565b613546601f8401601f191660200161337e565b905082815283838301111561355a57600080fd5b828260208301376000602084830101529392505050565b600082601f83011261358257600080fd5b610cbd8383356020850161351a565b600080600080608085870312156135a757600080fd5b6135b08561329c565b93506135be6020860161329c565b925060408501356001600160401b03808211156135da57600080fd5b6135e6888389016134bf565b935060608701359150808211156135fc57600080fd5b5061360987828801613571565b91505092959194509250565b600082601f83011261362657600080fd5b813560206136366133f2836133ae565b82815260079290921b8401810191818101908684111561365557600080fd5b8286015b8481101561345557608081890312156136725760008081fd5b61367a61335c565b8135815284820135858201526040808301359082015260608083013590820152835291830191608001613659565b60008060008060008060c087890312156136c157600080fd5b86356001600160401b03808211156136d857600080fd5b6136e48a838b01613615565b9750602089013591506136f682613460565b9095506040880135908082111561370c57600080fd5b6137188a838b016133d1565b95506060890135915061372a82613460565b9093506080880135908082111561374057600080fd5b5061374d89828a016133d1565b92505060a087013561375e81613460565b809150509295509295509295565b602080825282518282018190526000919060409081850190868401855b828110156131d857815180518552868101518786015285810151868601526060908101519085015260809093019290850190600101613789565b600080604083850312156137d657600080fd5b82356001600160401b038111156137ec57600080fd5b6134a385828601613615565b60006020828403121561380a57600080fd5b81356001600160401b0381111561382057600080fd5b8201601f8101841361383157600080fd5b612c548482356020840161351a565b6000806020838503121561385357600080fd5b82356001600160401b038082111561386a57600080fd5b818501915085601f83011261387e57600080fd5b81358181111561388d57600080fd5b8660208260051b85010111156138a257600080fd5b60209290920196919550909350505050565b80516001600160a01b031682526020808201516001600160401b03169083015260408082015115159083015260609081015162ffffff16910152565b6020808252825182820181905260009190848201906040850190845b81811015611b035761391f8385516138b4565b928401926080929092019160010161390c565b803560ff811681146132b357600080fd5b600080600080600080600080610100898b03121561396057600080fd5b88359750602089013596506040890135955061397e60608a0161329c565b94506080890135935061399360a08a01613932565b925060c0890135915060e089013590509295985092959890939650565b6000602082840312156139c257600080fd5b8135610cbd81613460565b6000602082840312156139df57600080fd5b610cbd8261329c565b6020808252825182820181905260009190848201906040850190845b81811015611b0357835183529284019291840191600101613a04565b600080600060608486031215613a3557600080fd5b613a3e8461329c565b9250613a4c6020850161329c565b915060408401356001600160401b03811115613a6757600080fd5b613a73868287016134bf565b9150509250925092565b600080600060608486031215613a9257600080fd5b613a9b8461329c565b95602085013595506040909401359392505050565b60008060408385031215613ac357600080fd5b613acc8361329c565b915060208301356134b481613460565b600080600080600060a08688031215613af457600080fd5b8535945060208601359350613b0b60408701613932565b94979396509394606081013594506080013592915050565b861515815285602082015284604082015260c060608201526000613b4a60c0830186613244565b93151560808301525090151560a090910152949350505050565b60008060008060808587031215613b7a57600080fd5b613b838561329c565b9350613b916020860161329c565b92506040850135915060608501356001600160401b03811115613bb357600080fd5b61360987828801613571565b60008060408385031215613bd257600080fd5b50508035926020909101359150565b60808101610b2a82846138b4565b600080600080600060a08688031215613c0757600080fd5b85359450613c176020870161329c565b9350613b0b60408701613932565b60008060408385031215613c3857600080fd5b613c418361329c565b9150613c4f6020840161329c565b90509250929050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415613c9857613c98613c6e565b5060010190565b600181811c90821680613cb357607f821691505b60208210811415613cd457634e487b7160e01b600052602260045260246000fd5b50919050565b60008219821115613ced57613ced613c6e565b500190565b6000816000190483118215151615613d0c57613d0c613c6e565b500290565b600082613d2e57634e487b7160e01b600052601260045260246000fd5b500490565b600060208284031215613d4557600080fd5b8151610cbd81613460565b600060208284031215613d6257600080fd5b5051919050565b600082821015613d7b57613d7b613c6e565b500390565b600081613d8f57613d8f613c6e565b506000190190565b60008151613da9818560208601613218565b9290920192915050565b600080855481600182811c915080831680613dcf57607f831692505b6020808410821415613def57634e487b7160e01b86526022600452602486fd5b818015613e035760018114613e1457613e41565b60ff19861689528489019650613e41565b60008c81526020902060005b86811015613e395781548b820152908501908301613e20565b505084890196505b505050505050613e5a613e548287613d97565b85613d97565b9695505050505050565b6001600160a01b0385811682528416602082015260408101839052608060608201819052600090613e5a90830184613244565b600060208284031215613ea957600080fd5b8151610cbd816131e5565b634e487b7160e01b600052603160045260246000fdfea2646970667358221220bf708b897d52e88fcce43ef5a74a7a1f96b328ac9c128027ed40a82913f240f064736f6c63430008090033

Deployed ByteCode

0x6080604052600436106102ee5760003560e01c8063715018a611610186578063ac7dc68d116100d7578063d111515d11610085578063d111515d146108fd578063dd06555914610912578063ddddefc714610932578063e985e9c514610952578063f2fde38b1461099b578063f4d40a9c146109bb578063fb0c402b14610a0257600080fd5b8063ac7dc68d14610828578063b88d4fde1461083d578063be4f182c14610850578063c23dc68f14610870578063c2873f041461089d578063c87b56dd146108bd578063c9d48579146108dd57600080fd5b80638da5cb5b116101345780638da5cb5b1461075557806395d89b411461077357806399a2557a14610788578063a22cb465146107a8578063a2309ff8146107c8578063a4fb233c146107e1578063abdc30331461080157600080fd5b8063715018a614610688578063748a500a1461069d578063796b89ec146106b25780638462151c146106d257806389476069146106ff57806389b5a8c21461071f5780638a19c8bc1461073f57600080fd5b80633bc91e28116102405780635b7633d0116101ee5780635b7633d0146105a25780635bbb2177146105c8578063616cdb1e146105f55780636352211e146106155780636c22e06e146106355780636e453d621461064857806370a082311461066857600080fd5b80633bc91e28146104d85780633ccfd60b146104f85780633d6a57451461050d5780633e9dbed01461052d57806342842e0e1461054f578063511e1d511461056257806355f804b31461058257600080fd5b80631c1cb3231161029d5780631c1cb3231461040f5780631e14d44b1461042f57806323b872dd1461044f5780632fdea6541461046257806332ab9bbe1461048257806332cb6b0c146104a25780633aeb7501146104b857600080fd5b80620319df146102fa57806301ffc9a71461032557806306fdde0314610355578063081812fc14610377578063095ea7b3146103af5780630ebbb09c146103c457806318160ddd146103f257600080fd5b366102f557005b600080fd5b34801561030657600080fd5b5061030f610a22565b60405161031c9190613196565b60405180910390f35b34801561033157600080fd5b506103456103403660046131fb565b610b10565b604051901515815260200161031c565b34801561036157600080fd5b5061036a610b30565b60405161031c9190613270565b34801561038357600080fd5b50610397610392366004613283565b610bc2565b6040516001600160a01b03909116815260200161031c565b6103c26103bd3660046132b8565b610c06565b005b3480156103d057600080fd5b506103e46103df3660046132b8565b610ca6565b60405190815260200161031c565b3480156103fe57600080fd5b5060015460005403600019016103e4565b34801561041b57600080fd5b50602054610397906001600160a01b031681565b34801561043b57600080fd5b506103c261044a366004613283565b610cc4565b6103c261045d3660046132e2565b610cd1565b34801561046e57600080fd5b506103c261047d36600461346e565b610e63565b34801561048e57600080fd5b506103c261049d366004613591565b610f3e565b3480156104ae57600080fd5b506103e461155a81565b3480156104c457600080fd5b506103c26104d33660046136a8565b610f88565b3480156104e457600080fd5b506103c26104f3366004613283565b610fae565b34801561050457600080fd5b506103c2610fe9565b34801561051957600080fd5b506103c26105283660046132b8565b610ffd565b34801561053957600080fd5b5061054261101c565b60405161031c919061376c565b6103c261055d3660046132e2565b611231565b34801561056e57600080fd5b506103c261057d3660046137c3565b611251565b34801561058e57600080fd5b506103c261059d3660046137f8565b6113b3565b3480156105ae57600080fd5b50601e54610397906201000090046001600160a01b031681565b3480156105d457600080fd5b506105e86105e3366004613840565b6113f2565b60405161031c91906138f0565b34801561060157600080fd5b506103c2610610366004613283565b6114a4565b34801561062157600080fd5b50610397610630366004613283565b6114b1565b6103c2610643366004613943565b6114bc565b34801561065457600080fd5b506103c26106633660046139b0565b611891565b34801561067457600080fd5b506103e46106833660046139cd565b6118b3565b34801561069457600080fd5b506103c2611901565b3480156106a957600080fd5b5061030f611913565b3480156106be57600080fd5b506103c26106cd3660046139cd565b6119f8565b3480156106de57600080fd5b506106f26106ed3660046139cd565b611a22565b60405161031c91906139e8565b34801561070b57600080fd5b506103c261071a3660046139cd565b611b0f565b34801561072b57600080fd5b506103c261073a366004613a20565b611c18565b34801561074b57600080fd5b506103e4601f5481565b34801561076157600080fd5b506008546001600160a01b0316610397565b34801561077f57600080fd5b5061036a611c5a565b34801561079457600080fd5b506106f26107a3366004613a7d565b611c69565b3480156107b457600080fd5b506103c26107c3366004613ab0565b611df2565b3480156107d457600080fd5b50600054600019016103e4565b3480156107ed57600080fd5b506103c26107fc366004613adc565b611e63565b34801561080d57600080fd5b50610816611eb5565b60405161031c96959493929190613b23565b34801561083457600080fd5b506103e4611f84565b6103c261084b366004613b64565b611f98565b34801561085c57600080fd5b506103c261086b366004613bbf565b611fdc565b34801561087c57600080fd5b5061089061088b366004613283565b61215b565b60405161031c9190613be1565b3480156108a957600080fd5b506103c26108b83660046139b0565b6121ab565b3480156108c957600080fd5b5061036a6108d8366004613283565b6121c6565b3480156108e957600080fd5b506103c26108f8366004613bef565b612326565b34801561090957600080fd5b506103c2612393565b34801561091e57600080fd5b506103c261092d36600461346e565b6123aa565b34801561093e57600080fd5b506103e461094d3660046132b8565b6124b5565b34801561095e57600080fd5b5061034561096d366004613c25565b6001600160a01b03918216600090815260076020908152604080832093909416825291909152205460ff1690565b3480156109a757600080fd5b506103c26109b63660046139cd565b612655565b3480156109c757600080fd5b506103e46109d6366004613283565b6017546000908152600e60209081526040808320601f5484528252808320938352929052206003015490565b348015610a0e57600080fd5b506106f2610a1d366004613283565b6126d3565b6012546060906000816001600160401b03811115610a4257610a4261331e565b604051908082528060200260200182016040528015610a8757816020015b6040805180820190915260008082526020820152815260200190600190039081610a605790505b5060185460009081526013602052604081209192505b83811015610b07576000838281518110610ab957610ab9613c58565b6020026020010151905060128281548110610ad657610ad6613c58565b6000918252602080832090910154808452825284815260409091205491015280610aff81613c84565b915050610a9d565b50909392505050565b6000610b1b8261278f565b80610b2a5750610b2a8261278f565b92915050565b606060028054610b3f90613c9f565b80601f0160208091040260200160405190810160405280929190818152602001828054610b6b90613c9f565b8015610bb85780601f10610b8d57610100808354040283529160200191610bb8565b820191906000526020600020905b815481529060010190602001808311610b9b57829003601f168201915b5050505050905090565b6000610bcd826127dd565b610bea576040516333d1c03960e21b815260040160405180910390fd5b506000908152600660205260409020546001600160a01b031690565b6000610c11826114b1565b9050336001600160a01b03821614610c4a57610c2d813361096d565b610c4a576040516367d9dca160e11b815260040160405180910390fd5b60008281526006602052604080822080546001600160a01b0319166001600160a01b0387811691821790925591518593918516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591a4505050565b6000610cbd610cb584846124b5565b601b54612812565b9392505050565b610ccc612828565b601c55565b6000610cdc82612882565b9050836001600160a01b0316816001600160a01b031614610d0f5760405162a1148160e81b815260040160405180910390fd5b60008281526006602052604090208054338082146001600160a01b03881690911417610d5c57610d3f863361096d565b610d5c57604051632ce44b5f60e11b815260040160405180910390fd5b6001600160a01b038516610d8357604051633a954ecd60e21b815260040160405180910390fd5b8015610d8e57600082555b6001600160a01b038681166000908152600560205260408082208054600019019055918716808252919020805460010190554260a01b17600160e11b17600085815260046020526040902055600160e11b8316610e195760018401600081815260046020526040902054610e17576000548114610e175760008181526004602052604090208490555b505b83856001600160a01b0316876001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a45b505050505050565b610e6b612828565b8015610e935760188054906000610e8183613c84565b90915550610e939050601260006130b8565b6018546000908152601360205260408120905b8351811015610f38576000848281518110610ec357610ec3613c58565b6020908102919091018101518051818301516000828152938790526040909320929092559150610ef46012826128eb565b610f2e57601280546001810182556000919091527fbb8a6a4669ba250d26cd7a459eca9d215f8307e33aebe50379bc5a3617ec3444018190555b5050600101610ea6565b50505050565b60005b8251811015610f8157610f6f8585858481518110610f6157610f61613c58565b602002602001015185611f98565b80610f7981613c84565b915050610f41565b5050505050565b610f90612828565b610f9a8686611251565b610fa48484610e63565b610e5b82826123aa565b610fb6612828565b601f81905560405181907fe13ec1fa9c3ede43997fc070c234a83909ba45575dd0ad079ea7138418cc846590600090a250565b610ff1612828565b610ffb3347612946565b565b611005612828565b61100e816129c3565b6110188282612a0c565b5050565b6017546000908152600f60205260408120606091805b60115481101561108b578260006011838154811061105257611052613c58565b9060005260206000200154815260200190815260200160002054826110779190613cda565b91508061108381613c84565b915050611032565b506000816001600160401b038111156110a6576110a661331e565b60405190808252806020026020018201604052801561110257816020015b6110ef6040518060800160405280600081526020016000815260200160008152602001600081525090565b8152602001906001900390816110c45790505b5090506000805b6011548110156112275760006011828154811061112857611128613c58565b6000918252602080832090910154808352908890526040822054909250905b81811015611211576017546000908152601060209081526040808320868452909152812080548390811061117d5761117d613c58565b60009182526020808320909101546017548352600e825260408084208885528352808420828552909252908220895191935091908990899081106111c3576111c3613c58565b60209081029190910181015187815290810184905260028301546040820152600383015460608201529050876111f881613c84565b985050505050808061120990613c84565b915050611147565b505050808061121f90613c84565b915050611109565b5090949350505050565b61124c83838360405180602001604052806000815250611f98565b505050565b611259612828565b8015611281576017805490600061126f83613c84565b909155506112819050601160006130b8565b6017546000908152600e60209081526040808320600f8352818420601090935290832090925b8551811015610e5b5760008682815181106112c4576112c4613c58565b60209081029190910181015180516000818152888452604080822084860180518452955290819020828155935160018501558201516002840155606082015160038401556004830154919350919060ff1615611322575050506113ab565b60048101805460ff191660019081179091556000838152602088815260408083208054850190558882528220868201518154948501825590835291209091015561136d6011836128eb565b6113a757601180546001810182556000919091527f31ecc21a745e3968a04e9570e4425bc18fa8019c68028196b546d1669c200c68018290555b5050505b6001016112a7565b6113bb612828565b601a5460ff16156113df5760405163777821ff60e11b815260040160405180910390fd5b805161101890601d9060208401906130d6565b6060816000816001600160401b0381111561140f5761140f61331e565b60405190808252806020026020018201604052801561144857816020015b61143561315a565b81526020019060019003908161142d5790505b50905060005b82811461149b5761147686868381811061146a5761146a613c58565b9050602002013561215b565b82828151811061148857611488613c58565b602090810291909101015260010161144e565b50949350505050565b6114ac612828565b601b55565b6000610b2a82612882565b6114c4612a26565b601f546114e457604051636f312cbd60e01b815260040160405180910390fd5b83600088126114fe576114fb88601087901b613cda565b90505b61154c8182898960405160200161153593929190928352602083019190915260601b6001600160601b031916604082015260540190565b604051602081830303815290604052868686612a80565b6017546000908152600e60209081526040808320601f548452909152812090808a126115755750885b60008181526020839052604090206004015460ff166115c45760008080526020839052604090206004015460ff166115c057604051637c75aa6f60e11b815260040160405180910390fd5b5060005b6115cd8b6129c3565b6000808b126115d95750895b8b6115e43383610ca6565b101561160357604051633ce4251960e01b815260040160405180910390fd5b50600081815260208390526040812060030154611620908d613cf2565b6000858152600d60209081526040909120600190555490915081906001600160a01b03161561164d575060005b80341461166d57604051630551cf2960e01b815260040160405180910390fd5b50611678338d612a0c565b601f54600090815260166020526040812080548e9290611699908490613cda565b9091555050336000908152600a6020526040812080548e92906116bd908490613cda565b9091555050336000908152600b60209081526040808320601f5484528252808320858452909152812080548e92906116f6908490613cda565b9091555050336000908152600c60209081526040808320858452909152812080548e9290611725908490613cda565b909155506000905061271061173a8c84613cf2565b6117449190613d11565b6020549091506001600160a01b03161561186e576020546040516323b872dd60e01b8152336004820152306024820152604481018490526001600160a01b039091169081906323b872dd90606401602060405180830381600087803b1580156117ac57600080fd5b505af11580156117c0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117e49190613d33565b5060405163a9059cbb60e01b81526001600160a01b038c811660048301526024820184905282169063a9059cbb90604401602060405180830381600087803b15801561182f57600080fd5b505af1158015611843573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118679190613d33565b5050611878565b6118788a82612946565b50505050506118876001600955565b5050505050505050565b611899612828565b601e80549115156101000261ff0019909216919091179055565b60006001600160a01b0382166118dc576040516323d3ad8160e21b815260040160405180910390fd5b506001600160a01b03166000908152600560205260409020546001600160401b031690565b611909612828565b610ffb6000612af2565b6015546060906000816001600160401b038111156119335761193361331e565b60405190808252806020026020018201604052801561197857816020015b60408051808201909152600080825260208201528152602001906001900390816119515790505b5060195460009081526014602052604081209192505b83811015610b075760008382815181106119aa576119aa613c58565b60200260200101519050601582815481106119c7576119c7613c58565b60009182526020808320909101548084528252848152604090912054910152806119f081613c84565b91505061198e565b611a00612828565b602080546001600160a01b0319166001600160a01b0392909216919091179055565b60606000806000611a32856118b3565b90506000816001600160401b03811115611a4e57611a4e61331e565b604051908082528060200260200182016040528015611a77578160200160208202803683370190505b509050611a8261315a565b60015b838614611b0357611a9581612b44565b9150816040015115611aa657611afb565b81516001600160a01b031615611abb57815194505b876001600160a01b0316856001600160a01b03161415611afb5780838780600101985081518110611aee57611aee613c58565b6020026020010181815250505b600101611a85565b50909695505050505050565b611b17612828565b6040516370a0823160e01b815230600482015281906001600160a01b0382169063a9059cbb90339083906370a082319060240160206040518083038186803b158015611b6257600080fd5b505afa158015611b76573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b9a9190613d50565b6040516001600160e01b031960e085901b1681526001600160a01b0390921660048301526024820152604401602060405180830381600087803b158015611be057600080fd5b505af1158015611bf4573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061124c9190613d33565b60005b8151811015610f3857611c488484848481518110611c3b57611c3b613c58565b6020026020010151610cd1565b80611c5281613c84565b915050611c1b565b606060038054610b3f90613c9f565b6060818310611c8b57604051631960ccad60e11b815260040160405180910390fd5b600080611c9760005490565b90506001851015611ca757600194505b80841115611cb3578093505b6000611cbe876118b3565b905084861015611cdd5785850381811015611cd7578091505b50611ce1565b5060005b6000816001600160401b03811115611cfb57611cfb61331e565b604051908082528060200260200182016040528015611d24578160200160208202803683370190505b50905081611d37579350610cbd92505050565b6000611d428861215b565b905060008160400151611d53575080515b885b888114158015611d655750848714155b15611de157611d7381612b44565b9250826040015115611d8457611dd9565b82516001600160a01b031615611d9957825191505b8a6001600160a01b0316826001600160a01b03161415611dd95780848880600101995081518110611dcc57611dcc613c58565b6020026020010181815250505b600101611d55565b505050928352509095945050505050565b3360008181526007602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b905090565b611e9a858686604051602001611e83929190918252602082015260400190565b604051602081830303815290604052858585612a80565b6000858152600d6020526040902060019055610f8184610fae565b601a54601b54601c54601e54601d8054600095869586956060958795869560ff958616959192610100810483169216908390611ef090613c9f565b80601f0160208091040260200160405190810160405280929190818152602001828054611f1c90613c9f565b8015611f695780601f10611f3e57610100808354040283529160200191611f69565b820191906000526020600020905b815481529060010190602001808311611f4c57829003601f168201915b50505050509250955095509550955095509550909192939495565b6000805460001901611e5e9061155a613d69565b611fa3848484610cd1565b6001600160a01b0383163b15610f3857611fbf84848484612b64565b610f38576040516368d2bf6b60e11b815260040160405180910390fd5b611fe4612828565b6017546000818152600e6020908152604080832086845282528083208584528252808320938352600f9091529020600482015460ff166120375760405163d73251d760e01b815260040160405180910390fd5b600080835560018301819055600283018190556003830181905560048301805460ff1916905584815260208290526040812080549161207583613d80565b909155505060175460009081526010602090815260408083208784529091528120805490915b818110156120e857858382815481106120b6576120b6613c58565b906000526020600020015414156120d6576120d18382612c5c565b6120e8565b806120e081613c84565b91505061209b565b50600086815260208490526040902054610e5b575060125460005b8181101561215257866012828154811061211f5761211f613c58565b906000526020600020015414156121405761213b601282612c5c565b612152565b8061214a81613c84565b915050612103565b50505050505050565b61216361315a565b61216b61315a565b600183108061217c57506000548310155b156121875792915050565b61219083612b44565b90508060400151156121a25792915050565b610cbd83612cd1565b6121b3612828565b601e805460ff1916911515919091179055565b60606121d1826127dd565b6121ee57604051634a1850bf60e11b815260040160405180910390fd5b601d80546121fb90613c9f565b1515905061221757505060408051602081019091526000815290565b601e5460ff16156122b457601d805461222f90613c9f565b80601f016020809104026020016040519081016040528092919081815260200182805461225b90613c9f565b80156122a85780601f1061227d576101008083540402835291602001916122a8565b820191906000526020600020905b81548152906001019060200180831161228b57829003601f168201915b50505050509050919050565b604080516020810190915260008152601e54610100900460ff16156122f15750604080518082019091526005815264173539b7b760d91b60208201525b601d6122fc84612cea565b8260405160200161230f93929190613db3565b604051602081830303815290604052915050919050565b612353858686604051602001611e8392919091825260601b6001600160601b031916602082015260340190565b5050506000918252600d602052604090912060019055601e80546001600160a01b03909216620100000262010000600160b01b0319909216919091179055565b61239b612828565b601a805460ff19166001179055565b6123b2612828565b80156123da57601980549060006123c883613c84565b909155506123da9050601560006130b8565b6019546000908152601460205260408120905b8351811015610f3857600084828151811061240a5761240a613c58565b6020908102919091018101518082015181516000908152928690526040832055601554909250815b8181101561246e578351601580548390811061245057612450613c58565b9060005260206000200154141561246657600192505b600101612432565b50816124aa578251601580546001810182556000919091527f55f448fdea98c4d29eb340757ef0a66cd03dbb9538908a6a81d96026b71ec47501555b5050506001016123ed565b6001600160a01b0382166000818152600a6020908152604080832054601854845260138352818420601f5480865290845282852054601954865260148552838620888752855283862054878752600b86528487208388528652848720898852865284872054978752600c865284872089885286528487205483885260169096529386205495969295879591949392158061254f5750848110155b8061255a5750838210155b806125675750601c548710155b806125725750848110155b15612587576000975050505050505050610b2a565b6017546000908152600e60209081526040808320601f54845282528083208c84529091529020600481015460ff16156125c257806002015496505b8684106125da57600098505050505050505050610b2a565b600088601c546125ea9190613d69565b905060006125f8868a613d69565b90506000612606858a613d69565b90506000612614878a613d69565b905061264261263561262f6126298787612812565b85612812565b83612812565b61263d611f84565b612812565b9f9e505050505050505050505050505050565b61265d612828565b6001600160a01b0381166126c75760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084015b60405180910390fd5b6126d081612af2565b50565b601754600090815260106020908152604080832084845290915281208054606092816001600160401b0381111561270c5761270c61331e565b604051908082528060200260200182016040528015612735578160200160208202803683370190505b50905060005b8281101561149b5783818154811061275557612755613c58565b906000526020600020015482828151811061277257612772613c58565b60209081029190910101528061278781613c84565b91505061273b565b60006301ffc9a760e01b6001600160e01b0319831614806127c057506380ac58cd60e01b6001600160e01b03198316145b80610b2a5750506001600160e01b031916635b5e139f60e01b1490565b6000816001111580156127f1575060005482105b8015610b2a575050600090815260046020526040902054600160e01b161590565b60008183106128215781610cbd565b5090919050565b6008546001600160a01b03163314610ffb5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016126be565b600081806001116128d2576000548110156128d257600081815260046020526040902054600160e01b81166128d0575b80610cbd5750600019016000818152600460205260409020546128b2565b505b604051636f96cda160e11b815260040160405180910390fd5b8154600090815b8181101561293b578385828154811061290d5761290d613c58565b9060005260206000200154141561292957600192505050610b2a565b8061293381613c84565b9150506128f2565b506000949350505050565b8061294f575050565b6000826001600160a01b03168260405160006040518083038185875af1925050503d806000811461299c576040519150601f19603f3d011682016040523d82523d6000602084013e6129a1565b606091505b505090508061124c576040516328316c4d60e11b815260040160405180910390fd5b600081116129e45760405163162908e360e11b815260040160405180910390fd5b806129ed611f84565b10156126d05760405163671317e960e11b815260040160405180910390fd5b611018828260405180602001604052806000815250612d86565b60026009541415612a795760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016126be565b6002600955565b6000858152600d602052604090205415612aad5760405163256f5cdd60e11b815260040160405180910390fd5b601e546201000090046001600160a01b0316612acb85858585612dec565b6001600160a01b031614610f8157604051638baa579f60e01b815260040160405180910390fd5b600880546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b612b4c61315a565b600082815260046020526040902054610b2a90612ea6565b604051630a85bd0160e11b81526000906001600160a01b0385169063150b7a0290612b99903390899088908890600401613e64565b602060405180830381600087803b158015612bb357600080fd5b505af1925050508015612be3575060408051601f3d908101601f19168201909252612be091810190613e97565b60015b612c3e573d808015612c11576040519150601f19603f3d011682016040523d82523d6000602084013e612c16565b606091505b508051612c36576040516368d2bf6b60e11b815260040160405180910390fd5b805181602001fd5b6001600160e01b031916630a85bd0160e11b1490505b949350505050565b81548290612c6c90600190613d69565b81548110612c7c57612c7c613c58565b9060005260206000200154828281548110612c9957612c99613c58565b906000526020600020018190555081805480612cb757612cb7613eb4565b600190038181906000526020600020016000905590555050565b612cd961315a565b610b2a612ce583612882565b612ea6565b60606000612cf783612ee9565b60010190506000816001600160401b03811115612d1657612d1661331e565b6040519080825280601f01601f191660200182016040528015612d40576020820181803683370190505b5090508181016020015b600019016f181899199a1a9b1b9c1cb0b131b232b360811b600a86061a8153600a8504945084612d7957612d7e565b612d4a565b509392505050565b612d908383612fc1565b6001600160a01b0383163b1561124c576000548281035b612dba6000868380600101945086612b64565b612dd7576040516368d2bf6b60e11b815260040160405180910390fd5b818110612da7578160005414610f8157600080fd5b600060018580519060200120604051602001612e3491907f19457468657265756d205369676e6564204d6573736167653a0a3332000000008152601c810191909152603c0190565b60408051601f198184030181528282528051602091820120600084529083018083525260ff871690820152606081018590526080810184905260a0016020604051602081039080840390855afa158015612e92573d6000803e3d6000fd5b5050604051601f1901519695505050505050565b612eae61315a565b6001600160a01b03821681526001600160401b0360a083901c166020820152600160e01b82161515604082015260e89190911c606082015290565b60008072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b8310612f285772184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b830492506040015b6d04ee2d6d415b85acef81000000008310612f54576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc100008310612f7257662386f26fc10000830492506010015b6305f5e1008310612f8a576305f5e100830492506008015b6127108310612f9e57612710830492506004015b60648310612fb0576064830492506002015b600a8310610b2a5760010192915050565b60005481612fe25760405163b562e8dd60e01b815260040160405180910390fd5b6001600160a01b03831660008181526005602090815260408083208054680100000000000000018802019055848352600490915281206001851460e11b4260a01b178317905582840190839083907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8180a4600183015b81811461309157808360007fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef600080a4600101613059565b50816130af57604051622e076360e81b815260040160405180910390fd5b60005550505050565b50805460008255906000526020600020908101906126d09190613181565b8280546130e290613c9f565b90600052602060002090601f016020900481019282613104576000855561314a565b82601f1061311d57805160ff191683800117855561314a565b8280016001018555821561314a579182015b8281111561314a57825182559160200191906001019061312f565b50613156929150613181565b5090565b60408051608081018252600080825260208201819052918101829052606081019190915290565b5b808211156131565760008155600101613182565b602080825282518282018190526000919060409081850190868401855b828110156131d8578151805185528601518685015292840192908501906001016131b3565b5091979650505050505050565b6001600160e01b0319811681146126d057600080fd5b60006020828403121561320d57600080fd5b8135610cbd816131e5565b60005b8381101561323357818101518382015260200161321b565b83811115610f385750506000910152565b6000815180845261325c816020860160208601613218565b601f01601f19169290920160200192915050565b602081526000610cbd6020830184613244565b60006020828403121561329557600080fd5b5035919050565b80356001600160a01b03811681146132b357600080fd5b919050565b600080604083850312156132cb57600080fd5b6132d48361329c565b946020939093013593505050565b6000806000606084860312156132f757600080fd5b6133008461329c565b925061330e6020850161329c565b9150604084013590509250925092565b634e487b7160e01b600052604160045260246000fd5b604080519081016001600160401b03811182821017156133565761335661331e565b60405290565b604051608081016001600160401b03811182821017156133565761335661331e565b604051601f8201601f191681016001600160401b03811182821017156133a6576133a661331e565b604052919050565b60006001600160401b038211156133c7576133c761331e565b5060051b60200190565b600082601f8301126133e257600080fd5b813560206133f76133f2836133ae565b61337e565b82815260069290921b8401810191818101908684111561341657600080fd5b8286015b8481101561345557604081890312156134335760008081fd5b61343b613334565b81358152848201358582015283529183019160400161341a565b509695505050505050565b80151581146126d057600080fd5b6000806040838503121561348157600080fd5b82356001600160401b0381111561349757600080fd5b6134a3858286016133d1565b92505060208301356134b481613460565b809150509250929050565b600082601f8301126134d057600080fd5b813560206134e06133f2836133ae565b82815260059290921b840181019181810190868411156134ff57600080fd5b8286015b848110156134555780358352918301918301613503565b60006001600160401b038311156135335761353361331e565b613546601f8401601f191660200161337e565b905082815283838301111561355a57600080fd5b828260208301376000602084830101529392505050565b600082601f83011261358257600080fd5b610cbd8383356020850161351a565b600080600080608085870312156135a757600080fd5b6135b08561329c565b93506135be6020860161329c565b925060408501356001600160401b03808211156135da57600080fd5b6135e6888389016134bf565b935060608701359150808211156135fc57600080fd5b5061360987828801613571565b91505092959194509250565b600082601f83011261362657600080fd5b813560206136366133f2836133ae565b82815260079290921b8401810191818101908684111561365557600080fd5b8286015b8481101561345557608081890312156136725760008081fd5b61367a61335c565b8135815284820135858201526040808301359082015260608083013590820152835291830191608001613659565b60008060008060008060c087890312156136c157600080fd5b86356001600160401b03808211156136d857600080fd5b6136e48a838b01613615565b9750602089013591506136f682613460565b9095506040880135908082111561370c57600080fd5b6137188a838b016133d1565b95506060890135915061372a82613460565b9093506080880135908082111561374057600080fd5b5061374d89828a016133d1565b92505060a087013561375e81613460565b809150509295509295509295565b602080825282518282018190526000919060409081850190868401855b828110156131d857815180518552868101518786015285810151868601526060908101519085015260809093019290850190600101613789565b600080604083850312156137d657600080fd5b82356001600160401b038111156137ec57600080fd5b6134a385828601613615565b60006020828403121561380a57600080fd5b81356001600160401b0381111561382057600080fd5b8201601f8101841361383157600080fd5b612c548482356020840161351a565b6000806020838503121561385357600080fd5b82356001600160401b038082111561386a57600080fd5b818501915085601f83011261387e57600080fd5b81358181111561388d57600080fd5b8660208260051b85010111156138a257600080fd5b60209290920196919550909350505050565b80516001600160a01b031682526020808201516001600160401b03169083015260408082015115159083015260609081015162ffffff16910152565b6020808252825182820181905260009190848201906040850190845b81811015611b035761391f8385516138b4565b928401926080929092019160010161390c565b803560ff811681146132b357600080fd5b600080600080600080600080610100898b03121561396057600080fd5b88359750602089013596506040890135955061397e60608a0161329c565b94506080890135935061399360a08a01613932565b925060c0890135915060e089013590509295985092959890939650565b6000602082840312156139c257600080fd5b8135610cbd81613460565b6000602082840312156139df57600080fd5b610cbd8261329c565b6020808252825182820181905260009190848201906040850190845b81811015611b0357835183529284019291840191600101613a04565b600080600060608486031215613a3557600080fd5b613a3e8461329c565b9250613a4c6020850161329c565b915060408401356001600160401b03811115613a6757600080fd5b613a73868287016134bf565b9150509250925092565b600080600060608486031215613a9257600080fd5b613a9b8461329c565b95602085013595506040909401359392505050565b60008060408385031215613ac357600080fd5b613acc8361329c565b915060208301356134b481613460565b600080600080600060a08688031215613af457600080fd5b8535945060208601359350613b0b60408701613932565b94979396509394606081013594506080013592915050565b861515815285602082015284604082015260c060608201526000613b4a60c0830186613244565b93151560808301525090151560a090910152949350505050565b60008060008060808587031215613b7a57600080fd5b613b838561329c565b9350613b916020860161329c565b92506040850135915060608501356001600160401b03811115613bb357600080fd5b61360987828801613571565b60008060408385031215613bd257600080fd5b50508035926020909101359150565b60808101610b2a82846138b4565b600080600080600060a08688031215613c0757600080fd5b85359450613c176020870161329c565b9350613b0b60408701613932565b60008060408385031215613c3857600080fd5b613c418361329c565b9150613c4f6020840161329c565b90509250929050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415613c9857613c98613c6e565b5060010190565b600181811c90821680613cb357607f821691505b60208210811415613cd457634e487b7160e01b600052602260045260246000fd5b50919050565b60008219821115613ced57613ced613c6e565b500190565b6000816000190483118215151615613d0c57613d0c613c6e565b500290565b600082613d2e57634e487b7160e01b600052601260045260246000fd5b500490565b600060208284031215613d4557600080fd5b8151610cbd81613460565b600060208284031215613d6257600080fd5b5051919050565b600082821015613d7b57613d7b613c6e565b500390565b600081613d8f57613d8f613c6e565b506000190190565b60008151613da9818560208601613218565b9290920192915050565b600080855481600182811c915080831680613dcf57607f831692505b6020808410821415613def57634e487b7160e01b86526022600452602486fd5b818015613e035760018114613e1457613e41565b60ff19861689528489019650613e41565b60008c81526020902060005b86811015613e395781548b820152908501908301613e20565b505084890196505b505050505050613e5a613e548287613d97565b85613d97565b9695505050505050565b6001600160a01b0385811682528416602082015260408101839052608060608201819052600090613e5a90830184613244565b600060208284031215613ea957600080fd5b8151610cbd816131e5565b634e487b7160e01b600052603160045260246000fdfea2646970667358221220bf708b897d52e88fcce43ef5a74a7a1f96b328ac9c128027ed40a82913f240f064736f6c63430008090033