Skip to main content
Helpful?

Fuzzers

Git Source | Generated with forge doc

Inherits: StdUtils

State Variables

_vm

Vm internal constant _vm = Vm(address(uint160(uint256(keccak256("hevm cheat code")))));

Functions

boundLiquidityDelta

function boundLiquidityDelta(PoolKey memory key, int256 liquidityDeltaUnbounded, int256 liquidityMaxByAmount)
internal
pure
returns (int256);

boundLiquidityDeltaTightly

function boundLiquidityDeltaTightly(
PoolKey memory key,
int256 liquidityDeltaUnbounded,
int256 liquidityMaxByAmount,
uint256 maxPositions
) internal pure returns (int256);

getLiquidityDeltaFromAmounts

function getLiquidityDeltaFromAmounts(int24 tickLower, int24 tickUpper, uint160 sqrtPriceX96)
internal
pure
returns (int256);

boundTicks

function boundTicks(int24 tickLower, int24 tickUpper, int24 tickSpacing) internal pure returns (int24, int24);

boundTicks

function boundTicks(PoolKey memory key, int24 tickLower, int24 tickUpper) internal pure returns (int24, int24);

createRandomSqrtPriceX96

function createRandomSqrtPriceX96(int24 tickSpacing, int256 seed) internal pure returns (uint160);

createFuzzyLiquidityParams

Obtain fuzzed and bounded parameters for creating liquidity

function createFuzzyLiquidityParams(
PoolKey memory key,
IPoolManager.ModifyLiquidityParams memory params,
uint160 sqrtPriceX96
) internal pure returns (IPoolManager.ModifyLiquidityParams memory result);

Parameters

NameTypeDescription
keyPoolKeyThe pool key
paramsIPoolManager.ModifyLiquidityParamsIPoolManager.ModifyLiquidityParams Note that these parameters are unbounded
sqrtPriceX96uint160The current sqrt price

createFuzzyLiquidityParamsWithTightBound

function createFuzzyLiquidityParamsWithTightBound(
PoolKey memory key,
IPoolManager.ModifyLiquidityParams memory params,
uint160 sqrtPriceX96,
uint256 maxPositions
) internal pure returns (IPoolManager.ModifyLiquidityParams memory result);

createFuzzyLiquidity

function createFuzzyLiquidity(
PoolModifyLiquidityTest modifyLiquidityRouter,
PoolKey memory key,
IPoolManager.ModifyLiquidityParams memory params,
uint160 sqrtPriceX96,
bytes memory hookData
) internal returns (IPoolManager.ModifyLiquidityParams memory result, BalanceDelta delta);

createFuzzyLiquidityWithTightBound

function createFuzzyLiquidityWithTightBound(
PoolModifyLiquidityTest modifyLiquidityRouter,
PoolKey memory key,
IPoolManager.ModifyLiquidityParams memory params,
uint160 sqrtPriceX96,
bytes memory hookData,
uint256 maxPositions
) internal returns (IPoolManager.ModifyLiquidityParams memory result, BalanceDelta delta);
Helpful?