Skip to content

Commit

Permalink
Feat/update latest v4 lib (#19)
Browse files Browse the repository at this point in the history
* feat: Update pancake-v4-universal-router lib

* feat: Remove hookData from Initialize and update test cases

1. Remove hookData from Initialize and update test cases
2. Remove Wrap__FailedHookCall and update with CustomRevert.WrappedError
  • Loading branch information
ChefSnoopy authored Nov 19, 2024
1 parent 5a9f737 commit 7d553d9
Show file tree
Hide file tree
Showing 18 changed files with 93 additions and 76 deletions.
2 changes: 1 addition & 1 deletion lib/pancake-v4-universal-router
Submodule pancake-v4-universal-router updated 72 files
+1 −1 .forge-snapshots/BinNativePancakeSwapV4Test#test_v4BinSwap_ExactInSingle_NativeIn.snap
+1 −1 .forge-snapshots/BinNativePancakeSwapV4Test#test_v4BinSwap_ExactInSingle_NativeOut_RouterRecipient.snap
+1 −0 .forge-snapshots/BinNativePancakeSwapV4Test#test_v4BinSwap_v4InitializeBinPool.snap
+1 −1 .forge-snapshots/BinPancakeSwapV4Test#test_v4BinSwap_ExactInSingle.snap
+1 −1 .forge-snapshots/BinPancakeSwapV4Test#test_v4BinSwap_ExactIn_MultiHop.snap
+1 −1 .forge-snapshots/BinPancakeSwapV4Test#test_v4BinSwap_ExactIn_SingleHop.snap
+1 −1 .forge-snapshots/BinPancakeSwapV4Test#test_v4BinSwap_ExactOut_MultiHop.snap
+1 −1 .forge-snapshots/BinPancakeSwapV4Test#test_v4BinSwap_ExactOut_SingleHop.snap
+1 −0 .forge-snapshots/BinPancakeSwapV4Test#test_v4BinSwap_InitializeBinPool.snap
+1 −1 .forge-snapshots/BinPancakeSwapV4Test#test_v4ClSwap_ExactOutSingle.snap
+1 −1 .forge-snapshots/CLNativePancakeSwapV4Test#test_v4ClSwap_ExactInSingle_NativeIn.snap
+1 −1 .forge-snapshots/CLNativePancakeSwapV4Test#test_v4ClSwap_ExactInSingle_NativeOut.snap
+1 −0 .forge-snapshots/CLNativePancakeSwapV4Test#test_v4ClSwap_v4InitializeClPool.snap
+1 −1 .forge-snapshots/CLPancakeSwapV4Test#test_v4ClSwap_ExactInSingle.snap
+1 −1 .forge-snapshots/CLPancakeSwapV4Test#test_v4ClSwap_ExactIn_MultiHop.snap
+1 −1 .forge-snapshots/CLPancakeSwapV4Test#test_v4ClSwap_ExactIn_SingleHop.snap
+1 −1 .forge-snapshots/CLPancakeSwapV4Test#test_v4ClSwap_ExactOutSingle.snap
+1 −1 .forge-snapshots/CLPancakeSwapV4Test#test_v4ClSwap_ExactOut_MultiHop.snap
+1 −1 .forge-snapshots/CLPancakeSwapV4Test#test_v4ClSwap_ExactOut_SingleHop.snap
+1 −0 .forge-snapshots/CLPancakeSwapV4Test#test_v4ClSwap_v4InitializeClPool.snap
+1 −1 .forge-snapshots/PancakeSwapV2Test#test_v2Swap_exactInput0For1.snap
+1 −1 .forge-snapshots/PancakeSwapV2Test#test_v2Swap_exactOutput0For1.snap
+1 −1 .forge-snapshots/PancakeSwapV3Test#test_v3Swap_ExactInput0For1.snap
+1 −1 .forge-snapshots/PancakeSwapV3Test#test_v3Swap_ExactInput0For1_ContractBalance.snap
+1 −1 .forge-snapshots/PancakeSwapV3Test#test_v3Swap_exactInput_MultiHop.snap
+1 −1 .forge-snapshots/PancakeSwapV3Test#test_v3Swap_exactOutput0For1.snap
+1 −1 .forge-snapshots/PancakeSwapV3Test#test_v3Swap_exactOutput_MultiHop.snap
+1 −1 .forge-snapshots/StableSwapTest#test_stableSwap_ExactInput0For1.snap
+1 −1 .forge-snapshots/StableSwapTest#test_stableSwap_ExactInput1For0.snap
+1 −1 .forge-snapshots/UniversalRouterBytecodeSize.snap
+1 −1 .forge-snapshots/UniversalRouterTest#test_sweep_token.snap
+1 −1 .forge-snapshots/V3ToV4MigrationNativeTest#test_v4CLPositionmanager_Mint_Native.snap
+1 −1 .forge-snapshots/V3ToV4MigrationTest#test_v3PositionManager_burn.snap
+1 −1 .forge-snapshots/V3ToV4MigrationTest#test_v4BinPositionmanager_BinAddLiquidity.snap
+1 −1 .forge-snapshots/V3ToV4MigrationTest#test_v4BinPositionmanager_BinAddLiquidity_Native.snap
+1 −1 .forge-snapshots/V3ToV4MigrationTest#test_v4CLPositionmanager_Mint.snap
+3 −0 .gitmodules
+28 −8 README.md
+1 −1 deploy-addresses/bsc-testnet.json
+1 −1 deploy-addresses/ethereum-sepolia.json
+1 −0 example_args.txt
+4 −1 foundry.toml
+1 −0 lib/pancake-create3-factory
+1 −1 lib/pancake-v4-periphery
+3 −0 remappings.txt
+27 −5 script/DeployUniversalRouter.s.sol
+10 −2 script/deployParameters/mainnet/DeployArbitrum.s.sol
+10 −2 script/deployParameters/mainnet/DeployBase.s.sol
+10 −2 script/deployParameters/mainnet/DeployBsc.s.sol
+10 −2 script/deployParameters/mainnet/DeployEth.s.sol
+10 −2 script/deployParameters/mainnet/DeployLinea.s.sol
+8 −1 script/deployParameters/mainnet/DeployOpBnb.s.sol
+10 −2 script/deployParameters/mainnet/DeployzkEvm.s.sol
+11 −3 script/deployParameters/testnet/DeployBscTestnet.s.sol
+10 −2 script/deployParameters/testnet/DeployEthSepolia.s.sol
+1 −0 script/deployParameters/testnet/args/bsc_testnet.txt
+1 −0 script/deployParameters/testnet/args/eth_sepolia.txt
+40 −45 src/base/Dispatcher.sol
+1 −1 src/base/RouterImmutables.sol
+0 −13 src/interfaces/IWETH9.sol
+5 −3 src/libraries/Commands.sol
+114 −2 src/modules/V3ToV4Migrator.sol
+2 −1 src/modules/pancakeswap/StableSwapRouter.sol
+563 −0 test/UniversalRouter.crossVersion.t.sol
+1 −1 test/UniversalRouter.t.sol
+79 −6 test/V3ToV4Migration.t.sol
+8 −4 test/V3ToV4MigrationNative.t.sol
+27 −6 test/stableSwap/StableSwap.t.sol
+41 −2 test/v4/BinNativePancakeSwapV4.t.sol
+45 −3 test/v4/BinPancakeSwapV4.t.sol
+47 −5 test/v4/CLNativePancakeSwapV4.t.sol
+51 −5 test/v4/CLPancakeSwapV4.t.sol
4 changes: 2 additions & 2 deletions src/pool-bin/BinBaseHook.sol
Original file line number Diff line number Diff line change
Expand Up @@ -111,12 +111,12 @@ abstract contract BinBaseHook is IBinHooks {
}

/// @inheritdoc IBinHooks
function beforeInitialize(address, PoolKey calldata, uint24, bytes calldata) external virtual returns (bytes4) {
function beforeInitialize(address, PoolKey calldata, uint24) external virtual returns (bytes4) {
revert HookNotImplemented();
}

/// @inheritdoc IBinHooks
function afterInitialize(address, PoolKey calldata, uint24, bytes calldata) external virtual returns (bytes4) {
function afterInitialize(address, PoolKey calldata, uint24) external virtual returns (bytes4) {
revert HookNotImplemented();
}

Expand Down
2 changes: 1 addition & 1 deletion src/pool-bin/geomean-oracle/BinGeomeanOracle.sol
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ contract BinGeomeanOracle is BinBaseHook {
oracle.update(parameters, activeId);
}

function beforeInitialize(address sender, PoolKey calldata key, uint24 activeId, bytes calldata hookData)
function beforeInitialize(address sender, PoolKey calldata key, uint24 activeId)
external
override
poolManagerOnly
Expand Down
2 changes: 1 addition & 1 deletion src/pool-bin/limit-order/BinLimitOrder.sol
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ contract BinLimitOrder is BinBaseHook {
return epochInfos[epoch].liquidity[owner];
}

function afterInitialize(address sender, PoolKey calldata key, uint24 activeId, bytes calldata hookData)
function afterInitialize(address sender, PoolKey calldata key, uint24 activeId)
external
override
poolManagerOnly
Expand Down
8 changes: 2 additions & 6 deletions src/pool-cl/CLBaseHook.sol
Original file line number Diff line number Diff line change
Expand Up @@ -111,16 +111,12 @@ abstract contract CLBaseHook is ICLHooks {
}

/// @inheritdoc ICLHooks
function beforeInitialize(address, PoolKey calldata, uint160, bytes calldata) external virtual returns (bytes4) {
function beforeInitialize(address, PoolKey calldata, uint160) external virtual returns (bytes4) {
revert HookNotImplemented();
}

/// @inheritdoc ICLHooks
function afterInitialize(address, PoolKey calldata, uint160, int24, bytes calldata)
external
virtual
returns (bytes4)
{
function afterInitialize(address, PoolKey calldata, uint160, int24) external virtual returns (bytes4) {
revert HookNotImplemented();
}

Expand Down
2 changes: 1 addition & 1 deletion src/pool-cl/full-range/CLFullRange.sol
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ contract CLFullRange is CLBaseHook {

/// @dev Deploy a new liquidity token for the pool and initialize the
/// PoolInfo
function beforeInitialize(address, PoolKey calldata key, uint160, bytes calldata)
function beforeInitialize(address, PoolKey calldata key, uint160)
external
override
poolManagerOnly
Expand Down
4 changes: 2 additions & 2 deletions src/pool-cl/geomean-oracle/CLGeomeanOracle.sol
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ contract CLGeomeanOracle is CLBaseHook {
);
}

function beforeInitialize(address, PoolKey calldata key, uint160, bytes calldata)
function beforeInitialize(address, PoolKey calldata key, uint160)
external
view
override
Expand All @@ -104,7 +104,7 @@ contract CLGeomeanOracle is CLBaseHook {
return this.beforeInitialize.selector;
}

function afterInitialize(address, PoolKey calldata key, uint160, int24, bytes calldata)
function afterInitialize(address, PoolKey calldata key, uint160, int24)
external
override
poolManagerOnly
Expand Down
2 changes: 1 addition & 1 deletion src/pool-cl/limit-order/CLLimitOrder.sol
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ contract CLLimitOrder is CLBaseHook {
return compressed * tickSpacing;
}

function afterInitialize(address, PoolKey calldata key, uint160, int24 tick, bytes calldata)
function afterInitialize(address, PoolKey calldata key, uint160, int24 tick)
external
override
poolManagerOnly
Expand Down
22 changes: 14 additions & 8 deletions test/pool-bin/BinGeomeanOracle.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ import {BinPoolParametersHelper} from "pancake-v4-core/src/pool-bin/libraries/Bi
import {Constants} from "pancake-v4-core/src/pool-bin/libraries/Constants.sol";
import {SortTokens} from "pancake-v4-core/test/helpers/SortTokens.sol";
import {Hooks} from "pancake-v4-core/src/libraries/Hooks.sol";
import {IBinHooks} from "pancake-v4-core/src/pool-bin/interfaces/IBinHooks.sol";
import {CustomRevert} from "pancake-v4-core/src/libraries/CustomRevert.sol";
import {MockERC20} from "solmate/src/test/utils/mocks/MockERC20.sol";
import {IBinRouterBase} from "pancake-v4-periphery/src/pool-bin/interfaces/IBinRouterBase.sol";
import {IBinPositionManager} from "pancake-v4-periphery/src/pool-bin/interfaces/IBinPositionManager.sol";
Expand Down Expand Up @@ -86,16 +88,18 @@ contract BinGeomeanOracleHookTest is Test, Deployers, DeployPermit2 {
});
vm.expectRevert(
abi.encodeWithSelector(
Hooks.Wrap__FailedHookCall.selector,
CustomRevert.WrappedError.selector,
address(geomeanOracle),
abi.encodeWithSelector(BinGeomeanOracle.OnlyOneOraclePoolAllowed.selector)
IBinHooks.beforeInitialize.selector,
abi.encodeWithSelector(BinGeomeanOracle.OnlyOneOraclePoolAllowed.selector),
abi.encodeWithSelector(Hooks.HookCallFailed.selector)
)
);
poolManager.initialize(k, BIN_ID_1_1, ZERO_BYTES);
poolManager.initialize(k, BIN_ID_1_1);
}

function test_InitializePool() public {
poolManager.initialize(key, BIN_ID_1_1, ZERO_BYTES);
poolManager.initialize(key, BIN_ID_1_1);

(uint8 sampleLifetime, uint16 size, uint16 activeSize, uint40 lastUpdated, uint40 firstTimestamp) =
geomeanOracle.getOracleParameters(key);
Expand All @@ -112,7 +116,7 @@ contract BinGeomeanOracleHookTest is Test, Deployers, DeployPermit2 {
}

function test_AddLiquidity() public {
poolManager.initialize(key, BIN_ID_1_1, ZERO_BYTES);
poolManager.initialize(key, BIN_ID_1_1);

geomeanOracle.increaseOracleLength(key, 1);

Expand Down Expand Up @@ -198,7 +202,7 @@ contract BinGeomeanOracleHookTest is Test, Deployers, DeployPermit2 {
}

function test_RevertIfRemoveLiquidity() public {
poolManager.initialize(key, BIN_ID_1_1, ZERO_BYTES);
poolManager.initialize(key, BIN_ID_1_1);

uint256 numBins = 1;
int256[] memory deltaIds = new int256[](numBins);
Expand Down Expand Up @@ -226,9 +230,11 @@ contract BinGeomeanOracleHookTest is Test, Deployers, DeployPermit2 {

vm.expectRevert(
abi.encodeWithSelector(
Hooks.Wrap__FailedHookCall.selector,
CustomRevert.WrappedError.selector,
address(geomeanOracle),
abi.encodeWithSelector(BinGeomeanOracle.OraclePoolMustLockLiquidity.selector)
IBinHooks.beforeBurn.selector,
abi.encodeWithSelector(BinGeomeanOracle.OraclePoolMustLockLiquidity.selector),
abi.encodeWithSelector(Hooks.HookCallFailed.selector)
)
);

Expand Down
4 changes: 2 additions & 2 deletions test/pool-bin/BinLimitOrder.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ contract BinLimitOrderHookTest is Test, Deployers, DeployPermit2 {
});
id = key.toId();

poolManager.initialize(key, BIN_ID_1_1, ZERO_BYTES);
poolManager.initialize(key, BIN_ID_1_1);

uint256 numBins = 5;
int256[] memory deltaIds = new int256[](numBins);
Expand Down Expand Up @@ -127,7 +127,7 @@ contract BinLimitOrderHookTest is Test, Deployers, DeployPermit2 {
parameters: bytes32(uint256(limitOrder.getHooksRegistrationBitmap())).setBinStep(61)
});

poolManager.initialize(differentKey, BIN_ID_1_1 + 1, ZERO_BYTES);
poolManager.initialize(differentKey, BIN_ID_1_1 + 1);
assertEq(limitOrder.getActiveIdLast(differentKey.toId()), BIN_ID_1_1 + 1);
}

Expand Down
12 changes: 8 additions & 4 deletions test/pool-bin/BinVeCakeExclusiveHook.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ import {Vault} from "pancake-v4-core/src/Vault.sol";
import {IBinPoolManager} from "pancake-v4-core/src/pool-bin/interfaces/IBinPoolManager.sol";
import {Currency} from "pancake-v4-core/src/types/Currency.sol";
import {Hooks} from "pancake-v4-core/src/libraries/Hooks.sol";
import {IBinHooks} from "pancake-v4-core/src/pool-bin/interfaces/IBinHooks.sol";
import {CustomRevert} from "pancake-v4-core/src/libraries/CustomRevert.sol";
import {PoolKey} from "pancake-v4-core/src/types/PoolKey.sol";
import {PoolId, PoolIdLibrary} from "pancake-v4-core/src/types/PoolId.sol";
import {BinPoolParametersHelper} from "pancake-v4-core/src/pool-bin/libraries/BinPoolParametersHelper.sol";
Expand Down Expand Up @@ -79,7 +81,7 @@ contract BinVeCakeExclusiveHookTest is Test, Deployers, DeployPermit2 {
});
id = key.toId();

poolManager.initialize(key, BIN_ID_1_1, ZERO_BYTES);
poolManager.initialize(key, BIN_ID_1_1);

uint256 numBins = 1;
int256[] memory deltaIds = new int256[](numBins);
Expand Down Expand Up @@ -110,9 +112,11 @@ contract BinVeCakeExclusiveHookTest is Test, Deployers, DeployPermit2 {
vm.prank(nonHolder, nonHolder);
vm.expectRevert(
abi.encodeWithSelector(
Hooks.Wrap__FailedHookCall.selector,
address(veCakeExclusiveHook),
abi.encodeWithSelector(BinVeCakeExclusiveHook.NotVeCakeHolder.selector)
CustomRevert.WrappedError.selector,
address(key.hooks),
IBinHooks.beforeSwap.selector,
abi.encodeWithSelector(BinVeCakeExclusiveHook.NotVeCakeHolder.selector),
abi.encodeWithSelector(Hooks.HookCallFailed.selector)
)
);
swapRouter.exactInputSingle(
Expand Down
2 changes: 1 addition & 1 deletion test/pool-bin/helpers/Deployers.sol
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ contract Deployers {
: bytes32(uint256(((fee / 100 * 2) << 16) | 0x00ff))
);
id = key.toId();
manager.initialize(key, activeId, initData);
manager.initialize(key, activeId);
}

function createFreshManager() internal returns (IVault vault, BinPoolManager manager) {
Expand Down
3 changes: 2 additions & 1 deletion test/pool-bin/helpers/MockBinPositionManager.sol
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {CommonBase} from "forge-std/Base.sol";
import {Vm} from "forge-std/Vm.sol";
import {IVault} from "pancake-v4-core/src/interfaces/IVault.sol";
import {IBinPoolManager} from "pancake-v4-core/src/pool-bin/interfaces/IBinPoolManager.sol";
import {IWETH9} from "pancake-v4-periphery/src/interfaces/external/IWETH9.sol";
import {IBinPositionManager} from "pancake-v4-periphery/src/pool-bin/interfaces/IBinPositionManager.sol";
import {BinPositionManager} from "pancake-v4-periphery/src/pool-bin/BinPositionManager.sol";
import {IAllowanceTransfer} from "permit2/src/interfaces/IAllowanceTransfer.sol";
Expand All @@ -16,7 +17,7 @@ contract MockBinPositionManager is BinPositionManager, CommonBase {
using Planner for Plan;

constructor(IVault _vault, IBinPoolManager _binPoolManager, IAllowanceTransfer _permit2)
BinPositionManager(_vault, _binPoolManager, _permit2)
BinPositionManager(_vault, _binPoolManager, _permit2, IWETH9(address(0)))
{}

function addLiquidity(IBinPositionManager.BinAddLiquidityParams calldata params)
Expand Down
25 changes: 13 additions & 12 deletions test/pool-cl/CLFullRangeHook.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ import {Deployers} from "pancake-v4-core/test/pool-cl/helpers/Deployers.sol";
import {MockERC20} from "solmate/src/test/utils/mocks/MockERC20.sol";

import {Hooks} from "pancake-v4-core/src/libraries/Hooks.sol";
import {ICLHooks} from "pancake-v4-core/src/pool-cl/interfaces/ICLHooks.sol";
import {CustomRevert} from "pancake-v4-core/src/libraries/CustomRevert.sol";
import {ICLRouterBase} from "pancake-v4-periphery/src/pool-cl/interfaces/ICLRouterBase.sol";
import {DeployPermit2} from "permit2/test/utils/DeployPermit2.sol";
import {IAllowanceTransfer} from "permit2/src/interfaces/IAllowanceTransfer.sol";
Expand Down Expand Up @@ -127,7 +129,7 @@ contract CLFullRangeHookTest is Test, Deployers, DeployPermit2 {
permit2.approve(address(token1), address(cpm), type(uint160).max, type(uint48).max);
permit2.approve(address(token2), address(cpm), type(uint160).max, type(uint48).max);

poolManager.initialize(keyWithLiq, SQRT_RATIO_1_1, ZERO_BYTES);
poolManager.initialize(keyWithLiq, SQRT_RATIO_1_1);

fullRange.addLiquidity(
CLFullRange.AddLiquidityParams({
Expand Down Expand Up @@ -157,12 +159,14 @@ contract CLFullRangeHookTest is Test, Deployers, DeployPermit2 {

vm.expectRevert(
abi.encodeWithSelector(
Hooks.Wrap__FailedHookCall.selector,
CustomRevert.WrappedError.selector,
address(fullRange),
abi.encodeWithSelector(CLFullRange.TickSpacingNotDefault.selector)
ICLHooks.beforeInitialize.selector,
abi.encodeWithSelector(CLFullRange.TickSpacingNotDefault.selector),
abi.encodeWithSelector(Hooks.HookCallFailed.selector)
)
);
poolManager.initialize(wrongKey, SQRT_RATIO_1_1, ZERO_BYTES);
poolManager.initialize(wrongKey, SQRT_RATIO_1_1);
}

function test_RevertIfNoPool() public {
Expand Down Expand Up @@ -196,7 +200,7 @@ contract CLFullRangeHookTest is Test, Deployers, DeployPermit2 {
}

function test_RevertIfTooMuchSlippage() public {
poolManager.initialize(key, SQRT_RATIO_1_1, ZERO_BYTES);
poolManager.initialize(key, SQRT_RATIO_1_1);

fullRange.addLiquidity(
CLFullRange.AddLiquidityParams({
Expand All @@ -219,7 +223,6 @@ contract CLFullRangeHookTest is Test, Deployers, DeployPermit2 {
zeroForOne: true,
amountIn: 1e18,
amountOutMinimum: 0,
sqrtPriceLimitX96: 0,
hookData: ZERO_BYTES
}),
block.timestamp
Expand All @@ -243,7 +246,7 @@ contract CLFullRangeHookTest is Test, Deployers, DeployPermit2 {
}

function test_AddLiquidity() public {
poolManager.initialize(key, SQRT_RATIO_1_1, ZERO_BYTES);
poolManager.initialize(key, SQRT_RATIO_1_1);

uint256 prevBalance0 = key.currency0.balanceOf(address(this));
uint256 prevBalance1 = key.currency1.balanceOf(address(this));
Expand Down Expand Up @@ -280,7 +283,6 @@ contract CLFullRangeHookTest is Test, Deployers, DeployPermit2 {
zeroForOne: true,
amountIn: 1e18,
amountOutMinimum: 0,
sqrtPriceLimitX96: 0,
hookData: ZERO_BYTES
}),
block.timestamp
Expand Down Expand Up @@ -310,7 +312,6 @@ contract CLFullRangeHookTest is Test, Deployers, DeployPermit2 {
zeroForOne: true,
amountIn: 1e18,
amountOutMinimum: 0,
sqrtPriceLimitX96: 0,
hookData: ZERO_BYTES
}),
block.timestamp
Expand All @@ -336,7 +337,7 @@ contract CLFullRangeHookTest is Test, Deployers, DeployPermit2 {
}

function testFuzz_AddLiquidity(uint256 amount) public {
poolManager.initialize(key, SQRT_RATIO_1_1, ZERO_BYTES);
poolManager.initialize(key, SQRT_RATIO_1_1);

if (amount <= MINIMUM_LIQUIDITY) {
vm.expectRevert(CLFullRange.LiquidityDoesntMeetMinimum.selector);
Expand Down Expand Up @@ -395,7 +396,7 @@ contract CLFullRangeHookTest is Test, Deployers, DeployPermit2 {
}

function test_RevertIfNoLiquidity() public {
poolManager.initialize(key, SQRT_RATIO_1_1, ZERO_BYTES);
poolManager.initialize(key, SQRT_RATIO_1_1);

(, address liquidityToken) = fullRange.poolInfo(id);

Expand Down Expand Up @@ -444,7 +445,7 @@ contract CLFullRangeHookTest is Test, Deployers, DeployPermit2 {
}

function testFuzz_RemoveLiquidity(uint256 amount) public {
poolManager.initialize(key, SQRT_RATIO_1_1, ZERO_BYTES);
poolManager.initialize(key, SQRT_RATIO_1_1);

fullRange.addLiquidity(
CLFullRange.AddLiquidityParams({
Expand Down
Loading

0 comments on commit 7d553d9

Please sign in to comment.