loom_defi_abi::uniswap4::pool

Module IHooks

Source
Expand description

Module containing a contract’s types and functions.

interface IHooks {
    function beforeInitialize(address sender, PoolKey calldata key, uint160 sqrtPriceX96, bytes calldata hookData) external returns (bytes4);
    function afterInitialize(address sender, PoolKey calldata key, uint160 sqrtPriceX96, int24 tick, bytes calldata hookData) external returns (bytes4);
    function beforeAddLiquidity(address sender, PoolKey calldata key, IPoolManagerModifyLiquidityParams calldata params, bytes calldata hookData) external returns (bytes4);
    function afterAddLiquidity(address sender, PoolKey calldata key, IPoolManagerModifyLiquidityParams calldata params, BalanceDelta delta, bytes calldata hookData) external returns (bytes4);
    function beforeRemoveLiquidity(address sender, PoolKey calldata key, IPoolManagerModifyLiquidityParams calldata params, bytes calldata hookData) external returns (bytes4);
    function afterRemoveLiquidity(address sender, PoolKey calldata key, IPoolManagerModifyLiquidityParams calldata params, BalanceDelta delta, bytes calldata hookData) external returns (bytes4);
    function beforeSwap(address sender, PoolKey calldata key, IPoolManagerSwapParams calldata params, bytes calldata hookData) external returns (bytes4);
    function afterSwap(address sender, PoolKey calldata key, IPoolManagerSwapParams calldata params, BalanceDelta delta, bytes calldata hookData) external returns (bytes4);
    function beforeDonate(address sender, PoolKey calldata key, uint256 amount0, uint256 amount1, bytes calldata hookData) external returns (bytes4);
    function afterDonate(address sender, PoolKey calldata key, uint256 amount0, uint256 amount1, bytes calldata hookData) external returns (bytes4);
}

Structs§

  • @notice The hook called after liquidity is added @param sender The initial msg.sender for the add liquidity call @param key The key for the pool @param params The parameters for adding liquidity @param hookData Arbitrary data handed into the PoolManager by the liquidty provider to be be passed on to the hook @return bytes4 The function selector for the hook Function with signature afterAddLiquidity(address,(address,address,uint24,int24,address),(int24,int24,int256),int256,bytes) and selector 0xb505b4ce.
  • @notice The hook called after liquidity is added @param sender The initial msg.sender for the add liquidity call @param key The key for the pool @param params The parameters for adding liquidity @param hookData Arbitrary data handed into the PoolManager by the liquidty provider to be be passed on to the hook @return bytes4 The function selector for the hook Container type for the return parameters of the afterAddLiquidity(address,(address,address,uint24,int24,address),(int24,int24,int256),int256,bytes) function.
  • @notice The hook called after donate @param sender The initial msg.sender for the donate call @param key The key for the pool @param amount0 The amount of token0 being donated @param amount1 The amount of token1 being donated @param hookData Arbitrary data handed into the PoolManager by the donor to be be passed on to the hook @return bytes4 The function selector for the hook Function with signature afterDonate(address,(address,address,uint24,int24,address),uint256,uint256,bytes) and selector 0xe1b4af69.
  • @notice The hook called after donate @param sender The initial msg.sender for the donate call @param key The key for the pool @param amount0 The amount of token0 being donated @param amount1 The amount of token1 being donated @param hookData Arbitrary data handed into the PoolManager by the donor to be be passed on to the hook @return bytes4 The function selector for the hook Container type for the return parameters of the afterDonate(address,(address,address,uint24,int24,address),uint256,uint256,bytes) function.
  • @notice The hook called after the state of a pool is initialized @param sender The initial msg.sender for the initialize call @param key The key for the pool being initialized @param sqrtPriceX96 The sqrt(price) of the pool as a Q64.96 @param tick The current tick after the state of a pool is initialized @param hookData Arbitrary data handed into the PoolManager by the initializer to be be passed on to the hook @return bytes4 The function selector for the hook Function with signature afterInitialize(address,(address,address,uint24,int24,address),uint160,int24,bytes) and selector 0xa910f80f.
  • @notice The hook called after the state of a pool is initialized @param sender The initial msg.sender for the initialize call @param key The key for the pool being initialized @param sqrtPriceX96 The sqrt(price) of the pool as a Q64.96 @param tick The current tick after the state of a pool is initialized @param hookData Arbitrary data handed into the PoolManager by the initializer to be be passed on to the hook @return bytes4 The function selector for the hook Container type for the return parameters of the afterInitialize(address,(address,address,uint24,int24,address),uint160,int24,bytes) function.
  • @notice The hook called after liquidity is removed @param sender The initial msg.sender for the remove liquidity call @param key The key for the pool @param params The parameters for removing liquidity @param hookData Arbitrary data handed into the PoolManager by the liquidty provider to be be passed on to the hook @return bytes4 The function selector for the hook Function with signature afterRemoveLiquidity(address,(address,address,uint24,int24,address),(int24,int24,int256),int256,bytes) and selector 0xc3d5d4e6.
  • @notice The hook called after liquidity is removed @param sender The initial msg.sender for the remove liquidity call @param key The key for the pool @param params The parameters for removing liquidity @param hookData Arbitrary data handed into the PoolManager by the liquidty provider to be be passed on to the hook @return bytes4 The function selector for the hook Container type for the return parameters of the afterRemoveLiquidity(address,(address,address,uint24,int24,address),(int24,int24,int256),int256,bytes) function.
  • @notice The hook called after a swap @param sender The initial msg.sender for the swap call @param key The key for the pool @param params The parameters for the swap @param delta The amount owed to the locker (positive) or owed to the pool (negative) @param hookData Arbitrary data handed into the PoolManager by the swapper to be be passed on to the hook @return bytes4 The function selector for the hook Function with signature afterSwap(address,(address,address,uint24,int24,address),(bool,int256,uint160),int256,bytes) and selector 0xb47b2fb1.
  • @notice The hook called after a swap @param sender The initial msg.sender for the swap call @param key The key for the pool @param params The parameters for the swap @param delta The amount owed to the locker (positive) or owed to the pool (negative) @param hookData Arbitrary data handed into the PoolManager by the swapper to be be passed on to the hook @return bytes4 The function selector for the hook Container type for the return parameters of the afterSwap(address,(address,address,uint24,int24,address),(bool,int256,uint160),int256,bytes) function.
  • @notice The hook called before liquidity is added @param sender The initial msg.sender for the add liquidity call @param key The key for the pool @param params The parameters for adding liquidity @param hookData Arbitrary data handed into the PoolManager by the liquidty provider to be be passed on to the hook @return bytes4 The function selector for the hook Function with signature beforeAddLiquidity(address,(address,address,uint24,int24,address),(int24,int24,int256),bytes) and selector 0xa6ab2a43.
  • @notice The hook called before liquidity is added @param sender The initial msg.sender for the add liquidity call @param key The key for the pool @param params The parameters for adding liquidity @param hookData Arbitrary data handed into the PoolManager by the liquidty provider to be be passed on to the hook @return bytes4 The function selector for the hook Container type for the return parameters of the beforeAddLiquidity(address,(address,address,uint24,int24,address),(int24,int24,int256),bytes) function.
  • @notice The hook called before donate @param sender The initial msg.sender for the donate call @param key The key for the pool @param amount0 The amount of token0 being donated @param amount1 The amount of token1 being donated @param hookData Arbitrary data handed into the PoolManager by the donor to be be passed on to the hook @return bytes4 The function selector for the hook Function with signature beforeDonate(address,(address,address,uint24,int24,address),uint256,uint256,bytes) and selector 0xb6a8b0fa.
  • @notice The hook called before donate @param sender The initial msg.sender for the donate call @param key The key for the pool @param amount0 The amount of token0 being donated @param amount1 The amount of token1 being donated @param hookData Arbitrary data handed into the PoolManager by the donor to be be passed on to the hook @return bytes4 The function selector for the hook Container type for the return parameters of the beforeDonate(address,(address,address,uint24,int24,address),uint256,uint256,bytes) function.
  • @notice The hook called before the state of a pool is initialized @param sender The initial msg.sender for the initialize call @param key The key for the pool being initialized @param sqrtPriceX96 The sqrt(price) of the pool as a Q64.96 @param hookData Arbitrary data handed into the PoolManager by the initializer to be be passed on to the hook @return bytes4 The function selector for the hook Function with signature beforeInitialize(address,(address,address,uint24,int24,address),uint160,bytes) and selector 0x3440d820.
  • @notice The hook called before the state of a pool is initialized @param sender The initial msg.sender for the initialize call @param key The key for the pool being initialized @param sqrtPriceX96 The sqrt(price) of the pool as a Q64.96 @param hookData Arbitrary data handed into the PoolManager by the initializer to be be passed on to the hook @return bytes4 The function selector for the hook Container type for the return parameters of the beforeInitialize(address,(address,address,uint24,int24,address),uint160,bytes) function.
  • @notice The hook called before liquidity is removed @param sender The initial msg.sender for the remove liquidity call @param key The key for the pool @param params The parameters for removing liquidity @param hookData Arbitrary data handed into the PoolManager by the liquidty provider to be be passed on to the hook @return bytes4 The function selector for the hook Function with signature beforeRemoveLiquidity(address,(address,address,uint24,int24,address),(int24,int24,int256),bytes) and selector 0x2b58404e.
  • @notice The hook called before liquidity is removed @param sender The initial msg.sender for the remove liquidity call @param key The key for the pool @param params The parameters for removing liquidity @param hookData Arbitrary data handed into the PoolManager by the liquidty provider to be be passed on to the hook @return bytes4 The function selector for the hook Container type for the return parameters of the beforeRemoveLiquidity(address,(address,address,uint24,int24,address),(int24,int24,int256),bytes) function.
  • @notice The hook called before a swap @param sender The initial msg.sender for the swap call @param key The key for the pool @param params The parameters for the swap @param hookData Arbitrary data handed into the PoolManager by the swapper to be be passed on to the hook @return bytes4 The function selector for the hook Function with signature beforeSwap(address,(address,address,uint24,int24,address),(bool,int256,uint160),bytes) and selector 0x575e24b4.
  • @notice The hook called before a swap @param sender The initial msg.sender for the swap call @param key The key for the pool @param params The parameters for the swap @param hookData Arbitrary data handed into the PoolManager by the swapper to be be passed on to the hook @return bytes4 The function selector for the hook Container type for the return parameters of the beforeSwap(address,(address,address,uint24,int24,address),(bool,int256,uint160),bytes) function.

Enums§