ETH Price: $3,607.20 (+9.27%)

Contract

0x7618Db15dA0027691dB33287355D11F2ee846d16
 

Overview

ETH Balance

0.542031866373792707 ETH

Eth Value

$1,955.22 (@ $3,607.20/ETH)

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Distribute Fee210325362024-10-24 2:41:3534 days ago1729737695IN
0x7618Db15...2ee846d16
0 ETH0.007415199.21148832
Distribute Fee207540642024-09-15 5:56:2373 days ago1726379783IN
0x7618Db15...2ee846d16
0 ETH0.001678471.57492246
Transfer204962032024-08-10 5:44:47109 days ago1723268687IN
0x7618Db15...2ee846d16
0.3 ETH0.000039241.86381003
Update Operation...204961922024-08-10 5:42:35109 days ago1723268555IN
0x7618Db15...2ee846d16
0 ETH0.000032981.04719088
Update Pool Mint...204961922024-08-10 5:42:35109 days ago1723268555IN
0x7618Db15...2ee846d16
0 ETH0.000033031.04719088
Update HONO Stak...204961922024-08-10 5:42:35109 days ago1723268555IN
0x7618Db15...2ee846d16
0 ETH0.000033021.04719088
Update Lp Engine204961922024-08-10 5:42:35109 days ago1723268555IN
0x7618Db15...2ee846d16
0 ETH0.00002761.04719088
0x60806040204961902024-08-10 5:42:11109 days ago1723268531IN
 Create: DistributionContract
0 ETH0.005687171.74435048

Latest 25 internal transactions (View All)

Advanced mode:
Parent Transaction Hash Block From To
212557922024-11-24 6:23:473 days ago1732429427
0x7618Db15...2ee846d16
0.00043874 ETH
212390502024-11-21 22:19:235 days ago1732227563
0x7618Db15...2ee846d16
0.00104139 ETH
212384522024-11-21 20:19:475 days ago1732220387
0x7618Db15...2ee846d16
0.00795773 ETH
212381512024-11-21 19:19:236 days ago1732216763
0x7618Db15...2ee846d16
0.01755142 ETH
212372532024-11-21 16:19:236 days ago1732205963
0x7618Db15...2ee846d16
0.01834131 ETH
212369572024-11-21 15:19:476 days ago1732202387
0x7618Db15...2ee846d16
0.02763318 ETH
211906362024-11-15 4:13:4712 days ago1731644027
0x7618Db15...2ee846d16
0.39278821 ETH
211691732024-11-12 4:19:3515 days ago1731385175
0x7618Db15...2ee846d16
0.03844277 ETH
211590172024-11-10 18:19:1117 days ago1731262751
0x7618Db15...2ee846d16
0.00602101 ETH
211554282024-11-10 6:19:1117 days ago1731219551
0x7618Db15...2ee846d16
0.005319 ETH
211500532024-11-09 12:19:1118 days ago1731154751
0x7618Db15...2ee846d16
0.009914 ETH
211467632024-11-09 1:19:2318 days ago1731115163
0x7618Db15...2ee846d16
0.00700387 ETH
211393042024-11-08 0:19:2319 days ago1731025163
0x7618Db15...2ee846d16
0.00197367 ETH
211327442024-11-07 2:19:2320 days ago1730945963
0x7618Db15...2ee846d16
0.00088113 ETH
211321462024-11-07 0:19:1120 days ago1730938751
0x7618Db15...2ee846d16
0.00325224 ETH
211085612024-11-03 17:19:1124 days ago1730654351
0x7618Db15...2ee846d16
0.00111153 ETH
210700522024-10-29 8:19:2329 days ago1730189963
0x7618Db15...2ee846d16
0.00048478 ETH
210325382024-10-24 2:41:5934 days ago1729737719
0x7618Db15...2ee846d16
0.00187579 ETH
210325362024-10-24 2:41:3534 days ago1729737695
0x7618Db15...2ee846d16
0.01805261 ETH
210325362024-10-24 2:41:3534 days ago1729737695
0x7618Db15...2ee846d16
0.02286658 ETH
210325362024-10-24 2:41:3534 days ago1729737695
0x7618Db15...2ee846d16
0.20459601 ETH
210325362024-10-24 2:41:3534 days ago1729737695
0x7618Db15...2ee846d16
0.32735362 ETH
210325362024-10-24 2:41:3534 days ago1729737695
0x7618Db15...2ee846d16
0.0818384 ETH
210325362024-10-24 2:41:3534 days ago1729737695
0x7618Db15...2ee846d16
0.16367681 ETH
210325362024-10-24 2:41:3534 days ago1729737695
0x7618Db15...2ee846d16
0.39083344 ETH
View All Internal Transactions
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
DistributionContract

Compiler Version
v0.7.6+commit.7338295f

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
File 1 of 2 : ETHDistributor.sol
import "./lib2.sol";
pragma solidity >=0.5.0 <0.8.0;
pragma abicoder v2;

contract DistributionContract is Ownable {
    using FullMath for uint256;

    // Events
    event RevenueSent(uint256 honoAmount, uint256 timestamp);

    // State Variables
    HonoToken public HONO;
    IERC20 public WETH;
    IERC20 public USDC;
    IERC20 public LINK;
    IUniswapV3Router public router;
    IUniswapV3Pool public _pool;
    INonfungiblePositionManager public _posMgr;
    HonoLPEngine public _lpEngine;
    uint256 public _tokenId;

    // Fee and Minimum Swap Parameters
    uint24 public feeForETHLINK = 3000;
    uint24 public slippageForETHLINK = 9000;
    uint24 public feeForHONOUSDC = 3000;
    uint256 public minimumLinkToSwap = 0;
    uint256 public minimumUSDCToSwap = 0;
    uint256 public minimumHONOToRedeem = 0;
    uint256 public minimumWETHToRedeem = 0;
    uint256 public minimumETHToDistribute = 0;

    // Distribution Percentages
    uint256 public HonoBackingP = 4000;
    uint256 public AddLPP = 500;
    uint256 public OperationWalletP = 2500;
    uint256 public HONOStakingRewardP = 2000;
    uint256 public PoolMinterP = 1000;

    // Addresses
    address payable public OperationWallet = 0x1784cf268e4a5D48562F01506C6f570aBc35F9c1;
    address payable public HONOStakingReward = 0xf39D0162e3d03fD95ea8355611cD331B3E068B18;
    address payable public PoolMinter = 0x0aC73C4559E08C05C7c3E0B5255f8E6cdd4639b0;

    // Price Variables
    uint256 public sqrt_price_high;
    uint256 public sqrt_price_low;
    uint256 maxApprove = 11579208923731619542357098500868790785326998466564056403945758400791312963993;

    // Constructor
    constructor(
        address honoAddress,
        address posMgr,
        address lpengine,
        uint256 tokenId,
        address routerAddress,
        address weth,
        address link,
        uint256 usdc
    ) {
        HONO = HonoToken(honoAddress);
        _posMgr = INonfungiblePositionManager(posMgr);
        _lpEngine = HonoLPEngine(lpengine);
        router = IUniswapV3Router(routerAddress);
        WETH = IERC20(weth);
        LINK = IERC20(link);
        USDC = IERC20(usdc);
        _tokenId = tokenId;
        _preconfig(_tokenId);
    }

    // Configuration Functions
    function updateLpEngine(address lpEngine) external onlyOwner {
        _lpEngine = HonoLPEngine(lpEngine);
    }

    function updateTokenId(uint256 tokenId) external {
        require(owner() == _msgSender() || _msgSender() == address(_lpEngine), "Not owner or lpengine");
        _tokenId = tokenId;
        _preconfig(_tokenId);
    }

    function updateMinimumLinkToSwap(uint256 _newAmount) external onlyOwner {
        minimumLinkToSwap = _newAmount;
    }
    function updateslippageForETHLINK(uint24 _newAmount) external onlyOwner {
        slippageForETHLINK = _newAmount;
    }

    function updateMinimumUSDCToSwap(uint256 _newAmount) external onlyOwner {
        minimumUSDCToSwap = _newAmount;
    }

    function updateminimumHONOToRedeem(uint256 _newAmount) external onlyOwner {
        minimumHONOToRedeem = _newAmount;
    }

    function updateminimumWETHToRedeem(uint256 _newAmount) external onlyOwner {
        minimumWETHToRedeem = _newAmount;
    }

    function updateminimumETHToDistribute(uint256 _newAmount) external onlyOwner {
        minimumETHToDistribute = _newAmount;
    }

    function updateETHLinkFee(uint24 _BP) external onlyOwner {
        feeForETHLINK = _BP;
    }

    function UpdateHONOUSDTFEE(uint24 _BP) external onlyOwner {
        feeForHONOUSDC = _BP;
    }

    function UpdateAddLPP(uint256 _BP) external onlyOwner {
        AddLPP = _BP;
    }

    function UpdateHonoBackingP(uint256 _BP) external onlyOwner {
        HonoBackingP = _BP;
    }

    function UpdateHONOStakingReward(address payable _newRecipient, uint256 _BP) external onlyOwner {
        HONOStakingReward = _newRecipient;
        HONOStakingRewardP = _BP;
    }

    function UpdatePoolMinter(address payable _newRecipient, uint256 _BP) external onlyOwner {
        PoolMinter = _newRecipient;
        PoolMinterP = _BP;
    }

    function UpdateOperationWallet(address payable _newRecipient, uint256 _BP) external onlyOwner {
        OperationWallet = _newRecipient;
        OperationWalletP = _BP;
    }

    // Distribution Functions
    function distributeFee() external {
        if (LINK.balanceOf(address(this)) > minimumLinkToSwap) {
            univ3swapWithLINKInput(LINK.balanceOf(address(this)));
        }

        if (USDC.balanceOf(address(this)) > minimumUSDCToSwap) {
            univ3swapWithUSDCInputHonoOutput(USDC.balanceOf(address(this)));
        }

        if (HONO.balanceOf(address(this)) > minimumHONOToRedeem) {
            HONO.redeem(HONO.balanceOf(address(this)));
        }

        if (WETH.balanceOf(address(this)) > minimumWETHToRedeem) {
            IWETH(address(WETH)).withdraw(WETH.balanceOf(address(this)));
        }

        uint totalETH = address(this).balance;
        if (totalETH > minimumETHToDistribute) {
            if (HONOStakingRewardP > 0) {
                sendEth(HONOStakingReward, totalETH * HONOStakingRewardP / 10000);
            }
            if (PoolMinterP > 0) {
                sendEth(PoolMinter, totalETH * PoolMinterP / 10000);
            }
            if (HonoBackingP > 0) {
                HONO.deposit{value: totalETH * HonoBackingP / 10000}();
            }
            if (OperationWalletP > 0) {
                sendEth(OperationWallet, totalETH * OperationWalletP / 10000);
            }
            if (AddLPP > 0) {
                swapAndAddLp(address(this).balance);
            }
            emit RevenueSent(totalETH, block.timestamp);
        }
    }

    function withdrawFunds() external onlyOwner {
        uint256 contractBalance = address(this).balance;
        require(contractBalance > 0, "No value to withdraw");
        payable(owner()).transfer(contractBalance);
    }

    receive() payable external {}

    // Internal Helper Functions
    function sendEth(address _address, uint256 _value) internal {
        (bool success, ) = _address.call{value: _value}("");
        require(success, "ETH Transfer failed.");
    }

    function sqrtPriceX96ToUint(uint160 sqrtPriceX96, uint8 decimalsToken0)
        internal
        pure
        returns (uint256)
    {
        uint256 numerator1 = uint256(sqrtPriceX96) * uint256(sqrtPriceX96);
        uint256 numerator2 = 10 ** decimalsToken0;
        return FullMath.mulDiv(numerator1, numerator2, 1 << 192);
    }

    function swapAndAddLp(uint256 totalEth) internal {
        (uint256 ethToSwap, uint256 ethToAddLp ) = _calculateCorrectAmount(totalEth);
        uint256 amountLINK = univ3swapWithETHInput(ethToSwap);
        LINK.approve(address(_lpEngine), amountLINK);
        _lpEngine.increaseLiquidityCurrentRange{value: ethToAddLp}(
            _tokenId,
            amountLINK,
            ethToAddLp,
            slippageForETHLINK,
            0x0000000000000000000000000000000000000000
        );
    }

    function swapAndAddLp() external payable onlyOwner {
        (uint256 ethToAddLp, uint256 ethToSwap) = _calculateCorrectAmount(msg.value);
        uint256 amountLINK = univ3swapWithETHInput(ethToSwap);
        LINK.approve(address(_lpEngine), amountLINK);
        if(amountLINK < ethToAddLp)
        {
            _lpEngine.increaseLiquidityCurrentRange{value: ethToAddLp}(
            _tokenId,
            ethToAddLp,
            amountLINK,
            10000,
            0x0000000000000000000000000000000000000000
            );
        }
        else
        {
            _lpEngine.increaseLiquidityCurrentRange{value: ethToAddLp}(
            _tokenId,
            amountLINK,
            ethToAddLp,
            10000,
            0x0000000000000000000000000000000000000000
        );
        }
        
    }

    function calculateCorrectAmount(uint256 totalETH) external view returns (uint256, uint256) {
        return _calculateCorrectAmount(totalETH);
    }

    function _calculateCorrectAmount(uint256 totalETH) internal view returns (uint256, uint256)
    {
        //we know eth is the token0, so can do this, if it is reverse need to change a bit
        (uint160 sqrtRatioX96,,,,,,) = _pool.slot0();
        uint256 priceWithDecimal = FullMath.mulDiv(2**96, 10**9, sqrtRatioX96)**2;
        uint256 liquidityWithDecimal = _getAmount1Needed();
        uint256 amountETHToAddLp = FullMath.mulDiv(totalETH, liquidityWithDecimal, priceWithDecimal + liquidityWithDecimal);

        return(amountETHToAddLp, totalETH - amountETHToAddLp);

    }

    function computeAddress(address token0, address token1, uint24 fee) external view returns (address) {
        return PoolAddress.computeAddress(
            _posMgr.factory(),
            PoolAddress.PoolKey({token0: token0, token1: token1, fee: fee})
        );
    }

    function _preconfig(uint256 tokenId) internal {
        _tokenId = tokenId;
        ( , , address token0, address token1, uint24 fee, int24 tickLower, int24 tickUpper, , , , , ) = _posMgr.positions(tokenId);

        _pool = IUniswapV3Pool(
            PoolAddress.computeAddress(
                _posMgr.factory(),
                PoolAddress.PoolKey({token0: token0, token1: token1, fee: fee})
            )
        );

        IERC20(token0).approve(address(router), maxApprove);
        IERC20(token1).approve(address(router), maxApprove);
        IERC20(token0).approve(address(_lpEngine), maxApprove);
        IERC20(token1).approve(address(_lpEngine), maxApprove);
        LINK.approve(address(router), maxApprove);
        USDC.approve(address(router), maxApprove);

        sqrt_price_high = TickMath.getSqrtRatioAtTick(tickUpper);
        sqrt_price_low = TickMath.getSqrtRatioAtTick(tickLower);
    }

    function PreConfig(uint256 tokenId) external onlyOwner {
        _preconfig(tokenId);
    }

    function _getAmount1Needed() internal view returns (uint256 token0needed) {
        (uint160 sqrtRatioX96,,,,,,) = _pool.slot0();
        token0needed = FullMath.mulDiv(sqrt_price_high, sqrtRatioX96, sqrt_price_high - sqrtRatioX96);
        token0needed = token0needed * (sqrtRatioX96 - sqrt_price_low);
        token0needed = FullMath.mulDiv(10**18, 2**192,token0needed );
    }

    function getAmount1Needed( ) external view returns (uint256 token1needed) {
        token1needed = _getAmount1Needed();
    }

    function univ3swapWithETHInput(uint256 amount) internal returns (uint256) {
        uint deadline = block.timestamp + 3000;
        IUniswapV3Router.ExactInputParams memory params = IUniswapV3Router.ExactInputParams({
            path: abi.encodePacked(WETH, feeForETHLINK, LINK),
            recipient: address(this),
            deadline: deadline,
            amountIn: amount,
            amountOutMinimum: 0
        });
        return router.exactInput{value: amount}(params);
    }

    function univ3swapWithLINKInput(uint256 amount) internal returns (uint256) {
        uint deadline = block.timestamp + 3000;
        IUniswapV3Router.ExactInputParams memory params = IUniswapV3Router.ExactInputParams({
            path: abi.encodePacked(LINK, feeForETHLINK, WETH),
            recipient: address(this),
            deadline: deadline,
            amountIn: amount,
            amountOutMinimum: 0
        });
        return router.exactInput(params);
    }

    function univ3swapWithUSDCInputHonoOutput(uint256 amount) internal returns (uint256) {
        uint deadline = block.timestamp + 3000;
        IUniswapV3Router.ExactInputParams memory params = IUniswapV3Router.ExactInputParams({
            path: abi.encodePacked(USDC, feeForHONOUSDC, HONO),
            recipient: address(this),
            deadline: deadline,
            amountIn: amount,
            amountOutMinimum: 0
        });
        return router.exactInput(params);
    }
    
    function recoverTokens(address tokenAddress) external onlyOwner {
        IERC20 token = IERC20(tokenAddress);
        token.transfer(msg.sender, token.balanceOf(address(this)));
    }
}

File 2 of 2 : lib2.sol
/**
 *Submitted for verification at Etherscan.io on 2023-07-11
*/
pragma solidity >=0.5.0 <0.8.0;
pragma abicoder v2;
library LowGasSafeMath {
    /// @notice Returns x + y, reverts if sum overflows uint256
    /// @param x The augend
    /// @param y The addend
    /// @return z The sum of x and y
    function add(uint256 x, uint256 y) internal pure returns (uint256 z) {
        require((z = x + y) >= x);
    }

    /// @notice Returns x - y, reverts if underflows
    /// @param x The minuend
    /// @param y The subtrahend
    /// @return z The difference of x and y
    function sub(uint256 x, uint256 y) internal pure returns (uint256 z) {
        require((z = x - y) <= x);
    }

    /// @notice Returns x * y, reverts if overflows
    /// @param x The multiplicand
    /// @param y The multiplier
    /// @return z The product of x and y
    function mul(uint256 x, uint256 y) internal pure returns (uint256 z) {
        require(x == 0 || (z = x * y) / x == y);
    }

    /// @notice Returns x + y, reverts if overflows or underflows
    /// @param x The augend
    /// @param y The addend
    /// @return z The sum of x and y
    function add(int256 x, int256 y) internal pure returns (int256 z) {
        require((z = x + y) >= x == (y >= 0));
    }

    /// @notice Returns x - y, reverts if overflows or underflows
    /// @param x The minuend
    /// @param y The subtrahend
    /// @return z The difference of x and y
    function sub(int256 x, int256 y) internal pure returns (int256 z) {
        require((z = x - y) <= x == (y >= 0));
    }
}
library TickMath {
    /// @dev The minimum tick that may be passed to #getSqrtRatioAtTick computed from log base 1.0001 of 2**-128
    int24 internal constant MIN_TICK = -887272;
    /// @dev The maximum tick that may be passed to #getSqrtRatioAtTick computed from log base 1.0001 of 2**128
    int24 internal constant MAX_TICK = -MIN_TICK;

    /// @dev The minimum value that can be returned from #getSqrtRatioAtTick. Equivalent to getSqrtRatioAtTick(MIN_TICK)
    uint160 internal constant MIN_SQRT_RATIO = 4295128739;
    /// @dev The maximum value that can be returned from #getSqrtRatioAtTick. Equivalent to getSqrtRatioAtTick(MAX_TICK)
    uint160 internal constant MAX_SQRT_RATIO = 1461446703485210103287273052203988822378723970342;

    /// @notice Calculates sqrt(1.0001^tick) * 2^96
    /// @dev Throws if |tick| > max tick
    /// @param tick The input tick for the above formula
    /// @return sqrtPriceX96 A Fixed point Q64.96 number representing the sqrt of the ratio of the two assets (token1/token0)
    /// at the given tick
    function getSqrtRatioAtTick(int24 tick) internal pure returns (uint160 sqrtPriceX96) {
        uint256 absTick = tick < 0 ? uint256(-int256(tick)) : uint256(int256(tick));
        require(absTick <= uint256(MAX_TICK), 'T');

        uint256 ratio = absTick & 0x1 != 0 ? 0xfffcb933bd6fad37aa2d162d1a594001 : 0x100000000000000000000000000000000;
        if (absTick & 0x2 != 0) ratio = (ratio * 0xfff97272373d413259a46990580e213a) >> 128;
        if (absTick & 0x4 != 0) ratio = (ratio * 0xfff2e50f5f656932ef12357cf3c7fdcc) >> 128;
        if (absTick & 0x8 != 0) ratio = (ratio * 0xffe5caca7e10e4e61c3624eaa0941cd0) >> 128;
        if (absTick & 0x10 != 0) ratio = (ratio * 0xffcb9843d60f6159c9db58835c926644) >> 128;
        if (absTick & 0x20 != 0) ratio = (ratio * 0xff973b41fa98c081472e6896dfb254c0) >> 128;
        if (absTick & 0x40 != 0) ratio = (ratio * 0xff2ea16466c96a3843ec78b326b52861) >> 128;
        if (absTick & 0x80 != 0) ratio = (ratio * 0xfe5dee046a99a2a811c461f1969c3053) >> 128;
        if (absTick & 0x100 != 0) ratio = (ratio * 0xfcbe86c7900a88aedcffc83b479aa3a4) >> 128;
        if (absTick & 0x200 != 0) ratio = (ratio * 0xf987a7253ac413176f2b074cf7815e54) >> 128;
        if (absTick & 0x400 != 0) ratio = (ratio * 0xf3392b0822b70005940c7a398e4b70f3) >> 128;
        if (absTick & 0x800 != 0) ratio = (ratio * 0xe7159475a2c29b7443b29c7fa6e889d9) >> 128;
        if (absTick & 0x1000 != 0) ratio = (ratio * 0xd097f3bdfd2022b8845ad8f792aa5825) >> 128;
        if (absTick & 0x2000 != 0) ratio = (ratio * 0xa9f746462d870fdf8a65dc1f90e061e5) >> 128;
        if (absTick & 0x4000 != 0) ratio = (ratio * 0x70d869a156d2a1b890bb3df62baf32f7) >> 128;
        if (absTick & 0x8000 != 0) ratio = (ratio * 0x31be135f97d08fd981231505542fcfa6) >> 128;
        if (absTick & 0x10000 != 0) ratio = (ratio * 0x9aa508b5b7a84e1c677de54f3e99bc9) >> 128;
        if (absTick & 0x20000 != 0) ratio = (ratio * 0x5d6af8dedb81196699c329225ee604) >> 128;
        if (absTick & 0x40000 != 0) ratio = (ratio * 0x2216e584f5fa1ea926041bedfe98) >> 128;
        if (absTick & 0x80000 != 0) ratio = (ratio * 0x48a170391f7dc42444e8fa2) >> 128;

        if (tick > 0) ratio = type(uint256).max / ratio;

        // this divides by 1<<32 rounding up to go from a Q128.128 to a Q128.96.
        // we then downcast because we know the result always fits within 160 bits due to our tick input constraint
        // we round up in the division so getTickAtSqrtRatio of the output price is always consistent
        sqrtPriceX96 = uint160((ratio >> 32) + (ratio % (1 << 32) == 0 ? 0 : 1));
    }

    /// @notice Calculates the greatest tick value such that getRatioAtTick(tick) <= ratio
    /// @dev Throws in case sqrtPriceX96 < MIN_SQRT_RATIO, as MIN_SQRT_RATIO is the lowest value getRatioAtTick may
    /// ever return.
    /// @param sqrtPriceX96 The sqrt ratio for which to compute the tick as a Q64.96
    /// @return tick The greatest tick for which the ratio is less than or equal to the input ratio
    function getTickAtSqrtRatio(uint160 sqrtPriceX96) internal pure returns (int24 tick) {
        // second inequality must be < because the price can never reach the price at the max tick
        require(sqrtPriceX96 >= MIN_SQRT_RATIO && sqrtPriceX96 < MAX_SQRT_RATIO, 'R');
        uint256 ratio = uint256(sqrtPriceX96) << 32;

        uint256 r = ratio;
        uint256 msb = 0;

        assembly {
            let f := shl(7, gt(r, 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF))
            msb := or(msb, f)
            r := shr(f, r)
        }
        assembly {
            let f := shl(6, gt(r, 0xFFFFFFFFFFFFFFFF))
            msb := or(msb, f)
            r := shr(f, r)
        }
        assembly {
            let f := shl(5, gt(r, 0xFFFFFFFF))
            msb := or(msb, f)
            r := shr(f, r)
        }
        assembly {
            let f := shl(4, gt(r, 0xFFFF))
            msb := or(msb, f)
            r := shr(f, r)
        }
        assembly {
            let f := shl(3, gt(r, 0xFF))
            msb := or(msb, f)
            r := shr(f, r)
        }
        assembly {
            let f := shl(2, gt(r, 0xF))
            msb := or(msb, f)
            r := shr(f, r)
        }
        assembly {
            let f := shl(1, gt(r, 0x3))
            msb := or(msb, f)
            r := shr(f, r)
        }
        assembly {
            let f := gt(r, 0x1)
            msb := or(msb, f)
        }

        if (msb >= 128) r = ratio >> (msb - 127);
        else r = ratio << (127 - msb);

        int256 log_2 = (int256(msb) - 128) << 64;

        assembly {
            r := shr(127, mul(r, r))
            let f := shr(128, r)
            log_2 := or(log_2, shl(63, f))
            r := shr(f, r)
        }
        assembly {
            r := shr(127, mul(r, r))
            let f := shr(128, r)
            log_2 := or(log_2, shl(62, f))
            r := shr(f, r)
        }
        assembly {
            r := shr(127, mul(r, r))
            let f := shr(128, r)
            log_2 := or(log_2, shl(61, f))
            r := shr(f, r)
        }
        assembly {
            r := shr(127, mul(r, r))
            let f := shr(128, r)
            log_2 := or(log_2, shl(60, f))
            r := shr(f, r)
        }
        assembly {
            r := shr(127, mul(r, r))
            let f := shr(128, r)
            log_2 := or(log_2, shl(59, f))
            r := shr(f, r)
        }
        assembly {
            r := shr(127, mul(r, r))
            let f := shr(128, r)
            log_2 := or(log_2, shl(58, f))
            r := shr(f, r)
        }
        assembly {
            r := shr(127, mul(r, r))
            let f := shr(128, r)
            log_2 := or(log_2, shl(57, f))
            r := shr(f, r)
        }
        assembly {
            r := shr(127, mul(r, r))
            let f := shr(128, r)
            log_2 := or(log_2, shl(56, f))
            r := shr(f, r)
        }
        assembly {
            r := shr(127, mul(r, r))
            let f := shr(128, r)
            log_2 := or(log_2, shl(55, f))
            r := shr(f, r)
        }
        assembly {
            r := shr(127, mul(r, r))
            let f := shr(128, r)
            log_2 := or(log_2, shl(54, f))
            r := shr(f, r)
        }
        assembly {
            r := shr(127, mul(r, r))
            let f := shr(128, r)
            log_2 := or(log_2, shl(53, f))
            r := shr(f, r)
        }
        assembly {
            r := shr(127, mul(r, r))
            let f := shr(128, r)
            log_2 := or(log_2, shl(52, f))
            r := shr(f, r)
        }
        assembly {
            r := shr(127, mul(r, r))
            let f := shr(128, r)
            log_2 := or(log_2, shl(51, f))
            r := shr(f, r)
        }
        assembly {
            r := shr(127, mul(r, r))
            let f := shr(128, r)
            log_2 := or(log_2, shl(50, f))
        }

        int256 log_sqrt10001 = log_2 * 255738958999603826347141; // 128.128 number

        int24 tickLow = int24((log_sqrt10001 - 3402992956809132418596140100660247210) >> 128);
        int24 tickHi = int24((log_sqrt10001 + 291339464771989622907027621153398088495) >> 128);

        tick = tickLow == tickHi ? tickLow : getSqrtRatioAtTick(tickHi) <= sqrtPriceX96 ? tickHi : tickLow;
    }
}

library FullMath {
    /// @notice Calculates floor(a×b÷denominator) with full precision. Throws if result overflows a uint256 or denominator == 0
    /// @param a The multiplicand
    /// @param b The multiplier
    /// @param denominator The divisor
    /// @return result The 256-bit result
    /// @dev Credit to Remco Bloemen under MIT license https://xn--2-umb.com/21/muldiv
    function mulDiv(
        uint256 a,
        uint256 b,
        uint256 denominator
    ) internal pure returns (uint256 result) {
        // 512-bit multiply [prod1 prod0] = a * b
        // Compute the product mod 2**256 and mod 2**256 - 1
        // then use the Chinese Remainder Theorem to reconstruct
        // the 512 bit result. The result is stored in two 256
        // variables such that product = prod1 * 2**256 + prod0
        uint256 prod0; // Least significant 256 bits of the product
        uint256 prod1; // Most significant 256 bits of the product
        assembly {
            let mm := mulmod(a, b, not(0))
            prod0 := mul(a, b)
            prod1 := sub(sub(mm, prod0), lt(mm, prod0))
        }

        // Handle non-overflow cases, 256 by 256 division
        if (prod1 == 0) {
            require(denominator > 0);
            assembly {
                result := div(prod0, denominator)
            }
            return result;
        }

        // Make sure the result is less than 2**256.
        // Also prevents denominator == 0
        require(denominator > prod1);

        ///////////////////////////////////////////////
        // 512 by 256 division.
        ///////////////////////////////////////////////

        // Make division exact by subtracting the remainder from [prod1 prod0]
        // Compute remainder using mulmod
        uint256 remainder;
        assembly {
            remainder := mulmod(a, b, denominator)
        }
        // Subtract 256 bit number from 512 bit number
        assembly {
            prod1 := sub(prod1, gt(remainder, prod0))
            prod0 := sub(prod0, remainder)
        }

        // Factor powers of two out of denominator
        // Compute largest power of two divisor of denominator.
        // Always >= 1.
        uint256 twos = -denominator & denominator;
        // Divide denominator by power of two
        assembly {
            denominator := div(denominator, twos)
        }

        // Divide [prod1 prod0] by the factors of two
        assembly {
            prod0 := div(prod0, twos)
        }
        // Shift in bits from prod1 into prod0. For this we need
        // to flip `twos` such that it is 2**256 / twos.
        // If twos is zero, then it becomes one
        assembly {
            twos := add(div(sub(0, twos), twos), 1)
        }
        prod0 |= prod1 * twos;

        // Invert denominator mod 2**256
        // Now that denominator is an odd number, it has an inverse
        // modulo 2**256 such that denominator * inv = 1 mod 2**256.
        // Compute the inverse by starting with a seed that is correct
        // correct for four bits. That is, denominator * inv = 1 mod 2**4
        uint256 inv = (3 * denominator) ^ 2;
        // Now use Newton-Raphson iteration to improve the precision.
        // Thanks to Hensel's lifting lemma, this also works in modular
        // arithmetic, doubling the correct bits in each step.
        inv *= 2 - denominator * inv; // inverse mod 2**8
        inv *= 2 - denominator * inv; // inverse mod 2**16
        inv *= 2 - denominator * inv; // inverse mod 2**32
        inv *= 2 - denominator * inv; // inverse mod 2**64
        inv *= 2 - denominator * inv; // inverse mod 2**128
        inv *= 2 - denominator * inv; // inverse mod 2**256

        // Because the division is now exact we can divide by multiplying
        // with the modular inverse of denominator. This will give us the
        // correct result modulo 2**256. Since the precoditions guarantee
        // that the outcome is less than 2**256, this is the final result.
        // We don't need to compute the high bits of the result and prod1
        // is no longer required.
        result = prod0 * inv;
        return result;
    }

    /// @notice Calculates ceil(a×b÷denominator) with full precision. Throws if result overflows a uint256 or denominator == 0
    /// @param a The multiplicand
    /// @param b The multiplier
    /// @param denominator The divisor
    /// @return result The 256-bit result
    function mulDivRoundingUp(
        uint256 a,
        uint256 b,
        uint256 denominator
    ) internal pure returns (uint256 result) {
        result = mulDiv(a, b, denominator);
        if (mulmod(a, b, denominator) > 0) {
            require(result < type(uint256).max);
            result++;
        }
    }
}

interface IUniswapV3Router {
    struct ExactInputParams {
        bytes path;
        address recipient;
        uint256 deadline;
        uint256 amountIn;
        uint256 amountOutMinimum;
    }
    function exactInput(ExactInputParams calldata params) external payable returns (uint256 amountOut);
}

library PoolAddress {
    bytes32 internal constant POOL_INIT_CODE_HASH = 0xe34f199b19b2b4f47f68442619d555527d244f78a3297ea89325f843f87b8b54;

    /// @notice The identifying key of the pool
    struct PoolKey {
        address token0;
        address token1;
        uint24 fee;
    }

    /// @notice Returns PoolKey: the ordered tokens with the matched fee levels
    /// @param tokenA The first token of a pool, unsorted
    /// @param tokenB The second token of a pool, unsorted
    /// @param fee The fee level of the pool
    /// @return Poolkey The pool details with ordered token0 and token1 assignments
    function getPoolKey(
        address tokenA,
        address tokenB,
        uint24 fee
    ) internal pure returns (PoolKey memory) {
        if (tokenA > tokenB) (tokenA, tokenB) = (tokenB, tokenA);
        return PoolKey({token0: tokenA, token1: tokenB, fee: fee});
    }

    /// @notice Deterministically computes the pool address given the factory and PoolKey
    /// @param factory The Uniswap V3 factory contract address
    /// @param key The PoolKey
    /// @return pool The contract address of the V3 pool
    function computeAddress(address factory, PoolKey memory key) internal pure returns (address pool) {
        require(key.token0 < key.token1);
        pool = address(
            uint256(
                keccak256(
                    abi.encodePacked(
                        hex'ff',
                        factory,
                        keccak256(abi.encode(key.token0, key.token1, key.fee)),
                        POOL_INIT_CODE_HASH
                    )
                )
            )
        );
    }
    
}

interface IUniswapV3Pool 
{
    struct Slot0 {
        // the current price
        uint160 sqrtPriceX96;
        // the current tick
        int24 tick;
        // the most-recently updated index of the observations array
        uint16 observationIndex;
        // the current maximum number of observations that are being stored
        uint16 observationCardinality;
        // the next maximum number of observations to store, triggered in observations.write
        uint16 observationCardinalityNext;
        // the current protocol fee as a percentage of the swap fee taken on withdrawal
        // represented as an integer denominator (1/x)%
        uint8 feeProtocol;
        // whether the pool is locked
        bool unlocked;
    }
    function liquidity()
        external
        view
        returns (uint256);
    function slot0()
        external
        view
        returns (
            uint160 sqrtPriceX96,
            int24 tick,
            uint16 observationIndex,
            uint16 observationCardinality,
            uint16 observationCardinalityNext,
            uint8 feeProtocol,
            bool unlocked
        );
}

interface INonfungiblePositionManager
{
    /// @notice Emitted when liquidity is increased for a position NFT
    /// @dev Also emitted when a token is minted
    /// @param tokenId The ID of the token for which liquidity was increased
    /// @param liquidity The amount by which liquidity for the NFT position was increased
    /// @param amount0 The amount of token0 that was paid for the increase in liquidity
    /// @param amount1 The amount of token1 that was paid for the increase in liquidity
    event IncreaseLiquidity(uint256 indexed tokenId, uint128 liquidity, uint256 amount0, uint256 amount1);
    /// @notice Emitted when liquidity is decreased for a position NFT
    /// @param tokenId The ID of the token for which liquidity was decreased
    /// @param liquidity The amount by which liquidity for the NFT position was decreased
    /// @param amount0 The amount of token0 that was accounted for the decrease in liquidity
    /// @param amount1 The amount of token1 that was accounted for the decrease in liquidity
    event DecreaseLiquidity(uint256 indexed tokenId, uint128 liquidity, uint256 amount0, uint256 amount1);
    /// @notice Emitted when tokens are collected for a position NFT
    /// @dev The amounts reported may not be exactly equivalent to the amounts transferred, due to rounding behavior
    /// @param tokenId The ID of the token for which underlying tokens were collected
    /// @param recipient The address of the account that received the collected tokens
    /// @param amount0 The amount of token0 owed to the position that was collected
    /// @param amount1 The amount of token1 owed to the position that was collected
    event Collect(uint256 indexed tokenId, address recipient, uint256 amount0, uint256 amount1);

    /// @notice Returns the position information associated with a given token ID.
    /// @dev Throws if the token ID is not valid.
    /// @param tokenId The ID of the token that represents the position
    /// @return nonce The nonce for permits
    /// @return operator The address that is approved for spending
    /// @return token0 The address of the token0 for a specific pool
    /// @return token1 The address of the token1 for a specific pool
    /// @return fee The fee associated with the pool
    /// @return tickLower The lower end of the tick range for the position
    /// @return tickUpper The higher end of the tick range for the position
    /// @return liquidity The liquidity of the position
    /// @return feeGrowthInside0LastX128 The fee growth of token0 as of the last action on the individual position
    /// @return feeGrowthInside1LastX128 The fee growth of token1 as of the last action on the individual position
    /// @return tokensOwed0 The uncollected amount of token0 owed to the position as of the last computation
    /// @return tokensOwed1 The uncollected amount of token1 owed to the position as of the last computation
    function positions(uint256 tokenId)
        external
        view
        returns (
            uint96 nonce,
            address operator,
            address token0,
            address token1,
            uint24 fee,
            int24 tickLower,
            int24 tickUpper,
            uint128 liquidity,
            uint256 feeGrowthInside0LastX128,
            uint256 feeGrowthInside1LastX128,
            uint128 tokensOwed0,
            uint128 tokensOwed1
        );

    struct MintParams {
        address token0;
        address token1;
        uint24 fee;
        int24 tickLower;
        int24 tickUpper;
        uint256 amount0Desired;
        uint256 amount1Desired;
        uint256 amount0Min;
        uint256 amount1Min;
        address recipient;
        uint256 deadline;
    }

    /// @notice Creates a new position wrapped in a NFT
    /// @dev Call this when the pool does exist and is initialized. Note that if the pool is created but not initialized
    /// a method does not exist, i.e. the pool is assumed to be initialized.
    /// @param params The params necessary to mint a position, encoded as `MintParams` in calldata
    /// @return tokenId The ID of the token that represents the minted position
    /// @return liquidity The amount of liquidity for this position
    /// @return amount0 The amount of token0
    /// @return amount1 The amount of token1
    function mint(MintParams calldata params)
        external
        payable
        returns (
            uint256 tokenId,
            uint128 liquidity,
            uint256 amount0,
            uint256 amount1
        );

    struct IncreaseLiquidityParams {
        uint256 tokenId;
        uint256 amount0Desired;
        uint256 amount1Desired;
        uint256 amount0Min;
        uint256 amount1Min;
        uint256 deadline;
    }

    /// @notice Increases the amount of liquidity in a position, with tokens paid by the `msg.sender`
    /// @param params tokenId The ID of the token for which liquidity is being increased,
    /// amount0Desired The desired amount of token0 to be spent,
    /// amount1Desired The desired amount of token1 to be spent,
    /// amount0Min The minimum amount of token0 to spend, which serves as a slippage check,
    /// amount1Min The minimum amount of token1 to spend, which serves as a slippage check,
    /// deadline The time by which the transaction must be included to effect the change
    /// @return liquidity The new liquidity amount as a result of the increase
    /// @return amount0 The amount of token0 to acheive resulting liquidity
    /// @return amount1 The amount of token1 to acheive resulting liquidity
    function increaseLiquidity(IncreaseLiquidityParams calldata params)
        external
        payable
        returns (
            uint128 liquidity,
            uint256 amount0,
            uint256 amount1
        );

    struct DecreaseLiquidityParams {
        uint256 tokenId;
        uint128 liquidity;
        uint256 amount0Min;
        uint256 amount1Min;
        uint256 deadline;
    }

    /// @notice Decreases the amount of liquidity in a position and accounts it to the position
    /// @param params tokenId The ID of the token for which liquidity is being decreased,
    /// amount The amount by which liquidity will be decreased,
    /// amount0Min The minimum amount of token0 that should be accounted for the burned liquidity,
    /// amount1Min The minimum amount of token1 that should be accounted for the burned liquidity,
    /// deadline The time by which the transaction must be included to effect the change
    /// @return amount0 The amount of token0 accounted to the position's tokens owed
    /// @return amount1 The amount of token1 accounted to the position's tokens owed
    function decreaseLiquidity(DecreaseLiquidityParams calldata params)
        external
        payable
        returns (uint256 amount0, uint256 amount1);

    struct CollectParams {
        uint256 tokenId;
        address recipient;
        uint128 amount0Max;
        uint128 amount1Max;
    }

    /// @notice Collects up to a maximum amount of fees owed to a specific position to the recipient
    /// @param params tokenId The ID of the NFT for which tokens are being collected,
    /// recipient The account that should receive the tokens,
    /// amount0Max The maximum amount of token0 to collect,
    /// amount1Max The maximum amount of token1 to collect
    /// @return amount0 The amount of fees collected in token0
    /// @return amount1 The amount of fees collected in token1
    function collect(CollectParams calldata params) external payable returns (uint256 amount0, uint256 amount1);

    /// @notice Burns a token ID, which deletes it from the NFT contract. The token must have 0 liquidity and all tokens
    /// must be collected first.
    /// @param tokenId The ID of the token that is being burned
    function burn(uint256 tokenId) external payable;
    function factory() external view returns (address);
}
// File: @openzeppelin/contracts/utils/math/SafeMath.sol

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

/**
 * @dev Wrappers over Solidity's arithmetic operations.
 *
 * NOTE: `SafeMath` is generally not needed starting with Solidity 0.8, since the compiler
 * now has built in overflow checking.
 */
// File: @openzeppelin/contracts/utils/Address.sol


// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)

/**
 * @dev Collection of functions related to the address type
 */
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)

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

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


// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)

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

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

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

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

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

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

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

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

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

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


// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)

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

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

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

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

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

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

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

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

// File: @openzeppelin/contracts/token/ERC20/extensions/draft-IERC20Permit.sol


// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/draft-IERC20Permit.sol)

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

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

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

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

interface HonoToken {
    function deposit() external payable;
    function balanceOf(address account) external view returns (uint);
    function redeem(uint256 _amount) external;
}

interface HonoLPEngine
{
    function increaseLiquidityCurrentRange(uint256 tokenId, uint256 amountAdd0, uint256 amountAdd1, uint256 slippage, address referrer)
        external
        payable
        returns (uint128 liquidity, uint256 amount0, uint256 amount1);
}

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);
}

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

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"honoAddress","type":"address"},{"internalType":"address","name":"posMgr","type":"address"},{"internalType":"address","name":"lpengine","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"address","name":"routerAddress","type":"address"},{"internalType":"address","name":"weth","type":"address"},{"internalType":"address","name":"link","type":"address"},{"internalType":"uint256","name":"usdc","type":"uint256"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"honoAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"timestamp","type":"uint256"}],"name":"RevenueSent","type":"event"},{"inputs":[],"name":"AddLPP","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"HONO","outputs":[{"internalType":"contract HonoToken","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"HONOStakingReward","outputs":[{"internalType":"address payable","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"HONOStakingRewardP","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"HonoBackingP","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"LINK","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"OperationWallet","outputs":[{"internalType":"address payable","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"OperationWalletP","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PoolMinter","outputs":[{"internalType":"address payable","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PoolMinterP","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"PreConfig","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"USDC","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_BP","type":"uint256"}],"name":"UpdateAddLPP","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address payable","name":"_newRecipient","type":"address"},{"internalType":"uint256","name":"_BP","type":"uint256"}],"name":"UpdateHONOStakingReward","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint24","name":"_BP","type":"uint24"}],"name":"UpdateHONOUSDTFEE","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_BP","type":"uint256"}],"name":"UpdateHonoBackingP","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address payable","name":"_newRecipient","type":"address"},{"internalType":"uint256","name":"_BP","type":"uint256"}],"name":"UpdateOperationWallet","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address payable","name":"_newRecipient","type":"address"},{"internalType":"uint256","name":"_BP","type":"uint256"}],"name":"UpdatePoolMinter","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"WETH","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"_lpEngine","outputs":[{"internalType":"contract HonoLPEngine","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"_pool","outputs":[{"internalType":"contract IUniswapV3Pool","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"_posMgr","outputs":[{"internalType":"contract INonfungiblePositionManager","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"_tokenId","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"totalETH","type":"uint256"}],"name":"calculateCorrectAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"token0","type":"address"},{"internalType":"address","name":"token1","type":"address"},{"internalType":"uint24","name":"fee","type":"uint24"}],"name":"computeAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"distributeFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"feeForETHLINK","outputs":[{"internalType":"uint24","name":"","type":"uint24"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"feeForHONOUSDC","outputs":[{"internalType":"uint24","name":"","type":"uint24"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getAmount1Needed","outputs":[{"internalType":"uint256","name":"token1needed","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"minimumETHToDistribute","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"minimumHONOToRedeem","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"minimumLinkToSwap","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"minimumUSDCToSwap","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"minimumWETHToRedeem","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"tokenAddress","type":"address"}],"name":"recoverTokens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"router","outputs":[{"internalType":"contract IUniswapV3Router","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"slippageForETHLINK","outputs":[{"internalType":"uint24","name":"","type":"uint24"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"sqrt_price_high","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"sqrt_price_low","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"swapAndAddLp","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint24","name":"_BP","type":"uint24"}],"name":"updateETHLinkFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"lpEngine","type":"address"}],"name":"updateLpEngine","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_newAmount","type":"uint256"}],"name":"updateMinimumLinkToSwap","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_newAmount","type":"uint256"}],"name":"updateMinimumUSDCToSwap","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"updateTokenId","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_newAmount","type":"uint256"}],"name":"updateminimumETHToDistribute","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_newAmount","type":"uint256"}],"name":"updateminimumHONOToRedeem","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_newAmount","type":"uint256"}],"name":"updateminimumWETHToRedeem","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint24","name":"_newAmount","type":"uint24"}],"name":"updateslippageForETHLINK","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"withdrawFunds","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]

6080604052600a8054610bb862ffffff199091161765ffffff00000019166423280000001762ffffff60301b1916670bb80000000000001790556000600b819055600c819055600d819055600e819055600f55610fa06010556101f46011556109c46012556107d06013556103e860145560158054731784cf268e4a5d48562f01506c6f570abc35f9c16001600160a01b0319918216179091556016805473f39d0162e3d03fd95ea8355611cd331b3e068b1890831617905560178054730ac73c4559e08c05c7c3e0b5255f8e6cdd4639b092169190911790557f1999999999999999999999999999999999999999999999999999999999999999601a553480156200010a57600080fd5b5060405162003af238038062003af28339810160408190526200012d9162000bc0565b620001416200013b620001cd565b620001d1565b600180546001600160a01b03199081166001600160a01b038b8116919091179092556007805482168a8416179055600880548216898416179055600580548216878416179055600280548216868416179055600480548216858416179055600380549091169183169190911790556009859055620001bf8562000221565b505050505050505062000e15565b3390565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b600981905560075460405163133f757160e31b815260009182918291829182916001600160a01b0316906399fbab88906200026190899060040162000e0c565b6101806040518083038186803b1580156200027b57600080fd5b505afa15801562000290573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620002b6919062000c77565b505050505096509650965096509650505062000398600760009054906101000a90046001600160a01b03166001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b1580156200031a57600080fd5b505afa1580156200032f573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000355919062000b9c565b6040518060600160405280886001600160a01b03168152602001876001600160a01b031681526020018662ffffff168152506200075460201b6200168e1760201c565b600680546001600160a01b0319166001600160a01b03928316179055600554601a5460405163095ea7b360e01b81528884169363095ea7b393620003e29391169160040162000dd8565b602060405180830381600087803b158015620003fd57600080fd5b505af115801562000412573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000438919062000c55565b50600554601a5460405163095ea7b360e01b81526001600160a01b038781169363095ea7b3936200047193929091169160040162000dd8565b602060405180830381600087803b1580156200048c57600080fd5b505af1158015620004a1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620004c7919062000c55565b50600854601a5460405163095ea7b360e01b81526001600160a01b038881169363095ea7b3936200050093929091169160040162000dd8565b602060405180830381600087803b1580156200051b57600080fd5b505af115801562000530573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000556919062000c55565b50600854601a5460405163095ea7b360e01b81526001600160a01b038781169363095ea7b3936200058f93929091169160040162000dd8565b602060405180830381600087803b158015620005aa57600080fd5b505af1158015620005bf573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620005e5919062000c55565b5060048054600554601a5460405163095ea7b360e01b81526001600160a01b039384169463095ea7b3946200061e941692910162000dd8565b602060405180830381600087803b1580156200063957600080fd5b505af11580156200064e573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000674919062000c55565b50600354600554601a5460405163095ea7b360e01b81526001600160a01b039384169363095ea7b393620006ae9391169160040162000dd8565b602060405180830381600087803b158015620006c957600080fd5b505af1158015620006de573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000704919062000c55565b506200071b816200080a60201b6200173f1760201c565b6001600160a01b031660188190555062000740826200080a60201b6200173f1760201c565b6001600160a01b0316601955505050505050565b600081602001516001600160a01b031682600001516001600160a01b0316106200077d57600080fd5b82826000015183602001518460400151604051602001620007a19392919062000db0565b60408051601f19818403018152908290528051602091820120620007eb939290917fe34f199b19b2b4f47f68442619d555527d244f78a3297ea89325f843f87b8b54910162000d65565b60408051601f1981840301815291905280516020909101209392505050565b60008060008360020b1262000823578260020b6200082b565b8260020b6000035b9050620d89e88111156200085c5760405162461bcd60e51b8152600401620008539062000df1565b60405180910390fd5b6000600182166200087257600160801b62000884565b6ffffcb933bd6fad37aa2d162d1a5940015b6001600160881b031690506002821615620008af576ffff97272373d413259a46990580e213a0260801c5b6004821615620008cf576ffff2e50f5f656932ef12357cf3c7fdcc0260801c5b6008821615620008ef576fffe5caca7e10e4e61c3624eaa0941cd00260801c5b60108216156200090f576fffcb9843d60f6159c9db58835c9266440260801c5b60208216156200092f576fff973b41fa98c081472e6896dfb254c00260801c5b60408216156200094f576fff2ea16466c96a3843ec78b326b528610260801c5b60808216156200096f576ffe5dee046a99a2a811c461f1969c30530260801c5b61010082161562000990576ffcbe86c7900a88aedcffc83b479aa3a40260801c5b610200821615620009b1576ff987a7253ac413176f2b074cf7815e540260801c5b610400821615620009d2576ff3392b0822b70005940c7a398e4b70f30260801c5b610800821615620009f3576fe7159475a2c29b7443b29c7fa6e889d90260801c5b61100082161562000a14576fd097f3bdfd2022b8845ad8f792aa58250260801c5b61200082161562000a35576fa9f746462d870fdf8a65dc1f90e061e50260801c5b61400082161562000a56576f70d869a156d2a1b890bb3df62baf32f70260801c5b61800082161562000a77576f31be135f97d08fd981231505542fcfa60260801c5b6201000082161562000a99576f09aa508b5b7a84e1c677de54f3e99bc90260801c5b6202000082161562000aba576e5d6af8dedb81196699c329225ee6040260801c5b6204000082161562000ada576d2216e584f5fa1ea926041bedfe980260801c5b6208000082161562000af8576b048a170391f7dc42444e8fa20260801c5b60008460020b131562000b1557806000198162000b1157fe5b0490505b64010000000081061562000b2b57600162000b2e565b60005b60ff16602082901c0192505050919050565b80516001600160a01b038116811462000b5857600080fd5b919050565b8051600281900b811462000b5857600080fd5b80516001600160801b038116811462000b5857600080fd5b805162ffffff8116811462000b5857600080fd5b60006020828403121562000bae578081fd5b62000bb98262000b40565b9392505050565b600080600080600080600080610100898b03121562000bdd578384fd5b62000be88962000b40565b975062000bf860208a0162000b40565b965062000c0860408a0162000b40565b95506060890151945062000c1f60808a0162000b40565b935062000c2f60a08a0162000b40565b925062000c3f60c08a0162000b40565b915060e089015190509295985092959890939650565b60006020828403121562000c67578081fd5b8151801515811462000bb9578182fd5b6000806000806000806000806000806000806101808d8f03121562000c9a578384fd5b8c516001600160601b038116811462000cb1578485fd5b9b5062000cc160208e0162000b40565b9a5062000cd160408e0162000b40565b995062000ce160608e0162000b40565b985062000cf160808e0162000b88565b975062000d0160a08e0162000b5d565b965062000d1160c08e0162000b5d565b955062000d2160e08e0162000b70565b94506101008d015193506101208d0151925062000d426101408e0162000b70565b915062000d536101608e0162000b70565b90509295989b509295989b509295989b565b7fff00000000000000000000000000000000000000000000000000000000000000815260609390931b6001600160601b03191660018401526015830191909152603582015260550190565b6001600160a01b03938416815291909216602082015262ffffff909116604082015260600190565b6001600160a01b03929092168252602082015260400190565b6020808252600190820152601560fa1b604082015260600190565b90815260200190565b612ccd8062000e256000396000f3fe60806040526004361061031e5760003560e01c80635ce2d0cb116101ab578063aaea23a0116100f7578063dd14dd9011610095578063f2fde38b1161006f578063f2fde38b14610828578063f317502814610848578063f887ea401461085d578063fffa3ced1461087257610325565b8063dd14dd90146107d3578063e0eec1b9146107e8578063e3c3afac1461080857610325565b8063ba48b416116100d1578063ba48b4161461077f578063c2d3ee4014610794578063daaf8501146107a9578063dad2734d146107be57610325565b8063aaea23a014610735578063ad5c46481461074a578063aea385e01461075f57610325565b80638d9f2f74116101645780639883523f1161013e5780639883523f146106b257806398ccb6ca146106d25780639b203dbb14610700578063a56996d31461072057610325565b80638d9f2f741461065d5780638da5cb5b1461067d57806396a2ec2d1461069257610325565b80635ce2d0cb146105e15780635f99ff71146105e9578063636fc28b14610609578063715018a61461061e57806383f5b3a81461063357806389a302711461064857610325565b806326c4e60d1161026a5780633ec8bde81161022357806349cafc7f116101fd57806349cafc7f146105825780634ba191701461059757806350f9df02146105ac5780635b45b5d9146105c157610325565b80633ec8bde81461052d57806344f29b801461054257806345c5c66f1461056257610325565b806326c4e60d14610497578063275fb3b9146104ac5780632acfa9e3146104c15780632ef217a4146104e35780633e5104de146105035780633ea02eac1461051857610325565b80631b6b6d23116102d7578063222f950f116102b1578063222f950f1461043857806322fdd1f51461044d57806324600fc31461046d578063248225141461048257610325565b80631b6b6d23146103e15780631d136bfb1461040357806320b127211461041857610325565b8063021bd5481461032a578063049fd03d1461034c5780630a4c22dc1461036c5780630f2ea48b1461039757806316114acd146103ac5780631643f794146103cc57610325565b3661032557005b600080fd5b34801561033657600080fd5b5061034a610345366004612856565b610892565b005b34801561035857600080fd5b5061034a61036736600461283a565b61089f565b34801561037857600080fd5b506103816108c1565b60405161038e9190612bfd565b60405180910390f35b3480156103a357600080fd5b506103816108c7565b3480156103b857600080fd5b5061034a6103c73660046126b1565b6108cd565b3480156103d857600080fd5b506103816109d1565b3480156103ed57600080fd5b506103f66109d7565b60405161038e91906129e8565b34801561040f57600080fd5b506103816109e6565b34801561042457600080fd5b506103f6610433366004612714565b6109ec565b34801561044457600080fd5b50610381610ab8565b34801561045957600080fd5b5061034a61046836600461283a565b610abe565b34801561047957600080fd5b5061034a610aea565b34801561048e57600080fd5b50610381610b5d565b3480156104a357600080fd5b5061034a610b63565b3480156104b857600080fd5b50610381611184565b3480156104cd57600080fd5b506104d661118a565b60405161038e9190612bed565b3480156104ef57600080fd5b5061034a6104fe3660046126b1565b611195565b34801561050f57600080fd5b506103816111bf565b34801561052457600080fd5b506103f66111c5565b34801561053957600080fd5b506103816111d4565b34801561054e57600080fd5b5061034a61055d366004612856565b6111da565b34801561056e57600080fd5b5061034a61057d366004612856565b6111e7565b34801561058e57600080fd5b506104d6611259565b3480156105a357600080fd5b506103f661126b565b3480156105b857600080fd5b5061038161127a565b3480156105cd57600080fd5b5061034a6105dc3660046126e9565b611280565b61034a6112ae565b3480156105f557600080fd5b5061034a6106043660046126e9565b611497565b34801561061557600080fd5b506103f66114c5565b34801561062a57600080fd5b5061034a6114d4565b34801561063f57600080fd5b506103816114e8565b34801561065457600080fd5b506103f66114ee565b34801561066957600080fd5b5061034a610678366004612856565b6114fd565b34801561068957600080fd5b506103f661150e565b34801561069e57600080fd5b5061034a6106ad3660046126e9565b61151d565b3480156106be57600080fd5b5061034a6106cd366004612856565b61154b565b3480156106de57600080fd5b506106f26106ed366004612856565b611558565b60405161038e929190612c06565b34801561070c57600080fd5b5061034a61071b366004612856565b61156d565b34801561072c57600080fd5b506103f661157a565b34801561074157600080fd5b506103f6611589565b34801561075657600080fd5b506103f6611598565b34801561076b57600080fd5b5061034a61077a366004612856565b6115a7565b34801561078b57600080fd5b506103816115b4565b3480156107a057600080fd5b506103f66115ba565b3480156107b557600080fd5b506103f66115c9565b3480156107ca57600080fd5b506103816115d8565b3480156107df57600080fd5b506104d66115e7565b3480156107f457600080fd5b5061034a61080336600461283a565b6115f9565b34801561081457600080fd5b5061034a610823366004612856565b611628565b34801561083457600080fd5b5061034a6108433660046126b1565b611635565b34801561085457600080fd5b5061038161166c565b34801561086957600080fd5b506103f6611672565b34801561087e57600080fd5b5061034a61088d366004612856565b611681565b61089a611a58565b601155565b6108a7611a58565b600a805462ffffff191662ffffff92909216919091179055565b60135481565b600f5481565b6108d5611a58565b6040516370a0823160e01b815281906001600160a01b0382169063a9059cbb90339083906370a082319061090d9030906004016129e8565b60206040518083038186803b15801561092557600080fd5b505afa158015610939573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061095d919061286e565b6040518363ffffffff1660e01b815260040161097a9291906129fc565b602060405180830381600087803b15801561099457600080fd5b505af11580156109a8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109cc919061275e565b505050565b600c5481565b6004546001600160a01b031681565b60125481565b6000610aae600760009054906101000a90046001600160a01b03166001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610a3f57600080fd5b505afa158015610a53573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a7791906126cd565b6040518060600160405280876001600160a01b03168152602001866001600160a01b031681526020018562ffffff1681525061168e565b90505b9392505050565b600e5481565b610ac6611a58565b600a805462ffffff90921663010000000265ffffff00000019909216919091179055565b610af2611a58565b4780610b195760405162461bcd60e51b8152600401610b1090612a83565b60405180910390fd5b610b2161150e565b6001600160a01b03166108fc829081150290604051600060405180830381858888f19350505050158015610b59573d6000803e3d6000fd5b5050565b60095481565b600b54600480546040516370a0823160e01b81526001600160a01b03909116916370a0823191610b95913091016129e8565b60206040518083038186803b158015610bad57600080fd5b505afa158015610bc1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610be5919061286e565b1115610c7557600480546040516370a0823160e01b8152610c73926001600160a01b03909216916370a0823191610c1e913091016129e8565b60206040518083038186803b158015610c3657600080fd5b505afa158015610c4a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c6e919061286e565b611a97565b505b600c546003546040516370a0823160e01b81526001600160a01b03909116906370a0823190610ca89030906004016129e8565b60206040518083038186803b158015610cc057600080fd5b505afa158015610cd4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cf8919061286e565b1115610d87576003546040516370a0823160e01b8152610d85916001600160a01b0316906370a0823190610d309030906004016129e8565b60206040518083038186803b158015610d4857600080fd5b505afa158015610d5c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d80919061286e565b611b99565b505b600d546001546040516370a0823160e01b81526001600160a01b03909116906370a0823190610dba9030906004016129e8565b60206040518083038186803b158015610dd257600080fd5b505afa158015610de6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e0a919061286e565b1115610ee7576001546040516370a0823160e01b81526001600160a01b039091169063db006a759082906370a0823190610e489030906004016129e8565b60206040518083038186803b158015610e6057600080fd5b505afa158015610e74573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e98919061286e565b6040518263ffffffff1660e01b8152600401610eb49190612bfd565b600060405180830381600087803b158015610ece57600080fd5b505af1158015610ee2573d6000803e3d6000fd5b505050505b600e546002546040516370a0823160e01b81526001600160a01b03909116906370a0823190610f1a9030906004016129e8565b60206040518083038186803b158015610f3257600080fd5b505afa158015610f46573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f6a919061286e565b1115611047576002546040516370a0823160e01b81526001600160a01b0390911690632e1a7d4d9082906370a0823190610fa89030906004016129e8565b60206040518083038186803b158015610fc057600080fd5b505afa158015610fd4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ff8919061286e565b6040518263ffffffff1660e01b81526004016110149190612bfd565b600060405180830381600087803b15801561102e57600080fd5b505af1158015611042573d6000803e3d6000fd5b505050505b600f544790811115611181576013541561107c5760165460135461107c916001600160a01b0316906127109084025b04611be4565b601454156110a3576017546014546110a3916001600160a01b031690612710908402611076565b6010541561110f576001546010546001600160a01b039091169063d0e30db090612710908402046040518263ffffffff1660e01b81526004016000604051808303818588803b1580156110f557600080fd5b505af1158015611109573d6000803e3d6000fd5b50505050505b6012541561113657601554601254611136916001600160a01b031690612710908402611076565b601154156111475761114747611c60565b7fe27433f62605db3813804daf75a595d40ed9c1b42e15d2b44fa6cb757f60d6348142604051611178929190612c06565b60405180910390a15b50565b600b5481565b600a5462ffffff1681565b61119d611a58565b600880546001600160a01b0319166001600160a01b0392909216919091179055565b60145481565b6016546001600160a01b031681565b600d5481565b6111e2611a58565b600e55565b6111ef611dad565b6001600160a01b031661120061150e565b6001600160a01b0316148061122f57506008546001600160a01b0316611224611dad565b6001600160a01b0316145b61124b5760405162461bcd60e51b8152600401610b1090612ab1565b600981905561118181611db1565b600a546301000000900462ffffff1681565b6001546001600160a01b031681565b60105481565b611288611a58565b601680546001600160a01b0319166001600160a01b039390931692909217909155601355565b6112b6611a58565b6000806112c23461228c565b9150915060006112d18261236c565b6004805460085460405163095ea7b360e01b81529394506001600160a01b039182169363095ea7b39361130a93909216918691016129fc565b602060405180830381600087803b15801561132457600080fd5b505af1158015611338573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061135c919061275e565b50828110156113fe57600854600954604051631b29fb8f60e01b81526001600160a01b0390921691631b29fb8f9186916113a491908390879061271090600090600401612c14565b6060604051808303818588803b1580156113bd57600080fd5b505af11580156113d1573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906113f69190612778565b5050506109cc565b600854600954604051631b29fb8f60e01b81526001600160a01b0390921691631b29fb8f91869161143d91908690849061271090600090600401612c14565b6060604051808303818588803b15801561145657600080fd5b505af115801561146a573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061148f9190612778565b505050505050565b61149f611a58565b601580546001600160a01b0319166001600160a01b039390931692909217909155601255565b6006546001600160a01b031681565b6114dc611a58565b6114e66000612466565b565b60115481565b6003546001600160a01b031681565b611505611a58565b61118181611db1565b6000546001600160a01b031690565b611525611a58565b601780546001600160a01b0319166001600160a01b039390931692909217909155601455565b611553611a58565b600c55565b6000806115648361228c565b91509150915091565b611575611a58565b601055565b6017546001600160a01b031681565b6008546001600160a01b031681565b6002546001600160a01b031681565b6115af611a58565b600b55565b60185481565b6007546001600160a01b031681565b6015546001600160a01b031681565b60006115e26124b6565b905090565b600a54600160301b900462ffffff1681565b611601611a58565b600a805462ffffff909216600160301b0268ffffff00000000000019909216919091179055565b611630611a58565b600f55565b61163d611a58565b6001600160a01b0381166116635760405162461bcd60e51b8152600401610b1090612a3d565b61118181612466565b60195481565b6005546001600160a01b031681565b611689611a58565b600d55565b600081602001516001600160a01b031682600001516001600160a01b0316106116b657600080fd5b828260000151836020015184604001516040516020016116d893929190612a15565b60408051601f19818403018152908290528051602091820120611720939290917fe34f199b19b2b4f47f68442619d555527d244f78a3297ea89325f843f87b8b5491016129ad565b60408051601f1981840301815291905280516020909101209392505050565b60008060008360020b12611756578260020b61175e565b8260020b6000035b9050620d89e88111156117835760405162461bcd60e51b8152600401610b1090612ae0565b60006001821661179757600160801b6117a9565b6ffffcb933bd6fad37aa2d162d1a5940015b70ffffffffffffffffffffffffffffffffff16905060028216156117dd576ffff97272373d413259a46990580e213a0260801c5b60048216156117fc576ffff2e50f5f656932ef12357cf3c7fdcc0260801c5b600882161561181b576fffe5caca7e10e4e61c3624eaa0941cd00260801c5b601082161561183a576fffcb9843d60f6159c9db58835c9266440260801c5b6020821615611859576fff973b41fa98c081472e6896dfb254c00260801c5b6040821615611878576fff2ea16466c96a3843ec78b326b528610260801c5b6080821615611897576ffe5dee046a99a2a811c461f1969c30530260801c5b6101008216156118b7576ffcbe86c7900a88aedcffc83b479aa3a40260801c5b6102008216156118d7576ff987a7253ac413176f2b074cf7815e540260801c5b6104008216156118f7576ff3392b0822b70005940c7a398e4b70f30260801c5b610800821615611917576fe7159475a2c29b7443b29c7fa6e889d90260801c5b611000821615611937576fd097f3bdfd2022b8845ad8f792aa58250260801c5b612000821615611957576fa9f746462d870fdf8a65dc1f90e061e50260801c5b614000821615611977576f70d869a156d2a1b890bb3df62baf32f70260801c5b618000821615611997576f31be135f97d08fd981231505542fcfa60260801c5b620100008216156119b8576f09aa508b5b7a84e1c677de54f3e99bc90260801c5b620200008216156119d8576e5d6af8dedb81196699c329225ee6040260801c5b620400008216156119f7576d2216e584f5fa1ea926041bedfe980260801c5b62080000821615611a14576b048a170391f7dc42444e8fa20260801c5b60008460020b1315611a2f578060001981611a2b57fe5b0490505b640100000000810615611a43576001611a46565b60005b60ff16602082901c0192505050919050565b611a60611dad565b6001600160a01b0316611a7161150e565b6001600160a01b0316146114e65760405162461bcd60e51b8152600401610b1090612b29565b6040805160a08101909152600454600a54600254600093610bb8420193859391928392611adc926001600160a01b039081169262ffffff909216911660c08501612972565b60408051601f19818403018152918152908252306020830152818101859052606082018790526000608090920191909152600554905163c04b8d5960e01b81529192506001600160a01b03169063c04b8d5990611b3d908490600401612b5e565b602060405180830381600087803b158015611b5757600080fd5b505af1158015611b6b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b8f919061286e565b925050505b919050565b6040805160a08101909152600354600a5460015460009342610bb80193859391928392611adc926001600160a01b0390811692600160301b90920462ffffff16911660c08501612972565b6000826001600160a01b031682604051611bfd906129e5565b60006040518083038185875af1925050503d8060008114611c3a576040519150601f19603f3d011682016040523d82523d6000602084013e611c3f565b606091505b50509050806109cc5760405162461bcd60e51b8152600401610b1090612afb565b600080611c6c8361228c565b915091506000611c7b8361236c565b6004805460085460405163095ea7b360e01b81529394506001600160a01b039182169363095ea7b393611cb493909216918691016129fc565b602060405180830381600087803b158015611cce57600080fd5b505af1158015611ce2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d06919061275e565b50600854600954600a54604051631b29fb8f60e01b81526001600160a01b0390931692631b29fb8f928692611d529287918591630100000090910462ffffff1690600090600401612c40565b6060604051808303818588803b158015611d6b57600080fd5b505af1158015611d7f573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190611da49190612778565b50505050505050565b3390565b600981905560075460405163133f757160e31b815260009182918291829182916001600160a01b0316906399fbab8890611def908990600401612bfd565b6101806040518083038186803b158015611e0857600080fd5b505afa158015611e1c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e409190612886565b5050505050965096509650965096505050611f11600760009054906101000a90046001600160a01b03166001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015611ea257600080fd5b505afa158015611eb6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611eda91906126cd565b6040518060600160405280886001600160a01b03168152602001876001600160a01b031681526020018662ffffff1681525061168e565b600680546001600160a01b0319166001600160a01b03928316179055600554601a5460405163095ea7b360e01b81528884169363095ea7b393611f59939116916004016129fc565b602060405180830381600087803b158015611f7357600080fd5b505af1158015611f87573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fab919061275e565b50600554601a5460405163095ea7b360e01b81526001600160a01b038781169363095ea7b393611fe29392909116916004016129fc565b602060405180830381600087803b158015611ffc57600080fd5b505af1158015612010573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612034919061275e565b50600854601a5460405163095ea7b360e01b81526001600160a01b038881169363095ea7b39361206b9392909116916004016129fc565b602060405180830381600087803b15801561208557600080fd5b505af1158015612099573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120bd919061275e565b50600854601a5460405163095ea7b360e01b81526001600160a01b038781169363095ea7b3936120f49392909116916004016129fc565b602060405180830381600087803b15801561210e57600080fd5b505af1158015612122573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612146919061275e565b5060048054600554601a5460405163095ea7b360e01b81526001600160a01b039384169463095ea7b39461217d94169291016129fc565b602060405180830381600087803b15801561219757600080fd5b505af11580156121ab573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906121cf919061275e565b50600354600554601a5460405163095ea7b360e01b81526001600160a01b039384169363095ea7b393612207939116916004016129fc565b602060405180830381600087803b15801561222157600080fd5b505af1158015612235573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612259919061275e565b506122638161173f565b6001600160a01b03166018556122788261173f565b6001600160a01b0316601955505050505050565b6000806000600660009054906101000a90046001600160a01b03166001600160a01b0316633850c7bd6040518163ffffffff1660e01b815260040160e06040518083038186803b1580156122df57600080fd5b505afa1580156122f3573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061231791906127ac565b50505050505090506000600261233f600160601b633b9aca00856001600160a01b0316612598565b0a9050600061234c6124b6565b9050600061235d8783848601612598565b97968890039695505050505050565b6040805160a08101909152600254600a54600454600093610bb84201938593919283926123b1926001600160a01b039081169262ffffff909216911660c08501612972565b60408051601f19818403018152918152908252306020830152818101859052606082018790526000608090920191909152600554905163c04b8d5960e01b81529192506001600160a01b03169063c04b8d59908690612414908590600401612b5e565b6020604051808303818588803b15801561242d57600080fd5b505af1158015612441573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190611b8f919061286e565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b600080600660009054906101000a90046001600160a01b03166001600160a01b0316633850c7bd6040518163ffffffff1660e01b815260040160e06040518083038186803b15801561250757600080fd5b505afa15801561251b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061253f91906127ac565b505050505050905061256a601854826001600160a01b0316836001600160a01b031660185403612598565b6019546001600160a01b03831603029150612592670de0b6b3a7640000600160c01b84612598565b91505090565b60008080600019858709868602925082811090839003039050806125ce57600084116125c357600080fd5b508290049050610ab1565b8084116125da57600080fd5b6000848688096000868103871696879004966002600389028118808a02820302808a02820302808a02820302808a02820302808a02820302808a02909103029181900381900460010186841190950394909402919094039290920491909117919091029150509392505050565b8051611b9481612c71565b80518015158114611b9457600080fd5b8051600281900b8114611b9457600080fd5b80516fffffffffffffffffffffffffffffffff81168114611b9457600080fd5b805161ffff81168114611b9457600080fd5b8051611b9481612c86565b6000602082840312156126c2578081fd5b8135610ab181612c71565b6000602082840312156126de578081fd5b8151610ab181612c71565b600080604083850312156126fb578081fd5b823561270681612c71565b946020939093013593505050565b600080600060608486031215612728578081fd5b833561273381612c71565b9250602084013561274381612c71565b9150604084013561275381612c86565b809150509250925092565b60006020828403121561276f578081fd5b610ab182612652565b60008060006060848603121561278c578283fd5b61279584612674565b925060208401519150604084015190509250925092565b600080600080600080600060e0888a0312156127c6578283fd5b87516127d181612c71565b96506127df60208901612662565b95506127ed60408901612694565b94506127fb60608901612694565b935061280960808901612694565b925060a088015160ff8116811461281e578283fd5b915061282c60c08901612652565b905092959891949750929550565b60006020828403121561284b578081fd5b8135610ab181612c86565b600060208284031215612867578081fd5b5035919050565b60006020828403121561287f578081fd5b5051919050565b6000806000806000806000806000806000806101808d8f0312156128a8578586fd5b8c516bffffffffffffffffffffffff811681146128c3578687fd5b9b506128d160208e01612647565b9a506128df60408e01612647565b99506128ed60608e01612647565b98506128fb60808e016126a6565b975061290960a08e01612662565b965061291760c08e01612662565b955061292560e08e01612674565b94506101008d015193506101208d015192506129446101408e01612674565b91506129536101608e01612674565b90509295989b509295989b509295989b565b6001600160a01b03169052565b606093841b6bffffffffffffffffffffffff19908116825260e89390931b6001600160e81b0319166014820152921b166017820152602b0190565b6001600160f81b0319815260609390931b6bffffffffffffffffffffffff191660018401526015830191909152603582015260550190565b90565b6001600160a01b0391909116815260200190565b6001600160a01b03929092168252602082015260400190565b6001600160a01b03938416815291909216602082015262ffffff909116604082015260600190565b60208082526026908201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160408201526564647265737360d01b606082015260800190565b6020808252601490820152734e6f2076616c756520746f20776974686472617760601b604082015260600190565b6020808252601590820152744e6f74206f776e6572206f72206c70656e67696e6560581b604082015260600190565b6020808252600190820152601560fa1b604082015260600190565b60208082526014908201527322aa24102a3930b739b332b9103330b4b632b21760611b604082015260600190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60006020808352835160a08285015280518060c0860152835b81811015612b935782810184015186820160e001528301612b77565b81811115612ba4578460e083880101525b509185015191612bb76040860184612965565b6040860151606086015260608601516080860152608086015160a086015260e0601f19601f830116860101935050505092915050565b62ffffff91909116815260200190565b90815260200190565b918252602082015260400190565b9485526020850193909352604084019190915260608301526001600160a01b0316608082015260a00190565b9485526020850193909352604084019190915262ffffff1660608301526001600160a01b0316608082015260a00190565b6001600160a01b038116811461118157600080fd5b62ffffff8116811461118157600080fdfea2646970667358221220c7e2eab19621a38819a4f0f20fb144bf1d787bfe4c7c638c363622835cc236d464736f6c634300070600330000000000000000000000000e16bd2cd962fadb4a23ec961bb170ffa25208a8000000000000000000000000c36442b4a4522e871399cd717abdd847ab11fe88000000000000000000000000a0f0f0b37f88fd5eebf70232f3517e7ce6ffb6b900000000000000000000000000000000000000000000000000000000000bb01a000000000000000000000000e592427a0aece92de3edee1f18e0157c05861564000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2000000000000000000000000514910771af9ca656af840dff83e8264ecf986ca000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48

Deployed Bytecode

0x60806040526004361061031e5760003560e01c80635ce2d0cb116101ab578063aaea23a0116100f7578063dd14dd9011610095578063f2fde38b1161006f578063f2fde38b14610828578063f317502814610848578063f887ea401461085d578063fffa3ced1461087257610325565b8063dd14dd90146107d3578063e0eec1b9146107e8578063e3c3afac1461080857610325565b8063ba48b416116100d1578063ba48b4161461077f578063c2d3ee4014610794578063daaf8501146107a9578063dad2734d146107be57610325565b8063aaea23a014610735578063ad5c46481461074a578063aea385e01461075f57610325565b80638d9f2f74116101645780639883523f1161013e5780639883523f146106b257806398ccb6ca146106d25780639b203dbb14610700578063a56996d31461072057610325565b80638d9f2f741461065d5780638da5cb5b1461067d57806396a2ec2d1461069257610325565b80635ce2d0cb146105e15780635f99ff71146105e9578063636fc28b14610609578063715018a61461061e57806383f5b3a81461063357806389a302711461064857610325565b806326c4e60d1161026a5780633ec8bde81161022357806349cafc7f116101fd57806349cafc7f146105825780634ba191701461059757806350f9df02146105ac5780635b45b5d9146105c157610325565b80633ec8bde81461052d57806344f29b801461054257806345c5c66f1461056257610325565b806326c4e60d14610497578063275fb3b9146104ac5780632acfa9e3146104c15780632ef217a4146104e35780633e5104de146105035780633ea02eac1461051857610325565b80631b6b6d23116102d7578063222f950f116102b1578063222f950f1461043857806322fdd1f51461044d57806324600fc31461046d578063248225141461048257610325565b80631b6b6d23146103e15780631d136bfb1461040357806320b127211461041857610325565b8063021bd5481461032a578063049fd03d1461034c5780630a4c22dc1461036c5780630f2ea48b1461039757806316114acd146103ac5780631643f794146103cc57610325565b3661032557005b600080fd5b34801561033657600080fd5b5061034a610345366004612856565b610892565b005b34801561035857600080fd5b5061034a61036736600461283a565b61089f565b34801561037857600080fd5b506103816108c1565b60405161038e9190612bfd565b60405180910390f35b3480156103a357600080fd5b506103816108c7565b3480156103b857600080fd5b5061034a6103c73660046126b1565b6108cd565b3480156103d857600080fd5b506103816109d1565b3480156103ed57600080fd5b506103f66109d7565b60405161038e91906129e8565b34801561040f57600080fd5b506103816109e6565b34801561042457600080fd5b506103f6610433366004612714565b6109ec565b34801561044457600080fd5b50610381610ab8565b34801561045957600080fd5b5061034a61046836600461283a565b610abe565b34801561047957600080fd5b5061034a610aea565b34801561048e57600080fd5b50610381610b5d565b3480156104a357600080fd5b5061034a610b63565b3480156104b857600080fd5b50610381611184565b3480156104cd57600080fd5b506104d661118a565b60405161038e9190612bed565b3480156104ef57600080fd5b5061034a6104fe3660046126b1565b611195565b34801561050f57600080fd5b506103816111bf565b34801561052457600080fd5b506103f66111c5565b34801561053957600080fd5b506103816111d4565b34801561054e57600080fd5b5061034a61055d366004612856565b6111da565b34801561056e57600080fd5b5061034a61057d366004612856565b6111e7565b34801561058e57600080fd5b506104d6611259565b3480156105a357600080fd5b506103f661126b565b3480156105b857600080fd5b5061038161127a565b3480156105cd57600080fd5b5061034a6105dc3660046126e9565b611280565b61034a6112ae565b3480156105f557600080fd5b5061034a6106043660046126e9565b611497565b34801561061557600080fd5b506103f66114c5565b34801561062a57600080fd5b5061034a6114d4565b34801561063f57600080fd5b506103816114e8565b34801561065457600080fd5b506103f66114ee565b34801561066957600080fd5b5061034a610678366004612856565b6114fd565b34801561068957600080fd5b506103f661150e565b34801561069e57600080fd5b5061034a6106ad3660046126e9565b61151d565b3480156106be57600080fd5b5061034a6106cd366004612856565b61154b565b3480156106de57600080fd5b506106f26106ed366004612856565b611558565b60405161038e929190612c06565b34801561070c57600080fd5b5061034a61071b366004612856565b61156d565b34801561072c57600080fd5b506103f661157a565b34801561074157600080fd5b506103f6611589565b34801561075657600080fd5b506103f6611598565b34801561076b57600080fd5b5061034a61077a366004612856565b6115a7565b34801561078b57600080fd5b506103816115b4565b3480156107a057600080fd5b506103f66115ba565b3480156107b557600080fd5b506103f66115c9565b3480156107ca57600080fd5b506103816115d8565b3480156107df57600080fd5b506104d66115e7565b3480156107f457600080fd5b5061034a61080336600461283a565b6115f9565b34801561081457600080fd5b5061034a610823366004612856565b611628565b34801561083457600080fd5b5061034a6108433660046126b1565b611635565b34801561085457600080fd5b5061038161166c565b34801561086957600080fd5b506103f6611672565b34801561087e57600080fd5b5061034a61088d366004612856565b611681565b61089a611a58565b601155565b6108a7611a58565b600a805462ffffff191662ffffff92909216919091179055565b60135481565b600f5481565b6108d5611a58565b6040516370a0823160e01b815281906001600160a01b0382169063a9059cbb90339083906370a082319061090d9030906004016129e8565b60206040518083038186803b15801561092557600080fd5b505afa158015610939573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061095d919061286e565b6040518363ffffffff1660e01b815260040161097a9291906129fc565b602060405180830381600087803b15801561099457600080fd5b505af11580156109a8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109cc919061275e565b505050565b600c5481565b6004546001600160a01b031681565b60125481565b6000610aae600760009054906101000a90046001600160a01b03166001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610a3f57600080fd5b505afa158015610a53573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a7791906126cd565b6040518060600160405280876001600160a01b03168152602001866001600160a01b031681526020018562ffffff1681525061168e565b90505b9392505050565b600e5481565b610ac6611a58565b600a805462ffffff90921663010000000265ffffff00000019909216919091179055565b610af2611a58565b4780610b195760405162461bcd60e51b8152600401610b1090612a83565b60405180910390fd5b610b2161150e565b6001600160a01b03166108fc829081150290604051600060405180830381858888f19350505050158015610b59573d6000803e3d6000fd5b5050565b60095481565b600b54600480546040516370a0823160e01b81526001600160a01b03909116916370a0823191610b95913091016129e8565b60206040518083038186803b158015610bad57600080fd5b505afa158015610bc1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610be5919061286e565b1115610c7557600480546040516370a0823160e01b8152610c73926001600160a01b03909216916370a0823191610c1e913091016129e8565b60206040518083038186803b158015610c3657600080fd5b505afa158015610c4a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c6e919061286e565b611a97565b505b600c546003546040516370a0823160e01b81526001600160a01b03909116906370a0823190610ca89030906004016129e8565b60206040518083038186803b158015610cc057600080fd5b505afa158015610cd4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cf8919061286e565b1115610d87576003546040516370a0823160e01b8152610d85916001600160a01b0316906370a0823190610d309030906004016129e8565b60206040518083038186803b158015610d4857600080fd5b505afa158015610d5c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d80919061286e565b611b99565b505b600d546001546040516370a0823160e01b81526001600160a01b03909116906370a0823190610dba9030906004016129e8565b60206040518083038186803b158015610dd257600080fd5b505afa158015610de6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e0a919061286e565b1115610ee7576001546040516370a0823160e01b81526001600160a01b039091169063db006a759082906370a0823190610e489030906004016129e8565b60206040518083038186803b158015610e6057600080fd5b505afa158015610e74573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e98919061286e565b6040518263ffffffff1660e01b8152600401610eb49190612bfd565b600060405180830381600087803b158015610ece57600080fd5b505af1158015610ee2573d6000803e3d6000fd5b505050505b600e546002546040516370a0823160e01b81526001600160a01b03909116906370a0823190610f1a9030906004016129e8565b60206040518083038186803b158015610f3257600080fd5b505afa158015610f46573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f6a919061286e565b1115611047576002546040516370a0823160e01b81526001600160a01b0390911690632e1a7d4d9082906370a0823190610fa89030906004016129e8565b60206040518083038186803b158015610fc057600080fd5b505afa158015610fd4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ff8919061286e565b6040518263ffffffff1660e01b81526004016110149190612bfd565b600060405180830381600087803b15801561102e57600080fd5b505af1158015611042573d6000803e3d6000fd5b505050505b600f544790811115611181576013541561107c5760165460135461107c916001600160a01b0316906127109084025b04611be4565b601454156110a3576017546014546110a3916001600160a01b031690612710908402611076565b6010541561110f576001546010546001600160a01b039091169063d0e30db090612710908402046040518263ffffffff1660e01b81526004016000604051808303818588803b1580156110f557600080fd5b505af1158015611109573d6000803e3d6000fd5b50505050505b6012541561113657601554601254611136916001600160a01b031690612710908402611076565b601154156111475761114747611c60565b7fe27433f62605db3813804daf75a595d40ed9c1b42e15d2b44fa6cb757f60d6348142604051611178929190612c06565b60405180910390a15b50565b600b5481565b600a5462ffffff1681565b61119d611a58565b600880546001600160a01b0319166001600160a01b0392909216919091179055565b60145481565b6016546001600160a01b031681565b600d5481565b6111e2611a58565b600e55565b6111ef611dad565b6001600160a01b031661120061150e565b6001600160a01b0316148061122f57506008546001600160a01b0316611224611dad565b6001600160a01b0316145b61124b5760405162461bcd60e51b8152600401610b1090612ab1565b600981905561118181611db1565b600a546301000000900462ffffff1681565b6001546001600160a01b031681565b60105481565b611288611a58565b601680546001600160a01b0319166001600160a01b039390931692909217909155601355565b6112b6611a58565b6000806112c23461228c565b9150915060006112d18261236c565b6004805460085460405163095ea7b360e01b81529394506001600160a01b039182169363095ea7b39361130a93909216918691016129fc565b602060405180830381600087803b15801561132457600080fd5b505af1158015611338573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061135c919061275e565b50828110156113fe57600854600954604051631b29fb8f60e01b81526001600160a01b0390921691631b29fb8f9186916113a491908390879061271090600090600401612c14565b6060604051808303818588803b1580156113bd57600080fd5b505af11580156113d1573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906113f69190612778565b5050506109cc565b600854600954604051631b29fb8f60e01b81526001600160a01b0390921691631b29fb8f91869161143d91908690849061271090600090600401612c14565b6060604051808303818588803b15801561145657600080fd5b505af115801561146a573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061148f9190612778565b505050505050565b61149f611a58565b601580546001600160a01b0319166001600160a01b039390931692909217909155601255565b6006546001600160a01b031681565b6114dc611a58565b6114e66000612466565b565b60115481565b6003546001600160a01b031681565b611505611a58565b61118181611db1565b6000546001600160a01b031690565b611525611a58565b601780546001600160a01b0319166001600160a01b039390931692909217909155601455565b611553611a58565b600c55565b6000806115648361228c565b91509150915091565b611575611a58565b601055565b6017546001600160a01b031681565b6008546001600160a01b031681565b6002546001600160a01b031681565b6115af611a58565b600b55565b60185481565b6007546001600160a01b031681565b6015546001600160a01b031681565b60006115e26124b6565b905090565b600a54600160301b900462ffffff1681565b611601611a58565b600a805462ffffff909216600160301b0268ffffff00000000000019909216919091179055565b611630611a58565b600f55565b61163d611a58565b6001600160a01b0381166116635760405162461bcd60e51b8152600401610b1090612a3d565b61118181612466565b60195481565b6005546001600160a01b031681565b611689611a58565b600d55565b600081602001516001600160a01b031682600001516001600160a01b0316106116b657600080fd5b828260000151836020015184604001516040516020016116d893929190612a15565b60408051601f19818403018152908290528051602091820120611720939290917fe34f199b19b2b4f47f68442619d555527d244f78a3297ea89325f843f87b8b5491016129ad565b60408051601f1981840301815291905280516020909101209392505050565b60008060008360020b12611756578260020b61175e565b8260020b6000035b9050620d89e88111156117835760405162461bcd60e51b8152600401610b1090612ae0565b60006001821661179757600160801b6117a9565b6ffffcb933bd6fad37aa2d162d1a5940015b70ffffffffffffffffffffffffffffffffff16905060028216156117dd576ffff97272373d413259a46990580e213a0260801c5b60048216156117fc576ffff2e50f5f656932ef12357cf3c7fdcc0260801c5b600882161561181b576fffe5caca7e10e4e61c3624eaa0941cd00260801c5b601082161561183a576fffcb9843d60f6159c9db58835c9266440260801c5b6020821615611859576fff973b41fa98c081472e6896dfb254c00260801c5b6040821615611878576fff2ea16466c96a3843ec78b326b528610260801c5b6080821615611897576ffe5dee046a99a2a811c461f1969c30530260801c5b6101008216156118b7576ffcbe86c7900a88aedcffc83b479aa3a40260801c5b6102008216156118d7576ff987a7253ac413176f2b074cf7815e540260801c5b6104008216156118f7576ff3392b0822b70005940c7a398e4b70f30260801c5b610800821615611917576fe7159475a2c29b7443b29c7fa6e889d90260801c5b611000821615611937576fd097f3bdfd2022b8845ad8f792aa58250260801c5b612000821615611957576fa9f746462d870fdf8a65dc1f90e061e50260801c5b614000821615611977576f70d869a156d2a1b890bb3df62baf32f70260801c5b618000821615611997576f31be135f97d08fd981231505542fcfa60260801c5b620100008216156119b8576f09aa508b5b7a84e1c677de54f3e99bc90260801c5b620200008216156119d8576e5d6af8dedb81196699c329225ee6040260801c5b620400008216156119f7576d2216e584f5fa1ea926041bedfe980260801c5b62080000821615611a14576b048a170391f7dc42444e8fa20260801c5b60008460020b1315611a2f578060001981611a2b57fe5b0490505b640100000000810615611a43576001611a46565b60005b60ff16602082901c0192505050919050565b611a60611dad565b6001600160a01b0316611a7161150e565b6001600160a01b0316146114e65760405162461bcd60e51b8152600401610b1090612b29565b6040805160a08101909152600454600a54600254600093610bb8420193859391928392611adc926001600160a01b039081169262ffffff909216911660c08501612972565b60408051601f19818403018152918152908252306020830152818101859052606082018790526000608090920191909152600554905163c04b8d5960e01b81529192506001600160a01b03169063c04b8d5990611b3d908490600401612b5e565b602060405180830381600087803b158015611b5757600080fd5b505af1158015611b6b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b8f919061286e565b925050505b919050565b6040805160a08101909152600354600a5460015460009342610bb80193859391928392611adc926001600160a01b0390811692600160301b90920462ffffff16911660c08501612972565b6000826001600160a01b031682604051611bfd906129e5565b60006040518083038185875af1925050503d8060008114611c3a576040519150601f19603f3d011682016040523d82523d6000602084013e611c3f565b606091505b50509050806109cc5760405162461bcd60e51b8152600401610b1090612afb565b600080611c6c8361228c565b915091506000611c7b8361236c565b6004805460085460405163095ea7b360e01b81529394506001600160a01b039182169363095ea7b393611cb493909216918691016129fc565b602060405180830381600087803b158015611cce57600080fd5b505af1158015611ce2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d06919061275e565b50600854600954600a54604051631b29fb8f60e01b81526001600160a01b0390931692631b29fb8f928692611d529287918591630100000090910462ffffff1690600090600401612c40565b6060604051808303818588803b158015611d6b57600080fd5b505af1158015611d7f573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190611da49190612778565b50505050505050565b3390565b600981905560075460405163133f757160e31b815260009182918291829182916001600160a01b0316906399fbab8890611def908990600401612bfd565b6101806040518083038186803b158015611e0857600080fd5b505afa158015611e1c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e409190612886565b5050505050965096509650965096505050611f11600760009054906101000a90046001600160a01b03166001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015611ea257600080fd5b505afa158015611eb6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611eda91906126cd565b6040518060600160405280886001600160a01b03168152602001876001600160a01b031681526020018662ffffff1681525061168e565b600680546001600160a01b0319166001600160a01b03928316179055600554601a5460405163095ea7b360e01b81528884169363095ea7b393611f59939116916004016129fc565b602060405180830381600087803b158015611f7357600080fd5b505af1158015611f87573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fab919061275e565b50600554601a5460405163095ea7b360e01b81526001600160a01b038781169363095ea7b393611fe29392909116916004016129fc565b602060405180830381600087803b158015611ffc57600080fd5b505af1158015612010573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612034919061275e565b50600854601a5460405163095ea7b360e01b81526001600160a01b038881169363095ea7b39361206b9392909116916004016129fc565b602060405180830381600087803b15801561208557600080fd5b505af1158015612099573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120bd919061275e565b50600854601a5460405163095ea7b360e01b81526001600160a01b038781169363095ea7b3936120f49392909116916004016129fc565b602060405180830381600087803b15801561210e57600080fd5b505af1158015612122573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612146919061275e565b5060048054600554601a5460405163095ea7b360e01b81526001600160a01b039384169463095ea7b39461217d94169291016129fc565b602060405180830381600087803b15801561219757600080fd5b505af11580156121ab573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906121cf919061275e565b50600354600554601a5460405163095ea7b360e01b81526001600160a01b039384169363095ea7b393612207939116916004016129fc565b602060405180830381600087803b15801561222157600080fd5b505af1158015612235573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612259919061275e565b506122638161173f565b6001600160a01b03166018556122788261173f565b6001600160a01b0316601955505050505050565b6000806000600660009054906101000a90046001600160a01b03166001600160a01b0316633850c7bd6040518163ffffffff1660e01b815260040160e06040518083038186803b1580156122df57600080fd5b505afa1580156122f3573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061231791906127ac565b50505050505090506000600261233f600160601b633b9aca00856001600160a01b0316612598565b0a9050600061234c6124b6565b9050600061235d8783848601612598565b97968890039695505050505050565b6040805160a08101909152600254600a54600454600093610bb84201938593919283926123b1926001600160a01b039081169262ffffff909216911660c08501612972565b60408051601f19818403018152918152908252306020830152818101859052606082018790526000608090920191909152600554905163c04b8d5960e01b81529192506001600160a01b03169063c04b8d59908690612414908590600401612b5e565b6020604051808303818588803b15801561242d57600080fd5b505af1158015612441573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190611b8f919061286e565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b600080600660009054906101000a90046001600160a01b03166001600160a01b0316633850c7bd6040518163ffffffff1660e01b815260040160e06040518083038186803b15801561250757600080fd5b505afa15801561251b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061253f91906127ac565b505050505050905061256a601854826001600160a01b0316836001600160a01b031660185403612598565b6019546001600160a01b03831603029150612592670de0b6b3a7640000600160c01b84612598565b91505090565b60008080600019858709868602925082811090839003039050806125ce57600084116125c357600080fd5b508290049050610ab1565b8084116125da57600080fd5b6000848688096000868103871696879004966002600389028118808a02820302808a02820302808a02820302808a02820302808a02820302808a02909103029181900381900460010186841190950394909402919094039290920491909117919091029150509392505050565b8051611b9481612c71565b80518015158114611b9457600080fd5b8051600281900b8114611b9457600080fd5b80516fffffffffffffffffffffffffffffffff81168114611b9457600080fd5b805161ffff81168114611b9457600080fd5b8051611b9481612c86565b6000602082840312156126c2578081fd5b8135610ab181612c71565b6000602082840312156126de578081fd5b8151610ab181612c71565b600080604083850312156126fb578081fd5b823561270681612c71565b946020939093013593505050565b600080600060608486031215612728578081fd5b833561273381612c71565b9250602084013561274381612c71565b9150604084013561275381612c86565b809150509250925092565b60006020828403121561276f578081fd5b610ab182612652565b60008060006060848603121561278c578283fd5b61279584612674565b925060208401519150604084015190509250925092565b600080600080600080600060e0888a0312156127c6578283fd5b87516127d181612c71565b96506127df60208901612662565b95506127ed60408901612694565b94506127fb60608901612694565b935061280960808901612694565b925060a088015160ff8116811461281e578283fd5b915061282c60c08901612652565b905092959891949750929550565b60006020828403121561284b578081fd5b8135610ab181612c86565b600060208284031215612867578081fd5b5035919050565b60006020828403121561287f578081fd5b5051919050565b6000806000806000806000806000806000806101808d8f0312156128a8578586fd5b8c516bffffffffffffffffffffffff811681146128c3578687fd5b9b506128d160208e01612647565b9a506128df60408e01612647565b99506128ed60608e01612647565b98506128fb60808e016126a6565b975061290960a08e01612662565b965061291760c08e01612662565b955061292560e08e01612674565b94506101008d015193506101208d015192506129446101408e01612674565b91506129536101608e01612674565b90509295989b509295989b509295989b565b6001600160a01b03169052565b606093841b6bffffffffffffffffffffffff19908116825260e89390931b6001600160e81b0319166014820152921b166017820152602b0190565b6001600160f81b0319815260609390931b6bffffffffffffffffffffffff191660018401526015830191909152603582015260550190565b90565b6001600160a01b0391909116815260200190565b6001600160a01b03929092168252602082015260400190565b6001600160a01b03938416815291909216602082015262ffffff909116604082015260600190565b60208082526026908201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160408201526564647265737360d01b606082015260800190565b6020808252601490820152734e6f2076616c756520746f20776974686472617760601b604082015260600190565b6020808252601590820152744e6f74206f776e6572206f72206c70656e67696e6560581b604082015260600190565b6020808252600190820152601560fa1b604082015260600190565b60208082526014908201527322aa24102a3930b739b332b9103330b4b632b21760611b604082015260600190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60006020808352835160a08285015280518060c0860152835b81811015612b935782810184015186820160e001528301612b77565b81811115612ba4578460e083880101525b509185015191612bb76040860184612965565b6040860151606086015260608601516080860152608086015160a086015260e0601f19601f830116860101935050505092915050565b62ffffff91909116815260200190565b90815260200190565b918252602082015260400190565b9485526020850193909352604084019190915260608301526001600160a01b0316608082015260a00190565b9485526020850193909352604084019190915262ffffff1660608301526001600160a01b0316608082015260a00190565b6001600160a01b038116811461118157600080fd5b62ffffff8116811461118157600080fdfea2646970667358221220c7e2eab19621a38819a4f0f20fb144bf1d787bfe4c7c638c363622835cc236d464736f6c63430007060033

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

0000000000000000000000000e16bd2cd962fadb4a23ec961bb170ffa25208a8000000000000000000000000c36442b4a4522e871399cd717abdd847ab11fe88000000000000000000000000a0f0f0b37f88fd5eebf70232f3517e7ce6ffb6b900000000000000000000000000000000000000000000000000000000000bb01a000000000000000000000000e592427a0aece92de3edee1f18e0157c05861564000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2000000000000000000000000514910771af9ca656af840dff83e8264ecf986ca000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48

-----Decoded View---------------
Arg [0] : honoAddress (address): 0x0e16BD2Cd962FaDb4A23eC961BB170FfA25208A8
Arg [1] : posMgr (address): 0xC36442b4a4522E871399CD717aBDD847Ab11FE88
Arg [2] : lpengine (address): 0xA0f0f0b37f88FD5eeBF70232f3517e7CE6FfB6b9
Arg [3] : tokenId (uint256): 765978
Arg [4] : routerAddress (address): 0xE592427A0AEce92De3Edee1F18E0157C05861564
Arg [5] : weth (address): 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2
Arg [6] : link (address): 0x514910771AF9Ca656af840dff83E8264EcF986CA
Arg [7] : usdc (uint256): 917551056842671309452305380979543736893630245704

-----Encoded View---------------
8 Constructor Arguments found :
Arg [0] : 0000000000000000000000000e16bd2cd962fadb4a23ec961bb170ffa25208a8
Arg [1] : 000000000000000000000000c36442b4a4522e871399cd717abdd847ab11fe88
Arg [2] : 000000000000000000000000a0f0f0b37f88fd5eebf70232f3517e7ce6ffb6b9
Arg [3] : 00000000000000000000000000000000000000000000000000000000000bb01a
Arg [4] : 000000000000000000000000e592427a0aece92de3edee1f18e0157c05861564
Arg [5] : 000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2
Arg [6] : 000000000000000000000000514910771af9ca656af840dff83e8264ecf986ca
Arg [7] : 000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48


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.