ETH Price: $1,766.95 (-0.35%)
Gas: 16 Gwei

Contract

0xaa359a4e357F61c2b87041264bd027fCCC23529F
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Token Holdings

Multi Chain

Multichain Addresses

2 addresses found via Blockscan
Transaction Hash
Method
Block
From
To
Value
Swap ET Hfor Tok...159904912022-11-17 14:59:23129 days 19 hrs ago1668697163IN
0xaa359a...CC23529F
0.0001 ETH0.0025718916.91746492
Swap ET Hfor Tok...159904142022-11-17 14:43:59129 days 19 hrs ago1668696239IN
0xaa359a...CC23529F
0.001 ETH0.0025622417.79745322
Swap Token For E...159902432022-11-17 14:09:23129 days 20 hrs ago1668694163IN
0xaa359a...CC23529F
0 ETH0.0013443316.51372649
Swap Token For T...159902332022-11-17 14:07:23129 days 20 hrs ago1668694043IN
0xaa359a...CC23529F
0 ETH0.0014759618.01495823
Swap ET Hfor Tok...159902142022-11-17 14:03:35129 days 20 hrs ago1668693815IN
0xaa359a...CC23529F
0.19 ETH0.0052501318.68263083
Swap ET Hfor Tok...159901962022-11-17 13:59:59129 days 20 hrs ago1668693599IN
0xaa359a...CC23529F
0.01 ETH0.0040111514.2736977
Swap Token For T...159901202022-11-17 13:44:35129 days 20 hrs ago1668692675IN
0xaa359a...CC23529F
0 ETH0.0084824914.9074113
Swap ET Hfor Tok...159901142022-11-17 13:43:23129 days 20 hrs ago1668692603IN
0xaa359a...CC23529F
0.19 ETH0.0042633514.30094053
Swap ET Hfor Tok...159900212022-11-17 13:24:35129 days 21 hrs ago1668691475IN
0xaa359a...CC23529F
0.05 ETH0.0044466414.62944404
Swap ET Hfor Tok...159900182022-11-17 13:23:59129 days 21 hrs ago1668691439IN
0xaa359a...CC23529F
0.05 ETH0.0044228514.55116067
Swap ET Hfor Tok...159900162022-11-17 13:23:35129 days 21 hrs ago1668691415IN
0xaa359a...CC23529F
0.05 ETH0.0045806115.07020203
Swap Token For T...159900062022-11-17 13:21:35129 days 21 hrs ago1668691295IN
0xaa359a...CC23529F
0 ETH0.0012486215.22454098
Swap Token For T...159900042022-11-17 13:21:11129 days 21 hrs ago1668691271IN
0xaa359a...CC23529F
0 ETH0.0012100714.75452438
Swap Token For T...159900022022-11-17 13:20:47129 days 21 hrs ago1668691247IN
0xaa359a...CC23529F
0 ETH0.0011739614.3141892
Swap Token For E...159896742022-11-17 12:14:35129 days 22 hrs ago1668687275IN
0xaa359a...CC23529F
0 ETH0.0041244113.32152297
Swap Token For E...159896682022-11-17 12:13:23129 days 22 hrs ago1668687203IN
0xaa359a...CC23529F
0 ETH0.0037164212.14602638
Swap ET Hfor Tok...159896642022-11-17 12:12:35129 days 22 hrs ago1668687155IN
0xaa359a...CC23529F
0.01 ETH0.0017497813.36345409
Swap ET Hfor Tok...159896632022-11-17 12:12:23129 days 22 hrs ago1668687143IN
0xaa359a...CC23529F
0.01 ETH0.0018121612.24120967
Swap ET Hfor Tok...159896292022-11-17 12:05:23129 days 22 hrs ago1668686723IN
0xaa359a...CC23529F
0.01 ETH0.0017280712.61846751
Swap ET Hfor Tok...159896292022-11-17 12:05:23129 days 22 hrs ago1668686723IN
0xaa359a...CC23529F
0.01 ETH0.0017280712.61846751
Swap Token For E...159896212022-11-17 12:03:47129 days 22 hrs ago1668686627IN
0xaa359a...CC23529F
0 ETH0.0010398512.6943092
Swap Token For E...159896212022-11-17 12:03:47129 days 22 hrs ago1668686627IN
0xaa359a...CC23529F
0 ETH0.0010398512.6943092
Swap Token For E...159896182022-11-17 12:03:11129 days 22 hrs ago1668686591IN
0xaa359a...CC23529F
0 ETH0.0029114412.18197238
Swap Token For E...159896152022-11-17 12:02:35129 days 22 hrs ago1668686555IN
0xaa359a...CC23529F
0 ETH0.0024514112.94286452
Swap Token For E...159896102022-11-17 12:01:35129 days 22 hrs ago1668686495IN
0xaa359a...CC23529F
0 ETH0.0010001312.19687611
View all transactions

Latest 25 internal transactions (View All)

Advanced mode:
Parent Txn Hash Block From To Value
159904912022-11-17 14:59:23129 days 19 hrs ago1668697163
0xaa359a...CC23529F
0.0000005 ETH
159904912022-11-17 14:59:23129 days 19 hrs ago1668697163
0xaa359a...CC23529F
0.0000995 ETH
159904142022-11-17 14:43:59129 days 19 hrs ago1668696239
0xaa359a...CC23529F
0.000005 ETH
159904142022-11-17 14:43:59129 days 19 hrs ago1668696239
0xaa359a...CC23529F
0.000995 ETH
159902142022-11-17 14:03:35129 days 20 hrs ago1668693815
0xaa359a...CC23529F
0.00095 ETH
159902142022-11-17 14:03:35129 days 20 hrs ago1668693815
0xaa359a...CC23529F
0.18905 ETH
159901962022-11-17 13:59:59129 days 20 hrs ago1668693599
0xaa359a...CC23529F
0.00005 ETH
159901962022-11-17 13:59:59129 days 20 hrs ago1668693599
0xaa359a...CC23529F
0.00995 ETH
159901142022-11-17 13:43:23129 days 20 hrs ago1668692603
0xaa359a...CC23529F
0.00095 ETH
159901142022-11-17 13:43:23129 days 20 hrs ago1668692603
0xaa359a...CC23529F
0.18905 ETH
159900212022-11-17 13:24:35129 days 21 hrs ago1668691475
0xaa359a...CC23529F
0.04975 ETH
159900182022-11-17 13:23:59129 days 21 hrs ago1668691439
0xaa359a...CC23529F
0.04975 ETH
159900162022-11-17 13:23:35129 days 21 hrs ago1668691415
0xaa359a...CC23529F
0.04975 ETH
159896642022-11-17 12:12:35129 days 22 hrs ago1668687155
0xaa359a...CC23529F
0.00005 ETH
159896642022-11-17 12:12:35129 days 22 hrs ago1668687155
0xaa359a...CC23529F
0.00995 ETH
159896632022-11-17 12:12:23129 days 22 hrs ago1668687143
0xaa359a...CC23529F
0.00005 ETH
159896632022-11-17 12:12:23129 days 22 hrs ago1668687143
0xaa359a...CC23529F
0.00995 ETH
159896292022-11-17 12:05:23129 days 22 hrs ago1668686723
0xaa359a...CC23529F
0.00005 ETH
159896292022-11-17 12:05:23129 days 22 hrs ago1668686723
0xaa359a...CC23529F
0.00995 ETH
159896292022-11-17 12:05:23129 days 22 hrs ago1668686723
0xaa359a...CC23529F
0.00005 ETH
159896292022-11-17 12:05:23129 days 22 hrs ago1668686723
0xaa359a...CC23529F
0.00995 ETH
159894902022-11-17 11:37:35129 days 23 hrs ago1668685055
0xaa359a...CC23529F
0.00005 ETH
159894902022-11-17 11:37:35129 days 23 hrs ago1668685055
0xaa359a...CC23529F
0.00995 ETH
159894872022-11-17 11:36:59129 days 23 hrs ago1668685019
0xaa359a...CC23529F
0.00995 ETH
159894802022-11-17 11:35:35129 days 23 hrs ago1668684935
0xaa359a...CC23529F
0.00995 ETH
View All Internal Transactions
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
SwapTokenETH

Compiler Version
v0.8.9+commit.e5eed63a

Optimization Enabled:
Yes with 1000 runs

Other Settings:
default evmVersion

Contract Source Code (Solidity Standard Json-Input format)

File 1 of 18 : SwapTokenETH.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.9;

import "../SwapTokenBase.sol";

contract SwapTokenETH is SwapTokenBase {
    constructor(uint256 _fee, address _addr) SwapTokenBase(_fee, _addr) {}

    function UNISWAP_V2_ROUTER() internal pure override returns (IUniswapV2Router02) {
        return IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
    }

    function UNISWAP_FACTORY() internal pure override returns (IUniswapV2Factory) {
        return IUniswapV2Factory(0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f);
    }
}

File 2 of 18 : SwapTokenBase.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.9;

import "@openzeppelin/contracts/access/AccessControl.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol";
import "@uniswap/v2-periphery/contracts/interfaces/IUniswapV2Router02.sol";
import "@uniswap/v2-core/contracts/interfaces/IUniswapV2Factory.sol";
import "./interfaces/IWETH.sol";
import "./interfaces/IBeneficiaryBase.sol";

abstract contract SwapTokenBase is AccessControl {
    using SafeERC20 for IERC20;
    bytes32 public constant DEVELOPER = keccak256("DEVELOPER");
    bytes32 public constant ADMIN = keccak256("ADMIN");
    address internal constant deadAddress = 0x000000000000000000000000000000000000dEaD;
    address internal immutable WETH;
    address public immutable wallet;
    uint256 public immutable fee;

    struct limitOrder {
        address _from;
        address _tokenIn;
        uint256 _amountIn;
        address _tokenOut;
        uint256 _amountOut;
        uint256 _expires;
    }

    limitOrder[] public limitOrders;
    event limitOrderCreated(
        address _from,
        address _tokenIn,
        uint256 _amountIn,
        address _tokenOut,
        uint256 _amountOut,
        uint256 _arrayIndex,
        uint256 _expires
    );

    event limitOrderExecuted(uint256 _orderIndex);
    event limitOrderExpired(uint256 _orderIndex);

    modifier validate(address[] memory path) {
        require(path.length >= 2, "INVALID_PATH");
        _;
    }

    constructor(uint256 _fee, address _addr) {
        WETH = UNISWAP_V2_ROUTER().WETH();
        fee = _fee;
        wallet = _addr;
        _grantRole(DEFAULT_ADMIN_ROLE, msg.sender);
        _grantRole(ADMIN, msg.sender);
        _grantRole(DEVELOPER, msg.sender);
    }

    function VOLT() public pure virtual returns (address) {
        return 0x7db5af2B9624e1b3B4Bb69D6DeBd9aD1016A58Ac;
    }

    function UNISWAP_V2_ROUTER() internal pure virtual returns (IUniswapV2Router02);

    function UNISWAP_FACTORY() internal pure virtual returns (IUniswapV2Factory);

    function burn(uint256 _feeAmount, address[] memory _path) internal {
        address tokenIn = _path[0];
        address tokenOut = _path[_path.length - 1];
        if (tokenIn == WETH) {
            _safeTransfer(wallet, _feeAmount);
        } else if (tokenOut == WETH) {
            if (tokenIn == VOLT()) {
                IERC20(tokenIn).safeTransfer(deadAddress, _feeAmount);
            } else {
                uint256 _firstFeeAmount = _feeAmount / 2;
                UNISWAP_V2_ROUTER().swapExactTokensForETHSupportingFeeOnTransferTokens(
                    _firstFeeAmount,
                    0,
                    _path,
                    wallet,
                    block.timestamp
                );

                uint256 _secondFeeAmount = _feeAmount - _firstFeeAmount;
                if (!IBeneficiaryBase(wallet).tokenWhitelist(tokenIn)) {
                    IERC20(tokenIn).safeTransfer(deadAddress, _secondFeeAmount);
                } else {
                    UNISWAP_V2_ROUTER().swapExactTokensForETHSupportingFeeOnTransferTokens(
                        _secondFeeAmount,
                        0,
                        _path,
                        wallet,
                        block.timestamp
                    );
                }
            }
        } else {
            if (tokenIn == VOLT()) {
                IERC20(tokenIn).safeTransfer(deadAddress, _feeAmount);
            } else {
                uint256 _firstFeeAmount = _feeAmount / 2;
                uint256 _secondFeeAmount = _feeAmount - _firstFeeAmount;

                address[] memory wethPath = _getWETHPath(_path);

                if (wethPath.length > 0) {
                    UNISWAP_V2_ROUTER().swapExactTokensForETHSupportingFeeOnTransferTokens(
                        _firstFeeAmount,
                        0,
                        wethPath,
                        wallet,
                        block.timestamp
                    );
                } else {
                    IERC20(tokenIn).safeTransfer(wallet, _firstFeeAmount);
                }
                bool whitelistIn = IBeneficiaryBase(wallet).tokenWhitelist(tokenIn);
                bool whitelistOut = IBeneficiaryBase(wallet).tokenWhitelist(tokenOut);
                if (!whitelistIn && whitelistOut) {
                    IERC20(tokenIn).safeTransfer(deadAddress, _secondFeeAmount);
                } else if (!whitelistOut) {
                    UNISWAP_V2_ROUTER().swapExactTokensForTokensSupportingFeeOnTransferTokens(
                        _secondFeeAmount,
                        0,
                        _path,
                        deadAddress,
                        block.timestamp
                    );
                }
            }
        }
    }

    function swapTokenForToken(
        uint256 _amountIn,
        uint256 _amountOutMin,
        bool _isLimitOrder,
        address _dest,
        address[] memory _path
    ) public validate(_path) {
        address tokenIn = _path[0];
        uint256 _realAmountIn;
        if (_isLimitOrder) {
            _realAmountIn = _amountIn;
        } else {
            uint256 prev_balance_tokenIn = IERC20(tokenIn).balanceOf(address(this));
            IERC20(tokenIn).safeTransferFrom(_dest, address(this), _amountIn);
            uint256 curr_balance_tokenIn = IERC20(tokenIn).balanceOf(address(this));
            _realAmountIn = curr_balance_tokenIn - prev_balance_tokenIn; // handle fee on transfer tokens
        }
        IERC20(tokenIn).safeIncreaseAllowance(address(UNISWAP_V2_ROUTER()), _realAmountIn);

        uint256 feeAmount = (_realAmountIn * fee) / 10000;
        uint256 amountInSub = _realAmountIn - feeAmount;
        UNISWAP_V2_ROUTER().swapExactTokensForTokensSupportingFeeOnTransferTokens(
            amountInSub,
            _amountOutMin,
            _path,
            _dest,
            block.timestamp
        );
        burn(feeAmount, _path);
    }

    function swapTokenForExactToken(
        uint256 _amountOut,
        uint256 _amountInMax,
        address[] memory _path
    ) public validate(_path) {
        address tokenIn = _path[0];

        IERC20(tokenIn).safeTransferFrom(msg.sender, address(this), _amountInMax);
        uint256 adjustedAmountIn = IERC20(tokenIn).balanceOf(address(this)); // handle fee on transfer tokens
        IERC20(tokenIn).safeIncreaseAllowance(address(UNISWAP_V2_ROUTER()), adjustedAmountIn);
        uint256 adjustedFee = (adjustedAmountIn * fee) / 10000;
        uint256[] memory amounts = UNISWAP_V2_ROUTER().swapTokensForExactTokens(
            _amountOut,
            adjustedAmountIn - adjustedFee,
            _path,
            msg.sender,
            block.timestamp
        );

        uint256 realAmountIn = amounts[0];
        uint256 feeAmount = (realAmountIn * fee) / 10000;
        uint256 refundAmount = adjustedAmountIn - realAmountIn - feeAmount;
        if (refundAmount > 0) {
            IERC20(tokenIn).safeTransfer(msg.sender, refundAmount);
        }
        burn(feeAmount, _path);
    }

    function swapTokenForETH(
        uint256 _amountIn,
        uint256 _amountOutMin,
        bool _isLimitOrder,
        address _dest,
        address[] memory _path
    ) public validate(_path) {
        address tokenIn = _path[0];
        uint256 adjustedAmountIn;
        if (_isLimitOrder) {
            adjustedAmountIn = _amountIn;
        } else {
            uint256 prev_balance_tokenIn = IERC20(tokenIn).balanceOf(address(this));
            IERC20(tokenIn).safeTransferFrom(_dest, address(this), _amountIn);
            uint256 curr_balance_tokenIn = IERC20(tokenIn).balanceOf(address(this));
            adjustedAmountIn = curr_balance_tokenIn - prev_balance_tokenIn; // handle fee on transfer tokens
        }

        if (tokenIn == WETH) {
            IWETH(WETH).withdraw(adjustedAmountIn);
            _safeTransfer(_dest, adjustedAmountIn);
        } else {
            IERC20(tokenIn).safeIncreaseAllowance(address(UNISWAP_V2_ROUTER()), adjustedAmountIn);
            uint256 feeAmount = (adjustedAmountIn * fee) / 10000;
            uint256 amountInSub = adjustedAmountIn - feeAmount;
            UNISWAP_V2_ROUTER().swapExactTokensForETHSupportingFeeOnTransferTokens(
                amountInSub,
                _amountOutMin,
                _path,
                _dest,
                block.timestamp
            );
            burn(feeAmount, _path);
        }
    }

    function swapTokenForExactETH(
        uint256 _amountOut,
        uint256 _amountInMax,
        address[] memory _path
    ) public validate(_path) {
        address tokenIn = _path[0];
        IERC20(tokenIn).safeTransferFrom(msg.sender, address(this), _amountInMax);
        uint256 adjustedAmountIn = IERC20(tokenIn).balanceOf(address(this)); // handle fee on transfer tokens
        IERC20(tokenIn).safeIncreaseAllowance(address(UNISWAP_V2_ROUTER()), adjustedAmountIn);

        if (tokenIn == WETH) {
            IWETH(WETH).withdraw(adjustedAmountIn);
            _safeTransfer(msg.sender, adjustedAmountIn);
        } else {
            IERC20(tokenIn).safeIncreaseAllowance(address(UNISWAP_V2_ROUTER()), adjustedAmountIn);
            uint256 adjustedFee = (adjustedAmountIn * fee) / 10000;
            uint256[] memory amounts = UNISWAP_V2_ROUTER().swapTokensForExactETH(
                _amountOut,
                adjustedAmountIn - adjustedFee,
                _path,
                msg.sender,
                block.timestamp
            );
            uint256 realAmountIn = amounts[0];
            uint256 feeAmount = (realAmountIn * fee) / 10000;
            uint256 refundAmount = adjustedAmountIn - realAmountIn - feeAmount;
            if (refundAmount > 0) {
                IERC20(tokenIn).safeTransfer(msg.sender, refundAmount);
            }
            burn(feeAmount, _path);
        }
    }

    function swapETHforToken(
        uint256 _amountOutMin,
        address _dest,
        address[] memory _path
    ) public payable validate(_path) {
        address tokenOut = _path[_path.length - 1];
        uint256 amountIn = msg.value;

        if (tokenOut == WETH) {
            IWETH(WETH).deposit{value: amountIn}();
            IERC20(WETH).transfer(_dest, amountIn);
        } else {
            uint256 feeAmount = (amountIn * fee) / 10000;
            uint256 amountInSub = amountIn - feeAmount;
            UNISWAP_V2_ROUTER().swapExactETHForTokensSupportingFeeOnTransferTokens{value: amountInSub}(
                _amountOutMin,
                _path,
                _dest,
                block.timestamp
            );
            burn(feeAmount, _path);
        }
    }

    function swapETHforExactToken(uint256 _amountOut, address[] memory _path) public payable validate(_path) {
        address tokenOut = _path[_path.length - 1];
        uint256 amountIn = msg.value;

        if (tokenOut == WETH) {
            IWETH(WETH).deposit{value: amountIn}();
            IERC20(WETH).transfer(msg.sender, amountIn);
        } else {
            uint256 feeAmount = (amountIn * fee) / 10000;
            uint256 amountInSub = amountIn - feeAmount;
            uint256[] memory amounts = UNISWAP_V2_ROUTER().swapETHForExactTokens{value: amountInSub}(
                _amountOut,
                _path,
                msg.sender,
                block.timestamp
            );
            uint256 refund = amountInSub - amounts[0];
            if (refund > 0) {
                _safeTransfer(msg.sender, refund);
            }
            burn(feeAmount, _path);
        }
    }

    function getPair(address _tokenIn, address _tokenOut) external view returns (address) {
        return UNISWAP_FACTORY().getPair(_tokenIn, _tokenOut);
    }

    function getAmountIn(uint256 _amountOut, address[] memory _path) public view returns (uint256) {
        uint256[] memory amountsIn = UNISWAP_V2_ROUTER().getAmountsIn(_amountOut, _path);
        return amountsIn[0];
    }

    function getAmountOutMinWithFees(uint256 _amountIn, address[] memory _path) public view returns (uint256) {
        uint256 feeAmount = (_amountIn * fee) / 10000;
        uint256 amountInSub = _amountIn - feeAmount;

        uint256[] memory amountOutMins = UNISWAP_V2_ROUTER().getAmountsOut(amountInSub, _path);
        return amountOutMins[amountOutMins.length - 1];
    }

    function _getWETHPath(address[] memory _path) internal view returns (address[] memory wethPath) {
        uint256 index = 0;
        for (uint256 i = 0; i < _path.length; i++) {
            if (_path[i] == WETH) {
                index = i + 1;
                break;
            }
        }
        wethPath = new address[](index);
        for (uint256 i = 0; i < index; i++) {
            wethPath[i] = _path[i];
        }
    }

    function _safeTransfer(address _to, uint256 _amount) internal {
        (bool sent, ) = _to.call{value: _amount}("");
        require(sent, "Failed to send Ether");
    }

    /*
     *   start limit order functions
     */

    // requires that msg.sender approves this contract to move his tokens
    // amountIn and amountOut may be reduced if token has fees on transfer
    function sendLimitOrder(
        address tokenIn,
        uint256 amountIn,
        address tokenOut,
        uint256 amountOut,
        uint256 expires
    ) external payable {
        require(expires > block.timestamp, "expires");
        limitOrder memory order;
        if (msg.value > 0) {
            order = limitOrder(msg.sender, address(0), msg.value, tokenOut, amountOut, expires);
            limitOrders.push(order);
            emit limitOrderCreated(
                msg.sender,
                address(0),
                msg.value,
                tokenOut,
                amountOut,
                limitOrders.length > 0 ? limitOrders.length - 1 : 0,
                expires
            );
        } else {
            uint256 prev_balance = IERC20(tokenIn).balanceOf(address(this));

            IERC20(tokenIn).safeTransferFrom(msg.sender, address(this), amountIn);
            uint256 curr_balance = IERC20(tokenIn).balanceOf(address(this));
            order = limitOrder(
                msg.sender,
                tokenIn,
                curr_balance - prev_balance, // I do this to take into consideration fees on transfers
                // which can make the amountIn less than the real amount exchanged
                tokenOut,
                amountOut,
                expires
            );
            limitOrders.push(order);
            emit limitOrderCreated(
                msg.sender,
                tokenIn,
                curr_balance - prev_balance,
                tokenOut,
                amountOut,
                limitOrders.length > 0 ? limitOrders.length - 1 : 0,
                expires
            );
        }
    }

    function isExecutableLimitOrder(uint256 orderIndex, address[] memory _path) public view returns (bool) {
        limitOrder memory order = limitOrders[orderIndex];
        uint256 amountOutMin = getAmountOutMinWithFees(
            order._amountIn,
            // order._tokenIn == address(0) ? UNISWAP_V2_ROUTER().WETH() : order._tokenIn,
            // order._tokenOut == address(0) ? UNISWAP_V2_ROUTER().WETH() : order._tokenOut
            _path
        );
        return amountOutMin >= order._amountOut;
    }

    function executeLimitOrder(uint256 _orderIndex, address[] memory _path) public {
        limitOrder memory order = limitOrders[_orderIndex];
        uint256 amountOutMin = getAmountOutMinWithFees(
            order._amountIn,
            // order._tokenIn == address(0) ? UNISWAP_V2_ROUTER().WETH() : order._tokenIn,
            // order._tokenOut == address(0) ? UNISWAP_V2_ROUTER().WETH() : order._tokenOut
            _path
        );
        if (amountOutMin >= order._amountOut && order._expires >= block.timestamp) {
            if (order._tokenIn == address(0)) {
                this.swapETHforToken{value: order._amountIn}(order._amountOut, order._from, _path);
            } else if (order._tokenOut == address(0)) {
                this.swapTokenForETH(order._amountIn, order._amountOut, true, order._from, _path);
            } else {
                this.swapTokenForToken(order._amountIn, order._amountOut, true, order._from, _path);
            }

            limitOrders[_orderIndex] = limitOrders[limitOrders.length - 1];
            limitOrders.pop();

            emit limitOrderExecuted(_orderIndex);
        } else if (order._expires < block.timestamp) {
            limitOrders[_orderIndex] = limitOrders[limitOrders.length - 1];
            limitOrders.pop();
            emit limitOrderExpired(_orderIndex);
        }
    }

    function getLimitOrdersCount() public view returns (uint256) {
        return limitOrders.length;
    }

    /*
     *   end limit order functions
     */

    function getTokenDecimals(address _addr) public view returns (uint8) {
        return IERC20Metadata(_addr).decimals();
    }

    receive() external payable {}
}

File 3 of 18 : AccessControl.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (access/AccessControl.sol)

pragma solidity ^0.8.0;

import "./IAccessControl.sol";
import "../utils/Context.sol";
import "../utils/Strings.sol";
import "../utils/introspection/ERC165.sol";

/**
 * @dev Contract module that allows children to implement role-based access
 * control mechanisms. This is a lightweight version that doesn't allow enumerating role
 * members except through off-chain means by accessing the contract event logs. Some
 * applications may benefit from on-chain enumerability, for those cases see
 * {AccessControlEnumerable}.
 *
 * Roles are referred to by their `bytes32` identifier. These should be exposed
 * in the external API and be unique. The best way to achieve this is by
 * using `public constant` hash digests:
 *
 * ```
 * bytes32 public constant MY_ROLE = keccak256("MY_ROLE");
 * ```
 *
 * Roles can be used to represent a set of permissions. To restrict access to a
 * function call, use {hasRole}:
 *
 * ```
 * function foo() public {
 *     require(hasRole(MY_ROLE, msg.sender));
 *     ...
 * }
 * ```
 *
 * Roles can be granted and revoked dynamically via the {grantRole} and
 * {revokeRole} functions. Each role has an associated admin role, and only
 * accounts that have a role's admin role can call {grantRole} and {revokeRole}.
 *
 * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means
 * that only accounts with this role will be able to grant or revoke other
 * roles. More complex role relationships can be created by using
 * {_setRoleAdmin}.
 *
 * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to
 * grant and revoke this role. Extra precautions should be taken to secure
 * accounts that have been granted it.
 */
abstract contract AccessControl is Context, IAccessControl, ERC165 {
    struct RoleData {
        mapping(address => bool) members;
        bytes32 adminRole;
    }

    mapping(bytes32 => RoleData) private _roles;

    bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;

    /**
     * @dev Modifier that checks that an account has a specific role. Reverts
     * with a standardized message including the required role.
     *
     * The format of the revert reason is given by the following regular expression:
     *
     *  /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/
     *
     * _Available since v4.1._
     */
    modifier onlyRole(bytes32 role) {
        _checkRole(role);
        _;
    }

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

    /**
     * @dev Returns `true` if `account` has been granted `role`.
     */
    function hasRole(bytes32 role, address account) public view virtual override returns (bool) {
        return _roles[role].members[account];
    }

    /**
     * @dev Revert with a standard message if `_msgSender()` is missing `role`.
     * Overriding this function changes the behavior of the {onlyRole} modifier.
     *
     * Format of the revert message is described in {_checkRole}.
     *
     * _Available since v4.6._
     */
    function _checkRole(bytes32 role) internal view virtual {
        _checkRole(role, _msgSender());
    }

    /**
     * @dev Revert with a standard message if `account` is missing `role`.
     *
     * The format of the revert reason is given by the following regular expression:
     *
     *  /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/
     */
    function _checkRole(bytes32 role, address account) internal view virtual {
        if (!hasRole(role, account)) {
            revert(
                string(
                    abi.encodePacked(
                        "AccessControl: account ",
                        Strings.toHexString(uint160(account), 20),
                        " is missing role ",
                        Strings.toHexString(uint256(role), 32)
                    )
                )
            );
        }
    }

    /**
     * @dev Returns the admin role that controls `role`. See {grantRole} and
     * {revokeRole}.
     *
     * To change a role's admin, use {_setRoleAdmin}.
     */
    function getRoleAdmin(bytes32 role) public view virtual override returns (bytes32) {
        return _roles[role].adminRole;
    }

    /**
     * @dev Grants `role` to `account`.
     *
     * If `account` had not been already granted `role`, emits a {RoleGranted}
     * event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     *
     * May emit a {RoleGranted} event.
     */
    function grantRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {
        _grantRole(role, account);
    }

    /**
     * @dev Revokes `role` from `account`.
     *
     * If `account` had been granted `role`, emits a {RoleRevoked} event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     *
     * May emit a {RoleRevoked} event.
     */
    function revokeRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {
        _revokeRole(role, account);
    }

    /**
     * @dev Revokes `role` from the calling account.
     *
     * Roles are often managed via {grantRole} and {revokeRole}: this function's
     * purpose is to provide a mechanism for accounts to lose their privileges
     * if they are compromised (such as when a trusted device is misplaced).
     *
     * If the calling account had been revoked `role`, emits a {RoleRevoked}
     * event.
     *
     * Requirements:
     *
     * - the caller must be `account`.
     *
     * May emit a {RoleRevoked} event.
     */
    function renounceRole(bytes32 role, address account) public virtual override {
        require(account == _msgSender(), "AccessControl: can only renounce roles for self");

        _revokeRole(role, account);
    }

    /**
     * @dev Grants `role` to `account`.
     *
     * If `account` had not been already granted `role`, emits a {RoleGranted}
     * event. Note that unlike {grantRole}, this function doesn't perform any
     * checks on the calling account.
     *
     * May emit a {RoleGranted} event.
     *
     * [WARNING]
     * ====
     * This function should only be called from the constructor when setting
     * up the initial roles for the system.
     *
     * Using this function in any other way is effectively circumventing the admin
     * system imposed by {AccessControl}.
     * ====
     *
     * NOTE: This function is deprecated in favor of {_grantRole}.
     */
    function _setupRole(bytes32 role, address account) internal virtual {
        _grantRole(role, account);
    }

    /**
     * @dev Sets `adminRole` as ``role``'s admin role.
     *
     * Emits a {RoleAdminChanged} event.
     */
    function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual {
        bytes32 previousAdminRole = getRoleAdmin(role);
        _roles[role].adminRole = adminRole;
        emit RoleAdminChanged(role, previousAdminRole, adminRole);
    }

    /**
     * @dev Grants `role` to `account`.
     *
     * Internal function without access restriction.
     *
     * May emit a {RoleGranted} event.
     */
    function _grantRole(bytes32 role, address account) internal virtual {
        if (!hasRole(role, account)) {
            _roles[role].members[account] = true;
            emit RoleGranted(role, account, _msgSender());
        }
    }

    /**
     * @dev Revokes `role` from `account`.
     *
     * Internal function without access restriction.
     *
     * May emit a {RoleRevoked} event.
     */
    function _revokeRole(bytes32 role, address account) internal virtual {
        if (hasRole(role, account)) {
            _roles[role].members[account] = false;
            emit RoleRevoked(role, account, _msgSender());
        }
    }
}

File 4 of 18 : SafeERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (token/ERC20/utils/SafeERC20.sol)

pragma solidity ^0.8.0;

import "../IERC20.sol";
import "../extensions/draft-IERC20Permit.sol";
import "../../../utils/Address.sol";

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

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

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

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

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

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

    function safePermit(
        IERC20Permit token,
        address owner,
        address spender,
        uint256 value,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) internal {
        uint256 nonceBefore = token.nonces(owner);
        token.permit(owner, spender, value, deadline, v, r, s);
        uint256 nonceAfter = token.nonces(owner);
        require(nonceAfter == nonceBefore + 1, "SafeERC20: permit did not succeed");
    }

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

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

File 5 of 18 : 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 6 of 18 : IERC20Metadata.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)

pragma solidity ^0.8.0;

import "../IERC20.sol";

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

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

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

File 7 of 18 : IUniswapV2Router02.sol
pragma solidity >=0.6.2;

import './IUniswapV2Router01.sol';

interface IUniswapV2Router02 is IUniswapV2Router01 {
    function removeLiquidityETHSupportingFeeOnTransferTokens(
        address token,
        uint liquidity,
        uint amountTokenMin,
        uint amountETHMin,
        address to,
        uint deadline
    ) external returns (uint amountETH);
    function removeLiquidityETHWithPermitSupportingFeeOnTransferTokens(
        address token,
        uint liquidity,
        uint amountTokenMin,
        uint amountETHMin,
        address to,
        uint deadline,
        bool approveMax, uint8 v, bytes32 r, bytes32 s
    ) external returns (uint amountETH);

    function swapExactTokensForTokensSupportingFeeOnTransferTokens(
        uint amountIn,
        uint amountOutMin,
        address[] calldata path,
        address to,
        uint deadline
    ) external;
    function swapExactETHForTokensSupportingFeeOnTransferTokens(
        uint amountOutMin,
        address[] calldata path,
        address to,
        uint deadline
    ) external payable;
    function swapExactTokensForETHSupportingFeeOnTransferTokens(
        uint amountIn,
        uint amountOutMin,
        address[] calldata path,
        address to,
        uint deadline
    ) external;
}

File 8 of 18 : IUniswapV2Factory.sol
pragma solidity >=0.5.0;

interface IUniswapV2Factory {
    event PairCreated(address indexed token0, address indexed token1, address pair, uint);

    function feeTo() external view returns (address);
    function feeToSetter() external view returns (address);

    function getPair(address tokenA, address tokenB) external view returns (address pair);
    function allPairs(uint) external view returns (address pair);
    function allPairsLength() external view returns (uint);

    function createPair(address tokenA, address tokenB) external returns (address pair);

    function setFeeTo(address) external;
    function setFeeToSetter(address) external;
}

File 9 of 18 : IWETH.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.9;

interface IWETH {
    function deposit() external payable;

    function withdraw(uint256) external;
}

File 10 of 18 : IBeneficiaryBase.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.9;

interface IBeneficiaryBase {
    function burn(uint256 _amountOutMin) external;

    function rescue(address _token) external;

    function tokenWhitelist(address _addr) external view returns (bool);
}

File 11 of 18 : IAccessControl.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (access/IAccessControl.sol)

pragma solidity ^0.8.0;

/**
 * @dev External interface of AccessControl declared to support ERC165 detection.
 */
interface IAccessControl {
    /**
     * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`
     *
     * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite
     * {RoleAdminChanged} not being emitted signaling this.
     *
     * _Available since v3.1._
     */
    event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);

    /**
     * @dev Emitted when `account` is granted `role`.
     *
     * `sender` is the account that originated the contract call, an admin role
     * bearer except when using {AccessControl-_setupRole}.
     */
    event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);

    /**
     * @dev Emitted when `account` is revoked `role`.
     *
     * `sender` is the account that originated the contract call:
     *   - if using `revokeRole`, it is the admin role bearer
     *   - if using `renounceRole`, it is the role bearer (i.e. `account`)
     */
    event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);

    /**
     * @dev Returns `true` if `account` has been granted `role`.
     */
    function hasRole(bytes32 role, address account) external view returns (bool);

    /**
     * @dev Returns the admin role that controls `role`. See {grantRole} and
     * {revokeRole}.
     *
     * To change a role's admin, use {AccessControl-_setRoleAdmin}.
     */
    function getRoleAdmin(bytes32 role) external view returns (bytes32);

    /**
     * @dev Grants `role` to `account`.
     *
     * If `account` had not been already granted `role`, emits a {RoleGranted}
     * event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     */
    function grantRole(bytes32 role, address account) external;

    /**
     * @dev Revokes `role` from `account`.
     *
     * If `account` had been granted `role`, emits a {RoleRevoked} event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     */
    function revokeRole(bytes32 role, address account) external;

    /**
     * @dev Revokes `role` from the calling account.
     *
     * Roles are often managed via {grantRole} and {revokeRole}: this function's
     * purpose is to provide a mechanism for accounts to lose their privileges
     * if they are compromised (such as when a trusted device is misplaced).
     *
     * If the calling account had been granted `role`, emits a {RoleRevoked}
     * event.
     *
     * Requirements:
     *
     * - the caller must be `account`.
     */
    function renounceRole(bytes32 role, address account) external;
}

File 12 of 18 : 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;
    }
}

File 13 of 18 : Strings.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (utils/Strings.sol)

pragma solidity ^0.8.0;

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

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

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

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

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

    /**
     * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.
     */
    function toHexString(address addr) internal pure returns (string memory) {
        return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);
    }
}

File 14 of 18 : ERC165.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)

pragma solidity ^0.8.0;

import "./IERC165.sol";

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

File 15 of 18 : 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 16 of 18 : draft-IERC20Permit.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/draft-IERC20Permit.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in
 * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].
 *
 * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by
 * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't
 * need to send a transaction, and thus is not required to hold Ether at all.
 */
interface IERC20Permit {
    /**
     * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,
     * given ``owner``'s signed approval.
     *
     * IMPORTANT: The same issues {IERC20-approve} has related to transaction
     * ordering also apply here.
     *
     * Emits an {Approval} event.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     * - `deadline` must be a timestamp in the future.
     * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`
     * over the EIP712-formatted function arguments.
     * - the signature must use ``owner``'s current nonce (see {nonces}).
     *
     * For more information on the signature format, see the
     * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP
     * section].
     */
    function permit(
        address owner,
        address spender,
        uint256 value,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) external;

    /**
     * @dev Returns the current nonce for `owner`. This value must be
     * included whenever a signature is generated for {permit}.
     *
     * Every successful call to {permit} increases ``owner``'s nonce by one. This
     * prevents a signature from being used multiple times.
     */
    function nonces(address owner) external view returns (uint256);

    /**
     * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.
     */
    // solhint-disable-next-line func-name-mixedcase
    function DOMAIN_SEPARATOR() external view returns (bytes32);
}

File 17 of 18 : Address.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.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 functionCall(target, data, "Address: low-level call failed");
    }

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

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

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

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

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

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

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

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

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

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

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

File 18 of 18 : IUniswapV2Router01.sol
pragma solidity >=0.6.2;

interface IUniswapV2Router01 {
    function factory() external pure returns (address);
    function WETH() external pure returns (address);

    function addLiquidity(
        address tokenA,
        address tokenB,
        uint amountADesired,
        uint amountBDesired,
        uint amountAMin,
        uint amountBMin,
        address to,
        uint deadline
    ) external returns (uint amountA, uint amountB, uint liquidity);
    function addLiquidityETH(
        address token,
        uint amountTokenDesired,
        uint amountTokenMin,
        uint amountETHMin,
        address to,
        uint deadline
    ) external payable returns (uint amountToken, uint amountETH, uint liquidity);
    function removeLiquidity(
        address tokenA,
        address tokenB,
        uint liquidity,
        uint amountAMin,
        uint amountBMin,
        address to,
        uint deadline
    ) external returns (uint amountA, uint amountB);
    function removeLiquidityETH(
        address token,
        uint liquidity,
        uint amountTokenMin,
        uint amountETHMin,
        address to,
        uint deadline
    ) external returns (uint amountToken, uint amountETH);
    function removeLiquidityWithPermit(
        address tokenA,
        address tokenB,
        uint liquidity,
        uint amountAMin,
        uint amountBMin,
        address to,
        uint deadline,
        bool approveMax, uint8 v, bytes32 r, bytes32 s
    ) external returns (uint amountA, uint amountB);
    function removeLiquidityETHWithPermit(
        address token,
        uint liquidity,
        uint amountTokenMin,
        uint amountETHMin,
        address to,
        uint deadline,
        bool approveMax, uint8 v, bytes32 r, bytes32 s
    ) external returns (uint amountToken, uint amountETH);
    function swapExactTokensForTokens(
        uint amountIn,
        uint amountOutMin,
        address[] calldata path,
        address to,
        uint deadline
    ) external returns (uint[] memory amounts);
    function swapTokensForExactTokens(
        uint amountOut,
        uint amountInMax,
        address[] calldata path,
        address to,
        uint deadline
    ) external returns (uint[] memory amounts);
    function swapExactETHForTokens(uint amountOutMin, address[] calldata path, address to, uint deadline)
        external
        payable
        returns (uint[] memory amounts);
    function swapTokensForExactETH(uint amountOut, uint amountInMax, address[] calldata path, address to, uint deadline)
        external
        returns (uint[] memory amounts);
    function swapExactTokensForETH(uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline)
        external
        returns (uint[] memory amounts);
    function swapETHForExactTokens(uint amountOut, address[] calldata path, address to, uint deadline)
        external
        payable
        returns (uint[] memory amounts);

    function quote(uint amountA, uint reserveA, uint reserveB) external pure returns (uint amountB);
    function getAmountOut(uint amountIn, uint reserveIn, uint reserveOut) external pure returns (uint amountOut);
    function getAmountIn(uint amountOut, uint reserveIn, uint reserveOut) external pure returns (uint amountIn);
    function getAmountsOut(uint amountIn, address[] calldata path) external view returns (uint[] memory amounts);
    function getAmountsIn(uint amountOut, address[] calldata path) external view returns (uint[] memory amounts);
}

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

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"uint256","name":"_fee","type":"uint256"},{"internalType":"address","name":"_addr","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"_from","type":"address"},{"indexed":false,"internalType":"address","name":"_tokenIn","type":"address"},{"indexed":false,"internalType":"uint256","name":"_amountIn","type":"uint256"},{"indexed":false,"internalType":"address","name":"_tokenOut","type":"address"},{"indexed":false,"internalType":"uint256","name":"_amountOut","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_arrayIndex","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_expires","type":"uint256"}],"name":"limitOrderCreated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"_orderIndex","type":"uint256"}],"name":"limitOrderExecuted","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"_orderIndex","type":"uint256"}],"name":"limitOrderExpired","type":"event"},{"inputs":[],"name":"ADMIN","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DEVELOPER","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"VOLT","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"uint256","name":"_orderIndex","type":"uint256"},{"internalType":"address[]","name":"_path","type":"address[]"}],"name":"executeLimitOrder","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"fee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amountOut","type":"uint256"},{"internalType":"address[]","name":"_path","type":"address[]"}],"name":"getAmountIn","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amountIn","type":"uint256"},{"internalType":"address[]","name":"_path","type":"address[]"}],"name":"getAmountOutMinWithFees","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getLimitOrdersCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_tokenIn","type":"address"},{"internalType":"address","name":"_tokenOut","type":"address"}],"name":"getPair","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_addr","type":"address"}],"name":"getTokenDecimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"orderIndex","type":"uint256"},{"internalType":"address[]","name":"_path","type":"address[]"}],"name":"isExecutableLimitOrder","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"limitOrders","outputs":[{"internalType":"address","name":"_from","type":"address"},{"internalType":"address","name":"_tokenIn","type":"address"},{"internalType":"uint256","name":"_amountIn","type":"uint256"},{"internalType":"address","name":"_tokenOut","type":"address"},{"internalType":"uint256","name":"_amountOut","type":"uint256"},{"internalType":"uint256","name":"_expires","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"tokenIn","type":"address"},{"internalType":"uint256","name":"amountIn","type":"uint256"},{"internalType":"address","name":"tokenOut","type":"address"},{"internalType":"uint256","name":"amountOut","type":"uint256"},{"internalType":"uint256","name":"expires","type":"uint256"}],"name":"sendLimitOrder","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amountOut","type":"uint256"},{"internalType":"address[]","name":"_path","type":"address[]"}],"name":"swapETHforExactToken","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amountOutMin","type":"uint256"},{"internalType":"address","name":"_dest","type":"address"},{"internalType":"address[]","name":"_path","type":"address[]"}],"name":"swapETHforToken","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amountIn","type":"uint256"},{"internalType":"uint256","name":"_amountOutMin","type":"uint256"},{"internalType":"bool","name":"_isLimitOrder","type":"bool"},{"internalType":"address","name":"_dest","type":"address"},{"internalType":"address[]","name":"_path","type":"address[]"}],"name":"swapTokenForETH","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amountOut","type":"uint256"},{"internalType":"uint256","name":"_amountInMax","type":"uint256"},{"internalType":"address[]","name":"_path","type":"address[]"}],"name":"swapTokenForExactETH","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amountOut","type":"uint256"},{"internalType":"uint256","name":"_amountInMax","type":"uint256"},{"internalType":"address[]","name":"_path","type":"address[]"}],"name":"swapTokenForExactToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amountIn","type":"uint256"},{"internalType":"uint256","name":"_amountOutMin","type":"uint256"},{"internalType":"bool","name":"_isLimitOrder","type":"bool"},{"internalType":"address","name":"_dest","type":"address"},{"internalType":"address[]","name":"_path","type":"address[]"}],"name":"swapTokenForToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"wallet","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"stateMutability":"payable","type":"receive"}]

60e06040523480156200001157600080fd5b506040516200411438038062004114833981016040819052620000349162000204565b8181737a250d5630b4cf539739df2c5dacb4c659f2488d6001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156200008457600080fd5b505afa15801562000099573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620000bf919062000233565b6001600160a01b0390811660805260c0839052811660a052620000e460003362000146565b620001107fdf8b4c520ffe197c5343c6f5aec59570151ef9a492f2c624fd45ddde6135ec423362000146565b6200013c7f2714cbbaddbb71bcae9366d8bf7770636ec7ae63227b573986d2f54fffacb39d3362000146565b5050505062000258565b6000828152602081815260408083206001600160a01b038516845290915290205460ff16620001e3576000828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055620001a23390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45b5050565b80516001600160a01b0381168114620001ff57600080fd5b919050565b600080604083850312156200021857600080fd5b825191506200022a60208401620001e7565b90509250929050565b6000602082840312156200024657600080fd5b6200025182620001e7565b9392505050565b60805160a05160c051613dc86200034c600039600081816105590152818161066b0152818161110c015281816113a50152818161169b015281816118a9015281816119a20152818161222a01526125d901526000818161035e01528181612a1301528181612af801528181612b8401528181612c5501528181612d5c01528181612dcc01528181612e130152612eb40152600081816110170152818161106501528181611248015281816112820152818161130d015281816120cb015281816121050152818161219a015281816124f10152818161253f015281816129d601528181612a3f01526131830152613dc86000f3fe6080604052600436106101b05760003560e01c8063785c7cf6116100ec578063d349e7251161008a578063e6a4390511610064578063e6a439051461057b578063ed5fe9211461059b578063f205a042146105c2578063faaeac4b146105e257600080fd5b8063d349e72514610514578063d547741f14610527578063ddca3f431461054757600080fd5b8063a217fddf116100c6578063a217fddf14610461578063a3e2b49514610476578063a8935d1c146104d4578063d263ed74146104f457600080fd5b8063785c7cf6146103cb57806391d14854146103fd5780639bed9f101461044157600080fd5b80632f2ff15d11610159578063470c63ee11610133578063470c63ee1461032c578063521eb2731461034c5780635b1f2942146103985780636a9db43f146103ab57600080fd5b80632f2ff15d146102b857806336568abe146102d85780633c934ab3146102f857600080fd5b8063248a9ca31161018a578063248a9ca3146102345780632a0acc6a146102645780632e9f31751461029857600080fd5b806301ffc9a7146101bc57806312b83f05146101f15780631c4b11331461021f57600080fd5b366101b757005b600080fd5b3480156101c857600080fd5b506101dc6101d736600461361f565b6105f7565b60405190151581526020015b60405180910390f35b3480156101fd57600080fd5b5061021161020c36600461373d565b610660565b6040519081526020016101e8565b61023261022d366004613784565b610788565b005b34801561024057600080fd5b5061021161024f3660046137d6565b60009081526020819052604090206001015490565b34801561027057600080fd5b506102117fdf8b4c520ffe197c5343c6f5aec59570151ef9a492f2c624fd45ddde6135ec4281565b3480156102a457600080fd5b506101dc6102b336600461373d565b610d37565b3480156102c457600080fd5b506102326102d33660046137ef565b610dd3565b3480156102e457600080fd5b506102326102f33660046137ef565b610dfd565b34801561030457600080fd5b506102117f2714cbbaddbb71bcae9366d8bf7770636ec7ae63227b573986d2f54fffacb39d81565b34801561033857600080fd5b5061023261034736600461382d565b610e89565b34801561035857600080fd5b506103807f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020016101e8565b6102326103a636600461373d565b6111d4565b3480156103b757600080fd5b506102326103c636600461382d565b6114e8565b3480156103d757600080fd5b506103eb6103e63660046138a3565b61171a565b60405160ff90911681526020016101e8565b34801561040957600080fd5b506101dc6104183660046137ef565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b34801561044d57600080fd5b5061023261045c3660046138c0565b61178d565b34801561046d57600080fd5b50610211600081565b34801561048257600080fd5b506104966104913660046137d6565b611a22565b604080516001600160a01b039788168152958716602087015285019390935293166060830152608082019290925260a081019190915260c0016101e8565b3480156104e057600080fd5b506102326104ef36600461373d565b611a76565b34801561050057600080fd5b5061021161050f36600461373d565b611f86565b610232610522366004613910565b612057565b34801561053357600080fd5b506102326105423660046137ef565b6122fe565b34801561055357600080fd5b506102117f000000000000000000000000000000000000000000000000000000000000000081565b34801561058757600080fd5b50610380610596366004613953565b612323565b3480156105a757600080fd5b50737db5af2b9624e1b3b4bb69d6debd9ad1016a58ac610380565b3480156105ce57600080fd5b506102326105dd3660046138c0565b6123dd565b3480156105ee57600080fd5b50600154610211565b60006001600160e01b031982167f7965db0b00000000000000000000000000000000000000000000000000000000148061065a57507f01ffc9a7000000000000000000000000000000000000000000000000000000006001600160e01b03198316145b92915050565b6000806127106106907f000000000000000000000000000000000000000000000000000000000000000086613997565b61069a91906139b6565b905060006106a882866139d8565b6040517fd06ca61f000000000000000000000000000000000000000000000000000000008152909150600090737a250d5630b4cf539739df2c5dacb4c659f2488d9063d06ca61f906107009085908990600401613a33565b60006040518083038186803b15801561071857600080fd5b505afa15801561072c573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526107549190810190613a4c565b9050806001825161076591906139d8565b8151811061077557610775613ad2565b6020026020010151935050505092915050565b4281116107dc5760405162461bcd60e51b815260206004820152600760248201527f657870697265730000000000000000000000000000000000000000000000000060448201526064015b60405180910390fd5b6040805160c081018252600080825260208201819052918101829052606081018290526080810182905260a08101919091523415610a0757506040805160c08101825233808252600060208301818152349484018581526001600160a01b0389811660608701908152608087018a815260a088018a81526001805480820182558189528a517fb10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cf6600690920291820180546001600160a01b031990811692891692909217905597517fb10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cf7820180548a1691881691909117905595517fb10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cf887015592517fb10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cf98601805490971694169390931790945592517fb10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cfa830155517fb10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cfb909101555492937fead9f1c7107fecea220d6158f6821366e48cfcffccb54421ad4aa8a9e8ded7e193889088906109ac5760006109ba565b600180546109ba91906139d8565b604080516001600160a01b039788168152958716602087015285019390935293166060830152608082019290925260a081019190915260c0810184905260e00160405180910390a1610d2f565b6040516370a0823160e01b81523060048201526000906001600160a01b038816906370a082319060240160206040518083038186803b158015610a4957600080fd5b505afa158015610a5d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a819190613ae8565b9050610a986001600160a01b038816333089612631565b6040516370a0823160e01b81523060048201526000906001600160a01b038916906370a082319060240160206040518083038186803b158015610ada57600080fd5b505afa158015610aee573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b129190613ae8565b6040805160c0810182523381526001600160a01b038b1660208201529192508101610b3d84846139d8565b81526001600160a01b0380891660208084019190915260408084018a90526060938401899052600180548082018255600091909152855160069091027fb10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cf6810180549286166001600160a01b0319938416179055928601517fb10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cf784018054918616918316919091179055908501517fb10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cf8830155928401517fb10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cf98201805491909316931692909217905560808201517fb10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cfa82015560a08201517fb10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cfb9091015592507fead9f1c7107fecea220d6158f6821366e48cfcffccb54421ad4aa8a9e8ded7e13389610cc485856139d8565b6001548a908a90610cd6576000610ce4565b60018054610ce491906139d8565b604080516001600160a01b039788168152958716602087015285019390935293166060830152608082019290925260a081019190915260c0810186905260e00160405180910390a150505b505050505050565b60008060018481548110610d4d57610d4d613ad2565b600091825260208083206040805160c081018252600690940290910180546001600160a01b03908116855260018201548116938501939093526002810154918401829052600381015490921660608401526004820154608084015260059091015460a0830152909250610dc09085610660565b6080909201519091101591505092915050565b600082815260208190526040902060010154610dee816126ca565b610df883836126d7565b505050565b6001600160a01b0381163314610e7b5760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201527f20726f6c657320666f722073656c66000000000000000000000000000000000060648201526084016107d3565b610e858282612775565b5050565b80600281511015610ecb5760405162461bcd60e51b815260206004820152600c60248201526b0929cac82989288bea082a8960a31b60448201526064016107d3565b600082600081518110610ee057610ee0613ad2565b6020026020010151905060008515610ef9575086611015565b6040516370a0823160e01b81523060048201526000906001600160a01b038416906370a082319060240160206040518083038186803b158015610f3b57600080fd5b505afa158015610f4f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f739190613ae8565b9050610f8a6001600160a01b03841687308c612631565b6040516370a0823160e01b81523060048201526000906001600160a01b038516906370a082319060240160206040518083038186803b158015610fcc57600080fd5b505afa158015610fe0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110049190613ae8565b905061101082826139d8565b925050505b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316826001600160a01b031614156110d857604051632e1a7d4d60e01b8152600481018290527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690632e1a7d4d90602401600060405180830381600087803b1580156110b157600080fd5b505af11580156110c5573d6000803e3d6000fd5b505050506110d385826127f4565b6111ca565b611102737a250d5630b4cf539739df2c5dacb4c659f2488d5b6001600160a01b0384169083612897565b60006127106111317f000000000000000000000000000000000000000000000000000000000000000084613997565b61113b91906139b6565b9050600061114982846139d8565b60405163791ac94760e01b8152909150737a250d5630b4cf539739df2c5dacb4c659f2488d9063791ac9479061118b9084908d908b908d904290600401613b01565b600060405180830381600087803b1580156111a557600080fd5b505af11580156111b9573d6000803e3d6000fd5b505050506111c7828761298a565b50505b5050505050505050565b806002815110156112165760405162461bcd60e51b815260206004820152600c60248201526b0929cac82989288bea082a8960a31b60448201526064016107d3565b6000826001845161122791906139d8565b8151811061123757611237613ad2565b6020026020010151905060003490507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316826001600160a01b0316141561139b577f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663d0e30db0826040518263ffffffff1660e01b81526004016000604051808303818588803b1580156112db57600080fd5b505af11580156112ef573d6000803e3d6000fd5b505060405163a9059cbb60e01b8152336004820152602481018590527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316935063a9059cbb92506044019050602060405180830381600087803b15801561135d57600080fd5b505af1158015611371573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113959190613b3d565b506114e1565b60006127106113ca7f000000000000000000000000000000000000000000000000000000000000000084613997565b6113d491906139b6565b905060006113e282846139d8565b6040517ffb3bdb41000000000000000000000000000000000000000000000000000000008152909150600090737a250d5630b4cf539739df2c5dacb4c659f2488d9063fb3bdb41908490611440908c908c9033904290600401613b5a565b6000604051808303818588803b15801561145957600080fd5b505af115801561146d573d6000803e3d6000fd5b50505050506040513d6000823e601f3d908101601f191682016040526114969190810190613a4c565b90506000816000815181106114ad576114ad613ad2565b6020026020010151836114c091906139d8565b905080156114d2576114d233826127f4565b6114dc848961298a565b505050505b5050505050565b8060028151101561152a5760405162461bcd60e51b815260206004820152600c60248201526b0929cac82989288bea082a8960a31b60448201526064016107d3565b60008260008151811061153f5761153f613ad2565b6020026020010151905060008515611558575086611674565b6040516370a0823160e01b81523060048201526000906001600160a01b038416906370a082319060240160206040518083038186803b15801561159a57600080fd5b505afa1580156115ae573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115d29190613ae8565b90506115e96001600160a01b03841687308c612631565b6040516370a0823160e01b81523060048201526000906001600160a01b038516906370a082319060240160206040518083038186803b15801561162b57600080fd5b505afa15801561163f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116639190613ae8565b905061166f82826139d8565b925050505b611691737a250d5630b4cf539739df2c5dacb4c659f2488d6110f1565b60006127106116c07f000000000000000000000000000000000000000000000000000000000000000084613997565b6116ca91906139b6565b905060006116d882846139d8565b604051635c11d79560e01b8152909150737a250d5630b4cf539739df2c5dacb4c659f2488d90635c11d7959061118b9084908d908b908d904290600401613b01565b6000816001600160a01b031663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b15801561175557600080fd5b505afa158015611769573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061065a9190613b8f565b806002815110156117cf5760405162461bcd60e51b815260206004820152600c60248201526b0929cac82989288bea082a8960a31b60448201526064016107d3565b6000826000815181106117e4576117e4613ad2565b602090810291909101015190506118066001600160a01b038216333087612631565b6040516370a0823160e01b81523060048201526000906001600160a01b038316906370a082319060240160206040518083038186803b15801561184857600080fd5b505afa15801561185c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118809190613ae8565b905061189f737a250d5630b4cf539739df2c5dacb4c659f2488d6110f1565b60006127106118ce7f000000000000000000000000000000000000000000000000000000000000000084613997565b6118d891906139b6565b90506000737a250d5630b4cf539739df2c5dacb4c659f2488d638803dbee8961190185876139d8565b8933426040518663ffffffff1660e01b8152600401611924959493929190613b01565b600060405180830381600087803b15801561193e57600080fd5b505af1158015611952573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261197a9190810190613a4c565b905060008160008151811061199157611991613ad2565b6020026020010151905060006127107f0000000000000000000000000000000000000000000000000000000000000000836119cc9190613997565b6119d691906139b6565b90506000816119e584886139d8565b6119ef91906139d8565b90508015611a0b57611a0b6001600160a01b0388163383612fdf565b611a15828a61298a565b5050505050505050505050565b60018181548110611a3257600080fd5b60009182526020909120600690910201805460018201546002830154600384015460048501546005909501546001600160a01b039485169650928416949193169186565b600060018381548110611a8b57611a8b613ad2565b600091825260208083206040805160c081018252600690940290910180546001600160a01b03908116855260018201548116938501939093526002810154918401829052600381015490921660608401526004820154608084015260059091015460a0830152909250611afe9084610660565b905081608001518110158015611b185750428260a0015110155b15611e225760208201516001600160a01b0316611bb2576040808301516080840151845192517fd349e725000000000000000000000000000000000000000000000000000000008152309363d349e7259392611b7b929091908990600401613bb2565b6000604051808303818588803b158015611b9457600080fd5b505af1158015611ba8573d6000803e3d6000fd5b5050505050611ccc565b60608201516001600160a01b0316611c4a576040808301516080840151845192517f470c63ee000000000000000000000000000000000000000000000000000000008152309363470c63ee93611c1393909290916001918a90600401613be3565b600060405180830381600087803b158015611c2d57600080fd5b505af1158015611c41573d6000803e3d6000fd5b50505050611ccc565b6040808301516080840151845192517f6a9db43f0000000000000000000000000000000000000000000000000000000081523093636a9db43f93611c9993909290916001918a90600401613be3565b600060405180830381600087803b158015611cb357600080fd5b505af1158015611cc7573d6000803e3d6000fd5b505050505b60018054611cdb9082906139d8565b81548110611ceb57611ceb613ad2565b906000526020600020906006020160018581548110611d0c57611d0c613ad2565b60009182526020909120825460069092020180546001600160a01b03199081166001600160a01b0393841617825560018085015481840180548416918616919091179055600280860154908401556003808601549084018054909316941693909317905560048084015490820155600592830154920191909155805480611d9557611d95613c19565b60008281526020812060066000199093019283020180546001600160a01b0319908116825560018201805482169055600282018390556003820180549091169055600481018290556005015590556040517f0f26775dbb51173f4c69690e55fe291ddf7f2ab8b4fadbd14b124c7e7025c69290611e159086815260200190565b60405180910390a1611f80565b428260a001511015611f805760018054611e3d9082906139d8565b81548110611e4d57611e4d613ad2565b906000526020600020906006020160018581548110611e6e57611e6e613ad2565b60009182526020909120825460069092020180546001600160a01b03199081166001600160a01b0393841617825560018085015481840180548416918616919091179055600280860154908401556003808601549084018054909316941693909317905560048084015490820155600592830154920191909155805480611ef757611ef7613c19565b60008281526020812060066000199093019283020180546001600160a01b0319908116825560018201805482169055600282018390556003820180549091169055600481018290556005015590556040517f100927afd30e37714bc4045d7aa299980e4b9996a7cd35b5fa095ad4e568f26390611f779086815260200190565b60405180910390a15b50505050565b6040517f1f00ca740000000000000000000000000000000000000000000000000000000081526000908190737a250d5630b4cf539739df2c5dacb4c659f2488d90631f00ca7490611fdd9087908790600401613a33565b60006040518083038186803b158015611ff557600080fd5b505afa158015612009573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526120319190810190613a4c565b90508060008151811061204657612046613ad2565b602002602001015191505092915050565b806002815110156120995760405162461bcd60e51b815260206004820152600c60248201526b0929cac82989288bea082a8960a31b60448201526064016107d3565b600082600184516120aa91906139d8565b815181106120ba576120ba613ad2565b6020026020010151905060003490507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316826001600160a01b03161415612220577f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663d0e30db0826040518263ffffffff1660e01b81526004016000604051808303818588803b15801561215e57600080fd5b505af1158015612172573d6000803e3d6000fd5b505060405163a9059cbb60e01b81526001600160a01b038981166004830152602482018690527f000000000000000000000000000000000000000000000000000000000000000016935063a9059cbb92506044019050602060405180830381600087803b1580156121e257600080fd5b505af11580156121f6573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061221a9190613b3d565b50610d2f565b600061271061224f7f000000000000000000000000000000000000000000000000000000000000000084613997565b61225991906139b6565b9050600061226782846139d8565b6040517fb6f9de95000000000000000000000000000000000000000000000000000000008152909150737a250d5630b4cf539739df2c5dacb4c659f2488d9063b6f9de959083906122c2908c908b908d904290600401613b5a565b6000604051808303818588803b1580156122db57600080fd5b505af11580156122ef573d6000803e3d6000fd5b50505050506111ca828761298a565b600082815260208190526040902060010154612319816126ca565b610df88383612775565b6000735c69bee701ef814a2b6a3edd4b1652cb9cc5aa6f6040517fe6a439050000000000000000000000000000000000000000000000000000000081526001600160a01b0385811660048301528481166024830152919091169063e6a439059060440160206040518083038186803b15801561239e57600080fd5b505afa1580156123b2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123d69190613c2f565b9392505050565b8060028151101561241f5760405162461bcd60e51b815260206004820152600c60248201526b0929cac82989288bea082a8960a31b60448201526064016107d3565b60008260008151811061243457612434613ad2565b602090810291909101015190506124566001600160a01b038216333087612631565b6040516370a0823160e01b81523060048201526000906001600160a01b038316906370a082319060240160206040518083038186803b15801561249857600080fd5b505afa1580156124ac573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124d09190613ae8565b90506124ef737a250d5630b4cf539739df2c5dacb4c659f2488d6110f1565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316826001600160a01b031614156125b257604051632e1a7d4d60e01b8152600481018290527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690632e1a7d4d90602401600060405180830381600087803b15801561258b57600080fd5b505af115801561259f573d6000803e3d6000fd5b505050506125ad33826127f4565b610d2f565b6125cf737a250d5630b4cf539739df2c5dacb4c659f2488d6110f1565b60006127106125fe7f000000000000000000000000000000000000000000000000000000000000000084613997565b61260891906139b6565b90506000737a250d5630b4cf539739df2c5dacb4c659f2488d634a25d94a8961190185876139d8565b6040516001600160a01b0380851660248301528316604482015260648101829052611f809085907f23b872dd00000000000000000000000000000000000000000000000000000000906084015b60408051601f198184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff166001600160e01b03199093169290921790915261300f565b6126d481336130f4565b50565b6000828152602081815260408083206001600160a01b038516845290915290205460ff16610e85576000828152602081815260408083206001600160a01b03851684529091529020805460ff191660011790556127313390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff1615610e85576000828152602081815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b6000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114612841576040519150601f19603f3d011682016040523d82523d6000602084013e612846565b606091505b5050905080610df85760405162461bcd60e51b815260206004820152601460248201527f4661696c656420746f2073656e6420457468657200000000000000000000000060448201526064016107d3565b6040517fdd62ed3e0000000000000000000000000000000000000000000000000000000081523060048201526001600160a01b038381166024830152600091839186169063dd62ed3e9060440160206040518083038186803b1580156128fc57600080fd5b505afa158015612910573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906129349190613ae8565b61293e9190613c4c565b6040516001600160a01b038516602482015260448101829052909150611f809085907f095ea7b3000000000000000000000000000000000000000000000000000000009060640161267e565b60008160008151811061299f5761299f613ad2565b60200260200101519050600082600184516129ba91906139d8565b815181106129ca576129ca613ad2565b602002602001015190507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316826001600160a01b03161415612a3d57612a387f0000000000000000000000000000000000000000000000000000000000000000856127f4565b611f80565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316816001600160a01b03161415612cb9576001600160a01b038216737db5af2b9624e1b3b4bb69d6debd9ad1016a58ac1415612ab257612a386001600160a01b03831661dead86612fdf565b6000612abf6002866139b6565b60405163791ac94760e01b8152909150737a250d5630b4cf539739df2c5dacb4c659f2488d9063791ac94790612b2290849060009089907f0000000000000000000000000000000000000000000000000000000000000000904290600401613b01565b600060405180830381600087803b158015612b3c57600080fd5b505af1158015612b50573d6000803e3d6000fd5b5050505060008186612b6291906139d8565b60405163753d756360e01b81526001600160a01b0386811660048301529192507f00000000000000000000000000000000000000000000000000000000000000009091169063753d75639060240160206040518083038186803b158015612bc857600080fd5b505afa158015612bdc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612c009190613b3d565b612c1f57612c1a6001600160a01b03851661dead83612fdf565b612cb2565b60405163791ac94760e01b8152737a250d5630b4cf539739df2c5dacb4c659f2488d9063791ac94790612c7f9084906000908a907f0000000000000000000000000000000000000000000000000000000000000000904290600401613b01565b600060405180830381600087803b158015612c9957600080fd5b505af1158015612cad573d6000803e3d6000fd5b505050505b5050611f80565b6001600160a01b038216737db5af2b9624e1b3b4bb69d6debd9ad1016a58ac1415612cf457612a386001600160a01b03831661dead86612fdf565b6000612d016002866139b6565b90506000612d0f82876139d8565b90506000612d1c86613172565b805190915015612dbd5760405163791ac94760e01b8152737a250d5630b4cf539739df2c5dacb4c659f2488d9063791ac94790612d8690869060009086907f0000000000000000000000000000000000000000000000000000000000000000904290600401613b01565b600060405180830381600087803b158015612da057600080fd5b505af1158015612db4573d6000803e3d6000fd5b50505050612df1565b612df16001600160a01b0386167f000000000000000000000000000000000000000000000000000000000000000085612fdf565b60405163753d756360e01b81526001600160a01b0386811660048301526000917f00000000000000000000000000000000000000000000000000000000000000009091169063753d75639060240160206040518083038186803b158015612e5757600080fd5b505afa158015612e6b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612e8f9190613b3d565b60405163753d756360e01b81526001600160a01b0387811660048301529192506000917f0000000000000000000000000000000000000000000000000000000000000000169063753d75639060240160206040518083038186803b158015612ef657600080fd5b505afa158015612f0a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612f2e9190613b3d565b905081158015612f3b5750805b15612f5b57612f566001600160a01b03881661dead86612fdf565b6114dc565b806114dc57604051635c11d79560e01b8152737a250d5630b4cf539739df2c5dacb4c659f2488d90635c11d79590612fa29087906000908d9061dead904290600401613b01565b600060405180830381600087803b158015612fbc57600080fd5b505af1158015612fd0573d6000803e3d6000fd5b50505050505050505050505050565b6040516001600160a01b038316602482015260448101829052610df890849063a9059cbb60e01b9060640161267e565b6000613064826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166132a69092919063ffffffff16565b805190915015610df857808060200190518101906130829190613b3d565b610df85760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f7420737563636565640000000000000000000000000000000000000000000060648201526084016107d3565b6000828152602081815260408083206001600160a01b038516845290915290205460ff16610e8557613130816001600160a01b031660146132bd565b61313b8360206132bd565b60405160200161314c929190613c90565b60408051601f198184030181529082905262461bcd60e51b82526107d391600401613d11565b60606000805b83518110156131f8577f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168482815181106131bd576131bd613ad2565b60200260200101516001600160a01b031614156131e6576131df816001613c4c565b91506131f8565b806131f081613d44565b915050613178565b508067ffffffffffffffff81111561321257613212613649565b60405190808252806020026020018201604052801561323b578160200160208202803683370190505b50915060005b8181101561329f5783818151811061325b5761325b613ad2565b602002602001015183828151811061327557613275613ad2565b6001600160a01b03909216602092830291909101909101528061329781613d44565b915050613241565b5050919050565b60606132b5848460008561349e565b949350505050565b606060006132cc836002613997565b6132d7906002613c4c565b67ffffffffffffffff8111156132ef576132ef613649565b6040519080825280601f01601f191660200182016040528015613319576020820181803683370190505b5090507f30000000000000000000000000000000000000000000000000000000000000008160008151811061335057613350613ad2565b60200101906001600160f81b031916908160001a9053507f78000000000000000000000000000000000000000000000000000000000000008160018151811061339b5761339b613ad2565b60200101906001600160f81b031916908160001a90535060006133bf846002613997565b6133ca906001613c4c565b90505b600181111561344f577f303132333435363738396162636465660000000000000000000000000000000085600f166010811061340b5761340b613ad2565b1a60f81b82828151811061342157613421613ad2565b60200101906001600160f81b031916908160001a90535060049490941c9361344881613d5f565b90506133cd565b5083156123d65760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e7460448201526064016107d3565b6060824710156135165760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c000000000000000000000000000000000000000000000000000060648201526084016107d3565b6001600160a01b0385163b61356d5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016107d3565b600080866001600160a01b031685876040516135899190613d76565b60006040518083038185875af1925050503d80600081146135c6576040519150601f19603f3d011682016040523d82523d6000602084013e6135cb565b606091505b50915091506135db8282866135e6565b979650505050505050565b606083156135f55750816123d6565b8251156136055782518084602001fd5b8160405162461bcd60e51b81526004016107d39190613d11565b60006020828403121561363157600080fd5b81356001600160e01b0319811681146123d657600080fd5b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff8111828210171561368857613688613649565b604052919050565b600067ffffffffffffffff8211156136aa576136aa613649565b5060051b60200190565b6001600160a01b03811681146126d457600080fd5b600082601f8301126136da57600080fd5b813560206136ef6136ea83613690565b61365f565b82815260059290921b8401810191818101908684111561370e57600080fd5b8286015b84811015613732578035613725816136b4565b8352918301918301613712565b509695505050505050565b6000806040838503121561375057600080fd5b82359150602083013567ffffffffffffffff81111561376e57600080fd5b61377a858286016136c9565b9150509250929050565b600080600080600060a0868803121561379c57600080fd5b85356137a7816136b4565b94506020860135935060408601356137be816136b4565b94979396509394606081013594506080013592915050565b6000602082840312156137e857600080fd5b5035919050565b6000806040838503121561380257600080fd5b823591506020830135613814816136b4565b809150509250929050565b80151581146126d457600080fd5b600080600080600060a0868803121561384557600080fd5b8535945060208601359350604086013561385e8161381f565b9250606086013561386e816136b4565b9150608086013567ffffffffffffffff81111561388a57600080fd5b613896888289016136c9565b9150509295509295909350565b6000602082840312156138b557600080fd5b81356123d6816136b4565b6000806000606084860312156138d557600080fd5b8335925060208401359150604084013567ffffffffffffffff8111156138fa57600080fd5b613906868287016136c9565b9150509250925092565b60008060006060848603121561392557600080fd5b833592506020840135613937816136b4565b9150604084013567ffffffffffffffff8111156138fa57600080fd5b6000806040838503121561396657600080fd5b8235613971816136b4565b91506020830135613814816136b4565b634e487b7160e01b600052601160045260246000fd5b60008160001904831182151516156139b1576139b1613981565b500290565b6000826139d357634e487b7160e01b600052601260045260246000fd5b500490565b6000828210156139ea576139ea613981565b500390565b600081518084526020808501945080840160005b83811015613a285781516001600160a01b031687529582019590820190600101613a03565b509495945050505050565b8281526040602082015260006132b560408301846139ef565b60006020808385031215613a5f57600080fd5b825167ffffffffffffffff811115613a7657600080fd5b8301601f81018513613a8757600080fd5b8051613a956136ea82613690565b81815260059190911b82018301908381019087831115613ab457600080fd5b928401925b828410156135db57835182529284019290840190613ab9565b634e487b7160e01b600052603260045260246000fd5b600060208284031215613afa57600080fd5b5051919050565b85815284602082015260a060408201526000613b2060a08301866139ef565b6001600160a01b0394909416606083015250608001529392505050565b600060208284031215613b4f57600080fd5b81516123d68161381f565b848152608060208201526000613b7360808301866139ef565b6001600160a01b03949094166040830152506060015292915050565b600060208284031215613ba157600080fd5b815160ff811681146123d657600080fd5b8381526001600160a01b0383166020820152606060408201526000613bda60608301846139ef565b95945050505050565b85815284602082015283151560408201526001600160a01b038316606082015260a0608082015260006135db60a08301846139ef565b634e487b7160e01b600052603160045260246000fd5b600060208284031215613c4157600080fd5b81516123d6816136b4565b60008219821115613c5f57613c5f613981565b500190565b60005b83811015613c7f578181015183820152602001613c67565b83811115611f805750506000910152565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351613cc8816017850160208801613c64565b7f206973206d697373696e6720726f6c65200000000000000000000000000000006017918401918201528351613d05816028840160208801613c64565b01602801949350505050565b6020815260008251806020840152613d30816040850160208701613c64565b601f01601f19169190910160400192915050565b6000600019821415613d5857613d58613981565b5060010190565b600081613d6e57613d6e613981565b506000190190565b60008251613d88818460208701613c64565b919091019291505056fea26469706673582212203c0d723a5e4bcfb65c5500962f9fbea6110e46473afd29e5c48db0f4bef1294064736f6c63430008090033000000000000000000000000000000000000000000000000000000000000003200000000000000000000000033771df3ca1ca26d7eff1d0b927de09903046a5d

Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)

000000000000000000000000000000000000000000000000000000000000003200000000000000000000000033771df3ca1ca26d7eff1d0b927de09903046a5d

-----Decoded View---------------
Arg [0] : _fee (uint256): 50
Arg [1] : _addr (address): 0x33771dF3Ca1ca26D7eff1D0B927de09903046A5d

-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 0000000000000000000000000000000000000000000000000000000000000032
Arg [1] : 00000000000000000000000033771df3ca1ca26d7eff1d0b927de09903046a5d


Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading
Make sure to use the "Vote Down" button for any spammy posts, and the "Vote Up" for interesting conversations.

Validator Index Block Amount
View All Withdrawals
[ Download: CSV Export  ]
[ 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.