From e46cf4c38a204148434652c8a776b2b9d3459eaf Mon Sep 17 00:00:00 2001 From: Chef Snoopy Date: Wed, 7 Aug 2024 15:09:47 +0800 Subject: [PATCH] feat: Remove single flag --- ...#testAddLiquidityOutsideActiveId_ExistingId.snap | 2 +- ...yTest#testAddLiquidityOutsideActiveId_NewId.snap | 2 +- ...dLiquidityTest#testAddLiquidityWithActiveId.snap | 2 +- ...yTest#testAddLiquidityWithActiveId_WithHook.snap | 2 +- ...dityTest#testBatch_AddLiquidityWithActiveId.snap | 2 +- ...dLiquidityWithActiveId_WithoutCloseCurrency.snap | 2 +- ...Batch_RemoveLiquidityWithActiveId_ThreeBins.snap | 2 +- ...WithActiveId_ThreeBins_WithoutCloseCurrency.snap | 2 +- ...estRemoveLiquidityOutsideActiveId_ThreeBins.snap | 2 +- ...t#testRemoveLiquidityWithActiveId_ThreeBins.snap | 2 +- ...emoveLiquidityTest#testRemoveLiquidity_Half.snap | 2 +- ...keswapV2Test#testMigrateFromV2IncludingInit.snap | 2 +- ...cakeswapV2Test#testMigrateFromV2WithoutInit.snap | 2 +- ...pV2Test#testMigrateFromV2WithoutNativeToken.snap | 2 +- ...keswapV3Test#testMigrateFromV3IncludingInit.snap | 2 +- ...cakeswapV3Test#testMigrateFromV3WithoutInit.snap | 2 +- ...pV3Test#testMigrateFromV3WithoutNativeToken.snap | 2 +- ...niswapV2Test#testMigrateFromV2IncludingInit.snap | 2 +- ...mUniswapV2Test#testMigrateFromV2WithoutInit.snap | 2 +- ...pV2Test#testMigrateFromV2WithoutNativeToken.snap | 2 +- ...niswapV3Test#testMigrateFromV3IncludingInit.snap | 2 +- ...mUniswapV3Test#testMigrateFromV3WithoutInit.snap | 2 +- ...pV3Test#testMigrateFromV3WithoutNativeToken.snap | 2 +- src/pool-bin/BinFungiblePositionManager.sol | 13 ++++--------- 24 files changed, 27 insertions(+), 32 deletions(-) diff --git a/.forge-snapshots/BinFungiblePositionManager_AddLiquidityTest#testAddLiquidityOutsideActiveId_ExistingId.snap b/.forge-snapshots/BinFungiblePositionManager_AddLiquidityTest#testAddLiquidityOutsideActiveId_ExistingId.snap index 3c20060..50080f5 100644 --- a/.forge-snapshots/BinFungiblePositionManager_AddLiquidityTest#testAddLiquidityOutsideActiveId_ExistingId.snap +++ b/.forge-snapshots/BinFungiblePositionManager_AddLiquidityTest#testAddLiquidityOutsideActiveId_ExistingId.snap @@ -1 +1 @@ -180120 \ No newline at end of file +179955 \ No newline at end of file diff --git a/.forge-snapshots/BinFungiblePositionManager_AddLiquidityTest#testAddLiquidityOutsideActiveId_NewId.snap b/.forge-snapshots/BinFungiblePositionManager_AddLiquidityTest#testAddLiquidityOutsideActiveId_NewId.snap index a4191cb..52eec02 100644 --- a/.forge-snapshots/BinFungiblePositionManager_AddLiquidityTest#testAddLiquidityOutsideActiveId_NewId.snap +++ b/.forge-snapshots/BinFungiblePositionManager_AddLiquidityTest#testAddLiquidityOutsideActiveId_NewId.snap @@ -1 +1 @@ -634289 \ No newline at end of file +634124 \ No newline at end of file diff --git a/.forge-snapshots/BinFungiblePositionManager_AddLiquidityTest#testAddLiquidityWithActiveId.snap b/.forge-snapshots/BinFungiblePositionManager_AddLiquidityTest#testAddLiquidityWithActiveId.snap index 7457eb2..bbc183d 100644 --- a/.forge-snapshots/BinFungiblePositionManager_AddLiquidityTest#testAddLiquidityWithActiveId.snap +++ b/.forge-snapshots/BinFungiblePositionManager_AddLiquidityTest#testAddLiquidityWithActiveId.snap @@ -1 +1 @@ -900548 \ No newline at end of file +900384 \ No newline at end of file diff --git a/.forge-snapshots/BinFungiblePositionManager_AddLiquidityTest#testAddLiquidityWithActiveId_WithHook.snap b/.forge-snapshots/BinFungiblePositionManager_AddLiquidityTest#testAddLiquidityWithActiveId_WithHook.snap index 9be7e04..4b6a452 100644 --- a/.forge-snapshots/BinFungiblePositionManager_AddLiquidityTest#testAddLiquidityWithActiveId_WithHook.snap +++ b/.forge-snapshots/BinFungiblePositionManager_AddLiquidityTest#testAddLiquidityWithActiveId_WithHook.snap @@ -1 +1 @@ -1265777 \ No newline at end of file +1265613 \ No newline at end of file diff --git a/.forge-snapshots/BinFungiblePositionManager_AddLiquidityTest#testBatch_AddLiquidityWithActiveId.snap b/.forge-snapshots/BinFungiblePositionManager_AddLiquidityTest#testBatch_AddLiquidityWithActiveId.snap index 9a290b5..9eb8871 100644 --- a/.forge-snapshots/BinFungiblePositionManager_AddLiquidityTest#testBatch_AddLiquidityWithActiveId.snap +++ b/.forge-snapshots/BinFungiblePositionManager_AddLiquidityTest#testBatch_AddLiquidityWithActiveId.snap @@ -1 +1 @@ -913480 \ No newline at end of file +913315 \ No newline at end of file diff --git a/.forge-snapshots/BinFungiblePositionManager_AddLiquidityTest#testBatch_AddLiquidityWithActiveId_WithoutCloseCurrency.snap b/.forge-snapshots/BinFungiblePositionManager_AddLiquidityTest#testBatch_AddLiquidityWithActiveId_WithoutCloseCurrency.snap index 293b6b5..782db02 100644 --- a/.forge-snapshots/BinFungiblePositionManager_AddLiquidityTest#testBatch_AddLiquidityWithActiveId_WithoutCloseCurrency.snap +++ b/.forge-snapshots/BinFungiblePositionManager_AddLiquidityTest#testBatch_AddLiquidityWithActiveId_WithoutCloseCurrency.snap @@ -1 +1 @@ -900549 \ No newline at end of file +900385 \ No newline at end of file diff --git a/.forge-snapshots/BinFungiblePositionManager_RemoveLiquidityTest#testBatch_RemoveLiquidityWithActiveId_ThreeBins.snap b/.forge-snapshots/BinFungiblePositionManager_RemoveLiquidityTest#testBatch_RemoveLiquidityWithActiveId_ThreeBins.snap index 052ed7c..e9dca54 100644 --- a/.forge-snapshots/BinFungiblePositionManager_RemoveLiquidityTest#testBatch_RemoveLiquidityWithActiveId_ThreeBins.snap +++ b/.forge-snapshots/BinFungiblePositionManager_RemoveLiquidityTest#testBatch_RemoveLiquidityWithActiveId_ThreeBins.snap @@ -1 +1 @@ -222600 \ No newline at end of file +222469 \ No newline at end of file diff --git a/.forge-snapshots/BinFungiblePositionManager_RemoveLiquidityTest#testBatch_RemoveLiquidityWithActiveId_ThreeBins_WithoutCloseCurrency.snap b/.forge-snapshots/BinFungiblePositionManager_RemoveLiquidityTest#testBatch_RemoveLiquidityWithActiveId_ThreeBins_WithoutCloseCurrency.snap index bacd213..c33b219 100644 --- a/.forge-snapshots/BinFungiblePositionManager_RemoveLiquidityTest#testBatch_RemoveLiquidityWithActiveId_ThreeBins_WithoutCloseCurrency.snap +++ b/.forge-snapshots/BinFungiblePositionManager_RemoveLiquidityTest#testBatch_RemoveLiquidityWithActiveId_ThreeBins_WithoutCloseCurrency.snap @@ -1 +1 @@ -212096 \ No newline at end of file +211964 \ No newline at end of file diff --git a/.forge-snapshots/BinFungiblePositionManager_RemoveLiquidityTest#testRemoveLiquidityOutsideActiveId_ThreeBins.snap b/.forge-snapshots/BinFungiblePositionManager_RemoveLiquidityTest#testRemoveLiquidityOutsideActiveId_ThreeBins.snap index 0ad2cf6..a9c6aa4 100644 --- a/.forge-snapshots/BinFungiblePositionManager_RemoveLiquidityTest#testRemoveLiquidityOutsideActiveId_ThreeBins.snap +++ b/.forge-snapshots/BinFungiblePositionManager_RemoveLiquidityTest#testRemoveLiquidityOutsideActiveId_ThreeBins.snap @@ -1 +1 @@ -146273 \ No newline at end of file +146141 \ No newline at end of file diff --git a/.forge-snapshots/BinFungiblePositionManager_RemoveLiquidityTest#testRemoveLiquidityWithActiveId_ThreeBins.snap b/.forge-snapshots/BinFungiblePositionManager_RemoveLiquidityTest#testRemoveLiquidityWithActiveId_ThreeBins.snap index bacd213..c33b219 100644 --- a/.forge-snapshots/BinFungiblePositionManager_RemoveLiquidityTest#testRemoveLiquidityWithActiveId_ThreeBins.snap +++ b/.forge-snapshots/BinFungiblePositionManager_RemoveLiquidityTest#testRemoveLiquidityWithActiveId_ThreeBins.snap @@ -1 +1 @@ -212096 \ No newline at end of file +211964 \ No newline at end of file diff --git a/.forge-snapshots/BinFungiblePositionManager_RemoveLiquidityTest#testRemoveLiquidity_Half.snap b/.forge-snapshots/BinFungiblePositionManager_RemoveLiquidityTest#testRemoveLiquidity_Half.snap index 61c9cb1..8604e7f 100644 --- a/.forge-snapshots/BinFungiblePositionManager_RemoveLiquidityTest#testRemoveLiquidity_Half.snap +++ b/.forge-snapshots/BinFungiblePositionManager_RemoveLiquidityTest#testRemoveLiquidity_Half.snap @@ -1 +1 @@ -237562 \ No newline at end of file +237397 \ No newline at end of file diff --git a/.forge-snapshots/BinMigratorFromPancakeswapV2Test#testMigrateFromV2IncludingInit.snap b/.forge-snapshots/BinMigratorFromPancakeswapV2Test#testMigrateFromV2IncludingInit.snap index c778658..5faab16 100644 --- a/.forge-snapshots/BinMigratorFromPancakeswapV2Test#testMigrateFromV2IncludingInit.snap +++ b/.forge-snapshots/BinMigratorFromPancakeswapV2Test#testMigrateFromV2IncludingInit.snap @@ -1 +1 @@ -1017192 \ No newline at end of file +1017028 \ No newline at end of file diff --git a/.forge-snapshots/BinMigratorFromPancakeswapV2Test#testMigrateFromV2WithoutInit.snap b/.forge-snapshots/BinMigratorFromPancakeswapV2Test#testMigrateFromV2WithoutInit.snap index 58bd8d7..0444dfe 100644 --- a/.forge-snapshots/BinMigratorFromPancakeswapV2Test#testMigrateFromV2WithoutInit.snap +++ b/.forge-snapshots/BinMigratorFromPancakeswapV2Test#testMigrateFromV2WithoutInit.snap @@ -1 +1 @@ -977380 \ No newline at end of file +977216 \ No newline at end of file diff --git a/.forge-snapshots/BinMigratorFromPancakeswapV2Test#testMigrateFromV2WithoutNativeToken.snap b/.forge-snapshots/BinMigratorFromPancakeswapV2Test#testMigrateFromV2WithoutNativeToken.snap index 2bfd6f2..ab3dd16 100644 --- a/.forge-snapshots/BinMigratorFromPancakeswapV2Test#testMigrateFromV2WithoutNativeToken.snap +++ b/.forge-snapshots/BinMigratorFromPancakeswapV2Test#testMigrateFromV2WithoutNativeToken.snap @@ -1 +1 @@ -1021528 \ No newline at end of file +1021364 \ No newline at end of file diff --git a/.forge-snapshots/BinMigratorFromPancakeswapV3Test#testMigrateFromV3IncludingInit.snap b/.forge-snapshots/BinMigratorFromPancakeswapV3Test#testMigrateFromV3IncludingInit.snap index b2daba8..401df7a 100644 --- a/.forge-snapshots/BinMigratorFromPancakeswapV3Test#testMigrateFromV3IncludingInit.snap +++ b/.forge-snapshots/BinMigratorFromPancakeswapV3Test#testMigrateFromV3IncludingInit.snap @@ -1 +1 @@ -1096118 \ No newline at end of file +1095954 \ No newline at end of file diff --git a/.forge-snapshots/BinMigratorFromPancakeswapV3Test#testMigrateFromV3WithoutInit.snap b/.forge-snapshots/BinMigratorFromPancakeswapV3Test#testMigrateFromV3WithoutInit.snap index d8b6c3c..c5b6f6e 100644 --- a/.forge-snapshots/BinMigratorFromPancakeswapV3Test#testMigrateFromV3WithoutInit.snap +++ b/.forge-snapshots/BinMigratorFromPancakeswapV3Test#testMigrateFromV3WithoutInit.snap @@ -1 +1 @@ -1056359 \ No newline at end of file +1056195 \ No newline at end of file diff --git a/.forge-snapshots/BinMigratorFromPancakeswapV3Test#testMigrateFromV3WithoutNativeToken.snap b/.forge-snapshots/BinMigratorFromPancakeswapV3Test#testMigrateFromV3WithoutNativeToken.snap index 72f5e21..77ce13e 100644 --- a/.forge-snapshots/BinMigratorFromPancakeswapV3Test#testMigrateFromV3WithoutNativeToken.snap +++ b/.forge-snapshots/BinMigratorFromPancakeswapV3Test#testMigrateFromV3WithoutNativeToken.snap @@ -1 +1 @@ -1093888 \ No newline at end of file +1093724 \ No newline at end of file diff --git a/.forge-snapshots/BinMigratorFromUniswapV2Test#testMigrateFromV2IncludingInit.snap b/.forge-snapshots/BinMigratorFromUniswapV2Test#testMigrateFromV2IncludingInit.snap index 8b959a5..d969080 100644 --- a/.forge-snapshots/BinMigratorFromUniswapV2Test#testMigrateFromV2IncludingInit.snap +++ b/.forge-snapshots/BinMigratorFromUniswapV2Test#testMigrateFromV2IncludingInit.snap @@ -1 +1 @@ -1017204 \ No newline at end of file +1017040 \ No newline at end of file diff --git a/.forge-snapshots/BinMigratorFromUniswapV2Test#testMigrateFromV2WithoutInit.snap b/.forge-snapshots/BinMigratorFromUniswapV2Test#testMigrateFromV2WithoutInit.snap index d763003..6097809 100644 --- a/.forge-snapshots/BinMigratorFromUniswapV2Test#testMigrateFromV2WithoutInit.snap +++ b/.forge-snapshots/BinMigratorFromUniswapV2Test#testMigrateFromV2WithoutInit.snap @@ -1 +1 @@ -977392 \ No newline at end of file +977228 \ No newline at end of file diff --git a/.forge-snapshots/BinMigratorFromUniswapV2Test#testMigrateFromV2WithoutNativeToken.snap b/.forge-snapshots/BinMigratorFromUniswapV2Test#testMigrateFromV2WithoutNativeToken.snap index a7009b7..1168edf 100644 --- a/.forge-snapshots/BinMigratorFromUniswapV2Test#testMigrateFromV2WithoutNativeToken.snap +++ b/.forge-snapshots/BinMigratorFromUniswapV2Test#testMigrateFromV2WithoutNativeToken.snap @@ -1 +1 @@ -1021525 \ No newline at end of file +1021361 \ No newline at end of file diff --git a/.forge-snapshots/BinMigratorFromUniswapV3Test#testMigrateFromV3IncludingInit.snap b/.forge-snapshots/BinMigratorFromUniswapV3Test#testMigrateFromV3IncludingInit.snap index 1106799..fce9013 100644 --- a/.forge-snapshots/BinMigratorFromUniswapV3Test#testMigrateFromV3IncludingInit.snap +++ b/.forge-snapshots/BinMigratorFromUniswapV3Test#testMigrateFromV3IncludingInit.snap @@ -1 +1 @@ -1094100 \ No newline at end of file +1093936 \ No newline at end of file diff --git a/.forge-snapshots/BinMigratorFromUniswapV3Test#testMigrateFromV3WithoutInit.snap b/.forge-snapshots/BinMigratorFromUniswapV3Test#testMigrateFromV3WithoutInit.snap index de98d9a..1bece7f 100644 --- a/.forge-snapshots/BinMigratorFromUniswapV3Test#testMigrateFromV3WithoutInit.snap +++ b/.forge-snapshots/BinMigratorFromUniswapV3Test#testMigrateFromV3WithoutInit.snap @@ -1 +1 @@ -1054341 \ No newline at end of file +1054177 \ No newline at end of file diff --git a/.forge-snapshots/BinMigratorFromUniswapV3Test#testMigrateFromV3WithoutNativeToken.snap b/.forge-snapshots/BinMigratorFromUniswapV3Test#testMigrateFromV3WithoutNativeToken.snap index aa709ce..608ee54 100644 --- a/.forge-snapshots/BinMigratorFromUniswapV3Test#testMigrateFromV3WithoutNativeToken.snap +++ b/.forge-snapshots/BinMigratorFromUniswapV3Test#testMigrateFromV3WithoutNativeToken.snap @@ -1 +1 @@ -1091866 \ No newline at end of file +1091702 \ No newline at end of file diff --git a/src/pool-bin/BinFungiblePositionManager.sol b/src/pool-bin/BinFungiblePositionManager.sol index 87f1247..e05114f 100644 --- a/src/pool-bin/BinFungiblePositionManager.sol +++ b/src/pool-bin/BinFungiblePositionManager.sol @@ -93,20 +93,15 @@ contract BinFungiblePositionManager is checkDeadline(deadline) returns (bytes[] memory) { - return abi.decode(vault.lock(abi.encode(msg.sender, false, lockData)), (bytes[])); + return abi.decode(vault.lock(abi.encode(msg.sender, lockData)), (bytes[])); } function lockAcquired(bytes calldata rawData) external override returns (bytes memory returnData) { if (msg.sender != address(vault)) revert OnlyVaultCaller(); - (address sender, bool isSingle, bytes memory lockData) = abi.decode(rawData, (address, bool, bytes)); - if (isSingle) { - CallbackData memory data = abi.decode(lockData, (CallbackData)); - return _handleSingleAction(data, sender, true); - } else { - bytes[] memory params = abi.decode(lockData, (bytes[])); - return _dispatch(params, sender); - } + (address sender, bytes memory lockData) = abi.decode(rawData, (address, bytes)); + bytes[] memory params = abi.decode(lockData, (bytes[])); + return _dispatch(params, sender); } function _dispatch(bytes[] memory params, address sender) internal returns (bytes memory returnDataArrayBytes) {