ETH Price: $2,948.62 (+1.24%)

Contract

0x6bEce1A3D1ed2Da49c76105c6F874fE1608A8e14

Overview

ETH Balance

0 ETH

ETH Value

$0.00

More Info

Private Name Tags

Multichain Info

No addresses found
Transaction Hash
Block
From
To
Set Prices385153842026-01-24 14:09:0311 secs ago1769263743IN
0x6bEce1A3...1608A8e14
0 ETH0.000000040.0005
Set Prices385153682026-01-24 14:08:4727 secs ago1769263727IN
0x6bEce1A3...1608A8e14
0 ETH0.000000040.0006
Set Prices385153452026-01-24 14:08:2450 secs ago1769263704IN
0x6bEce1A3...1608A8e14
0 ETH0.000000040.0005
Set Prices385153262026-01-24 14:08:051 min ago1769263685IN
0x6bEce1A3...1608A8e14
0 ETH0.000000040.0005
Set Prices385153042026-01-24 14:07:431 min ago1769263663IN
0x6bEce1A3...1608A8e14
0 ETH0.000000040.0005
Set Prices385152852026-01-24 14:07:241 min ago1769263644IN
0x6bEce1A3...1608A8e14
0 ETH0.000000040.0005005
Set Prices385152662026-01-24 14:07:052 mins ago1769263625IN
0x6bEce1A3...1608A8e14
0 ETH0.000000040.0005
Set Prices385152442026-01-24 14:06:432 mins ago1769263603IN
0x6bEce1A3...1608A8e14
0 ETH0.000000040.0005
Set Prices385152242026-01-24 14:06:232 mins ago1769263583IN
0x6bEce1A3...1608A8e14
0 ETH0.000000040.00055
Set Prices385152042026-01-24 14:06:033 mins ago1769263563IN
0x6bEce1A3...1608A8e14
0 ETH0.000000040.0005
Set Prices385151842026-01-24 14:05:433 mins ago1769263543IN
0x6bEce1A3...1608A8e14
0 ETH0.000000040.0005
Set Prices385151642026-01-24 14:05:233 mins ago1769263523IN
0x6bEce1A3...1608A8e14
0 ETH0.000000040.0005
Set Prices385151442026-01-24 14:05:034 mins ago1769263503IN
0x6bEce1A3...1608A8e14
0 ETH0.000000040.0005
Set Prices385151262026-01-24 14:04:454 mins ago1769263485IN
0x6bEce1A3...1608A8e14
0 ETH0.000000040.0005
Set Prices385151052026-01-24 14:04:244 mins ago1769263464IN
0x6bEce1A3...1608A8e14
0 ETH0.000000040.0006
Set Prices385150842026-01-24 14:04:035 mins ago1769263443IN
0x6bEce1A3...1608A8e14
0 ETH0.000000040.0005
Set Prices385150642026-01-24 14:03:435 mins ago1769263423IN
0x6bEce1A3...1608A8e14
0 ETH0.000000040.0005
Set Prices385150452026-01-24 14:03:245 mins ago1769263404IN
0x6bEce1A3...1608A8e14
0 ETH0.000000040.0005
Set Prices385150242026-01-24 14:03:036 mins ago1769263383IN
0x6bEce1A3...1608A8e14
0 ETH0.000000040.0005
Set Prices385150042026-01-24 14:02:436 mins ago1769263363IN
0x6bEce1A3...1608A8e14
0 ETH0.000000040.0005
Set Prices385149842026-01-24 14:02:236 mins ago1769263343IN
0x6bEce1A3...1608A8e14
0 ETH0.000000040.0005
Set Prices385149652026-01-24 14:02:047 mins ago1769263324IN
0x6bEce1A3...1608A8e14
0 ETH0.000000040.0005
Set Prices385149442026-01-24 14:01:437 mins ago1769263303IN
0x6bEce1A3...1608A8e14
0 ETH0.000000040.0005
Set Prices385149242026-01-24 14:01:237 mins ago1769263283IN
0x6bEce1A3...1608A8e14
0 ETH0.000000040.0005
Set Prices385149062026-01-24 14:01:058 mins ago1769263265IN
0x6bEce1A3...1608A8e14
0 ETH0.000000040.00055266
View all transactions

View more zero value Internal Transactions in Advanced View mode

Advanced mode:

Cross-Chain Transactions
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
UniversalJITOracle

Compiler Version
v0.8.26+commit.8a97fa7a

Optimization Enabled:
Yes with 100000 runs

Other Settings:
cancun EvmVersion
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.26;

// OpenZeppelin Contracts
import {AccessControl} from "@openzeppelin/contracts/access/AccessControl.sol";

// Hook Interfaces
import {IMinimalJITOracle, OracleReport} from "./interfaces/IMinimalJITOracle.sol";
import {PoolId} from "@uniswap/v4-core/src/types/PoolId.sol";

// Uniswap V4 Core Libraries
import {TickMath} from "@uniswap/v4-core/src/libraries/TickMath.sol";

contract UniversalJITOracle is AccessControl, IMinimalJITOracle {
    /* ---- Type Declarations ---- */
    struct OracleUpdate {
        PoolId poolId;
        int24 jitLowerTick;
        int24 jitUpperTick;
        uint16 jitLowerRange;
        uint16 jitUpperRange;
        uint72 uAssetLiquidity;
        uint72 usdcLiquidity;
    }

    struct OracleRound {
        int24 jitLowerTick;
        int24 jitUpperTick;
        uint16 jitLowerRange;
        uint16 jitUpperRange;
        uint72 uAssetLiquidity;
        uint72 usdcLiquidity;
        uint32 timestamp;
    }

    /* ---- Constants ---- */
    bytes32 public constant ORACLE_REPORTER_ROLE = keccak256("ORACLE_REPORTER_ROLE");

    uint256 public constant UASSET_SCALE = 1e12;

    uint256 public constant MIN_FREQUENCY = 5 seconds;
    uint256 public constant STALE_THRESHOLD = 30 seconds;
    
    int24 public maxDeltaTick;
    
    /* ---- Errors ---- */
    error InvalidMaxDeltaTick();
    error MaxDeltaTickExceeded();
    error PriceFrequency();
    error StalePrice();

    error InvalidTicks();
    error InvalidJitLowerRange();
    error InvalidJitUpperRange();
    error ZeroLiquidity();

    /* ---- State Variables ---- */
    mapping(PoolId => OracleRound) private oracleReports;

    /* ---- Modifiers ---- */
    constructor(int24 _maxDeltaTick) {
        if (_maxDeltaTick <= 0) revert InvalidMaxDeltaTick();
        maxDeltaTick = _maxDeltaTick;

        _grantRole(DEFAULT_ADMIN_ROLE, msg.sender);
    }

    function setMaxDeltaTick(int24 _maxDeltaTick) external onlyRole(DEFAULT_ADMIN_ROLE) {
        if (_maxDeltaTick <= 0) revert InvalidMaxDeltaTick();
        maxDeltaTick = _maxDeltaTick;
    }

    function setPrice(OracleUpdate memory update) external onlyRole(ORACLE_REPORTER_ROLE) {
        _setPrice(update);
    }

    function setPrices(OracleUpdate[] memory updates) external onlyRole(ORACLE_REPORTER_ROLE) {
        uint256 length = updates.length;
        for (uint256 i = 0; i < length; i++) {
            _setPrice(updates[i]);
        }
    }
    
    function getPrice(PoolId poolId) public view returns (OracleReport memory) {
        return OracleReport({
            jitLowerTick: oracleReports[poolId].jitLowerTick,
            jitUpperTick: oracleReports[poolId].jitUpperTick,
            jitLowerRange: uint24(oracleReports[poolId].jitLowerRange),
            jitUpperRange: uint24(oracleReports[poolId].jitUpperRange),
            uAssetLiquidity: _scaleuAssetLiquidity(oracleReports[poolId].uAssetLiquidity),
            usdcLiquidity: uint256(oracleReports[poolId].usdcLiquidity),
            timestamp: uint48(oracleReports[poolId].timestamp)
        });
    }

    function safeGetPrice(PoolId poolId) external view returns (OracleReport memory report) {
        report = getPrice(poolId);

        if (report.uAssetLiquidity == 0 || report.usdcLiquidity == 0) revert ZeroLiquidity();

        // Check that price is not stale
        if (report.timestamp + STALE_THRESHOLD < block.timestamp) {
            revert StalePrice();
        }

        return report;
    }

    function _setPrice(OracleUpdate memory update) internal {
        // Check that the ticks and ranges are valid
        _checkTicksAndRange(update);

        // Get the current oracle round
        OracleRound memory currentRound = oracleReports[update.poolId];

        // Check that at least MIN_FREQUENCY has passed since the last update
        if (block.timestamp < currentRound.timestamp + MIN_FREQUENCY) {
            revert PriceFrequency();
        }

        // If not the first time being updated, check that the delta between the current and last tick price is less than maxDeltaTick
        if (currentRound.timestamp != 0) {
            int24 delta = update.jitLowerTick - currentRound.jitLowerTick;
            if (delta > maxDeltaTick || delta < -maxDeltaTick) {
                revert MaxDeltaTickExceeded();
            }

            delta = update.jitUpperTick - currentRound.jitUpperTick;
            if (delta > maxDeltaTick || delta < -maxDeltaTick) {
                revert MaxDeltaTickExceeded();
            }
        }

        oracleReports[update.poolId] = OracleRound({
            jitLowerTick: update.jitLowerTick,
            jitUpperTick: update.jitUpperTick,
            jitLowerRange: update.jitLowerRange,
            jitUpperRange: update.jitUpperRange,
            uAssetLiquidity: update.uAssetLiquidity,
            usdcLiquidity: update.usdcLiquidity,
            timestamp: uint32(block.timestamp)
        });
    }

    function _checkTicksAndRange(OracleUpdate memory update) internal view {
        if (update.jitLowerTick > update.jitUpperTick) revert InvalidTicks();
        if (update.jitLowerRange == 0) revert InvalidJitLowerRange();
        if (update.jitUpperRange == 0) revert InvalidJitUpperRange();
        if (update.jitLowerTick - int24(uint24(update.jitLowerRange)) < TickMath.MIN_TICK) revert InvalidJitLowerRange();
        if (update.jitUpperTick + int24(uint24(update.jitUpperRange)) > TickMath.MAX_TICK) revert InvalidJitUpperRange();
    }

    function _scaleuAssetLiquidity(uint72 liquidity) internal pure returns (uint256) {
        uint256 scaledLiquidity = uint256(liquidity) * UASSET_SCALE;
        return scaledLiquidity;
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.4.0) (access/AccessControl.sol)

pragma solidity ^0.8.20;

import {IAccessControl} from "./IAccessControl.sol";
import {Context} from "../utils/Context.sol";
import {IERC165, ERC165} from "../utils/introspection/ERC165.sol";

/**
 * @dev Contract module that allows children to implement role-based access
 * control mechanisms. This is a lightweight version that doesn't allow enumerating role
 * members except through off-chain means by accessing the contract event logs. Some
 * applications may benefit from on-chain enumerability, for those cases see
 * {AccessControlEnumerable}.
 *
 * Roles are referred to by their `bytes32` identifier. These should be exposed
 * in the external API and be unique. The best way to achieve this is by
 * using `public constant` hash digests:
 *
 * ```solidity
 * bytes32 public constant MY_ROLE = keccak256("MY_ROLE");
 * ```
 *
 * Roles can be used to represent a set of permissions. To restrict access to a
 * function call, use {hasRole}:
 *
 * ```solidity
 * function foo() public {
 *     require(hasRole(MY_ROLE, msg.sender));
 *     ...
 * }
 * ```
 *
 * Roles can be granted and revoked dynamically via the {grantRole} and
 * {revokeRole} functions. Each role has an associated admin role, and only
 * accounts that have a role's admin role can call {grantRole} and {revokeRole}.
 *
 * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means
 * that only accounts with this role will be able to grant or revoke other
 * roles. More complex role relationships can be created by using
 * {_setRoleAdmin}.
 *
 * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to
 * grant and revoke this role. Extra precautions should be taken to secure
 * accounts that have been granted it. We recommend using {AccessControlDefaultAdminRules}
 * to enforce additional security measures for this role.
 */
abstract contract AccessControl is Context, IAccessControl, ERC165 {
    struct RoleData {
        mapping(address account => bool) hasRole;
        bytes32 adminRole;
    }

    mapping(bytes32 role => RoleData) private _roles;

    bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;

    /**
     * @dev Modifier that checks that an account has a specific role. Reverts
     * with an {AccessControlUnauthorizedAccount} error including the required role.
     */
    modifier onlyRole(bytes32 role) {
        _checkRole(role);
        _;
    }

    /// @inheritdoc IERC165
    function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
        return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId);
    }

    /**
     * @dev Returns `true` if `account` has been granted `role`.
     */
    function hasRole(bytes32 role, address account) public view virtual returns (bool) {
        return _roles[role].hasRole[account];
    }

    /**
     * @dev Reverts with an {AccessControlUnauthorizedAccount} error if `_msgSender()`
     * is missing `role`. Overriding this function changes the behavior of the {onlyRole} modifier.
     */
    function _checkRole(bytes32 role) internal view virtual {
        _checkRole(role, _msgSender());
    }

    /**
     * @dev Reverts with an {AccessControlUnauthorizedAccount} error if `account`
     * is missing `role`.
     */
    function _checkRole(bytes32 role, address account) internal view virtual {
        if (!hasRole(role, account)) {
            revert AccessControlUnauthorizedAccount(account, role);
        }
    }

    /**
     * @dev Returns the admin role that controls `role`. See {grantRole} and
     * {revokeRole}.
     *
     * To change a role's admin, use {_setRoleAdmin}.
     */
    function getRoleAdmin(bytes32 role) public view virtual returns (bytes32) {
        return _roles[role].adminRole;
    }

    /**
     * @dev Grants `role` to `account`.
     *
     * If `account` had not been already granted `role`, emits a {RoleGranted}
     * event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     *
     * May emit a {RoleGranted} event.
     */
    function grantRole(bytes32 role, address account) public virtual onlyRole(getRoleAdmin(role)) {
        _grantRole(role, account);
    }

    /**
     * @dev Revokes `role` from `account`.
     *
     * If `account` had been granted `role`, emits a {RoleRevoked} event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     *
     * May emit a {RoleRevoked} event.
     */
    function revokeRole(bytes32 role, address account) public virtual onlyRole(getRoleAdmin(role)) {
        _revokeRole(role, account);
    }

    /**
     * @dev Revokes `role` from the calling account.
     *
     * Roles are often managed via {grantRole} and {revokeRole}: this function's
     * purpose is to provide a mechanism for accounts to lose their privileges
     * if they are compromised (such as when a trusted device is misplaced).
     *
     * If the calling account had been revoked `role`, emits a {RoleRevoked}
     * event.
     *
     * Requirements:
     *
     * - the caller must be `callerConfirmation`.
     *
     * May emit a {RoleRevoked} event.
     */
    function renounceRole(bytes32 role, address callerConfirmation) public virtual {
        if (callerConfirmation != _msgSender()) {
            revert AccessControlBadConfirmation();
        }

        _revokeRole(role, callerConfirmation);
    }

    /**
     * @dev Sets `adminRole` as ``role``'s admin role.
     *
     * Emits a {RoleAdminChanged} event.
     */
    function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual {
        bytes32 previousAdminRole = getRoleAdmin(role);
        _roles[role].adminRole = adminRole;
        emit RoleAdminChanged(role, previousAdminRole, adminRole);
    }

    /**
     * @dev Attempts to grant `role` to `account` and returns a boolean indicating if `role` was granted.
     *
     * Internal function without access restriction.
     *
     * May emit a {RoleGranted} event.
     */
    function _grantRole(bytes32 role, address account) internal virtual returns (bool) {
        if (!hasRole(role, account)) {
            _roles[role].hasRole[account] = true;
            emit RoleGranted(role, account, _msgSender());
            return true;
        } else {
            return false;
        }
    }

    /**
     * @dev Attempts to revoke `role` from `account` and returns a boolean indicating if `role` was revoked.
     *
     * Internal function without access restriction.
     *
     * May emit a {RoleRevoked} event.
     */
    function _revokeRole(bytes32 role, address account) internal virtual returns (bool) {
        if (hasRole(role, account)) {
            _roles[role].hasRole[account] = false;
            emit RoleRevoked(role, account, _msgSender());
            return true;
        } else {
            return false;
        }
    }
}

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.26;

import {PoolId} from "@uniswap/v4-core/src/types/PoolId.sol";

/**
    * @notice Struct containing oracle price and range information.
    * @param jitLowerTick Observed tick (price) for lower side.
    * @param jitUpperTick Observed tick (price) for upper side.
    * @param jitLowerRange Range around jitLowerTick in ticks.
    * @param jitUpperRange Range around jitUpperTick in ticks.
    * @param uAssetLiquidity Observed uAsset liquidity at the time of the report.
    * @param usdcLiquidity Observed USDC liquidity at the time of the report.
    * @param timestamp Timestamp at which the report was produced.
    */
struct OracleReport {
    int24 jitLowerTick;
    int24 jitUpperTick;
    uint24 jitLowerRange;
    uint24 jitUpperRange;
    uint256 uAssetLiquidity;
    uint256 usdcLiquidity;
    uint48 timestamp;
}

/**
 * @title IMinimalJITOracle
 * @notice Minimal interface for JIT Oracles to be used with Uniswap v4 hooks.
 * @dev Contracts implementing this interface provide oracle functionalities and are called by the hook.
 */
interface IMinimalJITOracle {
    /**
     * @notice Returns a validated price report for a given pool. Reverts if the price is deemed unsafe by oracle logic.
     * @dev This function must implement all security and sanity checks.
     * @param poolId The PoolId identifier of the Uniswap v4 pool.
     * @return report The current OracleReport for the specified pool.
     */
    function safeGetPrice(PoolId poolId) external view returns (OracleReport memory report);
}

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import {PoolKey} from "./PoolKey.sol";

type PoolId is bytes32;

/// @notice Library for computing the ID of a pool
library PoolIdLibrary {
    /// @notice Returns value equal to keccak256(abi.encode(poolKey))
    function toId(PoolKey memory poolKey) internal pure returns (PoolId poolId) {
        assembly ("memory-safe") {
            // 0xa0 represents the total size of the poolKey struct (5 slots of 32 bytes)
            poolId := keccak256(poolKey, 0xa0)
        }
    }
}

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import {BitMath} from "./BitMath.sol";
import {CustomRevert} from "./CustomRevert.sol";

/// @title Math library for computing sqrt prices from ticks and vice versa
/// @notice Computes sqrt price for ticks of size 1.0001, i.e. sqrt(1.0001^tick) as fixed point Q64.96 numbers. Supports
/// prices between 2**-128 and 2**128
library TickMath {
    using CustomRevert for bytes4;

    /// @notice Thrown when the tick passed to #getSqrtPriceAtTick is not between MIN_TICK and MAX_TICK
    error InvalidTick(int24 tick);
    /// @notice Thrown when the price passed to #getTickAtSqrtPrice does not correspond to a price between MIN_TICK and MAX_TICK
    error InvalidSqrtPrice(uint160 sqrtPriceX96);

    /// @dev The minimum tick that may be passed to #getSqrtPriceAtTick computed from log base 1.0001 of 2**-128
    /// @dev If ever MIN_TICK and MAX_TICK are not centered around 0, the absTick logic in getSqrtPriceAtTick cannot be used
    int24 internal constant MIN_TICK = -887272;
    /// @dev The maximum tick that may be passed to #getSqrtPriceAtTick computed from log base 1.0001 of 2**128
    /// @dev If ever MIN_TICK and MAX_TICK are not centered around 0, the absTick logic in getSqrtPriceAtTick cannot be used
    int24 internal constant MAX_TICK = 887272;

    /// @dev The minimum tick spacing value drawn from the range of type int16 that is greater than 0, i.e. min from the range [1, 32767]
    int24 internal constant MIN_TICK_SPACING = 1;
    /// @dev The maximum tick spacing value drawn from the range of type int16, i.e. max from the range [1, 32767]
    int24 internal constant MAX_TICK_SPACING = type(int16).max;

    /// @dev The minimum value that can be returned from #getSqrtPriceAtTick. Equivalent to getSqrtPriceAtTick(MIN_TICK)
    uint160 internal constant MIN_SQRT_PRICE = 4295128739;
    /// @dev The maximum value that can be returned from #getSqrtPriceAtTick. Equivalent to getSqrtPriceAtTick(MAX_TICK)
    uint160 internal constant MAX_SQRT_PRICE = 1461446703485210103287273052203988822378723970342;
    /// @dev A threshold used for optimized bounds check, equals `MAX_SQRT_PRICE - MIN_SQRT_PRICE - 1`
    uint160 internal constant MAX_SQRT_PRICE_MINUS_MIN_SQRT_PRICE_MINUS_ONE =
        1461446703485210103287273052203988822378723970342 - 4295128739 - 1;

    /// @notice Given a tickSpacing, compute the maximum usable tick
    function maxUsableTick(int24 tickSpacing) internal pure returns (int24) {
        unchecked {
            return (MAX_TICK / tickSpacing) * tickSpacing;
        }
    }

    /// @notice Given a tickSpacing, compute the minimum usable tick
    function minUsableTick(int24 tickSpacing) internal pure returns (int24) {
        unchecked {
            return (MIN_TICK / tickSpacing) * tickSpacing;
        }
    }

    /// @notice Calculates sqrt(1.0001^tick) * 2^96
    /// @dev Throws if |tick| > max tick
    /// @param tick The input tick for the above formula
    /// @return sqrtPriceX96 A Fixed point Q64.96 number representing the sqrt of the price of the two assets (currency1/currency0)
    /// at the given tick
    function getSqrtPriceAtTick(int24 tick) internal pure returns (uint160 sqrtPriceX96) {
        unchecked {
            uint256 absTick;
            assembly ("memory-safe") {
                tick := signextend(2, tick)
                // mask = 0 if tick >= 0 else -1 (all 1s)
                let mask := sar(255, tick)
                // if tick >= 0, |tick| = tick = 0 ^ tick
                // if tick < 0, |tick| = ~~|tick| = ~(-|tick| - 1) = ~(tick - 1) = (-1) ^ (tick - 1)
                // either way, |tick| = mask ^ (tick + mask)
                absTick := xor(mask, add(mask, tick))
            }

            if (absTick > uint256(int256(MAX_TICK))) InvalidTick.selector.revertWith(tick);

            // The tick is decomposed into bits, and for each bit with index i that is set, the product of 1/sqrt(1.0001^(2^i))
            // is calculated (using Q128.128). The constants used for this calculation are rounded to the nearest integer

            // Equivalent to:
            //     price = absTick & 0x1 != 0 ? 0xfffcb933bd6fad37aa2d162d1a594001 : 0x100000000000000000000000000000000;
            //     or price = int(2**128 / sqrt(1.0001)) if (absTick & 0x1) else 1 << 128
            uint256 price;
            assembly ("memory-safe") {
                price := xor(shl(128, 1), mul(xor(shl(128, 1), 0xfffcb933bd6fad37aa2d162d1a594001), and(absTick, 0x1)))
            }
            if (absTick & 0x2 != 0) price = (price * 0xfff97272373d413259a46990580e213a) >> 128;
            if (absTick & 0x4 != 0) price = (price * 0xfff2e50f5f656932ef12357cf3c7fdcc) >> 128;
            if (absTick & 0x8 != 0) price = (price * 0xffe5caca7e10e4e61c3624eaa0941cd0) >> 128;
            if (absTick & 0x10 != 0) price = (price * 0xffcb9843d60f6159c9db58835c926644) >> 128;
            if (absTick & 0x20 != 0) price = (price * 0xff973b41fa98c081472e6896dfb254c0) >> 128;
            if (absTick & 0x40 != 0) price = (price * 0xff2ea16466c96a3843ec78b326b52861) >> 128;
            if (absTick & 0x80 != 0) price = (price * 0xfe5dee046a99a2a811c461f1969c3053) >> 128;
            if (absTick & 0x100 != 0) price = (price * 0xfcbe86c7900a88aedcffc83b479aa3a4) >> 128;
            if (absTick & 0x200 != 0) price = (price * 0xf987a7253ac413176f2b074cf7815e54) >> 128;
            if (absTick & 0x400 != 0) price = (price * 0xf3392b0822b70005940c7a398e4b70f3) >> 128;
            if (absTick & 0x800 != 0) price = (price * 0xe7159475a2c29b7443b29c7fa6e889d9) >> 128;
            if (absTick & 0x1000 != 0) price = (price * 0xd097f3bdfd2022b8845ad8f792aa5825) >> 128;
            if (absTick & 0x2000 != 0) price = (price * 0xa9f746462d870fdf8a65dc1f90e061e5) >> 128;
            if (absTick & 0x4000 != 0) price = (price * 0x70d869a156d2a1b890bb3df62baf32f7) >> 128;
            if (absTick & 0x8000 != 0) price = (price * 0x31be135f97d08fd981231505542fcfa6) >> 128;
            if (absTick & 0x10000 != 0) price = (price * 0x9aa508b5b7a84e1c677de54f3e99bc9) >> 128;
            if (absTick & 0x20000 != 0) price = (price * 0x5d6af8dedb81196699c329225ee604) >> 128;
            if (absTick & 0x40000 != 0) price = (price * 0x2216e584f5fa1ea926041bedfe98) >> 128;
            if (absTick & 0x80000 != 0) price = (price * 0x48a170391f7dc42444e8fa2) >> 128;

            assembly ("memory-safe") {
                // if (tick > 0) price = type(uint256).max / price;
                if sgt(tick, 0) { price := div(not(0), price) }

                // this divides by 1<<32 rounding up to go from a Q128.128 to a Q128.96.
                // we then downcast because we know the result always fits within 160 bits due to our tick input constraint
                // we round up in the division so getTickAtSqrtPrice of the output price is always consistent
                // `sub(shl(32, 1), 1)` is `type(uint32).max`
                // `price + type(uint32).max` will not overflow because `price` fits in 192 bits
                sqrtPriceX96 := shr(32, add(price, sub(shl(32, 1), 1)))
            }
        }
    }

    /// @notice Calculates the greatest tick value such that getSqrtPriceAtTick(tick) <= sqrtPriceX96
    /// @dev Throws in case sqrtPriceX96 < MIN_SQRT_PRICE, as MIN_SQRT_PRICE is the lowest value getSqrtPriceAtTick may
    /// ever return.
    /// @param sqrtPriceX96 The sqrt price for which to compute the tick as a Q64.96
    /// @return tick The greatest tick for which the getSqrtPriceAtTick(tick) is less than or equal to the input sqrtPriceX96
    function getTickAtSqrtPrice(uint160 sqrtPriceX96) internal pure returns (int24 tick) {
        unchecked {
            // Equivalent: if (sqrtPriceX96 < MIN_SQRT_PRICE || sqrtPriceX96 >= MAX_SQRT_PRICE) revert InvalidSqrtPrice();
            // second inequality must be >= because the price can never reach the price at the max tick
            // if sqrtPriceX96 < MIN_SQRT_PRICE, the `sub` underflows and `gt` is true
            // if sqrtPriceX96 >= MAX_SQRT_PRICE, sqrtPriceX96 - MIN_SQRT_PRICE > MAX_SQRT_PRICE - MIN_SQRT_PRICE - 1
            if ((sqrtPriceX96 - MIN_SQRT_PRICE) > MAX_SQRT_PRICE_MINUS_MIN_SQRT_PRICE_MINUS_ONE) {
                InvalidSqrtPrice.selector.revertWith(sqrtPriceX96);
            }

            uint256 price = uint256(sqrtPriceX96) << 32;

            uint256 r = price;
            uint256 msb = BitMath.mostSignificantBit(r);

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

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

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

            int256 log_sqrt10001 = log_2 * 255738958999603826347141; // Q22.128 number

            // Magic number represents the ceiling of the maximum value of the error when approximating log_sqrt10001(x)
            int24 tickLow = int24((log_sqrt10001 - 3402992956809132418596140100660247210) >> 128);

            // Magic number represents the minimum value of the error when approximating log_sqrt10001(x), when
            // sqrtPrice is from the range (2^-64, 2^64). This is safe as MIN_SQRT_PRICE is more than 2^-64. If MIN_SQRT_PRICE
            // is changed, this may need to be changed too
            int24 tickHi = int24((log_sqrt10001 + 291339464771989622907027621153398088495) >> 128);

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

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.4.0) (access/IAccessControl.sol)

pragma solidity >=0.8.4;

/**
 * @dev External interface of AccessControl declared to support ERC-165 detection.
 */
interface IAccessControl {
    /**
     * @dev The `account` is missing a role.
     */
    error AccessControlUnauthorizedAccount(address account, bytes32 neededRole);

    /**
     * @dev The caller of a function is not the expected one.
     *
     * NOTE: Don't confuse with {AccessControlUnauthorizedAccount}.
     */
    error AccessControlBadConfirmation();

    /**
     * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`
     *
     * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite
     * {RoleAdminChanged} not being emitted to signal this.
     */
    event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);

    /**
     * @dev Emitted when `account` is granted `role`.
     *
     * `sender` is the account that originated the contract call. This account bears the admin role (for the granted role).
     * Expected in cases where the role was granted using the internal {AccessControl-_grantRole}.
     */
    event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);

    /**
     * @dev Emitted when `account` is revoked `role`.
     *
     * `sender` is the account that originated the contract call:
     *   - if using `revokeRole`, it is the admin role bearer
     *   - if using `renounceRole`, it is the role bearer (i.e. `account`)
     */
    event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);

    /**
     * @dev Returns `true` if `account` has been granted `role`.
     */
    function hasRole(bytes32 role, address account) external view returns (bool);

    /**
     * @dev Returns the admin role that controls `role`. See {grantRole} and
     * {revokeRole}.
     *
     * To change a role's admin, use {AccessControl-_setRoleAdmin}.
     */
    function getRoleAdmin(bytes32 role) external view returns (bytes32);

    /**
     * @dev Grants `role` to `account`.
     *
     * If `account` had not been already granted `role`, emits a {RoleGranted}
     * event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     */
    function grantRole(bytes32 role, address account) external;

    /**
     * @dev Revokes `role` from `account`.
     *
     * If `account` had been granted `role`, emits a {RoleRevoked} event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     */
    function revokeRole(bytes32 role, address account) external;

    /**
     * @dev Revokes `role` from the calling account.
     *
     * Roles are often managed via {grantRole} and {revokeRole}: this function's
     * purpose is to provide a mechanism for accounts to lose their privileges
     * if they are compromised (such as when a trusted device is misplaced).
     *
     * If the calling account had been granted `role`, emits a {RoleRevoked}
     * event.
     *
     * Requirements:
     *
     * - the caller must be `callerConfirmation`.
     */
    function renounceRole(bytes32 role, address callerConfirmation) external;
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)

pragma solidity ^0.8.20;

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

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

    function _contextSuffixLength() internal view virtual returns (uint256) {
        return 0;
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.4.0) (utils/introspection/ERC165.sol)

pragma solidity ^0.8.20;

import {IERC165} from "./IERC165.sol";

/**
 * @dev Implementation of the {IERC165} interface.
 *
 * Contracts that want to implement ERC-165 should inherit from this contract and override {supportsInterface} to check
 * for the additional interface id that will be supported. For example:
 *
 * ```solidity
 * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
 *     return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);
 * }
 * ```
 */
abstract contract ERC165 is IERC165 {
    /// @inheritdoc IERC165
    function supportsInterface(bytes4 interfaceId) public view virtual returns (bool) {
        return interfaceId == type(IERC165).interfaceId;
    }
}

File 9 of 19 : PoolKey.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import {Currency} from "./Currency.sol";
import {IHooks} from "../interfaces/IHooks.sol";
import {PoolIdLibrary} from "./PoolId.sol";

using PoolIdLibrary for PoolKey global;

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

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

/// @title BitMath
/// @dev This library provides functionality for computing bit properties of an unsigned integer
/// @author Solady (https://github.com/Vectorized/solady/blob/8200a70e8dc2a77ecb074fc2e99a2a0d36547522/src/utils/LibBit.sol)
library BitMath {
    /// @notice Returns the index of the most significant bit of the number,
    ///     where the least significant bit is at index 0 and the most significant bit is at index 255
    /// @param x the value for which to compute the most significant bit, must be greater than 0
    /// @return r the index of the most significant bit
    function mostSignificantBit(uint256 x) internal pure returns (uint8 r) {
        require(x > 0);

        assembly ("memory-safe") {
            r := shl(7, lt(0xffffffffffffffffffffffffffffffff, x))
            r := or(r, shl(6, lt(0xffffffffffffffff, shr(r, x))))
            r := or(r, shl(5, lt(0xffffffff, shr(r, x))))
            r := or(r, shl(4, lt(0xffff, shr(r, x))))
            r := or(r, shl(3, lt(0xff, shr(r, x))))
            // forgefmt: disable-next-item
            r := or(r, byte(and(0x1f, shr(shr(r, x), 0x8421084210842108cc6318c6db6d54be)),
                0x0706060506020500060203020504000106050205030304010505030400000000))
        }
    }

    /// @notice Returns the index of the least significant bit of the number,
    ///     where the least significant bit is at index 0 and the most significant bit is at index 255
    /// @param x the value for which to compute the least significant bit, must be greater than 0
    /// @return r the index of the least significant bit
    function leastSignificantBit(uint256 x) internal pure returns (uint8 r) {
        require(x > 0);

        assembly ("memory-safe") {
            // Isolate the least significant bit.
            x := and(x, sub(0, x))
            // For the upper 3 bits of the result, use a De Bruijn-like lookup.
            // Credit to adhusson: https://blog.adhusson.com/cheap-find-first-set-evm/
            // forgefmt: disable-next-item
            r := shl(5, shr(252, shl(shl(2, shr(250, mul(x,
                0xb6db6db6ddddddddd34d34d349249249210842108c6318c639ce739cffffffff))),
                0x8040405543005266443200005020610674053026020000107506200176117077)))
            // For the lower 5 bits of the result, use a De Bruijn lookup.
            // forgefmt: disable-next-item
            r := or(r, byte(and(div(0xd76453e0, shr(r, x)), 0x1f),
                0x001f0d1e100c1d070f090b19131c1706010e11080a1a141802121b1503160405))
        }
    }
}

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

/// @title Library for reverting with custom errors efficiently
/// @notice Contains functions for reverting with custom errors with different argument types efficiently
/// @dev To use this library, declare `using CustomRevert for bytes4;` and replace `revert CustomError()` with
/// `CustomError.selector.revertWith()`
/// @dev The functions may tamper with the free memory pointer but it is fine since the call context is exited immediately
library CustomRevert {
    /// @dev ERC-7751 error for wrapping bubbled up reverts
    error WrappedError(address target, bytes4 selector, bytes reason, bytes details);

    /// @dev Reverts with the selector of a custom error in the scratch space
    function revertWith(bytes4 selector) internal pure {
        assembly ("memory-safe") {
            mstore(0, selector)
            revert(0, 0x04)
        }
    }

    /// @dev Reverts with a custom error with an address argument in the scratch space
    function revertWith(bytes4 selector, address addr) internal pure {
        assembly ("memory-safe") {
            mstore(0, selector)
            mstore(0x04, and(addr, 0xffffffffffffffffffffffffffffffffffffffff))
            revert(0, 0x24)
        }
    }

    /// @dev Reverts with a custom error with an int24 argument in the scratch space
    function revertWith(bytes4 selector, int24 value) internal pure {
        assembly ("memory-safe") {
            mstore(0, selector)
            mstore(0x04, signextend(2, value))
            revert(0, 0x24)
        }
    }

    /// @dev Reverts with a custom error with a uint160 argument in the scratch space
    function revertWith(bytes4 selector, uint160 value) internal pure {
        assembly ("memory-safe") {
            mstore(0, selector)
            mstore(0x04, and(value, 0xffffffffffffffffffffffffffffffffffffffff))
            revert(0, 0x24)
        }
    }

    /// @dev Reverts with a custom error with two int24 arguments
    function revertWith(bytes4 selector, int24 value1, int24 value2) internal pure {
        assembly ("memory-safe") {
            let fmp := mload(0x40)
            mstore(fmp, selector)
            mstore(add(fmp, 0x04), signextend(2, value1))
            mstore(add(fmp, 0x24), signextend(2, value2))
            revert(fmp, 0x44)
        }
    }

    /// @dev Reverts with a custom error with two uint160 arguments
    function revertWith(bytes4 selector, uint160 value1, uint160 value2) internal pure {
        assembly ("memory-safe") {
            let fmp := mload(0x40)
            mstore(fmp, selector)
            mstore(add(fmp, 0x04), and(value1, 0xffffffffffffffffffffffffffffffffffffffff))
            mstore(add(fmp, 0x24), and(value2, 0xffffffffffffffffffffffffffffffffffffffff))
            revert(fmp, 0x44)
        }
    }

    /// @dev Reverts with a custom error with two address arguments
    function revertWith(bytes4 selector, address value1, address value2) internal pure {
        assembly ("memory-safe") {
            let fmp := mload(0x40)
            mstore(fmp, selector)
            mstore(add(fmp, 0x04), and(value1, 0xffffffffffffffffffffffffffffffffffffffff))
            mstore(add(fmp, 0x24), and(value2, 0xffffffffffffffffffffffffffffffffffffffff))
            revert(fmp, 0x44)
        }
    }

    /// @notice bubble up the revert message returned by a call and revert with a wrapped ERC-7751 error
    /// @dev this method can be vulnerable to revert data bombs
    function bubbleUpAndRevertWith(
        address revertingContract,
        bytes4 revertingFunctionSelector,
        bytes4 additionalContext
    ) internal pure {
        bytes4 wrappedErrorSelector = WrappedError.selector;
        assembly ("memory-safe") {
            // Ensure the size of the revert data is a multiple of 32 bytes
            let encodedDataSize := mul(div(add(returndatasize(), 31), 32), 32)

            let fmp := mload(0x40)

            // Encode wrapped error selector, address, function selector, offset, additional context, size, revert reason
            mstore(fmp, wrappedErrorSelector)
            mstore(add(fmp, 0x04), and(revertingContract, 0xffffffffffffffffffffffffffffffffffffffff))
            mstore(
                add(fmp, 0x24),
                and(revertingFunctionSelector, 0xffffffff00000000000000000000000000000000000000000000000000000000)
            )
            // offset revert reason
            mstore(add(fmp, 0x44), 0x80)
            // offset additional context
            mstore(add(fmp, 0x64), add(0xa0, encodedDataSize))
            // size revert reason
            mstore(add(fmp, 0x84), returndatasize())
            // revert reason
            returndatacopy(add(fmp, 0xa4), 0, returndatasize())
            // size additional context
            mstore(add(fmp, add(0xa4, encodedDataSize)), 0x04)
            // additional context
            mstore(
                add(fmp, add(0xc4, encodedDataSize)),
                and(additionalContext, 0xffffffff00000000000000000000000000000000000000000000000000000000)
            )
            revert(fmp, add(0xe4, encodedDataSize))
        }
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.4.0) (utils/introspection/IERC165.sol)

pragma solidity >=0.4.16;

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

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import {IERC20Minimal} from "../interfaces/external/IERC20Minimal.sol";
import {CustomRevert} from "../libraries/CustomRevert.sol";

type Currency is address;

using {greaterThan as >, lessThan as <, greaterThanOrEqualTo as >=, equals as ==} for Currency global;
using CurrencyLibrary for Currency global;

function equals(Currency currency, Currency other) pure returns (bool) {
    return Currency.unwrap(currency) == Currency.unwrap(other);
}

function greaterThan(Currency currency, Currency other) pure returns (bool) {
    return Currency.unwrap(currency) > Currency.unwrap(other);
}

function lessThan(Currency currency, Currency other) pure returns (bool) {
    return Currency.unwrap(currency) < Currency.unwrap(other);
}

function greaterThanOrEqualTo(Currency currency, Currency other) pure returns (bool) {
    return Currency.unwrap(currency) >= Currency.unwrap(other);
}

/// @title CurrencyLibrary
/// @dev This library allows for transferring and holding native tokens and ERC20 tokens
library CurrencyLibrary {
    /// @notice Additional context for ERC-7751 wrapped error when a native transfer fails
    error NativeTransferFailed();

    /// @notice Additional context for ERC-7751 wrapped error when an ERC20 transfer fails
    error ERC20TransferFailed();

    /// @notice A constant to represent the native currency
    Currency public constant ADDRESS_ZERO = Currency.wrap(address(0));

    function transfer(Currency currency, address to, uint256 amount) internal {
        // altered from https://github.com/transmissions11/solmate/blob/44a9963d4c78111f77caa0e65d677b8b46d6f2e6/src/utils/SafeTransferLib.sol
        // modified custom error selectors

        bool success;
        if (currency.isAddressZero()) {
            assembly ("memory-safe") {
                // Transfer the ETH and revert if it fails.
                success := call(gas(), to, amount, 0, 0, 0, 0)
            }
            // revert with NativeTransferFailed, containing the bubbled up error as an argument
            if (!success) {
                CustomRevert.bubbleUpAndRevertWith(to, bytes4(0), NativeTransferFailed.selector);
            }
        } else {
            assembly ("memory-safe") {
                // Get a pointer to some free memory.
                let fmp := mload(0x40)

                // Write the abi-encoded calldata into memory, beginning with the function selector.
                mstore(fmp, 0xa9059cbb00000000000000000000000000000000000000000000000000000000)
                mstore(add(fmp, 4), and(to, 0xffffffffffffffffffffffffffffffffffffffff)) // Append and mask the "to" argument.
                mstore(add(fmp, 36), amount) // Append the "amount" argument. Masking not required as it's a full 32 byte type.

                success :=
                    and(
                        // Set success to whether the call reverted, if not we check it either
                        // returned exactly 1 (can't just be non-zero data), or had no return data.
                        or(and(eq(mload(0), 1), gt(returndatasize(), 31)), iszero(returndatasize())),
                        // We use 68 because the length of our calldata totals up like so: 4 + 32 * 2.
                        // We use 0 and 32 to copy up to 32 bytes of return data into the scratch space.
                        // Counterintuitively, this call must be positioned second to the or() call in the
                        // surrounding and() call or else returndatasize() will be zero during the computation.
                        call(gas(), currency, 0, fmp, 68, 0, 32)
                    )

                // Now clean the memory we used
                mstore(fmp, 0) // 4 byte `selector` and 28 bytes of `to` were stored here
                mstore(add(fmp, 0x20), 0) // 4 bytes of `to` and 28 bytes of `amount` were stored here
                mstore(add(fmp, 0x40), 0) // 4 bytes of `amount` were stored here
            }
            // revert with ERC20TransferFailed, containing the bubbled up error as an argument
            if (!success) {
                CustomRevert.bubbleUpAndRevertWith(
                    Currency.unwrap(currency), IERC20Minimal.transfer.selector, ERC20TransferFailed.selector
                );
            }
        }
    }

    function balanceOfSelf(Currency currency) internal view returns (uint256) {
        if (currency.isAddressZero()) {
            return address(this).balance;
        } else {
            return IERC20Minimal(Currency.unwrap(currency)).balanceOf(address(this));
        }
    }

    function balanceOf(Currency currency, address owner) internal view returns (uint256) {
        if (currency.isAddressZero()) {
            return owner.balance;
        } else {
            return IERC20Minimal(Currency.unwrap(currency)).balanceOf(owner);
        }
    }

    function isAddressZero(Currency currency) internal pure returns (bool) {
        return Currency.unwrap(currency) == Currency.unwrap(ADDRESS_ZERO);
    }

    function toId(Currency currency) internal pure returns (uint256) {
        return uint160(Currency.unwrap(currency));
    }

    // If the upper 12 bytes are non-zero, they will be zero-ed out
    // Therefore, fromId() and toId() are not inverses of each other
    function fromId(uint256 id) internal pure returns (Currency) {
        return Currency.wrap(address(uint160(id)));
    }
}

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import {PoolKey} from "../types/PoolKey.sol";
import {BalanceDelta} from "../types/BalanceDelta.sol";
import {ModifyLiquidityParams, SwapParams} from "../types/PoolOperation.sol";
import {BeforeSwapDelta} from "../types/BeforeSwapDelta.sol";

/// @notice V4 decides whether to invoke specific hooks by inspecting the least significant bits
/// of the address that the hooks contract is deployed to.
/// For example, a hooks contract deployed to address: 0x0000000000000000000000000000000000002400
/// has the lowest bits '10 0100 0000 0000' which would cause the 'before initialize' and 'after add liquidity' hooks to be used.
/// See the Hooks library for the full spec.
/// @dev Should only be callable by the v4 PoolManager.
interface IHooks {
    /// @notice The hook called before the state of a pool is initialized
    /// @param sender The initial msg.sender for the initialize call
    /// @param key The key for the pool being initialized
    /// @param sqrtPriceX96 The sqrt(price) of the pool as a Q64.96
    /// @return bytes4 The function selector for the hook
    function beforeInitialize(address sender, PoolKey calldata key, uint160 sqrtPriceX96) external returns (bytes4);

    /// @notice The hook called after the state of a pool is initialized
    /// @param sender The initial msg.sender for the initialize call
    /// @param key The key for the pool being initialized
    /// @param sqrtPriceX96 The sqrt(price) of the pool as a Q64.96
    /// @param tick The current tick after the state of a pool is initialized
    /// @return bytes4 The function selector for the hook
    function afterInitialize(address sender, PoolKey calldata key, uint160 sqrtPriceX96, int24 tick)
        external
        returns (bytes4);

    /// @notice The hook called before liquidity is added
    /// @param sender The initial msg.sender for the add liquidity call
    /// @param key The key for the pool
    /// @param params The parameters for adding liquidity
    /// @param hookData Arbitrary data handed into the PoolManager by the liquidity provider to be passed on to the hook
    /// @return bytes4 The function selector for the hook
    function beforeAddLiquidity(
        address sender,
        PoolKey calldata key,
        ModifyLiquidityParams calldata params,
        bytes calldata hookData
    ) external returns (bytes4);

    /// @notice The hook called after liquidity is added
    /// @param sender The initial msg.sender for the add liquidity call
    /// @param key The key for the pool
    /// @param params The parameters for adding liquidity
    /// @param delta The caller's balance delta after adding liquidity; the sum of principal delta, fees accrued, and hook delta
    /// @param feesAccrued The fees accrued since the last time fees were collected from this position
    /// @param hookData Arbitrary data handed into the PoolManager by the liquidity provider to be passed on to the hook
    /// @return bytes4 The function selector for the hook
    /// @return BalanceDelta The hook's delta in token0 and token1. Positive: the hook is owed/took currency, negative: the hook owes/sent currency
    function afterAddLiquidity(
        address sender,
        PoolKey calldata key,
        ModifyLiquidityParams calldata params,
        BalanceDelta delta,
        BalanceDelta feesAccrued,
        bytes calldata hookData
    ) external returns (bytes4, BalanceDelta);

    /// @notice The hook called before liquidity is removed
    /// @param sender The initial msg.sender for the remove liquidity call
    /// @param key The key for the pool
    /// @param params The parameters for removing liquidity
    /// @param hookData Arbitrary data handed into the PoolManager by the liquidity provider to be be passed on to the hook
    /// @return bytes4 The function selector for the hook
    function beforeRemoveLiquidity(
        address sender,
        PoolKey calldata key,
        ModifyLiquidityParams calldata params,
        bytes calldata hookData
    ) external returns (bytes4);

    /// @notice The hook called after liquidity is removed
    /// @param sender The initial msg.sender for the remove liquidity call
    /// @param key The key for the pool
    /// @param params The parameters for removing liquidity
    /// @param delta The caller's balance delta after removing liquidity; the sum of principal delta, fees accrued, and hook delta
    /// @param feesAccrued The fees accrued since the last time fees were collected from this position
    /// @param hookData Arbitrary data handed into the PoolManager by the liquidity provider to be be passed on to the hook
    /// @return bytes4 The function selector for the hook
    /// @return BalanceDelta The hook's delta in token0 and token1. Positive: the hook is owed/took currency, negative: the hook owes/sent currency
    function afterRemoveLiquidity(
        address sender,
        PoolKey calldata key,
        ModifyLiquidityParams calldata params,
        BalanceDelta delta,
        BalanceDelta feesAccrued,
        bytes calldata hookData
    ) external returns (bytes4, BalanceDelta);

    /// @notice The hook called before a swap
    /// @param sender The initial msg.sender for the swap call
    /// @param key The key for the pool
    /// @param params The parameters for the swap
    /// @param hookData Arbitrary data handed into the PoolManager by the swapper to be be passed on to the hook
    /// @return bytes4 The function selector for the hook
    /// @return BeforeSwapDelta The hook's delta in specified and unspecified currencies. Positive: the hook is owed/took currency, negative: the hook owes/sent currency
    /// @return uint24 Optionally override the lp fee, only used if three conditions are met: 1. the Pool has a dynamic fee, 2. the value's 2nd highest bit is set (23rd bit, 0x400000), and 3. the value is less than or equal to the maximum fee (1 million)
    function beforeSwap(address sender, PoolKey calldata key, SwapParams calldata params, bytes calldata hookData)
        external
        returns (bytes4, BeforeSwapDelta, uint24);

    /// @notice The hook called after a swap
    /// @param sender The initial msg.sender for the swap call
    /// @param key The key for the pool
    /// @param params The parameters for the swap
    /// @param delta The amount owed to the caller (positive) or owed to the pool (negative)
    /// @param hookData Arbitrary data handed into the PoolManager by the swapper to be be passed on to the hook
    /// @return bytes4 The function selector for the hook
    /// @return int128 The hook's delta in unspecified currency. Positive: the hook is owed/took currency, negative: the hook owes/sent currency
    function afterSwap(
        address sender,
        PoolKey calldata key,
        SwapParams calldata params,
        BalanceDelta delta,
        bytes calldata hookData
    ) external returns (bytes4, int128);

    /// @notice The hook called before donate
    /// @param sender The initial msg.sender for the donate call
    /// @param key The key for the pool
    /// @param amount0 The amount of token0 being donated
    /// @param amount1 The amount of token1 being donated
    /// @param hookData Arbitrary data handed into the PoolManager by the donor to be be passed on to the hook
    /// @return bytes4 The function selector for the hook
    function beforeDonate(
        address sender,
        PoolKey calldata key,
        uint256 amount0,
        uint256 amount1,
        bytes calldata hookData
    ) external returns (bytes4);

    /// @notice The hook called after donate
    /// @param sender The initial msg.sender for the donate call
    /// @param key The key for the pool
    /// @param amount0 The amount of token0 being donated
    /// @param amount1 The amount of token1 being donated
    /// @param hookData Arbitrary data handed into the PoolManager by the donor to be be passed on to the hook
    /// @return bytes4 The function selector for the hook
    function afterDonate(
        address sender,
        PoolKey calldata key,
        uint256 amount0,
        uint256 amount1,
        bytes calldata hookData
    ) external returns (bytes4);
}

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

/// @title Minimal ERC20 interface for Uniswap
/// @notice Contains a subset of the full ERC20 interface that is used in Uniswap V3
interface IERC20Minimal {
    /// @notice Returns an account's balance in the token
    /// @param account The account for which to look up the number of tokens it has, i.e. its balance
    /// @return The number of tokens held by the account
    function balanceOf(address account) external view returns (uint256);

    /// @notice Transfers the amount of token from the `msg.sender` to the recipient
    /// @param recipient The account that will receive the amount transferred
    /// @param amount The number of tokens to send from the sender to the recipient
    /// @return Returns true for a successful transfer, false for an unsuccessful transfer
    function transfer(address recipient, uint256 amount) external returns (bool);

    /// @notice Returns the current allowance given to a spender by an owner
    /// @param owner The account of the token owner
    /// @param spender The account of the token spender
    /// @return The current allowance granted by `owner` to `spender`
    function allowance(address owner, address spender) external view returns (uint256);

    /// @notice Sets the allowance of a spender from the `msg.sender` to the value `amount`
    /// @param spender The account which will be allowed to spend a given amount of the owners tokens
    /// @param amount The amount of tokens allowed to be used by `spender`
    /// @return Returns true for a successful approval, false for unsuccessful
    function approve(address spender, uint256 amount) external returns (bool);

    /// @notice Transfers `amount` tokens from `sender` to `recipient` up to the allowance given to the `msg.sender`
    /// @param sender The account from which the transfer will be initiated
    /// @param recipient The recipient of the transfer
    /// @param amount The amount of the transfer
    /// @return Returns true for a successful transfer, false for unsuccessful
    function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);

    /// @notice Event emitted when tokens are transferred from one address to another, either via `#transfer` or `#transferFrom`.
    /// @param from The account from which the tokens were sent, i.e. the balance decreased
    /// @param to The account to which the tokens were sent, i.e. the balance increased
    /// @param value The amount of tokens that were transferred
    event Transfer(address indexed from, address indexed to, uint256 value);

    /// @notice Event emitted when the approval amount for the spender of a given owner's tokens changes.
    /// @param owner The account that approved spending of its tokens
    /// @param spender The account for which the spending allowance was modified
    /// @param value The new allowance from the owner to the spender
    event Approval(address indexed owner, address indexed spender, uint256 value);
}

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import {SafeCast} from "../libraries/SafeCast.sol";

/// @dev Two `int128` values packed into a single `int256` where the upper 128 bits represent the amount0
/// and the lower 128 bits represent the amount1.
type BalanceDelta is int256;

using {add as +, sub as -, eq as ==, neq as !=} for BalanceDelta global;
using BalanceDeltaLibrary for BalanceDelta global;
using SafeCast for int256;

function toBalanceDelta(int128 _amount0, int128 _amount1) pure returns (BalanceDelta balanceDelta) {
    assembly ("memory-safe") {
        balanceDelta := or(shl(128, _amount0), and(sub(shl(128, 1), 1), _amount1))
    }
}

function add(BalanceDelta a, BalanceDelta b) pure returns (BalanceDelta) {
    int256 res0;
    int256 res1;
    assembly ("memory-safe") {
        let a0 := sar(128, a)
        let a1 := signextend(15, a)
        let b0 := sar(128, b)
        let b1 := signextend(15, b)
        res0 := add(a0, b0)
        res1 := add(a1, b1)
    }
    return toBalanceDelta(res0.toInt128(), res1.toInt128());
}

function sub(BalanceDelta a, BalanceDelta b) pure returns (BalanceDelta) {
    int256 res0;
    int256 res1;
    assembly ("memory-safe") {
        let a0 := sar(128, a)
        let a1 := signextend(15, a)
        let b0 := sar(128, b)
        let b1 := signextend(15, b)
        res0 := sub(a0, b0)
        res1 := sub(a1, b1)
    }
    return toBalanceDelta(res0.toInt128(), res1.toInt128());
}

function eq(BalanceDelta a, BalanceDelta b) pure returns (bool) {
    return BalanceDelta.unwrap(a) == BalanceDelta.unwrap(b);
}

function neq(BalanceDelta a, BalanceDelta b) pure returns (bool) {
    return BalanceDelta.unwrap(a) != BalanceDelta.unwrap(b);
}

/// @notice Library for getting the amount0 and amount1 deltas from the BalanceDelta type
library BalanceDeltaLibrary {
    /// @notice A BalanceDelta of 0
    BalanceDelta public constant ZERO_DELTA = BalanceDelta.wrap(0);

    function amount0(BalanceDelta balanceDelta) internal pure returns (int128 _amount0) {
        assembly ("memory-safe") {
            _amount0 := sar(128, balanceDelta)
        }
    }

    function amount1(BalanceDelta balanceDelta) internal pure returns (int128 _amount1) {
        assembly ("memory-safe") {
            _amount1 := signextend(15, balanceDelta)
        }
    }
}

File 17 of 19 : PoolOperation.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.24;

import {PoolKey} from "../types/PoolKey.sol";
import {BalanceDelta} from "../types/BalanceDelta.sol";

/// @notice Parameter struct for `ModifyLiquidity` pool operations
struct ModifyLiquidityParams {
    // the lower and upper tick of the position
    int24 tickLower;
    int24 tickUpper;
    // how to modify the liquidity
    int256 liquidityDelta;
    // a value to set if you want unique liquidity positions at the same range
    bytes32 salt;
}

/// @notice Parameter struct for `Swap` pool operations
struct SwapParams {
    /// Whether to swap token0 for token1 or vice versa
    bool zeroForOne;
    /// The desired input amount if negative (exactIn), or the desired output amount if positive (exactOut)
    int256 amountSpecified;
    /// The sqrt price at which, if reached, the swap will stop executing
    uint160 sqrtPriceLimitX96;
}

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

// Return type of the beforeSwap hook.
// Upper 128 bits is the delta in specified tokens. Lower 128 bits is delta in unspecified tokens (to match the afterSwap hook)
type BeforeSwapDelta is int256;

// Creates a BeforeSwapDelta from specified and unspecified
function toBeforeSwapDelta(int128 deltaSpecified, int128 deltaUnspecified)
    pure
    returns (BeforeSwapDelta beforeSwapDelta)
{
    assembly ("memory-safe") {
        beforeSwapDelta := or(shl(128, deltaSpecified), and(sub(shl(128, 1), 1), deltaUnspecified))
    }
}

/// @notice Library for getting the specified and unspecified deltas from the BeforeSwapDelta type
library BeforeSwapDeltaLibrary {
    /// @notice A BeforeSwapDelta of 0
    BeforeSwapDelta public constant ZERO_DELTA = BeforeSwapDelta.wrap(0);

    /// extracts int128 from the upper 128 bits of the BeforeSwapDelta
    /// returned by beforeSwap
    function getSpecifiedDelta(BeforeSwapDelta delta) internal pure returns (int128 deltaSpecified) {
        assembly ("memory-safe") {
            deltaSpecified := sar(128, delta)
        }
    }

    /// extracts int128 from the lower 128 bits of the BeforeSwapDelta
    /// returned by beforeSwap and afterSwap
    function getUnspecifiedDelta(BeforeSwapDelta delta) internal pure returns (int128 deltaUnspecified) {
        assembly ("memory-safe") {
            deltaUnspecified := signextend(15, delta)
        }
    }
}

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import {CustomRevert} from "./CustomRevert.sol";

/// @title Safe casting methods
/// @notice Contains methods for safely casting between types
library SafeCast {
    using CustomRevert for bytes4;

    error SafeCastOverflow();

    /// @notice Cast a uint256 to a uint160, revert on overflow
    /// @param x The uint256 to be downcasted
    /// @return y The downcasted integer, now type uint160
    function toUint160(uint256 x) internal pure returns (uint160 y) {
        y = uint160(x);
        if (y != x) SafeCastOverflow.selector.revertWith();
    }

    /// @notice Cast a uint256 to a uint128, revert on overflow
    /// @param x The uint256 to be downcasted
    /// @return y The downcasted integer, now type uint128
    function toUint128(uint256 x) internal pure returns (uint128 y) {
        y = uint128(x);
        if (x != y) SafeCastOverflow.selector.revertWith();
    }

    /// @notice Cast a int128 to a uint128, revert on overflow or underflow
    /// @param x The int128 to be casted
    /// @return y The casted integer, now type uint128
    function toUint128(int128 x) internal pure returns (uint128 y) {
        if (x < 0) SafeCastOverflow.selector.revertWith();
        y = uint128(x);
    }

    /// @notice Cast a int256 to a int128, revert on overflow or underflow
    /// @param x The int256 to be downcasted
    /// @return y The downcasted integer, now type int128
    function toInt128(int256 x) internal pure returns (int128 y) {
        y = int128(x);
        if (y != x) SafeCastOverflow.selector.revertWith();
    }

    /// @notice Cast a uint256 to a int256, revert on overflow
    /// @param x The uint256 to be casted
    /// @return y The casted integer, now type int256
    function toInt256(uint256 x) internal pure returns (int256 y) {
        y = int256(x);
        if (y < 0) SafeCastOverflow.selector.revertWith();
    }

    /// @notice Cast a uint256 to a int128, revert on overflow
    /// @param x The uint256 to be downcasted
    /// @return The downcasted integer, now type int128
    function toInt128(uint256 x) internal pure returns (int128) {
        if (x >= 1 << 127) SafeCastOverflow.selector.revertWith();
        return int128(int256(x));
    }
}

Settings
{
  "remappings": [
    "lib/UniswapX:openzeppelin-contracts-upgradeable/=lib/UniswapX/lib/openzeppelin-contracts-upgradeable/",
    "lib/UniswapX:openzeppelin-contracts/=lib/UniswapX/lib/openzeppelin-contracts/contracts/",
    "lib/UniswapX:openzeppelin/=lib/UniswapX/lib/openzeppelin-contracts/contracts/",
    "@openzeppelin/contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts/",
    "@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/",
    "openzeppelin-contracts/=lib/openzeppelin-contracts/contracts/",
    "openzeppelin-contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts/",
    "UniswapX/=lib/UniswapX/",
    "ds-test/=lib/UniswapX/lib/forge-std/lib/ds-test/src/",
    "erc4626-tests/=lib/openzeppelin-contracts-upgradeable/lib/erc4626-tests/",
    "forge-gas-snapshot/=lib/UniswapX/lib/forge-gas-snapshot/src/",
    "forge-std/=lib/forge-std/src/",
    "permit2/=lib/UniswapX/lib/permit2/",
    "solmate/=lib/UniswapX/lib/solmate/",
    "chainlink/=lib/chainlink/contracts/src/v0.8/",
    "across/=/lib/across/contracts/",
    "safe-smart-account/=lib/safe-smart-account/contracts/",
    "src/=src/",
    "script/=script/",
    "test/=test/",
    "@uniswap/v4-core/=lib/uniswap-hooks/lib/v4-core/",
    "@uniswap/v4-periphery/=lib/uniswap-hooks/lib/v4-periphery/",
    "v4-core/=lib/uniswap-hooks/lib/v4-core/",
    "v4-periphery/=lib/uniswap-hooks/lib/v4-periphery/",
    "@openzeppelin/uniswap-hooks/=lib/uniswap-hooks/",
    "hookmate/=lib/hookmate/src/",
    "@ensdomains/=lib/uniswap-hooks/lib/v4-core/node_modules/@ensdomains/",
    "FreshCryptoLib/=lib/UniswapX/lib/calibur/lib/webauthn-sol/lib/FreshCryptoLib/solidity/src/",
    "account-abstraction/=lib/UniswapX/lib/calibur/lib/account-abstraction/contracts/",
    "calibur/=lib/UniswapX/lib/calibur/",
    "erc20-eth/=lib/UniswapX/lib/calibur/lib/erc20-eth/src/",
    "halmos-cheatcodes/=lib/openzeppelin-contracts-upgradeable/lib/halmos-cheatcodes/src/",
    "hardhat/=lib/uniswap-hooks/lib/v4-core/node_modules/hardhat/",
    "openzeppelin/=lib/UniswapX/lib/openzeppelin-contracts/contracts/",
    "solady/=lib/solady/src/",
    "solarray/=lib/UniswapX/lib/solarray/src/",
    "uniswap-hooks/=lib/uniswap-hooks/src/",
    "webauthn-sol/=lib/UniswapX/lib/calibur/lib/webauthn-sol/"
  ],
  "optimizer": {
    "enabled": true,
    "runs": 100000
  },
  "metadata": {
    "useLiteralContent": false,
    "bytecodeHash": "ipfs",
    "appendCBOR": true
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "evmVersion": "cancun",
  "viaIR": false
}

Contract Security Audit

Contract ABI

API
[{"inputs":[{"internalType":"int24","name":"_maxDeltaTick","type":"int24"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"AccessControlBadConfirmation","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"bytes32","name":"neededRole","type":"bytes32"}],"name":"AccessControlUnauthorizedAccount","type":"error"},{"inputs":[],"name":"InvalidJitLowerRange","type":"error"},{"inputs":[],"name":"InvalidJitUpperRange","type":"error"},{"inputs":[],"name":"InvalidMaxDeltaTick","type":"error"},{"inputs":[],"name":"InvalidTicks","type":"error"},{"inputs":[],"name":"MaxDeltaTickExceeded","type":"error"},{"inputs":[],"name":"PriceFrequency","type":"error"},{"inputs":[],"name":"StalePrice","type":"error"},{"inputs":[],"name":"ZeroLiquidity","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","type":"event"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MIN_FREQUENCY","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ORACLE_REPORTER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"STALE_THRESHOLD","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"UASSET_SCALE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"PoolId","name":"poolId","type":"bytes32"}],"name":"getPrice","outputs":[{"components":[{"internalType":"int24","name":"jitLowerTick","type":"int24"},{"internalType":"int24","name":"jitUpperTick","type":"int24"},{"internalType":"uint24","name":"jitLowerRange","type":"uint24"},{"internalType":"uint24","name":"jitUpperRange","type":"uint24"},{"internalType":"uint256","name":"uAssetLiquidity","type":"uint256"},{"internalType":"uint256","name":"usdcLiquidity","type":"uint256"},{"internalType":"uint48","name":"timestamp","type":"uint48"}],"internalType":"struct OracleReport","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxDeltaTick","outputs":[{"internalType":"int24","name":"","type":"int24"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"callerConfirmation","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"PoolId","name":"poolId","type":"bytes32"}],"name":"safeGetPrice","outputs":[{"components":[{"internalType":"int24","name":"jitLowerTick","type":"int24"},{"internalType":"int24","name":"jitUpperTick","type":"int24"},{"internalType":"uint24","name":"jitLowerRange","type":"uint24"},{"internalType":"uint24","name":"jitUpperRange","type":"uint24"},{"internalType":"uint256","name":"uAssetLiquidity","type":"uint256"},{"internalType":"uint256","name":"usdcLiquidity","type":"uint256"},{"internalType":"uint48","name":"timestamp","type":"uint48"}],"internalType":"struct OracleReport","name":"report","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"int24","name":"_maxDeltaTick","type":"int24"}],"name":"setMaxDeltaTick","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"PoolId","name":"poolId","type":"bytes32"},{"internalType":"int24","name":"jitLowerTick","type":"int24"},{"internalType":"int24","name":"jitUpperTick","type":"int24"},{"internalType":"uint16","name":"jitLowerRange","type":"uint16"},{"internalType":"uint16","name":"jitUpperRange","type":"uint16"},{"internalType":"uint72","name":"uAssetLiquidity","type":"uint72"},{"internalType":"uint72","name":"usdcLiquidity","type":"uint72"}],"internalType":"struct UniversalJITOracle.OracleUpdate","name":"update","type":"tuple"}],"name":"setPrice","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"PoolId","name":"poolId","type":"bytes32"},{"internalType":"int24","name":"jitLowerTick","type":"int24"},{"internalType":"int24","name":"jitUpperTick","type":"int24"},{"internalType":"uint16","name":"jitLowerRange","type":"uint16"},{"internalType":"uint16","name":"jitUpperRange","type":"uint16"},{"internalType":"uint72","name":"uAssetLiquidity","type":"uint72"},{"internalType":"uint72","name":"usdcLiquidity","type":"uint72"}],"internalType":"struct UniversalJITOracle.OracleUpdate[]","name":"updates","type":"tuple[]"}],"name":"setPrices","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"}]

608060405234801561000f575f80fd5b5060405161155e38038061155e83398101604081905261002e9161011e565b5f8160020b13610051576040516342d1268d60e11b815260040160405180910390fd5b6001805462ffffff191662ffffff831617905561006e5f33610075565b5050610145565b5f828152602081815260408083206001600160a01b038516845290915281205460ff16610115575f838152602081815260408083206001600160a01b03861684529091529020805460ff191660011790556100cd3390565b6001600160a01b0316826001600160a01b0316847f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a4506001610118565b505f5b92915050565b5f6020828403121561012e575f80fd5b81518060020b811461013e575f80fd5b9392505050565b61140c806101525f395ff3fe608060405234801561000f575f80fd5b5060043610610115575f3560e01c80635432e04b116100ad57806391d148541161007d578063a217fddf11610063578063a217fddf146102f8578063bc60a7aa146102ff578063d547741f14610312575f80fd5b806391d148541461028e578063a06f660e146102d1575f80fd5b80635432e04b146102405780635bdddcd0146102605780637d690c511461026857806385ef2d0c1461027b575f80fd5b80632f2ff15d116100e85780632f2ff15d1461018557806331d98b3f1461019a57806336568abe1461021a5780634923f7aa1461022d575f80fd5b806301ffc9a714610119578063248a9ca3146101415780632bddb8ba146101715780632cc31a7c14610179575b5f80fd5b61012c610127366004610faf565b610325565b60405190151581526020015b60405180910390f35b61016361014f366004610fee565b5f9081526020819052604090206001015490565b604051908152602001610138565b610163600581565b61016364e8d4a5100081565b610198610193366004611005565b6103bd565b005b6101ad6101a8366004610fee565b6103e7565b60405161013891905f60e082019050825160020b8252602083015160020b602083015262ffffff604084015116604083015262ffffff60608401511660608301526080830151608083015260a083015160a083015265ffffffffffff60c08401511660c083015292915050565b610198610228366004611005565b610512565b61019861023b3660046111ab565b610570565b60015461024d9060020b81565b60405160029190910b8152602001610138565b610163601e81565b610198610276366004611261565b6105d0565b61019861028936600461127b565b610607565b61012c61029c366004611005565b5f9182526020828152604080842073ffffffffffffffffffffffffffffffffffffffff93909316845291905290205460ff1690565b6101637fbe70bdea4fd0e1afdfe1dbaf3f90843e549c26043d4f73bde45a21a96d44101d81565b6101635f81565b6101ad61030d366004610fee565b610684565b610198610320366004611005565b610769565b5f7fffffffff0000000000000000000000000000000000000000000000000000000082167f7965db0b0000000000000000000000000000000000000000000000000000000014806103b757507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316145b92915050565b5f828152602081905260409020600101546103d78161078d565b6103e1838361079a565b50505050565b6040805160e0810182525f80825260208201819052918101829052606081018290526080810182905260a0810182905260c08101919091526040805160e0810182525f848152600260208181528483205480830b855263010000008104830b8286015261ffff6601000000000000820481169686019690965268010000000000000000810490951660608501529186905290529060808201906104a39068ffffffffffffffffff6a010000000000000000000090910416610893565b81525f84815260026020818152604080842054730100000000000000000000000000000000000000810468ffffffffffffffffff168387015297909352527c010000000000000000000000000000000000000000000000000000000090940463ffffffff169301929092525090565b73ffffffffffffffffffffffffffffffffffffffff81163314610561576040517f6697b23200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61056b82826108b6565b505050565b7fbe70bdea4fd0e1afdfe1dbaf3f90843e549c26043d4f73bde45a21a96d44101d61059a8161078d565b81515f5b818110156103e1576105c88482815181106105bb576105bb611294565b602002602001015161096f565b60010161059e565b7fbe70bdea4fd0e1afdfe1dbaf3f90843e549c26043d4f73bde45a21a96d44101d6105fa8161078d565b6106038261096f565b5050565b5f6106118161078d565b5f8260020b1361064d576040517f85a24d1a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b50600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000001662ffffff92909216919091179055565b6040805160e0810182525f80825260208201819052918101829052606081018290526080810182905260a0810182905260c08101919091526106c5826103e7565b905080608001515f14806106db575060a0810151155b15610712576040517f1007454800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b42601e8260c0015165ffffffffffff1661072c91906112ee565b1015610764576040517f19abf40e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b919050565b5f828152602081905260409020600101546107838161078d565b6103e183836108b6565b6107978133610d8b565b50565b5f8281526020818152604080832073ffffffffffffffffffffffffffffffffffffffff8516845290915281205460ff1661088c575f8381526020818152604080832073ffffffffffffffffffffffffffffffffffffffff86168452909152902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016600117905561082a3390565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16847f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45060016103b7565b505f6103b7565b5f806108af64e8d4a5100068ffffffffffffffffff8516611301565b9392505050565b5f8281526020818152604080832073ffffffffffffffffffffffffffffffffffffffff8516845290915281205460ff161561088c575f8381526020818152604080832073ffffffffffffffffffffffffffffffffffffffff8616808552925280832080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016905551339286917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45060016103b7565b61097881610e14565b80515f90815260026020818152604092839020835160e081018552905480840b82526301000000810490930b9181019190915261ffff66010000000000008304811693820193909352680100000000000000008204909216606083015268ffffffffffffffffff6a010000000000000000000082048116608084015273010000000000000000000000000000000000000082041660a083015263ffffffff7c01000000000000000000000000000000000000000000000000000000009091041660c08201819052610a4b906005906112ee565b421015610a84576040517ffefc520300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60c081015163ffffffff1615610b8657805160208301515f91610aa691611318565b600154909150600290810b9082900b1380610ad45750600154610acb9060020b611359565b60020b8160020b125b15610b0b576040517fc52744ef00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b81602001518360400151610b1f9190611318565b600154909150600290810b9082900b1380610b4d5750600154610b449060020b611359565b60020b8160020b125b15610b84576040517fc52744ef00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b505b506040805160e081018252602080840151600290810b835284840151810b82840190815260608087015161ffff9081168688019081526080808a0151831693880193845260a0808b015168ffffffffffffffffff908116928a0192835260c0808d01518216928b0192835263ffffffff428116918c019182529c515f908152989099529990962097518854955192519451915196519751909a167c0100000000000000000000000000000000000000000000000000000000027bffffffffffffffffffffffffffffffffffffffffffffffffffffffff978a16730100000000000000000000000000000000000000027fffffffff000000000000000000ffffffffffffffffffffffffffffffffffffff97909a166a010000000000000000000002969096167fffffffff000000000000000000000000000000000000ffffffffffffffffffff91841668010000000000000000027fffffffffffffffffffffffffffffffffffffffffffff0000ffffffffffffffff95909416660100000000000002949094167fffffffffffffffffffffffffffffffffffffffffffff00000000ffffffffffff62ffffff9384166301000000027fffffffffffffffffffffffffffffffffffffffffffffffffffff00000000000090971693909b16929092179490941798909816979097179690961716949094179290921791909116919091179055565b5f8281526020818152604080832073ffffffffffffffffffffffffffffffffffffffff8516845290915290205460ff16610603576040517fe2517d3f00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff821660048201526024810183905260440160405180910390fd5b806040015160020b816020015160020b1315610e5c576040517f1434ed7f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b806060015161ffff165f03610e9d576040517f0f32a29f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b806080015161ffff165f03610ede576040517f7b0adf0400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff2761860020b816060015161ffff168260200151610f1a9190611318565b60020b1215610f55576040517f0f32a29f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b620d89e860020b816080015161ffff168260400151610f749190611395565b60020b1315610797576040517f7b0adf0400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f60208284031215610fbf575f80fd5b81357fffffffff00000000000000000000000000000000000000000000000000000000811681146108af575f80fd5b5f60208284031215610ffe575f80fd5b5035919050565b5f8060408385031215611016575f80fd5b82359150602083013573ffffffffffffffffffffffffffffffffffffffff81168114611040575f80fd5b809150509250929050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff811182821017156110bf576110bf61104b565b604052919050565b8035600281900b8114610764575f80fd5b803561ffff81168114610764575f80fd5b803568ffffffffffffffffff81168114610764575f80fd5b5f60e08284031215611111575f80fd5b60405160e0810167ffffffffffffffff811182821017156111345761113461104b565b6040528235815290508061114a602084016110c7565b602082015261115b604084016110c7565b604082015261116c606084016110d8565b606082015261117d608084016110d8565b608082015261118e60a084016110e9565b60a082015261119f60c084016110e9565b60c08201525092915050565b5f602082840312156111bb575f80fd5b813567ffffffffffffffff8111156111d1575f80fd5b8201601f810184136111e1575f80fd5b803567ffffffffffffffff8111156111fb576111fb61104b565b61120a60208260051b01611078565b80828252602082019150602060e0840285010192508683111561122b575f80fd5b6020840193505b82841015611257576112448785611101565b825260208201915060e084019350611232565b9695505050505050565b5f60e08284031215611271575f80fd5b6108af8383611101565b5f6020828403121561128b575f80fd5b6108af826110c7565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b808201808211156103b7576103b76112c1565b80820281158282048414176103b7576103b76112c1565b600282810b9082900b037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8000008112627fffff821317156103b7576103b76112c1565b5f8160020b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffff800000810361138d5761138d6112c1565b5f0392915050565b600281810b9083900b01627fffff81137fffffffffffffffffffffffffffffffffffffffffffffffffffffffffff800000821217156103b7576103b76112c156fea2646970667358221220d3c25364cc82b010a6d87cf20276f7e34d5ec6bfba8fbcdca6f3c8edf2b5c59b64736f6c634300081a003300000000000000000000000000000000000000000000000000000000000003e8

Deployed Bytecode

0x608060405234801561000f575f80fd5b5060043610610115575f3560e01c80635432e04b116100ad57806391d148541161007d578063a217fddf11610063578063a217fddf146102f8578063bc60a7aa146102ff578063d547741f14610312575f80fd5b806391d148541461028e578063a06f660e146102d1575f80fd5b80635432e04b146102405780635bdddcd0146102605780637d690c511461026857806385ef2d0c1461027b575f80fd5b80632f2ff15d116100e85780632f2ff15d1461018557806331d98b3f1461019a57806336568abe1461021a5780634923f7aa1461022d575f80fd5b806301ffc9a714610119578063248a9ca3146101415780632bddb8ba146101715780632cc31a7c14610179575b5f80fd5b61012c610127366004610faf565b610325565b60405190151581526020015b60405180910390f35b61016361014f366004610fee565b5f9081526020819052604090206001015490565b604051908152602001610138565b610163600581565b61016364e8d4a5100081565b610198610193366004611005565b6103bd565b005b6101ad6101a8366004610fee565b6103e7565b60405161013891905f60e082019050825160020b8252602083015160020b602083015262ffffff604084015116604083015262ffffff60608401511660608301526080830151608083015260a083015160a083015265ffffffffffff60c08401511660c083015292915050565b610198610228366004611005565b610512565b61019861023b3660046111ab565b610570565b60015461024d9060020b81565b60405160029190910b8152602001610138565b610163601e81565b610198610276366004611261565b6105d0565b61019861028936600461127b565b610607565b61012c61029c366004611005565b5f9182526020828152604080842073ffffffffffffffffffffffffffffffffffffffff93909316845291905290205460ff1690565b6101637fbe70bdea4fd0e1afdfe1dbaf3f90843e549c26043d4f73bde45a21a96d44101d81565b6101635f81565b6101ad61030d366004610fee565b610684565b610198610320366004611005565b610769565b5f7fffffffff0000000000000000000000000000000000000000000000000000000082167f7965db0b0000000000000000000000000000000000000000000000000000000014806103b757507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316145b92915050565b5f828152602081905260409020600101546103d78161078d565b6103e1838361079a565b50505050565b6040805160e0810182525f80825260208201819052918101829052606081018290526080810182905260a0810182905260c08101919091526040805160e0810182525f848152600260208181528483205480830b855263010000008104830b8286015261ffff6601000000000000820481169686019690965268010000000000000000810490951660608501529186905290529060808201906104a39068ffffffffffffffffff6a010000000000000000000090910416610893565b81525f84815260026020818152604080842054730100000000000000000000000000000000000000810468ffffffffffffffffff168387015297909352527c010000000000000000000000000000000000000000000000000000000090940463ffffffff169301929092525090565b73ffffffffffffffffffffffffffffffffffffffff81163314610561576040517f6697b23200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61056b82826108b6565b505050565b7fbe70bdea4fd0e1afdfe1dbaf3f90843e549c26043d4f73bde45a21a96d44101d61059a8161078d565b81515f5b818110156103e1576105c88482815181106105bb576105bb611294565b602002602001015161096f565b60010161059e565b7fbe70bdea4fd0e1afdfe1dbaf3f90843e549c26043d4f73bde45a21a96d44101d6105fa8161078d565b6106038261096f565b5050565b5f6106118161078d565b5f8260020b1361064d576040517f85a24d1a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b50600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000001662ffffff92909216919091179055565b6040805160e0810182525f80825260208201819052918101829052606081018290526080810182905260a0810182905260c08101919091526106c5826103e7565b905080608001515f14806106db575060a0810151155b15610712576040517f1007454800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b42601e8260c0015165ffffffffffff1661072c91906112ee565b1015610764576040517f19abf40e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b919050565b5f828152602081905260409020600101546107838161078d565b6103e183836108b6565b6107978133610d8b565b50565b5f8281526020818152604080832073ffffffffffffffffffffffffffffffffffffffff8516845290915281205460ff1661088c575f8381526020818152604080832073ffffffffffffffffffffffffffffffffffffffff86168452909152902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016600117905561082a3390565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16847f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45060016103b7565b505f6103b7565b5f806108af64e8d4a5100068ffffffffffffffffff8516611301565b9392505050565b5f8281526020818152604080832073ffffffffffffffffffffffffffffffffffffffff8516845290915281205460ff161561088c575f8381526020818152604080832073ffffffffffffffffffffffffffffffffffffffff8616808552925280832080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016905551339286917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45060016103b7565b61097881610e14565b80515f90815260026020818152604092839020835160e081018552905480840b82526301000000810490930b9181019190915261ffff66010000000000008304811693820193909352680100000000000000008204909216606083015268ffffffffffffffffff6a010000000000000000000082048116608084015273010000000000000000000000000000000000000082041660a083015263ffffffff7c01000000000000000000000000000000000000000000000000000000009091041660c08201819052610a4b906005906112ee565b421015610a84576040517ffefc520300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60c081015163ffffffff1615610b8657805160208301515f91610aa691611318565b600154909150600290810b9082900b1380610ad45750600154610acb9060020b611359565b60020b8160020b125b15610b0b576040517fc52744ef00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b81602001518360400151610b1f9190611318565b600154909150600290810b9082900b1380610b4d5750600154610b449060020b611359565b60020b8160020b125b15610b84576040517fc52744ef00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b505b506040805160e081018252602080840151600290810b835284840151810b82840190815260608087015161ffff9081168688019081526080808a0151831693880193845260a0808b015168ffffffffffffffffff908116928a0192835260c0808d01518216928b0192835263ffffffff428116918c019182529c515f908152989099529990962097518854955192519451915196519751909a167c0100000000000000000000000000000000000000000000000000000000027bffffffffffffffffffffffffffffffffffffffffffffffffffffffff978a16730100000000000000000000000000000000000000027fffffffff000000000000000000ffffffffffffffffffffffffffffffffffffff97909a166a010000000000000000000002969096167fffffffff000000000000000000000000000000000000ffffffffffffffffffff91841668010000000000000000027fffffffffffffffffffffffffffffffffffffffffffff0000ffffffffffffffff95909416660100000000000002949094167fffffffffffffffffffffffffffffffffffffffffffff00000000ffffffffffff62ffffff9384166301000000027fffffffffffffffffffffffffffffffffffffffffffffffffffff00000000000090971693909b16929092179490941798909816979097179690961716949094179290921791909116919091179055565b5f8281526020818152604080832073ffffffffffffffffffffffffffffffffffffffff8516845290915290205460ff16610603576040517fe2517d3f00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff821660048201526024810183905260440160405180910390fd5b806040015160020b816020015160020b1315610e5c576040517f1434ed7f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b806060015161ffff165f03610e9d576040517f0f32a29f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b806080015161ffff165f03610ede576040517f7b0adf0400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff2761860020b816060015161ffff168260200151610f1a9190611318565b60020b1215610f55576040517f0f32a29f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b620d89e860020b816080015161ffff168260400151610f749190611395565b60020b1315610797576040517f7b0adf0400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f60208284031215610fbf575f80fd5b81357fffffffff00000000000000000000000000000000000000000000000000000000811681146108af575f80fd5b5f60208284031215610ffe575f80fd5b5035919050565b5f8060408385031215611016575f80fd5b82359150602083013573ffffffffffffffffffffffffffffffffffffffff81168114611040575f80fd5b809150509250929050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff811182821017156110bf576110bf61104b565b604052919050565b8035600281900b8114610764575f80fd5b803561ffff81168114610764575f80fd5b803568ffffffffffffffffff81168114610764575f80fd5b5f60e08284031215611111575f80fd5b60405160e0810167ffffffffffffffff811182821017156111345761113461104b565b6040528235815290508061114a602084016110c7565b602082015261115b604084016110c7565b604082015261116c606084016110d8565b606082015261117d608084016110d8565b608082015261118e60a084016110e9565b60a082015261119f60c084016110e9565b60c08201525092915050565b5f602082840312156111bb575f80fd5b813567ffffffffffffffff8111156111d1575f80fd5b8201601f810184136111e1575f80fd5b803567ffffffffffffffff8111156111fb576111fb61104b565b61120a60208260051b01611078565b80828252602082019150602060e0840285010192508683111561122b575f80fd5b6020840193505b82841015611257576112448785611101565b825260208201915060e084019350611232565b9695505050505050565b5f60e08284031215611271575f80fd5b6108af8383611101565b5f6020828403121561128b575f80fd5b6108af826110c7565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b808201808211156103b7576103b76112c1565b80820281158282048414176103b7576103b76112c1565b600282810b9082900b037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8000008112627fffff821317156103b7576103b76112c1565b5f8160020b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffff800000810361138d5761138d6112c1565b5f0392915050565b600281810b9083900b01627fffff81137fffffffffffffffffffffffffffffffffffffffffffffffffffffffffff800000821217156103b7576103b76112c156fea2646970667358221220d3c25364cc82b010a6d87cf20276f7e34d5ec6bfba8fbcdca6f3c8edf2b5c59b64736f6c634300081a0033

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

00000000000000000000000000000000000000000000000000000000000003e8

-----Decoded View---------------
Arg [0] : _maxDeltaTick (int24): 1000

-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 00000000000000000000000000000000000000000000000000000000000003e8


Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

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

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
Loading...
Loading
[ Download: CSV Export  ]

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.