Contract Address Details

0xd9CC0c0591a4b8D62fd3C8BA65B1A04965F4d3c7

Contract Name
SpecialHorseFarmV2
Creator
0xe4bc3d–a61c7a at 0xfc5fa8–a96a2c
Balance
0 ADIL ( )
Tokens
Fetching tokens...
Transactions
0 Transactions
Transfers
0 Transfers
Gas Used
Fetching gas used...
Last Balance Update
13122672
Contract name:
SpecialHorseFarmV2




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




Optimization runs
999999
Verified at
2024-10-31 06:39:48.035815Z

contracts/farm-v2/SpecialHorseFarmV2.sol

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

import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import "@openzeppelin/contracts/utils/math/SafeMath.sol";

import "../libraries/BytesLibrary.sol";
import "../libraries/StringLibrary.sol";
import "../interfaces/ITransporter.sol";

import "../abtracts/OwnerOperator.sol";
import "@openzeppelin/contracts-upgradeable/token/ERC721/utils/ERC721HolderUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol";
import "../interfaces/ICollection721.sol";

contract SpecialHorseFarmV2 is ERC721HolderUpgradeable, OwnerOperator, PausableUpgradeable, ReentrancyGuardUpgradeable {
    using SafeERC20 for IERC20;
    using SafeMath for uint256;
    using StringLibrary for string;
    using BytesLibrary for bytes32;

    struct LeaseData {
        address owner;
        address horseAddress;
        uint256 horseId;
        uint256 blockExpired;
        string nonce;
        uint8 v;
        bytes32 r;
        bytes32 s;
    }

    struct SavedLease {
        address owner;
        address horseAddress;
        uint256 horseId;
        uint256 blockExpired;
    }

    struct WithdrawData {
        address owner;
        address horseAddress;
        uint256 horseId;
        uint256 blockExpired;
        string nonce;
        uint8 v;
        bytes32 r;
        bytes32 s;
    }

    struct SavedWithdraw {
        address owner;
        address horseAddress;
        uint256 horseId;
        uint256 blockExpired;
    }

    // Mapping from nft token id to owner of token
    mapping(address => mapping(uint256 => address)) public ownerOf;

    // Mapping from sign message to checking value
    mapping(bytes32 => bool) public leaseCompleted;
    // Mapping from nonce to leaseData
    mapping(string => SavedLease) public leaseData;
    // Mapping from user address to lease count
    mapping(address => uint256) public leaseCountOf;
    // Mapping from user address and lease index to lease nonce
    mapping(address => mapping(uint256 => string)) public leaseNoneOf;

    // Mapping from sign message to checking value
    mapping(bytes32 => bool) public withdrawCompleted;
    // Mapping from nonce to withdrawData
    mapping(string => SavedWithdraw) public withdrawData;
    // Mapping from user address to withdraw count
    mapping(address => uint256) public withdrawCountOf;
    // Mapping from user address and withdraw index to withdraw nonce
    mapping(address => mapping(uint256 => string)) public withdrawNoneOf;
    //Mapping verify horsenft
    mapping(address => bool) public isHorseNFT;

    event Lease(address indexed owner, address indexed signer, uint256 indexed horseId, string nonce);
    event Withdraw(address indexed owner, address indexed signer, uint256 indexed horseId, string nonce);
    event Signer(address signers);

    ITransporter public transporter;
    ICollection721 public collection721;

    mapping(address => mapping(uint256 => uint256[])) public horseItems;

    function init() external initializer {
        super.initialize();
        super.__Pausable_init();
    }
    function pause() external virtual onlyOwner {
        _pause();
    }

    function unpause() external virtual onlyOwner {
        _unpause();
    }

    function setCollection(address _collection) external operatorOrOwner {
        collection721 = ICollection721(_collection);
    }

    function setTransporter(address _transporter) external virtual onlyOwner {
        transporter = ITransporter(_transporter);
    }

    function setHorseNFT(address _horseNFT) external virtual operatorOrOwner {
        isHorseNFT[_horseNFT] = true;
    }

    /**
     * @dev withdraw token that user mistakenly transferred.
     */
    function withdrawToken(address token) external virtual onlyOwner {
        uint256 amount = IERC20(token).balanceOf(address(this));
        require(amount > 0, "SpecialHorseFarmV2: zero out amount");
        IERC20(token).safeTransfer(msg.sender, amount);
    }

    /**
     * @dev withdraw nft that user mistakenly transferred.
     */
    function withdrawNFT(address token, uint256 tokenId) external virtual onlyOwner {
        require(
            !isHorseNFT[token] || ownerOf[token][tokenId] == address(0),
            "SpecialHorseFarmV2: horse belong to contract"
        );
        IERC721(token).safeTransferFrom(address(this), msg.sender, tokenId);
    }

    /**
     * @dev user lease horse.
     */
    function lease(LeaseData memory data, uint256[] memory items) external virtual nonReentrant whenNotPaused {
        require(isHorseNFT[data.horseAddress], "SpecialHorseFarmV2: invalid horse address");
        require(msg.sender == data.owner, "SpecialHorseFarmV2: sender is not owner");
        (bytes32 message, address signer) = _verifyLease(data);

        leaseCompleted[message] = true;
        leaseData[data.nonce] = SavedLease({
            owner: data.owner,
            horseAddress: data.horseAddress,
            horseId: data.horseId,
            blockExpired: data.blockExpired
        });

        leaseNoneOf[data.owner][leaseCountOf[data.owner]] = data.nonce;
        leaseCountOf[data.owner] = leaseCountOf[data.owner].add(1);

        ownerOf[data.horseAddress][data.horseId] = data.owner;

        transporter.safeTransferNFT721From(data.horseAddress, data.owner, address(this), data.horseId);

        if (items.length != 0) {
            horseItems[data.horseAddress][data.horseId] = items;
            collection721.batchSetLocked(items, true);
        }

        emit Lease(data.owner, signer, data.horseId, data.nonce);
    }

    function _verifyLease(LeaseData memory data) internal view returns (bytes32, address) {
        bytes32 message = keccak256(
            abi.encode(
                address(this),
                "Lease",
                data.owner,
                data.horseAddress,
                data.horseId,
                data.blockExpired,
                data.nonce
            )
        );
        address signer = message.toString().recover(data.v, data.r, data.s);
        require(operators[signer], "SpecialHorseFarmV2: lease not verify");
        require(block.number < data.blockExpired, "SpecialHorseFarmV2: lease expired");
        require(!leaseCompleted[message], "SpecialHorseFarmV2: lease completed");
        require(leaseData[data.nonce].owner == address(0), "SpecialHorseFarmV2: nonce existed");
        return (message, signer);
    }

    /**
     * @dev user withdraw horse.
     */
    function withdraw(WithdrawData memory data) external virtual nonReentrant whenNotPaused {
        require(isHorseNFT[data.horseAddress], "SpecialHorseFarmV2: invalid horse address");
        require(ownerOf[data.horseAddress][data.horseId] != address(0), "SpecialHorseFarmV2: horse withdrawed");
        require(msg.sender == data.owner, "SpecialHorseFarmV2: sender is not owner");
        require(
            msg.sender == ownerOf[data.horseAddress][data.horseId],
            "SpecialHorseFarmV2: sender is not horse owner"
        );
        (bytes32 message, address signer) = _verifyWithdraw(data);

        withdrawCompleted[message] = true;
        withdrawData[data.nonce] = SavedWithdraw({
            owner: data.owner,
            horseAddress: data.horseAddress,
            horseId: data.horseId,
            blockExpired: data.blockExpired
        });

        withdrawNoneOf[msg.sender][withdrawCountOf[msg.sender]] = data.nonce;
        withdrawCountOf[msg.sender] = withdrawCountOf[msg.sender].add(1);

        ownerOf[data.horseAddress][data.horseId] = address(0);

        IERC721(data.horseAddress).safeTransferFrom(address(this), msg.sender, data.horseId);

        if (horseItems[data.horseAddress][data.horseId].length != 0) {
            collection721.batchSetLocked(horseItems[data.horseAddress][data.horseId], false);

            delete horseItems[data.horseAddress][data.horseId];
        }

        emit Withdraw(msg.sender, signer, data.horseId, data.nonce);
    }

    function _verifyWithdraw(WithdrawData memory data) internal view returns (bytes32, address) {
        bytes32 message = keccak256(
            abi.encode(
                address(this),
                "Withdraw",
                data.owner,
                data.horseAddress,
                data.horseId,
                data.blockExpired,
                data.nonce
            )
        );
        address signer = message.toString().recover(data.v, data.r, data.s);
        require(operators[signer], "SpecialHorseFarmV2: withdraw not verify");
        require(block.number < data.blockExpired, "SpecialHorseFarmV2: withdraw expired");
        require(!withdrawCompleted[message], "SpecialHorseFarmV2: withdraw completed");
        require(withdrawData[data.nonce].blockExpired == 0, "SpecialHorseFarmV2: nonce existed");
        return (message, signer);
    }
}
        

@openzeppelin/contracts/utils/Address.sol

// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

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

        uint256 size;
        assembly {
            size := extcodesize(account)
        }
        return size > 0;
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable.sol)

pragma solidity ^0.8.0;

import "../utils/ContextUpgradeable.sol";
import {Initializable} from "../proxy/utils/Initializable.sol";

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

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

    /**
     * @dev Initializes the contract setting the deployer as the initial owner.
     */
    function __Ownable_init() internal onlyInitializing {
        __Ownable_init_unchained();
    }

    function __Ownable_init_unchained() internal onlyInitializing {
        _transferOwnership(_msgSender());
    }

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

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

    /**
     * @dev Throws if the sender is not the owner.
     */
    function _checkOwner() internal view virtual {
        require(owner() == _msgSender(), "Ownable: caller is not the owner");
    }

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

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

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

    /**
     * @dev This empty reserved space is put in place to allow future versions to add new
     * variables without shifting down storage in the inheritance chain.
     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
     */
    uint256[49] private __gap;
}
          

@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (proxy/utils/Initializable.sol)

pragma solidity ^0.8.2;

import "../../utils/AddressUpgradeable.sol";

/**
 * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed
 * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an
 * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer
 * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.
 *
 * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be
 * reused. This mechanism prevents re-execution of each "step" but allows the creation of new initialization steps in
 * case an upgrade adds a module that needs to be initialized.
 *
 * For example:
 *
 * [.hljs-theme-light.nopadding]
 * ```solidity
 * contract MyToken is ERC20Upgradeable {
 *     function initialize() initializer public {
 *         __ERC20_init("MyToken", "MTK");
 *     }
 * }
 *
 * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {
 *     function initializeV2() reinitializer(2) public {
 *         __ERC20Permit_init("MyToken");
 *     }
 * }
 * ```
 *
 * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as
 * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.
 *
 * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure
 * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.
 *
 * [CAUTION]
 * ====
 * Avoid leaving a contract uninitialized.
 *
 * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation
 * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke
 * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:
 *
 * [.hljs-theme-light.nopadding]
 * ```
 * /// @custom:oz-upgrades-unsafe-allow constructor
 * constructor() {
 *     _disableInitializers();
 * }
 * ```
 * ====
 */
abstract contract Initializable {
    /**
     * @dev Indicates that the contract has been initialized.
     * @custom:oz-retyped-from bool
     */
    uint8 private _initialized;

    /**
     * @dev Indicates that the contract is in the process of being initialized.
     */
    bool private _initializing;

    /**
     * @dev Triggered when the contract has been initialized or reinitialized.
     */
    event Initialized(uint8 version);

    /**
     * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,
     * `onlyInitializing` functions can be used to initialize parent contracts.
     *
     * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a
     * constructor.
     *
     * Emits an {Initialized} event.
     */
    modifier initializer() {
        bool isTopLevelCall = !_initializing;
        require(
            (isTopLevelCall && _initialized < 1) || (!AddressUpgradeable.isContract(address(this)) && _initialized == 1),
            "Initializable: contract is already initialized"
        );
        _initialized = 1;
        if (isTopLevelCall) {
            _initializing = true;
        }
        _;
        if (isTopLevelCall) {
            _initializing = false;
            emit Initialized(1);
        }
    }

    /**
     * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the
     * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be
     * used to initialize parent contracts.
     *
     * A reinitializer may be used after the original initialization step. This is essential to configure modules that
     * are added through upgrades and that require initialization.
     *
     * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`
     * cannot be nested. If one is invoked in the context of another, execution will revert.
     *
     * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in
     * a contract, executing them in the right order is up to the developer or operator.
     *
     * WARNING: setting the version to 255 will prevent any future reinitialization.
     *
     * Emits an {Initialized} event.
     */
    modifier reinitializer(uint8 version) {
        require(!_initializing && _initialized < version, "Initializable: contract is already initialized");
        _initialized = version;
        _initializing = true;
        _;
        _initializing = false;
        emit Initialized(version);
    }

    /**
     * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the
     * {initializer} and {reinitializer} modifiers, directly or indirectly.
     */
    modifier onlyInitializing() {
        require(_initializing, "Initializable: contract is not initializing");
        _;
    }

    /**
     * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.
     * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized
     * to any version. It is recommended to use this to lock implementation contracts that are designed to be called
     * through proxies.
     *
     * Emits an {Initialized} event the first time it is successfully executed.
     */
    function _disableInitializers() internal virtual {
        require(!_initializing, "Initializable: contract is initializing");
        if (_initialized != type(uint8).max) {
            _initialized = type(uint8).max;
            emit Initialized(type(uint8).max);
        }
    }

    /**
     * @dev Returns the highest version that has been initialized. See {reinitializer}.
     */
    function _getInitializedVersion() internal view returns (uint8) {
        return _initialized;
    }

    /**
     * @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}.
     */
    function _isInitializing() internal view returns (bool) {
        return _initializing;
    }
}
          

@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (security/Pausable.sol)

pragma solidity ^0.8.0;

import "../utils/ContextUpgradeable.sol";
import {Initializable} from "../proxy/utils/Initializable.sol";

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

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

    bool private _paused;

    /**
     * @dev Initializes the contract in unpaused state.
     */
    function __Pausable_init() internal onlyInitializing {
        __Pausable_init_unchained();
    }

    function __Pausable_init_unchained() internal onlyInitializing {
        _paused = false;
    }

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

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

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

    /**
     * @dev Throws if the contract is paused.
     */
    function _requireNotPaused() internal view virtual {
        require(!paused(), "Pausable: paused");
    }

    /**
     * @dev Throws if the contract is not paused.
     */
    function _requirePaused() internal view virtual {
        require(paused(), "Pausable: not paused");
    }

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

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

    /**
     * @dev This empty reserved space is put in place to allow future versions to add new
     * variables without shifting down storage in the inheritance chain.
     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
     */
    uint256[49] private __gap;
}
          

@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (security/ReentrancyGuard.sol)

pragma solidity ^0.8.0;
import {Initializable} from "../proxy/utils/Initializable.sol";

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

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

    uint256 private _status;

    function __ReentrancyGuard_init() internal onlyInitializing {
        __ReentrancyGuard_init_unchained();
    }

    function __ReentrancyGuard_init_unchained() internal onlyInitializing {
        _status = _NOT_ENTERED;
    }

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

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

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

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

    /**
     * @dev Returns true if the reentrancy guard is currently set to "entered", which indicates there is a
     * `nonReentrant` function in the call stack.
     */
    function _reentrancyGuardEntered() internal view returns (bool) {
        return _status == _ENTERED;
    }

    /**
     * @dev This empty reserved space is put in place to allow future versions to add new
     * variables without shifting down storage in the inheritance chain.
     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
     */
    uint256[49] private __gap;
}
          

@openzeppelin/contracts-upgradeable/token/ERC721/IERC721ReceiverUpgradeable.sol

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC721/IERC721Receiver.sol)

pragma solidity ^0.8.0;

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

@openzeppelin/contracts-upgradeable/token/ERC721/utils/ERC721HolderUpgradeable.sol

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC721/utils/ERC721Holder.sol)

pragma solidity ^0.8.0;

import "../IERC721ReceiverUpgradeable.sol";
import {Initializable} from "../../../proxy/utils/Initializable.sol";

/**
 * @dev Implementation of the {IERC721Receiver} interface.
 *
 * Accepts all token transfers.
 * Make sure the contract is able to use its token with {IERC721-safeTransferFrom}, {IERC721-approve} or {IERC721-setApprovalForAll}.
 */
contract ERC721HolderUpgradeable is Initializable, IERC721ReceiverUpgradeable {
    function __ERC721Holder_init() internal onlyInitializing {
    }

    function __ERC721Holder_init_unchained() internal onlyInitializing {
    }
    /**
     * @dev See {IERC721Receiver-onERC721Received}.
     *
     * Always returns `IERC721Receiver.onERC721Received.selector`.
     */
    function onERC721Received(address, address, uint256, bytes memory) public virtual override returns (bytes4) {
        return this.onERC721Received.selector;
    }

    /**
     * @dev This empty reserved space is put in place to allow future versions to add new
     * variables without shifting down storage in the inheritance chain.
     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
     */
    uint256[50] private __gap;
}
          

@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/Address.sol)

pragma solidity ^0.8.1;

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

        return account.code.length > 0;
    }

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

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

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

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

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

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

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

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal view returns (bytes memory) {
        (bool success, bytes memory returndata) = target.staticcall(data);
        return verifyCallResultFromTarget(target, success, returndata, errorMessage);
    }

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

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal returns (bytes memory) {
        (bool success, bytes memory returndata) = target.delegatecall(data);
        return verifyCallResultFromTarget(target, success, returndata, errorMessage);
    }

    /**
     * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling
     * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.
     *
     * _Available since v4.8._
     */
    function verifyCallResultFromTarget(
        address target,
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) internal view returns (bytes memory) {
        if (success) {
            if (returndata.length == 0) {
                // only check isContract if the call was successful and the return data is empty
                // otherwise we already know that it was a contract
                require(isContract(target), "Address: call to non-contract");
            }
            return returndata;
        } else {
            _revert(returndata, errorMessage);
        }
    }

    /**
     * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the
     * revert reason or using the provided one.
     *
     * _Available since v4.3._
     */
    function verifyCallResult(
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) internal pure returns (bytes memory) {
        if (success) {
            return returndata;
        } else {
            _revert(returndata, errorMessage);
        }
    }

    function _revert(bytes memory returndata, string memory errorMessage) private pure {
        // Look for revert reason and bubble it up if present
        if (returndata.length > 0) {
            // The easiest way to bubble the revert reason is using memory via assembly
            /// @solidity memory-safe-assembly
            assembly {
                let returndata_size := mload(returndata)
                revert(add(32, returndata), returndata_size)
            }
        } else {
            revert(errorMessage);
        }
    }
}
          

@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.4) (utils/Context.sol)

pragma solidity ^0.8.0;
import {Initializable} from "../proxy/utils/Initializable.sol";

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

    function __Context_init_unchained() internal onlyInitializing {
    }
    function _msgSender() internal view virtual returns (address) {
        return msg.sender;
    }

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

    function _contextSuffixLength() internal view virtual returns (uint256) {
        return 0;
    }

    /**
     * @dev This empty reserved space is put in place to allow future versions to add new
     * variables without shifting down storage in the inheritance chain.
     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
     */
    uint256[50] private __gap;
}
          

@openzeppelin/contracts/token/ERC20/IERC20.sol

// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20 {
    /**
     * @dev Returns the amount of tokens in existence.
     */
    function totalSupply() external view returns (uint256);

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

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

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

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

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

    /**
     * @dev Emitted when `value` tokens are moved from one account (`from`) to
     * another (`to`).
     *
     * Note that `value` may be zero.
     */
    event Transfer(address indexed from, address indexed to, uint256 value);

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

@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol

// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "../IERC20.sol";
import "../../../utils/Address.sol";

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

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

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

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

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

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

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

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

@openzeppelin/contracts/token/ERC721/IERC721.sol

// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "../../utils/introspection/IERC165.sol";

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

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

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

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

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

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

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

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

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

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

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

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

@openzeppelin/contracts/utils/introspection/IERC165.sol

// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

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

@openzeppelin/contracts/utils/math/SafeMath.sol

// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

contracts/abtracts/OwnerOperator.sol

//SPDX-License-Identifier: MIT
pragma solidity ^0.8.2;
import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";

abstract contract OwnerOperator is OwnableUpgradeable {
    mapping(address => bool) public operators;

    function initialize() public initializer {
        __Context_init_unchained();
        __Ownable_init_unchained();
    }

    modifier operatorOrOwner() {
        require(operators[msg.sender] || owner() == msg.sender, "OwnerOperator: !operator, !owner");
        _;
    }

    modifier onlyOperator() {
        require(operators[msg.sender], "OwnerOperator: !operator");
        _;
    }

    function addOperator(address operator) external virtual onlyOwner {
        require(operator != address(0), "OwnerOperator: operator is the zero address");
        operators[operator] = true;
    }

    function removeOperator(address operator) external virtual onlyOwner {
        require(operator != address(0), "OwnerOperator: operator is the zero address");
        operators[operator] = false;
    }
}
          

contracts/interfaces/ICollection721.sol

// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

interface ICollection721 {
    function batchSetLocked(uint256[] memory tokenId, bool lock) external;
}
          

contracts/interfaces/ITransporter.sol

// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

interface ITransporter {
    function safeTransferTokenFrom(
        address token_,
        address from_,
        address to_,
        uint256 amount_
    ) external;

    function safeTransferNFT721From(
        address token_,
        address from_,
        address to_,
        uint256 tokenId_
    ) external;

    function safeBurnNFT721From(address token_, uint256 tokenId_) external;

    function safeTransferNFT1155From(
        address token_,
        address from_,
        address to_,
        uint256 tokenId_,
        uint256 amount_
    ) external;

    function safeBurnNFT1155From(
        address token_,
        address from_,
        uint256 tokenId_,
        uint256 amount_
    ) external;

    function safeBurnBatchNFT1155From(
        address token_,
        address from_,
        uint256[] memory tokenId_,
        uint256[] memory amount_
    ) external;
}
          

contracts/libraries/BytesLibrary.sol

// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/**
 * @dev BytesLibrary operations.
 */
library BytesLibrary {
    function toString(bytes32 value) internal pure returns (string memory) {
        bytes memory alphabet = "0123456789abcdef";
        bytes memory str = new bytes(64);
        for (uint256 i = 0; i < 32; i++) {
            str[i * 2] = alphabet[uint8(value[i] >> 4)];
            str[1 + i * 2] = alphabet[uint8(value[i] & 0x0f)];
        }
        return string(str);
    }
}
          

contracts/libraries/StringLibrary.sol

// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "./UintLibrary.sol";

library StringLibrary {
    using UintLibrary for uint256;

    function append(string memory a, string memory b) internal pure returns (string memory) {
        bytes memory ba = bytes(a);
        bytes memory bb = bytes(b);
        bytes memory bab = new bytes(ba.length + bb.length);
        uint256 k = 0;
        for (uint256 i = 0; i < ba.length; i++) bab[k++] = ba[i];
        for (uint256 i = 0; i < bb.length; i++) bab[k++] = bb[i];
        return string(bab);
    }

    function append(
        string memory a,
        string memory b,
        string memory c
    ) internal pure returns (string memory) {
        bytes memory ba = bytes(a);
        bytes memory bb = bytes(b);
        bytes memory bc = bytes(c);
        bytes memory bbb = new bytes(ba.length + bb.length + bc.length);
        uint256 k = 0;
        for (uint256 i = 0; i < ba.length; i++) bbb[k++] = ba[i];
        for (uint256 i = 0; i < bb.length; i++) bbb[k++] = bb[i];
        for (uint256 i = 0; i < bc.length; i++) bbb[k++] = bc[i];
        return string(bbb);
    }

    function recover(
        string memory message,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) internal pure returns (address) {
        bytes memory msgBytes = bytes(message);
        bytes memory fullMessage = concat(
            bytes("\x19Ethereum Signed Message:\n"),
            bytes(msgBytes.length.toString()),
            msgBytes,
            new bytes(0),
            new bytes(0),
            new bytes(0),
            new bytes(0)
        );
        return ecrecover(keccak256(fullMessage), v, r, s);
    }

    function concat(
        bytes memory ba,
        bytes memory bb,
        bytes memory bc,
        bytes memory bd,
        bytes memory be,
        bytes memory bf,
        bytes memory bg
    ) internal pure returns (bytes memory) {
        bytes memory resultBytes = new bytes(ba.length + bb.length + bc.length + bd.length + be.length + bf.length + bg.length);
        uint256 k = 0;
        for (uint256 i = 0; i < ba.length; i++) resultBytes[k++] = ba[i];
        for (uint256 i = 0; i < bb.length; i++) resultBytes[k++] = bb[i];
        for (uint256 i = 0; i < bc.length; i++) resultBytes[k++] = bc[i];
        for (uint256 i = 0; i < bd.length; i++) resultBytes[k++] = bd[i];
        for (uint256 i = 0; i < be.length; i++) resultBytes[k++] = be[i];
        for (uint256 i = 0; i < bf.length; i++) resultBytes[k++] = bf[i];
        for (uint256 i = 0; i < bg.length; i++) resultBytes[k++] = bg[i];
        return resultBytes;
    }
}
          

contracts/libraries/UintLibrary.sol

// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "@openzeppelin/contracts/utils/math/SafeMath.sol";

library UintLibrary {
    using SafeMath for uint256;

    function toString(uint256 i) internal pure returns (string memory) {
        if (i == 0) {
            return "0";
        }

        uint256 j = i;
        uint256 len;

        while (j != 0) {
            len++;
            j /= 10;
        }

        bytes memory bstr = new bytes(len);

        for (uint256 k = len; k > 0; k--) {
            bstr[k - 1] = bytes1(uint8(48 + (i % 10)));
            i /= 10;
        }

        return string(bstr);
    }

    function bp(uint256 value, uint256 bpValue) internal pure returns (uint256) {
        return value.mul(bpValue).div(10000);
    }
}
          

Contract ABI

[{"type":"event","name":"Initialized","inputs":[{"type":"uint8","name":"version","internalType":"uint8","indexed":false}],"anonymous":false},{"type":"event","name":"Lease","inputs":[{"type":"address","name":"owner","internalType":"address","indexed":true},{"type":"address","name":"signer","internalType":"address","indexed":true},{"type":"uint256","name":"horseId","internalType":"uint256","indexed":true},{"type":"string","name":"nonce","internalType":"string","indexed":false}],"anonymous":false},{"type":"event","name":"OwnershipTransferred","inputs":[{"type":"address","name":"previousOwner","internalType":"address","indexed":true},{"type":"address","name":"newOwner","internalType":"address","indexed":true}],"anonymous":false},{"type":"event","name":"Paused","inputs":[{"type":"address","name":"account","internalType":"address","indexed":false}],"anonymous":false},{"type":"event","name":"Signer","inputs":[{"type":"address","name":"signers","internalType":"address","indexed":false}],"anonymous":false},{"type":"event","name":"Unpaused","inputs":[{"type":"address","name":"account","internalType":"address","indexed":false}],"anonymous":false},{"type":"event","name":"Withdraw","inputs":[{"type":"address","name":"owner","internalType":"address","indexed":true},{"type":"address","name":"signer","internalType":"address","indexed":true},{"type":"uint256","name":"horseId","internalType":"uint256","indexed":true},{"type":"string","name":"nonce","internalType":"string","indexed":false}],"anonymous":false},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"addOperator","inputs":[{"type":"address","name":"operator","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"contract ICollection721"}],"name":"collection721","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"horseItems","inputs":[{"type":"address","name":"","internalType":"address"},{"type":"uint256","name":"","internalType":"uint256"},{"type":"uint256","name":"","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"init","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"initialize","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"isHorseNFT","inputs":[{"type":"address","name":"","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"lease","inputs":[{"type":"tuple","name":"data","internalType":"struct SpecialHorseFarmV2.LeaseData","components":[{"type":"address","name":"owner","internalType":"address"},{"type":"address","name":"horseAddress","internalType":"address"},{"type":"uint256","name":"horseId","internalType":"uint256"},{"type":"uint256","name":"blockExpired","internalType":"uint256"},{"type":"string","name":"nonce","internalType":"string"},{"type":"uint8","name":"v","internalType":"uint8"},{"type":"bytes32","name":"r","internalType":"bytes32"},{"type":"bytes32","name":"s","internalType":"bytes32"}]},{"type":"uint256[]","name":"items","internalType":"uint256[]"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"leaseCompleted","inputs":[{"type":"bytes32","name":"","internalType":"bytes32"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"leaseCountOf","inputs":[{"type":"address","name":"","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"owner","internalType":"address"},{"type":"address","name":"horseAddress","internalType":"address"},{"type":"uint256","name":"horseId","internalType":"uint256"},{"type":"uint256","name":"blockExpired","internalType":"uint256"}],"name":"leaseData","inputs":[{"type":"string","name":"","internalType":"string"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"string","name":"","internalType":"string"}],"name":"leaseNoneOf","inputs":[{"type":"address","name":"","internalType":"address"},{"type":"uint256","name":"","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bytes4","name":"","internalType":"bytes4"}],"name":"onERC721Received","inputs":[{"type":"address","name":"","internalType":"address"},{"type":"address","name":"","internalType":"address"},{"type":"uint256","name":"","internalType":"uint256"},{"type":"bytes","name":"","internalType":"bytes"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"operators","inputs":[{"type":"address","name":"","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"owner","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"ownerOf","inputs":[{"type":"address","name":"","internalType":"address"},{"type":"uint256","name":"","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"pause","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"paused","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"removeOperator","inputs":[{"type":"address","name":"operator","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"renounceOwnership","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setCollection","inputs":[{"type":"address","name":"_collection","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setHorseNFT","inputs":[{"type":"address","name":"_horseNFT","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setTransporter","inputs":[{"type":"address","name":"_transporter","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"transferOwnership","inputs":[{"type":"address","name":"newOwner","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"contract ITransporter"}],"name":"transporter","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"unpause","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"withdraw","inputs":[{"type":"tuple","name":"data","internalType":"struct SpecialHorseFarmV2.WithdrawData","components":[{"type":"address","name":"owner","internalType":"address"},{"type":"address","name":"horseAddress","internalType":"address"},{"type":"uint256","name":"horseId","internalType":"uint256"},{"type":"uint256","name":"blockExpired","internalType":"uint256"},{"type":"string","name":"nonce","internalType":"string"},{"type":"uint8","name":"v","internalType":"uint8"},{"type":"bytes32","name":"r","internalType":"bytes32"},{"type":"bytes32","name":"s","internalType":"bytes32"}]}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"withdrawCompleted","inputs":[{"type":"bytes32","name":"","internalType":"bytes32"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"withdrawCountOf","inputs":[{"type":"address","name":"","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"owner","internalType":"address"},{"type":"address","name":"horseAddress","internalType":"address"},{"type":"uint256","name":"horseId","internalType":"uint256"},{"type":"uint256","name":"blockExpired","internalType":"uint256"}],"name":"withdrawData","inputs":[{"type":"string","name":"","internalType":"string"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"withdrawNFT","inputs":[{"type":"address","name":"token","internalType":"address"},{"type":"uint256","name":"tokenId","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"string","name":"","internalType":"string"}],"name":"withdrawNoneOf","inputs":[{"type":"address","name":"","internalType":"address"},{"type":"uint256","name":"","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"withdrawToken","inputs":[{"type":"address","name":"token","internalType":"address"}]}]
            

Deployed ByteCode

0x608060405234801561001057600080fd5b50600436106101f05760003560e01c80637a2ef48b1161010f5780639f9d8c58116100a2578063e1c7392a11610071578063e1c7392a146105f2578063e42b0212146105fa578063e817d0e51461061b578063f2fde38b1461062e576101f0565b80639f9d8c5814610587578063a8ed22a3146105a8578063ab82ca12146105cc578063ac8a584a146105df576101f0565b80638da5cb5b116100de5780638da5cb5b146105235780639870d7fe1461054157806399725af1146105545780639c8dadae14610574576101f0565b80637a2ef48b146104a55780638129fc1c146105005780638456cb59146105085780638947606914610510576101f0565b806332a46144116101875780636088e93a116101565780636088e93a14610464578063715018a6146104775780637324506f1461047f578063768b5fd514610492576101f0565b806332a46144146103995780633f4ba83a146103bd5780635c975abb146103c5578063604ff5a4146103d0576101f0565b8063150b7a02116101c3578063150b7a02146102a357806317c6395d1461030b5780631ed924f11461031e5780631f29d2dc14610333576101f0565b8063037a4a4a146101f557806304d45b491461021e57806307d0ef971461025157806313e7c9d814610280575b600080fd5b610208610203366004613e37565b610641565b6040516102159190614213565b60405180910390f35b61024161022c366004613eb2565b60fd6020526000908152604090205460ff1681565b6040519015158152602001610215565b61027261025f366004613da4565b6101036020526000908152604090205481565b604051908152602001610215565b61024161028e366004613da4565b60976020526000908152604090205460ff1681565b6102da6102b1366004613dbe565b7f150b7a0200000000000000000000000000000000000000000000000000000000949350505050565b6040517fffffffff000000000000000000000000000000000000000000000000000000009091168152602001610215565b610208610319366004613e37565b6106e7565b61033161032c366004613da4565b61070c565b005b610374610341366004613e37565b60fc60209081526000928352604080842090915290825290205473ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff9091168152602001610215565b6102416103a7366004613da4565b6101056020526000908152604090205460ff1681565b610331610818565b60985460ff16610241565b61042c6103de366004613eca565b80518082016020908101805161010282529282019190930120915280546001820154600283015460039093015473ffffffffffffffffffffffffffffffffffffffff92831693919092169184565b6040805173ffffffffffffffffffffffffffffffffffffffff9586168152949093166020850152918301526060820152608001610215565b610331610472366004613e37565b61082a565b6103316109b4565b61033161048d366004613efd565b6109c6565b6103316104a0366004613da4565b610f29565b61042c6104b3366004613eca565b80518082016020908101805160fe82529282019190930120915280546001820154600283015460039093015473ffffffffffffffffffffffffffffffffffffffff92831693919092169184565b610331611028565b6103316111c9565b61033161051e366004613da4565b6111d9565b60655473ffffffffffffffffffffffffffffffffffffffff16610374565b61033161054f366004613da4565b611334565b610272610562366004613da4565b60ff6020526000908152604090205481565b610331610582366004613da4565b61142e565b610107546103749073ffffffffffffffffffffffffffffffffffffffff1681565b6102416105b6366004613eb2565b6101016020526000908152604090205460ff1681565b6102726105da366004613e60565b61147e565b6103316105ed366004613da4565b6114bd565b6103316115b4565b610106546103749073ffffffffffffffffffffffffffffffffffffffff1681565b610331610629366004613fc7565b6116ef565b61033161063c366004613da4565b611dfa565b610104602090815260009283526040808420909152908252902080546106669061435a565b80601f01602080910402602001604051908101604052809291908181526020018280546106929061435a565b80156106df5780601f106106b4576101008083540402835291602001916106df565b820191906000526020600020905b8154815290600101906020018083116106c257829003601f168201915b505050505081565b610100602090815260009283526040808420909152908252902080546106669061435a565b3360009081526097602052604090205460ff168061075d57503361074560655473ffffffffffffffffffffffffffffffffffffffff1690565b73ffffffffffffffffffffffffffffffffffffffff16145b6107c8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e65724f70657261746f723a20216f70657261746f722c20216f776e657260448201526064015b60405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff1660009081526101056020526040902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055565b610820611eae565b610828611f2f565b565b610832611eae565b73ffffffffffffffffffffffffffffffffffffffff82166000908152610105602052604090205460ff161580610898575073ffffffffffffffffffffffffffffffffffffffff828116600090815260fc6020908152604080832085845290915290205416155b610924576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602c60248201527f5370656369616c486f7273654661726d56323a20686f7273652062656c6f6e6760448201527f20746f20636f6e7472616374000000000000000000000000000000000000000060648201526084016107bf565b6040517f42842e0e0000000000000000000000000000000000000000000000000000000081523060048201523360248201526044810182905273ffffffffffffffffffffffffffffffffffffffff8316906342842e0e90606401600060405180830381600087803b15801561099857600080fd5b505af11580156109ac573d6000803e3d6000fd5b505050505050565b6109bc611eae565b6108286000611fac565b6109ce612023565b6109d6612097565b60208083015173ffffffffffffffffffffffffffffffffffffffff166000908152610105909152604090205460ff16610a91576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602960248201527f5370656369616c486f7273654661726d56323a20696e76616c696420686f727360448201527f652061646472657373000000000000000000000000000000000000000000000060648201526084016107bf565b815173ffffffffffffffffffffffffffffffffffffffff163314610b37576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602760248201527f5370656369616c486f7273654661726d56323a2073656e646572206973206e6f60448201527f74206f776e65720000000000000000000000000000000000000000000000000060648201526084016107bf565b600080610b4384612104565b600082815260fd602090815260409182902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055815160808082018452895173ffffffffffffffffffffffffffffffffffffffff90811683528a840151169282019290925288830151818401526060808a015190820152908801519151939550919350909160fe91610bdb9161405c565b9081526040805160209281900383019020835181547fffffffffffffffffffffffff000000000000000000000000000000000000000090811673ffffffffffffffffffffffffffffffffffffffff92831617835585850151600184018054909216908316179055848301516002830155606090940151600390910155608087015187518416600090815261010084528281208951909516815260ff845282812054815293835292208251610c959391929190910190613b47565b50835173ffffffffffffffffffffffffffffffffffffffff16600090815260ff6020526040902054610cc8906001612447565b845173ffffffffffffffffffffffffffffffffffffffff908116600090815260ff6020908152604080832094909455875181890180518516845260fc8352858420868b018051865293529285902080547fffffffffffffffffffffffff0000000000000000000000000000000000000000169185169190911790556101065491518851915194517fa5bc64ca000000000000000000000000000000000000000000000000000000008152908416600482015290831660248201523060448201526064810193909352169063a5bc64ca90608401600060405180830381600087803b158015610db557600080fd5b505af1158015610dc9573d6000803e3d6000fd5b505050508251600014610ea75760208085015173ffffffffffffffffffffffffffffffffffffffff16600090815261010882526040808220818801518352835290208451610e1992860190613bcb565b50610107546040517fd53ae81d00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff9091169063d53ae81d90610e7490869060019060040161418a565b600060405180830381600087803b158015610e8e57600080fd5b505af1158015610ea2573d6000803e3d6000fd5b505050505b83604001518173ffffffffffffffffffffffffffffffffffffffff16856000015173ffffffffffffffffffffffffffffffffffffffff167f6c0f40da73c577567dd97a5f1acfd9d4a433a9832757bf34c6bdee20791c113d8760800151604051610f119190614213565b60405180910390a45050610f25600160ca55565b5050565b3360009081526097602052604090205460ff1680610f7a575033610f6260655473ffffffffffffffffffffffffffffffffffffffff1690565b73ffffffffffffffffffffffffffffffffffffffff16145b610fe0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e65724f70657261746f723a20216f70657261746f722c20216f776e657260448201526064016107bf565b61010780547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b600054610100900460ff16158080156110485750600054600160ff909116105b8061106957506110573061245a565b158015611069575060005460ff166001145b6110f5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a656400000000000000000000000000000000000060648201526084016107bf565b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055801561115357600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff166101001790555b61115b61247a565b611163612511565b80156111c657600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b50565b6111d1611eae565b6108286125b1565b6111e1611eae565b6040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015260009073ffffffffffffffffffffffffffffffffffffffff8316906370a082319060240160206040518083038186803b15801561124957600080fd5b505afa15801561125d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112819190613ffa565b905060008111611313576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602360248201527f5370656369616c486f7273654661726d56323a207a65726f206f757420616d6f60448201527f756e74000000000000000000000000000000000000000000000000000000000060648201526084016107bf565b610f2573ffffffffffffffffffffffffffffffffffffffff8316338361260c565b61133c611eae565b73ffffffffffffffffffffffffffffffffffffffff81166113df576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f4f776e65724f70657261746f723a206f70657261746f7220697320746865207a60448201527f65726f206164647265737300000000000000000000000000000000000000000060648201526084016107bf565b73ffffffffffffffffffffffffffffffffffffffff16600090815260976020526040902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055565b611436611eae565b61010680547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b61010860205282600052604060002060205281600052604060002081815481106114a757600080fd5b9060005260206000200160009250925050505481565b6114c5611eae565b73ffffffffffffffffffffffffffffffffffffffff8116611568576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f4f776e65724f70657261746f723a206f70657261746f7220697320746865207a60448201527f65726f206164647265737300000000000000000000000000000000000000000060648201526084016107bf565b73ffffffffffffffffffffffffffffffffffffffff16600090815260976020526040902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00169055565b600054610100900460ff16158080156115d45750600054600160ff909116105b806115f557506115e33061245a565b1580156115f5575060005460ff166001145b611681576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a656400000000000000000000000000000000000060648201526084016107bf565b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016600117905580156116df57600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff166101001790555b6116e7611028565b61116361269e565b6116f7612023565b6116ff612097565b60208082015173ffffffffffffffffffffffffffffffffffffffff166000908152610105909152604090205460ff166117ba576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602960248201527f5370656369616c486f7273654661726d56323a20696e76616c696420686f727360448201527f652061646472657373000000000000000000000000000000000000000000000060648201526084016107bf565b60208082015173ffffffffffffffffffffffffffffffffffffffff908116600090815260fc83526040808220818601518352909352919091205416611880576040517f08c379a0000000000000000000000000000000000000000000000000000000008152602060048201526024808201527f5370656369616c486f7273654661726d56323a20686f7273652077697468647260448201527f617765640000000000000000000000000000000000000000000000000000000060648201526084016107bf565b805173ffffffffffffffffffffffffffffffffffffffff163314611926576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602760248201527f5370656369616c486f7273654661726d56323a2073656e646572206973206e6f60448201527f74206f776e65720000000000000000000000000000000000000000000000000060648201526084016107bf565b60208181015173ffffffffffffffffffffffffffffffffffffffff908116600090815260fc8352604080822081860151835290935291909120541633146119ef576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602d60248201527f5370656369616c486f7273654661726d56323a2073656e646572206973206e6f60448201527f7420686f727365206f776e65720000000000000000000000000000000000000060648201526084016107bf565b6000806119fb8361273d565b6000828152610101602090815260409182902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055815160808082018452885173ffffffffffffffffffffffffffffffffffffffff9081168352898401511692820192909252878301518184015260608089015190820152908701519151939550919350909161010291611a959161405c565b908152604080519182900360209081019092208351815473ffffffffffffffffffffffffffffffffffffffff9182167fffffffffffffffffffffffff0000000000000000000000000000000000000000918216178355858501516001840180549190931691161790558382015160028201556060909301516003909301929092556080850151336000908152610104835283812061010384528482205482528352929092208251611b4c9391929190910190613b47565b503360009081526101036020526040902054611b69906001612447565b3360008181526101036020908152604080832094909455868101805173ffffffffffffffffffffffffffffffffffffffff908116845260fc83528584208987018051865293529285902080547fffffffffffffffffffffffff000000000000000000000000000000000000000016905551905193517f42842e0e0000000000000000000000000000000000000000000000000000000081523060048201526024810193909352604483019390935291909116906342842e0e90606401600060405180830381600087803b158015611c3f57600080fd5b505af1158015611c53573d6000803e3d6000fd5b5050505060208381015173ffffffffffffffffffffffffffffffffffffffff16600090815261010882526040808220818701518352909252205415611d80576101075460208085015173ffffffffffffffffffffffffffffffffffffffff90811660009081526101088352604080822081890151835290935282812092517fd53ae81d000000000000000000000000000000000000000000000000000000008152919093169263d53ae81d92611d0e929091906004016141d5565b600060405180830381600087803b158015611d2857600080fd5b505af1158015611d3c573d6000803e3d6000fd5b5050505060208381015173ffffffffffffffffffffffffffffffffffffffff16600090815261010882526040808220818701518352909252908120611d8091613c05565b82604001518173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c73b702b261c879bc4ebea83f44bd0c9a90cffb4aa0f324e52750d831b9cb4f8660800151604051611de69190614213565b60405180910390a450506111c6600160ca55565b611e02611eae565b73ffffffffffffffffffffffffffffffffffffffff8116611ea5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f646472657373000000000000000000000000000000000000000000000000000060648201526084016107bf565b6111c681611fac565b60655473ffffffffffffffffffffffffffffffffffffffff163314610828576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016107bf565b611f37612a46565b609880547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390a1565b6065805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600260ca541415612090576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016107bf565b600260ca55565b60985460ff1615610828576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f5061757361626c653a207061757365640000000000000000000000000000000060448201526064016107bf565b6000806000308460000151856020015186604001518760600151886080015160405160200161213896959493929190614078565b60405160208183030381529060405280519060200120905060006121758560a001518660c001518760e0015161216d86612ab2565b929190612d81565b73ffffffffffffffffffffffffffffffffffffffff811660009081526097602052604090205490915060ff1661222c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152602060048201526024808201527f5370656369616c486f7273654661726d56323a206c65617365206e6f7420766560448201527f726966790000000000000000000000000000000000000000000000000000000060648201526084016107bf565b846060015143106122bf576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602160248201527f5370656369616c486f7273654661726d56323a206c656173652065787069726560448201527f640000000000000000000000000000000000000000000000000000000000000060648201526084016107bf565b600082815260fd602052604090205460ff161561235e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602360248201527f5370656369616c486f7273654661726d56323a206c6561736520636f6d706c6560448201527f746564000000000000000000000000000000000000000000000000000000000060648201526084016107bf565b600073ffffffffffffffffffffffffffffffffffffffff1660fe866080015160405161238a919061405c565b9081526040519081900360200190205473ffffffffffffffffffffffffffffffffffffffff161461243d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602160248201527f5370656369616c486f7273654661726d56323a206e6f6e63652065786973746560448201527f640000000000000000000000000000000000000000000000000000000000000060648201526084016107bf565b9092509050915091565b60006124538284614275565b9392505050565b73ffffffffffffffffffffffffffffffffffffffff81163b15155b919050565b600054610100900460ff16610828576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e6700000000000000000000000000000000000000000060648201526084016107bf565b600054610100900460ff166125a8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e6700000000000000000000000000000000000000000060648201526084016107bf565b61082833611fac565b6125b9612097565b609880547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258611f823390565b6040805173ffffffffffffffffffffffffffffffffffffffff8416602482015260448082018490528251808303909101815260649091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fa9059cbb00000000000000000000000000000000000000000000000000000000179052612699908490612e94565b505050565b600054610100900460ff16612735576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e6700000000000000000000000000000000000000000060648201526084016107bf565b610828612fa0565b6000806000308460000151856020015186604001518760600151886080015160405160200161277196959493929190614108565b60405160208183030381529060405280519060200120905060006127a68560a001518660c001518760e0015161216d86612ab2565b73ffffffffffffffffffffffffffffffffffffffff811660009081526097602052604090205490915060ff1661285e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602760248201527f5370656369616c486f7273654661726d56323a207769746864726177206e6f7460448201527f207665726966790000000000000000000000000000000000000000000000000060648201526084016107bf565b846060015143106128f0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152602060048201526024808201527f5370656369616c486f7273654661726d56323a2077697468647261772065787060448201527f697265640000000000000000000000000000000000000000000000000000000060648201526084016107bf565b6000828152610101602052604090205460ff1615612990576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f5370656369616c486f7273654661726d56323a20776974686472617720636f6d60448201527f706c65746564000000000000000000000000000000000000000000000000000060648201526084016107bf565b61010285608001516040516129a5919061405c565b90815260200160405180910390206003015460001461243d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602160248201527f5370656369616c486f7273654661726d56323a206e6f6e63652065786973746560448201527f640000000000000000000000000000000000000000000000000000000000000060648201526084016107bf565b60985460ff16610828576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f5061757361626c653a206e6f742070617573656400000000000000000000000060448201526064016107bf565b604080518082018252601081527f30313233343536373839616263646566000000000000000000000000000000006020820152815182815260608181018452926000919060208201818036833701905050905060005b6020811015612d7957826004868360208110612b4d577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b1a60f81b7effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916901c60f81c60ff1681518110612bb2577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b01602001517fff000000000000000000000000000000000000000000000000000000000000001682612be58360026142a1565b81518110612c1c577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535082858260208110612c85577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b825191901a600f16908110612cc3577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b01602001517fff000000000000000000000000000000000000000000000000000000000000001682612cf68360026142a1565b612d01906001614275565b81518110612d38577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535080612d71816143ae565b915050612b08565b509392505050565b6000808590506000612df96040518060400160405280601a81526020017f19457468657265756d205369676e6564204d6573736167653a0a000000000000815250612dcc8451613061565b604080516000808252602082018181528284018281526060840192835260808401909452889390916131f6565b90506001818051906020012087878760405160008152602001604052604051612e3e949392919093845260ff9290921660208401526040830152606082015260800190565b6020604051602081039080840390855afa158015612e60573d6000803e3d6000fd5b50506040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0015198975050505050505050565b6000612ef6826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff1661395d9092919063ffffffff16565b8051909150156126995780806020019051810190612f149190613e92565b612699576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f7420737563636565640000000000000000000000000000000000000000000060648201526084016107bf565b600054610100900460ff16613037576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e6700000000000000000000000000000000000000000060648201526084016107bf565b609880547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00169055565b6060816130a2575060408051808201909152600181527f30000000000000000000000000000000000000000000000000000000000000006020820152612475565b8160005b81156130cc57806130b6816143ae565b91506130c59050600a8361428d565b91506130a6565b60008167ffffffffffffffff81111561310e577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040519080825280601f01601f191660200182016040528015613138576020820181803683370190505b509050815b80156131ed5761314e600a876143e7565b613159906030614275565b60f81b826131686001846142de565b8151811061319f577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053506131d9600a8761428d565b9550806131e581614325565b91505061313d565b50949350505050565b6060600082518451865188518a518c518e516132129190614275565b61321c9190614275565b6132269190614275565b6132309190614275565b61323a9190614275565b6132449190614275565b67ffffffffffffffff811115613283577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040519080825280601f01601f1916602001820160405280156132ad576020820181803683370190505b5090506000805b8a518110156133a2578a81815181106132f6577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b01602001517fff00000000000000000000000000000000000000000000000000000000000000168383613328816143ae565b945081518110613361577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053508061339a816143ae565b9150506132b4565b5060005b8951811015613494578981815181106133e8577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b01602001517fff0000000000000000000000000000000000000000000000000000000000000016838361341a816143ae565b945081518110613453577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053508061348c816143ae565b9150506133a6565b5060005b8851811015613586578881815181106134da577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b01602001517fff0000000000000000000000000000000000000000000000000000000000000016838361350c816143ae565b945081518110613545577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053508061357e816143ae565b915050613498565b5060005b8751811015613678578781815181106135cc577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b01602001517fff000000000000000000000000000000000000000000000000000000000000001683836135fe816143ae565b945081518110613637577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535080613670816143ae565b91505061358a565b5060005b865181101561376a578681815181106136be577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b01602001517fff000000000000000000000000000000000000000000000000000000000000001683836136f0816143ae565b945081518110613729577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535080613762816143ae565b91505061367c565b5060005b855181101561385c578581815181106137b0577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b01602001517fff000000000000000000000000000000000000000000000000000000000000001683836137e2816143ae565b94508151811061381b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535080613854816143ae565b91505061376e565b5060005b845181101561394e578481815181106138a2577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b01602001517fff000000000000000000000000000000000000000000000000000000000000001683836138d4816143ae565b94508151811061390d577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535080613946816143ae565b915050613860565b50909998505050505050505050565b606061396c8484600085613974565b949350505050565b606082471015613a06576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c000000000000000000000000000000000000000000000000000060648201526084016107bf565b843b613a6e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016107bf565b6000808673ffffffffffffffffffffffffffffffffffffffff168587604051613a97919061405c565b60006040518083038185875af1925050503d8060008114613ad4576040519150601f19603f3d011682016040523d82523d6000602084013e613ad9565b606091505b5091509150613ae9828286613af4565b979650505050505050565b60608315613b03575081612453565b825115613b135782518084602001fd5b816040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107bf9190614213565b828054613b539061435a565b90600052602060002090601f016020900481019282613b755760008555613bbb565b82601f10613b8e57805160ff1916838001178555613bbb565b82800160010185558215613bbb579182015b82811115613bbb578251825591602001919060010190613ba0565b50613bc7929150613c1f565b5090565b828054828255906000526020600020908101928215613bbb5791602002820182811115613bbb578251825591602001919060010190613ba0565b50805460008255906000526020600020908101906111c691905b5b80821115613bc75760008155600101613c20565b600067ffffffffffffffff831115613c4e57613c4e614459565b613c7f60207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f86011601614226565b9050828152838383011115613c9357600080fd5b828260208301376000602084830101529392505050565b803573ffffffffffffffffffffffffffffffffffffffff8116811461247557600080fd5b600082601f830112613cde578081fd5b61245383833560208501613c34565b6000610100808385031215613d00578182fd5b613d0981614226565b915050613d1582613caa565b8152613d2360208301613caa565b60208201526040820135604082015260608201356060820152608082013567ffffffffffffffff811115613d5657600080fd5b613d6284828501613cce565b608083015250613d7460a08301613d93565b60a082015260c082013560c082015260e082013560e082015292915050565b803560ff8116811461247557600080fd5b600060208284031215613db5578081fd5b61245382613caa565b60008060008060808587031215613dd3578283fd5b613ddc85613caa565b9350613dea60208601613caa565b925060408501359150606085013567ffffffffffffffff811115613e0c578182fd5b8501601f81018713613e1c578182fd5b613e2b87823560208401613c34565b91505092959194509250565b60008060408385031215613e49578182fd5b613e5283613caa565b946020939093013593505050565b600080600060608486031215613e74578283fd5b613e7d84613caa565b95602085013595506040909401359392505050565b600060208284031215613ea3578081fd5b81518015158114612453578182fd5b600060208284031215613ec3578081fd5b5035919050565b600060208284031215613edb578081fd5b813567ffffffffffffffff811115613ef1578182fd5b61396c84828501613cce565b60008060408385031215613f0f578182fd5b823567ffffffffffffffff80821115613f26578384fd5b613f3286838701613ced565b9350602091508185013581811115613f48578384fd5b8501601f81018713613f58578384fd5b803582811115613f6a57613f6a614459565b8381029250613f7a848401614226565b8181528481019083860185850187018b1015613f94578788fd5b8795505b83861015613fb6578035835260019590950194918601918601613f98565b508096505050505050509250929050565b600060208284031215613fd8578081fd5b813567ffffffffffffffff811115613fee578182fd5b61396c84828501613ced565b60006020828403121561400b578081fd5b5051919050565b6000815180845261402a8160208601602086016142f5565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b6000825161406e8184602087016142f5565b9190910192915050565b600073ffffffffffffffffffffffffffffffffffffffff808916835260e06020840152600560e08401527f4c65617365000000000000000000000000000000000000000000000000000000610100840152610120818916604085015281881660608501528660808501528560a08501528060c08501526140fa81850186614012565b9a9950505050505050505050565b600073ffffffffffffffffffffffffffffffffffffffff808916835260e06020840152600860e08401527f5769746864726177000000000000000000000000000000000000000000000000610100840152610120818916604085015281881660608501528660808501528560a08501528060c08501526140fa81850186614012565b604080825283519082018190526000906020906060840190828701845b828110156141c3578151845292840192908401906001016141a7565b50505093151592019190915250919050565b6000604082016040835280855480835260608501915086845260209250828420845b828110156141c3578154845292840192600191820191016141f7565b6000602082526124536020830184614012565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff8111828210171561426d5761426d614459565b604052919050565b60008219821115614288576142886143fb565b500190565b60008261429c5761429c61442a565b500490565b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156142d9576142d96143fb565b500290565b6000828210156142f0576142f06143fb565b500390565b60005b838110156143105781810151838201526020016142f8565b8381111561431f576000848401525b50505050565b600081614334576143346143fb565b507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190565b60028104600182168061436e57607f821691505b602082108114156143a8577f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b50919050565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156143e0576143e06143fb565b5060010190565b6000826143f6576143f661442a565b500690565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fdfea2646970667358221220fb95a7d53155ef58a869aec1df35e2754b901cb5db1f069329a7789a1dc75faf64736f6c63430008020033