ETH Price: $2,439.08 (-1.44%)
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Payment ETH146237632022-04-20 19:22:14929 days ago1650482534IN
0x68Dc2554...d0D8Ebbf0
0.10356588 ETH0.0197805995.32632066
Payment ETH146237542022-04-20 19:20:01929 days ago1650482401IN
0x68Dc2554...d0D8Ebbf0
0.10356974 ETH0.0199825881.6735918
Payment ETH146236752022-04-20 19:04:27929 days ago1650481467IN
0x68Dc2554...d0D8Ebbf0
0.10407001 ETH0.02354931113.48848829
Payment ETH146233852022-04-20 18:00:16929 days ago1650477616IN
0x68Dc2554...d0D8Ebbf0
0.10404631 ETH0.0196623199.76415017
Payment ETH146228492022-04-20 16:03:22929 days ago1650470602IN
0x68Dc2554...d0D8Ebbf0
0.10340175 ETH0.0359435173.21839429
Payment ETH146228452022-04-20 16:01:51929 days ago1650470511IN
0x68Dc2554...d0D8Ebbf0
0.10340129 ETH0.02562236123.47890438
Payment ETH146228332022-04-20 15:59:33929 days ago1650470373IN
0x68Dc2554...d0D8Ebbf0
0.10341075 ETH0.0133645464.40619863
Payment ETH146227542022-04-20 15:40:51929 days ago1650469251IN
0x68Dc2554...d0D8Ebbf0
0.10347284 ETH0.0161992682.19303971
Payment ETH146226092022-04-20 15:07:37929 days ago1650467257IN
0x68Dc2554...d0D8Ebbf0
0.10259211 ETH0.0195320294.12842231
Payment ETH146225942022-04-20 15:03:03929 days ago1650466983IN
0x68Dc2554...d0D8Ebbf0
0.20486742 ETH0.0170341269.62593707
Payment ETH146221182022-04-20 13:14:12929 days ago1650460452IN
0x68Dc2554...d0D8Ebbf0
0.10959973 ETH0.0192950292.98626101
Payment ETH146219522022-04-20 12:39:23929 days ago1650458363IN
0x68Dc2554...d0D8Ebbf0
0.10964709 ETH0.0089186242.98049817
Payment ETH146218562022-04-20 12:17:22930 days ago1650457042IN
0x68Dc2554...d0D8Ebbf0
0.10966049 ETH0.0084531140.7371349
Payment ETH146218532022-04-20 12:16:51930 days ago1650457011IN
0x68Dc2554...d0D8Ebbf0
0.10861666 ETH0.0124973351.07956881
Payment ETH146218482022-04-20 12:16:12930 days ago1650456972IN
0x68Dc2554...d0D8Ebbf0
0.10969174 ETH0.0134680355.04977289
Payment ETH146218442022-04-20 12:14:50930 days ago1650456890IN
0x68Dc2554...d0D8Ebbf0
0.10970329 ETH0.0102353541.83432318
Payment ETH146217052022-04-20 11:48:56930 days ago1650455336IN
0x68Dc2554...d0D8Ebbf0
0.10941509 ETH0.0078119237.64928997
Payment ETH146216342022-04-20 11:32:51930 days ago1650454371IN
0x68Dc2554...d0D8Ebbf0
0.10893507 ETH0.0091745237.49846891
Payment ETH146213152022-04-20 10:19:51930 days ago1650449991IN
0x68Dc2554...d0D8Ebbf0
0.10902137 ETH0.0097844747.15318528
Payment ETH146212402022-04-20 10:00:54930 days ago1650448854IN
0x68Dc2554...d0D8Ebbf0
0.10889511 ETH0.009000943.37699833
Payment ETH146211852022-04-20 9:49:12930 days ago1650448152IN
0x68Dc2554...d0D8Ebbf0
0.10894424 ETH0.009670539.52563582
Payment ETH146211222022-04-20 9:33:16930 days ago1650447196IN
0x68Dc2554...d0D8Ebbf0
0.10905091 ETH0.0120370249.19817539
Payment ETH146210212022-04-20 9:11:15930 days ago1650445875IN
0x68Dc2554...d0D8Ebbf0
0.21887542 ETH0.010026848.32101132
Payment ETH146209942022-04-20 9:04:04930 days ago1650445444IN
0x68Dc2554...d0D8Ebbf0
0.1099814 ETH0.0099616750.54428858
Payment ETH146209842022-04-20 9:00:36930 days ago1650445236IN
0x68Dc2554...d0D8Ebbf0
0.33038972 ETH0.0071599234.50501764
View all transactions

Latest 25 internal transactions (View All)

Advanced mode:
Parent Transaction Hash Block From To
146237632022-04-20 19:22:14929 days ago1650482534
0x68Dc2554...d0D8Ebbf0
0.0010254 ETH
146237632022-04-20 19:22:14929 days ago1650482534
0x68Dc2554...d0D8Ebbf0
0.0010254 ETH
146237632022-04-20 19:22:14929 days ago1650482534
0x68Dc2554...d0D8Ebbf0
0.10356588 ETH
146237542022-04-20 19:20:01929 days ago1650482401
0x68Dc2554...d0D8Ebbf0
0.00102544 ETH
146237542022-04-20 19:20:01929 days ago1650482401
0x68Dc2554...d0D8Ebbf0
0.00102544 ETH
146237542022-04-20 19:20:01929 days ago1650482401
0x68Dc2554...d0D8Ebbf0
0.10356974 ETH
146236752022-04-20 19:04:27929 days ago1650481467
0x68Dc2554...d0D8Ebbf0
0.00103039 ETH
146236752022-04-20 19:04:27929 days ago1650481467
0x68Dc2554...d0D8Ebbf0
0.00103039 ETH
146236752022-04-20 19:04:27929 days ago1650481467
0x68Dc2554...d0D8Ebbf0
0.10407001 ETH
146233852022-04-20 18:00:16929 days ago1650477616
0x68Dc2554...d0D8Ebbf0
0.00105544 ETH
146233852022-04-20 18:00:16929 days ago1650477616
0x68Dc2554...d0D8Ebbf0
0.00105544 ETH
146233852022-04-20 18:00:16929 days ago1650477616
0x68Dc2554...d0D8Ebbf0
0.10404631 ETH
146228492022-04-20 16:03:22929 days ago1650470602
0x68Dc2554...d0D8Ebbf0
0.00102377 ETH
146228492022-04-20 16:03:22929 days ago1650470602
0x68Dc2554...d0D8Ebbf0
0.00102377 ETH
146228492022-04-20 16:03:22929 days ago1650470602
0x68Dc2554...d0D8Ebbf0
0.10340175 ETH
146228452022-04-20 16:01:51929 days ago1650470511
0x68Dc2554...d0D8Ebbf0
0.00102377 ETH
146228452022-04-20 16:01:51929 days ago1650470511
0x68Dc2554...d0D8Ebbf0
0.00102377 ETH
146228452022-04-20 16:01:51929 days ago1650470511
0x68Dc2554...d0D8Ebbf0
0.10340129 ETH
146228332022-04-20 15:59:33929 days ago1650470373
0x68Dc2554...d0D8Ebbf0
0.00102386 ETH
146228332022-04-20 15:59:33929 days ago1650470373
0x68Dc2554...d0D8Ebbf0
0.00102386 ETH
146228332022-04-20 15:59:33929 days ago1650470373
0x68Dc2554...d0D8Ebbf0
0.10341075 ETH
146227542022-04-20 15:40:51929 days ago1650469251
0x68Dc2554...d0D8Ebbf0
0.00103696 ETH
146227542022-04-20 15:40:51929 days ago1650469251
0x68Dc2554...d0D8Ebbf0
0.00103696 ETH
146227542022-04-20 15:40:51929 days ago1650469251
0x68Dc2554...d0D8Ebbf0
0.10347284 ETH
146226092022-04-20 15:07:37929 days ago1650467257
0x68Dc2554...d0D8Ebbf0
0.0010162 ETH
View All Internal Transactions
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
BridgeLeft

Compiler Version
v0.8.8+commit.dddeac2f

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion, MIT license
File 1 of 10 : BridgeLeft.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import "SafeERC20.sol";
import "Ownable.sol";
import "EnumerableSet.sol";
import "ReentrancyGuard.sol";

import "IUniswapV2Router02.sol";
//import "IUniswapV2Router02.sol";


/** @title BridgeLeft
  * @notice user wants to make a payment for an order
  *   orderId: 42
  *   orderUSDAmount: 123
  *
  * call paymentERC20(orderId=42, orderUSDAmount=123, payableToken=XXX, ...) or paymentERC20 or paymentETH
  *       |
  *       |   ~ contract adds serviceFee
  *       |   ~ contract swaps payableToken to stablecoin
  *       |__________________
  *       |                  |
  *       V                  V
  *   destination       serviceFeeTreasury
**/
contract BridgeLeft is Ownable, ReentrancyGuard {
    using SafeERC20 for IERC20;
    using EnumerableSet for EnumerableSet.AddressSet;

    // we always pass USD with 6 decimals
    // in functions: estimateFee, paymentStablecoin, estimatePayableTokenAmount, paymentERC20, paymentETH
    uint256 constant public USD_DECIMALS = 6;

    uint256 internal constant ONE_PERCENT = 100;  // 1%
    uint256 public constant FEE_DENOMINATOR = 100 * ONE_PERCENT;  // 100%
    uint256 public feeNumerator = 5 * ONE_PERCENT;

    address public serviceFeeTreasury;  // this is a service fee for the project support

    bool public whitelistAllTokens;  // do we want to accept all erc20 token as a payment? todo: be careful with deflationary etc
    EnumerableSet.AddressSet internal _whitelistTokens;  // erc20 tokens we accept as a payment (before swap)  //todo gas optimisations
    EnumerableSet.AddressSet internal _whitelistStablecoins;  // stablecoins we accept as a final payment method  //todo gas optimisations
    mapping (address => uint256) public stablecoinDecimals;

    address immutable public router;  // dex router we use todo: maybe make it updateable or just deploy new contract?

    // we need orderId
    // if someone from 2 different browsers will try to make a payment, the backend
    // will not be able to understand which transfer match which order
    // we also need (user -> order -> flag) mapping because if we use (order -> flag) mapping
    // other malicious user may front-run the client and make him sad :-(
    mapping (address /*user*/ => mapping (bytes16 /*orderId*/ => bool)) public userPaidOrders;

    event ServiceFeeTreasurySet(address indexed value);
    event WhitelistAllTokensSet(bool value);
    event TokenAddedToWhitelistStablecoins(address indexed token, uint256 decimals);
    event TokenAddedToWhitelist(address indexed token);
    event TokenRemovedFromWhitelistStablecoins(address indexed token);
    event TokenRemovedFromWhitelist(address indexed token);
    event OrderPaid(
        bytes16 orderId,
        uint256 orderUSDAmount,
        address destination,
        address payer,
        address payableToken,
        uint256 payableTokenAmount,
        address stablecoin,
        uint256 serviceFeeUSDAmount
    );

    constructor(
        address routerAddress,
        address serviceFeeTreasuryAddress
    ) {
        require(routerAddress != address(0), "zero address");
        router = routerAddress;

        require(serviceFeeTreasuryAddress != address(0), "zero address");
        serviceFeeTreasury = serviceFeeTreasuryAddress;
    }

    function setServiceFeeTreasury(address serviceFeeTreasuryAddress) external onlyOwner {
        require(serviceFeeTreasuryAddress != address(0), "zero address");
        serviceFeeTreasury = serviceFeeTreasuryAddress;
        emit ServiceFeeTreasurySet(serviceFeeTreasuryAddress);
    }

    function setWhitelistAllTokens(bool value) external onlyOwner {
        whitelistAllTokens = value;
        emit WhitelistAllTokensSet(value);
    }

    function getWhitelistedTokens() external view returns(address[] memory) {
        uint256 length = _whitelistTokens.length();
        address[] memory result = new address[](length);
        for (uint256 i=0; i < length; ++i) {
            result[i] = _whitelistTokens.at(i);
        }
        return result;
    }

    function getWhitelistedStablecoins() external view returns(address[] memory) {
        uint256 length = _whitelistStablecoins.length();
        address[] memory result = new address[](length);
        for (uint256 i=0; i < length; ++i) {
            result[i] = _whitelistStablecoins.at(i);
        }
        return result;
    }

    function isTokenWhitelisted(address token) external view returns(bool) {
        return _whitelistTokens.contains(token);
    }

    function isWhitelistedStablecoin(address token) public view returns(bool) {
        return _whitelistStablecoins.contains(token);
    }

    modifier onlyWhitelistedTokenOrAllWhitelisted(address token) {
        require(whitelistAllTokens || _whitelistTokens.contains(token), "not whitelisted");
        _;
    }

    function addTokenToWhitelist(address token) external onlyOwner {
        require(_whitelistTokens.add(token), "already whitelisted");
        emit TokenAddedToWhitelist(token);
    }

    function removeTokenFromWhitelist(address token) external onlyOwner {
        require(_whitelistTokens.remove(token), "not whitelisted");
        emit TokenRemovedFromWhitelist(token);
    }

    function addTokenToWhitelistStablecoins(address token, uint256 decimals) external onlyOwner {
        require(_whitelistStablecoins.add(token), "already whitelisted stablecoin");
        stablecoinDecimals[token] = decimals;
        emit TokenAddedToWhitelistStablecoins(token, decimals);
    }

    function removeTokenFromWhitelistStablecoins(address token) external onlyOwner {
        require(_whitelistStablecoins.remove(token), "not whitelisted stablecoin");
        delete stablecoinDecimals[token];
        emit TokenRemovedFromWhitelistStablecoins(token);
    }

    function setFeeNumerator(uint256 newFeeNumerator) external onlyOwner {
        require(newFeeNumerator <= 1000, "Max fee numerator: 1000");
        feeNumerator = newFeeNumerator;
    }

    // ==== payment

    function estimateFee(
        uint256 orderUSDAmount  // 6 decimals
    ) view external returns(uint256) {
        return orderUSDAmount * feeNumerator / FEE_DENOMINATOR;
    }

    // not supporting deflationary or transfer-fee stablecoin (warning: usdt IS transfer-fee stablecoin but fee=0 now)
    function paymentStablecoin(
        bytes16 orderId,
        uint256 orderUSDAmount,  // 6 decimals
        address destination,
        address stablecoin
    ) external nonReentrant {
        require(destination != address(0), "zero address");
        require(!userPaidOrders[msg.sender][orderId], "order already paid");
        require(isWhitelistedStablecoin(stablecoin), "the end path is not stablecoin");
        userPaidOrders[msg.sender][orderId] = true;

        uint256 orderUSDAmountERC20DECIMALS = orderUSDAmount * (10 ** stablecoinDecimals[stablecoin]) / (10 ** USD_DECIMALS);
        uint256 feeStablecoinAmount = orderUSDAmount * feeNumerator / FEE_DENOMINATOR;
        uint256 feeStablecoinAmountERC20DECIMALS = feeStablecoinAmount * (10 ** stablecoinDecimals[stablecoin]) / (10 ** USD_DECIMALS);

        IERC20(stablecoin).safeTransferFrom(msg.sender, destination, orderUSDAmountERC20DECIMALS);
        IERC20(stablecoin).safeTransferFrom(msg.sender, serviceFeeTreasury, feeStablecoinAmountERC20DECIMALS);

        emit OrderPaid({
            orderId: orderId,
            orderUSDAmount: orderUSDAmount,
            destination: destination,
            payer: msg.sender,
            payableToken: stablecoin,
            payableTokenAmount: (orderUSDAmountERC20DECIMALS + feeStablecoinAmountERC20DECIMALS),
            stablecoin: stablecoin,
            serviceFeeUSDAmount: feeStablecoinAmount
        });
    }

    // view method to return how much tokens should be transferred
    function estimatePayableTokenAmount(
        uint256 orderUSDAmount,  // 6 decimals
        address[] calldata path
    ) external view onlyWhitelistedTokenOrAllWhitelisted(path[0]) returns(uint256) {
        require(isWhitelistedStablecoin(path[path.length-1]), "the end path is not stablecoin");
        uint256 orderUSDAmountERC20DECIMALS = orderUSDAmount * (10 ** stablecoinDecimals[path[path.length-1]]) / (10 ** USD_DECIMALS);
        uint256[] memory amounts = IUniswapV2Router02(router).getAmountsIn(orderUSDAmountERC20DECIMALS, path);
        return amounts[0];
    }

    // not supporting deflationary tokens (99.9% of cases)
    function paymentERC20(
        bytes16 orderId,
        uint256 orderUSDAmount,  // 6 decimals
        address destination,
        uint256 payableTokenMaxAmount,
        uint256 deadline,
        address[] calldata path
    ) external onlyWhitelistedTokenOrAllWhitelisted(path[0]) nonReentrant {
        require(destination != address(0), "zero address");
        require(!userPaidOrders[msg.sender][orderId], "order already paid");
        require(isWhitelistedStablecoin(path[path.length-1]), "the end path is not stablecoin");
        userPaidOrders[msg.sender][orderId] = true;

        uint256 orderUSDAmountERC20DECIMALS = orderUSDAmount * (10 ** stablecoinDecimals[path[path.length-1]]) / (10 ** USD_DECIMALS);
        uint256 feeStablecoinAmount = orderUSDAmount * feeNumerator / FEE_DENOMINATOR;

        uint256 amountIn;

        {
            uint256 feeStablecoinAmountERC20DECIMALS = feeStablecoinAmount * (10 ** stablecoinDecimals[path[path.length-1]]) / (10 ** USD_DECIMALS);
            uint256 totalAmountERC20DECIMALS = orderUSDAmountERC20DECIMALS + feeStablecoinAmountERC20DECIMALS;
            amountIn = IUniswapV2Router02(router).getAmountsIn(totalAmountERC20DECIMALS, path)[0];  // todo think about 2x cycle
            require(amountIn <= payableTokenMaxAmount, "insufficient payableTokenMaxAmount");
            IERC20(path[0]).safeTransferFrom(msg.sender, address(this), amountIn);
            IERC20(path[0]).safeApprove(router, amountIn);  // think: approve type(uint256).max once
            IUniswapV2Router02(router).swapExactTokensForTokens({
                amountIn: amountIn,
                amountOutMin: totalAmountERC20DECIMALS,
                path: path,
                to: address(this),
                deadline: deadline
            });
            IERC20(path[path.length-1]).safeTransfer(destination, orderUSDAmountERC20DECIMALS);
            IERC20(path[path.length-1]).safeTransfer(serviceFeeTreasury, feeStablecoinAmountERC20DECIMALS);
        }

        // no dust tokens are rest on the SC balance since we use getAmountsIn

        emit OrderPaid({
            orderId: orderId,
            orderUSDAmount: orderUSDAmount,
            destination: destination,
            payer: msg.sender,
            payableToken: path[0],
            payableTokenAmount: amountIn,
            stablecoin: path[path.length-1],
            serviceFeeUSDAmount: feeStablecoinAmount
        });
    }

    // supporting deflationary tokens (0.1% of cases)
    // todo think about it and test it well!
//    function paymentERC20SupportingFeeOnTransfer(
//        bytes16 orderId,
//        uint256 orderUSDAmount,
//        address destination,
//        uint256 payableTokenMaxAmount,
//        uint256 deadline,
//        address[] calldata path,
//        uint256 minTokensRestAmountToReturn
//    ) external onlyWhitelistedTokenOrAllWhitelisted(path[0]) nonReentrant {
//        address stablecoin = path[path.length-1];
//
//        require(destination != address(0), "zero address");
//        require(!userPaidOrders[msg.sender][orderId], "order already paid");
//        require(isWhitelistedStablecoin(stablecoin), "the end path is not stablecoin");
//        userPaidOrders[msg.sender][orderId] = true;
//
//        uint256 feeStablecoinAmount = orderUSDAmount * feeNumerator / FEE_DENOMINATOR;
//
//        uint256 contractStablecoinBalanceBefore = IERC20(stablecoin).balanceOf(address(this));
//        uint256 payableTokenReceivedAmount;
//
//        {
//            uint256 contractPayableTokenBalanceBefore = IERC20(path[0]).balanceOf(address(this));
//            IERC20(path[0]).safeTransferFrom(msg.sender, address(this), payableTokenMaxAmount);
//            uint256 contractPayableTokenBalanceAfterTransfer = IERC20(path[0]).balanceOf(address(this));
//            payableTokenReceivedAmount = contractPayableTokenBalanceAfterTransfer - contractPayableTokenBalanceBefore;
//        }
//
//        IERC20(path[0]).safeApprove(router, payableTokenReceivedAmount);
//
//        IUniswapV2Router02(router).swapExactTokensForTokensSupportingFeeOnTransferTokens({
//            amountIn: payableTokenReceivedAmount,
//            amountOutMin: orderUSDAmount + feeStablecoinAmount,
//            path: path,
//            to: address(this),
//            deadline: deadline
//        });
//
//        IERC20(stablecoin).safeTransfer(destination, orderUSDAmount);
//        IERC20(stablecoin).safeTransfer(serviceFeeTreasury, feeStablecoinAmount);
//
//        // send rest of stablecoins to msg.sender
//        {
//            uint256 stablecoinTokenRestAmount = IERC20(path[0]).balanceOf(address(this)) - contractStablecoinBalanceBefore;
//            if (stablecoinTokenRestAmount >= minTokensRestAmountToReturn) {  // do not return dust
//                IERC20(stablecoin).safeTransfer(msg.sender, stablecoinTokenRestAmount);
//            }
//        }
//
//        emit OrderPaid({
//            orderId: orderId,
//            orderUSDAmount: orderUSDAmount,
//            destination: destination,
//            payer: msg.sender,
//            payableToken: path[0],
//            payableTokenAmount: payableTokenReceivedAmount,
//            stablecoin: stablecoin,
//            serviceFeeUSDAmount: feeStablecoinAmount
//        });
//    }

    function paymentETH(
        bytes16 orderId,
        uint256 orderUSDAmount,  // 6 decimals
        address destination,
        uint256 deadline,
        address[] calldata path,
        uint256 minETHRestAmountToReturn
    ) external payable onlyWhitelistedTokenOrAllWhitelisted(path[0]) nonReentrant {
        address stablecoin = path[path.length-1];

        require(destination != address(0), "zero address");
        require(!userPaidOrders[msg.sender][orderId], "order already paid");
        require(isWhitelistedStablecoin(stablecoin), "the end path is not stablecoin");
        userPaidOrders[msg.sender][orderId] = true;

        uint256 feeStablecoinAmount = orderUSDAmount * feeNumerator / FEE_DENOMINATOR;

        _paymentETHProcess(
            orderUSDAmount,  // 6 decimals
            destination,
            deadline,
            path,
            minETHRestAmountToReturn,
            feeStablecoinAmount
        );

        emit OrderPaid({
            orderId: orderId,
            orderUSDAmount: orderUSDAmount,
            destination: destination,
            payer: msg.sender,
            payableToken: address(0),
            payableTokenAmount: msg.value,
            stablecoin: stablecoin,
            serviceFeeUSDAmount: feeStablecoinAmount
        });
    }

    function _paymentETHProcess(
        uint256 orderUSDAmount,  // 6 decimals
        address destination,
        uint256 deadline,
        address[] calldata path,
        uint256 minETHRestAmountToReturn,
        uint256 feeStablecoinAmount
    ) internal {
        uint256 orderUSDAmountERC20DECIMALS = orderUSDAmount * (10 ** stablecoinDecimals[path[path.length-1]]) / (10 ** USD_DECIMALS);
        uint256 feeStablecoinAmountERC20DECIMALS = feeStablecoinAmount * (10 ** stablecoinDecimals[path[path.length-1]]) / (10 ** USD_DECIMALS);
        uint256 totalAmountERC20DECIMALS = orderUSDAmountERC20DECIMALS + feeStablecoinAmountERC20DECIMALS;
        uint256[] memory amounts = IUniswapV2Router02(router).swapETHForExactTokens{value: msg.value}(
            totalAmountERC20DECIMALS,
            path,
            address(this),
            deadline
        );

        // send rest of tokens to msg.sender
        {
            uint256 ethRest = msg.value - amounts[0];
            if (ethRest >= minETHRestAmountToReturn) {
                (bool sent, /*bytes memory data*/) = payable(msg.sender).call{value: ethRest}("");
                require(sent, "Failed to send Ether");
            }
        }

        IERC20(path[path.length-1]).safeTransfer(destination, orderUSDAmountERC20DECIMALS);
        IERC20(path[path.length-1]).safeTransfer(serviceFeeTreasury, feeStablecoinAmountERC20DECIMALS);
    }

    // ==== withdraw occasionally transferred tokens from the contract (or dust)

    fallback() external payable { }  // we need it to receive eth on the contract from uniswap
    
    function withdrawERC20To(IERC20 token, address recipient, uint256 amount) external onlyOwner {
        token.safeTransfer(recipient, amount);
    }

    function withdrawETHTo(address recipient, uint256 amount) external onlyOwner {
        // https://solidity-by-example.org/sending-ether/
        (bool sent, /*bytes memory data*/) = payable(recipient).call{value: amount}("");
        require(sent, "Failed to send Ether");
    }
}

File 2 of 10 : SafeERC20.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "IERC20.sol";
import "Address.sol";

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

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

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

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

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

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

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

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

File 3 of 10 : IERC20.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

File 4 of 10 : Address.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

File 5 of 10 : Ownable.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "Context.sol";

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

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

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

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

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

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

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

    function _setOwner(address newOwner) private {
        address oldOwner = _owner;
        _owner = newOwner;
        emit OwnershipTransferred(oldOwner, newOwner);
    }
}

File 6 of 10 : Context.sol
// SPDX-License-Identifier: MIT

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 7 of 10 : EnumerableSet.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/**
 * @dev Library for managing
 * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive
 * types.
 *
 * Sets have the following properties:
 *
 * - Elements are added, removed, and checked for existence in constant time
 * (O(1)).
 * - Elements are enumerated in O(n). No guarantees are made on the ordering.
 *
 * ```
 * contract Example {
 *     // Add the library methods
 *     using EnumerableSet for EnumerableSet.AddressSet;
 *
 *     // Declare a set state variable
 *     EnumerableSet.AddressSet private mySet;
 * }
 * ```
 *
 * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`)
 * and `uint256` (`UintSet`) are supported.
 */
library EnumerableSet {
    // To implement this library for multiple types with as little code
    // repetition as possible, we write it in terms of a generic Set type with
    // bytes32 values.
    // The Set implementation uses private functions, and user-facing
    // implementations (such as AddressSet) are just wrappers around the
    // underlying Set.
    // This means that we can only create new EnumerableSets for types that fit
    // in bytes32.

    struct Set {
        // Storage of set values
        bytes32[] _values;
        // Position of the value in the `values` array, plus 1 because index 0
        // means a value is not in the set.
        mapping(bytes32 => uint256) _indexes;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function _add(Set storage set, bytes32 value) private returns (bool) {
        if (!_contains(set, value)) {
            set._values.push(value);
            // The value is stored at length-1, but we add 1 to all indexes
            // and use 0 as a sentinel value
            set._indexes[value] = set._values.length;
            return true;
        } else {
            return false;
        }
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function _remove(Set storage set, bytes32 value) private returns (bool) {
        // We read and store the value's index to prevent multiple reads from the same storage slot
        uint256 valueIndex = set._indexes[value];

        if (valueIndex != 0) {
            // Equivalent to contains(set, value)
            // To delete an element from the _values array in O(1), we swap the element to delete with the last one in
            // the array, and then remove the last element (sometimes called as 'swap and pop').
            // This modifies the order of the array, as noted in {at}.

            uint256 toDeleteIndex = valueIndex - 1;
            uint256 lastIndex = set._values.length - 1;

            if (lastIndex != toDeleteIndex) {
                bytes32 lastvalue = set._values[lastIndex];

                // Move the last value to the index where the value to delete is
                set._values[toDeleteIndex] = lastvalue;
                // Update the index for the moved value
                set._indexes[lastvalue] = valueIndex; // Replace lastvalue's index to valueIndex
            }

            // Delete the slot where the moved value was stored
            set._values.pop();

            // Delete the index for the deleted slot
            delete set._indexes[value];

            return true;
        } else {
            return false;
        }
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function _contains(Set storage set, bytes32 value) private view returns (bool) {
        return set._indexes[value] != 0;
    }

    /**
     * @dev Returns the number of values on the set. O(1).
     */
    function _length(Set storage set) private view returns (uint256) {
        return set._values.length;
    }

    /**
     * @dev Returns the value stored at position `index` in the set. O(1).
     *
     * Note that there are no guarantees on the ordering of values inside the
     * array, and it may change when more values are added or removed.
     *
     * Requirements:
     *
     * - `index` must be strictly less than {length}.
     */
    function _at(Set storage set, uint256 index) private view returns (bytes32) {
        return set._values[index];
    }

    /**
     * @dev Return the entire set in an array
     *
     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
     * this function has an unbounded cost, and using it as part of a state-changing function may render the function
     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
     */
    function _values(Set storage set) private view returns (bytes32[] memory) {
        return set._values;
    }

    // Bytes32Set

    struct Bytes32Set {
        Set _inner;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function add(Bytes32Set storage set, bytes32 value) internal returns (bool) {
        return _add(set._inner, value);
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) {
        return _remove(set._inner, value);
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) {
        return _contains(set._inner, value);
    }

    /**
     * @dev Returns the number of values in the set. O(1).
     */
    function length(Bytes32Set storage set) internal view returns (uint256) {
        return _length(set._inner);
    }

    /**
     * @dev Returns the value stored at position `index` in the set. O(1).
     *
     * Note that there are no guarantees on the ordering of values inside the
     * array, and it may change when more values are added or removed.
     *
     * Requirements:
     *
     * - `index` must be strictly less than {length}.
     */
    function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) {
        return _at(set._inner, index);
    }

    /**
     * @dev Return the entire set in an array
     *
     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
     * this function has an unbounded cost, and using it as part of a state-changing function may render the function
     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
     */
    function values(Bytes32Set storage set) internal view returns (bytes32[] memory) {
        return _values(set._inner);
    }

    // AddressSet

    struct AddressSet {
        Set _inner;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function add(AddressSet storage set, address value) internal returns (bool) {
        return _add(set._inner, bytes32(uint256(uint160(value))));
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function remove(AddressSet storage set, address value) internal returns (bool) {
        return _remove(set._inner, bytes32(uint256(uint160(value))));
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function contains(AddressSet storage set, address value) internal view returns (bool) {
        return _contains(set._inner, bytes32(uint256(uint160(value))));
    }

    /**
     * @dev Returns the number of values in the set. O(1).
     */
    function length(AddressSet storage set) internal view returns (uint256) {
        return _length(set._inner);
    }

    /**
     * @dev Returns the value stored at position `index` in the set. O(1).
     *
     * Note that there are no guarantees on the ordering of values inside the
     * array, and it may change when more values are added or removed.
     *
     * Requirements:
     *
     * - `index` must be strictly less than {length}.
     */
    function at(AddressSet storage set, uint256 index) internal view returns (address) {
        return address(uint160(uint256(_at(set._inner, index))));
    }

    /**
     * @dev Return the entire set in an array
     *
     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
     * this function has an unbounded cost, and using it as part of a state-changing function may render the function
     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
     */
    function values(AddressSet storage set) internal view returns (address[] memory) {
        bytes32[] memory store = _values(set._inner);
        address[] memory result;

        assembly {
            result := store
        }

        return result;
    }

    // UintSet

    struct UintSet {
        Set _inner;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function add(UintSet storage set, uint256 value) internal returns (bool) {
        return _add(set._inner, bytes32(value));
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function remove(UintSet storage set, uint256 value) internal returns (bool) {
        return _remove(set._inner, bytes32(value));
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function contains(UintSet storage set, uint256 value) internal view returns (bool) {
        return _contains(set._inner, bytes32(value));
    }

    /**
     * @dev Returns the number of values on the set. O(1).
     */
    function length(UintSet storage set) internal view returns (uint256) {
        return _length(set._inner);
    }

    /**
     * @dev Returns the value stored at position `index` in the set. O(1).
     *
     * Note that there are no guarantees on the ordering of values inside the
     * array, and it may change when more values are added or removed.
     *
     * Requirements:
     *
     * - `index` must be strictly less than {length}.
     */
    function at(UintSet storage set, uint256 index) internal view returns (uint256) {
        return uint256(_at(set._inner, index));
    }

    /**
     * @dev Return the entire set in an array
     *
     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
     * this function has an unbounded cost, and using it as part of a state-changing function may render the function
     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
     */
    function values(UintSet storage set) internal view returns (uint256[] memory) {
        bytes32[] memory store = _values(set._inner);
        uint256[] memory result;

        assembly {
            result := store
        }

        return result;
    }
}

File 8 of 10 : ReentrancyGuard.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

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

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

    uint256 private _status;

    constructor() {
        _status = _NOT_ENTERED;
    }

    /**
     * @dev Prevents a contract from calling itself, directly or indirectly.
     * Calling a `nonReentrant` function from another `nonReentrant`
     * function is not supported. It is possible to prevent this from happening
     * by making the `nonReentrant` function external, and make it call a
     * `private` function that does the actual work.
     */
    modifier nonReentrant() {
        // On the first call to nonReentrant, _notEntered will be true
        require(_status != _ENTERED, "ReentrancyGuard: reentrant call");

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

        _;

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

File 9 of 10 : 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 10 of 10 : 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
{
  "evmVersion": "istanbul",
  "optimizer": {
    "enabled": true,
    "runs": 200
  },
  "libraries": {
    "BridgeLeft.sol": {}
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  }
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"routerAddress","type":"address"},{"internalType":"address","name":"serviceFeeTreasuryAddress","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes16","name":"orderId","type":"bytes16"},{"indexed":false,"internalType":"uint256","name":"orderUSDAmount","type":"uint256"},{"indexed":false,"internalType":"address","name":"destination","type":"address"},{"indexed":false,"internalType":"address","name":"payer","type":"address"},{"indexed":false,"internalType":"address","name":"payableToken","type":"address"},{"indexed":false,"internalType":"uint256","name":"payableTokenAmount","type":"uint256"},{"indexed":false,"internalType":"address","name":"stablecoin","type":"address"},{"indexed":false,"internalType":"uint256","name":"serviceFeeUSDAmount","type":"uint256"}],"name":"OrderPaid","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"value","type":"address"}],"name":"ServiceFeeTreasurySet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"token","type":"address"}],"name":"TokenAddedToWhitelist","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"decimals","type":"uint256"}],"name":"TokenAddedToWhitelistStablecoins","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"token","type":"address"}],"name":"TokenRemovedFromWhitelist","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"token","type":"address"}],"name":"TokenRemovedFromWhitelistStablecoins","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bool","name":"value","type":"bool"}],"name":"WhitelistAllTokensSet","type":"event"},{"stateMutability":"payable","type":"fallback"},{"inputs":[],"name":"FEE_DENOMINATOR","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"USD_DECIMALS","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"addTokenToWhitelist","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"decimals","type":"uint256"}],"name":"addTokenToWhitelistStablecoins","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"orderUSDAmount","type":"uint256"}],"name":"estimateFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"orderUSDAmount","type":"uint256"},{"internalType":"address[]","name":"path","type":"address[]"}],"name":"estimatePayableTokenAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"feeNumerator","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getWhitelistedStablecoins","outputs":[{"internalType":"address[]","name":"","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getWhitelistedTokens","outputs":[{"internalType":"address[]","name":"","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"isTokenWhitelisted","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"isWhitelistedStablecoin","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes16","name":"orderId","type":"bytes16"},{"internalType":"uint256","name":"orderUSDAmount","type":"uint256"},{"internalType":"address","name":"destination","type":"address"},{"internalType":"uint256","name":"payableTokenMaxAmount","type":"uint256"},{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"address[]","name":"path","type":"address[]"}],"name":"paymentERC20","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes16","name":"orderId","type":"bytes16"},{"internalType":"uint256","name":"orderUSDAmount","type":"uint256"},{"internalType":"address","name":"destination","type":"address"},{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"address[]","name":"path","type":"address[]"},{"internalType":"uint256","name":"minETHRestAmountToReturn","type":"uint256"}],"name":"paymentETH","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"bytes16","name":"orderId","type":"bytes16"},{"internalType":"uint256","name":"orderUSDAmount","type":"uint256"},{"internalType":"address","name":"destination","type":"address"},{"internalType":"address","name":"stablecoin","type":"address"}],"name":"paymentStablecoin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"removeTokenFromWhitelist","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"removeTokenFromWhitelistStablecoins","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"router","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"serviceFeeTreasury","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"newFeeNumerator","type":"uint256"}],"name":"setFeeNumerator","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"serviceFeeTreasuryAddress","type":"address"}],"name":"setServiceFeeTreasury","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"value","type":"bool"}],"name":"setWhitelistAllTokens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"stablecoinDecimals","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"bytes16","name":"","type":"bytes16"}],"name":"userPaidOrders","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"whitelistAllTokens","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"token","type":"address"},{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"withdrawERC20To","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"withdrawETHTo","outputs":[],"stateMutability":"nonpayable","type":"function"}]

60a060405262000012606460056200016f565b6002553480156200002257600080fd5b5060405162002e0038038062002e008339810160408190526200004591620001ba565b62000050336200011f565b600180556001600160a01b0382166200009f5760405162461bcd60e51b815260206004820152600c60248201526b7a65726f206164647265737360a01b60448201526064015b60405180910390fd5b6001600160601b0319606083901b166080526001600160a01b038116620000f85760405162461bcd60e51b815260206004820152600c60248201526b7a65726f206164647265737360a01b604482015260640162000096565b600380546001600160a01b0319166001600160a01b039290921691909117905550620001f2565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60008160001904831182151516156200019857634e487b7160e01b600052601160045260246000fd5b500290565b80516001600160a01b0381168114620001b557600080fd5b919050565b60008060408385031215620001ce57600080fd5b620001d9836200019d565b9150620001e9602084016200019d565b90509250929050565b60805160601c612bcc620002346000396000818161056201528181610e4401528181610f8c01528181610fe6015281816113d10152611bbd0152612bcc6000f3fe6080604052600436106101ad5760003560e01c80638da5cb5b116100eb578063d21a74ff1161008f578063e26f790011610061578063e26f790014610505578063e86dea4a1461051a578063f2fde38b14610530578063f887ea401461055057005b8063d21a74ff14610483578063d73792a9146104b0578063d84c1b38146104c5578063dfe5ba38146104e557005b8063a45db911116100c8578063a45db91114610403578063ac6af06814610423578063ae50c22914610443578063b5af090f1461046357005b80638da5cb5b146103a557806390a2450b146103c35780639ee765c4146103e357005b8063614264b911610152578063715018a61161012f578063715018a61461033d57806374f823ec14610352578063871e530e14610372578063877c6bf21461038557005b8063614264b9146102aa578063697b894a146102e25780636cd5bc441461030257005b80632f6ee6951161018b5780632f6ee69514610235578063306275be1461024a5780634f12abeb1461026a5780635f97d5261461028a57005b8063127e8e4d146101af578063137f9d5a146101e25780632707f76b14610204575b005b3480156101bb57600080fd5b506101cf6101ca366004612295565b610584565b6040519081526020015b60405180910390f35b3480156101ee57600080fd5b506101f76105ae565b6040516101d991906122ae565b34801561021057600080fd5b5060035461022590600160a01b900460ff1681565b60405190151581526020016101d9565b34801561024157600080fd5b506101cf600681565b34801561025657600080fd5b506101ad610265366004612310565b61065c565b34801561027657600080fd5b506101ad61028536600461233b565b6106ed565b34801561029657600080fd5b506101ad6102a5366004612310565b61076f565b3480156102b657600080fd5b506003546102ca906001600160a01b031681565b6040516001600160a01b0390911681526020016101d9565b3480156102ee57600080fd5b506101ad6102fd366004612358565b610834565b34801561030e57600080fd5b5061022561031d3660046123a1565b600960209081526000928352604080842090915290825290205460ff1681565b34801561034957600080fd5b506101ad6108fd565b34801561035e57600080fd5b506101ad61036d3660046123d6565b610933565b6101ad610380366004612463565b610971565b34801561039157600080fd5b506102256103a0366004612310565b610b7c565b3480156103b157600080fd5b506000546001600160a01b03166102ca565b3480156103cf57600080fd5b506101ad6103de3660046124e6565b610b89565b3480156103ef57600080fd5b506101ad6103fe366004612310565b6111a4565b34801561040f57600080fd5b506101ad61041e366004612295565b61123e565b34801561042f57600080fd5b506101cf61043e36600461256a565b6112bf565b34801561044f57600080fd5b506101ad61045e3660046125b6565b61149c565b34801561046f57600080fd5b5061022561047e366004612310565b6116c3565b34801561048f57600080fd5b506101cf61049e366004612310565b60086020526000908152604090205481565b3480156104bc57600080fd5b506101cf6116d0565b3480156104d157600080fd5b506101ad6104e0366004612310565b6116de565b3480156104f157600080fd5b506101ad610500366004612358565b61178c565b34801561051157600080fd5b506101f7611866565b34801561052657600080fd5b506101cf60025481565b34801561053c57600080fd5b506101ad61054b366004612310565b61190d565b34801561055c57600080fd5b506102ca7f000000000000000000000000000000000000000000000000000000000000000081565b600061059160648061261d565b60025461059e908461261d565b6105a8919061263c565b92915050565b606060006105bc60066119a8565b905060008167ffffffffffffffff8111156105d9576105d961265e565b604051908082528060200260200182016040528015610602578160200160208202803683370190505b50905060005b828110156106555761061b6006826119b2565b82828151811061062d5761062d612674565b6001600160a01b039092166020928302919091019091015261064e8161268a565b9050610608565b5092915050565b6000546001600160a01b0316331461068f5760405162461bcd60e51b8152600401610686906126a5565b60405180910390fd5b61069a6004826119c5565b6106b65760405162461bcd60e51b8152600401610686906126da565b6040516001600160a01b038216907fdd2e6d9f52cbe8f695939d018b7d4a216dc613a669876163ac548b916489d91790600090a250565b6000546001600160a01b031633146107175760405162461bcd60e51b8152600401610686906126a5565b60038054821515600160a01b0260ff60a01b199091161790556040517fa25676aca3b540ad0666287c6b940b42b950a0636b38219a49675c3e342a4cc09061076490831515815260200190565b60405180910390a150565b6000546001600160a01b031633146107995760405162461bcd60e51b8152600401610686906126a5565b6107a46006826119c5565b6107f05760405162461bcd60e51b815260206004820152601a60248201527f6e6f742077686974656c697374656420737461626c65636f696e0000000000006044820152606401610686565b6001600160a01b038116600081815260086020526040808220829055517f5796fc45b6039532c1497312d234bb1b272f8efc383f7f6b1fd7f9ce8b97d8219190a250565b6000546001600160a01b0316331461085e5760405162461bcd60e51b8152600401610686906126a5565b6000826001600160a01b03168260405160006040518083038185875af1925050503d80600081146108ab576040519150601f19603f3d011682016040523d82523d6000602084013e6108b0565b606091505b50509050806108f85760405162461bcd60e51b81526020600482015260146024820152732330b4b632b2103a379039b2b7321022ba3432b960611b6044820152606401610686565b505050565b6000546001600160a01b031633146109275760405162461bcd60e51b8152600401610686906126a5565b61093160006119da565b565b6000546001600160a01b0316331461095d5760405162461bcd60e51b8152600401610686906126a5565b6108f86001600160a01b0384168383611a2a565b8282600081811061098457610984612674565b90506020020160208101906109999190612310565b600354600160a01b900460ff16806109b757506109b7600482611a8d565b6109d35760405162461bcd60e51b8152600401610686906126da565b600260015414156109f65760405162461bcd60e51b815260040161068690612703565b6002600190815560009085908590610a0e908261273a565b818110610a1d57610a1d612674565b9050602002016020810190610a329190612310565b90506001600160a01b038716610a5a5760405162461bcd60e51b815260040161068690612751565b3360009081526009602090815260408083206001600160801b03198d16845290915290205460ff1615610a9f5760405162461bcd60e51b815260040161068690612777565b610aa881610b7c565b610ac45760405162461bcd60e51b8152600401610686906127a3565b3360009081526009602090815260408083206001600160801b03198d1684529091528120805460ff19166001179055610afe60648061261d565b600254610b0b908b61261d565b610b15919061263c565b9050610b2689898989898987611aaf565b7fa852c7c55996f8cebef42cd65025e93f32068a525dda35dac57df54f4150a57b8a8a8a336000348888604051610b649897969594939291906127da565b60405180910390a15050600180555050505050505050565b60006105a8600683611a8d565b81816000818110610b9c57610b9c612674565b9050602002016020810190610bb19190612310565b600354600160a01b900460ff1680610bcf5750610bcf600482611a8d565b610beb5760405162461bcd60e51b8152600401610686906126da565b60026001541415610c0e5760405162461bcd60e51b815260040161068690612703565b60026001556001600160a01b038616610c395760405162461bcd60e51b815260040161068690612751565b3360009081526009602090815260408083206001600160801b03198c16845290915290205460ff1615610c7e5760405162461bcd60e51b815260040161068690612777565b610cb28383610c8e60018261273a565b818110610c9d57610c9d612674565b90506020020160208101906103a09190612310565b610cce5760405162461bcd60e51b8152600401610686906127a3565b3360009081526009602090815260408083206001600160801b03198c1684529091528120805460ff19166001179055610d096006600a61290c565b600860008686610d1a60018261273a565b818110610d2957610d29612674565b9050602002016020810190610d3e9190612310565b6001600160a01b03168152602081019190915260400160002054610d6390600a61290c565b610d6d908a61261d565b610d77919061263c565b90506000610d8660648061261d565b600254610d93908b61261d565b610d9d919061263c565b9050600080610dae6006600a61290c565b600860008989610dbf60018261273a565b818110610dce57610dce612674565b9050602002016020810190610de39190612310565b6001600160a01b03168152602081019190915260400160002054610e0890600a61290c565b610e12908561261d565b610e1c919061263c565b90506000610e2a8286612918565b6040516307c0329d60e21b81529091506001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001690631f00ca7490610e7d9084908c908c90600401612979565b60006040518083038186803b158015610e9557600080fd5b505afa158015610ea9573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610ed1919081019061299c565b600081518110610ee357610ee3612674565b6020026020010151925089831115610f485760405162461bcd60e51b815260206004820152602260248201527f696e73756666696369656e742070617961626c65546f6b656e4d6178416d6f756044820152611b9d60f21b6064820152608401610686565b610f873330858b8b6000818110610f6157610f61612674565b9050602002016020810190610f769190612310565b6001600160a01b0316929190611d68565b610fe47f0000000000000000000000000000000000000000000000000000000000000000848a8a6000818110610fbf57610fbf612674565b9050602002016020810190610fd49190612310565b6001600160a01b03169190611da6565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166338ed173984838b8b308f6040518763ffffffff1660e01b815260040161103a96959493929190612a5a565b600060405180830381600087803b15801561105457600080fd5b505af1158015611068573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052611090919081019061299c565b506110d78b868a8a6110a360018261273a565b8181106110b2576110b2612674565b90506020020160208101906110c79190612310565b6001600160a01b03169190611a2a565b6003546110f5906001600160a01b0316838a8a6110a360018261273a565b50507fa852c7c55996f8cebef42cd65025e93f32068a525dda35dac57df54f4150a57b8b8b8b338a8a600081811061112f5761112f612674565b90506020020160208101906111449190612310565b868c8c61115260018261273a565b81811061116157611161612674565b90506020020160208101906111769190612310565b8960405161118b9897969594939291906127da565b60405180910390a1505060018055505050505050505050565b6000546001600160a01b031633146111ce5760405162461bcd60e51b8152600401610686906126a5565b6001600160a01b0381166111f45760405162461bcd60e51b815260040161068690612751565b600380546001600160a01b0319166001600160a01b0383169081179091556040517f7fd76a984c1d5873adea6a1da2c0686aca1a38e0740a4ac4e8ec49211310885690600090a250565b6000546001600160a01b031633146112685760405162461bcd60e51b8152600401610686906126a5565b6103e88111156112ba5760405162461bcd60e51b815260206004820152601760248201527f4d617820666565206e756d657261746f723a20313030300000000000000000006044820152606401610686565b600255565b6000828260008181106112d4576112d4612674565b90506020020160208101906112e99190612310565b600354600160a01b900460ff16806113075750611307600482611a8d565b6113235760405162461bcd60e51b8152600401610686906126da565b6113338484610c8e60018261273a565b61134f5760405162461bcd60e51b8152600401610686906127a3565b600061135d6006600a61290c565b60086000878761136e60018261273a565b81811061137d5761137d612674565b90506020020160208101906113929190612310565b6001600160a01b031681526020810191909152604001600020546113b790600a61290c565b6113c1908861261d565b6113cb919061263c565b905060007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316631f00ca748388886040518463ffffffff1660e01b815260040161141f93929190612979565b60006040518083038186803b15801561143757600080fd5b505afa15801561144b573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052611473919081019061299c565b90508060008151811061148857611488612674565b602002602001015193505050509392505050565b600260015414156114bf5760405162461bcd60e51b815260040161068690612703565b60026001556001600160a01b0382166114ea5760405162461bcd60e51b815260040161068690612751565b3360009081526009602090815260408083206001600160801b03198816845290915290205460ff161561152f5760405162461bcd60e51b815260040161068690612777565b61153881610b7c565b6115545760405162461bcd60e51b8152600401610686906127a3565b3360009081526009602090815260408083206001600160801b0319881684529091528120805460ff1916600117905561158f6006600a61290c565b6001600160a01b0383166000908152600860205260409020546115b390600a61290c565b6115bd908661261d565b6115c7919061263c565b905060006115d660648061261d565b6002546115e3908761261d565b6115ed919061263c565b905060006115fd6006600a61290c565b6001600160a01b03851660009081526008602052604090205461162190600a61290c565b61162b908461261d565b611635919061263c565b905061164c6001600160a01b038516338786611d68565b600354611668906001600160a01b038681169133911684611d68565b7fa852c7c55996f8cebef42cd65025e93f32068a525dda35dac57df54f4150a57b8787873388611698878a612918565b8a896040516116ae9897969594939291906127da565b60405180910390a15050600180555050505050565b60006105a8600483611a8d565b6116db60648061261d565b81565b6000546001600160a01b031633146117085760405162461bcd60e51b8152600401610686906126a5565b611713600482611eca565b6117555760405162461bcd60e51b8152602060048201526013602482015272185b1c9958591e481dda1a5d195b1a5cdd1959606a1b6044820152606401610686565b6040516001600160a01b038216907fa718ddb71589521cab00fa313e3bd14e75ca7204d57a12ff3a5aa40796f3427690600090a250565b6000546001600160a01b031633146117b65760405162461bcd60e51b8152600401610686906126a5565b6117c1600683611eca565b61180d5760405162461bcd60e51b815260206004820152601e60248201527f616c72656164792077686974656c697374656420737461626c65636f696e00006044820152606401610686565b6001600160a01b03821660008181526008602052604090819020839055517f16a657417be9e0af4ad015f790bb3c085d977ab22b042891c7d2d7016acdb0b39061185a9084815260200190565b60405180910390a25050565b6060600061187460046119a8565b905060008167ffffffffffffffff8111156118915761189161265e565b6040519080825280602002602001820160405280156118ba578160200160208202803683370190505b50905060005b82811015610655576118d36004826119b2565b8282815181106118e5576118e5612674565b6001600160a01b03909216602092830291909101909101526119068161268a565b90506118c0565b6000546001600160a01b031633146119375760405162461bcd60e51b8152600401610686906126a5565b6001600160a01b03811661199c5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610686565b6119a5816119da565b50565b60006105a8825490565b60006119be8383611edf565b9392505050565b60006119be836001600160a01b038416611f09565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6040516001600160a01b0383166024820152604481018290526108f890849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152611ffc565b6001600160a01b038116600090815260018301602052604081205415156119be565b6000611abd6006600a61290c565b600860008787611ace60018261273a565b818110611add57611add612674565b9050602002016020810190611af29190612310565b6001600160a01b03168152602081019190915260400160002054611b1790600a61290c565b611b21908a61261d565b611b2b919061263c565b90506000611b3b6006600a61290c565b600860008888611b4c60018261273a565b818110611b5b57611b5b612674565b9050602002016020810190611b709190612310565b6001600160a01b03168152602081019190915260400160002054611b9590600a61290c565b611b9f908561261d565b611ba9919061263c565b90506000611bb78284612918565b905060007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663fb3bdb4134848b8b308f6040518763ffffffff1660e01b8152600401611c10959493929190612a98565b6000604051808303818588803b158015611c2957600080fd5b505af1158015611c3d573d6000803e3d6000fd5b50505050506040513d6000823e601f3d908101601f19168201604052611c66919081019061299c565b9050600081600081518110611c7d57611c7d612674565b602002602001015134611c90919061273a565b9050868110611d2a57604051600090339083908381818185875af1925050503d8060008114611cdb576040519150601f19603f3d011682016040523d82523d6000602084013e611ce0565b606091505b5050905080611d285760405162461bcd60e51b81526020600482015260146024820152732330b4b632b2103a379039b2b7321022ba3432b960611b6044820152606401610686565b505b50611d3d8a858a8a6110a360018261273a565b600354611d5b906001600160a01b0316848a8a6110a360018261273a565b5050505050505050505050565b6040516001600160a01b0380851660248301528316604482015260648101829052611da09085906323b872dd60e01b90608401611a56565b50505050565b801580611e2f5750604051636eb1769f60e11b81523060048201526001600160a01b03838116602483015284169063dd62ed3e9060440160206040518083038186803b158015611df557600080fd5b505afa158015611e09573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e2d9190612acf565b155b611e9a5760405162461bcd60e51b815260206004820152603660248201527f5361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f60448201527520746f206e6f6e2d7a65726f20616c6c6f77616e636560501b6064820152608401610686565b6040516001600160a01b0383166024820152604481018290526108f890849063095ea7b360e01b90606401611a56565b60006119be836001600160a01b0384166120ce565b6000826000018281548110611ef657611ef6612674565b9060005260206000200154905092915050565b60008181526001830160205260408120548015611ff2576000611f2d60018361273a565b8554909150600090611f419060019061273a565b9050818114611fa6576000866000018281548110611f6157611f61612674565b9060005260206000200154905080876000018481548110611f8457611f84612674565b6000918252602080832090910192909255918252600188019052604090208390555b8554869080611fb757611fb7612ae8565b6001900381819060005260206000200160009055905585600101600086815260200190815260200160002060009055600193505050506105a8565b60009150506105a8565b6000612051826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b031661211d9092919063ffffffff16565b8051909150156108f8578080602001905181019061206f9190612afe565b6108f85760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610686565b6000818152600183016020526040812054612115575081546001818101845560008481526020808220909301849055845484825282860190935260409020919091556105a8565b5060006105a8565b606061212c8484600085612134565b949350505050565b6060824710156121955760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b6064820152608401610686565b843b6121e35760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610686565b600080866001600160a01b031685876040516121ff9190612b47565b60006040518083038185875af1925050503d806000811461223c576040519150601f19603f3d011682016040523d82523d6000602084013e612241565b606091505b509150915061225182828661225c565b979650505050505050565b6060831561226b5750816119be565b82511561227b5782518084602001fd5b8160405162461bcd60e51b81526004016106869190612b63565b6000602082840312156122a757600080fd5b5035919050565b6020808252825182820181905260009190848201906040850190845b818110156122ef5783516001600160a01b0316835292840192918401916001016122ca565b50909695505050505050565b6001600160a01b03811681146119a557600080fd5b60006020828403121561232257600080fd5b81356119be816122fb565b80151581146119a557600080fd5b60006020828403121561234d57600080fd5b81356119be8161232d565b6000806040838503121561236b57600080fd5b8235612376816122fb565b946020939093013593505050565b80356001600160801b03198116811461239c57600080fd5b919050565b600080604083850312156123b457600080fd5b82356123bf816122fb565b91506123cd60208401612384565b90509250929050565b6000806000606084860312156123eb57600080fd5b83356123f6816122fb565b92506020840135612406816122fb565b929592945050506040919091013590565b60008083601f84011261242957600080fd5b50813567ffffffffffffffff81111561244157600080fd5b6020830191508360208260051b850101111561245c57600080fd5b9250929050565b600080600080600080600060c0888a03121561247e57600080fd5b61248788612384565b965060208801359550604088013561249e816122fb565b945060608801359350608088013567ffffffffffffffff8111156124c157600080fd5b6124cd8a828b01612417565b989b979a5095989497959660a090950135949350505050565b600080600080600080600060c0888a03121561250157600080fd5b61250a88612384565b9650602088013595506040880135612521816122fb565b9450606088013593506080880135925060a088013567ffffffffffffffff81111561254b57600080fd5b6125578a828b01612417565b989b979a50959850939692959293505050565b60008060006040848603121561257f57600080fd5b83359250602084013567ffffffffffffffff81111561259d57600080fd5b6125a986828701612417565b9497909650939450505050565b600080600080608085870312156125cc57600080fd5b6125d585612384565b93506020850135925060408501356125ec816122fb565b915060608501356125fc816122fb565b939692955090935050565b634e487b7160e01b600052601160045260246000fd5b600081600019048311821515161561263757612637612607565b500290565b60008261265957634e487b7160e01b600052601260045260246000fd5b500490565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b600060001982141561269e5761269e612607565b5060010190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6020808252600f908201526e1b9bdd081dda1a5d195b1a5cdd1959608a1b604082015260600190565b6020808252601f908201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604082015260600190565b60008282101561274c5761274c612607565b500390565b6020808252600c908201526b7a65726f206164647265737360a01b604082015260600190565b6020808252601290820152711bdc99195c88185b1c9958591e481c185a5960721b604082015260600190565b6020808252601e908201527f74686520656e642070617468206973206e6f7420737461626c65636f696e0000604082015260600190565b6001600160801b031998909816885260208801969096526001600160a01b0394851660408801529284166060870152908316608086015260a08501521660c083015260e08201526101000190565b600181815b8085111561286357816000190482111561284957612849612607565b8085161561285657918102915b93841c939080029061282d565b509250929050565b60008261287a575060016105a8565b81612887575060006105a8565b816001811461289d57600281146128a7576128c3565b60019150506105a8565b60ff8411156128b8576128b8612607565b50506001821b6105a8565b5060208310610133831016604e8410600b84101617156128e6575081810a6105a8565b6128f08383612828565b806000190482111561290457612904612607565b029392505050565b60006119be838361286b565b6000821982111561292b5761292b612607565b500190565b8183526000602080850194508260005b8581101561296e578135612953816122fb565b6001600160a01b031687529582019590820190600101612940565b509495945050505050565b838152604060208201526000612993604083018486612930565b95945050505050565b600060208083850312156129af57600080fd5b825167ffffffffffffffff808211156129c757600080fd5b818501915085601f8301126129db57600080fd5b8151818111156129ed576129ed61265e565b8060051b604051601f19603f83011681018181108582111715612a1257612a1261265e565b604052918252848201925083810185019188831115612a3057600080fd5b938501935b82851015612a4e57845184529385019392850192612a35565b98975050505050505050565b86815285602082015260a060408201526000612a7a60a083018688612930565b6001600160a01b039490941660608301525060800152949350505050565b858152608060208201526000612ab2608083018688612930565b6001600160a01b0394909416604083015250606001529392505050565b600060208284031215612ae157600080fd5b5051919050565b634e487b7160e01b600052603160045260246000fd5b600060208284031215612b1057600080fd5b81516119be8161232d565b60005b83811015612b36578181015183820152602001612b1e565b83811115611da05750506000910152565b60008251612b59818460208701612b1b565b9190910192915050565b6020815260008251806020840152612b82816040850160208701612b1b565b601f01601f1916919091016040019291505056fea2646970667358221220268433bbbf0b36d512647bd2085ec19cc51ccec2ad43d0a10b5775b60a7a67ef64736f6c634300080800330000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d0000000000000000000000003ccb0f1f6cc0709f491a2d25b4fbca5fe78870e8

Deployed Bytecode

0x6080604052600436106101ad5760003560e01c80638da5cb5b116100eb578063d21a74ff1161008f578063e26f790011610061578063e26f790014610505578063e86dea4a1461051a578063f2fde38b14610530578063f887ea401461055057005b8063d21a74ff14610483578063d73792a9146104b0578063d84c1b38146104c5578063dfe5ba38146104e557005b8063a45db911116100c8578063a45db91114610403578063ac6af06814610423578063ae50c22914610443578063b5af090f1461046357005b80638da5cb5b146103a557806390a2450b146103c35780639ee765c4146103e357005b8063614264b911610152578063715018a61161012f578063715018a61461033d57806374f823ec14610352578063871e530e14610372578063877c6bf21461038557005b8063614264b9146102aa578063697b894a146102e25780636cd5bc441461030257005b80632f6ee6951161018b5780632f6ee69514610235578063306275be1461024a5780634f12abeb1461026a5780635f97d5261461028a57005b8063127e8e4d146101af578063137f9d5a146101e25780632707f76b14610204575b005b3480156101bb57600080fd5b506101cf6101ca366004612295565b610584565b6040519081526020015b60405180910390f35b3480156101ee57600080fd5b506101f76105ae565b6040516101d991906122ae565b34801561021057600080fd5b5060035461022590600160a01b900460ff1681565b60405190151581526020016101d9565b34801561024157600080fd5b506101cf600681565b34801561025657600080fd5b506101ad610265366004612310565b61065c565b34801561027657600080fd5b506101ad61028536600461233b565b6106ed565b34801561029657600080fd5b506101ad6102a5366004612310565b61076f565b3480156102b657600080fd5b506003546102ca906001600160a01b031681565b6040516001600160a01b0390911681526020016101d9565b3480156102ee57600080fd5b506101ad6102fd366004612358565b610834565b34801561030e57600080fd5b5061022561031d3660046123a1565b600960209081526000928352604080842090915290825290205460ff1681565b34801561034957600080fd5b506101ad6108fd565b34801561035e57600080fd5b506101ad61036d3660046123d6565b610933565b6101ad610380366004612463565b610971565b34801561039157600080fd5b506102256103a0366004612310565b610b7c565b3480156103b157600080fd5b506000546001600160a01b03166102ca565b3480156103cf57600080fd5b506101ad6103de3660046124e6565b610b89565b3480156103ef57600080fd5b506101ad6103fe366004612310565b6111a4565b34801561040f57600080fd5b506101ad61041e366004612295565b61123e565b34801561042f57600080fd5b506101cf61043e36600461256a565b6112bf565b34801561044f57600080fd5b506101ad61045e3660046125b6565b61149c565b34801561046f57600080fd5b5061022561047e366004612310565b6116c3565b34801561048f57600080fd5b506101cf61049e366004612310565b60086020526000908152604090205481565b3480156104bc57600080fd5b506101cf6116d0565b3480156104d157600080fd5b506101ad6104e0366004612310565b6116de565b3480156104f157600080fd5b506101ad610500366004612358565b61178c565b34801561051157600080fd5b506101f7611866565b34801561052657600080fd5b506101cf60025481565b34801561053c57600080fd5b506101ad61054b366004612310565b61190d565b34801561055c57600080fd5b506102ca7f0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d81565b600061059160648061261d565b60025461059e908461261d565b6105a8919061263c565b92915050565b606060006105bc60066119a8565b905060008167ffffffffffffffff8111156105d9576105d961265e565b604051908082528060200260200182016040528015610602578160200160208202803683370190505b50905060005b828110156106555761061b6006826119b2565b82828151811061062d5761062d612674565b6001600160a01b039092166020928302919091019091015261064e8161268a565b9050610608565b5092915050565b6000546001600160a01b0316331461068f5760405162461bcd60e51b8152600401610686906126a5565b60405180910390fd5b61069a6004826119c5565b6106b65760405162461bcd60e51b8152600401610686906126da565b6040516001600160a01b038216907fdd2e6d9f52cbe8f695939d018b7d4a216dc613a669876163ac548b916489d91790600090a250565b6000546001600160a01b031633146107175760405162461bcd60e51b8152600401610686906126a5565b60038054821515600160a01b0260ff60a01b199091161790556040517fa25676aca3b540ad0666287c6b940b42b950a0636b38219a49675c3e342a4cc09061076490831515815260200190565b60405180910390a150565b6000546001600160a01b031633146107995760405162461bcd60e51b8152600401610686906126a5565b6107a46006826119c5565b6107f05760405162461bcd60e51b815260206004820152601a60248201527f6e6f742077686974656c697374656420737461626c65636f696e0000000000006044820152606401610686565b6001600160a01b038116600081815260086020526040808220829055517f5796fc45b6039532c1497312d234bb1b272f8efc383f7f6b1fd7f9ce8b97d8219190a250565b6000546001600160a01b0316331461085e5760405162461bcd60e51b8152600401610686906126a5565b6000826001600160a01b03168260405160006040518083038185875af1925050503d80600081146108ab576040519150601f19603f3d011682016040523d82523d6000602084013e6108b0565b606091505b50509050806108f85760405162461bcd60e51b81526020600482015260146024820152732330b4b632b2103a379039b2b7321022ba3432b960611b6044820152606401610686565b505050565b6000546001600160a01b031633146109275760405162461bcd60e51b8152600401610686906126a5565b61093160006119da565b565b6000546001600160a01b0316331461095d5760405162461bcd60e51b8152600401610686906126a5565b6108f86001600160a01b0384168383611a2a565b8282600081811061098457610984612674565b90506020020160208101906109999190612310565b600354600160a01b900460ff16806109b757506109b7600482611a8d565b6109d35760405162461bcd60e51b8152600401610686906126da565b600260015414156109f65760405162461bcd60e51b815260040161068690612703565b6002600190815560009085908590610a0e908261273a565b818110610a1d57610a1d612674565b9050602002016020810190610a329190612310565b90506001600160a01b038716610a5a5760405162461bcd60e51b815260040161068690612751565b3360009081526009602090815260408083206001600160801b03198d16845290915290205460ff1615610a9f5760405162461bcd60e51b815260040161068690612777565b610aa881610b7c565b610ac45760405162461bcd60e51b8152600401610686906127a3565b3360009081526009602090815260408083206001600160801b03198d1684529091528120805460ff19166001179055610afe60648061261d565b600254610b0b908b61261d565b610b15919061263c565b9050610b2689898989898987611aaf565b7fa852c7c55996f8cebef42cd65025e93f32068a525dda35dac57df54f4150a57b8a8a8a336000348888604051610b649897969594939291906127da565b60405180910390a15050600180555050505050505050565b60006105a8600683611a8d565b81816000818110610b9c57610b9c612674565b9050602002016020810190610bb19190612310565b600354600160a01b900460ff1680610bcf5750610bcf600482611a8d565b610beb5760405162461bcd60e51b8152600401610686906126da565b60026001541415610c0e5760405162461bcd60e51b815260040161068690612703565b60026001556001600160a01b038616610c395760405162461bcd60e51b815260040161068690612751565b3360009081526009602090815260408083206001600160801b03198c16845290915290205460ff1615610c7e5760405162461bcd60e51b815260040161068690612777565b610cb28383610c8e60018261273a565b818110610c9d57610c9d612674565b90506020020160208101906103a09190612310565b610cce5760405162461bcd60e51b8152600401610686906127a3565b3360009081526009602090815260408083206001600160801b03198c1684529091528120805460ff19166001179055610d096006600a61290c565b600860008686610d1a60018261273a565b818110610d2957610d29612674565b9050602002016020810190610d3e9190612310565b6001600160a01b03168152602081019190915260400160002054610d6390600a61290c565b610d6d908a61261d565b610d77919061263c565b90506000610d8660648061261d565b600254610d93908b61261d565b610d9d919061263c565b9050600080610dae6006600a61290c565b600860008989610dbf60018261273a565b818110610dce57610dce612674565b9050602002016020810190610de39190612310565b6001600160a01b03168152602081019190915260400160002054610e0890600a61290c565b610e12908561261d565b610e1c919061263c565b90506000610e2a8286612918565b6040516307c0329d60e21b81529091506001600160a01b037f0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d1690631f00ca7490610e7d9084908c908c90600401612979565b60006040518083038186803b158015610e9557600080fd5b505afa158015610ea9573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610ed1919081019061299c565b600081518110610ee357610ee3612674565b6020026020010151925089831115610f485760405162461bcd60e51b815260206004820152602260248201527f696e73756666696369656e742070617961626c65546f6b656e4d6178416d6f756044820152611b9d60f21b6064820152608401610686565b610f873330858b8b6000818110610f6157610f61612674565b9050602002016020810190610f769190612310565b6001600160a01b0316929190611d68565b610fe47f0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d848a8a6000818110610fbf57610fbf612674565b9050602002016020810190610fd49190612310565b6001600160a01b03169190611da6565b7f0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d6001600160a01b03166338ed173984838b8b308f6040518763ffffffff1660e01b815260040161103a96959493929190612a5a565b600060405180830381600087803b15801561105457600080fd5b505af1158015611068573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052611090919081019061299c565b506110d78b868a8a6110a360018261273a565b8181106110b2576110b2612674565b90506020020160208101906110c79190612310565b6001600160a01b03169190611a2a565b6003546110f5906001600160a01b0316838a8a6110a360018261273a565b50507fa852c7c55996f8cebef42cd65025e93f32068a525dda35dac57df54f4150a57b8b8b8b338a8a600081811061112f5761112f612674565b90506020020160208101906111449190612310565b868c8c61115260018261273a565b81811061116157611161612674565b90506020020160208101906111769190612310565b8960405161118b9897969594939291906127da565b60405180910390a1505060018055505050505050505050565b6000546001600160a01b031633146111ce5760405162461bcd60e51b8152600401610686906126a5565b6001600160a01b0381166111f45760405162461bcd60e51b815260040161068690612751565b600380546001600160a01b0319166001600160a01b0383169081179091556040517f7fd76a984c1d5873adea6a1da2c0686aca1a38e0740a4ac4e8ec49211310885690600090a250565b6000546001600160a01b031633146112685760405162461bcd60e51b8152600401610686906126a5565b6103e88111156112ba5760405162461bcd60e51b815260206004820152601760248201527f4d617820666565206e756d657261746f723a20313030300000000000000000006044820152606401610686565b600255565b6000828260008181106112d4576112d4612674565b90506020020160208101906112e99190612310565b600354600160a01b900460ff16806113075750611307600482611a8d565b6113235760405162461bcd60e51b8152600401610686906126da565b6113338484610c8e60018261273a565b61134f5760405162461bcd60e51b8152600401610686906127a3565b600061135d6006600a61290c565b60086000878761136e60018261273a565b81811061137d5761137d612674565b90506020020160208101906113929190612310565b6001600160a01b031681526020810191909152604001600020546113b790600a61290c565b6113c1908861261d565b6113cb919061263c565b905060007f0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d6001600160a01b0316631f00ca748388886040518463ffffffff1660e01b815260040161141f93929190612979565b60006040518083038186803b15801561143757600080fd5b505afa15801561144b573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052611473919081019061299c565b90508060008151811061148857611488612674565b602002602001015193505050509392505050565b600260015414156114bf5760405162461bcd60e51b815260040161068690612703565b60026001556001600160a01b0382166114ea5760405162461bcd60e51b815260040161068690612751565b3360009081526009602090815260408083206001600160801b03198816845290915290205460ff161561152f5760405162461bcd60e51b815260040161068690612777565b61153881610b7c565b6115545760405162461bcd60e51b8152600401610686906127a3565b3360009081526009602090815260408083206001600160801b0319881684529091528120805460ff1916600117905561158f6006600a61290c565b6001600160a01b0383166000908152600860205260409020546115b390600a61290c565b6115bd908661261d565b6115c7919061263c565b905060006115d660648061261d565b6002546115e3908761261d565b6115ed919061263c565b905060006115fd6006600a61290c565b6001600160a01b03851660009081526008602052604090205461162190600a61290c565b61162b908461261d565b611635919061263c565b905061164c6001600160a01b038516338786611d68565b600354611668906001600160a01b038681169133911684611d68565b7fa852c7c55996f8cebef42cd65025e93f32068a525dda35dac57df54f4150a57b8787873388611698878a612918565b8a896040516116ae9897969594939291906127da565b60405180910390a15050600180555050505050565b60006105a8600483611a8d565b6116db60648061261d565b81565b6000546001600160a01b031633146117085760405162461bcd60e51b8152600401610686906126a5565b611713600482611eca565b6117555760405162461bcd60e51b8152602060048201526013602482015272185b1c9958591e481dda1a5d195b1a5cdd1959606a1b6044820152606401610686565b6040516001600160a01b038216907fa718ddb71589521cab00fa313e3bd14e75ca7204d57a12ff3a5aa40796f3427690600090a250565b6000546001600160a01b031633146117b65760405162461bcd60e51b8152600401610686906126a5565b6117c1600683611eca565b61180d5760405162461bcd60e51b815260206004820152601e60248201527f616c72656164792077686974656c697374656420737461626c65636f696e00006044820152606401610686565b6001600160a01b03821660008181526008602052604090819020839055517f16a657417be9e0af4ad015f790bb3c085d977ab22b042891c7d2d7016acdb0b39061185a9084815260200190565b60405180910390a25050565b6060600061187460046119a8565b905060008167ffffffffffffffff8111156118915761189161265e565b6040519080825280602002602001820160405280156118ba578160200160208202803683370190505b50905060005b82811015610655576118d36004826119b2565b8282815181106118e5576118e5612674565b6001600160a01b03909216602092830291909101909101526119068161268a565b90506118c0565b6000546001600160a01b031633146119375760405162461bcd60e51b8152600401610686906126a5565b6001600160a01b03811661199c5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610686565b6119a5816119da565b50565b60006105a8825490565b60006119be8383611edf565b9392505050565b60006119be836001600160a01b038416611f09565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6040516001600160a01b0383166024820152604481018290526108f890849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152611ffc565b6001600160a01b038116600090815260018301602052604081205415156119be565b6000611abd6006600a61290c565b600860008787611ace60018261273a565b818110611add57611add612674565b9050602002016020810190611af29190612310565b6001600160a01b03168152602081019190915260400160002054611b1790600a61290c565b611b21908a61261d565b611b2b919061263c565b90506000611b3b6006600a61290c565b600860008888611b4c60018261273a565b818110611b5b57611b5b612674565b9050602002016020810190611b709190612310565b6001600160a01b03168152602081019190915260400160002054611b9590600a61290c565b611b9f908561261d565b611ba9919061263c565b90506000611bb78284612918565b905060007f0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d6001600160a01b031663fb3bdb4134848b8b308f6040518763ffffffff1660e01b8152600401611c10959493929190612a98565b6000604051808303818588803b158015611c2957600080fd5b505af1158015611c3d573d6000803e3d6000fd5b50505050506040513d6000823e601f3d908101601f19168201604052611c66919081019061299c565b9050600081600081518110611c7d57611c7d612674565b602002602001015134611c90919061273a565b9050868110611d2a57604051600090339083908381818185875af1925050503d8060008114611cdb576040519150601f19603f3d011682016040523d82523d6000602084013e611ce0565b606091505b5050905080611d285760405162461bcd60e51b81526020600482015260146024820152732330b4b632b2103a379039b2b7321022ba3432b960611b6044820152606401610686565b505b50611d3d8a858a8a6110a360018261273a565b600354611d5b906001600160a01b0316848a8a6110a360018261273a565b5050505050505050505050565b6040516001600160a01b0380851660248301528316604482015260648101829052611da09085906323b872dd60e01b90608401611a56565b50505050565b801580611e2f5750604051636eb1769f60e11b81523060048201526001600160a01b03838116602483015284169063dd62ed3e9060440160206040518083038186803b158015611df557600080fd5b505afa158015611e09573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e2d9190612acf565b155b611e9a5760405162461bcd60e51b815260206004820152603660248201527f5361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f60448201527520746f206e6f6e2d7a65726f20616c6c6f77616e636560501b6064820152608401610686565b6040516001600160a01b0383166024820152604481018290526108f890849063095ea7b360e01b90606401611a56565b60006119be836001600160a01b0384166120ce565b6000826000018281548110611ef657611ef6612674565b9060005260206000200154905092915050565b60008181526001830160205260408120548015611ff2576000611f2d60018361273a565b8554909150600090611f419060019061273a565b9050818114611fa6576000866000018281548110611f6157611f61612674565b9060005260206000200154905080876000018481548110611f8457611f84612674565b6000918252602080832090910192909255918252600188019052604090208390555b8554869080611fb757611fb7612ae8565b6001900381819060005260206000200160009055905585600101600086815260200190815260200160002060009055600193505050506105a8565b60009150506105a8565b6000612051826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b031661211d9092919063ffffffff16565b8051909150156108f8578080602001905181019061206f9190612afe565b6108f85760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610686565b6000818152600183016020526040812054612115575081546001818101845560008481526020808220909301849055845484825282860190935260409020919091556105a8565b5060006105a8565b606061212c8484600085612134565b949350505050565b6060824710156121955760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b6064820152608401610686565b843b6121e35760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610686565b600080866001600160a01b031685876040516121ff9190612b47565b60006040518083038185875af1925050503d806000811461223c576040519150601f19603f3d011682016040523d82523d6000602084013e612241565b606091505b509150915061225182828661225c565b979650505050505050565b6060831561226b5750816119be565b82511561227b5782518084602001fd5b8160405162461bcd60e51b81526004016106869190612b63565b6000602082840312156122a757600080fd5b5035919050565b6020808252825182820181905260009190848201906040850190845b818110156122ef5783516001600160a01b0316835292840192918401916001016122ca565b50909695505050505050565b6001600160a01b03811681146119a557600080fd5b60006020828403121561232257600080fd5b81356119be816122fb565b80151581146119a557600080fd5b60006020828403121561234d57600080fd5b81356119be8161232d565b6000806040838503121561236b57600080fd5b8235612376816122fb565b946020939093013593505050565b80356001600160801b03198116811461239c57600080fd5b919050565b600080604083850312156123b457600080fd5b82356123bf816122fb565b91506123cd60208401612384565b90509250929050565b6000806000606084860312156123eb57600080fd5b83356123f6816122fb565b92506020840135612406816122fb565b929592945050506040919091013590565b60008083601f84011261242957600080fd5b50813567ffffffffffffffff81111561244157600080fd5b6020830191508360208260051b850101111561245c57600080fd5b9250929050565b600080600080600080600060c0888a03121561247e57600080fd5b61248788612384565b965060208801359550604088013561249e816122fb565b945060608801359350608088013567ffffffffffffffff8111156124c157600080fd5b6124cd8a828b01612417565b989b979a5095989497959660a090950135949350505050565b600080600080600080600060c0888a03121561250157600080fd5b61250a88612384565b9650602088013595506040880135612521816122fb565b9450606088013593506080880135925060a088013567ffffffffffffffff81111561254b57600080fd5b6125578a828b01612417565b989b979a50959850939692959293505050565b60008060006040848603121561257f57600080fd5b83359250602084013567ffffffffffffffff81111561259d57600080fd5b6125a986828701612417565b9497909650939450505050565b600080600080608085870312156125cc57600080fd5b6125d585612384565b93506020850135925060408501356125ec816122fb565b915060608501356125fc816122fb565b939692955090935050565b634e487b7160e01b600052601160045260246000fd5b600081600019048311821515161561263757612637612607565b500290565b60008261265957634e487b7160e01b600052601260045260246000fd5b500490565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b600060001982141561269e5761269e612607565b5060010190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6020808252600f908201526e1b9bdd081dda1a5d195b1a5cdd1959608a1b604082015260600190565b6020808252601f908201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604082015260600190565b60008282101561274c5761274c612607565b500390565b6020808252600c908201526b7a65726f206164647265737360a01b604082015260600190565b6020808252601290820152711bdc99195c88185b1c9958591e481c185a5960721b604082015260600190565b6020808252601e908201527f74686520656e642070617468206973206e6f7420737461626c65636f696e0000604082015260600190565b6001600160801b031998909816885260208801969096526001600160a01b0394851660408801529284166060870152908316608086015260a08501521660c083015260e08201526101000190565b600181815b8085111561286357816000190482111561284957612849612607565b8085161561285657918102915b93841c939080029061282d565b509250929050565b60008261287a575060016105a8565b81612887575060006105a8565b816001811461289d57600281146128a7576128c3565b60019150506105a8565b60ff8411156128b8576128b8612607565b50506001821b6105a8565b5060208310610133831016604e8410600b84101617156128e6575081810a6105a8565b6128f08383612828565b806000190482111561290457612904612607565b029392505050565b60006119be838361286b565b6000821982111561292b5761292b612607565b500190565b8183526000602080850194508260005b8581101561296e578135612953816122fb565b6001600160a01b031687529582019590820190600101612940565b509495945050505050565b838152604060208201526000612993604083018486612930565b95945050505050565b600060208083850312156129af57600080fd5b825167ffffffffffffffff808211156129c757600080fd5b818501915085601f8301126129db57600080fd5b8151818111156129ed576129ed61265e565b8060051b604051601f19603f83011681018181108582111715612a1257612a1261265e565b604052918252848201925083810185019188831115612a3057600080fd5b938501935b82851015612a4e57845184529385019392850192612a35565b98975050505050505050565b86815285602082015260a060408201526000612a7a60a083018688612930565b6001600160a01b039490941660608301525060800152949350505050565b858152608060208201526000612ab2608083018688612930565b6001600160a01b0394909416604083015250606001529392505050565b600060208284031215612ae157600080fd5b5051919050565b634e487b7160e01b600052603160045260246000fd5b600060208284031215612b1057600080fd5b81516119be8161232d565b60005b83811015612b36578181015183820152602001612b1e565b83811115611da05750506000910152565b60008251612b59818460208701612b1b565b9190910192915050565b6020815260008251806020840152612b82816040850160208701612b1b565b601f01601f1916919091016040019291505056fea2646970667358221220268433bbbf0b36d512647bd2085ec19cc51ccec2ad43d0a10b5775b60a7a67ef64736f6c63430008080033

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

0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d0000000000000000000000003ccb0f1f6cc0709f491a2d25b4fbca5fe78870e8

-----Decoded View---------------
Arg [0] : routerAddress (address): 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D
Arg [1] : serviceFeeTreasuryAddress (address): 0x3CCb0F1f6Cc0709f491A2D25b4FBCa5Fe78870e8

-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d
Arg [1] : 0000000000000000000000003ccb0f1f6cc0709f491a2d25b4fbca5fe78870e8


Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

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

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
Loading...
Loading
[ Download: CSV Export  ]
[ 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.