Contract Address Details

0xFC966b221fb8ee64f2e7535b3c5c1cc19Bb4Ac93

Token
CryptoBrokeVLX (CBV)
Creator
0x18ce12–c2a391 at 0x473592–2c88da
Balance
2.71017301250085 VLX
Tokens
Fetching tokens...
Transactions
698 Transactions
Transfers
4 Transfers
Gas Used
156,805,394
Last Balance Update
69799306
Contract name:
CryptoBrokeSquad




Optimization enabled
true
Compiler version
v0.8.7+commit.e28d00a7




Optimization runs
200
EVM Version
default




Verified at
2021-12-14T22:29:53.804433Z

Contract source code

// SPDX-License-Identifier: WTFPL

pragma solidity ^0.8.0;

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

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

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

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

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

// File: http://github.com/OpenZeppelin/openzeppelin-contracts/contracts/utils/EnumerableMap.sol

pragma solidity ^0.8.0;

/**
 * @dev Library for managing an enumerable variant of Solidity's
 * https://solidity.readthedocs.io/en/latest/types.html#mapping-types[`mapping`]
 * type.
 *
 * Maps have the following properties:
 *
 * - Entries are added, removed, and checked for existence in constant time
 * (O(1)).
 * - Entries are enumerated in O(n). No guarantees are made on the ordering.
 *
 * ```
 * contract Example {
 *     // Add the library methods
 *     using EnumerableMap for EnumerableMap.UintToAddressMap;
 *
 *     // Declare a set state variable
 *     EnumerableMap.UintToAddressMap private myMap;
 * }
 * ```
 *
 * As of v3.0.0, only maps of type `uint256 -> address` (`UintToAddressMap`) are
 * supported.
 */
library EnumerableMap {
    // To implement this library for multiple types with as little code
    // repetition as possible, we write it in terms of a generic Map type with
    // bytes32 keys and values.
    // The Map implementation uses private functions, and user-facing
    // implementations (such as Uint256ToAddressMap) are just wrappers around
    // the underlying Map.
    // This means that we can only create new EnumerableMaps for types that fit
    // in bytes32.

    struct MapEntry {
        bytes32 _key;
        bytes32 _value;
    }

    struct Map {
        // Storage of map keys and values
        MapEntry[] _entries;
        // Position of the entry defined by a key in the `entries` array, plus 1
        // because index 0 means a key is not in the map.
        mapping(bytes32 => uint256) _indexes;
    }

    /**
     * @dev Adds a key-value pair to a map, or updates the value for an existing
     * key. O(1).
     *
     * Returns true if the key was added to the map, that is if it was not
     * already present.
     */
    function _set(
        Map storage map,
        bytes32 key,
        bytes32 value
    ) private returns (bool) {
        // We read and store the key's index to prevent multiple reads from the same storage slot
        uint256 keyIndex = map._indexes[key];

        if (keyIndex == 0) {
            // Equivalent to !contains(map, key)
            map._entries.push(MapEntry({_key : key, _value : value}));
            // The entry is stored at length-1, but we add 1 to all indexes
            // and use 0 as a sentinel value
            map._indexes[key] = map._entries.length;
            return true;
        } else {
            map._entries[keyIndex - 1]._value = value;
            return false;
        }
    }

    /**
     * @dev Removes a key-value pair from a map. O(1).
     *
     * Returns true if the key was removed from the map, that is if it was present.
     */
    function _remove(Map storage map, bytes32 key) private returns (bool) {
        // We read and store the key's index to prevent multiple reads from the same storage slot
        uint256 keyIndex = map._indexes[key];

        if (keyIndex != 0) {
            // Equivalent to contains(map, key)
            // To delete a key-value pair from the _entries array in O(1), we swap the entry to delete with the last one
            // in the array, and then remove the last entry (sometimes called as 'swap and pop').
            // This modifies the order of the array, as noted in {at}.

            uint256 toDeleteIndex = keyIndex - 1;
            uint256 lastIndex = map._entries.length - 1;

            // When the entry to delete is the last one, the swap operation is unnecessary. However, since this occurs
            // so rarely, we still do the swap anyway to avoid the gas cost of adding an 'if' statement.

            MapEntry storage lastEntry = map._entries[lastIndex];

            // Move the last entry to the index where the entry to delete is
            map._entries[toDeleteIndex] = lastEntry;
            // Update the index for the moved entry
            map._indexes[lastEntry._key] = toDeleteIndex + 1;
            // All indexes are 1-based

            // Delete the slot where the moved entry was stored
            map._entries.pop();

            // Delete the index for the deleted slot
            delete map._indexes[key];

            return true;
        } else {
            return false;
        }
    }

    /**
     * @dev Returns true if the key is in the map. O(1).
     */
    function _contains(Map storage map, bytes32 key)
    private
    view
    returns (bool)
    {
        return map._indexes[key] != 0;
    }

    /**
     * @dev Returns the number of key-value pairs in the map. O(1).
     */
    function _length(Map storage map) private view returns (uint256) {
        return map._entries.length;
    }

    /**
     * @dev Returns the key-value pair stored at position `index` in the map. O(1).
     *
     * Note that there are no guarantees on the ordering of entries inside the
     * array, and it may change when more entries are added or removed.
     *
     * Requirements:
     *
     * - `index` must be strictly less than {length}.
     */
    function _at(Map storage map, uint256 index)
    private
    view
    returns (bytes32, bytes32)
    {
        require(
            map._entries.length > index,
            "EnumerableMap: index out of bounds"
        );

        MapEntry storage entry = map._entries[index];
        return (entry._key, entry._value);
    }

    /**
     * @dev Tries to returns the value associated with `key`.  O(1).
     * Does not revert if `key` is not in the map.
     */
    function _tryGet(Map storage map, bytes32 key)
    private
    view
    returns (bool, bytes32)
    {
        uint256 keyIndex = map._indexes[key];
        if (keyIndex == 0) return (false, 0);
        // Equivalent to contains(map, key)
        return (true, map._entries[keyIndex - 1]._value);
        // All indexes are 1-based
    }

    /**
     * @dev Returns the value associated with `key`.  O(1).
     *
     * Requirements:
     *
     * - `key` must be in the map.
     */
    function _get(Map storage map, bytes32 key) private view returns (bytes32) {
        uint256 keyIndex = map._indexes[key];
        require(keyIndex != 0, "EnumerableMap: nonexistent key");
        // Equivalent to contains(map, key)
        return map._entries[keyIndex - 1]._value;
        // All indexes are 1-based
    }

    /**
     * @dev Same as {_get}, with a custom error message when `key` is not in the map.
     *
     * CAUTION: This function is deprecated because it requires allocating memory for the error
     * message unnecessarily. For custom revert reasons use {_tryGet}.
     */
    function _get(
        Map storage map,
        bytes32 key,
        string memory errorMessage
    ) private view returns (bytes32) {
        uint256 keyIndex = map._indexes[key];
        require(keyIndex != 0, errorMessage);
        // Equivalent to contains(map, key)
        return map._entries[keyIndex - 1]._value;
        // All indexes are 1-based
    }

    // UintToAddressMap

    struct UintToAddressMap {
        Map _inner;
    }

    /**
     * @dev Adds a key-value pair to a map, or updates the value for an existing
     * key. O(1).
     *
     * Returns true if the key was added to the map, that is if it was not
     * already present.
     */
    function set(
        UintToAddressMap storage map,
        uint256 key,
        address value
    ) internal returns (bool) {
        return _set(map._inner, bytes32(key), bytes32(uint256(uint160(value))));
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the key was removed from the map, that is if it was present.
     */
    function remove(UintToAddressMap storage map, uint256 key)
    internal
    returns (bool)
    {
        return _remove(map._inner, bytes32(key));
    }

    /**
     * @dev Returns true if the key is in the map. O(1).
     */
    function contains(UintToAddressMap storage map, uint256 key)
    internal
    view
    returns (bool)
    {
        return _contains(map._inner, bytes32(key));
    }

    /**
     * @dev Returns the number of elements in the map. O(1).
     */
    function length(UintToAddressMap storage map)
    internal
    view
    returns (uint256)
    {
        return _length(map._inner);
    }

    /**
     * @dev Returns the element stored at position `index` in the set. O(1).
     * Note that there are no guarantees on the ordering of values inside the
     * array, and it may change when more values are added or removed.
     *
     * Requirements:
     *
     * - `index` must be strictly less than {length}.
     */
    function at(UintToAddressMap storage map, uint256 index)
    internal
    view
    returns (uint256, address)
    {
        (bytes32 key, bytes32 value) = _at(map._inner, index);
        return (uint256(key), address(uint160(uint256(value))));
    }

    /**
     * @dev Tries to returns the value associated with `key`.  O(1).
     * Does not revert if `key` is not in the map.
     *
     * _Available since v3.4._
     */
    function tryGet(UintToAddressMap storage map, uint256 key)
    internal
    view
    returns (bool, address)
    {
        (bool success, bytes32 value) = _tryGet(map._inner, bytes32(key));
        return (success, address(uint160(uint256(value))));
    }

    /**
     * @dev Returns the value associated with `key`.  O(1).
     *
     * Requirements:
     *
     * - `key` must be in the map.
     */
    function get(UintToAddressMap storage map, uint256 key)
    internal
    view
    returns (address)
    {
        return address(uint160(uint256(_get(map._inner, bytes32(key)))));
    }

    /**
     * @dev Same as {get}, with a custom error message when `key` is not in the map.
     *
     * CAUTION: This function is deprecated because it requires allocating memory for the error
     * message unnecessarily. For custom revert reasons use {tryGet}.
     */
    function get(
        UintToAddressMap storage map,
        uint256 key,
        string memory errorMessage
    ) internal view returns (address) {
        return
        address(
            uint160(uint256(_get(map._inner, bytes32(key), errorMessage)))
        );
    }
}

// File: http://github.com/OpenZeppelin/openzeppelin-contracts/contracts/utils/EnumerableSet.sol

pragma solidity ^0.8.0;

/**
 * @dev Library for managing
 * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive
 * types.
 *
 * Sets have the following properties:
 *
 * - Elements are added, removed, and checked for existence in constant time
 * (O(1)).
 * - Elements are enumerated in O(n). No guarantees are made on the ordering.
 *
 * ```
 * contract Example {
 *     // Add the library methods
 *     using EnumerableSet for EnumerableSet.AddressSet;
 *
 *     // Declare a set state variable
 *     EnumerableSet.AddressSet private mySet;
 * }
 * ```
 *
 * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`)
 * and `uint256` (`UintSet`) are supported.
 */
library EnumerableSet {
    // To implement this library for multiple types with as little code
    // repetition as possible, we write it in terms of a generic Set type with
    // bytes32 values.
    // The Set implementation uses private functions, and user-facing
    // implementations (such as AddressSet) are just wrappers around the
    // underlying Set.
    // This means that we can only create new EnumerableSets for types that fit
    // in bytes32.

    struct Set {
        // Storage of set values
        bytes32[] _values;
        // Position of the value in the `values` array, plus 1 because index 0
        // means a value is not in the set.
        mapping(bytes32 => uint256) _indexes;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function _add(Set storage set, bytes32 value) private returns (bool) {
        if (!_contains(set, value)) {
            set._values.push(value);
            // The value is stored at length-1, but we add 1 to all indexes
            // and use 0 as a sentinel value
            set._indexes[value] = set._values.length;
            return true;
        } else {
            return false;
        }
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function _remove(Set storage set, bytes32 value) private returns (bool) {
        // We read and store the value's index to prevent multiple reads from the same storage slot
        uint256 valueIndex = set._indexes[value];

        if (valueIndex != 0) {
            // Equivalent to contains(set, value)
            // To delete an element from the _values array in O(1), we swap the element to delete with the last one in
            // the array, and then remove the last element (sometimes called as 'swap and pop').
            // This modifies the order of the array, as noted in {at}.

            uint256 toDeleteIndex = valueIndex - 1;
            uint256 lastIndex = set._values.length - 1;

            // When the value to delete is the last one, the swap operation is unnecessary. However, since this occurs
            // so rarely, we still do the swap anyway to avoid the gas cost of adding an 'if' statement.

            bytes32 lastvalue = set._values[lastIndex];

            // Move the last value to the index where the value to delete is
            set._values[toDeleteIndex] = lastvalue;
            // Update the index for the moved value
            set._indexes[lastvalue] = toDeleteIndex + 1;
            // All indexes are 1-based

            // Delete the slot where the moved value was stored
            set._values.pop();

            // Delete the index for the deleted slot
            delete set._indexes[value];

            return true;
        } else {
            return false;
        }
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function _contains(Set storage set, bytes32 value)
    private
    view
    returns (bool)
    {
        return set._indexes[value] != 0;
    }

    /**
     * @dev Returns the number of values on the set. O(1).
     */
    function _length(Set storage set) private view returns (uint256) {
        return set._values.length;
    }

    /**
     * @dev Returns the value stored at position `index` in the set. O(1).
     *
     * Note that there are no guarantees on the ordering of values inside the
     * array, and it may change when more values are added or removed.
     *
     * Requirements:
     *
     * - `index` must be strictly less than {length}.
     */
    function _at(Set storage set, uint256 index)
    private
    view
    returns (bytes32)
    {
        require(
            set._values.length > index,
            "EnumerableSet: index out of bounds"
        );
        return set._values[index];
    }

    // Bytes32Set

    struct Bytes32Set {
        Set _inner;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function add(Bytes32Set storage set, bytes32 value)
    internal
    returns (bool)
    {
        return _add(set._inner, value);
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function remove(Bytes32Set storage set, bytes32 value)
    internal
    returns (bool)
    {
        return _remove(set._inner, value);
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function contains(Bytes32Set storage set, bytes32 value)
    internal
    view
    returns (bool)
    {
        return _contains(set._inner, value);
    }

    /**
     * @dev Returns the number of values in the set. O(1).
     */
    function length(Bytes32Set storage set) internal view returns (uint256) {
        return _length(set._inner);
    }

    /**
     * @dev Returns the value stored at position `index` in the set. O(1).
     *
     * Note that there are no guarantees on the ordering of values inside the
     * array, and it may change when more values are added or removed.
     *
     * Requirements:
     *
     * - `index` must be strictly less than {length}.
     */
    function at(Bytes32Set storage set, uint256 index)
    internal
    view
    returns (bytes32)
    {
        return _at(set._inner, index);
    }

    // AddressSet

    struct AddressSet {
        Set _inner;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function add(AddressSet storage set, address value)
    internal
    returns (bool)
    {
        return _add(set._inner, bytes32(uint256(uint160(value))));
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function remove(AddressSet storage set, address value)
    internal
    returns (bool)
    {
        return _remove(set._inner, bytes32(uint256(uint160(value))));
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function contains(AddressSet storage set, address value)
    internal
    view
    returns (bool)
    {
        return _contains(set._inner, bytes32(uint256(uint160(value))));
    }

    /**
     * @dev Returns the number of values in the set. O(1).
     */
    function length(AddressSet storage set) internal view returns (uint256) {
        return _length(set._inner);
    }

    /**
     * @dev Returns the value stored at position `index` in the set. O(1).
     *
     * Note that there are no guarantees on the ordering of values inside the
     * array, and it may change when more values are added or removed.
     *
     * Requirements:
     *
     * - `index` must be strictly less than {length}.
     */
    function at(AddressSet storage set, uint256 index)
    internal
    view
    returns (address)
    {
        return address(uint160(uint256(_at(set._inner, index))));
    }

    // UintSet

    struct UintSet {
        Set _inner;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function add(UintSet storage set, uint256 value) internal returns (bool) {
        return _add(set._inner, bytes32(value));
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function remove(UintSet storage set, uint256 value)
    internal
    returns (bool)
    {
        return _remove(set._inner, bytes32(value));
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function contains(UintSet storage set, uint256 value)
    internal
    view
    returns (bool)
    {
        return _contains(set._inner, bytes32(value));
    }

    /**
     * @dev Returns the number of values on the set. O(1).
     */
    function length(UintSet storage set) internal view returns (uint256) {
        return _length(set._inner);
    }

    /**
     * @dev Returns the value stored at position `index` in the set. O(1).
     *
     * Note that there are no guarantees on the ordering of values inside the
     * array, and it may change when more values are added or removed.
     *
     * Requirements:
     *
     * - `index` must be strictly less than {length}.
     */
    function at(UintSet storage set, uint256 index)
    internal
    view
    returns (uint256)
    {
        return uint256(_at(set._inner, index));
    }
}

// File: http://github.com/OpenZeppelin/openzeppelin-contracts/contracts/utils/Address.sol

pragma solidity ^0.8.0;

/**
 * @dev Collection of functions related to the address type
 */
library Address {
    /**
     * @dev Returns true if `account` is a contract.
     *
     * [IMPORTANT]
     * ====
     * It is unsafe to assume that an address for which this function returns
     * false is an externally-owned account (EOA) and not a contract.
     *
     * Among others, `isContract` will return false for the following
     * types of addresses:
     *
     *  - an externally-owned account
     *  - a contract in construction
     *  - an address where a contract will be created
     *  - an address where a contract lived, but was destroyed
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies on extcodesize, which returns 0 for contracts in
        // construction, since the code is only stored at the end of the
        // constructor execution.

        uint256 size;
        // solhint-disable-next-line no-inline-assembly
        assembly {
            size := extcodesize(account)
        }
        return size > 0;
    }

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

        // solhint-disable-next-line avoid-low-level-calls, avoid-call-value
        (bool success,) = recipient.call{value : amount}("");
        require(
            success,
            "Address: unable to send value, recipient may have reverted"
        );
    }

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

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

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

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

        // solhint-disable-next-line avoid-low-level-calls
        (bool success, bytes memory returndata) = target.call{value : value}(
            data
        );
        return _verifyCallResult(success, returndata, errorMessage);
    }

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

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

        // solhint-disable-next-line avoid-low-level-calls
        (bool success, bytes memory returndata) = target.staticcall(data);
        return _verifyCallResult(success, returndata, errorMessage);
    }

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

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

        // solhint-disable-next-line avoid-low-level-calls
        (bool success, bytes memory returndata) = target.delegatecall(data);
        return _verifyCallResult(success, returndata, errorMessage);
    }

    function _verifyCallResult(
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) private pure returns (bytes memory) {
        if (success) {
            return returndata;
        } else {
            // Look for revert reason and bubble it up if present
            if (returndata.length > 0) {
                // The easiest way to bubble the revert reason is using memory via assembly

                // solhint-disable-next-line no-inline-assembly
                assembly {
                    let returndata_size := mload(returndata)
                    revert(add(32, returndata), returndata_size)
                }
            } else {
                revert(errorMessage);
            }
        }
    }
}

// File: http://github.com/OpenZeppelin/openzeppelin-contracts/contracts/introspection/ERC165.sol

pragma solidity ^0.8.0;

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

// File: http://github.com/OpenZeppelin/openzeppelin-contracts/contracts/token/ERC721/IERC721.sol

pragma solidity ^0.8.0;

/**
 * @dev Implementation of the {IERC165} interface.
 *
 * Contracts may inherit from this and call {_registerInterface} to declare
 * their support of an interface.
 */
abstract contract ERC165 is IERC165 {
    /**
     * @dev Mapping of interface ids to whether or not it's supported.
     */
    mapping(bytes4 => bool) private _supportedInterfaces;

    constructor() {
        // Derived contracts need only register support for their own interfaces,
        // we register support for ERC165 itself here
        _registerInterface(type(IERC165).interfaceId);
    }

    /**
     * @dev See {IERC165-supportsInterface}.
     *
     * Time complexity O(1), guaranteed to always use less than 30 000 gas.
     */
    function supportsInterface(bytes4 interfaceId)
    public
    view
    virtual
    override
    returns (bool)
    {
        return _supportedInterfaces[interfaceId];
    }

    /**
     * @dev Registers the contract as an implementer of the interface defined by
     * `interfaceId`. Support of the actual ERC165 interface is automatic and
     * registering its interface id is not required.
     *
     * See {IERC165-supportsInterface}.
     *
     * Requirements:
     *
     * - `interfaceId` cannot be the ERC165 invalid interface (`0xffffffff`).
     */
    function _registerInterface(bytes4 interfaceId) internal virtual {
        require(interfaceId != 0xffffffff, "ERC165: invalid interface id");
        _supportedInterfaces[interfaceId] = true;
    }
}

// File: http://github.com/OpenZeppelin/openzeppelin-contracts/contracts/token/ERC721/IERC721Receiver.sol

pragma solidity ^0.8.0;

/**
 * @dev Required interface of an ERC721 compliant contract.
 */
interface IERC721 is IERC165 {
    /**
     * @dev Emitted when `tokenId` token is transferred from `from` to `to`.
     */
    event Transfer(
        address indexed from,
        address indexed to,
        uint256 indexed tokenId
    );

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

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

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

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

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

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

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

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

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

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

    /**
     * @dev Safely transfers `tokenId` token from `from` to `to`.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must exist and be owned by `from`.
     * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
     *
     * Emits a {Transfer} event.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 tokenId,
        bytes calldata data
    ) external;
}

pragma solidity ^0.8.0;

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

// File: http://github.com/OpenZeppelin/openzeppelin-contracts/contracts/token/ERC721/IERC721Enumerable.sol

pragma solidity ^0.8.0;

/**
 * @title ERC-721 Non-Fungible Token Standard, optional enumeration extension
 * @dev See https://eips.ethereum.org/EIPS/eip-721
 */
interface IERC721Enumerable is IERC721 {
    /**
     * @dev Returns the total amount of tokens stored by the contract.
     */
    function totalSupply() external view returns (uint256);

    /**
     * @dev Returns a token ID owned by `owner` at a given `index` of its token list.
     * Use along with {balanceOf} to enumerate all of ``owner``'s tokens.
     */
    function tokenOfOwnerByIndex(address owner, uint256 index)
    external
    view
    returns (uint256 tokenId);

    /**
     * @dev Returns a token ID at a given `index` of all the tokens stored by the contract.
     * Use along with {totalSupply} to enumerate all tokens.
     */
    function tokenByIndex(uint256 index) external view returns (uint256);
}

// File: http://github.com/OpenZeppelin/openzeppelin-contracts/contracts/token/ERC721/IERC721Metadata.sol

pragma solidity ^0.8.0;

/**
 * @title ERC-721 Non-Fungible Token Standard, optional metadata extension
 * @dev See https://eips.ethereum.org/EIPS/eip-721
 */
interface IERC721Metadata is IERC721 {
    /**
     * @dev Returns the token collection name.
     */
    function name() external view returns (string memory);

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

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

// File: http://github.com/OpenZeppelin/openzeppelin-contracts/contracts/introspection/IERC165.sol

// File: http://github.com/OpenZeppelin/openzeppelin-contracts/contracts/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 GSN 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) {
        this;
        // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
        return msg.data;
    }
}

// File: http://github.com/OpenZeppelin/openzeppelin-contracts/contracts/token/ERC721/ERC721.sol

pragma solidity ^0.8.0;

/**
 * @title ERC721 Non-Fungible Token Standard basic implementation
 * @dev see https://eips.ethereum.org/EIPS/eip-721
 */
contract ERC721 is
Context,
ERC165,
IERC721,
IERC721Metadata,
IERC721Enumerable
{
    using Address for address;
    using EnumerableSet for EnumerableSet.UintSet;
    using EnumerableMap for EnumerableMap.UintToAddressMap;
    using Strings for uint256;
    struct Price {
        uint256 tokenId;
        uint256 price;
        TokenState state;
    }
    enum TokenState {
        Pending,
        ForSale,
        Sold,
        Transferred,
        Neutral
    }


    // Mapping from holder address to their (enumerable) set of owned tokens
    mapping(address => EnumerableSet.UintSet) private _holderTokens;

    // Enumerable mapping from token ids to their owners
    EnumerableMap.UintToAddressMap private _tokenOwners;

    uint256 private availableNfts;

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

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

    // Token name
    string private _name;

    // Token symbol
    string private _symbol;

    // Optional mapping for token URIs
    mapping(uint256 => string) private _tokenURIs;

    // Base URI
    string private _baseURI;

    /**
     * @dev Initializes the contract by setting a `name` and a `symbol` to the token collection.
     */
    constructor(string memory name_, string memory symbol_) {
        _name = name_;
        _symbol = symbol_;

        // register the supported interfaces to conform to ERC721 via ERC165
        _registerInterface(type(IERC721).interfaceId);
        _registerInterface(type(IERC721Metadata).interfaceId);
        _registerInterface(type(IERC721Enumerable).interfaceId);
    }

    /**
     * @dev See {IERC721-balanceOf}.
     */
    function balanceOf(address owner)
    public
    view
    virtual
    override
    returns (uint256)
    {
        require(
            owner != address(0),
            "ERC721: balance query for the zero address"
        );
        return _holderTokens[owner].length();
    }

    /**
     * @dev See {IERC721-ownerOf}.
     */
    function ownerOf(uint256 tokenId)
    public
    view
    virtual
    override
    returns (address)
    {
        return
        _tokenOwners.get(
            tokenId,
            "ERC721: owner query for nonexistent token"
        );
    }

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

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

    /**
     * @dev See {IERC721Metadata-tokenURI}.
     */
    function tokenURI(uint256 tokenId)
    public
    view
    virtual
    override
    returns (string memory)
    {
        require(
            _exists(tokenId),
            "ERC721Metadata: URI query for nonexistent token"
        );

        string memory _tokenURI = _tokenURIs[tokenId];
        string memory base = baseURI();
        string memory json = ".json";

        // If there is no base URI, return the token URI.
        if (bytes(base).length == 0) {
            return _tokenURI;
        }
        // If both are set, concatenate the baseURI and tokenURI (via abi.encodePacked).
        if (bytes(_tokenURI).length > 0) {
            return string(abi.encodePacked(base, _tokenURI));
        }
        // If there is a baseURI but no tokenURI, concatenate the tokenID to the baseURI.
        return string(abi.encodePacked(base, tokenId.toString(), json));
    }

    /**
     * @dev Returns the base URI set via {_setBaseURI}. This will be
     * automatically added as a prefix in {tokenURI} to each token's URI, or
     * to the token ID if no specific URI is set for that token ID.
     */
    function baseURI() public view virtual returns (string memory) {
        return _baseURI;
    }

    /**
     * @dev See {IERC721Enumerable-tokenOfOwnerByIndex}.
     */
    function tokenOfOwnerByIndex(address owner, uint256 index)
    public
    view
    virtual
    override
    returns (uint256)
    {
        return _holderTokens[owner].at(index);
    }

    /**
     * @dev See {IERC721Enumerable-totalSupply}.
     */
    function totalSupply() public view virtual override returns (uint256) {
        // _tokenOwners are indexed by tokenIds, so .length() returns the number of tokenIds
        return _tokenOwners.length();
    }

    /**
     * @dev See {IERC721Enumerable-tokenByIndex}.
     */
    function tokenByIndex(uint256 index)
    public
    view
    virtual
    override
    returns (uint256)
    {
        (uint256 tokenId,) = _tokenOwners.at(index);
        return tokenId;
    }

    /**
     * @dev See {IERC721-approve}.
     */
    function approve(address to, uint256 tokenId) public virtual override {
        address owner = ERC721.ownerOf(tokenId);
        require(to != owner, "ERC721: approval to current owner");

        require(
            _msgSender() == owner ||
            ERC721.isApprovedForAll(owner, _msgSender()),
            "ERC721: approve caller is not owner nor approved for all"
        );

        _approve(to, tokenId);
    }

    /**
     * @dev See {IERC721-getApproved}.
     */
    function getApproved(uint256 tokenId)
    public
    view
    virtual
    override
    returns (address)
    {
        require(
            _exists(tokenId),
            "ERC721: approved query for nonexistent token"
        );

        return _tokenApprovals[tokenId];
    }

    /**
     * @dev See {IERC721-setApprovalForAll}.
     */
    function setApprovalForAll(address operator, bool approved)
    public
    virtual
    override
    {
        require(operator != _msgSender(), "ERC721: approve to caller");

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

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

    /**
     * @dev See {IERC721-transferFrom}.
     */
    function transferFrom(
        address from,
        address to,
        uint256 tokenId
    ) public virtual override {
        //solhint-disable-next-line max-line-length
        require(
            _isApprovedOrOwner(_msgSender(), tokenId),
            "ERC721: transfer caller is not owner nor approved"
        );

        _transfer(from, to, tokenId);
    }

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

    /**
     * @dev See {IERC721-safeTransferFrom}.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 tokenId,
        bytes memory _data
    ) public virtual override {
        require(
            _isApprovedOrOwner(_msgSender(), tokenId),
            "ERC721: transfer caller is not owner nor approved"
        );
        _safeTransfer(from, to, tokenId, _data);
    }

    /**
     * @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.
     *
     * `_data` is additional data, it has no specified format and it is sent in call to `to`.
     *
     * This internal function is equivalent to {safeTransferFrom}, and can be used to e.g.
     * implement alternative mechanisms to perform token transfer, such as signature-based.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must exist and be owned by `from`.
     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
     *
     * Emits a {Transfer} event.
     */
    function _safeTransfer(
        address from,
        address to,
        uint256 tokenId,
        bytes memory _data
    ) internal virtual {
        _transfer(from, to, tokenId);
        require(
            _checkOnERC721Received(from, to, tokenId, _data),
            "ERC721: transfer to non ERC721Receiver implementer"
        );
    }

    /**
     * @dev Returns whether `tokenId` exists.
     *
     * Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}.
     *
     * Tokens start existing when they are minted (`_mint`),
     * and stop existing when they are burned (`_burn`).
     */
    function _exists(uint256 tokenId) internal view virtual returns (bool) {
        return _tokenOwners.contains(tokenId);
    }

    /**
     * @dev Returns whether `spender` is allowed to manage `tokenId`.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function _isApprovedOrOwner(address spender, uint256 tokenId)
    internal
    view
    virtual
    returns (bool)
    {
        require(
            _exists(tokenId),
            "ERC721: operator query for nonexistent token"
        );
        address owner = ERC721.ownerOf(tokenId);
        return (spender == owner ||
        getApproved(tokenId) == spender ||
        ERC721.isApprovedForAll(owner, spender));
    }

    /**
     * @dev Safely mints `tokenId` and transfers it to `to`.
     *
     * Requirements:
     d*
     * - `tokenId` must not exist.
     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
     *
     * Emits a {Transfer} event.
     */
    function _safeMint(address to, uint256 tokenId) internal virtual {
        _safeMint(to, tokenId, "");
    }

    /**
     * @dev Same as {xref-ERC721-_safeMint-address-uint256-}[`_safeMint`], with an additional `data` parameter which is
     * forwarded in {IERC721Receiver-onERC721Received} to contract recipients.
     */
    function _safeMint(
        address to,
        uint256 tokenId,
        bytes memory _data
    ) internal virtual {
        _mint(to, tokenId);
        require(
            _checkOnERC721Received(address(0), to, tokenId, _data),
            "ERC721: transfer to non ERC721Receiver implementer"
        );
    }

    /**
     * @dev Mints `tokenId` and transfers it to `to`.
     *
     * WARNING: Usage of this method is discouraged, use {_safeMint} whenever possible
     *
     * Requirements:
     *
     * - `tokenId` must not exist.
     * - `to` cannot be the zero address.
     *
     * Emits a {Transfer} event.
     */
    function _mint(address to, uint256 tokenId) internal virtual {
        require(to != address(0), "ERC721: mint to the zero address");
        require(!_exists(tokenId), "ERC721: token already minted");

        _beforeTokenTransfer(address(0), to, tokenId);

        _holderTokens[to].add(tokenId);

        _tokenOwners.set(tokenId, to);

        emit Transfer(address(0), to, tokenId);
    }

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

        _beforeTokenTransfer(owner, address(0), tokenId);

        // Clear approvals
        _approve(address(0), tokenId);

        // Clear metadata (if any)
        if (bytes(_tokenURIs[tokenId]).length != 0) {
            delete _tokenURIs[tokenId];
        }

        _holderTokens[owner].remove(tokenId);

        _tokenOwners.remove(tokenId);

        emit Transfer(owner, address(0), tokenId);
    }

    /**
     * @dev Transfers `tokenId` from `from` to `to`.
     *  As opposed to {transferFrom}, this imposes no restrictions on msg.sender.
     *
     * Requirements:
     *
     * - `to` cannot be the zero address.
     * - `tokenId` token must be owned by `from`.
     *
     * Emits a {Transfer} event.
     */
    function _transfer(
        address from,
        address to,
        uint256 tokenId
    ) internal virtual {
        require(
            ERC721.ownerOf(tokenId) == from,
            "ERC721: transfer of token that is not own"
        );
        // internal owner
        require(to != address(0), "ERC721: transfer to the zero address");

        _beforeTokenTransfer(from, to, tokenId);

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

        _holderTokens[from].remove(tokenId);
        _holderTokens[to].add(tokenId);

        _tokenOwners.set(tokenId, to);
        emit Transfer(from, to, tokenId);
    }

    /**
     * @dev Sets `_tokenURI` as the tokenURI of `tokenId`.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function _setTokenURI(uint256 tokenId, string memory _tokenURI)
    internal
    virtual
    {
        require(
            _exists(tokenId),
            "ERC721Metadata: URI set of nonexistent token"
        );
        _tokenURIs[tokenId] = _tokenURI;
    }

    /**
     * @dev Internal function to set the base URI for all token IDs. It is
     * automatically added as a prefix to the value returned in {tokenURI},
     * or to the token ID if {tokenURI} is empty.
     */
    function _setBaseURI(string memory baseURI_) internal virtual {
        _baseURI = baseURI_;
    }

    /**
     * @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target address.
     * The call is not executed if the target address is not a contract.
     *
     * @param from address representing the previous owner of the given token ID
     * @param to target address that will receive the tokens
     * @param tokenId uint256 ID of the token to be transferred
     * @param _data bytes optional data to send along with the call
     * @return bool whether the call correctly returned the expected magic value
     */
    function _checkOnERC721Received(address from, address to, uint256 tokenId, bytes memory _data) private returns (bool) {
        if (to.isContract()) {
            try
            IERC721Receiver(to).onERC721Received(
                _msgSender(),
                from,
                tokenId,
                _data
            )
            returns (bytes4 retval) {
                return retval == IERC721Receiver(to).onERC721Received.selector;
            } catch (bytes memory reason) {
                if (reason.length == 0) {
                    revert(
                    "ERC721: transfer to non ERC721Receiver implementer"
                    );
                } else {
                    // solhint-disable-next-line no-inline-assembly
                    assembly {
                        revert(add(32, reason), mload(reason))
                    }
                }
            }
        } else {
            return true;
        }
    }

    function _approve(address to, uint256 tokenId) private {
        _tokenApprovals[tokenId] = to;
        emit Approval(ERC721.ownerOf(tokenId), to, tokenId);
        // internal owner
    }

    /**
     * @dev Hook that is called before any token transfer. This includes minting
     * and burning.
     *
     * 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, ``from``'s `tokenId` will be burned.
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     *
     * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
     */
    function _beforeTokenTransfer(
        address from,
        address to,
        uint256 tokenId
    ) internal virtual {}
}

// File: http://github.com/OpenZeppelin/openzeppelin-contracts/contracts/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() {
        address msgSender = _msgSender();
        _owner = msgSender;
        emit OwnershipTransferred(address(0), msgSender);
    }

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

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

    /**
     * @dev Leaves the contract without owner. It will not be possible to call
     * `onlyOwner` functions anymore. Can only be called by the current owner.
     *
     * NOTE: Renouncing ownership will leave the contract without an owner,
     * thereby removing any functionality that is only available to the owner.
     */
    function renounceOwnership() public virtual onlyOwner {
        emit OwnershipTransferred(_owner, address(0));
        _owner = 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"
        );
        emit OwnershipTransferred(_owner, newOwner);
        _owner = newOwner;
    }
}

// File: https://github.com/OpenZeppelin/openzeppelin-contracts/contracts/utils/math/SafeMath.sol

pragma solidity ^0.8.0;

// CAUTION
// This version of SafeMath should only be used with Solidity 0.8 or later,
// because it relies on the compiler's built in overflow checks.

/**
 * @dev Wrappers over Solidity's arithmetic operations.
 *
 * NOTE: `SafeMath` is no longer needed starting with Solidity 0.8. The compiler
 * now has built in overflow checking.
 */
library SafeMath {
    /**
     * @dev Returns the addition of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function tryAdd(uint256 a, uint256 b)
    internal
    pure
    returns (bool, uint256)
    {
    unchecked {
        uint256 c = a + b;
        if (c < a) return (false, 0);
        return (true, c);
    }
    }

    /**
     * @dev Returns the substraction of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function trySub(uint256 a, uint256 b)
    internal
    pure
    returns (bool, uint256)
    {
    unchecked {
        if (b > a) return (false, 0);
        return (true, a - b);
    }
    }

    /**
     * @dev Returns the multiplication of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function tryMul(uint256 a, uint256 b)
    internal
    pure
    returns (bool, uint256)
    {
    unchecked {
        // Gas optimization: this is cheaper than requiring 'a' not being zero, but the
        // benefit is lost if 'b' is also tested.
        // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
        if (a == 0) return (true, 0);
        uint256 c = a * b;
        if (c / a != b) return (false, 0);
        return (true, c);
    }
    }

    /**
     * @dev Returns the division of two unsigned integers, with a division by zero flag.
     *
     * _Available since v3.4._
     */
    function tryDiv(uint256 a, uint256 b)
    internal
    pure
    returns (bool, uint256)
    {
    unchecked {
        if (b == 0) return (false, 0);
        return (true, a / b);
    }
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.
     *
     * _Available since v3.4._
     */
    function tryMod(uint256 a, uint256 b)
    internal
    pure
    returns (bool, uint256)
    {
    unchecked {
        if (b == 0) return (false, 0);
        return (true, a % b);
    }
    }

    /**
     * @dev Returns the addition of two unsigned integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `+` operator.
     *
     * Requirements:
     *
     * - Addition cannot overflow.
     */
    function add(uint256 a, uint256 b) internal pure returns (uint256) {
        return a + b;
    }

    /**
     * @dev Returns the subtraction of two unsigned integers, reverting on
     * overflow (when the result is negative).
     *
     * Counterpart to Solidity's `-` operator.
     *
     * Requirements:
     *
     * - Subtraction cannot overflow.
     */
    function sub(uint256 a, uint256 b) internal pure returns (uint256) {
        return a - b;
    }

    /**
     * @dev Returns the multiplication of two unsigned integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `*` operator.
     *
     * Requirements:
     *
     * - Multiplication cannot overflow.
     */
    function mul(uint256 a, uint256 b) internal pure returns (uint256) {
        return a * b;
    }

    /**
     * @dev Returns the integer division of two unsigned integers, reverting on
     * division by zero. The result is rounded towards zero.
     *
     * Counterpart to Solidity's `/` operator.
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function div(uint256 a, uint256 b) internal pure returns (uint256) {
        return a / b;
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
     * reverting when dividing by zero.
     *
     * Counterpart to Solidity's `%` operator. This function uses a `revert`
     * opcode (which leaves remaining gas untouched) while Solidity uses an
     * invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function mod(uint256 a, uint256 b) internal pure returns (uint256) {
        return a % b;
    }

    /**
     * @dev Returns the subtraction of two unsigned integers, reverting with custom message on
     * overflow (when the result is negative).
     *
     * CAUTION: This function is deprecated because it requires allocating memory for the error
     * message unnecessarily. For custom revert reasons use {trySub}.
     *
     * Counterpart to Solidity's `-` operator.
     *
     * Requirements:
     *
     * - Subtraction cannot overflow.
     */
    function sub(
        uint256 a,
        uint256 b,
        string memory errorMessage
    ) internal pure returns (uint256) {
    unchecked {
        require(b <= a, errorMessage);
        return a - b;
    }
    }

    /**
     * @dev Returns the integer division of two unsigned integers, reverting with custom message on
     * division by zero. The result is rounded towards zero.
     *
     * Counterpart to Solidity's `%` operator. This function uses a `revert`
     * opcode (which leaves remaining gas untouched) while Solidity uses an
     * invalid opcode to revert (consuming all remaining gas).
     *
     * Counterpart to Solidity's `/` operator. Note: this function uses a
     * `revert` opcode (which leaves remaining gas untouched) while Solidity
     * uses an invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function div(
        uint256 a,
        uint256 b,
        string memory errorMessage
    ) internal pure returns (uint256) {
    unchecked {
        require(b > 0, errorMessage);
        return a / b;
    }
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
     * reverting with custom message when dividing by zero.
     *
     * CAUTION: This function is deprecated because it requires allocating memory for the error
     * message unnecessarily. For custom revert reasons use {tryMod}.
     *
     * Counterpart to Solidity's `%` operator. This function uses a `revert`
     * opcode (which leaves remaining gas untouched) while Solidity uses an
     * invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function mod(
        uint256 a,
        uint256 b,
        string memory errorMessage
    ) internal pure returns (uint256) {
    unchecked {
        require(b > 0, errorMessage);
        return a % b;
    }
    }
}

interface IERC20 {
    function name() external view returns (string memory);

    function symbol() external view returns (string memory);

    function decimals() external view returns (uint8);

    function totalSupply() external view returns (uint256);

    function balanceOf(address account) external view returns (uint256);

    function transfer(address recipient, uint256 amount) external returns (bool);

    function allowance(address owner, address spender) external view returns (uint256);

    function approve(address spender, uint256 amount) external returns (bool);

    function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);

    function permit(address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) external;

    event Transfer(address indexed from, address indexed to, uint256 value);
    event Approval(address indexed owner, address indexed spender, uint256 value);
}

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

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

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

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

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

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

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

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

pragma solidity ^0.8.0;

contract CryptoBrokeSquad is ERC721, Ownable {
    using SafeMath for uint256;
    using SafeERC20 for IERC20;
    uint16 public constant maxSupply = 666;
    uint256 public nftRemaining = maxSupply;
    uint128 public nftPrice = 100000000000000000000; // 100 VLX
    uint8 public maxToMint = 10; // Per transaction
    uint8 public whitelistedIndex = 0;
    uint8 public maxWhitelistedAmount = 25;
    bool public saleHasStarted = false;

    address private dev1 = 0x18cE125C45CC119F7cFFd4Bc255211Bdd2C2a391;
    address private dev2 = 0x3d996BdF946dd88Dd693Db5984992B5534A23D00;
    address private artist = 0x27f7c30858290Ca926F5F804bC7Ea892da2e04A0;

    mapping(uint256 => uint256) private orderToId;
    mapping(address => bool) public isWhitelisted;
    mapping(uint256 => uint256) public mintedNfts;

    string public METADATA_PROVENANCE_HASH = "";

    constructor() ERC721("CryptoBrokeVLX", "CBV") {
        setBaseURI("https://cryptobrokesquad.xyz/api/files/");
    }

    /**
     * @notice Get all ERC721 tokens ID owned by address
     * @param _owner An address of the owner
     * @return An array of all held tokens ID
     */

    function tokensOfOwner(address _owner) external view returns (uint256[] memory) {
        uint256 tokenCount = balanceOf(_owner);
        if (tokenCount == 0) {
            return new uint256[](0);
        } else {
            uint256[] memory result = new uint256[](tokenCount);
            uint256 index;
            for (index = 0; index < tokenCount; index++) {
                result[index] = tokenOfOwnerByIndex(_owner, index);
            }
            return result;
        }
    }

    /**
     * @notice Set the maximum of random NFTs to mint per transaction
     * @param _max maximum of NFTs
     */

    function setMaxToMint(uint8 _max) public onlyOwner {
        maxToMint = _max;
    }

    /**
     * @notice Set the price of NFTs
     * @param _price Price of the NFT
     */

    function setPrice(uint128 _price) public onlyOwner {
        nftPrice = _price;
    }

    /**
     * @notice Allow to avoid duplicates using randomly chosen indexes
     * @param currentIndex id of NFT to mint
     * @param randomIndex random id
     * @return a non-duplicated version of currentIndex for minting
     */

    function _fillOrderToId(uint256 currentIndex, uint256 randomIndex) internal returns (uint256) {
        uint256 temp = currentIndex;
        if (orderToId[currentIndex] > 0) {
            temp = orderToId[currentIndex];
        }
        orderToId[currentIndex] = randomIndex;
        if (orderToId[randomIndex] > 0) {
            orderToId[currentIndex] = orderToId[randomIndex];
        }
        orderToId[randomIndex] = temp;
        return orderToId[currentIndex];
    }

    /**
     * @notice Create some on-chain randomness
     * @return A pseudo-random number
     */

    function createRandomness() internal view returns (uint256) {
        return uint256(
            keccak256(
                abi.encodePacked(block.timestamp + block.difficulty + ((uint256(keccak256(abi.encodePacked(block.coinbase)))) / block.timestamp) + block.gaslimit + ((uint256(keccak256(abi.encodePacked(_msgSender())))) / block.timestamp) + block.number)
            )
        ) / nftRemaining;
    }

    /**
     * @dev Emitted when someone mints an NFT
     * @param tokenId is the minted token ID
     * @param minter is the minter address
     */

    event Minted(uint256 tokenId, address minter);

    /**
     * @notice Mint a random nft that is not minted yet
     * @param nftsNumber number of NFTs to mint
     */

    function mintRandomNft(uint8 nftsNumber) public payable {
        require(saleHasStarted == true, "Sale is not live");
        require(nftsNumber > 0, "Minting number cannot be negative");
        require(nftsNumber <= maxToMint, "Minting number per transaction exceeded");
        require(totalSupply() + nftsNumber <= maxSupply, "Mint less NFTs, hard cap exceeded");
        require(msg.value == nftsNumber * nftPrice, "Value not correct");

        uint256 _nftRemaining = nftRemaining;

        for (uint8 i = 0; i < nftsNumber; i++) {
            uint256 mintIndexOutOfRandom = createRandomness() % _nftRemaining;
            uint256 mintIndex = _fillOrderToId(--_nftRemaining, mintIndexOutOfRandom);
            _safeMint(msg.sender, mintIndex);
            mintedNfts[maxSupply - _nftRemaining - 1] = mintIndex;
            emit Minted(mintIndex, msg.sender);
        }
        nftRemaining = _nftRemaining;
    }


    /**
     * @notice Minting function that can be called for airdrop purpose
     * @param nftIds Ids of the NFTs to mint
     * @param recipients addresses of the recipients
     */

    function mintNftsById(uint16[] memory nftIds, address[] memory recipients) public onlyOwner {
        require(_isUniqueArray(nftIds), "Ids should be unique");
        require(nftIds.length == recipients.length, "You must set the exact same amount of recipient");
        require(totalSupply() + nftIds.length < maxSupply, "Mint less NFTs, hard cap exceeded");

        uint256 _nftRemaining = nftRemaining;

        for (uint8 i = 0; i < nftIds.length; i++) {
            uint16 mintIndex = nftIds[i];
            require(mintIndex >= 0 && mintIndex < maxSupply, "Id boundaries exceeded");
            _safeMint(recipients[i], mintIndex);
            --_nftRemaining;
            mintedNfts[maxSupply - _nftRemaining - 1] = mintIndex;
            emit Minted(mintIndex, recipients[i]);
        }
        nftRemaining = _nftRemaining;
    }

    /**
     * @notice Minting function for minting 1 NFT by a lucky whitelisted user
     */

    function mintNftForWhitelisted() public {
        require(isWhitelisted[address(msg.sender)], "Need to be whitelisted");
        require(nftRemaining > 0, "No NFTs left");

        uint256 _nftRemaining = nftRemaining;
        uint256 mintIndexOutOfRandom = createRandomness() % _nftRemaining;
        uint256 mintIndex = _fillOrderToId(--_nftRemaining, mintIndexOutOfRandom);
        _safeMint(msg.sender, mintIndex);
        mintedNfts[maxSupply - _nftRemaining - 1] = mintIndex;
        emit Minted(mintIndex, msg.sender);

        isWhitelisted[msg.sender] = false;

        nftRemaining = _nftRemaining;
    }

    function getAllMinted(
    ) public view returns (uint256[] memory) {
        uint256[] memory allNfts = new uint256[](totalSupply());
        for (uint i = 0; i < totalSupply(); i++) {
            allNfts[i] = mintedNfts[i];
        }
        return allNfts;
    }

    /**
     * @notice Check if the array of IDs is unique (no duplicates)
     * @param nftIds array to check
     * @return a bool that tells if the array is unique or not
     */

    function _isUniqueArray(uint16[] memory nftIds) internal pure returns (bool) {
        bool isUnique = true;
        uint256 nftIdsLength = nftIds.length;
        for (uint16 i = 0; i < nftIdsLength; i++) {
            for (uint16 j = 0; j < nftIdsLength; j++) {
                if (j != i) {
                    if (nftIds[j] == nftIds[i]) {
                        isUnique = false;
                    }
                }
            }
        }
        return isUnique;
    }

    /**
     * @notice Add a lucky user to the whitelist
     * @param recipient address to be added
     */

    function addToWhitelist(address recipient) public onlyOwner {
        require(whitelistedIndex < maxWhitelistedAmount, "Amount of whitelisted exceeded");
        whitelistedIndex++;
        isWhitelisted[recipient] = true;
    }

    /**
     * @notice Sets the METADATA_PROVENANCE_HASH to attest of the authenticity of all the NFTs
     * @param _hash string of the hash to set
     */

    function setProvenanceHash(string memory _hash) public onlyOwner {
        METADATA_PROVENANCE_HASH = _hash;
    }

    /**
    * @notice Change the baseURI of .json files
     * @param baseURI string representing the URI
     */

    function setBaseURI(string memory baseURI) public onlyOwner {
        _setBaseURI(baseURI);
    }

    /**
    * @notice Start sale (or restart after pausing)
     */

    function startSale() public onlyOwner {
        saleHasStarted = true;
    }

    /**
    * @notice Pause sale if any error occurred
     */

    function pauseSale() public onlyOwner {
        saleHasStarted = false;
    }

    /**
     * @notice Withdraw coins used to mint NFTs equally
     */

    function withdraw() public payable onlyOwner {
        uint256 contractBalance = address(this).balance;
        payable(dev1).transfer(contractBalance.mul(3333).div(10000));
        payable(dev2).transfer(contractBalance.mul(3333).div(10000));
        payable(artist).transfer(contractBalance.mul(3333).div(10000));
    }

    /**
     * @notice Withdraw ERC20 token sent by error
     * @param token address of the token to recover
     */

    function withdrawToken(address token) public onlyOwner {
        IERC20(token).safeTransfer(msg.sender, balanceOf(address(this)));
    }
}
        

Contract ABI

[{"type":"constructor","stateMutability":"nonpayable","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":"Minted","inputs":[{"type":"uint256","name":"tokenId","internalType":"uint256","indexed":false},{"type":"address","name":"minter","internalType":"address","indexed":false}],"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":"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":"string","name":"","internalType":"string"}],"name":"METADATA_PROVENANCE_HASH","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"addToWhitelist","inputs":[{"type":"address","name":"recipient","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","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":"string","name":"","internalType":"string"}],"name":"baseURI","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256[]","name":"","internalType":"uint256[]"}],"name":"getAllMinted","inputs":[]},{"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"}],"name":"isApprovedForAll","inputs":[{"type":"address","name":"owner","internalType":"address"},{"type":"address","name":"operator","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"isWhitelisted","inputs":[{"type":"address","name":"","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint16","name":"","internalType":"uint16"}],"name":"maxSupply","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint8","name":"","internalType":"uint8"}],"name":"maxToMint","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint8","name":"","internalType":"uint8"}],"name":"maxWhitelistedAmount","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"mintNftForWhitelisted","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"mintNftsById","inputs":[{"type":"uint16[]","name":"nftIds","internalType":"uint16[]"},{"type":"address[]","name":"recipients","internalType":"address[]"}]},{"type":"function","stateMutability":"payable","outputs":[],"name":"mintRandomNft","inputs":[{"type":"uint8","name":"nftsNumber","internalType":"uint8"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"mintedNfts","inputs":[{"type":"uint256","name":"","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"string","name":"","internalType":"string"}],"name":"name","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint128","name":"","internalType":"uint128"}],"name":"nftPrice","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"nftRemaining","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":"pauseSale","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"renounceOwnership","inputs":[]},{"type":"function","stateMutability":"nonpayable","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":"nonpayable","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":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"saleHasStarted","inputs":[]},{"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":"setMaxToMint","inputs":[{"type":"uint8","name":"_max","internalType":"uint8"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setPrice","inputs":[{"type":"uint128","name":"_price","internalType":"uint128"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setProvenanceHash","inputs":[{"type":"string","name":"_hash","internalType":"string"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"startSale","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":"uint256","name":"","internalType":"uint256"}],"name":"tokenByIndex","inputs":[{"type":"uint256","name":"index","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"tokenOfOwnerByIndex","inputs":[{"type":"address","name":"owner","internalType":"address"},{"type":"uint256","name":"index","internalType":"uint256"}]},{"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":"totalSupply","inputs":[]},{"type":"function","stateMutability":"nonpayable","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":"view","outputs":[{"type":"uint8","name":"","internalType":"uint8"}],"name":"whitelistedIndex","inputs":[]},{"type":"function","stateMutability":"payable","outputs":[],"name":"withdraw","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"withdrawToken","inputs":[{"type":"address","name":"token","internalType":"address"}]}]
            

Deployed ByteCode

0x6080604052600436106102675760003560e01c806370a0823111610144578063a773b488116100b6578063d5abeb011161007a578063d5abeb0114610747578063e43252d714610770578063e985e9c514610790578063f0c9dc60146107d9578063f2fde38b146107ee578063f76156131461080e57600080fd5b8063a773b488146106bc578063b66a0e5d146106d1578063b88d4fde146106e6578063c702996414610706578063c87b56dd1461072757600080fd5b8063894760691161010857806389476069146106085780638da5cb5b146106285780638ed0e7281461064657806395d89b4114610666578063a22cb4651461067b578063a2a53c221461069b57600080fd5b806370a082311461057c578063715018a61461059c57806377abf0c8146105b1578063830738ea146105d25780638462151c146105e857600080fd5b80632f745c59116101dd57806342842e0e116101a157806342842e0e146104d25780634f6ccce7146104f257806355367ba91461051257806355f804b3146105275780636352211e146105475780636c0360eb1461056757600080fd5b80632f745c59146104385780633595e9bf146104585780633ae84a821461047a5780633af32abf1461049a5780633ccfd60b146104ca57600080fd5b80630d39fc811161022f5780630d39fc811461036a57806310969523146103a2578063141b4824146103c257806318160ddd146103d557806323b872dd146103f85780632a0cdb601461041857600080fd5b806301ffc9a71461026c57806306fdde03146102bb578063081812fc146102dd578063095ea7b3146103155780630ba133c514610337575b600080fd5b34801561027857600080fd5b506102a6610287366004612f01565b6001600160e01b03191660009081526020819052604090205460ff1690565b60405190151581526020015b60405180910390f35b3480156102c757600080fd5b506102d061083b565b6040516102b29190613124565b3480156102e957600080fd5b506102fd6102f8366004612fad565b6108cd565b6040516001600160a01b0390911681526020016102b2565b34801561032157600080fd5b50610335610330366004612dea565b61095a565b005b34801561034357600080fd5b50600d5461035890600160801b900460ff1681565b60405160ff90911681526020016102b2565b34801561037657600080fd5b50600d5461038a906001600160801b031681565b6040516001600160801b0390911681526020016102b2565b3480156103ae57600080fd5b506103356103bd366004612f3b565b610a70565b6103356103d0366004612fc6565b610ab1565b3480156103e157600080fd5b506103ea610d4e565b6040519081526020016102b2565b34801561040457600080fd5b50610335610413366004612cfb565b610d5f565b34801561042457600080fd5b50610335610433366004612fc6565b610d90565b34801561044457600080fd5b506103ea610453366004612dea565b610dda565b34801561046457600080fd5b5061046d610e05565b6040516102b291906130e0565b34801561048657600080fd5b50610335610495366004612f84565b610ead565b3480156104a657600080fd5b506102a66104b5366004612cad565b60126020526000908152604090205460ff1681565b610335610f02565b3480156104de57600080fd5b506103356104ed366004612cfb565b611011565b3480156104fe57600080fd5b506103ea61050d366004612fad565b61102c565b34801561051e57600080fd5b50610335611042565b34801561053357600080fd5b50610335610542366004612f3b565b61107b565b34801561055357600080fd5b506102fd610562366004612fad565b6110b1565b34801561057357600080fd5b506102d06110d9565b34801561058857600080fd5b506103ea610597366004612cad565b6110e8565b3480156105a857600080fd5b50610335611174565b3480156105bd57600080fd5b50600d5461035890600160881b900460ff1681565b3480156105de57600080fd5b506103ea600c5481565b3480156105f457600080fd5b5061046d610603366004612cad565b6111e8565b34801561061457600080fd5b50610335610623366004612cad565b61129d565b34801561063457600080fd5b50600b546001600160a01b03166102fd565b34801561065257600080fd5b50610335610661366004612e14565b6112e5565b34801561067257600080fd5b506102d061156d565b34801561068757600080fd5b50610335610696366004612db3565b61157c565b3480156106a757600080fd5b50600d5461035890600160901b900460ff1681565b3480156106c857600080fd5b50610335611641565b3480156106dd57600080fd5b506103356117af565b3480156106f257600080fd5b50610335610701366004612d37565b6117ee565b34801561071257600080fd5b50600d546102a690600160981b900460ff1681565b34801561073357600080fd5b506102d0610742366004612fad565b611826565b34801561075357600080fd5b5061075d61029a81565b60405161ffff90911681526020016102b2565b34801561077c57600080fd5b5061033561078b366004612cad565b6119b7565b34801561079c57600080fd5b506102a66107ab366004612cc8565b6001600160a01b03918216600090815260066020908152604080832093909416825291909152205460ff1690565b3480156107e557600080fd5b506102d0611aa0565b3480156107fa57600080fd5b50610335610809366004612cad565b611b2e565b34801561081a57600080fd5b506103ea610829366004612fad565b60136020526000908152604090205481565b60606007805461084a90613379565b80601f016020809104026020016040519081016040528092919081815260200182805461087690613379565b80156108c35780601f10610898576101008083540402835291602001916108c3565b820191906000526020600020905b8154815290600101906020018083116108a657829003601f168201915b5050505050905090565b60006108d882611c19565b61093e5760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b60648201526084015b60405180910390fd5b506000908152600560205260409020546001600160a01b031690565b6000610965826110b1565b9050806001600160a01b0316836001600160a01b031614156109d35760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b6064820152608401610935565b336001600160a01b03821614806109ef57506109ef81336107ab565b610a615760405162461bcd60e51b815260206004820152603860248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f7760448201527f6e6572206e6f7220617070726f76656420666f7220616c6c00000000000000006064820152608401610935565b610a6b8383611c26565b505050565b600b546001600160a01b03163314610a9a5760405162461bcd60e51b8152600401610935906131ca565b8051610aad906014906020840190612b27565b5050565b600d54600160981b900460ff161515600114610b025760405162461bcd60e51b815260206004820152601060248201526f53616c65206973206e6f74206c69766560801b6044820152606401610935565b60008160ff1611610b5f5760405162461bcd60e51b815260206004820152602160248201527f4d696e74696e67206e756d6265722063616e6e6f74206265206e6567617469766044820152606560f81b6064820152608401610935565b600d5460ff600160801b90910481169082161115610bcf5760405162461bcd60e51b815260206004820152602760248201527f4d696e74696e67206e756d62657220706572207472616e73616374696f6e20656044820152661e18d95959195960ca1b6064820152608401610935565b61029a60ff8216610bde610d4e565b610be891906132a5565b1115610c065760405162461bcd60e51b815260040161093590613189565b600d54610c1f906001600160801b031660ff83166132d1565b6001600160801b03163414610c6a5760405162461bcd60e51b815260206004820152601160248201527015985b1d59481b9bdd0818dbdc9c9958dd607a1b6044820152606401610935565b600c5460005b8260ff168160ff161015610d4757600082610c89611c94565b610c93919061340b565b90506000610cac610ca385613362565b94508483611d99565b9050610cb83382611e10565b80601360006001610ccb8861029a61331f565b610cd5919061331f565b8152602001908152602001600020819055507fb9203d657e9c0ec8274c818292ab0f58b04e1970050716891770eb1bab5d655e8133604051610d2a9291909182526001600160a01b0316602082015260400190565b60405180910390a150508080610d3f906133eb565b915050610c70565b50600c5550565b6000610d5a6002611e2a565b905090565b610d693382611e34565b610d855760405162461bcd60e51b8152600401610935906131ff565b610a6b838383611f1e565b600b546001600160a01b03163314610dba5760405162461bcd60e51b8152600401610935906131ca565b600d805460ff909216600160801b0260ff60801b19909216919091179055565b6001600160a01b0382166000908152600160205260408120610dfc908361209f565b90505b92915050565b60606000610e11610d4e565b67ffffffffffffffff811115610e2957610e29613477565b604051908082528060200260200182016040528015610e52578160200160208202803683370190505b50905060005b610e60610d4e565b811015610ea7576000818152601360205260409020548251839083908110610e8a57610e8a613461565b602090810291909101015280610e9f816133d0565b915050610e58565b50919050565b600b546001600160a01b03163314610ed75760405162461bcd60e51b8152600401610935906131ca565b600d80546fffffffffffffffffffffffffffffffff19166001600160801b0392909216919091179055565b600b546001600160a01b03163314610f2c5760405162461bcd60e51b8152600401610935906131ca565b600e5447906001600160a01b03166108fc610f55612710610f4f85610d056120ab565b906120b7565b6040518115909202916000818181858888f19350505050158015610f7d573d6000803e3d6000fd5b50600f546001600160a01b03166108fc610f9f612710610f4f85610d056120ab565b6040518115909202916000818181858888f19350505050158015610fc7573d6000803e3d6000fd5b506010546001600160a01b03166108fc610fe9612710610f4f85610d056120ab565b6040518115909202916000818181858888f19350505050158015610aad573d6000803e3d6000fd5b610a6b838383604051806020016040528060008152506117ee565b60008061103a6002846120c3565b509392505050565b600b546001600160a01b0316331461106c5760405162461bcd60e51b8152600401610935906131ca565b600d805460ff60981b19169055565b600b546001600160a01b031633146110a55760405162461bcd60e51b8152600401610935906131ca565b6110ae816120df565b50565b6000610dff826040518060600160405280602981526020016134b260299139600291906120f2565b6060600a805461084a90613379565b60006001600160a01b0382166111535760405162461bcd60e51b815260206004820152602a60248201527f4552433732313a2062616c616e636520717565727920666f7220746865207a65604482015269726f206164647265737360b01b6064820152608401610935565b6001600160a01b0382166000908152600160205260409020610dff90611e2a565b600b546001600160a01b0316331461119e5760405162461bcd60e51b8152600401610935906131ca565b600b546040516000916001600160a01b0316907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600b80546001600160a01b0319169055565b606060006111f5836110e8565b90508061121257604080516000808252602082019092529061103a565b60008167ffffffffffffffff81111561122d5761122d613477565b604051908082528060200260200182016040528015611256578160200160208202803683370190505b50905060005b8281101561103a5761126e8582610dda565b82828151811061128057611280613461565b602090810291909101015280611295816133d0565b91505061125c565b600b546001600160a01b031633146112c75760405162461bcd60e51b8152600401610935906131ca565b6110ae336112d4306110e8565b6001600160a01b0384169190612109565b600b546001600160a01b0316331461130f5760405162461bcd60e51b8152600401610935906131ca565b6113188261215b565b61135b5760405162461bcd60e51b81526020600482015260146024820152734964732073686f756c6420626520756e6971756560601b6044820152606401610935565b80518251146113c45760405162461bcd60e51b815260206004820152602f60248201527f596f75206d75737420736574207468652065786163742073616d6520616d6f7560448201526e1b9d081bd9881c9958da5c1a595b9d608a1b6064820152608401610935565b815161029a906113d2610d4e565b6113dc91906132a5565b106113f95760405162461bcd60e51b815260040161093590613189565b600c5460005b83518160ff161015611565576000848260ff168151811061142257611422613461565b6020908102919091010151905061029a61ffff82161061147d5760405162461bcd60e51b8152602060048201526016602482015275125908189bdd5b99185c9a595cc8195e18d95959195960521b6044820152606401610935565b6114a7848360ff168151811061149557611495613461565b60200260200101518261ffff16611e10565b6114b083613362565b925061ffff81166013600060016114c98761029a61331f565b6114d3919061331f565b8152602001908152602001600020819055507fb9203d657e9c0ec8274c818292ab0f58b04e1970050716891770eb1bab5d655e81858460ff168151811061151c5761151c613461565b602002602001015160405161154a92919061ffff9290921682526001600160a01b0316602082015260400190565b60405180910390a1508061155d816133eb565b9150506113ff565b50600c555050565b60606008805461084a90613379565b6001600160a01b0382163314156115d55760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c6572000000000000006044820152606401610935565b3360008181526006602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b3360009081526012602052604090205460ff166116995760405162461bcd60e51b815260206004820152601660248201527513995959081d1bc81899481dda1a5d195b1a5cdd195960521b6044820152606401610935565b6000600c54116116da5760405162461bcd60e51b815260206004820152600c60248201526b139bc81391951cc81b19599d60a21b6044820152606401610935565b600c546000816116e8611c94565b6116f2919061340b565b9050600061170b61170284613362565b93508383611d99565b90506117173382611e10565b8060136000600161172a8761029a61331f565b611734919061331f565b8152602001908152602001600020819055507fb9203d657e9c0ec8274c818292ab0f58b04e1970050716891770eb1bab5d655e81336040516117899291909182526001600160a01b0316602082015260400190565b60405180910390a15050336000908152601260205260409020805460ff19169055600c55565b600b546001600160a01b031633146117d95760405162461bcd60e51b8152600401610935906131ca565b600d805460ff60981b1916600160981b179055565b6117f83383611e34565b6118145760405162461bcd60e51b8152600401610935906131ff565b6118208484848461220c565b50505050565b606061183182611c19565b6118955760405162461bcd60e51b815260206004820152602f60248201527f4552433732314d657461646174613a2055524920717565727920666f72206e6f60448201526e3732bc34b9ba32b73a103a37b5b2b760891b6064820152608401610935565b600082815260096020526040812080546118ae90613379565b80601f01602080910402602001604051908101604052809291908181526020018280546118da90613379565b80156119275780601f106118fc57610100808354040283529160200191611927565b820191906000526020600020905b81548152906001019060200180831161190a57829003601f168201915b5050505050905060006119386110d9565b604080518082019091526005815264173539b7b760d91b60208201528151919250906119675750909392505050565b82511561199a578183604051602001611981929190613031565b6040516020818303038152906040529350505050919050565b816119a48661223f565b8260405160200161198193929190613060565b600b546001600160a01b031633146119e15760405162461bcd60e51b8152600401610935906131ca565b600d5460ff600160901b82048116600160881b9092041610611a455760405162461bcd60e51b815260206004820152601e60248201527f416d6f756e74206f662077686974656c697374656420657863656564656400006044820152606401610935565b600d8054600160881b900460ff16906011611a5f836133eb565b825460ff9182166101009390930a9283029190920219909116179055506001600160a01b03166000908152601260205260409020805460ff19166001179055565b60148054611aad90613379565b80601f0160208091040260200160405190810160405280929190818152602001828054611ad990613379565b8015611b265780601f10611afb57610100808354040283529160200191611b26565b820191906000526020600020905b815481529060010190602001808311611b0957829003601f168201915b505050505081565b600b546001600160a01b03163314611b585760405162461bcd60e51b8152600401610935906131ca565b6001600160a01b038116611bbd5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610935565b600b546040516001600160a01b038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3600b80546001600160a01b0319166001600160a01b0392909216919091179055565b6000610dff60028361233d565b600081815260056020526040902080546001600160a01b0319166001600160a01b0384169081179091558190611c5b826110b1565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b6000600c544342611ca23390565b604051602001611cca919060609190911b6bffffffffffffffffffffffff1916815260140190565b6040516020818303038152906040528051906020012060001c611ced91906132bd565b6040516bffffffffffffffffffffffff194160601b166020820152459042906034016040516020818303038152906040528051906020012060001c611d3291906132bd565b611d3c44426132a5565b611d4691906132a5565b611d5091906132a5565b611d5a91906132a5565b611d6491906132a5565b604051602001611d7691815260200190565b6040516020818303038152906040528051906020012060001c610d5a91906132bd565b600082815260116020526040812054839015611dc057506000838152601160205260409020545b60008481526011602052604080822085905584825290205415611df457600083815260116020526040808220548683529120555b6000928352601160205260408084209190915592825250205490565b610aad828260405180602001604052806000815250612355565b6000610dff825490565b6000611e3f82611c19565b611ea05760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b6064820152608401610935565b6000611eab836110b1565b9050806001600160a01b0316846001600160a01b03161480611ee65750836001600160a01b0316611edb846108cd565b6001600160a01b0316145b80611f1657506001600160a01b0380821660009081526006602090815260408083209388168352929052205460ff165b949350505050565b826001600160a01b0316611f31826110b1565b6001600160a01b031614611f995760405162461bcd60e51b815260206004820152602960248201527f4552433732313a207472616e73666572206f6620746f6b656e2074686174206960448201526839903737ba1037bbb760b91b6064820152608401610935565b6001600160a01b038216611ffb5760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b6064820152608401610935565b612006600082611c26565b6001600160a01b03831660009081526001602052604090206120289082612388565b506001600160a01b038216600090815260016020526040902061204b9082612394565b50612058600282846123a0565b5080826001600160a01b0316846001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a4505050565b6000610dfc83836123b6565b6000610dfc8284613300565b6000610dfc82846132bd565b60008080806120d2868661243c565b9097909650945050505050565b8051610aad90600a906020840190612b27565b60006120ff8484846124d9565b90505b9392505050565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b179052610a6b908490612542565b8051600090600190825b818161ffff1610156122035760005b828161ffff1610156121f0578161ffff168161ffff16146121de57858261ffff16815181106121a5576121a5613461565b602002602001015161ffff16868261ffff16815181106121c7576121c7613461565b602002602001015161ffff1614156121de57600093505b806121e8816133ae565b915050612174565b50806121fb816133ae565b915050612165565b50909392505050565b612217848484611f1e565b61222384848484612614565b6118205760405162461bcd60e51b815260040161093590613137565b6060816122635750506040805180820190915260018152600360fc1b602082015290565b8160005b811561228d5780612277816133d0565b91506122869050600a836132bd565b9150612267565b60008167ffffffffffffffff8111156122a8576122a8613477565b6040519080825280601f01601f1916602001820160405280156122d2576020820181803683370190505b5090505b8415611f16576122e760018361331f565b91506122f4600a8661340b565b6122ff9060306132a5565b60f81b81838151811061231457612314613461565b60200101906001600160f81b031916908160001a905350612336600a866132bd565b94506122d6565b60008181526001830160205260408120541515610dfc565b61235f8383612721565b61236c6000848484612614565b610a6b5760405162461bcd60e51b815260040161093590613137565b6000610dfc8383612839565b6000610dfc838361292c565b60006120ff84846001600160a01b03851661297b565b815460009082106124145760405162461bcd60e51b815260206004820152602260248201527f456e756d657261626c655365743a20696e646578206f7574206f6620626f756e604482015261647360f01b6064820152608401610935565b82600001828154811061242957612429613461565b9060005260206000200154905092915050565b81546000908190831061249c5760405162461bcd60e51b815260206004820152602260248201527f456e756d657261626c654d61703a20696e646578206f7574206f6620626f756e604482015261647360f01b6064820152608401610935565b60008460000184815481106124b3576124b3613461565b906000526020600020906002020190508060000154816001015492509250509250929050565b600082815260018401602052604081205482816125095760405162461bcd60e51b81526004016109359190613124565b508461251660018361331f565b8154811061252657612526613461565b9060005260206000209060020201600101549150509392505050565b6000612597826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316612a1c9092919063ffffffff16565b805190915015610a6b57808060200190518101906125b59190612ee4565b610a6b5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610935565b60006001600160a01b0384163b1561271657604051630a85bd0160e11b81526001600160a01b0385169063150b7a02906126589033908990889088906004016130a3565b602060405180830381600087803b15801561267257600080fd5b505af19250505080156126a2575060408051601f3d908101601f1916820190925261269f91810190612f1e565b60015b6126fc573d8080156126d0576040519150601f19603f3d011682016040523d82523d6000602084013e6126d5565b606091505b5080516126f45760405162461bcd60e51b815260040161093590613137565b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050611f16565b506001949350505050565b6001600160a01b0382166127775760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f20616464726573736044820152606401610935565b61278081611c19565b156127cd5760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152606401610935565b6001600160a01b03821660009081526001602052604090206127ef9082612394565b506127fc600282846123a0565b5060405181906001600160a01b038416906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b6000818152600183016020526040812054801561292257600061285d60018361331f565b85549091506000906128719060019061331f565b9050600086600001828154811061288a5761288a613461565b90600052602060002001549050808760000184815481106128ad576128ad613461565b6000918252602090912001556128c48360016132a5565b600082815260018901602052604090205586548790806128e6576128e661344b565b60019003818190600052602060002001600090559055866001016000878152602001908152602001600020600090556001945050505050610dff565b6000915050610dff565b600081815260018301602052604081205461297357508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610dff565b506000610dff565b6000828152600184016020526040812054806129e0575050604080518082018252838152602080820184815286546001818101895560008981528481209551600290930290950191825591519082015586548684528188019092529290912055612102565b82856129ed60018461331f565b815481106129fd576129fd613461565b9060005260206000209060020201600101819055506000915050612102565b60606120ff848460008585843b612a755760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610935565b600080866001600160a01b03168587604051612a919190613015565b60006040518083038185875af1925050503d8060008114612ace576040519150601f19603f3d011682016040523d82523d6000602084013e612ad3565b606091505b5091509150612ae3828286612aee565b979650505050505050565b60608315612afd575081612102565b825115612b0d5782518084602001fd5b8160405162461bcd60e51b81526004016109359190613124565b828054612b3390613379565b90600052602060002090601f016020900481019282612b555760008555612b9b565b82601f10612b6e57805160ff1916838001178555612b9b565b82800160010185558215612b9b579182015b82811115612b9b578251825591602001919060010190612b80565b50612ba7929150612bab565b5090565b5b80821115612ba75760008155600101612bac565b600067ffffffffffffffff831115612bda57612bda613477565b612bed601f8401601f1916602001613250565b9050828152838383011115612c0157600080fd5b828260208301376000602084830101529392505050565b80356001600160a01b0381168114612c2f57600080fd5b919050565b600082601f830112612c4557600080fd5b81356020612c5a612c5583613281565b613250565b80838252828201915082860187848660051b8901011115612c7a57600080fd5b60005b85811015612ca057612c8e82612c18565b84529284019290840190600101612c7d565b5090979650505050505050565b600060208284031215612cbf57600080fd5b610dfc82612c18565b60008060408385031215612cdb57600080fd5b612ce483612c18565b9150612cf260208401612c18565b90509250929050565b600080600060608486031215612d1057600080fd5b612d1984612c18565b9250612d2760208501612c18565b9150604084013590509250925092565b60008060008060808587031215612d4d57600080fd5b612d5685612c18565b9350612d6460208601612c18565b925060408501359150606085013567ffffffffffffffff811115612d8757600080fd5b8501601f81018713612d9857600080fd5b612da787823560208401612bc0565b91505092959194509250565b60008060408385031215612dc657600080fd5b612dcf83612c18565b91506020830135612ddf8161348d565b809150509250929050565b60008060408385031215612dfd57600080fd5b612e0683612c18565b946020939093013593505050565b60008060408385031215612e2757600080fd5b823567ffffffffffffffff80821115612e3f57600080fd5b818501915085601f830112612e5357600080fd5b81356020612e63612c5583613281565b8083825282820191508286018a848660051b8901011115612e8357600080fd5b600096505b84871015612eb657803561ffff81168114612ea257600080fd5b835260019690960195918301918301612e88565b5096505086013592505080821115612ecd57600080fd5b50612eda85828601612c34565b9150509250929050565b600060208284031215612ef657600080fd5b81516121028161348d565b600060208284031215612f1357600080fd5b81356121028161349b565b600060208284031215612f3057600080fd5b81516121028161349b565b600060208284031215612f4d57600080fd5b813567ffffffffffffffff811115612f6457600080fd5b8201601f81018413612f7557600080fd5b611f1684823560208401612bc0565b600060208284031215612f9657600080fd5b81356001600160801b038116811461210257600080fd5b600060208284031215612fbf57600080fd5b5035919050565b600060208284031215612fd857600080fd5b813560ff8116811461210257600080fd5b60008151808452613001816020860160208601613336565b601f01601f19169290920160200192915050565b60008251613027818460208701613336565b9190910192915050565b60008351613043818460208801613336565b835190830190613057818360208801613336565b01949350505050565b60008451613072818460208901613336565b845190830190613086818360208901613336565b8451910190613099818360208801613336565b0195945050505050565b6001600160a01b03858116825284166020820152604081018390526080606082018190526000906130d690830184612fe9565b9695505050505050565b6020808252825182820181905260009190848201906040850190845b81811015613118578351835292840192918401916001016130fc565b50909695505050505050565b602081526000610dfc6020830184612fe9565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b60208082526021908201527f4d696e74206c657373204e4654732c20686172642063617020657863656564656040820152601960fa1b606082015260800190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60208082526031908201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f6040820152701ddb995c881b9bdc88185c1c1c9bdd9959607a1b606082015260800190565b604051601f8201601f1916810167ffffffffffffffff8111828210171561327957613279613477565b604052919050565b600067ffffffffffffffff82111561329b5761329b613477565b5060051b60200190565b600082198211156132b8576132b861341f565b500190565b6000826132cc576132cc613435565b500490565b60006001600160801b03808316818516818304811182151516156132f7576132f761341f565b02949350505050565b600081600019048311821515161561331a5761331a61341f565b500290565b6000828210156133315761333161341f565b500390565b60005b83811015613351578181015183820152602001613339565b838111156118205750506000910152565b6000816133715761337161341f565b506000190190565b600181811c9082168061338d57607f821691505b60208210811415610ea757634e487b7160e01b600052602260045260246000fd5b600061ffff808316818114156133c6576133c661341f565b6001019392505050565b60006000198214156133e4576133e461341f565b5060010190565b600060ff821660ff8114156134025761340261341f565b60010192915050565b60008261341a5761341a613435565b500690565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b634e487b7160e01b600052603160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b80151581146110ae57600080fd5b6001600160e01b0319811681146110ae57600080fdfe4552433732313a206f776e657220717565727920666f72206e6f6e6578697374656e7420746f6b656ea2646970667358221220245a135941939284fb7d917d643fb349e277186501c8c11848b449d2a1f307d164736f6c63430008070033