Sepolia Testnet

Contract

0xa85D1A8f20d1D51612Ffa969f8594166A855c3C2

Overview

ETH Balance

0 ETH

Multichain Info

N/A
Transaction Hash
Method
Block
From
To
0x60e0346161921642024-06-26 17:22:1222 days ago1719422532IN
 Create: MarginalV1Factory
0 ETH0.005587188.81562939

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

Contract Source Code Verified (Exact Match)

Contract Name:
MarginalV1Factory

Compiler Version
v0.8.17+commit.8df45f5f

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion, GNU AGPLv3 license

Contract Source Code (Solidity Standard Json-Input format)

File 1 of 12 : MarginalV1Factory.sol
// SPDX-License-Identifier: AGPL-3.0
pragma solidity 0.8.17;

import {IUniswapV3Factory} from "@uniswap/v3-core/contracts/interfaces/IUniswapV3Factory.sol";
import {IUniswapV3Pool} from "@uniswap/v3-core/contracts/interfaces/IUniswapV3Pool.sol";

import {IMarginalV1Factory} from "./interfaces/IMarginalV1Factory.sol";
import {IMarginalV1PoolDeployer} from "./interfaces/IMarginalV1PoolDeployer.sol";

contract MarginalV1Factory is IMarginalV1Factory {
    /// @inheritdoc IMarginalV1Factory
    address public immutable marginalV1Deployer;
    /// @inheritdoc IMarginalV1Factory
    address public immutable uniswapV3Factory;
    /// @inheritdoc IMarginalV1Factory
    uint16 public immutable observationCardinalityMinimum;

    /// @inheritdoc IMarginalV1Factory
    address public owner;

    /// @inheritdoc IMarginalV1Factory
    mapping(address => mapping(address => mapping(uint24 => mapping(address => address))))
        public getPool;
    /// @inheritdoc IMarginalV1Factory
    mapping(address => bool) public isPool;
    /// @inheritdoc IMarginalV1Factory
    mapping(uint24 => uint256) public getLeverage;

    event PoolCreated(
        address indexed token0,
        address indexed token1,
        uint24 maintenance,
        address indexed oracle,
        address pool
    );
    event LeverageEnabled(uint24 maintenance, uint256 leverage);
    event OwnerChanged(address indexed oldOwner, address indexed newOwner);

    error Unauthorized();
    error InvalidMaintenance();
    error InvalidOracle();
    error InvalidObservationCardinality(uint16 observationCardinality);
    error PoolActive();
    error LeverageActive();

    constructor(
        address _marginalV1Deployer,
        address _uniswapV3Factory,
        uint16 _observationCardinalityMinimum
    ) {
        owner = msg.sender;
        emit OwnerChanged(address(0), msg.sender);

        marginalV1Deployer = _marginalV1Deployer;
        uniswapV3Factory = _uniswapV3Factory;
        observationCardinalityMinimum = _observationCardinalityMinimum;

        getLeverage[250000] = 5000000;
        emit LeverageEnabled(250000, 5000000);
        getLeverage[500000] = 3000000;
        emit LeverageEnabled(500000, 3000000);
        getLeverage[1000000] = 2000000;
        emit LeverageEnabled(1000000, 2000000);
    }

    /// @inheritdoc IMarginalV1Factory
    function createPool(
        address tokenA,
        address tokenB,
        uint24 maintenance,
        uint24 uniswapV3Fee
    ) external returns (address pool) {
        (address token0, address token1) = tokenA < tokenB
            ? (tokenA, tokenB)
            : (tokenB, tokenA);
        if (getLeverage[maintenance] == 0) revert InvalidMaintenance();

        address oracle = IUniswapV3Factory(uniswapV3Factory).getPool(
            token0,
            token1,
            uniswapV3Fee
        ); // no need to check tokenA != tokenB or zero address given Uniswap checks if valid
        if (oracle == address(0)) revert InvalidOracle();
        if (getPool[token0][token1][maintenance][oracle] != address(0))
            revert PoolActive();

        (, , , uint16 observationCardinality, , , ) = IUniswapV3Pool(oracle)
            .slot0();
        if (observationCardinality < observationCardinalityMinimum)
            revert InvalidObservationCardinality(observationCardinality);

        pool = IMarginalV1PoolDeployer(marginalV1Deployer).deploy(
            token0,
            token1,
            maintenance,
            oracle
        );

        // populate in reverse for key (token0, token1, maintenance, oracle)
        getPool[token0][token1][maintenance][oracle] = pool;
        getPool[token1][token0][maintenance][oracle] = pool;
        isPool[pool] = true;

        emit PoolCreated(token0, token1, maintenance, oracle, pool);
    }

    /// @inheritdoc IMarginalV1Factory
    function setOwner(address _owner) external {
        if (msg.sender != owner) revert Unauthorized();
        emit OwnerChanged(owner, _owner);
        owner = _owner;
    }

    /// @inheritdoc IMarginalV1Factory
    function enableLeverage(uint24 maintenance) external {
        if (msg.sender != owner) revert Unauthorized();
        if (!(maintenance >= 100000 && maintenance < 1000000))
            // 2x to 11x
            revert InvalidMaintenance();
        if (getLeverage[maintenance] > 0) revert LeverageActive();

        // l = 1 + 1/M
        uint256 leverage = 1e6 + 1e12 / uint256(maintenance);
        getLeverage[maintenance] = leverage;

        emit LeverageEnabled(maintenance, leverage);
    }
}

File 2 of 12 : IMarginalV1Factory.sol
// SPDX-License-Identifier: AGPL-3.0
pragma solidity >=0.5.0;

/// @title The interface for the Marginal v1 factory
/// @notice The Marginal v1 factory creates pools and enables leverage tiers
interface IMarginalV1Factory {
    /// @notice Returns the Marginal v1 pool deployer to use when creating pools
    /// @return The address of the Marginal v1 pool deployer
    function marginalV1Deployer() external view returns (address);

    /// @notice Returns the Uniswap v3 factory to reference for pool oracles
    /// @return The address of the Uniswap v3 factory
    function uniswapV3Factory() external view returns (address);

    /// @notice Returns the minimum observation cardinality the Uniswap v3 oracle must have
    /// @dev Used as a check that averaging over `secondsAgo` in the Marginal v1 pool is likely to succeed
    /// @return The minimum observation cardinality the Uniswap v3 oracle must have
    function observationCardinalityMinimum() external view returns (uint16);

    /// @notice Returns the current owner of the Marginal v1 factory contract
    /// @dev Changed via permissioned `setOwner` function on the factory
    /// @return The address of the current owner of the Marginal v1 factory
    function owner() external view returns (address);

    /// @notice Returns the pool address for the given unique Marginal v1 pool key
    /// @dev tokenA and tokenB may be passed in either token0/token1 or token1/token0 order
    /// @param tokenA The address of either token0/token1
    /// @param tokenB The address of the other token token1/token0
    /// @param maintenance The minimum maintenance requirement for the pool
    /// @param oracle The address of the Uniswap v3 oracle used by the pool
    /// @return The address of the Marginal v1 pool
    function getPool(
        address tokenA,
        address tokenB,
        uint24 maintenance,
        address oracle
    ) external view returns (address);

    /// @notice Returns whether given address is a Marginal v1 pool deployed by the factory
    /// @return Whether address is a pool
    function isPool(address pool) external view returns (bool);

    /// @notice Returns the maximum leverage associated with the pool maintenance if pool exists
    /// @param maintenance The minimum maintenance margin requirement for the pool
    /// @return The maximum leverage for the pool maintenance if pool exists
    function getLeverage(uint24 maintenance) external view returns (uint256);

    /// @notice Creates a new Marginal v1 pool for the given unique pool key
    /// @dev tokenA and tokenB may be passed in either token0/token1 or token1/token0 order
    /// @param tokenA The address of either token0/token1
    /// @param tokenB The address of the other token token1/token0
    /// @param maintenance The minimum maintenance requirement for the pool
    /// @param uniswapV3Fee The fee tier of the Uniswap v3 oracle used by the Marginal v1 pool
    /// @return pool The address of the created Marginal v1 pool
    function createPool(
        address tokenA,
        address tokenB,
        uint24 maintenance,
        uint24 uniswapV3Fee
    ) external returns (address pool);

    /// @notice Sets the owner of the Marginal v1 factory contract
    /// @dev Can only be called by the current factory owner
    /// @param _owner The new owner of the factory
    function setOwner(address _owner) external;

    /// @notice Enables a new leverage tier for Marginal v1 pool deployments
    /// @dev Can only be called by the current factory owner
    /// @dev Set leverage tier obeys: l = 1 + 1/M; M = maintenance
    /// @param maintenance The minimum maintenance requirement associated with the leverage tier
    function enableLeverage(uint24 maintenance) external;
}

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

/// @title The interface for the Uniswap V3 Factory
/// @notice The Uniswap V3 Factory facilitates creation of Uniswap V3 pools and control over the protocol fees
interface IUniswapV3Factory {
    /// @notice Emitted when the owner of the factory is changed
    /// @param oldOwner The owner before the owner was changed
    /// @param newOwner The owner after the owner was changed
    event OwnerChanged(address indexed oldOwner, address indexed newOwner);

    /// @notice Emitted when a pool is created
    /// @param token0 The first token of the pool by address sort order
    /// @param token1 The second token of the pool by address sort order
    /// @param fee The fee collected upon every swap in the pool, denominated in hundredths of a bip
    /// @param tickSpacing The minimum number of ticks between initialized ticks
    /// @param pool The address of the created pool
    event PoolCreated(
        address indexed token0,
        address indexed token1,
        uint24 indexed fee,
        int24 tickSpacing,
        address pool
    );

    /// @notice Emitted when a new fee amount is enabled for pool creation via the factory
    /// @param fee The enabled fee, denominated in hundredths of a bip
    /// @param tickSpacing The minimum number of ticks between initialized ticks for pools created with the given fee
    event FeeAmountEnabled(uint24 indexed fee, int24 indexed tickSpacing);

    /// @notice Returns the current owner of the factory
    /// @dev Can be changed by the current owner via setOwner
    /// @return The address of the factory owner
    function owner() external view returns (address);

    /// @notice Returns the tick spacing for a given fee amount, if enabled, or 0 if not enabled
    /// @dev A fee amount can never be removed, so this value should be hard coded or cached in the calling context
    /// @param fee The enabled fee, denominated in hundredths of a bip. Returns 0 in case of unenabled fee
    /// @return The tick spacing
    function feeAmountTickSpacing(uint24 fee) external view returns (int24);

    /// @notice Returns the pool address for a given pair of tokens and a fee, or address 0 if it does not exist
    /// @dev tokenA and tokenB may be passed in either token0/token1 or token1/token0 order
    /// @param tokenA The contract address of either token0 or token1
    /// @param tokenB The contract address of the other token
    /// @param fee The fee collected upon every swap in the pool, denominated in hundredths of a bip
    /// @return pool The pool address
    function getPool(
        address tokenA,
        address tokenB,
        uint24 fee
    ) external view returns (address pool);

    /// @notice Creates a pool for the given two tokens and fee
    /// @param tokenA One of the two tokens in the desired pool
    /// @param tokenB The other of the two tokens in the desired pool
    /// @param fee The desired fee for the pool
    /// @dev tokenA and tokenB may be passed in either order: token0/token1 or token1/token0. tickSpacing is retrieved
    /// from the fee. The call will revert if the pool already exists, the fee is invalid, or the token arguments
    /// are invalid.
    /// @return pool The address of the newly created pool
    function createPool(
        address tokenA,
        address tokenB,
        uint24 fee
    ) external returns (address pool);

    /// @notice Updates the owner of the factory
    /// @dev Must be called by the current owner
    /// @param _owner The new owner of the factory
    function setOwner(address _owner) external;

    /// @notice Enables a fee amount with the given tickSpacing
    /// @dev Fee amounts may never be removed once enabled
    /// @param fee The fee amount to enable, denominated in hundredths of a bip (i.e. 1e-6)
    /// @param tickSpacing The spacing between ticks to be enforced for all pools created with the given fee amount
    function enableFeeAmount(uint24 fee, int24 tickSpacing) external;
}

File 4 of 12 : IMarginalV1PoolDeployer.sol
// SPDX-License-Identifier: AGPL-3.0
pragma solidity >=0.5.0;

/// @title The interface for the Marginal v1 pool deployer
/// @notice The Marginal v1 pool deployer deploys new pools
interface IMarginalV1PoolDeployer {
    /// @notice Deploys a new Marginal v1 pool for the given unique pool key
    /// @dev `msg.sender` treated as factory address for the pool
    /// @param token0 The address of token0 for the pool
    /// @param token1 The address of token1 for the pool
    /// @param maintenance The minimum maintenance requirement for the pool
    /// @param oracle The address of the Uniswap v3 oracle used by the pool
    /// @return pool The address of the deployed Marginal v1 pool
    function deploy(
        address token0,
        address token1,
        uint24 maintenance,
        address oracle
    ) external returns (address pool);
}

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

import {IUniswapV3PoolImmutables} from './pool/IUniswapV3PoolImmutables.sol';
import {IUniswapV3PoolState} from './pool/IUniswapV3PoolState.sol';
import {IUniswapV3PoolDerivedState} from './pool/IUniswapV3PoolDerivedState.sol';
import {IUniswapV3PoolActions} from './pool/IUniswapV3PoolActions.sol';
import {IUniswapV3PoolOwnerActions} from './pool/IUniswapV3PoolOwnerActions.sol';
import {IUniswapV3PoolErrors} from './pool/IUniswapV3PoolErrors.sol';
import {IUniswapV3PoolEvents} from './pool/IUniswapV3PoolEvents.sol';

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

}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

File 9 of 12 : IUniswapV3PoolErrors.sol
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity >=0.5.0;

/// @title Errors emitted by a pool
/// @notice Contains all events emitted by the pool
interface IUniswapV3PoolErrors {
    error LOK();
    error TLU();
    error TLM();
    error TUM();
    error AI();
    error M0();
    error M1();
    error AS();
    error IIA();
    error L();
    error F0();
    error F1();
}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Settings
{
  "optimizer": {
    "enabled": true,
    "runs": 200
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "remappings": [
    "@uniswap/v3-core/contracts=.cache/uniswap-v3-core/v0.8"
  ],
  "viaIR": true
}

Contract ABI

[{"inputs":[{"internalType":"address","name":"_marginalV1Deployer","type":"address"},{"internalType":"address","name":"_uniswapV3Factory","type":"address"},{"internalType":"uint16","name":"_observationCardinalityMinimum","type":"uint16"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"InvalidMaintenance","type":"error"},{"inputs":[{"internalType":"uint16","name":"observationCardinality","type":"uint16"}],"name":"InvalidObservationCardinality","type":"error"},{"inputs":[],"name":"InvalidOracle","type":"error"},{"inputs":[],"name":"LeverageActive","type":"error"},{"inputs":[],"name":"PoolActive","type":"error"},{"inputs":[],"name":"Unauthorized","type":"error"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint24","name":"maintenance","type":"uint24"},{"indexed":false,"internalType":"uint256","name":"leverage","type":"uint256"}],"name":"LeverageEnabled","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"oldOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnerChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"token0","type":"address"},{"indexed":true,"internalType":"address","name":"token1","type":"address"},{"indexed":false,"internalType":"uint24","name":"maintenance","type":"uint24"},{"indexed":true,"internalType":"address","name":"oracle","type":"address"},{"indexed":false,"internalType":"address","name":"pool","type":"address"}],"name":"PoolCreated","type":"event"},{"inputs":[{"internalType":"address","name":"tokenA","type":"address"},{"internalType":"address","name":"tokenB","type":"address"},{"internalType":"uint24","name":"maintenance","type":"uint24"},{"internalType":"uint24","name":"uniswapV3Fee","type":"uint24"}],"name":"createPool","outputs":[{"internalType":"address","name":"pool","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint24","name":"maintenance","type":"uint24"}],"name":"enableLeverage","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint24","name":"","type":"uint24"}],"name":"getLeverage","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint24","name":"","type":"uint24"},{"internalType":"address","name":"","type":"address"}],"name":"getPool","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"isPool","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"marginalV1Deployer","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"observationCardinalityMinimum","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_owner","type":"address"}],"name":"setOwner","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"uniswapV3Factory","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"}]

60e03461016c57601f610a4e38819003918201601f191683019291906001600160401b0384118385101761017157816060928492604096875283398101031261016c5761004b81610187565b6020918361005a848301610187565b91015161ffff8116810361016c578493849384926000943360018060a01b031987541617865584519233877fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c8180a360805260a05260c0526203d09080855260038352624c4b409081858720558252828201527f0175cc2b6dea96eecb423609f839e898f6c8e4457e87cb61c6d742dd58799a18958691a184826207a12080865260038452622dc6c08083882055825191825284820152a1620f42409283815260038252621e848092839120558351928352820152a1516108b2908161019c823960805181818161035501526104ff015260a0518181816102d3015261041b015260c05181818160ac01526104ac0152f35b600080fd5b634e487b7160e01b600052604160045260246000fd5b51906001600160a01b038216820361016c5756fe608060408181526004918236101561001657600080fd5b600092833560e01c91826313af4035146107475750816342265bc11461038457816348870e68146103405781635b16ebb7146103025781635b549182146102be5781635d0aec411461023d57816386f7b2981461020a5781638da5cb5b146101e2578163c5385e4f146100d4575063d6d563851461009357600080fd5b346100d057816003193601126100d0576020905161ffff7f0000000000000000000000000000000000000000000000000000000000000000168152f35b5080fd5b8383346100d05760203660031901126100d0576100ef610804565b82546001600160a01b031633036101d35762ffffff16620186a0811015806101c7575b156101b7578083526003602052818320546101a757801561019457620f42408164e8d4a5100004810180911161018157839450817f0175cc2b6dea96eecb423609f839e898f6c8e4457e87cb61c6d742dd58799a1894526003602052808386205582519182526020820152a180f35b634e487b7160e01b845260118552602484fd5b634e487b7160e01b835260128452602483fd5b8151634992f64360e01b81528490fd5b8151631b78542960e01b81528490fd5b50620f42408110610112565b81516282b42960e81b81528490fd5b5050346100d057816003193601126100d057905490516001600160a01b039091168152602090f35b5050346100d05760203660031901126100d0578060209262ffffff61022d610804565b1681526003845220549051908152f35b5050346100d05760803660031901126100d0576102586107c1565b6102606107dc565b6102686107f2565b6001600160a01b03926064358481169391908490036102ba57918593918560209894168452600188528585852091168452875262ffffff84842091168352865282822090825285522054169051908152f35b8680fd5b5050346100d057816003193601126100d057517f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168152602090f35b5050346100d05760203660031901126100d05760209160ff9082906001600160a01b0361032d6107c1565b1681526002855220541690519015158152f35b5050346100d057816003193601126100d057517f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168152602090f35b919050346106da5760803660031901126106da576103a06107c1565b6103a86107dc565b936103b16107f2565b6064359162ffffff8084168094036100d0576001600160a01b039488861681871610156107415797925b1690818152602097600389528682205415610731578580885192630b4c774160e11b84521694858a840152169485602483015260448201528881606481897f0000000000000000000000000000000000000000000000000000000000000000165afa90811561063b579086918391610714575b501694851561070457838252600189528682208583528952868220838352895286822086835289528087832054166106f4578651633850c7bd60e01b815260e0818a818a5afa9081156106ea57839161065b575b5061ffff809116907f00000000000000000000000000000000000000000000000000000000000000001681106106455750838751986378b40f7b60e11b8a52890152846024890152826044890152856064890152888860848185857f0000000000000000000000000000000000000000000000000000000000000000165af197881561063b5782986105e2575b509186827f87373c1fedf2e80f7cec4be7f52a3b3d258e63ac299d2ebfa1630ceae6afb2c5948683955260018c528282208883528c528282208483528c528282208983528c528282209a16996bffffffffffffffffffffffff60a01b908b8282541617905587825260018c528282208783528c528282208483528c528282208983528c528a8383209182541617905589815260028b5220600160ff1982541617905581519081528789820152a451908152f35b7f87373c1fedf2e80f7cec4be7f52a3b3d258e63ac299d2ebfa1630ceae6afb2c593919850879261062984928c8d3d10610634575b6106218183610816565b81019061084e565b99929450925061052f565b503d610617565b87513d84823e3d90fd5b886024918951916337016f2360e21b8352820152fd5b905060e0813d82116106e2575b8161067560e09383610816565b810103126106da578051828116036106da57898101518060020b036106da5761069f88820161086d565b506106ac6060820161086d565b906106b96080820161086d565b5060a081015160ff8116036106de5760c00151801515036106da57386104a2565b8280fd5b8380fd5b3d9150610668565b88513d85823e3d90fd5b865163649aa6df60e11b81528890fd5b8651639589a27d60e01b81528890fd5b61072b91508a3d8c11610634576106218183610816565b3861044e565b8651631b78542960e01b81528890fd5b926103db565b8491346106da5760203660031901126106da576107626107c1565b83546001600160a01b03808216949193909291338690036107b65750501680927fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c8580a36001600160a01b03191617815580f35b6282b42960e81b8152fd5b600435906001600160a01b03821682036107d757565b600080fd5b602435906001600160a01b03821682036107d757565b6044359062ffffff821682036107d757565b6004359062ffffff821682036107d757565b90601f8019910116810190811067ffffffffffffffff82111761083857604052565b634e487b7160e01b600052604160045260246000fd5b908160209103126107d757516001600160a01b03811681036107d75790565b519061ffff821682036107d75756fea264697066735822122015d295b54be295e00fb2aa100e8a31e0489f543e2c60c5c73b36d2ef2c14a3eb64736f6c6343000811003300000000000000000000000055da3d11cb0053a8690544522b36d23bbf292fd00000000000000000000000000227628f3f023bb0b980b67d528571c95c6dac1c00000000000000000000000000000000000000000000000000000000000003e8

Deployed Bytecode

0x608060408181526004918236101561001657600080fd5b600092833560e01c91826313af4035146107475750816342265bc11461038457816348870e68146103405781635b16ebb7146103025781635b549182146102be5781635d0aec411461023d57816386f7b2981461020a5781638da5cb5b146101e2578163c5385e4f146100d4575063d6d563851461009357600080fd5b346100d057816003193601126100d0576020905161ffff7f00000000000000000000000000000000000000000000000000000000000003e8168152f35b5080fd5b8383346100d05760203660031901126100d0576100ef610804565b82546001600160a01b031633036101d35762ffffff16620186a0811015806101c7575b156101b7578083526003602052818320546101a757801561019457620f42408164e8d4a5100004810180911161018157839450817f0175cc2b6dea96eecb423609f839e898f6c8e4457e87cb61c6d742dd58799a1894526003602052808386205582519182526020820152a180f35b634e487b7160e01b845260118552602484fd5b634e487b7160e01b835260128452602483fd5b8151634992f64360e01b81528490fd5b8151631b78542960e01b81528490fd5b50620f42408110610112565b81516282b42960e81b81528490fd5b5050346100d057816003193601126100d057905490516001600160a01b039091168152602090f35b5050346100d05760203660031901126100d0578060209262ffffff61022d610804565b1681526003845220549051908152f35b5050346100d05760803660031901126100d0576102586107c1565b6102606107dc565b6102686107f2565b6001600160a01b03926064358481169391908490036102ba57918593918560209894168452600188528585852091168452875262ffffff84842091168352865282822090825285522054169051908152f35b8680fd5b5050346100d057816003193601126100d057517f0000000000000000000000000227628f3f023bb0b980b67d528571c95c6dac1c6001600160a01b03168152602090f35b5050346100d05760203660031901126100d05760209160ff9082906001600160a01b0361032d6107c1565b1681526002855220541690519015158152f35b5050346100d057816003193601126100d057517f00000000000000000000000055da3d11cb0053a8690544522b36d23bbf292fd06001600160a01b03168152602090f35b919050346106da5760803660031901126106da576103a06107c1565b6103a86107dc565b936103b16107f2565b6064359162ffffff8084168094036100d0576001600160a01b039488861681871610156107415797925b1690818152602097600389528682205415610731578580885192630b4c774160e11b84521694858a840152169485602483015260448201528881606481897f0000000000000000000000000227628f3f023bb0b980b67d528571c95c6dac1c165afa90811561063b579086918391610714575b501694851561070457838252600189528682208583528952868220838352895286822086835289528087832054166106f4578651633850c7bd60e01b815260e0818a818a5afa9081156106ea57839161065b575b5061ffff809116907f00000000000000000000000000000000000000000000000000000000000003e81681106106455750838751986378b40f7b60e11b8a52890152846024890152826044890152856064890152888860848185857f00000000000000000000000055da3d11cb0053a8690544522b36d23bbf292fd0165af197881561063b5782986105e2575b509186827f87373c1fedf2e80f7cec4be7f52a3b3d258e63ac299d2ebfa1630ceae6afb2c5948683955260018c528282208883528c528282208483528c528282208983528c528282209a16996bffffffffffffffffffffffff60a01b908b8282541617905587825260018c528282208783528c528282208483528c528282208983528c528a8383209182541617905589815260028b5220600160ff1982541617905581519081528789820152a451908152f35b7f87373c1fedf2e80f7cec4be7f52a3b3d258e63ac299d2ebfa1630ceae6afb2c593919850879261062984928c8d3d10610634575b6106218183610816565b81019061084e565b99929450925061052f565b503d610617565b87513d84823e3d90fd5b886024918951916337016f2360e21b8352820152fd5b905060e0813d82116106e2575b8161067560e09383610816565b810103126106da578051828116036106da57898101518060020b036106da5761069f88820161086d565b506106ac6060820161086d565b906106b96080820161086d565b5060a081015160ff8116036106de5760c00151801515036106da57386104a2565b8280fd5b8380fd5b3d9150610668565b88513d85823e3d90fd5b865163649aa6df60e11b81528890fd5b8651639589a27d60e01b81528890fd5b61072b91508a3d8c11610634576106218183610816565b3861044e565b8651631b78542960e01b81528890fd5b926103db565b8491346106da5760203660031901126106da576107626107c1565b83546001600160a01b03808216949193909291338690036107b65750501680927fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c8580a36001600160a01b03191617815580f35b6282b42960e81b8152fd5b600435906001600160a01b03821682036107d757565b600080fd5b602435906001600160a01b03821682036107d757565b6044359062ffffff821682036107d757565b6004359062ffffff821682036107d757565b90601f8019910116810190811067ffffffffffffffff82111761083857604052565b634e487b7160e01b600052604160045260246000fd5b908160209103126107d757516001600160a01b03811681036107d75790565b519061ffff821682036107d75756fea264697066735822122015d295b54be295e00fb2aa100e8a31e0489f543e2c60c5c73b36d2ef2c14a3eb64736f6c63430008110033

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

00000000000000000000000055da3d11cb0053a8690544522b36d23bbf292fd00000000000000000000000000227628f3f023bb0b980b67d528571c95c6dac1c00000000000000000000000000000000000000000000000000000000000003e8

-----Decoded View---------------
Arg [0] : _marginalV1Deployer (address): 0x55DA3d11cb0053A8690544522b36d23BBF292Fd0
Arg [1] : _uniswapV3Factory (address): 0x0227628f3F023bb0B980b67D528571c95c6DaC1c
Arg [2] : _observationCardinalityMinimum (uint16): 1000

-----Encoded View---------------
3 Constructor Arguments found :
Arg [0] : 00000000000000000000000055da3d11cb0053a8690544522b36d23bbf292fd0
Arg [1] : 0000000000000000000000000227628f3f023bb0b980b67d528571c95c6dac1c
Arg [2] : 00000000000000000000000000000000000000000000000000000000000003e8


Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

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

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
[ 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.