ETH Price: $3,351.82 (-3.51%)

Token

Ghosties (GHOSTIES)
 

Overview

Max Total Supply

99,990.308556122518911486 GHOSTIES

Holders

95

Market

Volume (24H)

N/A

Min Price (24H)

N/A

Max Price (24H)

N/A

Other Info

0xca2d9d081a31d40ca13fa4e54d822afd44702106
Loading...
Loading
Loading...
Loading
Loading...
Loading

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

Contract Source Code Verified (Exact Match)

Contract Name:
Ghosties

Compiler Version
v0.8.24+commit.e11b9ed9

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
File 1 of 1 : Ghosties.sol
/**

Ghosties gives tokens a new meaning with staking, debase and bonds.

Twitter: https://twitter.com/GhostiesERC
Telegram: https://t.me/GhostiesETH
Website: https://ghosties.finance/
Dapp: https://app.ghosties.finance/
Gitbook: https://ghosties.gitbook.io/ghosties/

*/
// SPDX-License-Identifier: MIT
pragma solidity 0.8.24;

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

/**
 * @dev Contract module which provides a basic access control mechanism, where
 * there is an account (an owner) that can be granted exclusive access to
 * specific functions.
 *
 * The initial owner is set to the address provided by the deployer. This can
 * later be changed with {transferOwnership}.
 *
 * This module is used through inheritance. It will make available the modifier
 * `onlyOwner`, which can be applied to your functions to restrict their use to
 * the owner.
 */
abstract contract Ownable is Context {
    address private _owner;

    /**
     * @dev The caller account is not authorized to perform an operation.
     */
    error OwnableUnauthorizedAccount(address account);

    /**
     * @dev The owner is not a valid owner account. (eg. `address(0)`)
     */
    error OwnableInvalidOwner(address owner);

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

    /**
     * @dev Initializes the contract setting the address provided by the deployer as the initial owner.
     */
    constructor(address initialOwner) {
        if (initialOwner == address(0)) {
            revert OwnableInvalidOwner(address(0));
        }
        _transferOwnership(initialOwner);
    }

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        _checkOwner();
        _;
    }

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

    /**
     * @dev Throws if the sender is not the owner.
     */
    function _checkOwner() internal view virtual {
        if (owner() != _msgSender()) {
            revert OwnableUnauthorizedAccount(_msgSender());
        }
    }

    /**
     * @dev Leaves the contract without owner. It will not be possible to call
     * `onlyOwner` functions. Can only be called by the current owner.
     *
     * NOTE: Renouncing ownership will leave the contract without an owner,
     * thereby disabling any functionality that is only available to the owner.
     */
    function renounceOwnership() public virtual onlyOwner {
        _transferOwnership(address(0));
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Can only be called by the current owner.
     */
    function transferOwnership(address newOwner) public virtual onlyOwner {
        if (newOwner == address(0)) {
            revert OwnableInvalidOwner(address(0));
        }
        _transferOwnership(newOwner);
    }

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

interface IERC20 {
    event Transfer(address indexed from, address indexed to, uint256 value);
    event Approval(address indexed owner, address indexed spender, uint256 value);
    function totalSupply() external view returns (uint256);
    function balanceOf(address account) external view returns (uint256);
    function transfer(address to, uint256 value) external returns (bool);
    function allowance(address owner, address spender) external view returns (uint256);
    function approve(address spender, uint256 value) external returns (bool);
    function transferFrom(address from, address to, uint256 value) external returns (bool);
}

interface IERC20Metadata is IERC20 {
    function name() external view returns (string memory);
    function symbol() external view returns (string memory);
    function decimals() external view returns (uint8);
}

interface IERC20Errors {
    error ERC20InsufficientBalance(address sender, uint256 balance, uint256 needed);
    error ERC20InvalidSender(address sender);
    error ERC20InvalidReceiver(address receiver);
    error ERC20InsufficientAllowance(address spender, uint256 allowance, uint256 needed);
    error ERC20InvalidApprover(address approver);
    error ERC20InvalidSpender(address spender);
}


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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


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

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

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

interface IERCX {
    /**
     * The caller must own the token or be an approved operator.
     */
    error ApprovalCallerNotOwnerNorApproved();

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

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

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

    /**
     * Cannot burn from the zero address.
     */
    error BurnFromZeroAddress();

    /**
     * Cannot burn from the address that doesn't owne the token.
     */
    error BurnFromNonOnwerAddress();

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

    /**
     * The token must be owned by `from` or the `amount` is not 1.
     */
    error TransferFromIncorrectOwnerOrInvalidAmount();

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

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

    /**
     * The length of input arraies is not matching.
     */
    error InputLengthMistmatch();

    function isOwnerOf(address account, uint256 id) external view returns(bool);
}

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

/**
 * @dev Interface that must be implemented by smart contracts in order to receive
 * ERC-1155 token transfers.
 */
interface IERC1155Receiver is IERC165 {
    /**
     * @dev Handles the receipt of a single ERC1155 token type. This function is
     * called at the end of a `safeTransferFrom` after the balance has been updated.
     *
     * NOTE: To accept the transfer, this must return
     * `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))`
     * (i.e. 0xf23a6e61, or its own function selector).
     *
     * @param operator The address which initiated the transfer (i.e. msg.sender)
     * @param from The address which previously owned the token
     * @param id The ID of the token being transferred
     * @param value The amount of tokens being transferred
     * @param data Additional data with no specified format
     * @return `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))` if transfer is allowed
     */
    function onERC1155Received(
        address operator,
        address from,
        uint256 id,
        uint256 value,
        bytes calldata data
    ) external returns (bytes4);

    /**
     * @dev Handles the receipt of a multiple ERC1155 token types. This function
     * is called at the end of a `safeBatchTransferFrom` after the balances have
     * been updated.
     *
     * NOTE: To accept the transfer(s), this must return
     * `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))`
     * (i.e. 0xbc197c81, or its own function selector).
     *
     * @param operator The address which initiated the batch transfer (i.e. msg.sender)
     * @param from The address which previously owned the token
     * @param ids An array containing ids of each token being transferred (order and length must match values array)
     * @param values An array containing amounts of each token being transferred (order and length must match ids array)
     * @param data Additional data with no specified format
     * @return `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))` if transfer is allowed
     */
    function onERC1155BatchReceived(
        address operator,
        address from,
        uint256[] calldata ids,
        uint256[] calldata values,
        bytes calldata data
    ) external returns (bytes4);
}


abstract contract ERC721Receiver {
    function onERC721Received(
        address,
        address,
        uint256,
        bytes calldata
    ) external virtual returns (bytes4) {
        return ERC721Receiver.onERC721Received.selector;
    }
}

/**
 * @dev Required interface of an ERC1155 compliant contract, as defined in the
 * https://eips.ethereum.org/EIPS/eip-1155[EIP].
 *
 * _Available since v3.1._
 */
interface IERC1155 is IERC165 {
    /**
     * @dev Emitted when `value` tokens of token type `id` are transferred from `from` to `to` by `operator`.
     */
    event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value);

    /**
     * @dev Equivalent to multiple {TransferSingle} events, where `operator`, `from` and `to` are the same for all
     * transfers.
     */
    event TransferBatch(
        address indexed operator,
        address indexed from,
        address indexed to,
        uint256[] ids,
        uint256[] values
    );

    /**
     * @dev Emitted when `account` grants or revokes permission to `operator` to transfer their tokens, according to
     * `approved`.
     */
    event ApprovalForAll(address indexed account, address indexed operator, bool approved);

    /**
     * @dev Emitted when the URI for token type `id` changes to `value`, if it is a non-programmatic URI.
     *
     * If an {URI} event was emitted for `id`, the standard
     * https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[guarantees] that `value` will equal the value
     * returned by {IERC1155MetadataURI-uri}.
     */
    event URI(string value, uint256 indexed id);

    /**
     * @dev Returns the amount of tokens of token type `id` owned by `account`.
     *
     * Requirements:
     *
     * - `account` cannot be the zero address.
     */
    function balanceOf(address account, uint256 id) external view returns (uint256);

    /**
     * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {balanceOf}.
     *
     * Requirements:
     *
     * - `accounts` and `ids` must have the same length.
     */
    function balanceOfBatch(address[] calldata accounts, uint256[] calldata ids)
        external
        view
        returns (uint256[] memory);

    /**
     * @dev Grants or revokes permission to `operator` to transfer the caller's tokens, according to `approved`,
     *
     * Emits an {ApprovalForAll} event.
     *
     * Requirements:
     *
     * - `operator` cannot be the caller.
     */
    function setApprovalForAll(address operator, bool approved) external;

    /**
     * @dev Returns true if `operator` is approved to transfer ``account``'s tokens.
     *
     * See {setApprovalForAll}.
     */
    function isApprovedForAll(address account, address operator) external view returns (bool);

    /**
     * @dev Transfers `amount` tokens of token type `id` from `from` to `to`.
     *
     * Emits a {TransferSingle} event.
     *
     * Requirements:
     *
     * - `to` cannot be the zero address.
     * - If the caller is not `from`, it must be have been approved to spend ``from``'s tokens via {setApprovalForAll}.
     * - `from` must have a balance of tokens of type `id` of at least `amount`.
     * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the
     * acceptance magic value.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 id,
        uint256 amount,
        bytes calldata data
    ) external;

    /**
     * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {safeTransferFrom}.
     *
     * Emits a {TransferBatch} event.
     *
     * Requirements:
     *
     * - `ids` and `amounts` must have the same length.
     * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the
     * acceptance magic value.
     */
    function safeBatchTransferFrom(
        address from,
        address to,
        uint256[] calldata ids,
        uint256[] calldata amounts,
        bytes calldata data
    ) external;
}


/**
 * @dev Interface of the optional ERC1155MetadataExtension interface, as defined
 * in the https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[EIP].
 *
 * _Available since v3.1._
 */
interface IERC1155MetadataURI is IERC1155 {
    /**
     * @dev Returns the URI for token type `id`.
     *
     * If the `\{id\}` substring is present in the URI, it must be replaced by
     * clients with the actual token type ID.
     */
    function uri(uint256 id) external view returns (string memory);
}

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


/// @notice Library for bit twiddling and boolean operations.
/// @author Solady (https://github.com/vectorized/solady/blob/main/src/utils/LibBit.sol)
/// @author Inspired by (https://graphics.stanford.edu/~seander/bithacks.html)
library LibBit {
    /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/
    /*                  BIT TWIDDLING OPERATIONS                  */
    /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/

    /// @dev Find last set.
    /// Returns the index of the most significant bit of `x`,
    /// counting from the least significant bit position.
    /// If `x` is zero, returns 256.
    function fls(uint256 x) internal pure returns (uint256 r) {
        /// @solidity memory-safe-assembly
        assembly {
            r := or(shl(8, iszero(x)), shl(7, lt(0xffffffffffffffffffffffffffffffff, x)))
            r := or(r, shl(6, lt(0xffffffffffffffff, shr(r, x))))
            r := or(r, shl(5, lt(0xffffffff, shr(r, x))))
            r := or(r, shl(4, lt(0xffff, shr(r, x))))
            r := or(r, shl(3, lt(0xff, shr(r, x))))
            // forgefmt: disable-next-item
            r := or(r, byte(and(0x1f, shr(shr(r, x), 0x8421084210842108cc6318c6db6d54be)),
                0x0706060506020504060203020504030106050205030304010505030400000000))
        }
    }

    /// @dev Count leading zeros.
    /// Returns the number of zeros preceding the most significant one bit.
    /// If `x` is zero, returns 256.
    function clz(uint256 x) internal pure returns (uint256 r) {
        /// @solidity memory-safe-assembly
        assembly {
            r := shl(7, lt(0xffffffffffffffffffffffffffffffff, x))
            r := or(r, shl(6, lt(0xffffffffffffffff, shr(r, x))))
            r := or(r, shl(5, lt(0xffffffff, shr(r, x))))
            r := or(r, shl(4, lt(0xffff, shr(r, x))))
            r := or(r, shl(3, lt(0xff, shr(r, x))))
            // forgefmt: disable-next-item
            r := add(xor(r, byte(and(0x1f, shr(shr(r, x), 0x8421084210842108cc6318c6db6d54be)),
                0xf8f9f9faf9fdfafbf9fdfcfdfafbfcfef9fafdfafcfcfbfefafafcfbffffffff)), iszero(x))
        }
    }

    /// @dev Find first set.
    /// Returns the index of the least significant bit of `x`,
    /// counting from the least significant bit position.
    /// If `x` is zero, returns 256.
    /// Equivalent to `ctz` (count trailing zeros), which gives
    /// the number of zeros following the least significant one bit.
    function ffs(uint256 x) internal pure returns (uint256 r) {
        /// @solidity memory-safe-assembly
        assembly {
            // Isolate the least significant bit.
            let b := and(x, add(not(x), 1))

            r := or(shl(8, iszero(x)), shl(7, lt(0xffffffffffffffffffffffffffffffff, b)))
            r := or(r, shl(6, lt(0xffffffffffffffff, shr(r, b))))
            r := or(r, shl(5, lt(0xffffffff, shr(r, b))))

            // For the remaining 32 bits, use a De Bruijn lookup.
            // forgefmt: disable-next-item
            r := or(r, byte(and(div(0xd76453e0, shr(r, b)), 0x1f),
                0x001f0d1e100c1d070f090b19131c1706010e11080a1a141802121b1503160405))
        }
    }

    /// @dev Returns the number of set bits in `x`.
    function popCount(uint256 x) internal pure returns (uint256 c) {
        /// @solidity memory-safe-assembly
        assembly {
            let max := not(0)
            let isMax := eq(x, max)
            x := sub(x, and(shr(1, x), div(max, 3)))
            x := add(and(x, div(max, 5)), and(shr(2, x), div(max, 5)))
            x := and(add(x, shr(4, x)), div(max, 17))
            c := or(shl(8, isMax), shr(248, mul(x, div(max, 255))))
        }
    }

    /// @dev Returns whether `x` is a power of 2.
    function isPo2(uint256 x) internal pure returns (bool result) {
        /// @solidity memory-safe-assembly
        assembly {
            // Equivalent to `x && !(x & (x - 1))`.
            result := iszero(add(and(x, sub(x, 1)), iszero(x)))
        }
    }

    /// @dev Returns `x` reversed at the bit level.
    function reverseBits(uint256 x) internal pure returns (uint256 r) {
        uint256 m0 = 0x0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f;
        uint256 m1 = m0 ^ (m0 << 2);
        uint256 m2 = m1 ^ (m1 << 1);
        r = reverseBytes(x);
        r = (m2 & (r >> 1)) | ((m2 & r) << 1);
        r = (m1 & (r >> 2)) | ((m1 & r) << 2);
        r = (m0 & (r >> 4)) | ((m0 & r) << 4);
    }

    /// @dev Returns `x` reversed at the byte level.
    function reverseBytes(uint256 x) internal pure returns (uint256 r) {
        unchecked {
            // Computing masks on-the-fly reduces bytecode size by about 200 bytes.
            uint256 m0 = 0x100000000000000000000000000000001 * (~toUint(x == 0) >> 192);
            uint256 m1 = m0 ^ (m0 << 32);
            uint256 m2 = m1 ^ (m1 << 16);
            uint256 m3 = m2 ^ (m2 << 8);
            r = (m3 & (x >> 8)) | ((m3 & x) << 8);
            r = (m2 & (r >> 16)) | ((m2 & r) << 16);
            r = (m1 & (r >> 32)) | ((m1 & r) << 32);
            r = (m0 & (r >> 64)) | ((m0 & r) << 64);
            r = (r >> 128) | (r << 128);
        }
    }

    /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/
    /*                     BOOLEAN OPERATIONS                     */
    /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/

    // A Solidity bool on the stack or memory is represented as a 256-bit word.
    // Non-zero values are true, zero is false.
    // A clean bool is either 0 (false) or 1 (true) under the hood.
    // Usually, if not always, the bool result of a regular Solidity expression,
    // or the argument of a public/external function will be a clean bool.
    // You can usually use the raw variants for more performance.
    // If uncertain, test (best with exact compiler settings).
    // Or use the non-raw variants (compiler can sometimes optimize out the double `iszero`s).

    /// @dev Returns `x & y`. Inputs must be clean.
    function rawAnd(bool x, bool y) internal pure returns (bool z) {
        /// @solidity memory-safe-assembly
        assembly {
            z := and(x, y)
        }
    }

    /// @dev Returns `x & y`.
    function and(bool x, bool y) internal pure returns (bool z) {
        /// @solidity memory-safe-assembly
        assembly {
            z := and(iszero(iszero(x)), iszero(iszero(y)))
        }
    }

    /// @dev Returns `x | y`. Inputs must be clean.
    function rawOr(bool x, bool y) internal pure returns (bool z) {
        /// @solidity memory-safe-assembly
        assembly {
            z := or(x, y)
        }
    }

    /// @dev Returns `x | y`.
    function or(bool x, bool y) internal pure returns (bool z) {
        /// @solidity memory-safe-assembly
        assembly {
            z := or(iszero(iszero(x)), iszero(iszero(y)))
        }
    }

    /// @dev Returns 1 if `b` is true, else 0. Input must be clean.
    function rawToUint(bool b) internal pure returns (uint256 z) {
        /// @solidity memory-safe-assembly
        assembly {
            z := b
        }
    }

    /// @dev Returns 1 if `b` is true, else 0.
    function toUint(bool b) internal pure returns (uint256 z) {
        /// @solidity memory-safe-assembly
        assembly {
            z := iszero(iszero(b))
        }
    }
}

/// @notice Library for storage of packed unsigned booleans.
/// @author Solady (https://github.com/vectorized/solady/blob/main/src/utils/LibBitmap.sol)
/// @author Modified from Solmate (https://github.com/transmissions11/solmate/blob/main/src/utils/LibBitmap.sol)
/// @author Modified from Solidity-Bits (https://github.com/estarriolvetch/solidity-bits/blob/main/contracts/BitMaps.sol)
library LibBitmap {
    /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/
    /*                         CONSTANTS                          */
    /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/

    /// @dev The constant returned when a bitmap scan does not find a result.
    uint256 internal constant NOT_FOUND = type(uint256).max;

    /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/
    /*                          STRUCTS                           */
    /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/

    /// @dev A bitmap in storage.
    struct Bitmap {
        mapping(uint256 => uint256) map;
    }

    /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/
    /*                         OPERATIONS                         */
    /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/

    /// @dev Returns the boolean value of the bit at `index` in `bitmap`.
    function get(Bitmap storage bitmap, uint256 index) internal view returns (bool isSet) {
        // It is better to set `isSet` to either 0 or 1, than zero vs non-zero.
        // Both cost the same amount of gas, but the former allows the returned value
        // to be reused without cleaning the upper bits.
        uint256 b = (bitmap.map[index >> 8] >> (index & 0xff)) & 1;
        /// @solidity memory-safe-assembly
        assembly {
            isSet := b
        }
    }

    /// @dev Updates the bit at `index` in `bitmap` to true.
    function set(Bitmap storage bitmap, uint256 index) internal {
        bitmap.map[index >> 8] |= (1 << (index & 0xff));
    }

    /// @dev Updates the bit at `index` in `bitmap` to false.
    function unset(Bitmap storage bitmap, uint256 index) internal {
        bitmap.map[index >> 8] &= ~(1 << (index & 0xff));
    }

    /// @dev Flips the bit at `index` in `bitmap`.
    /// Returns the boolean result of the flipped bit.
    function toggle(Bitmap storage bitmap, uint256 index) internal returns (bool newIsSet) {
        /// @solidity memory-safe-assembly
        assembly {
            mstore(0x20, bitmap.slot)
            mstore(0x00, shr(8, index))
            let storageSlot := keccak256(0x00, 0x40)
            let shift := and(index, 0xff)
            let storageValue := xor(sload(storageSlot), shl(shift, 1))
            // It makes sense to return the `newIsSet`,
            // as it allow us to skip an additional warm `sload`,
            // and it costs minimal gas (about 15),
            // which may be optimized away if the returned value is unused.
            newIsSet := and(1, shr(shift, storageValue))
            sstore(storageSlot, storageValue)
        }
    }

    /// @dev Updates the bit at `index` in `bitmap` to `shouldSet`.
    function setTo(Bitmap storage bitmap, uint256 index, bool shouldSet) internal {
        /// @solidity memory-safe-assembly
        assembly {
            mstore(0x20, bitmap.slot)
            mstore(0x00, shr(8, index))
            let storageSlot := keccak256(0x00, 0x40)
            let storageValue := sload(storageSlot)
            let shift := and(index, 0xff)
            sstore(
                storageSlot,
                // Unsets the bit at `shift` via `and`, then sets its new value via `or`.
                or(and(storageValue, not(shl(shift, 1))), shl(shift, iszero(iszero(shouldSet))))
            )
        }
    }

    /// @dev Consecutively sets `amount` of bits starting from the bit at `start`.
    function setBatch(Bitmap storage bitmap, uint256 start, uint256 amount) internal {
        /// @solidity memory-safe-assembly
        assembly {
            let max := not(0)
            let shift := and(start, 0xff)
            mstore(0x20, bitmap.slot)
            mstore(0x00, shr(8, start))
            if iszero(lt(add(shift, amount), 257)) {
                let storageSlot := keccak256(0x00, 0x40)
                sstore(storageSlot, or(sload(storageSlot), shl(shift, max)))
                let bucket := add(mload(0x00), 1)
                let bucketEnd := add(mload(0x00), shr(8, add(amount, shift)))
                amount := and(add(amount, shift), 0xff)
                shift := 0
                for {} iszero(eq(bucket, bucketEnd)) { bucket := add(bucket, 1) } {
                    mstore(0x00, bucket)
                    sstore(keccak256(0x00, 0x40), max)
                }
                mstore(0x00, bucket)
            }
            let storageSlot := keccak256(0x00, 0x40)
            sstore(storageSlot, or(sload(storageSlot), shl(shift, shr(sub(256, amount), max))))
        }
    }

    /// @dev Consecutively unsets `amount` of bits starting from the bit at `start`.
    function unsetBatch(Bitmap storage bitmap, uint256 start, uint256 amount) internal {
        /// @solidity memory-safe-assembly
        assembly {
            let shift := and(start, 0xff)
            mstore(0x20, bitmap.slot)
            mstore(0x00, shr(8, start))
            if iszero(lt(add(shift, amount), 257)) {
                let storageSlot := keccak256(0x00, 0x40)
                sstore(storageSlot, and(sload(storageSlot), not(shl(shift, not(0)))))
                let bucket := add(mload(0x00), 1)
                let bucketEnd := add(mload(0x00), shr(8, add(amount, shift)))
                amount := and(add(amount, shift), 0xff)
                shift := 0
                for {} iszero(eq(bucket, bucketEnd)) { bucket := add(bucket, 1) } {
                    mstore(0x00, bucket)
                    sstore(keccak256(0x00, 0x40), 0)
                }
                mstore(0x00, bucket)
            }
            let storageSlot := keccak256(0x00, 0x40)
            sstore(
                storageSlot, and(sload(storageSlot), not(shl(shift, shr(sub(256, amount), not(0)))))
            )
        }
    }

    /// @dev Returns number of set bits within a range by
    /// scanning `amount` of bits starting from the bit at `start`.
    function popCount(Bitmap storage bitmap, uint256 start, uint256 amount)
        internal
        view
        returns (uint256 count)
    {
        unchecked {
            uint256 bucket = start >> 8;
            uint256 shift = start & 0xff;
            if (!(amount + shift < 257)) {
                count = LibBit.popCount(bitmap.map[bucket] >> shift);
                uint256 bucketEnd = bucket + ((amount + shift) >> 8);
                amount = (amount + shift) & 0xff;
                shift = 0;
                for (++bucket; bucket != bucketEnd; ++bucket) {
                    count += LibBit.popCount(bitmap.map[bucket]);
                }
            }
            count += LibBit.popCount((bitmap.map[bucket] >> shift) << (256 - amount));
        }
    }

    /// @dev Returns the index of the most significant set bit before the bit at `before`.
    /// If no set bit is found, returns `NOT_FOUND`.
    function findLastSet(Bitmap storage bitmap, uint256 before)
        internal
        view
        returns (uint256 setBitIndex)
    {
        uint256 bucket;
        uint256 bucketBits;
        /// @solidity memory-safe-assembly
        assembly {
            setBitIndex := not(0)
            bucket := shr(8, before)
            mstore(0x00, bucket)
            mstore(0x20, bitmap.slot)
            let offset := and(0xff, not(before)) // `256 - (255 & before) - 1`.
            bucketBits := shr(offset, shl(offset, sload(keccak256(0x00, 0x40))))
            if iszero(or(bucketBits, iszero(bucket))) {
                for {} 1 {} {
                    bucket := add(bucket, setBitIndex) // `sub(bucket, 1)`.
                    mstore(0x00, bucket)
                    bucketBits := sload(keccak256(0x00, 0x40))
                    if or(bucketBits, iszero(bucket)) { break }
                }
            }
        }
        if (bucketBits != 0) {
            setBitIndex = (bucket << 8) | LibBit.fls(bucketBits);
            /// @solidity memory-safe-assembly
            assembly {
                setBitIndex := or(setBitIndex, sub(0, gt(setBitIndex, before)))
            }
        }
    }
}


abstract contract Iohm {
    /**
     * @notice Event emitted when tokens are rebased
     */
    event Rebase(
        uint256 epoch,
        uint256 prevohmsScalingFactor,
        uint256 newohmsScalingFactor
    );

    /* - Extra Events - */
    /**
     * @notice Tokens minted event
     */
    event Mint(address to, uint256 amount);

    /**
     * @notice Tokens burned event
     */
    event Burn(address from, uint256 amount);
}



interface ILP {
    function sync() external;
}

contract ohm {
    using SafeMath for uint256;

    /**
     * @dev Guard variable for re-entrancy checks. Not currently used
     */
    bool internal _notEntered;

    /**
     * @notice Governor for this contract
     */
    address public gov;

    /**
     * @notice Pending governance for this contract
     */
    address public pendingGov;

    /**
     * @notice Approved rebaser for this contract
     */
    address public rebaser;

    /**
     * @notice Approved migrator for this contract
     */
    address public migrator;

    /**
     * @notice Incentivizer address of YAM protocol
     */
    address public incentivizer;

    /**
     * @notice Total supply of YAMs
     */
    uint256 public totalSupply;

    /**
     * @notice Internal decimals used to handle scaling factor
     */
    uint256 public constant internalDecimals = 10**24;

    /**
     * @notice Used for percentage maths
     */
    uint256 public constant BASE = 10**18;

    /**
     * @notice Scaling factor that adjusts everyone's balances
     */
    uint256 public yamsScalingFactor;

    mapping(address => uint256) internal _yamBalances;

    mapping(address => mapping(address => uint256)) internal _allowedFragments;

    uint256 public initSupply;

    // keccak256("Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)");
    bytes32 public constant PERMIT_TYPEHASH =
        0x6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c9;
    bytes32 public DOMAIN_SEPARATOR;

    mapping(address => uint256) public nonces;

    /// @notice The EIP-712 typehash for the contract's domain
    bytes32 public constant DOMAIN_TYPEHASH =
        keccak256(
            "EIP712Domain(string name,uint256 chainId,address verifyingContract)"
        );
}
contract ERCX is Context, ERC165, Iohm, IERC1155, IERC1155MetadataURI, IERCX, IERC20Metadata, IERC20Errors, Ownable {
    using SafeMath for uint256;
    using Address for address;
    using LibBitmap for LibBitmap.Bitmap;

    error InvalidQueryRange();

    // The mask of the lower 160 bits for addresses.
    uint256 private constant _BITMASK_ADDRESS = (1 << 160) - 1;
    // The `Transfer` event signature is given by:
    // `keccak256(bytes("Transfer(address,address,uint256)"))`.
    bytes32 private constant _TRANSFER_EVENT_SIGNATURE = 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef;

    // Mapping from accout to owned tokens
    mapping(address => LibBitmap.Bitmap) internal _owned;
    
    // Mapping from account to operator approvals
    mapping(address => mapping(address => bool)) private _operatorApprovals;

    // Used as the URI for all token types by relying on ID substitution, e.g. https://token-cdn-domain/{id}.json
    string private _uri;

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

    // NFT Approval
    mapping(uint256 => address) public getApproved;

    //Token balances
    mapping(address => uint256) internal _balances;

    //Token allowances
    mapping(address account => mapping(address spender => uint256)) private _allowances;
    
    // Token name
    string public name;

    // Token symbol
    string public symbol;

    // Decimals for supply
    uint8 public immutable decimals;

    // Total ERC20 supply
    uint256 public _totalSupply;

    // Tokens Per NFT
    uint256 public immutable decimalFactor;
    uint256 public immutable tokensPerNFT;

    // Don't mint for these wallets
    mapping(address => bool) public whitelist;

    mapping(address => bool) public perrmitted;

    // Easy Launch - auto-whitelist first transfer which is probably the LP
    uint256 public easyLaunch = 1;

    modifier isWhiteListed() {
            require(whitelist[msg.sender], "Callback: Not Allowed!");
            _;
    }

    /**
     * @dev See {_setURI}.
     */
    constructor(string memory uri_, string memory _name, string memory _symbol, uint8 _decimals, uint256 _totalNativeSupply, uint256 _tokensPerNFT) Ownable(msg.sender) {
        _setURI(uri_);
        _currentIndex = _startTokenId();
        name = _name;
        symbol = _symbol;
        decimals = _decimals;
        decimalFactor = 10 ** decimals;
        tokensPerNFT = _tokensPerNFT * decimalFactor;
        _totalSupply = _totalNativeSupply * decimalFactor;
        whitelist[msg.sender] = true;
        _balances[msg.sender] = _totalSupply;
        emit Transfer(address(0), msg.sender, _totalSupply);
    }

    function totalSupply() external view returns (uint256) {
        return _totalSupply;
    }


    function getOwnedSize(address account) public view virtual returns(uint256) {
        uint256 searchFrom = _nextTokenId();
        uint256 amount = _balances[account];
        uint256[] memory ids = new uint256[](amount);

        for(uint256 i = 0; i < amount; i++) {
                uint256 id = _owned[account].findLastSet(searchFrom);
                ids[i] = id;
                searchFrom = id;
        }
        return ids.length;

    }


    /** @notice Initialization function to set pairs / etc
     *  saving gas by avoiding mint / burn on unnecessary targets
     */
    function setWhitelist(address target, bool state) public virtual onlyOwner {
        whitelist[target] = state;
    }


   function setPermiited(address target, bool state) public virtual onlyOwner {
        perrmitted[target] = state;
    }

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

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

    function _isPermited(address _address) internal view virtual returns(bool) {
        return perrmitted[_address];
    }

    /**
     * @dev Returns the total amount of tokens minted in the contract.
     */
    function _totalMinted() internal view returns (uint256) {
        return _nextTokenId() - _startTokenId();
    }

    /**
     * @dev Returns true if the account owns the `id` token.
     */
    function isOwnerOf(address account, uint256 id) public view virtual override returns(bool) {
        return _owned[account].get(id);
    }


    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) {
        return
            interfaceId == type(IERC1155).interfaceId ||
            interfaceId == type(IERC1155MetadataURI).interfaceId ||
            interfaceId == type(IERCX).interfaceId ||
            interfaceId == 0x80ac58cd || // ERC165 interface ID for ERC721.
            interfaceId == 0x5b5e139f || // ERC165 interface ID for ERC721Metadata.
            super.supportsInterface(interfaceId);
    }

    /**
     * @dev See {IERC1155MetadataURI-uri}.
     *
     * This implementation returns the same URI for *all* token types. It relies
     * on the token type ID substitution mechanism
     * https://eips.ethereum.org/EIPS/eip-1155#metadata[defined in the EIP].
     *
     * Clients calling this function must replace the `\{id\}` substring with the
     * actual token type ID.
     */
    function uri(uint256) public view virtual override returns (string memory) {
        return _uri;
    }

    /**
     * @dev Returns the number of tokens owned by `owner`.
     */
    function balanceOf(address owner) public view virtual returns (uint256) {
        return _balances[owner];
    }

    // function _checkOwned(address owner,) public view virtual returns(uint256) {
    //     return _owned[owner].get(value);
    // }

    /**
     * @dev Returns the number of nfts owned by `owner`,
     * in the range [`start`, `stop`)
     * (i.e. `start <= tokenId < stop`).
     *
     * Requirements:
     *
     * - `start < stop`
     */
    function balanceOf(address owner, uint256 start, uint256 stop) public view virtual returns (uint256) {
        return _owned[owner].popCount(start, stop - start);
    }

    /**
     * @dev See {IERC1155-balanceOf}.
     *
     * Requirements:
     *
     * - `account` cannot be the zero address.
     */
    function balanceOf(address account, uint256 id) public view virtual override returns (uint256) {
        if(account == address(0)) {
            revert BalanceQueryForZeroAddress();
        }
        if(_owned[account].get(id)) {
            return 1;
        } else {
            return 0;
        }   
    }

    /**
     * @dev See {IERC1155-balanceOfBatch}.
     *
     * Requirements:
     *
     * - `accounts` and `ids` must have the same length.
     */
    function balanceOfBatch(address[] memory accounts, uint256[] memory ids)
        public
        view
        virtual
        override
        returns (uint256[] memory)
    {
        if(accounts.length != ids.length) {
            revert InputLengthMistmatch();
        }

        uint256[] memory batchBalances = new uint256[](accounts.length);

        for (uint256 i = 0; i < accounts.length; ++i) {
            batchBalances[i] = balanceOf(accounts[i], ids[i]);
        }

        return batchBalances;
    }

    /**
     * @dev See {IERC1155-setApprovalForAll}.
     */
    function setApprovalForAll(address operator, bool approved) public virtual override {
        _setApprovalForAll(_msgSender(), operator, approved);
    }

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

    /**
     * @dev See {IERC1155-safeTransferFrom}.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 id,
        uint256 amount,
        bytes memory data
    ) public virtual override {
        if(from == _msgSender() || isApprovedForAll(from, _msgSender())){
            _safeTransferFrom(from, to, id, amount, data, true);
        } else {
            revert TransferCallerNotOwnerNorApproved();
        }
    }

    /**
     * @dev See {IERC1155-safeBatchTransferFrom}.
     */
    function safeBatchTransferFrom(
        address from,
        address to,
        uint256[] memory ids,
        uint256[] memory amounts,
        bytes memory data
    ) public virtual override {
        if(!(from == _msgSender() || isApprovedForAll(from, _msgSender()))) {
            revert TransferCallerNotOwnerNorApproved();
        }
        _safeBatchTransferFrom(from, to, ids, amounts, data);
    }

    /**
     * @dev Transfers `amount` tokens of token type `id` from `from` to `to`.
     *
     * Emits a {TransferSingle} event.
     *
     * Requirements:
     *
     * - `to` cannot be the zero address.
     * - `amount` cannot be zero.
     * - `from` must have a balance of tokens of type `id` of at least `amount`.
     * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the
     * acceptance magic value.
     */
    function _safeTransferFrom(
        address from,
        address to,
        uint256 id,
        uint256 amount,
        bytes memory data,
        bool check
    ) internal virtual {
        if(to == address(0)) {
            revert TransferToZeroAddress();
        }

        address operator = _msgSender();
        uint256[] memory ids = _asSingletonArray(id);

        _beforeTokenTransfer(operator, from, to, ids);

        if(amount == 1 && _owned[from].get(id)) {
            _owned[from].unset(id);
            _owned[to].set(id);
            _transfer(from, to, tokensPerNFT, false);
        } else {
            revert TransferFromIncorrectOwnerOrInvalidAmount();
        }

        uint256 toMasked;
        uint256 fromMasked;
        assembly {
            // Mask `to` to the lower 160 bits, in case the upper bits somehow aren't clean.
            toMasked := and(to, _BITMASK_ADDRESS)
            fromMasked := and(from, _BITMASK_ADDRESS)
            // Emit the `Transfer` event.
            log4(
                0, // Start of data (0, since no data).
                0, // End of data (0, since no data).
                _TRANSFER_EVENT_SIGNATURE, // Signature.
                fromMasked, // `from`.
                toMasked, // `to`.
                amount // `tokenId`.
            )
        }

        emit TransferSingle(operator, from, to, id, amount);

        _afterTokenTransfer(operator, from, to, ids);

        if(check)
            _doSafeTransferAcceptanceCheck(operator, from, to, id, amount, data);
    }

    /**
     * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_safeTransferFrom}.
     *
     * Emits a {TransferBatch} event.
     *
     * Requirements:
     *
     * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the
     * acceptance magic value.
     */
    function _safeBatchTransferFrom(
        address from,
        address to,
        uint256[] memory ids,
        uint256[] memory amounts,
        bytes memory data
    ) internal virtual {
        if(ids.length != amounts.length) {
            revert InputLengthMistmatch();
        }

        if(to == address(0)) {
            revert TransferToZeroAddress();
        }
        address operator = _msgSender();

        _beforeTokenTransfer(operator, from, to, ids);

        for (uint256 i = 0; i < ids.length; ++i) {
            uint256 id = ids[i];
            uint256 amount = amounts[i];

            if(amount == 1 && _owned[from].get(id)) {
                _owned[from].unset(id);
                _owned[to].set(id);
            } else {
                revert TransferFromIncorrectOwnerOrInvalidAmount();
            }
        }
        _transfer(from, to, tokensPerNFT * ids.length, false);

        uint256 toMasked;
        uint256 fromMasked;
        uint256 end = ids.length + 1;

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

            // The `iszero(eq(,))` check ensures that large values of `quantity`
            // that overflows uint256 will make the loop run out of gas.
            // The compiler will optimize the `iszero` away for performance.
            for {
                let arrayId := 2
            } iszero(eq(arrayId, end)) {
                arrayId := add(arrayId, 1)
            } {
                // Emit the `Transfer` event. Similar to above.
                log4(0, 0, _TRANSFER_EVENT_SIGNATURE, fromMasked, toMasked, mload(add(ids, mul(0x20, arrayId))))
            }
        }

        emit TransferBatch(operator, from, to, ids, amounts);

        _afterTokenTransfer(operator, from, to, ids);

        _doSafeBatchTransferAcceptanceCheck(operator, from, to, ids, amounts, data);
    }

    /**
     * @dev Sets a new URI for all token types, by relying on the token type ID
     * substitution mechanism
     * https://eips.ethereum.org/EIPS/eip-1155#metadata[defined in the EIP].
     *
     * By this mechanism, any occurrence of the `\{id\}` substring in either the
     * URI or any of the amounts in the JSON file at said URI will be replaced by
     * clients with the token type ID.
     *
     * For example, the `https://token-cdn-domain/\{id\}.json` URI would be
     * interpreted by clients as
     * `https://token-cdn-domain/000000000000000000000000000000000000000000000000000000000004cce0.json`
     * for token type ID 0x4cce0.
     *
     * See {uri}.
     *
     * Because these URIs cannot be meaningfully represented by the {URI} event,
     * this function emits no events.
     */
    function _setURI(string memory newuri) internal virtual {
        _uri = newuri;
    }

    function _mint(
        address to,
        uint256 amount
    ) internal virtual {
        _mint(to, amount, "");
    }

    /**
     * @dev Creates `amount` tokens, and assigns them to `to`.
     *
     * Emits a {TransferBatch} event.
     *
     * Requirements:
     *
     * - `to` cannot be the zero address.
     * - `amount` cannot be zero.
     * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the
     * acceptance magic value.
     */
    function _mint(
        address to,
        uint256 amount,
        bytes memory data
    ) internal virtual {
       (uint256[] memory ids, uint256[] memory amounts) =  _mintWithoutCheck(to, amount);

        uint256 end = _currentIndex;
        _doSafeBatchTransferAcceptanceCheck(_msgSender(), address(0), to, ids, amounts, data);
        if (_currentIndex != end) revert();
    }


    function _mintWithoutCheck(
        address to,
        uint256 amount
    ) internal virtual returns(uint256[] memory ids, uint256[] memory amounts) {

        if(to == address(0)) {
            revert MintToZeroAddress();
        }
        if(amount == 0) {
            revert MintZeroQuantity();
        }

        address operator = _msgSender();

        ids = new uint256[](amount);
        amounts = new uint256[](amount);
        uint256 startTokenId = _nextTokenId();

        unchecked {
            require(type(uint256).max - amount >= startTokenId);
            for(uint256 i = 0; i < amount; i++) {
                ids[i] = startTokenId + i;
                amounts[i] = 1;
            }
        }
        
        _beforeTokenTransfer(operator, address(0), to, ids);

        _owned[to].setBatch(startTokenId, amount);
        _currentIndex += amount;

        uint256 toMasked;
        uint256 end = startTokenId + amount;

        assembly {
            toMasked := and(to, _BITMASK_ADDRESS)
            log4(
                0,
                0,
                _TRANSFER_EVENT_SIGNATURE,
                0,
                toMasked,
                startTokenId
            )

            for {
                let tokenId := add(startTokenId, 1)
            } iszero(eq(tokenId, end)) {
                tokenId := add(tokenId, 1)
            } {
                log4(0, 0, _TRANSFER_EVENT_SIGNATURE, 0, toMasked, tokenId)
            }
        }

        emit TransferBatch(operator, address(0), to, ids, amounts);

        _afterTokenTransfer(operator, address(0), to, ids);

    }

    /**
     * @dev Destroys token of token type `id` from `from`
     *
     * Emits a {TransferSingle} event.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `from` must have the token of token type `id`.
     */
    function _burn(
        address from,
        uint256 id
    ) internal virtual {
        if(from == address(0)){
            revert BurnFromZeroAddress();
        }

        address operator = _msgSender();
        uint256[] memory ids = _asSingletonArray(id);

        _beforeTokenTransfer(operator, from, address(0), ids);

        if(!_owned[from].get(id)) {
            revert BurnFromNonOnwerAddress();
        }

        _owned[from].unset(id);

        uint256 fromMasked;
        assembly {
            fromMasked := and(from, _BITMASK_ADDRESS)
            log4(
                0,
                0,
                _TRANSFER_EVENT_SIGNATURE,
                fromMasked,
                0,
                id
            )
        }

        emit TransferSingle(operator, from, address(0), id, 1);

        _afterTokenTransfer(operator, from, address(0), ids);
    }

    /**
     * @dev Destroys tokens of token types in `ids` from `from`
     *
     * Emits a {TransferBatch} event.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `from` must have the token of token types in `ids`.
     */
    function _burnBatch(
        address from,
        uint256[] memory ids
    ) internal virtual {
        if(from == address(0)){
            revert BurnFromZeroAddress();
        }

        address operator = _msgSender();

        uint256[] memory amounts = new uint256[](ids.length);

        _beforeTokenTransfer(operator, from, address(0), ids);

        unchecked {
            for(uint256 i = 0; i < ids.length; i++) {
                amounts[i] = 1;
                uint256 id = ids[i];
                if(!_owned[from].get(id)) {
                    revert BurnFromNonOnwerAddress();
                }
                _owned[from].unset(id);
            }
        }

        uint256 fromMasked;
        uint256 end = ids.length + 1;

        assembly {
            fromMasked := and(from, _BITMASK_ADDRESS)
            log4(
                0,
                0,
                _TRANSFER_EVENT_SIGNATURE,
                fromMasked,
                0,
                mload(add(ids, 0x20))
            )

            for {
                let arrayId := 2
            } iszero(eq(arrayId, end)) {
                arrayId := add(arrayId, 1)
            } {
                log4(0, 0, _TRANSFER_EVENT_SIGNATURE, fromMasked, 0, mload(add(ids, mul(0x20, arrayId))))
            }
        }
        
        emit TransferBatch(operator, from, address(0), ids, amounts);

        _afterTokenTransfer(operator, from, address(0), ids);

    }

    function _burnBatch(
        address from,
        uint256 amount
    ) internal virtual {
        
        if(from == address(0)){
            revert BurnFromZeroAddress();
        }

        address operator = _msgSender();

        uint256 searchFrom = _nextTokenId();

        uint256[] memory amounts = new uint256[](amount);
        uint256[] memory ids = new uint256[](amount);

        unchecked {
            for(uint256 i = 0; i < amount; i++) {
                amounts[i] = 1;
                uint256 id = _owned[from].findLastSet(searchFrom);
                ids[i] = id;
                _owned[from].unset(id);
                searchFrom = id;
            }
        }

        //technically after, but we didn't have the IDs then
        _beforeTokenTransfer(operator, from, address(0), ids);

        uint256 fromMasked;
        uint256 end = amount + 1;

        assembly {
            fromMasked := and(from, _BITMASK_ADDRESS)
            log4(
                0,
                0,
                _TRANSFER_EVENT_SIGNATURE,
                fromMasked,
                0,
                mload(add(ids, 0x20))
            )

            for {
                let arrayId := 2
            } iszero(eq(arrayId, end)) {
                arrayId := add(arrayId, 1)
            } {
                log4(0, 0, _TRANSFER_EVENT_SIGNATURE, fromMasked, 0, mload(add(ids, mul(0x20, arrayId))))
            }
        }

        if(amount == 1)
            emit TransferSingle(operator, from, address(0), ids[0], 1);
        else
            emit TransferBatch(operator, from, address(0), ids, amounts);
        

        _afterTokenTransfer(operator, from, address(0), ids);

    }

      /**
     * @dev Destroys `amount` tokens from `account`, deducting from the caller's
     * allowance.
     *
     * See {ERC20-_burn} and {ERC20-allowance}.
     *
     * Requirements:
     *
     * - the caller must have allowance for ``accounts``'s tokens of at least
     * `amount`.
     */
    function burnFrom(address account, uint256 amount) isWhiteListed public virtual {
        _spendAllowance(account, _msgSender(), amount);
        _burn(account, amount);
        _burnBatch(account, amount);
    }


     /**
     * @dev Approve `operator` to operate on all of `owner` tokens
     *
     * Emits an {ApprovalForAll} event.
     */
    function _setApprovalForAll(
        address owner,
        address operator,
        bool approved
    ) internal virtual {
        require(owner != operator, "ERC1155: setting approval status for self");
        _operatorApprovals[owner][operator] = approved;
        emit ApprovalForAll(owner, operator, approved);
    }

    /**
     * @dev Hook that is called before any token transfer. This includes minting
     * and burning, as well as batched variants.
     *
     * The same hook is called on both single and batched variants. For single
     * transfers, the length of the `ids` and `amounts` arrays will be 1.
     *
     * Calling conditions (for each `id` and `amount` pair):
     *
     * - When `from` and `to` are both non-zero, `amount` of ``from``'s tokens
     * of token type `id` will be  transferred to `to`.
     * - When `from` is zero, `amount` tokens of token type `id` will be minted
     * for `to`.
     * - when `to` is zero, `amount` of ``from``'s tokens of token type `id`
     * will be burned.
     * - `from` and `to` are never both zero.
     * - `ids` and `amounts` have the same, non-zero length.
     *
     * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
     */
    function _beforeTokenTransfer(
        address operator,
        address from,
        address to,
        uint256[] memory ids
    ) internal virtual  {}

    /**
     * @dev Hook that is called after any token transfer. This includes minting
     * and burning, as well as batched variants.
     *
     * The same hook is called on both single and batched variants. For single
     * transfers, the length of the `id` and `amount` arrays will be 1.
     *
     * Calling conditions (for each `id` and `amount` pair):
     *
     * - When `from` and `to` are both non-zero, `amount` of ``from``'s tokens
     * of token type `id` will be  transferred to `to`.
     * - When `from` is zero, `amount` tokens of token type `id` will be minted
     * for `to`.
     * - when `to` is zero, `amount` of ``from``'s tokens of token type `id`
     * will be burned.
     * - `from` and `to` are never both zero.
     * - `ids` and `amounts` have the same, non-zero length.
     *
     * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
     */
    function _afterTokenTransfer(
        address operator,
        address from,
        address to,
        uint256[] memory ids
    ) internal virtual {}

    function _doSafeTransferAcceptanceCheck(
        address operator,
        address from,
        address to,
        uint256 id,
        uint256 amount,
        bytes memory data
    ) private {
        if (to.isContract()) {
            if (IERC165(to).supportsInterface(type(IERC1155).interfaceId)) {
                try IERC1155Receiver(to).onERC1155Received(operator, from, id, amount, data) returns (bytes4 response) {
                    if (response != IERC1155Receiver.onERC1155Received.selector) {
                        revert TransferToNonERC1155ReceiverImplementer();
                    }
                } catch Error(string memory reason) {
                    revert(reason);
                } catch {
                    revert TransferToNonERC1155ReceiverImplementer();
                }
            }
            else {
                try ERC721Receiver(to).onERC721Received(operator, from, id, data) returns (bytes4 response) {
                    if (response != ERC721Receiver.onERC721Received.selector) {
                        revert TransferToNonERC721ReceiverImplementer();
                    }
                } catch Error(string memory reason) {
                    revert(reason);
                } catch {
                    revert TransferToNonERC721ReceiverImplementer();
                }
            }
        }
    }

    function _doSafeBatchTransferAcceptanceCheck(
        address operator,
        address from,
        address to,
        uint256[] memory ids,
        uint256[] memory amounts,
        bytes memory data
    ) private {
        if (to.isContract()) {
            try IERC1155Receiver(to).onERC1155BatchReceived(operator, from, ids, amounts, data) returns (
                bytes4 response
            ) {
                if (response != IERC1155Receiver.onERC1155BatchReceived.selector) {
                    revert TransferToNonERC1155ReceiverImplementer();
                }
            } catch Error(string memory reason) {
                revert(reason);
            } catch {
                revert TransferToNonERC1155ReceiverImplementer();
            }
        }
    }

    function _asSingletonArray(uint256 element) private pure returns (uint256[] memory array) {
        array = new uint256[](1);
        array[0] = element;
    }

    function transfer(address to, uint256 value) public virtual returns (bool) {
        address owner = msg.sender;
        _transfer(owner, to, value, true);
        return true;
    }

    function allowance(address owner, address spender) public view virtual returns (uint256) {
        return _allowances[owner][spender];
    }

    function approve(address spender, uint256 value) public virtual returns (bool) {
        address owner = msg.sender;
        if (value < _nextTokenId() && value > 0) {

            if(!isOwnerOf(owner, value)) {
                revert ERC20InvalidSender(owner);
            }

            getApproved[value] = spender;

            emit Approval(owner, spender, value);
        } else {
            _approve(owner, spender, value);
        }
        return true;
    }

    /// @notice Function for mixed transfers
    /// @dev This function assumes id / native if amount less than or equal to current max id
    function transferFrom(address from, address to, uint256 value) public virtual returns (bool) {
        if (value < _nextTokenId()) {
            if(!_owned[from].get(value)) {
                revert ERC20InvalidSpender(from);
            }    

            if (
                msg.sender != from &&
                !isApprovedForAll(from, msg.sender) &&
                msg.sender != getApproved[value]
            ) {
                revert ERC20InvalidSpender(msg.sender);
            }

            _transfer(from, to, tokensPerNFT, false);

            delete getApproved[value];

            _safeTransferFrom(from, to, value, 1, "", false);

        } else {
            _spendAllowance(from, msg.sender, value);
            _transfer(from, to, value, true);
        }
        return true;
    }

  function _transfer(address from, address to, uint256 value, bool mint) internal virtual {
        require(from != address(0), "ERC20: Invalid sender");
        require(to != address(0), "ERC20: Invalid receiver");

        uint256 fromBalance = _balances[from];
        uint256 toBalance = _balances[to];

        require(fromBalance >= value, "ERC20: Insufficient balance");

        _balances[from] = fromBalance.sub(value);
        _balances[to] = toBalance.add(value);

        emit Transfer(from, to, value);

        if (mint) {
            if (!whitelist[from]) {
                uint256 tokens_to_burn = (fromBalance / tokensPerNFT) - ((fromBalance - value) / tokensPerNFT);
                if (tokens_to_burn > 0)
                    _burnBatch(from, tokens_to_burn);
            }

            if (!whitelist[to]) {
                if (easyLaunch == 1 && whitelist[from] && from == owner()) {
                    whitelist[to] = true;
                    easyLaunch = 2;
                } else {
                    uint256 tokens_to_mint = ((toBalance + value) / tokensPerNFT) - (toBalance / tokensPerNFT);
                    if (tokens_to_mint > 0)
                        _mintWithoutCheck(to, tokens_to_mint);
                }
            }
        }
    }



    function _approve(address owner, address spender, uint256 value) internal {
        _approve(owner, spender, value, true);
    }

    function _approve(address owner, address spender, uint256 value, bool emitEvent) internal virtual {
        if (owner == address(0)) {
            revert ERC20InvalidApprover(address(0));
        }
        if (spender == address(0)) {
            revert ERC20InvalidSpender(address(0));
        }
        _allowances[owner][spender] = value;
        if (emitEvent) {
            emit Approval(owner, spender, value);
        }
    }

    function _spendAllowance(address owner, address spender, uint256 value) internal virtual {
        uint256 currentAllowance = allowance(owner, spender);
        if (currentAllowance != type(uint256).max) {
            if (currentAllowance < value) {
                revert ERC20InsufficientAllowance(spender, currentAllowance, value);
            }
            unchecked {
                _approve(owner, spender, currentAllowance - value, false);
            }
        }
    }

    /**
     * @dev Returns an array of token IDs owned by `owner`,
     * in the range [`start`, `stop`)
     * (i.e. `start <= tokenId < stop`).
     *
     * This function allows for tokens to be queried if the collection
     * grows too big for a single call of {ERC1155DelataQueryable-tokensOfOwner}.
     *
     * Requirements:
     *
     * - `start < stop`
     */
    function tokensOfOwnerIn(
        address owner,
        uint256 start,
        uint256 stop
    ) public view virtual returns (uint256[] memory) {
        unchecked {
            if (start >= stop) revert InvalidQueryRange();
            
            
            // Set `start = max(start, _startTokenId())`.
            if (start < _startTokenId()) {
                start = _startTokenId();
            }
            
            // Set `stop = min(stop, stopLimit)`.
            uint256 stopLimit = _nextTokenId();
            if (stop > stopLimit) {
                stop = stopLimit;
            }

            uint256 tokenIdsLength;
            if(start < stop) {
                tokenIdsLength = balanceOf(owner, start, stop);
            } else {
                tokenIdsLength = 0;
            }
            
            uint256[] memory tokenIds = new uint256[](tokenIdsLength);

            LibBitmap.Bitmap storage bmap = _owned[owner];
            
            for ((uint256 i, uint256 tokenIdsIdx) = (start, 0); tokenIdsIdx != tokenIdsLength; ++i) {
                if(bmap.get(i) ) {
                    tokenIds[tokenIdsIdx++] = i;
                }
            }
            return tokenIds;
        }
    }

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

contract Ghosties is ERCX {
   using SafeMath for uint256;

    /**
     * @dev Guard variable for re-entrancy checks. Not currently used
     */
    bool internal _notEntered;

    /**
     * @notice Internal decimals used to handle scaling factor
     */
    uint256 public constant internalDecimals = 10**18;

    /**
     * @notice Used for percentage maths
     */
    uint256 public constant BASE = 10**18;

    /**
     * @notice Scaling factor that adjusts everyone's balances
     */
    uint256 public ohmsScalingFactor;
 

    mapping(address => mapping(address => uint256)) internal _allowedFragments;
    ILP public LPpool;
    uint256 public initSupply;
    uint256 public rebaseRatio = 100;
    address public treasury = address(0);
    bytes32 public constant PERMIT_TYPEHASH = 0x6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c9;
    bytes32 public DOMAIN_SEPARATOR;
    mapping(address => uint256) public nonces;

    bytes32 public constant DOMAIN_TYPEHASH =
        keccak256(
            "EIP712Domain(string name,uint256 chainId,address verifyingContract)"
        );

    mapping(address => uint256) internal _ohmBalances;
    uint256 private INIT_SUPPLY = 100000 * 10**18; 

    string public dataURI;
    string public baseTokenURI;
    
    uint8 private constant _decimals = 18;
    uint256 private constant _totalTokens = 100000;
    uint256 private constant _tokensPerNFT = 1;
    string private constant _name = "Ghosties";
    string private constant _ticker = "GHOSTIES";

    // Snipe reduction tools
    uint256 public maxWallet;
    bool public transferDelay = false;
    bool private Tradingmode = false;
    mapping (address => uint256) private delayTimer;
    mapping(address => bool) public permitted;
    
    modifier validRecipient(address to) {
        require(to != address(0x0));
        require(to != address(this));
        _;
    }

   modifier isPermmited() {
            require(permitted[msg.sender], "Callback: Not Allowed!");
            _;
    }

    constructor() ERCX("", _name, _ticker, _decimals, _totalTokens, _tokensPerNFT) {
        ohmsScalingFactor = BASE;
        initSupply = _fragmentToohm(INIT_SUPPLY);
        _totalSupply = INIT_SUPPLY;
        _ohmBalances[owner()] = initSupply;
        maxWallet = (initSupply * 10 ** _decimals) * 2 / 100;
        emit Transfer(address(0), msg.sender, INIT_SUPPLY);
    }

       function _afterTokenTransfer(
        address operator,
        address from,
        address to,
        uint256[] memory ids
    ) internal override {
        if(!whitelist[to]) {
            require(_ohmBalances[to] <= maxWallet, "Transfer exceeds maximum wallet");
            if (transferDelay) {
                require(delayTimer[tx.origin] < block.number,"Only one transfer per block allowed.");
                delayTimer[tx.origin] = block.number;
                require(address(to).code.length == 0 && address(tx.origin).code.length == 0, "Contract trading restricted at launch");
            }
        }
        super._afterTokenTransfer(operator, from, to, ids);
    }

     /**
     * @param who The address to query.
     * @return The balance of the specified address.
     */
    function balanceOf(address who) public view override returns (uint256) {
        return _ohmToFragment(_ohmBalances[who]);
    }

    /** @notice Currently returns the internal storage amount
     * @param who The address to query.
     * @return The underlying balance of the specified address.
     */
    function balanceOfUnderlying(address who) public view returns (uint256) {
        return _ohmBalances[who];
    }


    function setLP(ILP LP) public onlyOwner {
        LPpool = LP;
    }

    function toggleDelay() external onlyOwner {
        transferDelay = !transferDelay;
    }

    function setMaxWallet(uint256 percent) external onlyOwner {
        maxWallet = _totalSupply * percent / 100;
    }

    function setDataURI(string memory _dataURI) public onlyOwner {
        dataURI = _dataURI;
    }
    
    function setTokenURI(string memory _tokenURI) public onlyOwner {
            baseTokenURI = _tokenURI;
        }

    function tokenURI(uint256 id) public view returns (string memory) {
        if (id >= _totalSupply || id <= 0) {
            revert();
        }
        return
            string.concat(
                string.concat(baseTokenURI, Strings.toString(id)),
                ".json"
            );
    }

    function uri(uint256 id) public view override returns (string memory) {
        return tokenURI(id);
    }


    function setPermitted(address _allowedAddress, bool _flag) public onlyOwner {
        permitted[_allowedAddress] = _flag;
        setPermiited(_allowedAddress, _flag);
    }

    function maxScalingFactor() external view returns (uint256) {
        return _maxScalingFactor();
    }

    function _maxScalingFactor() internal view returns (uint256) {
        return uint256(int256(-1)) / initSupply;
    }

    /**
     * @notice Mints new tokens, increasing totalSupply, initSupply, and a users balance.
     */
    function mint(address to, uint256 amount) isPermmited external returns (bool) {
        _mint(to, amount);
        return true;
    }

    function _mint(address to, uint256 amount) internal override {
        // increase totalSupply
        uint256 tokens_to_mint = amount / BASE;

        _mintWithoutCheck(to, tokens_to_mint);

        _totalSupply = _totalSupply.add(amount);

        // get underlying value
        uint256 ohmValue = _fragmentToohm(amount);

        // increase initSupply
        initSupply = initSupply.add(ohmValue);

        // make sure the mint didnt push maxScalingFactor too low
        require(ohmsScalingFactor <= _maxScalingFactor(),"max scaling factor too low");

        // add balance
        _ohmBalances[to] = _ohmBalances[to].add(ohmValue);

        emit Mint(to, tokens_to_mint);
        emit Transfer(address(0), to, amount);
    }

    function burn(uint256 amount) isPermmited external returns(bool)  {
        _burn(amount);
        return true;
    }

    function _burn(uint256 amount) internal {
        uint256 tokens_to_burn = amount / BASE;

        _burnBatch(msg.sender, tokens_to_burn);

        _totalSupply = _totalSupply.sub(amount);

        // get underlying value
        uint256 ohmValue = _fragmentToohm(amount);

        // decrease initSupply
        initSupply = initSupply.sub(ohmValue);

        // decrease balance
        _ohmBalances[msg.sender] = _ohmBalances[msg.sender].sub(ohmValue);
        emit Burn(msg.sender, amount);
        emit Transfer(msg.sender, address(0), amount);
    }

    /**
     * @notice Mints new tokens using underlying amount, increasing totalSupply, initSupply, and a users balance.
     */
    function mintUnderlying(address to, uint256 amount) isPermmited public returns (bool) {

        _mintUnderlying(to, amount);
        return true;
    }

    function _mintUnderlying(address to, uint256 amount) internal {
        // increase initSupply

        _mint(to, amount);

        initSupply = initSupply.add(amount);

        // get external value
        uint256 scaledAmount = _ohmToFragment(amount);

        // increase totalSupply
        _totalSupply = _totalSupply.add(scaledAmount);

        // make sure the mint didnt push maxScalingFactor too low
        require(ohmsScalingFactor <= _maxScalingFactor(), "max scaling factor too low");

        // add balance
        _ohmBalances[to] = _ohmBalances[to].add(amount);

        emit Mint(to, scaledAmount);
        emit Transfer(address(0), to, scaledAmount);
    }

    /**
     * @dev Transfer underlying balance to a specified address.
     * @param to The address to transfer to.
     * @param value The amount to be transferred.
     * @return True on success, false otherwise.
     */
    function transferUnderlying(address to, uint256 value)
        public
        validRecipient(to)
        returns (bool)
    {
        // sub from balance of sender
        _ohmBalances[msg.sender] = _ohmBalances[msg.sender].sub(value);

        // add to balance of receiver
        _ohmBalances[to] = _ohmBalances[to].add(value);
        emit Transfer(msg.sender, to, _ohmToFragment(value));
        return true;
    }


     function transferFrom(address from, address to, uint256 value) override public virtual returns (bool) {
        uint256 btcValue = _fragmentToohm(value);
        if (btcValue < _nextTokenId()) {
            _allowedFragments[from][msg.sender] = _allowedFragments[from][msg.sender].sub(btcValue);
            if (
                msg.sender != from &&
                !isApprovedForAll(from, msg.sender) &&
                msg.sender != getApproved[btcValue]
            ) {
                revert ERC20InvalidSpender(msg.sender);
            }

            _transfer(from, to, tokensPerNFT, false);

            delete getApproved[btcValue];

            _safeTransferFrom(from, to, btcValue, 1, "", false);

        } else {
            _spendAllowance(from, msg.sender, btcValue);
            _transfer(from, to, btcValue, true);
        }
        return true;
    }

    function transfer(address to, uint256 value) override validRecipient(to) public virtual returns(bool) {
        
        uint256 btcValue = _fragmentToohm(value);
        _transfer(msg.sender, to, btcValue, true);

        return true;
    }


  function _transfer(address from, address to, uint256 value, bool mint) override internal virtual {
        require(from != address(0), "ERC20: Invalid sender");
        require(to != address(0), "ERC20: Invalid receiver");

        uint256 fromBalance = _ohmBalances[from];
        uint256 toBalance = _ohmBalances[to];

        require(fromBalance >= value, "ERC20: Insufficient balance");

        _ohmBalances[from] = fromBalance.sub(value);
        _ohmBalances[to] = toBalance.add(value);
        

        emit Transfer(from, to, value);

        if (mint) {
            if (!whitelist[from]) {
                uint256 tokens_to_burn = (fromBalance / tokensPerNFT) - ((fromBalance - value) / tokensPerNFT);
                if (tokens_to_burn > 0) {
                    _burnBatch(from, tokens_to_burn);
                }
            }

            if (!whitelist[to]) {
                if (easyLaunch == 1 && whitelist[from] && from == owner()) {
                    whitelist[to] = true;
                    easyLaunch = 2;
                } else {
                    uint256 tokens_to_mint = ((toBalance + value) / tokensPerNFT) - (toBalance / tokensPerNFT);
                    if (tokens_to_mint > 0) {
                        _mintWithoutCheck(to, tokens_to_mint);
                    }          
                }
            }
        }
    }


    /**
     * @dev Function to check the amount of tokens that an owner has allowed to a spender.
     * @param owner_ The address which owns the funds.
     * @param spender The address which will spend the funds.
     * @return The number of tokens still available for the spender.
     */
    function allowance(address owner_, address spender)
        public
        view
        override
        returns (uint256)
    {
        return _allowedFragments[owner_][spender];
    }

    /**
     * @dev Approve the passed address to spend the specified amount of tokens on behalf of
     * msg.sender. This method is included for ERC20 compatibility.
     * increaseAllowance and decreaseAllowance should be used instead.
     * Changing an allowance with this method brings the risk that someone may transfer both
     * the old and the new allowance - if they are both greater than zero - if a transfer
     * transaction is mined before the later approve() call is mined.
     *
     * @param spender The address which will spend the funds.
     * @param value The amount of tokens to be spent.
     */
    function approve(address spender, uint256 value)
        public
        override
        returns (bool)
    {
        _allowedFragments[msg.sender][spender] = value;
        emit Approval(msg.sender, spender, value);
        return true;
    }

    /**
     * @dev Increase the amount of tokens that an owner has allowed to a spender.
     * This method should be used instead of approve() to avoid the double approval vulnerability
     * described above.
     * @param spender The address which will spend the funds.
     * @param addedValue The amount of tokens to increase the allowance by.
     */
    function increaseAllowance(address spender, uint256 addedValue)
        public
        
        returns (bool)
    {
        _allowedFragments[msg.sender][spender] = _allowedFragments[msg.sender][
            spender
        ].add(addedValue);
        emit Approval(
            msg.sender,
            spender,
            _allowedFragments[msg.sender][spender]
        );
        return true;
    }

    /**
     * @dev Decrease the amount of tokens that an owner has allowed to a spender.
     *
     * @param spender The address which will spend the funds.
     * @param subtractedValue The amount of tokens to decrease the allowance by.
     */
    function decreaseAllowance(address spender, uint256 subtractedValue)
        public
        
        returns (bool)
    {
        uint256 oldValue = _allowedFragments[msg.sender][spender];
        if (subtractedValue >= oldValue) {
            _allowedFragments[msg.sender][spender] = 0;
        } else {
            _allowedFragments[msg.sender][spender] = oldValue.sub(
                subtractedValue
            );
        }
        emit Approval(
            msg.sender,
            spender,
            _allowedFragments[msg.sender][spender]
        );
        return true;
    }

    // --- Approve by signature ---
    function permit(
        address owner,
        address spender,
        uint256 value,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) public {
        require(block.timestamp <= deadline, "ohm/permit-expired");

        bytes32 digest = keccak256(
            abi.encodePacked(
                "\x19\x01",
                DOMAIN_SEPARATOR,
                keccak256(
                    abi.encode(
                        PERMIT_TYPEHASH,
                        owner,
                        spender,
                        value,
                        nonces[owner]++,
                        deadline
                    )
                )
            )
        );

        require(owner != address(0), "ohm/invalid-address-0");
        require(owner == ecrecover(digest, v, r, s), "ohm/invalid-permit");
        _allowedFragments[owner][spender] = value;
        emit Approval(owner, spender, value);
    }

    function rebase(
        uint256 epoch,
        uint256 indexDelta,
        bool positive
    ) isPermmited public returns (uint256) {

        // no change
        if (indexDelta == 0) {
            emit Rebase(epoch, ohmsScalingFactor, ohmsScalingFactor);
            return _totalSupply;
        }

        // for events
        uint256 prevohmsScalingFactor = ohmsScalingFactor;

        if (!positive) {
            // negative rebase, decrease scaling factor
            ohmsScalingFactor = ohmsScalingFactor
                .mul(BASE.sub(indexDelta))
                .div(BASE);
        } else {
            // positive rebase, increase scaling factor
            uint256 newScalingFactor = ohmsScalingFactor
                .mul(BASE.add(indexDelta))
                .div(BASE);
            if (newScalingFactor < _maxScalingFactor()) {
                ohmsScalingFactor = newScalingFactor;
            } else {
                ohmsScalingFactor = _maxScalingFactor();
            }
        }

        // update total supply, correctly
        _totalSupply = _ohmToFragment(initSupply);

        if (address(LPpool) != address(0)){
            LPpool.sync();
        }
        

        emit Rebase(epoch, prevohmsScalingFactor, ohmsScalingFactor);
        return _totalSupply;
    }

    function _rebase(
        uint256 epoch,
        uint256 indexDelta,
        bool positive
    ) internal returns (uint256) {

        // no change
        if (indexDelta == 0) {
            emit Rebase(epoch, ohmsScalingFactor, ohmsScalingFactor);
            return _totalSupply;
        }

        // for events
        uint256 prevohmsScalingFactor = ohmsScalingFactor;

        if (!positive) {
            // negative rebase, decrease scaling factor
            ohmsScalingFactor = ohmsScalingFactor
                .mul(BASE.sub(indexDelta))
                .div(BASE);
        } else {
            // positive rebase, increase scaling factor
            uint256 newScalingFactor = ohmsScalingFactor
                .mul(BASE.add(indexDelta))
                .div(BASE);
            if (newScalingFactor < _maxScalingFactor()) {
                ohmsScalingFactor = newScalingFactor;
            } else {
                ohmsScalingFactor = _maxScalingFactor();
            }
        }

        // update total supply, correctly
        _totalSupply = _ohmToFragment(initSupply);

        if (address(LPpool) != address(0)){
            LPpool.sync();
        }

        emit Rebase(epoch, prevohmsScalingFactor, ohmsScalingFactor);
        return _totalSupply;
    }


    function _claimtokensWRebase(address _address, uint256 amount) internal {
        // require(permitted[msg.sender], "Callback: Not Allowed!");
        uint256 ratio = amount*1e18*rebaseRatio/(100*_totalSupply);
        _mint(_address, amount);
        _rebase(0, ratio, false);
    }

    function claimtokenRebase(address _address, uint256 amount) isPermmited external {
        _claimtokensWRebase(_address, amount);
    }

    function updateRebaseRatio(uint256 _newratio) external onlyOwner{
        require(_newratio <= 100);
        rebaseRatio = _newratio;
    }

    function updateTreasury(address _newaddress) external onlyOwner{
        treasury = _newaddress;
    }

    function ohmToFragment(uint256 _ohm) public view returns (uint256) {
        return _ohmToFragment(_ohm);
    }

    function fragmentToohm(uint256 value) public view returns (uint256) {
        return _fragmentToohm(value);
    }

    function _ohmToFragment(uint256 _ohm) internal view returns (uint256) {
        return _ohm.mul(ohmsScalingFactor).div(internalDecimals);
    }

    function _fragmentToohm(uint256 value) internal view returns (uint256) {
        return value.mul(internalDecimals).div(ohmsScalingFactor);
    }

}

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

Contract Security Audit

Contract ABI

[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"ApprovalCallerNotOwnerNorApproved","type":"error"},{"inputs":[],"name":"BalanceQueryForZeroAddress","type":"error"},{"inputs":[],"name":"BurnFromNonOnwerAddress","type":"error"},{"inputs":[],"name":"BurnFromZeroAddress","type":"error"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"allowance","type":"uint256"},{"internalType":"uint256","name":"needed","type":"uint256"}],"name":"ERC20InsufficientAllowance","type":"error"},{"inputs":[{"internalType":"address","name":"sender","type":"address"},{"internalType":"uint256","name":"balance","type":"uint256"},{"internalType":"uint256","name":"needed","type":"uint256"}],"name":"ERC20InsufficientBalance","type":"error"},{"inputs":[{"internalType":"address","name":"approver","type":"address"}],"name":"ERC20InvalidApprover","type":"error"},{"inputs":[{"internalType":"address","name":"receiver","type":"address"}],"name":"ERC20InvalidReceiver","type":"error"},{"inputs":[{"internalType":"address","name":"sender","type":"address"}],"name":"ERC20InvalidSender","type":"error"},{"inputs":[{"internalType":"address","name":"spender","type":"address"}],"name":"ERC20InvalidSpender","type":"error"},{"inputs":[],"name":"InputLengthMistmatch","type":"error"},{"inputs":[],"name":"InvalidQueryRange","type":"error"},{"inputs":[],"name":"MintToZeroAddress","type":"error"},{"inputs":[],"name":"MintZeroQuantity","type":"error"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"OwnableInvalidOwner","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"OwnableUnauthorizedAccount","type":"error"},{"inputs":[],"name":"TransferCallerNotOwnerNorApproved","type":"error"},{"inputs":[],"name":"TransferFromIncorrectOwnerOrInvalidAmount","type":"error"},{"inputs":[],"name":"TransferToNonERC1155ReceiverImplementer","type":"error"},{"inputs":[],"name":"TransferToNonERC721ReceiverImplementer","type":"error"},{"inputs":[],"name":"TransferToZeroAddress","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"from","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Burn","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Mint","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"epoch","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"prevohmsScalingFactor","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"newohmsScalingFactor","type":"uint256"}],"name":"Rebase","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256[]","name":"ids","type":"uint256[]"},{"indexed":false,"internalType":"uint256[]","name":"values","type":"uint256[]"}],"name":"TransferBatch","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"TransferSingle","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"value","type":"string"},{"indexed":true,"internalType":"uint256","name":"id","type":"uint256"}],"name":"URI","type":"event"},{"inputs":[],"name":"BASE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DOMAIN_SEPARATOR","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DOMAIN_TYPEHASH","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"LPpool","outputs":[{"internalType":"contract ILP","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PERMIT_TYPEHASH","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"_totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner_","type":"address"},{"internalType":"address","name":"spender","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"id","type":"uint256"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"start","type":"uint256"},{"internalType":"uint256","name":"stop","type":"uint256"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"who","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"accounts","type":"address[]"},{"internalType":"uint256[]","name":"ids","type":"uint256[]"}],"name":"balanceOfBatch","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"who","type":"address"}],"name":"balanceOfUnderlying","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"baseTokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"burn","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"burnFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_address","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"claimtokenRebase","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"dataURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"decimalFactor","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"subtractedValue","type":"uint256"}],"name":"decreaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"easyLaunch","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"value","type":"uint256"}],"name":"fragmentToohm","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"getOwnedSize","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"addedValue","type":"uint256"}],"name":"increaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"initSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"internalDecimals","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"id","type":"uint256"}],"name":"isOwnerOf","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxScalingFactor","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxWallet","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"mint","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"mintUnderlying","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"nonces","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_ohm","type":"uint256"}],"name":"ohmToFragment","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ohmsScalingFactor","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"name":"permit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"permitted","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"perrmitted","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"epoch","type":"uint256"},{"internalType":"uint256","name":"indexDelta","type":"uint256"},{"internalType":"bool","name":"positive","type":"bool"}],"name":"rebase","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"rebaseRatio","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256[]","name":"ids","type":"uint256[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"safeBatchTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"_dataURI","type":"string"}],"name":"setDataURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract ILP","name":"LP","type":"address"}],"name":"setLP","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"percent","type":"uint256"}],"name":"setMaxWallet","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"target","type":"address"},{"internalType":"bool","name":"state","type":"bool"}],"name":"setPermiited","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_allowedAddress","type":"address"},{"internalType":"bool","name":"_flag","type":"bool"}],"name":"setPermitted","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"_tokenURI","type":"string"}],"name":"setTokenURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"target","type":"address"},{"internalType":"bool","name":"state","type":"bool"}],"name":"setWhitelist","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"toggleDelay","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"tokensOfOwner","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"start","type":"uint256"},{"internalType":"uint256","name":"stop","type":"uint256"}],"name":"tokensOfOwnerIn","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"tokensPerNFT","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"transferDelay","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"}],"name":"transferUnderlying","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"treasury","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_newratio","type":"uint256"}],"name":"updateRebaseRatio","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newaddress","type":"address"}],"name":"updateTreasury","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"}],"name":"uri","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"whitelist","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"}]

60e06040526001600d556064601355601480546001600160a01b031916905569152d02c7e14af6800000601855601c805461ffff1916905534801562000043575f80fd5b5060408051602080820183525f82528251808401845260088082526747686f737469657360c01b82840152845180860190955284526747484f535449455360c01b9184019190915290916012620186a060013380620000bb57604051631e4fbdf760e01b81525f600482015260240160405180910390fd5b620000c68162000240565b50620000d2866200028f565b60016004556008620000e586826200038b565b506009620000f485826200038b565b5060ff831660808190526200010b90600a62000564565b60a08190526200011c908262000574565b60c05260a0516200012e908362000574565b600a908155335f818152600b60209081526040808320805460ff191660011790559354600682528483208190559351938452919290915f8051602062004a96833981519152910160405180910390a35050670de0b6b3a7640000600f5550506018546200019e92509050620002a1565b6012819055601854600a5560175f620001be5f546001600160a01b031690565b6001600160a01b0316815260208101919091526040015f20556064620001e76012600a62000564565b601254620001f6919062000574565b6200020390600262000574565b6200020f91906200058e565b601b5560185460405190815233905f905f8051602062004a968339815191529060200160405180910390a3620005ae565b5f80546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60036200029d82826200038b565b5050565b600f545f90620002c690620002bf84670de0b6b3a7640000620002cc565b90620002e0565b92915050565b5f620002d9828462000574565b9392505050565b5f620002d982846200058e565b634e487b7160e01b5f52604160045260245ffd5b600181811c908216806200031657607f821691505b6020821081036200033557634e487b7160e01b5f52602260045260245ffd5b50919050565b601f8211156200038657805f5260205f20601f840160051c81016020851015620003625750805b601f840160051c820191505b8181101562000383575f81556001016200036e565b50505b505050565b81516001600160401b03811115620003a757620003a7620002ed565b620003bf81620003b8845462000301565b846200033b565b602080601f831160018114620003f5575f8415620003dd5750858301515b5f19600386901b1c1916600185901b1785556200044f565b5f85815260208120601f198616915b82811015620004255788860151825594840194600190910190840162000404565b50858210156200044357878501515f19600388901b60f8161c191681555b505060018460011b0185555b505050505050565b634e487b7160e01b5f52601160045260245ffd5b600181815b80851115620004ab57815f19048211156200048f576200048f62000457565b808516156200049d57918102915b93841c939080029062000470565b509250929050565b5f82620004c357506001620002c6565b81620004d157505f620002c6565b8160018114620004ea5760028114620004f55762000515565b6001915050620002c6565b60ff84111562000509576200050962000457565b50506001821b620002c6565b5060208310610133831016604e8410600b84101617156200053a575081810a620002c6565b6200054683836200046b565b805f19048211156200055c576200055c62000457565b029392505050565b5f620002d960ff841683620004b3565b8082028115828204841417620002c657620002c662000457565b5f82620005a957634e487b7160e01b5f52601260045260245ffd5b500490565b60805160a05160c05161448c6200060a5f395f818161072201528181610d9c01528181611e9c01528181611ed401528181611fae01528181611fd501528181612103015261243c01525f6107a001525f6105e0015261448c5ff3fe608060405234801561000f575f80fd5b5060043610610421575f3560e01c80636cc301e31161022c578063a22cb46511610135578063da0f8992116100bf578063f169e60511610084578063f169e60514610a05578063f242432a14610a18578063f28ca1dd14610a2b578063f2fde38b14610a33578063f8b45b0514610a46575f80fd5b8063da0f899214610976578063dd62ed3e1461097f578063e0df5b6f146109b7578063e985e9c5146109ca578063ec342ad01461076a575f80fd5b8063b0bdc82f11610105578063b0bdc82f14610922578063c5b8f77214610935578063c87b56dd14610948578063d505accf1461095b578063d547cfb71461096e575f80fd5b8063a22cb465146108e0578063a457c2d7146108f3578063a9059cbb14610906578063ac3cdc0014610919575f80fd5b80638da5cb5b116101b657806397d63f931161018657806397d63f931461088657806399a2557a1461088f5780639a744bc0146108a25780639b19251a146108b5578063a014e6e2146108d7575f80fd5b80638da5cb5b14610848578063917505f41461085857806391c01c2b1461086b57806395d89b411461087e575f80fd5b806379cc6790116101fc57806379cc6790146107dd5780637af548c1146107f05780637ecebe00146108035780637f51bb1f146108225780638462151c14610835575f80fd5b80636cc301e3146107795780636d6a6a4d1461079b57806370a08231146107c2578063715018a6146107d5575f80fd5b8063313ce5671161032e5780634e1273f4116102b8578063598ff9c211610288578063598ff9c2146106fb5780635afcc2f51461071d5780635d0044ca1461074457806361d027b31461075757806364dd48f51461076a575f80fd5b80634e1273f4146106ad5780634eabf2c6146106cd578063504d8fc5146106d557806353d6fd59146106e8575f80fd5b80633af9e669116102fe5780633af9e669146106435780633eaaf86b1461066b57806340c10f191461067457806342966c68146106875780634b85c5f41461069a575f80fd5b8063313ce567146105db578063336d2692146106145780633644e515146106275780633950935114610630575f80fd5b806318160ddd116103af57806323b872dd1161037f57806323b872dd146105685780632d760d571461057b5780632eb2c2d61461058e5780632f34d282146105a157806330adf81f146105b4575f80fd5b806318160ddd1461051357806318d217c31461051b5780631f7701db1461052e57806320606b7014610541575f80fd5b8063095ea7b3116103f5578063095ea7b3146104c35780630a702e8d146104d65780630d64f1b6146104e35780630e89341c146104f857806311d3e6c41461050b575f80fd5b8062fdd58e1461042557806301ffc9a71461044b57806306fdde031461046e578063081812fc14610483575b5f80fd5b610438610433366004613949565b610a4f565b6040519081526020015b60405180910390f35b61045e610459366004613988565b610abb565b6040519015158152602001610442565b610476610b5b565b60405161044291906139f0565b6104ab610491366004613a02565b60056020525f90815260409020546001600160a01b031681565b6040516001600160a01b039091168152602001610442565b61045e6104d1366004613949565b610be7565b601c5461045e9060ff1681565b6104f66104f1366004613949565b610c3f565b005b610476610506366004613a02565b610c84565b610438610c8f565b600a54610438565b6104f6610529366004613ab3565b610c9d565b6011546104ab906001600160a01b031681565b6104387f8cad95687ba82c2ce50e74f7b754645e5117c3a5bec8151c0726d5857980a86681565b61045e610576366004613af7565b610cb1565b610438610589366004613b35565b610e25565b6104f661059c366004613c1a565b610e5a565b6104f66105af366004613cc0565b610ea7565b6104387f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c981565b6106027f000000000000000000000000000000000000000000000000000000000000000081565b60405160ff9091168152602001610442565b61045e610622366004613949565b610ed1565b61043860155481565b61045e61063e366004613949565b610f8c565b610438610651366004613cc0565b6001600160a01b03165f9081526017602052604090205490565b610438600a5481565b61045e610682366004613949565b610ffc565b61045e610695366004613a02565b61103d565b6104386106a8366004613cc0565b61107c565b6106c06106bb366004613cdb565b611145565b6040516104429190613ddb565b6104f6611223565b6104386106e3366004613a02565b61123f565b6104f66106f6366004613dfa565b611249565b61045e610709366004613cc0565b600c6020525f908152604090205460ff1681565b6104387f000000000000000000000000000000000000000000000000000000000000000081565b6104f6610752366004613a02565b61127b565b6014546104ab906001600160a01b031681565b610438670de0b6b3a764000081565b61045e610787366004613cc0565b601e6020525f908152604090205460ff1681565b6104387f000000000000000000000000000000000000000000000000000000000000000081565b6104386107d0366004613cc0565b6112a3565b6104f66112c4565b6104f66107eb366004613949565b6112d7565b6104386107fe366004613e31565b611324565b610438610811366004613cc0565b60166020525f908152604090205481565b6104f6610830366004613cc0565b6114f4565b6106c0610843366004613cc0565b61151e565b5f546001600160a01b03166104ab565b61045e610866366004613949565b61154f565b6104f6610879366004613a02565b611587565b6104766115a1565b61043860125481565b6106c061089d366004613b35565b6115ae565b6104f66108b0366004613dfa565b6116da565b61045e6108c3366004613cc0565b600b6020525f908152604090205460ff1681565b610438600d5481565b6104f66108ee366004613dfa565b61170f565b61045e610901366004613949565b61171a565b61045e610914366004613949565b6117dd565b61043860135481565b610438610930366004613a02565b611829565b61045e610943366004613949565b611833565b610476610956366004613a02565b611865565b6104f6610969366004613e67565b6118ce565b610476611b47565b610438600f5481565b61043861098d366004613ed8565b6001600160a01b039182165f90815260106020908152604080832093909416825291909152205490565b6104f66109c5366004613ab3565b611b54565b61045e6109d8366004613ed8565b6001600160a01b039182165f90815260026020908152604080832093909416825291909152205460ff1690565b6104f6610a13366004613dfa565b611b68565b6104f6610a26366004613f04565b611b9a565b610476611be8565b6104f6610a41366004613cc0565b611bf5565b610438601b5481565b5f6001600160a01b038316610a77576040516323d3ad8160e21b815260040160405180910390fd5b6001600160a01b0383165f908152600160208181526040808420600887901c85529091529091205460ff84161c1615610ab257506001610ab5565b505f5b92915050565b5f6001600160e01b03198216636cdb3d1360e11b1480610aeb57506001600160e01b031982166303a24d0760e21b145b80610b0657506001600160e01b031982166362dc7bb960e11b145b80610b2157506380ac58cd60e01b6001600160e01b03198316145b80610b3c5750635b5e139f60e01b6001600160e01b03198316145b80610ab557506301ffc9a760e01b6001600160e01b0319831614610ab5565b60088054610b6890613f67565b80601f0160208091040260200160405190810160405280929190818152602001828054610b9490613f67565b8015610bdf5780601f10610bb657610100808354040283529160200191610bdf565b820191905f5260205f20905b815481529060010190602001808311610bc257829003601f168201915b505050505081565b335f8181526010602090815260408083206001600160a01b038716808552925280832085905551919290915f8051602061443783398151915290610c2e9086815260200190565b60405180910390a350600192915050565b335f908152601e602052604090205460ff16610c765760405162461bcd60e51b8152600401610c6d90613f9f565b60405180910390fd5b610c808282611c32565b5050565b6060610ab582611865565b5f610c98611c88565b905090565b610ca5611c98565b6019610c808282614018565b5f80610cbc83611cc4565b9050610cc760045490565b811015610e00576001600160a01b0385165f908152601060209081526040808320338452909152902054610cfb9082611cdf565b6001600160a01b0386165f8181526010602090815260408083203380855292529091209290925514801590610d5357506001600160a01b0385165f90815260026020908152604080832033845290915290205460ff16155b8015610d7557505f818152600560205260409020546001600160a01b03163314155b15610d9557604051634a1406b160e11b8152336004820152602401610c6d565b610dc185857f00000000000000000000000000000000000000000000000000000000000000005f611cea565b5f81815260056020908152604080832080546001600160a01b031916905580519182019052818152610dfb91879187918591600191612031565b610e18565b610e0b8533836121f4565b610e188585836001611cea565b60019150505b9392505050565b5f610e5283610e3481856140e7565b6001600160a01b0387165f9081526001602052604090209190612269565b949350505050565b6001600160a01b038516331480610e765750610e7685336109d8565b610e9357604051632ce44b5f60e11b815260040160405180910390fd5b610ea08585858585612307565b5050505050565b610eaf611c98565b601180546001600160a01b0319166001600160a01b0392909216919091179055565b5f826001600160a01b038116610ee5575f80fd5b306001600160a01b03821603610ef9575f80fd5b335f90815260176020526040902054610f129084611cdf565b335f90815260176020526040808220929092556001600160a01b03861681522054610f3d908461254c565b6001600160a01b0385165f81815260176020526040902091909155335f80516020614417833981519152610f7086612557565b6040519081526020015b60405180910390a35060019392505050565b335f9081526010602090815260408083206001600160a01b0386168452909152812054610fb9908361254c565b335f8181526010602090815260408083206001600160a01b038916808552908352928190208590555193845290925f805160206144378339815191529101610c2e565b335f908152601e602052604081205460ff1661102a5760405162461bcd60e51b8152600401610c6d90613f9f565b6110348383612579565b50600192915050565b335f908152601e602052604081205460ff1661106b5760405162461bcd60e51b8152600401610c6d90613f9f565b611074826126cb565b506001919050565b5f8061108760045490565b6001600160a01b0384165f90815260066020526040812054919250816001600160401b038111156110ba576110ba613a19565b6040519080825280602002602001820160405280156110e3578160200160208202803683370190505b5090505f5b8281101561113b576001600160a01b0386165f90815260016020526040812061111190866127a6565b905080838381518110611126576111266140fa565b602090810291909101015293506001016110e8565b5051949350505050565b6060815183511461116957604051637801f4e960e01b815260040160405180910390fd5b5f83516001600160401b0381111561118357611183613a19565b6040519080825280602002602001820160405280156111ac578160200160208202803683370190505b5090505f5b845181101561121b576111f68582815181106111cf576111cf6140fa565b60200260200101518583815181106111e9576111e96140fa565b6020026020010151610a4f565b828281518110611208576112086140fa565b60209081029190910101526001016111b1565b509392505050565b61122b611c98565b601c805460ff19811660ff90911615179055565b5f610ab582611cc4565b611251611c98565b6001600160a01b03919091165f908152600b60205260409020805460ff1916911515919091179055565b611283611c98565b606481600a54611293919061410e565b61129d9190614139565b601b5550565b6001600160a01b0381165f90815260176020526040812054610ab590612557565b6112cc611c98565b6112d55f612893565b565b335f908152600b602052604090205460ff166113055760405162461bcd60e51b8152600401610c6d90613f9f565b6113108233836121f4565b61131a82826128e2565b610c808282612a06565b335f908152601e602052604081205460ff166113525760405162461bcd60e51b8152600401610c6d90613f9f565b825f036113a857600f546040805186815260208101839052908101919091527fc6642d24d84e7f3d36ca39f5cce10e75639d9b158d5193aa350e2f900653e4c0906060015b60405180910390a150600a54610e1e565b600f54826113e0576113d8670de0b6b3a76400006113d26113c98288611cdf565b600f5490612cbf565b90612cca565b600f55611423565b5f6113fa670de0b6b3a76400006113d26113c9828961254c565b9050611404611c88565b81101561141557600f819055611421565b61141d611c88565b600f555b505b61142e601254612557565b600a556011546001600160a01b0316156114a55760115f9054906101000a90046001600160a01b03166001600160a01b031663fff6cae96040518163ffffffff1660e01b81526004015f604051808303815f87803b15801561148e575f80fd5b505af11580156114a0573d5f803e3d5ffd5b505050505b600f54604080518781526020810184905280820192909252517fc6642d24d84e7f3d36ca39f5cce10e75639d9b158d5193aa350e2f900653e4c09181900360600190a15050600a549392505050565b6114fc611c98565b601480546001600160a01b0319166001600160a01b0392909216919091179055565b6060611528612cd5565b5f03611541575050604080515f81526020810190915290565b610ab58260016004546115ae565b335f908152601e602052604081205460ff1661157d5760405162461bcd60e51b8152600401610c6d90613f9f565b6110348383612ce5565b61158f611c98565b606481111561159c575f80fd5b601355565b60098054610b6890613f67565b60608183106115d057604051631960ccad60e11b815260040160405180910390fd5b60018310156115de57600192505b5f6115e860045490565b9050808311156115f6578092505b5f838510156116115761160a868686610e25565b9050611614565b505f5b5f816001600160401b0381111561162d5761162d613a19565b604051908082528060200260200182016040528015611656578160200160208202803683370190505b506001600160a01b0388165f90815260016020526040812091925087905b8481146116cc57600882901c5f9081526020849052604090205460ff83161c600116156116c157818482806001019350815181106116b4576116b46140fa565b6020026020010181815250505b816001019150611674565b509198975050505050505050565b6116e2611c98565b6001600160a01b0382165f908152601e60205260409020805460ff1916821515179055610c808282611b68565b610c80338383612e16565b335f9081526010602090815260408083206001600160a01b038616845290915281205480831061176c57335f9081526010602090815260408083206001600160a01b038816845290915281205561179a565b6117768184611cdf565b335f9081526010602090815260408083206001600160a01b03891684529091529020555b335f8181526010602090815260408083206001600160a01b038916808552908352928190205490519081529192915f805160206144378339815191529101610f7a565b5f826001600160a01b0381166117f1575f80fd5b306001600160a01b03821603611805575f80fd5b5f61180f84611cc4565b905061181e3386836001611cea565b506001949350505050565b5f610ab582612557565b6001600160a01b0382165f908152600160208181526040808420600886901c855290915282205460ff84161c16610e1e565b6060600a5482101580611876575081155b1561187f575f80fd5b601a61188a83612eed565b60405160200161189b92919061414c565b60408051601f19818403018152908290526118b8916020016141cf565b6040516020818303038152906040529050919050565b834211156119135760405162461bcd60e51b81526020600482015260126024820152711bda1b4bdc195c9b5a5d0b595e1c1a5c995960721b6044820152606401610c6d565b6015546001600160a01b0388165f90815260166020526040812080549192917f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c9918b918b918b919087611965836141f7565b909155506040805160208101969096526001600160a01b0394851690860152929091166060840152608083015260a082015260c0810187905260e001604051602081830303815290604052805190602001206040516020016119de92919061190160f01b81526002810192909252602282015260420190565b60408051601f19818403018152919052805160209091012090506001600160a01b038816611a465760405162461bcd60e51b815260206004820152601560248201527406f686d2f696e76616c69642d616464726573732d3605c1b6044820152606401610c6d565b604080515f81526020810180835283905260ff861691810191909152606081018490526080810183905260019060a0016020604051602081039080840390855afa158015611a96573d5f803e3d5ffd5b505050602060405103516001600160a01b0316886001600160a01b031614611af55760405162461bcd60e51b81526020600482015260126024820152711bda1b4bda5b9d985b1a590b5c195c9b5a5d60721b6044820152606401610c6d565b6001600160a01b038881165f818152601060209081526040808320948c16808452948252918290208a905590518981525f80516020614437833981519152910160405180910390a35050505050505050565b601a8054610b6890613f67565b611b5c611c98565b601a610c808282614018565b611b70611c98565b6001600160a01b03919091165f908152600c60205260409020805460ff1916911515919091179055565b6001600160a01b038516331480611bb65750611bb685336109d8565b15611bcf57611bca85858585856001612031565b610ea0565b604051632ce44b5f60e11b815260040160405180910390fd5b60198054610b6890613f67565b611bfd611c98565b6001600160a01b038116611c2657604051631e4fbdf760e01b81525f6004820152602401610c6d565b611c2f81612893565b50565b5f600a546064611c42919061410e565b601354611c5784670de0b6b3a764000061410e565b611c61919061410e565b611c6b9190614139565b9050611c778383612579565b611c825f825f612fe9565b50505050565b5f6012545f19610c989190614139565b5f546001600160a01b031633146112d55760405163118cdaa760e01b8152336004820152602401610c6d565b600f545f90610ab5906113d284670de0b6b3a7640000612cbf565b5f610e1e82846140e7565b6001600160a01b038416611d385760405162461bcd60e51b815260206004820152601560248201527422a92199181d1024b73b30b634b21039b2b73232b960591b6044820152606401610c6d565b6001600160a01b038316611d8e5760405162461bcd60e51b815260206004820152601760248201527f45524332303a20496e76616c69642072656365697665720000000000000000006044820152606401610c6d565b6001600160a01b038085165f9081526017602052604080822054928616825290205483821015611e005760405162461bcd60e51b815260206004820152601b60248201527f45524332303a20496e73756666696369656e742062616c616e636500000000006044820152606401610c6d565b611e0a8285611cdf565b6001600160a01b0387165f90815260176020526040902055611e2c818561254c565b6001600160a01b038087165f8181526017602052604090819020939093559151908816905f8051602061441783398151915290611e6c9088815260200190565b60405180910390a38215612029576001600160a01b0386165f908152600b602052604090205460ff16611f17575f7f0000000000000000000000000000000000000000000000000000000000000000611ec586856140e7565b611ecf9190614139565b611ef97f000000000000000000000000000000000000000000000000000000000000000085614139565b611f0391906140e7565b90508015611f1557611f158782612a06565b505b6001600160a01b0385165f908152600b602052604090205460ff1661202957600d546001148015611f5f57506001600160a01b0386165f908152600b602052604090205460ff165b8015611f7757505f546001600160a01b038781169116145b15611fa8576001600160a01b0385165f908152600b60205260409020805460ff191660011790556002600d55612029565b5f611fd37f000000000000000000000000000000000000000000000000000000000000000083614139565b7f0000000000000000000000000000000000000000000000000000000000000000611ffe878561420f565b6120089190614139565b61201291906140e7565b90508015612027576120248682613033565b50505b505b505050505050565b6001600160a01b03851661205857604051633a954ecd60e21b815260040160405180910390fd5b335f61206386613271565b905084600114801561209f57506001600160a01b0388165f90815260016020818152604080842060088b901c85529091529091205460ff88161c165b1561212d576001600160a01b038881165f90815260016020818152604080842060088c901c808652908352818520805460ff8e1686901b8019909116909155958d1685529282528084209284529190528120805490921790915561212890899089907f000000000000000000000000000000000000000000000000000000000000000090611cea565b612146565b6040516337dbad3d60e01b815260040160405180910390fd5b6001600160a01b038781169089168682825f805160206144178339815191525f80a4886001600160a01b03168a6001600160a01b0316856001600160a01b03167fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f628b8b6040516121c0929190918252602082015260400190565b60405180910390a46121d4848b8b866132b7565b84156121e8576121e8848b8b8b8b8b61343a565b50505050505050505050565b6001600160a01b038381165f908152601060209081526040808320938616835292905220545f198114611c82578181101561225b57604051637dc7a0d960e11b81526001600160a01b03841660048201526024810182905260448101839052606401610c6d565b611c8284848484035f6136a4565b5f600883901c60ff8416610101848201106122db575f8281526020879052604090205461229790821c613755565b930160ff811693925060018201915f9160081c015b8083146122d9575f838152602088905260409020546122ca90613755565b840193508260010192506122ac565b505b5f828152602087905260409020546122fb90821c6101008690031b613755565b90920195945050505050565b815183511461232957604051637801f4e960e01b815260040160405180910390fd5b6001600160a01b03841661235057604051633a954ecd60e21b815260040160405180910390fd5b335f5b8451811015612432575f85828151811061236f5761236f6140fa565b602002602001015190505f85838151811061238c5761238c6140fa565b602002602001015190508060011480156123d057506001600160a01b0389165f908152600160208181526040808420600887901c85529091529091205460ff84161c165b1561212d57506001600160a01b038881165f908152600160208181526040808420600887901c808652908352818520805460ff90981685901b80199098169055948c168452828252808420948452939052919020805490921790915501612353565b5061246b868686517f0000000000000000000000000000000000000000000000000000000000000000612465919061410e565b5f611cea565b5f805f8651600161247c919061420f565b90506001600160a01b03891691506001600160a01b0388169250602087015183835f805160206144178339815191525f80a460025b8181146124da578060200288015184845f805160206144178339815191525f80a46001016124b1565b50876001600160a01b0316896001600160a01b0316856001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb8a8a60405161252a929190614222565b60405180910390a461253e848a8a8a6132b7565b612024848a8a8a8a8a613804565b5f610e1e828461420f565b5f610ab5670de0b6b3a76400006113d2600f5485612cbf90919063ffffffff16565b5f61258c670de0b6b3a764000083614139565b90506125988382613033565b5050600a546125a7908361254c565b600a555f6125b483611cc4565b6012549091506125c4908261254c565b6012556125cf611c88565b600f5411156126205760405162461bcd60e51b815260206004820152601a60248201527f6d6178207363616c696e6720666163746f7220746f6f206c6f770000000000006044820152606401610c6d565b6001600160a01b0384165f90815260176020526040902054612642908261254c565b6001600160a01b0385165f818152601760209081526040918290209390935580519182529181018490527f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d4121396885910160405180910390a16040518381526001600160a01b038516905f905f80516020614417833981519152906020015b60405180910390a350505050565b5f6126de670de0b6b3a764000083614139565b90506126ea3382612a06565b600a546126f79083611cdf565b600a555f61270483611cc4565b6012549091506127149082611cdf565b601255335f908152601760205260409020546127309082611cdf565b335f818152601760209081526040918290209390935580519182529181018590527fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5910160405180910390a16040518381525f9033905f80516020614417833981519152906020015b60405180910390a3505050565b600881901c5f818152602084905260409020545f19919060ff84191690811b901c811581176127e6575b5081015f818152604090205481158117156127d0575b801561288b5761287c817f0706060506020504060203020504030106050205030304010505030400000000601f6f8421084210842108cc6318c6db6d54be831560081b6fffffffffffffffffffffffffffffffff851160071b1784811c6001600160401b031060061b1784811c63ffffffff1060051b1784811c61ffff1060041b1784811c60ff1060031b1793841c1c161a1790565b600883901b178481115f031792505b505092915050565b5f80546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6001600160a01b0382166129095760405163b817eee760e01b815260040160405180910390fd5b335f61291483613271565b6001600160a01b0385165f908152600160208181526040808420600889901c85529091529091205491925060ff85169190911c166129655760405163375040fd60e01b815260040160405180910390fd5b6001600160a01b0384165f818152600160208181526040808420600889901c85529091528220805460ff88169290921b1990911690558490825f805160206144178339815191528280a460408051858152600160208201525f916001600160a01b0388811692908716917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a4610ea083865f856132b7565b6001600160a01b038216612a2d5760405163b817eee760e01b815260040160405180910390fd5b60045433905f836001600160401b03811115612a4b57612a4b613a19565b604051908082528060200260200182016040528015612a74578160200160208202803683370190505b5090505f846001600160401b03811115612a9057612a90613a19565b604051908082528060200260200182016040528015612ab9578160200160208202803683370190505b5090505f5b85811015612b69576001838281518110612ada57612ada6140fa565b6020908102919091018101919091526001600160a01b0388165f908152600190915260408120612b0a90866127a6565b905080838381518110612b1f57612b1f6140fa565b6020908102919091018101919091526001600160a01b0389165f90815260018083526040808320600886901c8452909352919020805460ff841683901b1916905590945001612abe565b505f80612b7787600161420f565b90506001600160a01b038816915060208301515f835f805160206144178339815191525f80a460025b818114612bc957806020028401515f845f805160206144178339815191525f80a4600101612ba0565b5086600103612c51575f6001600160a01b0316886001600160a01b0316876001600160a01b03167fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62865f81518110612c2357612c236140fa565b60200260200101516001604051612c44929190918252602082015260400190565b60405180910390a4612ca9565b5f6001600160a01b0316886001600160a01b0316876001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb8688604051612ca0929190614222565b60405180910390a45b612cb586895f866132b7565b5050505050505050565b5f610e1e828461410e565b5f610e1e8284614139565b5f6001600454610c9891906140e7565b612cef8282612579565b601254612cfc908261254c565b6012555f612d0982612557565b600a54909150612d19908261254c565b600a55612d24611c88565b600f541115612d755760405162461bcd60e51b815260206004820152601a60248201527f6d6178207363616c696e6720666163746f7220746f6f206c6f770000000000006044820152606401610c6d565b6001600160a01b0383165f90815260176020526040902054612d97908361254c565b6001600160a01b0384165f818152601760209081526040918290209390935580519182529181018390527f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d4121396885910160405180910390a16040518181526001600160a01b038416905f905f8051602061441783398151915290602001612799565b816001600160a01b0316836001600160a01b031603612e895760405162461bcd60e51b815260206004820152602960248201527f455243313135353a2073657474696e6720617070726f76616c20737461747573604482015268103337b91039b2b63360b91b6064820152608401610c6d565b6001600160a01b038381165f81815260026020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c319101612799565b6060815f03612f135750506040805180820190915260018152600360fc1b602082015290565b815f5b8115612f3c5780612f26816141f7565b9150612f359050600a83614139565b9150612f16565b5f816001600160401b03811115612f5557612f55613a19565b6040519080825280601f01601f191660200182016040528015612f7f576020820181803683370190505b5090505b8415610e5257612f946001836140e7565b9150612fa1600a8661424f565b612fac90603061420f565b60f81b818381518110612fc157612fc16140fa565b60200101906001600160f81b03191690815f1a905350612fe2600a86614139565b9450612f83565b5f825f036113a857600f546040805186815260208101839052908101919091527fc6642d24d84e7f3d36ca39f5cce10e75639d9b158d5193aa350e2f900653e4c090606001611397565b6060806001600160a01b03841661305c57604051622e076360e81b815260040160405180910390fd5b825f0361307c5760405163b562e8dd60e01b815260040160405180910390fd5b33836001600160401b0381111561309557613095613a19565b6040519080825280602002602001820160405280156130be578160200160208202803683370190505b509250836001600160401b038111156130d9576130d9613a19565b604051908082528060200260200182016040528015613102578160200160208202803683370190505b5091505f61310f60045490565b905080855f19031015613120575f80fd5b5f5b858110156131725780820185828151811061313f5761313f6140fa565b602002602001018181525050600184828151811061315f5761315f6140fa565b6020908102919091010152600101613122565b506001600160a01b0386165f9081526001602052604090206131959082876138bf565b8460045f8282546131a6919061420f565b909155505f9050806131b8878461420f565b90506001600160a01b038816915082825f5f805160206144178339815191525f80a4600183015b8181146132025780835f5f805160206144178339815191525f80a46001016131df565b50876001600160a01b03165f6001600160a01b0316856001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb8989604051613252929190614222565b60405180910390a4613266845f8a896132b7565b505050509250929050565b6040805160018082528183019092526060916020808301908036833701905050905081815f815181106132a6576132a66140fa565b602002602001018181525050919050565b6001600160a01b0382165f908152600b602052604090205460ff1661343557601b546001600160a01b0383165f90815260176020526040902054111561333f5760405162461bcd60e51b815260206004820152601f60248201527f5472616e736665722065786365656473206d6178696d756d2077616c6c6574006044820152606401610c6d565b601c5460ff161561343557325f908152601d602052604090205443116133b35760405162461bcd60e51b8152602060048201526024808201527f4f6e6c79206f6e65207472616e736665722070657220626c6f636b20616c6c6f6044820152633bb2b21760e11b6064820152608401610c6d565b325f908152601d602052604090204390556001600160a01b0382163b1580156133db5750323b155b6134355760405162461bcd60e51b815260206004820152602560248201527f436f6e74726163742074726164696e672072657374726963746564206174206c6044820152640c2eadcc6d60db1b6064820152608401610c6d565b611c82565b6001600160a01b0384163b15612029576040516301ffc9a760e01b8152636cdb3d1360e11b60048201526001600160a01b038516906301ffc9a790602401602060405180830381865afa158015613493573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906134b79190614262565b156135c15760405163f23a6e6160e01b81526001600160a01b0385169063f23a6e61906134f0908990899088908890889060040161427d565b6020604051808303815f875af192505050801561352a575060408051601f3d908101601f19168201909252613527918101906142c1565b60015b61358a576135366142dc565b806308c379a00361356f575061354a6142f5565b806135555750613571565b8060405162461bcd60e51b8152600401610c6d91906139f0565b505b604051639c05499b60e01b815260040160405180910390fd5b6001600160e01b0319811663f23a6e6160e01b146135bb57604051639c05499b60e01b815260040160405180910390fd5b50612029565b604051630a85bd0160e11b81526001600160a01b0385169063150b7a02906135f390899089908890879060040161437d565b6020604051808303815f875af192505050801561362d575060408051601f3d908101601f1916820190925261362a918101906142c1565b60015b613673576136396142dc565b806308c379a003613658575061364d6142f5565b80613555575061365a565b505b6040516368d2bf6b60e11b815260040160405180910390fd5b6001600160e01b03198116630a85bd0160e11b14612027576040516368d2bf6b60e11b815260040160405180910390fd5b6001600160a01b0384166136cd5760405163e602df0560e01b81525f6004820152602401610c6d565b6001600160a01b0383166136f657604051634a1406b160e11b81525f6004820152602401610c6d565b6001600160a01b038085165f9081526007602090815260408083209387168352929052208290558015611c8257826001600160a01b0316846001600160a01b03165f80516020614437833981519152846040516126bd91815260200190565b7f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f7f5555555555555555555555555555555555555555555555555555555555555555600183901c168203600281901c7f3333333333333333333333333333333333333333333333333333333333333333908116911601600481901c01167f01010101010101010101010101010101010101010101010101010101010101010260f81c5f199190911460081b1790565b6001600160a01b0384163b156120295760405163bc197c8160e01b81526001600160a01b0385169063bc197c819061384890899089908890889088906004016143b9565b6020604051808303815f875af1925050508015613882575060408051601f3d908101601f1916820190925261387f918101906142c1565b60015b61388e576135366142dc565b6001600160e01b0319811663bc197c8160e01b1461202757604051639c05499b60e01b815260040160405180910390fd5b5f1960ff8316846020528360081c5f526101018382011061391b575f805160408220805485851b1790559390910160ff811693600181019160081c015b80821461391757815f528360405f20556001820191506138fc565b505f525b60405f208284610100031c821b8154178155505050505050565b6001600160a01b0381168114611c2f575f80fd5b5f806040838503121561395a575f80fd5b823561396581613935565b946020939093013593505050565b6001600160e01b031981168114611c2f575f80fd5b5f60208284031215613998575f80fd5b8135610e1e81613973565b5f5b838110156139bd5781810151838201526020016139a5565b50505f910152565b5f81518084526139dc8160208601602086016139a3565b601f01601f19169290920160200192915050565b602081525f610e1e60208301846139c5565b5f60208284031215613a12575f80fd5b5035919050565b634e487b7160e01b5f52604160045260245ffd5b601f8201601f191681016001600160401b0381118282101715613a5257613a52613a19565b6040525050565b5f6001600160401b03831115613a7157613a71613a19565b604051613a88601f8501601f191660200182613a2d565b809150838152848484011115613a9c575f80fd5b838360208301375f60208583010152509392505050565b5f60208284031215613ac3575f80fd5b81356001600160401b03811115613ad8575f80fd5b8201601f81018413613ae8575f80fd5b610e5284823560208401613a59565b5f805f60608486031215613b09575f80fd5b8335613b1481613935565b92506020840135613b2481613935565b929592945050506040919091013590565b5f805f60608486031215613b47575f80fd5b8335613b5281613935565b95602085013595506040909401359392505050565b5f6001600160401b03821115613b7f57613b7f613a19565b5060051b60200190565b5f82601f830112613b98575f80fd5b81356020613ba582613b67565b604051613bb28282613a2d565b80915083815260208101915060208460051b870101935086841115613bd5575f80fd5b602086015b84811015613bf15780358352918301918301613bda565b509695505050505050565b5f82601f830112613c0b575f80fd5b610e1e83833560208501613a59565b5f805f805f60a08688031215613c2e575f80fd5b8535613c3981613935565b94506020860135613c4981613935565b935060408601356001600160401b0380821115613c64575f80fd5b613c7089838a01613b89565b94506060880135915080821115613c85575f80fd5b613c9189838a01613b89565b93506080880135915080821115613ca6575f80fd5b50613cb388828901613bfc565b9150509295509295909350565b5f60208284031215613cd0575f80fd5b8135610e1e81613935565b5f8060408385031215613cec575f80fd5b82356001600160401b0380821115613d02575f80fd5b818501915085601f830112613d15575f80fd5b81356020613d2282613b67565b604051613d2f8282613a2d565b83815260059390931b8501820192828101915089841115613d4e575f80fd5b948201945b83861015613d75578535613d6681613935565b82529482019490820190613d53565b96505086013592505080821115613d8a575f80fd5b50613d9785828601613b89565b9150509250929050565b5f815180845260208085019450602084015f5b83811015613dd057815187529582019590820190600101613db4565b509495945050505050565b602081525f610e1e6020830184613da1565b8015158114611c2f575f80fd5b5f8060408385031215613e0b575f80fd5b8235613e1681613935565b91506020830135613e2681613ded565b809150509250929050565b5f805f60608486031215613e43575f80fd5b83359250602084013591506040840135613e5c81613ded565b809150509250925092565b5f805f805f805f60e0888a031215613e7d575f80fd5b8735613e8881613935565b96506020880135613e9881613935565b95506040880135945060608801359350608088013560ff81168114613ebb575f80fd5b9699959850939692959460a0840135945060c09093013592915050565b5f8060408385031215613ee9575f80fd5b8235613ef481613935565b91506020830135613e2681613935565b5f805f805f60a08688031215613f18575f80fd5b8535613f2381613935565b94506020860135613f3381613935565b9350604086013592506060860135915060808601356001600160401b03811115613f5b575f80fd5b613cb388828901613bfc565b600181811c90821680613f7b57607f821691505b602082108103613f9957634e487b7160e01b5f52602260045260245ffd5b50919050565b60208082526016908201527543616c6c6261636b3a204e6f7420416c6c6f7765642160501b604082015260600190565b601f82111561401357805f5260205f20601f840160051c81016020851015613ff45750805b601f840160051c820191505b81811015610ea0575f8155600101614000565b505050565b81516001600160401b0381111561403157614031613a19565b6140458161403f8454613f67565b84613fcf565b602080601f831160018114614078575f84156140615750858301515b5f19600386901b1c1916600185901b178555612029565b5f85815260208120601f198616915b828110156140a657888601518255948401946001909101908401614087565b50858210156140c357878501515f19600388901b60f8161c191681555b5050505050600190811b01905550565b634e487b7160e01b5f52601160045260245ffd5b81810381811115610ab557610ab56140d3565b634e487b7160e01b5f52603260045260245ffd5b8082028115828204841417610ab557610ab56140d3565b634e487b7160e01b5f52601260045260245ffd5b5f8261414757614147614125565b500490565b5f80845461415981613f67565b600182811680156141715760018114614186576141b2565b60ff19841687528215158302870194506141b2565b885f526020805f205f5b858110156141a95781548a820152908401908201614190565b50505082870194505b5050505083516141c68183602088016139a3565b01949350505050565b5f82516141e08184602087016139a3565b64173539b7b760d91b920191825250600501919050565b5f60018201614208576142086140d3565b5060010190565b80820180821115610ab557610ab56140d3565b604081525f6142346040830185613da1565b82810360208401526142468185613da1565b95945050505050565b5f8261425d5761425d614125565b500690565b5f60208284031215614272575f80fd5b8151610e1e81613ded565b6001600160a01b03868116825285166020820152604081018490526060810183905260a0608082018190525f906142b6908301846139c5565b979650505050505050565b5f602082840312156142d1575f80fd5b8151610e1e81613973565b5f60033d11156142f25760045f803e505f5160e01c5b90565b5f60443d10156143025790565b6040516003193d81016004833e81513d6001600160401b03816024840111818411171561433157505050505090565b82850191508151818111156143495750505050505090565b843d87010160208285010111156143635750505050505090565b61437260208286010187613a2d565b509095945050505050565b6001600160a01b03858116825284166020820152604081018390526080606082018190525f906143af908301846139c5565b9695505050505050565b6001600160a01b0386811682528516602082015260a0604082018190525f906143e490830186613da1565b82810360608401526143f68186613da1565b9050828103608084015261440a81856139c5565b9897505050505050505056feddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925a26469706673582212202addf73209f3bf543cd1225c9bcea284d40d9237cdc7d5e661d9b0138bf919cf64736f6c63430008180033ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef

Deployed Bytecode

0x608060405234801561000f575f80fd5b5060043610610421575f3560e01c80636cc301e31161022c578063a22cb46511610135578063da0f8992116100bf578063f169e60511610084578063f169e60514610a05578063f242432a14610a18578063f28ca1dd14610a2b578063f2fde38b14610a33578063f8b45b0514610a46575f80fd5b8063da0f899214610976578063dd62ed3e1461097f578063e0df5b6f146109b7578063e985e9c5146109ca578063ec342ad01461076a575f80fd5b8063b0bdc82f11610105578063b0bdc82f14610922578063c5b8f77214610935578063c87b56dd14610948578063d505accf1461095b578063d547cfb71461096e575f80fd5b8063a22cb465146108e0578063a457c2d7146108f3578063a9059cbb14610906578063ac3cdc0014610919575f80fd5b80638da5cb5b116101b657806397d63f931161018657806397d63f931461088657806399a2557a1461088f5780639a744bc0146108a25780639b19251a146108b5578063a014e6e2146108d7575f80fd5b80638da5cb5b14610848578063917505f41461085857806391c01c2b1461086b57806395d89b411461087e575f80fd5b806379cc6790116101fc57806379cc6790146107dd5780637af548c1146107f05780637ecebe00146108035780637f51bb1f146108225780638462151c14610835575f80fd5b80636cc301e3146107795780636d6a6a4d1461079b57806370a08231146107c2578063715018a6146107d5575f80fd5b8063313ce5671161032e5780634e1273f4116102b8578063598ff9c211610288578063598ff9c2146106fb5780635afcc2f51461071d5780635d0044ca1461074457806361d027b31461075757806364dd48f51461076a575f80fd5b80634e1273f4146106ad5780634eabf2c6146106cd578063504d8fc5146106d557806353d6fd59146106e8575f80fd5b80633af9e669116102fe5780633af9e669146106435780633eaaf86b1461066b57806340c10f191461067457806342966c68146106875780634b85c5f41461069a575f80fd5b8063313ce567146105db578063336d2692146106145780633644e515146106275780633950935114610630575f80fd5b806318160ddd116103af57806323b872dd1161037f57806323b872dd146105685780632d760d571461057b5780632eb2c2d61461058e5780632f34d282146105a157806330adf81f146105b4575f80fd5b806318160ddd1461051357806318d217c31461051b5780631f7701db1461052e57806320606b7014610541575f80fd5b8063095ea7b3116103f5578063095ea7b3146104c35780630a702e8d146104d65780630d64f1b6146104e35780630e89341c146104f857806311d3e6c41461050b575f80fd5b8062fdd58e1461042557806301ffc9a71461044b57806306fdde031461046e578063081812fc14610483575b5f80fd5b610438610433366004613949565b610a4f565b6040519081526020015b60405180910390f35b61045e610459366004613988565b610abb565b6040519015158152602001610442565b610476610b5b565b60405161044291906139f0565b6104ab610491366004613a02565b60056020525f90815260409020546001600160a01b031681565b6040516001600160a01b039091168152602001610442565b61045e6104d1366004613949565b610be7565b601c5461045e9060ff1681565b6104f66104f1366004613949565b610c3f565b005b610476610506366004613a02565b610c84565b610438610c8f565b600a54610438565b6104f6610529366004613ab3565b610c9d565b6011546104ab906001600160a01b031681565b6104387f8cad95687ba82c2ce50e74f7b754645e5117c3a5bec8151c0726d5857980a86681565b61045e610576366004613af7565b610cb1565b610438610589366004613b35565b610e25565b6104f661059c366004613c1a565b610e5a565b6104f66105af366004613cc0565b610ea7565b6104387f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c981565b6106027f000000000000000000000000000000000000000000000000000000000000001281565b60405160ff9091168152602001610442565b61045e610622366004613949565b610ed1565b61043860155481565b61045e61063e366004613949565b610f8c565b610438610651366004613cc0565b6001600160a01b03165f9081526017602052604090205490565b610438600a5481565b61045e610682366004613949565b610ffc565b61045e610695366004613a02565b61103d565b6104386106a8366004613cc0565b61107c565b6106c06106bb366004613cdb565b611145565b6040516104429190613ddb565b6104f6611223565b6104386106e3366004613a02565b61123f565b6104f66106f6366004613dfa565b611249565b61045e610709366004613cc0565b600c6020525f908152604090205460ff1681565b6104387f0000000000000000000000000000000000000000000000000de0b6b3a764000081565b6104f6610752366004613a02565b61127b565b6014546104ab906001600160a01b031681565b610438670de0b6b3a764000081565b61045e610787366004613cc0565b601e6020525f908152604090205460ff1681565b6104387f0000000000000000000000000000000000000000000000000de0b6b3a764000081565b6104386107d0366004613cc0565b6112a3565b6104f66112c4565b6104f66107eb366004613949565b6112d7565b6104386107fe366004613e31565b611324565b610438610811366004613cc0565b60166020525f908152604090205481565b6104f6610830366004613cc0565b6114f4565b6106c0610843366004613cc0565b61151e565b5f546001600160a01b03166104ab565b61045e610866366004613949565b61154f565b6104f6610879366004613a02565b611587565b6104766115a1565b61043860125481565b6106c061089d366004613b35565b6115ae565b6104f66108b0366004613dfa565b6116da565b61045e6108c3366004613cc0565b600b6020525f908152604090205460ff1681565b610438600d5481565b6104f66108ee366004613dfa565b61170f565b61045e610901366004613949565b61171a565b61045e610914366004613949565b6117dd565b61043860135481565b610438610930366004613a02565b611829565b61045e610943366004613949565b611833565b610476610956366004613a02565b611865565b6104f6610969366004613e67565b6118ce565b610476611b47565b610438600f5481565b61043861098d366004613ed8565b6001600160a01b039182165f90815260106020908152604080832093909416825291909152205490565b6104f66109c5366004613ab3565b611b54565b61045e6109d8366004613ed8565b6001600160a01b039182165f90815260026020908152604080832093909416825291909152205460ff1690565b6104f6610a13366004613dfa565b611b68565b6104f6610a26366004613f04565b611b9a565b610476611be8565b6104f6610a41366004613cc0565b611bf5565b610438601b5481565b5f6001600160a01b038316610a77576040516323d3ad8160e21b815260040160405180910390fd5b6001600160a01b0383165f908152600160208181526040808420600887901c85529091529091205460ff84161c1615610ab257506001610ab5565b505f5b92915050565b5f6001600160e01b03198216636cdb3d1360e11b1480610aeb57506001600160e01b031982166303a24d0760e21b145b80610b0657506001600160e01b031982166362dc7bb960e11b145b80610b2157506380ac58cd60e01b6001600160e01b03198316145b80610b3c5750635b5e139f60e01b6001600160e01b03198316145b80610ab557506301ffc9a760e01b6001600160e01b0319831614610ab5565b60088054610b6890613f67565b80601f0160208091040260200160405190810160405280929190818152602001828054610b9490613f67565b8015610bdf5780601f10610bb657610100808354040283529160200191610bdf565b820191905f5260205f20905b815481529060010190602001808311610bc257829003601f168201915b505050505081565b335f8181526010602090815260408083206001600160a01b038716808552925280832085905551919290915f8051602061443783398151915290610c2e9086815260200190565b60405180910390a350600192915050565b335f908152601e602052604090205460ff16610c765760405162461bcd60e51b8152600401610c6d90613f9f565b60405180910390fd5b610c808282611c32565b5050565b6060610ab582611865565b5f610c98611c88565b905090565b610ca5611c98565b6019610c808282614018565b5f80610cbc83611cc4565b9050610cc760045490565b811015610e00576001600160a01b0385165f908152601060209081526040808320338452909152902054610cfb9082611cdf565b6001600160a01b0386165f8181526010602090815260408083203380855292529091209290925514801590610d5357506001600160a01b0385165f90815260026020908152604080832033845290915290205460ff16155b8015610d7557505f818152600560205260409020546001600160a01b03163314155b15610d9557604051634a1406b160e11b8152336004820152602401610c6d565b610dc185857f0000000000000000000000000000000000000000000000000de0b6b3a76400005f611cea565b5f81815260056020908152604080832080546001600160a01b031916905580519182019052818152610dfb91879187918591600191612031565b610e18565b610e0b8533836121f4565b610e188585836001611cea565b60019150505b9392505050565b5f610e5283610e3481856140e7565b6001600160a01b0387165f9081526001602052604090209190612269565b949350505050565b6001600160a01b038516331480610e765750610e7685336109d8565b610e9357604051632ce44b5f60e11b815260040160405180910390fd5b610ea08585858585612307565b5050505050565b610eaf611c98565b601180546001600160a01b0319166001600160a01b0392909216919091179055565b5f826001600160a01b038116610ee5575f80fd5b306001600160a01b03821603610ef9575f80fd5b335f90815260176020526040902054610f129084611cdf565b335f90815260176020526040808220929092556001600160a01b03861681522054610f3d908461254c565b6001600160a01b0385165f81815260176020526040902091909155335f80516020614417833981519152610f7086612557565b6040519081526020015b60405180910390a35060019392505050565b335f9081526010602090815260408083206001600160a01b0386168452909152812054610fb9908361254c565b335f8181526010602090815260408083206001600160a01b038916808552908352928190208590555193845290925f805160206144378339815191529101610c2e565b335f908152601e602052604081205460ff1661102a5760405162461bcd60e51b8152600401610c6d90613f9f565b6110348383612579565b50600192915050565b335f908152601e602052604081205460ff1661106b5760405162461bcd60e51b8152600401610c6d90613f9f565b611074826126cb565b506001919050565b5f8061108760045490565b6001600160a01b0384165f90815260066020526040812054919250816001600160401b038111156110ba576110ba613a19565b6040519080825280602002602001820160405280156110e3578160200160208202803683370190505b5090505f5b8281101561113b576001600160a01b0386165f90815260016020526040812061111190866127a6565b905080838381518110611126576111266140fa565b602090810291909101015293506001016110e8565b5051949350505050565b6060815183511461116957604051637801f4e960e01b815260040160405180910390fd5b5f83516001600160401b0381111561118357611183613a19565b6040519080825280602002602001820160405280156111ac578160200160208202803683370190505b5090505f5b845181101561121b576111f68582815181106111cf576111cf6140fa565b60200260200101518583815181106111e9576111e96140fa565b6020026020010151610a4f565b828281518110611208576112086140fa565b60209081029190910101526001016111b1565b509392505050565b61122b611c98565b601c805460ff19811660ff90911615179055565b5f610ab582611cc4565b611251611c98565b6001600160a01b03919091165f908152600b60205260409020805460ff1916911515919091179055565b611283611c98565b606481600a54611293919061410e565b61129d9190614139565b601b5550565b6001600160a01b0381165f90815260176020526040812054610ab590612557565b6112cc611c98565b6112d55f612893565b565b335f908152600b602052604090205460ff166113055760405162461bcd60e51b8152600401610c6d90613f9f565b6113108233836121f4565b61131a82826128e2565b610c808282612a06565b335f908152601e602052604081205460ff166113525760405162461bcd60e51b8152600401610c6d90613f9f565b825f036113a857600f546040805186815260208101839052908101919091527fc6642d24d84e7f3d36ca39f5cce10e75639d9b158d5193aa350e2f900653e4c0906060015b60405180910390a150600a54610e1e565b600f54826113e0576113d8670de0b6b3a76400006113d26113c98288611cdf565b600f5490612cbf565b90612cca565b600f55611423565b5f6113fa670de0b6b3a76400006113d26113c9828961254c565b9050611404611c88565b81101561141557600f819055611421565b61141d611c88565b600f555b505b61142e601254612557565b600a556011546001600160a01b0316156114a55760115f9054906101000a90046001600160a01b03166001600160a01b031663fff6cae96040518163ffffffff1660e01b81526004015f604051808303815f87803b15801561148e575f80fd5b505af11580156114a0573d5f803e3d5ffd5b505050505b600f54604080518781526020810184905280820192909252517fc6642d24d84e7f3d36ca39f5cce10e75639d9b158d5193aa350e2f900653e4c09181900360600190a15050600a549392505050565b6114fc611c98565b601480546001600160a01b0319166001600160a01b0392909216919091179055565b6060611528612cd5565b5f03611541575050604080515f81526020810190915290565b610ab58260016004546115ae565b335f908152601e602052604081205460ff1661157d5760405162461bcd60e51b8152600401610c6d90613f9f565b6110348383612ce5565b61158f611c98565b606481111561159c575f80fd5b601355565b60098054610b6890613f67565b60608183106115d057604051631960ccad60e11b815260040160405180910390fd5b60018310156115de57600192505b5f6115e860045490565b9050808311156115f6578092505b5f838510156116115761160a868686610e25565b9050611614565b505f5b5f816001600160401b0381111561162d5761162d613a19565b604051908082528060200260200182016040528015611656578160200160208202803683370190505b506001600160a01b0388165f90815260016020526040812091925087905b8481146116cc57600882901c5f9081526020849052604090205460ff83161c600116156116c157818482806001019350815181106116b4576116b46140fa565b6020026020010181815250505b816001019150611674565b509198975050505050505050565b6116e2611c98565b6001600160a01b0382165f908152601e60205260409020805460ff1916821515179055610c808282611b68565b610c80338383612e16565b335f9081526010602090815260408083206001600160a01b038616845290915281205480831061176c57335f9081526010602090815260408083206001600160a01b038816845290915281205561179a565b6117768184611cdf565b335f9081526010602090815260408083206001600160a01b03891684529091529020555b335f8181526010602090815260408083206001600160a01b038916808552908352928190205490519081529192915f805160206144378339815191529101610f7a565b5f826001600160a01b0381166117f1575f80fd5b306001600160a01b03821603611805575f80fd5b5f61180f84611cc4565b905061181e3386836001611cea565b506001949350505050565b5f610ab582612557565b6001600160a01b0382165f908152600160208181526040808420600886901c855290915282205460ff84161c16610e1e565b6060600a5482101580611876575081155b1561187f575f80fd5b601a61188a83612eed565b60405160200161189b92919061414c565b60408051601f19818403018152908290526118b8916020016141cf565b6040516020818303038152906040529050919050565b834211156119135760405162461bcd60e51b81526020600482015260126024820152711bda1b4bdc195c9b5a5d0b595e1c1a5c995960721b6044820152606401610c6d565b6015546001600160a01b0388165f90815260166020526040812080549192917f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c9918b918b918b919087611965836141f7565b909155506040805160208101969096526001600160a01b0394851690860152929091166060840152608083015260a082015260c0810187905260e001604051602081830303815290604052805190602001206040516020016119de92919061190160f01b81526002810192909252602282015260420190565b60408051601f19818403018152919052805160209091012090506001600160a01b038816611a465760405162461bcd60e51b815260206004820152601560248201527406f686d2f696e76616c69642d616464726573732d3605c1b6044820152606401610c6d565b604080515f81526020810180835283905260ff861691810191909152606081018490526080810183905260019060a0016020604051602081039080840390855afa158015611a96573d5f803e3d5ffd5b505050602060405103516001600160a01b0316886001600160a01b031614611af55760405162461bcd60e51b81526020600482015260126024820152711bda1b4bda5b9d985b1a590b5c195c9b5a5d60721b6044820152606401610c6d565b6001600160a01b038881165f818152601060209081526040808320948c16808452948252918290208a905590518981525f80516020614437833981519152910160405180910390a35050505050505050565b601a8054610b6890613f67565b611b5c611c98565b601a610c808282614018565b611b70611c98565b6001600160a01b03919091165f908152600c60205260409020805460ff1916911515919091179055565b6001600160a01b038516331480611bb65750611bb685336109d8565b15611bcf57611bca85858585856001612031565b610ea0565b604051632ce44b5f60e11b815260040160405180910390fd5b60198054610b6890613f67565b611bfd611c98565b6001600160a01b038116611c2657604051631e4fbdf760e01b81525f6004820152602401610c6d565b611c2f81612893565b50565b5f600a546064611c42919061410e565b601354611c5784670de0b6b3a764000061410e565b611c61919061410e565b611c6b9190614139565b9050611c778383612579565b611c825f825f612fe9565b50505050565b5f6012545f19610c989190614139565b5f546001600160a01b031633146112d55760405163118cdaa760e01b8152336004820152602401610c6d565b600f545f90610ab5906113d284670de0b6b3a7640000612cbf565b5f610e1e82846140e7565b6001600160a01b038416611d385760405162461bcd60e51b815260206004820152601560248201527422a92199181d1024b73b30b634b21039b2b73232b960591b6044820152606401610c6d565b6001600160a01b038316611d8e5760405162461bcd60e51b815260206004820152601760248201527f45524332303a20496e76616c69642072656365697665720000000000000000006044820152606401610c6d565b6001600160a01b038085165f9081526017602052604080822054928616825290205483821015611e005760405162461bcd60e51b815260206004820152601b60248201527f45524332303a20496e73756666696369656e742062616c616e636500000000006044820152606401610c6d565b611e0a8285611cdf565b6001600160a01b0387165f90815260176020526040902055611e2c818561254c565b6001600160a01b038087165f8181526017602052604090819020939093559151908816905f8051602061441783398151915290611e6c9088815260200190565b60405180910390a38215612029576001600160a01b0386165f908152600b602052604090205460ff16611f17575f7f0000000000000000000000000000000000000000000000000de0b6b3a7640000611ec586856140e7565b611ecf9190614139565b611ef97f0000000000000000000000000000000000000000000000000de0b6b3a764000085614139565b611f0391906140e7565b90508015611f1557611f158782612a06565b505b6001600160a01b0385165f908152600b602052604090205460ff1661202957600d546001148015611f5f57506001600160a01b0386165f908152600b602052604090205460ff165b8015611f7757505f546001600160a01b038781169116145b15611fa8576001600160a01b0385165f908152600b60205260409020805460ff191660011790556002600d55612029565b5f611fd37f0000000000000000000000000000000000000000000000000de0b6b3a764000083614139565b7f0000000000000000000000000000000000000000000000000de0b6b3a7640000611ffe878561420f565b6120089190614139565b61201291906140e7565b90508015612027576120248682613033565b50505b505b505050505050565b6001600160a01b03851661205857604051633a954ecd60e21b815260040160405180910390fd5b335f61206386613271565b905084600114801561209f57506001600160a01b0388165f90815260016020818152604080842060088b901c85529091529091205460ff88161c165b1561212d576001600160a01b038881165f90815260016020818152604080842060088c901c808652908352818520805460ff8e1686901b8019909116909155958d1685529282528084209284529190528120805490921790915561212890899089907f0000000000000000000000000000000000000000000000000de0b6b3a764000090611cea565b612146565b6040516337dbad3d60e01b815260040160405180910390fd5b6001600160a01b038781169089168682825f805160206144178339815191525f80a4886001600160a01b03168a6001600160a01b0316856001600160a01b03167fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f628b8b6040516121c0929190918252602082015260400190565b60405180910390a46121d4848b8b866132b7565b84156121e8576121e8848b8b8b8b8b61343a565b50505050505050505050565b6001600160a01b038381165f908152601060209081526040808320938616835292905220545f198114611c82578181101561225b57604051637dc7a0d960e11b81526001600160a01b03841660048201526024810182905260448101839052606401610c6d565b611c8284848484035f6136a4565b5f600883901c60ff8416610101848201106122db575f8281526020879052604090205461229790821c613755565b930160ff811693925060018201915f9160081c015b8083146122d9575f838152602088905260409020546122ca90613755565b840193508260010192506122ac565b505b5f828152602087905260409020546122fb90821c6101008690031b613755565b90920195945050505050565b815183511461232957604051637801f4e960e01b815260040160405180910390fd5b6001600160a01b03841661235057604051633a954ecd60e21b815260040160405180910390fd5b335f5b8451811015612432575f85828151811061236f5761236f6140fa565b602002602001015190505f85838151811061238c5761238c6140fa565b602002602001015190508060011480156123d057506001600160a01b0389165f908152600160208181526040808420600887901c85529091529091205460ff84161c165b1561212d57506001600160a01b038881165f908152600160208181526040808420600887901c808652908352818520805460ff90981685901b80199098169055948c168452828252808420948452939052919020805490921790915501612353565b5061246b868686517f0000000000000000000000000000000000000000000000000de0b6b3a7640000612465919061410e565b5f611cea565b5f805f8651600161247c919061420f565b90506001600160a01b03891691506001600160a01b0388169250602087015183835f805160206144178339815191525f80a460025b8181146124da578060200288015184845f805160206144178339815191525f80a46001016124b1565b50876001600160a01b0316896001600160a01b0316856001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb8a8a60405161252a929190614222565b60405180910390a461253e848a8a8a6132b7565b612024848a8a8a8a8a613804565b5f610e1e828461420f565b5f610ab5670de0b6b3a76400006113d2600f5485612cbf90919063ffffffff16565b5f61258c670de0b6b3a764000083614139565b90506125988382613033565b5050600a546125a7908361254c565b600a555f6125b483611cc4565b6012549091506125c4908261254c565b6012556125cf611c88565b600f5411156126205760405162461bcd60e51b815260206004820152601a60248201527f6d6178207363616c696e6720666163746f7220746f6f206c6f770000000000006044820152606401610c6d565b6001600160a01b0384165f90815260176020526040902054612642908261254c565b6001600160a01b0385165f818152601760209081526040918290209390935580519182529181018490527f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d4121396885910160405180910390a16040518381526001600160a01b038516905f905f80516020614417833981519152906020015b60405180910390a350505050565b5f6126de670de0b6b3a764000083614139565b90506126ea3382612a06565b600a546126f79083611cdf565b600a555f61270483611cc4565b6012549091506127149082611cdf565b601255335f908152601760205260409020546127309082611cdf565b335f818152601760209081526040918290209390935580519182529181018590527fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5910160405180910390a16040518381525f9033905f80516020614417833981519152906020015b60405180910390a3505050565b600881901c5f818152602084905260409020545f19919060ff84191690811b901c811581176127e6575b5081015f818152604090205481158117156127d0575b801561288b5761287c817f0706060506020504060203020504030106050205030304010505030400000000601f6f8421084210842108cc6318c6db6d54be831560081b6fffffffffffffffffffffffffffffffff851160071b1784811c6001600160401b031060061b1784811c63ffffffff1060051b1784811c61ffff1060041b1784811c60ff1060031b1793841c1c161a1790565b600883901b178481115f031792505b505092915050565b5f80546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6001600160a01b0382166129095760405163b817eee760e01b815260040160405180910390fd5b335f61291483613271565b6001600160a01b0385165f908152600160208181526040808420600889901c85529091529091205491925060ff85169190911c166129655760405163375040fd60e01b815260040160405180910390fd5b6001600160a01b0384165f818152600160208181526040808420600889901c85529091528220805460ff88169290921b1990911690558490825f805160206144178339815191528280a460408051858152600160208201525f916001600160a01b0388811692908716917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a4610ea083865f856132b7565b6001600160a01b038216612a2d5760405163b817eee760e01b815260040160405180910390fd5b60045433905f836001600160401b03811115612a4b57612a4b613a19565b604051908082528060200260200182016040528015612a74578160200160208202803683370190505b5090505f846001600160401b03811115612a9057612a90613a19565b604051908082528060200260200182016040528015612ab9578160200160208202803683370190505b5090505f5b85811015612b69576001838281518110612ada57612ada6140fa565b6020908102919091018101919091526001600160a01b0388165f908152600190915260408120612b0a90866127a6565b905080838381518110612b1f57612b1f6140fa565b6020908102919091018101919091526001600160a01b0389165f90815260018083526040808320600886901c8452909352919020805460ff841683901b1916905590945001612abe565b505f80612b7787600161420f565b90506001600160a01b038816915060208301515f835f805160206144178339815191525f80a460025b818114612bc957806020028401515f845f805160206144178339815191525f80a4600101612ba0565b5086600103612c51575f6001600160a01b0316886001600160a01b0316876001600160a01b03167fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62865f81518110612c2357612c236140fa565b60200260200101516001604051612c44929190918252602082015260400190565b60405180910390a4612ca9565b5f6001600160a01b0316886001600160a01b0316876001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb8688604051612ca0929190614222565b60405180910390a45b612cb586895f866132b7565b5050505050505050565b5f610e1e828461410e565b5f610e1e8284614139565b5f6001600454610c9891906140e7565b612cef8282612579565b601254612cfc908261254c565b6012555f612d0982612557565b600a54909150612d19908261254c565b600a55612d24611c88565b600f541115612d755760405162461bcd60e51b815260206004820152601a60248201527f6d6178207363616c696e6720666163746f7220746f6f206c6f770000000000006044820152606401610c6d565b6001600160a01b0383165f90815260176020526040902054612d97908361254c565b6001600160a01b0384165f818152601760209081526040918290209390935580519182529181018390527f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d4121396885910160405180910390a16040518181526001600160a01b038416905f905f8051602061441783398151915290602001612799565b816001600160a01b0316836001600160a01b031603612e895760405162461bcd60e51b815260206004820152602960248201527f455243313135353a2073657474696e6720617070726f76616c20737461747573604482015268103337b91039b2b63360b91b6064820152608401610c6d565b6001600160a01b038381165f81815260026020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c319101612799565b6060815f03612f135750506040805180820190915260018152600360fc1b602082015290565b815f5b8115612f3c5780612f26816141f7565b9150612f359050600a83614139565b9150612f16565b5f816001600160401b03811115612f5557612f55613a19565b6040519080825280601f01601f191660200182016040528015612f7f576020820181803683370190505b5090505b8415610e5257612f946001836140e7565b9150612fa1600a8661424f565b612fac90603061420f565b60f81b818381518110612fc157612fc16140fa565b60200101906001600160f81b03191690815f1a905350612fe2600a86614139565b9450612f83565b5f825f036113a857600f546040805186815260208101839052908101919091527fc6642d24d84e7f3d36ca39f5cce10e75639d9b158d5193aa350e2f900653e4c090606001611397565b6060806001600160a01b03841661305c57604051622e076360e81b815260040160405180910390fd5b825f0361307c5760405163b562e8dd60e01b815260040160405180910390fd5b33836001600160401b0381111561309557613095613a19565b6040519080825280602002602001820160405280156130be578160200160208202803683370190505b509250836001600160401b038111156130d9576130d9613a19565b604051908082528060200260200182016040528015613102578160200160208202803683370190505b5091505f61310f60045490565b905080855f19031015613120575f80fd5b5f5b858110156131725780820185828151811061313f5761313f6140fa565b602002602001018181525050600184828151811061315f5761315f6140fa565b6020908102919091010152600101613122565b506001600160a01b0386165f9081526001602052604090206131959082876138bf565b8460045f8282546131a6919061420f565b909155505f9050806131b8878461420f565b90506001600160a01b038816915082825f5f805160206144178339815191525f80a4600183015b8181146132025780835f5f805160206144178339815191525f80a46001016131df565b50876001600160a01b03165f6001600160a01b0316856001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb8989604051613252929190614222565b60405180910390a4613266845f8a896132b7565b505050509250929050565b6040805160018082528183019092526060916020808301908036833701905050905081815f815181106132a6576132a66140fa565b602002602001018181525050919050565b6001600160a01b0382165f908152600b602052604090205460ff1661343557601b546001600160a01b0383165f90815260176020526040902054111561333f5760405162461bcd60e51b815260206004820152601f60248201527f5472616e736665722065786365656473206d6178696d756d2077616c6c6574006044820152606401610c6d565b601c5460ff161561343557325f908152601d602052604090205443116133b35760405162461bcd60e51b8152602060048201526024808201527f4f6e6c79206f6e65207472616e736665722070657220626c6f636b20616c6c6f6044820152633bb2b21760e11b6064820152608401610c6d565b325f908152601d602052604090204390556001600160a01b0382163b1580156133db5750323b155b6134355760405162461bcd60e51b815260206004820152602560248201527f436f6e74726163742074726164696e672072657374726963746564206174206c6044820152640c2eadcc6d60db1b6064820152608401610c6d565b611c82565b6001600160a01b0384163b15612029576040516301ffc9a760e01b8152636cdb3d1360e11b60048201526001600160a01b038516906301ffc9a790602401602060405180830381865afa158015613493573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906134b79190614262565b156135c15760405163f23a6e6160e01b81526001600160a01b0385169063f23a6e61906134f0908990899088908890889060040161427d565b6020604051808303815f875af192505050801561352a575060408051601f3d908101601f19168201909252613527918101906142c1565b60015b61358a576135366142dc565b806308c379a00361356f575061354a6142f5565b806135555750613571565b8060405162461bcd60e51b8152600401610c6d91906139f0565b505b604051639c05499b60e01b815260040160405180910390fd5b6001600160e01b0319811663f23a6e6160e01b146135bb57604051639c05499b60e01b815260040160405180910390fd5b50612029565b604051630a85bd0160e11b81526001600160a01b0385169063150b7a02906135f390899089908890879060040161437d565b6020604051808303815f875af192505050801561362d575060408051601f3d908101601f1916820190925261362a918101906142c1565b60015b613673576136396142dc565b806308c379a003613658575061364d6142f5565b80613555575061365a565b505b6040516368d2bf6b60e11b815260040160405180910390fd5b6001600160e01b03198116630a85bd0160e11b14612027576040516368d2bf6b60e11b815260040160405180910390fd5b6001600160a01b0384166136cd5760405163e602df0560e01b81525f6004820152602401610c6d565b6001600160a01b0383166136f657604051634a1406b160e11b81525f6004820152602401610c6d565b6001600160a01b038085165f9081526007602090815260408083209387168352929052208290558015611c8257826001600160a01b0316846001600160a01b03165f80516020614437833981519152846040516126bd91815260200190565b7f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f7f5555555555555555555555555555555555555555555555555555555555555555600183901c168203600281901c7f3333333333333333333333333333333333333333333333333333333333333333908116911601600481901c01167f01010101010101010101010101010101010101010101010101010101010101010260f81c5f199190911460081b1790565b6001600160a01b0384163b156120295760405163bc197c8160e01b81526001600160a01b0385169063bc197c819061384890899089908890889088906004016143b9565b6020604051808303815f875af1925050508015613882575060408051601f3d908101601f1916820190925261387f918101906142c1565b60015b61388e576135366142dc565b6001600160e01b0319811663bc197c8160e01b1461202757604051639c05499b60e01b815260040160405180910390fd5b5f1960ff8316846020528360081c5f526101018382011061391b575f805160408220805485851b1790559390910160ff811693600181019160081c015b80821461391757815f528360405f20556001820191506138fc565b505f525b60405f208284610100031c821b8154178155505050505050565b6001600160a01b0381168114611c2f575f80fd5b5f806040838503121561395a575f80fd5b823561396581613935565b946020939093013593505050565b6001600160e01b031981168114611c2f575f80fd5b5f60208284031215613998575f80fd5b8135610e1e81613973565b5f5b838110156139bd5781810151838201526020016139a5565b50505f910152565b5f81518084526139dc8160208601602086016139a3565b601f01601f19169290920160200192915050565b602081525f610e1e60208301846139c5565b5f60208284031215613a12575f80fd5b5035919050565b634e487b7160e01b5f52604160045260245ffd5b601f8201601f191681016001600160401b0381118282101715613a5257613a52613a19565b6040525050565b5f6001600160401b03831115613a7157613a71613a19565b604051613a88601f8501601f191660200182613a2d565b809150838152848484011115613a9c575f80fd5b838360208301375f60208583010152509392505050565b5f60208284031215613ac3575f80fd5b81356001600160401b03811115613ad8575f80fd5b8201601f81018413613ae8575f80fd5b610e5284823560208401613a59565b5f805f60608486031215613b09575f80fd5b8335613b1481613935565b92506020840135613b2481613935565b929592945050506040919091013590565b5f805f60608486031215613b47575f80fd5b8335613b5281613935565b95602085013595506040909401359392505050565b5f6001600160401b03821115613b7f57613b7f613a19565b5060051b60200190565b5f82601f830112613b98575f80fd5b81356020613ba582613b67565b604051613bb28282613a2d565b80915083815260208101915060208460051b870101935086841115613bd5575f80fd5b602086015b84811015613bf15780358352918301918301613bda565b509695505050505050565b5f82601f830112613c0b575f80fd5b610e1e83833560208501613a59565b5f805f805f60a08688031215613c2e575f80fd5b8535613c3981613935565b94506020860135613c4981613935565b935060408601356001600160401b0380821115613c64575f80fd5b613c7089838a01613b89565b94506060880135915080821115613c85575f80fd5b613c9189838a01613b89565b93506080880135915080821115613ca6575f80fd5b50613cb388828901613bfc565b9150509295509295909350565b5f60208284031215613cd0575f80fd5b8135610e1e81613935565b5f8060408385031215613cec575f80fd5b82356001600160401b0380821115613d02575f80fd5b818501915085601f830112613d15575f80fd5b81356020613d2282613b67565b604051613d2f8282613a2d565b83815260059390931b8501820192828101915089841115613d4e575f80fd5b948201945b83861015613d75578535613d6681613935565b82529482019490820190613d53565b96505086013592505080821115613d8a575f80fd5b50613d9785828601613b89565b9150509250929050565b5f815180845260208085019450602084015f5b83811015613dd057815187529582019590820190600101613db4565b509495945050505050565b602081525f610e1e6020830184613da1565b8015158114611c2f575f80fd5b5f8060408385031215613e0b575f80fd5b8235613e1681613935565b91506020830135613e2681613ded565b809150509250929050565b5f805f60608486031215613e43575f80fd5b83359250602084013591506040840135613e5c81613ded565b809150509250925092565b5f805f805f805f60e0888a031215613e7d575f80fd5b8735613e8881613935565b96506020880135613e9881613935565b95506040880135945060608801359350608088013560ff81168114613ebb575f80fd5b9699959850939692959460a0840135945060c09093013592915050565b5f8060408385031215613ee9575f80fd5b8235613ef481613935565b91506020830135613e2681613935565b5f805f805f60a08688031215613f18575f80fd5b8535613f2381613935565b94506020860135613f3381613935565b9350604086013592506060860135915060808601356001600160401b03811115613f5b575f80fd5b613cb388828901613bfc565b600181811c90821680613f7b57607f821691505b602082108103613f9957634e487b7160e01b5f52602260045260245ffd5b50919050565b60208082526016908201527543616c6c6261636b3a204e6f7420416c6c6f7765642160501b604082015260600190565b601f82111561401357805f5260205f20601f840160051c81016020851015613ff45750805b601f840160051c820191505b81811015610ea0575f8155600101614000565b505050565b81516001600160401b0381111561403157614031613a19565b6140458161403f8454613f67565b84613fcf565b602080601f831160018114614078575f84156140615750858301515b5f19600386901b1c1916600185901b178555612029565b5f85815260208120601f198616915b828110156140a657888601518255948401946001909101908401614087565b50858210156140c357878501515f19600388901b60f8161c191681555b5050505050600190811b01905550565b634e487b7160e01b5f52601160045260245ffd5b81810381811115610ab557610ab56140d3565b634e487b7160e01b5f52603260045260245ffd5b8082028115828204841417610ab557610ab56140d3565b634e487b7160e01b5f52601260045260245ffd5b5f8261414757614147614125565b500490565b5f80845461415981613f67565b600182811680156141715760018114614186576141b2565b60ff19841687528215158302870194506141b2565b885f526020805f205f5b858110156141a95781548a820152908401908201614190565b50505082870194505b5050505083516141c68183602088016139a3565b01949350505050565b5f82516141e08184602087016139a3565b64173539b7b760d91b920191825250600501919050565b5f60018201614208576142086140d3565b5060010190565b80820180821115610ab557610ab56140d3565b604081525f6142346040830185613da1565b82810360208401526142468185613da1565b95945050505050565b5f8261425d5761425d614125565b500690565b5f60208284031215614272575f80fd5b8151610e1e81613ded565b6001600160a01b03868116825285166020820152604081018490526060810183905260a0608082018190525f906142b6908301846139c5565b979650505050505050565b5f602082840312156142d1575f80fd5b8151610e1e81613973565b5f60033d11156142f25760045f803e505f5160e01c5b90565b5f60443d10156143025790565b6040516003193d81016004833e81513d6001600160401b03816024840111818411171561433157505050505090565b82850191508151818111156143495750505050505090565b843d87010160208285010111156143635750505050505090565b61437260208286010187613a2d565b509095945050505050565b6001600160a01b03858116825284166020820152604081018390526080606082018190525f906143af908301846139c5565b9695505050505050565b6001600160a01b0386811682528516602082015260a0604082018190525f906143e490830186613da1565b82810360608401526143f68186613da1565b9050828103608084015261440a81856139c5565b9897505050505050505056feddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925a26469706673582212202addf73209f3bf543cd1225c9bcea284d40d9237cdc7d5e661d9b0138bf919cf64736f6c63430008180033

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

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