{
  "language": "Solidity",
  "sources": {
    "contracts/ERC20Airdrops.sol": {
      "content": "// SPDX-License-Identifier: UNLICENSED\n\npragma solidity =0.8.3;\n\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\";\nimport \"./MerkleProof.sol\";\n\ncontract ERC20Airdrops is MerkleProof {\n    using SafeERC20 for IERC20;\n\n    mapping(address => mapping(bytes32 => uint256)) public deadlineOf;\n    mapping(address => mapping(bytes32 => address)) public walletOf;\n    mapping(address => mapping(bytes32 => mapping(bytes32 => bool))) internal _hasClaimed;\n\n    event AddMerkleRoot(address indexed token, bytes32 indexed merkleRoot, address wallet, uint256 deadline);\n    event Claim(\n        address indexed token,\n        bytes32 indexed merkleRoot,\n        address wallet,\n        address indexed account,\n        uint256 amount\n    );\n\n    function addMerkleRoot(\n        address token,\n        bytes32 merkleRoot,\n        uint256 deadline\n    ) external {\n        address wallet = walletOf[token][merkleRoot];\n        require(wallet == address(0), \"LEVX: DUPLICATE_ROOT\");\n        walletOf[token][merkleRoot] = msg.sender;\n        deadlineOf[token][merkleRoot] = deadline;\n\n        emit AddMerkleRoot(token, merkleRoot, msg.sender, deadline);\n    }\n\n    function claim(\n        address token,\n        bytes32 merkleRoot,\n        bytes32[] calldata merkleProof,\n        uint256 amount\n    ) external {\n        address wallet = walletOf[token][merkleRoot];\n        require(wallet != address(0), \"LEVX: INVALID_ROOT\");\n        require(block.timestamp < deadlineOf[token][merkleRoot], \"LEVX: EXPIRED\");\n\n        bytes32 leaf = keccak256(abi.encodePacked(msg.sender, amount));\n        require(!_hasClaimed[token][merkleRoot][leaf], \"LEVX: FORBIDDEN\");\n        require(verify(merkleRoot, leaf, merkleProof), \"LEVX: INVALID_PROOF\");\n\n        _hasClaimed[token][merkleRoot][leaf] = true;\n        IERC20(token).safeTransferFrom(wallet, msg.sender, amount);\n\n        emit Claim(token, merkleRoot, wallet, msg.sender, amount);\n    }\n}\n"
    },
    "@openzeppelin/contracts/token/ERC20/IERC20.sol": {
      "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC20/IERC20.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC20 standard as defined in the EIP.\n */\ninterface IERC20 {\n    /**\n     * @dev Returns the amount of tokens in existence.\n     */\n    function totalSupply() external view returns (uint256);\n\n    /**\n     * @dev Returns the amount of tokens owned by `account`.\n     */\n    function balanceOf(address account) external view returns (uint256);\n\n    /**\n     * @dev Moves `amount` tokens from the caller's account to `to`.\n     *\n     * Returns a boolean value indicating whether the operation succeeded.\n     *\n     * Emits a {Transfer} event.\n     */\n    function transfer(address to, uint256 amount) external returns (bool);\n\n    /**\n     * @dev Returns the remaining number of tokens that `spender` will be\n     * allowed to spend on behalf of `owner` through {transferFrom}. This is\n     * zero by default.\n     *\n     * This value changes when {approve} or {transferFrom} are called.\n     */\n    function allowance(address owner, address spender) external view returns (uint256);\n\n    /**\n     * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\n     *\n     * Returns a boolean value indicating whether the operation succeeded.\n     *\n     * IMPORTANT: Beware that changing an allowance with this method brings the risk\n     * that someone may use both the old and the new allowance by unfortunate\n     * transaction ordering. One possible solution to mitigate this race\n     * condition is to first reduce the spender's allowance to 0 and set the\n     * desired value afterwards:\n     * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\n     *\n     * Emits an {Approval} event.\n     */\n    function approve(address spender, uint256 amount) external returns (bool);\n\n    /**\n     * @dev Moves `amount` tokens from `from` to `to` using the\n     * allowance mechanism. `amount` is then deducted from the caller's\n     * allowance.\n     *\n     * Returns a boolean value indicating whether the operation succeeded.\n     *\n     * Emits a {Transfer} event.\n     */\n    function transferFrom(\n        address from,\n        address to,\n        uint256 amount\n    ) external returns (bool);\n\n    /**\n     * @dev Emitted when `value` tokens are moved from one account (`from`) to\n     * another (`to`).\n     *\n     * Note that `value` may be zero.\n     */\n    event Transfer(address indexed from, address indexed to, uint256 value);\n\n    /**\n     * @dev Emitted when the allowance of a `spender` for an `owner` is set by\n     * a call to {approve}. `value` is the new allowance.\n     */\n    event Approval(address indexed owner, address indexed spender, uint256 value);\n}\n"
    },
    "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol": {
      "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/utils/SafeERC20.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../IERC20.sol\";\nimport \"../../../utils/Address.sol\";\n\n/**\n * @title SafeERC20\n * @dev Wrappers around ERC20 operations that throw on failure (when the token\n * contract returns false). Tokens that return no value (and instead revert or\n * throw on failure) are also supported, non-reverting calls are assumed to be\n * successful.\n * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,\n * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.\n */\nlibrary SafeERC20 {\n    using Address for address;\n\n    function safeTransfer(\n        IERC20 token,\n        address to,\n        uint256 value\n    ) internal {\n        _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));\n    }\n\n    function safeTransferFrom(\n        IERC20 token,\n        address from,\n        address to,\n        uint256 value\n    ) internal {\n        _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));\n    }\n\n    /**\n     * @dev Deprecated. This function has issues similar to the ones found in\n     * {IERC20-approve}, and its usage is discouraged.\n     *\n     * Whenever possible, use {safeIncreaseAllowance} and\n     * {safeDecreaseAllowance} instead.\n     */\n    function safeApprove(\n        IERC20 token,\n        address spender,\n        uint256 value\n    ) internal {\n        // safeApprove should only be called when setting an initial allowance,\n        // or when resetting it to zero. To increase and decrease it, use\n        // 'safeIncreaseAllowance' and 'safeDecreaseAllowance'\n        require(\n            (value == 0) || (token.allowance(address(this), spender) == 0),\n            \"SafeERC20: approve from non-zero to non-zero allowance\"\n        );\n        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));\n    }\n\n    function safeIncreaseAllowance(\n        IERC20 token,\n        address spender,\n        uint256 value\n    ) internal {\n        uint256 newAllowance = token.allowance(address(this), spender) + value;\n        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\n    }\n\n    function safeDecreaseAllowance(\n        IERC20 token,\n        address spender,\n        uint256 value\n    ) internal {\n        unchecked {\n            uint256 oldAllowance = token.allowance(address(this), spender);\n            require(oldAllowance >= value, \"SafeERC20: decreased allowance below zero\");\n            uint256 newAllowance = oldAllowance - value;\n            _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\n        }\n    }\n\n    /**\n     * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\n     * on the return value: the return value is optional (but if data is returned, it must not be false).\n     * @param token The token targeted by the call.\n     * @param data The call data (encoded using abi.encode or one of its variants).\n     */\n    function _callOptionalReturn(IERC20 token, bytes memory data) private {\n        // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since\n        // we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that\n        // the target address contains contract code and also asserts for success in the low-level call.\n\n        bytes memory returndata = address(token).functionCall(data, \"SafeERC20: low-level call failed\");\n        if (returndata.length > 0) {\n            // Return data is optional\n            require(abi.decode(returndata, (bool)), \"SafeERC20: ERC20 operation did not succeed\");\n        }\n    }\n}\n"
    },
    "contracts/MerkleProof.sol": {
      "content": "// SPDX-License-Identifier: UNLICENSED\n\npragma solidity =0.8.3;\n\ncontract MerkleProof {\n    function verify(\n        bytes32 root,\n        bytes32 leaf,\n        bytes32[] memory proof\n    ) public pure returns (bool) {\n        bytes32 computedHash = leaf;\n\n        for (uint256 i = 0; i < proof.length; i++) {\n            bytes32 proofElement = proof[i];\n\n            if (computedHash < proofElement) {\n                // Hash(current computed hash + current element of the proof)\n                computedHash = keccak256(abi.encodePacked(computedHash, proofElement));\n            } else {\n                // Hash(current element of the proof + current computed hash)\n                computedHash = keccak256(abi.encodePacked(proofElement, computedHash));\n            }\n        }\n\n        // Check if the computed hash (root) is equal to the provided root\n        return computedHash == root;\n    }\n}\n"
    },
    "@openzeppelin/contracts/utils/Address.sol": {
      "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0) (utils/Address.sol)\n\npragma solidity ^0.8.1;\n\n/**\n * @dev Collection of functions related to the address type\n */\nlibrary Address {\n    /**\n     * @dev Returns true if `account` is a contract.\n     *\n     * [IMPORTANT]\n     * ====\n     * It is unsafe to assume that an address for which this function returns\n     * false is an externally-owned account (EOA) and not a contract.\n     *\n     * Among others, `isContract` will return false for the following\n     * types of addresses:\n     *\n     *  - an externally-owned account\n     *  - a contract in construction\n     *  - an address where a contract will be created\n     *  - an address where a contract lived, but was destroyed\n     * ====\n     *\n     * [IMPORTANT]\n     * ====\n     * You shouldn't rely on `isContract` to protect against flash loan attacks!\n     *\n     * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\n     * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\n     * constructor.\n     * ====\n     */\n    function isContract(address account) internal view returns (bool) {\n        // This method relies on extcodesize/address.code.length, which returns 0\n        // for contracts in construction, since the code is only stored at the end\n        // of the constructor execution.\n\n        return account.code.length > 0;\n    }\n\n    /**\n     * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\n     * `recipient`, forwarding all available gas and reverting on errors.\n     *\n     * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\n     * of certain opcodes, possibly making contracts go over the 2300 gas limit\n     * imposed by `transfer`, making them unable to receive funds via\n     * `transfer`. {sendValue} removes this limitation.\n     *\n     * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\n     *\n     * IMPORTANT: because control is transferred to `recipient`, care must be\n     * taken to not create reentrancy vulnerabilities. Consider using\n     * {ReentrancyGuard} or the\n     * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\n     */\n    function sendValue(address payable recipient, uint256 amount) internal {\n        require(address(this).balance >= amount, \"Address: insufficient balance\");\n\n        (bool success, ) = recipient.call{value: amount}(\"\");\n        require(success, \"Address: unable to send value, recipient may have reverted\");\n    }\n\n    /**\n     * @dev Performs a Solidity function call using a low level `call`. A\n     * plain `call` is an unsafe replacement for a function call: use this\n     * function instead.\n     *\n     * If `target` reverts with a revert reason, it is bubbled up by this\n     * function (like regular Solidity function calls).\n     *\n     * Returns the raw returned data. To convert to the expected return value,\n     * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\n     *\n     * Requirements:\n     *\n     * - `target` must be a contract.\n     * - calling `target` with `data` must not revert.\n     *\n     * _Available since v3.1._\n     */\n    function functionCall(address target, bytes memory data) internal returns (bytes memory) {\n        return functionCall(target, data, \"Address: low-level call failed\");\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\n     * `errorMessage` as a fallback revert reason when `target` reverts.\n     *\n     * _Available since v3.1._\n     */\n    function functionCall(\n        address target,\n        bytes memory data,\n        string memory errorMessage\n    ) internal returns (bytes memory) {\n        return functionCallWithValue(target, data, 0, errorMessage);\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n     * but also transferring `value` wei to `target`.\n     *\n     * Requirements:\n     *\n     * - the calling contract must have an ETH balance of at least `value`.\n     * - the called Solidity function must be `payable`.\n     *\n     * _Available since v3.1._\n     */\n    function functionCallWithValue(\n        address target,\n        bytes memory data,\n        uint256 value\n    ) internal returns (bytes memory) {\n        return functionCallWithValue(target, data, value, \"Address: low-level call with value failed\");\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\n     * with `errorMessage` as a fallback revert reason when `target` reverts.\n     *\n     * _Available since v3.1._\n     */\n    function functionCallWithValue(\n        address target,\n        bytes memory data,\n        uint256 value,\n        string memory errorMessage\n    ) internal returns (bytes memory) {\n        require(address(this).balance >= value, \"Address: insufficient balance for call\");\n        require(isContract(target), \"Address: call to non-contract\");\n\n        (bool success, bytes memory returndata) = target.call{value: value}(data);\n        return verifyCallResult(success, returndata, errorMessage);\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n     * but performing a static call.\n     *\n     * _Available since v3.3._\n     */\n    function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\n        return functionStaticCall(target, data, \"Address: low-level static call failed\");\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n     * but performing a static call.\n     *\n     * _Available since v3.3._\n     */\n    function functionStaticCall(\n        address target,\n        bytes memory data,\n        string memory errorMessage\n    ) internal view returns (bytes memory) {\n        require(isContract(target), \"Address: static call to non-contract\");\n\n        (bool success, bytes memory returndata) = target.staticcall(data);\n        return verifyCallResult(success, returndata, errorMessage);\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n     * but performing a delegate call.\n     *\n     * _Available since v3.4._\n     */\n    function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\n        return functionDelegateCall(target, data, \"Address: low-level delegate call failed\");\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n     * but performing a delegate call.\n     *\n     * _Available since v3.4._\n     */\n    function functionDelegateCall(\n        address target,\n        bytes memory data,\n        string memory errorMessage\n    ) internal returns (bytes memory) {\n        require(isContract(target), \"Address: delegate call to non-contract\");\n\n        (bool success, bytes memory returndata) = target.delegatecall(data);\n        return verifyCallResult(success, returndata, errorMessage);\n    }\n\n    /**\n     * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the\n     * revert reason using the provided one.\n     *\n     * _Available since v4.3._\n     */\n    function verifyCallResult(\n        bool success,\n        bytes memory returndata,\n        string memory errorMessage\n    ) internal pure returns (bytes memory) {\n        if (success) {\n            return returndata;\n        } else {\n            // Look for revert reason and bubble it up if present\n            if (returndata.length > 0) {\n                // The easiest way to bubble the revert reason is using memory via assembly\n\n                assembly {\n                    let returndata_size := mload(returndata)\n                    revert(add(32, returndata), returndata_size)\n                }\n            } else {\n                revert(errorMessage);\n            }\n        }\n    }\n}\n"
    },
    "contracts/LevxAirdrop.sol": {
      "content": "// SPDX-License-Identifier: UNLICENSED\n\npragma solidity =0.8.3;\n\nimport \"@openzeppelin/contracts/access/Ownable.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\";\nimport \"./MerkleProof.sol\";\n\ncontract LevxAirdrop is Ownable, MerkleProof {\n    using SafeERC20 for IERC20;\n\n    address public immutable levx;\n    mapping(bytes32 => bool) public isValidMerkleRoot;\n    mapping(bytes32 => mapping(bytes32 => bool)) internal _hasClaimed;\n\n    event AddMerkleRoot(bytes32 indexed merkleRoot);\n    event Claim(bytes32 indexed merkleRoot, address indexed account, uint256 amount);\n\n    constructor(address _owner, address _levx) {\n        levx = _levx;\n        _transferOwnership(_owner);\n    }\n\n    function addMerkleRoot(bytes32 merkleRoot) external onlyOwner {\n        require(!isValidMerkleRoot[merkleRoot], \"SHOYU: DUPLICATE_ROOT\");\n        isValidMerkleRoot[merkleRoot] = true;\n\n        emit AddMerkleRoot(merkleRoot);\n    }\n\n    function claim(\n        bytes32 merkleRoot,\n        bytes32[] calldata merkleProof,\n        uint256 amount\n    ) external {\n        require(isValidMerkleRoot[merkleRoot], \"SHOYU: INVALID_ROOT\");\n\n        bytes32 leaf = keccak256(abi.encodePacked(msg.sender, amount));\n        require(!_hasClaimed[merkleRoot][leaf], \"SHOYU: FORBIDDEN\");\n        require(verify(merkleRoot, leaf, merkleProof), \"SHOYU: INVALID_PROOF\");\n\n        _hasClaimed[merkleRoot][leaf] = true;\n        IERC20(levx).safeTransferFrom(owner(), msg.sender, amount);\n\n        emit Claim(merkleRoot, msg.sender, amount);\n    }\n}\n"
    },
    "@openzeppelin/contracts/access/Ownable.sol": {
      "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../utils/Context.sol\";\n\n/**\n * @dev Contract module which provides a basic access control mechanism, where\n * there is an account (an owner) that can be granted exclusive access to\n * specific functions.\n *\n * By default, the owner account will be the one that deploys the contract. This\n * can later be changed with {transferOwnership}.\n *\n * This module is used through inheritance. It will make available the modifier\n * `onlyOwner`, which can be applied to your functions to restrict their use to\n * the owner.\n */\nabstract contract Ownable is Context {\n    address private _owner;\n\n    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\n\n    /**\n     * @dev Initializes the contract setting the deployer as the initial owner.\n     */\n    constructor() {\n        _transferOwnership(_msgSender());\n    }\n\n    /**\n     * @dev Returns the address of the current owner.\n     */\n    function owner() public view virtual returns (address) {\n        return _owner;\n    }\n\n    /**\n     * @dev Throws if called by any account other than the owner.\n     */\n    modifier onlyOwner() {\n        require(owner() == _msgSender(), \"Ownable: caller is not the owner\");\n        _;\n    }\n\n    /**\n     * @dev Leaves the contract without owner. It will not be possible to call\n     * `onlyOwner` functions anymore. Can only be called by the current owner.\n     *\n     * NOTE: Renouncing ownership will leave the contract without an owner,\n     * thereby removing any functionality that is only available to the owner.\n     */\n    function renounceOwnership() public virtual onlyOwner {\n        _transferOwnership(address(0));\n    }\n\n    /**\n     * @dev Transfers ownership of the contract to a new account (`newOwner`).\n     * Can only be called by the current owner.\n     */\n    function transferOwnership(address newOwner) public virtual onlyOwner {\n        require(newOwner != address(0), \"Ownable: new owner is the zero address\");\n        _transferOwnership(newOwner);\n    }\n\n    /**\n     * @dev Transfers ownership of the contract to a new account (`newOwner`).\n     * Internal function without access restriction.\n     */\n    function _transferOwnership(address newOwner) internal virtual {\n        address oldOwner = _owner;\n        _owner = newOwner;\n        emit OwnershipTransferred(oldOwner, newOwner);\n    }\n}\n"
    },
    "@openzeppelin/contracts/utils/Context.sol": {
      "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract Context {\n    function _msgSender() internal view virtual returns (address) {\n        return msg.sender;\n    }\n\n    function _msgData() internal view virtual returns (bytes calldata) {\n        return msg.data;\n    }\n}\n"
    },
    "contracts/NFTAirdropsAndSales.sol": {
      "content": "// SPDX-License-Identifier: UNLICENSED\n\npragma solidity =0.8.3;\n\nimport \"@openzeppelin/contracts/access/Ownable.sol\";\nimport \"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\";\nimport \"@shoyunft/contracts/contracts/interfaces/INFT721.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\";\n\ncontract NFTAirdropsAndSales is Ownable {\n    using SafeERC20 for IERC20;\n\n    address public immutable nftContract;\n    address public immutable levx;\n    address public immutable wallet;\n    mapping(bytes32 => Airdrop) public airdrops;\n    mapping(address => bool) public isMinter;\n    mapping(bytes32 => mapping(bytes32 => bool)) internal _minted;\n\n    struct Airdrop {\n        address signer;\n        uint64 deadline;\n        uint256 nextTokenId;\n        uint256 maxTokenId;\n    }\n\n    event SetMinter(address account, bool indexed isMinter);\n    event Add(bytes32 indexed slug, address signer, uint64 deadline, uint256 fromTokenId, uint256 maxTokenId);\n    event Claim(bytes32 indexed slug, bytes32 indexed id, address indexed to, uint256 tokenId, uint256 price);\n\n    constructor(\n        address _nftContract,\n        address _levx,\n        address _wallet\n    ) {\n        nftContract = _nftContract;\n        levx = _levx;\n        wallet = _wallet;\n    }\n\n    function setMinter(address account, bool _isMinter) external onlyOwner {\n        isMinter[account] = _isMinter;\n\n        emit SetMinter(account, _isMinter);\n    }\n\n    function transferOwnershipOfNFTContract(address newOwner) external onlyOwner {\n        INFT721(nftContract).transferOwnership(newOwner);\n    }\n\n    function setRoyaltyFeeRecipient(address _royaltyFeeRecipient) external onlyOwner {\n        INFT721(nftContract).setRoyaltyFeeRecipient(_royaltyFeeRecipient);\n    }\n\n    function setRoyaltyFee(uint8 _royaltyFee) external onlyOwner {\n        INFT721(nftContract).setRoyaltyFee(_royaltyFee);\n    }\n\n    function setTokenURI(uint256 tokenId, string memory uri) external onlyOwner {\n        INFT721(nftContract).setTokenURI(tokenId, uri);\n    }\n\n    function setBaseURI(string memory baseURI) external onlyOwner {\n        INFT721(nftContract).setBaseURI(baseURI);\n    }\n\n    function parkTokenIds(uint256 toTokenId) external onlyOwner {\n        INFT721(nftContract).parkTokenIds(toTokenId);\n    }\n\n    function mint(\n        address to,\n        uint256 tokenId,\n        bytes calldata data\n    ) external {\n        require(msg.sender == owner() || isMinter[msg.sender], \"LEVX: FORBIDDEN\");\n\n        INFT721(nftContract).mint(to, tokenId, data);\n    }\n\n    function mintBatch(\n        address to,\n        uint256[] calldata tokenIds,\n        bytes calldata data\n    ) external {\n        require(msg.sender == owner() || isMinter[msg.sender], \"LEVX: FORBIDDEN\");\n\n        INFT721(nftContract).mintBatch(to, tokenIds, data);\n    }\n\n    function add(\n        bytes32 slug,\n        address signer,\n        uint64 deadline,\n        uint256 fromTokenId,\n        uint256 maxTokenId\n    ) external onlyOwner {\n        Airdrop storage airdrop = airdrops[slug];\n        require(airdrop.signer == address(0), \"LEVX: ADDED\");\n\n        airdrop.signer = signer;\n        airdrop.deadline = deadline;\n        airdrop.nextTokenId = fromTokenId;\n        airdrop.maxTokenId = maxTokenId;\n\n        emit Add(slug, signer, deadline, fromTokenId, maxTokenId);\n    }\n\n    function claim(\n        bytes32 slug,\n        bytes32 id,\n        uint256 tokenId,\n        uint256 price,\n        uint8 v,\n        bytes32 r,\n        bytes32 s,\n        address to,\n        bytes calldata data\n    ) external {\n        Airdrop storage airdrop = airdrops[slug];\n        {\n            (address signer, uint64 deadline) = (airdrop.signer, airdrop.deadline);\n\n            require(signer != address(0), \"LEVX: INVALID_SLUG\");\n            require(deadline == 0 || uint64(block.timestamp) < deadline, \"LEVX: EXPIRED\");\n            require(!_minted[slug][id], \"LEVX: MINTED\");\n\n            bytes32 message = keccak256(abi.encodePacked(slug, id, tokenId, price));\n            require(ECDSA.recover(ECDSA.toEthSignedMessageHash(message), v, r, s) == signer, \"LEVX: UNAUTHORIZED\");\n        }\n\n        {\n            (uint256 nextTokenId, uint256 maxTokenId) = (airdrop.nextTokenId, airdrop.maxTokenId);\n\n            if (tokenId == 0) {\n                tokenId = nextTokenId;\n                while (tokenId < maxTokenId) {\n                    if (INFT721(nftContract).ownerOf(tokenId) == address(0)) {\n                        break;\n                    }\n                    tokenId++;\n                }\n                require(tokenId < maxTokenId, \"LEVX: INVALID_TOKEN_ID\");\n                airdrop.nextTokenId = tokenId + 1;\n            } else {\n                require(tokenId >= nextTokenId && tokenId < maxTokenId, \"LEVX: INVALID_TOKEN_ID\");\n            }\n        }\n\n        _minted[slug][id] = true;\n\n        emit Claim(slug, id, to, tokenId, price);\n        if (price > 0) IERC20(levx).safeTransferFrom(msg.sender, wallet, price);\n        INFT721(nftContract).mint(to, tokenId, data);\n    }\n}\n"
    },
    "@openzeppelin/contracts/utils/cryptography/ECDSA.sol": {
      "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0) (utils/cryptography/ECDSA.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../Strings.sol\";\n\n/**\n * @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations.\n *\n * These functions can be used to verify that a message was signed by the holder\n * of the private keys of a given address.\n */\nlibrary ECDSA {\n    enum RecoverError {\n        NoError,\n        InvalidSignature,\n        InvalidSignatureLength,\n        InvalidSignatureS,\n        InvalidSignatureV\n    }\n\n    function _throwError(RecoverError error) private pure {\n        if (error == RecoverError.NoError) {\n            return; // no error: do nothing\n        } else if (error == RecoverError.InvalidSignature) {\n            revert(\"ECDSA: invalid signature\");\n        } else if (error == RecoverError.InvalidSignatureLength) {\n            revert(\"ECDSA: invalid signature length\");\n        } else if (error == RecoverError.InvalidSignatureS) {\n            revert(\"ECDSA: invalid signature 's' value\");\n        } else if (error == RecoverError.InvalidSignatureV) {\n            revert(\"ECDSA: invalid signature 'v' value\");\n        }\n    }\n\n    /**\n     * @dev Returns the address that signed a hashed message (`hash`) with\n     * `signature` or error string. This address can then be used for verification purposes.\n     *\n     * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:\n     * this function rejects them by requiring the `s` value to be in the lower\n     * half order, and the `v` value to be either 27 or 28.\n     *\n     * IMPORTANT: `hash` _must_ be the result of a hash operation for the\n     * verification to be secure: it is possible to craft signatures that\n     * recover to arbitrary addresses for non-hashed data. A safe way to ensure\n     * this is by receiving a hash of the original message (which may otherwise\n     * be too long), and then calling {toEthSignedMessageHash} on it.\n     *\n     * Documentation for signature generation:\n     * - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js]\n     * - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers]\n     *\n     * _Available since v4.3._\n     */\n    function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError) {\n        // Check the signature length\n        // - case 65: r,s,v signature (standard)\n        // - case 64: r,vs signature (cf https://eips.ethereum.org/EIPS/eip-2098) _Available since v4.1._\n        if (signature.length == 65) {\n            bytes32 r;\n            bytes32 s;\n            uint8 v;\n            // ecrecover takes the signature parameters, and the only way to get them\n            // currently is to use assembly.\n            assembly {\n                r := mload(add(signature, 0x20))\n                s := mload(add(signature, 0x40))\n                v := byte(0, mload(add(signature, 0x60)))\n            }\n            return tryRecover(hash, v, r, s);\n        } else if (signature.length == 64) {\n            bytes32 r;\n            bytes32 vs;\n            // ecrecover takes the signature parameters, and the only way to get them\n            // currently is to use assembly.\n            assembly {\n                r := mload(add(signature, 0x20))\n                vs := mload(add(signature, 0x40))\n            }\n            return tryRecover(hash, r, vs);\n        } else {\n            return (address(0), RecoverError.InvalidSignatureLength);\n        }\n    }\n\n    /**\n     * @dev Returns the address that signed a hashed message (`hash`) with\n     * `signature`. This address can then be used for verification purposes.\n     *\n     * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:\n     * this function rejects them by requiring the `s` value to be in the lower\n     * half order, and the `v` value to be either 27 or 28.\n     *\n     * IMPORTANT: `hash` _must_ be the result of a hash operation for the\n     * verification to be secure: it is possible to craft signatures that\n     * recover to arbitrary addresses for non-hashed data. A safe way to ensure\n     * this is by receiving a hash of the original message (which may otherwise\n     * be too long), and then calling {toEthSignedMessageHash} on it.\n     */\n    function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {\n        (address recovered, RecoverError error) = tryRecover(hash, signature);\n        _throwError(error);\n        return recovered;\n    }\n\n    /**\n     * @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately.\n     *\n     * See https://eips.ethereum.org/EIPS/eip-2098[EIP-2098 short signatures]\n     *\n     * _Available since v4.3._\n     */\n    function tryRecover(\n        bytes32 hash,\n        bytes32 r,\n        bytes32 vs\n    ) internal pure returns (address, RecoverError) {\n        bytes32 s = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff);\n        uint8 v = uint8((uint256(vs) >> 255) + 27);\n        return tryRecover(hash, v, r, s);\n    }\n\n    /**\n     * @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately.\n     *\n     * _Available since v4.2._\n     */\n    function recover(\n        bytes32 hash,\n        bytes32 r,\n        bytes32 vs\n    ) internal pure returns (address) {\n        (address recovered, RecoverError error) = tryRecover(hash, r, vs);\n        _throwError(error);\n        return recovered;\n    }\n\n    /**\n     * @dev Overload of {ECDSA-tryRecover} that receives the `v`,\n     * `r` and `s` signature fields separately.\n     *\n     * _Available since v4.3._\n     */\n    function tryRecover(\n        bytes32 hash,\n        uint8 v,\n        bytes32 r,\n        bytes32 s\n    ) internal pure returns (address, RecoverError) {\n        // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature\n        // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines\n        // the valid range for s in (301): 0 < s < secp256k1n ÷ 2 + 1, and for v in (302): v ∈ {27, 28}. Most\n        // signatures from current libraries generate a unique signature with an s-value in the lower half order.\n        //\n        // If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value\n        // with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or\n        // vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept\n        // these malleable signatures as well.\n        if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) {\n            return (address(0), RecoverError.InvalidSignatureS);\n        }\n        if (v != 27 && v != 28) {\n            return (address(0), RecoverError.InvalidSignatureV);\n        }\n\n        // If the signature is valid (and not malleable), return the signer address\n        address signer = ecrecover(hash, v, r, s);\n        if (signer == address(0)) {\n            return (address(0), RecoverError.InvalidSignature);\n        }\n\n        return (signer, RecoverError.NoError);\n    }\n\n    /**\n     * @dev Overload of {ECDSA-recover} that receives the `v`,\n     * `r` and `s` signature fields separately.\n     */\n    function recover(\n        bytes32 hash,\n        uint8 v,\n        bytes32 r,\n        bytes32 s\n    ) internal pure returns (address) {\n        (address recovered, RecoverError error) = tryRecover(hash, v, r, s);\n        _throwError(error);\n        return recovered;\n    }\n\n    /**\n     * @dev Returns an Ethereum Signed Message, created from a `hash`. This\n     * produces hash corresponding to the one signed with the\n     * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]\n     * JSON-RPC method as part of EIP-191.\n     *\n     * See {recover}.\n     */\n    function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32) {\n        // 32 is the length in bytes of hash,\n        // enforced by the type signature above\n        return keccak256(abi.encodePacked(\"\\x19Ethereum Signed Message:\\n32\", hash));\n    }\n\n    /**\n     * @dev Returns an Ethereum Signed Message, created from `s`. This\n     * produces hash corresponding to the one signed with the\n     * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]\n     * JSON-RPC method as part of EIP-191.\n     *\n     * See {recover}.\n     */\n    function toEthSignedMessageHash(bytes memory s) internal pure returns (bytes32) {\n        return keccak256(abi.encodePacked(\"\\x19Ethereum Signed Message:\\n\", Strings.toString(s.length), s));\n    }\n\n    /**\n     * @dev Returns an Ethereum Signed Typed Data, created from a\n     * `domainSeparator` and a `structHash`. This produces hash corresponding\n     * to the one signed with the\n     * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`]\n     * JSON-RPC method as part of EIP-712.\n     *\n     * See {recover}.\n     */\n    function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32) {\n        return keccak256(abi.encodePacked(\"\\x19\\x01\", domainSeparator, structHash));\n    }\n}\n"
    },
    "@shoyunft/contracts/contracts/interfaces/INFT721.sol": {
      "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.5.0;\n\nimport \"./IBaseNFT721.sol\";\nimport \"./IBaseExchange.sol\";\n\ninterface INFT721 is IBaseNFT721, IBaseExchange {\n    event SetRoyaltyFeeRecipient(address recipient);\n    event SetRoyaltyFee(uint8 fee);\n\n    function initialize(\n        address _owner,\n        string calldata _name,\n        string calldata _symbol,\n        uint256[] calldata tokenIds,\n        address royaltyFeeRecipient,\n        uint8 royaltyFee\n    ) external;\n\n    function initialize(\n        address _owner,\n        string calldata _name,\n        string calldata _symbol,\n        uint256 toTokenId,\n        address royaltyFeeRecipient,\n        uint8 royaltyFee\n    ) external;\n\n    function DOMAIN_SEPARATOR() external view override(IBaseNFT721, IBaseExchange) returns (bytes32);\n\n    function factory() external view override(IBaseNFT721, IBaseExchange) returns (address);\n\n    function setRoyaltyFeeRecipient(address _royaltyFeeRecipient) external;\n\n    function setRoyaltyFee(uint8 _royaltyFee) external;\n}\n"
    },
    "@openzeppelin/contracts/utils/Strings.sol": {
      "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/Strings.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev String operations.\n */\nlibrary Strings {\n    bytes16 private constant _HEX_SYMBOLS = \"0123456789abcdef\";\n\n    /**\n     * @dev Converts a `uint256` to its ASCII `string` decimal representation.\n     */\n    function toString(uint256 value) internal pure returns (string memory) {\n        // Inspired by OraclizeAPI's implementation - MIT licence\n        // https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol\n\n        if (value == 0) {\n            return \"0\";\n        }\n        uint256 temp = value;\n        uint256 digits;\n        while (temp != 0) {\n            digits++;\n            temp /= 10;\n        }\n        bytes memory buffer = new bytes(digits);\n        while (value != 0) {\n            digits -= 1;\n            buffer[digits] = bytes1(uint8(48 + uint256(value % 10)));\n            value /= 10;\n        }\n        return string(buffer);\n    }\n\n    /**\n     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.\n     */\n    function toHexString(uint256 value) internal pure returns (string memory) {\n        if (value == 0) {\n            return \"0x00\";\n        }\n        uint256 temp = value;\n        uint256 length = 0;\n        while (temp != 0) {\n            length++;\n            temp >>= 8;\n        }\n        return toHexString(value, length);\n    }\n\n    /**\n     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.\n     */\n    function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {\n        bytes memory buffer = new bytes(2 * length + 2);\n        buffer[0] = \"0\";\n        buffer[1] = \"x\";\n        for (uint256 i = 2 * length + 1; i > 1; --i) {\n            buffer[i] = _HEX_SYMBOLS[value & 0xf];\n            value >>= 4;\n        }\n        require(value == 0, \"Strings: hex length insufficient\");\n        return string(buffer);\n    }\n}\n"
    },
    "@shoyunft/contracts/contracts/interfaces/IBaseNFT721.sol": {
      "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.5.0;\n\nimport \"@openzeppelin/contracts/token/ERC721/IERC721.sol\";\nimport \"@openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol\";\n\nimport \"./IOwnable.sol\";\n\ninterface IBaseNFT721 is IERC721, IERC721Metadata, IOwnable {\n    event SetTokenURI(uint256 indexed tokenId, string uri);\n    event SetBaseURI(string uri);\n    event ParkTokenIds(uint256 toTokenId);\n    event Burn(uint256 indexed tokenId, uint256 indexed label, bytes32 data);\n\n    function PERMIT_TYPEHASH() external view returns (bytes32);\n\n    function PERMIT_ALL_TYPEHASH() external view returns (bytes32);\n\n    function DOMAIN_SEPARATOR() external view returns (bytes32);\n\n    function factory() external view returns (address);\n\n    function nonces(uint256 tokenId) external view returns (uint256);\n\n    function noncesForAll(address account) external view returns (uint256);\n\n    function parked(uint256 tokenId) external view returns (bool);\n\n    function initialize(\n        string calldata name,\n        string calldata symbol,\n        address _owner\n    ) external;\n\n    function setTokenURI(uint256 id, string memory uri) external;\n\n    function setBaseURI(string memory uri) external;\n\n    function parkTokenIds(uint256 toTokenId) external;\n\n    function mint(\n        address to,\n        uint256 tokenId,\n        bytes calldata data\n    ) external;\n\n    function mintBatch(\n        address to,\n        uint256[] calldata tokenIds,\n        bytes calldata data\n    ) external;\n\n    function burn(\n        uint256 tokenId,\n        uint256 label,\n        bytes32 data\n    ) external;\n\n    function burnBatch(uint256[] calldata tokenIds) external;\n\n    function permit(\n        address spender,\n        uint256 tokenId,\n        uint256 deadline,\n        uint8 v,\n        bytes32 r,\n        bytes32 s\n    ) external;\n\n    function permitAll(\n        address owner,\n        address spender,\n        uint256 deadline,\n        uint8 v,\n        bytes32 r,\n        bytes32 s\n    ) external;\n}\n"
    },
    "@shoyunft/contracts/contracts/interfaces/IBaseExchange.sol": {
      "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.5.0;\n\nimport \"../libraries/Orders.sol\";\n\ninterface IBaseExchange {\n    event Cancel(bytes32 indexed hash);\n    event Claim(\n        bytes32 indexed hash,\n        address bidder,\n        uint256 amount,\n        uint256 price,\n        address recipient,\n        address referrer\n    );\n    event Bid(bytes32 indexed hash, address bidder, uint256 amount, uint256 price, address recipient, address referrer);\n    event UpdateApprovedBidHash(\n        address indexed proxy,\n        bytes32 indexed askHash,\n        address indexed bidder,\n        bytes32 bidHash\n    );\n\n    function DOMAIN_SEPARATOR() external view returns (bytes32);\n\n    function factory() external view returns (address);\n\n    function canTrade(address token) external view returns (bool);\n\n    function bestBid(bytes32 hash)\n        external\n        view\n        returns (\n            address bidder,\n            uint256 amount,\n            uint256 price,\n            address recipient,\n            address referrer,\n            uint256 blockNumber\n        );\n\n    function isCancelledOrClaimed(bytes32 hash) external view returns (bool);\n\n    function amountFilled(bytes32 hash) external view returns (uint256);\n\n    function approvedBidHash(\n        address proxy,\n        bytes32 askHash,\n        address bidder\n    ) external view returns (bytes32 bidHash);\n\n    function cancel(Orders.Ask memory order) external;\n\n    function updateApprovedBidHash(\n        bytes32 askHash,\n        address bidder,\n        bytes32 bidHash\n    ) external;\n\n    function bid(Orders.Ask memory askOrder, Orders.Bid memory bidOrder) external returns (bool executed);\n\n    function bid(\n        Orders.Ask memory askOrder,\n        uint256 bidAmount,\n        uint256 bidPrice,\n        address bidRecipient,\n        address bidReferrer\n    ) external returns (bool executed);\n\n    function claim(Orders.Ask memory order) external;\n}\n"
    },
    "@openzeppelin/contracts/token/ERC721/IERC721.sol": {
      "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC721/IERC721.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../../utils/introspection/IERC165.sol\";\n\n/**\n * @dev Required interface of an ERC721 compliant contract.\n */\ninterface IERC721 is IERC165 {\n    /**\n     * @dev Emitted when `tokenId` token is transferred from `from` to `to`.\n     */\n    event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);\n\n    /**\n     * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.\n     */\n    event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);\n\n    /**\n     * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.\n     */\n    event ApprovalForAll(address indexed owner, address indexed operator, bool approved);\n\n    /**\n     * @dev Returns the number of tokens in ``owner``'s account.\n     */\n    function balanceOf(address owner) external view returns (uint256 balance);\n\n    /**\n     * @dev Returns the owner of the `tokenId` token.\n     *\n     * Requirements:\n     *\n     * - `tokenId` must exist.\n     */\n    function ownerOf(uint256 tokenId) external view returns (address owner);\n\n    /**\n     * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients\n     * are aware of the ERC721 protocol to prevent tokens from being forever locked.\n     *\n     * Requirements:\n     *\n     * - `from` cannot be the zero address.\n     * - `to` cannot be the zero address.\n     * - `tokenId` token must exist and be owned by `from`.\n     * - If the caller is not `from`, it must be have been allowed to move this token by either {approve} or {setApprovalForAll}.\n     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.\n     *\n     * Emits a {Transfer} event.\n     */\n    function safeTransferFrom(\n        address from,\n        address to,\n        uint256 tokenId\n    ) external;\n\n    /**\n     * @dev Transfers `tokenId` token from `from` to `to`.\n     *\n     * WARNING: Usage of this method is discouraged, use {safeTransferFrom} whenever possible.\n     *\n     * Requirements:\n     *\n     * - `from` cannot be the zero address.\n     * - `to` cannot be the zero address.\n     * - `tokenId` token must be owned by `from`.\n     * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.\n     *\n     * Emits a {Transfer} event.\n     */\n    function transferFrom(\n        address from,\n        address to,\n        uint256 tokenId\n    ) external;\n\n    /**\n     * @dev Gives permission to `to` to transfer `tokenId` token to another account.\n     * The approval is cleared when the token is transferred.\n     *\n     * Only a single account can be approved at a time, so approving the zero address clears previous approvals.\n     *\n     * Requirements:\n     *\n     * - The caller must own the token or be an approved operator.\n     * - `tokenId` must exist.\n     *\n     * Emits an {Approval} event.\n     */\n    function approve(address to, uint256 tokenId) external;\n\n    /**\n     * @dev Returns the account approved for `tokenId` token.\n     *\n     * Requirements:\n     *\n     * - `tokenId` must exist.\n     */\n    function getApproved(uint256 tokenId) external view returns (address operator);\n\n    /**\n     * @dev Approve or remove `operator` as an operator for the caller.\n     * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller.\n     *\n     * Requirements:\n     *\n     * - The `operator` cannot be the caller.\n     *\n     * Emits an {ApprovalForAll} event.\n     */\n    function setApprovalForAll(address operator, bool _approved) external;\n\n    /**\n     * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.\n     *\n     * See {setApprovalForAll}\n     */\n    function isApprovedForAll(address owner, address operator) external view returns (bool);\n\n    /**\n     * @dev Safely transfers `tokenId` token from `from` to `to`.\n     *\n     * Requirements:\n     *\n     * - `from` cannot be the zero address.\n     * - `to` cannot be the zero address.\n     * - `tokenId` token must exist and be owned by `from`.\n     * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.\n     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.\n     *\n     * Emits a {Transfer} event.\n     */\n    function safeTransferFrom(\n        address from,\n        address to,\n        uint256 tokenId,\n        bytes calldata data\n    ) external;\n}\n"
    },
    "@openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol": {
      "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/IERC721Metadata.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../IERC721.sol\";\n\n/**\n * @title ERC-721 Non-Fungible Token Standard, optional metadata extension\n * @dev See https://eips.ethereum.org/EIPS/eip-721\n */\ninterface IERC721Metadata is IERC721 {\n    /**\n     * @dev Returns the token collection name.\n     */\n    function name() external view returns (string memory);\n\n    /**\n     * @dev Returns the token collection symbol.\n     */\n    function symbol() external view returns (string memory);\n\n    /**\n     * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token.\n     */\n    function tokenURI(uint256 tokenId) external view returns (string memory);\n}\n"
    },
    "@shoyunft/contracts/contracts/interfaces/IOwnable.sol": {
      "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.5.0;\n\ninterface IOwnable {\n    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\n\n    function owner() external view returns (address);\n\n    function renounceOwnership() external;\n\n    function transferOwnership(address newOwner) external;\n}\n"
    },
    "@openzeppelin/contracts/utils/introspection/IERC165.sol": {
      "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC165 standard, as defined in the\n * https://eips.ethereum.org/EIPS/eip-165[EIP].\n *\n * Implementers can declare support of contract interfaces, which can then be\n * queried by others ({ERC165Checker}).\n *\n * For an implementation, see {ERC165}.\n */\ninterface IERC165 {\n    /**\n     * @dev Returns true if this contract implements the interface defined by\n     * `interfaceId`. See the corresponding\n     * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]\n     * to learn more about how these ids are created.\n     *\n     * This function call must use less than 30 000 gas.\n     */\n    function supportsInterface(bytes4 interfaceId) external view returns (bool);\n}\n"
    },
    "@shoyunft/contracts/contracts/libraries/Orders.sol": {
      "content": "// SPDX-License-Identifier: MIT\n\npragma solidity =0.8.3;\n\nlibrary Orders {\n    // keccak256(\"Ask(address signer,address proxy,address token,uint256 tokenId,uint256 amount,address strategy,address currency,address recipient,uint256 deadline,bytes params)\")\n    bytes32 internal constant ASK_TYPEHASH = 0x5fbc9a24e1532fa5245d1ec2dc5592849ae97ac5475f361b1a1f7a6e2ac9b2fd;\n    // keccak256(\"Bid(bytes32 askHash,address signer,uint256 amount,uint256 price,address recipient,address referrer)\")\n    bytes32 internal constant BID_TYPEHASH = 0xb98e1dc48988064e6dfb813618609d7da80a8841e5f277039788ac4b50d497b2;\n\n    struct Ask {\n        address signer;\n        address proxy;\n        address token;\n        uint256 tokenId;\n        uint256 amount;\n        address strategy;\n        address currency;\n        address recipient;\n        uint256 deadline;\n        bytes params;\n        uint8 v;\n        bytes32 r;\n        bytes32 s;\n    }\n\n    struct Bid {\n        bytes32 askHash;\n        address signer;\n        uint256 amount;\n        uint256 price;\n        address recipient;\n        address referrer;\n        uint8 v;\n        bytes32 r;\n        bytes32 s;\n    }\n\n    function hash(Ask memory ask) internal pure returns (bytes32) {\n        return\n            keccak256(\n                abi.encode(\n                    ASK_TYPEHASH,\n                    ask.signer,\n                    ask.proxy,\n                    ask.token,\n                    ask.tokenId,\n                    ask.amount,\n                    ask.strategy,\n                    ask.currency,\n                    ask.recipient,\n                    ask.deadline,\n                    keccak256(ask.params)\n                )\n            );\n    }\n\n    function hash(Bid memory bid) internal pure returns (bytes32) {\n        return\n            keccak256(\n                abi.encode(BID_TYPEHASH, bid.askHash, bid.signer, bid.amount, bid.price, bid.recipient, bid.referrer)\n            );\n    }\n}\n"
    },
    "contracts/LevxStreaming.sol": {
      "content": "// SPDX-License-Identifier: UNLICENSED\n\npragma solidity =0.8.3;\n\nimport \"@openzeppelin/contracts/access/Ownable.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\";\nimport \"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\";\nimport \"@openzeppelin/contracts/utils/Address.sol\";\n\ncontract LevxStreaming is Ownable {\n    using SafeERC20 for IERC20;\n    using Address for address;\n\n    uint256 constant STREAMING_PERIOD = 180 days;\n\n    struct Stream {\n        address recipient;\n        uint64 startedAt;\n        uint256 amount;\n        uint256 claimed;\n    }\n\n    address public immutable levx;\n    address public immutable signer;\n    address public immutable wallet;\n    uint64 public immutable deadline;\n    mapping(bytes32 => Stream[]) public streams;\n\n    event Start(bytes32 indexed id, uint256 nonce, uint256 amount, address indexed recipient);\n    event Claim(bytes32 indexed id, uint256 nonce, uint256 amount, address indexed recipient);\n\n    constructor(\n        address _levx,\n        address _signer,\n        address _wallet,\n        uint64 _deadline\n    ) {\n        levx = _levx;\n        signer = _signer;\n        wallet = _wallet;\n        deadline = _deadline;\n    }\n\n    function start(\n        bytes32 id,\n        uint256 amount,\n        uint8 v,\n        bytes32 r,\n        bytes32 s\n    ) external {\n        require(amount > 0, \"LEVX: INVALID_AMOUNT\");\n\n        uint64 _now = uint64(block.timestamp);\n        require(_now < deadline, \"LEVX: EXPIRED\");\n\n        uint256 nonce = streams[id].length;\n        bytes32 message = keccak256(abi.encodePacked(id, nonce, amount));\n        require(ECDSA.recover(ECDSA.toEthSignedMessageHash(message), v, r, s) == signer, \"LEVX: UNAUTHORIZED\");\n\n        Stream storage stream = streams[id].push();\n        stream.recipient = msg.sender;\n        stream.startedAt = _now;\n        stream.amount = amount;\n\n        emit Start(id, nonce, amount, msg.sender);\n\n        IERC20(levx).safeTransferFrom(wallet, address(this), amount);\n    }\n\n    function claim(\n        bytes32 id,\n        uint256 nonce,\n        address to,\n        bytes calldata callData\n    ) external {\n        Stream storage stream = streams[id][nonce];\n        require(stream.recipient == msg.sender, \"LEVX: FORBIDDEN\");\n\n        uint256 amount = _amountReleased(stream);\n        uint256 pending = amount - stream.claimed;\n        stream.claimed = amount;\n\n        if (to == address(0)) {\n            emit Claim(id, nonce, pending, msg.sender);\n\n            IERC20(levx).safeTransfer(msg.sender, pending);\n        } else {\n            emit Claim(id, nonce, pending, to);\n\n            IERC20(levx).safeTransfer(to, pending);\n            to.functionCall(callData);\n        }\n    }\n\n    function pendingAmount(bytes32 id, uint256 index) external view returns (uint256) {\n        Stream storage stream = streams[id][index];\n        return _amountReleased(stream) - stream.claimed;\n    }\n\n    function _amountReleased(Stream storage stream) internal view returns (uint256) {\n        uint256 duration = block.timestamp - stream.startedAt;\n        if (duration > STREAMING_PERIOD) duration = STREAMING_PERIOD;\n        return (stream.amount * duration) / STREAMING_PERIOD;\n    }\n}\n"
    },
    "contracts/SecondLevxStreaming.sol": {
      "content": "// SPDX-License-Identifier: UNLICENSED\n\npragma solidity =0.8.3;\n\nimport \"./LevxStreaming.sol\";\n\ncontract SecondLevxStreaming is LevxStreaming {\n    constructor(\n        address _levx,\n        address _signer,\n        address _wallet,\n        uint64 _deadline\n    ) LevxStreaming(_levx, _signer, _wallet, _deadline) {}\n}\n"
    },
    "contracts/LevxPayout.sol": {
      "content": "// SPDX-License-Identifier: UNLICENSED\n\npragma solidity =0.8.3;\n\nimport \"@openzeppelin/contracts/access/Ownable.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\";\nimport \"@openzeppelin/contracts/utils/Address.sol\";\n\ncontract LevxPayout is Ownable {\n    using SafeERC20 for IERC20;\n    using Address for address;\n\n    address public immutable levx;\n\n    Payout[] public payouts;\n\n    struct Payout {\n        address wallet;\n        address recipient;\n        uint32 startedAt;\n        uint32 duration;\n        uint32 stoppedAt;\n        uint256 amount;\n        uint256 claimed;\n    }\n\n    event Start(uint256 indexed id, address wallet, address indexed recipient, uint32 duration, uint256 amount);\n    event Stop(uint256 indexed id, uint256 pendingAmount);\n    event Claim(uint256 indexed id, uint256 amount, address indexed recipient);\n\n    constructor(address _levx) {\n        levx = _levx;\n    }\n\n    function start(\n        address wallet,\n        address recipient,\n        uint32 duration,\n        uint256 amount\n    ) external onlyOwner {\n        require(amount > 0, \"LEVX: INVALID_AMOUNT\");\n\n        uint256 id = payouts.length;\n        Payout storage payout = payouts.push();\n        payout.wallet = wallet;\n        payout.recipient = recipient;\n        payout.startedAt = uint32(block.timestamp);\n        payout.duration = duration;\n        payout.amount = amount;\n\n        emit Start(id, wallet, recipient, duration, amount);\n\n        IERC20(levx).safeTransferFrom(wallet, address(this), amount);\n    }\n\n    function stop(uint256 id) external onlyOwner {\n        Payout storage payout = payouts[id];\n        require(payout.stoppedAt == 0, \"LEVX: STOPPED\");\n\n        uint256 released = _amountReleased(payout);\n        uint256 remaining = payout.amount - released;\n        require(remaining > 0, \"LEVX: FINISHED\");\n\n        payout.claimed = released;\n        payout.stoppedAt = uint32(block.timestamp);\n\n        uint256 pending = released - payout.claimed;\n        emit Stop(id, pending);\n        IERC20(levx).safeTransfer(payout.wallet, remaining);\n        if (pending > 0) {\n            IERC20(levx).safeTransfer(payout.recipient, pending);\n        }\n    }\n\n    function claim(\n        uint256 id,\n        address to,\n        bytes calldata callData\n    ) external {\n        Payout storage payout = payouts[id];\n        require(payout.recipient == msg.sender, \"LEVX: FORBIDDEN\");\n\n        uint256 released = _amountReleased(payout);\n        uint256 pending = released - payout.claimed;\n        payout.claimed = released;\n\n        if (to == address(0)) {\n            emit Claim(id, pending, msg.sender);\n\n            IERC20(levx).safeTransfer(msg.sender, pending);\n        } else {\n            emit Claim(id, pending, to);\n\n            IERC20(levx).safeTransfer(to, pending);\n            to.functionCall(callData);\n        }\n    }\n\n    function pendingAmount(uint256 id) external view returns (uint256) {\n        Payout storage payout = payouts[id];\n        return _amountReleased(payout) - payout.claimed;\n    }\n\n    function _amountReleased(Payout storage stream) internal view returns (uint256) {\n        uint256 duration = block.timestamp - stream.startedAt;\n        uint256 _total = uint256(stream.duration);\n        if (duration >= _total) return stream.amount;\n        return (stream.amount * duration) / _total;\n    }\n}\n"
    },
    "contracts/NFTAirdrops.sol": {
      "content": "// SPDX-License-Identifier: UNLICENSED\n\npragma solidity =0.8.3;\n\nimport \"@openzeppelin/contracts/access/Ownable.sol\";\nimport \"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\";\nimport \"@shoyunft/contracts/contracts/interfaces/INFT721.sol\";\n\ncontract NFTAirdrops is Ownable {\n    address public immutable nftContract;\n    mapping(bytes32 => Airdrop) public airdrops;\n    mapping(address => bool) public isMinter;\n    mapping(bytes32 => mapping(bytes32 => bool)) internal _minted;\n    uint256 internal _tokenId;\n\n    struct Airdrop {\n        address signer;\n        uint32 deadline;\n        uint32 max;\n        uint32 minted;\n    }\n\n    event SetMinter(address account, bool indexed isMinter);\n    event Add(bytes32 indexed slug, address signer, uint32 deadline, uint32 max);\n    event Claim(bytes32 indexed slug, bytes32 indexed id, address indexed to, uint256 tokenId);\n\n    constructor(address _nftContract, uint256 fromTokenId) {\n        nftContract = _nftContract;\n        _tokenId = fromTokenId;\n    }\n\n    function setMinter(address account, bool _isMinter) external onlyOwner {\n        isMinter[account] = _isMinter;\n\n        emit SetMinter(account, _isMinter);\n    }\n\n    function transferOwnershipOfNFTContract(address newOwner) external onlyOwner {\n        INFT721(nftContract).transferOwnership(newOwner);\n    }\n\n    function setRoyaltyFeeRecipient(address _royaltyFeeRecipient) external onlyOwner {\n        INFT721(nftContract).setRoyaltyFeeRecipient(_royaltyFeeRecipient);\n    }\n\n    function setRoyaltyFee(uint8 _royaltyFee) external onlyOwner {\n        INFT721(nftContract).setRoyaltyFee(_royaltyFee);\n    }\n\n    function setTokenURI(uint256 tokenId, string memory uri) external onlyOwner {\n        INFT721(nftContract).setTokenURI(tokenId, uri);\n    }\n\n    function setBaseURI(string memory baseURI) external onlyOwner {\n        INFT721(nftContract).setBaseURI(baseURI);\n    }\n\n    function parkTokenIds(uint256 toTokenId) external onlyOwner {\n        INFT721(nftContract).parkTokenIds(toTokenId);\n    }\n\n    function mint(\n        address to,\n        uint256 tokenId,\n        bytes calldata data\n    ) external {\n        require(msg.sender == owner() || isMinter[msg.sender], \"LEVX: FORBIDDEN\");\n\n        INFT721(nftContract).mint(to, tokenId, data);\n    }\n\n    function mintBatch(\n        address to,\n        uint256[] calldata tokenIds,\n        bytes calldata data\n    ) external {\n        require(msg.sender == owner() || isMinter[msg.sender], \"LEVX: FORBIDDEN\");\n\n        INFT721(nftContract).mintBatch(to, tokenIds, data);\n    }\n\n    function add(\n        bytes32 slug,\n        address signer,\n        uint32 deadline,\n        uint32 max\n    ) external onlyOwner {\n        Airdrop storage airdrop = airdrops[slug];\n        require(airdrop.signer == address(0), \"LEVX: ADDED\");\n\n        airdrop.signer = signer;\n        airdrop.deadline = deadline;\n        airdrop.max = max;\n\n        emit Add(slug, signer, deadline, max);\n    }\n\n    function claim(\n        bytes32 slug,\n        bytes32 id,\n        uint8 v,\n        bytes32 r,\n        bytes32 s,\n        address to,\n        bytes calldata data\n    ) external {\n        Airdrop storage airdrop = airdrops[slug];\n        (address signer, uint32 deadline, uint32 max, uint32 minted) = (\n            airdrop.signer,\n            airdrop.deadline,\n            airdrop.max,\n            airdrop.minted\n        );\n\n        require(signer != address(0), \"LEVX: INVALID_SLUG\");\n        require(deadline == 0 || uint32(block.timestamp) < deadline, \"LEVX: EXPIRED\");\n        require(max == 0 || minted < max, \"LEVX: FINISHED\");\n        require(!_minted[slug][id], \"LEVX: MINTED\");\n\n        {\n            bytes32 message = keccak256(abi.encodePacked(slug, id));\n            require(ECDSA.recover(ECDSA.toEthSignedMessageHash(message), v, r, s) == signer, \"LEVX: UNAUTHORIZED\");\n        }\n\n        airdrop.minted = minted + 1;\n        _minted[slug][id] = true;\n\n        uint256 tokenId = _tokenId++;\n        emit Claim(slug, id, to, tokenId);\n        INFT721(nftContract).mint(to, tokenId, data);\n    }\n}\n"
    },
    "contracts/ETHAirdrop.sol": {
      "content": "// SPDX-License-Identifier: UNLICENSED\n\npragma solidity =0.8.3;\n\nimport \"@openzeppelin/contracts/access/Ownable.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol\";\nimport \"./uniswapv2/interfaces/IUniswapV2Router01.sol\";\nimport \"./uniswapv2/interfaces/IUniswapV2Pair.sol\";\nimport \"./uniswapv2/interfaces/IWETH.sol\";\nimport \"./uniswapv2/libraries/UniswapV2Library.sol\";\nimport \"./MerkleProof.sol\";\n\ncontract ETHAirdrop is Ownable, MerkleProof {\n    using SafeERC20 for IERC20;\n\n    address public immutable levx;\n    address public immutable weth;\n    address public immutable router;\n    mapping(bytes32 => bool) public isValidMerkleRoot;\n    mapping(bytes32 => mapping(bytes32 => bool)) internal _hasClaimed;\n\n    event Deposit(uint256 amount, address from);\n    event Withdraw(uint256 amount, address to);\n    event AddMerkleRoot(bytes32 indexed merkleRoot);\n    event Claim(bytes32 indexed merkleRoot, address indexed account, uint256 amount, address to);\n\n    modifier ensure(uint256 deadline) {\n        require(deadline >= block.timestamp, \"LEVX: EXPIRED\");\n        _;\n    }\n\n    constructor(\n        address _owner,\n        address _levx,\n        address _weth,\n        address _router\n    ) {\n        levx = _levx;\n        weth = _weth;\n        router = _router;\n        _transferOwnership(_owner);\n    }\n\n    receive() external payable {\n        emit Deposit(msg.value, msg.sender);\n    }\n\n    function withdraw(uint256 amount) external onlyOwner {\n        payable(msg.sender).transfer(amount);\n\n        emit Withdraw(amount, msg.sender);\n    }\n\n    function addMerkleRoot(bytes32 merkleRoot) external onlyOwner {\n        require(!isValidMerkleRoot[merkleRoot], \"SHOYU: DUPLICATE_ROOT\");\n        isValidMerkleRoot[merkleRoot] = true;\n\n        emit AddMerkleRoot(merkleRoot);\n    }\n\n    function claim(\n        bytes32 merkleRoot,\n        bytes32[] calldata merkleProof,\n        uint256 amount,\n        address to\n    ) public {\n        require(isValidMerkleRoot[merkleRoot], \"SHOYU: INVALID_ROOT\");\n\n        bytes32 leaf = keccak256(abi.encodePacked(msg.sender, amount));\n        require(!_hasClaimed[merkleRoot][leaf], \"SHOYU: FORBIDDEN\");\n        require(verify(merkleRoot, leaf, merkleProof), \"SHOYU: INVALID_PROOF\");\n\n        _hasClaimed[merkleRoot][leaf] = true;\n        if (to != address(this)) {\n            payable(to).transfer(amount);\n        }\n\n        emit Claim(merkleRoot, msg.sender, amount, to);\n    }\n\n    function batchClaim(\n        bytes32[] calldata merkleRoots,\n        bytes32[][] calldata merkleProofs,\n        uint256[] calldata amounts,\n        address to\n    ) external {\n        for (uint256 i; i < merkleRoots.length; i++) {\n            claim(merkleRoots[i], merkleProofs[i], amounts[i], to);\n        }\n    }\n\n    function claimAndSwapToLevx(\n        bytes32 merkleRoot,\n        bytes32[] calldata merkleProof,\n        uint256 amount,\n        uint256 amountOutMin,\n        address to,\n        uint256 deadline\n    ) public ensure(deadline) returns (uint256 amountOut) {\n        claim(merkleRoot, merkleProof, amount, address(this));\n\n        address[] memory path = new address[](2);\n        path[0] = weth;\n        path[1] = levx;\n        uint256[] memory amounts = IUniswapV2Router01(router).swapExactETHForTokens{value: amount}(\n            amountOutMin,\n            path,\n            to,\n            deadline\n        );\n        amountOut = amounts[1];\n    }\n\n    function batchClaimAndSwapToLevx(\n        bytes32[] calldata merkleRoots,\n        bytes32[][] calldata merkleProofs,\n        uint256[] calldata amounts,\n        uint256 amountOutMin,\n        address to,\n        uint256 deadline\n    ) public ensure(deadline) returns (uint256 amountOut) {\n        uint256 amountIn;\n        for (uint256 i; i < merkleRoots.length; i++) {\n            uint256 amount = amounts[i];\n            claim(merkleRoots[i], merkleProofs[i], amount, address(this));\n            amountIn += amount;\n        }\n\n        address[] memory path = new address[](2);\n        path[0] = weth;\n        path[1] = levx;\n        uint256[] memory _amounts = IUniswapV2Router01(router).swapExactETHForTokens{value: amountIn}(\n            amountOutMin,\n            path,\n            to,\n            deadline\n        );\n        amountOut = _amounts[1];\n    }\n}\n"
    },
    "contracts/uniswapv2/interfaces/IUniswapV2Router01.sol": {
      "content": "// SPDX-License-Identifier: GPL-3.0\n\npragma solidity >=0.6.2;\n\ninterface IUniswapV2Router01 {\n    function factory() external pure returns (address);\n    function WETH() external pure returns (address);\n\n    function addLiquidity(\n        address tokenA,\n        address tokenB,\n        uint amountADesired,\n        uint amountBDesired,\n        uint amountAMin,\n        uint amountBMin,\n        address to,\n        uint deadline\n    ) external returns (uint amountA, uint amountB, uint liquidity);\n    function addLiquidityETH(\n        address token,\n        uint amountTokenDesired,\n        uint amountTokenMin,\n        uint amountETHMin,\n        address to,\n        uint deadline\n    ) external payable returns (uint amountToken, uint amountETH, uint liquidity);\n    function removeLiquidity(\n        address tokenA,\n        address tokenB,\n        uint liquidity,\n        uint amountAMin,\n        uint amountBMin,\n        address to,\n        uint deadline\n    ) external returns (uint amountA, uint amountB);\n    function removeLiquidityETH(\n        address token,\n        uint liquidity,\n        uint amountTokenMin,\n        uint amountETHMin,\n        address to,\n        uint deadline\n    ) external returns (uint amountToken, uint amountETH);\n    function removeLiquidityWithPermit(\n        address tokenA,\n        address tokenB,\n        uint liquidity,\n        uint amountAMin,\n        uint amountBMin,\n        address to,\n        uint deadline,\n        bool approveMax, uint8 v, bytes32 r, bytes32 s\n    ) external returns (uint amountA, uint amountB);\n    function removeLiquidityETHWithPermit(\n        address token,\n        uint liquidity,\n        uint amountTokenMin,\n        uint amountETHMin,\n        address to,\n        uint deadline,\n        bool approveMax, uint8 v, bytes32 r, bytes32 s\n    ) external returns (uint amountToken, uint amountETH);\n    function swapExactTokensForTokens(\n        uint amountIn,\n        uint amountOutMin,\n        address[] calldata path,\n        address to,\n        uint deadline\n    ) external returns (uint[] memory amounts);\n    function swapTokensForExactTokens(\n        uint amountOut,\n        uint amountInMax,\n        address[] calldata path,\n        address to,\n        uint deadline\n    ) external returns (uint[] memory amounts);\n    function swapExactETHForTokens(uint amountOutMin, address[] calldata path, address to, uint deadline)\n        external\n        payable\n        returns (uint[] memory amounts);\n    function swapTokensForExactETH(uint amountOut, uint amountInMax, address[] calldata path, address to, uint deadline)\n        external\n        returns (uint[] memory amounts);\n    function swapExactTokensForETH(uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline)\n        external\n        returns (uint[] memory amounts);\n    function swapETHForExactTokens(uint amountOut, address[] calldata path, address to, uint deadline)\n        external\n        payable\n        returns (uint[] memory amounts);\n\n    function quote(uint amountA, uint reserveA, uint reserveB) external pure returns (uint amountB);\n    function getAmountOut(uint amountIn, uint reserveIn, uint reserveOut) external pure returns (uint amountOut);\n    function getAmountIn(uint amountOut, uint reserveIn, uint reserveOut) external pure returns (uint amountIn);\n    function getAmountsOut(uint amountIn, address[] calldata path) external view returns (uint[] memory amounts);\n    function getAmountsIn(uint amountOut, address[] calldata path) external view returns (uint[] memory amounts);\n}"
    },
    "contracts/uniswapv2/interfaces/IUniswapV2Pair.sol": {
      "content": "// SPDX-License-Identifier: GPL-3.0\n\npragma solidity >=0.5.0;\n\ninterface IUniswapV2Pair {\n    event Approval(address indexed owner, address indexed spender, uint value);\n    event Transfer(address indexed from, address indexed to, uint value);\n\n    function name() external pure returns (string memory);\n    function symbol() external pure returns (string memory);\n    function decimals() external pure returns (uint8);\n    function totalSupply() external view returns (uint);\n    function balanceOf(address owner) external view returns (uint);\n    function allowance(address owner, address spender) external view returns (uint);\n\n    function approve(address spender, uint value) external returns (bool);\n    function transfer(address to, uint value) external returns (bool);\n    function transferFrom(address from, address to, uint value) external returns (bool);\n\n    function DOMAIN_SEPARATOR() external view returns (bytes32);\n    function PERMIT_TYPEHASH() external pure returns (bytes32);\n    function nonces(address owner) external view returns (uint);\n\n    function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external;\n\n    event Mint(address indexed sender, uint amount0, uint amount1);\n    event Burn(address indexed sender, uint amount0, uint amount1, address indexed to);\n    event Swap(\n        address indexed sender,\n        uint amount0In,\n        uint amount1In,\n        uint amount0Out,\n        uint amount1Out,\n        address indexed to\n    );\n    event Sync(uint112 reserve0, uint112 reserve1);\n\n    function MINIMUM_LIQUIDITY() external pure returns (uint);\n    function factory() external view returns (address);\n    function token0() external view returns (address);\n    function token1() external view returns (address);\n    function getReserves() external view returns (uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast);\n    function price0CumulativeLast() external view returns (uint);\n    function price1CumulativeLast() external view returns (uint);\n    function kLast() external view returns (uint);\n\n    function mint(address to) external returns (uint liquidity);\n    function burn(address to) external returns (uint amount0, uint amount1);\n    function swap(uint amount0Out, uint amount1Out, address to, bytes calldata data) external;\n    function skim(address to) external;\n    function sync() external;\n\n    function initialize(address, address) external;\n}"
    },
    "contracts/uniswapv2/interfaces/IWETH.sol": {
      "content": "// SPDX-License-Identifier: GPL-3.0\n\npragma solidity >=0.5.0;\n\ninterface IWETH {\n    function deposit() external payable;\n    function transfer(address to, uint value) external returns (bool);\n    function withdraw(uint) external;\n}"
    },
    "contracts/uniswapv2/libraries/UniswapV2Library.sol": {
      "content": "// SPDX-License-Identifier: GPL-3.0\n\npragma solidity =0.8.3;\n\nimport \"@openzeppelin/contracts/utils/math/SafeMath.sol\";\nimport \"../interfaces/IUniswapV2Pair.sol\";\n\nlibrary UniswapV2Library {\n    using SafeMath for uint256;\n\n    // returns sorted token addresses, used to handle return values from pairs sorted in this order\n    function sortTokens(address tokenA, address tokenB) internal pure returns (address token0, address token1) {\n        require(tokenA != tokenB, \"UniswapV2Library: IDENTICAL_ADDRESSES\");\n        (token0, token1) = tokenA < tokenB ? (tokenA, tokenB) : (tokenB, tokenA);\n        require(token0 != address(0), \"UniswapV2Library: ZERO_ADDRESS\");\n    }\n\n    // calculates the CREATE2 address for a pair without making any external calls\n    function pairFor(\n        address factory,\n        address tokenA,\n        address tokenB\n    ) internal pure returns (address pair) {\n        (address token0, address token1) = sortTokens(tokenA, tokenB);\n        pair = address(\n            uint160(\n                uint256(\n                    keccak256(\n                        abi.encodePacked(\n                            hex\"ff\",\n                            factory,\n                            keccak256(abi.encodePacked(token0, token1)),\n                            hex\"e18a34eb0e04b04f7a0ac29a6e80748dca96319b42c54d679cb821dca90c6303\" // init code hash\n                        )\n                    )\n                )\n            )\n        );\n    }\n\n    // fetches and sorts the reserves for a pair\n    function getReserves(\n        address factory,\n        address tokenA,\n        address tokenB\n    ) internal view returns (uint256 reserveA, uint256 reserveB) {\n        (address token0, ) = sortTokens(tokenA, tokenB);\n        (uint256 reserve0, uint256 reserve1, ) = IUniswapV2Pair(pairFor(factory, tokenA, tokenB)).getReserves();\n        (reserveA, reserveB) = tokenA == token0 ? (reserve0, reserve1) : (reserve1, reserve0);\n    }\n\n    // given some amount of an asset and pair reserves, returns an equivalent amount of the other asset\n    function quote(\n        uint256 amountA,\n        uint256 reserveA,\n        uint256 reserveB\n    ) internal pure returns (uint256 amountB) {\n        require(amountA > 0, \"UniswapV2Library: INSUFFICIENT_AMOUNT\");\n        require(reserveA > 0 && reserveB > 0, \"UniswapV2Library: INSUFFICIENT_LIQUIDITY\");\n        amountB = amountA.mul(reserveB) / reserveA;\n    }\n\n    // given an input amount of an asset and pair reserves, returns the maximum output amount of the other asset\n    function getAmountOut(\n        uint256 amountIn,\n        uint256 reserveIn,\n        uint256 reserveOut\n    ) internal pure returns (uint256 amountOut) {\n        require(amountIn > 0, \"UniswapV2Library: INSUFFICIENT_INPUT_AMOUNT\");\n        require(reserveIn > 0 && reserveOut > 0, \"UniswapV2Library: INSUFFICIENT_LIQUIDITY\");\n        uint256 amountInWithFee = amountIn.mul(997);\n        uint256 numerator = amountInWithFee.mul(reserveOut);\n        uint256 denominator = reserveIn.mul(1000).add(amountInWithFee);\n        amountOut = numerator / denominator;\n    }\n\n    // given an output amount of an asset and pair reserves, returns a required input amount of the other asset\n    function getAmountIn(\n        uint256 amountOut,\n        uint256 reserveIn,\n        uint256 reserveOut\n    ) internal pure returns (uint256 amountIn) {\n        require(amountOut > 0, \"UniswapV2Library: INSUFFICIENT_OUTPUT_AMOUNT\");\n        require(reserveIn > 0 && reserveOut > 0, \"UniswapV2Library: INSUFFICIENT_LIQUIDITY\");\n        uint256 numerator = reserveIn.mul(amountOut).mul(1000);\n        uint256 denominator = reserveOut.sub(amountOut).mul(997);\n        amountIn = (numerator / denominator).add(1);\n    }\n\n    // performs chained getAmountOut calculations on any number of pairs\n    function getAmountsOut(\n        address factory,\n        uint256 amountIn,\n        address[] memory path\n    ) internal view returns (uint256[] memory amounts) {\n        require(path.length >= 2, \"UniswapV2Library: INVALID_PATH\");\n        amounts = new uint256[](path.length);\n        amounts[0] = amountIn;\n        for (uint256 i; i < path.length - 1; i++) {\n            (uint256 reserveIn, uint256 reserveOut) = getReserves(factory, path[i], path[i + 1]);\n            amounts[i + 1] = getAmountOut(amounts[i], reserveIn, reserveOut);\n        }\n    }\n\n    // performs chained getAmountIn calculations on any number of pairs\n    function getAmountsIn(\n        address factory,\n        uint256 amountOut,\n        address[] memory path\n    ) internal view returns (uint256[] memory amounts) {\n        require(path.length >= 2, \"UniswapV2Library: INVALID_PATH\");\n        amounts = new uint256[](path.length);\n        amounts[amounts.length - 1] = amountOut;\n        for (uint256 i = path.length - 1; i > 0; i--) {\n            (uint256 reserveIn, uint256 reserveOut) = getReserves(factory, path[i - 1], path[i]);\n            amounts[i - 1] = getAmountIn(amounts[i], reserveIn, reserveOut);\n        }\n    }\n}\n"
    },
    "@openzeppelin/contracts/utils/math/SafeMath.sol": {
      "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/math/SafeMath.sol)\n\npragma solidity ^0.8.0;\n\n// CAUTION\n// This version of SafeMath should only be used with Solidity 0.8 or later,\n// because it relies on the compiler's built in overflow checks.\n\n/**\n * @dev Wrappers over Solidity's arithmetic operations.\n *\n * NOTE: `SafeMath` is generally not needed starting with Solidity 0.8, since the compiler\n * now has built in overflow checking.\n */\nlibrary SafeMath {\n    /**\n     * @dev Returns the addition of two unsigned integers, with an overflow flag.\n     *\n     * _Available since v3.4._\n     */\n    function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {\n        unchecked {\n            uint256 c = a + b;\n            if (c < a) return (false, 0);\n            return (true, c);\n        }\n    }\n\n    /**\n     * @dev Returns the substraction of two unsigned integers, with an overflow flag.\n     *\n     * _Available since v3.4._\n     */\n    function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {\n        unchecked {\n            if (b > a) return (false, 0);\n            return (true, a - b);\n        }\n    }\n\n    /**\n     * @dev Returns the multiplication of two unsigned integers, with an overflow flag.\n     *\n     * _Available since v3.4._\n     */\n    function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {\n        unchecked {\n            // Gas optimization: this is cheaper than requiring 'a' not being zero, but the\n            // benefit is lost if 'b' is also tested.\n            // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522\n            if (a == 0) return (true, 0);\n            uint256 c = a * b;\n            if (c / a != b) return (false, 0);\n            return (true, c);\n        }\n    }\n\n    /**\n     * @dev Returns the division of two unsigned integers, with a division by zero flag.\n     *\n     * _Available since v3.4._\n     */\n    function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {\n        unchecked {\n            if (b == 0) return (false, 0);\n            return (true, a / b);\n        }\n    }\n\n    /**\n     * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.\n     *\n     * _Available since v3.4._\n     */\n    function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {\n        unchecked {\n            if (b == 0) return (false, 0);\n            return (true, a % b);\n        }\n    }\n\n    /**\n     * @dev Returns the addition of two unsigned integers, reverting on\n     * overflow.\n     *\n     * Counterpart to Solidity's `+` operator.\n     *\n     * Requirements:\n     *\n     * - Addition cannot overflow.\n     */\n    function add(uint256 a, uint256 b) internal pure returns (uint256) {\n        return a + b;\n    }\n\n    /**\n     * @dev Returns the subtraction of two unsigned integers, reverting on\n     * overflow (when the result is negative).\n     *\n     * Counterpart to Solidity's `-` operator.\n     *\n     * Requirements:\n     *\n     * - Subtraction cannot overflow.\n     */\n    function sub(uint256 a, uint256 b) internal pure returns (uint256) {\n        return a - b;\n    }\n\n    /**\n     * @dev Returns the multiplication of two unsigned integers, reverting on\n     * overflow.\n     *\n     * Counterpart to Solidity's `*` operator.\n     *\n     * Requirements:\n     *\n     * - Multiplication cannot overflow.\n     */\n    function mul(uint256 a, uint256 b) internal pure returns (uint256) {\n        return a * b;\n    }\n\n    /**\n     * @dev Returns the integer division of two unsigned integers, reverting on\n     * division by zero. The result is rounded towards zero.\n     *\n     * Counterpart to Solidity's `/` operator.\n     *\n     * Requirements:\n     *\n     * - The divisor cannot be zero.\n     */\n    function div(uint256 a, uint256 b) internal pure returns (uint256) {\n        return a / b;\n    }\n\n    /**\n     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),\n     * reverting when dividing by zero.\n     *\n     * Counterpart to Solidity's `%` operator. This function uses a `revert`\n     * opcode (which leaves remaining gas untouched) while Solidity uses an\n     * invalid opcode to revert (consuming all remaining gas).\n     *\n     * Requirements:\n     *\n     * - The divisor cannot be zero.\n     */\n    function mod(uint256 a, uint256 b) internal pure returns (uint256) {\n        return a % b;\n    }\n\n    /**\n     * @dev Returns the subtraction of two unsigned integers, reverting with custom message on\n     * overflow (when the result is negative).\n     *\n     * CAUTION: This function is deprecated because it requires allocating memory for the error\n     * message unnecessarily. For custom revert reasons use {trySub}.\n     *\n     * Counterpart to Solidity's `-` operator.\n     *\n     * Requirements:\n     *\n     * - Subtraction cannot overflow.\n     */\n    function sub(\n        uint256 a,\n        uint256 b,\n        string memory errorMessage\n    ) internal pure returns (uint256) {\n        unchecked {\n            require(b <= a, errorMessage);\n            return a - b;\n        }\n    }\n\n    /**\n     * @dev Returns the integer division of two unsigned integers, reverting with custom message on\n     * division by zero. The result is rounded towards zero.\n     *\n     * Counterpart to Solidity's `/` operator. Note: this function uses a\n     * `revert` opcode (which leaves remaining gas untouched) while Solidity\n     * uses an invalid opcode to revert (consuming all remaining gas).\n     *\n     * Requirements:\n     *\n     * - The divisor cannot be zero.\n     */\n    function div(\n        uint256 a,\n        uint256 b,\n        string memory errorMessage\n    ) internal pure returns (uint256) {\n        unchecked {\n            require(b > 0, errorMessage);\n            return a / b;\n        }\n    }\n\n    /**\n     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),\n     * reverting with custom message when dividing by zero.\n     *\n     * CAUTION: This function is deprecated because it requires allocating memory for the error\n     * message unnecessarily. For custom revert reasons use {tryMod}.\n     *\n     * Counterpart to Solidity's `%` operator. This function uses a `revert`\n     * opcode (which leaves remaining gas untouched) while Solidity uses an\n     * invalid opcode to revert (consuming all remaining gas).\n     *\n     * Requirements:\n     *\n     * - The divisor cannot be zero.\n     */\n    function mod(\n        uint256 a,\n        uint256 b,\n        string memory errorMessage\n    ) internal pure returns (uint256) {\n        unchecked {\n            require(b > 0, errorMessage);\n            return a % b;\n        }\n    }\n}\n"
    },
    "contracts/uniswapv2/interfaces/IUniswapV2Router02.sol": {
      "content": "// SPDX-License-Identifier: GPL-3.0\n\npragma solidity >=0.6.2;\n\nimport './IUniswapV2Router01.sol';\n\ninterface IUniswapV2Router02 is IUniswapV2Router01 {\n    function removeLiquidityETHSupportingFeeOnTransferTokens(\n        address token,\n        uint liquidity,\n        uint amountTokenMin,\n        uint amountETHMin,\n        address to,\n        uint deadline\n    ) external returns (uint amountETH);\n    function removeLiquidityETHWithPermitSupportingFeeOnTransferTokens(\n        address token,\n        uint liquidity,\n        uint amountTokenMin,\n        uint amountETHMin,\n        address to,\n        uint deadline,\n        bool approveMax, uint8 v, bytes32 r, bytes32 s\n    ) external returns (uint amountETH);\n\n    function swapExactTokensForTokensSupportingFeeOnTransferTokens(\n        uint amountIn,\n        uint amountOutMin,\n        address[] calldata path,\n        address to,\n        uint deadline\n    ) external;\n    function swapExactETHForTokensSupportingFeeOnTransferTokens(\n        uint amountOutMin,\n        address[] calldata path,\n        address to,\n        uint deadline\n    ) external payable;\n    function swapExactTokensForETHSupportingFeeOnTransferTokens(\n        uint amountIn,\n        uint amountOutMin,\n        address[] calldata path,\n        address to,\n        uint deadline\n    ) external;\n}"
    }
  },
  "settings": {
    "optimizer": {
      "enabled": true,
      "runs": 200
    },
    "outputSelection": {
      "*": {
        "*": [
          "abi",
          "evm.bytecode",
          "evm.deployedBytecode",
          "evm.methodIdentifiers",
          "metadata",
          "devdoc",
          "userdoc",
          "storageLayout",
          "evm.gasEstimates"
        ],
        "": [
          "ast"
        ]
      }
    },
    "metadata": {
      "useLiteralContent": true
    },
    "libraries": {
      "": {
        "__CACHE_BREAKER__": "0x00000000d41867734bbee4c6863d9255b2b06ac1"
      }
    }
  }
}