ETH Price: $3,480.51 (+0.29%)

Contract

0x9Bff9F810D19cDb4BF7701C9d5aD101E91CdA08d
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Token Holdings

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Buyn Burn214821512024-12-25 21:24:113 hrs ago1735161851IN
Helios : Buy And Burn
0 ETH0.000682563.80682264
Buyn Burn214814032024-12-25 18:53:476 hrs ago1735152827IN
Helios : Buy And Burn
0 ETH0.000682633.78650938
Buyn Burn214795092024-12-25 12:32:2312 hrs ago1735129943IN
Helios : Buy And Burn
0 ETH0.000678173.76167658
Buyn Burn214790592024-12-25 11:01:5914 hrs ago1735124519IN
Helios : Buy And Burn
0 ETH0.000730294.07369627
Buyn Burn214783522024-12-25 8:39:5916 hrs ago1735115999IN
Helios : Buy And Burn
0 ETH0.001106833.30503691
Buyn Burn214757142024-12-24 23:49:5925 hrs ago1735084199IN
Helios : Buy And Burn
0 ETH0.000751394.16826627
Buyn Burn214752682024-12-24 22:19:4726 hrs ago1735078787IN
Helios : Buy And Burn
0 ETH0.000756834.23348915
Buyn Burn214748192024-12-24 20:49:3528 hrs ago1735073375IN
Helios : Buy And Burn
0 ETH0.000743344.12395932
Buyn Burn214720032024-12-24 11:22:4737 hrs ago1735039367IN
Helios : Buy And Burn
0 ETH0.000735474.08037162
Buyn Burn214709892024-12-24 7:58:1141 hrs ago1735027091IN
Helios : Buy And Burn
0 ETH0.000755194.19044089
Buyn Burn214705392024-12-24 6:27:3542 hrs ago1735021655IN
Helios : Buy And Burn
0 ETH0.001347954.35492892
Buyn Burn214637642024-12-23 7:41:592 days ago1734939719IN
Helios : Buy And Burn
0 ETH0.000870414.21527276
Buyn Burn214632762024-12-23 6:03:352 days ago1734933815IN
Helios : Buy And Burn
0 ETH0.000740733.60468516
Buyn Burn214628212024-12-23 4:32:112 days ago1734928331IN
Helios : Buy And Burn
0 ETH0.000843214.70224308
Buyn Burn214623282024-12-23 2:52:352 days ago1734922355IN
Helios : Buy And Burn
0 ETH0.000761394.24632342
Buyn Burn214618572024-12-23 1:17:472 days ago1734916667IN
Helios : Buy And Burn
0 ETH0.001387524.54665191
Buyn Burn214565232024-12-22 7:23:593 days ago1734852239IN
Helios : Buy And Burn
0 ETH0.001048734.51395715
Buyn Burn214560232024-12-22 5:43:473 days ago1734846227IN
Helios : Buy And Burn
0 ETH0.000979585.43249252
Buyn Burn214555452024-12-22 4:07:233 days ago1734840443IN
Helios : Buy And Burn
0 ETH0.000859914.76885003
Buyn Burn214550772024-12-22 2:33:113 days ago1734834791IN
Helios : Buy And Burn
0 ETH0.001072965.19663127
Buyn Burn214550702024-12-22 2:31:473 days ago1734834707IN
Helios : Buy And Burn
0 ETH0.001205455.21006509
Buyn Burn214545592024-12-22 0:49:114 days ago1734828551IN
Helios : Buy And Burn
0 ETH0.001063965.17766539
Buyn Burn214540352024-12-21 23:03:474 days ago1734822227IN
Helios : Buy And Burn
0 ETH0.001986535.95430865
Buyn Burn213075852024-12-01 12:13:3524 days ago1733055215IN
Helios : Buy And Burn
0 ETH0.001525158.50670825
Buyn Burn213003182024-11-30 11:53:1125 days ago1732967591IN
Helios : Buy And Burn
0 ETH0.001147126.36247096
View all transactions

Latest 25 internal transactions (View All)

Advanced mode:
Parent Transaction Hash Block
From
To
212369362024-11-21 15:15:3534 days ago1732202135
Helios : Buy And Burn
0.00922997 ETH
212369362024-11-21 15:15:3534 days ago1732202135
Helios : Buy And Burn
0.00922997 ETH
210769102024-10-30 7:16:3556 days ago1730272595
Helios : Buy And Burn
63.2202613 ETH
210769102024-10-30 7:16:3556 days ago1730272595
Helios : Buy And Burn
63.2202613 ETH
209765092024-10-16 7:03:4770 days ago1729062227
Helios : Buy And Burn
0.01798582 ETH
209765092024-10-16 7:03:4770 days ago1729062227
Helios : Buy And Burn
0.01798582 ETH
209005342024-10-05 16:29:1181 days ago1728145751
Helios : Buy And Burn
0.00453548 ETH
209005342024-10-05 16:29:1181 days ago1728145751
Helios : Buy And Burn
0.00453548 ETH
208911242024-10-04 9:00:4782 days ago1728032447
Helios : Buy And Burn
0.03142779 ETH
208911242024-10-04 9:00:4782 days ago1728032447
Helios : Buy And Burn
0.03142779 ETH
207919602024-09-20 13:00:4796 days ago1726837247
Helios : Buy And Burn
0.01657777 ETH
207919602024-09-20 13:00:4796 days ago1726837247
Helios : Buy And Burn
0.01657777 ETH
207325252024-09-12 5:44:35104 days ago1726119875
Helios : Buy And Burn
0.00772956 ETH
207325252024-09-12 5:44:35104 days ago1726119875
Helios : Buy And Burn
0.00772956 ETH
206739092024-09-04 1:23:23112 days ago1725413003
Helios : Buy And Burn
0.00176664 ETH
206739092024-09-04 1:23:23112 days ago1725413003
Helios : Buy And Burn
0.00176664 ETH
206486312024-08-31 12:43:59116 days ago1725108239
Helios : Buy And Burn
0.00339014 ETH
206486312024-08-31 12:43:59116 days ago1725108239
Helios : Buy And Burn
0.00339014 ETH
206339172024-08-29 11:23:35118 days ago1724930615
Helios : Buy And Burn
0.00051734 ETH
206339172024-08-29 11:23:35118 days ago1724930615
Helios : Buy And Burn
0.00051734 ETH
205689752024-08-20 9:35:35127 days ago1724146535
Helios : Buy And Burn
0.00122691 ETH
205689752024-08-20 9:35:35127 days ago1724146535
Helios : Buy And Burn
0.00122691 ETH
205344112024-08-15 13:44:59132 days ago1723729499
Helios : Buy And Burn
0.00073373 ETH
205344112024-08-15 13:44:59132 days ago1723729499
Helios : Buy And Burn
0.00073373 ETH
204472362024-08-03 9:51:59144 days ago1722678719
Helios : Buy And Burn
0.00077276 ETH
View All Internal Transactions
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
BuyAndBurn

Compiler Version
v0.7.6+commit.7338295f

Optimization Enabled:
Yes with 0 runs

Other Settings:
default evmVersion
File 1 of 30 : BuyAndBurn.sol
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.7.6;
pragma abicoder v2;

import "./openzeppelin/security/ReentrancyGuard.sol";

import "./libs/Constant.sol";
import "./libs/PoolAddress.sol";
import "./libs/CallbackValidation.sol";
import "./libs/TransferHelper.sol";

import "./interfaces/IWETH9.sol";
import "./interfaces/IHELIOS.sol";
import "./interfaces/INonfungiblePositionManager.sol";
import "./interfaces/ITITANX.sol";
import "./interfaces/IHELIOS.sol";
import "hardhat/console.sol";

import "@uniswap/v3-core/contracts/libraries/TickMath.sol";
import "@uniswap/v3-periphery/contracts/libraries/OracleLibrary.sol";

contract BuyAndBurn is ReentrancyGuard {
    /** @dev Hlx Token Contract Address */
    address private s_hlxAddress;

    /** @dev Hlx/TitanX Pool Contract Address */
    address private s_poolAddress;

    /** @dev is initial LP created */
    InitialLPCreated private s_initialLiquidityCreated;

    /** @dev genesis timestamp */
    uint256 private immutable i_genesisTs;

    /** @dev owner address */
    address private s_ownerAddress;

    /** @dev Flag for lp and burn */
    bool private s_addLiquidity;

    /** @dev tracks total weth used for buyandburn */
    uint256 private s_totalWethBuyAndBurn;

    /** @dev tracks total titanX used for buyandburn */
    uint256 private s_totalTitanXBuyAndBurn;

    /** @dev tracks Helios burned through buyandburn */
    uint256 private s_totalHlxBuyAndBurn;

    /**
     * @dev Specifies the value in minutes for the timed-weighted average when calculating the price
     */
    uint32 private _minutesTwa;

    /** @dev tracks total hlx burned from fees */
    uint256 private s_totalHlxFeesBurn;

    /** @dev tracks collect fees (titanx) for buyandburn */
    uint256 private s_feesTitanXBuyAndBurn;

    /** @dev tracks current per swap cap */
    uint256 private s_capPerSwap;

    /** @dev tracks current minimum Cap ETH per swap cap */
    uint256 private s_capPerSwapETH;

    /** @dev tracks timestamp of the last buynburn was called */
    uint256 private s_lastCallTs;

    /** @dev tracks timestamp of the last ETH buynburn was called */
    uint256 private s_ethLastCallTs;

    /** @dev slippage amount between 1 - 15 */
    uint256 private s_slippage;

    /** @dev buynburn interval in seconds */
    uint256 private s_interval;

    /** @dev ETH swap interval in seconds */
    uint256 private s_ethInterval;

    /** @dev store position token info, only one full range position */
    TokenInfo private s_tokenInfo;

    //structs
    struct TokenInfo {
        uint80 tokenId;
        uint256 liquidity;
        int24 tickLower;
        int24 tickUpper;
    }

    event BoughtAndBurned(
        uint256 indexed titanx,
        uint256 indexed hlx,
        address indexed caller
    );
    event CollectedFees(
        uint256 indexed titanx,
        uint256 indexed hlx,
        address indexed caller
    );

    constructor() {
        i_genesisTs = block.timestamp;
        s_ownerAddress = msg.sender;
        s_capPerSwap = 50_000_000 ether;
        s_capPerSwapETH = 0.01 ether;
        s_slippage = 5;
        s_interval = 60 minutes;
        s_ethInterval = 60 minutes;
        s_addLiquidity = true;
        _minutesTwa = 15;
    }

    /** @notice receive eth and convert all eth into weth */
    receive() external payable {
        //prevent ETH withdrawal received from WETH contract into deposit function
        if (msg.sender != WETH9) IWETH9(WETH9).deposit{value: msg.value}();
    }

    /** @notice remove owner */
    function renounceOwnership() public {
        require(msg.sender == s_ownerAddress, "InvalidCaller");
        s_ownerAddress = address(0);
    }

    /** @notice change flag */
    function addLiquidity() public {
        require(msg.sender == s_ownerAddress, "InvalidCaller");
        s_addLiquidity = !s_addLiquidity;
    }

    /** @notice set new owner address. Only callable by owner address.
     * @param ownerAddress new owner address
     */
    function setOwnerAddress(address ownerAddress) external {
        require(msg.sender == s_ownerAddress, "InvalidCaller");
        require(ownerAddress != address(0), "InvalidAddress");
        s_ownerAddress = ownerAddress;
    }

    /** @notice set hlx token address. Only callable by owner address.
     * @param hlxAddress new owner address
     */
    function setHlxAddress(address hlxAddress) external {
        require(msg.sender == s_ownerAddress, "InvalidCaller");
        require(hlxAddress != address(0), "InvalidAddress");
        s_hlxAddress = hlxAddress;
    }

    /** @notice set Hlx/Titanx pool address. Only callable by owner address.
     * @param poolAddress new owner address
     */
    function setHlxTitanPoolAddress(address poolAddress) external {
        require(msg.sender == s_ownerAddress, "InvalidCaller");
        require(poolAddress != address(0), "InvalidAddress");
        s_poolAddress = poolAddress;
    }

    /**
     * @notice set TitanX cap amount per buynburn call. Only callable by owner address.
     * @param amount amount in 18 decimals
     */
    function setCapPerSwap(uint256 amount) external {
        require(msg.sender == s_ownerAddress, "InvalidCaller");
        s_capPerSwap = amount;
    }

    /**
     * @notice set ETH cap amount per buynburn call. Only callable by owner address.
     * @param amount amount in 18 decimals
     */
    function setETHCapPerSwap(uint256 amount) external {
        require(msg.sender == s_ownerAddress, "InvalidCaller");
        s_capPerSwapETH = amount;
    }

    /**
     * @notice set slippage % for buynburn minimum received amount. Only callable by owner address.
     * @param amount amount from 0 - 50
     */
    function setSlippage(uint256 amount) external {
        require(msg.sender == s_ownerAddress, "InvalidCaller");
        require(amount >= 1 && amount <= 15, "1-15_Only");
        s_slippage = amount;
    }

    /**
     * @notice set buynburn call interval in seconds. Only callable by owner address.
     * @param secs amount in seconds
     */
    function setBuynBurnInterval(uint256 secs) external {
        require(msg.sender == s_ownerAddress, "InvalidCaller");
        require(
            secs >= MIN_INTERVAL_SECONDS && secs <= MAX_INTERVAL_SECONDS,
            "1m-12h_Only"
        );
        s_interval = secs;
    }

    /**
     * @notice set the TWA value in Minutes. Only callable by owner address.
     * @param mins TWA in minutes
     */
    function setMinutesTwa(uint32 mins) external {
        require(msg.sender == s_ownerAddress, "InvalidCaller");
        require(mins >= 5 && mins <= 60, "5m-1h only");
        _minutesTwa = mins;
    }

    /**
     * @notice set ETHbuynburn call interval in seconds. Only callable by owner address.
     * @param secs amount in seconds
     */
    function setETHBuynBurnInterval(uint256 secs) external {
        require(msg.sender == s_ownerAddress, "InvalidCaller");
        require(
            secs >= MIN_INTERVAL_SECONDS && secs <= MAX_INTERVAL_SECONDS,
            "1m-12h_Only"
        );
        s_ethInterval = secs;
    }

    /** @notice burn all Helios in BuyAndBurn address */
    function burnLPHelios() public {
        IHELIOS(s_hlxAddress).burnLPTokens();
    }

    /** @notice One-time function to create initial pool to initialize with the desired price ratio.
     * To avoid being front run, must call this function right after contract is deployed and HLX address is set.
     */
    function createInitialPool() public {
        require(s_poolAddress == address(0), "PoolHasCreated");
        require(s_hlxAddress != address(0), "InvalidHlxAddress");
        _createPool();
    }

    /** @notice One-time function to create initial liquidity pool. Require TitanX to execute. */
    function createInitialLiquidity() public {
        require(s_poolAddress != address(0), "NoPoolExists");
        if (s_initialLiquidityCreated == InitialLPCreated.YES) return;
        require(
            ITITANX(TITANX).balanceOf(address(this)) >= INITIAL_LP_TITAN,
            "Need More TitanX"
        );

        s_initialLiquidityCreated = InitialLPCreated.YES;

        // Approve the position manager
        TransferHelper.safeApprove(
            s_hlxAddress,
            NONFUNGIBLEPOSITIONMANAGER,
            type(uint256).max
        );
        TransferHelper.safeApprove(
            TITANX,
            NONFUNGIBLEPOSITIONMANAGER,
            type(uint256).max
        );

        IHELIOS(s_hlxAddress).mintLPTokens();

        _mintPosition();
    }

    /** @notice buy and burn Helios from uniswap pool */
    function buynBurn() public nonReentrant {
        //prevent contract accounts (bots) from calling this function
        require(msg.sender == tx.origin, "InvalidCaller");

        require(
            s_initialLiquidityCreated == InitialLPCreated.YES,
            "NeedInitialLP"
        );
        //a minium gap of 1 min between each call
        require(block.timestamp - s_lastCallTs > s_interval, "IntervalWait");
        s_lastCallTs = block.timestamp;
        uint256 titanAmount = getTitanXBalance(address(this));

        uint256 titanCap = s_capPerSwap;
        uint256 wethBalance = getWethBalance();
        if (
            titanAmount < titanCap &&
            wethBalance > 0 &&
            (block.timestamp - s_ethLastCallTs) > s_ethInterval
        ) {
            s_ethLastCallTs = block.timestamp;
            if (wethBalance > s_capPerSwapETH) wethBalance = s_capPerSwapETH;
            // Swap ETH to TitanX to reach the cap
            _swapTokens(WETH9, TITANX, wethBalance);

            // Update the titanAmount to the current balance
            titanAmount = getTitanXBalance(address(this));
        }

        require(titanAmount != 0, "NoAvailableFunds");

        if (titanAmount > titanCap) titanAmount = titanCap;

        uint256 incentiveFee = (titanAmount * INCENTIVE_FEE) /
            INCENTIVE_FEE_PERCENT_BASE;

        titanAmount -= incentiveFee;
        _swapTokens(TITANX, s_hlxAddress, titanAmount);
        TransferHelper.safeTransfer(TITANX, msg.sender, incentiveFee);
    }

    /** @notice Used by uniswapV3. Modified from uniswapV3 swap callback function to complete the swap */
    function uniswapV3SwapCallback(
        int256 amount0Delta,
        int256 amount1Delta,
        bytes calldata
    ) external {
        require(amount0Delta > 0 || amount1Delta > 0, "Invalid Swap"); // swaps entirely within 0-liquidity regions are not supported

        if (msg.sender == TITANX_WETH_POOL) {
            IUniswapV3Pool pool = CallbackValidation.verifyCallback(
                UNISWAPV3FACTORY,
                WETH9,
                TITANX,
                POOLFEE1PERCENT
            );
            require(address(pool) == TITANX_WETH_POOL, "WrongPool");

            TransferHelper.safeTransfer(
                WETH9,
                msg.sender,
                amount0Delta > 0 ? uint256(amount0Delta) : uint256(amount1Delta)
            );
            s_totalWethBuyAndBurn += amount0Delta > 0
                ? uint256(amount0Delta)
                : uint256(amount1Delta);
        } else if (msg.sender == s_poolAddress) {
            IUniswapV3Pool pool = CallbackValidation.verifyCallback(
                UNISWAPV3FACTORY,
                TITANX,
                s_hlxAddress,
                POOLFEE1PERCENT
            );

            require(address(pool) == s_poolAddress, "WrongPool");

            TransferHelper.safeTransfer(
                TITANX,
                msg.sender,
                amount0Delta > 0 ? uint256(amount0Delta) : uint256(amount1Delta)
            );

            s_totalTitanXBuyAndBurn += amount0Delta > 0
                ? uint256(amount0Delta)
                : uint256(amount1Delta);
        } else {
            // Unknown pool, revert the transasction
            revert("UnknownPool");
        }
    }

    /** @notice collect fees from LP */
    function collectFees() public nonReentrant {
        (uint256 amount0, uint256 amount1) = _collectFees();
        uint256 helios;
        uint256 titan;
        if (TITANX < s_hlxAddress) {
            titan = uint256(amount0 >= 0 ? amount0 : -amount0);
            helios = uint256(amount1 >= 0 ? amount1 : -amount1);
        } else {
            helios = uint256(amount0 >= 0 ? amount0 : -amount0);
            titan = uint256(amount1 >= 0 ? amount1 : -amount1);
        }

        if (s_addLiquidity) {
            uint256 price = getCurrentTitanPrice();
            if (helios != 0 && titan != 0) {
                if (TITANX < s_hlxAddress) {
                    _increaseLiquidityCurrentRange(titan, helios, price);
                } else {
                    _increaseLiquidityCurrentRange(
                        helios,
                        titan,
                        ((1 ether * 1 ether) / price)
                    );
                }
            }
        } else {
            burnLPHelios();
            s_totalHlxFeesBurn += helios;
            s_feesTitanXBuyAndBurn += titan;
        }

        emit CollectedFees(titan, helios, msg.sender);
    }

    // ==================== Private Functions =======================================

    /** @dev sort tokens in ascending order, that's how uniswap identify the pair
     * @return token0 token address that is digitally smaller than token1
     * @return token1 token address that is digitally larger than token0
     * @return amount0 LP amount for token0
     * @return amount1 LP amount for token1
     */
    function _getTokensConfig()
        private
        view
        returns (
            address token0,
            address token1,
            uint256 amount0,
            uint256 amount1
        )
    {
        token0 = TITANX;
        token1 = s_hlxAddress;
        amount0 = INITIAL_LP_TITAN;
        amount1 = INITIAL_LP_HLX;
        if (s_hlxAddress < TITANX) {
            token0 = s_hlxAddress;
            token1 = TITANX;
            amount0 = INITIAL_LP_HLX;
            amount1 = INITIAL_LP_TITAN;
        }
    }

    /** @dev create pool with the preset sqrt price ratio */
    function _createPool() private {
        (address token0, address token1, , ) = _getTokensConfig();
        s_poolAddress = INonfungiblePositionManager(NONFUNGIBLEPOSITIONMANAGER)
            .createAndInitializePoolIfNecessary(
                token0,
                token1,
                POOLFEE1PERCENT,
                TITANX < s_hlxAddress
                    ? INITIAL_SQRTPRICE_TITANX_HLX
                    : INITIAL_SQRTPRICE_HLX_TITANX
            );
    }

    /** @dev mint full range LP token */
    function _mintPosition() private {
        (
            address token0,
            address token1,
            uint256 amount0Desired,
            uint256 amount1Desired
        ) = _getTokensConfig();

        INonfungiblePositionManager.MintParams
            memory params = INonfungiblePositionManager.MintParams({
                token0: token0,
                token1: token1,
                fee: POOLFEE1PERCENT,
                tickLower: MIN_TICK,
                tickUpper: MAX_TICK,
                amount0Desired: amount0Desired,
                amount1Desired: amount1Desired,
                amount0Min: (amount0Desired * 90) / 100,
                amount1Min: (amount1Desired * 90) / 100,
                recipient: address(this),
                deadline: block.timestamp + 600
            });

        (uint256 tokenId, uint256 liquidity, , ) = INonfungiblePositionManager(
            NONFUNGIBLEPOSITIONMANAGER
        ).mint(params);

        s_tokenInfo.tokenId = uint80(tokenId);
        s_tokenInfo.liquidity = liquidity;
        s_tokenInfo.tickLower = MIN_TICK;
        s_tokenInfo.tickUpper = MAX_TICK;
    }

    /**
     * @dev Increases liquidity in the current price range of the Uniswap V3 pool.
     * This function calculates the amounts of each token to add to the pool,
     * keeping the ratio consistent with the current pool price.
     *
     * @param amount0Collected The amount of token0 collected as fees.
     * @param amount1Collected The amount of token1 collected as fees.
     * @param price The current price of token1 in terms of token0.
     */
    function _increaseLiquidityCurrentRange(
        uint256 amount0Collected,
        uint256 amount1Collected,
        uint256 price
    ) private {
        // Calculate desired amounts of each token to maintain the price ratio
        uint256 desiredAmount0 = FullMath.mulDiv(amount1Collected, price, 1e18);
        uint256 desiredAmount1 = FullMath.mulDiv(amount0Collected, 1e18, price);

        // Determine the actual amounts to add, which are the lesser of the
        // collected amounts and the desired amounts
        uint256 amount0ToAdd = amount0Collected < desiredAmount0
            ? amount0Collected
            : desiredAmount0;
        uint256 amount1ToAdd = amount1Collected < desiredAmount1
            ? amount1Collected
            : desiredAmount1;

        // Create parameters for increasing liquidity
        INonfungiblePositionManager.IncreaseLiquidityParams
            memory params = INonfungiblePositionManager
                .IncreaseLiquidityParams({
                    tokenId: s_tokenInfo.tokenId,
                    amount0Desired: amount0ToAdd,
                    amount1Desired: amount1ToAdd,
                    amount0Min: (amount0ToAdd * 90) / 100,
                    amount1Min: (amount1ToAdd * 90) / 100,
                    deadline: block.timestamp + 600
                });

        // Call Uniswap V3's increaseLiquidity function to add liquidity
        (uint256 liquidity, , ) = INonfungiblePositionManager(
            NONFUNGIBLEPOSITIONMANAGER
        ).increaseLiquidity(params);

        // update the stored liquidity amount
        s_tokenInfo.liquidity += liquidity;
    }

    /**
     * @dev Generic function to swap tokens on Uniswap and perform additional actions
     * @param fromToken Address of the source token
     * @param toToken Address of the destination token
     * @param amount Amount of tokens to swap
     */
    function _swapTokens(
        address fromToken,
        address toToken,
        uint256 amount
    ) private {
        // Calculate minimum amount for slippage protection
        uint256 minTokenAmount = ((amount * 1 ether * (100 - s_slippage)) /
            (
                fromToken == WETH9
                    ? getCurrentEthPrice()
                    : getCurrentTitanPrice()
            )) / 100;

        // Get the corresponding Uniswap pool address
        address pool = fromToken == WETH9 ? TITANX_WETH_POOL : s_poolAddress;

        // Swap tokens on Uniswap
        (int256 amount0, int256 amount1) = IUniswapV3Pool(pool).swap(
            address(this),
            fromToken < toToken,
            int256(amount),
            fromToken < toToken ? MIN_SQRT_RATIO + 1 : MAX_SQRT_RATIO - 1,
            ""
        );

        // Get the actual swapped amount
        uint256 swappedAmount = fromToken < toToken
            ? uint256(amount1 >= 0 ? amount1 : -amount1)
            : uint256(amount0 >= 0 ? amount0 : -amount0);

        // Slippage protection check
        require(swappedAmount >= minTokenAmount, "TooLittleReceived");

        // If destination token is HLX, burn the LP tokens
        if (toToken == s_hlxAddress) {
            uint256 hlxBalance = getHlxBalance();
            uint256 hlxBurnAmount = hlxBalance > swappedAmount
                ? swappedAmount
                : hlxBalance;
            s_totalHlxBuyAndBurn += hlxBurnAmount;
            burnLPHelios();
            emit BoughtAndBurned(amount, hlxBurnAmount, msg.sender);
        }
    }

    /** @dev call uniswapv3 collect funtion to collect LP fees
     * @return amount0 token0 amount
     * @return amount1 token1 amount
     */
    function _collectFees() private returns (uint256 amount0, uint256 amount1) {
        INonfungiblePositionManager.CollectParams
            memory params = INonfungiblePositionManager.CollectParams(
                s_tokenInfo.tokenId,
                address(this),
                type(uint128).max,
                type(uint128).max
            );
        (amount0, amount1) = INonfungiblePositionManager(
            NONFUNGIBLEPOSITIONMANAGER
        ).collect(params);
    }

    //views
    /** @notice get Helios TitanX pool address
     * @return address Helios TitanX pool address
     */
    function getPoolAddress() public view returns (address) {
        return s_poolAddress;
    }

    /** @notice flag that if true add liqudity from fees if false
     * @return bool
     */
    function getAddLiquidity() public view returns (bool) {
        return s_addLiquidity;
    }

    /** @notice getlast timestamp when BuynBurn is called
     * @return uint256 timestamp
     */
    function getlastBuynBurnCall() public view returns (uint256) {
        return s_lastCallTs;
    }

    //views
    /** @notice get TitanX weth pool address
     * @return address TitanX weth pool address
     */
    function getTitanXPoolAddress() public pure returns (address) {
        return TITANX_WETH_POOL;
    }

    /** @notice get contract ETH balance
     * @return balance contract ETH balance
     */
    function getWethBalance() public view returns (uint256) {
        return IWETH9(WETH9).balanceOf(address(this));
    }

    /** @notice get WETH balance for speciifed address
     * @param account address
     * @return balance WETH balance
     */
    function getWethBalance(address account) public view returns (uint256) {
        return IWETH9(WETH9).balanceOf(account);
    }

    /** @notice get Helios Balance for BuyAndBurn Contract
     */
    function getHlxBalance() public view returns (uint256) {
        return IHELIOS(s_hlxAddress).balanceOf(address(this));
    }

    /** @notice get Helios balance for speicifed address
     * @param account address
     */
    function getHlxBalance(address account) public view returns (uint256) {
        return IHELIOS(s_hlxAddress).balanceOf(account);
    }

    /** @notice get TitanX balance for speicifed address
     * @param account address
     */
    function getTitanXBalance(address account) public view returns (uint256) {
        return ITITANX(TITANX).balanceOf(account);
    }

    /** @notice get TitanX balance for BuyAndBurn Contract
     */
    function getTitanXBalance() public view returns (uint256) {
        return ITITANX(TITANX).balanceOf(address(this));
    }

    /** @notice get current sqrt price
     * @return sqrtPrice sqrt Price X96
     */
    function getCurrentSqrtPriceX96() public view returns (uint160) {
        IUniswapV3Pool pool = IUniswapV3Pool(s_poolAddress);
        (uint160 sqrtPriceX96, , , , , , ) = pool.slot0();
        return sqrtPriceX96;
    }

    /** @notice get current Titan price TitanX/HLX
     * @return TitanX price
     */
    function getCurrentTitanPrice() public view returns (uint256) {
        uint256 sqrtPriceX96 = getSqrtPriceX96(s_poolAddress);
        uint256 numerator1 = sqrtPriceX96 * sqrtPriceX96;
        uint256 numerator2 = 10 ** 18;
        uint256 price = FullMath.mulDiv(numerator1, numerator2, 1 << 192);
        price = TITANX < s_hlxAddress ? (1 ether * 1 ether) / price : price;

        return price;
    }

    /** @notice get current eth price
     * @return ethPrice eth price
     */
    function getCurrentEthPrice() public view returns (uint256) {
        uint256 sqrtPriceX96 = getSqrtPriceX96(TITANX_WETH_POOL);
        uint256 numerator1 = sqrtPriceX96 * sqrtPriceX96;
        uint256 numerator2 = 10 ** 18;
        uint256 price = FullMath.mulDiv(numerator1, numerator2, 1 << 192);
        price = WETH9 < TITANX ? (1 ether * 1 ether) / price : price;
        return price;
    }

    function getSqrtPriceX96(
        address poolAddress
    ) public view returns (uint160 sqrtPriceX96) {
        uint32 secondsAgo = _minutesTwa * 60;
        uint32 oldestObservation = OracleLibrary.getOldestObservationSecondsAgo(
            poolAddress
        );

        if (oldestObservation < secondsAgo) {
            secondsAgo = oldestObservation;
        }

        if (secondsAgo == 0) {
            IUniswapV3Pool pool = IUniswapV3Pool(poolAddress);
            (sqrtPriceX96, , , , , , ) = pool.slot0();
        } else {
            (int24 arithmeticMeanTick, ) = OracleLibrary.consult(
                poolAddress,
                secondsAgo
            );
            sqrtPriceX96 = TickMath.getSqrtRatioAtTick(arithmeticMeanTick);
        }

        return sqrtPriceX96;
    }

    /** @notice get Titanx cap amount per buy and burn
     * @return cap amount
     */
    function getBuyAndBurnCap() public view returns (uint256) {
        return s_capPerSwap;
    }

    /** @notice get  ETH cap amount per buy and burn
     * @return cap amount
     */
    function getWethBuyAndBurnCap() public view returns (uint256) {
        return s_capPerSwapETH;
    }

    /** @notice get buynburn slippage
     * @return slippage
     */
    function getSlippage() public view returns (uint256) {
        return s_slippage;
    }

    /** @notice get the buynburn interval between each call in seconds
     * @return seconds
     */
    function getBuynBurnInterval() public view returns (uint256) {
        return s_interval;
    }

    /** @notice get the buynburn ETH interval between each call in seconds
     * @return seconds
     */
    function getBuynBurnEthInterval() public view returns (uint256) {
        return s_ethInterval;
    }

    /**
     * @return return the total supply
     */
    function totalHeliosLiquidSupply() public view returns (uint256) {
        return IHELIOS(s_hlxAddress).totalSupply();
    }

    // ==================== BuyAndBurn Getters =======================================
    /** @notice get buy and burn funds
     * @return amount TitanX amount
     */
    function getBuyAndBurnFunds() public view returns (uint256) {
        return getTitanXBalance(address(this));
    }

    /** @notice get total TitanX amount used to buy and burn
     * @return amount total TitanX amount
     */
    function getTotalTitanXBuyAndBurn() public view returns (uint256) {
        return s_totalTitanXBuyAndBurn;
    }

    /** @notice get total Helios amount burned from all buy and burn
     * @return amount total Helios amount
     */
    function getTotalHelioBuyAndBurn() public view returns (uint256) {
        return s_totalHlxBuyAndBurn;
    }

    /** @notice get buy and burn funds from TitanX fees only
     * @return amount TitanX amount
     */
    function getTitanXFeesBuyAndBurnFunds() public view returns (uint256) {
        return s_feesTitanXBuyAndBurn;
    }

    /** @notice get burned HLX from fees
     * @return amount HLX amount
     */
    function getHlxFeesBuyAndBurnFunds() public view returns (uint256) {
        return s_totalHlxFeesBurn;
    }

    /** @notice get LP token info
     * @return tokenId tokenId
     * @return liquidity liquidity
     * @return tickLower tickLower
     * @return tickUpper tickUpper
     */
    function getTokenInfo()
        public
        view
        returns (
            uint256 tokenId,
            uint256 liquidity,
            int24 tickLower,
            int24 tickUpper
        )
    {
        return (
            s_tokenInfo.tokenId,
            s_tokenInfo.liquidity,
            s_tokenInfo.tickLower,
            s_tokenInfo.tickUpper
        );
    }

    /** @notice get LP token URI
     * @return uri URI
     */
    function getTokenURI() public view returns (string memory) {
        return
            INonfungiblePositionManager(NONFUNGIBLEPOSITIONMANAGER).tokenURI(1);
    }
}

File 2 of 30 : IUniswapV3Pool.sol
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.5.0;

import './pool/IUniswapV3PoolImmutables.sol';
import './pool/IUniswapV3PoolState.sol';
import './pool/IUniswapV3PoolDerivedState.sol';
import './pool/IUniswapV3PoolActions.sol';
import './pool/IUniswapV3PoolOwnerActions.sol';
import './pool/IUniswapV3PoolEvents.sol';

/// @title The interface for a Uniswap V3 Pool
/// @notice A Uniswap pool facilitates swapping and automated market making between any two assets that strictly conform
/// to the ERC20 specification
/// @dev The pool interface is broken up into many smaller pieces
interface IUniswapV3Pool is
    IUniswapV3PoolImmutables,
    IUniswapV3PoolState,
    IUniswapV3PoolDerivedState,
    IUniswapV3PoolActions,
    IUniswapV3PoolOwnerActions,
    IUniswapV3PoolEvents
{

}

File 3 of 30 : IUniswapV3PoolActions.sol
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.5.0;

/// @title Permissionless pool actions
/// @notice Contains pool methods that can be called by anyone
interface IUniswapV3PoolActions {
    /// @notice Sets the initial price for the pool
    /// @dev Price is represented as a sqrt(amountToken1/amountToken0) Q64.96 value
    /// @param sqrtPriceX96 the initial sqrt price of the pool as a Q64.96
    function initialize(uint160 sqrtPriceX96) external;

    /// @notice Adds liquidity for the given recipient/tickLower/tickUpper position
    /// @dev The caller of this method receives a callback in the form of IUniswapV3MintCallback#uniswapV3MintCallback
    /// in which they must pay any token0 or token1 owed for the liquidity. The amount of token0/token1 due depends
    /// on tickLower, tickUpper, the amount of liquidity, and the current price.
    /// @param recipient The address for which the liquidity will be created
    /// @param tickLower The lower tick of the position in which to add liquidity
    /// @param tickUpper The upper tick of the position in which to add liquidity
    /// @param amount The amount of liquidity to mint
    /// @param data Any data that should be passed through to the callback
    /// @return amount0 The amount of token0 that was paid to mint the given amount of liquidity. Matches the value in the callback
    /// @return amount1 The amount of token1 that was paid to mint the given amount of liquidity. Matches the value in the callback
    function mint(
        address recipient,
        int24 tickLower,
        int24 tickUpper,
        uint128 amount,
        bytes calldata data
    ) external returns (uint256 amount0, uint256 amount1);

    /// @notice Collects tokens owed to a position
    /// @dev Does not recompute fees earned, which must be done either via mint or burn of any amount of liquidity.
    /// Collect must be called by the position owner. To withdraw only token0 or only token1, amount0Requested or
    /// amount1Requested may be set to zero. To withdraw all tokens owed, caller may pass any value greater than the
    /// actual tokens owed, e.g. type(uint128).max. Tokens owed may be from accumulated swap fees or burned liquidity.
    /// @param recipient The address which should receive the fees collected
    /// @param tickLower The lower tick of the position for which to collect fees
    /// @param tickUpper The upper tick of the position for which to collect fees
    /// @param amount0Requested How much token0 should be withdrawn from the fees owed
    /// @param amount1Requested How much token1 should be withdrawn from the fees owed
    /// @return amount0 The amount of fees collected in token0
    /// @return amount1 The amount of fees collected in token1
    function collect(
        address recipient,
        int24 tickLower,
        int24 tickUpper,
        uint128 amount0Requested,
        uint128 amount1Requested
    ) external returns (uint128 amount0, uint128 amount1);

    /// @notice Burn liquidity from the sender and account tokens owed for the liquidity to the position
    /// @dev Can be used to trigger a recalculation of fees owed to a position by calling with an amount of 0
    /// @dev Fees must be collected separately via a call to #collect
    /// @param tickLower The lower tick of the position for which to burn liquidity
    /// @param tickUpper The upper tick of the position for which to burn liquidity
    /// @param amount How much liquidity to burn
    /// @return amount0 The amount of token0 sent to the recipient
    /// @return amount1 The amount of token1 sent to the recipient
    function burn(
        int24 tickLower,
        int24 tickUpper,
        uint128 amount
    ) external returns (uint256 amount0, uint256 amount1);

    /// @notice Swap token0 for token1, or token1 for token0
    /// @dev The caller of this method receives a callback in the form of IUniswapV3SwapCallback#uniswapV3SwapCallback
    /// @param recipient The address to receive the output of the swap
    /// @param zeroForOne The direction of the swap, true for token0 to token1, false for token1 to token0
    /// @param amountSpecified The amount of the swap, which implicitly configures the swap as exact input (positive), or exact output (negative)
    /// @param sqrtPriceLimitX96 The Q64.96 sqrt price limit. If zero for one, the price cannot be less than this
    /// value after the swap. If one for zero, the price cannot be greater than this value after the swap
    /// @param data Any data to be passed through to the callback
    /// @return amount0 The delta of the balance of token0 of the pool, exact when negative, minimum when positive
    /// @return amount1 The delta of the balance of token1 of the pool, exact when negative, minimum when positive
    function swap(
        address recipient,
        bool zeroForOne,
        int256 amountSpecified,
        uint160 sqrtPriceLimitX96,
        bytes calldata data
    ) external returns (int256 amount0, int256 amount1);

    /// @notice Receive token0 and/or token1 and pay it back, plus a fee, in the callback
    /// @dev The caller of this method receives a callback in the form of IUniswapV3FlashCallback#uniswapV3FlashCallback
    /// @dev Can be used to donate underlying tokens pro-rata to currently in-range liquidity providers by calling
    /// with 0 amount{0,1} and sending the donation amount(s) from the callback
    /// @param recipient The address which will receive the token0 and token1 amounts
    /// @param amount0 The amount of token0 to send
    /// @param amount1 The amount of token1 to send
    /// @param data Any data to be passed through to the callback
    function flash(
        address recipient,
        uint256 amount0,
        uint256 amount1,
        bytes calldata data
    ) external;

    /// @notice Increase the maximum number of price and liquidity observations that this pool will store
    /// @dev This method is no-op if the pool already has an observationCardinalityNext greater than or equal to
    /// the input observationCardinalityNext.
    /// @param observationCardinalityNext The desired minimum number of observations for the pool to store
    function increaseObservationCardinalityNext(uint16 observationCardinalityNext) external;
}

File 4 of 30 : IUniswapV3PoolDerivedState.sol
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.5.0;

/// @title Pool state that is not stored
/// @notice Contains view functions to provide information about the pool that is computed rather than stored on the
/// blockchain. The functions here may have variable gas costs.
interface IUniswapV3PoolDerivedState {
    /// @notice Returns the cumulative tick and liquidity as of each timestamp `secondsAgo` from the current block timestamp
    /// @dev To get a time weighted average tick or liquidity-in-range, you must call this with two values, one representing
    /// the beginning of the period and another for the end of the period. E.g., to get the last hour time-weighted average tick,
    /// you must call it with secondsAgos = [3600, 0].
    /// @dev The time weighted average tick represents the geometric time weighted average price of the pool, in
    /// log base sqrt(1.0001) of token1 / token0. The TickMath library can be used to go from a tick value to a ratio.
    /// @param secondsAgos From how long ago each cumulative tick and liquidity value should be returned
    /// @return tickCumulatives Cumulative tick values as of each `secondsAgos` from the current block timestamp
    /// @return secondsPerLiquidityCumulativeX128s Cumulative seconds per liquidity-in-range value as of each `secondsAgos` from the current block
    /// timestamp
    function observe(uint32[] calldata secondsAgos)
        external
        view
        returns (int56[] memory tickCumulatives, uint160[] memory secondsPerLiquidityCumulativeX128s);

    /// @notice Returns a snapshot of the tick cumulative, seconds per liquidity and seconds inside a tick range
    /// @dev Snapshots must only be compared to other snapshots, taken over a period for which a position existed.
    /// I.e., snapshots cannot be compared if a position is not held for the entire period between when the first
    /// snapshot is taken and the second snapshot is taken.
    /// @param tickLower The lower tick of the range
    /// @param tickUpper The upper tick of the range
    /// @return tickCumulativeInside The snapshot of the tick accumulator for the range
    /// @return secondsPerLiquidityInsideX128 The snapshot of seconds per liquidity for the range
    /// @return secondsInside The snapshot of seconds per liquidity for the range
    function snapshotCumulativesInside(int24 tickLower, int24 tickUpper)
        external
        view
        returns (
            int56 tickCumulativeInside,
            uint160 secondsPerLiquidityInsideX128,
            uint32 secondsInside
        );
}

File 5 of 30 : IUniswapV3PoolEvents.sol
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.5.0;

/// @title Events emitted by a pool
/// @notice Contains all events emitted by the pool
interface IUniswapV3PoolEvents {
    /// @notice Emitted exactly once by a pool when #initialize is first called on the pool
    /// @dev Mint/Burn/Swap cannot be emitted by the pool before Initialize
    /// @param sqrtPriceX96 The initial sqrt price of the pool, as a Q64.96
    /// @param tick The initial tick of the pool, i.e. log base 1.0001 of the starting price of the pool
    event Initialize(uint160 sqrtPriceX96, int24 tick);

    /// @notice Emitted when liquidity is minted for a given position
    /// @param sender The address that minted the liquidity
    /// @param owner The owner of the position and recipient of any minted liquidity
    /// @param tickLower The lower tick of the position
    /// @param tickUpper The upper tick of the position
    /// @param amount The amount of liquidity minted to the position range
    /// @param amount0 How much token0 was required for the minted liquidity
    /// @param amount1 How much token1 was required for the minted liquidity
    event Mint(
        address sender,
        address indexed owner,
        int24 indexed tickLower,
        int24 indexed tickUpper,
        uint128 amount,
        uint256 amount0,
        uint256 amount1
    );

    /// @notice Emitted when fees are collected by the owner of a position
    /// @dev Collect events may be emitted with zero amount0 and amount1 when the caller chooses not to collect fees
    /// @param owner The owner of the position for which fees are collected
    /// @param tickLower The lower tick of the position
    /// @param tickUpper The upper tick of the position
    /// @param amount0 The amount of token0 fees collected
    /// @param amount1 The amount of token1 fees collected
    event Collect(
        address indexed owner,
        address recipient,
        int24 indexed tickLower,
        int24 indexed tickUpper,
        uint128 amount0,
        uint128 amount1
    );

    /// @notice Emitted when a position's liquidity is removed
    /// @dev Does not withdraw any fees earned by the liquidity position, which must be withdrawn via #collect
    /// @param owner The owner of the position for which liquidity is removed
    /// @param tickLower The lower tick of the position
    /// @param tickUpper The upper tick of the position
    /// @param amount The amount of liquidity to remove
    /// @param amount0 The amount of token0 withdrawn
    /// @param amount1 The amount of token1 withdrawn
    event Burn(
        address indexed owner,
        int24 indexed tickLower,
        int24 indexed tickUpper,
        uint128 amount,
        uint256 amount0,
        uint256 amount1
    );

    /// @notice Emitted by the pool for any swaps between token0 and token1
    /// @param sender The address that initiated the swap call, and that received the callback
    /// @param recipient The address that received the output of the swap
    /// @param amount0 The delta of the token0 balance of the pool
    /// @param amount1 The delta of the token1 balance of the pool
    /// @param sqrtPriceX96 The sqrt(price) of the pool after the swap, as a Q64.96
    /// @param liquidity The liquidity of the pool after the swap
    /// @param tick The log base 1.0001 of price of the pool after the swap
    event Swap(
        address indexed sender,
        address indexed recipient,
        int256 amount0,
        int256 amount1,
        uint160 sqrtPriceX96,
        uint128 liquidity,
        int24 tick
    );

    /// @notice Emitted by the pool for any flashes of token0/token1
    /// @param sender The address that initiated the swap call, and that received the callback
    /// @param recipient The address that received the tokens from flash
    /// @param amount0 The amount of token0 that was flashed
    /// @param amount1 The amount of token1 that was flashed
    /// @param paid0 The amount of token0 paid for the flash, which can exceed the amount0 plus the fee
    /// @param paid1 The amount of token1 paid for the flash, which can exceed the amount1 plus the fee
    event Flash(
        address indexed sender,
        address indexed recipient,
        uint256 amount0,
        uint256 amount1,
        uint256 paid0,
        uint256 paid1
    );

    /// @notice Emitted by the pool for increases to the number of observations that can be stored
    /// @dev observationCardinalityNext is not the observation cardinality until an observation is written at the index
    /// just before a mint/swap/burn.
    /// @param observationCardinalityNextOld The previous value of the next observation cardinality
    /// @param observationCardinalityNextNew The updated value of the next observation cardinality
    event IncreaseObservationCardinalityNext(
        uint16 observationCardinalityNextOld,
        uint16 observationCardinalityNextNew
    );

    /// @notice Emitted when the protocol fee is changed by the pool
    /// @param feeProtocol0Old The previous value of the token0 protocol fee
    /// @param feeProtocol1Old The previous value of the token1 protocol fee
    /// @param feeProtocol0New The updated value of the token0 protocol fee
    /// @param feeProtocol1New The updated value of the token1 protocol fee
    event SetFeeProtocol(uint8 feeProtocol0Old, uint8 feeProtocol1Old, uint8 feeProtocol0New, uint8 feeProtocol1New);

    /// @notice Emitted when the collected protocol fees are withdrawn by the factory owner
    /// @param sender The address that collects the protocol fees
    /// @param recipient The address that receives the collected protocol fees
    /// @param amount0 The amount of token0 protocol fees that is withdrawn
    /// @param amount0 The amount of token1 protocol fees that is withdrawn
    event CollectProtocol(address indexed sender, address indexed recipient, uint128 amount0, uint128 amount1);
}

File 6 of 30 : IUniswapV3PoolImmutables.sol
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.5.0;

/// @title Pool state that never changes
/// @notice These parameters are fixed for a pool forever, i.e., the methods will always return the same values
interface IUniswapV3PoolImmutables {
    /// @notice The contract that deployed the pool, which must adhere to the IUniswapV3Factory interface
    /// @return The contract address
    function factory() external view returns (address);

    /// @notice The first of the two tokens of the pool, sorted by address
    /// @return The token contract address
    function token0() external view returns (address);

    /// @notice The second of the two tokens of the pool, sorted by address
    /// @return The token contract address
    function token1() external view returns (address);

    /// @notice The pool's fee in hundredths of a bip, i.e. 1e-6
    /// @return The fee
    function fee() external view returns (uint24);

    /// @notice The pool tick spacing
    /// @dev Ticks can only be used at multiples of this value, minimum of 1 and always positive
    /// e.g.: a tickSpacing of 3 means ticks can be initialized every 3rd tick, i.e., ..., -6, -3, 0, 3, 6, ...
    /// This value is an int24 to avoid casting even though it is always positive.
    /// @return The tick spacing
    function tickSpacing() external view returns (int24);

    /// @notice The maximum amount of position liquidity that can use any tick in the range
    /// @dev This parameter is enforced per tick to prevent liquidity from overflowing a uint128 at any point, and
    /// also prevents out-of-range liquidity from being used to prevent adding in-range liquidity to a pool
    /// @return The max amount of liquidity per tick
    function maxLiquidityPerTick() external view returns (uint128);
}

File 7 of 30 : IUniswapV3PoolOwnerActions.sol
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.5.0;

/// @title Permissioned pool actions
/// @notice Contains pool methods that may only be called by the factory owner
interface IUniswapV3PoolOwnerActions {
    /// @notice Set the denominator of the protocol's % share of the fees
    /// @param feeProtocol0 new protocol fee for token0 of the pool
    /// @param feeProtocol1 new protocol fee for token1 of the pool
    function setFeeProtocol(uint8 feeProtocol0, uint8 feeProtocol1) external;

    /// @notice Collect the protocol fee accrued to the pool
    /// @param recipient The address to which collected protocol fees should be sent
    /// @param amount0Requested The maximum amount of token0 to send, can be 0 to collect fees in only token1
    /// @param amount1Requested The maximum amount of token1 to send, can be 0 to collect fees in only token0
    /// @return amount0 The protocol fee collected in token0
    /// @return amount1 The protocol fee collected in token1
    function collectProtocol(
        address recipient,
        uint128 amount0Requested,
        uint128 amount1Requested
    ) external returns (uint128 amount0, uint128 amount1);
}

File 8 of 30 : IUniswapV3PoolState.sol
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.5.0;

/// @title Pool state that can change
/// @notice These methods compose the pool's state, and can change with any frequency including multiple times
/// per transaction
interface IUniswapV3PoolState {
    /// @notice The 0th storage slot in the pool stores many values, and is exposed as a single method to save gas
    /// when accessed externally.
    /// @return sqrtPriceX96 The current price of the pool as a sqrt(token1/token0) Q64.96 value
    /// tick The current tick of the pool, i.e. according to the last tick transition that was run.
    /// This value may not always be equal to SqrtTickMath.getTickAtSqrtRatio(sqrtPriceX96) if the price is on a tick
    /// boundary.
    /// observationIndex The index of the last oracle observation that was written,
    /// observationCardinality The current maximum number of observations stored in the pool,
    /// observationCardinalityNext The next maximum number of observations, to be updated when the observation.
    /// feeProtocol The protocol fee for both tokens of the pool.
    /// Encoded as two 4 bit values, where the protocol fee of token1 is shifted 4 bits and the protocol fee of token0
    /// is the lower 4 bits. Used as the denominator of a fraction of the swap fee, e.g. 4 means 1/4th of the swap fee.
    /// unlocked Whether the pool is currently locked to reentrancy
    function slot0()
        external
        view
        returns (
            uint160 sqrtPriceX96,
            int24 tick,
            uint16 observationIndex,
            uint16 observationCardinality,
            uint16 observationCardinalityNext,
            uint8 feeProtocol,
            bool unlocked
        );

    /// @notice The fee growth as a Q128.128 fees of token0 collected per unit of liquidity for the entire life of the pool
    /// @dev This value can overflow the uint256
    function feeGrowthGlobal0X128() external view returns (uint256);

    /// @notice The fee growth as a Q128.128 fees of token1 collected per unit of liquidity for the entire life of the pool
    /// @dev This value can overflow the uint256
    function feeGrowthGlobal1X128() external view returns (uint256);

    /// @notice The amounts of token0 and token1 that are owed to the protocol
    /// @dev Protocol fees will never exceed uint128 max in either token
    function protocolFees() external view returns (uint128 token0, uint128 token1);

    /// @notice The currently in range liquidity available to the pool
    /// @dev This value has no relationship to the total liquidity across all ticks
    function liquidity() external view returns (uint128);

    /// @notice Look up information about a specific tick in the pool
    /// @param tick The tick to look up
    /// @return liquidityGross the total amount of position liquidity that uses the pool either as tick lower or
    /// tick upper,
    /// liquidityNet how much liquidity changes when the pool price crosses the tick,
    /// feeGrowthOutside0X128 the fee growth on the other side of the tick from the current tick in token0,
    /// feeGrowthOutside1X128 the fee growth on the other side of the tick from the current tick in token1,
    /// tickCumulativeOutside the cumulative tick value on the other side of the tick from the current tick
    /// secondsPerLiquidityOutsideX128 the seconds spent per liquidity on the other side of the tick from the current tick,
    /// secondsOutside the seconds spent on the other side of the tick from the current tick,
    /// initialized Set to true if the tick is initialized, i.e. liquidityGross is greater than 0, otherwise equal to false.
    /// Outside values can only be used if the tick is initialized, i.e. if liquidityGross is greater than 0.
    /// In addition, these values are only relative and must be used only in comparison to previous snapshots for
    /// a specific position.
    function ticks(int24 tick)
        external
        view
        returns (
            uint128 liquidityGross,
            int128 liquidityNet,
            uint256 feeGrowthOutside0X128,
            uint256 feeGrowthOutside1X128,
            int56 tickCumulativeOutside,
            uint160 secondsPerLiquidityOutsideX128,
            uint32 secondsOutside,
            bool initialized
        );

    /// @notice Returns 256 packed tick initialized boolean values. See TickBitmap for more information
    function tickBitmap(int16 wordPosition) external view returns (uint256);

    /// @notice Returns the information about a position by the position's key
    /// @param key The position's key is a hash of a preimage composed by the owner, tickLower and tickUpper
    /// @return _liquidity The amount of liquidity in the position,
    /// Returns feeGrowthInside0LastX128 fee growth of token0 inside the tick range as of the last mint/burn/poke,
    /// Returns feeGrowthInside1LastX128 fee growth of token1 inside the tick range as of the last mint/burn/poke,
    /// Returns tokensOwed0 the computed amount of token0 owed to the position as of the last mint/burn/poke,
    /// Returns tokensOwed1 the computed amount of token1 owed to the position as of the last mint/burn/poke
    function positions(bytes32 key)
        external
        view
        returns (
            uint128 _liquidity,
            uint256 feeGrowthInside0LastX128,
            uint256 feeGrowthInside1LastX128,
            uint128 tokensOwed0,
            uint128 tokensOwed1
        );

    /// @notice Returns data about a specific observation index
    /// @param index The element of the observations array to fetch
    /// @dev You most likely want to use #observe() instead of this method to get an observation as of some amount of time
    /// ago, rather than at a specific index in the array.
    /// @return blockTimestamp The timestamp of the observation,
    /// Returns tickCumulative the tick multiplied by seconds elapsed for the life of the pool as of the observation timestamp,
    /// Returns secondsPerLiquidityCumulativeX128 the seconds per in range liquidity for the life of the pool as of the observation timestamp,
    /// Returns initialized whether the observation has been initialized and the values are safe to use
    function observations(uint256 index)
        external
        view
        returns (
            uint32 blockTimestamp,
            int56 tickCumulative,
            uint160 secondsPerLiquidityCumulativeX128,
            bool initialized
        );
}

File 9 of 30 : FullMath.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.4.0 <0.8.0;

/// @title Contains 512-bit math functions
/// @notice Facilitates multiplication and division that can have overflow of an intermediate value without any loss of precision
/// @dev Handles "phantom overflow" i.e., allows multiplication and division where an intermediate value overflows 256 bits
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++;
        }
    }
}

File 10 of 30 : TickMath.sol
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.5.0 <0.8.0;

/// @title Math library for computing sqrt prices from ticks and vice versa
/// @notice Computes sqrt price for ticks of size 1.0001, i.e. sqrt(1.0001^tick) as fixed point Q64.96 numbers. Supports
/// prices between 2**-128 and 2**128
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;
    }
}

File 11 of 30 : OracleLibrary.sol
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.5.0 <0.8.0;

import '@uniswap/v3-core/contracts/libraries/FullMath.sol';
import '@uniswap/v3-core/contracts/libraries/TickMath.sol';
import '@uniswap/v3-core/contracts/interfaces/IUniswapV3Pool.sol';

/// @title Oracle library
/// @notice Provides functions to integrate with V3 pool oracle
library OracleLibrary {
    /// @notice Calculates time-weighted means of tick and liquidity for a given Uniswap V3 pool
    /// @param pool Address of the pool that we want to observe
    /// @param secondsAgo Number of seconds in the past from which to calculate the time-weighted means
    /// @return arithmeticMeanTick The arithmetic mean tick from (block.timestamp - secondsAgo) to block.timestamp
    /// @return harmonicMeanLiquidity The harmonic mean liquidity from (block.timestamp - secondsAgo) to block.timestamp
    function consult(address pool, uint32 secondsAgo)
        internal
        view
        returns (int24 arithmeticMeanTick, uint128 harmonicMeanLiquidity)
    {
        require(secondsAgo != 0, 'BP');

        uint32[] memory secondsAgos = new uint32[](2);
        secondsAgos[0] = secondsAgo;
        secondsAgos[1] = 0;

        (int56[] memory tickCumulatives, uint160[] memory secondsPerLiquidityCumulativeX128s) =
            IUniswapV3Pool(pool).observe(secondsAgos);

        int56 tickCumulativesDelta = tickCumulatives[1] - tickCumulatives[0];
        uint160 secondsPerLiquidityCumulativesDelta =
            secondsPerLiquidityCumulativeX128s[1] - secondsPerLiquidityCumulativeX128s[0];

        arithmeticMeanTick = int24(tickCumulativesDelta / secondsAgo);
        // Always round to negative infinity
        if (tickCumulativesDelta < 0 && (tickCumulativesDelta % secondsAgo != 0)) arithmeticMeanTick--;

        // We are multiplying here instead of shifting to ensure that harmonicMeanLiquidity doesn't overflow uint128
        uint192 secondsAgoX160 = uint192(secondsAgo) * type(uint160).max;
        harmonicMeanLiquidity = uint128(secondsAgoX160 / (uint192(secondsPerLiquidityCumulativesDelta) << 32));
    }

    /// @notice Given a tick and a token amount, calculates the amount of token received in exchange
    /// @param tick Tick value used to calculate the quote
    /// @param baseAmount Amount of token to be converted
    /// @param baseToken Address of an ERC20 token contract used as the baseAmount denomination
    /// @param quoteToken Address of an ERC20 token contract used as the quoteAmount denomination
    /// @return quoteAmount Amount of quoteToken received for baseAmount of baseToken
    function getQuoteAtTick(
        int24 tick,
        uint128 baseAmount,
        address baseToken,
        address quoteToken
    ) internal pure returns (uint256 quoteAmount) {
        uint160 sqrtRatioX96 = TickMath.getSqrtRatioAtTick(tick);

        // Calculate quoteAmount with better precision if it doesn't overflow when multiplied by itself
        if (sqrtRatioX96 <= type(uint128).max) {
            uint256 ratioX192 = uint256(sqrtRatioX96) * sqrtRatioX96;
            quoteAmount = baseToken < quoteToken
                ? FullMath.mulDiv(ratioX192, baseAmount, 1 << 192)
                : FullMath.mulDiv(1 << 192, baseAmount, ratioX192);
        } else {
            uint256 ratioX128 = FullMath.mulDiv(sqrtRatioX96, sqrtRatioX96, 1 << 64);
            quoteAmount = baseToken < quoteToken
                ? FullMath.mulDiv(ratioX128, baseAmount, 1 << 128)
                : FullMath.mulDiv(1 << 128, baseAmount, ratioX128);
        }
    }

    /// @notice Given a pool, it returns the number of seconds ago of the oldest stored observation
    /// @param pool Address of Uniswap V3 pool that we want to observe
    /// @return secondsAgo The number of seconds ago of the oldest observation stored for the pool
    function getOldestObservationSecondsAgo(address pool) internal view returns (uint32 secondsAgo) {
        (, , uint16 observationIndex, uint16 observationCardinality, , , ) = IUniswapV3Pool(pool).slot0();
        require(observationCardinality > 0, 'NI');

        (uint32 observationTimestamp, , , bool initialized) =
            IUniswapV3Pool(pool).observations((observationIndex + 1) % observationCardinality);

        // The next index might not be initialized if the cardinality is in the process of increasing
        // In this case the oldest observation is always in index 0
        if (!initialized) {
            (observationTimestamp, , , ) = IUniswapV3Pool(pool).observations(0);
        }

        secondsAgo = uint32(block.timestamp) - observationTimestamp;
    }

    /// @notice Given a pool, it returns the tick value as of the start of the current block
    /// @param pool Address of Uniswap V3 pool
    /// @return The tick that the pool was in at the start of the current block
    function getBlockStartingTickAndLiquidity(address pool) internal view returns (int24, uint128) {
        (, int24 tick, uint16 observationIndex, uint16 observationCardinality, , , ) = IUniswapV3Pool(pool).slot0();

        // 2 observations are needed to reliably calculate the block starting tick
        require(observationCardinality > 1, 'NEO');

        // If the latest observation occurred in the past, then no tick-changing trades have happened in this block
        // therefore the tick in `slot0` is the same as at the beginning of the current block.
        // We don't need to check if this observation is initialized - it is guaranteed to be.
        (uint32 observationTimestamp, int56 tickCumulative, uint160 secondsPerLiquidityCumulativeX128, ) =
            IUniswapV3Pool(pool).observations(observationIndex);
        if (observationTimestamp != uint32(block.timestamp)) {
            return (tick, IUniswapV3Pool(pool).liquidity());
        }

        uint256 prevIndex = (uint256(observationIndex) + observationCardinality - 1) % observationCardinality;
        (
            uint32 prevObservationTimestamp,
            int56 prevTickCumulative,
            uint160 prevSecondsPerLiquidityCumulativeX128,
            bool prevInitialized
        ) = IUniswapV3Pool(pool).observations(prevIndex);

        require(prevInitialized, 'ONI');

        uint32 delta = observationTimestamp - prevObservationTimestamp;
        tick = int24((tickCumulative - prevTickCumulative) / delta);
        uint128 liquidity =
            uint128(
                (uint192(delta) * type(uint160).max) /
                    (uint192(secondsPerLiquidityCumulativeX128 - prevSecondsPerLiquidityCumulativeX128) << 32)
            );
        return (tick, liquidity);
    }

    /// @notice Information for calculating a weighted arithmetic mean tick
    struct WeightedTickData {
        int24 tick;
        uint128 weight;
    }

    /// @notice Given an array of ticks and weights, calculates the weighted arithmetic mean tick
    /// @param weightedTickData An array of ticks and weights
    /// @return weightedArithmeticMeanTick The weighted arithmetic mean tick
    /// @dev Each entry of `weightedTickData` should represents ticks from pools with the same underlying pool tokens. If they do not,
    /// extreme care must be taken to ensure that ticks are comparable (including decimal differences).
    /// @dev Note that the weighted arithmetic mean tick corresponds to the weighted geometric mean price.
    function getWeightedArithmeticMeanTick(WeightedTickData[] memory weightedTickData)
        internal
        pure
        returns (int24 weightedArithmeticMeanTick)
    {
        // Accumulates the sum of products between each tick and its weight
        int256 numerator;

        // Accumulates the sum of the weights
        uint256 denominator;

        // Products fit in 152 bits, so it would take an array of length ~2**104 to overflow this logic
        for (uint256 i; i < weightedTickData.length; i++) {
            numerator += weightedTickData[i].tick * int256(weightedTickData[i].weight);
            denominator += weightedTickData[i].weight;
        }

        weightedArithmeticMeanTick = int24(numerator / int256(denominator));
        // Always round to negative infinity
        if (numerator < 0 && (numerator % int256(denominator) != 0)) weightedArithmeticMeanTick--;
    }

    /// @notice Returns the "synthetic" tick which represents the price of the first entry in `tokens` in terms of the last
    /// @dev Useful for calculating relative prices along routes.
    /// @dev There must be one tick for each pairwise set of tokens.
    /// @param tokens The token contract addresses
    /// @param ticks The ticks, representing the price of each token pair in `tokens`
    /// @return syntheticTick The synthetic tick, representing the relative price of the outermost tokens in `tokens`
    function getChainedPrice(address[] memory tokens, int24[] memory ticks)
        internal
        pure
        returns (int256 syntheticTick)
    {
        require(tokens.length - 1 == ticks.length, 'DL');
        for (uint256 i = 1; i <= ticks.length; i++) {
            // check the tokens for address sort order, then accumulate the
            // ticks into the running synthetic tick, ensuring that intermediate tokens "cancel out"
            tokens[i - 1] < tokens[i] ? syntheticTick += ticks[i - 1] : syntheticTick -= ticks[i - 1];
        }
    }
}

File 12 of 30 : IERC721Permit.sol
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.7.5;

import "../openzeppelin/token/ERC721/IERC721.sol";

/// @title ERC721 with permit
/// @notice Extension to ERC721 that includes a permit function for signature based approvals
interface IERC721Permit is IERC721 {
    /// @notice The permit typehash used in the permit signature
    /// @return The typehash for the permit
    function PERMIT_TYPEHASH() external pure returns (bytes32);

    /// @notice The domain separator used in the permit signature
    /// @return The domain seperator used in encoding of permit signature
    function DOMAIN_SEPARATOR() external view returns (bytes32);

    /// @notice Approve of a specific token ID for spending by spender via signature
    /// @param spender The account that is being approved
    /// @param tokenId The ID of the token that is being approved for spending
    /// @param deadline The deadline timestamp by which the call must be mined for the approve to work
    /// @param v Must produce valid secp256k1 signature from the holder along with `r` and `s`
    /// @param r Must produce valid secp256k1 signature from the holder along with `v` and `s`
    /// @param s Must produce valid secp256k1 signature from the holder along with `r` and `v`
    function permit(
        address spender,
        uint256 tokenId,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) external payable;
}

File 13 of 30 : IHELIOS.sol
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.7.6;

interface IHELIOS {
    function burnLPTokens() external;

    function balanceOf(address account) external view returns (uint256);

    function totalSupply() external view returns (uint256);

    function mintLPTokens() external;
}

File 14 of 30 : INonfungiblePositionManager.sol
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.7.5;
pragma abicoder v2;

import "../openzeppelin/token/ERC721/IERC721Metadata.sol";
import "../openzeppelin/token/ERC721/IERC721Enumerable.sol";

import "./IPoolInitializer.sol";
import "./IERC721Permit.sol";
import "./IPeripheryPayments.sol";
import "./IPeripheryImmutableState.sol";
import "../libs/PoolAddress.sol";

/// @title Non-fungible token for positions
/// @notice Wraps Uniswap V3 positions in a non-fungible token interface which allows for them to be transferred
/// and authorized.
interface INonfungiblePositionManager is
    IPoolInitializer,
    IPeripheryPayments,
    IPeripheryImmutableState,
    IERC721Metadata,
    IERC721Enumerable,
    IERC721Permit
{
    /// @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;
}

File 15 of 30 : IPeripheryImmutableState.sol
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.5.0;

/// @title Immutable state
/// @notice Functions that return immutable state of the router
interface IPeripheryImmutableState {
    /// @return Returns the address of the Uniswap V3 factory
    function factory() external view returns (address);

    /// @return Returns the address of WETH9
    function WETH9() external view returns (address);
}

File 16 of 30 : IPeripheryPayments.sol
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.7.5;

/// @title Periphery Payments
/// @notice Functions to ease deposits and withdrawals of ETH
interface IPeripheryPayments {
    /// @notice Unwraps the contract's WETH9 balance and sends it to recipient as ETH.
    /// @dev The amountMinimum parameter prevents malicious contracts from stealing WETH9 from users.
    /// @param amountMinimum The minimum amount of WETH9 to unwrap
    /// @param recipient The address receiving ETH
    function unwrapWETH9(
        uint256 amountMinimum,
        address recipient
    ) external payable;

    /// @notice Refunds any ETH balance held by this contract to the `msg.sender`
    /// @dev Useful for bundling with mint or increase liquidity that uses ether, or exact output swaps
    /// that use ether for the input amount
    function refundETH() external payable;

    /// @notice Transfers the full amount of a token held by this contract to recipient
    /// @dev The amountMinimum parameter prevents malicious contracts from stealing the token from users
    /// @param token The contract address of the token which will be transferred to `recipient`
    /// @param amountMinimum The minimum amount of token required for a transfer
    /// @param recipient The destination address of the token
    function sweepToken(
        address token,
        uint256 amountMinimum,
        address recipient
    ) external payable;
}

File 17 of 30 : IPoolInitializer.sol
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.7.5;
pragma abicoder v2;

/// @title Creates and initializes V3 Pools
/// @notice Provides a method for creating and initializing a pool, if necessary, for bundling with other methods that
/// require the pool to exist.
interface IPoolInitializer {
    /// @notice Creates a new pool if it does not exist, then initializes if not initialized
    /// @dev This method can be bundled with others via IMulticall for the first action (e.g. mint) performed against a pool
    /// @param token0 The contract address of token0 of the pool
    /// @param token1 The contract address of token1 of the pool
    /// @param fee The fee amount of the v3 pool for the specified token pair
    /// @param sqrtPriceX96 The initial square root price of the pool as a Q64.96 value
    /// @return pool Returns the pool address based on the pair of tokens and fee, will return the newly created pool address if necessary
    function createAndInitializePoolIfNecessary(
        address token0,
        address token1,
        uint24 fee,
        uint160 sqrtPriceX96
    ) external payable returns (address pool);
}

File 18 of 30 : ITITANX.sol
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.7.6;

interface ITITANX {
    function balanceOf(address account) external view returns (uint256);

    function getBalance() external;

    function mintLPTokens() external;

    function burnLPTokens() external;

    function startStake(uint256 amount, uint256 numOfDays) external;

    function claimUserAvailableETHPayouts() external;
}

File 19 of 30 : IWETH9.sol
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity =0.7.6;

import "../openzeppelin/token/ERC20/IERC20.sol";

/// @title Interface for WETH9
interface IWETH9 is IERC20 {
    /// @notice Deposit ether to get wrapped ether
    function deposit() external payable;

    /// @notice Withdraw wrapped ether to get ether
    function withdraw(uint256) external;
}

File 20 of 30 : CallbackValidation.sol
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.7.6;

import "@uniswap/v3-core/contracts/interfaces/IUniswapV3Pool.sol";
import "./PoolAddress.sol";

/// @notice Provides validation for callbacks from Uniswap V3 Pools
library CallbackValidation {
    /// @notice Returns the address of a valid Uniswap V3 Pool
    /// @param factory The contract address of the Uniswap V3 factory
    /// @param tokenA The contract address of either token0 or token1
    /// @param tokenB The contract address of the other token
    /// @param fee The fee collected upon every swap in the pool, denominated in hundredths of a bip
    /// @return pool The V3 pool contract address
    function verifyCallback(
        address factory,
        address tokenA,
        address tokenB,
        uint24 fee
    ) internal view returns (IUniswapV3Pool pool) {
        return
            verifyCallback(
                factory,
                PoolAddress.getPoolKey(tokenA, tokenB, fee)
            );
    }

    /// @notice Returns the address of a valid Uniswap V3 Pool
    /// @param factory The contract address of the Uniswap V3 factory
    /// @param poolKey The identifying key of the V3 pool
    /// @return pool The V3 pool contract address
    function verifyCallback(
        address factory,
        PoolAddress.PoolKey memory poolKey
    ) internal view returns (IUniswapV3Pool pool) {
        pool = IUniswapV3Pool(PoolAddress.computeAddress(factory, poolKey));
        require(msg.sender == address(pool));
    }
}

File 21 of 30 : Constant.sol
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.7.6;

enum InitialLPCreated {
    NO,
    YES
}

enum Liquidity {
    Increase,
    Mint
}

address constant TITANX = 0xF19308F923582A6f7c465e5CE7a9Dc1BEC6665B1;
address constant UNISWAPV3FACTORY = 0x1F98431c8aD98523631AE4a59f267346ea31F984;
address constant WETH9 = 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2;
address constant TITANX_WETH_POOL = 0xc45A81BC23A64eA556ab4CdF08A86B61cdcEEA8b;

uint256 constant SECONDS_IN_DAY = 86400;

uint24 constant POOLFEE1PERCENT = 10000; //1% Fee
uint160 constant MIN_SQRT_RATIO = 4295128739;
uint160 constant MAX_SQRT_RATIO = 1461446703485210103287273052203988822378723970342;

uint256 constant INCENTIVE_FEE = 3300;
uint256 constant INCENTIVE_FEE_PERCENT_BASE = 1_000_000;

uint256 constant MIN_INTERVAL_SECONDS = 60;
uint256 constant MAX_INTERVAL_SECONDS = 43200; //12 hours

uint256 constant INITIAL_LP_TITAN = 16_000_000_000 ether;
uint256 constant INITIAL_LP_HLX = 1_600_000_000 ether;

address constant NONFUNGIBLEPOSITIONMANAGER = 0xC36442b4a4522E871399CD717aBDD847Ab11FE88;

uint160 constant INITIAL_SQRTPRICE_TITANX_HLX = 25054144837504793750611689472;
uint160 constant INITIAL_SQRTPRICE_HLX_TITANX = 250541448375047946302209916928;

int24 constant MIN_TICK = -887200;
int24 constant MAX_TICK = 887200;

File 22 of 30 : PoolAddress.sol
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.5.0;

/// @title Provides functions for deriving a pool address from the factory, tokens, and the fee
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(
            uint160(
                uint256(
                    keccak256(
                        abi.encodePacked(
                            hex"ff",
                            factory,
                            keccak256(
                                abi.encode(key.token0, key.token1, key.fee)
                            ),
                            POOL_INIT_CODE_HASH
                        )
                    )
                )
            )
        );
    }
}

File 23 of 30 : TransferHelper.sol
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.6.0;

import "../openzeppelin/token/ERC20/IERC20.sol";

library TransferHelper {
    /// @notice Transfers tokens from the targeted address to the given destination
    /// @notice Errors with 'STF' if transfer fails
    /// @param token The contract address of the token to be transferred
    /// @param from The originating address from which the tokens will be transferred
    /// @param to The destination address of the transfer
    /// @param value The amount to be transferred
    function safeTransferFrom(
        address token,
        address from,
        address to,
        uint256 value
    ) internal {
        (bool success, bytes memory data) = token.call(
            abi.encodeWithSelector(
                IERC20.transferFrom.selector,
                from,
                to,
                value
            )
        );
        require(
            success && (data.length == 0 || abi.decode(data, (bool))),
            "STF"
        );
    }

    /// @notice Transfers tokens from msg.sender to a recipient
    /// @dev Errors with ST if transfer fails
    /// @param token The contract address of the token which will be transferred
    /// @param to The recipient of the transfer
    /// @param value The value of the transfer
    function safeTransfer(address token, address to, uint256 value) internal {
        (bool success, bytes memory data) = token.call(
            abi.encodeWithSelector(IERC20.transfer.selector, to, value)
        );
        require(
            success && (data.length == 0 || abi.decode(data, (bool))),
            "ST"
        );
    }

    /// @notice Approves the stipulated contract to spend the given allowance in the given token
    /// @dev Errors with 'SA' if transfer fails
    /// @param token The contract address of the token to be approved
    /// @param to The target of the approval
    /// @param value The amount of the given token the target will be allowed to spend
    function safeApprove(address token, address to, uint256 value) internal {
        (bool success, bytes memory data) = token.call(
            abi.encodeWithSelector(IERC20.approve.selector, to, value)
        );
        require(
            success && (data.length == 0 || abi.decode(data, (bool))),
            "SA"
        );
    }

    /// @notice Transfers ETH to the recipient address
    /// @dev Fails with `STE`
    /// @param to The destination of the transfer
    /// @param value The value to be transferred
    function safeTransferETH(address to, uint256 value) internal {
        (bool success, ) = to.call{value: value}(new bytes(0));
        require(success, "STE");
    }
}

File 24 of 30 : ReentrancyGuard.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (security/ReentrancyGuard.sol)

pragma solidity ^0.7.6;

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

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

    uint256 private _status;

    constructor() {
        _status = _NOT_ENTERED;
    }

    /**
     * @dev Prevents a contract from calling itself, directly or indirectly.
     * Calling a `nonReentrant` function from another `nonReentrant`
     * function is not supported. It is possible to prevent this from happening
     * by making the `nonReentrant` function external, and making it call a
     * `private` function that does the actual work.
     */
    modifier nonReentrant() {
        _nonReentrantBefore();
        _;
        _nonReentrantAfter();
    }

    function _nonReentrantBefore() private {
        // On the first call to nonReentrant, _status will be _NOT_ENTERED
        require(_status != _ENTERED, "ReentrancyGuard: reentrant call");

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

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

    /**
     * @dev Returns true if the reentrancy guard is currently set to "entered", which indicates there is a
     * `nonReentrant` function in the call stack.
     */
    function _reentrancyGuardEntered() internal view returns (bool) {
        return _status == _ENTERED;
    }
}

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

pragma solidity >=0.7.0;

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

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

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

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

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

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

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

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

File 26 of 30 : IERC165.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.7.0;

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

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

pragma solidity ^0.7.0;

import "./IERC165.sol";

/**
 * @dev Required interface of an ERC721 compliant contract.
 */
interface IERC721 is IERC165 {
    /**
     * @dev Emitted when `tokenId` token is transferred from `from` to `to`.
     */
    event Transfer(
        address indexed from,
        address indexed to,
        uint256 indexed tokenId
    );

    /**
     * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.
     */
    event Approval(
        address indexed owner,
        address indexed approved,
        uint256 indexed tokenId
    );

    /**
     * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.
     */
    event ApprovalForAll(
        address indexed owner,
        address indexed operator,
        bool approved
    );

    /**
     * @dev Returns the number of tokens in ``owner``'s account.
     */
    function balanceOf(address owner) external view returns (uint256 balance);

    /**
     * @dev Returns the owner of the `tokenId` token.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function ownerOf(uint256 tokenId) external view returns (address owner);

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

    /**
     * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients
     * are aware of the ERC721 protocol to prevent tokens from being forever locked.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must exist and be owned by `from`.
     * - If the caller is not `from`, it must have been allowed to move this token by either {approve} or {setApprovalForAll}.
     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
     *
     * Emits a {Transfer} event.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 tokenId
    ) external;

    /**
     * @dev Transfers `tokenId` token from `from` to `to`.
     *
     * WARNING: Note that the caller is responsible to confirm that the recipient is capable of receiving ERC721
     * or else they may be permanently lost. Usage of {safeTransferFrom} prevents loss, though the caller must
     * understand this adds an external call which potentially creates a reentrancy vulnerability.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must be owned by `from`.
     * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(address from, address to, uint256 tokenId) external;

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

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

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

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

File 28 of 30 : IERC721Enumerable.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.7.0;

import "./IERC721.sol";

/**
 * @title ERC-721 Non-Fungible Token Standard, optional enumeration extension
 * @dev See https://eips.ethereum.org/EIPS/eip-721
 */
interface IERC721Enumerable is IERC721 {
    /**
     * @dev Returns the total amount of tokens stored by the contract.
     */
    function totalSupply() external view returns (uint256);

    /**
     * @dev Returns a token ID owned by `owner` at a given `index` of its token list.
     * Use along with {balanceOf} to enumerate all of ``owner``'s tokens.
     */
    function tokenOfOwnerByIndex(
        address owner,
        uint256 index
    ) external view returns (uint256 tokenId);

    /**
     * @dev Returns a token ID at a given `index` of all the tokens stored by the contract.
     * Use along with {totalSupply} to enumerate all tokens.
     */
    function tokenByIndex(uint256 index) external view returns (uint256);
}

File 29 of 30 : IERC721Metadata.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.7.0;

import "./IERC721.sol";

/**
 * @title ERC-721 Non-Fungible Token Standard, optional metadata extension
 * @dev See https://eips.ethereum.org/EIPS/eip-721
 */
interface IERC721Metadata is IERC721 {
    /**
     * @dev Returns the token collection name.
     */
    function name() external view returns (string memory);

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

    /**
     * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token.
     */
    function tokenURI(uint256 tokenId) external view returns (string memory);
}

File 30 of 30 : console.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.4.22 <0.9.0;

library console {
    address constant CONSOLE_ADDRESS =
        0x000000000000000000636F6e736F6c652e6c6f67;

    function _sendLogPayloadImplementation(bytes memory payload) internal view {
        address consoleAddress = CONSOLE_ADDRESS;
        /// @solidity memory-safe-assembly
        assembly {
            pop(
                staticcall(
                    gas(),
                    consoleAddress,
                    add(payload, 32),
                    mload(payload),
                    0,
                    0
                )
            )
        }
    }

    function _castToPure(
      function(bytes memory) internal view fnIn
    ) internal pure returns (function(bytes memory) pure fnOut) {
        assembly {
            fnOut := fnIn
        }
    }

    function _sendLogPayload(bytes memory payload) internal pure {
        _castToPure(_sendLogPayloadImplementation)(payload);
    }

    function log() internal pure {
        _sendLogPayload(abi.encodeWithSignature("log()"));
    }
    function logInt(int256 p0) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(int256)", p0));
    }

    function logUint(uint256 p0) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(uint256)", p0));
    }

    function logString(string memory p0) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(string)", p0));
    }

    function logBool(bool p0) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(bool)", p0));
    }

    function logAddress(address p0) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(address)", p0));
    }

    function logBytes(bytes memory p0) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(bytes)", p0));
    }

    function logBytes1(bytes1 p0) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(bytes1)", p0));
    }

    function logBytes2(bytes2 p0) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(bytes2)", p0));
    }

    function logBytes3(bytes3 p0) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(bytes3)", p0));
    }

    function logBytes4(bytes4 p0) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(bytes4)", p0));
    }

    function logBytes5(bytes5 p0) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(bytes5)", p0));
    }

    function logBytes6(bytes6 p0) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(bytes6)", p0));
    }

    function logBytes7(bytes7 p0) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(bytes7)", p0));
    }

    function logBytes8(bytes8 p0) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(bytes8)", p0));
    }

    function logBytes9(bytes9 p0) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(bytes9)", p0));
    }

    function logBytes10(bytes10 p0) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(bytes10)", p0));
    }

    function logBytes11(bytes11 p0) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(bytes11)", p0));
    }

    function logBytes12(bytes12 p0) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(bytes12)", p0));
    }

    function logBytes13(bytes13 p0) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(bytes13)", p0));
    }

    function logBytes14(bytes14 p0) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(bytes14)", p0));
    }

    function logBytes15(bytes15 p0) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(bytes15)", p0));
    }

    function logBytes16(bytes16 p0) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(bytes16)", p0));
    }

    function logBytes17(bytes17 p0) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(bytes17)", p0));
    }

    function logBytes18(bytes18 p0) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(bytes18)", p0));
    }

    function logBytes19(bytes19 p0) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(bytes19)", p0));
    }

    function logBytes20(bytes20 p0) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(bytes20)", p0));
    }

    function logBytes21(bytes21 p0) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(bytes21)", p0));
    }

    function logBytes22(bytes22 p0) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(bytes22)", p0));
    }

    function logBytes23(bytes23 p0) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(bytes23)", p0));
    }

    function logBytes24(bytes24 p0) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(bytes24)", p0));
    }

    function logBytes25(bytes25 p0) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(bytes25)", p0));
    }

    function logBytes26(bytes26 p0) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(bytes26)", p0));
    }

    function logBytes27(bytes27 p0) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(bytes27)", p0));
    }

    function logBytes28(bytes28 p0) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(bytes28)", p0));
    }

    function logBytes29(bytes29 p0) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(bytes29)", p0));
    }

    function logBytes30(bytes30 p0) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(bytes30)", p0));
    }

    function logBytes31(bytes31 p0) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(bytes31)", p0));
    }

    function logBytes32(bytes32 p0) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(bytes32)", p0));
    }

    function log(uint256 p0) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(uint256)", p0));
    }

    function log(string memory p0) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(string)", p0));
    }

    function log(bool p0) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(bool)", p0));
    }

    function log(address p0) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(address)", p0));
    }

    function log(uint256 p0, uint256 p1) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(uint256,uint256)", p0, p1));
    }

    function log(uint256 p0, string memory p1) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(uint256,string)", p0, p1));
    }

    function log(uint256 p0, bool p1) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(uint256,bool)", p0, p1));
    }

    function log(uint256 p0, address p1) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(uint256,address)", p0, p1));
    }

    function log(string memory p0, uint256 p1) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(string,uint256)", p0, p1));
    }

    function log(string memory p0, string memory p1) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(string,string)", p0, p1));
    }

    function log(string memory p0, bool p1) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(string,bool)", p0, p1));
    }

    function log(string memory p0, address p1) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(string,address)", p0, p1));
    }

    function log(bool p0, uint256 p1) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(bool,uint256)", p0, p1));
    }

    function log(bool p0, string memory p1) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(bool,string)", p0, p1));
    }

    function log(bool p0, bool p1) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(bool,bool)", p0, p1));
    }

    function log(bool p0, address p1) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(bool,address)", p0, p1));
    }

    function log(address p0, uint256 p1) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(address,uint256)", p0, p1));
    }

    function log(address p0, string memory p1) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(address,string)", p0, p1));
    }

    function log(address p0, bool p1) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(address,bool)", p0, p1));
    }

    function log(address p0, address p1) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(address,address)", p0, p1));
    }

    function log(uint256 p0, uint256 p1, uint256 p2) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(uint256,uint256,uint256)", p0, p1, p2));
    }

    function log(uint256 p0, uint256 p1, string memory p2) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(uint256,uint256,string)", p0, p1, p2));
    }

    function log(uint256 p0, uint256 p1, bool p2) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(uint256,uint256,bool)", p0, p1, p2));
    }

    function log(uint256 p0, uint256 p1, address p2) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(uint256,uint256,address)", p0, p1, p2));
    }

    function log(uint256 p0, string memory p1, uint256 p2) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(uint256,string,uint256)", p0, p1, p2));
    }

    function log(uint256 p0, string memory p1, string memory p2) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(uint256,string,string)", p0, p1, p2));
    }

    function log(uint256 p0, string memory p1, bool p2) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(uint256,string,bool)", p0, p1, p2));
    }

    function log(uint256 p0, string memory p1, address p2) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(uint256,string,address)", p0, p1, p2));
    }

    function log(uint256 p0, bool p1, uint256 p2) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(uint256,bool,uint256)", p0, p1, p2));
    }

    function log(uint256 p0, bool p1, string memory p2) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(uint256,bool,string)", p0, p1, p2));
    }

    function log(uint256 p0, bool p1, bool p2) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(uint256,bool,bool)", p0, p1, p2));
    }

    function log(uint256 p0, bool p1, address p2) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(uint256,bool,address)", p0, p1, p2));
    }

    function log(uint256 p0, address p1, uint256 p2) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(uint256,address,uint256)", p0, p1, p2));
    }

    function log(uint256 p0, address p1, string memory p2) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(uint256,address,string)", p0, p1, p2));
    }

    function log(uint256 p0, address p1, bool p2) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(uint256,address,bool)", p0, p1, p2));
    }

    function log(uint256 p0, address p1, address p2) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(uint256,address,address)", p0, p1, p2));
    }

    function log(string memory p0, uint256 p1, uint256 p2) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(string,uint256,uint256)", p0, p1, p2));
    }

    function log(string memory p0, uint256 p1, string memory p2) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(string,uint256,string)", p0, p1, p2));
    }

    function log(string memory p0, uint256 p1, bool p2) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(string,uint256,bool)", p0, p1, p2));
    }

    function log(string memory p0, uint256 p1, address p2) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(string,uint256,address)", p0, p1, p2));
    }

    function log(string memory p0, string memory p1, uint256 p2) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(string,string,uint256)", p0, p1, p2));
    }

    function log(string memory p0, string memory p1, string memory p2) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(string,string,string)", p0, p1, p2));
    }

    function log(string memory p0, string memory p1, bool p2) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(string,string,bool)", p0, p1, p2));
    }

    function log(string memory p0, string memory p1, address p2) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(string,string,address)", p0, p1, p2));
    }

    function log(string memory p0, bool p1, uint256 p2) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(string,bool,uint256)", p0, p1, p2));
    }

    function log(string memory p0, bool p1, string memory p2) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(string,bool,string)", p0, p1, p2));
    }

    function log(string memory p0, bool p1, bool p2) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(string,bool,bool)", p0, p1, p2));
    }

    function log(string memory p0, bool p1, address p2) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(string,bool,address)", p0, p1, p2));
    }

    function log(string memory p0, address p1, uint256 p2) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(string,address,uint256)", p0, p1, p2));
    }

    function log(string memory p0, address p1, string memory p2) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(string,address,string)", p0, p1, p2));
    }

    function log(string memory p0, address p1, bool p2) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(string,address,bool)", p0, p1, p2));
    }

    function log(string memory p0, address p1, address p2) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(string,address,address)", p0, p1, p2));
    }

    function log(bool p0, uint256 p1, uint256 p2) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(bool,uint256,uint256)", p0, p1, p2));
    }

    function log(bool p0, uint256 p1, string memory p2) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(bool,uint256,string)", p0, p1, p2));
    }

    function log(bool p0, uint256 p1, bool p2) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(bool,uint256,bool)", p0, p1, p2));
    }

    function log(bool p0, uint256 p1, address p2) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(bool,uint256,address)", p0, p1, p2));
    }

    function log(bool p0, string memory p1, uint256 p2) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(bool,string,uint256)", p0, p1, p2));
    }

    function log(bool p0, string memory p1, string memory p2) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(bool,string,string)", p0, p1, p2));
    }

    function log(bool p0, string memory p1, bool p2) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(bool,string,bool)", p0, p1, p2));
    }

    function log(bool p0, string memory p1, address p2) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(bool,string,address)", p0, p1, p2));
    }

    function log(bool p0, bool p1, uint256 p2) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(bool,bool,uint256)", p0, p1, p2));
    }

    function log(bool p0, bool p1, string memory p2) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(bool,bool,string)", p0, p1, p2));
    }

    function log(bool p0, bool p1, bool p2) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(bool,bool,bool)", p0, p1, p2));
    }

    function log(bool p0, bool p1, address p2) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(bool,bool,address)", p0, p1, p2));
    }

    function log(bool p0, address p1, uint256 p2) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(bool,address,uint256)", p0, p1, p2));
    }

    function log(bool p0, address p1, string memory p2) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(bool,address,string)", p0, p1, p2));
    }

    function log(bool p0, address p1, bool p2) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(bool,address,bool)", p0, p1, p2));
    }

    function log(bool p0, address p1, address p2) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(bool,address,address)", p0, p1, p2));
    }

    function log(address p0, uint256 p1, uint256 p2) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(address,uint256,uint256)", p0, p1, p2));
    }

    function log(address p0, uint256 p1, string memory p2) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(address,uint256,string)", p0, p1, p2));
    }

    function log(address p0, uint256 p1, bool p2) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(address,uint256,bool)", p0, p1, p2));
    }

    function log(address p0, uint256 p1, address p2) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(address,uint256,address)", p0, p1, p2));
    }

    function log(address p0, string memory p1, uint256 p2) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(address,string,uint256)", p0, p1, p2));
    }

    function log(address p0, string memory p1, string memory p2) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(address,string,string)", p0, p1, p2));
    }

    function log(address p0, string memory p1, bool p2) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(address,string,bool)", p0, p1, p2));
    }

    function log(address p0, string memory p1, address p2) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(address,string,address)", p0, p1, p2));
    }

    function log(address p0, bool p1, uint256 p2) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(address,bool,uint256)", p0, p1, p2));
    }

    function log(address p0, bool p1, string memory p2) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(address,bool,string)", p0, p1, p2));
    }

    function log(address p0, bool p1, bool p2) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(address,bool,bool)", p0, p1, p2));
    }

    function log(address p0, bool p1, address p2) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(address,bool,address)", p0, p1, p2));
    }

    function log(address p0, address p1, uint256 p2) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(address,address,uint256)", p0, p1, p2));
    }

    function log(address p0, address p1, string memory p2) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(address,address,string)", p0, p1, p2));
    }

    function log(address p0, address p1, bool p2) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(address,address,bool)", p0, p1, p2));
    }

    function log(address p0, address p1, address p2) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(address,address,address)", p0, p1, p2));
    }

    function log(uint256 p0, uint256 p1, uint256 p2, uint256 p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(uint256,uint256,uint256,uint256)", p0, p1, p2, p3));
    }

    function log(uint256 p0, uint256 p1, uint256 p2, string memory p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(uint256,uint256,uint256,string)", p0, p1, p2, p3));
    }

    function log(uint256 p0, uint256 p1, uint256 p2, bool p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(uint256,uint256,uint256,bool)", p0, p1, p2, p3));
    }

    function log(uint256 p0, uint256 p1, uint256 p2, address p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(uint256,uint256,uint256,address)", p0, p1, p2, p3));
    }

    function log(uint256 p0, uint256 p1, string memory p2, uint256 p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(uint256,uint256,string,uint256)", p0, p1, p2, p3));
    }

    function log(uint256 p0, uint256 p1, string memory p2, string memory p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(uint256,uint256,string,string)", p0, p1, p2, p3));
    }

    function log(uint256 p0, uint256 p1, string memory p2, bool p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(uint256,uint256,string,bool)", p0, p1, p2, p3));
    }

    function log(uint256 p0, uint256 p1, string memory p2, address p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(uint256,uint256,string,address)", p0, p1, p2, p3));
    }

    function log(uint256 p0, uint256 p1, bool p2, uint256 p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(uint256,uint256,bool,uint256)", p0, p1, p2, p3));
    }

    function log(uint256 p0, uint256 p1, bool p2, string memory p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(uint256,uint256,bool,string)", p0, p1, p2, p3));
    }

    function log(uint256 p0, uint256 p1, bool p2, bool p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(uint256,uint256,bool,bool)", p0, p1, p2, p3));
    }

    function log(uint256 p0, uint256 p1, bool p2, address p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(uint256,uint256,bool,address)", p0, p1, p2, p3));
    }

    function log(uint256 p0, uint256 p1, address p2, uint256 p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(uint256,uint256,address,uint256)", p0, p1, p2, p3));
    }

    function log(uint256 p0, uint256 p1, address p2, string memory p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(uint256,uint256,address,string)", p0, p1, p2, p3));
    }

    function log(uint256 p0, uint256 p1, address p2, bool p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(uint256,uint256,address,bool)", p0, p1, p2, p3));
    }

    function log(uint256 p0, uint256 p1, address p2, address p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(uint256,uint256,address,address)", p0, p1, p2, p3));
    }

    function log(uint256 p0, string memory p1, uint256 p2, uint256 p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(uint256,string,uint256,uint256)", p0, p1, p2, p3));
    }

    function log(uint256 p0, string memory p1, uint256 p2, string memory p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(uint256,string,uint256,string)", p0, p1, p2, p3));
    }

    function log(uint256 p0, string memory p1, uint256 p2, bool p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(uint256,string,uint256,bool)", p0, p1, p2, p3));
    }

    function log(uint256 p0, string memory p1, uint256 p2, address p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(uint256,string,uint256,address)", p0, p1, p2, p3));
    }

    function log(uint256 p0, string memory p1, string memory p2, uint256 p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(uint256,string,string,uint256)", p0, p1, p2, p3));
    }

    function log(uint256 p0, string memory p1, string memory p2, string memory p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(uint256,string,string,string)", p0, p1, p2, p3));
    }

    function log(uint256 p0, string memory p1, string memory p2, bool p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(uint256,string,string,bool)", p0, p1, p2, p3));
    }

    function log(uint256 p0, string memory p1, string memory p2, address p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(uint256,string,string,address)", p0, p1, p2, p3));
    }

    function log(uint256 p0, string memory p1, bool p2, uint256 p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(uint256,string,bool,uint256)", p0, p1, p2, p3));
    }

    function log(uint256 p0, string memory p1, bool p2, string memory p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(uint256,string,bool,string)", p0, p1, p2, p3));
    }

    function log(uint256 p0, string memory p1, bool p2, bool p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(uint256,string,bool,bool)", p0, p1, p2, p3));
    }

    function log(uint256 p0, string memory p1, bool p2, address p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(uint256,string,bool,address)", p0, p1, p2, p3));
    }

    function log(uint256 p0, string memory p1, address p2, uint256 p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(uint256,string,address,uint256)", p0, p1, p2, p3));
    }

    function log(uint256 p0, string memory p1, address p2, string memory p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(uint256,string,address,string)", p0, p1, p2, p3));
    }

    function log(uint256 p0, string memory p1, address p2, bool p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(uint256,string,address,bool)", p0, p1, p2, p3));
    }

    function log(uint256 p0, string memory p1, address p2, address p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(uint256,string,address,address)", p0, p1, p2, p3));
    }

    function log(uint256 p0, bool p1, uint256 p2, uint256 p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(uint256,bool,uint256,uint256)", p0, p1, p2, p3));
    }

    function log(uint256 p0, bool p1, uint256 p2, string memory p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(uint256,bool,uint256,string)", p0, p1, p2, p3));
    }

    function log(uint256 p0, bool p1, uint256 p2, bool p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(uint256,bool,uint256,bool)", p0, p1, p2, p3));
    }

    function log(uint256 p0, bool p1, uint256 p2, address p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(uint256,bool,uint256,address)", p0, p1, p2, p3));
    }

    function log(uint256 p0, bool p1, string memory p2, uint256 p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(uint256,bool,string,uint256)", p0, p1, p2, p3));
    }

    function log(uint256 p0, bool p1, string memory p2, string memory p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(uint256,bool,string,string)", p0, p1, p2, p3));
    }

    function log(uint256 p0, bool p1, string memory p2, bool p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(uint256,bool,string,bool)", p0, p1, p2, p3));
    }

    function log(uint256 p0, bool p1, string memory p2, address p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(uint256,bool,string,address)", p0, p1, p2, p3));
    }

    function log(uint256 p0, bool p1, bool p2, uint256 p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(uint256,bool,bool,uint256)", p0, p1, p2, p3));
    }

    function log(uint256 p0, bool p1, bool p2, string memory p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(uint256,bool,bool,string)", p0, p1, p2, p3));
    }

    function log(uint256 p0, bool p1, bool p2, bool p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(uint256,bool,bool,bool)", p0, p1, p2, p3));
    }

    function log(uint256 p0, bool p1, bool p2, address p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(uint256,bool,bool,address)", p0, p1, p2, p3));
    }

    function log(uint256 p0, bool p1, address p2, uint256 p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(uint256,bool,address,uint256)", p0, p1, p2, p3));
    }

    function log(uint256 p0, bool p1, address p2, string memory p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(uint256,bool,address,string)", p0, p1, p2, p3));
    }

    function log(uint256 p0, bool p1, address p2, bool p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(uint256,bool,address,bool)", p0, p1, p2, p3));
    }

    function log(uint256 p0, bool p1, address p2, address p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(uint256,bool,address,address)", p0, p1, p2, p3));
    }

    function log(uint256 p0, address p1, uint256 p2, uint256 p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(uint256,address,uint256,uint256)", p0, p1, p2, p3));
    }

    function log(uint256 p0, address p1, uint256 p2, string memory p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(uint256,address,uint256,string)", p0, p1, p2, p3));
    }

    function log(uint256 p0, address p1, uint256 p2, bool p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(uint256,address,uint256,bool)", p0, p1, p2, p3));
    }

    function log(uint256 p0, address p1, uint256 p2, address p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(uint256,address,uint256,address)", p0, p1, p2, p3));
    }

    function log(uint256 p0, address p1, string memory p2, uint256 p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(uint256,address,string,uint256)", p0, p1, p2, p3));
    }

    function log(uint256 p0, address p1, string memory p2, string memory p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(uint256,address,string,string)", p0, p1, p2, p3));
    }

    function log(uint256 p0, address p1, string memory p2, bool p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(uint256,address,string,bool)", p0, p1, p2, p3));
    }

    function log(uint256 p0, address p1, string memory p2, address p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(uint256,address,string,address)", p0, p1, p2, p3));
    }

    function log(uint256 p0, address p1, bool p2, uint256 p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(uint256,address,bool,uint256)", p0, p1, p2, p3));
    }

    function log(uint256 p0, address p1, bool p2, string memory p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(uint256,address,bool,string)", p0, p1, p2, p3));
    }

    function log(uint256 p0, address p1, bool p2, bool p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(uint256,address,bool,bool)", p0, p1, p2, p3));
    }

    function log(uint256 p0, address p1, bool p2, address p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(uint256,address,bool,address)", p0, p1, p2, p3));
    }

    function log(uint256 p0, address p1, address p2, uint256 p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(uint256,address,address,uint256)", p0, p1, p2, p3));
    }

    function log(uint256 p0, address p1, address p2, string memory p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(uint256,address,address,string)", p0, p1, p2, p3));
    }

    function log(uint256 p0, address p1, address p2, bool p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(uint256,address,address,bool)", p0, p1, p2, p3));
    }

    function log(uint256 p0, address p1, address p2, address p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(uint256,address,address,address)", p0, p1, p2, p3));
    }

    function log(string memory p0, uint256 p1, uint256 p2, uint256 p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(string,uint256,uint256,uint256)", p0, p1, p2, p3));
    }

    function log(string memory p0, uint256 p1, uint256 p2, string memory p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(string,uint256,uint256,string)", p0, p1, p2, p3));
    }

    function log(string memory p0, uint256 p1, uint256 p2, bool p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(string,uint256,uint256,bool)", p0, p1, p2, p3));
    }

    function log(string memory p0, uint256 p1, uint256 p2, address p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(string,uint256,uint256,address)", p0, p1, p2, p3));
    }

    function log(string memory p0, uint256 p1, string memory p2, uint256 p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(string,uint256,string,uint256)", p0, p1, p2, p3));
    }

    function log(string memory p0, uint256 p1, string memory p2, string memory p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(string,uint256,string,string)", p0, p1, p2, p3));
    }

    function log(string memory p0, uint256 p1, string memory p2, bool p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(string,uint256,string,bool)", p0, p1, p2, p3));
    }

    function log(string memory p0, uint256 p1, string memory p2, address p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(string,uint256,string,address)", p0, p1, p2, p3));
    }

    function log(string memory p0, uint256 p1, bool p2, uint256 p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(string,uint256,bool,uint256)", p0, p1, p2, p3));
    }

    function log(string memory p0, uint256 p1, bool p2, string memory p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(string,uint256,bool,string)", p0, p1, p2, p3));
    }

    function log(string memory p0, uint256 p1, bool p2, bool p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(string,uint256,bool,bool)", p0, p1, p2, p3));
    }

    function log(string memory p0, uint256 p1, bool p2, address p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(string,uint256,bool,address)", p0, p1, p2, p3));
    }

    function log(string memory p0, uint256 p1, address p2, uint256 p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(string,uint256,address,uint256)", p0, p1, p2, p3));
    }

    function log(string memory p0, uint256 p1, address p2, string memory p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(string,uint256,address,string)", p0, p1, p2, p3));
    }

    function log(string memory p0, uint256 p1, address p2, bool p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(string,uint256,address,bool)", p0, p1, p2, p3));
    }

    function log(string memory p0, uint256 p1, address p2, address p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(string,uint256,address,address)", p0, p1, p2, p3));
    }

    function log(string memory p0, string memory p1, uint256 p2, uint256 p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(string,string,uint256,uint256)", p0, p1, p2, p3));
    }

    function log(string memory p0, string memory p1, uint256 p2, string memory p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(string,string,uint256,string)", p0, p1, p2, p3));
    }

    function log(string memory p0, string memory p1, uint256 p2, bool p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(string,string,uint256,bool)", p0, p1, p2, p3));
    }

    function log(string memory p0, string memory p1, uint256 p2, address p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(string,string,uint256,address)", p0, p1, p2, p3));
    }

    function log(string memory p0, string memory p1, string memory p2, uint256 p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(string,string,string,uint256)", p0, p1, p2, p3));
    }

    function log(string memory p0, string memory p1, string memory p2, string memory p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(string,string,string,string)", p0, p1, p2, p3));
    }

    function log(string memory p0, string memory p1, string memory p2, bool p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(string,string,string,bool)", p0, p1, p2, p3));
    }

    function log(string memory p0, string memory p1, string memory p2, address p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(string,string,string,address)", p0, p1, p2, p3));
    }

    function log(string memory p0, string memory p1, bool p2, uint256 p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(string,string,bool,uint256)", p0, p1, p2, p3));
    }

    function log(string memory p0, string memory p1, bool p2, string memory p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(string,string,bool,string)", p0, p1, p2, p3));
    }

    function log(string memory p0, string memory p1, bool p2, bool p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(string,string,bool,bool)", p0, p1, p2, p3));
    }

    function log(string memory p0, string memory p1, bool p2, address p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(string,string,bool,address)", p0, p1, p2, p3));
    }

    function log(string memory p0, string memory p1, address p2, uint256 p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(string,string,address,uint256)", p0, p1, p2, p3));
    }

    function log(string memory p0, string memory p1, address p2, string memory p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(string,string,address,string)", p0, p1, p2, p3));
    }

    function log(string memory p0, string memory p1, address p2, bool p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(string,string,address,bool)", p0, p1, p2, p3));
    }

    function log(string memory p0, string memory p1, address p2, address p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(string,string,address,address)", p0, p1, p2, p3));
    }

    function log(string memory p0, bool p1, uint256 p2, uint256 p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(string,bool,uint256,uint256)", p0, p1, p2, p3));
    }

    function log(string memory p0, bool p1, uint256 p2, string memory p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(string,bool,uint256,string)", p0, p1, p2, p3));
    }

    function log(string memory p0, bool p1, uint256 p2, bool p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(string,bool,uint256,bool)", p0, p1, p2, p3));
    }

    function log(string memory p0, bool p1, uint256 p2, address p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(string,bool,uint256,address)", p0, p1, p2, p3));
    }

    function log(string memory p0, bool p1, string memory p2, uint256 p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(string,bool,string,uint256)", p0, p1, p2, p3));
    }

    function log(string memory p0, bool p1, string memory p2, string memory p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(string,bool,string,string)", p0, p1, p2, p3));
    }

    function log(string memory p0, bool p1, string memory p2, bool p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(string,bool,string,bool)", p0, p1, p2, p3));
    }

    function log(string memory p0, bool p1, string memory p2, address p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(string,bool,string,address)", p0, p1, p2, p3));
    }

    function log(string memory p0, bool p1, bool p2, uint256 p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(string,bool,bool,uint256)", p0, p1, p2, p3));
    }

    function log(string memory p0, bool p1, bool p2, string memory p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(string,bool,bool,string)", p0, p1, p2, p3));
    }

    function log(string memory p0, bool p1, bool p2, bool p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(string,bool,bool,bool)", p0, p1, p2, p3));
    }

    function log(string memory p0, bool p1, bool p2, address p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(string,bool,bool,address)", p0, p1, p2, p3));
    }

    function log(string memory p0, bool p1, address p2, uint256 p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(string,bool,address,uint256)", p0, p1, p2, p3));
    }

    function log(string memory p0, bool p1, address p2, string memory p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(string,bool,address,string)", p0, p1, p2, p3));
    }

    function log(string memory p0, bool p1, address p2, bool p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(string,bool,address,bool)", p0, p1, p2, p3));
    }

    function log(string memory p0, bool p1, address p2, address p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(string,bool,address,address)", p0, p1, p2, p3));
    }

    function log(string memory p0, address p1, uint256 p2, uint256 p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(string,address,uint256,uint256)", p0, p1, p2, p3));
    }

    function log(string memory p0, address p1, uint256 p2, string memory p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(string,address,uint256,string)", p0, p1, p2, p3));
    }

    function log(string memory p0, address p1, uint256 p2, bool p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(string,address,uint256,bool)", p0, p1, p2, p3));
    }

    function log(string memory p0, address p1, uint256 p2, address p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(string,address,uint256,address)", p0, p1, p2, p3));
    }

    function log(string memory p0, address p1, string memory p2, uint256 p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(string,address,string,uint256)", p0, p1, p2, p3));
    }

    function log(string memory p0, address p1, string memory p2, string memory p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(string,address,string,string)", p0, p1, p2, p3));
    }

    function log(string memory p0, address p1, string memory p2, bool p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(string,address,string,bool)", p0, p1, p2, p3));
    }

    function log(string memory p0, address p1, string memory p2, address p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(string,address,string,address)", p0, p1, p2, p3));
    }

    function log(string memory p0, address p1, bool p2, uint256 p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(string,address,bool,uint256)", p0, p1, p2, p3));
    }

    function log(string memory p0, address p1, bool p2, string memory p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(string,address,bool,string)", p0, p1, p2, p3));
    }

    function log(string memory p0, address p1, bool p2, bool p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(string,address,bool,bool)", p0, p1, p2, p3));
    }

    function log(string memory p0, address p1, bool p2, address p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(string,address,bool,address)", p0, p1, p2, p3));
    }

    function log(string memory p0, address p1, address p2, uint256 p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(string,address,address,uint256)", p0, p1, p2, p3));
    }

    function log(string memory p0, address p1, address p2, string memory p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(string,address,address,string)", p0, p1, p2, p3));
    }

    function log(string memory p0, address p1, address p2, bool p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(string,address,address,bool)", p0, p1, p2, p3));
    }

    function log(string memory p0, address p1, address p2, address p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(string,address,address,address)", p0, p1, p2, p3));
    }

    function log(bool p0, uint256 p1, uint256 p2, uint256 p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(bool,uint256,uint256,uint256)", p0, p1, p2, p3));
    }

    function log(bool p0, uint256 p1, uint256 p2, string memory p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(bool,uint256,uint256,string)", p0, p1, p2, p3));
    }

    function log(bool p0, uint256 p1, uint256 p2, bool p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(bool,uint256,uint256,bool)", p0, p1, p2, p3));
    }

    function log(bool p0, uint256 p1, uint256 p2, address p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(bool,uint256,uint256,address)", p0, p1, p2, p3));
    }

    function log(bool p0, uint256 p1, string memory p2, uint256 p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(bool,uint256,string,uint256)", p0, p1, p2, p3));
    }

    function log(bool p0, uint256 p1, string memory p2, string memory p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(bool,uint256,string,string)", p0, p1, p2, p3));
    }

    function log(bool p0, uint256 p1, string memory p2, bool p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(bool,uint256,string,bool)", p0, p1, p2, p3));
    }

    function log(bool p0, uint256 p1, string memory p2, address p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(bool,uint256,string,address)", p0, p1, p2, p3));
    }

    function log(bool p0, uint256 p1, bool p2, uint256 p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(bool,uint256,bool,uint256)", p0, p1, p2, p3));
    }

    function log(bool p0, uint256 p1, bool p2, string memory p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(bool,uint256,bool,string)", p0, p1, p2, p3));
    }

    function log(bool p0, uint256 p1, bool p2, bool p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(bool,uint256,bool,bool)", p0, p1, p2, p3));
    }

    function log(bool p0, uint256 p1, bool p2, address p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(bool,uint256,bool,address)", p0, p1, p2, p3));
    }

    function log(bool p0, uint256 p1, address p2, uint256 p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(bool,uint256,address,uint256)", p0, p1, p2, p3));
    }

    function log(bool p0, uint256 p1, address p2, string memory p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(bool,uint256,address,string)", p0, p1, p2, p3));
    }

    function log(bool p0, uint256 p1, address p2, bool p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(bool,uint256,address,bool)", p0, p1, p2, p3));
    }

    function log(bool p0, uint256 p1, address p2, address p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(bool,uint256,address,address)", p0, p1, p2, p3));
    }

    function log(bool p0, string memory p1, uint256 p2, uint256 p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(bool,string,uint256,uint256)", p0, p1, p2, p3));
    }

    function log(bool p0, string memory p1, uint256 p2, string memory p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(bool,string,uint256,string)", p0, p1, p2, p3));
    }

    function log(bool p0, string memory p1, uint256 p2, bool p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(bool,string,uint256,bool)", p0, p1, p2, p3));
    }

    function log(bool p0, string memory p1, uint256 p2, address p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(bool,string,uint256,address)", p0, p1, p2, p3));
    }

    function log(bool p0, string memory p1, string memory p2, uint256 p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(bool,string,string,uint256)", p0, p1, p2, p3));
    }

    function log(bool p0, string memory p1, string memory p2, string memory p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(bool,string,string,string)", p0, p1, p2, p3));
    }

    function log(bool p0, string memory p1, string memory p2, bool p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(bool,string,string,bool)", p0, p1, p2, p3));
    }

    function log(bool p0, string memory p1, string memory p2, address p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(bool,string,string,address)", p0, p1, p2, p3));
    }

    function log(bool p0, string memory p1, bool p2, uint256 p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(bool,string,bool,uint256)", p0, p1, p2, p3));
    }

    function log(bool p0, string memory p1, bool p2, string memory p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(bool,string,bool,string)", p0, p1, p2, p3));
    }

    function log(bool p0, string memory p1, bool p2, bool p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(bool,string,bool,bool)", p0, p1, p2, p3));
    }

    function log(bool p0, string memory p1, bool p2, address p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(bool,string,bool,address)", p0, p1, p2, p3));
    }

    function log(bool p0, string memory p1, address p2, uint256 p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(bool,string,address,uint256)", p0, p1, p2, p3));
    }

    function log(bool p0, string memory p1, address p2, string memory p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(bool,string,address,string)", p0, p1, p2, p3));
    }

    function log(bool p0, string memory p1, address p2, bool p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(bool,string,address,bool)", p0, p1, p2, p3));
    }

    function log(bool p0, string memory p1, address p2, address p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(bool,string,address,address)", p0, p1, p2, p3));
    }

    function log(bool p0, bool p1, uint256 p2, uint256 p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(bool,bool,uint256,uint256)", p0, p1, p2, p3));
    }

    function log(bool p0, bool p1, uint256 p2, string memory p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(bool,bool,uint256,string)", p0, p1, p2, p3));
    }

    function log(bool p0, bool p1, uint256 p2, bool p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(bool,bool,uint256,bool)", p0, p1, p2, p3));
    }

    function log(bool p0, bool p1, uint256 p2, address p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(bool,bool,uint256,address)", p0, p1, p2, p3));
    }

    function log(bool p0, bool p1, string memory p2, uint256 p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(bool,bool,string,uint256)", p0, p1, p2, p3));
    }

    function log(bool p0, bool p1, string memory p2, string memory p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(bool,bool,string,string)", p0, p1, p2, p3));
    }

    function log(bool p0, bool p1, string memory p2, bool p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(bool,bool,string,bool)", p0, p1, p2, p3));
    }

    function log(bool p0, bool p1, string memory p2, address p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(bool,bool,string,address)", p0, p1, p2, p3));
    }

    function log(bool p0, bool p1, bool p2, uint256 p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(bool,bool,bool,uint256)", p0, p1, p2, p3));
    }

    function log(bool p0, bool p1, bool p2, string memory p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(bool,bool,bool,string)", p0, p1, p2, p3));
    }

    function log(bool p0, bool p1, bool p2, bool p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(bool,bool,bool,bool)", p0, p1, p2, p3));
    }

    function log(bool p0, bool p1, bool p2, address p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(bool,bool,bool,address)", p0, p1, p2, p3));
    }

    function log(bool p0, bool p1, address p2, uint256 p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(bool,bool,address,uint256)", p0, p1, p2, p3));
    }

    function log(bool p0, bool p1, address p2, string memory p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(bool,bool,address,string)", p0, p1, p2, p3));
    }

    function log(bool p0, bool p1, address p2, bool p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(bool,bool,address,bool)", p0, p1, p2, p3));
    }

    function log(bool p0, bool p1, address p2, address p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(bool,bool,address,address)", p0, p1, p2, p3));
    }

    function log(bool p0, address p1, uint256 p2, uint256 p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(bool,address,uint256,uint256)", p0, p1, p2, p3));
    }

    function log(bool p0, address p1, uint256 p2, string memory p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(bool,address,uint256,string)", p0, p1, p2, p3));
    }

    function log(bool p0, address p1, uint256 p2, bool p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(bool,address,uint256,bool)", p0, p1, p2, p3));
    }

    function log(bool p0, address p1, uint256 p2, address p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(bool,address,uint256,address)", p0, p1, p2, p3));
    }

    function log(bool p0, address p1, string memory p2, uint256 p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(bool,address,string,uint256)", p0, p1, p2, p3));
    }

    function log(bool p0, address p1, string memory p2, string memory p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(bool,address,string,string)", p0, p1, p2, p3));
    }

    function log(bool p0, address p1, string memory p2, bool p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(bool,address,string,bool)", p0, p1, p2, p3));
    }

    function log(bool p0, address p1, string memory p2, address p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(bool,address,string,address)", p0, p1, p2, p3));
    }

    function log(bool p0, address p1, bool p2, uint256 p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(bool,address,bool,uint256)", p0, p1, p2, p3));
    }

    function log(bool p0, address p1, bool p2, string memory p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(bool,address,bool,string)", p0, p1, p2, p3));
    }

    function log(bool p0, address p1, bool p2, bool p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(bool,address,bool,bool)", p0, p1, p2, p3));
    }

    function log(bool p0, address p1, bool p2, address p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(bool,address,bool,address)", p0, p1, p2, p3));
    }

    function log(bool p0, address p1, address p2, uint256 p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(bool,address,address,uint256)", p0, p1, p2, p3));
    }

    function log(bool p0, address p1, address p2, string memory p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(bool,address,address,string)", p0, p1, p2, p3));
    }

    function log(bool p0, address p1, address p2, bool p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(bool,address,address,bool)", p0, p1, p2, p3));
    }

    function log(bool p0, address p1, address p2, address p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(bool,address,address,address)", p0, p1, p2, p3));
    }

    function log(address p0, uint256 p1, uint256 p2, uint256 p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(address,uint256,uint256,uint256)", p0, p1, p2, p3));
    }

    function log(address p0, uint256 p1, uint256 p2, string memory p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(address,uint256,uint256,string)", p0, p1, p2, p3));
    }

    function log(address p0, uint256 p1, uint256 p2, bool p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(address,uint256,uint256,bool)", p0, p1, p2, p3));
    }

    function log(address p0, uint256 p1, uint256 p2, address p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(address,uint256,uint256,address)", p0, p1, p2, p3));
    }

    function log(address p0, uint256 p1, string memory p2, uint256 p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(address,uint256,string,uint256)", p0, p1, p2, p3));
    }

    function log(address p0, uint256 p1, string memory p2, string memory p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(address,uint256,string,string)", p0, p1, p2, p3));
    }

    function log(address p0, uint256 p1, string memory p2, bool p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(address,uint256,string,bool)", p0, p1, p2, p3));
    }

    function log(address p0, uint256 p1, string memory p2, address p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(address,uint256,string,address)", p0, p1, p2, p3));
    }

    function log(address p0, uint256 p1, bool p2, uint256 p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(address,uint256,bool,uint256)", p0, p1, p2, p3));
    }

    function log(address p0, uint256 p1, bool p2, string memory p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(address,uint256,bool,string)", p0, p1, p2, p3));
    }

    function log(address p0, uint256 p1, bool p2, bool p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(address,uint256,bool,bool)", p0, p1, p2, p3));
    }

    function log(address p0, uint256 p1, bool p2, address p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(address,uint256,bool,address)", p0, p1, p2, p3));
    }

    function log(address p0, uint256 p1, address p2, uint256 p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(address,uint256,address,uint256)", p0, p1, p2, p3));
    }

    function log(address p0, uint256 p1, address p2, string memory p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(address,uint256,address,string)", p0, p1, p2, p3));
    }

    function log(address p0, uint256 p1, address p2, bool p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(address,uint256,address,bool)", p0, p1, p2, p3));
    }

    function log(address p0, uint256 p1, address p2, address p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(address,uint256,address,address)", p0, p1, p2, p3));
    }

    function log(address p0, string memory p1, uint256 p2, uint256 p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(address,string,uint256,uint256)", p0, p1, p2, p3));
    }

    function log(address p0, string memory p1, uint256 p2, string memory p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(address,string,uint256,string)", p0, p1, p2, p3));
    }

    function log(address p0, string memory p1, uint256 p2, bool p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(address,string,uint256,bool)", p0, p1, p2, p3));
    }

    function log(address p0, string memory p1, uint256 p2, address p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(address,string,uint256,address)", p0, p1, p2, p3));
    }

    function log(address p0, string memory p1, string memory p2, uint256 p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(address,string,string,uint256)", p0, p1, p2, p3));
    }

    function log(address p0, string memory p1, string memory p2, string memory p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(address,string,string,string)", p0, p1, p2, p3));
    }

    function log(address p0, string memory p1, string memory p2, bool p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(address,string,string,bool)", p0, p1, p2, p3));
    }

    function log(address p0, string memory p1, string memory p2, address p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(address,string,string,address)", p0, p1, p2, p3));
    }

    function log(address p0, string memory p1, bool p2, uint256 p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(address,string,bool,uint256)", p0, p1, p2, p3));
    }

    function log(address p0, string memory p1, bool p2, string memory p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(address,string,bool,string)", p0, p1, p2, p3));
    }

    function log(address p0, string memory p1, bool p2, bool p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(address,string,bool,bool)", p0, p1, p2, p3));
    }

    function log(address p0, string memory p1, bool p2, address p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(address,string,bool,address)", p0, p1, p2, p3));
    }

    function log(address p0, string memory p1, address p2, uint256 p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(address,string,address,uint256)", p0, p1, p2, p3));
    }

    function log(address p0, string memory p1, address p2, string memory p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(address,string,address,string)", p0, p1, p2, p3));
    }

    function log(address p0, string memory p1, address p2, bool p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(address,string,address,bool)", p0, p1, p2, p3));
    }

    function log(address p0, string memory p1, address p2, address p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(address,string,address,address)", p0, p1, p2, p3));
    }

    function log(address p0, bool p1, uint256 p2, uint256 p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(address,bool,uint256,uint256)", p0, p1, p2, p3));
    }

    function log(address p0, bool p1, uint256 p2, string memory p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(address,bool,uint256,string)", p0, p1, p2, p3));
    }

    function log(address p0, bool p1, uint256 p2, bool p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(address,bool,uint256,bool)", p0, p1, p2, p3));
    }

    function log(address p0, bool p1, uint256 p2, address p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(address,bool,uint256,address)", p0, p1, p2, p3));
    }

    function log(address p0, bool p1, string memory p2, uint256 p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(address,bool,string,uint256)", p0, p1, p2, p3));
    }

    function log(address p0, bool p1, string memory p2, string memory p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(address,bool,string,string)", p0, p1, p2, p3));
    }

    function log(address p0, bool p1, string memory p2, bool p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(address,bool,string,bool)", p0, p1, p2, p3));
    }

    function log(address p0, bool p1, string memory p2, address p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(address,bool,string,address)", p0, p1, p2, p3));
    }

    function log(address p0, bool p1, bool p2, uint256 p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(address,bool,bool,uint256)", p0, p1, p2, p3));
    }

    function log(address p0, bool p1, bool p2, string memory p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(address,bool,bool,string)", p0, p1, p2, p3));
    }

    function log(address p0, bool p1, bool p2, bool p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(address,bool,bool,bool)", p0, p1, p2, p3));
    }

    function log(address p0, bool p1, bool p2, address p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(address,bool,bool,address)", p0, p1, p2, p3));
    }

    function log(address p0, bool p1, address p2, uint256 p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(address,bool,address,uint256)", p0, p1, p2, p3));
    }

    function log(address p0, bool p1, address p2, string memory p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(address,bool,address,string)", p0, p1, p2, p3));
    }

    function log(address p0, bool p1, address p2, bool p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(address,bool,address,bool)", p0, p1, p2, p3));
    }

    function log(address p0, bool p1, address p2, address p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(address,bool,address,address)", p0, p1, p2, p3));
    }

    function log(address p0, address p1, uint256 p2, uint256 p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(address,address,uint256,uint256)", p0, p1, p2, p3));
    }

    function log(address p0, address p1, uint256 p2, string memory p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(address,address,uint256,string)", p0, p1, p2, p3));
    }

    function log(address p0, address p1, uint256 p2, bool p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(address,address,uint256,bool)", p0, p1, p2, p3));
    }

    function log(address p0, address p1, uint256 p2, address p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(address,address,uint256,address)", p0, p1, p2, p3));
    }

    function log(address p0, address p1, string memory p2, uint256 p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(address,address,string,uint256)", p0, p1, p2, p3));
    }

    function log(address p0, address p1, string memory p2, string memory p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(address,address,string,string)", p0, p1, p2, p3));
    }

    function log(address p0, address p1, string memory p2, bool p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(address,address,string,bool)", p0, p1, p2, p3));
    }

    function log(address p0, address p1, string memory p2, address p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(address,address,string,address)", p0, p1, p2, p3));
    }

    function log(address p0, address p1, bool p2, uint256 p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(address,address,bool,uint256)", p0, p1, p2, p3));
    }

    function log(address p0, address p1, bool p2, string memory p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(address,address,bool,string)", p0, p1, p2, p3));
    }

    function log(address p0, address p1, bool p2, bool p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(address,address,bool,bool)", p0, p1, p2, p3));
    }

    function log(address p0, address p1, bool p2, address p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(address,address,bool,address)", p0, p1, p2, p3));
    }

    function log(address p0, address p1, address p2, uint256 p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(address,address,address,uint256)", p0, p1, p2, p3));
    }

    function log(address p0, address p1, address p2, string memory p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(address,address,address,string)", p0, p1, p2, p3));
    }

    function log(address p0, address p1, address p2, bool p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(address,address,address,bool)", p0, p1, p2, p3));
    }

    function log(address p0, address p1, address p2, address p3) internal pure {
        _sendLogPayload(abi.encodeWithSignature("log(address,address,address,address)", p0, p1, p2, p3));
    }

}

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

Contract Security Audit

Contract ABI

[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"titanx","type":"uint256"},{"indexed":true,"internalType":"uint256","name":"hlx","type":"uint256"},{"indexed":true,"internalType":"address","name":"caller","type":"address"}],"name":"BoughtAndBurned","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"titanx","type":"uint256"},{"indexed":true,"internalType":"uint256","name":"hlx","type":"uint256"},{"indexed":true,"internalType":"address","name":"caller","type":"address"}],"name":"CollectedFees","type":"event"},{"inputs":[],"name":"addLiquidity","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"burnLPHelios","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"buynBurn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"collectFees","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"createInitialLiquidity","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"createInitialPool","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getAddLiquidity","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getBuyAndBurnCap","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getBuyAndBurnFunds","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getBuynBurnEthInterval","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getBuynBurnInterval","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getCurrentEthPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getCurrentSqrtPriceX96","outputs":[{"internalType":"uint160","name":"","type":"uint160"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getCurrentTitanPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"getHlxBalance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getHlxBalance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getHlxFeesBuyAndBurnFunds","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getPoolAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getSlippage","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"poolAddress","type":"address"}],"name":"getSqrtPriceX96","outputs":[{"internalType":"uint160","name":"sqrtPriceX96","type":"uint160"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getTitanXBalance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"getTitanXBalance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getTitanXFeesBuyAndBurnFunds","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getTitanXPoolAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"getTokenInfo","outputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"liquidity","type":"uint256"},{"internalType":"int24","name":"tickLower","type":"int24"},{"internalType":"int24","name":"tickUpper","type":"int24"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getTokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getTotalHelioBuyAndBurn","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getTotalTitanXBuyAndBurn","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"getWethBalance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getWethBalance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getWethBuyAndBurnCap","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getlastBuynBurnCall","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"secs","type":"uint256"}],"name":"setBuynBurnInterval","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"setCapPerSwap","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"secs","type":"uint256"}],"name":"setETHBuynBurnInterval","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"setETHCapPerSwap","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"hlxAddress","type":"address"}],"name":"setHlxAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"poolAddress","type":"address"}],"name":"setHlxTitanPoolAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint32","name":"mins","type":"uint32"}],"name":"setMinutesTwa","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"ownerAddress","type":"address"}],"name":"setOwnerAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"setSlippage","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"totalHeliosLiquidSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"int256","name":"amount0Delta","type":"int256"},{"internalType":"int256","name":"amount1Delta","type":"int256"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"uniswapV3SwapCallback","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]

60a060405234801561001057600080fd5b50600160005542608052600380546a295be96e64066972000000600a55662386f26fc10000600b556005600e55610e10600f81815560109190915560ff60a01b196001600160a01b0319909216331791909116600160a01b179091556007805463ffffffff19169091179055608051613539610091600039506135396000f3fe6080604052600436106101fb5760003560e01c8063098dada51461027f5780630caf3edb1461029f578063110f18a0146102bf57806314bb2158146102df57806332432f8a1461030a578063331a6bf51461031f578063335bce0b1461033f5780633b20250c146103545780633bd32b16146103745780634088e6051461039457806346ceea53146103a95780634b409045146103cb578063665f8efb146103e057806367ceadab146103f5578063715018a61461040a57806371a0314b1461041f5780637aed38a8146104345780637fec4bed146104565780639125009d1461046b57806394747820146104805780639dd58b5814610495578063a76222af146104aa578063abb1dc44146104bf578063ad2eb63d146104e4578063b12bea12146104f9578063bee403b81461050e578063c179306c1461052e578063c7ee259114610543578063c879657214610558578063ca8f3bb11461056d578063cece50d414610582578063d098d320146105a2578063d25c565c146105c2578063d4a19116146105d7578063d6315990146105f9578063db293e6214610619578063e7a101c01461062e578063e8078d941461064e578063f029a2b214610663578063f0fa55a914610683578063f586c6d9146106a3578063fa461e33146106b8578063fc9cee3c146106d8578063ff3af7a6146106ed5761027a565b3661027a57336000805160206134c483398151915214610278576000805160206134c48339815191526001600160a01b031663d0e30db0346040518263ffffffff1660e01b81526004016000604051808303818588803b15801561025e57600080fd5b505af1158015610272573d6000803e3d6000fd5b50505050505b005b600080fd5b34801561028b57600080fd5b5061027861029a366004612f18565b610702565b3480156102ab57600080fd5b506102786102ba366004612f18565b61073a565b3480156102cb57600080fd5b506102786102da366004612cd9565b610769565b3480156102eb57600080fd5b506102f46107db565b604051610301919061305f565b60405180910390f35b34801561031657600080fd5b506102f46107e1565b34801561032b57600080fd5b5061027861033a366004612cd9565b610863565b34801561034b57600080fd5b506102786108d5565b34801561036057600080fd5b506102f461036f366004612cd9565b61093f565b34801561038057600080fd5b506102f461038f366004612cd9565b6109cb565b3480156103a057600080fd5b506102f46109fc565b3480156103b557600080fd5b506103be610a02565b6040516103019190612fd6565b3480156103d757600080fd5b50610278610a1a565b3480156103ec57600080fd5b506102f4610a75565b34801561040157600080fd5b506102f4610b02565b34801561041657600080fd5b50610278610b08565b34801561042b57600080fd5b50610278610b44565b34801561044057600080fd5b50610449610d10565b6040516103019190613054565b34801561046257600080fd5b506103be610d20565b34801561047757600080fd5b506102f4610daf565b34801561048c57600080fd5b506102f4610dfe565b3480156104a157600080fd5b506102f4610e47565b3480156104b657600080fd5b506102f4610e7b565b3480156104cb57600080fd5b506104d4610eaf565b604051610301949392919061343e565b3480156104f057600080fd5b506102f4610eda565b34801561050557600080fd5b506102f4610ee5565b34801561051a57600080fd5b50610278610529366004612f18565b610eeb565b34801561053a57600080fd5b50610278610f49565b34801561054f57600080fd5b506102f46110dc565b34801561056457600080fd5b506102786110e2565b34801561057957600080fd5b506102f461120e565b34801561058e57600080fd5b5061027861059d366004612f18565b611214565b3480156105ae57600080fd5b506103be6105bd366004612cd9565b611272565b3480156105ce57600080fd5b506102f4611359565b3480156105e357600080fd5b506105ec61135f565b6040516103019190613068565b34801561060557600080fd5b50610278610614366004612f95565b6113e8565b34801561062557600080fd5b506102f4611468565b34801561063a57600080fd5b50610278610649366004612cd9565b61146e565b34801561065a57600080fd5b506102786114e0565b34801561066f57600080fd5b506102f461067e366004612cd9565b61152b565b34801561068f57600080fd5b5061027861069e366004612f18565b61155f565b3480156106af57600080fd5b506103be6115bc565b3480156106c457600080fd5b506102786106d3366004612d34565b6115cb565b3480156106e457600080fd5b506102f46117b3565b3480156106f957600080fd5b506102f46117b9565b6003546001600160a01b031633146107355760405162461bcd60e51b815260040161072c90613225565b60405180910390fd5b600a55565b6003546001600160a01b031633146107645760405162461bcd60e51b815260040161072c90613225565b600b55565b6003546001600160a01b031633146107935760405162461bcd60e51b815260040161072c90613225565b6001600160a01b0381166107b95760405162461bcd60e51b815260040161072c906130c6565b600180546001600160a01b0319166001600160a01b0392909216919091179055565b60085490565b600154604080516318160ddd60e01b815290516000926001600160a01b0316916318160ddd916004808301926020929190829003018186803b15801561082657600080fd5b505afa15801561083a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061085e9190612f30565b905090565b6003546001600160a01b0316331461088d5760405162461bcd60e51b815260040161072c90613225565b6001600160a01b0381166108b35760405162461bcd60e51b815260040161072c906130c6565b600380546001600160a01b0319166001600160a01b0392909216919091179055565b600160009054906101000a90046001600160a01b03166001600160a01b031663bb88603c6040518163ffffffff1660e01b8152600401600060405180830381600087803b15801561092557600080fd5b505af1158015610939573d6000803e3d6000fd5b50505050565b6040516370a0823160e01b81526000906000805160206134c4833981519152906370a0823190610973908590600401612fd6565b60206040518083038186803b15801561098b57600080fd5b505afa15801561099f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109c39190612f30565b90505b919050565b6001546040516370a0823160e01b81526000916001600160a01b0316906370a0823190610973908590600401612fd6565b60065490565b73c45a81bc23a64ea556ab4cdf08a86b61cdceea8b90565b6002546001600160a01b031615610a435760405162461bcd60e51b815260040161072c9061324c565b6001546001600160a01b0316610a6b5760405162461bcd60e51b815260040161072c9061309b565b610a736117bf565b565b6002546000908190610a8f906001600160a01b0316611272565b6001600160a01b03169050808002670de0b6b3a76400006000610ab78383600160c01b6118c0565b6001549091506001600160a01b03166000805160206134a483398151915210610ae05780610af9565b806a0c097ce7bc90715b34b9f160241b81610af757fe5b045b94505050505090565b600f5490565b6003546001600160a01b03163314610b325760405162461bcd60e51b815260040161072c90613225565b600380546001600160a01b0319169055565b6002546001600160a01b0316610b6c5760405162461bcd60e51b815260040161072c906131ff565b6001600254600160a01b900460ff166001811115610b8657fe5b1415610b9157610a73565b6040516370a0823160e01b8152676765c793fa10079d601f1b906000805160206134a4833981519152906370a0823190610bcf903090600401612fd6565b60206040518083038186803b158015610be757600080fd5b505afa158015610bfb573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c1f9190612f30565b1015610c3d5760405162461bcd60e51b815260040161072c9061313b565b6002805460ff60a01b1916600160a01b179055600154610c77906001600160a01b03166000805160206134e4833981519152600019611970565b610ca06000805160206134a48339815191526000805160206134e4833981519152600019611970565b600160009054906101000a90046001600160a01b03166001600160a01b031663e3d3227d6040518163ffffffff1660e01b8152600401600060405180830381600087803b158015610cf057600080fd5b505af1158015610d04573d6000803e3d6000fd5b50505050610a73611abe565b600354600160a01b900460ff1690565b60025460408051633850c7bd60e01b815290516000926001600160a01b03169183918391633850c7bd9160048083019260e0929190829003018186803b158015610d6957600080fd5b505afa158015610d7d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610da19190612e78565b509497505050505050505090565b600080610dcf73c45a81bc23a64ea556ab4cdf08a86b61cdceea8b611272565b6001600160a01b03169050808002670de0b6b3a76400006000610df78383600160c01b6118c0565b9050610ae0565b6001546040516370a0823160e01b81526000916001600160a01b0316906370a0823190610e2f903090600401612fd6565b60206040518083038186803b15801561082657600080fd5b6040516370a0823160e01b81526000906000805160206134c4833981519152906370a0823190610e2f903090600401612fd6565b6040516370a0823160e01b81526000906000805160206134a4833981519152906370a0823190610e2f903090600401612fd6565b6011546012546013546001600160501b0390921691600281810b9163010000009004900b5b90919293565b600061085e3061152b565b600b5490565b6003546001600160a01b03163314610f155760405162461bcd60e51b815260040161072c90613225565b603c8110158015610f28575061a8c08111155b610f445760405162461bcd60e51b815260040161072c906131da565b600f55565b610f51611c41565b333214610f705760405162461bcd60e51b815260040161072c90613225565b6001600254600160a01b900460ff166001811115610f8a57fe5b14610fa75760405162461bcd60e51b815260040161072c90613274565b600f54600c54420311610fcc5760405162461bcd60e51b815260040161072c906131b4565b42600c556000610fdb3061152b565b600a549091506000610feb610e47565b90508183108015610ffc5750600081115b801561100d5750601054600d544203115b156110585742600d55600b548111156110255750600b545b61104c6000805160206134c48339815191526000805160206134a483398151915283611ca0565b6110553061152b565b92505b826110755760405162461bcd60e51b815260040161072c906130ee565b81831115611081578192505b600154620f4240610ce48502049384900393906110b7906000805160206134a4833981519152906001600160a01b031686611ca0565b6110d06000805160206134a48339815191523383611ee8565b50505050610a7361202f565b600c5490565b6110ea611c41565b6000806110f5612036565b600154919350915060009081906001600160a01b03166000805160206134a4833981519152101561112a575081905082611130565b50829050815b600354600160a01b900460ff16156111ba57600061114c610a75565b9050821580159061115c57508115155b156111b4576001546001600160a01b03166000805160206134a483398151915210156111925761118d8284836120f7565b6111b4565b6111b48383836a0c097ce7bc90715b34b9f160241b816111ae57fe5b046120f7565b506111d3565b6111c26108d5565b600880548301905560098054820190555b6040513390839083907fb3ff07f4fe20273bbc264b773aacc6325987f8b0b1aa4c5bdfe5b75fdbd1284c90600090a450505050610a7361202f565b60095490565b6003546001600160a01b0316331461123e5760405162461bcd60e51b815260040161072c90613225565b603c8110158015611251575061a8c08111155b61126d5760405162461bcd60e51b815260040161072c906131da565b601055565b60075460009063ffffffff16603c028161128b8461223a565b90508163ffffffff168163ffffffff1610156112a5578091505b63ffffffff8216611336576000849050806001600160a01b0316633850c7bd6040518163ffffffff1660e01b815260040160e06040518083038186803b1580156112ee57600080fd5b505afa158015611302573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113269190612e78565b5094985061135295505050505050565b60006113428584612409565b50905061134e81612773565b9350505b5050919050565b60105490565b60405163c87b56dd60e01b81526060906000805160206134e48339815191529063c87b56dd906113949060019060040161305f565b60006040518083038186803b1580156113ac57600080fd5b505afa1580156113c0573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261085e9190810190612dae565b6003546001600160a01b031633146114125760405162461bcd60e51b815260040161072c90613225565b60058163ffffffff16101580156114305750603c8163ffffffff1611155b61144c5760405162461bcd60e51b815260040161072c90613190565b6007805463ffffffff191663ffffffff92909216919091179055565b60055490565b6003546001600160a01b031633146114985760405162461bcd60e51b815260040161072c90613225565b6001600160a01b0381166114be5760405162461bcd60e51b815260040161072c906130c6565b600280546001600160a01b0319166001600160a01b0392909216919091179055565b6003546001600160a01b0316331461150a5760405162461bcd60e51b815260040161072c90613225565b6003805460ff60a01b198116600160a01b9182900460ff1615909102179055565b6040516370a0823160e01b81526000906000805160206134a4833981519152906370a0823190610973908590600401612fd6565b6003546001600160a01b031633146115895760405162461bcd60e51b815260040161072c90613225565b6001811015801561159b5750600f8111155b6115b75760405162461bcd60e51b815260040161072c90613118565b600e55565b6002546001600160a01b031690565b60008413806115da5750600083135b6115f65760405162461bcd60e51b815260040161072c906132e3565b3373c45a81bc23a64ea556ab4cdf08a86b61cdceea8b14156116d7576000611652731f98431c8ad98523631ae4a59f267346ea31f9846000805160206134c48339815191526000805160206134a4833981519152612710612a9a565b90506001600160a01b03811673c45a81bc23a64ea556ab4cdf08a86b61cdceea8b146116905760405162461bcd60e51b815260040161072c906132c0565b6116b86000805160206134c483398151915233600088136116b157866116b3565b875b611ee8565b600085136116c657836116c8565b845b60048054909101905550610939565b6002546001600160a01b031633141561179b5760015460009061172b90731f98431c8ad98523631ae4a59f267346ea31f984906000805160206134a4833981519152906001600160a01b0316612710612a9a565b6002549091506001600160a01b0380831691161461175b5760405162461bcd60e51b815260040161072c906132c0565b61177c6000805160206134a483398151915233600088136116b157866116b3565b6000851361178a578361178c565b845b60058054909101905550610939565b60405162461bcd60e51b815260040161072c9061329b565b600e5490565b600a5490565b6000806117ca612ab9565b505060015491935091506000805160206134e4833981519152906313ead5629084908490612710906001600160a01b03166000805160206134a48339815191521061181f5766194c583ada5b53602d1b61182b565b66143d136248490f602a1b5b6040518563ffffffff1660e01b815260040161184a9493929190613024565b602060405180830381600087803b15801561186457600080fd5b505af1158015611878573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061189c9190612cf5565b600280546001600160a01b0319166001600160a01b03929092169190911790555050565b60008080600019858709868602925082811090839003039050806118f657600084116118eb57600080fd5b508290049050611969565b80841161190257600080fd5b6000848688096000868103871696879004966002600389028118808a02820302808a02820302808a02820302808a02820302808a02820302808a02909103029181900381900460010186841190950394909402919094039290920491909117919091029150505b9392505050565b604080516001600160a01b038481166024830152604480830185905283518084039091018152606490920183526020820180516001600160e01b031663095ea7b360e01b1781529251825160009485949389169392918291908083835b602083106119ec5780518252601f1990920191602091820191016119cd565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114611a4e576040519150601f19603f3d011682016040523d82523d6000602084013e611a53565b606091505b5091509150818015611a81575080511580611a815750808060200190516020811015611a7e57600080fd5b50515b611ab7576040805162461bcd60e51b8152602060048201526002602482015261534160f01b604482015290519081900360640190fd5b5050505050565b600080600080611acc612ab9565b93509350935093506000604051806101600160405280866001600160a01b03168152602001856001600160a01b0316815260200161271062ffffff168152602001620d899f1960020b8152602001620d89a060020b8152602001848152602001838152602001606485605a0281611b3f57fe5b0481526020016064605a8502048152306020820152610258420160409182015251634418b22b60e11b815290915060009081906000805160206134e483398151915290638831645690611b96908690600401613390565b608060405180830381600087803b158015611bb057600080fd5b505af1158015611bc4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611be89190612f48565b5050601180546001600160501b0319166001600160501b0393909316929092179091556001600160801b031660125550506013805462ffffff191662f276601765ffffff0000001916616c4d601d1b1790555050505050565b60026000541415611c99576040805162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b6002600055565b600060646001600160a01b0385166000805160206134c483398151915214611ccf57611cca610a75565b611cd7565b611cd7610daf565b600e5460640384670de0b6b3a7640000020281611cf057fe5b0481611cf857fe5b04905060006001600160a01b0385166000805160206134c483398151915214611d2c576002546001600160a01b0316611d42565b73c45a81bc23a64ea556ab4cdf08a86b61cdceea8b5b90506000806001600160a01b038084169063128acb08903090898116908b16108881611d825773fffd8963efd1fc6a506488495d951d5263988d25611d89565b6401000276a45b6040518563ffffffff1660e01b8152600401611da89493929190612fea565b6040805180830381600087803b158015611dc157600080fd5b505af1158015611dd5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611df99190612d11565b915091506000866001600160a01b0316886001600160a01b031610611e31576000831215611e2a5782600003611e2c565b825b611e45565b6000821215611e435781600003611e45565b815b905084811015611e675760405162461bcd60e51b815260040161072c90613165565b6001546001600160a01b0388811691161415611ede576000611e87610dfe565b90506000828211611e985781611e9a565b825b60068054820190559050611eac6108d5565b604051339082908a907f1b6fe3d614107093562b62b9236e265cac820f430060c5eb674a70824a7435db90600090a450505b5050505050505050565b604080516001600160a01b038481166024830152604480830185905283518084039091018152606490920183526020820180516001600160e01b031663a9059cbb60e01b1781529251825160009485949389169392918291908083835b60208310611f645780518252601f199092019160209182019101611f45565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114611fc6576040519150601f19603f3d011682016040523d82523d6000602084013e611fcb565b606091505b5091509150818015611ff9575080511580611ff95750808060200190516020811015611ff657600080fd5b50515b611ab7576040805162461bcd60e51b815260206004820152600260248201526114d560f21b604482015290519081900360640190fd5b6001600055565b604080516080810182526011546001600160501b031681523060208201526001600160801b038183018190526060820152905163fc6f786560e01b815260009182916000805160206134e48339815191529063fc6f78659061209c908490600401613309565b6040805180830381600087803b1580156120b557600080fd5b505af11580156120c9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120ed9190612f83565b9094909350915050565b600061210c8383670de0b6b3a76400006118c0565b9050600061212385670de0b6b3a7640000856118c0565b905060008286106121345782612136565b855b905060008286106121475782612149565b855b6040805160c0810182526011546001600160501b03168152602081018590528082018390526064605a80870282900460608401528402046080820152426102580160a0820152905163219f5d1760e01b8152919250906000906000805160206134e48339815191529063219f5d17906121c690859060040161334c565b606060405180830381600087803b1580156121e057600080fd5b505af11580156121f4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906122189190612e44565b5050601280546001600160801b03929092169091019055505050505050505050565b6000806000836001600160a01b0316633850c7bd6040518163ffffffff1660e01b815260040160e06040518083038186803b15801561227857600080fd5b505afa15801561228c573d6000803e3d6000fd5b505050506040513d60e08110156122a257600080fd5b506040810151606090910151909250905061ffff81166122ee576040805162461bcd60e51b81526020600482015260026024820152614e4960f01b604482015290519081900360640190fd5b600080856001600160a01b031663252c09d78461ffff168660010161ffff168161231457fe5b066040518263ffffffff1660e01b8152600401808261ffff16815260200191505060806040518083038186803b15801561234d57600080fd5b505afa158015612361573d6000803e3d6000fd5b505050506040513d608081101561237757600080fd5b5080516060909101519092509050806123fe57856001600160a01b031663252c09d760006040518263ffffffff1660e01b81526004018082815260200191505060806040518083038186803b1580156123cf57600080fd5b505afa1580156123e3573d6000803e3d6000fd5b505050506040513d60808110156123f957600080fd5b505191505b504203949350505050565b60008063ffffffff8316612449576040805162461bcd60e51b8152602060048201526002602482015261042560f41b604482015290519081900360640190fd5b604080516002808252606082018352600092602083019080368337019050509050838160008151811061247857fe5b602002602001019063ffffffff16908163ffffffff16815250506000816001815181106124a157fe5b63ffffffff90921660209283029190910182015260405163883bdbfd60e01b81526004810182815283516024830152835160009384936001600160a01b038b169363883bdbfd9388939192839260449091019185820191028083838b5b838110156125165781810151838201526020016124fe565b505050509050019250505060006040518083038186803b15801561253957600080fd5b505afa15801561254d573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604090815281101561257657600080fd5b8101908080516040519392919084600160201b82111561259557600080fd5b9083019060208201858111156125aa57600080fd5b82518660208202830111600160201b821117156125c657600080fd5b82525081516020918201928201910280838360005b838110156125f35781810151838201526020016125db565b5050505090500160405260200180516040519392919084600160201b82111561261b57600080fd5b90830190602082018581111561263057600080fd5b82518660208202830111600160201b8211171561264c57600080fd5b82525081516020918201928201910280838360005b83811015612679578181015183820152602001612661565b505050509050016040525050509150915060008260008151811061269957fe5b6020026020010151836001815181106126ae57fe5b60200260200101510390506000826000815181106126c857fe5b6020026020010151836001815181106126dd57fe5b60200260200101510390508763ffffffff168260060b816126fa57fe5b05965060008260060b12801561272457508763ffffffff168260060b8161271d57fe5b0760060b15155b1561273157600019909601955b63ffffffff88166001600160a01b0302600160201b600160c01b03602083901b166001600160c01b0382168161276357fe5b0496505050505050509250929050565b60008060008360020b1261278a578260020b612792565b8260020b6000035b9050620d89e88111156127d0576040805162461bcd60e51b81526020600482015260016024820152601560fa1b604482015290519081900360640190fd5b6000600182166127e457600160801b6127f6565b6ffffcb933bd6fad37aa2d162d1a5940015b6001600160881b031690506002821615612820576ffff97272373d413259a46990580e213a0260801c5b600482161561283f576ffff2e50f5f656932ef12357cf3c7fdcc0260801c5b600882161561285e576fffe5caca7e10e4e61c3624eaa0941cd00260801c5b601082161561287d576fffcb9843d60f6159c9db58835c9266440260801c5b602082161561289c576fff973b41fa98c081472e6896dfb254c00260801c5b60408216156128bb576fff2ea16466c96a3843ec78b326b528610260801c5b60808216156128da576ffe5dee046a99a2a811c461f1969c30530260801c5b6101008216156128fa576ffcbe86c7900a88aedcffc83b479aa3a40260801c5b61020082161561291a576ff987a7253ac413176f2b074cf7815e540260801c5b61040082161561293a576ff3392b0822b70005940c7a398e4b70f30260801c5b61080082161561295a576fe7159475a2c29b7443b29c7fa6e889d90260801c5b61100082161561297a576fd097f3bdfd2022b8845ad8f792aa58250260801c5b61200082161561299a576fa9f746462d870fdf8a65dc1f90e061e50260801c5b6140008216156129ba576f70d869a156d2a1b890bb3df62baf32f70260801c5b6180008216156129da576f31be135f97d08fd981231505542fcfa60260801c5b620100008216156129fb576f09aa508b5b7a84e1c677de54f3e99bc90260801c5b62020000821615612a1b576e5d6af8dedb81196699c329225ee6040260801c5b62040000821615612a3a576d2216e584f5fa1ea926041bedfe980260801c5b62080000821615612a57576b048a170391f7dc42444e8fa20260801c5b60008460020b1315612a72578060001981612a6e57fe5b0490505b600160201b810615612a85576001612a88565b60005b60ff16602082901c0192505050919050565b6000612ab085612aab868686612b32565b612b88565b95945050505050565b6001546000805160206134a4833981519152906001600160a01b0316676765c793fa10079d601f1b6714adf4b7320334b9601e1b83831015610ed45750506001546001600160a01b0316926000805160206134a483398151915292506714adf4b7320334b9601e1b9150676765c793fa10079d601f1b90565b612b3a612c90565b826001600160a01b0316846001600160a01b03161115612b58579192915b50604080516060810182526001600160a01b03948516815292909316602083015262ffffff169181019190915290565b6000612b948383612bb1565b9050336001600160a01b03821614612bab57600080fd5b92915050565b600081602001516001600160a01b031682600001516001600160a01b031610612bd957600080fd5b50805160208083015160409384015184516001600160a01b0394851681850152939091168385015262ffffff166060808401919091528351808403820181526080840185528051908301206001600160f81b031960a085015294901b6001600160601b03191660a183015260b58201939093527fe34f199b19b2b4f47f68442619d555527d244f78a3297ea89325f843f87b8b5460d5808301919091528251808303909101815260f5909101909152805191012090565b604080516060810182526000808252602082018190529181019190915290565b80516001600160801b03811681146109c657600080fd5b805161ffff811681146109c657600080fd5b600060208284031215612cea578081fd5b81356119698161348b565b600060208284031215612d06578081fd5b81516119698161348b565b60008060408385031215612d23578081fd5b505080516020909101519092909150565b60008060008060608587031215612d49578182fd5b843593506020850135925060408501356001600160401b0380821115612d6d578384fd5b818701915087601f830112612d80578384fd5b813581811115612d8e578485fd5b886020828501011115612d9f578485fd5b95989497505060200194505050565b600060208284031215612dbf578081fd5b81516001600160401b0380821115612dd5578283fd5b818401915084601f830112612de8578283fd5b815181811115612df457fe5b604051601f8201601f191681016020018381118282101715612e1257fe5b604052818152838201602001871015612e29578485fd5b612e3a82602083016020870161345f565b9695505050505050565b600080600060608486031215612e58578283fd5b612e6184612cb0565b925060208401519150604084015190509250925092565b600080600080600080600060e0888a031215612e92578283fd5b8751612e9d8161348b565b8097505060208801518060020b8114612eb4578384fd5b9550612ec260408901612cc7565b9450612ed060608901612cc7565b9350612ede60808901612cc7565b925060a088015160ff81168114612ef3578283fd5b60c08901519092508015158114612f08578182fd5b8091505092959891949750929550565b600060208284031215612f29578081fd5b5035919050565b600060208284031215612f41578081fd5b5051919050565b60008060008060808587031215612f5d578081fd5b84519350612f6d60208601612cb0565b6040860151606090960151949790965092505050565b60008060408385031215612d23578182fd5b600060208284031215612fa6578081fd5b813563ffffffff81168114611969578182fd5b6001600160a01b03169052565b60020b9052565b62ffffff169052565b6001600160a01b0391909116815260200190565b6001600160a01b03948516815292151560208401526040830191909152909116606082015260a06080820181905260009082015260c00190565b6001600160a01b039485168152928416602084015262ffffff919091166040830152909116606082015260800190565b901515815260200190565b90815260200190565b600060208252825180602084015261308781604085016020870161345f565b601f01601f19169190910160400192915050565b602080825260119082015270496e76616c6964486c784164647265737360781b604082015260600190565b6020808252600e908201526d496e76616c69644164647265737360901b604082015260600190565b60208082526010908201526f4e6f417661696c61626c6546756e647360801b604082015260600190565b602080825260099082015268312d31355f4f6e6c7960b81b604082015260600190565b60208082526010908201526f09ccacac8409adee4ca40a8d2e8c2dcb60831b604082015260600190565b602080825260119082015270151bdbd31a5d1d1b19549958d95a5d9959607a1b604082015260600190565b6020808252600a9082015269356d2d3168206f6e6c7960b01b604082015260600190565b6020808252600c908201526b125b9d195c9d985b15d85a5d60a21b604082015260600190565b6020808252600b908201526a316d2d3132685f4f6e6c7960a81b604082015260600190565b6020808252600c908201526b4e6f506f6f6c45786973747360a01b604082015260600190565b6020808252600d908201526c24b73b30b634b221b0b63632b960991b604082015260600190565b6020808252600e908201526d141bdbdb12185cd0dc99585d195960921b604082015260600190565b6020808252600d908201526c04e656564496e697469616c4c5609c1b604082015260600190565b6020808252600b908201526a155b9adb9bdddb941bdbdb60aa1b604082015260600190565b60208082526009908201526815dc9bdb99d41bdbdb60ba1b604082015260600190565b6020808252600c908201526b0496e76616c696420537761760a41b604082015260600190565b815181526020808301516001600160a01b0316908201526040808301516001600160801b0390811691830191909152606092830151169181019190915260800190565b600060c082019050825182526020830151602083015260408301516040830152606083015160608301526080830151608083015260a083015160a083015292915050565b6000610160820190506133a4828451612fb9565b60208301516133b66020840182612fb9565b5060408301516133c96040840182612fcd565b5060608301516133dc6060840182612fc6565b5060808301516133ef6080840182612fc6565b5060a083015160a083015260c083015160c083015260e083015160e08301526101008084015181840152506101208084015161342d82850182612fb9565b505061014092830151919092015290565b9384526020840192909252600290810b60408401520b606082015260800190565b60005b8381101561347a578181015183820152602001613462565b838111156109395750506000910152565b6001600160a01b03811681146134a057600080fd5b5056fe000000000000000000000000f19308f923582a6f7c465e5ce7a9dc1bec6665b1000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2000000000000000000000000c36442b4a4522e871399cd717abdd847ab11fe88a2646970667358221220653388cd753af50354195108b9a8f1764f0dcc09200e89a32482ec3c15b1311d64736f6c63430007060033

Deployed Bytecode

0x6080604052600436106101fb5760003560e01c8063098dada51461027f5780630caf3edb1461029f578063110f18a0146102bf57806314bb2158146102df57806332432f8a1461030a578063331a6bf51461031f578063335bce0b1461033f5780633b20250c146103545780633bd32b16146103745780634088e6051461039457806346ceea53146103a95780634b409045146103cb578063665f8efb146103e057806367ceadab146103f5578063715018a61461040a57806371a0314b1461041f5780637aed38a8146104345780637fec4bed146104565780639125009d1461046b57806394747820146104805780639dd58b5814610495578063a76222af146104aa578063abb1dc44146104bf578063ad2eb63d146104e4578063b12bea12146104f9578063bee403b81461050e578063c179306c1461052e578063c7ee259114610543578063c879657214610558578063ca8f3bb11461056d578063cece50d414610582578063d098d320146105a2578063d25c565c146105c2578063d4a19116146105d7578063d6315990146105f9578063db293e6214610619578063e7a101c01461062e578063e8078d941461064e578063f029a2b214610663578063f0fa55a914610683578063f586c6d9146106a3578063fa461e33146106b8578063fc9cee3c146106d8578063ff3af7a6146106ed5761027a565b3661027a57336000805160206134c483398151915214610278576000805160206134c48339815191526001600160a01b031663d0e30db0346040518263ffffffff1660e01b81526004016000604051808303818588803b15801561025e57600080fd5b505af1158015610272573d6000803e3d6000fd5b50505050505b005b600080fd5b34801561028b57600080fd5b5061027861029a366004612f18565b610702565b3480156102ab57600080fd5b506102786102ba366004612f18565b61073a565b3480156102cb57600080fd5b506102786102da366004612cd9565b610769565b3480156102eb57600080fd5b506102f46107db565b604051610301919061305f565b60405180910390f35b34801561031657600080fd5b506102f46107e1565b34801561032b57600080fd5b5061027861033a366004612cd9565b610863565b34801561034b57600080fd5b506102786108d5565b34801561036057600080fd5b506102f461036f366004612cd9565b61093f565b34801561038057600080fd5b506102f461038f366004612cd9565b6109cb565b3480156103a057600080fd5b506102f46109fc565b3480156103b557600080fd5b506103be610a02565b6040516103019190612fd6565b3480156103d757600080fd5b50610278610a1a565b3480156103ec57600080fd5b506102f4610a75565b34801561040157600080fd5b506102f4610b02565b34801561041657600080fd5b50610278610b08565b34801561042b57600080fd5b50610278610b44565b34801561044057600080fd5b50610449610d10565b6040516103019190613054565b34801561046257600080fd5b506103be610d20565b34801561047757600080fd5b506102f4610daf565b34801561048c57600080fd5b506102f4610dfe565b3480156104a157600080fd5b506102f4610e47565b3480156104b657600080fd5b506102f4610e7b565b3480156104cb57600080fd5b506104d4610eaf565b604051610301949392919061343e565b3480156104f057600080fd5b506102f4610eda565b34801561050557600080fd5b506102f4610ee5565b34801561051a57600080fd5b50610278610529366004612f18565b610eeb565b34801561053a57600080fd5b50610278610f49565b34801561054f57600080fd5b506102f46110dc565b34801561056457600080fd5b506102786110e2565b34801561057957600080fd5b506102f461120e565b34801561058e57600080fd5b5061027861059d366004612f18565b611214565b3480156105ae57600080fd5b506103be6105bd366004612cd9565b611272565b3480156105ce57600080fd5b506102f4611359565b3480156105e357600080fd5b506105ec61135f565b6040516103019190613068565b34801561060557600080fd5b50610278610614366004612f95565b6113e8565b34801561062557600080fd5b506102f4611468565b34801561063a57600080fd5b50610278610649366004612cd9565b61146e565b34801561065a57600080fd5b506102786114e0565b34801561066f57600080fd5b506102f461067e366004612cd9565b61152b565b34801561068f57600080fd5b5061027861069e366004612f18565b61155f565b3480156106af57600080fd5b506103be6115bc565b3480156106c457600080fd5b506102786106d3366004612d34565b6115cb565b3480156106e457600080fd5b506102f46117b3565b3480156106f957600080fd5b506102f46117b9565b6003546001600160a01b031633146107355760405162461bcd60e51b815260040161072c90613225565b60405180910390fd5b600a55565b6003546001600160a01b031633146107645760405162461bcd60e51b815260040161072c90613225565b600b55565b6003546001600160a01b031633146107935760405162461bcd60e51b815260040161072c90613225565b6001600160a01b0381166107b95760405162461bcd60e51b815260040161072c906130c6565b600180546001600160a01b0319166001600160a01b0392909216919091179055565b60085490565b600154604080516318160ddd60e01b815290516000926001600160a01b0316916318160ddd916004808301926020929190829003018186803b15801561082657600080fd5b505afa15801561083a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061085e9190612f30565b905090565b6003546001600160a01b0316331461088d5760405162461bcd60e51b815260040161072c90613225565b6001600160a01b0381166108b35760405162461bcd60e51b815260040161072c906130c6565b600380546001600160a01b0319166001600160a01b0392909216919091179055565b600160009054906101000a90046001600160a01b03166001600160a01b031663bb88603c6040518163ffffffff1660e01b8152600401600060405180830381600087803b15801561092557600080fd5b505af1158015610939573d6000803e3d6000fd5b50505050565b6040516370a0823160e01b81526000906000805160206134c4833981519152906370a0823190610973908590600401612fd6565b60206040518083038186803b15801561098b57600080fd5b505afa15801561099f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109c39190612f30565b90505b919050565b6001546040516370a0823160e01b81526000916001600160a01b0316906370a0823190610973908590600401612fd6565b60065490565b73c45a81bc23a64ea556ab4cdf08a86b61cdceea8b90565b6002546001600160a01b031615610a435760405162461bcd60e51b815260040161072c9061324c565b6001546001600160a01b0316610a6b5760405162461bcd60e51b815260040161072c9061309b565b610a736117bf565b565b6002546000908190610a8f906001600160a01b0316611272565b6001600160a01b03169050808002670de0b6b3a76400006000610ab78383600160c01b6118c0565b6001549091506001600160a01b03166000805160206134a483398151915210610ae05780610af9565b806a0c097ce7bc90715b34b9f160241b81610af757fe5b045b94505050505090565b600f5490565b6003546001600160a01b03163314610b325760405162461bcd60e51b815260040161072c90613225565b600380546001600160a01b0319169055565b6002546001600160a01b0316610b6c5760405162461bcd60e51b815260040161072c906131ff565b6001600254600160a01b900460ff166001811115610b8657fe5b1415610b9157610a73565b6040516370a0823160e01b8152676765c793fa10079d601f1b906000805160206134a4833981519152906370a0823190610bcf903090600401612fd6565b60206040518083038186803b158015610be757600080fd5b505afa158015610bfb573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c1f9190612f30565b1015610c3d5760405162461bcd60e51b815260040161072c9061313b565b6002805460ff60a01b1916600160a01b179055600154610c77906001600160a01b03166000805160206134e4833981519152600019611970565b610ca06000805160206134a48339815191526000805160206134e4833981519152600019611970565b600160009054906101000a90046001600160a01b03166001600160a01b031663e3d3227d6040518163ffffffff1660e01b8152600401600060405180830381600087803b158015610cf057600080fd5b505af1158015610d04573d6000803e3d6000fd5b50505050610a73611abe565b600354600160a01b900460ff1690565b60025460408051633850c7bd60e01b815290516000926001600160a01b03169183918391633850c7bd9160048083019260e0929190829003018186803b158015610d6957600080fd5b505afa158015610d7d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610da19190612e78565b509497505050505050505090565b600080610dcf73c45a81bc23a64ea556ab4cdf08a86b61cdceea8b611272565b6001600160a01b03169050808002670de0b6b3a76400006000610df78383600160c01b6118c0565b9050610ae0565b6001546040516370a0823160e01b81526000916001600160a01b0316906370a0823190610e2f903090600401612fd6565b60206040518083038186803b15801561082657600080fd5b6040516370a0823160e01b81526000906000805160206134c4833981519152906370a0823190610e2f903090600401612fd6565b6040516370a0823160e01b81526000906000805160206134a4833981519152906370a0823190610e2f903090600401612fd6565b6011546012546013546001600160501b0390921691600281810b9163010000009004900b5b90919293565b600061085e3061152b565b600b5490565b6003546001600160a01b03163314610f155760405162461bcd60e51b815260040161072c90613225565b603c8110158015610f28575061a8c08111155b610f445760405162461bcd60e51b815260040161072c906131da565b600f55565b610f51611c41565b333214610f705760405162461bcd60e51b815260040161072c90613225565b6001600254600160a01b900460ff166001811115610f8a57fe5b14610fa75760405162461bcd60e51b815260040161072c90613274565b600f54600c54420311610fcc5760405162461bcd60e51b815260040161072c906131b4565b42600c556000610fdb3061152b565b600a549091506000610feb610e47565b90508183108015610ffc5750600081115b801561100d5750601054600d544203115b156110585742600d55600b548111156110255750600b545b61104c6000805160206134c48339815191526000805160206134a483398151915283611ca0565b6110553061152b565b92505b826110755760405162461bcd60e51b815260040161072c906130ee565b81831115611081578192505b600154620f4240610ce48502049384900393906110b7906000805160206134a4833981519152906001600160a01b031686611ca0565b6110d06000805160206134a48339815191523383611ee8565b50505050610a7361202f565b600c5490565b6110ea611c41565b6000806110f5612036565b600154919350915060009081906001600160a01b03166000805160206134a4833981519152101561112a575081905082611130565b50829050815b600354600160a01b900460ff16156111ba57600061114c610a75565b9050821580159061115c57508115155b156111b4576001546001600160a01b03166000805160206134a483398151915210156111925761118d8284836120f7565b6111b4565b6111b48383836a0c097ce7bc90715b34b9f160241b816111ae57fe5b046120f7565b506111d3565b6111c26108d5565b600880548301905560098054820190555b6040513390839083907fb3ff07f4fe20273bbc264b773aacc6325987f8b0b1aa4c5bdfe5b75fdbd1284c90600090a450505050610a7361202f565b60095490565b6003546001600160a01b0316331461123e5760405162461bcd60e51b815260040161072c90613225565b603c8110158015611251575061a8c08111155b61126d5760405162461bcd60e51b815260040161072c906131da565b601055565b60075460009063ffffffff16603c028161128b8461223a565b90508163ffffffff168163ffffffff1610156112a5578091505b63ffffffff8216611336576000849050806001600160a01b0316633850c7bd6040518163ffffffff1660e01b815260040160e06040518083038186803b1580156112ee57600080fd5b505afa158015611302573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113269190612e78565b5094985061135295505050505050565b60006113428584612409565b50905061134e81612773565b9350505b5050919050565b60105490565b60405163c87b56dd60e01b81526060906000805160206134e48339815191529063c87b56dd906113949060019060040161305f565b60006040518083038186803b1580156113ac57600080fd5b505afa1580156113c0573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261085e9190810190612dae565b6003546001600160a01b031633146114125760405162461bcd60e51b815260040161072c90613225565b60058163ffffffff16101580156114305750603c8163ffffffff1611155b61144c5760405162461bcd60e51b815260040161072c90613190565b6007805463ffffffff191663ffffffff92909216919091179055565b60055490565b6003546001600160a01b031633146114985760405162461bcd60e51b815260040161072c90613225565b6001600160a01b0381166114be5760405162461bcd60e51b815260040161072c906130c6565b600280546001600160a01b0319166001600160a01b0392909216919091179055565b6003546001600160a01b0316331461150a5760405162461bcd60e51b815260040161072c90613225565b6003805460ff60a01b198116600160a01b9182900460ff1615909102179055565b6040516370a0823160e01b81526000906000805160206134a4833981519152906370a0823190610973908590600401612fd6565b6003546001600160a01b031633146115895760405162461bcd60e51b815260040161072c90613225565b6001811015801561159b5750600f8111155b6115b75760405162461bcd60e51b815260040161072c90613118565b600e55565b6002546001600160a01b031690565b60008413806115da5750600083135b6115f65760405162461bcd60e51b815260040161072c906132e3565b3373c45a81bc23a64ea556ab4cdf08a86b61cdceea8b14156116d7576000611652731f98431c8ad98523631ae4a59f267346ea31f9846000805160206134c48339815191526000805160206134a4833981519152612710612a9a565b90506001600160a01b03811673c45a81bc23a64ea556ab4cdf08a86b61cdceea8b146116905760405162461bcd60e51b815260040161072c906132c0565b6116b86000805160206134c483398151915233600088136116b157866116b3565b875b611ee8565b600085136116c657836116c8565b845b60048054909101905550610939565b6002546001600160a01b031633141561179b5760015460009061172b90731f98431c8ad98523631ae4a59f267346ea31f984906000805160206134a4833981519152906001600160a01b0316612710612a9a565b6002549091506001600160a01b0380831691161461175b5760405162461bcd60e51b815260040161072c906132c0565b61177c6000805160206134a483398151915233600088136116b157866116b3565b6000851361178a578361178c565b845b60058054909101905550610939565b60405162461bcd60e51b815260040161072c9061329b565b600e5490565b600a5490565b6000806117ca612ab9565b505060015491935091506000805160206134e4833981519152906313ead5629084908490612710906001600160a01b03166000805160206134a48339815191521061181f5766194c583ada5b53602d1b61182b565b66143d136248490f602a1b5b6040518563ffffffff1660e01b815260040161184a9493929190613024565b602060405180830381600087803b15801561186457600080fd5b505af1158015611878573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061189c9190612cf5565b600280546001600160a01b0319166001600160a01b03929092169190911790555050565b60008080600019858709868602925082811090839003039050806118f657600084116118eb57600080fd5b508290049050611969565b80841161190257600080fd5b6000848688096000868103871696879004966002600389028118808a02820302808a02820302808a02820302808a02820302808a02820302808a02909103029181900381900460010186841190950394909402919094039290920491909117919091029150505b9392505050565b604080516001600160a01b038481166024830152604480830185905283518084039091018152606490920183526020820180516001600160e01b031663095ea7b360e01b1781529251825160009485949389169392918291908083835b602083106119ec5780518252601f1990920191602091820191016119cd565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114611a4e576040519150601f19603f3d011682016040523d82523d6000602084013e611a53565b606091505b5091509150818015611a81575080511580611a815750808060200190516020811015611a7e57600080fd5b50515b611ab7576040805162461bcd60e51b8152602060048201526002602482015261534160f01b604482015290519081900360640190fd5b5050505050565b600080600080611acc612ab9565b93509350935093506000604051806101600160405280866001600160a01b03168152602001856001600160a01b0316815260200161271062ffffff168152602001620d899f1960020b8152602001620d89a060020b8152602001848152602001838152602001606485605a0281611b3f57fe5b0481526020016064605a8502048152306020820152610258420160409182015251634418b22b60e11b815290915060009081906000805160206134e483398151915290638831645690611b96908690600401613390565b608060405180830381600087803b158015611bb057600080fd5b505af1158015611bc4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611be89190612f48565b5050601180546001600160501b0319166001600160501b0393909316929092179091556001600160801b031660125550506013805462ffffff191662f276601765ffffff0000001916616c4d601d1b1790555050505050565b60026000541415611c99576040805162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b6002600055565b600060646001600160a01b0385166000805160206134c483398151915214611ccf57611cca610a75565b611cd7565b611cd7610daf565b600e5460640384670de0b6b3a7640000020281611cf057fe5b0481611cf857fe5b04905060006001600160a01b0385166000805160206134c483398151915214611d2c576002546001600160a01b0316611d42565b73c45a81bc23a64ea556ab4cdf08a86b61cdceea8b5b90506000806001600160a01b038084169063128acb08903090898116908b16108881611d825773fffd8963efd1fc6a506488495d951d5263988d25611d89565b6401000276a45b6040518563ffffffff1660e01b8152600401611da89493929190612fea565b6040805180830381600087803b158015611dc157600080fd5b505af1158015611dd5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611df99190612d11565b915091506000866001600160a01b0316886001600160a01b031610611e31576000831215611e2a5782600003611e2c565b825b611e45565b6000821215611e435781600003611e45565b815b905084811015611e675760405162461bcd60e51b815260040161072c90613165565b6001546001600160a01b0388811691161415611ede576000611e87610dfe565b90506000828211611e985781611e9a565b825b60068054820190559050611eac6108d5565b604051339082908a907f1b6fe3d614107093562b62b9236e265cac820f430060c5eb674a70824a7435db90600090a450505b5050505050505050565b604080516001600160a01b038481166024830152604480830185905283518084039091018152606490920183526020820180516001600160e01b031663a9059cbb60e01b1781529251825160009485949389169392918291908083835b60208310611f645780518252601f199092019160209182019101611f45565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114611fc6576040519150601f19603f3d011682016040523d82523d6000602084013e611fcb565b606091505b5091509150818015611ff9575080511580611ff95750808060200190516020811015611ff657600080fd5b50515b611ab7576040805162461bcd60e51b815260206004820152600260248201526114d560f21b604482015290519081900360640190fd5b6001600055565b604080516080810182526011546001600160501b031681523060208201526001600160801b038183018190526060820152905163fc6f786560e01b815260009182916000805160206134e48339815191529063fc6f78659061209c908490600401613309565b6040805180830381600087803b1580156120b557600080fd5b505af11580156120c9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120ed9190612f83565b9094909350915050565b600061210c8383670de0b6b3a76400006118c0565b9050600061212385670de0b6b3a7640000856118c0565b905060008286106121345782612136565b855b905060008286106121475782612149565b855b6040805160c0810182526011546001600160501b03168152602081018590528082018390526064605a80870282900460608401528402046080820152426102580160a0820152905163219f5d1760e01b8152919250906000906000805160206134e48339815191529063219f5d17906121c690859060040161334c565b606060405180830381600087803b1580156121e057600080fd5b505af11580156121f4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906122189190612e44565b5050601280546001600160801b03929092169091019055505050505050505050565b6000806000836001600160a01b0316633850c7bd6040518163ffffffff1660e01b815260040160e06040518083038186803b15801561227857600080fd5b505afa15801561228c573d6000803e3d6000fd5b505050506040513d60e08110156122a257600080fd5b506040810151606090910151909250905061ffff81166122ee576040805162461bcd60e51b81526020600482015260026024820152614e4960f01b604482015290519081900360640190fd5b600080856001600160a01b031663252c09d78461ffff168660010161ffff168161231457fe5b066040518263ffffffff1660e01b8152600401808261ffff16815260200191505060806040518083038186803b15801561234d57600080fd5b505afa158015612361573d6000803e3d6000fd5b505050506040513d608081101561237757600080fd5b5080516060909101519092509050806123fe57856001600160a01b031663252c09d760006040518263ffffffff1660e01b81526004018082815260200191505060806040518083038186803b1580156123cf57600080fd5b505afa1580156123e3573d6000803e3d6000fd5b505050506040513d60808110156123f957600080fd5b505191505b504203949350505050565b60008063ffffffff8316612449576040805162461bcd60e51b8152602060048201526002602482015261042560f41b604482015290519081900360640190fd5b604080516002808252606082018352600092602083019080368337019050509050838160008151811061247857fe5b602002602001019063ffffffff16908163ffffffff16815250506000816001815181106124a157fe5b63ffffffff90921660209283029190910182015260405163883bdbfd60e01b81526004810182815283516024830152835160009384936001600160a01b038b169363883bdbfd9388939192839260449091019185820191028083838b5b838110156125165781810151838201526020016124fe565b505050509050019250505060006040518083038186803b15801561253957600080fd5b505afa15801561254d573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604090815281101561257657600080fd5b8101908080516040519392919084600160201b82111561259557600080fd5b9083019060208201858111156125aa57600080fd5b82518660208202830111600160201b821117156125c657600080fd5b82525081516020918201928201910280838360005b838110156125f35781810151838201526020016125db565b5050505090500160405260200180516040519392919084600160201b82111561261b57600080fd5b90830190602082018581111561263057600080fd5b82518660208202830111600160201b8211171561264c57600080fd5b82525081516020918201928201910280838360005b83811015612679578181015183820152602001612661565b505050509050016040525050509150915060008260008151811061269957fe5b6020026020010151836001815181106126ae57fe5b60200260200101510390506000826000815181106126c857fe5b6020026020010151836001815181106126dd57fe5b60200260200101510390508763ffffffff168260060b816126fa57fe5b05965060008260060b12801561272457508763ffffffff168260060b8161271d57fe5b0760060b15155b1561273157600019909601955b63ffffffff88166001600160a01b0302600160201b600160c01b03602083901b166001600160c01b0382168161276357fe5b0496505050505050509250929050565b60008060008360020b1261278a578260020b612792565b8260020b6000035b9050620d89e88111156127d0576040805162461bcd60e51b81526020600482015260016024820152601560fa1b604482015290519081900360640190fd5b6000600182166127e457600160801b6127f6565b6ffffcb933bd6fad37aa2d162d1a5940015b6001600160881b031690506002821615612820576ffff97272373d413259a46990580e213a0260801c5b600482161561283f576ffff2e50f5f656932ef12357cf3c7fdcc0260801c5b600882161561285e576fffe5caca7e10e4e61c3624eaa0941cd00260801c5b601082161561287d576fffcb9843d60f6159c9db58835c9266440260801c5b602082161561289c576fff973b41fa98c081472e6896dfb254c00260801c5b60408216156128bb576fff2ea16466c96a3843ec78b326b528610260801c5b60808216156128da576ffe5dee046a99a2a811c461f1969c30530260801c5b6101008216156128fa576ffcbe86c7900a88aedcffc83b479aa3a40260801c5b61020082161561291a576ff987a7253ac413176f2b074cf7815e540260801c5b61040082161561293a576ff3392b0822b70005940c7a398e4b70f30260801c5b61080082161561295a576fe7159475a2c29b7443b29c7fa6e889d90260801c5b61100082161561297a576fd097f3bdfd2022b8845ad8f792aa58250260801c5b61200082161561299a576fa9f746462d870fdf8a65dc1f90e061e50260801c5b6140008216156129ba576f70d869a156d2a1b890bb3df62baf32f70260801c5b6180008216156129da576f31be135f97d08fd981231505542fcfa60260801c5b620100008216156129fb576f09aa508b5b7a84e1c677de54f3e99bc90260801c5b62020000821615612a1b576e5d6af8dedb81196699c329225ee6040260801c5b62040000821615612a3a576d2216e584f5fa1ea926041bedfe980260801c5b62080000821615612a57576b048a170391f7dc42444e8fa20260801c5b60008460020b1315612a72578060001981612a6e57fe5b0490505b600160201b810615612a85576001612a88565b60005b60ff16602082901c0192505050919050565b6000612ab085612aab868686612b32565b612b88565b95945050505050565b6001546000805160206134a4833981519152906001600160a01b0316676765c793fa10079d601f1b6714adf4b7320334b9601e1b83831015610ed45750506001546001600160a01b0316926000805160206134a483398151915292506714adf4b7320334b9601e1b9150676765c793fa10079d601f1b90565b612b3a612c90565b826001600160a01b0316846001600160a01b03161115612b58579192915b50604080516060810182526001600160a01b03948516815292909316602083015262ffffff169181019190915290565b6000612b948383612bb1565b9050336001600160a01b03821614612bab57600080fd5b92915050565b600081602001516001600160a01b031682600001516001600160a01b031610612bd957600080fd5b50805160208083015160409384015184516001600160a01b0394851681850152939091168385015262ffffff166060808401919091528351808403820181526080840185528051908301206001600160f81b031960a085015294901b6001600160601b03191660a183015260b58201939093527fe34f199b19b2b4f47f68442619d555527d244f78a3297ea89325f843f87b8b5460d5808301919091528251808303909101815260f5909101909152805191012090565b604080516060810182526000808252602082018190529181019190915290565b80516001600160801b03811681146109c657600080fd5b805161ffff811681146109c657600080fd5b600060208284031215612cea578081fd5b81356119698161348b565b600060208284031215612d06578081fd5b81516119698161348b565b60008060408385031215612d23578081fd5b505080516020909101519092909150565b60008060008060608587031215612d49578182fd5b843593506020850135925060408501356001600160401b0380821115612d6d578384fd5b818701915087601f830112612d80578384fd5b813581811115612d8e578485fd5b886020828501011115612d9f578485fd5b95989497505060200194505050565b600060208284031215612dbf578081fd5b81516001600160401b0380821115612dd5578283fd5b818401915084601f830112612de8578283fd5b815181811115612df457fe5b604051601f8201601f191681016020018381118282101715612e1257fe5b604052818152838201602001871015612e29578485fd5b612e3a82602083016020870161345f565b9695505050505050565b600080600060608486031215612e58578283fd5b612e6184612cb0565b925060208401519150604084015190509250925092565b600080600080600080600060e0888a031215612e92578283fd5b8751612e9d8161348b565b8097505060208801518060020b8114612eb4578384fd5b9550612ec260408901612cc7565b9450612ed060608901612cc7565b9350612ede60808901612cc7565b925060a088015160ff81168114612ef3578283fd5b60c08901519092508015158114612f08578182fd5b8091505092959891949750929550565b600060208284031215612f29578081fd5b5035919050565b600060208284031215612f41578081fd5b5051919050565b60008060008060808587031215612f5d578081fd5b84519350612f6d60208601612cb0565b6040860151606090960151949790965092505050565b60008060408385031215612d23578182fd5b600060208284031215612fa6578081fd5b813563ffffffff81168114611969578182fd5b6001600160a01b03169052565b60020b9052565b62ffffff169052565b6001600160a01b0391909116815260200190565b6001600160a01b03948516815292151560208401526040830191909152909116606082015260a06080820181905260009082015260c00190565b6001600160a01b039485168152928416602084015262ffffff919091166040830152909116606082015260800190565b901515815260200190565b90815260200190565b600060208252825180602084015261308781604085016020870161345f565b601f01601f19169190910160400192915050565b602080825260119082015270496e76616c6964486c784164647265737360781b604082015260600190565b6020808252600e908201526d496e76616c69644164647265737360901b604082015260600190565b60208082526010908201526f4e6f417661696c61626c6546756e647360801b604082015260600190565b602080825260099082015268312d31355f4f6e6c7960b81b604082015260600190565b60208082526010908201526f09ccacac8409adee4ca40a8d2e8c2dcb60831b604082015260600190565b602080825260119082015270151bdbd31a5d1d1b19549958d95a5d9959607a1b604082015260600190565b6020808252600a9082015269356d2d3168206f6e6c7960b01b604082015260600190565b6020808252600c908201526b125b9d195c9d985b15d85a5d60a21b604082015260600190565b6020808252600b908201526a316d2d3132685f4f6e6c7960a81b604082015260600190565b6020808252600c908201526b4e6f506f6f6c45786973747360a01b604082015260600190565b6020808252600d908201526c24b73b30b634b221b0b63632b960991b604082015260600190565b6020808252600e908201526d141bdbdb12185cd0dc99585d195960921b604082015260600190565b6020808252600d908201526c04e656564496e697469616c4c5609c1b604082015260600190565b6020808252600b908201526a155b9adb9bdddb941bdbdb60aa1b604082015260600190565b60208082526009908201526815dc9bdb99d41bdbdb60ba1b604082015260600190565b6020808252600c908201526b0496e76616c696420537761760a41b604082015260600190565b815181526020808301516001600160a01b0316908201526040808301516001600160801b0390811691830191909152606092830151169181019190915260800190565b600060c082019050825182526020830151602083015260408301516040830152606083015160608301526080830151608083015260a083015160a083015292915050565b6000610160820190506133a4828451612fb9565b60208301516133b66020840182612fb9565b5060408301516133c96040840182612fcd565b5060608301516133dc6060840182612fc6565b5060808301516133ef6080840182612fc6565b5060a083015160a083015260c083015160c083015260e083015160e08301526101008084015181840152506101208084015161342d82850182612fb9565b505061014092830151919092015290565b9384526020840192909252600290810b60408401520b606082015260800190565b60005b8381101561347a578181015183820152602001613462565b838111156109395750506000910152565b6001600160a01b03811681146134a057600080fd5b5056fe000000000000000000000000f19308f923582a6f7c465e5ce7a9dc1bec6665b1000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2000000000000000000000000c36442b4a4522e871399cd717abdd847ab11fe88a2646970667358221220653388cd753af50354195108b9a8f1764f0dcc09200e89a32482ec3c15b1311d64736f6c63430007060033

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.