ETH Price: $3,866.76 (-0.81%)

Contract

0x7F18060604F8e1FB9Aa6c051D1Cdec49Cd62B3D5
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Token Holdings

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Create Erc1155191396012024-02-02 8:43:59317 days ago1706863439IN
0x7F180606...9Cd62B3D5
0 ETH0.0060440820.39200522
Swap191321812024-02-01 7:44:47318 days ago1706773487IN
0x7F180606...9Cd62B3D5
0 ETH0.0018490816.44319877
Create Erc1155174720292023-06-13 15:41:47550 days ago1686670907IN
0x7F180606...9Cd62B3D5
0 ETH0.0073012324.6404398
Create Erc1155174639502023-06-12 12:22:47551 days ago1686572567IN
0x7F180606...9Cd62B3D5
0 ETH0.0046424715.66819602
Swap174124652023-06-05 6:11:23559 days ago1685945483IN
0x7F180606...9Cd62B3D5
0 ETH0.0040299522.50041655
Create Erc1155169745012023-04-04 8:58:11621 days ago1680598691IN
0x7F180606...9Cd62B3D5
0 ETH0.0055570419.90087889
Swap169744942023-04-04 8:56:47621 days ago1680598607IN
0x7F180606...9Cd62B3D5
0 ETH0.0022626320.12069669
Cancel169742192023-04-04 8:01:11621 days ago1680595271IN
0x7F180606...9Cd62B3D5
0 ETH0.0022359621.67056037
Swap169742192023-04-04 8:01:11621 days ago1680595271IN
0x7F180606...9Cd62B3D5
0 ETH0.0024369121.67056037
Create Erc1155169742152023-04-04 8:00:11621 days ago1680595211IN
0x7F180606...9Cd62B3D5
0 ETH0.0058218719.9713806
Swap169682092023-04-03 11:30:23621 days ago1680521423IN
0x7F180606...9Cd62B3D5
0 ETH0.0023215620.64479914
Swap169682032023-04-03 11:29:11621 days ago1680521351IN
0x7F180606...9Cd62B3D5
0 ETH0.0021932619.50387753
Swap169681612023-04-03 11:20:35621 days ago1680520835IN
0x7F180606...9Cd62B3D5
0 ETH0.0031520628.03006443
Swap169258002023-03-28 12:21:47627 days ago1680006107IN
0x7F180606...9Cd62B3D5
0 ETH0.0028748525.56497552
Swap169250402023-03-28 9:47:35628 days ago1679996855IN
0x7F180606...9Cd62B3D5
0 ETH0.0033173825.60639746
Swap168823752023-03-22 9:55:11634 days ago1679478911IN
0x7F180606...9Cd62B3D5
0 ETH0.0016134814.34807979
Swap168823702023-03-22 9:54:11634 days ago1679478851IN
0x7F180606...9Cd62B3D5
0 ETH0.0015208713.52458002
Swap168686922023-03-20 11:49:23635 days ago1679312963IN
0x7F180606...9Cd62B3D5
0 ETH0.0017422715.49338672
Swap168686872023-03-20 11:48:23635 days ago1679312903IN
0x7F180606...9Cd62B3D5
0 ETH0.0015988914.21831379
Swap168686622023-03-20 11:43:11635 days ago1679312591IN
0x7F180606...9Cd62B3D5
0 ETH0.0014813713.17331921
Create Erc1155168686272023-03-20 11:36:11635 days ago1679312171IN
0x7F180606...9Cd62B3D5
0 ETH0.0042271914.25280362
Swap168685992023-03-20 11:30:35635 days ago1679311835IN
0x7F180606...9Cd62B3D5
0 ETH0.0020846216.09090676
Swap168411312023-03-16 14:54:59639 days ago1678978499IN
0x7F180606...9Cd62B3D5
0 ETH0.0032117528.56086499
Swap168410672023-03-16 14:42:11639 days ago1678977731IN
0x7F180606...9Cd62B3D5
0 ETH0.0034680930.84043397
Swap168410622023-03-16 14:41:11639 days ago1678977671IN
0x7F180606...9Cd62B3D5
0 ETH0.0032568828.96220579
View all transactions

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
NFTFixedswap

Compiler Version
v0.8.13+commit.abaa5c0e

Optimization Enabled:
Yes with 1000 runs

Other Settings:
default evmVersion
File 1 of 13 : NFTFixedswap.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.8.0;
pragma experimental ABIEncoderV2;

import "@openzeppelin/contracts/utils/math/SafeMath.sol";
import "@openzeppelin/contracts/utils/Address.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol";
import "@openzeppelin/contracts/token/ERC1155/IERC1155.sol";
import "@openzeppelin/contracts/proxy/utils/Initializable.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "./libraries/TransferHelper.sol";
import "./modules/Configurable.sol";

contract NFTFixedswap is Initializable, Ownable, Configurable, IERC721Receiver {
    using SafeMath for uint;
    using Address for address;

    bytes32 internal constant TxFeeRatio            = bytes32("FPNFT::TxFeeRatio");
    bytes32 internal constant MinValueOfBotHolder   = bytes32("FPNFT::MinValueOfBotHolder");
    bytes32 internal constant BotToken              = bytes32("FPNFT::BotToken");
    bytes32 internal constant DisableErc721         = bytes32("FPNFT::DisableErc721");
    bytes32 internal constant DisableErc1155        = bytes32("FPNFT::DisableErc1155");
    uint    internal constant TypeErc721            = 0;
    uint    internal constant TypeErc1155           = 1;

    struct Pool {
        // address of pool creator
        address creator;
        // address of sell token
        address token0;
        // address of buy token
        address token1;
        // token id of token0
        uint tokenId;
        // total amount of token0
        uint amountTotal0;
        // total amount of token1
        uint amountTotal1;
        // NFT token type
        uint nftType;
        // open at
        uint openAt;
        // pool name
        string name;
    }

    Pool[] public pools;

    // creator address => pool index => whether the account create the pool.
    mapping(address => mapping(uint => bool)) public myCreatedP;

    // pool index => the swap pool only allow BOT holder to take part in
    mapping(uint => bool) public onlyBotHolderP;

    // pool index => a flag that if creator is canceled the pool
    mapping(uint => bool) public creatorCanceledP;
    // pool index => a flag that if the pool is finished
    mapping(uint => bool) public swappedP;

    // check if token0 in whitelist
    bool public checkToken0;
    // token0 address => true or false
    mapping(address => bool) public token0List;

    // pool index => swapped amount of token0
    mapping(uint => uint) public swappedAmount0P;
    // pool index => swapped amount of token1
    mapping(uint => uint) public swappedAmount1P;

    uint public totalTxFee;

    event Created(address indexed sender, uint indexed index);
    event Canceled(address indexed sender, uint indexed index, uint unswappedAmount0);
    event Swapped(address indexed sender, uint indexed index, uint swappedAmount0, uint swappedAmount1);

    modifier checkBotHolder(uint index) {
        if (onlyBotHolderP[index]) {
            require(
            getMinValueOfBotHolder() > 0 && IERC20(getBotToken()).balanceOf(msg.sender) >= getMinValueOfBotHolder(),
                "BOT is not enough"
            );
        }
        _;
    }

    modifier isPoolNotSwap(uint index) {
        require(!swappedP[index], "this pool is swapped");
        _;
    }

    modifier isPoolExist(uint index) {
        require(index < pools.length, "this pool does not exist");
        _;
    }

    function initialize(address botToken) public initializer {
        config[MinValueOfBotHolder] = 1 ether;
        config[BotToken] = uint(uint160(botToken)); 
    }

    function createErc721(
        string memory name,
        address token0,
        address token1,
        uint tokenId,
        uint amountTotal1,
        uint openAt,
        bool onlyBot
    ) external {
        require(!getDisableErc721(), "ERC721 pool is disabled");
        if (checkToken0) {
            require(token0List[token0], "invalid token0");
        }
        uint amountTotal0 = 1;
        _create(
           name, token0, token1, tokenId, amountTotal0, amountTotal1, openAt, onlyBot, TypeErc721
        );
    }

    function createErc1155(
        string memory name,
        address token0,
        address token1,
        uint tokenId,
        uint amountTotal0,
        uint amountTotal1,
        uint openAt,
        bool onlyBot
    ) external {
        require(!getDisableErc1155(), "ERC1155 pool is disabled");
        if (checkToken0) {
            require(token0List[token0], "invalid token0");
        }
        _create(
           name, token0, token1, tokenId, amountTotal0, amountTotal1, openAt, onlyBot, TypeErc1155
        );
    }

    function swap(uint index, uint amount0) external payable isPoolExist(index) checkBotHolder(index) isPoolNotSwap(index) {
        require(!creatorCanceledP[index], "creator has canceled this pool");

        Pool storage pool = pools[index];
        require(pool.creator != msg.sender, "creator can't swap the pool created by self");
        require(amount0 >= 1 && amount0 <= pool.amountTotal0, "invalid amount0");
        require(swappedAmount0P[index].add(amount0) <= pool.amountTotal0, "pool filled or invalid amount0");
        require(pool.openAt <= block.timestamp, "pool is not open");

        uint amount1 = amount0.mul(pool.amountTotal1).div(pool.amountTotal0);
        swappedAmount0P[index] = swappedAmount0P[index].add(amount0);
        swappedAmount1P[index] = swappedAmount1P[index].add(amount1);
        if (swappedAmount0P[index] == pool.amountTotal0) {
            // mark pool is swapped
            swappedP[index] = true;
        }

        // transfer amount of token1 to creator
        if (pool.token1 == address(0)) {
            require(amount1 == msg.value, "invalid ETH amount");
            TransferHelper.safeTransferETH(pool.creator, amount1);
        } else {
            TransferHelper.safeTransferFrom(pool.token1, msg.sender, pool.creator, amount1);
        }

        // transfer tokenId of token0 to sender
        if (pool.nftType == TypeErc721) {
            IERC721(pool.token0).safeTransferFrom(address(this), msg.sender, pool.tokenId);
        } else {
            IERC1155(pool.token0).safeTransferFrom(address(this), msg.sender, pool.tokenId, amount0, "");
        }

        emit Swapped(msg.sender, index, amount0, amount1);
    }

    function cancel(uint index) external isPoolExist(index) isPoolNotSwap(index) {
        require(isCreator(msg.sender, index), "sender is not pool creator");
        require(!creatorCanceledP[index], "creator has canceled this pool");
        creatorCanceledP[index] = true;

        Pool memory pool = pools[index];
        if (pool.nftType == TypeErc721) {
            IERC721(pool.token0).safeTransferFrom(address(this), pool.creator, pool.tokenId);
        } else {
            IERC1155(pool.token0).safeTransferFrom(address(this), pool.creator, pool.tokenId, pool.amountTotal0.sub(swappedAmount0P[index]), "");
        }

        emit Canceled(msg.sender, index, pool.amountTotal0.sub(swappedAmount0P[index]));
    }

    function enableCheckToken0(bool enable) external onlyOwner {
        checkToken0 = enable;
    }

    function addToken0List(address[] memory token0List_) external onlyOwner {
        for (uint i = 0; i < token0List_.length; i++) {
            token0List[token0List_[i]] = true;
        }
    }

    function removeToken0List(address[] memory token0List_) external onlyOwner {
        for (uint i = 0; i < token0List_.length; i++) {
            delete token0List[token0List_[i]];
        }
    }

    function setConfig(bytes32 key, uint value) external onlyOwner {
        _setConfig(key, value);
    }
    
    function setConfig(bytes32 key, uint index, uint value) external onlyOwner {
        _setConfig(bytes32(uint(key) ^ index), value);
    }

    function setConfig(bytes32 key, address addr, uint value) external onlyOwner {
        _setConfig(bytes32(uint(key) ^ uint(uint160(addr))), value);
    }

    function withdrawFee(address payable to, uint amount) external onlyOwner {
        totalTxFee = totalTxFee.sub(amount);
        TransferHelper.safeTransferETH(to, amount);
    }

    function isCreator(address target, uint index) public view returns (bool) {
        if (pools[index].creator == target) {
            return true;
        }
        return false;
    }

    function getMinValueOfBotHolder() public view returns (uint) {
        return config[MinValueOfBotHolder];
    }

    function getBotToken() public view returns (address) {
        return address(uint160(config[BotToken]));
    }

    function getDisableErc721() public view returns (bool) {
        return config[DisableErc721] != 0;
    }

    function getDisableErc1155() public view returns (bool) {
        return config[DisableErc1155] != 0;
    }

    function getPoolCount() external view returns (uint) {
        return pools.length;
    }

    function onERC721Received(address, address, uint, bytes calldata) external pure override returns (bytes4) {
        return this.onERC721Received.selector;
    }

    function onERC1155Received(address, address, uint, uint, bytes calldata) external pure returns(bytes4) {
        return this.onERC1155Received.selector;
    }

    function _create(
        string memory name,
        address token0,
        address token1,
        uint tokenId,
        uint amountTotal0,
        uint amountTotal1,
        uint openAt,
        bool onlyBot,
        uint nftType
    ) private {
        // require(tx.origin == msg.sender, "disallow contract caller");
        require(amountTotal1 != 0, "the value of amountTotal1 is zero.");
        require(bytes(name).length <= 32, "the length of name is too long");

        // transfer tokenId of token0 to this contract
        if (nftType == TypeErc721) {
            require(amountTotal0 == 1, "invalid amountTotal0");
            IERC721(token0).safeTransferFrom(msg.sender, address(this), tokenId);
        } else {
            require(amountTotal0 != 0, "invalid amountTotal0");
            IERC1155(token0).safeTransferFrom(msg.sender, address(this), tokenId, amountTotal0, "");
        }

        // creator pool
        Pool memory pool;
        pool.creator = msg.sender;
        pool.name = name;
        pool.token0 = token0;
        pool.token1 = token1;
        pool.tokenId = tokenId;
        pool.amountTotal0 = amountTotal0;
        pool.amountTotal1 = amountTotal1;
        pool.nftType = nftType;
        pool.openAt = openAt;

        uint index = pools.length;
        myCreatedP[msg.sender][index] = true;
        if (onlyBot) {
            onlyBotHolderP[index] = onlyBot;
        }

        pools.push(pool);

        emit Created(msg.sender, index);
    }

}

File 2 of 13 : SafeMath.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (utils/math/SafeMath.sol)

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

File 3 of 13 : Address.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)

pragma solidity ^0.8.1;

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

        return account.code.length > 0;
    }

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

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

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

File 4 of 13 : IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

File 5 of 13 : IERC721.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC721/IERC721.sol)

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

    /**
     * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients
     * are aware of the ERC721 protocol to prevent tokens from being forever locked.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must exist and be owned by `from`.
     * - If the caller is not `from`, it must 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: Note that the caller is responsible to confirm that the recipient is capable of receiving ERC721
     * or else they may be permanently lost. Usage of {safeTransferFrom} prevents loss, though the caller must
     * understand this adds an external call which potentially creates a reentrancy vulnerability.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must be owned by `from`.
     * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(
        address from,
        address to,
        uint256 tokenId
    ) external;

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

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

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

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

File 6 of 13 : IERC721Receiver.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 IERC721Receiver {
    /**
     * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom}
     * by `operator` from `from`, this function is called.
     *
     * It must return its Solidity selector to confirm the token transfer.
     * If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted.
     *
     * The selector can be obtained in Solidity with `IERC721Receiver.onERC721Received.selector`.
     */
    function onERC721Received(
        address operator,
        address from,
        uint256 tokenId,
        bytes calldata data
    ) external returns (bytes4);
}

File 7 of 13 : IERC1155.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (token/ERC1155/IERC1155.sol)

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

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

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

File 8 of 13 : Initializable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (proxy/utils/Initializable.sol)

pragma solidity ^0.8.2;

import "../../utils/Address.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]
 * ```
 * 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) || (!Address.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 Internal function that returns the initialized version. Returns `_initialized`
     */
    function _getInitializedVersion() internal view returns (uint8) {
        return _initialized;
    }

    /**
     * @dev Internal function that returns the initialized version. Returns `_initializing`
     */
    function _isInitializing() internal view returns (bool) {
        return _initializing;
    }
}

File 9 of 13 : Ownable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)

pragma solidity ^0.8.0;

import "../utils/Context.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 Ownable is Context {
    address private _owner;

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

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

    /**
     * @dev 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 anymore. Can only be called by the current owner.
     *
     * NOTE: Renouncing ownership will leave the contract without an owner,
     * thereby removing any functionality that is only available to the owner.
     */
    function renounceOwnership() public virtual onlyOwner {
        _transferOwnership(address(0));
    }

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

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

File 10 of 13 : TransferHelper.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.8.0;

// helper methods for interacting with ERC20 tokens and sending ETH that do not consistently return true/false
library TransferHelper {
    function safeApprove(address token, address to, uint value) internal {
        // bytes4(keccak256(bytes('approve(address,uint256)')));
        (bool success, bytes memory data) = token.call(abi.encodeWithSelector(0x095ea7b3, to, value));
        require(success && (data.length == 0 || abi.decode(data, (bool))), 'TransferHelper: APPROVE_FAILED');
    }

    function safeTransfer(address token, address to, uint value) internal {
        // bytes4(keccak256(bytes('transfer(address,uint256)')));
        (bool success, bytes memory data) = token.call(abi.encodeWithSelector(0xa9059cbb, to, value));
        require(success && (data.length == 0 || abi.decode(data, (bool))), 'TransferHelper: TRANSFER_FAILED');
    }

    function safeTransferFrom(address token, address from, address to, uint value) internal {
        // bytes4(keccak256(bytes('transferFrom(address,address,uint256)')));
        (bool success, bytes memory data) = token.call(abi.encodeWithSelector(0x23b872dd, from, to, value));
        require(success && (data.length == 0 || abi.decode(data, (bool))), 'TransferHelper: TRANSFER_FROM_FAILED');
    }

    function safeTransferETH(address to, uint value) internal {
        (bool success,) = to.call{value:value}(new bytes(0));
        require(success, 'TransferHelper: ETH_TRANSFER_FAILED');
    }
}

File 11 of 13 : Configurable.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.8.0;

contract Configurable {

    mapping (bytes32 => uint) internal config;
    
    function getConfig(bytes32 key) public view returns (uint) {
        return config[key];
    }
    function getConfig(bytes32 key, uint index) public view returns (uint) {
        return config[bytes32(uint(key) ^ index)];
    }
    function getConfig(bytes32 key, address addr) public view returns (uint) {
        return config[bytes32(uint(key) ^ uint(uint160(addr)))];
    }

    function _setConfig(bytes32 key, uint value) internal {
        if(config[key] != value)
            config[key] = value;
    }
    function _setConfig(bytes32 key, uint index, uint value) internal {
        _setConfig(bytes32(uint(key) ^ index), value);
    }
    function _setConfig(bytes32 key, address addr, uint value) internal {
        _setConfig(bytes32(uint(key) ^ uint(uint160(addr))), value);
    }
}

File 12 of 13 : IERC165.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)

pragma solidity ^0.8.0;

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

File 13 of 13 : Context.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)

pragma solidity ^0.8.0;

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

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

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

Contract Security Audit

Contract ABI

[{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":true,"internalType":"uint256","name":"index","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"unswappedAmount0","type":"uint256"}],"name":"Canceled","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":true,"internalType":"uint256","name":"index","type":"uint256"}],"name":"Created","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint8","name":"version","type":"uint8"}],"name":"Initialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":true,"internalType":"uint256","name":"index","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"swappedAmount0","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"swappedAmount1","type":"uint256"}],"name":"Swapped","type":"event"},{"inputs":[{"internalType":"address[]","name":"token0List_","type":"address[]"}],"name":"addToken0List","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"index","type":"uint256"}],"name":"cancel","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"checkToken0","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"name","type":"string"},{"internalType":"address","name":"token0","type":"address"},{"internalType":"address","name":"token1","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"amountTotal0","type":"uint256"},{"internalType":"uint256","name":"amountTotal1","type":"uint256"},{"internalType":"uint256","name":"openAt","type":"uint256"},{"internalType":"bool","name":"onlyBot","type":"bool"}],"name":"createErc1155","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"name","type":"string"},{"internalType":"address","name":"token0","type":"address"},{"internalType":"address","name":"token1","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"amountTotal1","type":"uint256"},{"internalType":"uint256","name":"openAt","type":"uint256"},{"internalType":"bool","name":"onlyBot","type":"bool"}],"name":"createErc721","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"creatorCanceledP","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bool","name":"enable","type":"bool"}],"name":"enableCheckToken0","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getBotToken","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"key","type":"bytes32"},{"internalType":"address","name":"addr","type":"address"}],"name":"getConfig","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"key","type":"bytes32"}],"name":"getConfig","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"key","type":"bytes32"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"getConfig","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getDisableErc1155","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getDisableErc721","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getMinValueOfBotHolder","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getPoolCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"botToken","type":"address"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"target","type":"address"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"isCreator","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"myCreatedP","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"onERC1155Received","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"onERC721Received","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"onlyBotHolderP","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"pools","outputs":[{"internalType":"address","name":"creator","type":"address"},{"internalType":"address","name":"token0","type":"address"},{"internalType":"address","name":"token1","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"amountTotal0","type":"uint256"},{"internalType":"uint256","name":"amountTotal1","type":"uint256"},{"internalType":"uint256","name":"nftType","type":"uint256"},{"internalType":"uint256","name":"openAt","type":"uint256"},{"internalType":"string","name":"name","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"token0List_","type":"address[]"}],"name":"removeToken0List","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"key","type":"bytes32"},{"internalType":"uint256","name":"value","type":"uint256"}],"name":"setConfig","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"key","type":"bytes32"},{"internalType":"address","name":"addr","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"}],"name":"setConfig","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"key","type":"bytes32"},{"internalType":"uint256","name":"index","type":"uint256"},{"internalType":"uint256","name":"value","type":"uint256"}],"name":"setConfig","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"index","type":"uint256"},{"internalType":"uint256","name":"amount0","type":"uint256"}],"name":"swap","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"swappedAmount0P","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"swappedAmount1P","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"swappedP","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"token0List","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalTxFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address payable","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"withdrawFee","outputs":[],"stateMutability":"nonpayable","type":"function"}]

608060405234801561001057600080fd5b5061001a3361001f565b61007a565b600080546001600160a01b038381166201000081810262010000600160b01b0319851617855560405193049190911692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a35050565b612cb5806200008a6000396000f3fe60806040526004361061024f5760003560e01c8063b21544f311610138578063db06c05f116100b0578063f27d533c1161007f578063f3f9742f11610064578063f3f9742f14610889578063fd9be522146108a9578063fde88858146108c957600080fd5b8063f27d533c14610849578063f2fde38b1461086957600080fd5b8063db06c05f14610793578063ddf2be3f146107c3578063e9479378146107e3578063f23a6e611461080357600080fd5b8063c6472b1211610107578063c94dddf8116100ec578063c94dddf81461073d578063cbe4b8eb14610753578063d96073cf1461078057600080fd5b8063c6472b12146106be578063c7011b7b146106ee57600080fd5b8063b21544f3146105ef578063b4b267761461060f578063c4d66de81461066e578063c53c305d1461068e57600080fd5b806363cb6c42116101cb578063715018a61161019a5780638ec872e31161017f5780638ec872e3146105775780638eec5d70146105a5578063ac4afa38146105ba57600080fd5b8063715018a61461052a5780638da5cb5b1461053f57600080fd5b806363cb6c42146104535780636ca9b9f2146104b05780636d17b1d8146104d05780636dd5b69d146104fd57600080fd5b80632ca77bf8116102225780633fb7166d116102075780633fb7166d146103ca57806340e58ee51461040557806352665f471461042557600080fd5b80632ca77bf81461035157806333838c6e1461036b57600080fd5b806306e7441814610254578063150b7a021461027657806315fe96dc146102f157806329dbd09814610311575b600080fd5b34801561026057600080fd5b5061027461026f3660046125bf565b6108e9565b005b34801561028257600080fd5b506102bb6102913660046126ba565b7f150b7a020000000000000000000000000000000000000000000000000000000095945050505050565b6040517fffffffff0000000000000000000000000000000000000000000000000000000090911681526020015b60405180910390f35b3480156102fd57600080fd5b5061027461030c36600461272d565b610954565b34801561031d57600080fd5b5061034161032c36600461274f565b60086020526000908152604090205460ff1681565b60405190151581526020016102e8565b34801561035d57600080fd5b506007546103419060ff1681565b34801561037757600080fd5b507f46504e46543a3a44697361626c6545726331313535000000000000000000000060005260016020527fe4bc44dca9a99c56a2ca6a329332a871d3fda368a400dd2da206ea73db807f1d541515610341565b3480156103d657600080fd5b506103416103e536600461276c565b600360209081526000928352604080842090915290825290205460ff1681565b34801561041157600080fd5b50610274610420366004612798565b610966565b34801561043157600080fd5b506104456104403660046127b1565b610dd3565b6040519081526020016102e8565b34801561045f57600080fd5b507f46504e46543a3a4d696e56616c75654f66426f74486f6c64657200000000000060005260016020527f3b199c60c812e21ef78a0cb1d39beb4b11d20b936f9925571c5b896947e8f2d754610445565b3480156104bc57600080fd5b506103416104cb36600461276c565b610df5565b3480156104dc57600080fd5b506104456104eb366004612798565b60096020526000908152604090205481565b34801561050957600080fd5b50610445610518366004612798565b60009081526001602052604090205490565b34801561053657600080fd5b50610274610e44565b34801561054b57600080fd5b506000546201000090046001600160a01b03165b6040516001600160a01b0390911681526020016102e8565b34801561058357600080fd5b5061044561059236600461272d565b1860009081526001602052604090205490565b3480156105b157600080fd5b50600254610445565b3480156105c657600080fd5b506105da6105d5366004612798565b610e58565b6040516102e899989796959493929190612811565b3480156105fb57600080fd5b5061027461060a366004612891565b610f50565b34801561061b57600080fd5b507f46504e46543a3a44697361626c6545726337323100000000000000000000000060005260016020527f07440e9b95e28e7c138e0d2e304dcf810f889c470107ff4a426d027d35e868d2541515610341565b34801561067a57600080fd5b5061027461068936600461274f565b610f72565b34801561069a57600080fd5b506103416106a9366004612798565b60056020526000908152604090205460ff1681565b3480156106ca57600080fd5b506103416106d9366004612798565b60046020526000908152604090205460ff1681565b3480156106fa57600080fd5b506e232827232a1d1d2137ba2a37b5b2b760891b60005260016020527f6bf267ff3ff1daa1aea5b0d2dbcb4d52862e1979908f7cb798f00df8e35c78cc5461055f565b34801561074957600080fd5b50610445600b5481565b34801561075f57600080fd5b5061044561076e366004612798565b600a6020526000908152604090205481565b61027461078e36600461272d565b6110fc565b34801561079f57600080fd5b506103416107ae366004612798565b60066020526000908152604090205460ff1681565b3480156107cf57600080fd5b506102746107de3660046128c9565b61183a565b3480156107ef57600080fd5b506102746107fe366004612973565b61184e565b34801561080f57600080fd5b506102bb61081e366004612a11565b7ff23a6e61000000000000000000000000000000000000000000000000000000009695505050505050565b34801561085557600080fd5b506102746108643660046125bf565b611975565b34801561087557600080fd5b5061027461088436600461274f565b6119e5565b34801561089557600080fd5b506102746108a4366004612a8d565b611a75565b3480156108b557600080fd5b506102746108c436600461276c565b611a90565b3480156108d557600080fd5b506102746108e4366004612aaa565b611ab2565b6108f1611bd1565b60005b8151811015610950576008600083838151811061091357610913612b3e565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff191690558061094881612b6a565b9150506108f4565b5050565b61095c611bd1565b6109508282611c32565b600254819081106109be5760405162461bcd60e51b815260206004820152601860248201527f7468697320706f6f6c20646f6573206e6f74206578697374000000000000000060448201526064015b60405180910390fd5b600082815260066020526040902054829060ff1615610a1f5760405162461bcd60e51b815260206004820152601460248201527f7468697320706f6f6c206973207377617070656400000000000000000000000060448201526064016109b5565b610a293384610df5565b610a755760405162461bcd60e51b815260206004820152601a60248201527f73656e646572206973206e6f7420706f6f6c2063726561746f7200000000000060448201526064016109b5565b60008381526005602052604090205460ff1615610ad45760405162461bcd60e51b815260206004820152601e60248201527f63726561746f72206861732063616e63656c6564207468697320706f6f6c000060448201526064016109b5565b6000838152600560205260408120805460ff191660011790556002805485908110610b0157610b01612b3e565b60009182526020918290206040805161012081018252600990930290910180546001600160a01b03908116845260018201548116948401949094526002810154909316908201526003820154606082015260048201546080820152600582015460a0820152600682015460c0820152600782015460e082015260088201805491929161010084019190610b9390612b83565b80601f0160208091040260200160405190810160405280929190818152602001828054610bbf90612b83565b8015610c0c5780601f10610be157610100808354040283529160200191610c0c565b820191906000526020600020905b815481529060010190602001808311610bef57829003601f168201915b505050505081525050905060008160c0015103610c9d57602081015181516060830151604051632142170760e11b81523060048201526001600160a01b03928316602482015260448101919091529116906342842e0e90606401600060405180830381600087803b158015610c8057600080fd5b505af1158015610c94573d6000803e3d6000fd5b50505050610d78565b80602001516001600160a01b031663f242432a3083600001518460600151610ce5600960008b8152602001908152602001600020548760800151611c5990919063ffffffff16565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e087901b1681526001600160a01b0394851660048201529390921660248401526044830152606482015260a06084820152600060a482015260c401600060405180830381600087803b158015610d5f57600080fd5b505af1158015610d73573d6000803e3d6000fd5b505050505b6000848152600960205260409020546080820151859133917fbfa7d46262a9a31ea77e88a2181c8df97ba63688b0743969005d612d614faba091610dbc9190611c59565b60405190815260200160405180910390a350505050565b6001600160a01b03811682186000908152600160205260409020545b92915050565b6000826001600160a01b031660028381548110610e1457610e14612b3e565b60009182526020909120600990910201546001600160a01b031603610e3b57506001610def565b50600092915050565b610e4c611bd1565b610e566000611c6c565b565b60028181548110610e6857600080fd5b60009182526020909120600990910201805460018201546002830154600384015460048501546005860154600687015460078801546008890180546001600160a01b03998a169b509789169998909616979496939592949193909290610ecd90612b83565b80601f0160208091040260200160405190810160405280929190818152602001828054610ef990612b83565b8015610f465780601f10610f1b57610100808354040283529160200191610f46565b820191906000526020600020905b815481529060010190602001808311610f2957829003601f168201915b5050505050905089565b610f58611bd1565b610f6d6001600160a01b038316841882611c32565b505050565b600054610100900460ff1615808015610f925750600054600160ff909116105b80610fac5750303b158015610fac575060005460ff166001145b61101e5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a656400000000000000000000000000000000000060648201526084016109b5565b6000805460ff191660011790558015611041576000805461ff0019166101001790555b6001602052670de0b6b3a76400007f3b199c60c812e21ef78a0cb1d39beb4b11d20b936f9925571c5b896947e8f2d7556e232827232a1d1d2137ba2a37b5b2b760891b6000526001600160a01b0382167f6bf267ff3ff1daa1aea5b0d2dbcb4d52862e1979908f7cb798f00df8e35c78cc558015610950576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15050565b6002548290811061114f5760405162461bcd60e51b815260206004820152601860248201527f7468697320706f6f6c20646f6573206e6f74206578697374000000000000000060448201526064016109b5565b600083815260046020526040902054839060ff161561131d5760006111bb7f46504e46543a3a4d696e56616c75654f66426f74486f6c64657200000000000060005260016020527f3b199c60c812e21ef78a0cb1d39beb4b11d20b936f9925571c5b896947e8f2d75490565b1180156112d157507f46504e46543a3a4d696e56616c75654f66426f74486f6c64657200000000000060005260016020527f3b199c60c812e21ef78a0cb1d39beb4b11d20b936f9925571c5b896947e8f2d7546e232827232a1d1d2137ba2a37b5b2b760891b60005260016020527f6bf267ff3ff1daa1aea5b0d2dbcb4d52862e1979908f7cb798f00df8e35c78cc546040517f70a082310000000000000000000000000000000000000000000000000000000081523360048201526001600160a01b0391909116906370a0823190602401602060405180830381865afa1580156112aa573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112ce9190612bbd565b10155b61131d5760405162461bcd60e51b815260206004820152601160248201527f424f54206973206e6f7420656e6f75676800000000000000000000000000000060448201526064016109b5565b600084815260066020526040902054849060ff161561137e5760405162461bcd60e51b815260206004820152601460248201527f7468697320706f6f6c206973207377617070656400000000000000000000000060448201526064016109b5565b60008581526005602052604090205460ff16156113dd5760405162461bcd60e51b815260206004820152601e60248201527f63726561746f72206861732063616e63656c6564207468697320706f6f6c000060448201526064016109b5565b6000600286815481106113f2576113f2612b3e565b600091825260209091206009909102018054909150336001600160a01b03909116036114865760405162461bcd60e51b815260206004820152602b60248201527f63726561746f722063616e277420737761702074686520706f6f6c206372656160448201527f7465642062792073656c6600000000000000000000000000000000000000000060648201526084016109b5565b6001851015801561149b575080600401548511155b6114e75760405162461bcd60e51b815260206004820152600f60248201527f696e76616c696420616d6f756e7430000000000000000000000000000000000060448201526064016109b5565b60048101546000878152600960205260409020546115059087611cdd565b11156115535760405162461bcd60e51b815260206004820152601e60248201527f706f6f6c2066696c6c6564206f7220696e76616c696420616d6f756e7430000060448201526064016109b5565b42816007015411156115a75760405162461bcd60e51b815260206004820152601060248201527f706f6f6c206973206e6f74206f70656e0000000000000000000000000000000060448201526064016109b5565b60006115ce82600401546115c8846005015489611ce990919063ffffffff16565b90611cf5565b6000888152600960205260409020549091506115ea9087611cdd565b600088815260096020908152604080832093909355600a9052205461160f9082611cdd565b6000888152600a6020908152604080832093909355600485015460099091529190205403611651576000878152600660205260409020805460ff191660011790555b60028201546001600160a01b03166116cc573481146116b25760405162461bcd60e51b815260206004820152601260248201527f696e76616c69642045544820616d6f756e74000000000000000000000000000060448201526064016109b5565b81546116c7906001600160a01b031682611d01565b6116ec565b600282015482546116ec916001600160a01b039081169133911684611de4565b600682015461176c5760018201546003830154604051632142170760e11b815230600482015233602482015260448101919091526001600160a01b03909116906342842e0e90606401600060405180830381600087803b15801561174f57600080fd5b505af1158015611763573d6000803e3d6000fd5b505050506117f4565b60018201546003830154604051637921219560e11b815230600482015233602482015260448101919091526064810188905260a06084820152600060a48201526001600160a01b039091169063f242432a9060c401600060405180830381600087803b1580156117db57600080fd5b505af11580156117ef573d6000803e3d6000fd5b505050505b6040805187815260208101839052889133917f36a39cf3f9b8206db312650e7d954482535a2e33fb0b54e1030f149ed213823a910160405180910390a350505050505050565b611842611bd1565b610f6d83831882611c32565b7f46504e46543a3a44697361626c6545726331313535000000000000000000000060005260016020527fe4bc44dca9a99c56a2ca6a329332a871d3fda368a400dd2da206ea73db807f1d54156118e65760405162461bcd60e51b815260206004820152601860248201527f4552433131353520706f6f6c2069732064697361626c6564000000000000000060448201526064016109b5565b60075460ff1615611959576001600160a01b03871660009081526008602052604090205460ff166119595760405162461bcd60e51b815260206004820152600e60248201527f696e76616c696420746f6b656e3000000000000000000000000000000000000060448201526064016109b5565b61196b88888888888888886001611f5b565b5050505050505050565b61197d611bd1565b60005b8151811015610950576001600860008484815181106119a1576119a1612b3e565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806119dd81612b6a565b915050611980565b6119ed611bd1565b6001600160a01b038116611a695760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f646472657373000000000000000000000000000000000000000000000000000060648201526084016109b5565b611a7281611c6c565b50565b611a7d611bd1565b6007805460ff1916911515919091179055565b611a98611bd1565b600b54611aa59082611c59565b600b556109508282611d01565b7f46504e46543a3a44697361626c6545726337323100000000000000000000000060005260016020527f07440e9b95e28e7c138e0d2e304dcf810f889c470107ff4a426d027d35e868d25415611b4a5760405162461bcd60e51b815260206004820152601760248201527f45524337323120706f6f6c2069732064697361626c656400000000000000000060448201526064016109b5565b60075460ff1615611bbd576001600160a01b03861660009081526008602052604090205460ff16611bbd5760405162461bcd60e51b815260206004820152600e60248201527f696e76616c696420746f6b656e3000000000000000000000000000000000000060448201526064016109b5565b600161196b88888888858989896000611f5b565b6000546001600160a01b0362010000909104163314610e565760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016109b5565b60008281526001602052604090205481146109505760009182526001602052604090912055565b6000611c658284612bd6565b9392505050565b600080546001600160a01b03838116620100008181027fffffffffffffffffffff0000000000000000000000000000000000000000ffff851617855560405193049190911692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a35050565b6000611c658284612bed565b6000611c658284612c05565b6000611c658284612c24565b604080516000808252602082019092526001600160a01b038416908390604051611d2b9190612c46565b60006040518083038185875af1925050503d8060008114611d68576040519150601f19603f3d011682016040523d82523d6000602084013e611d6d565b606091505b5050905080610f6d5760405162461bcd60e51b815260206004820152602360248201527f5472616e7366657248656c7065723a204554485f5452414e534645525f46414960448201527f4c4544000000000000000000000000000000000000000000000000000000000060648201526084016109b5565b604080516001600160a01b0385811660248301528481166044830152606480830185905283518084039091018152608490920183526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f23b872dd000000000000000000000000000000000000000000000000000000001790529151600092839290881691611e769190612c46565b6000604051808303816000865af19150503d8060008114611eb3576040519150601f19603f3d011682016040523d82523d6000602084013e611eb8565b606091505b5091509150818015611ee2575080511580611ee2575080806020019051810190611ee29190612c62565b611f535760405162461bcd60e51b8152602060048201526024808201527f5472616e7366657248656c7065723a205452414e534645525f46524f4d5f464160448201527f494c45440000000000000000000000000000000000000000000000000000000060648201526084016109b5565b505050505050565b83600003611fd15760405162461bcd60e51b815260206004820152602260248201527f7468652076616c7565206f6620616d6f756e74546f74616c31206973207a657260448201527f6f2e00000000000000000000000000000000000000000000000000000000000060648201526084016109b5565b6020895111156120235760405162461bcd60e51b815260206004820152601e60248201527f746865206c656e677468206f66206e616d6520697320746f6f206c6f6e67000060448201526064016109b5565b806120e357846001146120785760405162461bcd60e51b815260206004820152601460248201527f696e76616c696420616d6f756e74546f74616c3000000000000000000000000060448201526064016109b5565b604051632142170760e11b8152336004820152306024820152604481018790526001600160a01b038916906342842e0e90606401600060405180830381600087803b1580156120c657600080fd5b505af11580156120da573d6000803e3d6000fd5b505050506121af565b846000036121335760405162461bcd60e51b815260206004820152601460248201527f696e76616c696420616d6f756e74546f74616c3000000000000000000000000060448201526064016109b5565b604051637921219560e11b8152336004820152306024820152604481018790526064810186905260a06084820152600060a48201526001600160a01b0389169063f242432a9060c401600060405180830381600087803b15801561219657600080fd5b505af11580156121aa573d6000803e3d6000fd5b505050505b61221960405180610120016040528060006001600160a01b0316815260200160006001600160a01b0316815260200160006001600160a01b031681526020016000815260200160008152602001600081526020016000815260200160008152602001606081525090565b3380825261010082018b90526001600160a01b038a8116602080850191909152908a16604080850191909152606084018a90526080840189905260a0840188905260c0840185905260e08401879052600254600093845260038352818420818552909252909120805460ff1916600117905583156122ac576000818152600460205260409020805460ff19168515151790555b6002805460018101825560009190915282517f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ace600990920291820180547fffffffffffffffffffffffff00000000000000000000000000000000000000009081166001600160a01b039384161782556020808701517f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5acf86018054841691861691909117905560408701517f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ad086018054909316941693909317905560608501517f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ad184015560808501517f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ad284015560a08501517f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ad384015560c08501517f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ad484015560e08501517f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ad584015561010085015180518694929361248d937f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ad6019201906124ca565b505060405182915033907f0ce3610e89a4bb9ec9359763f99110ed52a4abaea0b62028a1637e242ca2768b90600090a35050505050505050505050565b8280546124d690612b83565b90600052602060002090601f0160209004810192826124f8576000855561253e565b82601f1061251157805160ff191683800117855561253e565b8280016001018555821561253e579182015b8281111561253e578251825591602001919060010190612523565b5061254a92915061254e565b5090565b5b8082111561254a576000815560010161254f565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff811182821017156125a2576125a2612563565b604052919050565b6001600160a01b0381168114611a7257600080fd5b600060208083850312156125d257600080fd5b823567ffffffffffffffff808211156125ea57600080fd5b818501915085601f8301126125fe57600080fd5b81358181111561261057612610612563565b8060051b9150612621848301612579565b818152918301840191848101908884111561263b57600080fd5b938501935b838510156126655784359250612655836125aa565b8282529385019390850190612640565b98975050505050505050565b60008083601f84011261268357600080fd5b50813567ffffffffffffffff81111561269b57600080fd5b6020830191508360208285010111156126b357600080fd5b9250929050565b6000806000806000608086880312156126d257600080fd5b85356126dd816125aa565b945060208601356126ed816125aa565b935060408601359250606086013567ffffffffffffffff81111561271057600080fd5b61271c88828901612671565b969995985093965092949392505050565b6000806040838503121561274057600080fd5b50508035926020909101359150565b60006020828403121561276157600080fd5b8135611c65816125aa565b6000806040838503121561277f57600080fd5b823561278a816125aa565b946020939093013593505050565b6000602082840312156127aa57600080fd5b5035919050565b600080604083850312156127c457600080fd5b8235915060208301356127d6816125aa565b809150509250929050565b60005b838110156127fc5781810151838201526020016127e4565b8381111561280b576000848401525b50505050565b60006101206001600160a01b03808d168452808c166020850152808b166040850152508860608401528760808401528660a08401528560c08401528460e08401528061010084015283518082850152610140915061287581838601602088016127e1565b601f01601f1916929092019091019a9950505050505050505050565b6000806000606084860312156128a657600080fd5b8335925060208401356128b8816125aa565b929592945050506040919091013590565b6000806000606084860312156128de57600080fd5b505081359360208301359350604090920135919050565b600082601f83011261290657600080fd5b813567ffffffffffffffff81111561292057612920612563565b612933601f8201601f1916602001612579565b81815284602083860101111561294857600080fd5b816020850160208301376000918101602001919091529392505050565b8015158114611a7257600080fd5b600080600080600080600080610100898b03121561299057600080fd5b883567ffffffffffffffff8111156129a757600080fd5b6129b38b828c016128f5565b98505060208901356129c4816125aa565b965060408901356129d4816125aa565b9550606089013594506080890135935060a0890135925060c0890135915060e0890135612a0081612965565b809150509295985092959890939650565b60008060008060008060a08789031215612a2a57600080fd5b8635612a35816125aa565b95506020870135612a45816125aa565b94506040870135935060608701359250608087013567ffffffffffffffff811115612a6f57600080fd5b612a7b89828a01612671565b979a9699509497509295939492505050565b600060208284031215612a9f57600080fd5b8135611c6581612965565b600080600080600080600060e0888a031215612ac557600080fd5b873567ffffffffffffffff811115612adc57600080fd5b612ae88a828b016128f5565b9750506020880135612af9816125aa565b95506040880135612b09816125aa565b9450606088013593506080880135925060a0880135915060c0880135612b2e81612965565b8091505092959891949750929550565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600060018201612b7c57612b7c612b54565b5060010190565b600181811c90821680612b9757607f821691505b602082108103612bb757634e487b7160e01b600052602260045260246000fd5b50919050565b600060208284031215612bcf57600080fd5b5051919050565b600082821015612be857612be8612b54565b500390565b60008219821115612c0057612c00612b54565b500190565b6000816000190483118215151615612c1f57612c1f612b54565b500290565b600082612c4157634e487b7160e01b600052601260045260246000fd5b500490565b60008251612c588184602087016127e1565b9190910192915050565b600060208284031215612c7457600080fd5b8151611c658161296556fea2646970667358221220eb941ef19afbc3101173428393a97ebb95b248a0297aca1057def98aca01260864736f6c634300080d0033

Deployed Bytecode

0x60806040526004361061024f5760003560e01c8063b21544f311610138578063db06c05f116100b0578063f27d533c1161007f578063f3f9742f11610064578063f3f9742f14610889578063fd9be522146108a9578063fde88858146108c957600080fd5b8063f27d533c14610849578063f2fde38b1461086957600080fd5b8063db06c05f14610793578063ddf2be3f146107c3578063e9479378146107e3578063f23a6e611461080357600080fd5b8063c6472b1211610107578063c94dddf8116100ec578063c94dddf81461073d578063cbe4b8eb14610753578063d96073cf1461078057600080fd5b8063c6472b12146106be578063c7011b7b146106ee57600080fd5b8063b21544f3146105ef578063b4b267761461060f578063c4d66de81461066e578063c53c305d1461068e57600080fd5b806363cb6c42116101cb578063715018a61161019a5780638ec872e31161017f5780638ec872e3146105775780638eec5d70146105a5578063ac4afa38146105ba57600080fd5b8063715018a61461052a5780638da5cb5b1461053f57600080fd5b806363cb6c42146104535780636ca9b9f2146104b05780636d17b1d8146104d05780636dd5b69d146104fd57600080fd5b80632ca77bf8116102225780633fb7166d116102075780633fb7166d146103ca57806340e58ee51461040557806352665f471461042557600080fd5b80632ca77bf81461035157806333838c6e1461036b57600080fd5b806306e7441814610254578063150b7a021461027657806315fe96dc146102f157806329dbd09814610311575b600080fd5b34801561026057600080fd5b5061027461026f3660046125bf565b6108e9565b005b34801561028257600080fd5b506102bb6102913660046126ba565b7f150b7a020000000000000000000000000000000000000000000000000000000095945050505050565b6040517fffffffff0000000000000000000000000000000000000000000000000000000090911681526020015b60405180910390f35b3480156102fd57600080fd5b5061027461030c36600461272d565b610954565b34801561031d57600080fd5b5061034161032c36600461274f565b60086020526000908152604090205460ff1681565b60405190151581526020016102e8565b34801561035d57600080fd5b506007546103419060ff1681565b34801561037757600080fd5b507f46504e46543a3a44697361626c6545726331313535000000000000000000000060005260016020527fe4bc44dca9a99c56a2ca6a329332a871d3fda368a400dd2da206ea73db807f1d541515610341565b3480156103d657600080fd5b506103416103e536600461276c565b600360209081526000928352604080842090915290825290205460ff1681565b34801561041157600080fd5b50610274610420366004612798565b610966565b34801561043157600080fd5b506104456104403660046127b1565b610dd3565b6040519081526020016102e8565b34801561045f57600080fd5b507f46504e46543a3a4d696e56616c75654f66426f74486f6c64657200000000000060005260016020527f3b199c60c812e21ef78a0cb1d39beb4b11d20b936f9925571c5b896947e8f2d754610445565b3480156104bc57600080fd5b506103416104cb36600461276c565b610df5565b3480156104dc57600080fd5b506104456104eb366004612798565b60096020526000908152604090205481565b34801561050957600080fd5b50610445610518366004612798565b60009081526001602052604090205490565b34801561053657600080fd5b50610274610e44565b34801561054b57600080fd5b506000546201000090046001600160a01b03165b6040516001600160a01b0390911681526020016102e8565b34801561058357600080fd5b5061044561059236600461272d565b1860009081526001602052604090205490565b3480156105b157600080fd5b50600254610445565b3480156105c657600080fd5b506105da6105d5366004612798565b610e58565b6040516102e899989796959493929190612811565b3480156105fb57600080fd5b5061027461060a366004612891565b610f50565b34801561061b57600080fd5b507f46504e46543a3a44697361626c6545726337323100000000000000000000000060005260016020527f07440e9b95e28e7c138e0d2e304dcf810f889c470107ff4a426d027d35e868d2541515610341565b34801561067a57600080fd5b5061027461068936600461274f565b610f72565b34801561069a57600080fd5b506103416106a9366004612798565b60056020526000908152604090205460ff1681565b3480156106ca57600080fd5b506103416106d9366004612798565b60046020526000908152604090205460ff1681565b3480156106fa57600080fd5b506e232827232a1d1d2137ba2a37b5b2b760891b60005260016020527f6bf267ff3ff1daa1aea5b0d2dbcb4d52862e1979908f7cb798f00df8e35c78cc5461055f565b34801561074957600080fd5b50610445600b5481565b34801561075f57600080fd5b5061044561076e366004612798565b600a6020526000908152604090205481565b61027461078e36600461272d565b6110fc565b34801561079f57600080fd5b506103416107ae366004612798565b60066020526000908152604090205460ff1681565b3480156107cf57600080fd5b506102746107de3660046128c9565b61183a565b3480156107ef57600080fd5b506102746107fe366004612973565b61184e565b34801561080f57600080fd5b506102bb61081e366004612a11565b7ff23a6e61000000000000000000000000000000000000000000000000000000009695505050505050565b34801561085557600080fd5b506102746108643660046125bf565b611975565b34801561087557600080fd5b5061027461088436600461274f565b6119e5565b34801561089557600080fd5b506102746108a4366004612a8d565b611a75565b3480156108b557600080fd5b506102746108c436600461276c565b611a90565b3480156108d557600080fd5b506102746108e4366004612aaa565b611ab2565b6108f1611bd1565b60005b8151811015610950576008600083838151811061091357610913612b3e565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff191690558061094881612b6a565b9150506108f4565b5050565b61095c611bd1565b6109508282611c32565b600254819081106109be5760405162461bcd60e51b815260206004820152601860248201527f7468697320706f6f6c20646f6573206e6f74206578697374000000000000000060448201526064015b60405180910390fd5b600082815260066020526040902054829060ff1615610a1f5760405162461bcd60e51b815260206004820152601460248201527f7468697320706f6f6c206973207377617070656400000000000000000000000060448201526064016109b5565b610a293384610df5565b610a755760405162461bcd60e51b815260206004820152601a60248201527f73656e646572206973206e6f7420706f6f6c2063726561746f7200000000000060448201526064016109b5565b60008381526005602052604090205460ff1615610ad45760405162461bcd60e51b815260206004820152601e60248201527f63726561746f72206861732063616e63656c6564207468697320706f6f6c000060448201526064016109b5565b6000838152600560205260408120805460ff191660011790556002805485908110610b0157610b01612b3e565b60009182526020918290206040805161012081018252600990930290910180546001600160a01b03908116845260018201548116948401949094526002810154909316908201526003820154606082015260048201546080820152600582015460a0820152600682015460c0820152600782015460e082015260088201805491929161010084019190610b9390612b83565b80601f0160208091040260200160405190810160405280929190818152602001828054610bbf90612b83565b8015610c0c5780601f10610be157610100808354040283529160200191610c0c565b820191906000526020600020905b815481529060010190602001808311610bef57829003601f168201915b505050505081525050905060008160c0015103610c9d57602081015181516060830151604051632142170760e11b81523060048201526001600160a01b03928316602482015260448101919091529116906342842e0e90606401600060405180830381600087803b158015610c8057600080fd5b505af1158015610c94573d6000803e3d6000fd5b50505050610d78565b80602001516001600160a01b031663f242432a3083600001518460600151610ce5600960008b8152602001908152602001600020548760800151611c5990919063ffffffff16565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e087901b1681526001600160a01b0394851660048201529390921660248401526044830152606482015260a06084820152600060a482015260c401600060405180830381600087803b158015610d5f57600080fd5b505af1158015610d73573d6000803e3d6000fd5b505050505b6000848152600960205260409020546080820151859133917fbfa7d46262a9a31ea77e88a2181c8df97ba63688b0743969005d612d614faba091610dbc9190611c59565b60405190815260200160405180910390a350505050565b6001600160a01b03811682186000908152600160205260409020545b92915050565b6000826001600160a01b031660028381548110610e1457610e14612b3e565b60009182526020909120600990910201546001600160a01b031603610e3b57506001610def565b50600092915050565b610e4c611bd1565b610e566000611c6c565b565b60028181548110610e6857600080fd5b60009182526020909120600990910201805460018201546002830154600384015460048501546005860154600687015460078801546008890180546001600160a01b03998a169b509789169998909616979496939592949193909290610ecd90612b83565b80601f0160208091040260200160405190810160405280929190818152602001828054610ef990612b83565b8015610f465780601f10610f1b57610100808354040283529160200191610f46565b820191906000526020600020905b815481529060010190602001808311610f2957829003601f168201915b5050505050905089565b610f58611bd1565b610f6d6001600160a01b038316841882611c32565b505050565b600054610100900460ff1615808015610f925750600054600160ff909116105b80610fac5750303b158015610fac575060005460ff166001145b61101e5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a656400000000000000000000000000000000000060648201526084016109b5565b6000805460ff191660011790558015611041576000805461ff0019166101001790555b6001602052670de0b6b3a76400007f3b199c60c812e21ef78a0cb1d39beb4b11d20b936f9925571c5b896947e8f2d7556e232827232a1d1d2137ba2a37b5b2b760891b6000526001600160a01b0382167f6bf267ff3ff1daa1aea5b0d2dbcb4d52862e1979908f7cb798f00df8e35c78cc558015610950576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15050565b6002548290811061114f5760405162461bcd60e51b815260206004820152601860248201527f7468697320706f6f6c20646f6573206e6f74206578697374000000000000000060448201526064016109b5565b600083815260046020526040902054839060ff161561131d5760006111bb7f46504e46543a3a4d696e56616c75654f66426f74486f6c64657200000000000060005260016020527f3b199c60c812e21ef78a0cb1d39beb4b11d20b936f9925571c5b896947e8f2d75490565b1180156112d157507f46504e46543a3a4d696e56616c75654f66426f74486f6c64657200000000000060005260016020527f3b199c60c812e21ef78a0cb1d39beb4b11d20b936f9925571c5b896947e8f2d7546e232827232a1d1d2137ba2a37b5b2b760891b60005260016020527f6bf267ff3ff1daa1aea5b0d2dbcb4d52862e1979908f7cb798f00df8e35c78cc546040517f70a082310000000000000000000000000000000000000000000000000000000081523360048201526001600160a01b0391909116906370a0823190602401602060405180830381865afa1580156112aa573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112ce9190612bbd565b10155b61131d5760405162461bcd60e51b815260206004820152601160248201527f424f54206973206e6f7420656e6f75676800000000000000000000000000000060448201526064016109b5565b600084815260066020526040902054849060ff161561137e5760405162461bcd60e51b815260206004820152601460248201527f7468697320706f6f6c206973207377617070656400000000000000000000000060448201526064016109b5565b60008581526005602052604090205460ff16156113dd5760405162461bcd60e51b815260206004820152601e60248201527f63726561746f72206861732063616e63656c6564207468697320706f6f6c000060448201526064016109b5565b6000600286815481106113f2576113f2612b3e565b600091825260209091206009909102018054909150336001600160a01b03909116036114865760405162461bcd60e51b815260206004820152602b60248201527f63726561746f722063616e277420737761702074686520706f6f6c206372656160448201527f7465642062792073656c6600000000000000000000000000000000000000000060648201526084016109b5565b6001851015801561149b575080600401548511155b6114e75760405162461bcd60e51b815260206004820152600f60248201527f696e76616c696420616d6f756e7430000000000000000000000000000000000060448201526064016109b5565b60048101546000878152600960205260409020546115059087611cdd565b11156115535760405162461bcd60e51b815260206004820152601e60248201527f706f6f6c2066696c6c6564206f7220696e76616c696420616d6f756e7430000060448201526064016109b5565b42816007015411156115a75760405162461bcd60e51b815260206004820152601060248201527f706f6f6c206973206e6f74206f70656e0000000000000000000000000000000060448201526064016109b5565b60006115ce82600401546115c8846005015489611ce990919063ffffffff16565b90611cf5565b6000888152600960205260409020549091506115ea9087611cdd565b600088815260096020908152604080832093909355600a9052205461160f9082611cdd565b6000888152600a6020908152604080832093909355600485015460099091529190205403611651576000878152600660205260409020805460ff191660011790555b60028201546001600160a01b03166116cc573481146116b25760405162461bcd60e51b815260206004820152601260248201527f696e76616c69642045544820616d6f756e74000000000000000000000000000060448201526064016109b5565b81546116c7906001600160a01b031682611d01565b6116ec565b600282015482546116ec916001600160a01b039081169133911684611de4565b600682015461176c5760018201546003830154604051632142170760e11b815230600482015233602482015260448101919091526001600160a01b03909116906342842e0e90606401600060405180830381600087803b15801561174f57600080fd5b505af1158015611763573d6000803e3d6000fd5b505050506117f4565b60018201546003830154604051637921219560e11b815230600482015233602482015260448101919091526064810188905260a06084820152600060a48201526001600160a01b039091169063f242432a9060c401600060405180830381600087803b1580156117db57600080fd5b505af11580156117ef573d6000803e3d6000fd5b505050505b6040805187815260208101839052889133917f36a39cf3f9b8206db312650e7d954482535a2e33fb0b54e1030f149ed213823a910160405180910390a350505050505050565b611842611bd1565b610f6d83831882611c32565b7f46504e46543a3a44697361626c6545726331313535000000000000000000000060005260016020527fe4bc44dca9a99c56a2ca6a329332a871d3fda368a400dd2da206ea73db807f1d54156118e65760405162461bcd60e51b815260206004820152601860248201527f4552433131353520706f6f6c2069732064697361626c6564000000000000000060448201526064016109b5565b60075460ff1615611959576001600160a01b03871660009081526008602052604090205460ff166119595760405162461bcd60e51b815260206004820152600e60248201527f696e76616c696420746f6b656e3000000000000000000000000000000000000060448201526064016109b5565b61196b88888888888888886001611f5b565b5050505050505050565b61197d611bd1565b60005b8151811015610950576001600860008484815181106119a1576119a1612b3e565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806119dd81612b6a565b915050611980565b6119ed611bd1565b6001600160a01b038116611a695760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f646472657373000000000000000000000000000000000000000000000000000060648201526084016109b5565b611a7281611c6c565b50565b611a7d611bd1565b6007805460ff1916911515919091179055565b611a98611bd1565b600b54611aa59082611c59565b600b556109508282611d01565b7f46504e46543a3a44697361626c6545726337323100000000000000000000000060005260016020527f07440e9b95e28e7c138e0d2e304dcf810f889c470107ff4a426d027d35e868d25415611b4a5760405162461bcd60e51b815260206004820152601760248201527f45524337323120706f6f6c2069732064697361626c656400000000000000000060448201526064016109b5565b60075460ff1615611bbd576001600160a01b03861660009081526008602052604090205460ff16611bbd5760405162461bcd60e51b815260206004820152600e60248201527f696e76616c696420746f6b656e3000000000000000000000000000000000000060448201526064016109b5565b600161196b88888888858989896000611f5b565b6000546001600160a01b0362010000909104163314610e565760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016109b5565b60008281526001602052604090205481146109505760009182526001602052604090912055565b6000611c658284612bd6565b9392505050565b600080546001600160a01b03838116620100008181027fffffffffffffffffffff0000000000000000000000000000000000000000ffff851617855560405193049190911692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a35050565b6000611c658284612bed565b6000611c658284612c05565b6000611c658284612c24565b604080516000808252602082019092526001600160a01b038416908390604051611d2b9190612c46565b60006040518083038185875af1925050503d8060008114611d68576040519150601f19603f3d011682016040523d82523d6000602084013e611d6d565b606091505b5050905080610f6d5760405162461bcd60e51b815260206004820152602360248201527f5472616e7366657248656c7065723a204554485f5452414e534645525f46414960448201527f4c4544000000000000000000000000000000000000000000000000000000000060648201526084016109b5565b604080516001600160a01b0385811660248301528481166044830152606480830185905283518084039091018152608490920183526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f23b872dd000000000000000000000000000000000000000000000000000000001790529151600092839290881691611e769190612c46565b6000604051808303816000865af19150503d8060008114611eb3576040519150601f19603f3d011682016040523d82523d6000602084013e611eb8565b606091505b5091509150818015611ee2575080511580611ee2575080806020019051810190611ee29190612c62565b611f535760405162461bcd60e51b8152602060048201526024808201527f5472616e7366657248656c7065723a205452414e534645525f46524f4d5f464160448201527f494c45440000000000000000000000000000000000000000000000000000000060648201526084016109b5565b505050505050565b83600003611fd15760405162461bcd60e51b815260206004820152602260248201527f7468652076616c7565206f6620616d6f756e74546f74616c31206973207a657260448201527f6f2e00000000000000000000000000000000000000000000000000000000000060648201526084016109b5565b6020895111156120235760405162461bcd60e51b815260206004820152601e60248201527f746865206c656e677468206f66206e616d6520697320746f6f206c6f6e67000060448201526064016109b5565b806120e357846001146120785760405162461bcd60e51b815260206004820152601460248201527f696e76616c696420616d6f756e74546f74616c3000000000000000000000000060448201526064016109b5565b604051632142170760e11b8152336004820152306024820152604481018790526001600160a01b038916906342842e0e90606401600060405180830381600087803b1580156120c657600080fd5b505af11580156120da573d6000803e3d6000fd5b505050506121af565b846000036121335760405162461bcd60e51b815260206004820152601460248201527f696e76616c696420616d6f756e74546f74616c3000000000000000000000000060448201526064016109b5565b604051637921219560e11b8152336004820152306024820152604481018790526064810186905260a06084820152600060a48201526001600160a01b0389169063f242432a9060c401600060405180830381600087803b15801561219657600080fd5b505af11580156121aa573d6000803e3d6000fd5b505050505b61221960405180610120016040528060006001600160a01b0316815260200160006001600160a01b0316815260200160006001600160a01b031681526020016000815260200160008152602001600081526020016000815260200160008152602001606081525090565b3380825261010082018b90526001600160a01b038a8116602080850191909152908a16604080850191909152606084018a90526080840189905260a0840188905260c0840185905260e08401879052600254600093845260038352818420818552909252909120805460ff1916600117905583156122ac576000818152600460205260409020805460ff19168515151790555b6002805460018101825560009190915282517f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ace600990920291820180547fffffffffffffffffffffffff00000000000000000000000000000000000000009081166001600160a01b039384161782556020808701517f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5acf86018054841691861691909117905560408701517f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ad086018054909316941693909317905560608501517f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ad184015560808501517f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ad284015560a08501517f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ad384015560c08501517f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ad484015560e08501517f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ad584015561010085015180518694929361248d937f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ad6019201906124ca565b505060405182915033907f0ce3610e89a4bb9ec9359763f99110ed52a4abaea0b62028a1637e242ca2768b90600090a35050505050505050505050565b8280546124d690612b83565b90600052602060002090601f0160209004810192826124f8576000855561253e565b82601f1061251157805160ff191683800117855561253e565b8280016001018555821561253e579182015b8281111561253e578251825591602001919060010190612523565b5061254a92915061254e565b5090565b5b8082111561254a576000815560010161254f565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff811182821017156125a2576125a2612563565b604052919050565b6001600160a01b0381168114611a7257600080fd5b600060208083850312156125d257600080fd5b823567ffffffffffffffff808211156125ea57600080fd5b818501915085601f8301126125fe57600080fd5b81358181111561261057612610612563565b8060051b9150612621848301612579565b818152918301840191848101908884111561263b57600080fd5b938501935b838510156126655784359250612655836125aa565b8282529385019390850190612640565b98975050505050505050565b60008083601f84011261268357600080fd5b50813567ffffffffffffffff81111561269b57600080fd5b6020830191508360208285010111156126b357600080fd5b9250929050565b6000806000806000608086880312156126d257600080fd5b85356126dd816125aa565b945060208601356126ed816125aa565b935060408601359250606086013567ffffffffffffffff81111561271057600080fd5b61271c88828901612671565b969995985093965092949392505050565b6000806040838503121561274057600080fd5b50508035926020909101359150565b60006020828403121561276157600080fd5b8135611c65816125aa565b6000806040838503121561277f57600080fd5b823561278a816125aa565b946020939093013593505050565b6000602082840312156127aa57600080fd5b5035919050565b600080604083850312156127c457600080fd5b8235915060208301356127d6816125aa565b809150509250929050565b60005b838110156127fc5781810151838201526020016127e4565b8381111561280b576000848401525b50505050565b60006101206001600160a01b03808d168452808c166020850152808b166040850152508860608401528760808401528660a08401528560c08401528460e08401528061010084015283518082850152610140915061287581838601602088016127e1565b601f01601f1916929092019091019a9950505050505050505050565b6000806000606084860312156128a657600080fd5b8335925060208401356128b8816125aa565b929592945050506040919091013590565b6000806000606084860312156128de57600080fd5b505081359360208301359350604090920135919050565b600082601f83011261290657600080fd5b813567ffffffffffffffff81111561292057612920612563565b612933601f8201601f1916602001612579565b81815284602083860101111561294857600080fd5b816020850160208301376000918101602001919091529392505050565b8015158114611a7257600080fd5b600080600080600080600080610100898b03121561299057600080fd5b883567ffffffffffffffff8111156129a757600080fd5b6129b38b828c016128f5565b98505060208901356129c4816125aa565b965060408901356129d4816125aa565b9550606089013594506080890135935060a0890135925060c0890135915060e0890135612a0081612965565b809150509295985092959890939650565b60008060008060008060a08789031215612a2a57600080fd5b8635612a35816125aa565b95506020870135612a45816125aa565b94506040870135935060608701359250608087013567ffffffffffffffff811115612a6f57600080fd5b612a7b89828a01612671565b979a9699509497509295939492505050565b600060208284031215612a9f57600080fd5b8135611c6581612965565b600080600080600080600060e0888a031215612ac557600080fd5b873567ffffffffffffffff811115612adc57600080fd5b612ae88a828b016128f5565b9750506020880135612af9816125aa565b95506040880135612b09816125aa565b9450606088013593506080880135925060a0880135915060c0880135612b2e81612965565b8091505092959891949750929550565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600060018201612b7c57612b7c612b54565b5060010190565b600181811c90821680612b9757607f821691505b602082108103612bb757634e487b7160e01b600052602260045260246000fd5b50919050565b600060208284031215612bcf57600080fd5b5051919050565b600082821015612be857612be8612b54565b500390565b60008219821115612c0057612c00612b54565b500190565b6000816000190483118215151615612c1f57612c1f612b54565b500290565b600082612c4157634e487b7160e01b600052601260045260246000fd5b500490565b60008251612c588184602087016127e1565b9190910192915050565b600060208284031215612c7457600080fd5b8151611c658161296556fea2646970667358221220eb941ef19afbc3101173428393a97ebb95b248a0297aca1057def98aca01260864736f6c634300080d0033

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
Loading...
Loading
[ Download: CSV Export  ]

A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.