ETH Price: $3,114.14 (+1.94%)

Contract

0x37b68A29444F53D8213a7a932B3f7D05F140BbBe

Overview

ETH Balance

0 ETH

ETH Value

$0.00

More Info

Private Name Tags

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To

There are no matching entries

Please try again later

Advanced mode:
Parent Transaction Hash Block From To
View All Internal Transactions

Cross-Chain Transactions
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
QueryData

Compiler Version
v0.8.17+commit.8df45f5f

Optimization Enabled:
No with 200 runs

Other Settings:
london EvmVersion
// SPDX-License-Identifier: MIT
pragma solidity 0.8.17;

import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
import "./interface/IAlgebraPool.sol";
import "./interface/ICLPoolManager.sol";
import "./interface/IHooks.sol";
import "./interface/IHorizonPool.sol";
import "./interface/IPoolManager.sol";
import "./interface/IPositionManager.sol";
import "./interface/IStateView.sol";
import "./interface/IUniswapV3Pool.sol";
import "./interface/IZora.sol";
import "./interface/IZumiPool.sol";

import "./extLib/QueryUniv3TicksSuperCompact.sol";
import "./extLib/QueryAlgebraTicksSuperCompact.sol";
import "./extLib/QueryHorizonTicksSuperCompact.sol";
import "./extLib/QueryIzumiSuperCompact.sol";
import "./extLib/QueryUniv4TicksSuperCompact.sol";
import "./extLib/QueryZoraTicksSuperCompact.sol";
/// @title DexNativeRouter
/// @notice Entrance of trading native token in web3-dex

contract QueryData is Initializable {
    address public POOL_MANAGER;
    address public STATE_VIEW;
    address public POSITION_MANAGER;

    int24 internal constant MIN_TICK_MINUS_1 = -887_272 - 1;
    int24 internal constant MAX_TICK_PLUS_1 = 887_272 + 1;
    bytes32 public constant POOLS_SLOT = bytes32(uint256(6));
    address public constant PANCAKE_INFINITY_CLPOOLMANAGER = 0xa0FfB9c1CE1Fe56963B0321B32E7A0302114058b;
    address public constant PANCAKE_INFINITY_POSITION_MANAGER = 0x55f4c8abA71A1e923edC303eb4fEfF14608cC226;
    uint256 internal constant OFFSET_TICK_SPACING = 16;

    function initialize(address stateView, address positionManager, address poolManager) public initializer {
        STATE_VIEW = stateView;
        POSITION_MANAGER = positionManager;
        POOL_MANAGER = poolManager;
    }

    type Currency is address;
    /// @notice Returns the key for identifying a pool

    struct PoolKey {
        /// @notice The lower currency of the pool, sorted numerically
        Currency currency0;
        /// @notice The higher currency of the pool, sorted numerically
        Currency currency1;
        /// @notice The pool LP fee, capped at 1_000_000. If the highest bit is 1, the pool has a dynamic fee and must be exactly equal to 0x800000
        uint24 fee;
        /// @notice Ticks that involve positions must be a multiple of tick spacing
        int24 tickSpacing;
        /// @notice The hooks of the pool
        IHooks hooks;
    }

    struct SuperVar {
        int24 tickSpacing;
        int24 currTick;
        int24 right;
        int24 left;
        int24 leftMost;
        int24 rightMost;
        uint256 initPoint;
        uint256 initPoint2;
    }

    function queryUniv3TicksSuperCompact(address pool, uint256 len) public view returns (bytes memory) {
        return QueryUniv3TicksSuperCompact.queryUniv3TicksSuperCompact(pool, len);
    }

    function queryAlgebraTicksSuperCompact(address pool, uint256 len) public view returns (bytes memory) {
        return QueryAlgebraTicksSuperCompact.queryAlgebraTicksSuperCompact(pool, len);
    }

    function queryAlgebraTicksSuperCompact3_back(address pool, uint256 len) public view returns (bytes memory) {
        return QueryAlgebraTicksSuperCompact.queryAlgebraTicksSuperCompact3_back(pool, len);
    }

    function queryHorizonTicksSuperCompact(address pool, uint256 len) public view returns (bytes memory) {
        return QueryHorizonTicksSuperCompact.queryHorizonTicksSuperCompact(pool, len);
    }

    function queryAlgebraTicksSuperCompact2(address pool, uint256 len) public view returns (bytes memory) {
        return QueryAlgebraTicksSuperCompact.queryAlgebraTicksSuperCompact2(pool, len);
    }

    function queryIzumiSuperCompact(address pool, uint256 len) public view returns (bytes memory, bytes memory) {
        return QueryIzumiSuperCompact.queryIzumiSuperCompact(pool, len);
    }

    function queryAlgebraTicksSuperCompact3(address pool, uint256 len) public view returns (bytes memory) {
        return QueryAlgebraTicksSuperCompact.queryAlgebraTicksSuperCompact3(pool, len);
    }

    function queryUniv4TicksSuperCompact(bytes32 poolId, uint256 len) public view returns (bytes memory) {
        return QueryUniv4TicksSuperCompact.queryUniv4TicksSuperCompact(
            poolId, len, POOL_MANAGER, STATE_VIEW, POSITION_MANAGER
        );
    }

    function queryPancakeInfinityTicksSuperCompact(bytes32 poolId, uint256 len) public view returns (bytes memory) {
        return QueryUniv4TicksSuperCompact.queryPancakeInfinityTicksSuperCompact(
            poolId, len, POOL_MANAGER, STATE_VIEW, POSITION_MANAGER
        );
    }

    function queryZoraTicksSuperCompact(address coin, uint256 len) public view returns (bytes memory) {
        return
            QueryZoraTicksSuperCompact.queryZoraTicksSuperCompact(coin, len, POOL_MANAGER, STATE_VIEW, POSITION_MANAGER);
    }

    // General function for all v4 pools
    function toId(IZoraCoin.PoolKey memory poolKey) public pure returns (bytes32 poolId) {
        return QueryZoraTicksSuperCompact.toId(poolKey);
    }

    // Specifically for Zora
    function getPoolKeyOfZora(address coin) public view returns (IZoraCoin.PoolKey memory) {
        return QueryZoraTicksSuperCompact.getPoolKeyOfZora(coin, POOL_MANAGER, STATE_VIEW, POSITION_MANAGER);
    }

    // Specifically for Zora
    function getSlot0OfZora(address coin)
        public
        view
        returns (int256 liquidity, uint160 sqrtPriceX96, int24 tick, uint24 protocolFee, uint24 lpFee)
    {
        return QueryZoraTicksSuperCompact.getSlot0OfZora(coin, POOL_MANAGER, STATE_VIEW, POSITION_MANAGER);
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (proxy/utils/Initializable.sol)

pragma solidity ^0.8.2;

import "../../utils/AddressUpgradeable.sol";

/**
 * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed
 * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an
 * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer
 * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.
 *
 * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be
 * reused. This mechanism prevents re-execution of each "step" but allows the creation of new initialization steps in
 * case an upgrade adds a module that needs to be initialized.
 *
 * For example:
 *
 * [.hljs-theme-light.nopadding]
 * ```solidity
 * contract MyToken is ERC20Upgradeable {
 *     function initialize() initializer public {
 *         __ERC20_init("MyToken", "MTK");
 *     }
 * }
 *
 * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {
 *     function initializeV2() reinitializer(2) public {
 *         __ERC20Permit_init("MyToken");
 *     }
 * }
 * ```
 *
 * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as
 * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.
 *
 * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure
 * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.
 *
 * [CAUTION]
 * ====
 * Avoid leaving a contract uninitialized.
 *
 * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation
 * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke
 * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:
 *
 * [.hljs-theme-light.nopadding]
 * ```
 * /// @custom:oz-upgrades-unsafe-allow constructor
 * constructor() {
 *     _disableInitializers();
 * }
 * ```
 * ====
 */
abstract contract Initializable {
    /**
     * @dev Indicates that the contract has been initialized.
     * @custom:oz-retyped-from bool
     */
    uint8 private _initialized;

    /**
     * @dev Indicates that the contract is in the process of being initialized.
     */
    bool private _initializing;

    /**
     * @dev Triggered when the contract has been initialized or reinitialized.
     */
    event Initialized(uint8 version);

    /**
     * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,
     * `onlyInitializing` functions can be used to initialize parent contracts.
     *
     * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a
     * constructor.
     *
     * Emits an {Initialized} event.
     */
    modifier initializer() {
        bool isTopLevelCall = !_initializing;
        require(
            (isTopLevelCall && _initialized < 1) || (!AddressUpgradeable.isContract(address(this)) && _initialized == 1),
            "Initializable: contract is already initialized"
        );
        _initialized = 1;
        if (isTopLevelCall) {
            _initializing = true;
        }
        _;
        if (isTopLevelCall) {
            _initializing = false;
            emit Initialized(1);
        }
    }

    /**
     * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the
     * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be
     * used to initialize parent contracts.
     *
     * A reinitializer may be used after the original initialization step. This is essential to configure modules that
     * are added through upgrades and that require initialization.
     *
     * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`
     * cannot be nested. If one is invoked in the context of another, execution will revert.
     *
     * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in
     * a contract, executing them in the right order is up to the developer or operator.
     *
     * WARNING: setting the version to 255 will prevent any future reinitialization.
     *
     * Emits an {Initialized} event.
     */
    modifier reinitializer(uint8 version) {
        require(!_initializing && _initialized < version, "Initializable: contract is already initialized");
        _initialized = version;
        _initializing = true;
        _;
        _initializing = false;
        emit Initialized(version);
    }

    /**
     * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the
     * {initializer} and {reinitializer} modifiers, directly or indirectly.
     */
    modifier onlyInitializing() {
        require(_initializing, "Initializable: contract is not initializing");
        _;
    }

    /**
     * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.
     * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized
     * to any version. It is recommended to use this to lock implementation contracts that are designed to be called
     * through proxies.
     *
     * Emits an {Initialized} event the first time it is successfully executed.
     */
    function _disableInitializers() internal virtual {
        require(!_initializing, "Initializable: contract is initializing");
        if (_initialized != type(uint8).max) {
            _initialized = type(uint8).max;
            emit Initialized(type(uint8).max);
        }
    }

    /**
     * @dev Returns the highest version that has been initialized. See {reinitializer}.
     */
    function _getInitializedVersion() internal view returns (uint8) {
        return _initialized;
    }

    /**
     * @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}.
     */
    function _isInitializing() internal view returns (bool) {
        return _initializing;
    }
}

interface IAlgebraPool {
    function globalState()
        external
        view
        returns (
            uint160 price,
            int24 tick,
            int24 prevInitializedTick,
            uint16 fee,
            uint16 timepointIndex,
            uint8 communityFee,
            bool unlocked
        );

    function tickSpacing() external view returns (int24);

    function ticks(int24 tick)
        external
        view
        returns (
            uint128 liquidityTotal,
            int128 liquidityDelta,
            uint256 outerFeeGrowth0Token,
            uint256 outerFeeGrowth1Token,
            int24 prevTick,
            int24 nextTick,
            uint160 outerSecondsPerLiquidity,
            uint32 outerSecondsSpent,
            bool hasLimitOrders
        );

    function tickTable(int16 wordPosition) external view returns (uint256);
    function prevInitializedTick() external view returns (int24);
}

interface IAlgebraPoolV1_9 {
    function globalState()
        external
        view
        returns (
            uint160 price,
            int24 tick,
            int24 prevInitializedTick,
            uint16 fee,
            uint16 timepointIndex,
            uint8 communityFee,
            bool unlocked
        );

    function tickSpacing() external view returns (int24);
    function ticks(int24 tick)
        external
        view
        returns (
            uint128 liquidityTotal,
            int128 liquidityDelta,
            uint256 outerFeeGrowth0Token,
            uint256 outerFeeGrowth1Token,
            int56 outerTickCumulative,
            uint160 outerSecondsPerLiquidity,
            uint32 outerSecondsSpent,
            bool initialized
        );
    function tickTable(int16 wordPosition) external view returns (uint256);
}

/// @notice Tick info library for Pancake Infinity
library Tick {
    struct Info {
        uint128 liquidityGross;
        int128 liquidityNet;
        uint256 feeGrowthOutside0X128;
        uint256 feeGrowthOutside1X128;
    }
}

interface ICLPoolManager {
    type PoolId is bytes32;

    /// @notice Get the tick info about a specific tick in the pool
    function getPoolTickInfo(PoolId id, int24 tick) external view returns (Tick.Info memory);

    /// @notice Get the tick bitmap info about a specific range (a word range) in the pool
    function getPoolBitmapInfo(PoolId id, int16 word) external view returns (uint256 tickBitmap);

    /// @notice Get Slot0 of the pool: sqrtPriceX96, tick, protocolFee, lpFee
    function getSlot0(PoolId id)
        external
        view
        returns (uint160 sqrtPriceX96, int24 tick, uint24 protocolFee, uint24 lpFee);
}

File 5 of 21 : IHooks.sol
interface IHooks {}

interface IHorizonPool {
    function tickDistance() external view returns (int24);

    function ticks(int24 tick)
        external
        view
        returns (
            uint128 liquidityGross,
            int128 liquidityNet,
            uint256 feeGrowthOutside,
            uint128 secondsPerLiquidityOutside
        );

    function initializedTicks(int24 tick) external view returns (int24 previous, int24 next);

    function getPoolState()
        external
        view
        returns (uint160 sqrtP, int24 currentTick, int24 nearestCurrentTick, bool locked);
}

interface IPoolManager {
    function extsload(bytes32 startSlot, uint256 nSlots) external view returns (bytes32[] memory);
}

import "./IHooks.sol";

interface IPositionManager {
    type Currency is address;

    /// @notice Returns the key for identifying a pool
    struct PoolKey {
        /// @notice The lower currency of the pool, sorted numerically
        Currency currency0;
        /// @notice The higher currency of the pool, sorted numerically
        Currency currency1;
        /// @notice The pool LP fee, capped at 1_000_000. If the highest bit is 1, the pool has a dynamic fee and must be exactly equal to 0x800000
        uint24 fee;
        /// @notice Ticks that involve positions must be a multiple of tick spacing
        int24 tickSpacing;
        /// @notice The hooks of the pool
        IHooks hooks;
    }

    function poolKeys(bytes25 poolId) external view returns (PoolKey memory);
}

interface IStateView {
    type PoolId is bytes32;

    /// @notice Retrieves the tick bitmap of a pool at a specific tick.
    /// @dev Corresponds to pools[poolId].tickBitmap[tick]
    /// @param poolId The ID of the pool.
    /// @param tick The tick to retrieve the bitmap for.
    /// @return tickBitmap The bitmap of the tick.
    function getTickBitmap(PoolId poolId, int16 tick) external view returns (uint256 tickBitmap);

    /// @notice Retrieves the liquidity information of a pool at a specific tick.
    /// @dev Corresponds to pools[poolId].ticks[tick].liquidityGross and pools[poolId].ticks[tick].liquidityNet. A more gas efficient version of getTickInfo
    /// @param poolId The ID of the pool.
    /// @param tick The tick to retrieve liquidity for.
    /// @return liquidityGross The total position liquidity that references this tick
    /// @return liquidityNet The amount of net liquidity added (subtracted) when tick is crossed from left to right (right to left)
    function getTickLiquidity(PoolId poolId, int24 tick)
        external
        view
        returns (uint128 liquidityGross, int128 liquidityNet);

    /// @notice Get Slot0 of the pool: sqrtPriceX96, tick, protocolFee, lpFee
    /// @dev Corresponds to pools[poolId].slot0
    /// @param poolId The ID of the pool.
    /// @return sqrtPriceX96 The square root of the price of the pool, in Q96 precision.
    /// @return tick The current tick of the pool.
    /// @return protocolFee The protocol fee of the pool.
    /// @return lpFee The swap fee of the pool.
    function getSlot0(PoolId poolId)
        external
        view
        returns (uint160 sqrtPriceX96, int24 tick, uint24 protocolFee, uint24 lpFee);
}

File 10 of 21 : IUniswapV3Pool.sol
import "./IUniswapV3PoolImmutables.sol";
import "./IUniswapV3PoolState.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 {}

import "./IHooks.sol";

interface IZoraCoin {
    type Currency is address;

    struct PoolKey {
        /// @notice The lower currency of the pool, sorted numerically
        Currency currency0;
        /// @notice The higher currency of the pool, sorted numerically
        Currency currency1;
        /// @notice The pool LP fee, capped at 1_000_000. If the highest bit is 1, the pool has a dynamic fee and must be exactly equal to 0x800000
        uint24 fee;
        /// @notice Ticks that involve positions must be a multiple of tick spacing
        int24 tickSpacing;
        /// @notice The hooks of the pool
        IHooks hooks;
    }

    function getPoolKey() external view returns (PoolKey memory);
}

interface IZumiPool {
    function points(int24 tick) external view returns (uint256, int128, uint256, uint256, bool);

    function pointDelta() external view returns (int24);

    function orderOrEndpoint(int24 tick) external view returns (int24);

    function limitOrderData(int24 point)
        external
        view
        returns (
            uint128 sellingX,
            uint128 earnY,
            uint256 accEarnY,
            uint256 legacyAccEarnY,
            uint128 legacyEarnY,
            uint128 sellingY,
            uint128 earnX,
            uint128 legacyEarnX,
            uint256 accEarnX,
            uint256 legacyAccEarnX
        );

    function pointBitmap(int16 tick) external view returns (uint256);

    function factory() external view returns (address);
}

// SPDX-License-Identifier: MIT
pragma solidity 0.8.17;

import "../interface/IAlgebraPool.sol";
import "../interface/ICLPoolManager.sol";
import "../interface/IHooks.sol";
import "../interface/IHorizonPool.sol";
import "../interface/IPoolManager.sol";
import "../interface/IPositionManager.sol";
import "../interface/IStateView.sol";
import "../interface/IUniswapV3Pool.sol";
import "../interface/IZora.sol";
import "../interface/IZumiPool.sol";

library QueryUniv3TicksSuperCompact {
    struct SuperVar {
        int24 tickSpacing;
        int24 currTick;
        int24 right;
        int24 left;
        int24 leftMost;
        int24 rightMost;
        uint256 initPoint;
        uint256 initPoint2;
    }

    function queryUniv3TicksSuperCompact(address pool, uint256 len) public view returns (bytes memory) {
        SuperVar memory tmp;
        tmp.tickSpacing = IUniswapV3Pool(pool).tickSpacing();
        // fix-bug: pancake pool's slot returns different types of params than uniV3, which will cause problem
        {
            (, bytes memory slot0) = pool.staticcall(abi.encodeWithSignature("slot0()"));
            int24 currTick;
            assembly {
                currTick := mload(add(slot0, 64))
            }
            tmp.currTick = currTick;
        }

        tmp.right = tmp.currTick / tmp.tickSpacing / int24(256);
        tmp.leftMost = -887_272 / tmp.tickSpacing / int24(256) - 2;
        tmp.rightMost = 887_272 / tmp.tickSpacing / int24(256) + 1;

        if (tmp.currTick < 0) {
            tmp.initPoint = uint256(
                int256(tmp.currTick) / int256(tmp.tickSpacing)
                    - (int256(tmp.currTick) / int256(tmp.tickSpacing) / 256 - 1) * 256
            ) % 256;
        } else {
            tmp.initPoint = (uint256(int256(tmp.currTick)) / uint256(int256(tmp.tickSpacing))) % 256;
        }
        tmp.initPoint2 = tmp.initPoint;

        if (tmp.currTick < 0) tmp.right--;

        bytes memory tickInfo;

        tmp.left = tmp.right;

        uint256 index = 0;

        while (index < len / 2 && tmp.right < tmp.rightMost) {
            uint256 res = IUniswapV3Pool(pool).tickBitmap(int16(tmp.right));
            if (res > 0) {
                res = res >> tmp.initPoint;
                for (uint256 i = tmp.initPoint; i < 256 && index < len / 2; i++) {
                    uint256 isInit = res & 0x01;
                    if (isInit > 0) {
                        int256 tick = int256((256 * tmp.right + int256(i)) * tmp.tickSpacing);
                        // (, int128 liquidityNet,,,,,,) = IUniswapV3Pool(pool).ticks(int24(int256(tick)));
                        // fix-bug: to make consistent with solidlyV3 and ramsesV2
                        int128 liquidityNet;
                        (, bytes memory d) = pool.staticcall(
                            abi.encodeWithSelector(IUniswapV3PoolState.ticks.selector, int24(int256(tick)))
                        );
                        assembly {
                            liquidityNet := mload(add(d, 64))
                        }
                        int256 data = int256(uint256(int256(tick)) << 128)
                            + (int256(liquidityNet) & 0x00000000000000000000000000000000ffffffffffffffffffffffffffffffff);
                        tickInfo = bytes.concat(tickInfo, bytes32(uint256(data)));

                        index++;
                    }

                    res = res >> 1;
                }
            }
            tmp.initPoint = 0;
            tmp.right++;
        }
        bool isInitPoint = true;
        while (index < len && tmp.left > tmp.leftMost) {
            uint256 res = IUniswapV3Pool(pool).tickBitmap(int16(tmp.left));
            if (res > 0 && tmp.initPoint2 != 0) {
                res = isInitPoint ? res << ((256 - tmp.initPoint2) % 256) : res;
                for (uint256 i = tmp.initPoint2 - 1; i >= 0 && index < len; i--) {
                    uint256 isInit = res & 0x8000000000000000000000000000000000000000000000000000000000000000;
                    if (isInit > 0) {
                        int256 tick = int256((256 * tmp.left + int256(i)) * tmp.tickSpacing);
                        // (, int128 liquidityNet,,,,,,) = IUniswapV3Pool(pool).ticks(int24(int256(tick)));
                        // fix-bug: to make consistent with solidlyV3 and ramsesV2
                        int128 liquidityNet;
                        (, bytes memory d) = pool.staticcall(
                            abi.encodeWithSelector(IUniswapV3PoolState.ticks.selector, int24(int256(tick)))
                        );
                        assembly {
                            liquidityNet := mload(add(d, 64))
                        }
                        int256 data = int256(uint256(int256(tick)) << 128)
                            + (int256(liquidityNet) & 0x00000000000000000000000000000000ffffffffffffffffffffffffffffffff);
                        tickInfo = bytes.concat(tickInfo, bytes32(uint256(data)));

                        index++;
                    }

                    res = res << 1;
                    if (i == 0) break;
                }
            }
            isInitPoint = false;
            tmp.initPoint2 = 256;

            tmp.left--;
        }
        return tickInfo;
    }
}

// SPDX-License-Identifier: MIT
pragma solidity 0.8.17;

import "../interface/IAlgebraPool.sol";
import "../interface/ICLPoolManager.sol";
import "../interface/IHooks.sol";
import "../interface/IHorizonPool.sol";
import "../interface/IPoolManager.sol";
import "../interface/IPositionManager.sol";
import "../interface/IStateView.sol";
import "../interface/IUniswapV3Pool.sol";
import "../interface/IZora.sol";
import "../interface/IZumiPool.sol";

library QueryAlgebraTicksSuperCompact {
    int24 internal constant MIN_TICK_MINUS_1 = -887_272 - 1;
    int24 internal constant MAX_TICK_PLUS_1 = 887_272 + 1;

    struct SuperVar {
        int24 tickSpacing;
        int24 currTick;
        int24 right;
        int24 left;
        int24 leftMost;
        int24 rightMost;
        uint256 initPoint;
        uint256 initPoint2;
    }

    function queryAlgebraTicksSuperCompact(address pool, uint256 len) public view returns (bytes memory) {
        SuperVar memory tmp;

        {
            (, bytes memory slot0) = pool.staticcall(abi.encodeWithSignature("globalState()"));
            int24 currTick;
            assembly {
                currTick := mload(add(slot0, 64))
            }
            tmp.currTick = currTick;
        }
        tmp.right = tmp.currTick / int24(256);
        tmp.leftMost = -887_272 / int24(256) - 2;
        tmp.rightMost = 887_272 / int24(256) + 1;

        if (tmp.currTick < 0) {
            tmp.initPoint = (256 - (uint256(int256(-tmp.currTick)) % 256)) % 256;
        } else {
            tmp.initPoint = uint256(int256(tmp.currTick)) % 256;
        }
        tmp.initPoint2 = tmp.initPoint;

        if (tmp.currTick < 0) tmp.right--;

        bytes memory tickInfo;

        tmp.left = tmp.right;

        uint256 index = 0;

        while (index < len / 2 && tmp.right < tmp.rightMost) {
            uint256 res = IAlgebraPoolV1_9(pool).tickTable(int16(tmp.right));
            if (res > 0) {
                res = res >> tmp.initPoint;
                for (uint256 i = tmp.initPoint; i < 256 && index < len / 2; i++) {
                    uint256 isInit = res & 0x01;
                    if (isInit > 0) {
                        int256 tick = int256((256 * tmp.right + int256(i)));
                        // (, int128 liquidityNet,,,,,,) = IAlgebraPoolV1_9(pool).ticks(int24(int256(tick)));
                        (, bytes memory deltaL) = pool.staticcall(abi.encodeWithSignature("ticks(int24)", tick));
                        int128 liquidityNet;
                        assembly {
                            liquidityNet := mload(add(deltaL, 64))
                        }

                        int256 data = int256(uint256(int256(tick)) << 128)
                            + (int256(liquidityNet) & 0x00000000000000000000000000000000ffffffffffffffffffffffffffffffff);
                        tickInfo = bytes.concat(tickInfo, bytes32(uint256(data)));

                        index++;
                    }

                    res = res >> 1;
                }
            }
            tmp.initPoint = 0;
            tmp.right++;
        }
        bool isInitPoint = true;
        while (index < len && tmp.left > tmp.leftMost) {
            uint256 res = IAlgebraPoolV1_9(pool).tickTable(int16(tmp.left));
            if (res > 0 && tmp.initPoint2 != 0) {
                res = isInitPoint ? res << ((256 - tmp.initPoint2) % 256) : res;

                for (uint256 i = tmp.initPoint2 - 1; i >= 0 && index < len; i--) {
                    uint256 isInit = res & 0x8000000000000000000000000000000000000000000000000000000000000000;
                    if (isInit > 0) {
                        int256 tick = int256((256 * tmp.left + int256(i)));
                        // (, int128 liquidityNet,,,,,,) = IAlgebraPoolV1_9(pool).ticks(int24(int256(tick)));

                        (, bytes memory deltaL) = pool.staticcall(abi.encodeWithSignature("ticks(int24)", tick));
                        int128 liquidityNet;
                        assembly {
                            liquidityNet := mload(add(deltaL, 64))
                        }
                        int256 data = int256(uint256(int256(tick)) << 128)
                            + (int256(liquidityNet) & 0x00000000000000000000000000000000ffffffffffffffffffffffffffffffff);
                        tickInfo = bytes.concat(tickInfo, bytes32(uint256(data)));

                        index++;
                    }

                    res = res << 1;
                    if (i == 0) break;
                }
            }
            isInitPoint = false;
            tmp.initPoint2 = 256;

            tmp.left--;
        }
        return tickInfo;
    }

    function queryAlgebraTicksSuperCompact2(address pool, uint256 iteration) public view returns (bytes memory) {
        int24 currTick;
        {
            (bool s, bytes memory res) = pool.staticcall(abi.encodeWithSignature("prevInitializedTick()"));
            if (s) {
                currTick = abi.decode(res, (int24));
            } else {
                (s, res) = pool.staticcall(abi.encodeWithSignature("globalState()"));
                if (s) {
                    assembly {
                        currTick := mload(add(res, 96))
                    }
                }
            }
        }

        int24 currTick2 = currTick;
        uint256 threshold = iteration / 2;
        // travel from left to right
        bytes memory tickInfo;

        while (currTick < MAX_TICK_PLUS_1 && iteration > threshold) {
            (, int128 liquidityNet,,, int24 prevTick, int24 nextTick,,,) = IAlgebraPool(pool).ticks(currTick);

            int256 data = int256(uint256(int256(currTick)) << 128)
                + (int256(liquidityNet) & 0x00000000000000000000000000000000ffffffffffffffffffffffffffffffff);
            tickInfo = bytes.concat(tickInfo, bytes32(uint256(data)));

            if (currTick == nextTick) {
                break;
            }
            currTick = nextTick;
            iteration--;
        }

        while (currTick2 > MIN_TICK_MINUS_1 && iteration > 0) {
            (, int128 liquidityNet,,, int24 prevTick, int24 nextTick,,,) = IAlgebraPool(pool).ticks(currTick2);

            int256 data = int256(uint256(int256(currTick2)) << 128)
                + (int256(liquidityNet) & 0x00000000000000000000000000000000ffffffffffffffffffffffffffffffff);
            tickInfo = bytes.concat(tickInfo, bytes32(uint256(data)));

            if (currTick2 == prevTick) {
                break;
            }
            currTick2 = prevTick;
            iteration--;
        }

        return tickInfo;
    }

    function queryAlgebraTicksSuperCompact3_back(address pool, uint256 len) public view returns (bytes memory) {
        SuperVar memory tmp;
        tmp.tickSpacing = IAlgebraPool(pool).tickSpacing();

        {
            (, bytes memory slot0) = pool.staticcall(abi.encodeWithSignature("globalState()"));
            int24 currTick;
            assembly {
                currTick := mload(add(slot0, 64))
            }
            tmp.currTick = currTick;
        }
        tmp.right = tmp.currTick / tmp.tickSpacing / int24(256);
        tmp.leftMost = -887_272 / tmp.tickSpacing / int24(256) - 2;
        tmp.rightMost = 887_272 / tmp.tickSpacing / int24(256) + 1;

        if (tmp.currTick < 0) {
            tmp.initPoint = uint256(
                int256(tmp.currTick) / int256(tmp.tickSpacing)
                    - (int256(tmp.currTick) / int256(tmp.tickSpacing) / 256 - 1) * 256
            ) % 256;
        } else {
            tmp.initPoint = (uint256(int256(tmp.currTick)) / uint256(int256(tmp.tickSpacing))) % 256;
        }
        tmp.initPoint2 = tmp.initPoint;

        if (tmp.currTick < 0) tmp.right--;

        bytes memory tickInfo;

        tmp.left = tmp.right;

        uint256 index = 0;

        while (index < len / 2 && tmp.right < tmp.rightMost) {
            uint256 res = IAlgebraPoolV1_9(pool).tickTable(int16(tmp.right));
            if (res > 0) {
                res = res >> tmp.initPoint;
                for (uint256 i = tmp.initPoint; i < 256 && index < len / 2; i++) {
                    uint256 isInit = res & 0x01;
                    if (isInit > 0) {
                        int256 tick = int256((256 * tmp.right + int256(i)) * tmp.tickSpacing);
                        // (, int128 liquidityNet,,,,,,) = IAlgebraPoolV1_9(pool).ticks(int24(int256(tick)));
                        (, bytes memory deltaL) = pool.staticcall(abi.encodeWithSignature("ticks(int24)", tick));
                        int128 liquidityNet;
                        assembly {
                            liquidityNet := mload(add(deltaL, 64))
                        }

                        int256 data = int256(uint256(int256(tick)) << 128)
                            + (int256(liquidityNet) & 0x00000000000000000000000000000000ffffffffffffffffffffffffffffffff);
                        tickInfo = bytes.concat(tickInfo, bytes32(uint256(data)));

                        index++;
                    }

                    res = res >> 1;
                }
            }
            tmp.initPoint = 0;
            tmp.right++;
        }
        bool isInitPoint = true;
        while (index < len && tmp.left > tmp.leftMost) {
            uint256 res = IAlgebraPoolV1_9(pool).tickTable(int16(tmp.left));
            if (res > 0 && tmp.initPoint2 != 0) {
                res = isInitPoint ? res << ((256 - tmp.initPoint2) % 256) : res;

                for (uint256 i = tmp.initPoint2 - 1; i >= 0 && index < len; i--) {
                    uint256 isInit = res & 0x8000000000000000000000000000000000000000000000000000000000000000;
                    if (isInit > 0) {
                        int256 tick = int256((256 * tmp.left + int256(i)) * tmp.tickSpacing);
                        // (, int128 liquidityNet,,,,,,) = IAlgebraPoolV1_9(pool).ticks(int24(int256(tick)));

                        (, bytes memory deltaL) = pool.staticcall(abi.encodeWithSignature("ticks(int24)", tick));
                        int128 liquidityNet;
                        assembly {
                            liquidityNet := mload(add(deltaL, 64))
                        }
                        int256 data = int256(uint256(int256(tick)) << 128)
                            + (int256(liquidityNet) & 0x00000000000000000000000000000000ffffffffffffffffffffffffffffffff);
                        tickInfo = bytes.concat(tickInfo, bytes32(uint256(data)));

                        index++;
                    }

                    res = res << 1;
                    if (i == 0) break;
                }
            }
            isInitPoint = false;
            tmp.initPoint2 = 256;

            tmp.left--;
        }
        return tickInfo;
    }

    function queryAlgebraTicksSuperCompact3(address pool, uint256 len) public view returns (bytes memory) {
        SuperVar memory tmp;
        tmp.tickSpacing = 1;

        {
            (, bytes memory slot0) = pool.staticcall(abi.encodeWithSignature("globalState()"));
            int24 currTick;
            assembly {
                currTick := mload(add(slot0, 64))
            }
            tmp.currTick = currTick;
        }
        int24 step = int24(int256(len)) * 200;
        tmp.right = tmp.currTick / tmp.tickSpacing / int24(256);
        tmp.leftMost = (tmp.currTick - step) / tmp.tickSpacing / int24(256) - 2;
        tmp.rightMost = (tmp.currTick + step) / tmp.tickSpacing / int24(256) + 1;

        if (tmp.currTick < 0) {
            tmp.initPoint = uint256(
                int256(tmp.currTick) / int256(tmp.tickSpacing)
                    - (int256(tmp.currTick) / int256(tmp.tickSpacing) / 256 - 1) * 256
            ) % 256;
        } else {
            tmp.initPoint = (uint256(int256(tmp.currTick)) / uint256(int256(tmp.tickSpacing))) % 256;
        }

        tmp.initPoint2 = tmp.initPoint;

        if (tmp.currTick < 0) tmp.right--;

        bytes memory tickInfo;

        tmp.left = tmp.right;

        uint256 index = 0;

        while (index < len / 2 && tmp.right < tmp.rightMost) {
            uint256 res = IAlgebraPoolV1_9(pool).tickTable(int16(tmp.right));
            if (res > 0) {
                res = res >> tmp.initPoint;
                for (uint256 i = tmp.initPoint; i < 256 && index < len / 2; i++) {
                    uint256 isInit = res & 0x01;
                    if (isInit > 0) {
                        int256 tick = int256((256 * tmp.right + int256(i)) * tmp.tickSpacing);
                        // (, int128 liquidityNet,,,,,,) = IAlgebraPoolV1_9(pool).ticks(int24(int256(tick)));
                        (, bytes memory deltaL) = pool.staticcall(abi.encodeWithSignature("ticks(int24)", tick));
                        int128 liquidityNet;
                        assembly {
                            liquidityNet := mload(add(deltaL, 64))
                        }

                        int256 data = int256(uint256(int256(tick)) << 128)
                            + (int256(liquidityNet) & 0x00000000000000000000000000000000ffffffffffffffffffffffffffffffff);
                        tickInfo = bytes.concat(tickInfo, bytes32(uint256(data)));

                        index++;
                    }

                    res = res >> 1;
                }
            }
            tmp.initPoint = 0;
            tmp.right++;
        }
        bool isInitPoint = true;
        while (index < len && tmp.left > tmp.leftMost) {
            uint256 res = IAlgebraPoolV1_9(pool).tickTable(int16(tmp.left));
            if (res > 0 && tmp.initPoint2 != 0) {
                res = isInitPoint ? res << ((256 - tmp.initPoint2) % 256) : res;

                for (uint256 i = tmp.initPoint2 - 1; i >= 0 && index < len; i--) {
                    uint256 isInit = res & 0x8000000000000000000000000000000000000000000000000000000000000000;
                    if (isInit > 0) {
                        int256 tick = int256((256 * tmp.left + int256(i)) * tmp.tickSpacing);
                        // (, int128 liquidityNet,,,,,,) = IAlgebraPoolV1_9(pool).ticks(int24(int256(tick)));

                        (, bytes memory deltaL) = pool.staticcall(abi.encodeWithSignature("ticks(int24)", tick));
                        int128 liquidityNet;
                        assembly {
                            liquidityNet := mload(add(deltaL, 64))
                        }
                        int256 data = int256(uint256(int256(tick)) << 128)
                            + (int256(liquidityNet) & 0x00000000000000000000000000000000ffffffffffffffffffffffffffffffff);
                        tickInfo = bytes.concat(tickInfo, bytes32(uint256(data)));

                        index++;
                    }

                    res = res << 1;
                    if (i == 0) break;
                }
            }
            isInitPoint = false;
            tmp.initPoint2 = 256;

            tmp.left--;
        }
        return tickInfo;
    }
}

// SPDX-License-Identifier: MIT
pragma solidity 0.8.17;

import "../interface/IAlgebraPool.sol";
import "../interface/ICLPoolManager.sol";
import "../interface/IHooks.sol";
import "../interface/IHorizonPool.sol";
import "../interface/IPoolManager.sol";
import "../interface/IPositionManager.sol";
import "../interface/IStateView.sol";
import "../interface/IUniswapV3Pool.sol";
import "../interface/IZora.sol";
import "../interface/IZumiPool.sol";

library QueryHorizonTicksSuperCompact {
    int24 internal constant MIN_TICK_MINUS_1 = -887_272 - 1;
    int24 internal constant MAX_TICK_PLUS_1 = 887_272 + 1;
    bytes32 public constant POOLS_SLOT = bytes32(uint256(6));
    address public constant PANCAKE_INFINITY_CLPOOLMANAGER = 0xa0FfB9c1CE1Fe56963B0321B32E7A0302114058b;
    address public constant PANCAKE_INFINITY_POSITION_MANAGER = 0x55f4c8abA71A1e923edC303eb4fEfF14608cC226;
    uint256 internal constant OFFSET_TICK_SPACING = 16;

    struct SuperVar {
        int24 tickSpacing;
        int24 currTick;
        int24 right;
        int24 left;
        int24 leftMost;
        int24 rightMost;
        uint256 initPoint;
        uint256 initPoint2;
    }

    function queryHorizonTicksSuperCompact(address pool, uint256 len) public view returns (bytes memory) {
        (,, int24 currTick,) = IHorizonPool(pool).getPoolState();
        int24 currTick2 = currTick;
        uint256 threshold = len / 2;

        // travel from left to right
        bytes memory tickInfo;

        while (currTick < MAX_TICK_PLUS_1 && len > threshold) {
            (, int128 liquidityNet,,) = IHorizonPool(pool).ticks(currTick);

            int256 data = int256(uint256(int256(currTick)) << 128)
                + (int256(liquidityNet) & 0x00000000000000000000000000000000ffffffffffffffffffffffffffffffff);
            tickInfo = bytes.concat(tickInfo, bytes32(uint256(data)));
            (, int24 nextTick) = IHorizonPool(pool).initializedTicks(currTick);
            if (currTick == nextTick) {
                break;
            }
            currTick = nextTick;
            len--;
        }

        while (currTick2 > MIN_TICK_MINUS_1 && len > 0) {
            (, int128 liquidityNet,,) = IHorizonPool(pool).ticks(currTick2);
            int256 data = int256(uint256(int256(currTick2)) << 128)
                + (int256(liquidityNet) & 0x00000000000000000000000000000000ffffffffffffffffffffffffffffffff);
            tickInfo = bytes.concat(tickInfo, bytes32(uint256(data)));
            (int24 prevTick,) = IHorizonPool(pool).initializedTicks(currTick2);
            if (prevTick == currTick2) {
                break;
            }
            currTick2 = prevTick;
            len--;
        }

        return tickInfo;
    }
}

// SPDX-License-Identifier: MIT
pragma solidity 0.8.17;

import "../interface/IAlgebraPool.sol";
import "../interface/ICLPoolManager.sol";
import "../interface/IHooks.sol";
import "../interface/IHorizonPool.sol";
import "../interface/IPoolManager.sol";
import "../interface/IPositionManager.sol";
import "../interface/IStateView.sol";
import "../interface/IUniswapV3Pool.sol";
import "../interface/IZora.sol";
import "../interface/IZumiPool.sol";

library QueryIzumiSuperCompact {
    int24 internal constant MIN_TICK_MINUS_1 = -887_272 - 1;
    int24 internal constant MAX_TICK_PLUS_1 = 887_272 + 1;
    bytes32 public constant POOLS_SLOT = bytes32(uint256(6));
    address public constant PANCAKE_INFINITY_CLPOOLMANAGER = 0xa0FfB9c1CE1Fe56963B0321B32E7A0302114058b;
    address public constant PANCAKE_INFINITY_POSITION_MANAGER = 0x55f4c8abA71A1e923edC303eb4fEfF14608cC226;
    uint256 internal constant OFFSET_TICK_SPACING = 16;

    struct SuperVar {
        int24 tickSpacing;
        int24 currTick;
        int24 right;
        int24 left;
        int24 leftMost;
        int24 rightMost;
        uint256 initPoint;
        uint256 initPoint2;
    }

    function queryIzumiSuperCompact(address pool, uint256 len) public view returns (bytes memory, bytes memory) {
        SuperVar memory tmp;
        tmp.tickSpacing = IZumiPool(pool).pointDelta();
        {
            (, bytes memory slot0) = pool.staticcall(abi.encodeWithSignature("state()"));
            int24 currTick;
            assembly {
                currTick := mload(add(slot0, 64))
            }
            tmp.currTick = currTick;
        }

        tmp.right = tmp.currTick / tmp.tickSpacing / int24(256);
        tmp.leftMost = -887_272 / tmp.tickSpacing / int24(256) - 2;
        tmp.rightMost = 887_272 / tmp.tickSpacing / int24(256) + 1;

        if (tmp.currTick < 0) {
            tmp.initPoint = uint256(
                int256(tmp.currTick) / int256(tmp.tickSpacing)
                    - (int256(tmp.currTick) / int256(tmp.tickSpacing) / 256 - 1) * 256
            ) % 256;
        } else {
            tmp.initPoint = (uint256(int256(tmp.currTick)) / uint256(int256(tmp.tickSpacing))) % 256;
        }
        tmp.initPoint2 = tmp.initPoint;

        if (tmp.currTick < 0) tmp.right--;

        bytes memory tickInfo;
        bytes memory limitOrderInfo;

        tmp.left = tmp.right;

        uint256 index = 0;

        while (index < len / 2 && tmp.right < tmp.rightMost) {
            uint256 res = IZumiPool(pool).pointBitmap(int16(tmp.right));
            if (res > 0) {
                res = res >> tmp.initPoint;
                for (uint256 i = tmp.initPoint; i < 256; i++) {
                    uint256 isInit = res & 0x01;
                    if (isInit > 0) {
                        int24 tick = int24(int256((256 * tmp.right + int256(i)) * tmp.tickSpacing));
                        int24 orderOrEndpoint = IZumiPool(pool).orderOrEndpoint(tick / tmp.tickSpacing);
                        if (orderOrEndpoint & 0x01 == 0x01) {
                            (, int128 liquidityNet,,,) = IZumiPool(pool).points(tick);
                            if (liquidityNet != 0) {
                                int256 data = int256(uint256(int256(tick)) << 128)
                                    + (
                                        int256(liquidityNet)
                                            & 0x00000000000000000000000000000000ffffffffffffffffffffffffffffffff
                                    );
                                tickInfo = bytes.concat(tickInfo, bytes32(uint256(data)));

                                index++;
                            }
                        }
                        if (orderOrEndpoint & 0x02 == 0x02) {
                            (uint128 sellingX,,,,, uint128 sellingY,,,,) = IZumiPool(pool).limitOrderData(tick);
                            if (sellingX != 0 || sellingY != 0) {
                                bytes32 data =
                                    bytes32(abi.encodePacked(int32(tick), uint112(sellingX), uint112(sellingY)));
                                limitOrderInfo = bytes.concat(limitOrderInfo, data);

                                index++;
                            }
                        }
                    }

                    res = res >> 1;
                }
            }
            tmp.initPoint = 0;
            tmp.right++;
        }
        bool isInitPoint = true;
        while (index < len && tmp.left > tmp.leftMost) {
            uint256 res = IZumiPool(pool).pointBitmap(int16(tmp.left));
            if (res > 0 && tmp.initPoint2 != 0) {
                res = isInitPoint ? res << ((256 - tmp.initPoint2) % 256) : res;
                for (uint256 i = tmp.initPoint2 - 1; i >= 0 && index < len; i--) {
                    uint256 isInit = res & 0x8000000000000000000000000000000000000000000000000000000000000000;
                    if (isInit > 0) {
                        int24 tick = int24(int256((256 * tmp.left + int256(i)) * tmp.tickSpacing));

                        int24 orderOrEndpoint = IZumiPool(pool).orderOrEndpoint(tick / tmp.tickSpacing);
                        if (orderOrEndpoint & 0x01 == 0x01) {
                            (, int128 liquidityNet,,,) = IZumiPool(pool).points(tick);
                            if (liquidityNet != 0) {
                                int256 data = int256(uint256(int256(tick)) << 128)
                                    + (
                                        int256(liquidityNet)
                                            & 0x00000000000000000000000000000000ffffffffffffffffffffffffffffffff
                                    );
                                tickInfo = bytes.concat(tickInfo, bytes32(uint256(data)));

                                index++;
                            }
                        }
                        if (orderOrEndpoint & 0x02 == 0x02) {
                            (uint128 sellingX,,,,, uint128 sellingY,,,,) = IZumiPool(pool).limitOrderData(tick);
                            if (sellingX != 0 || sellingY != 0) {
                                bytes32 data =
                                    bytes32(abi.encodePacked(int32(tick), uint112(sellingX), uint112(sellingY)));
                                limitOrderInfo = bytes.concat(limitOrderInfo, data);

                                index++;
                            }
                        }
                    }
                    res = res << 1;
                    if (i == 0) break;
                }
            }
            isInitPoint = false;
            tmp.initPoint2 = 256;

            tmp.left--;
        }
        return (tickInfo, limitOrderInfo);
    }
}

// SPDX-License-Identifier: MIT
pragma solidity 0.8.17;

import "../interface/IAlgebraPool.sol";
import "../interface/ICLPoolManager.sol";
import "../interface/IHooks.sol";
import "../interface/IHorizonPool.sol";
import "../interface/IPoolManager.sol";
import "../interface/IPositionManager.sol";
import "../interface/IStateView.sol";
import "../interface/IUniswapV3Pool.sol";
import "../interface/IZora.sol";
import "../interface/IZumiPool.sol";

library QueryUniv4TicksSuperCompact {
    int24 internal constant MIN_TICK_MINUS_1 = -887_272 - 1;
    int24 internal constant MAX_TICK_PLUS_1 = 887_272 + 1;
    bytes32 public constant POOLS_SLOT = bytes32(uint256(6));

    address public constant PANCAKE_INFINITY_CLPOOLMANAGER = 0xa0FfB9c1CE1Fe56963B0321B32E7A0302114058b;
    address public constant PANCAKE_INFINITY_POSITION_MANAGER = 0x55f4c8abA71A1e923edC303eb4fEfF14608cC226;
    uint256 internal constant OFFSET_TICK_SPACING = 16;

    struct SuperVar {
        int24 tickSpacing;
        int24 currTick;
        int24 right;
        int24 left;
        int24 leftMost;
        int24 rightMost;
        uint256 initPoint;
        uint256 initPoint2;
    }

    function getTickSpacing(bytes32 params) internal pure returns (int24 tickSpacing) {
        assembly {
            tickSpacing := and(shr(OFFSET_TICK_SPACING, params), 0xffffff)
        }
    }

    function queryUniv4TicksSuperCompact(
        bytes32 poolId,
        uint256 len,
        address POOL_MANAGER,
        address STATE_VIEW,
        address POSITION_MANAGER
    ) public view returns (bytes memory) {
        SuperVar memory tmp;
        IPositionManager.PoolKey memory poolkey = IPositionManager(POSITION_MANAGER).poolKeys(bytes25(poolId));
        tmp.tickSpacing = poolkey.tickSpacing;

        IStateView.PoolId statePoolId = IStateView.PoolId.wrap(poolId);

        {
            (uint160 sqrtPriceX96, int24 tick, uint24 protocolFee, uint24 lpFee) =
                IStateView(STATE_VIEW).getSlot0(statePoolId);
            tmp.currTick = tick;
        }

        tmp.right = tmp.currTick / tmp.tickSpacing / int24(256);
        tmp.leftMost = -887_272 / tmp.tickSpacing / int24(256) - 2;
        tmp.rightMost = 887_272 / tmp.tickSpacing / int24(256) + 1;

        if (tmp.currTick < 0) {
            tmp.initPoint = uint256(
                int256(tmp.currTick) / int256(tmp.tickSpacing)
                    - (int256(tmp.currTick) / int256(tmp.tickSpacing) / 256 - 1) * 256
            ) % 256;
        } else {
            tmp.initPoint = (uint256(int256(tmp.currTick)) / uint256(int256(tmp.tickSpacing))) % 256;
        }
        tmp.initPoint2 = tmp.initPoint;

        if (tmp.currTick < 0) tmp.right--;

        bytes memory tickInfo;
        tmp.left = tmp.right;

        uint256 index = 0;

        while (index < len / 2 && tmp.right < tmp.rightMost) {
            uint256 res = IStateView(STATE_VIEW).getTickBitmap(statePoolId, int16(tmp.right));
            if (res > 0) {
                res = res >> tmp.initPoint;
                for (uint256 i = tmp.initPoint; i < 256 && index < len / 2; i++) {
                    uint256 isInit = res & 0x01;
                    if (isInit > 0) {
                        int256 tick = int256((256 * tmp.right + int256(i)) * tmp.tickSpacing);

                        (uint128 liquidityGross, int128 liquidityNet) =
                            IStateView(STATE_VIEW).getTickLiquidity(statePoolId, int24(int256(tick)));

                        int256 data = int256(uint256(int256(tick)) << 128)
                            + (int256(liquidityNet) & 0x00000000000000000000000000000000ffffffffffffffffffffffffffffffff);
                        tickInfo = bytes.concat(tickInfo, bytes32(uint256(data)));

                        index++;
                    }

                    res = res >> 1;
                }
            }
            tmp.initPoint = 0;
            tmp.right++;
        }

        bool isInitPoint = true;
        while (index < len && tmp.left > tmp.leftMost) {
            uint256 res = IStateView(STATE_VIEW).getTickBitmap(statePoolId, int16(tmp.left));
            if (res > 0 && tmp.initPoint2 != 0) {
                res = isInitPoint ? res << ((256 - tmp.initPoint2) % 256) : res;
                for (uint256 i = tmp.initPoint2 - 1; i >= 0 && index < len; i--) {
                    uint256 isInit = res & 0x8000000000000000000000000000000000000000000000000000000000000000;
                    if (isInit > 0) {
                        int256 tick = int256((256 * tmp.left + int256(i)) * tmp.tickSpacing);

                        (uint128 liquidityGross, int128 liquidityNet) =
                            IStateView(STATE_VIEW).getTickLiquidity(statePoolId, int24(int256(tick)));

                        int256 data = int256(uint256(int256(tick)) << 128)
                            + (int256(liquidityNet) & 0x00000000000000000000000000000000ffffffffffffffffffffffffffffffff);
                        tickInfo = bytes.concat(tickInfo, bytes32(uint256(data)));

                        index++;
                    }

                    res = res << 1;
                    if (i == 0) break;
                }
            }
            isInitPoint = false;
            tmp.initPoint2 = 256;
            tmp.left--;
        }
        return tickInfo;
    }

    function queryPancakeInfinityTicksSuperCompact(
        bytes32 poolId,
        uint256 len,
        address POOL_MANAGER,
        address STATE_VIEW,
        address POSITION_MANAGER
    ) public view returns (bytes memory) {
        SuperVar memory tmp;

        {
            (, bytes memory result) = PANCAKE_INFINITY_POSITION_MANAGER.staticcall(
                abi.encodeWithSignature("poolKeys(bytes25)", bytes25(poolId))
            );
            bytes32 parameters;
            assembly {
                // Skip currency0 (32), currency1 (32), hooks (32), poolManager (32), fee (32)
                // Parameters is at offset 160 (32 * 5)
                parameters := mload(add(result, 192))
            }
            tmp.tickSpacing = getTickSpacing(parameters);
        }

        ICLPoolManager.PoolId clPoolId = ICLPoolManager.PoolId.wrap(poolId);

        {
            (, int24 tick,,) = ICLPoolManager(PANCAKE_INFINITY_CLPOOLMANAGER).getSlot0(clPoolId);
            tmp.currTick = tick;
        }

        tmp.right = tmp.currTick / tmp.tickSpacing / int24(256);
        tmp.leftMost = -887_272 / tmp.tickSpacing / int24(256) - 2;
        tmp.rightMost = 887_272 / tmp.tickSpacing / int24(256) + 1;

        if (tmp.currTick < 0) {
            tmp.initPoint = uint256(
                int256(tmp.currTick) / int256(tmp.tickSpacing)
                    - (int256(tmp.currTick) / int256(tmp.tickSpacing) / 256 - 1) * 256
            ) % 256;
        } else {
            tmp.initPoint = (uint256(int256(tmp.currTick)) / uint256(int256(tmp.tickSpacing))) % 256;
        }
        tmp.initPoint2 = tmp.initPoint;

        if (tmp.currTick < 0) tmp.right--;

        bytes memory tickInfo;
        tmp.left = tmp.right;

        uint256 index = 0;

        while (index < len / 2 && tmp.right < tmp.rightMost) {
            uint256 res = ICLPoolManager(PANCAKE_INFINITY_CLPOOLMANAGER).getPoolBitmapInfo(clPoolId, int16(tmp.right));
            if (res > 0) {
                res = res >> tmp.initPoint;
                for (uint256 i = tmp.initPoint; i < 256 && index < len / 2; i++) {
                    uint256 isInit = res & 0x01;
                    if (isInit > 0) {
                        int256 tick = int256((256 * tmp.right + int256(i)) * tmp.tickSpacing);

                        Tick.Info memory tickInfo_ = ICLPoolManager(PANCAKE_INFINITY_CLPOOLMANAGER).getPoolTickInfo(
                            clPoolId, int24(int256(tick))
                        );
                        int128 liquidityNet = tickInfo_.liquidityNet;

                        int256 data = int256(uint256(int256(tick)) << 128)
                            + (int256(liquidityNet) & 0x00000000000000000000000000000000ffffffffffffffffffffffffffffffff);
                        tickInfo = bytes.concat(tickInfo, bytes32(uint256(data)));

                        index++;
                    }

                    res = res >> 1;
                }
            }
            tmp.initPoint = 0;
            tmp.right++;
        }

        bool isInitPoint = true;
        while (index < len && tmp.left > tmp.leftMost) {
            uint256 res = ICLPoolManager(PANCAKE_INFINITY_CLPOOLMANAGER).getPoolBitmapInfo(clPoolId, int16(tmp.left));
            if (res > 0 && tmp.initPoint2 != 0) {
                res = isInitPoint ? res << ((256 - tmp.initPoint2) % 256) : res;
                for (uint256 i = tmp.initPoint2 - 1; i >= 0 && index < len; i--) {
                    uint256 isInit = res & 0x8000000000000000000000000000000000000000000000000000000000000000;
                    if (isInit > 0) {
                        int256 tick = int256((256 * tmp.left + int256(i)) * tmp.tickSpacing);

                        Tick.Info memory tickInfo_ = ICLPoolManager(PANCAKE_INFINITY_CLPOOLMANAGER).getPoolTickInfo(
                            clPoolId, int24(int256(tick))
                        );
                        int128 liquidityNet = tickInfo_.liquidityNet;

                        int256 data = int256(uint256(int256(tick)) << 128)
                            + (int256(liquidityNet) & 0x00000000000000000000000000000000ffffffffffffffffffffffffffffffff);
                        tickInfo = bytes.concat(tickInfo, bytes32(uint256(data)));

                        index++;
                    }

                    res = res << 1;
                    if (i == 0) break;
                }
            }
            isInitPoint = false;
            tmp.initPoint2 = 256;
            tmp.left--;
        }
        return tickInfo;
    }
}

// SPDX-License-Identifier: MIT
pragma solidity 0.8.17;

import "../interface/IAlgebraPool.sol";
import "../interface/ICLPoolManager.sol";
import "../interface/IHooks.sol";
import "../interface/IHorizonPool.sol";
import "../interface/IPoolManager.sol";
import "../interface/IPositionManager.sol";
import "../interface/IStateView.sol";
import "../interface/IUniswapV3Pool.sol";
import "../interface/IZora.sol";
import "../interface/IZumiPool.sol";

library QueryZoraTicksSuperCompact {
    int24 internal constant MIN_TICK_MINUS_1 = -887_272 - 1;
    int24 internal constant MAX_TICK_PLUS_1 = 887_272 + 1;
    bytes32 public constant POOLS_SLOT = bytes32(uint256(6));
    address public constant PANCAKE_INFINITY_CLPOOLMANAGER = 0xa0FfB9c1CE1Fe56963B0321B32E7A0302114058b;
    address public constant PANCAKE_INFINITY_POSITION_MANAGER = 0x55f4c8abA71A1e923edC303eb4fEfF14608cC226;
    uint256 internal constant OFFSET_TICK_SPACING = 16;

    struct SuperVar {
        int24 tickSpacing;
        int24 currTick;
        int24 right;
        int24 left;
        int24 leftMost;
        int24 rightMost;
        uint256 initPoint;
        uint256 initPoint2;
    }

    function queryZoraTicksSuperCompact(
        address coin,
        uint256 len,
        address POOL_MANAGER,
        address STATE_VIEW,
        address POSITION_MANAGER
    ) public view returns (bytes memory) {
        SuperVar memory tmp;
        IZoraCoin.PoolKey memory poolkey = IZoraCoin(coin).getPoolKey();
        tmp.tickSpacing = poolkey.tickSpacing;
        bytes32 poolId = toId(poolkey);
        IStateView.PoolId statePoolId = IStateView.PoolId.wrap(poolId);

        {
            (uint160 sqrtPriceX96, int24 tick, uint24 protocolFee, uint24 lpFee) =
                IStateView(STATE_VIEW).getSlot0(statePoolId);
            tmp.currTick = tick;
        }

        tmp.right = tmp.currTick / tmp.tickSpacing / int24(256);
        tmp.leftMost = -887_272 / tmp.tickSpacing / int24(256) - 2;
        tmp.rightMost = 887_272 / tmp.tickSpacing / int24(256) + 1;

        if (tmp.currTick < 0) {
            tmp.initPoint = uint256(
                int256(tmp.currTick) / int256(tmp.tickSpacing)
                    - (int256(tmp.currTick) / int256(tmp.tickSpacing) / 256 - 1) * 256
            ) % 256;
        } else {
            tmp.initPoint = (uint256(int256(tmp.currTick)) / uint256(int256(tmp.tickSpacing))) % 256;
        }
        tmp.initPoint2 = tmp.initPoint;

        if (tmp.currTick < 0) tmp.right--;

        bytes memory tickInfo;
        tmp.left = tmp.right;

        uint256 index = 0;

        while (index < len / 2 && tmp.right < tmp.rightMost) {
            uint256 res = IStateView(STATE_VIEW).getTickBitmap(statePoolId, int16(tmp.right));
            if (res > 0) {
                res = res >> tmp.initPoint;
                for (uint256 i = tmp.initPoint; i < 256 && index < len / 2; i++) {
                    uint256 isInit = res & 0x01;
                    if (isInit > 0) {
                        int256 tick = int256((256 * tmp.right + int256(i)) * tmp.tickSpacing);

                        (uint128 liquidityGross, int128 liquidityNet) =
                            IStateView(STATE_VIEW).getTickLiquidity(statePoolId, int24(int256(tick)));

                        int256 data = int256(uint256(int256(tick)) << 128)
                            + (int256(liquidityNet) & 0x00000000000000000000000000000000ffffffffffffffffffffffffffffffff);
                        tickInfo = bytes.concat(tickInfo, bytes32(uint256(data)));

                        index++;
                    }

                    res = res >> 1;
                }
            }
            tmp.initPoint = 0;
            tmp.right++;
        }

        bool isInitPoint = true;
        while (index < len && tmp.left > tmp.leftMost) {
            uint256 res = IStateView(STATE_VIEW).getTickBitmap(statePoolId, int16(tmp.left));
            if (res > 0 && tmp.initPoint2 != 0) {
                res = isInitPoint ? res << ((256 - tmp.initPoint2) % 256) : res;
                for (uint256 i = tmp.initPoint2 - 1; i >= 0 && index < len; i--) {
                    uint256 isInit = res & 0x8000000000000000000000000000000000000000000000000000000000000000;
                    if (isInit > 0) {
                        int256 tick = int256((256 * tmp.left + int256(i)) * tmp.tickSpacing);

                        (uint128 liquidityGross, int128 liquidityNet) =
                            IStateView(STATE_VIEW).getTickLiquidity(statePoolId, int24(int256(tick)));

                        int256 data = int256(uint256(int256(tick)) << 128)
                            + (int256(liquidityNet) & 0x00000000000000000000000000000000ffffffffffffffffffffffffffffffff);
                        tickInfo = bytes.concat(tickInfo, bytes32(uint256(data)));

                        index++;
                    }

                    res = res << 1;
                    if (i == 0) break;
                }
            }
            isInitPoint = false;
            tmp.initPoint2 = 256;
            tmp.left--;
        }
        return tickInfo;
    }
    // General function for all v4 pools

    function toId(IZoraCoin.PoolKey memory poolKey) public pure returns (bytes32 poolId) {
        assembly ("memory-safe") {
            // 0xa0 represents the total size of the poolKey struct (5 slots of 32 bytes)
            poolId := keccak256(poolKey, 0xa0)
        }
    }

    // Specifically for Zora
    function getPoolKeyOfZora(address coin, address POOL_MANAGER, address STATE_VIEW, address POSITION_MANAGER)
        public
        view
        returns (IZoraCoin.PoolKey memory)
    {
        IZoraCoin.PoolKey memory poolKey = IZoraCoin(coin).getPoolKey();
        return poolKey;
    }

    // Specifically for Zora
    function getSlot0OfZora(address coin, address POOL_MANAGER, address STATE_VIEW, address POSITION_MANAGER)
        public
        view
        returns (int256 liquidity, uint160 sqrtPriceX96, int24 tick, uint24 protocolFee, uint24 lpFee)
    {
        IZoraCoin.PoolKey memory poolKey = IZoraCoin(coin).getPoolKey();
        bytes32 poolId = toId(poolKey);
        bytes32 slot = _getPoolStateSlot(poolId);
        bytes32[] memory slot0 = IPoolManager(POOL_MANAGER).extsload(slot, 4);
        bytes32 data = slot0[0];
        liquidity = int256(uint256(slot0[3]));

        //   24 bits  |24bits|24bits      |24 bits|160 bits
        // 0x000000   |000bb8|000000      |ffff75 |0000000000000000fe3aa841ba359daa0ea9eff7
        // ---------- | fee  |protocolfee | tick  | sqrtPriceX96
        assembly ("memory-safe") {
            // bottom 160 bits of data
            sqrtPriceX96 := and(data, 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF)
            // next 24 bits of data
            tick := signextend(2, shr(160, data))
            // next 24 bits of data
            protocolFee := and(shr(184, data), 0xFFFFFF)
            // last 24 bits of data
            lpFee := and(shr(208, data), 0xFFFFFF)
        }
    }

    function _getPoolStateSlot(bytes32 poolId) internal pure returns (bytes32) {
        return keccak256(abi.encodePacked(poolId, POOLS_SLOT));
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/Address.sol)

pragma solidity ^0.8.1;

/**
 * @dev Collection of functions related to the address type
 */
library AddressUpgradeable {
    /**
     * @dev Returns true if `account` is a contract.
     *
     * [IMPORTANT]
     * ====
     * It is unsafe to assume that an address for which this function returns
     * false is an externally-owned account (EOA) and not a contract.
     *
     * Among others, `isContract` will return false for the following
     * types of addresses:
     *
     *  - an externally-owned account
     *  - a contract in construction
     *  - an address where a contract will be created
     *  - an address where a contract lived, but was destroyed
     *
     * Furthermore, `isContract` will also return true if the target contract within
     * the same transaction is already scheduled for destruction by `SELFDESTRUCT`,
     * which only has an effect at the end of a transaction.
     * ====
     *
     * [IMPORTANT]
     * ====
     * You shouldn't rely on `isContract` to protect against flash loan attacks!
     *
     * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
     * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
     * constructor.
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies on extcodesize/address.code.length, which returns 0
        // for contracts in construction, since the code is only stored at the end
        // of the constructor execution.

        return account.code.length > 0;
    }

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

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

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

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

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

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

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

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal view returns (bytes memory) {
        (bool success, bytes memory returndata) = target.staticcall(data);
        return verifyCallResultFromTarget(target, success, returndata, errorMessage);
    }

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

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal returns (bytes memory) {
        (bool success, bytes memory returndata) = target.delegatecall(data);
        return verifyCallResultFromTarget(target, success, returndata, errorMessage);
    }

    /**
     * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling
     * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.
     *
     * _Available since v4.8._
     */
    function verifyCallResultFromTarget(
        address target,
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) internal view returns (bytes memory) {
        if (success) {
            if (returndata.length == 0) {
                // only check isContract if the call was successful and the return data is empty
                // otherwise we already know that it was a contract
                require(isContract(target), "Address: call to non-contract");
            }
            return returndata;
        } else {
            _revert(returndata, errorMessage);
        }
    }

    /**
     * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the
     * revert reason or using the provided one.
     *
     * _Available since v4.3._
     */
    function verifyCallResult(
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) internal pure returns (bytes memory) {
        if (success) {
            return returndata;
        } else {
            _revert(returndata, errorMessage);
        }
    }

    function _revert(bytes memory returndata, string memory errorMessage) private pure {
        // Look for revert reason and bubble it up if present
        if (returndata.length > 0) {
            // The easiest way to bubble the revert reason is using memory via assembly
            /// @solidity memory-safe-assembly
            assembly {
                let returndata_size := mload(returndata)
                revert(add(32, returndata), returndata_size)
            }
        } else {
            revert(errorMessage);
        }
    }
}

// SPDX-License-Identifier: MIT
pragma solidity 0.8.17;

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

// SPDX-License-Identifier: MIT
pragma solidity 0.8.17;

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

Settings
{
  "remappings": [
    "@openzeppelin/contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts/",
    "@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/",
    "erc4626-tests/=lib/openzeppelin-contracts-upgradeable/lib/erc4626-tests/",
    "forge-std/=lib/forge-std/src/",
    "halmos-cheatcodes/=lib/openzeppelin-contracts-upgradeable/lib/halmos-cheatcodes/src/",
    "openzeppelin-contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/",
    "openzeppelin-contracts/=lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/",
    "ds-test/=lib/openzeppelin-contracts-upgradeable/lib/forge-std/lib/ds-test/src/",
    "openzeppelin/=lib/openzeppelin-contracts-upgradeable/contracts/"
  ],
  "optimizer": {
    "enabled": false,
    "runs": 200
  },
  "metadata": {
    "useLiteralContent": false,
    "bytecodeHash": "ipfs"
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "evmVersion": "london",
  "viaIR": false,
  "libraries": {
    "src/Quote.sol": {
      "QueryAlgebraTicksSuperCompact": "0x5156142cc4393bec8563c88acf5da2b6163343aa",
      "QueryHorizonTicksSuperCompact": "0x527c89b1012948165c29922520b3cbb202ad922c",
      "QueryIzumiSuperCompact": "0x213d25f187c31b3184047c6fa0c47ebf64f4d4c0",
      "QueryUniv3TicksSuperCompact": "0xcd69c342adc132f27918a6febf34159d8010c249",
      "QueryUniv4TicksSuperCompact": "0x42e9a1c3b1bf8caffc09bc1e8006affded0b3471",
      "QueryZoraTicksSuperCompact": "0x630b63ae9bad0460cf59024e02124754a5a9c0a6"
    }
  }
}

Contract Security Audit

Contract ABI

API
[{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint8","name":"version","type":"uint8"}],"name":"Initialized","type":"event"},{"inputs":[],"name":"PANCAKE_INFINITY_CLPOOLMANAGER","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PANCAKE_INFINITY_POSITION_MANAGER","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"POOLS_SLOT","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"POOL_MANAGER","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"POSITION_MANAGER","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"STATE_VIEW","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"coin","type":"address"}],"name":"getPoolKeyOfZora","outputs":[{"components":[{"internalType":"IZoraCoin.Currency","name":"currency0","type":"address"},{"internalType":"IZoraCoin.Currency","name":"currency1","type":"address"},{"internalType":"uint24","name":"fee","type":"uint24"},{"internalType":"int24","name":"tickSpacing","type":"int24"},{"internalType":"contract IHooks","name":"hooks","type":"address"}],"internalType":"struct IZoraCoin.PoolKey","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"coin","type":"address"}],"name":"getSlot0OfZora","outputs":[{"internalType":"int256","name":"liquidity","type":"int256"},{"internalType":"uint160","name":"sqrtPriceX96","type":"uint160"},{"internalType":"int24","name":"tick","type":"int24"},{"internalType":"uint24","name":"protocolFee","type":"uint24"},{"internalType":"uint24","name":"lpFee","type":"uint24"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"stateView","type":"address"},{"internalType":"address","name":"positionManager","type":"address"},{"internalType":"address","name":"poolManager","type":"address"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"pool","type":"address"},{"internalType":"uint256","name":"len","type":"uint256"}],"name":"queryAlgebraTicksSuperCompact","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"pool","type":"address"},{"internalType":"uint256","name":"len","type":"uint256"}],"name":"queryAlgebraTicksSuperCompact2","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"pool","type":"address"},{"internalType":"uint256","name":"len","type":"uint256"}],"name":"queryAlgebraTicksSuperCompact3","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"pool","type":"address"},{"internalType":"uint256","name":"len","type":"uint256"}],"name":"queryAlgebraTicksSuperCompact3_back","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"pool","type":"address"},{"internalType":"uint256","name":"len","type":"uint256"}],"name":"queryHorizonTicksSuperCompact","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"pool","type":"address"},{"internalType":"uint256","name":"len","type":"uint256"}],"name":"queryIzumiSuperCompact","outputs":[{"internalType":"bytes","name":"","type":"bytes"},{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"poolId","type":"bytes32"},{"internalType":"uint256","name":"len","type":"uint256"}],"name":"queryPancakeInfinityTicksSuperCompact","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"pool","type":"address"},{"internalType":"uint256","name":"len","type":"uint256"}],"name":"queryUniv3TicksSuperCompact","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"poolId","type":"bytes32"},{"internalType":"uint256","name":"len","type":"uint256"}],"name":"queryUniv4TicksSuperCompact","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"coin","type":"address"},{"internalType":"uint256","name":"len","type":"uint256"}],"name":"queryZoraTicksSuperCompact","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"IZoraCoin.Currency","name":"currency0","type":"address"},{"internalType":"IZoraCoin.Currency","name":"currency1","type":"address"},{"internalType":"uint24","name":"fee","type":"uint24"},{"internalType":"int24","name":"tickSpacing","type":"int24"},{"internalType":"contract IHooks","name":"hooks","type":"address"}],"internalType":"struct IZoraCoin.PoolKey","name":"poolKey","type":"tuple"}],"name":"toId","outputs":[{"internalType":"bytes32","name":"poolId","type":"bytes32"}],"stateMutability":"pure","type":"function"}]

608060405234801561001057600080fd5b50611e83806100206000396000f3fe608060405234801561001057600080fd5b506004361061012c5760003560e01c80637df8773a116100ad578063c684206c11610071578063c684206c14610382578063ca883bec146103b2578063cd7f833c146103e2578063d1c62f2614610416578063f9f59a77146104465761012c565b80637df8773a146102b857806388c0a8a7146102e8578063aa4cfccd14610318578063c0c53b8b14610336578063c38f8f35146103525761012c565b8063512bcef9116100f4578063512bcef9146101fd57806357eb1da71461022d578063594a1bf31461024b578063609971071461027c57806362308e851461029a5761012c565b80631bea83fe146101315780632d6d225e1461014f57806332c961d91461017f578063417be3f2146101af5780634421ab4b146101df575b600080fd5b610139610476565b604051610146919061110e565b60405180910390f35b6101696004803603810190610164919061119f565b61049c565b604051610176919061126f565b60405180910390f35b6101996004803603810190610194919061147b565b610525565b6040516101a691906114c1565b60405180910390f35b6101c960048036038101906101c4919061119f565b6105a6565b6040516101d6919061126f565b60405180910390f35b6101e761069b565b6040516101f4919061110e565b60405180910390f35b61021760048036038101906102129190611508565b6106b3565b604051610224919061126f565b60405180910390f35b6102356107a8565b60405161024291906114c1565b60405180910390f35b6102656004803603810190610260919061119f565b6107b0565b604051610273929190611548565b60405180910390f35b61028461083d565b604051610291919061110e565b60405180910390f35b6102a2610855565b6040516102af919061110e565b60405180910390f35b6102d260048036038101906102cd919061119f565b61087b565b6040516102df919061126f565b60405180910390f35b61030260048036038101906102fd919061157f565b610904565b60405161030f91906116b2565b60405180910390f35b6103206109f7565b60405161032d919061110e565b60405180910390f35b610350600480360381019061034b91906116cd565b610a1d565b005b61036c6004803603810190610367919061119f565b610c19565b604051610379919061126f565b60405180910390f35b61039c6004803603810190610397919061119f565b610ca2565b6040516103a9919061126f565b60405180910390f35b6103cc60048036038101906103c7919061119f565b610d2b565b6040516103d9919061126f565b60405180910390f35b6103fc60048036038101906103f7919061157f565b610db4565b60405161040d959493929190611766565b60405180910390f35b610430600480360381019061042b9190611508565b610eb3565b60405161043d919061126f565b60405180910390f35b610460600480360381019061045b919061119f565b610fa8565b60405161046d919061126f565b60405180910390f35b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6060735156142cc4393bec8563c88acf5da2b6163343aa632d6d225e84846040518363ffffffff1660e01b81526004016104d79291906117d7565b600060405180830381865af41580156104f4573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f8201168201806040525081019061051d91906118ab565b905092915050565b600073630b63ae9bad0460cf59024e02124754a5a9c0a663aa5d0ea1836040518263ffffffff1660e01b815260040161055e9190611998565b602060405180830381865af415801561057b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061059f91906119c8565b9050919050565b606073630b63ae9bad0460cf59024e02124754a5a9c0a663728bbdb38484600060029054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166040518663ffffffff1660e01b815260040161064d9594939291906119f5565b600060405180830381865af415801561066a573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f8201168201806040525081019061069391906118ab565b905092915050565b73a0ffb9c1ce1fe56963b0321b32e7a0302114058b81565b60607342e9a1c3b1bf8caffc09bc1e8006affded0b34716373d6a12a8484600060029054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166040518663ffffffff1660e01b815260040161075a959493929190611a57565b600060405180830381865af4158015610777573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f820116820180604052508101906107a091906118ab565b905092915050565b600660001b81565b60608073213d25f187c31b3184047c6fa0c47ebf64f4d4c063594a1bf385856040518363ffffffff1660e01b81526004016107ec9291906117d7565b600060405180830381865af4158015610809573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f820116820180604052508101906108329190611aaa565b915091509250929050565b7355f4c8aba71a1e923edc303eb4feff14608cc22681565b600060029054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6060735156142cc4393bec8563c88acf5da2b6163343aa637df8773a84846040518363ffffffff1660e01b81526004016108b69291906117d7565b600060405180830381865af41580156108d3573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f820116820180604052508101906108fc91906118ab565b905092915050565b61090c611054565b73630b63ae9bad0460cf59024e02124754a5a9c0a6634e48281683600060029054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166040518563ffffffff1660e01b81526004016109af9493929190611b22565b60a060405180830381865af41580156109cc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109f09190611c47565b9050919050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008060019054906101000a900460ff16159050808015610a4e5750600160008054906101000a900460ff1660ff16105b80610a7b5750610a5d30611031565b158015610a7a5750600160008054906101000a900460ff1660ff16145b5b610aba576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ab190611cf7565b60405180910390fd5b60016000806101000a81548160ff021916908360ff1602179055508015610af7576001600060016101000a81548160ff0219169083151502179055505b83600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555082600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555081600060026101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508015610c135760008060016101000a81548160ff0219169083151502179055507f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024986001604051610c0a9190611d5f565b60405180910390a15b50505050565b6060735156142cc4393bec8563c88acf5da2b6163343aa63c38f8f3584846040518363ffffffff1660e01b8152600401610c549291906117d7565b600060405180830381865af4158015610c71573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f82011682018060405250810190610c9a91906118ab565b905092915050565b606073527c89b1012948165c29922520b3cbb202ad922c63c684206c84846040518363ffffffff1660e01b8152600401610cdd9291906117d7565b600060405180830381865af4158015610cfa573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f82011682018060405250810190610d2391906118ab565b905092915050565b6060735156142cc4393bec8563c88acf5da2b6163343aa63ca883bec84846040518363ffffffff1660e01b8152600401610d669291906117d7565b600060405180830381865af4158015610d83573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f82011682018060405250810190610dac91906118ab565b905092915050565b600080600080600073630b63ae9bad0460cf59024e02124754a5a9c0a6637a4aeed787600060029054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166040518563ffffffff1660e01b8152600401610e5f9493929190611b22565b60a060405180830381865af4158015610e7c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ea09190611dd2565b9450945094509450945091939590929450565b60607342e9a1c3b1bf8caffc09bc1e8006affded0b347163958956698484600060029054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166040518663ffffffff1660e01b8152600401610f5a959493929190611a57565b600060405180830381865af4158015610f77573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f82011682018060405250810190610fa091906118ab565b905092915050565b606073cd69c342adc132f27918a6febf34159d8010c24963f9f59a7784846040518363ffffffff1660e01b8152600401610fe39291906117d7565b600060405180830381865af4158015611000573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f8201168201806040525081019061102991906118ab565b905092915050565b6000808273ffffffffffffffffffffffffffffffffffffffff163b119050919050565b6040518060a00160405280600073ffffffffffffffffffffffffffffffffffffffff168152602001600073ffffffffffffffffffffffffffffffffffffffff168152602001600062ffffff168152602001600060020b8152602001600073ffffffffffffffffffffffffffffffffffffffff1681525090565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006110f8826110cd565b9050919050565b611108816110ed565b82525050565b600060208201905061112360008301846110ff565b92915050565b6000604051905090565b600080fd5b600080fd5b611146816110ed565b811461115157600080fd5b50565b6000813590506111638161113d565b92915050565b6000819050919050565b61117c81611169565b811461118757600080fd5b50565b60008135905061119981611173565b92915050565b600080604083850312156111b6576111b5611133565b5b60006111c485828601611154565b92505060206111d58582860161118a565b9150509250929050565b600081519050919050565b600082825260208201905092915050565b60005b838110156112195780820151818401526020810190506111fe565b60008484015250505050565b6000601f19601f8301169050919050565b6000611241826111df565b61124b81856111ea565b935061125b8185602086016111fb565b61126481611225565b840191505092915050565b600060208201905081810360008301526112898184611236565b905092915050565b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6112ce82611225565b810181811067ffffffffffffffff821117156112ed576112ec611296565b5b80604052505050565b6000611300611129565b905061130c82826112c5565b919050565b61131a816110ed565b811461132557600080fd5b50565b60008135905061133781611311565b92915050565b600062ffffff82169050919050565b6113558161133d565b811461136057600080fd5b50565b6000813590506113728161134c565b92915050565b60008160020b9050919050565b61138e81611378565b811461139957600080fd5b50565b6000813590506113ab81611385565b92915050565b60006113bc826110ed565b9050919050565b6113cc816113b1565b81146113d757600080fd5b50565b6000813590506113e9816113c3565b92915050565b600060a0828403121561140557611404611291565b5b61140f60a06112f6565b9050600061141f84828501611328565b600083015250602061143384828501611328565b602083015250604061144784828501611363565b604083015250606061145b8482850161139c565b606083015250608061146f848285016113da565b60808301525092915050565b600060a0828403121561149157611490611133565b5b600061149f848285016113ef565b91505092915050565b6000819050919050565b6114bb816114a8565b82525050565b60006020820190506114d660008301846114b2565b92915050565b6114e5816114a8565b81146114f057600080fd5b50565b600081359050611502816114dc565b92915050565b6000806040838503121561151f5761151e611133565b5b600061152d858286016114f3565b925050602061153e8582860161118a565b9150509250929050565b600060408201905081810360008301526115628185611236565b905081810360208301526115768184611236565b90509392505050565b60006020828403121561159557611594611133565b5b60006115a384828501611154565b91505092915050565b6000819050919050565b60006115d16115cc6115c7846110cd565b6115ac565b6110cd565b9050919050565b60006115e3826115b6565b9050919050565b60006115f5826115d8565b9050919050565b611605816115ea565b82525050565b6116148161133d565b82525050565b61162381611378565b82525050565b6000611634826115d8565b9050919050565b61164481611629565b82525050565b60a08201600082015161166060008501826115fc565b50602082015161167360208501826115fc565b506040820151611686604085018261160b565b506060820151611699606085018261161a565b5060808201516116ac608085018261163b565b50505050565b600060a0820190506116c7600083018461164a565b92915050565b6000806000606084860312156116e6576116e5611133565b5b60006116f486828701611154565b935050602061170586828701611154565b925050604061171686828701611154565b9150509250925092565b6000819050919050565b61173381611720565b82525050565b611742816110cd565b82525050565b61175181611378565b82525050565b6117608161133d565b82525050565b600060a08201905061177b600083018861172a565b6117886020830187611739565b6117956040830186611748565b6117a26060830185611757565b6117af6080830184611757565b9695505050505050565b6117c2816110ed565b82525050565b6117d181611169565b82525050565b60006040820190506117ec60008301856117b9565b6117f960208301846117c8565b9392505050565b600080fd5b600080fd5b600067ffffffffffffffff82111561182557611824611296565b5b61182e82611225565b9050602081019050919050565b600061184e6118498461180a565b6112f6565b90508281526020810184848401111561186a57611869611805565b5b6118758482856111fb565b509392505050565b600082601f83011261189257611891611800565b5b81516118a284826020860161183b565b91505092915050565b6000602082840312156118c1576118c0611133565b5b600082015167ffffffffffffffff8111156118df576118de611138565b5b6118eb8482850161187d565b91505092915050565b6118fd816115ea565b82525050565b61190c8161133d565b82525050565b61191b81611378565b82525050565b61192a81611629565b82525050565b60a08201600082015161194660008501826118f4565b50602082015161195960208501826118f4565b50604082015161196c6040850182611903565b50606082015161197f6060850182611912565b5060808201516119926080850182611921565b50505050565b600060a0820190506119ad6000830184611930565b92915050565b6000815190506119c2816114dc565b92915050565b6000602082840312156119de576119dd611133565b5b60006119ec848285016119b3565b91505092915050565b600060a082019050611a0a60008301886117b9565b611a1760208301876117c8565b611a2460408301866117b9565b611a3160608301856117b9565b611a3e60808301846117b9565b9695505050505050565b611a51816114a8565b82525050565b600060a082019050611a6c6000830188611a48565b611a7960208301876117c8565b611a8660408301866117b9565b611a9360608301856117b9565b611aa060808301846117b9565b9695505050505050565b60008060408385031215611ac157611ac0611133565b5b600083015167ffffffffffffffff811115611adf57611ade611138565b5b611aeb8582860161187d565b925050602083015167ffffffffffffffff811115611b0c57611b0b611138565b5b611b188582860161187d565b9150509250929050565b6000608082019050611b3760008301876117b9565b611b4460208301866117b9565b611b5160408301856117b9565b611b5e60608301846117b9565b95945050505050565b600081519050611b7681611311565b92915050565b600081519050611b8b8161134c565b92915050565b600081519050611ba081611385565b92915050565b600081519050611bb5816113c3565b92915050565b600060a08284031215611bd157611bd0611291565b5b611bdb60a06112f6565b90506000611beb84828501611b67565b6000830152506020611bff84828501611b67565b6020830152506040611c1384828501611b7c565b6040830152506060611c2784828501611b91565b6060830152506080611c3b84828501611ba6565b60808301525092915050565b600060a08284031215611c5d57611c5c611133565b5b6000611c6b84828501611bbb565b91505092915050565b600082825260208201905092915050565b7f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160008201527f647920696e697469616c697a6564000000000000000000000000000000000000602082015250565b6000611ce1602e83611c74565b9150611cec82611c85565b604082019050919050565b60006020820190508181036000830152611d1081611cd4565b9050919050565b6000819050919050565b600060ff82169050919050565b6000611d49611d44611d3f84611d17565b6115ac565b611d21565b9050919050565b611d5981611d2e565b82525050565b6000602082019050611d746000830184611d50565b92915050565b611d8381611720565b8114611d8e57600080fd5b50565b600081519050611da081611d7a565b92915050565b611daf816110cd565b8114611dba57600080fd5b50565b600081519050611dcc81611da6565b92915050565b600080600080600060a08688031215611dee57611ded611133565b5b6000611dfc88828901611d91565b9550506020611e0d88828901611dbd565b9450506040611e1e88828901611b91565b9350506060611e2f88828901611b7c565b9250506080611e4088828901611b7c565b915050929550929590935056fea2646970667358221220f5b703ebfecf0a0e9c365637d293d9b7ffc1ef07c608247f02d85ed2fafa38c364736f6c63430008110033

Deployed Bytecode

0x608060405234801561001057600080fd5b506004361061012c5760003560e01c80637df8773a116100ad578063c684206c11610071578063c684206c14610382578063ca883bec146103b2578063cd7f833c146103e2578063d1c62f2614610416578063f9f59a77146104465761012c565b80637df8773a146102b857806388c0a8a7146102e8578063aa4cfccd14610318578063c0c53b8b14610336578063c38f8f35146103525761012c565b8063512bcef9116100f4578063512bcef9146101fd57806357eb1da71461022d578063594a1bf31461024b578063609971071461027c57806362308e851461029a5761012c565b80631bea83fe146101315780632d6d225e1461014f57806332c961d91461017f578063417be3f2146101af5780634421ab4b146101df575b600080fd5b610139610476565b604051610146919061110e565b60405180910390f35b6101696004803603810190610164919061119f565b61049c565b604051610176919061126f565b60405180910390f35b6101996004803603810190610194919061147b565b610525565b6040516101a691906114c1565b60405180910390f35b6101c960048036038101906101c4919061119f565b6105a6565b6040516101d6919061126f565b60405180910390f35b6101e761069b565b6040516101f4919061110e565b60405180910390f35b61021760048036038101906102129190611508565b6106b3565b604051610224919061126f565b60405180910390f35b6102356107a8565b60405161024291906114c1565b60405180910390f35b6102656004803603810190610260919061119f565b6107b0565b604051610273929190611548565b60405180910390f35b61028461083d565b604051610291919061110e565b60405180910390f35b6102a2610855565b6040516102af919061110e565b60405180910390f35b6102d260048036038101906102cd919061119f565b61087b565b6040516102df919061126f565b60405180910390f35b61030260048036038101906102fd919061157f565b610904565b60405161030f91906116b2565b60405180910390f35b6103206109f7565b60405161032d919061110e565b60405180910390f35b610350600480360381019061034b91906116cd565b610a1d565b005b61036c6004803603810190610367919061119f565b610c19565b604051610379919061126f565b60405180910390f35b61039c6004803603810190610397919061119f565b610ca2565b6040516103a9919061126f565b60405180910390f35b6103cc60048036038101906103c7919061119f565b610d2b565b6040516103d9919061126f565b60405180910390f35b6103fc60048036038101906103f7919061157f565b610db4565b60405161040d959493929190611766565b60405180910390f35b610430600480360381019061042b9190611508565b610eb3565b60405161043d919061126f565b60405180910390f35b610460600480360381019061045b919061119f565b610fa8565b60405161046d919061126f565b60405180910390f35b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6060735156142cc4393bec8563c88acf5da2b6163343aa632d6d225e84846040518363ffffffff1660e01b81526004016104d79291906117d7565b600060405180830381865af41580156104f4573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f8201168201806040525081019061051d91906118ab565b905092915050565b600073630b63ae9bad0460cf59024e02124754a5a9c0a663aa5d0ea1836040518263ffffffff1660e01b815260040161055e9190611998565b602060405180830381865af415801561057b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061059f91906119c8565b9050919050565b606073630b63ae9bad0460cf59024e02124754a5a9c0a663728bbdb38484600060029054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166040518663ffffffff1660e01b815260040161064d9594939291906119f5565b600060405180830381865af415801561066a573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f8201168201806040525081019061069391906118ab565b905092915050565b73a0ffb9c1ce1fe56963b0321b32e7a0302114058b81565b60607342e9a1c3b1bf8caffc09bc1e8006affded0b34716373d6a12a8484600060029054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166040518663ffffffff1660e01b815260040161075a959493929190611a57565b600060405180830381865af4158015610777573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f820116820180604052508101906107a091906118ab565b905092915050565b600660001b81565b60608073213d25f187c31b3184047c6fa0c47ebf64f4d4c063594a1bf385856040518363ffffffff1660e01b81526004016107ec9291906117d7565b600060405180830381865af4158015610809573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f820116820180604052508101906108329190611aaa565b915091509250929050565b7355f4c8aba71a1e923edc303eb4feff14608cc22681565b600060029054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6060735156142cc4393bec8563c88acf5da2b6163343aa637df8773a84846040518363ffffffff1660e01b81526004016108b69291906117d7565b600060405180830381865af41580156108d3573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f820116820180604052508101906108fc91906118ab565b905092915050565b61090c611054565b73630b63ae9bad0460cf59024e02124754a5a9c0a6634e48281683600060029054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166040518563ffffffff1660e01b81526004016109af9493929190611b22565b60a060405180830381865af41580156109cc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109f09190611c47565b9050919050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008060019054906101000a900460ff16159050808015610a4e5750600160008054906101000a900460ff1660ff16105b80610a7b5750610a5d30611031565b158015610a7a5750600160008054906101000a900460ff1660ff16145b5b610aba576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ab190611cf7565b60405180910390fd5b60016000806101000a81548160ff021916908360ff1602179055508015610af7576001600060016101000a81548160ff0219169083151502179055505b83600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555082600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555081600060026101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508015610c135760008060016101000a81548160ff0219169083151502179055507f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024986001604051610c0a9190611d5f565b60405180910390a15b50505050565b6060735156142cc4393bec8563c88acf5da2b6163343aa63c38f8f3584846040518363ffffffff1660e01b8152600401610c549291906117d7565b600060405180830381865af4158015610c71573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f82011682018060405250810190610c9a91906118ab565b905092915050565b606073527c89b1012948165c29922520b3cbb202ad922c63c684206c84846040518363ffffffff1660e01b8152600401610cdd9291906117d7565b600060405180830381865af4158015610cfa573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f82011682018060405250810190610d2391906118ab565b905092915050565b6060735156142cc4393bec8563c88acf5da2b6163343aa63ca883bec84846040518363ffffffff1660e01b8152600401610d669291906117d7565b600060405180830381865af4158015610d83573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f82011682018060405250810190610dac91906118ab565b905092915050565b600080600080600073630b63ae9bad0460cf59024e02124754a5a9c0a6637a4aeed787600060029054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166040518563ffffffff1660e01b8152600401610e5f9493929190611b22565b60a060405180830381865af4158015610e7c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ea09190611dd2565b9450945094509450945091939590929450565b60607342e9a1c3b1bf8caffc09bc1e8006affded0b347163958956698484600060029054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166040518663ffffffff1660e01b8152600401610f5a959493929190611a57565b600060405180830381865af4158015610f77573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f82011682018060405250810190610fa091906118ab565b905092915050565b606073cd69c342adc132f27918a6febf34159d8010c24963f9f59a7784846040518363ffffffff1660e01b8152600401610fe39291906117d7565b600060405180830381865af4158015611000573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f8201168201806040525081019061102991906118ab565b905092915050565b6000808273ffffffffffffffffffffffffffffffffffffffff163b119050919050565b6040518060a00160405280600073ffffffffffffffffffffffffffffffffffffffff168152602001600073ffffffffffffffffffffffffffffffffffffffff168152602001600062ffffff168152602001600060020b8152602001600073ffffffffffffffffffffffffffffffffffffffff1681525090565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006110f8826110cd565b9050919050565b611108816110ed565b82525050565b600060208201905061112360008301846110ff565b92915050565b6000604051905090565b600080fd5b600080fd5b611146816110ed565b811461115157600080fd5b50565b6000813590506111638161113d565b92915050565b6000819050919050565b61117c81611169565b811461118757600080fd5b50565b60008135905061119981611173565b92915050565b600080604083850312156111b6576111b5611133565b5b60006111c485828601611154565b92505060206111d58582860161118a565b9150509250929050565b600081519050919050565b600082825260208201905092915050565b60005b838110156112195780820151818401526020810190506111fe565b60008484015250505050565b6000601f19601f8301169050919050565b6000611241826111df565b61124b81856111ea565b935061125b8185602086016111fb565b61126481611225565b840191505092915050565b600060208201905081810360008301526112898184611236565b905092915050565b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6112ce82611225565b810181811067ffffffffffffffff821117156112ed576112ec611296565b5b80604052505050565b6000611300611129565b905061130c82826112c5565b919050565b61131a816110ed565b811461132557600080fd5b50565b60008135905061133781611311565b92915050565b600062ffffff82169050919050565b6113558161133d565b811461136057600080fd5b50565b6000813590506113728161134c565b92915050565b60008160020b9050919050565b61138e81611378565b811461139957600080fd5b50565b6000813590506113ab81611385565b92915050565b60006113bc826110ed565b9050919050565b6113cc816113b1565b81146113d757600080fd5b50565b6000813590506113e9816113c3565b92915050565b600060a0828403121561140557611404611291565b5b61140f60a06112f6565b9050600061141f84828501611328565b600083015250602061143384828501611328565b602083015250604061144784828501611363565b604083015250606061145b8482850161139c565b606083015250608061146f848285016113da565b60808301525092915050565b600060a0828403121561149157611490611133565b5b600061149f848285016113ef565b91505092915050565b6000819050919050565b6114bb816114a8565b82525050565b60006020820190506114d660008301846114b2565b92915050565b6114e5816114a8565b81146114f057600080fd5b50565b600081359050611502816114dc565b92915050565b6000806040838503121561151f5761151e611133565b5b600061152d858286016114f3565b925050602061153e8582860161118a565b9150509250929050565b600060408201905081810360008301526115628185611236565b905081810360208301526115768184611236565b90509392505050565b60006020828403121561159557611594611133565b5b60006115a384828501611154565b91505092915050565b6000819050919050565b60006115d16115cc6115c7846110cd565b6115ac565b6110cd565b9050919050565b60006115e3826115b6565b9050919050565b60006115f5826115d8565b9050919050565b611605816115ea565b82525050565b6116148161133d565b82525050565b61162381611378565b82525050565b6000611634826115d8565b9050919050565b61164481611629565b82525050565b60a08201600082015161166060008501826115fc565b50602082015161167360208501826115fc565b506040820151611686604085018261160b565b506060820151611699606085018261161a565b5060808201516116ac608085018261163b565b50505050565b600060a0820190506116c7600083018461164a565b92915050565b6000806000606084860312156116e6576116e5611133565b5b60006116f486828701611154565b935050602061170586828701611154565b925050604061171686828701611154565b9150509250925092565b6000819050919050565b61173381611720565b82525050565b611742816110cd565b82525050565b61175181611378565b82525050565b6117608161133d565b82525050565b600060a08201905061177b600083018861172a565b6117886020830187611739565b6117956040830186611748565b6117a26060830185611757565b6117af6080830184611757565b9695505050505050565b6117c2816110ed565b82525050565b6117d181611169565b82525050565b60006040820190506117ec60008301856117b9565b6117f960208301846117c8565b9392505050565b600080fd5b600080fd5b600067ffffffffffffffff82111561182557611824611296565b5b61182e82611225565b9050602081019050919050565b600061184e6118498461180a565b6112f6565b90508281526020810184848401111561186a57611869611805565b5b6118758482856111fb565b509392505050565b600082601f83011261189257611891611800565b5b81516118a284826020860161183b565b91505092915050565b6000602082840312156118c1576118c0611133565b5b600082015167ffffffffffffffff8111156118df576118de611138565b5b6118eb8482850161187d565b91505092915050565b6118fd816115ea565b82525050565b61190c8161133d565b82525050565b61191b81611378565b82525050565b61192a81611629565b82525050565b60a08201600082015161194660008501826118f4565b50602082015161195960208501826118f4565b50604082015161196c6040850182611903565b50606082015161197f6060850182611912565b5060808201516119926080850182611921565b50505050565b600060a0820190506119ad6000830184611930565b92915050565b6000815190506119c2816114dc565b92915050565b6000602082840312156119de576119dd611133565b5b60006119ec848285016119b3565b91505092915050565b600060a082019050611a0a60008301886117b9565b611a1760208301876117c8565b611a2460408301866117b9565b611a3160608301856117b9565b611a3e60808301846117b9565b9695505050505050565b611a51816114a8565b82525050565b600060a082019050611a6c6000830188611a48565b611a7960208301876117c8565b611a8660408301866117b9565b611a9360608301856117b9565b611aa060808301846117b9565b9695505050505050565b60008060408385031215611ac157611ac0611133565b5b600083015167ffffffffffffffff811115611adf57611ade611138565b5b611aeb8582860161187d565b925050602083015167ffffffffffffffff811115611b0c57611b0b611138565b5b611b188582860161187d565b9150509250929050565b6000608082019050611b3760008301876117b9565b611b4460208301866117b9565b611b5160408301856117b9565b611b5e60608301846117b9565b95945050505050565b600081519050611b7681611311565b92915050565b600081519050611b8b8161134c565b92915050565b600081519050611ba081611385565b92915050565b600081519050611bb5816113c3565b92915050565b600060a08284031215611bd157611bd0611291565b5b611bdb60a06112f6565b90506000611beb84828501611b67565b6000830152506020611bff84828501611b67565b6020830152506040611c1384828501611b7c565b6040830152506060611c2784828501611b91565b6060830152506080611c3b84828501611ba6565b60808301525092915050565b600060a08284031215611c5d57611c5c611133565b5b6000611c6b84828501611bbb565b91505092915050565b600082825260208201905092915050565b7f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160008201527f647920696e697469616c697a6564000000000000000000000000000000000000602082015250565b6000611ce1602e83611c74565b9150611cec82611c85565b604082019050919050565b60006020820190508181036000830152611d1081611cd4565b9050919050565b6000819050919050565b600060ff82169050919050565b6000611d49611d44611d3f84611d17565b6115ac565b611d21565b9050919050565b611d5981611d2e565b82525050565b6000602082019050611d746000830184611d50565b92915050565b611d8381611720565b8114611d8e57600080fd5b50565b600081519050611da081611d7a565b92915050565b611daf816110cd565b8114611dba57600080fd5b50565b600081519050611dcc81611da6565b92915050565b600080600080600060a08688031215611dee57611ded611133565b5b6000611dfc88828901611d91565b9550506020611e0d88828901611dbd565b9450506040611e1e88828901611b91565b9350506060611e2f88828901611b7c565b9250506080611e4088828901611b7c565b915050929550929590935056fea2646970667358221220f5b703ebfecf0a0e9c365637d293d9b7ffc1ef07c608247f02d85ed2fafa38c364736f6c63430008110033

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

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.