Contract Address Details

0x6D2da5AE4ef3766c5E327Fe3aF32c07Ef3Facd4b

Token
CronosShaggyGalaxy (CSG)
Creator
0xface3f–00f604 at 0xa9568f–b52d65
Balance
25.578907638029585856 CRO ( )
Tokens
Fetching tokens...
Transactions
736 Transactions
Transfers
159 Transfers
Gas Used
214,055,553
Last Balance Update
13831175
Contract name:
CronosShaggyGalaxy




Optimization enabled
true
Compiler version
v0.8.2+commit.661d1103




Optimization runs
200
EVM Version
default




Verified at
2022-06-19T15:49:16.063382Z

Constructor Arguments

000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000821ab0d4414980000000000000000000000000000000000000000000000000000000000000000271000000000000000000000000000000000000000000000000000000000000002ee000000000000000000000000000000000000000000000000000000000000004068747470733a2f2f617277656176652e6e65742f364b63506e4e703966504f7475385f394a49454c3570754653593462756364497038506c583937577470672f

Arg [0] (string) : https://arweave.net/6KcPnNp9fPOtu8_9JIEL5puFSY4bucdIp8PlX97Wtpg/
Arg [1] (uint256) : 150000000000000000000
Arg [2] (uint256) : 10000
Arg [3] (uint256) : 750

              

Contract source code

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.2;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        return account.code.length > 0;
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

/**
 * @dev Provides information about the current execution context, including the
 * sender of the transaction and its data. While these are generally available
 * via msg.sender and msg.data, they should not be accessed in such a direct
 * manner, since when dealing with meta-transactions the account sending and
 * paying for execution may not be the actual sender (as far as an application
 * is concerned).
 *
 * This contract is only required for intermediate, library-like contracts.
 */
abstract contract Context {
    function _msgSender() internal view virtual returns (address) {
        return msg.sender;
    }

    function _msgData() internal view virtual returns (bytes calldata) {
        return msg.data;
    }
}

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

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

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

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

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


/**
 * @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;
    }
}
/**
 * @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including
 * the Metadata extension, but not including the Enumerable extension, which is available separately as
 * {ERC721Enumerable}.
 */
contract ERC721 is Context, ERC165, IERC721, IERC721Metadata {
    using Address for address;
    using Strings for uint256;

    // Token name
    string private _name;

    // Token symbol
    string private _symbol;

    // Mapping from token ID to owner address
    mapping(uint256 => address) private _owners;

    // Mapping owner address to token count
    mapping(address => uint256) private _balances;

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

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

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

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

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

    /**
     * @dev See {IERC721-ownerOf}.
     */
    function ownerOf(uint256 tokenId) public view virtual override returns (address) {
        address owner = _owners[tokenId];
        require(owner != address(0), "ERC721: owner query for nonexistent token");
        return owner;
    }

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

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

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

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

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

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

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

        _approve(to, tokenId);
    }

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

        return _tokenApprovals[tokenId];
    }

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

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

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

        _transfer(from, to, tokenId);
    }

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

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

    /**
     * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients
     * are aware of the ERC721 protocol to prevent tokens from being forever locked.
     *
     * `_data` is additional data, it has no specified format and it is sent in call to `to`.
     *
     * This internal function is equivalent to {safeTransferFrom}, and can be used to e.g.
     * implement alternative mechanisms to perform token transfer, such as signature-based.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must exist and be owned by `from`.
     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
     *
     * Emits a {Transfer} event.
     */
    function _safeTransfer(
        address from,
        address to,
        uint256 tokenId,
        bytes memory _data
    ) internal virtual {
        _transfer(from, to, tokenId);
        require(_checkOnERC721Received(from, to, tokenId, _data), "ERC721: transfer to non ERC721Receiver implementer");
    }

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

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

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

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

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

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

        _balances[to] += 1;
        _owners[tokenId] = to;

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

        _afterTokenTransfer(address(0), to, tokenId);
    }

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

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

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

        _balances[owner] -= 1;
        delete _owners[tokenId];

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

        _afterTokenTransfer(owner, address(0), tokenId);
    }

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

        _beforeTokenTransfer(from, to, tokenId);

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

        _balances[from] -= 1;
        _balances[to] += 1;
        _owners[tokenId] = to;

        emit Transfer(from, to, tokenId);

        _afterTokenTransfer(from, to, tokenId);
    }

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

    /**
     * @dev Approve `operator` to operate on all of `owner` tokens
     *
     * Emits a {ApprovalForAll} event.
     */
    function _setApprovalForAll(
        address owner,
        address operator,
        bool approved
    ) internal virtual {
        require(owner != operator, "ERC721: approve to caller");
        _operatorApprovals[owner][operator] = approved;
        emit ApprovalForAll(owner, operator, approved);
    }

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

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

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


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

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

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


/**
 * @dev This implements an optional extension of {ERC721} defined in the EIP that adds
 * enumerability of all the token ids in the contract as well as all token ids owned by each
 * account.
 */
abstract contract ERC721Enumerable is ERC721, IERC721Enumerable {
    // Mapping from owner to list of owned token IDs
    mapping(address => mapping(uint256 => uint256)) private _ownedTokens;

    // Mapping from token ID to index of the owner tokens list
    mapping(uint256 => uint256) private _ownedTokensIndex;

    // Array with all token ids, used for enumeration
    uint256[] private _allTokens;

    // Mapping from token id to position in the allTokens array
    mapping(uint256 => uint256) private _allTokensIndex;

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

    /**
     * @dev See {IERC721Enumerable-tokenOfOwnerByIndex}.
     */
    function tokenOfOwnerByIndex(address owner, uint256 index) public view virtual override returns (uint256) {
        require(index < ERC721.balanceOf(owner), "ERC721Enumerable: owner index out of bounds");
        return _ownedTokens[owner][index];
    }

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

    /**
     * @dev See {IERC721Enumerable-tokenByIndex}.
     */
    function tokenByIndex(uint256 index) public view virtual override returns (uint256) {
        require(index < ERC721Enumerable.totalSupply(), "ERC721Enumerable: global index out of bounds");
        return _allTokens[index];
    }

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

        if (from == address(0)) {
            _addTokenToAllTokensEnumeration(tokenId);
        } else if (from != to) {
            _removeTokenFromOwnerEnumeration(from, tokenId);
        }
        if (to == address(0)) {
            _removeTokenFromAllTokensEnumeration(tokenId);
        } else if (to != from) {
            _addTokenToOwnerEnumeration(to, tokenId);
        }
    }

    /**
     * @dev Private function to add a token to this extension's ownership-tracking data structures.
     * @param to address representing the new owner of the given token ID
     * @param tokenId uint256 ID of the token to be added to the tokens list of the given address
     */
    function _addTokenToOwnerEnumeration(address to, uint256 tokenId) private {
        uint256 length = ERC721.balanceOf(to);
        _ownedTokens[to][length] = tokenId;
        _ownedTokensIndex[tokenId] = length;
    }

    /**
     * @dev Private function to add a token to this extension's token tracking data structures.
     * @param tokenId uint256 ID of the token to be added to the tokens list
     */
    function _addTokenToAllTokensEnumeration(uint256 tokenId) private {
        _allTokensIndex[tokenId] = _allTokens.length;
        _allTokens.push(tokenId);
    }

    /**
     * @dev Private function to remove a token from this extension's ownership-tracking data structures. Note that
     * while the token is not assigned a new owner, the `_ownedTokensIndex` mapping is _not_ updated: this allows for
     * gas optimizations e.g. when performing a transfer operation (avoiding double writes).
     * This has O(1) time complexity, but alters the order of the _ownedTokens array.
     * @param from address representing the previous owner of the given token ID
     * @param tokenId uint256 ID of the token to be removed from the tokens list of the given address
     */
    function _removeTokenFromOwnerEnumeration(address from, uint256 tokenId) private {
        // To prevent a gap in from's tokens array, we store the last token in the index of the token to delete, and
        // then delete the last slot (swap and pop).

        uint256 lastTokenIndex = ERC721.balanceOf(from) - 1;
        uint256 tokenIndex = _ownedTokensIndex[tokenId];

        // When the token to delete is the last token, the swap operation is unnecessary
        if (tokenIndex != lastTokenIndex) {
            uint256 lastTokenId = _ownedTokens[from][lastTokenIndex];

            _ownedTokens[from][tokenIndex] = lastTokenId; // Move the last token to the slot of the to-delete token
            _ownedTokensIndex[lastTokenId] = tokenIndex; // Update the moved token's index
        }

        // This also deletes the contents at the last position of the array
        delete _ownedTokensIndex[tokenId];
        delete _ownedTokens[from][lastTokenIndex];
    }

    /**
     * @dev Private function to remove a token from this extension's token tracking data structures.
     * This has O(1) time complexity, but alters the order of the _allTokens array.
     * @param tokenId uint256 ID of the token to be removed from the tokens list
     */
    function _removeTokenFromAllTokensEnumeration(uint256 tokenId) private {
        // To prevent a gap in the tokens array, we store the last token in the index of the token to delete, and
        // then delete the last slot (swap and pop).

        uint256 lastTokenIndex = _allTokens.length - 1;
        uint256 tokenIndex = _allTokensIndex[tokenId];

        // When the token to delete is the last token, the swap operation is unnecessary. However, since this occurs so
        // rarely (when the last minted token is burnt) that we still do the swap here to avoid the gas cost of adding
        // an 'if' statement (like in _removeTokenFromOwnerEnumeration)
        uint256 lastTokenId = _allTokens[lastTokenIndex];

        _allTokens[tokenIndex] = lastTokenId; // Move the last token to the slot of the to-delete token
        _allTokensIndex[lastTokenId] = tokenIndex; // Update the moved token's index

        // This also deletes the contents at the last position of the array
        delete _allTokensIndex[tokenId];
        _allTokens.pop();
    }
}

/**
 * @dev ERC721 token with storage based token URI management.
 */
abstract contract ERC721URIStorage is ERC721 {
    using Strings for uint256;

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

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

        string memory _tokenURI = _tokenURIs[tokenId];
        string memory base = _baseURI();

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

        return super.tokenURI(tokenId);
    }

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

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

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

/**
 * @dev Contract module which allows children to implement an emergency stop
 * mechanism that can be triggered by an authorized account.
 *
 * This module is used through inheritance. It will make available the
 * modifiers `whenNotPaused` and `whenPaused`, which can be applied to
 * the functions of your contract. Note that they will not be pausable by
 * simply including this module, only once the modifiers are put in place.
 */
abstract contract Pausable is Context {
    /**
     * @dev Emitted when the pause is triggered by `account`.
     */
    event Paused(address account);

    /**
     * @dev Emitted when the pause is lifted by `account`.
     */
    event Unpaused(address account);

    bool private _paused;

    /**
     * @dev Initializes the contract in unpaused state.
     */
    constructor() {
        _paused = false;
    }

    /**
     * @dev Returns true if the contract is paused, and false otherwise.
     */
    function paused() public view virtual returns (bool) {
        return _paused;
    }

    /**
     * @dev Modifier to make a function callable only when the contract is not paused.
     *
     * Requirements:
     *
     * - The contract must not be paused.
     */
    modifier whenNotPaused() {
        require(!paused(), "Pausable: paused");
        _;
    }

    /**
     * @dev Modifier to make a function callable only when the contract is paused.
     *
     * Requirements:
     *
     * - The contract must be paused.
     */
    modifier whenPaused() {
        require(paused(), "Pausable: not paused");
        _;
    }

    /**
     * @dev Triggers stopped state.
     *
     * Requirements:
     *
     * - The contract must not be paused.
     */
    function _pause() internal virtual whenNotPaused {
        _paused = true;
        emit Paused(_msgSender());
    }

    /**
     * @dev Returns to normal state.
     *
     * Requirements:
     *
     * - The contract must be paused.
     */
    function _unpause() internal virtual whenPaused {
        _paused = false;
        emit Unpaused(_msgSender());
    }
}

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

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

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

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

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

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

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Can only be called by the current owner.
     */
    function transferOwnership(address newOwner) public virtual onlyOwner {
        require(newOwner != address(0), "Ownable: new owner is the zero address");
        _transferOwnership(newOwner);
    }

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

/**
 * @title Counters
 * @author Matt Condon (@shrugs)
 * @dev Provides counters that can only be incremented, decremented or reset. This can be used e.g. to track the number
 * of elements in a mapping, issuing ERC721 ids, or counting request ids.
 *
 * Include with `using Counters for Counters.Counter;`
 */
library Counters {
    struct Counter {
        // This variable should never be directly accessed by users of the library: interactions must be restricted to
        // the library's function. As of Solidity v0.5.2, this cannot be enforced, though there is a proposal to add
        // this feature: see https://github.com/ethereum/solidity/issues/4637
        uint256 _value; // default: 0
    }

    function current(Counter storage counter) internal view returns (uint256) {
        return counter._value;
    }

    function increment(Counter storage counter) internal {
        unchecked {
            counter._value += 1;
        }
    }

    function decrement(Counter storage counter) internal {
        uint256 value = counter._value;
        require(value > 0, "Counter: decrement overflow");
        unchecked {
            counter._value = value - 1;
        }
    }

    function reset(Counter storage counter) internal {
        counter._value = 0;
    }
}

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

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

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

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

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

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

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

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

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

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

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

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

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


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

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

    uint256 private _totalSupply;

    string private _name;
    string private _symbol;

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

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

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

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

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

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

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

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

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

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

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

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

        return true;
    }

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

        _beforeTokenTransfer(from, to, amount);

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

        emit Transfer(from, to, amount);

        _afterTokenTransfer(from, to, amount);
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

contract CronosShaggyGalaxy is ERC721, ERC721Enumerable, ERC721URIStorage, Pausable, Ownable {
    using Counters for Counters.Counter;
    using SafeMath for uint256;
    using Strings for uint256;

    // General
    Counters.Counter private _tokenIdCounter;
    string public baseTokenURI;
    uint256 public maxSupply;
    uint256 public mintPrice;
    uint256 public tokensRemainingToAssign;
    mapping(uint256 => uint256) private assignOrders;

    // Marketplace
    uint256 public volume;
    mapping (uint256 => Sale) public tokensForSale;
    address public ownerTeam;
    address public ownerRoyalties;
    uint256 public royaltiesBips;

    // Rewards
    address public combToken;
    address public liquidityPool;
    address public marketplaceRoyalties;
    uint256 public initTimestamp;
    uint256 public claimInterval;
    mapping (uint256 => Claim) public claims;

    constructor(
        string memory _baseURIValue,
        uint256 _mintPrice,
        uint256 _maxSupply,
        uint256 _royaltiesBips
    ) ERC721("CronosShaggyGalaxy", "CSG") {
        baseTokenURI = _baseURIValue;
        mintPrice = _mintPrice;
        maxSupply = _maxSupply;
        tokensRemainingToAssign = _maxSupply;

        ownerTeam = address(0xBDaAB06205C6230801527B27B3f1DC1913293B1E);
        ownerRoyalties = address(0xFACE3f87A1762eeaE31595d1B374765a9a00f604);
        royaltiesBips = _royaltiesBips;

        combToken = address(0x0);
        liquidityPool = address(0x0);
        marketplaceRoyalties = address(0x0);
        initTimestamp = 1656705600; // 2022-07-01 20:00:00 UTC
        claimInterval = 604800; // 604800 seconds = 1 week
        _pause();
    }

    receive() external payable {} // needed to accumulate marketplace distribution

    // -- Structures

    struct Sale {
        bool isForSale;
        uint256 tokenId;
        address seller;
        uint256 price;
    }

    struct Claim {
        uint256 timestamp;
        address hodler;
        uint256 amount;
    }

    // -- Events

    event TokensMinted(uint[] tokenIds, address buyer);
    event UpdateMintPrice(uint256 mintPrice, address owner);
    event PutTokenForSale(uint256 tokenId, uint256 price, address from);
    event TokenBought(uint tokenId, uint value, uint sellerRevenue, uint royalties, address seller, address buyer);
    event TokenNoLongerForSale(uint256 tokenId, address from);
    event ClaimRewards(uint256 timestamp, address hodler, uint256 amount);

    // -- Modifiers

    modifier onlyTradableToken (address from, uint256 tokenId) {
        require(_exists(tokenId), "CronosShaggyGalaxy: TokenId does not exist");
        require(ownerOf(tokenId) == from, "CronosShaggyGalaxy: Token does not belong to user");
        _;
    }

    // -- Minting Methods

    function mintToken(uint256 amount) public payable {
        require(initTimestamp <= block.timestamp, "Minting is closed at the moment.");
        require(amount <= 10, "CronosShaggyGalaxy: You cannot mint more than 10 NFTs per time.");
        require(getMintPrice(amount) == msg.value, "CronosShaggyGalaxy: Payment amount is incorrect.");
        _mintToken(amount, _msgSender(), true);
    }

    function _mintToken(uint256 amount, address recipient, bool random) private {
        require(totalSupply() < maxSupply, "CronosShaggyGalaxy: Sale has already ended.");
        require(amount > 0, "CronosShaggyGalaxy: You cannot mint 0 Nfts.");
        require(SafeMath.add(totalSupply(), amount) <= maxSupply, "CronosShaggyGalaxy: Exceeds maximum supply. Please try to mint less Nfts.");

        uint[] memory tokenIdsBought = new uint[](amount);

        for (uint i = 0; i < amount; i++) {
            uint256 randIndex = (random ? _random(tokensRemainingToAssign) : totalSupply()) % tokensRemainingToAssign;
            uint256 tokenIndex = SafeMath.add(_fillAssignOrder(--tokensRemainingToAssign, randIndex), 1);
            _tokenIdCounter.increment();
            _safeMint(recipient, tokenIndex);
            _setTokenURI(tokenIndex, string(abi.encodePacked(Strings.toString(tokenIndex), ".json")));
            tokenIdsBought[i] = tokenIndex;
            // generating first dummy claim in order to set block countdown
            claims[tokenIndex] = Claim(block.timestamp, msg.sender, 0);
        }

        // dividing by 3 the msg.value
        uint256 distributedValue = msg.value.div(3);
        // first third to owner
        (bool success1,) = ownerTeam.call{value: SafeMath.mul(distributedValue / 100, 85)}("");
        require(success1);
        (bool success2,) = ownerRoyalties.call{value: SafeMath.mul(distributedValue / 100, 15)}("");
        require(success2);
        // second third to address for CRO/$COMB LP
        (bool success3,) = liquidityPool.call{value: distributedValue}("");
        require(success3);
        uint256 combAmount = SafeMath.mul(2500 * 10 ** ERC20(combToken).decimals(), amount);
        ERC20(combToken).approve(address(this), combAmount);
        ERC20(combToken).transferFrom(address(this), liquidityPool, combAmount);
        // last third left in this contract for rewards claiming

        emit TokensMinted(tokenIdsBought, _msgSender());
    }

    function _random(uint256 number) internal view returns(uint256) {
        return uint256(
            keccak256(
                abi.encodePacked(
                    block.timestamp + block.difficulty + block.gaslimit + block.number +
                    ((uint256(keccak256(abi.encodePacked(block.coinbase)))) / block.timestamp) +
                    ((uint256(keccak256(abi.encodePacked(msg.sender)))) / block.timestamp)
                )
            )
        ) / number;
    }

    function _fillAssignOrder(uint256 orderA, uint256 orderB) internal returns(uint256) {
        uint256 temp = orderA;
        if (assignOrders[orderA] > 0) temp = assignOrders[orderA];
        assignOrders[orderA] = orderB;
        if (assignOrders[orderB] > 0) assignOrders[orderA] = assignOrders[orderB];
        assignOrders[orderB] = temp;
        return assignOrders[orderA];
    }

    // -- Marketplace Methods

    function putTokenForSale(uint256 tokenId, uint256 price) public onlyTradableToken(_msgSender(), tokenId) {
        require(price != 0, "CronosShaggyGalaxy: Cannot put zero as a price");

        tokensForSale[tokenId] = Sale(true, tokenId, _msgSender(), price);
        emit PutTokenForSale(tokenId, price, _msgSender());
    }

    function buyToken(uint256 tokenId) payable public {
        Sale memory offer = tokensForSale[tokenId];
        require(_exists(tokenId), "CronosShaggyGalaxy: TokenId does not exist");
        require(offer.isForSale, "CronosShaggyGalaxy: No Sale");
        require(msg.value == offer.price, "CronosShaggyGalaxy: Incorrect amount");
        require(ownerOf(tokenId) == offer.seller, "CronosShaggyGalaxy: Not seller"); // This is not possible but just in case
        address seller = offer.seller;

        // Transfer the NFT, this will automatically remove it from the marketplace
        _safeTransfer(seller, _msgSender(), tokenId, "");
        // Calculating royalties
        (uint256 amountAfterRoyalties, uint256 royaltiesAmount) = _calculateMarketplaceRoyalties(msg.value, royaltiesBips);

        // increasing marketplace volume
        volume += msg.value;
        // sending amount less fees to seller
        (bool success1,) = seller.call{value: amountAfterRoyalties}("");
        require(success1);
        // sending fees to marketplaceRoyalties contract
        (bool success2,) = marketplaceRoyalties.call{value: royaltiesAmount}("");
        require(success2);

        emit TokenBought(tokenId, msg.value, amountAfterRoyalties, royaltiesAmount, seller, _msgSender());
    }

    function _calculateMarketplaceRoyalties(uint256 amount, uint256 _royaltiesBips) internal pure returns (uint256 amountAfterRoyalties, uint256 royaltiesAmount) {
        royaltiesAmount = amount.mul(_royaltiesBips).div(10000);
        amountAfterRoyalties = amount.sub(royaltiesAmount);
    }

    function tokenNoLongerForSale(uint256 tokenId) public onlyTradableToken(_msgSender(), tokenId) {
        tokensForSale[tokenId] = Sale(false, tokenId, _msgSender(), 0);
        emit TokenNoLongerForSale(tokenId, _msgSender());
    }

    // -- CRO Rewards Claiming Methods

    function claimRewards() public {
        require(initTimestamp <= block.timestamp, "Claiming is closed at the moment.");
        require(balanceOf(msg.sender) > 0, "You do not own any Shaggy.");

        uint256 claimable = _calculateClaimableAmount();
        require(claimable > 0, "You are not eligible to claim any CRO rewards.");

        // sending claimable to the user
        (bool success,) = msg.sender.call{value: claimable}("");
        require(success);

        emit ClaimRewards(block.timestamp, msg.sender, claimable);
    }

    function _calculateClaimableAmount() private returns (uint256) {
        uint256 totalAmount = 0;
        // foreach shaggy owned
        for (uint i = 0; i < balanceOf(msg.sender); i++) {
            uint tokenId = tokenOfOwnerByIndex(msg.sender, i);
            // check the mapping for eligibility, cannot be zero (should never be) && lastClaimTimestamp+claimInterval less or equal currentTimestamp
            if (claims[tokenId].timestamp != 0 && SafeMath.add(claims[tokenId].timestamp, claimInterval) <= block.timestamp) {
                // currentBalance divided currentTotalSupply
                uint256 amount = SafeMath.div(address(this).balance, totalSupply());
                // increase reward
                totalAmount = SafeMath.add(totalAmount, amount);
                // generating claim in order to update block countdown
                claims[tokenId] = Claim(block.timestamp, msg.sender, SafeMath.add(claims[tokenId].amount, amount));
            }
        }

        return totalAmount;
    }

    function getClaimableAmount() public view returns (uint256) {
        uint256 totalAmount = 0;
        // foreach shaggy owned
        for (uint i = 0; i < balanceOf(msg.sender); i++) {
            uint tokenId = tokenOfOwnerByIndex(msg.sender, i);
            // check the mapping for eligibility, cannot be zero (should never be) && lastClaimTimestamp+claimInterval less or equal currentTimestamp
            if (claims[tokenId].timestamp != 0 && SafeMath.add(claims[tokenId].timestamp, claimInterval) <= block.timestamp) {
                uint256 amount = SafeMath.div(address(this).balance, totalSupply());
                // increase reward
                totalAmount = SafeMath.add(totalAmount, amount);
            }
        }

        return totalAmount;
    }

    // -- Getters

    function getMintPrice(uint256 amount) public view returns (uint256) {
        return amount * mintPrice;
    }

    function getOnSaleTokenIds(uint256 start, uint256 end) public view returns (uint256[] memory tokenIds, address[] memory sellers, uint256[] memory prices) {
        uint256 max = maxSupply > end ? end : maxSupply;

        uint256 count = 0;
        for (uint i = start; i < max; i++) {
            if (tokensForSale[i].isForSale) {
                count++;
            }
        }

        uint256[] memory _onSaleTokenIds = new uint[](count);
        address[] memory _sellers = new address[](count);
        uint256[] memory _prices = new uint256[](count);

        uint256 counter = 0;
        for (uint i = start; i < end; i++) {
            if (tokensForSale[i].isForSale) {
                _onSaleTokenIds[counter] = i;
                _sellers[counter] = tokensForSale[i].seller;
                _prices[counter] = tokensForSale[i].price;
                counter++;
            }
        }

        return (_onSaleTokenIds, _sellers, _prices);
    }

    // -- Owner

    function updateBaseURI(string memory _baseTokenURI) public onlyOwner {
        baseTokenURI = _baseTokenURI;
    }

    function updateMintPrice(uint256 _mintPrice) public onlyOwner {
        mintPrice = _mintPrice;
        emit UpdateMintPrice(_mintPrice, _msgSender());
    }

    function updateCombToken(address _combToken) public onlyOwner {
        combToken = _combToken;
    }

    function updateLiquidityPool(address _liquidityPool) public onlyOwner {
        liquidityPool = _liquidityPool;
    }

    function updateMarketplaceRoyalties(address _marketplaceRoyalties) public onlyOwner {
        marketplaceRoyalties = _marketplaceRoyalties;
    }

    function updateInitTimestamp(uint256 _initTimestamp) public onlyOwner {
        initTimestamp = _initTimestamp;
    }

    function updateClaimInterval(uint256 _claimInterval) public onlyOwner {
        claimInterval = _claimInterval;
    }

    function adminMintToken(uint256 amount, address recipient) public {
        require(msg.sender == ownerTeam);
        _mintToken(amount, recipient, true);
    }

    function adminMintTokenNoRandomness(uint256 amount, address recipient) public onlyOwner {
        _mintToken(amount, recipient, false);
    }

    // -- Overwriting this method for Sale creation

    function _beforeTokenTransfer(address from, address to, uint256 tokenId) internal whenNotPaused override(ERC721, ERC721Enumerable) {
        super._beforeTokenTransfer(from, to, tokenId);

        tokensForSale[tokenId] = Sale(false, tokenId, address(0), 0);
    }

    // -- Overwriting this methods for Pause/Unpause the contract

    function pause() public onlyOwner {
        _pause();
    }
    function unpause() public onlyOwner {
        require(combToken != address(0x0));
        require(liquidityPool != address(0x0));
        require(marketplaceRoyalties != address(0x0));
        _unpause();
    }

    // -- Solidity overrides

    function _burn(uint256 tokenId) internal override(ERC721, ERC721URIStorage) {
        super._burn(tokenId);
    }

    function _baseURI() internal view override returns (string memory) {
        return baseTokenURI;
    }

    function tokenURI(uint256 tokenId) public view override(ERC721, ERC721URIStorage) returns (string memory) {
        return super.tokenURI(tokenId);
    }

    function supportsInterface(bytes4 interfaceId) public view override(ERC721, ERC721Enumerable) returns (bool) {
        return super.supportsInterface(interfaceId);
    }
}
        

Contract ABI

[{"type":"constructor","stateMutability":"nonpayable","inputs":[{"type":"string","name":"_baseURIValue","internalType":"string"},{"type":"uint256","name":"_mintPrice","internalType":"uint256"},{"type":"uint256","name":"_maxSupply","internalType":"uint256"},{"type":"uint256","name":"_royaltiesBips","internalType":"uint256"}]},{"type":"event","name":"Approval","inputs":[{"type":"address","name":"owner","internalType":"address","indexed":true},{"type":"address","name":"approved","internalType":"address","indexed":true},{"type":"uint256","name":"tokenId","internalType":"uint256","indexed":true}],"anonymous":false},{"type":"event","name":"ApprovalForAll","inputs":[{"type":"address","name":"owner","internalType":"address","indexed":true},{"type":"address","name":"operator","internalType":"address","indexed":true},{"type":"bool","name":"approved","internalType":"bool","indexed":false}],"anonymous":false},{"type":"event","name":"ClaimRewards","inputs":[{"type":"uint256","name":"timestamp","internalType":"uint256","indexed":false},{"type":"address","name":"hodler","internalType":"address","indexed":false},{"type":"uint256","name":"amount","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"OwnershipTransferred","inputs":[{"type":"address","name":"previousOwner","internalType":"address","indexed":true},{"type":"address","name":"newOwner","internalType":"address","indexed":true}],"anonymous":false},{"type":"event","name":"Paused","inputs":[{"type":"address","name":"account","internalType":"address","indexed":false}],"anonymous":false},{"type":"event","name":"PutTokenForSale","inputs":[{"type":"uint256","name":"tokenId","internalType":"uint256","indexed":false},{"type":"uint256","name":"price","internalType":"uint256","indexed":false},{"type":"address","name":"from","internalType":"address","indexed":false}],"anonymous":false},{"type":"event","name":"TokenBought","inputs":[{"type":"uint256","name":"tokenId","internalType":"uint256","indexed":false},{"type":"uint256","name":"value","internalType":"uint256","indexed":false},{"type":"uint256","name":"sellerRevenue","internalType":"uint256","indexed":false},{"type":"uint256","name":"royalties","internalType":"uint256","indexed":false},{"type":"address","name":"seller","internalType":"address","indexed":false},{"type":"address","name":"buyer","internalType":"address","indexed":false}],"anonymous":false},{"type":"event","name":"TokenNoLongerForSale","inputs":[{"type":"uint256","name":"tokenId","internalType":"uint256","indexed":false},{"type":"address","name":"from","internalType":"address","indexed":false}],"anonymous":false},{"type":"event","name":"TokensMinted","inputs":[{"type":"uint256[]","name":"tokenIds","internalType":"uint256[]","indexed":false},{"type":"address","name":"buyer","internalType":"address","indexed":false}],"anonymous":false},{"type":"event","name":"Transfer","inputs":[{"type":"address","name":"from","internalType":"address","indexed":true},{"type":"address","name":"to","internalType":"address","indexed":true},{"type":"uint256","name":"tokenId","internalType":"uint256","indexed":true}],"anonymous":false},{"type":"event","name":"Unpaused","inputs":[{"type":"address","name":"account","internalType":"address","indexed":false}],"anonymous":false},{"type":"event","name":"UpdateMintPrice","inputs":[{"type":"uint256","name":"mintPrice","internalType":"uint256","indexed":false},{"type":"address","name":"owner","internalType":"address","indexed":false}],"anonymous":false},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"adminMintToken","inputs":[{"type":"uint256","name":"amount","internalType":"uint256"},{"type":"address","name":"recipient","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"adminMintTokenNoRandomness","inputs":[{"type":"uint256","name":"amount","internalType":"uint256"},{"type":"address","name":"recipient","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"approve","inputs":[{"type":"address","name":"to","internalType":"address"},{"type":"uint256","name":"tokenId","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"balanceOf","inputs":[{"type":"address","name":"owner","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"string","name":"","internalType":"string"}],"name":"baseTokenURI","inputs":[]},{"type":"function","stateMutability":"payable","outputs":[],"name":"buyToken","inputs":[{"type":"uint256","name":"tokenId","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"claimInterval","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"claimRewards","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"timestamp","internalType":"uint256"},{"type":"address","name":"hodler","internalType":"address"},{"type":"uint256","name":"amount","internalType":"uint256"}],"name":"claims","inputs":[{"type":"uint256","name":"","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"combToken","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"getApproved","inputs":[{"type":"uint256","name":"tokenId","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"getClaimableAmount","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"getMintPrice","inputs":[{"type":"uint256","name":"amount","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256[]","name":"tokenIds","internalType":"uint256[]"},{"type":"address[]","name":"sellers","internalType":"address[]"},{"type":"uint256[]","name":"prices","internalType":"uint256[]"}],"name":"getOnSaleTokenIds","inputs":[{"type":"uint256","name":"start","internalType":"uint256"},{"type":"uint256","name":"end","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"initTimestamp","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"isApprovedForAll","inputs":[{"type":"address","name":"owner","internalType":"address"},{"type":"address","name":"operator","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"liquidityPool","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"marketplaceRoyalties","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"maxSupply","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"mintPrice","inputs":[]},{"type":"function","stateMutability":"payable","outputs":[],"name":"mintToken","inputs":[{"type":"uint256","name":"amount","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"string","name":"","internalType":"string"}],"name":"name","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"owner","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"ownerOf","inputs":[{"type":"uint256","name":"tokenId","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"ownerRoyalties","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"ownerTeam","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"pause","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"paused","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"putTokenForSale","inputs":[{"type":"uint256","name":"tokenId","internalType":"uint256"},{"type":"uint256","name":"price","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"renounceOwnership","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"royaltiesBips","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"safeTransferFrom","inputs":[{"type":"address","name":"from","internalType":"address"},{"type":"address","name":"to","internalType":"address"},{"type":"uint256","name":"tokenId","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"safeTransferFrom","inputs":[{"type":"address","name":"from","internalType":"address"},{"type":"address","name":"to","internalType":"address"},{"type":"uint256","name":"tokenId","internalType":"uint256"},{"type":"bytes","name":"_data","internalType":"bytes"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setApprovalForAll","inputs":[{"type":"address","name":"operator","internalType":"address"},{"type":"bool","name":"approved","internalType":"bool"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"supportsInterface","inputs":[{"type":"bytes4","name":"interfaceId","internalType":"bytes4"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"string","name":"","internalType":"string"}],"name":"symbol","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"tokenByIndex","inputs":[{"type":"uint256","name":"index","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"tokenNoLongerForSale","inputs":[{"type":"uint256","name":"tokenId","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"tokenOfOwnerByIndex","inputs":[{"type":"address","name":"owner","internalType":"address"},{"type":"uint256","name":"index","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"string","name":"","internalType":"string"}],"name":"tokenURI","inputs":[{"type":"uint256","name":"tokenId","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"isForSale","internalType":"bool"},{"type":"uint256","name":"tokenId","internalType":"uint256"},{"type":"address","name":"seller","internalType":"address"},{"type":"uint256","name":"price","internalType":"uint256"}],"name":"tokensForSale","inputs":[{"type":"uint256","name":"","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"tokensRemainingToAssign","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"totalSupply","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"transferFrom","inputs":[{"type":"address","name":"from","internalType":"address"},{"type":"address","name":"to","internalType":"address"},{"type":"uint256","name":"tokenId","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"transferOwnership","inputs":[{"type":"address","name":"newOwner","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"unpause","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"updateBaseURI","inputs":[{"type":"string","name":"_baseTokenURI","internalType":"string"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"updateClaimInterval","inputs":[{"type":"uint256","name":"_claimInterval","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"updateCombToken","inputs":[{"type":"address","name":"_combToken","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"updateInitTimestamp","inputs":[{"type":"uint256","name":"_initTimestamp","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"updateLiquidityPool","inputs":[{"type":"address","name":"_liquidityPool","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"updateMarketplaceRoyalties","inputs":[{"type":"address","name":"_marketplaceRoyalties","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"updateMintPrice","inputs":[{"type":"uint256","name":"_mintPrice","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"volume","inputs":[]},{"type":"receive","stateMutability":"payable"}]
            

Contract Creation Code

0x60806040523480156200001157600080fd5b50604051620046bb380380620046bb833981016040819052620000349162000302565b604080518082018252601281527143726f6e6f7353686167677947616c61787960701b60208083019182528351808501909452600384526243534760e81b90840152815191929162000089916000916200025c565b5080516200009f9060019060208401906200025c565b5050600b805460ff1916905550620000b73362000164565b8351620000cc90600d9060208701906200025c565b50600f839055600e8290556010829055601480546001600160a01b031990811673bdaab06205c6230801527b27b3f1dc1913293b1e1790915560158054821673face3f87a1762eeae31595d1b374765a9a00f6041790556016829055601780548216905560188054821690556019805490911690556362bf5240601a5562093a80601b556200015a620001be565b5050505062000447565b600b80546001600160a01b03838116610100818102610100600160a81b031985161790945560405193909204169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600b5460ff1615620002095760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b604482015260640160405180910390fd5b600b805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586200023f3390565b6040516001600160a01b03909116815260200160405180910390a1565b8280546200026a90620003f4565b90600052602060002090601f0160209004810192826200028e5760008555620002d9565b82601f10620002a957805160ff1916838001178555620002d9565b82800160010185558215620002d9579182015b82811115620002d9578251825591602001919060010190620002bc565b50620002e7929150620002eb565b5090565b5b80821115620002e75760008155600101620002ec565b6000806000806080858703121562000318578384fd5b84516001600160401b03808211156200032f578586fd5b818701915087601f83011262000343578586fd5b81518181111562000358576200035862000431565b604051601f8201601f19908116603f0116810190838211818310171562000383576200038362000431565b81604052828152602093508a848487010111156200039f578889fd5b8891505b82821015620003c25784820184015181830185015290830190620003a3565b82821115620003d357888484830101525b9289015160408a01516060909a0151939b909a509297509195505050505050565b6002810460018216806200040957607f821691505b602082108114156200042b57634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052604160045260246000fd5b61426480620004576000396000f3fe6080604052600436106103385760003560e01c8063715018a6116101ab578063b88d4fde116100f7578063d5abeb0111610095578063e985e9c51161006f578063e985e9c5146109c1578063ee88248914610a0a578063f2fde38b14610a2a578063fc60d90014610a4a5761033f565b8063d5abeb011461096b578063d9c0e8de14610981578063dd3cdf6c146109a15761033f565b8063c618a1e4116100d1578063c618a1e41461090d578063c634d03214610923578063c87b56dd14610936578063d547cfb7146109565761033f565b8063b88d4fde146108b8578063c354bd6e146108d8578063c4aa05cd146108ed5761033f565b80638da5cb5b11610164578063a22cb4651161013e578063a22cb465146107eb578063a80b96cd1461080b578063a888c2cd14610821578063aabe65e8146108895761033f565b80638da5cb5b14610792578063931688cb146107b657806395d89b41146107d65761033f565b8063715018a61461068f5780637358c57a146106a45780637ad503de146106ba5780638456cb59146106da57806387b37468146106ef5780638c2f5c17146107725761033f565b80632f745c5911610285578063559e775b11610223578063665a11ca116101fd578063665a11ca146106195780636817c76c146106395780636ae0ea731461064f57806370a082311461066f5761033f565b8063559e775b146105c15780635c975abb146105e15780636352211e146105f95761033f565b80633f4ba83a1161025f5780633f4ba83a1461054c57806342842e0e1461056157806344afc5c6146105815780634f6ccce7146105a15761033f565b80632f745c59146104f7578063372500ab14610517578063377e7c4e1461052c5761033f565b80630c01478b116102f257806318160ddd116102cc57806318160ddd1461048f578063206e8f32146104a457806323b872dd146104c45780632d296bf1146104e45761033f565b80630c01478b14610439578063109e3b6c14610459578063153e3248146104795761033f565b8062728e461461034457806301ffc9a71461036657806306fdde031461039b578063081812fc146103bd578063095ea7b3146103f55780630b433a12146104155761033f565b3661033f57005b600080fd5b34801561035057600080fd5b5061036461035f366004613c09565b610a6a565b005b34801561037257600080fd5b50610386610381366004613b8b565b610ae5565b60405190151581526020015b60405180910390f35b3480156103a757600080fd5b506103b0610af8565b6040516103929190613e1c565b3480156103c957600080fd5b506103dd6103d8366004613c09565b610b8a565b6040516001600160a01b039091168152602001610392565b34801561040157600080fd5b50610364610410366004613b46565b610c12565b34801561042157600080fd5b5061042b601b5481565b604051908152602001610392565b34801561044557600080fd5b50610364610454366004613c21565b610d28565b34801561046557600080fd5b50610364610474366004613c09565b610d4f565b34801561048557600080fd5b5061042b60105481565b34801561049b57600080fd5b5060085461042b565b3480156104b057600080fd5b506103646104bf366004613c09565b610e68565b3480156104d057600080fd5b506103646104df366004613a5c565b610e9d565b6103646104f2366004613c09565b610ece565b34801561050357600080fd5b5061042b610512366004613b46565b6111c8565b34801561052357600080fd5b5061036461125e565b34801561053857600080fd5b506015546103dd906001600160a01b031681565b34801561055857600080fd5b5061036461141e565b34801561056d57600080fd5b5061036461057c366004613a5c565b611497565b34801561058d57600080fd5b506017546103dd906001600160a01b031681565b3480156105ad57600080fd5b5061042b6105bc366004613c09565b6114b2565b3480156105cd57600080fd5b5061042b6105dc366004613c09565b611553565b3480156105ed57600080fd5b50600b5460ff16610386565b34801561060557600080fd5b506103dd610614366004613c09565b611563565b34801561062557600080fd5b506018546103dd906001600160a01b031681565b34801561064557600080fd5b5061042b600f5481565b34801561065b57600080fd5b5061036461066a366004613c09565b6115da565b34801561067b57600080fd5b5061042b61068a366004613a10565b61160f565b34801561069b57600080fd5b50610364611696565b3480156106b057600080fd5b5061042b601a5481565b3480156106c657600080fd5b506019546103dd906001600160a01b031681565b3480156106e657600080fd5b506103646116d0565b3480156106fb57600080fd5b5061074161070a366004613c09565b601360205260009081526040902080546001820154600283015460039093015460ff9092169290916001600160a01b039091169084565b6040516103929493929190931515845260208401929092526001600160a01b03166040830152606082015260800190565b34801561077e57600080fd5b5061036461078d366004613c21565b611708565b34801561079e57600080fd5b506103dd600b5461010090046001600160a01b031690565b3480156107c257600080fd5b506103646107d1366004613bc3565b611744565b3480156107e257600080fd5b506103b0611787565b3480156107f757600080fd5b50610364610806366004613b10565b611796565b34801561081757600080fd5b5061042b60165481565b34801561082d57600080fd5b5061086661083c366004613c09565b601c6020526000908152604090208054600182015460029092015490916001600160a01b03169083565b604080519384526001600160a01b03909216602084015290820152606001610392565b34801561089557600080fd5b506108a96108a4366004613c43565b6117a1565b60405161039293929190613daa565b3480156108c457600080fd5b506103646108d3366004613a97565b611a1a565b3480156108e457600080fd5b5061042b611a52565b3480156108f957600080fd5b506014546103dd906001600160a01b031681565b34801561091957600080fd5b5061042b60125481565b610364610931366004613c09565b611af0565b34801561094257600080fd5b506103b0610951366004613c09565b611c38565b34801561096257600080fd5b506103b0611c43565b34801561097757600080fd5b5061042b600e5481565b34801561098d57600080fd5b5061036461099c366004613a10565b611cd1565b3480156109ad57600080fd5b506103646109bc366004613a10565b611d23565b3480156109cd57600080fd5b506103866109dc366004613a2a565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205460ff1690565b348015610a1657600080fd5b50610364610a25366004613c43565b611d75565b348015610a3657600080fd5b50610364610a45366004613a10565b611f0a565b348015610a5657600080fd5b50610364610a65366004613a10565b611fa8565b600b546001600160a01b03610100909104163314610aa35760405162461bcd60e51b8152600401610a9a90613ecb565b60405180910390fd5b600f8190556040805182815233602082015281517f04acbbc6c2b9071a3acb31ab8882dee38db343ca813496ea6b9de1c6c2af535d929181900390910190a150565b6000610af082611ffa565b90505b919050565b606060008054610b079061415e565b80601f0160208091040260200160405190810160405280929190818152602001828054610b339061415e565b8015610b805780601f10610b5557610100808354040283529160200191610b80565b820191906000526020600020905b815481529060010190602001808311610b6357829003601f168201915b5050505050905090565b6000610b958261201f565b610bf65760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b6064820152608401610a9a565b506000908152600460205260409020546001600160a01b031690565b6000610c1d82611563565b9050806001600160a01b0316836001600160a01b03161415610c8b5760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b6064820152608401610a9a565b336001600160a01b0382161480610ca75750610ca781336109dc565b610d195760405162461bcd60e51b815260206004820152603860248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f7760448201527f6e6572206e6f7220617070726f76656420666f7220616c6c00000000000000006064820152608401610a9a565b610d23838361203c565b505050565b6014546001600160a01b03163314610d3f57600080fd5b610d4b828260016120aa565b5050565b3381610d5a8161201f565b610d765760405162461bcd60e51b8152600401610a9a90613e2f565b816001600160a01b0316610d8982611563565b6001600160a01b031614610daf5760405162461bcd60e51b8152600401610a9a90613f51565b604080516080810182526000808252602080830187815233848601818152606086018581528a86526013909452959093209351845460ff191690151517845551600184015592516002830180546001600160a01b0319166001600160a01b0390921691909117905591516003909101557fb6998174ef3af72dd2741f4fd4e8f4b763a51b73bffb3b595b48c2c648807501908490604080519283526001600160a01b0390911660208301520160405180910390a1505050565b600b546001600160a01b03610100909104163314610e985760405162461bcd60e51b8152600401610a9a90613ecb565b601b55565b610ea733826126fe565b610ec35760405162461bcd60e51b8152600401610a9a90613f00565b610d238383836127e8565b6000818152601360209081526040918290208251608081018452815460ff161515815260018201549281019290925260028101546001600160a01b0316928201929092526003909101546060820152610f268261201f565b610f425760405162461bcd60e51b8152600401610a9a90613e2f565b8051610f905760405162461bcd60e51b815260206004820152601b60248201527f43726f6e6f7353686167677947616c6178793a204e6f2053616c6500000000006044820152606401610a9a565b80606001513414610fef5760405162461bcd60e51b8152602060048201526024808201527f43726f6e6f7353686167677947616c6178793a20496e636f727265637420616d6044820152631bdd5b9d60e21b6064820152608401610a9a565b80604001516001600160a01b031661100683611563565b6001600160a01b03161461105c5760405162461bcd60e51b815260206004820152601e60248201527f43726f6e6f7353686167677947616c6178793a204e6f742073656c6c657200006044820152606401610a9a565b604081015161107c8133856040518060200160405280600081525061298f565b60008061108b346016546129c2565b9150915034601260008282546110a19190613fa2565b90915550506040516000906001600160a01b0385169084908381818185875af1925050503d80600081146110f1576040519150601f19603f3d011682016040523d82523d6000602084013e6110f6565b606091505b505090508061110457600080fd5b6019546040516000916001600160a01b03169084908381818185875af1925050503d8060008114611151576040519150601f19603f3d011682016040523d82523d6000602084013e611156565b606091505b505090508061116457600080fd5b60408051888152346020820152808201869052606081018590526001600160a01b03871660808201523360a082015290517f20a0b8ff795d0e9de798e46ad7f51b33f3c02dbce0c22af5206c6cedc3f9f9bc9181900360c00190a150505050505050565b60006111d38361160f565b82106112355760405162461bcd60e51b815260206004820152602b60248201527f455243373231456e756d657261626c653a206f776e657220696e646578206f7560448201526a74206f6620626f756e647360a81b6064820152608401610a9a565b506001600160a01b03919091166000908152600660209081526040808320938352929052205490565b42601a5411156112ba5760405162461bcd60e51b815260206004820152602160248201527f436c61696d696e6720697320636c6f73656420617420746865206d6f6d656e746044820152601760f91b6064820152608401610a9a565b60006112c53361160f565b116113125760405162461bcd60e51b815260206004820152601a60248201527f596f7520646f206e6f74206f776e20616e79205368616767792e0000000000006044820152606401610a9a565b600061131c6129f0565b9050600081116113855760405162461bcd60e51b815260206004820152602e60248201527f596f7520617265206e6f7420656c696769626c6520746f20636c61696d20616e60448201526d3c9021a927903932bbb0b932399760911b6064820152608401610a9a565b604051600090339083908381818185875af1925050503d80600081146113c7576040519150601f19603f3d011682016040523d82523d6000602084013e6113cc565b606091505b50509050806113da57600080fd5b604080514281523360208201529081018390527f72b7f576fbac8c4a57da18644ed0ae9bf73bb7dad927efa1d1b3d3023cf1a1919060600160405180910390a15050565b600b546001600160a01b0361010090910416331461144e5760405162461bcd60e51b8152600401610a9a90613ecb565b6017546001600160a01b031661146357600080fd5b6018546001600160a01b031661147857600080fd5b6019546001600160a01b031661148d57600080fd5b611495612b09565b565b610d2383838360405180602001604052806000815250611a1a565b60006114bd60085490565b82106115205760405162461bcd60e51b815260206004820152602c60248201527f455243373231456e756d657261626c653a20676c6f62616c20696e646578206f60448201526b7574206f6620626f756e647360a01b6064820152608401610a9a565b6008828154811061154157634e487b7160e01b600052603260045260246000fd5b90600052602060002001549050919050565b6000600f5482610af091906140e5565b6000818152600260205260408120546001600160a01b031680610af05760405162461bcd60e51b815260206004820152602960248201527f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460448201526832b73a103a37b5b2b760b91b6064820152608401610a9a565b600b546001600160a01b0361010090910416331461160a5760405162461bcd60e51b8152600401610a9a90613ecb565b601a55565b60006001600160a01b03821661167a5760405162461bcd60e51b815260206004820152602a60248201527f4552433732313a2062616c616e636520717565727920666f7220746865207a65604482015269726f206164647265737360b01b6064820152608401610a9a565b506001600160a01b031660009081526003602052604090205490565b600b546001600160a01b036101009091041633146116c65760405162461bcd60e51b8152600401610a9a90613ecb565b6114956000612b9c565b600b546001600160a01b036101009091041633146117005760405162461bcd60e51b8152600401610a9a90613ecb565b611495612bf6565b600b546001600160a01b036101009091041633146117385760405162461bcd60e51b8152600401610a9a90613ecb565b610d4b828260006120aa565b600b546001600160a01b036101009091041633146117745760405162461bcd60e51b8152600401610a9a90613ecb565b8051610d4b90600d9060208401906138ea565b606060018054610b079061415e565b610d4b338383612c71565b6060806060600084600e54116117b957600e546117bb565b845b90506000865b828110156118005760008181526013602052604090205460ff16156117ee57816117ea81614199565b9250505b806117f881614199565b9150506117c1565b5060008167ffffffffffffffff81111561182a57634e487b7160e01b600052604160045260246000fd5b604051908082528060200260200182016040528015611853578160200160208202803683370190505b50905060008267ffffffffffffffff81111561187f57634e487b7160e01b600052604160045260246000fd5b6040519080825280602002602001820160405280156118a8578160200160208202803683370190505b50905060008367ffffffffffffffff8111156118d457634e487b7160e01b600052604160045260246000fd5b6040519080825280602002602001820160405280156118fd578160200160208202803683370190505b50905060008a5b8a811015611a095760008181526013602052604090205460ff16156119f7578085838151811061194457634e487b7160e01b600052603260045260246000fd5b60209081029190910181019190915260008281526013909152604090206002015484516001600160a01b039091169085908490811061199357634e487b7160e01b600052603260045260246000fd5b6001600160a01b0390921660209283029190910182015260008281526013909152604090206003015483518490849081106119de57634e487b7160e01b600052603260045260246000fd5b6020908102919091010152816119f381614199565b9250505b80611a0181614199565b915050611904565b50929a919950975095505050505050565b611a2433836126fe565b611a405760405162461bcd60e51b8152600401610a9a90613f00565b611a4c8484848461298f565b50505050565b600080805b611a603361160f565b811015611aea576000611a7333836111c8565b6000818152601c602052604090205490915015801590611aae57506000818152601c6020526040902054601b544291611aab91612d40565b11155b15611ad7576000611ac747611ac260085490565b612d53565b9050611ad38482612d40565b9350505b5080611ae281614199565b915050611a57565b50905090565b42601a541115611b425760405162461bcd60e51b815260206004820181905260248201527f4d696e74696e6720697320636c6f73656420617420746865206d6f6d656e742e6044820152606401610a9a565b600a811115611bb95760405162461bcd60e51b815260206004820152603f60248201527f43726f6e6f7353686167677947616c6178793a20596f752063616e6e6f74206d60448201527f696e74206d6f7265207468616e203130204e465473207065722074696d652e006064820152608401610a9a565b34611bc382611553565b14611c295760405162461bcd60e51b815260206004820152603060248201527f43726f6e6f7353686167677947616c6178793a205061796d656e7420616d6f7560448201526f373a1034b99034b731b7b93932b1ba1760811b6064820152608401610a9a565b611c35813360016120aa565b50565b6060610af082612d5f565b600d8054611c509061415e565b80601f0160208091040260200160405190810160405280929190818152602001828054611c7c9061415e565b8015611cc95780601f10611c9e57610100808354040283529160200191611cc9565b820191906000526020600020905b815481529060010190602001808311611cac57829003601f168201915b505050505081565b600b546001600160a01b03610100909104163314611d015760405162461bcd60e51b8152600401610a9a90613ecb565b601780546001600160a01b0319166001600160a01b0392909216919091179055565b600b546001600160a01b03610100909104163314611d535760405162461bcd60e51b8152600401610a9a90613ecb565b601880546001600160a01b0319166001600160a01b0392909216919091179055565b3382611d808161201f565b611d9c5760405162461bcd60e51b8152600401610a9a90613e2f565b816001600160a01b0316611daf82611563565b6001600160a01b031614611dd55760405162461bcd60e51b8152600401610a9a90613f51565b82611e395760405162461bcd60e51b815260206004820152602e60248201527f43726f6e6f7353686167677947616c6178793a2043616e6e6f7420707574207a60448201526d65726f206173206120707269636560901b6064820152608401610a9a565b604080516080810182526001815260208101869052908101336001600160a01b03908116825260209182018690526000878152601383526040908190208451815460ff19169015151781559284015160018401558301516002830180546001600160a01b031916919092161790556060909101516003909101557f36f8215cc1ab61ba3318dad623f5fc4dba513a9107815306c3d86e74ba46307a8484611edd3390565b6040805193845260208401929092526001600160a01b03169082015260600160405180910390a150505050565b600b546001600160a01b03610100909104163314611f3a5760405162461bcd60e51b8152600401610a9a90613ecb565b6001600160a01b038116611f9f5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610a9a565b611c3581612b9c565b600b546001600160a01b03610100909104163314611fd85760405162461bcd60e51b8152600401610a9a90613ecb565b601980546001600160a01b0319166001600160a01b0392909216919091179055565b60006001600160e01b0319821663780e9d6360e01b1480610af05750610af082612ec2565b6000908152600260205260409020546001600160a01b0316151590565b600081815260046020526040902080546001600160a01b0319166001600160a01b038416908117909155819061207182611563565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b600e54600854106121115760405162461bcd60e51b815260206004820152602b60248201527f43726f6e6f7353686167677947616c6178793a2053616c652068617320616c7260448201526a32b0b23c9032b73232b21760a91b6064820152608401610a9a565b600083116121755760405162461bcd60e51b815260206004820152602b60248201527f43726f6e6f7353686167677947616c6178793a20596f752063616e6e6f74206d60448201526a34b73a10181027333a399760a91b6064820152608401610a9a565b600e5461218a61218460085490565b85612d40565b11156122105760405162461bcd60e51b815260206004820152604960248201527f43726f6e6f7353686167677947616c6178793a2045786365656473206d61786960448201527f6d756d20737570706c792e20506c656173652074727920746f206d696e74206c60648201526832b9b99027333a399760b91b608482015260a401610a9a565b60008367ffffffffffffffff81111561223957634e487b7160e01b600052604160045260246000fd5b604051908082528060200260200182016040528015612262578160200160208202803683370190505b50905060005b848110156123a6576000601054846122825760085461228d565b61228d601054612f12565b61229791906141b4565b905060006122c26122bb6010600081546122b090614147565b918290555084613006565b6001612d40565b90506122d2600c80546001019055565b6122dc868261307d565b61230d816122e983613097565b6040516020016122f99190613d1a565b6040516020818303038152906040526131b2565b8084848151811061232e57634e487b7160e01b600052603260045260246000fd5b60209081029190910181019190915260408051606081018252428152338184019081526000828401818152958152601c9094529190922091518255516001820180546001600160a01b0319166001600160a01b039092169190911790559051600290910155508061239e81614199565b915050612268565b5060006123b4346003612d53565b6014549091506000906001600160a01b03166123db6123d4606485613fba565b605561323d565b604051600081818185875af1925050503d8060008114612417576040519150601f19603f3d011682016040523d82523d6000602084013e61241c565b606091505b505090508061242a57600080fd5b6015546000906001600160a01b031661244e612447606486613fba565b600f61323d565b604051600081818185875af1925050503d806000811461248a576040519150601f19603f3d011682016040523d82523d6000602084013e61248f565b606091505b505090508061249d57600080fd5b6018546040516000916001600160a01b03169085908381818185875af1925050503d80600081146124ea576040519150601f19603f3d011682016040523d82523d6000602084013e6124ef565b606091505b50509050806124fd57600080fd5b60006125a5601760009054906101000a90046001600160a01b03166001600160a01b031663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b15801561255057600080fd5b505afa158015612564573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125889190613c64565b61259390600a614014565b61259f906109c46140e5565b8a61323d565b60175460405163095ea7b360e01b8152306004820152602481018390529192506001600160a01b03169063095ea7b390604401602060405180830381600087803b1580156125f257600080fd5b505af1158015612606573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061262a9190613b6f565b506017546018546040516323b872dd60e01b81523060048201526001600160a01b039182166024820152604481018490529116906323b872dd90606401602060405180830381600087803b15801561268157600080fd5b505af1158015612695573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906126b99190613b6f565b507fbc07a750767f513de2b3356e24037db0e90c9e5cdaa0d757c7e628c3d82e8f1286336040516126eb929190613d80565b60405180910390a1505050505050505050565b60006127098261201f565b61276a5760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b6064820152608401610a9a565b600061277583611563565b9050806001600160a01b0316846001600160a01b031614806127bc57506001600160a01b0380821660009081526005602090815260408083209388168352929052205460ff165b806127e05750836001600160a01b03166127d584610b8a565b6001600160a01b0316145b949350505050565b826001600160a01b03166127fb82611563565b6001600160a01b03161461285f5760405162461bcd60e51b815260206004820152602560248201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060448201526437bbb732b960d91b6064820152608401610a9a565b6001600160a01b0382166128c15760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b6064820152608401610a9a565b6128cc838383613249565b6128d760008261203c565b6001600160a01b0383166000908152600360205260408120805460019290612900908490614104565b90915550506001600160a01b038216600090815260036020526040812080546001929061292e908490613fa2565b909155505060008181526002602052604080822080546001600160a01b0319166001600160a01b0386811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4610d23565b61299a8484846127e8565b6129a68484848461330e565b611a4c5760405162461bcd60e51b8152600401610a9a90613e79565b6000806129db6127106129d5868661323d565b90612d53565b90506129e7848261341b565b91509250929050565b600080805b6129fe3361160f565b811015611aea576000612a1133836111c8565b6000818152601c602052604090205490915015801590612a4c57506000818152601c6020526040902054601b544291612a4991612d40565b11155b15612af6576000612a6047611ac260085490565b9050612a6c8482612d40565b93506040518060600160405280428152602001336001600160a01b03168152602001612aae601c60008681526020019081526020016000206002015484612d40565b90526000838152601c602090815260409182902083518155908301516001820180546001600160a01b0319166001600160a01b03909216919091179055910151600290910155505b5080612b0181614199565b9150506129f5565b600b5460ff16612b525760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b6044820152606401610a9a565b600b805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b600b80546001600160a01b03838116610100818102610100600160a81b031985161790945560405193909204169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600b5460ff1615612c3c5760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b6044820152606401610a9a565b600b805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258612b7f3390565b816001600160a01b0316836001600160a01b03161415612cd35760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c6572000000000000006044820152606401610a9a565b6001600160a01b03838116600081815260056020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b6000612d4c8284613fa2565b9392505050565b6000612d4c8284613fba565b6060612d6a8261201f565b612dd05760405162461bcd60e51b815260206004820152603160248201527f45524337323155524953746f726167653a2055524920717565727920666f72206044820152703737b732bc34b9ba32b73a103a37b5b2b760791b6064820152608401610a9a565b6000828152600a602052604081208054612de99061415e565b80601f0160208091040260200160405190810160405280929190818152602001828054612e159061415e565b8015612e625780601f10612e3757610100808354040283529160200191612e62565b820191906000526020600020905b815481529060010190602001808311612e4557829003601f168201915b505050505090506000612e73613427565b9050805160001415612e8757509050610af3565b815115612eb9578082604051602001612ea1929190613ceb565b60405160208183030381529060405292505050610af3565b6127e084613436565b60006001600160e01b031982166380ac58cd60e01b1480612ef357506001600160e01b03198216635b5e139f60e01b145b80610af057506301ffc9a760e01b6001600160e01b0319831614610af0565b6040516bffffffffffffffffffffffff193360601b166020820152600090829042906034016040516020818303038152906040528051906020012060001c612f5a9190613fba565b6040516bffffffffffffffffffffffff194160601b16602082015242906034016040516020818303038152906040528051906020012060001c612f9d9190613fba565b4345612fa94442613fa2565b612fb39190613fa2565b612fbd9190613fa2565b612fc79190613fa2565b612fd19190613fa2565b604051602001612fe391815260200190565b6040516020818303038152906040528051906020012060001c610af09190613fba565b60008281526011602052604081205483901561302d57506000838152601160205260409020545b6000848152601160205260408082208590558482529020541561306157600083815260116020526040808220548683529120555b6000928352601160205260408084209190915592825250205490565b610d4b828260405180602001604052806000815250613500565b6060816130bc57506040805180820190915260018152600360fc1b6020820152610af3565b8160005b81156130e657806130d081614199565b91506130df9050600a83613fba565b91506130c0565b60008167ffffffffffffffff81111561310f57634e487b7160e01b600052604160045260246000fd5b6040519080825280601f01601f191660200182016040528015613139576020820181803683370190505b5090505b84156127e05761314e600183614104565b915061315b600a866141b4565b613166906030613fa2565b60f81b81838151811061318957634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a9053506131ab600a86613fba565b945061313d565b6131bb8261201f565b61321e5760405162461bcd60e51b815260206004820152602e60248201527f45524337323155524953746f726167653a2055524920736574206f66206e6f6e60448201526d32bc34b9ba32b73a103a37b5b2b760911b6064820152608401610a9a565b6000828152600a602090815260409091208251610d23928401906138ea565b6000612d4c82846140e5565b600b5460ff161561328f5760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b6044820152606401610a9a565b61329a838383613533565b6040805160808101825260008082526020808301858152838501838152606085018481529684526013909252939091209151825460ff19169015151782559151600182015590516002820180546001600160a01b0319166001600160a01b0390921691909117905590516003909101555050565b60006001600160a01b0384163b1561341057604051630a85bd0160e11b81526001600160a01b0385169063150b7a0290613352903390899088908890600401613d43565b602060405180830381600087803b15801561336c57600080fd5b505af192505050801561339c575060408051601f3d908101601f1916820190925261339991810190613ba7565b60015b6133f6573d8080156133ca576040519150601f19603f3d011682016040523d82523d6000602084013e6133cf565b606091505b5080516133ee5760405162461bcd60e51b8152600401610a9a90613e79565b805181602001fd5b6001600160e01b031916630a85bd0160e11b1490506127e0565b506001949350505050565b6000612d4c8284614104565b6060600d8054610b079061415e565b60606134418261201f565b6134a55760405162461bcd60e51b815260206004820152602f60248201527f4552433732314d657461646174613a2055524920717565727920666f72206e6f60448201526e3732bc34b9ba32b73a103a37b5b2b760891b6064820152608401610a9a565b60006134af613427565b905060008151116134cf5760405180602001604052806000815250612d4c565b806134d984613097565b6040516020016134ea929190613ceb565b6040516020818303038152906040529392505050565b61350a83836135f0565b613517600084848461330e565b610d235760405162461bcd60e51b8152600401610a9a90613e79565b6001600160a01b03831661358e5761358981600880546000838152600960205260408120829055600182018355919091527ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee30155565b6135b1565b816001600160a01b0316836001600160a01b0316146135b1576135b18382613730565b6001600160a01b0382166135cd576135c8816137cd565b610d23565b826001600160a01b0316826001600160a01b031614610d2357610d2382826138a6565b6001600160a01b0382166136465760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f20616464726573736044820152606401610a9a565b61364f8161201f565b1561369c5760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152606401610a9a565b6136a860008383613249565b6001600160a01b03821660009081526003602052604081208054600192906136d1908490613fa2565b909155505060008181526002602052604080822080546001600160a01b0319166001600160a01b03861690811790915590518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a4610d4b565b6000600161373d8461160f565b6137479190614104565b60008381526007602052604090205490915080821461379a576001600160a01b03841660009081526006602090815260408083208584528252808320548484528184208190558352600790915290208190555b5060009182526007602090815260408084208490556001600160a01b039094168352600681528383209183525290812055565b6008546000906137df90600190614104565b6000838152600960205260408120546008805493945090928490811061381557634e487b7160e01b600052603260045260246000fd5b90600052602060002001549050806008838154811061384457634e487b7160e01b600052603260045260246000fd5b600091825260208083209091019290925582815260099091526040808220849055858252812055600880548061388a57634e487b7160e01b600052603160045260246000fd5b6001900381819060005260206000200160009055905550505050565b60006138b18361160f565b6001600160a01b039093166000908152600660209081526040808320868452825280832085905593825260079052919091209190915550565b8280546138f69061415e565b90600052602060002090601f016020900481019282613918576000855561395e565b82601f1061393157805160ff191683800117855561395e565b8280016001018555821561395e579182015b8281111561395e578251825591602001919060010190613943565b5061396a92915061396e565b5090565b5b8082111561396a576000815560010161396f565b600067ffffffffffffffff8084111561399e5761399e6141f4565b604051601f8501601f19908116603f011681019082821181831017156139c6576139c66141f4565b816040528093508581528686860111156139df57600080fd5b858560208301376000602087830101525050509392505050565b80356001600160a01b0381168114610af357600080fd5b600060208284031215613a21578081fd5b612d4c826139f9565b60008060408385031215613a3c578081fd5b613a45836139f9565b9150613a53602084016139f9565b90509250929050565b600080600060608486031215613a70578081fd5b613a79846139f9565b9250613a87602085016139f9565b9150604084013590509250925092565b60008060008060808587031215613aac578081fd5b613ab5856139f9565b9350613ac3602086016139f9565b925060408501359150606085013567ffffffffffffffff811115613ae5578182fd5b8501601f81018713613af5578182fd5b613b0487823560208401613983565b91505092959194509250565b60008060408385031215613b22578182fd5b613b2b836139f9565b91506020830135613b3b8161420a565b809150509250929050565b60008060408385031215613b58578182fd5b613b61836139f9565b946020939093013593505050565b600060208284031215613b80578081fd5b8151612d4c8161420a565b600060208284031215613b9c578081fd5b8135612d4c81614218565b600060208284031215613bb8578081fd5b8151612d4c81614218565b600060208284031215613bd4578081fd5b813567ffffffffffffffff811115613bea578182fd5b8201601f81018413613bfa578182fd5b6127e084823560208401613983565b600060208284031215613c1a578081fd5b5035919050565b60008060408385031215613c33578182fd5b82359150613a53602084016139f9565b60008060408385031215613c55578182fd5b50508035926020909101359150565b600060208284031215613c75578081fd5b815160ff81168114612d4c578182fd5b6000815180845260208085019450808401835b83811015613cb457815187529582019590820190600101613c98565b509495945050505050565b60008151808452613cd781602086016020860161411b565b601f01601f19169290920160200192915050565b60008351613cfd81846020880161411b565b835190830190613d1181836020880161411b565b01949350505050565b60008251613d2c81846020870161411b565b64173539b7b760d91b920191825250600501919050565b6001600160a01b0385811682528416602082015260408101839052608060608201819052600090613d7690830184613cbf565b9695505050505050565b600060408252613d936040830185613c85565b905060018060a01b03831660208301529392505050565b600060608252613dbd6060830186613c85565b828103602084810191909152855180835286820192820190845b81811015613dfc5784516001600160a01b031683529383019391830191600101613dd7565b50508481036040860152613e108187613c85565b98975050505050505050565b600060208252612d4c6020830184613cbf565b6020808252602a908201527f43726f6e6f7353686167677947616c6178793a20546f6b656e496420646f6573604082015269081b9bdd08195e1a5cdd60b21b606082015260800190565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60208082526031908201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f6040820152701ddb995c881b9bdc88185c1c1c9bdd9959607a1b606082015260800190565b60208082526031908201527f43726f6e6f7353686167677947616c6178793a20546f6b656e20646f6573206e60408201527037ba103132b637b733903a37903ab9b2b960791b606082015260800190565b60008219821115613fb557613fb56141c8565b500190565b600082613fc957613fc96141de565b500490565b80825b6001808611613fe0575061400b565b818704821115613ff257613ff26141c8565b80861615613fff57918102915b9490941c938002613fd1565b94509492505050565b6000612d4c60001960ff85168460008261403057506001612d4c565b8161403d57506000612d4c565b8160018114614053576002811461405d5761408a565b6001915050612d4c565b60ff84111561406e5761406e6141c8565b6001841b915084821115614084576140846141c8565b50612d4c565b5060208310610133831016604e8410600b84101617156140bd575081810a838111156140b8576140b86141c8565b612d4c565b6140ca8484846001613fce565b8086048211156140dc576140dc6141c8565b02949350505050565b60008160001904831182151516156140ff576140ff6141c8565b500290565b600082821015614116576141166141c8565b500390565b60005b8381101561413657818101518382015260200161411e565b83811115611a4c5750506000910152565b600081614156576141566141c8565b506000190190565b60028104600182168061417257607f821691505b6020821081141561419357634e487b7160e01b600052602260045260246000fd5b50919050565b60006000198214156141ad576141ad6141c8565b5060010190565b6000826141c3576141c36141de565b500690565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b8015158114611c3557600080fd5b6001600160e01b031981168114611c3557600080fdfea2646970667358221220b0bc90060eeb6846de6b85e9c8b48fcb736e4e5b89574d86d8833be739d5708c64736f6c63430008020033000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000821ab0d4414980000000000000000000000000000000000000000000000000000000000000000271000000000000000000000000000000000000000000000000000000000000002ee000000000000000000000000000000000000000000000000000000000000004068747470733a2f2f617277656176652e6e65742f364b63506e4e703966504f7475385f394a49454c3570754653593462756364497038506c583937577470672f

Deployed ByteCode

0x6080604052600436106103385760003560e01c8063715018a6116101ab578063b88d4fde116100f7578063d5abeb0111610095578063e985e9c51161006f578063e985e9c5146109c1578063ee88248914610a0a578063f2fde38b14610a2a578063fc60d90014610a4a5761033f565b8063d5abeb011461096b578063d9c0e8de14610981578063dd3cdf6c146109a15761033f565b8063c618a1e4116100d1578063c618a1e41461090d578063c634d03214610923578063c87b56dd14610936578063d547cfb7146109565761033f565b8063b88d4fde146108b8578063c354bd6e146108d8578063c4aa05cd146108ed5761033f565b80638da5cb5b11610164578063a22cb4651161013e578063a22cb465146107eb578063a80b96cd1461080b578063a888c2cd14610821578063aabe65e8146108895761033f565b80638da5cb5b14610792578063931688cb146107b657806395d89b41146107d65761033f565b8063715018a61461068f5780637358c57a146106a45780637ad503de146106ba5780638456cb59146106da57806387b37468146106ef5780638c2f5c17146107725761033f565b80632f745c5911610285578063559e775b11610223578063665a11ca116101fd578063665a11ca146106195780636817c76c146106395780636ae0ea731461064f57806370a082311461066f5761033f565b8063559e775b146105c15780635c975abb146105e15780636352211e146105f95761033f565b80633f4ba83a1161025f5780633f4ba83a1461054c57806342842e0e1461056157806344afc5c6146105815780634f6ccce7146105a15761033f565b80632f745c59146104f7578063372500ab14610517578063377e7c4e1461052c5761033f565b80630c01478b116102f257806318160ddd116102cc57806318160ddd1461048f578063206e8f32146104a457806323b872dd146104c45780632d296bf1146104e45761033f565b80630c01478b14610439578063109e3b6c14610459578063153e3248146104795761033f565b8062728e461461034457806301ffc9a71461036657806306fdde031461039b578063081812fc146103bd578063095ea7b3146103f55780630b433a12146104155761033f565b3661033f57005b600080fd5b34801561035057600080fd5b5061036461035f366004613c09565b610a6a565b005b34801561037257600080fd5b50610386610381366004613b8b565b610ae5565b60405190151581526020015b60405180910390f35b3480156103a757600080fd5b506103b0610af8565b6040516103929190613e1c565b3480156103c957600080fd5b506103dd6103d8366004613c09565b610b8a565b6040516001600160a01b039091168152602001610392565b34801561040157600080fd5b50610364610410366004613b46565b610c12565b34801561042157600080fd5b5061042b601b5481565b604051908152602001610392565b34801561044557600080fd5b50610364610454366004613c21565b610d28565b34801561046557600080fd5b50610364610474366004613c09565b610d4f565b34801561048557600080fd5b5061042b60105481565b34801561049b57600080fd5b5060085461042b565b3480156104b057600080fd5b506103646104bf366004613c09565b610e68565b3480156104d057600080fd5b506103646104df366004613a5c565b610e9d565b6103646104f2366004613c09565b610ece565b34801561050357600080fd5b5061042b610512366004613b46565b6111c8565b34801561052357600080fd5b5061036461125e565b34801561053857600080fd5b506015546103dd906001600160a01b031681565b34801561055857600080fd5b5061036461141e565b34801561056d57600080fd5b5061036461057c366004613a5c565b611497565b34801561058d57600080fd5b506017546103dd906001600160a01b031681565b3480156105ad57600080fd5b5061042b6105bc366004613c09565b6114b2565b3480156105cd57600080fd5b5061042b6105dc366004613c09565b611553565b3480156105ed57600080fd5b50600b5460ff16610386565b34801561060557600080fd5b506103dd610614366004613c09565b611563565b34801561062557600080fd5b506018546103dd906001600160a01b031681565b34801561064557600080fd5b5061042b600f5481565b34801561065b57600080fd5b5061036461066a366004613c09565b6115da565b34801561067b57600080fd5b5061042b61068a366004613a10565b61160f565b34801561069b57600080fd5b50610364611696565b3480156106b057600080fd5b5061042b601a5481565b3480156106c657600080fd5b506019546103dd906001600160a01b031681565b3480156106e657600080fd5b506103646116d0565b3480156106fb57600080fd5b5061074161070a366004613c09565b601360205260009081526040902080546001820154600283015460039093015460ff9092169290916001600160a01b039091169084565b6040516103929493929190931515845260208401929092526001600160a01b03166040830152606082015260800190565b34801561077e57600080fd5b5061036461078d366004613c21565b611708565b34801561079e57600080fd5b506103dd600b5461010090046001600160a01b031690565b3480156107c257600080fd5b506103646107d1366004613bc3565b611744565b3480156107e257600080fd5b506103b0611787565b3480156107f757600080fd5b50610364610806366004613b10565b611796565b34801561081757600080fd5b5061042b60165481565b34801561082d57600080fd5b5061086661083c366004613c09565b601c6020526000908152604090208054600182015460029092015490916001600160a01b03169083565b604080519384526001600160a01b03909216602084015290820152606001610392565b34801561089557600080fd5b506108a96108a4366004613c43565b6117a1565b60405161039293929190613daa565b3480156108c457600080fd5b506103646108d3366004613a97565b611a1a565b3480156108e457600080fd5b5061042b611a52565b3480156108f957600080fd5b506014546103dd906001600160a01b031681565b34801561091957600080fd5b5061042b60125481565b610364610931366004613c09565b611af0565b34801561094257600080fd5b506103b0610951366004613c09565b611c38565b34801561096257600080fd5b506103b0611c43565b34801561097757600080fd5b5061042b600e5481565b34801561098d57600080fd5b5061036461099c366004613a10565b611cd1565b3480156109ad57600080fd5b506103646109bc366004613a10565b611d23565b3480156109cd57600080fd5b506103866109dc366004613a2a565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205460ff1690565b348015610a1657600080fd5b50610364610a25366004613c43565b611d75565b348015610a3657600080fd5b50610364610a45366004613a10565b611f0a565b348015610a5657600080fd5b50610364610a65366004613a10565b611fa8565b600b546001600160a01b03610100909104163314610aa35760405162461bcd60e51b8152600401610a9a90613ecb565b60405180910390fd5b600f8190556040805182815233602082015281517f04acbbc6c2b9071a3acb31ab8882dee38db343ca813496ea6b9de1c6c2af535d929181900390910190a150565b6000610af082611ffa565b90505b919050565b606060008054610b079061415e565b80601f0160208091040260200160405190810160405280929190818152602001828054610b339061415e565b8015610b805780601f10610b5557610100808354040283529160200191610b80565b820191906000526020600020905b815481529060010190602001808311610b6357829003601f168201915b5050505050905090565b6000610b958261201f565b610bf65760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b6064820152608401610a9a565b506000908152600460205260409020546001600160a01b031690565b6000610c1d82611563565b9050806001600160a01b0316836001600160a01b03161415610c8b5760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b6064820152608401610a9a565b336001600160a01b0382161480610ca75750610ca781336109dc565b610d195760405162461bcd60e51b815260206004820152603860248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f7760448201527f6e6572206e6f7220617070726f76656420666f7220616c6c00000000000000006064820152608401610a9a565b610d23838361203c565b505050565b6014546001600160a01b03163314610d3f57600080fd5b610d4b828260016120aa565b5050565b3381610d5a8161201f565b610d765760405162461bcd60e51b8152600401610a9a90613e2f565b816001600160a01b0316610d8982611563565b6001600160a01b031614610daf5760405162461bcd60e51b8152600401610a9a90613f51565b604080516080810182526000808252602080830187815233848601818152606086018581528a86526013909452959093209351845460ff191690151517845551600184015592516002830180546001600160a01b0319166001600160a01b0390921691909117905591516003909101557fb6998174ef3af72dd2741f4fd4e8f4b763a51b73bffb3b595b48c2c648807501908490604080519283526001600160a01b0390911660208301520160405180910390a1505050565b600b546001600160a01b03610100909104163314610e985760405162461bcd60e51b8152600401610a9a90613ecb565b601b55565b610ea733826126fe565b610ec35760405162461bcd60e51b8152600401610a9a90613f00565b610d238383836127e8565b6000818152601360209081526040918290208251608081018452815460ff161515815260018201549281019290925260028101546001600160a01b0316928201929092526003909101546060820152610f268261201f565b610f425760405162461bcd60e51b8152600401610a9a90613e2f565b8051610f905760405162461bcd60e51b815260206004820152601b60248201527f43726f6e6f7353686167677947616c6178793a204e6f2053616c6500000000006044820152606401610a9a565b80606001513414610fef5760405162461bcd60e51b8152602060048201526024808201527f43726f6e6f7353686167677947616c6178793a20496e636f727265637420616d6044820152631bdd5b9d60e21b6064820152608401610a9a565b80604001516001600160a01b031661100683611563565b6001600160a01b03161461105c5760405162461bcd60e51b815260206004820152601e60248201527f43726f6e6f7353686167677947616c6178793a204e6f742073656c6c657200006044820152606401610a9a565b604081015161107c8133856040518060200160405280600081525061298f565b60008061108b346016546129c2565b9150915034601260008282546110a19190613fa2565b90915550506040516000906001600160a01b0385169084908381818185875af1925050503d80600081146110f1576040519150601f19603f3d011682016040523d82523d6000602084013e6110f6565b606091505b505090508061110457600080fd5b6019546040516000916001600160a01b03169084908381818185875af1925050503d8060008114611151576040519150601f19603f3d011682016040523d82523d6000602084013e611156565b606091505b505090508061116457600080fd5b60408051888152346020820152808201869052606081018590526001600160a01b03871660808201523360a082015290517f20a0b8ff795d0e9de798e46ad7f51b33f3c02dbce0c22af5206c6cedc3f9f9bc9181900360c00190a150505050505050565b60006111d38361160f565b82106112355760405162461bcd60e51b815260206004820152602b60248201527f455243373231456e756d657261626c653a206f776e657220696e646578206f7560448201526a74206f6620626f756e647360a81b6064820152608401610a9a565b506001600160a01b03919091166000908152600660209081526040808320938352929052205490565b42601a5411156112ba5760405162461bcd60e51b815260206004820152602160248201527f436c61696d696e6720697320636c6f73656420617420746865206d6f6d656e746044820152601760f91b6064820152608401610a9a565b60006112c53361160f565b116113125760405162461bcd60e51b815260206004820152601a60248201527f596f7520646f206e6f74206f776e20616e79205368616767792e0000000000006044820152606401610a9a565b600061131c6129f0565b9050600081116113855760405162461bcd60e51b815260206004820152602e60248201527f596f7520617265206e6f7420656c696769626c6520746f20636c61696d20616e60448201526d3c9021a927903932bbb0b932399760911b6064820152608401610a9a565b604051600090339083908381818185875af1925050503d80600081146113c7576040519150601f19603f3d011682016040523d82523d6000602084013e6113cc565b606091505b50509050806113da57600080fd5b604080514281523360208201529081018390527f72b7f576fbac8c4a57da18644ed0ae9bf73bb7dad927efa1d1b3d3023cf1a1919060600160405180910390a15050565b600b546001600160a01b0361010090910416331461144e5760405162461bcd60e51b8152600401610a9a90613ecb565b6017546001600160a01b031661146357600080fd5b6018546001600160a01b031661147857600080fd5b6019546001600160a01b031661148d57600080fd5b611495612b09565b565b610d2383838360405180602001604052806000815250611a1a565b60006114bd60085490565b82106115205760405162461bcd60e51b815260206004820152602c60248201527f455243373231456e756d657261626c653a20676c6f62616c20696e646578206f60448201526b7574206f6620626f756e647360a01b6064820152608401610a9a565b6008828154811061154157634e487b7160e01b600052603260045260246000fd5b90600052602060002001549050919050565b6000600f5482610af091906140e5565b6000818152600260205260408120546001600160a01b031680610af05760405162461bcd60e51b815260206004820152602960248201527f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460448201526832b73a103a37b5b2b760b91b6064820152608401610a9a565b600b546001600160a01b0361010090910416331461160a5760405162461bcd60e51b8152600401610a9a90613ecb565b601a55565b60006001600160a01b03821661167a5760405162461bcd60e51b815260206004820152602a60248201527f4552433732313a2062616c616e636520717565727920666f7220746865207a65604482015269726f206164647265737360b01b6064820152608401610a9a565b506001600160a01b031660009081526003602052604090205490565b600b546001600160a01b036101009091041633146116c65760405162461bcd60e51b8152600401610a9a90613ecb565b6114956000612b9c565b600b546001600160a01b036101009091041633146117005760405162461bcd60e51b8152600401610a9a90613ecb565b611495612bf6565b600b546001600160a01b036101009091041633146117385760405162461bcd60e51b8152600401610a9a90613ecb565b610d4b828260006120aa565b600b546001600160a01b036101009091041633146117745760405162461bcd60e51b8152600401610a9a90613ecb565b8051610d4b90600d9060208401906138ea565b606060018054610b079061415e565b610d4b338383612c71565b6060806060600084600e54116117b957600e546117bb565b845b90506000865b828110156118005760008181526013602052604090205460ff16156117ee57816117ea81614199565b9250505b806117f881614199565b9150506117c1565b5060008167ffffffffffffffff81111561182a57634e487b7160e01b600052604160045260246000fd5b604051908082528060200260200182016040528015611853578160200160208202803683370190505b50905060008267ffffffffffffffff81111561187f57634e487b7160e01b600052604160045260246000fd5b6040519080825280602002602001820160405280156118a8578160200160208202803683370190505b50905060008367ffffffffffffffff8111156118d457634e487b7160e01b600052604160045260246000fd5b6040519080825280602002602001820160405280156118fd578160200160208202803683370190505b50905060008a5b8a811015611a095760008181526013602052604090205460ff16156119f7578085838151811061194457634e487b7160e01b600052603260045260246000fd5b60209081029190910181019190915260008281526013909152604090206002015484516001600160a01b039091169085908490811061199357634e487b7160e01b600052603260045260246000fd5b6001600160a01b0390921660209283029190910182015260008281526013909152604090206003015483518490849081106119de57634e487b7160e01b600052603260045260246000fd5b6020908102919091010152816119f381614199565b9250505b80611a0181614199565b915050611904565b50929a919950975095505050505050565b611a2433836126fe565b611a405760405162461bcd60e51b8152600401610a9a90613f00565b611a4c8484848461298f565b50505050565b600080805b611a603361160f565b811015611aea576000611a7333836111c8565b6000818152601c602052604090205490915015801590611aae57506000818152601c6020526040902054601b544291611aab91612d40565b11155b15611ad7576000611ac747611ac260085490565b612d53565b9050611ad38482612d40565b9350505b5080611ae281614199565b915050611a57565b50905090565b42601a541115611b425760405162461bcd60e51b815260206004820181905260248201527f4d696e74696e6720697320636c6f73656420617420746865206d6f6d656e742e6044820152606401610a9a565b600a811115611bb95760405162461bcd60e51b815260206004820152603f60248201527f43726f6e6f7353686167677947616c6178793a20596f752063616e6e6f74206d60448201527f696e74206d6f7265207468616e203130204e465473207065722074696d652e006064820152608401610a9a565b34611bc382611553565b14611c295760405162461bcd60e51b815260206004820152603060248201527f43726f6e6f7353686167677947616c6178793a205061796d656e7420616d6f7560448201526f373a1034b99034b731b7b93932b1ba1760811b6064820152608401610a9a565b611c35813360016120aa565b50565b6060610af082612d5f565b600d8054611c509061415e565b80601f0160208091040260200160405190810160405280929190818152602001828054611c7c9061415e565b8015611cc95780601f10611c9e57610100808354040283529160200191611cc9565b820191906000526020600020905b815481529060010190602001808311611cac57829003601f168201915b505050505081565b600b546001600160a01b03610100909104163314611d015760405162461bcd60e51b8152600401610a9a90613ecb565b601780546001600160a01b0319166001600160a01b0392909216919091179055565b600b546001600160a01b03610100909104163314611d535760405162461bcd60e51b8152600401610a9a90613ecb565b601880546001600160a01b0319166001600160a01b0392909216919091179055565b3382611d808161201f565b611d9c5760405162461bcd60e51b8152600401610a9a90613e2f565b816001600160a01b0316611daf82611563565b6001600160a01b031614611dd55760405162461bcd60e51b8152600401610a9a90613f51565b82611e395760405162461bcd60e51b815260206004820152602e60248201527f43726f6e6f7353686167677947616c6178793a2043616e6e6f7420707574207a60448201526d65726f206173206120707269636560901b6064820152608401610a9a565b604080516080810182526001815260208101869052908101336001600160a01b03908116825260209182018690526000878152601383526040908190208451815460ff19169015151781559284015160018401558301516002830180546001600160a01b031916919092161790556060909101516003909101557f36f8215cc1ab61ba3318dad623f5fc4dba513a9107815306c3d86e74ba46307a8484611edd3390565b6040805193845260208401929092526001600160a01b03169082015260600160405180910390a150505050565b600b546001600160a01b03610100909104163314611f3a5760405162461bcd60e51b8152600401610a9a90613ecb565b6001600160a01b038116611f9f5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610a9a565b611c3581612b9c565b600b546001600160a01b03610100909104163314611fd85760405162461bcd60e51b8152600401610a9a90613ecb565b601980546001600160a01b0319166001600160a01b0392909216919091179055565b60006001600160e01b0319821663780e9d6360e01b1480610af05750610af082612ec2565b6000908152600260205260409020546001600160a01b0316151590565b600081815260046020526040902080546001600160a01b0319166001600160a01b038416908117909155819061207182611563565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b600e54600854106121115760405162461bcd60e51b815260206004820152602b60248201527f43726f6e6f7353686167677947616c6178793a2053616c652068617320616c7260448201526a32b0b23c9032b73232b21760a91b6064820152608401610a9a565b600083116121755760405162461bcd60e51b815260206004820152602b60248201527f43726f6e6f7353686167677947616c6178793a20596f752063616e6e6f74206d60448201526a34b73a10181027333a399760a91b6064820152608401610a9a565b600e5461218a61218460085490565b85612d40565b11156122105760405162461bcd60e51b815260206004820152604960248201527f43726f6e6f7353686167677947616c6178793a2045786365656473206d61786960448201527f6d756d20737570706c792e20506c656173652074727920746f206d696e74206c60648201526832b9b99027333a399760b91b608482015260a401610a9a565b60008367ffffffffffffffff81111561223957634e487b7160e01b600052604160045260246000fd5b604051908082528060200260200182016040528015612262578160200160208202803683370190505b50905060005b848110156123a6576000601054846122825760085461228d565b61228d601054612f12565b61229791906141b4565b905060006122c26122bb6010600081546122b090614147565b918290555084613006565b6001612d40565b90506122d2600c80546001019055565b6122dc868261307d565b61230d816122e983613097565b6040516020016122f99190613d1a565b6040516020818303038152906040526131b2565b8084848151811061232e57634e487b7160e01b600052603260045260246000fd5b60209081029190910181019190915260408051606081018252428152338184019081526000828401818152958152601c9094529190922091518255516001820180546001600160a01b0319166001600160a01b039092169190911790559051600290910155508061239e81614199565b915050612268565b5060006123b4346003612d53565b6014549091506000906001600160a01b03166123db6123d4606485613fba565b605561323d565b604051600081818185875af1925050503d8060008114612417576040519150601f19603f3d011682016040523d82523d6000602084013e61241c565b606091505b505090508061242a57600080fd5b6015546000906001600160a01b031661244e612447606486613fba565b600f61323d565b604051600081818185875af1925050503d806000811461248a576040519150601f19603f3d011682016040523d82523d6000602084013e61248f565b606091505b505090508061249d57600080fd5b6018546040516000916001600160a01b03169085908381818185875af1925050503d80600081146124ea576040519150601f19603f3d011682016040523d82523d6000602084013e6124ef565b606091505b50509050806124fd57600080fd5b60006125a5601760009054906101000a90046001600160a01b03166001600160a01b031663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b15801561255057600080fd5b505afa158015612564573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125889190613c64565b61259390600a614014565b61259f906109c46140e5565b8a61323d565b60175460405163095ea7b360e01b8152306004820152602481018390529192506001600160a01b03169063095ea7b390604401602060405180830381600087803b1580156125f257600080fd5b505af1158015612606573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061262a9190613b6f565b506017546018546040516323b872dd60e01b81523060048201526001600160a01b039182166024820152604481018490529116906323b872dd90606401602060405180830381600087803b15801561268157600080fd5b505af1158015612695573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906126b99190613b6f565b507fbc07a750767f513de2b3356e24037db0e90c9e5cdaa0d757c7e628c3d82e8f1286336040516126eb929190613d80565b60405180910390a1505050505050505050565b60006127098261201f565b61276a5760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b6064820152608401610a9a565b600061277583611563565b9050806001600160a01b0316846001600160a01b031614806127bc57506001600160a01b0380821660009081526005602090815260408083209388168352929052205460ff165b806127e05750836001600160a01b03166127d584610b8a565b6001600160a01b0316145b949350505050565b826001600160a01b03166127fb82611563565b6001600160a01b03161461285f5760405162461bcd60e51b815260206004820152602560248201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060448201526437bbb732b960d91b6064820152608401610a9a565b6001600160a01b0382166128c15760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b6064820152608401610a9a565b6128cc838383613249565b6128d760008261203c565b6001600160a01b0383166000908152600360205260408120805460019290612900908490614104565b90915550506001600160a01b038216600090815260036020526040812080546001929061292e908490613fa2565b909155505060008181526002602052604080822080546001600160a01b0319166001600160a01b0386811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4610d23565b61299a8484846127e8565b6129a68484848461330e565b611a4c5760405162461bcd60e51b8152600401610a9a90613e79565b6000806129db6127106129d5868661323d565b90612d53565b90506129e7848261341b565b91509250929050565b600080805b6129fe3361160f565b811015611aea576000612a1133836111c8565b6000818152601c602052604090205490915015801590612a4c57506000818152601c6020526040902054601b544291612a4991612d40565b11155b15612af6576000612a6047611ac260085490565b9050612a6c8482612d40565b93506040518060600160405280428152602001336001600160a01b03168152602001612aae601c60008681526020019081526020016000206002015484612d40565b90526000838152601c602090815260409182902083518155908301516001820180546001600160a01b0319166001600160a01b03909216919091179055910151600290910155505b5080612b0181614199565b9150506129f5565b600b5460ff16612b525760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b6044820152606401610a9a565b600b805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b600b80546001600160a01b03838116610100818102610100600160a81b031985161790945560405193909204169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600b5460ff1615612c3c5760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b6044820152606401610a9a565b600b805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258612b7f3390565b816001600160a01b0316836001600160a01b03161415612cd35760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c6572000000000000006044820152606401610a9a565b6001600160a01b03838116600081815260056020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b6000612d4c8284613fa2565b9392505050565b6000612d4c8284613fba565b6060612d6a8261201f565b612dd05760405162461bcd60e51b815260206004820152603160248201527f45524337323155524953746f726167653a2055524920717565727920666f72206044820152703737b732bc34b9ba32b73a103a37b5b2b760791b6064820152608401610a9a565b6000828152600a602052604081208054612de99061415e565b80601f0160208091040260200160405190810160405280929190818152602001828054612e159061415e565b8015612e625780601f10612e3757610100808354040283529160200191612e62565b820191906000526020600020905b815481529060010190602001808311612e4557829003601f168201915b505050505090506000612e73613427565b9050805160001415612e8757509050610af3565b815115612eb9578082604051602001612ea1929190613ceb565b60405160208183030381529060405292505050610af3565b6127e084613436565b60006001600160e01b031982166380ac58cd60e01b1480612ef357506001600160e01b03198216635b5e139f60e01b145b80610af057506301ffc9a760e01b6001600160e01b0319831614610af0565b6040516bffffffffffffffffffffffff193360601b166020820152600090829042906034016040516020818303038152906040528051906020012060001c612f5a9190613fba565b6040516bffffffffffffffffffffffff194160601b16602082015242906034016040516020818303038152906040528051906020012060001c612f9d9190613fba565b4345612fa94442613fa2565b612fb39190613fa2565b612fbd9190613fa2565b612fc79190613fa2565b612fd19190613fa2565b604051602001612fe391815260200190565b6040516020818303038152906040528051906020012060001c610af09190613fba565b60008281526011602052604081205483901561302d57506000838152601160205260409020545b6000848152601160205260408082208590558482529020541561306157600083815260116020526040808220548683529120555b6000928352601160205260408084209190915592825250205490565b610d4b828260405180602001604052806000815250613500565b6060816130bc57506040805180820190915260018152600360fc1b6020820152610af3565b8160005b81156130e657806130d081614199565b91506130df9050600a83613fba565b91506130c0565b60008167ffffffffffffffff81111561310f57634e487b7160e01b600052604160045260246000fd5b6040519080825280601f01601f191660200182016040528015613139576020820181803683370190505b5090505b84156127e05761314e600183614104565b915061315b600a866141b4565b613166906030613fa2565b60f81b81838151811061318957634e487b7160e01b600052603260045260246000fd5b60200101906001600160f81b031916908160001a9053506131ab600a86613fba565b945061313d565b6131bb8261201f565b61321e5760405162461bcd60e51b815260206004820152602e60248201527f45524337323155524953746f726167653a2055524920736574206f66206e6f6e60448201526d32bc34b9ba32b73a103a37b5b2b760911b6064820152608401610a9a565b6000828152600a602090815260409091208251610d23928401906138ea565b6000612d4c82846140e5565b600b5460ff161561328f5760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b6044820152606401610a9a565b61329a838383613533565b6040805160808101825260008082526020808301858152838501838152606085018481529684526013909252939091209151825460ff19169015151782559151600182015590516002820180546001600160a01b0319166001600160a01b0390921691909117905590516003909101555050565b60006001600160a01b0384163b1561341057604051630a85bd0160e11b81526001600160a01b0385169063150b7a0290613352903390899088908890600401613d43565b602060405180830381600087803b15801561336c57600080fd5b505af192505050801561339c575060408051601f3d908101601f1916820190925261339991810190613ba7565b60015b6133f6573d8080156133ca576040519150601f19603f3d011682016040523d82523d6000602084013e6133cf565b606091505b5080516133ee5760405162461bcd60e51b8152600401610a9a90613e79565b805181602001fd5b6001600160e01b031916630a85bd0160e11b1490506127e0565b506001949350505050565b6000612d4c8284614104565b6060600d8054610b079061415e565b60606134418261201f565b6134a55760405162461bcd60e51b815260206004820152602f60248201527f4552433732314d657461646174613a2055524920717565727920666f72206e6f60448201526e3732bc34b9ba32b73a103a37b5b2b760891b6064820152608401610a9a565b60006134af613427565b905060008151116134cf5760405180602001604052806000815250612d4c565b806134d984613097565b6040516020016134ea929190613ceb565b6040516020818303038152906040529392505050565b61350a83836135f0565b613517600084848461330e565b610d235760405162461bcd60e51b8152600401610a9a90613e79565b6001600160a01b03831661358e5761358981600880546000838152600960205260408120829055600182018355919091527ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee30155565b6135b1565b816001600160a01b0316836001600160a01b0316146135b1576135b18382613730565b6001600160a01b0382166135cd576135c8816137cd565b610d23565b826001600160a01b0316826001600160a01b031614610d2357610d2382826138a6565b6001600160a01b0382166136465760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f20616464726573736044820152606401610a9a565b61364f8161201f565b1561369c5760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152606401610a9a565b6136a860008383613249565b6001600160a01b03821660009081526003602052604081208054600192906136d1908490613fa2565b909155505060008181526002602052604080822080546001600160a01b0319166001600160a01b03861690811790915590518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a4610d4b565b6000600161373d8461160f565b6137479190614104565b60008381526007602052604090205490915080821461379a576001600160a01b03841660009081526006602090815260408083208584528252808320548484528184208190558352600790915290208190555b5060009182526007602090815260408084208490556001600160a01b039094168352600681528383209183525290812055565b6008546000906137df90600190614104565b6000838152600960205260408120546008805493945090928490811061381557634e487b7160e01b600052603260045260246000fd5b90600052602060002001549050806008838154811061384457634e487b7160e01b600052603260045260246000fd5b600091825260208083209091019290925582815260099091526040808220849055858252812055600880548061388a57634e487b7160e01b600052603160045260246000fd5b6001900381819060005260206000200160009055905550505050565b60006138b18361160f565b6001600160a01b039093166000908152600660209081526040808320868452825280832085905593825260079052919091209190915550565b8280546138f69061415e565b90600052602060002090601f016020900481019282613918576000855561395e565b82601f1061393157805160ff191683800117855561395e565b8280016001018555821561395e579182015b8281111561395e578251825591602001919060010190613943565b5061396a92915061396e565b5090565b5b8082111561396a576000815560010161396f565b600067ffffffffffffffff8084111561399e5761399e6141f4565b604051601f8501601f19908116603f011681019082821181831017156139c6576139c66141f4565b816040528093508581528686860111156139df57600080fd5b858560208301376000602087830101525050509392505050565b80356001600160a01b0381168114610af357600080fd5b600060208284031215613a21578081fd5b612d4c826139f9565b60008060408385031215613a3c578081fd5b613a45836139f9565b9150613a53602084016139f9565b90509250929050565b600080600060608486031215613a70578081fd5b613a79846139f9565b9250613a87602085016139f9565b9150604084013590509250925092565b60008060008060808587031215613aac578081fd5b613ab5856139f9565b9350613ac3602086016139f9565b925060408501359150606085013567ffffffffffffffff811115613ae5578182fd5b8501601f81018713613af5578182fd5b613b0487823560208401613983565b91505092959194509250565b60008060408385031215613b22578182fd5b613b2b836139f9565b91506020830135613b3b8161420a565b809150509250929050565b60008060408385031215613b58578182fd5b613b61836139f9565b946020939093013593505050565b600060208284031215613b80578081fd5b8151612d4c8161420a565b600060208284031215613b9c578081fd5b8135612d4c81614218565b600060208284031215613bb8578081fd5b8151612d4c81614218565b600060208284031215613bd4578081fd5b813567ffffffffffffffff811115613bea578182fd5b8201601f81018413613bfa578182fd5b6127e084823560208401613983565b600060208284031215613c1a578081fd5b5035919050565b60008060408385031215613c33578182fd5b82359150613a53602084016139f9565b60008060408385031215613c55578182fd5b50508035926020909101359150565b600060208284031215613c75578081fd5b815160ff81168114612d4c578182fd5b6000815180845260208085019450808401835b83811015613cb457815187529582019590820190600101613c98565b509495945050505050565b60008151808452613cd781602086016020860161411b565b601f01601f19169290920160200192915050565b60008351613cfd81846020880161411b565b835190830190613d1181836020880161411b565b01949350505050565b60008251613d2c81846020870161411b565b64173539b7b760d91b920191825250600501919050565b6001600160a01b0385811682528416602082015260408101839052608060608201819052600090613d7690830184613cbf565b9695505050505050565b600060408252613d936040830185613c85565b905060018060a01b03831660208301529392505050565b600060608252613dbd6060830186613c85565b828103602084810191909152855180835286820192820190845b81811015613dfc5784516001600160a01b031683529383019391830191600101613dd7565b50508481036040860152613e108187613c85565b98975050505050505050565b600060208252612d4c6020830184613cbf565b6020808252602a908201527f43726f6e6f7353686167677947616c6178793a20546f6b656e496420646f6573604082015269081b9bdd08195e1a5cdd60b21b606082015260800190565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60208082526031908201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f6040820152701ddb995c881b9bdc88185c1c1c9bdd9959607a1b606082015260800190565b60208082526031908201527f43726f6e6f7353686167677947616c6178793a20546f6b656e20646f6573206e60408201527037ba103132b637b733903a37903ab9b2b960791b606082015260800190565b60008219821115613fb557613fb56141c8565b500190565b600082613fc957613fc96141de565b500490565b80825b6001808611613fe0575061400b565b818704821115613ff257613ff26141c8565b80861615613fff57918102915b9490941c938002613fd1565b94509492505050565b6000612d4c60001960ff85168460008261403057506001612d4c565b8161403d57506000612d4c565b8160018114614053576002811461405d5761408a565b6001915050612d4c565b60ff84111561406e5761406e6141c8565b6001841b915084821115614084576140846141c8565b50612d4c565b5060208310610133831016604e8410600b84101617156140bd575081810a838111156140b8576140b86141c8565b612d4c565b6140ca8484846001613fce565b8086048211156140dc576140dc6141c8565b02949350505050565b60008160001904831182151516156140ff576140ff6141c8565b500290565b600082821015614116576141166141c8565b500390565b60005b8381101561413657818101518382015260200161411e565b83811115611a4c5750506000910152565b600081614156576141566141c8565b506000190190565b60028104600182168061417257607f821691505b6020821081141561419357634e487b7160e01b600052602260045260246000fd5b50919050565b60006000198214156141ad576141ad6141c8565b5060010190565b6000826141c3576141c36141de565b500690565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b8015158114611c3557600080fd5b6001600160e01b031981168114611c3557600080fdfea2646970667358221220b0bc90060eeb6846de6b85e9c8b48fcb736e4e5b89574d86d8833be739d5708c64736f6c63430008020033