Uniswap.Contracts.V3Pool (Uniswap v0.0.5)

View Source

Uniswap V3 Pool Contract

Summary

Functions

Default address of the contract. Returns nil if not specified.

Prepares burn(int24 tickLower, int24 tickUpper, uint128 amount) call parameters on the contract.

Prepares collect(address recipient, int24 tickLower, int24 tickUpper, uint128 amount0Requested, uint128 amount1Requested) call parameters on the contract.

Prepares collectProtocol(address recipient, uint128 amount0Requested, uint128 amount1Requested) call parameters on the contract.

Prepares contract constructor values for deployment.

Prepares factory() call parameters on the contract.

Prepares fee() call parameters on the contract.

Prepares feeGrowthGlobal0X128() call parameters on the contract.

Prepares feeGrowthGlobal1X128() call parameters on the contract.

Prepares flash(address recipient, uint256 amount0, uint256 amount1, bytes data) call parameters on the contract.

Prepares increaseObservationCardinalityNext(uint16 observationCardinalityNext) call parameters on the contract.

Prepares initialize(uint160 sqrtPriceX96) call parameters on the contract.

Prepares liquidity() call parameters on the contract.

Prepares maxLiquidityPerTick() call parameters on the contract.

Prepares mint(address recipient, int24 tickLower, int24 tickUpper, uint128 amount, bytes data) call parameters on the contract.

Prepares observations(uint256) call parameters on the contract.

Prepares observe(uint32[] secondsAgos) call parameters on the contract.

Calculates the position key based PositionKey.sol library implementation

Prepares positions(bytes32) call parameters on the contract.

Prepares protocolFees() call parameters on the contract.

Prepares setFeeProtocol(uint8 feeProtocol0, uint8 feeProtocol1) call parameters on the contract.

Prepares slot0() call parameters on the contract.

Prepares snapshotCumulativesInside(int24 tickLower, int24 tickUpper) call parameters on the contract.

Prepares swap(address recipient, bool zeroForOne, int256 amountSpecified, uint160 sqrtPriceLimitX96, bytes data) call parameters on the contract.

Prepares tickBitmap(int16) call parameters on the contract.

Prepares tickSpacing() call parameters on the contract.

Prepares ticks(int24) call parameters on the contract.

Prepares token0() call parameters on the contract.

Prepares token1() call parameters on the contract.

Functions

__default_address__()

@spec __default_address__() :: nil

Default address of the contract. Returns nil if not specified.

To specify a default address see Ethers.Contract

burn(tick_lower, tick_upper, amount)

@spec burn(integer(), integer(), non_neg_integer()) :: Ethers.TxData.t()

Prepares burn(int24 tickLower, int24 tickUpper, uint128 amount) call parameters on the contract.

This function can be used for a transaction or additionally called for results (Use Ethers.send_transaction/2). No amount of Ether can be sent with this function.

State mutability: non_payable

Function Parameter Types

  • tickLower: {:int, 24}
  • tickUpper: {:int, 24}
  • amount: {:uint, 128}

Return Types (when called with Ethers.call/2)

  • amount0: {:uint, 256}
  • amount1: {:uint, 256}

collect(recipient, tick_lower, tick_upper, amount0_requested, amount1_requested)

Prepares collect(address recipient, int24 tickLower, int24 tickUpper, uint128 amount0Requested, uint128 amount1Requested) call parameters on the contract.

This function can be used for a transaction or additionally called for results (Use Ethers.send_transaction/2). No amount of Ether can be sent with this function.

State mutability: non_payable

Function Parameter Types

  • recipient: :address
  • tickLower: {:int, 24}
  • tickUpper: {:int, 24}
  • amount0Requested: {:uint, 128}
  • amount1Requested: {:uint, 128}

Return Types (when called with Ethers.call/2)

  • amount0: {:uint, 128}
  • amount1: {:uint, 128}

collect_protocol(recipient, amount0_requested, amount1_requested)

Prepares collectProtocol(address recipient, uint128 amount0Requested, uint128 amount1Requested) call parameters on the contract.

This function can be used for a transaction or additionally called for results (Use Ethers.send_transaction/2). No amount of Ether can be sent with this function.

State mutability: non_payable

Function Parameter Types

  • recipient: :address
  • amount0Requested: {:uint, 128}
  • amount1Requested: {:uint, 128}

Return Types (when called with Ethers.call/2)

  • amount0: {:uint, 128}
  • amount1: {:uint, 128}

constructor()

@spec constructor() :: binary()

Prepares contract constructor values for deployment.

To deploy a contracts use Ethers.deploy/2 and pass the result of this function as :encoded_constructor option.

Parameters

factory()

@spec factory() :: Ethers.TxData.t()

Prepares factory() call parameters on the contract.

This function should only be called for result and never in a transaction on its own. (Use Ethers.call/2)

State mutability: view

Return Types (when called with Ethers.call/2)

  • :address

fee()

@spec fee() :: Ethers.TxData.t()

Prepares fee() call parameters on the contract.

This function should only be called for result and never in a transaction on its own. (Use Ethers.call/2)

State mutability: view

Return Types (when called with Ethers.call/2)

  • {:uint, 24}

fee_growth_global0_x128()

@spec fee_growth_global0_x128() :: Ethers.TxData.t()

Prepares feeGrowthGlobal0X128() call parameters on the contract.

This function should only be called for result and never in a transaction on its own. (Use Ethers.call/2)

State mutability: view

Return Types (when called with Ethers.call/2)

  • {:uint, 256}

fee_growth_global1_x128()

@spec fee_growth_global1_x128() :: Ethers.TxData.t()

Prepares feeGrowthGlobal1X128() call parameters on the contract.

This function should only be called for result and never in a transaction on its own. (Use Ethers.call/2)

State mutability: view

Return Types (when called with Ethers.call/2)

  • {:uint, 256}

flash(recipient, amount0, amount1, data)

Prepares flash(address recipient, uint256 amount0, uint256 amount1, bytes data) call parameters on the contract.

This function can be used for a transaction or additionally called for results (Use Ethers.send_transaction/2). No amount of Ether can be sent with this function.

State mutability: non_payable

Function Parameter Types

  • recipient: :address
  • amount0: {:uint, 256}
  • amount1: {:uint, 256}
  • data: :bytes

Return Types (when called with Ethers.call/2)

This function does not return any values!

increase_observation_cardinality_next(observation_cardinality_next)

@spec increase_observation_cardinality_next(non_neg_integer()) :: Ethers.TxData.t()

Prepares increaseObservationCardinalityNext(uint16 observationCardinalityNext) call parameters on the contract.

This function can be used for a transaction or additionally called for results (Use Ethers.send_transaction/2). No amount of Ether can be sent with this function.

State mutability: non_payable

Function Parameter Types

  • observationCardinalityNext: {:uint, 16}

Return Types (when called with Ethers.call/2)

This function does not return any values!

initialize(sqrt_price_x96)

@spec initialize(non_neg_integer()) :: Ethers.TxData.t()

Prepares initialize(uint160 sqrtPriceX96) call parameters on the contract.

This function can be used for a transaction or additionally called for results (Use Ethers.send_transaction/2). No amount of Ether can be sent with this function.

State mutability: non_payable

Function Parameter Types

  • sqrtPriceX96: {:uint, 160}

Return Types (when called with Ethers.call/2)

This function does not return any values!

liquidity()

@spec liquidity() :: Ethers.TxData.t()

Prepares liquidity() call parameters on the contract.

This function should only be called for result and never in a transaction on its own. (Use Ethers.call/2)

State mutability: view

Return Types (when called with Ethers.call/2)

  • {:uint, 128}

max_liquidity_per_tick()

@spec max_liquidity_per_tick() :: Ethers.TxData.t()

Prepares maxLiquidityPerTick() call parameters on the contract.

This function should only be called for result and never in a transaction on its own. (Use Ethers.call/2)

State mutability: view

Return Types (when called with Ethers.call/2)

  • {:uint, 128}

mint(recipient, tick_lower, tick_upper, amount, data)

Prepares mint(address recipient, int24 tickLower, int24 tickUpper, uint128 amount, bytes data) call parameters on the contract.

This function can be used for a transaction or additionally called for results (Use Ethers.send_transaction/2). No amount of Ether can be sent with this function.

State mutability: non_payable

Function Parameter Types

  • recipient: :address
  • tickLower: {:int, 24}
  • tickUpper: {:int, 24}
  • amount: {:uint, 128}
  • data: :bytes

Return Types (when called with Ethers.call/2)

  • amount0: {:uint, 256}
  • amount1: {:uint, 256}

observations(arg1)

@spec observations(non_neg_integer()) :: Ethers.TxData.t()

Prepares observations(uint256) call parameters on the contract.

This function should only be called for result and never in a transaction on its own. (Use Ethers.call/2)

State mutability: view

Function Parameter Types

  • {:uint, 256}

Return Types (when called with Ethers.call/2)

  • blockTimestamp: {:uint, 32}
  • tickCumulative: {:int, 56}
  • secondsPerLiquidityCumulativeX128: {:uint, 160}
  • initialized: :bool

observe(seconds_agos)

@spec observe([non_neg_integer()]) :: Ethers.TxData.t()

Prepares observe(uint32[] secondsAgos) call parameters on the contract.

This function should only be called for result and never in a transaction on its own. (Use Ethers.call/2)

State mutability: view

Function Parameter Types

  • secondsAgos: {:array, {:uint, 32}}

Return Types (when called with Ethers.call/2)

  • tickCumulatives: {:array, {:int, 56}}
  • secondsPerLiquidityCumulativeX128s: {:array, {:uint, 160}}

position_key(owner \\ NonfungiblePositionManager.__default_address__(), lower_tick, upper_tick)

Calculates the position key based PositionKey.sol library implementation

Examples

iex> V3Pool.position_key(-276330, -276320)
"0x83947e3b1c37534eabbcccb7343ebdbf5390725cbe77c0d7dae7963d7d8d3a3d"

positions(arg1)

@spec positions(<<_::256>>) :: Ethers.TxData.t()

Prepares positions(bytes32) call parameters on the contract.

This function should only be called for result and never in a transaction on its own. (Use Ethers.call/2)

State mutability: view

Function Parameter Types

  • {:bytes, 32}

Return Types (when called with Ethers.call/2)

  • liquidity: {:uint, 128}
  • feeGrowthInside0LastX128: {:uint, 256}
  • feeGrowthInside1LastX128: {:uint, 256}
  • tokensOwed0: {:uint, 128}
  • tokensOwed1: {:uint, 128}

protocol_fees()

@spec protocol_fees() :: Ethers.TxData.t()

Prepares protocolFees() call parameters on the contract.

This function should only be called for result and never in a transaction on its own. (Use Ethers.call/2)

State mutability: view

Return Types (when called with Ethers.call/2)

  • token0: {:uint, 128}
  • token1: {:uint, 128}

set_fee_protocol(fee_protocol0, fee_protocol1)

@spec set_fee_protocol(non_neg_integer(), non_neg_integer()) :: Ethers.TxData.t()

Prepares setFeeProtocol(uint8 feeProtocol0, uint8 feeProtocol1) call parameters on the contract.

This function can be used for a transaction or additionally called for results (Use Ethers.send_transaction/2). No amount of Ether can be sent with this function.

State mutability: non_payable

Function Parameter Types

  • feeProtocol0: {:uint, 8}
  • feeProtocol1: {:uint, 8}

Return Types (when called with Ethers.call/2)

This function does not return any values!

slot0()

@spec slot0() :: Ethers.TxData.t()

Prepares slot0() call parameters on the contract.

This function should only be called for result and never in a transaction on its own. (Use Ethers.call/2)

State mutability: view

Return Types (when called with Ethers.call/2)

  • sqrtPriceX96: {:uint, 160}
  • tick: {:int, 24}
  • observationIndex: {:uint, 16}
  • observationCardinality: {:uint, 16}
  • observationCardinalityNext: {:uint, 16}
  • feeProtocol: {:uint, 8}
  • unlocked: :bool

snapshot_cumulatives_inside(tick_lower, tick_upper)

@spec snapshot_cumulatives_inside(integer(), integer()) :: Ethers.TxData.t()

Prepares snapshotCumulativesInside(int24 tickLower, int24 tickUpper) call parameters on the contract.

This function should only be called for result and never in a transaction on its own. (Use Ethers.call/2)

State mutability: view

Function Parameter Types

  • tickLower: {:int, 24}
  • tickUpper: {:int, 24}

Return Types (when called with Ethers.call/2)

  • tickCumulativeInside: {:int, 56}
  • secondsPerLiquidityInsideX128: {:uint, 160}
  • secondsInside: {:uint, 32}

swap(recipient, zero_for_one, amount_specified, sqrt_price_limit_x96, data)

Prepares swap(address recipient, bool zeroForOne, int256 amountSpecified, uint160 sqrtPriceLimitX96, bytes data) call parameters on the contract.

This function can be used for a transaction or additionally called for results (Use Ethers.send_transaction/2). No amount of Ether can be sent with this function.

State mutability: non_payable

Function Parameter Types

  • recipient: :address
  • zeroForOne: :bool
  • amountSpecified: {:int, 256}
  • sqrtPriceLimitX96: {:uint, 160}
  • data: :bytes

Return Types (when called with Ethers.call/2)

  • amount0: {:int, 256}
  • amount1: {:int, 256}

tick_bitmap(arg1)

@spec tick_bitmap(integer()) :: Ethers.TxData.t()

Prepares tickBitmap(int16) call parameters on the contract.

This function should only be called for result and never in a transaction on its own. (Use Ethers.call/2)

State mutability: view

Function Parameter Types

  • {:int, 16}

Return Types (when called with Ethers.call/2)

  • {:uint, 256}

tick_spacing()

@spec tick_spacing() :: Ethers.TxData.t()

Prepares tickSpacing() call parameters on the contract.

This function should only be called for result and never in a transaction on its own. (Use Ethers.call/2)

State mutability: view

Return Types (when called with Ethers.call/2)

  • {:int, 24}

ticks(arg1)

@spec ticks(integer()) :: Ethers.TxData.t()

Prepares ticks(int24) call parameters on the contract.

This function should only be called for result and never in a transaction on its own. (Use Ethers.call/2)

State mutability: view

Function Parameter Types

  • {:int, 24}

Return Types (when called with Ethers.call/2)

  • liquidityGross: {:uint, 128}
  • liquidityNet: {:int, 128}
  • feeGrowthOutside0X128: {:uint, 256}
  • feeGrowthOutside1X128: {:uint, 256}
  • tickCumulativeOutside: {:int, 56}
  • secondsPerLiquidityOutsideX128: {:uint, 160}
  • secondsOutside: {:uint, 32}
  • initialized: :bool

token0()

@spec token0() :: Ethers.TxData.t()

Prepares token0() call parameters on the contract.

This function should only be called for result and never in a transaction on its own. (Use Ethers.call/2)

State mutability: view

Return Types (when called with Ethers.call/2)

  • :address

token1()

@spec token1() :: Ethers.TxData.t()

Prepares token1() call parameters on the contract.

This function should only be called for result and never in a transaction on its own. (Use Ethers.call/2)

State mutability: view

Return Types (when called with Ethers.call/2)

  • :address