Skip to content

Solidity API

PropsUniswapV4PoolManager

Diamond facet for managing Uniswap V4 liquidity pools

Provides functionality to create and manage Uniswap V4 pools Uses the Diamond storage pattern for managing state Implements IPropsUniswapV4PoolManager interface with internal implementation from PropsUniswapV4PoolManagerInternal

init

solidity
function init(address tokenA, address tokenB, uint24 fee, int24 tickSpacing) external

Initializes the Uniswap V4 pool manager with token pair and settings

Can only be called once by the diamond owner or factory

Parameters

NameTypeDescription
tokenAaddressAddress of the first token in the pool pair
tokenBaddressAddress of the second token in the pool pair
feeuint24The fee tier for the Uniswap V4 pool (in hundredths of a basis point)
tickSpacingint24The spacing between ticks for the pool

setUniswapDeployment

solidity
function setUniswapDeployment(struct IPropsUniswapV4PoolManager.UniswapV4Deployment deployment) external

Sets the Uniswap V4 deployment information

Can only be called by the diamond owner or factory

Parameters

NameTypeDescription
deploymentstruct IPropsUniswapV4PoolManager.UniswapV4DeploymentStruct containing Uniswap V4 deployment details

getUniswapDeployment

solidity
function getUniswapDeployment() external view returns (struct IPropsUniswapV4PoolManager.UniswapV4Deployment)

Retrieves the current Uniswap V4 deployment configuration

Reads from diamond storage

Return Values

NameTypeDescription
[0]struct IPropsUniswapV4PoolManager.UniswapV4DeploymentThe UniswapV4Deployment struct with deployment details

getTokenA

solidity
function getTokenA() external view returns (address)

Gets the address of the first token in the pool pair

Reads from diamond storage

Return Values

NameTypeDescription
[0]addressThe address of tokenA

getTokenB

solidity
function getTokenB() external view returns (address)

Gets the address of the second token in the pool pair

Reads from diamond storage

Return Values

NameTypeDescription
[0]addressThe address of tokenB

setFee

solidity
function setFee(uint24 fee) external

Updates the fee tier for the Uniswap V4 pool

Can only be called by the diamond owner or factory

Parameters

NameTypeDescription
feeuint24The new fee tier (in hundredths of a basis point)

getFee

solidity
function getFee() external view returns (uint24)

Gets the current fee tier for the Uniswap V4 pool

Reads from diamond storage

Return Values

NameTypeDescription
[0]uint24The fee tier in hundredths of a basis point

getTickSpacing

solidity
function getTickSpacing() external view returns (int24)

Gets the tick spacing for the Uniswap V4 pool

Reads from diamond storage

Return Values

NameTypeDescription
[0]int24The tick spacing value

getPoolManagerAddress

solidity
function getPoolManagerAddress() external view returns (address)

Gets the address of the Uniswap V4 pool manager contract

Reads from diamond storage

Return Values

NameTypeDescription
[0]addressThe address of the IPoolManager implementation

getPoolManager

solidity
function getPoolManager() external view returns (contract IPoolManager)

Gets the Uniswap V4 pool manager interface

Returns the IPoolManager interface to interact with Uniswap V4

Return Values

NameTypeDescription
[0]contract IPoolManagerThe IPoolManager interface

deployPoolWithLiquidity

solidity
function deployPoolWithLiquidity() external

Deploys a new Uniswap V4 pool and adds initial liquidity

Can only be called by the diamond itself Fetches treasury balances for both assets to use as initial liquidity

getPoolKey

solidity
function getPoolKey() external view returns (struct PoolKey)

Gets the Uniswap V4 pool key for the current token pair

The pool key uniquely identifies a pool in Uniswap V4

Return Values

NameTypeDescription
[0]struct PoolKeyThe PoolKey struct for the current token pair and settings

getPoolId

solidity
function getPoolId() external view returns (PoolId)

Gets the Uniswap V4 pool ID for the current token pair

The pool ID is derived from the pool key and is used for pool lookups

Return Values

NameTypeDescription
[0]PoolIdThe PoolId for the current token pair and settings