ETH Price: $2,592.00 (-1.84%)
Gas: 5 Gwei

Contract

0x5C35BaDebD40308e409df891aC56d17C8625c2bC
 

Overview

ETH Balance

0.01 ETH

Eth Value

$25.92 (@ $2,592.00/ETH)

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Hybrid Swap Exac...128193242021-07-13 14:30:031123 days ago1626186603IN
0x5C35BaDe...C8625c2bC
0.016 ETH0.004294334
Remove Liquidity...128046802021-07-11 7:30:331125 days ago1625988633IN
0x5C35BaDe...C8625c2bC
0.01 ETH0.0031581414
Remove Liquidity...126887152021-06-23 6:00:361143 days ago1624428036IN
0x5C35BaDe...C8625c2bC
0.01 ETH0.0039223616.5
Remove Liquidity...126707942021-06-20 10:44:211146 days ago1624185861IN
0x5C35BaDe...C8625c2bC
0.01 ETH0.003895817
Add Liquidity An...126707362021-06-20 10:32:551146 days ago1624185175IN
0x5C35BaDe...C8625c2bC
0.31 ETH0.0094785828
Remove Liquidity...126694862021-06-20 5:53:541146 days ago1624168434IN
0x5C35BaDe...C8625c2bC
0.01 ETH0.0024403410
Remove Liquidity...125609192021-06-03 10:07:421163 days ago1622714862IN
0x5C35BaDe...C8625c2bC
0.01 ETH0.0051864721
Remove Liquidity...125608882021-06-03 10:01:451163 days ago1622714505IN
0x5C35BaDe...C8625c2bC
0.01 ETH0.0051862221
Remove Liquidity...125327812021-05-30 1:28:151167 days ago1622338095IN
0x5C35BaDe...C8625c2bC
0.01 ETH0.0050450719.25000023
Remove Liquidity...125099332021-05-26 12:29:311171 days ago1622032171IN
0x5C35BaDe...C8625c2bC
0.01 ETH0.0076592331
Remove Liquidity...125099192021-05-26 12:26:191171 days ago1622031979IN
0x5C35BaDe...C8625c2bC
0.01 ETH0.0083608631.9
Remove Liquidity...125005332021-05-25 1:19:321172 days ago1621905572IN
0x5C35BaDe...C8625c2bC
0.01 ETH0.0079866139.00000145
Remove Liquidity...125005172021-05-25 1:16:321172 days ago1621905392IN
0x5C35BaDe...C8625c2bC
0.01 ETH0.0092153245.00000145
Remove Liquidity...124874192021-05-23 0:39:231174 days ago1621730363IN
0x5C35BaDe...C8625c2bC
0.01 ETH0.0102296941.4
Remove Liquidity...124813752021-05-22 2:06:221175 days ago1621649182IN
0x5C35BaDe...C8625c2bC
0.01 ETH0.0128488852
Remove Liquidity...124809612021-05-22 0:37:391175 days ago1621643859IN
0x5C35BaDe...C8625c2bC
0.01 ETH0.0130959853.00000145
Remove Liquidity...124777452021-05-21 12:41:471176 days ago1621600907IN
0x5C35BaDe...C8625c2bC
0.01 ETH0.0137413153
Remove Liquidity...124769322021-05-21 9:35:331176 days ago1621589733IN
0x5C35BaDe...C8625c2bC
0.01 ETH0.0107453641.00000145
Hybrid Swap Exac...124765232021-05-21 8:06:301176 days ago1621584390IN
0x5C35BaDe...C8625c2bC
30.63864 ETH0.0166222556
Hybrid Swap Exac...124765112021-05-21 8:03:231176 days ago1621584203IN
0x5C35BaDe...C8625c2bC
0.7092 ETH0.0150307354
Remove Liquidity...124753312021-05-21 3:26:301176 days ago1621567590IN
0x5C35BaDe...C8625c2bC
0.01 ETH0.0106281343.00000145
Hybrid Swap Exac...124327352021-05-14 13:17:491183 days ago1620998269IN
0x5C35BaDe...C8625c2bC
0.01 ETH0.01568841117.6775
Hybrid Swap Exac...124072982021-05-10 15:03:401187 days ago1620659020IN
0x5C35BaDe...C8625c2bC
0.015 ETH0.01065355
Hybrid Swap Exac...123763432021-05-05 20:11:591192 days ago1620245519IN
0x5C35BaDe...C8625c2bC
0.01 ETH0.0087527969.3
Remove Liquidity...123075722021-04-25 5:34:331202 days ago1619328873IN
0x5C35BaDe...C8625c2bC
0.01 ETH0.0108898138
View all transactions

Latest 25 internal transactions (View All)

Advanced mode:
Parent Transaction Hash Block From To
128193242021-07-13 14:30:031123 days ago1626186603
0x5C35BaDe...C8625c2bC
0.016 ETH
128046802021-07-11 7:30:331125 days ago1625988633
0x5C35BaDe...C8625c2bC
1.96403358 ETH
128046802021-07-11 7:30:331125 days ago1625988633
0x5C35BaDe...C8625c2bC
1.96403358 ETH
128046802021-07-11 7:30:331125 days ago1625988633
0x5C35BaDe...C8625c2bC
0.01 ETH
126887152021-06-23 6:00:361143 days ago1624428036
0x5C35BaDe...C8625c2bC
0.05785261 ETH
126887152021-06-23 6:00:361143 days ago1624428036
0x5C35BaDe...C8625c2bC
0.05785261 ETH
126887152021-06-23 6:00:361143 days ago1624428036
0x5C35BaDe...C8625c2bC
0.01 ETH
126707942021-06-20 10:44:211146 days ago1624185861
0x5C35BaDe...C8625c2bC
0.29939998 ETH
126707942021-06-20 10:44:211146 days ago1624185861
0x5C35BaDe...C8625c2bC
0.29939998 ETH
126707942021-06-20 10:44:211146 days ago1624185861
0x5C35BaDe...C8625c2bC
0.01 ETH
126707362021-06-20 10:32:551146 days ago1624185175
0x5C35BaDe...C8625c2bC
0.01 ETH
126707362021-06-20 10:32:551146 days ago1624185175
0x5C35BaDe...C8625c2bC
0.3 ETH
126694862021-06-20 5:53:541146 days ago1624168434
0x5C35BaDe...C8625c2bC
0.0341222 ETH
126694862021-06-20 5:53:541146 days ago1624168434
0x5C35BaDe...C8625c2bC
0.0341222 ETH
126694862021-06-20 5:53:541146 days ago1624168434
0x5C35BaDe...C8625c2bC
0.01 ETH
125609192021-06-03 10:07:421163 days ago1622714862
0x5C35BaDe...C8625c2bC
1.86677531 ETH
125609192021-06-03 10:07:421163 days ago1622714862
0x5C35BaDe...C8625c2bC
1.86677531 ETH
125609192021-06-03 10:07:421163 days ago1622714862
0x5C35BaDe...C8625c2bC
0.01 ETH
125608882021-06-03 10:01:451163 days ago1622714505
0x5C35BaDe...C8625c2bC
1.86572469 ETH
125608882021-06-03 10:01:451163 days ago1622714505
0x5C35BaDe...C8625c2bC
1.86572469 ETH
125608882021-06-03 10:01:451163 days ago1622714505
0x5C35BaDe...C8625c2bC
0.01 ETH
125327812021-05-30 1:28:151167 days ago1622338095
0x5C35BaDe...C8625c2bC
0.83920431 ETH
125327812021-05-30 1:28:151167 days ago1622338095
0x5C35BaDe...C8625c2bC
0.83920431 ETH
125327812021-05-30 1:28:151167 days ago1622338095
0x5C35BaDe...C8625c2bC
0.01 ETH
125099332021-05-26 12:29:311171 days ago1622032171
0x5C35BaDe...C8625c2bC
0.05482785 ETH
View All Internal Transactions
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
CoFiXRouter02

Compiler Version
v0.6.12+commit.27d51765

Optimization Enabled:
Yes with 6666 runs

Other Settings:
default evmVersion
File 1 of 13 : CoFiXRouter02.sol
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity 0.6.12;

import "./interface/ICoFiXFactory.sol";
import "./lib/TransferHelper.sol";
import "./lib/UniswapV2Library.sol";
import "./interface/ICoFiXRouter02.sol";
import "@openzeppelin/contracts/math/SafeMath.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "./interface/IWETH.sol";
import "./interface/ICoFiXPair.sol";
import "./interface/ICoFiXVaultForLP.sol";
import "./interface/ICoFiXStakingRewards.sol";
import "./interface/ICoFiXVaultForTrader.sol";


// Router contract to interact with each CoFiXPair, no owner or governance
contract CoFiXRouter02 is ICoFiXRouter02 {
    using SafeMath for uint;

    address public immutable override factory;
    address public immutable uniFactory;
    address public immutable override WETH;

    uint256 internal constant NEST_ORACLE_FEE = 0.01 ether;

    modifier ensure(uint deadline) {
        require(deadline >= block.timestamp, 'CRouter: EXPIRED');
        _;
    }

    constructor(address _factory, address _uniFactory, address _WETH) public {
        factory = _factory;
        uniFactory = _uniFactory;
        WETH = _WETH;
    }

    receive() external payable {}

    // calculates the CREATE2 address for a pair without making any external calls
    function pairFor(address _factory, address token) internal view returns (address pair) {
        // pair = address(uint(keccak256(abi.encodePacked(
        //         hex'ff',
        //         _factory,
        //         keccak256(abi.encodePacked(token)),
        //         hex'fb0c5470b7fbfce7f512b5035b5c35707fd5c7bd43c8d81959891b0296030118' // init code hash
        //     )))); // calc the real init code hash, not suitable for us now, could use this in the future
        return ICoFiXFactory(_factory).getPair(token);
    }

    // msg.value = amountETH + oracle fee
    function addLiquidity(
        address token,
        uint amountETH,
        uint amountToken,
        uint liquidityMin,
        address to,
        uint deadline
    ) external override payable ensure(deadline) returns (uint liquidity)
    {
        // create the pair if it doesn't exist yet
        if (ICoFiXFactory(factory).getPair(token) == address(0)) {
            ICoFiXFactory(factory).createPair(token);
        }
        require(msg.value > amountETH, "CRouter: insufficient msg.value");
        uint256 _oracleFee = msg.value.sub(amountETH);
        address pair = pairFor(factory, token);
        if (amountToken > 0 ) { // support for tokens which do not allow to transfer zero values
            TransferHelper.safeTransferFrom(token, msg.sender, pair, amountToken);
        }
        if (amountETH > 0) {
            IWETH(WETH).deposit{value: amountETH}();
            assert(IWETH(WETH).transfer(pair, amountETH));
        }
        uint256 oracleFeeChange;
        (liquidity, oracleFeeChange) = ICoFiXPair(pair).mint{value: _oracleFee}(to);
        require(liquidity >= liquidityMin, "CRouter: less liquidity than expected");
        // refund oracle fee to msg.sender, if any
        if (oracleFeeChange > 0) TransferHelper.safeTransferETH(msg.sender, oracleFeeChange);
    }

    // msg.value = amountETH + oracle fee
    function addLiquidityAndStake(
        address token,
        uint amountETH,
        uint amountToken,
        uint liquidityMin,
        address to,
        uint deadline
    ) external override payable ensure(deadline) returns (uint liquidity)
    {
        // must create a pair before using this function
        require(msg.value > amountETH, "CRouter: insufficient msg.value");
        uint256 _oracleFee = msg.value.sub(amountETH);
        address pair = pairFor(factory, token);
        require(pair != address(0), "CRouter: invalid pair");
        if (amountToken > 0 ) { // support for tokens which do not allow to transfer zero values
            TransferHelper.safeTransferFrom(token, msg.sender, pair, amountToken);
        }
        if (amountETH > 0) {
            IWETH(WETH).deposit{value: amountETH}();
            assert(IWETH(WETH).transfer(pair, amountETH));
        }
        uint256 oracleFeeChange;
        (liquidity, oracleFeeChange) = ICoFiXPair(pair).mint{value: _oracleFee}(address(this));
        require(liquidity >= liquidityMin, "CRouter: less liquidity than expected");

        // find the staking rewards pool contract for the liquidity token (pair)
        address pool = ICoFiXVaultForLP(ICoFiXFactory(factory).getVaultForLP()).stakingPoolForPair(pair);
        require(pool != address(0), "CRouter: invalid staking pool");
        // approve to staking pool
        ICoFiXPair(pair).approve(pool, liquidity);
        ICoFiXStakingRewards(pool).stakeForOther(to, liquidity);
        ICoFiXPair(pair).approve(pool, 0); // ensure
        // refund oracle fee to msg.sender, if any
        if (oracleFeeChange > 0) TransferHelper.safeTransferETH(msg.sender, oracleFeeChange);
    }

    // msg.value = oracle fee
    function removeLiquidityGetToken(
        address token,
        uint liquidity,
        uint amountTokenMin,
        address to,
        uint deadline
    ) external override payable ensure(deadline) returns (uint amountToken)
    {
        require(msg.value > 0, "CRouter: insufficient msg.value");
        address pair = pairFor(factory, token);
        ICoFiXPair(pair).transferFrom(msg.sender, pair, liquidity); // send liquidity to pair
        uint oracleFeeChange; 
        (amountToken, oracleFeeChange) = ICoFiXPair(pair).burn{value: msg.value}(token, to);
        require(amountToken >= amountTokenMin, "CRouter: got less than expected");
        // refund oracle fee to msg.sender, if any
        if (oracleFeeChange > 0) TransferHelper.safeTransferETH(msg.sender, oracleFeeChange);
    }

    // msg.value = oracle fee
    function removeLiquidityGetETH(
        address token,
        uint liquidity,
        uint amountETHMin,
        address to,
        uint deadline
    ) external override payable ensure(deadline) returns (uint amountETH)
    {
        require(msg.value > 0, "CRouter: insufficient msg.value");
        address pair = pairFor(factory, token);
        ICoFiXPair(pair).transferFrom(msg.sender, pair, liquidity); // send liquidity to pair
        uint oracleFeeChange; 
        (amountETH, oracleFeeChange) = ICoFiXPair(pair).burn{value: msg.value}(WETH, address(this));
        require(amountETH >= amountETHMin, "CRouter: got less than expected");
        IWETH(WETH).withdraw(amountETH);
        TransferHelper.safeTransferETH(to, amountETH);
        // refund oracle fee to msg.sender, if any
        if (oracleFeeChange > 0) TransferHelper.safeTransferETH(msg.sender, oracleFeeChange);
    }

    // msg.value = amountIn + oracle fee
    function swapExactETHForTokens(
        address token,
        uint amountIn,
        uint amountOutMin,
        address to,
        address rewardTo,
        uint deadline
    ) external override payable ensure(deadline) returns (uint _amountIn, uint _amountOut)
    {
        require(msg.value > amountIn, "CRouter: insufficient msg.value");
        IWETH(WETH).deposit{value: amountIn}();
        address pair = pairFor(factory, token);
        assert(IWETH(WETH).transfer(pair, amountIn));
        uint oracleFeeChange; 
        uint256[4] memory tradeInfo;
        (_amountIn, _amountOut, oracleFeeChange, tradeInfo) = ICoFiXPair(pair).swapWithExact{
            value: msg.value.sub(amountIn)}(token, to);
        require(_amountOut >= amountOutMin, "CRouter: got less than expected");

        // distribute trading rewards - CoFi!
        address vaultForTrader = ICoFiXFactory(factory).getVaultForTrader();
        if (tradeInfo[0] > 0 && rewardTo != address(0) && vaultForTrader != address(0)) {
            ICoFiXVaultForTrader(vaultForTrader).distributeReward(pair, tradeInfo[0], tradeInfo[1], tradeInfo[2], tradeInfo[3], rewardTo);
        }

        // refund oracle fee to msg.sender, if any
        if (oracleFeeChange > 0) TransferHelper.safeTransferETH(msg.sender, oracleFeeChange);
    }

    // msg.value = oracle fee
    function swapExactTokensForTokens(
        address tokenIn,
        address tokenOut,
        uint amountIn,
        uint amountOutMin,
        address to,
        address rewardTo,
        uint deadline
    ) external override payable ensure(deadline) returns (uint _amountIn, uint _amountOut) {

        require(msg.value > 0, "CRouter: insufficient msg.value");
        address[2] memory pairs; // [pairIn, pairOut]

        // swapExactTokensForETH
        pairs[0] = pairFor(factory, tokenIn);
        TransferHelper.safeTransferFrom(tokenIn, msg.sender, pairs[0], amountIn);
        uint oracleFeeChange;
        uint256[4] memory tradeInfo;
        (_amountIn, _amountOut, oracleFeeChange, tradeInfo) = ICoFiXPair(pairs[0]).swapWithExact{value: msg.value}(WETH, address(this));

        // distribute trading rewards - CoFi!
        address vaultForTrader = ICoFiXFactory(factory).getVaultForTrader();
        if (tradeInfo[0] > 0 && rewardTo != address(0) && vaultForTrader != address(0)) {
            ICoFiXVaultForTrader(vaultForTrader).distributeReward(pairs[0], tradeInfo[0], tradeInfo[1], tradeInfo[2], tradeInfo[3], rewardTo);
        }

        // swapExactETHForTokens
        pairs[1] = pairFor(factory, tokenOut);
        assert(IWETH(WETH).transfer(pairs[1], _amountOut)); // swap with all amountOut in last swap
        (, _amountOut, oracleFeeChange, tradeInfo) = ICoFiXPair(pairs[1]).swapWithExact{value: oracleFeeChange}(tokenOut, to);
        require(_amountOut >= amountOutMin, "CRouter: got less than expected");

        // distribute trading rewards - CoFi!
        if (tradeInfo[0] > 0 && rewardTo != address(0) && vaultForTrader != address(0)) {
            ICoFiXVaultForTrader(vaultForTrader).distributeReward(pairs[1], tradeInfo[0], tradeInfo[1], tradeInfo[2], tradeInfo[3], rewardTo);
        }

        // refund oracle fee to msg.sender, if any
        if (oracleFeeChange > 0) TransferHelper.safeTransferETH(msg.sender, oracleFeeChange);
    }

    // msg.value = oracle fee
    function swapExactTokensForETH(
        address token,
        uint amountIn,
        uint amountOutMin,
        address to,
        address rewardTo,
        uint deadline
    ) external override payable ensure(deadline) returns (uint _amountIn, uint _amountOut)
    {
        require(msg.value > 0, "CRouter: insufficient msg.value");
        address pair = pairFor(factory, token);
        TransferHelper.safeTransferFrom(token, msg.sender, pair, amountIn);
        uint oracleFeeChange; 
        uint256[4] memory tradeInfo;
        (_amountIn, _amountOut, oracleFeeChange, tradeInfo) = ICoFiXPair(pair).swapWithExact{value: msg.value}(WETH, address(this));
        require(_amountOut >= amountOutMin, "CRouter: got less than expected");
        IWETH(WETH).withdraw(_amountOut);
        TransferHelper.safeTransferETH(to, _amountOut);

        // distribute trading rewards - CoFi!
        address vaultForTrader = ICoFiXFactory(factory).getVaultForTrader();
        if (tradeInfo[0] > 0 && rewardTo != address(0) && vaultForTrader != address(0)) {
            ICoFiXVaultForTrader(vaultForTrader).distributeReward(pair, tradeInfo[0], tradeInfo[1], tradeInfo[2], tradeInfo[3], rewardTo);
        }

        // refund oracle fee to msg.sender, if any
        if (oracleFeeChange > 0) TransferHelper.safeTransferETH(msg.sender, oracleFeeChange);
    }

    function hybridSwapExactTokensForTokens(
        uint amountIn,
        uint amountOutMin,
        address[] calldata path,
        DEX_TYPE[] calldata dexes,
        address to,
        address rewardTo,
        uint deadline
    ) external override payable ensure(deadline) returns (uint[] memory amounts) {
        // fast check
        require(path.length >= 2, "CRouter: invalid path");
        require(dexes.length == path.length - 1, "CRouter: invalid dexes");
        _checkOracleFee(dexes, msg.value);

        // send amountIn to the first pair
        TransferHelper.safeTransferFrom(
            path[0], msg.sender,  getPairForDEX(path[0], path[1], dexes[0]), amountIn
        );

        // exec hybridSwap
        amounts = new uint[](path.length);
        amounts[0] = amountIn;
        _hybridSwap(path, dexes, amounts, to, rewardTo);

        // check amountOutMin in the last
        require(amounts[amounts.length - 1] >= amountOutMin, "CRouter: insufficient output amount ");
    }

    function hybridSwapExactETHForTokens(
        uint amountIn,
        uint amountOutMin,
        address[] calldata path,
        DEX_TYPE[] calldata dexes,
        address to,
        address rewardTo,
        uint deadline
    ) external override payable ensure(deadline) returns (uint[] memory amounts) {
        // fast check
        require(path.length >= 2 && path[0] == WETH, "CRouter: invalid path");
        require(dexes.length == path.length - 1, "CRouter: invalid dexes");
        _checkOracleFee(dexes, msg.value.sub(amountIn)); // would revert if msg.value is less than amountIn

        // convert ETH and send amountIn to the first pair
        IWETH(WETH).deposit{value: amountIn}();
        assert(IWETH(WETH).transfer(getPairForDEX(path[0], path[1], dexes[0]), amountIn));

        // exec hybridSwap
        amounts = new uint[](path.length);
        amounts[0] = amountIn;
        _hybridSwap(path, dexes, amounts, to, rewardTo);

        // check amountOutMin in the last
        require(amounts[amounts.length - 1] >= amountOutMin, "CRouter: insufficient output amount ");
    }

    function hybridSwapExactTokensForETH(
        uint amountIn,
        uint amountOutMin,
        address[] calldata path,
        DEX_TYPE[] calldata dexes,
        address to,
        address rewardTo,
        uint deadline
    ) external override payable ensure(deadline) returns (uint[] memory amounts) {
        // fast check
        require(path.length >= 2 && path[path.length - 1] == WETH, "CRouter: invalid path");
        require(dexes.length == path.length - 1, "CRouter: invalid dexes");
        _checkOracleFee(dexes, msg.value);

        // send amountIn to the first pair
        TransferHelper.safeTransferFrom(
            path[0], msg.sender, getPairForDEX(path[0], path[1], dexes[0]), amountIn
        );

        // exec hybridSwap
        amounts = new uint[](path.length);
        amounts[0] = amountIn;
        _hybridSwap(path, dexes, amounts, address(this), rewardTo);

        // check amountOutMin in the last
        require(amounts[amounts.length - 1] >= amountOutMin, "CRouter: insufficient output amount ");

        // convert WETH
        IWETH(WETH).withdraw(amounts[amounts.length - 1]);
        TransferHelper.safeTransferETH(to, amounts[amounts.length - 1]);
    }


    function _checkOracleFee(DEX_TYPE[] memory dexes, uint256 oracleFee) internal pure {
        uint cofixCnt;
        for (uint i; i < dexes.length; i++) {
            if (dexes[i] == DEX_TYPE.COFIX) {
                cofixCnt++;
            }
        }
        // strict check here
        // to simplify the verify logic for oracle fee and prevent user from locking oracle fee by mistake
        // if NEST_ORACLE_FEE value changed, this router would not work as expected
        // TODO: refund the oracle fee?
        require(oracleFee == NEST_ORACLE_FEE.mul(cofixCnt), "CRouter: wrong oracle fee");
    }

    function _hybridSwap(address[] memory path, DEX_TYPE[] memory dexes, uint[] memory amounts, address _to, address rewardTo) internal {
        for (uint i; i < path.length - 1; i++) {
            if (dexes[i] == DEX_TYPE.COFIX) {
                _swapOnCoFiX(i, path, dexes, amounts, _to, rewardTo);
            } else if (dexes[i] == DEX_TYPE.UNISWAP) {
                _swapOnUniswap(i, path, dexes, amounts, _to);
            } else {
                revert("CRouter: unknown dex");
            }
        }
    }

    function _swapOnUniswap(uint i, address[] memory path, DEX_TYPE[] memory dexes, uint[] memory amounts, address _to) internal {
        address pair = getPairForDEX(path[i], path[i + 1], DEX_TYPE.UNISWAP);

        (address token0,) = UniswapV2Library.sortTokens(path[i], path[i + 1]);
        {
            (uint reserveIn, uint reserveOut) = UniswapV2Library.getReserves(uniFactory, path[i], path[i + 1]);
            amounts[i + 1] = UniswapV2Library.getAmountOut(amounts[i], reserveIn, reserveOut);
        }
        uint amountOut = amounts[i + 1];
        (uint amount0Out, uint amount1Out) = path[i] == token0 ? (uint(0), amountOut) : (amountOut, uint(0));

        address to;
        {
            if (i < path.length - 2) {
                to = getPairForDEX(path[i + 1], path[i + 2], dexes[i + 1]);
            } else {
                to = _to;
            }
        }

        IUniswapV2Pair(pair).swap(
            amount0Out, amount1Out, to, new bytes(0)
        );
    }
    
    function _swapOnCoFiX(uint i, address[] memory path, DEX_TYPE[] memory dexes, uint[] memory amounts, address _to, address rewardTo) internal {
            address pair = getPairForDEX(path[i], path[i + 1], DEX_TYPE.COFIX);
            address to;
            if (i < path.length - 2) {
                to = getPairForDEX(path[i + 1], path[i + 2], dexes[i + 1]);
            } else {
                to = _to;
            }
            // TODO: dynamic oracle fee
            {
                uint256[4] memory tradeInfo;
                (,amounts[i+1],,tradeInfo) = ICoFiXPair(pair).swapWithExact{value: NEST_ORACLE_FEE}(path[i + 1], to);

                // distribute trading rewards - CoFi!
                address vaultForTrader = ICoFiXFactory(factory).getVaultForTrader();
                if (tradeInfo[0] > 0 && rewardTo != address(0) && vaultForTrader != address(0)) {
                    ICoFiXVaultForTrader(vaultForTrader).distributeReward(pair, tradeInfo[0], tradeInfo[1], tradeInfo[2], tradeInfo[3], rewardTo);
                }
            }
    } 

    function isCoFiXNativeSupported(address input, address output) public view returns (bool supported, address pair) {
        // NO WETH included
        if (input != WETH && output != WETH)
            return (false, pair);
        if (input != WETH) {
            pair = pairFor(factory, input);
        } else if (output != WETH) {
            pair = pairFor(factory, output);
        }
        // if tokenIn & tokenOut are both WETH, then the pair is zero
        if (pair != address(0)) // TODO: add check for reserves
            supported = true;
        return (supported, pair);
    }

    function getPairForDEX(address input, address output, DEX_TYPE dex) public view returns (address pair) {
        if (dex == DEX_TYPE.COFIX) {
            bool supported;
            (supported, pair) = isCoFiXNativeSupported(input, output);
            if (!supported) {
                revert("CRouter: not available on CoFiX");
            }
        } else if (dex == DEX_TYPE.UNISWAP) {
            pair = UniswapV2Library.pairFor(uniFactory, input, output);
        } else {
            revert("CRouter: unknown dex");
        }
    }

    // TODO: not used currently
    function hybridPair(address input, address output) public view returns (bool useCoFiX, address pair) {
        (useCoFiX, pair) = isCoFiXNativeSupported(input, output);
        if (useCoFiX) {
            return (useCoFiX, pair);
        }
        return (false, UniswapV2Library.pairFor(uniFactory, input, output));
    }
}

File 2 of 13 : ICoFiXERC20.sol
// SPDX-License-Identifier: GPL-3.0-or-later

pragma solidity 0.6.12;

interface ICoFiXERC20 {
    event Approval(address indexed owner, address indexed spender, uint value);
    event Transfer(address indexed from, address indexed to, uint value);

    // function name() external pure returns (string memory);
    // function symbol() external pure returns (string memory);
    function decimals() external pure returns (uint8);
    function totalSupply() external view returns (uint);
    function balanceOf(address owner) external view returns (uint);
    function allowance(address owner, address spender) external view returns (uint);

    function approve(address spender, uint value) external returns (bool);
    function transfer(address to, uint value) external returns (bool);
    function transferFrom(address from, address to, uint value) external returns (bool);

    function DOMAIN_SEPARATOR() external view returns (bytes32);
    function PERMIT_TYPEHASH() external pure returns (bytes32);
    function nonces(address owner) external view returns (uint);

    function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external;
}

File 3 of 13 : ICoFiXFactory.sol
// SPDX-License-Identifier: GPL-3.0-or-later

pragma solidity 0.6.12;

interface ICoFiXFactory {
    // All pairs: {ETH <-> ERC20 Token}
    event PairCreated(address indexed token, address pair, uint256);
    event NewGovernance(address _new);
    event NewController(address _new);
    event NewFeeReceiver(address _new);
    event NewFeeVaultForLP(address token, address feeVault);
    event NewVaultForLP(address _new);
    event NewVaultForTrader(address _new);
    event NewVaultForCNode(address _new);

    /// @dev Create a new token pair for trading
    /// @param  token the address of token to trade
    /// @return pair the address of new token pair
    function createPair(
        address token
        )
        external
        returns (address pair);

    function getPair(address token) external view returns (address pair);
    function allPairs(uint256) external view returns (address pair);
    function allPairsLength() external view returns (uint256);

    function getTradeMiningStatus(address token) external view returns (bool status);
    function setTradeMiningStatus(address token, bool status) external;
    function getFeeVaultForLP(address token) external view returns (address feeVault); // for LPs
    function setFeeVaultForLP(address token, address feeVault) external;

    function setGovernance(address _new) external;
    function setController(address _new) external;
    function setFeeReceiver(address _new) external;
    function setVaultForLP(address _new) external;
    function setVaultForTrader(address _new) external;
    function setVaultForCNode(address _new) external;
    function getController() external view returns (address controller);
    function getFeeReceiver() external view returns (address feeReceiver); // For CoFi Holders
    function getVaultForLP() external view returns (address vaultForLP);
    function getVaultForTrader() external view returns (address vaultForTrader);
    function getVaultForCNode() external view returns (address vaultForCNode);
}

File 4 of 13 : ICoFiXPair.sol
// SPDX-License-Identifier: GPL-3.0-or-later

pragma solidity 0.6.12;
import './ICoFiXERC20.sol';

interface ICoFiXPair is ICoFiXERC20 {

    struct OraclePrice {
        uint256 ethAmount;
        uint256 erc20Amount;
        uint256 blockNum;
        uint256 K;
        uint256 theta;
    }

    // All pairs: {ETH <-> ERC20 Token}
    event Mint(address indexed sender, uint amount0, uint amount1);
    event Burn(address indexed sender, address outToken, uint outAmount, address indexed to);
    event Swap(
        address indexed sender,
        uint amountIn,
        uint amountOut,
        address outToken,
        address indexed to
    );
    event Sync(uint112 reserve0, uint112 reserve1);

    function MINIMUM_LIQUIDITY() external pure returns (uint);
    function factory() external view returns (address);
    function token0() external view returns (address);
    function token1() external view returns (address);
    function getReserves() external view returns (uint112 reserve0, uint112 reserve1);

    function mint(address to) external payable returns (uint liquidity, uint oracleFeeChange);
    function burn(address outToken, address to) external payable returns (uint amountOut, uint oracleFeeChange);
    function swapWithExact(address outToken, address to) external payable returns (uint amountIn, uint amountOut, uint oracleFeeChange, uint256[4] memory tradeInfo);
    function swapForExact(address outToken, uint amountOutExact, address to) external payable returns (uint amountIn, uint amountOut, uint oracleFeeChange, uint256[4] memory tradeInfo);
    function skim(address to) external;
    function sync() external;

    function initialize(address, address, string memory, string memory) external;

    /// @dev get Net Asset Value Per Share
    /// @param  ethAmount ETH side of Oracle price {ETH <-> ERC20 Token}
    /// @param  erc20Amount Token side of Oracle price {ETH <-> ERC20 Token}
    /// @return navps The Net Asset Value Per Share (liquidity) represents
    function getNAVPerShare(uint256 ethAmount, uint256 erc20Amount) external view returns (uint256 navps);
}

File 5 of 13 : ICoFiXRouter02.sol
// SPDX-License-Identifier: GPL-3.0-or-later

pragma solidity 0.6.12;

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

    enum DEX_TYPE { COFIX, UNISWAP }

    // All pairs: {ETH <-> ERC20 Token}

    /// @dev Maker add liquidity to pool, get pool token (mint XToken to maker) (notice: msg.value = amountETH + oracle fee)
    /// @param  token The address of ERC20 Token
    /// @param  amountETH The amount of ETH added to pool
    /// @param  amountToken The amount of Token added to pool
    /// @param  liquidityMin The minimum liquidity maker wanted
    /// @param  to The target address receiving the liquidity pool (XToken)
    /// @param  deadline The dealine of this request
    /// @return liquidity The real liquidity or XToken minted from pool
    function addLiquidity(
        address token,
        uint amountETH,
        uint amountToken,
        uint liquidityMin,
        address to,
        uint deadline
    ) external payable returns (uint liquidity);

    /// @dev Maker add liquidity to pool, get pool token (mint XToken) and stake automatically (notice: msg.value = amountETH + oracle fee)
    /// @param  token The address of ERC20 Token
    /// @param  amountETH The amount of ETH added to pool
    /// @param  amountToken The amount of Token added to pool
    /// @param  liquidityMin The minimum liquidity maker wanted
    /// @param  to The target address receiving the liquidity pool (XToken)
    /// @param  deadline The dealine of this request
    /// @return liquidity The real liquidity or XToken minted from pool
    function addLiquidityAndStake(
        address token,
        uint amountETH,
        uint amountToken,
        uint liquidityMin,
        address to,
        uint deadline
    ) external payable returns (uint liquidity);

    /// @dev Maker remove liquidity from pool to get ERC20 Token back (maker burn XToken) (notice: msg.value = oracle fee)
    /// @param  token The address of ERC20 Token
    /// @param  liquidity The amount of liquidity (XToken) sent to pool, or the liquidity to remove
    /// @param  amountTokenMin The minimum amount of Token wanted to get from pool
    /// @param  to The target address receiving the Token
    /// @param  deadline The dealine of this request
    /// @return amountToken The real amount of Token transferred from the pool
    function removeLiquidityGetToken(
        address token,
        uint liquidity,
        uint amountTokenMin,
        address to,
        uint deadline
    ) external payable returns (uint amountToken);

    /// @dev Maker remove liquidity from pool to get ETH back (maker burn XToken) (notice: msg.value = oracle fee)
    /// @param  token The address of ERC20 Token
    /// @param  liquidity The amount of liquidity (XToken) sent to pool, or the liquidity to remove
    /// @param  amountETHMin The minimum amount of ETH wanted to get from pool
    /// @param  to The target address receiving the ETH
    /// @param  deadline The dealine of this request
    /// @return amountETH The real amount of ETH transferred from the pool
    function removeLiquidityGetETH(
        address token,
        uint liquidity,
        uint amountETHMin,
        address to,
        uint deadline
    ) external payable returns (uint amountETH);

    /// @dev Trader swap exact amount of ETH for ERC20 Tokens (notice: msg.value = amountIn + oracle fee)
    /// @param  token The address of ERC20 Token
    /// @param  amountIn The exact amount of ETH a trader want to swap into pool
    /// @param  amountOutMin The minimum amount of Token a trader want to swap out of pool
    /// @param  to The target address receiving the Token
    /// @param  rewardTo The target address receiving the CoFi Token as rewards
    /// @param  deadline The dealine of this request
    /// @return _amountIn The real amount of ETH transferred into pool
    /// @return _amountOut The real amount of Token transferred out of pool
    function swapExactETHForTokens(
        address token,
        uint amountIn,
        uint amountOutMin,
        address to,
        address rewardTo,
        uint deadline
    ) external payable returns (uint _amountIn, uint _amountOut);

    /// @dev Trader swap exact amount of ERC20 Tokens for ETH (notice: msg.value = oracle fee)
    /// @param  token The address of ERC20 Token
    /// @param  amountIn The exact amount of Token a trader want to swap into pool
    /// @param  amountOutMin The mininum amount of ETH a trader want to swap out of pool
    /// @param  to The target address receiving the ETH
    /// @param  rewardTo The target address receiving the CoFi Token as rewards
    /// @param  deadline The dealine of this request
    /// @return _amountIn The real amount of Token transferred into pool
    /// @return _amountOut The real amount of ETH transferred out of pool
    function swapExactTokensForETH(
        address token,
        uint amountIn,
        uint amountOutMin,
        address to,
        address rewardTo,
        uint deadline
    ) external payable returns (uint _amountIn, uint _amountOut);

    /// @dev Trader swap exact amount of ERC20 Tokens for other ERC20 Tokens (notice: msg.value = oracle fee)
    /// @param  tokenIn The address of ERC20 Token a trader want to swap into pool
    /// @param  tokenOut The address of ERC20 Token a trader want to swap out of pool
    /// @param  amountIn The exact amount of Token a trader want to swap into pool
    /// @param  amountOutMin The mininum amount of ETH a trader want to swap out of pool
    /// @param  to The target address receiving the Token
    /// @param  rewardTo The target address receiving the CoFi Token as rewards
    /// @param  deadline The dealine of this request
    /// @return _amountIn The real amount of Token transferred into pool
    /// @return _amountOut The real amount of Token transferred out of pool
    function swapExactTokensForTokens(
        address tokenIn,
        address tokenOut,
        uint amountIn,
        uint amountOutMin,
        address to,
        address rewardTo,
        uint deadline
    ) external payable returns (uint _amountIn, uint _amountOut);

    /// @dev Swaps an exact amount of input tokens for as many output tokens as possible, along the route determined by the path. The first element of path is the input token, the last is the output token, and any intermediate elements represent intermediate pairs to trade through (if, for example, a direct pair does not exist). `msg.sender` should have already given the router an allowance of at least amountIn on the input token. The swap execution can be done via cofix or uniswap. That's why it's called hybrid.
    /// @param amountIn The amount of input tokens to send.
    /// @param amountOutMin The minimum amount of output tokens that must be received for the transaction not to revert.
    /// @param path An array of token addresses. path.length must be >= 2. Pools for each consecutive pair of addresses must exist and have liquidity.
    /// @param dexes An array of dex type values, specifying the exchanges to be used, e.g. CoFiX, Uniswap.
    /// @param to Recipient of the output tokens.
    /// @param  rewardTo The target address receiving the CoFi Token as rewards.
    /// @param deadline Unix timestamp after which the transaction will revert.
    /// @return amounts The input token amount and all subsequent output token amounts.
    function hybridSwapExactTokensForTokens(
        uint amountIn,
        uint amountOutMin,
        address[] calldata path,
        DEX_TYPE[] calldata dexes,
        address to,
        address rewardTo,
        uint deadline
    ) external payable returns (uint[] memory amounts);

    /// @dev Swaps an exact amount of ETH for as many output tokens as possible, along the route determined by the path. The first element of path must be WETH, the last is the output token, and any intermediate elements represent intermediate pairs to trade through (if, for example, a direct pair does not exist).
    /// @param amountIn The amount of input tokens to send.
    /// @param amountOutMin The minimum amount of output tokens that must be received for the transaction not to revert.
    /// @param path An array of token addresses. path.length must be >= 2. Pools for each consecutive pair of addresses must exist and have liquidity.
    /// @param dexes An array of dex type values, specifying the exchanges to be used, e.g. CoFiX, Uniswap.
    /// @param to Recipient of the output tokens.
    /// @param  rewardTo The target address receiving the CoFi Token as rewards.
    /// @param deadline Unix timestamp after which the transaction will revert.
    /// @return amounts The input token amount and all subsequent output token amounts.
    function hybridSwapExactETHForTokens(
        uint amountIn,
        uint amountOutMin,
        address[] calldata path,
        DEX_TYPE[] calldata dexes,
        address to,
        address rewardTo,
        uint deadline
    ) external payable returns (uint[] memory amounts);

    /// @dev Swaps an exact amount of tokens for as much ETH as possible, along the route determined by the path. The first element of path is the input token, the last must be WETH, and any intermediate elements represent intermediate pairs to trade through (if, for example, a direct pair does not exist). If the to address is a smart contract, it must have the ability to receive ETH.
    /// @param amountIn The amount of input tokens to send.
    /// @param amountOutMin The minimum amount of output tokens that must be received for the transaction not to revert.
    /// @param path An array of token addresses. path.length must be >= 2. Pools for each consecutive pair of addresses must exist and have liquidity.
    /// @param dexes An array of dex type values, specifying the exchanges to be used, e.g. CoFiX, Uniswap.
    /// @param to Recipient of the output tokens.
    /// @param  rewardTo The target address receiving the CoFi Token as rewards.
    /// @param deadline Unix timestamp after which the transaction will revert.
    /// @return amounts The input token amount and all subsequent output token amounts.
    function hybridSwapExactTokensForETH(
        uint amountIn,
        uint amountOutMin,
        address[] calldata path,
        DEX_TYPE[] calldata dexes,
        address to,
        address rewardTo,
        uint deadline
    ) external payable returns (uint[] memory amounts);

}

File 6 of 13 : ICoFiXStakingRewards.sol
// SPDX-License-Identifier: MIT

pragma solidity 0.6.12;


interface ICoFiXStakingRewards {
    // Views

    /// @dev The rewards vault contract address set in factory contract
    /// @return Returns the vault address
    function rewardsVault() external view returns (address);

    /// @dev The lastBlock reward applicable
    /// @return Returns the latest block.number on-chain
    function lastBlockRewardApplicable() external view returns (uint256);

    /// @dev Reward amount represents by per staking token
    function rewardPerToken() external view returns (uint256);

    /// @dev How many reward tokens a user has earned but not claimed at present
    /// @param  account The target account
    /// @return The amount of reward tokens a user earned
    function earned(address account) external view returns (uint256);

    /// @dev How many reward tokens accrued recently
    /// @return The amount of reward tokens accrued recently
    function accrued() external view returns (uint256);

    /// @dev Get the latest reward rate of this mining pool (tokens amount per block)
    /// @return The latest reward rate
    function rewardRate() external view returns (uint256);

    /// @dev How many stakingToken (XToken) deposited into to this reward pool (mining pool)
    /// @return The total amount of XTokens deposited in this mining pool
    function totalSupply() external view returns (uint256);

    /// @dev How many stakingToken (XToken) deposited by the target account
    /// @param  account The target account
    /// @return The total amount of XToken deposited in this mining pool
    function balanceOf(address account) external view returns (uint256);

    /// @dev Get the address of token for staking in this mining pool
    /// @return The staking token address
    function stakingToken() external view returns (address);

    /// @dev Get the address of token for rewards in this mining pool
    /// @return The rewards token address
    function rewardsToken() external view returns (address);

    // Mutative

    /// @dev Stake/Deposit into the reward pool (mining pool)
    /// @param  amount The target amount
    function stake(uint256 amount) external;

    /// @dev Stake/Deposit into the reward pool (mining pool) for other account
    /// @param  other The target account
    /// @param  amount The target amount
    function stakeForOther(address other, uint256 amount) external;

    /// @dev Withdraw from the reward pool (mining pool), get the original tokens back
    /// @param  amount The target amount
    function withdraw(uint256 amount) external;

    /// @dev Withdraw without caring about rewards. EMERGENCY ONLY.
    function emergencyWithdraw() external;

    /// @dev Claim the reward the user earned
    function getReward() external;

    function getRewardAndStake() external;

    /// @dev User exit the reward pool, it's actually withdraw and getReward
    function exit() external;

    /// @dev Add reward to the mining pool
    function addReward(uint256 amount) external;

    // Events
    event RewardAdded(address sender, uint256 reward);
    event Staked(address indexed user, uint256 amount);
    event StakedForOther(address indexed user, address indexed other, uint256 amount);
    event Withdrawn(address indexed user, uint256 amount);
    event EmergencyWithdraw(address indexed user, uint256 amount);
    event RewardPaid(address indexed user, uint256 reward);
}

File 7 of 13 : ICoFiXVaultForLP.sol
// SPDX-License-Identifier: GPL-3.0-or-later

pragma solidity 0.6.12;

interface ICoFiXVaultForLP {

    enum POOL_STATE {INVALID, ENABLED, DISABLED}

    event NewPoolAdded(address pool, uint256 index);
    event PoolEnabled(address pool);
    event PoolDisabled(address pool);

    function setGovernance(address _new) external;
    function setInitCoFiRate(uint256 _new) external;
    function setDecayPeriod(uint256 _new) external;
    function setDecayRate(uint256 _new) external;

    function addPool(address pool) external;
    function enablePool(address pool) external;
    function disablePool(address pool) external;
    function setPoolWeight(address pool, uint256 weight) external;
    function batchSetPoolWeight(address[] memory pools, uint256[] memory weights) external;
    function distributeReward(address to, uint256 amount) external;

    function getPendingRewardOfLP(address pair) external view returns (uint256);
    function currentPeriod() external view returns (uint256);
    function currentCoFiRate() external view returns (uint256);
    function currentPoolRate(address pool) external view returns (uint256 poolRate);
    function currentPoolRateByPair(address pair) external view returns (uint256 poolRate);

    /// @dev Get the award staking pool address of pair (XToken)
    /// @param  pair The address of XToken(pair) contract
    /// @return pool The pool address
    function stakingPoolForPair(address pair) external view returns (address pool);

    function getPoolInfo(address pool) external view returns (POOL_STATE state, uint256 weight);
    function getPoolInfoByPair(address pair) external view returns (POOL_STATE state, uint256 weight);

    function getEnabledPoolCnt() external view returns (uint256);

    function getCoFiStakingPool() external view returns (address pool);

}

File 8 of 13 : ICoFiXVaultForTrader.sol
// SPDX-License-Identifier: GPL-3.0-or-later

pragma solidity 0.6.12;

interface ICoFiXVaultForTrader {

    event RouterAllowed(address router);
    event RouterDisallowed(address router);

    event ClearPendingRewardOfCNode(uint256 pendingAmount);
    event ClearPendingRewardOfLP(uint256 pendingAmount);

    function setGovernance(address gov) external;

    function setExpectedYieldRatio(uint256 r) external;
    function setLRatio(uint256 lRatio) external;
    function setTheta(uint256 theta) external;

    function allowRouter(address router) external;

    function disallowRouter(address router) external;

    function calcCoFiRate(uint256 bt_phi, uint256 xt, uint256 np) external view returns (uint256 at);

    function currentCoFiRate(address pair, uint256 np) external view returns (uint256);

    function currentThreshold(address pair, uint256 np, uint256 cofiRate) external view returns (uint256);

    function stdMiningRateAndAmount(address pair, uint256 np, uint256 thetaFee) external view returns (uint256 cofiRate, uint256 stdAmount);

    function calcDensity(uint256 _stdAmount) external view returns (uint256);

    function calcLambda(uint256 x, uint256 y) external pure returns (uint256);

    function actualMiningAmountAndDensity(address pair, uint256 thetaFee, uint256 x, uint256 y, uint256 np) external view returns (uint256 amount, uint256 density, uint256 cofiRate);

    function distributeReward(address pair, uint256 thetaFee, uint256 x, uint256 y, uint256 np, address rewardTo) external;

    function clearPendingRewardOfCNode() external;

    function clearPendingRewardOfLP(address pair) external;

    function getPendingRewardOfCNode() external view returns (uint256);

    function getPendingRewardOfLP(address pair) external view returns (uint256);

    function getCoFiRateCache(address pair) external view returns (uint256 cofiRate, uint256 updatedBlock);
}

File 9 of 13 : IWETH.sol
// SPDX-License-Identifier: GPL-3.0-or-later

pragma solidity 0.6.12;

interface IWETH {
    function deposit() external payable;
    function transfer(address to, uint value) external returns (bool);
    function withdraw(uint) external;
    function balanceOf(address account) external view returns (uint);
}

File 10 of 13 : TransferHelper.sol
// SPDX-License-Identifier: GPL-3.0-or-later

pragma solidity 0.6.12;

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

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

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

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

File 11 of 13 : UniswapV2Library.sol
// SPDX-License-Identifier: GPL-3.0-or-later

pragma solidity 0.6.12;

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

interface IUniswapV2Pair {
    function getReserves() external view returns (uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast);
    function swap(uint amount0Out, uint amount1Out, address to, bytes calldata data) external;
}

library UniswapV2Library {
    using SafeMath for uint;

    // returns sorted token addresses, used to handle return values from pairs sorted in this order
    function sortTokens(address tokenA, address tokenB) internal pure returns (address token0, address token1) {
        require(tokenA != tokenB, 'UniswapV2Library: IDENTICAL_ADDRESSES');
        (token0, token1) = tokenA < tokenB ? (tokenA, tokenB) : (tokenB, tokenA);
        require(token0 != address(0), 'UniswapV2Library: ZERO_ADDRESS');
    }

    // calculates the CREATE2 address for a pair without making any external calls
    function pairFor(address factory, address tokenA, address tokenB) internal pure returns (address pair) {
        (address token0, address token1) = sortTokens(tokenA, tokenB);
        pair = address(uint(keccak256(abi.encodePacked(
                hex'ff',
                factory,
                keccak256(abi.encodePacked(token0, token1)),
                hex'96e8ac4277198ff8b6f785478aa9a39f403cb768dd02cbee326c3e7da348845f' // init code hash
            ))));
    }

    // fetches and sorts the reserves for a pair
    function getReserves(address factory, address tokenA, address tokenB) internal view returns (uint reserveA, uint reserveB) {
        (address token0,) = sortTokens(tokenA, tokenB);
        (uint reserve0, uint reserve1,) = IUniswapV2Pair(pairFor(factory, tokenA, tokenB)).getReserves();
        (reserveA, reserveB) = tokenA == token0 ? (reserve0, reserve1) : (reserve1, reserve0);
    }

    // given some amount of an asset and pair reserves, returns an equivalent amount of the other asset
    function quote(uint amountA, uint reserveA, uint reserveB) internal pure returns (uint amountB) {
        require(amountA > 0, 'UniswapV2Library: INSUFFICIENT_AMOUNT');
        require(reserveA > 0 && reserveB > 0, 'UniswapV2Library: INSUFFICIENT_LIQUIDITY');
        amountB = amountA.mul(reserveB) / reserveA;
    }

    // given an input amount of an asset and pair reserves, returns the maximum output amount of the other asset
    function getAmountOut(uint amountIn, uint reserveIn, uint reserveOut) internal pure returns (uint amountOut) {
        require(amountIn > 0, 'UniswapV2Library: INSUFFICIENT_INPUT_AMOUNT');
        require(reserveIn > 0 && reserveOut > 0, 'UniswapV2Library: INSUFFICIENT_LIQUIDITY');
        uint amountInWithFee = amountIn.mul(997);
        uint numerator = amountInWithFee.mul(reserveOut);
        uint denominator = reserveIn.mul(1000).add(amountInWithFee);
        amountOut = numerator / denominator;
    }

    // given an output amount of an asset and pair reserves, returns a required input amount of the other asset
    function getAmountIn(uint amountOut, uint reserveIn, uint reserveOut) internal pure returns (uint amountIn) {
        require(amountOut > 0, 'UniswapV2Library: INSUFFICIENT_OUTPUT_AMOUNT');
        require(reserveIn > 0 && reserveOut > 0, 'UniswapV2Library: INSUFFICIENT_LIQUIDITY');
        uint numerator = reserveIn.mul(amountOut).mul(1000);
        uint denominator = reserveOut.sub(amountOut).mul(997);
        amountIn = (numerator / denominator).add(1);
    }

    // performs chained getAmountOut calculations on any number of pairs
    function getAmountsOut(address factory, uint amountIn, address[] memory path) internal view returns (uint[] memory amounts) {
        require(path.length >= 2, 'UniswapV2Library: INVALID_PATH');
        amounts = new uint[](path.length);
        amounts[0] = amountIn;
        for (uint i; i < path.length - 1; i++) {
            (uint reserveIn, uint reserveOut) = getReserves(factory, path[i], path[i + 1]);
            amounts[i + 1] = getAmountOut(amounts[i], reserveIn, reserveOut);
        }
    }

    // performs chained getAmountIn calculations on any number of pairs
    function getAmountsIn(address factory, uint amountOut, address[] memory path) internal view returns (uint[] memory amounts) {
        require(path.length >= 2, 'UniswapV2Library: INVALID_PATH');
        amounts = new uint[](path.length);
        amounts[amounts.length - 1] = amountOut;
        for (uint i = path.length - 1; i > 0; i--) {
            (uint reserveIn, uint reserveOut) = getReserves(factory, path[i - 1], path[i]);
            amounts[i - 1] = getAmountIn(amounts[i], reserveIn, reserveOut);
        }
    }
}

File 12 of 13 : SafeMath.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.6.0;

/**
 * @dev Wrappers over Solidity's arithmetic operations with added overflow
 * checks.
 *
 * Arithmetic operations in Solidity wrap on overflow. This can easily result
 * in bugs, because programmers usually assume that an overflow raises an
 * error, which is the standard behavior in high level programming languages.
 * `SafeMath` restores this intuition by reverting the transaction when an
 * operation overflows.
 *
 * Using this library instead of the unchecked operations eliminates an entire
 * class of bugs, so it's recommended to use it always.
 */
library SafeMath {
    /**
     * @dev Returns the addition of two unsigned integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `+` operator.
     *
     * Requirements:
     *
     * - Addition cannot overflow.
     */
    function add(uint256 a, uint256 b) internal pure returns (uint256) {
        uint256 c = a + b;
        require(c >= a, "SafeMath: addition overflow");

        return c;
    }

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

    /**
     * @dev Returns the subtraction of two unsigned integers, reverting with custom message on
     * overflow (when the result is negative).
     *
     * Counterpart to Solidity's `-` operator.
     *
     * Requirements:
     *
     * - Subtraction cannot overflow.
     */
    function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
        require(b <= a, errorMessage);
        uint256 c = a - b;

        return c;
    }

    /**
     * @dev Returns the multiplication of two unsigned integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `*` operator.
     *
     * Requirements:
     *
     * - Multiplication cannot overflow.
     */
    function mul(uint256 a, uint256 b) internal pure returns (uint256) {
        // Gas optimization: this is cheaper than requiring 'a' not being zero, but the
        // benefit is lost if 'b' is also tested.
        // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
        if (a == 0) {
            return 0;
        }

        uint256 c = a * b;
        require(c / a == b, "SafeMath: multiplication overflow");

        return c;
    }

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

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

        return c;
    }

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

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

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

pragma solidity ^0.6.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);
}

Settings
{
  "remappings": [],
  "optimizer": {
    "enabled": true,
    "runs": 6666
  },
  "evmVersion": "istanbul",
  "libraries": {
    "": {}
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "abi"
      ]
    }
  }
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"_factory","type":"address"},{"internalType":"address","name":"_uniFactory","type":"address"},{"internalType":"address","name":"_WETH","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"WETH","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"amountETH","type":"uint256"},{"internalType":"uint256","name":"amountToken","type":"uint256"},{"internalType":"uint256","name":"liquidityMin","type":"uint256"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"deadline","type":"uint256"}],"name":"addLiquidity","outputs":[{"internalType":"uint256","name":"liquidity","type":"uint256"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"amountETH","type":"uint256"},{"internalType":"uint256","name":"amountToken","type":"uint256"},{"internalType":"uint256","name":"liquidityMin","type":"uint256"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"deadline","type":"uint256"}],"name":"addLiquidityAndStake","outputs":[{"internalType":"uint256","name":"liquidity","type":"uint256"}],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"factory","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"input","type":"address"},{"internalType":"address","name":"output","type":"address"},{"internalType":"enum ICoFiXRouter02.DEX_TYPE","name":"dex","type":"uint8"}],"name":"getPairForDEX","outputs":[{"internalType":"address","name":"pair","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"input","type":"address"},{"internalType":"address","name":"output","type":"address"}],"name":"hybridPair","outputs":[{"internalType":"bool","name":"useCoFiX","type":"bool"},{"internalType":"address","name":"pair","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amountIn","type":"uint256"},{"internalType":"uint256","name":"amountOutMin","type":"uint256"},{"internalType":"address[]","name":"path","type":"address[]"},{"internalType":"enum ICoFiXRouter02.DEX_TYPE[]","name":"dexes","type":"uint8[]"},{"internalType":"address","name":"to","type":"address"},{"internalType":"address","name":"rewardTo","type":"address"},{"internalType":"uint256","name":"deadline","type":"uint256"}],"name":"hybridSwapExactETHForTokens","outputs":[{"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amountIn","type":"uint256"},{"internalType":"uint256","name":"amountOutMin","type":"uint256"},{"internalType":"address[]","name":"path","type":"address[]"},{"internalType":"enum ICoFiXRouter02.DEX_TYPE[]","name":"dexes","type":"uint8[]"},{"internalType":"address","name":"to","type":"address"},{"internalType":"address","name":"rewardTo","type":"address"},{"internalType":"uint256","name":"deadline","type":"uint256"}],"name":"hybridSwapExactTokensForETH","outputs":[{"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amountIn","type":"uint256"},{"internalType":"uint256","name":"amountOutMin","type":"uint256"},{"internalType":"address[]","name":"path","type":"address[]"},{"internalType":"enum ICoFiXRouter02.DEX_TYPE[]","name":"dexes","type":"uint8[]"},{"internalType":"address","name":"to","type":"address"},{"internalType":"address","name":"rewardTo","type":"address"},{"internalType":"uint256","name":"deadline","type":"uint256"}],"name":"hybridSwapExactTokensForTokens","outputs":[{"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"input","type":"address"},{"internalType":"address","name":"output","type":"address"}],"name":"isCoFiXNativeSupported","outputs":[{"internalType":"bool","name":"supported","type":"bool"},{"internalType":"address","name":"pair","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"liquidity","type":"uint256"},{"internalType":"uint256","name":"amountETHMin","type":"uint256"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"deadline","type":"uint256"}],"name":"removeLiquidityGetETH","outputs":[{"internalType":"uint256","name":"amountETH","type":"uint256"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"liquidity","type":"uint256"},{"internalType":"uint256","name":"amountTokenMin","type":"uint256"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"deadline","type":"uint256"}],"name":"removeLiquidityGetToken","outputs":[{"internalType":"uint256","name":"amountToken","type":"uint256"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"amountIn","type":"uint256"},{"internalType":"uint256","name":"amountOutMin","type":"uint256"},{"internalType":"address","name":"to","type":"address"},{"internalType":"address","name":"rewardTo","type":"address"},{"internalType":"uint256","name":"deadline","type":"uint256"}],"name":"swapExactETHForTokens","outputs":[{"internalType":"uint256","name":"_amountIn","type":"uint256"},{"internalType":"uint256","name":"_amountOut","type":"uint256"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"amountIn","type":"uint256"},{"internalType":"uint256","name":"amountOutMin","type":"uint256"},{"internalType":"address","name":"to","type":"address"},{"internalType":"address","name":"rewardTo","type":"address"},{"internalType":"uint256","name":"deadline","type":"uint256"}],"name":"swapExactTokensForETH","outputs":[{"internalType":"uint256","name":"_amountIn","type":"uint256"},{"internalType":"uint256","name":"_amountOut","type":"uint256"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"tokenIn","type":"address"},{"internalType":"address","name":"tokenOut","type":"address"},{"internalType":"uint256","name":"amountIn","type":"uint256"},{"internalType":"uint256","name":"amountOutMin","type":"uint256"},{"internalType":"address","name":"to","type":"address"},{"internalType":"address","name":"rewardTo","type":"address"},{"internalType":"uint256","name":"deadline","type":"uint256"}],"name":"swapExactTokensForTokens","outputs":[{"internalType":"uint256","name":"_amountIn","type":"uint256"},{"internalType":"uint256","name":"_amountOut","type":"uint256"}],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"uniFactory","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"stateMutability":"payable","type":"receive"}]

60e060405234801561001057600080fd5b5060405162004481380380620044818339818101604052606081101561003557600080fd5b50805160208201516040909201516001600160601b0319606092831b811660805292821b831660a052901b1660c05260805160601c60a05160601c60c05160601c61431f62000162600039806107ce5280610ab55280610c935280610cd05280610d155280610d7f5280610e645280610fa7528061101b52806112e052806113825280611aea5280611da05280612153528061226b52806122f3528061247252806124e65280612c935280612d7b528061305252806130c6525080610c0d52806116f4528061202d5280613bc4525080610d515280610dbb5280611359528061154852806117d95280611a6e5280611bd35280611d2f528061210452806123d652806126595280612ac75280612b9d5280612e665280612f0e528061301152806139d7525061431f6000f3fe6080604052600436106100f75760003560e01c806376771d4b1161008a578063bd9fe57f11610059578063bd9fe57f146105dc578063c45a0155146106c3578063e1a385dd146106d8578063e5d893651461071a576100fe565b806376771d4b14610524578063acdb6cd414610539578063ad5c464814610581578063bd23f30e14610596576100fe565b80632f59c2d5116100c65780632f59c2d5146103e257806337848c8a146104435780633f3f246a1461047e57806346c173a2146104d2576100fe565b80630117c1751461010357806302f57e301461023a5780631d3c240b1461029d57806321757292146102fb576100fe565b366100fe57005b600080fd5b6101ea600480360360e081101561011957600080fd5b81359160208101359181019060608101604082013564010000000081111561014057600080fd5b82018360208201111561015257600080fd5b8035906020019184602083028401116401000000008311171561017457600080fd5b91939092909160208101903564010000000081111561019257600080fd5b8201836020820111156101a457600080fd5b803590602001918460208302840111640100000000831117156101c657600080fd5b91935091506001600160a01b03813581169160208101359091169060400135610760565b60408051602080825283518183015283519192839290830191858101910280838360005b8381101561022657818101518382015260200161020e565b505050509050019250505060405180910390f35b34801561024657600080fd5b506102816004803603606081101561025d57600080fd5b5080356001600160a01b03908116916020810135909116906040013560ff16610b77565b604080516001600160a01b039092168252519081900360200190f35b3480156102a957600080fd5b506102d8600480360360408110156102c057600080fd5b506001600160a01b0381358116916020013516610c8e565b6040805192151583526001600160a01b0390911660208301528051918290030190f35b6101ea600480360360e081101561031157600080fd5b81359160208101359181019060608101604082013564010000000081111561033857600080fd5b82018360208201111561034a57600080fd5b8035906020019184602083028401116401000000008311171561036c57600080fd5b91939092909160208101903564010000000081111561038a57600080fd5b82018360208201111561039c57600080fd5b803590602001918460208302840111640100000000831117156103be57600080fd5b91935091506001600160a01b03813581169160208101359091169060400135610dfe565b61042a600480360360c08110156103f857600080fd5b506001600160a01b03813581169160208101359160408201359160608101358216916080820135169060a00135611231565b6040805192835260208301919091528051918290030190f35b34801561044f57600080fd5b506102d86004803603604081101561046657600080fd5b506001600160a01b03813581169160200135166116d0565b6104c0600480360360a081101561049457600080fd5b506001600160a01b03813581169160208101359160408201359160608101359091169060800135611725565b60408051918252519081900360200190f35b61042a600480360360e08110156104e857600080fd5b506001600160a01b0381358116916020810135821691604082013591606081013591608082013581169160a08101359091169060c001356119b3565b34801561053057600080fd5b5061028161202b565b61042a600480360360c081101561054f57600080fd5b506001600160a01b03813581169160208101359160408201359160608101358216916080820135169060a0013561204f565b34801561058d57600080fd5b506102816122f1565b6104c0600480360360c08110156105ac57600080fd5b506001600160a01b0381358116916020810135916040820135916060810135916080820135169060a00135612315565b6101ea600480360360e08110156105f257600080fd5b81359160208101359181019060608101604082013564010000000081111561061957600080fd5b82018360208201111561062b57600080fd5b8035906020019184602083028401116401000000008311171561064d57600080fd5b91939092909160208101903564010000000081111561066b57600080fd5b82018360208201111561067d57600080fd5b8035906020019184602083028401116401000000008311171561069f57600080fd5b91935091506001600160a01b03813581169160208101359091169060400135612971565b3480156106cf57600080fd5b50610281612ac5565b6104c0600480360360a08110156106ee57600080fd5b506001600160a01b03813581169160208101359160408201359160608101359091169060800135612ae9565b6104c0600480360360c081101561073057600080fd5b506001600160a01b0381358116916020810135916040820135916060810135916080820135169060a00135612e01565b606081428110156107b8576040805162461bcd60e51b815260206004820152601060248201527f43526f757465723a204558504952454400000000000000000000000000000000604482015290519081900360640190fd5b6002881080159061081957506001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016898960001981018181106107fe57fe5b905060200201356001600160a01b03166001600160a01b0316145b61086a576040805162461bcd60e51b815260206004820152601560248201527f43526f757465723a20696e76616c696420706174680000000000000000000000604482015290519081900360640190fd5b600019880186146108c2576040805162461bcd60e51b815260206004820152601660248201527f43526f757465723a20696e76616c696420646578657300000000000000000000604482015290519081900360640190fd5b610900878780806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250349250613253915050565b61098d8989600081811061091057fe5b905060200201356001600160a01b0316336109878c8c600081811061093157fe5b905060200201356001600160a01b03168d8d600181811061094e57fe5b905060200201356001600160a01b03168c8c600081811061096b57fe5b9050602002013560018111801561098157600080fd5b50610b77565b8e613300565b8767ffffffffffffffff811180156109a457600080fd5b506040519080825280602002602001820160405280156109ce578160200160208202803683370190505b5091508a826000815181106109df57fe5b602002602001018181525050610a5d89898080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525050604080516020808d0282810182019093528c82529093508c92508b9182918501908490808284376000920191909152508792503091508990506134a9565b8982600184510381518110610a6e57fe5b60200260200101511015610ab35760405162461bcd60e51b815260040180806020018281038252602481526020018061422f6024913960400191505060405180910390fd5b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316632e1a7d4d83600185510381518110610af257fe5b60200260200101516040518263ffffffff1660e01b815260040180828152602001915050600060405180830381600087803b158015610b3057600080fd5b505af1158015610b44573d6000803e3d6000fd5b50505050610b698583600185510381518110610b5c57fe5b602002602001015161352e565b509998505050505050505050565b600080826001811115610b8657fe5b1415610bf4576000610b988585610c8e565b9250905080610bee576040805162461bcd60e51b815260206004820152601f60248201527f43526f757465723a206e6f7420617661696c61626c65206f6e20436f46695800604482015290519081900360640190fd5b50610c87565b6001826001811115610c0257fe5b1415610c3a57610c337f0000000000000000000000000000000000000000000000000000000000000000858561363f565b9050610c87565b6040805162461bcd60e51b815260206004820152601460248201527f43526f757465723a20756e6b6e6f776e20646578000000000000000000000000604482015290519081900360640190fd5b9392505050565b6000807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316846001600160a01b031614158015610d0557507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316836001600160a01b031614155b15610d135760009150610df7565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316846001600160a01b031614610d7d57610d767f00000000000000000000000000000000000000000000000000000000000000008561372a565b9050610de3565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316836001600160a01b031614610de357610de07f00000000000000000000000000000000000000000000000000000000000000008461372a565b90505b6001600160a01b03811615610df757600191505b9250929050565b60608142811015610e56576040805162461bcd60e51b815260206004820152601060248201527f43526f757465723a204558504952454400000000000000000000000000000000604482015290519081900360640190fd5b60028810801590610eb457507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031689896000818110610e9957fe5b905060200201356001600160a01b03166001600160a01b0316145b610f05576040805162461bcd60e51b815260206004820152601560248201527f43526f757465723a20696e76616c696420706174680000000000000000000000604482015290519081900360640190fd5b60001988018614610f5d576040805162461bcd60e51b815260206004820152601660248201527f43526f757465723a20696e76616c696420646578657300000000000000000000604482015290519081900360640190fd5b610fa5878780806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250610fa092503491508f90506137ae565b613253565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663d0e30db08c6040518263ffffffff1660e01b81526004016000604051808303818588803b15801561100057600080fd5b505af1158015611014573d6000803e3d6000fd5b50505050507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663a9059cbb6110928b8b600081811061105857fe5b905060200201356001600160a01b03168c8c600181811061107557fe5b905060200201356001600160a01b03168b8b600081811061096b57fe5b8d6040518363ffffffff1660e01b815260040180836001600160a01b0316815260200182815260200192505050602060405180830381600087803b1580156110d957600080fd5b505af11580156110ed573d6000803e3d6000fd5b505050506040513d602081101561110357600080fd5b505161110b57fe5b8767ffffffffffffffff8111801561112257600080fd5b5060405190808252806020026020018201604052801561114c578160200160208202803683370190505b5091508a8260008151811061115d57fe5b6020026020010181815250506111db89898080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525050604080516020808d0282810182019093528c82529093508c92508b9182918501908490808284376000920191909152508792508a91508990506134a9565b89826001845103815181106111ec57fe5b60200260200101511015610b695760405162461bcd60e51b815260040180806020018281038252602481526020018061422f6024913960400191505060405180910390fd5b600080824281101561128a576040805162461bcd60e51b815260206004820152601060248201527f43526f757465723a204558504952454400000000000000000000000000000000604482015290519081900360640190fd5b8734116112de576040805162461bcd60e51b815260206004820152601f60248201527f43526f757465723a20696e73756666696369656e74206d73672e76616c756500604482015290519081900360640190fd5b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663d0e30db0896040518263ffffffff1660e01b81526004016000604051808303818588803b15801561133957600080fd5b505af115801561134d573d6000803e3d6000fd5b5050505050600061137e7f00000000000000000000000000000000000000000000000000000000000000008b61372a565b90507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663a9059cbb828b6040518363ffffffff1660e01b815260040180836001600160a01b0316815260200182815260200192505050602060405180830381600087803b1580156113f757600080fd5b505af115801561140b573d6000803e3d6000fd5b505050506040513d602081101561142157600080fd5b505161142957fe5b6000611433614184565b6001600160a01b038316639f44296a61144c348e6137ae565b8e8c6040518463ffffffff1660e01b815260040180836001600160a01b03168152602001826001600160a01b031681526020019250505060e0604051808303818588803b15801561149c57600080fd5b505af11580156114b0573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525060e08110156114d657600080fd5b5080516020820151604083015191985096509250606001905089851015611544576040805162461bcd60e51b815260206004820152601f60248201527f43526f757465723a20676f74206c657373207468616e20657870656374656400604482015290519081900360640190fd5b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663b58aa4786040518163ffffffff1660e01b815260040160206040518083038186803b15801561159f57600080fd5b505afa1580156115b3573d6000803e3d6000fd5b505050506040513d60208110156115c957600080fd5b50518251909150158015906115e657506001600160a01b03891615155b80156115fa57506001600160a01b03811615155b156116b05781516020830151604080850151606086015182517f5e3ddd690000000000000000000000000000000000000000000000000000000081526001600160a01b038a8116600483015260248201969096526044810194909452606484019190915260848301528b831660a48301525191831691635e3ddd699160c48082019260009290919082900301818387803b15801561169757600080fd5b505af11580156116ab573d6000803e3d6000fd5b505050505b82156116c0576116c0338461352e565b5050505050965096945050505050565b6000806116dd8484610c8e565b909250905081156116ed57610df7565b600061171a7f0000000000000000000000000000000000000000000000000000000000000000868661363f565b915091509250929050565b6000814281101561177d576040805162461bcd60e51b815260206004820152601060248201527f43526f757465723a204558504952454400000000000000000000000000000000604482015290519081900360640190fd5b600034116117d2576040805162461bcd60e51b815260206004820152601f60248201527f43526f757465723a20696e73756666696369656e74206d73672e76616c756500604482015290519081900360640190fd5b60006117fe7f00000000000000000000000000000000000000000000000000000000000000008961372a565b604080517f23b872dd0000000000000000000000000000000000000000000000000000000081523360048201526001600160a01b03831660248201819052604482018b9052915192935090916323b872dd916064808201926020929091908290030181600087803b15801561187257600080fd5b505af1158015611886573d6000803e3d6000fd5b505050506040513d602081101561189c57600080fd5b5050604080517f27fc84a30000000000000000000000000000000000000000000000000000000081526001600160a01b038a8116600483015287811660248301528251600093918516926327fc84a392349260448084019382900301818588803b15801561190957600080fd5b505af115801561191d573d6000803e3d6000fd5b50505050506040513d604081101561193457600080fd5b508051602090910151909450905086841015611997576040805162461bcd60e51b815260206004820152601f60248201527f43526f757465723a20676f74206c657373207468616e20657870656374656400604482015290519081900360640190fd5b80156119a7576119a7338261352e565b50505095945050505050565b6000808242811015611a0c576040805162461bcd60e51b815260206004820152601060248201527f43526f757465723a204558504952454400000000000000000000000000000000604482015290519081900360640190fd5b60003411611a61576040805162461bcd60e51b815260206004820152601f60248201527f43526f757465723a20696e73756666696369656e74206d73672e76616c756500604482015290519081900360640190fd5b611a696141a2565b611a937f00000000000000000000000000000000000000000000000000000000000000008c61372a565b6001600160a01b0316808252611aad908c9033908c613300565b6000611ab7614184565b8251604080517f9f44296a0000000000000000000000000000000000000000000000000000000081526001600160a01b037f00000000000000000000000000000000000000000000000000000000000000008116600483015230602483015291519190921691639f44296a91349160448082019260e09290919082900301818588803b158015611b4657600080fd5b505af1158015611b5a573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525060e0811015611b8057600080fd5b50805160208083015160408085015181517fb58aa4780000000000000000000000000000000000000000000000000000000081529151949b50919950909550606090930193506000926001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169263b58aa47892600480840193919291829003018186803b158015611c1757600080fd5b505afa158015611c2b573d6000803e3d6000fd5b505050506040513d6020811015611c4157600080fd5b5051825190915015801590611c5e57506001600160a01b03891615155b8015611c7257506001600160a01b03811615155b15611d2a57835182516020840151604080860151606087015182517f5e3ddd690000000000000000000000000000000000000000000000000000000081526001600160a01b03968716600482015260248101959095526044850193909352606484015260848301919091528b831660a48301525191831691635e3ddd699160c48082019260009290919082900301818387803b158015611d1157600080fd5b505af1158015611d25573d6000803e3d6000fd5b505050505b611d547f00000000000000000000000000000000000000000000000000000000000000008e61372a565b6001600160a01b039081166020808701829052604080517fa9059cbb0000000000000000000000000000000000000000000000000000000081526004810193909352602483018a9052517f00000000000000000000000000000000000000000000000000000000000000009093169263a9059cbb9260448082019392918290030181600087803b158015611de757600080fd5b505af1158015611dfb573d6000803e3d6000fd5b505050506040513d6020811015611e1157600080fd5b5051611e1957fe5b83600160200201516001600160a01b0316639f44296a848f8d6040518463ffffffff1660e01b815260040180836001600160a01b03168152602001826001600160a01b031681526020019250505060e0604051808303818588803b158015611e8057600080fd5b505af1158015611e94573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525060e0811015611eba57600080fd5b5060208101516040820151909750935060600191508a861015611f24576040805162461bcd60e51b815260206004820152601f60248201527f43526f757465723a20676f74206c657373207468616e20657870656374656400604482015290519081900360640190fd5b815115801590611f3c57506001600160a01b03891615155b8015611f5057506001600160a01b03811615155b1561200a57602080850151835191840151604080860151606087015182517f5e3ddd690000000000000000000000000000000000000000000000000000000081526001600160a01b03958616600482015260248101969096526044860193909352606485015260848401919091528b821660a48401525190831691635e3ddd699160c480830192600092919082900301818387803b158015611ff157600080fd5b505af1158015612005573d6000803e3d6000fd5b505050505b821561201a5761201a338461352e565b505050505097509795505050505050565b7f000000000000000000000000000000000000000000000000000000000000000081565b60008082428110156120a8576040805162461bcd60e51b815260206004820152601060248201527f43526f757465723a204558504952454400000000000000000000000000000000604482015290519081900360640190fd5b600034116120fd576040805162461bcd60e51b815260206004820152601f60248201527f43526f757465723a20696e73756666696369656e74206d73672e76616c756500604482015290519081900360640190fd5b60006121297f00000000000000000000000000000000000000000000000000000000000000008b61372a565b90506121378a33838c613300565b6000612141614184565b826001600160a01b0316639f44296a347f0000000000000000000000000000000000000000000000000000000000000000306040518463ffffffff1660e01b815260040180836001600160a01b03168152602001826001600160a01b031681526020019250505060e0604051808303818588803b1580156121c157600080fd5b505af11580156121d5573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525060e08110156121fb57600080fd5b5080516020820151604083015191985096509250606001905089851015612269576040805162461bcd60e51b815260206004820152601f60248201527f43526f757465723a20676f74206c657373207468616e20657870656374656400604482015290519081900360640190fd5b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316632e1a7d4d866040518263ffffffff1660e01b815260040180828152602001915050600060405180830381600087803b1580156122cf57600080fd5b505af11580156122e3573d6000803e3d6000fd5b50505050611544898661352e565b7f000000000000000000000000000000000000000000000000000000000000000081565b6000814281101561236d576040805162461bcd60e51b815260206004820152601060248201527f43526f757465723a204558504952454400000000000000000000000000000000604482015290519081900360640190fd5b8634116123c1576040805162461bcd60e51b815260206004820152601f60248201527f43526f757465723a20696e73756666696369656e74206d73672e76616c756500604482015290519081900360640190fd5b60006123cd34896137ae565b905060006123fb7f00000000000000000000000000000000000000000000000000000000000000008b61372a565b90506001600160a01b038116612458576040805162461bcd60e51b815260206004820152601560248201527f43526f757465723a20696e76616c696420706169720000000000000000000000604482015290519081900360640190fd5b871561246a5761246a8a33838b613300565b881561258d577f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663d0e30db08a6040518263ffffffff1660e01b81526004016000604051808303818588803b1580156124cb57600080fd5b505af11580156124df573d6000803e3d6000fd5b50505050507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663a9059cbb828b6040518363ffffffff1660e01b815260040180836001600160a01b0316815260200182815260200192505050602060405180830381600087803b15801561255b57600080fd5b505af115801561256f573d6000803e3d6000fd5b505050506040513d602081101561258557600080fd5b505161258d57fe5b6000816001600160a01b0316636a62784284306040518363ffffffff1660e01b815260040180826001600160a01b0316815260200191505060408051808303818588803b1580156125dd57600080fd5b505af11580156125f1573d6000803e3d6000fd5b50505050506040513d604081101561260857600080fd5b5080516020909101519095509050878510156126555760405162461bcd60e51b81526004018080602001828103825260258152602001806142536025913960400191505060405180910390fd5b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663d2d7f8166040518163ffffffff1660e01b815260040160206040518083038186803b1580156126b057600080fd5b505afa1580156126c4573d6000803e3d6000fd5b505050506040513d60208110156126da57600080fd5b5051604080517f38d8294b0000000000000000000000000000000000000000000000000000000081526001600160a01b038681166004830152915191909216916338d8294b916024808301926020929190829003018186803b15801561273f57600080fd5b505afa158015612753573d6000803e3d6000fd5b505050506040513d602081101561276957600080fd5b505190506001600160a01b0381166127c8576040805162461bcd60e51b815260206004820152601d60248201527f43526f757465723a20696e76616c6964207374616b696e6720706f6f6c000000604482015290519081900360640190fd5b826001600160a01b031663095ea7b382886040518363ffffffff1660e01b815260040180836001600160a01b0316815260200182815260200192505050602060405180830381600087803b15801561281f57600080fd5b505af1158015612833573d6000803e3d6000fd5b505050506040513d602081101561284957600080fd5b5050604080517ffe72bd010000000000000000000000000000000000000000000000000000000081526001600160a01b038a811660048301526024820189905291519183169163fe72bd019160448082019260009290919082900301818387803b1580156128b657600080fd5b505af11580156128ca573d6000803e3d6000fd5b50505050826001600160a01b031663095ea7b38260006040518363ffffffff1660e01b815260040180836001600160a01b0316815260200182815260200192505050602060405180830381600087803b15801561292657600080fd5b505af115801561293a573d6000803e3d6000fd5b505050506040513d602081101561295057600080fd5b5050811561296257612962338361352e565b50505050509695505050505050565b606081428110156129c9576040805162461bcd60e51b815260206004820152601060248201527f43526f757465723a204558504952454400000000000000000000000000000000604482015290519081900360640190fd5b6002881015612a1f576040805162461bcd60e51b815260206004820152601560248201527f43526f757465723a20696e76616c696420706174680000000000000000000000604482015290519081900360640190fd5b60001988018614612a77576040805162461bcd60e51b815260206004820152601660248201527f43526f757465723a20696e76616c696420646578657300000000000000000000604482015290519081900360640190fd5b612ab5878780806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250349250613253915050565b61110b8989600081811061091057fe5b7f000000000000000000000000000000000000000000000000000000000000000081565b60008142811015612b41576040805162461bcd60e51b815260206004820152601060248201527f43526f757465723a204558504952454400000000000000000000000000000000604482015290519081900360640190fd5b60003411612b96576040805162461bcd60e51b815260206004820152601f60248201527f43526f757465723a20696e73756666696369656e74206d73672e76616c756500604482015290519081900360640190fd5b6000612bc27f00000000000000000000000000000000000000000000000000000000000000008961372a565b604080517f23b872dd0000000000000000000000000000000000000000000000000000000081523360048201526001600160a01b03831660248201819052604482018b9052915192935090916323b872dd916064808201926020929091908290030181600087803b158015612c3657600080fd5b505af1158015612c4a573d6000803e3d6000fd5b505050506040513d6020811015612c6057600080fd5b5050604080517f27fc84a30000000000000000000000000000000000000000000000000000000081526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000811660048301523060248301528251600093918516926327fc84a392349260448084019382900301818588803b158015612ceb57600080fd5b505af1158015612cff573d6000803e3d6000fd5b50505050506040513d6040811015612d1657600080fd5b508051602090910151909450905086841015612d79576040805162461bcd60e51b815260206004820152601f60248201527f43526f757465723a20676f74206c657373207468616e20657870656374656400604482015290519081900360640190fd5b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316632e1a7d4d856040518263ffffffff1660e01b815260040180828152602001915050600060405180830381600087803b158015612ddf57600080fd5b505af1158015612df3573d6000803e3d6000fd5b50505050611997868561352e565b60008142811015612e59576040805162461bcd60e51b815260206004820152601060248201527f43526f757465723a204558504952454400000000000000000000000000000000604482015290519081900360640190fd5b60006001600160a01b03167f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316631a788a028a6040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b158015612ed157600080fd5b505afa158015612ee5573d6000803e3d6000fd5b505050506040513d6020811015612efb57600080fd5b50516001600160a01b03161415612fa8577f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316639ccb0744896040518263ffffffff1660e01b815260040180826001600160a01b03168152602001915050602060405180830381600087803b158015612f7b57600080fd5b505af1158015612f8f573d6000803e3d6000fd5b505050506040513d6020811015612fa557600080fd5b50505b863411612ffc576040805162461bcd60e51b815260206004820152601f60248201527f43526f757465723a20696e73756666696369656e74206d73672e76616c756500604482015290519081900360640190fd5b600061300834896137ae565b905060006130367f00000000000000000000000000000000000000000000000000000000000000008b61372a565b9050871561304a5761304a8a33838b613300565b881561316d577f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663d0e30db08a6040518263ffffffff1660e01b81526004016000604051808303818588803b1580156130ab57600080fd5b505af11580156130bf573d6000803e3d6000fd5b50505050507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663a9059cbb828b6040518363ffffffff1660e01b815260040180836001600160a01b0316815260200182815260200192505050602060405180830381600087803b15801561313b57600080fd5b505af115801561314f573d6000803e3d6000fd5b505050506040513d602081101561316557600080fd5b505161316d57fe5b6000816001600160a01b0316636a62784284896040518363ffffffff1660e01b815260040180826001600160a01b0316815260200191505060408051808303818588803b1580156131bd57600080fd5b505af11580156131d1573d6000803e3d6000fd5b50505050506040513d60408110156131e857600080fd5b5080516020909101519095509050878510156132355760405162461bcd60e51b81526004018080602001828103825260258152602001806142536025913960400191505060405180910390fd5b801561324557613245338261352e565b505050509695505050505050565b6000805b835181101561329657600084828151811061326e57fe5b6020026020010151600181111561328157fe5b141561328e576001909101905b600101613257565b506132a8662386f26fc10000826137f0565b82146132fb576040805162461bcd60e51b815260206004820152601960248201527f43526f757465723a2077726f6e67206f7261636c652066656500000000000000604482015290519081900360640190fd5b505050565b604080516001600160a01b0385811660248301528481166044830152606480830185905283518084039091018152608490920183526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f23b872dd0000000000000000000000000000000000000000000000000000000017815292518251600094606094938a169392918291908083835b602083106133d157805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe09092019160209182019101613394565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114613433576040519150601f19603f3d011682016040523d82523d6000602084013e613438565b606091505b5091509150818015613466575080511580613466575080806020019051602081101561346357600080fd5b50515b6134a15760405162461bcd60e51b815260040180806020018281038252602481526020018061429b6024913960400191505060405180910390fd5b505050505050565b60005b60018651038110156134a15760008582815181106134c657fe5b602002602001015160018111156134d957fe5b14156134f2576134ed818787878787613849565b613526565b600185828151811061350057fe5b6020026020010151600181111561351357fe5b1415610c3a576134ed8187878787613b4b565b6001016134ac565b604080516000808252602082019092526001600160a01b0384169083906040518082805190602001908083835b6020831061359857805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0909201916020918201910161355b565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d80600081146135fa576040519150601f19603f3d011682016040523d82523d6000602084013e6135ff565b606091505b50509050806132fb5760405162461bcd60e51b81526004018080602001828103825260238152602001806142786023913960400191505060405180910390fd5b600080600061364e8585613e16565b604080517fffffffffffffffffffffffffffffffffffffffff000000000000000000000000606094851b811660208084019190915293851b81166034830152825160288184030181526048830184528051908501207fff0000000000000000000000000000000000000000000000000000000000000060688401529a90941b9093166069840152607d8301989098527f96e8ac4277198ff8b6f785478aa9a39f403cb768dd02cbee326c3e7da348845f609d808401919091528851808403909101815260bd909201909752805196019590952095945050505050565b6000826001600160a01b0316631a788a02836040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b15801561377957600080fd5b505afa15801561378d573d6000803e3d6000fd5b505050506040513d60208110156137a357600080fd5b505190505b92915050565b6000610c8783836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250613eed565b6000826137ff575060006137a8565b8282028284828161380c57fe5b0414610c875760405162461bcd60e51b815260040180806020018281038252602181526020018061420e6021913960400191505060405180910390fd5b600061388086888151811061385a57fe5b602002602001015187896001018151811061387157fe5b60200260200101516000610b77565b9050600060028751038810156138e4576138dd8789600101815181106138a257fe5b6020026020010151888a600201815181106138b957fe5b6020026020010151888b600101815181106138d057fe5b6020026020010151610b77565b90506138e7565b50825b6138ef614184565b826001600160a01b0316639f44296a662386f26fc100008a8c6001018151811061391557fe5b6020026020010151856040518463ffffffff1660e01b815260040180836001600160a01b03168152602001826001600160a01b031681526020019250505060e0604051808303818588803b15801561396c57600080fd5b505af1158015613980573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525060e08110156139a657600080fd5b5060208101518751909160600190889060018d019081106139c357fe5b6020026020010181935082815250505060007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663b58aa4786040518163ffffffff1660e01b815260040160206040518083038186803b158015613a2e57600080fd5b505afa158015613a42573d6000803e3d6000fd5b505050506040513d6020811015613a5857600080fd5b5051825190915015801590613a7557506001600160a01b03851615155b8015613a8957506001600160a01b03811615155b15613b3f5781516020830151604080850151606086015182517f5e3ddd690000000000000000000000000000000000000000000000000000000081526001600160a01b038a81166004830152602482019690965260448101949094526064840191909152608483015287831660a48301525191831691635e3ddd699160c48082019260009290919082900301818387803b158015613b2657600080fd5b505af1158015613b3a573d6000803e3d6000fd5b505050505b50505050505050505050565b6000613b82858781518110613b5c57fe5b6020026020010151868860010181518110613b7357fe5b60200260200101516001610b77565b90506000613bb9868881518110613b9557fe5b6020026020010151878960010181518110613bac57fe5b6020026020010151613e16565b509050600080613c137f0000000000000000000000000000000000000000000000000000000000000000898b81518110613bef57fe5b60200260200101518a8c60010181518110613c0657fe5b6020026020010151613f84565b91509150613c35868a81518110613c2657fe5b60200260200101518383614052565b868a60010181518110613c4457fe5b60200260200101818152505050506000848860010181518110613c6357fe5b60200260200101519050600080836001600160a01b0316898b81518110613c8657fe5b60200260200101516001600160a01b031614613ca457826000613ca8565b6000835b91509150600060028a51038b1015613d0157613cfa8a8c60010181518110613ccc57fe5b60200260200101518b8d60020181518110613ce357fe5b60200260200101518b8e600101815181106138d057fe5b9050613d04565b50855b60408051600080825260208201928390527f022c0d9f00000000000000000000000000000000000000000000000000000000835260248201868152604483018690526001600160a01b038581166064850152608060848501908152845160a48601819052918c169563022c0d9f958a958a958a9592949093909260c48601928190849084905b83811015613da2578181015183820152602001613d8a565b50505050905090810190601f168015613dcf5780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b158015613df157600080fd5b505af1158015613e05573d6000803e3d6000fd5b505050505050505050505050505050565b600080826001600160a01b0316846001600160a01b03161415613e6a5760405162461bcd60e51b81526004018080602001828103825260258152602001806141c16025913960400191505060405180910390fd5b826001600160a01b0316846001600160a01b031610613e8a578284613e8d565b83835b90925090506001600160a01b038216610df7576040805162461bcd60e51b815260206004820152601e60248201527f556e697377617056324c6962726172793a205a45524f5f414444524553530000604482015290519081900360640190fd5b60008184841115613f7c5760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015613f41578181015183820152602001613f29565b50505050905090810190601f168015613f6e5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b6000806000613f938585613e16565b509050600080613fa488888861363f565b6001600160a01b0316630902f1ac6040518163ffffffff1660e01b815260040160606040518083038186803b158015613fdc57600080fd5b505afa158015613ff0573d6000803e3d6000fd5b505050506040513d606081101561400657600080fd5b5080516020909101516dffffffffffffffffffffffffffff91821693501690506001600160a01b0387811690841614614040578082614043565b81815b90999098509650505050505050565b60008084116140925760405162461bcd60e51b815260040180806020018281038252602b8152602001806142bf602b913960400191505060405180910390fd5b6000831180156140a25750600082115b6140dd5760405162461bcd60e51b81526004018080602001828103825260288152602001806141e66028913960400191505060405180910390fd5b60006140eb856103e56137f0565b905060006140f982856137f0565b905060006141138361410d886103e86137f0565b9061412a565b905080828161411e57fe5b04979650505050505050565b600082820183811015610c87576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b60405180608001604052806004906020820280368337509192915050565b6040518060400160405280600290602082028036833750919291505056fe556e697377617056324c6962726172793a204944454e544943414c5f414444524553534553556e697377617056324c6962726172793a20494e53554646494349454e545f4c4951554944495459536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7743526f757465723a20696e73756666696369656e74206f757470757420616d6f756e742043526f757465723a206c657373206c6971756964697479207468616e2065787065637465645472616e7366657248656c7065723a204554485f5452414e534645525f4641494c45445472616e7366657248656c7065723a205452414e534645525f46524f4d5f4641494c4544556e697377617056324c6962726172793a20494e53554646494349454e545f494e5055545f414d4f554e54a264697066735822122043b4291022a73a1d005bc44276778875ceef825541d9bc35862d041f82fb630c64736f6c634300060c003300000000000000000000000066c64ecc3a6014733325a8f2ebee46b4ca3ed5500000000000000000000000005c69bee701ef814a2b6a3edd4b1652cb9cc5aa6f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2

Deployed Bytecode

0x6080604052600436106100f75760003560e01c806376771d4b1161008a578063bd9fe57f11610059578063bd9fe57f146105dc578063c45a0155146106c3578063e1a385dd146106d8578063e5d893651461071a576100fe565b806376771d4b14610524578063acdb6cd414610539578063ad5c464814610581578063bd23f30e14610596576100fe565b80632f59c2d5116100c65780632f59c2d5146103e257806337848c8a146104435780633f3f246a1461047e57806346c173a2146104d2576100fe565b80630117c1751461010357806302f57e301461023a5780631d3c240b1461029d57806321757292146102fb576100fe565b366100fe57005b600080fd5b6101ea600480360360e081101561011957600080fd5b81359160208101359181019060608101604082013564010000000081111561014057600080fd5b82018360208201111561015257600080fd5b8035906020019184602083028401116401000000008311171561017457600080fd5b91939092909160208101903564010000000081111561019257600080fd5b8201836020820111156101a457600080fd5b803590602001918460208302840111640100000000831117156101c657600080fd5b91935091506001600160a01b03813581169160208101359091169060400135610760565b60408051602080825283518183015283519192839290830191858101910280838360005b8381101561022657818101518382015260200161020e565b505050509050019250505060405180910390f35b34801561024657600080fd5b506102816004803603606081101561025d57600080fd5b5080356001600160a01b03908116916020810135909116906040013560ff16610b77565b604080516001600160a01b039092168252519081900360200190f35b3480156102a957600080fd5b506102d8600480360360408110156102c057600080fd5b506001600160a01b0381358116916020013516610c8e565b6040805192151583526001600160a01b0390911660208301528051918290030190f35b6101ea600480360360e081101561031157600080fd5b81359160208101359181019060608101604082013564010000000081111561033857600080fd5b82018360208201111561034a57600080fd5b8035906020019184602083028401116401000000008311171561036c57600080fd5b91939092909160208101903564010000000081111561038a57600080fd5b82018360208201111561039c57600080fd5b803590602001918460208302840111640100000000831117156103be57600080fd5b91935091506001600160a01b03813581169160208101359091169060400135610dfe565b61042a600480360360c08110156103f857600080fd5b506001600160a01b03813581169160208101359160408201359160608101358216916080820135169060a00135611231565b6040805192835260208301919091528051918290030190f35b34801561044f57600080fd5b506102d86004803603604081101561046657600080fd5b506001600160a01b03813581169160200135166116d0565b6104c0600480360360a081101561049457600080fd5b506001600160a01b03813581169160208101359160408201359160608101359091169060800135611725565b60408051918252519081900360200190f35b61042a600480360360e08110156104e857600080fd5b506001600160a01b0381358116916020810135821691604082013591606081013591608082013581169160a08101359091169060c001356119b3565b34801561053057600080fd5b5061028161202b565b61042a600480360360c081101561054f57600080fd5b506001600160a01b03813581169160208101359160408201359160608101358216916080820135169060a0013561204f565b34801561058d57600080fd5b506102816122f1565b6104c0600480360360c08110156105ac57600080fd5b506001600160a01b0381358116916020810135916040820135916060810135916080820135169060a00135612315565b6101ea600480360360e08110156105f257600080fd5b81359160208101359181019060608101604082013564010000000081111561061957600080fd5b82018360208201111561062b57600080fd5b8035906020019184602083028401116401000000008311171561064d57600080fd5b91939092909160208101903564010000000081111561066b57600080fd5b82018360208201111561067d57600080fd5b8035906020019184602083028401116401000000008311171561069f57600080fd5b91935091506001600160a01b03813581169160208101359091169060400135612971565b3480156106cf57600080fd5b50610281612ac5565b6104c0600480360360a08110156106ee57600080fd5b506001600160a01b03813581169160208101359160408201359160608101359091169060800135612ae9565b6104c0600480360360c081101561073057600080fd5b506001600160a01b0381358116916020810135916040820135916060810135916080820135169060a00135612e01565b606081428110156107b8576040805162461bcd60e51b815260206004820152601060248201527f43526f757465723a204558504952454400000000000000000000000000000000604482015290519081900360640190fd5b6002881080159061081957506001600160a01b037f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc216898960001981018181106107fe57fe5b905060200201356001600160a01b03166001600160a01b0316145b61086a576040805162461bcd60e51b815260206004820152601560248201527f43526f757465723a20696e76616c696420706174680000000000000000000000604482015290519081900360640190fd5b600019880186146108c2576040805162461bcd60e51b815260206004820152601660248201527f43526f757465723a20696e76616c696420646578657300000000000000000000604482015290519081900360640190fd5b610900878780806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250349250613253915050565b61098d8989600081811061091057fe5b905060200201356001600160a01b0316336109878c8c600081811061093157fe5b905060200201356001600160a01b03168d8d600181811061094e57fe5b905060200201356001600160a01b03168c8c600081811061096b57fe5b9050602002013560018111801561098157600080fd5b50610b77565b8e613300565b8767ffffffffffffffff811180156109a457600080fd5b506040519080825280602002602001820160405280156109ce578160200160208202803683370190505b5091508a826000815181106109df57fe5b602002602001018181525050610a5d89898080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525050604080516020808d0282810182019093528c82529093508c92508b9182918501908490808284376000920191909152508792503091508990506134a9565b8982600184510381518110610a6e57fe5b60200260200101511015610ab35760405162461bcd60e51b815260040180806020018281038252602481526020018061422f6024913960400191505060405180910390fd5b7f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc26001600160a01b0316632e1a7d4d83600185510381518110610af257fe5b60200260200101516040518263ffffffff1660e01b815260040180828152602001915050600060405180830381600087803b158015610b3057600080fd5b505af1158015610b44573d6000803e3d6000fd5b50505050610b698583600185510381518110610b5c57fe5b602002602001015161352e565b509998505050505050505050565b600080826001811115610b8657fe5b1415610bf4576000610b988585610c8e565b9250905080610bee576040805162461bcd60e51b815260206004820152601f60248201527f43526f757465723a206e6f7420617661696c61626c65206f6e20436f46695800604482015290519081900360640190fd5b50610c87565b6001826001811115610c0257fe5b1415610c3a57610c337f0000000000000000000000005c69bee701ef814a2b6a3edd4b1652cb9cc5aa6f858561363f565b9050610c87565b6040805162461bcd60e51b815260206004820152601460248201527f43526f757465723a20756e6b6e6f776e20646578000000000000000000000000604482015290519081900360640190fd5b9392505050565b6000807f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc26001600160a01b0316846001600160a01b031614158015610d0557507f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc26001600160a01b0316836001600160a01b031614155b15610d135760009150610df7565b7f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc26001600160a01b0316846001600160a01b031614610d7d57610d767f00000000000000000000000066c64ecc3a6014733325a8f2ebee46b4ca3ed5508561372a565b9050610de3565b7f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc26001600160a01b0316836001600160a01b031614610de357610de07f00000000000000000000000066c64ecc3a6014733325a8f2ebee46b4ca3ed5508461372a565b90505b6001600160a01b03811615610df757600191505b9250929050565b60608142811015610e56576040805162461bcd60e51b815260206004820152601060248201527f43526f757465723a204558504952454400000000000000000000000000000000604482015290519081900360640190fd5b60028810801590610eb457507f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc26001600160a01b031689896000818110610e9957fe5b905060200201356001600160a01b03166001600160a01b0316145b610f05576040805162461bcd60e51b815260206004820152601560248201527f43526f757465723a20696e76616c696420706174680000000000000000000000604482015290519081900360640190fd5b60001988018614610f5d576040805162461bcd60e51b815260206004820152601660248201527f43526f757465723a20696e76616c696420646578657300000000000000000000604482015290519081900360640190fd5b610fa5878780806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250610fa092503491508f90506137ae565b613253565b7f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc26001600160a01b031663d0e30db08c6040518263ffffffff1660e01b81526004016000604051808303818588803b15801561100057600080fd5b505af1158015611014573d6000803e3d6000fd5b50505050507f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc26001600160a01b031663a9059cbb6110928b8b600081811061105857fe5b905060200201356001600160a01b03168c8c600181811061107557fe5b905060200201356001600160a01b03168b8b600081811061096b57fe5b8d6040518363ffffffff1660e01b815260040180836001600160a01b0316815260200182815260200192505050602060405180830381600087803b1580156110d957600080fd5b505af11580156110ed573d6000803e3d6000fd5b505050506040513d602081101561110357600080fd5b505161110b57fe5b8767ffffffffffffffff8111801561112257600080fd5b5060405190808252806020026020018201604052801561114c578160200160208202803683370190505b5091508a8260008151811061115d57fe5b6020026020010181815250506111db89898080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525050604080516020808d0282810182019093528c82529093508c92508b9182918501908490808284376000920191909152508792508a91508990506134a9565b89826001845103815181106111ec57fe5b60200260200101511015610b695760405162461bcd60e51b815260040180806020018281038252602481526020018061422f6024913960400191505060405180910390fd5b600080824281101561128a576040805162461bcd60e51b815260206004820152601060248201527f43526f757465723a204558504952454400000000000000000000000000000000604482015290519081900360640190fd5b8734116112de576040805162461bcd60e51b815260206004820152601f60248201527f43526f757465723a20696e73756666696369656e74206d73672e76616c756500604482015290519081900360640190fd5b7f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc26001600160a01b031663d0e30db0896040518263ffffffff1660e01b81526004016000604051808303818588803b15801561133957600080fd5b505af115801561134d573d6000803e3d6000fd5b5050505050600061137e7f00000000000000000000000066c64ecc3a6014733325a8f2ebee46b4ca3ed5508b61372a565b90507f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc26001600160a01b031663a9059cbb828b6040518363ffffffff1660e01b815260040180836001600160a01b0316815260200182815260200192505050602060405180830381600087803b1580156113f757600080fd5b505af115801561140b573d6000803e3d6000fd5b505050506040513d602081101561142157600080fd5b505161142957fe5b6000611433614184565b6001600160a01b038316639f44296a61144c348e6137ae565b8e8c6040518463ffffffff1660e01b815260040180836001600160a01b03168152602001826001600160a01b031681526020019250505060e0604051808303818588803b15801561149c57600080fd5b505af11580156114b0573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525060e08110156114d657600080fd5b5080516020820151604083015191985096509250606001905089851015611544576040805162461bcd60e51b815260206004820152601f60248201527f43526f757465723a20676f74206c657373207468616e20657870656374656400604482015290519081900360640190fd5b60007f00000000000000000000000066c64ecc3a6014733325a8f2ebee46b4ca3ed5506001600160a01b031663b58aa4786040518163ffffffff1660e01b815260040160206040518083038186803b15801561159f57600080fd5b505afa1580156115b3573d6000803e3d6000fd5b505050506040513d60208110156115c957600080fd5b50518251909150158015906115e657506001600160a01b03891615155b80156115fa57506001600160a01b03811615155b156116b05781516020830151604080850151606086015182517f5e3ddd690000000000000000000000000000000000000000000000000000000081526001600160a01b038a8116600483015260248201969096526044810194909452606484019190915260848301528b831660a48301525191831691635e3ddd699160c48082019260009290919082900301818387803b15801561169757600080fd5b505af11580156116ab573d6000803e3d6000fd5b505050505b82156116c0576116c0338461352e565b5050505050965096945050505050565b6000806116dd8484610c8e565b909250905081156116ed57610df7565b600061171a7f0000000000000000000000005c69bee701ef814a2b6a3edd4b1652cb9cc5aa6f868661363f565b915091509250929050565b6000814281101561177d576040805162461bcd60e51b815260206004820152601060248201527f43526f757465723a204558504952454400000000000000000000000000000000604482015290519081900360640190fd5b600034116117d2576040805162461bcd60e51b815260206004820152601f60248201527f43526f757465723a20696e73756666696369656e74206d73672e76616c756500604482015290519081900360640190fd5b60006117fe7f00000000000000000000000066c64ecc3a6014733325a8f2ebee46b4ca3ed5508961372a565b604080517f23b872dd0000000000000000000000000000000000000000000000000000000081523360048201526001600160a01b03831660248201819052604482018b9052915192935090916323b872dd916064808201926020929091908290030181600087803b15801561187257600080fd5b505af1158015611886573d6000803e3d6000fd5b505050506040513d602081101561189c57600080fd5b5050604080517f27fc84a30000000000000000000000000000000000000000000000000000000081526001600160a01b038a8116600483015287811660248301528251600093918516926327fc84a392349260448084019382900301818588803b15801561190957600080fd5b505af115801561191d573d6000803e3d6000fd5b50505050506040513d604081101561193457600080fd5b508051602090910151909450905086841015611997576040805162461bcd60e51b815260206004820152601f60248201527f43526f757465723a20676f74206c657373207468616e20657870656374656400604482015290519081900360640190fd5b80156119a7576119a7338261352e565b50505095945050505050565b6000808242811015611a0c576040805162461bcd60e51b815260206004820152601060248201527f43526f757465723a204558504952454400000000000000000000000000000000604482015290519081900360640190fd5b60003411611a61576040805162461bcd60e51b815260206004820152601f60248201527f43526f757465723a20696e73756666696369656e74206d73672e76616c756500604482015290519081900360640190fd5b611a696141a2565b611a937f00000000000000000000000066c64ecc3a6014733325a8f2ebee46b4ca3ed5508c61372a565b6001600160a01b0316808252611aad908c9033908c613300565b6000611ab7614184565b8251604080517f9f44296a0000000000000000000000000000000000000000000000000000000081526001600160a01b037f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc28116600483015230602483015291519190921691639f44296a91349160448082019260e09290919082900301818588803b158015611b4657600080fd5b505af1158015611b5a573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525060e0811015611b8057600080fd5b50805160208083015160408085015181517fb58aa4780000000000000000000000000000000000000000000000000000000081529151949b50919950909550606090930193506000926001600160a01b037f00000000000000000000000066c64ecc3a6014733325a8f2ebee46b4ca3ed550169263b58aa47892600480840193919291829003018186803b158015611c1757600080fd5b505afa158015611c2b573d6000803e3d6000fd5b505050506040513d6020811015611c4157600080fd5b5051825190915015801590611c5e57506001600160a01b03891615155b8015611c7257506001600160a01b03811615155b15611d2a57835182516020840151604080860151606087015182517f5e3ddd690000000000000000000000000000000000000000000000000000000081526001600160a01b03968716600482015260248101959095526044850193909352606484015260848301919091528b831660a48301525191831691635e3ddd699160c48082019260009290919082900301818387803b158015611d1157600080fd5b505af1158015611d25573d6000803e3d6000fd5b505050505b611d547f00000000000000000000000066c64ecc3a6014733325a8f2ebee46b4ca3ed5508e61372a565b6001600160a01b039081166020808701829052604080517fa9059cbb0000000000000000000000000000000000000000000000000000000081526004810193909352602483018a9052517f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc29093169263a9059cbb9260448082019392918290030181600087803b158015611de757600080fd5b505af1158015611dfb573d6000803e3d6000fd5b505050506040513d6020811015611e1157600080fd5b5051611e1957fe5b83600160200201516001600160a01b0316639f44296a848f8d6040518463ffffffff1660e01b815260040180836001600160a01b03168152602001826001600160a01b031681526020019250505060e0604051808303818588803b158015611e8057600080fd5b505af1158015611e94573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525060e0811015611eba57600080fd5b5060208101516040820151909750935060600191508a861015611f24576040805162461bcd60e51b815260206004820152601f60248201527f43526f757465723a20676f74206c657373207468616e20657870656374656400604482015290519081900360640190fd5b815115801590611f3c57506001600160a01b03891615155b8015611f5057506001600160a01b03811615155b1561200a57602080850151835191840151604080860151606087015182517f5e3ddd690000000000000000000000000000000000000000000000000000000081526001600160a01b03958616600482015260248101969096526044860193909352606485015260848401919091528b821660a48401525190831691635e3ddd699160c480830192600092919082900301818387803b158015611ff157600080fd5b505af1158015612005573d6000803e3d6000fd5b505050505b821561201a5761201a338461352e565b505050505097509795505050505050565b7f0000000000000000000000005c69bee701ef814a2b6a3edd4b1652cb9cc5aa6f81565b60008082428110156120a8576040805162461bcd60e51b815260206004820152601060248201527f43526f757465723a204558504952454400000000000000000000000000000000604482015290519081900360640190fd5b600034116120fd576040805162461bcd60e51b815260206004820152601f60248201527f43526f757465723a20696e73756666696369656e74206d73672e76616c756500604482015290519081900360640190fd5b60006121297f00000000000000000000000066c64ecc3a6014733325a8f2ebee46b4ca3ed5508b61372a565b90506121378a33838c613300565b6000612141614184565b826001600160a01b0316639f44296a347f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2306040518463ffffffff1660e01b815260040180836001600160a01b03168152602001826001600160a01b031681526020019250505060e0604051808303818588803b1580156121c157600080fd5b505af11580156121d5573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525060e08110156121fb57600080fd5b5080516020820151604083015191985096509250606001905089851015612269576040805162461bcd60e51b815260206004820152601f60248201527f43526f757465723a20676f74206c657373207468616e20657870656374656400604482015290519081900360640190fd5b7f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc26001600160a01b0316632e1a7d4d866040518263ffffffff1660e01b815260040180828152602001915050600060405180830381600087803b1580156122cf57600080fd5b505af11580156122e3573d6000803e3d6000fd5b50505050611544898661352e565b7f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc281565b6000814281101561236d576040805162461bcd60e51b815260206004820152601060248201527f43526f757465723a204558504952454400000000000000000000000000000000604482015290519081900360640190fd5b8634116123c1576040805162461bcd60e51b815260206004820152601f60248201527f43526f757465723a20696e73756666696369656e74206d73672e76616c756500604482015290519081900360640190fd5b60006123cd34896137ae565b905060006123fb7f00000000000000000000000066c64ecc3a6014733325a8f2ebee46b4ca3ed5508b61372a565b90506001600160a01b038116612458576040805162461bcd60e51b815260206004820152601560248201527f43526f757465723a20696e76616c696420706169720000000000000000000000604482015290519081900360640190fd5b871561246a5761246a8a33838b613300565b881561258d577f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc26001600160a01b031663d0e30db08a6040518263ffffffff1660e01b81526004016000604051808303818588803b1580156124cb57600080fd5b505af11580156124df573d6000803e3d6000fd5b50505050507f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc26001600160a01b031663a9059cbb828b6040518363ffffffff1660e01b815260040180836001600160a01b0316815260200182815260200192505050602060405180830381600087803b15801561255b57600080fd5b505af115801561256f573d6000803e3d6000fd5b505050506040513d602081101561258557600080fd5b505161258d57fe5b6000816001600160a01b0316636a62784284306040518363ffffffff1660e01b815260040180826001600160a01b0316815260200191505060408051808303818588803b1580156125dd57600080fd5b505af11580156125f1573d6000803e3d6000fd5b50505050506040513d604081101561260857600080fd5b5080516020909101519095509050878510156126555760405162461bcd60e51b81526004018080602001828103825260258152602001806142536025913960400191505060405180910390fd5b60007f00000000000000000000000066c64ecc3a6014733325a8f2ebee46b4ca3ed5506001600160a01b031663d2d7f8166040518163ffffffff1660e01b815260040160206040518083038186803b1580156126b057600080fd5b505afa1580156126c4573d6000803e3d6000fd5b505050506040513d60208110156126da57600080fd5b5051604080517f38d8294b0000000000000000000000000000000000000000000000000000000081526001600160a01b038681166004830152915191909216916338d8294b916024808301926020929190829003018186803b15801561273f57600080fd5b505afa158015612753573d6000803e3d6000fd5b505050506040513d602081101561276957600080fd5b505190506001600160a01b0381166127c8576040805162461bcd60e51b815260206004820152601d60248201527f43526f757465723a20696e76616c6964207374616b696e6720706f6f6c000000604482015290519081900360640190fd5b826001600160a01b031663095ea7b382886040518363ffffffff1660e01b815260040180836001600160a01b0316815260200182815260200192505050602060405180830381600087803b15801561281f57600080fd5b505af1158015612833573d6000803e3d6000fd5b505050506040513d602081101561284957600080fd5b5050604080517ffe72bd010000000000000000000000000000000000000000000000000000000081526001600160a01b038a811660048301526024820189905291519183169163fe72bd019160448082019260009290919082900301818387803b1580156128b657600080fd5b505af11580156128ca573d6000803e3d6000fd5b50505050826001600160a01b031663095ea7b38260006040518363ffffffff1660e01b815260040180836001600160a01b0316815260200182815260200192505050602060405180830381600087803b15801561292657600080fd5b505af115801561293a573d6000803e3d6000fd5b505050506040513d602081101561295057600080fd5b5050811561296257612962338361352e565b50505050509695505050505050565b606081428110156129c9576040805162461bcd60e51b815260206004820152601060248201527f43526f757465723a204558504952454400000000000000000000000000000000604482015290519081900360640190fd5b6002881015612a1f576040805162461bcd60e51b815260206004820152601560248201527f43526f757465723a20696e76616c696420706174680000000000000000000000604482015290519081900360640190fd5b60001988018614612a77576040805162461bcd60e51b815260206004820152601660248201527f43526f757465723a20696e76616c696420646578657300000000000000000000604482015290519081900360640190fd5b612ab5878780806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250349250613253915050565b61110b8989600081811061091057fe5b7f00000000000000000000000066c64ecc3a6014733325a8f2ebee46b4ca3ed55081565b60008142811015612b41576040805162461bcd60e51b815260206004820152601060248201527f43526f757465723a204558504952454400000000000000000000000000000000604482015290519081900360640190fd5b60003411612b96576040805162461bcd60e51b815260206004820152601f60248201527f43526f757465723a20696e73756666696369656e74206d73672e76616c756500604482015290519081900360640190fd5b6000612bc27f00000000000000000000000066c64ecc3a6014733325a8f2ebee46b4ca3ed5508961372a565b604080517f23b872dd0000000000000000000000000000000000000000000000000000000081523360048201526001600160a01b03831660248201819052604482018b9052915192935090916323b872dd916064808201926020929091908290030181600087803b158015612c3657600080fd5b505af1158015612c4a573d6000803e3d6000fd5b505050506040513d6020811015612c6057600080fd5b5050604080517f27fc84a30000000000000000000000000000000000000000000000000000000081526001600160a01b037f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2811660048301523060248301528251600093918516926327fc84a392349260448084019382900301818588803b158015612ceb57600080fd5b505af1158015612cff573d6000803e3d6000fd5b50505050506040513d6040811015612d1657600080fd5b508051602090910151909450905086841015612d79576040805162461bcd60e51b815260206004820152601f60248201527f43526f757465723a20676f74206c657373207468616e20657870656374656400604482015290519081900360640190fd5b7f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc26001600160a01b0316632e1a7d4d856040518263ffffffff1660e01b815260040180828152602001915050600060405180830381600087803b158015612ddf57600080fd5b505af1158015612df3573d6000803e3d6000fd5b50505050611997868561352e565b60008142811015612e59576040805162461bcd60e51b815260206004820152601060248201527f43526f757465723a204558504952454400000000000000000000000000000000604482015290519081900360640190fd5b60006001600160a01b03167f00000000000000000000000066c64ecc3a6014733325a8f2ebee46b4ca3ed5506001600160a01b0316631a788a028a6040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b158015612ed157600080fd5b505afa158015612ee5573d6000803e3d6000fd5b505050506040513d6020811015612efb57600080fd5b50516001600160a01b03161415612fa8577f00000000000000000000000066c64ecc3a6014733325a8f2ebee46b4ca3ed5506001600160a01b0316639ccb0744896040518263ffffffff1660e01b815260040180826001600160a01b03168152602001915050602060405180830381600087803b158015612f7b57600080fd5b505af1158015612f8f573d6000803e3d6000fd5b505050506040513d6020811015612fa557600080fd5b50505b863411612ffc576040805162461bcd60e51b815260206004820152601f60248201527f43526f757465723a20696e73756666696369656e74206d73672e76616c756500604482015290519081900360640190fd5b600061300834896137ae565b905060006130367f00000000000000000000000066c64ecc3a6014733325a8f2ebee46b4ca3ed5508b61372a565b9050871561304a5761304a8a33838b613300565b881561316d577f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc26001600160a01b031663d0e30db08a6040518263ffffffff1660e01b81526004016000604051808303818588803b1580156130ab57600080fd5b505af11580156130bf573d6000803e3d6000fd5b50505050507f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc26001600160a01b031663a9059cbb828b6040518363ffffffff1660e01b815260040180836001600160a01b0316815260200182815260200192505050602060405180830381600087803b15801561313b57600080fd5b505af115801561314f573d6000803e3d6000fd5b505050506040513d602081101561316557600080fd5b505161316d57fe5b6000816001600160a01b0316636a62784284896040518363ffffffff1660e01b815260040180826001600160a01b0316815260200191505060408051808303818588803b1580156131bd57600080fd5b505af11580156131d1573d6000803e3d6000fd5b50505050506040513d60408110156131e857600080fd5b5080516020909101519095509050878510156132355760405162461bcd60e51b81526004018080602001828103825260258152602001806142536025913960400191505060405180910390fd5b801561324557613245338261352e565b505050509695505050505050565b6000805b835181101561329657600084828151811061326e57fe5b6020026020010151600181111561328157fe5b141561328e576001909101905b600101613257565b506132a8662386f26fc10000826137f0565b82146132fb576040805162461bcd60e51b815260206004820152601960248201527f43526f757465723a2077726f6e67206f7261636c652066656500000000000000604482015290519081900360640190fd5b505050565b604080516001600160a01b0385811660248301528481166044830152606480830185905283518084039091018152608490920183526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f23b872dd0000000000000000000000000000000000000000000000000000000017815292518251600094606094938a169392918291908083835b602083106133d157805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe09092019160209182019101613394565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114613433576040519150601f19603f3d011682016040523d82523d6000602084013e613438565b606091505b5091509150818015613466575080511580613466575080806020019051602081101561346357600080fd5b50515b6134a15760405162461bcd60e51b815260040180806020018281038252602481526020018061429b6024913960400191505060405180910390fd5b505050505050565b60005b60018651038110156134a15760008582815181106134c657fe5b602002602001015160018111156134d957fe5b14156134f2576134ed818787878787613849565b613526565b600185828151811061350057fe5b6020026020010151600181111561351357fe5b1415610c3a576134ed8187878787613b4b565b6001016134ac565b604080516000808252602082019092526001600160a01b0384169083906040518082805190602001908083835b6020831061359857805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0909201916020918201910161355b565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d80600081146135fa576040519150601f19603f3d011682016040523d82523d6000602084013e6135ff565b606091505b50509050806132fb5760405162461bcd60e51b81526004018080602001828103825260238152602001806142786023913960400191505060405180910390fd5b600080600061364e8585613e16565b604080517fffffffffffffffffffffffffffffffffffffffff000000000000000000000000606094851b811660208084019190915293851b81166034830152825160288184030181526048830184528051908501207fff0000000000000000000000000000000000000000000000000000000000000060688401529a90941b9093166069840152607d8301989098527f96e8ac4277198ff8b6f785478aa9a39f403cb768dd02cbee326c3e7da348845f609d808401919091528851808403909101815260bd909201909752805196019590952095945050505050565b6000826001600160a01b0316631a788a02836040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b15801561377957600080fd5b505afa15801561378d573d6000803e3d6000fd5b505050506040513d60208110156137a357600080fd5b505190505b92915050565b6000610c8783836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250613eed565b6000826137ff575060006137a8565b8282028284828161380c57fe5b0414610c875760405162461bcd60e51b815260040180806020018281038252602181526020018061420e6021913960400191505060405180910390fd5b600061388086888151811061385a57fe5b602002602001015187896001018151811061387157fe5b60200260200101516000610b77565b9050600060028751038810156138e4576138dd8789600101815181106138a257fe5b6020026020010151888a600201815181106138b957fe5b6020026020010151888b600101815181106138d057fe5b6020026020010151610b77565b90506138e7565b50825b6138ef614184565b826001600160a01b0316639f44296a662386f26fc100008a8c6001018151811061391557fe5b6020026020010151856040518463ffffffff1660e01b815260040180836001600160a01b03168152602001826001600160a01b031681526020019250505060e0604051808303818588803b15801561396c57600080fd5b505af1158015613980573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525060e08110156139a657600080fd5b5060208101518751909160600190889060018d019081106139c357fe5b6020026020010181935082815250505060007f00000000000000000000000066c64ecc3a6014733325a8f2ebee46b4ca3ed5506001600160a01b031663b58aa4786040518163ffffffff1660e01b815260040160206040518083038186803b158015613a2e57600080fd5b505afa158015613a42573d6000803e3d6000fd5b505050506040513d6020811015613a5857600080fd5b5051825190915015801590613a7557506001600160a01b03851615155b8015613a8957506001600160a01b03811615155b15613b3f5781516020830151604080850151606086015182517f5e3ddd690000000000000000000000000000000000000000000000000000000081526001600160a01b038a81166004830152602482019690965260448101949094526064840191909152608483015287831660a48301525191831691635e3ddd699160c48082019260009290919082900301818387803b158015613b2657600080fd5b505af1158015613b3a573d6000803e3d6000fd5b505050505b50505050505050505050565b6000613b82858781518110613b5c57fe5b6020026020010151868860010181518110613b7357fe5b60200260200101516001610b77565b90506000613bb9868881518110613b9557fe5b6020026020010151878960010181518110613bac57fe5b6020026020010151613e16565b509050600080613c137f0000000000000000000000005c69bee701ef814a2b6a3edd4b1652cb9cc5aa6f898b81518110613bef57fe5b60200260200101518a8c60010181518110613c0657fe5b6020026020010151613f84565b91509150613c35868a81518110613c2657fe5b60200260200101518383614052565b868a60010181518110613c4457fe5b60200260200101818152505050506000848860010181518110613c6357fe5b60200260200101519050600080836001600160a01b0316898b81518110613c8657fe5b60200260200101516001600160a01b031614613ca457826000613ca8565b6000835b91509150600060028a51038b1015613d0157613cfa8a8c60010181518110613ccc57fe5b60200260200101518b8d60020181518110613ce357fe5b60200260200101518b8e600101815181106138d057fe5b9050613d04565b50855b60408051600080825260208201928390527f022c0d9f00000000000000000000000000000000000000000000000000000000835260248201868152604483018690526001600160a01b038581166064850152608060848501908152845160a48601819052918c169563022c0d9f958a958a958a9592949093909260c48601928190849084905b83811015613da2578181015183820152602001613d8a565b50505050905090810190601f168015613dcf5780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b158015613df157600080fd5b505af1158015613e05573d6000803e3d6000fd5b505050505050505050505050505050565b600080826001600160a01b0316846001600160a01b03161415613e6a5760405162461bcd60e51b81526004018080602001828103825260258152602001806141c16025913960400191505060405180910390fd5b826001600160a01b0316846001600160a01b031610613e8a578284613e8d565b83835b90925090506001600160a01b038216610df7576040805162461bcd60e51b815260206004820152601e60248201527f556e697377617056324c6962726172793a205a45524f5f414444524553530000604482015290519081900360640190fd5b60008184841115613f7c5760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015613f41578181015183820152602001613f29565b50505050905090810190601f168015613f6e5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b6000806000613f938585613e16565b509050600080613fa488888861363f565b6001600160a01b0316630902f1ac6040518163ffffffff1660e01b815260040160606040518083038186803b158015613fdc57600080fd5b505afa158015613ff0573d6000803e3d6000fd5b505050506040513d606081101561400657600080fd5b5080516020909101516dffffffffffffffffffffffffffff91821693501690506001600160a01b0387811690841614614040578082614043565b81815b90999098509650505050505050565b60008084116140925760405162461bcd60e51b815260040180806020018281038252602b8152602001806142bf602b913960400191505060405180910390fd5b6000831180156140a25750600082115b6140dd5760405162461bcd60e51b81526004018080602001828103825260288152602001806141e66028913960400191505060405180910390fd5b60006140eb856103e56137f0565b905060006140f982856137f0565b905060006141138361410d886103e86137f0565b9061412a565b905080828161411e57fe5b04979650505050505050565b600082820183811015610c87576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b60405180608001604052806004906020820280368337509192915050565b6040518060400160405280600290602082028036833750919291505056fe556e697377617056324c6962726172793a204944454e544943414c5f414444524553534553556e697377617056324c6962726172793a20494e53554646494349454e545f4c4951554944495459536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7743526f757465723a20696e73756666696369656e74206f757470757420616d6f756e742043526f757465723a206c657373206c6971756964697479207468616e2065787065637465645472616e7366657248656c7065723a204554485f5452414e534645525f4641494c45445472616e7366657248656c7065723a205452414e534645525f46524f4d5f4641494c4544556e697377617056324c6962726172793a20494e53554646494349454e545f494e5055545f414d4f554e54a264697066735822122043b4291022a73a1d005bc44276778875ceef825541d9bc35862d041f82fb630c64736f6c634300060c0033

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

00000000000000000000000066c64ecc3a6014733325a8f2ebee46b4ca3ed5500000000000000000000000005c69bee701ef814a2b6a3edd4b1652cb9cc5aa6f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2

-----Decoded View---------------
Arg [0] : _factory (address): 0x66C64ecC3A6014733325a8f2EBEE46B4CA3ED550
Arg [1] : _uniFactory (address): 0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f
Arg [2] : _WETH (address): 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2

-----Encoded View---------------
3 Constructor Arguments found :
Arg [0] : 00000000000000000000000066c64ecc3a6014733325a8f2ebee46b4ca3ed550
Arg [1] : 0000000000000000000000005c69bee701ef814a2b6a3edd4b1652cb9cc5aa6f
Arg [2] : 000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2


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.