Appearance
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) externalInitializes the Uniswap V4 pool manager with token pair and settings
Can only be called once by the diamond owner or factory
Parameters
| Name | Type | Description |
|---|---|---|
| tokenA | address | Address of the first token in the pool pair |
| tokenB | address | Address of the second token in the pool pair |
| fee | uint24 | The fee tier for the Uniswap V4 pool (in hundredths of a basis point) |
| tickSpacing | int24 | The spacing between ticks for the pool |
setUniswapDeployment
solidity
function setUniswapDeployment(struct IPropsUniswapV4PoolManager.UniswapV4Deployment deployment) externalSets the Uniswap V4 deployment information
Can only be called by the diamond owner or factory
Parameters
| Name | Type | Description |
|---|---|---|
| deployment | struct IPropsUniswapV4PoolManager.UniswapV4Deployment | Struct 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
| Name | Type | Description |
|---|---|---|
| [0] | struct IPropsUniswapV4PoolManager.UniswapV4Deployment | The 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
| Name | Type | Description |
|---|---|---|
| [0] | address | The 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
| Name | Type | Description |
|---|---|---|
| [0] | address | The address of tokenB |
setFee
solidity
function setFee(uint24 fee) externalUpdates the fee tier for the Uniswap V4 pool
Can only be called by the diamond owner or factory
Parameters
| Name | Type | Description |
|---|---|---|
| fee | uint24 | The 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
| Name | Type | Description |
|---|---|---|
| [0] | uint24 | The 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
| Name | Type | Description |
|---|---|---|
| [0] | int24 | The 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
| Name | Type | Description |
|---|---|---|
| [0] | address | The 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
| Name | Type | Description |
|---|---|---|
| [0] | contract IPoolManager | The IPoolManager interface |
deployPoolWithLiquidity
solidity
function deployPoolWithLiquidity() externalDeploys 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
| Name | Type | Description |
|---|---|---|
| [0] | struct PoolKey | The 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
| Name | Type | Description |
|---|---|---|
| [0] | PoolId | The PoolId for the current token pair and settings |