loom_defi_abi::uniswap4::pool

Module IUniswapV4PoolManager

Source
Expand description

Module containing a contract’s types and functions.

interface IUniswapV4PoolManager {
    error MaxCurrenciesTouched();
    error CurrencyNotSettled();
    error PoolNotInitialized();
    error LockedBy(address locker, address currentHook);
    error NotPoolManagerToken();
    error TickSpacingTooLarge();
    error TickSpacingTooSmall();
    error CurrenciesOutOfOrderOrEqual();
    event Initialize(PoolId indexed id, Currency indexed currency0, Currency indexed currency1, uint24 fee, int24 tickSpacing, Hooks hooks);
    event ModifyLiquidity(PoolId indexed id, address indexed sender, int24 tickLower, int24 tickUpper, int256 liquidityDelta);
    event Swap(PoolId indexed id, address indexed sender, int128 amount0, int128 amount1, uint160 sqrtPriceX96, uint128 liquidity, int24 tick, uint24 fee);
    event ProtocolFeeUpdated(PoolId indexed id, uint16 protocolFee);
    event DynamicSwapFeeUpdated(PoolId indexed id, uint24 dynamicSwapFee);
    function MAX_TICK_SPACING() external view returns (int24);
    function MIN_TICK_SPACING() external view returns (int24);
    function getSlot0(PoolId id) external view returns (uint160 sqrtPriceX96, int24 tick, uint16 protocolFee);
    function getLiquidity(PoolId id) external view returns (uint128 liquidity);
    function getLiquidity(PoolId id, address owner, int24 tickLower, int24 tickUpper) external view returns (uint128 liquidity);
    function getPoolTickInfo(PoolId id, int24 tick) external view returns (PoolTickInfo memory);
    function getPoolBitmapInfo(PoolId id, int16 word) external view returns (uint256 tickBitmap);
    function getPosition(PoolId id, address owner, int24 tickLower, int24 tickUpper) external view returns (PositionInfo memory position);
    function reservesOf(Currency currency) external view returns (uint256);
    function getLock(uint256 i) external view returns (address locker, address lockCaller);
    function getLockLength() external view returns (uint256 _length);
    function getCurrentHook() external view returns (Hooks _currentHook);
    function getLockNonzeroDeltaCount() external view returns (uint256 _nonzeroDeltaCount);
    function initialize(PoolKey memory key, uint160 sqrtPriceX96, bytes calldata hookData) external returns (int24 tick);
    function currencyDelta(address locker, Currency currency) external view returns (int256);
    function lock(address lockTarget, bytes calldata data) external payable returns (bytes memory);
    struct ModifyLiquidityParams { int24 tickLower; int24 tickUpper; int256 liquidityDelta; }
    function modifyLiquidity(PoolKey memory key, ModifyLiquidityParams memory params, bytes calldata hookData) external returns (BalanceDelta);
    struct SwapParams { bool zeroForOne; int256 amountSpecified; uint160 sqrtPriceLimitX96; }
    function swap(PoolKey memory key, SwapParams memory params, bytes calldata hookData) external returns (BalanceDelta);
    function donate(PoolKey memory key, uint256 amount0, uint256 amount1, bytes calldata hookData) external returns (BalanceDelta);
    function take(Currency currency, address to, uint256 amount) external;
    function mint(address to, uint256 id, uint256 amount) external;
    function burn(address from, uint256 id, uint256 amount) external;
    function settle(Currency token) external payable returns (uint256 paid);
    function setProtocolFee(PoolKey memory key) external;
    function updateDynamicSwapFee(PoolKey memory key) external;
    function extsload(bytes32 slot) external view returns (bytes32 value);
    function extsload(bytes32 slot, uint256 nSlots) external view returns (bytes memory value);
}

Structs§

  • @notice PoolKey must have currencies where address(currency0) < address(currency1) Custom error with signature CurrenciesOutOfOrderOrEqual() and selector 0xeaa6c6eb.
  • @notice Thrown when a currency is not netted out after a lock Custom error with signature CurrencyNotSettled() and selector 0x5212cba1.
  • Event with signature DynamicSwapFeeUpdated(bytes32,uint24) and selector 0xdda45bdfb4c4d89a045919c537cb189db3745c4b1977d65f1d7cf60b585e7b72.
  • @notice Emitted when a new pool is initialized @param id The abi encoded hash of the pool key struct for the new pool @param currency0 The first currency of the pool by address sort order @param currency1 The second currency 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 hooks The hooks contract address for the pool, or address(0) if none Event with signature Initialize(bytes32,address,address,uint24,int24,address) and selector 0x3fd553db44f207b1f41348cfc4d251860814af9eadc470e8e7895e4d120511f4.
  • @notice Thrown when a function is called by an address that is not the current locker @param locker The current locker @param currentHook The most recently called hook Custom error with signature LockedBy(address,address) and selector 0x74d86365.
  • @notice Returns the constant representing the maximum tickSpacing for an initialized pool key Function with signature MAX_TICK_SPACING() and selector 0x60460f06.
  • @notice Returns the constant representing the maximum tickSpacing for an initialized pool key Container type for the return parameters of the MAX_TICK_SPACING() function.
  • @notice Returns the constant representing the minimum tickSpacing for an initialized pool key Function with signature MIN_TICK_SPACING() and selector 0x07eff0dd.
  • @notice Returns the constant representing the minimum tickSpacing for an initialized pool key Container type for the return parameters of the MIN_TICK_SPACING() function.
  • @notice Thrown when currencies touched has exceeded max of 256 Custom error with signature MaxCurrenciesTouched() and selector 0x543f71a6.
  • @notice Emitted when a liquidity position is modified @param id The abi encoded hash of the pool key struct for the pool that was modified @param sender The address that modified the pool @param tickLower The lower tick of the position @param tickUpper The upper tick of the position @param liquidityDelta The amount of liquidity that was added or removed Event with signature ModifyLiquidity(bytes32,address,int24,int24,int256) and selector 0x541c041c2cce48e614b3de043c9280f06b6164c0a1741649e2de3c3d375f7974.
  • @notice The ERC1155 being deposited is not the Uniswap ERC1155 Custom error with signature NotPoolManagerToken() and selector 0x53fa5ae4.
  • @notice Thrown when trying to interact with a non-initialized pool Custom error with signature PoolNotInitialized() and selector 0x486aa307.
  • Event with signature ProtocolFeeUpdated(bytes32,uint16) and selector 0x9f9496a7bce5dc5951d2db4c6bac380c9bcbcc9a4e9c18eafbcc231d06de481a.
  • @notice Emitted for swaps between currency0 and currency1 @param id The abi encoded hash of the pool key struct for the pool that was modified @param sender The address that initiated the swap call, and that received the callback @param amount0 The delta of the currency0 balance of the pool @param amount1 The delta of the currency1 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 the price of the pool after the swap Event with signature Swap(bytes32,address,int128,int128,uint160,uint128,int24,uint24) and selector 0x40e9cecb9f5f1f1c5b9c97dec2917b7ee92e57ba5563708daca94dd84ad7112f.
  • @notice Pools are limited to type(int16).max tickSpacing in #initialize, to prevent overflow Custom error with signature TickSpacingTooLarge() and selector 0xb02b5dc2.
  • @notice Pools must have a positive non-zero tickSpacing passed to #initialize Custom error with signature TickSpacingTooSmall() and selector 0x16fe7696.
  • @notice Called by the user to move value from ERC6909 balance Function with signature burn(address,uint256,uint256) and selector 0xf5298aca.
  • @notice Called by the user to move value from ERC6909 balance Container type for the return parameters of the burn(address,uint256,uint256) function.
  • @notice Get the current delta for a locker in the given currency @param locker The address of the locker @param currency The currency for which to lookup the delta Function with signature currencyDelta(address,address) and selector 0xa54b2831.
  • @notice Get the current delta for a locker in the given currency @param locker The address of the locker @param currency The currency for which to lookup the delta Container type for the return parameters of the currencyDelta(address,address) function.
  • @notice Donate the given currency amounts to the pool with the given pool key Function with signature donate((address,address,uint24,int24,address),uint256,uint256,bytes) and selector 0x234266d7.
  • @notice Donate the given currency amounts to the pool with the given pool key Container type for the return parameters of the donate((address,address,uint24,int24,address),uint256,uint256,bytes) function.
  • @notice Called by external contracts to access granular pool state @param slot Key of slot to sload @return value The value of the slot as bytes32 Function with signature extsload(bytes32) and selector 0x1e2eaeaf.
  • @notice Called by external contracts to access granular pool state @param slot Key of slot to sload @return value The value of the slot as bytes32 Container type for the return parameters of the extsload(bytes32) function.
  • @notice Called by external contracts to access granular pool state @param slot Key of slot to start sloading from @param nSlots Number of slots to load into return value @return value The value of the sload-ed slots concatenated as dynamic bytes Function with signature extsload(bytes32,uint256) and selector 0x35fd631a.
  • @notice Called by external contracts to access granular pool state @param slot Key of slot to start sloading from @param nSlots Number of slots to load into return value @return value The value of the sload-ed slots concatenated as dynamic bytes Container type for the return parameters of the extsload(bytes32,uint256) function.
  • @notice Returns the most recently called hook. Function with signature getCurrentHook() and selector 0x6f887689.
  • @notice Returns the most recently called hook. Container type for the return parameters of the getCurrentHook() function.
  • @notice Get the current value of liquidity of the given pool Function with signature getLiquidity(bytes32) and selector 0xfa6793d5.
  • @notice Get the current value of liquidity of the given pool Container type for the return parameters of the getLiquidity(bytes32) function.
  • @notice Get the current value of liquidity for the specified pool and position Function with signature getLiquidity(bytes32,address,int24,int24) and selector 0x33aa955b.
  • @notice Get the current value of liquidity for the specified pool and position Container type for the return parameters of the getLiquidity(bytes32,address,int24,int24) function.
  • @notice Returns the locker in the ith position of the locker queue. Function with signature getLock(uint256) and selector 0xd68f4dd1.
  • @notice Returns the length of the lockers array, which is the number of locks open on the PoolManager. Function with signature getLockLength() and selector 0x61f5c65b.
  • @notice Returns the length of the lockers array, which is the number of locks open on the PoolManager. Container type for the return parameters of the getLockLength() function.
  • @notice Returns the number of nonzero deltas open on the PoolManager that must be zerod by the close of the initial lock. Function with signature getLockNonzeroDeltaCount() and selector 0x46063d05.
  • @notice Returns the number of nonzero deltas open on the PoolManager that must be zerod by the close of the initial lock. Container type for the return parameters of the getLockNonzeroDeltaCount() function.
  • @notice Returns the locker in the ith position of the locker queue. Container type for the return parameters of the getLock(uint256) function.
  • @notice Getter for the bitmap given the poolId and word position Function with signature getPoolBitmapInfo(bytes32,int16) and selector 0x7c352ef6.
  • @notice Getter for the bitmap given the poolId and word position Container type for the return parameters of the getPoolBitmapInfo(bytes32,int16) function.
  • @notice Getter for TickInfo for the given poolId and tick Function with signature getPoolTickInfo(bytes32,int24) and selector 0x5aa208a4.
  • @notice Getter for TickInfo for the given poolId and tick Container type for the return parameters of the getPoolTickInfo(bytes32,int24) function.
  • @notice Get the position struct for a specified pool and position Function with signature getPosition(bytes32,address,int24,int24) and selector 0x048d9c70.
  • @notice Get the position struct for a specified pool and position Container type for the return parameters of the getPosition(bytes32,address,int24,int24) function.
  • @notice Get the current value in slot0 of the given pool Function with signature getSlot0(bytes32) and selector 0xc815641c.
  • @notice Get the current value in slot0 of the given pool Container type for the return parameters of the getSlot0(bytes32) function.
  • @notice Initialize the state for a given pool ID Function with signature initialize((address,address,uint24,int24,address),uint160,bytes) and selector 0x695c5bf5.
  • @notice Initialize the state for a given pool ID Container type for the return parameters of the initialize((address,address,uint24,int24,address),uint160,bytes) function.
  • @notice All operations go through this function @param lockTarget The address to call the callback on @param data Any data to pass to the callback, via ILockCallback(msg.sender).lockAcquired(data) @return The data returned by the call to ILockCallback(msg.sender).lockAcquired(data) Function with signature lock(address,bytes) and selector 0x9ca17998.
  • @notice All operations go through this function @param lockTarget The address to call the callback on @param data Any data to pass to the callback, via ILockCallback(msg.sender).lockAcquired(data) @return The data returned by the call to ILockCallback(msg.sender).lockAcquired(data) Container type for the return parameters of the lock(address,bytes) function.
  • @notice Called by the user to move value into ERC6909 balance Function with signature mint(address,uint256,uint256) and selector 0x156e29f6.
  • @notice Called by the user to move value into ERC6909 balance Container type for the return parameters of the mint(address,uint256,uint256) function.
  • @notice Modify the liquidity for the given pool @dev Poke by calling with a zero liquidityDelta @param key The pool to modify liquidity in @param params The parameters for modifying the liquidity @param hookData Any data to pass to the callback, via ILockCallback(msg.sender).lockAcquired(data) @return delta The balance delta of the liquidity Function with signature modifyLiquidity((address,address,uint24,int24,address),(int24,int24,int256),bytes) and selector 0xbec999dd.
  • @notice Modify the liquidity for the given pool @dev Poke by calling with a zero liquidityDelta @param key The pool to modify liquidity in @param params The parameters for modifying the liquidity @param hookData Any data to pass to the callback, via ILockCallback(msg.sender).lockAcquired(data) @return delta The balance delta of the liquidity Container type for the return parameters of the modifyLiquidity((address,address,uint24,int24,address),(int24,int24,int256),bytes) function.
  • @notice Returns the reserves for a given ERC20 currency Function with signature reservesOf(address) and selector 0x93c85a21.
  • @notice Returns the reserves for a given ERC20 currency Container type for the return parameters of the reservesOf(address) function.
  • @notice Sets the protocol’s swap fee for the given pool Protocol fees are always a portion of the LP swap fee that is owed. If that fee is 0, no protocol fees will accrue even if it is set to > 0. Function with signature setProtocolFee((address,address,uint24,int24,address)) and selector 0xb02375ce.
  • @notice Sets the protocol’s swap fee for the given pool Protocol fees are always a portion of the LP swap fee that is owed. If that fee is 0, no protocol fees will accrue even if it is set to > 0. Container type for the return parameters of the setProtocolFee((address,address,uint24,int24,address)) function.
  • @notice Called by the user to pay what is owed Function with signature settle(address) and selector 0x6a256b29.
  • @notice Called by the user to pay what is owed Container type for the return parameters of the settle(address) function.
  • @notice Swap against the given pool Function with signature swap((address,address,uint24,int24,address),(bool,int256,uint160),bytes) and selector 0xf3cd914c.
  • @notice Swap against the given pool Container type for the return parameters of the swap((address,address,uint24,int24,address),(bool,int256,uint160),bytes) function.
  • @notice Called by the user to net out some value owed to the user @dev Can also be used as a mechanism for free flash loans Function with signature take(address,address,uint256) and selector 0x0b0d9c09.
  • @notice Called by the user to net out some value owed to the user @dev Can also be used as a mechanism for free flash loans Container type for the return parameters of the take(address,address,uint256) function.
  • @notice Updates the pools swap fees for the a pool that has enabled dynamic swap fees. Function with signature updateDynamicSwapFee((address,address,uint24,int24,address)) and selector 0x48a76703.
  • @notice Updates the pools swap fees for the a pool that has enabled dynamic swap fees. Container type for the return parameters of the updateDynamicSwapFee((address,address,uint24,int24,address)) function.

Enums§