diff --git a/.forge-snapshots/BinFungiblePositionManager_AddLiquidityTest#testAddLiquidityOutsideActiveId_ExistingId.snap b/.forge-snapshots/BinFungiblePositionManager_AddLiquidityTest#testAddLiquidityOutsideActiveId_ExistingId.snap index 7b0cdd4..3c20060 100644 --- a/.forge-snapshots/BinFungiblePositionManager_AddLiquidityTest#testAddLiquidityOutsideActiveId_ExistingId.snap +++ b/.forge-snapshots/BinFungiblePositionManager_AddLiquidityTest#testAddLiquidityOutsideActiveId_ExistingId.snap @@ -1 +1 @@ -180350 \ No newline at end of file +180120 \ 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 51f4302..a4191cb 100644 --- a/.forge-snapshots/BinFungiblePositionManager_AddLiquidityTest#testAddLiquidityOutsideActiveId_NewId.snap +++ b/.forge-snapshots/BinFungiblePositionManager_AddLiquidityTest#testAddLiquidityOutsideActiveId_NewId.snap @@ -1 +1 @@ -634518 \ No newline at end of file +634289 \ No newline at end of file diff --git a/.forge-snapshots/BinFungiblePositionManager_AddLiquidityTest#testAddLiquidityWithActiveId.snap b/.forge-snapshots/BinFungiblePositionManager_AddLiquidityTest#testAddLiquidityWithActiveId.snap index 6773759..7457eb2 100644 --- a/.forge-snapshots/BinFungiblePositionManager_AddLiquidityTest#testAddLiquidityWithActiveId.snap +++ b/.forge-snapshots/BinFungiblePositionManager_AddLiquidityTest#testAddLiquidityWithActiveId.snap @@ -1 +1 @@ -900791 \ No newline at end of file +900548 \ 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 777bc40..9be7e04 100644 --- a/.forge-snapshots/BinFungiblePositionManager_AddLiquidityTest#testAddLiquidityWithActiveId_WithHook.snap +++ b/.forge-snapshots/BinFungiblePositionManager_AddLiquidityTest#testAddLiquidityWithActiveId_WithHook.snap @@ -1 +1 @@ -1265997 \ No newline at end of file +1265777 \ 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 e5c6621..9a290b5 100644 --- a/.forge-snapshots/BinFungiblePositionManager_AddLiquidityTest#testBatch_AddLiquidityWithActiveId.snap +++ b/.forge-snapshots/BinFungiblePositionManager_AddLiquidityTest#testBatch_AddLiquidityWithActiveId.snap @@ -1 +1 @@ -913724 \ No newline at end of file +913480 \ 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 6773759..293b6b5 100644 --- a/.forge-snapshots/BinFungiblePositionManager_AddLiquidityTest#testBatch_AddLiquidityWithActiveId_WithoutCloseCurrency.snap +++ b/.forge-snapshots/BinFungiblePositionManager_AddLiquidityTest#testBatch_AddLiquidityWithActiveId_WithoutCloseCurrency.snap @@ -1 +1 @@ -900791 \ No newline at end of file +900549 \ 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 965c683..052ed7c 100644 --- a/.forge-snapshots/BinFungiblePositionManager_RemoveLiquidityTest#testBatch_RemoveLiquidityWithActiveId_ThreeBins.snap +++ b/.forge-snapshots/BinFungiblePositionManager_RemoveLiquidityTest#testBatch_RemoveLiquidityWithActiveId_ThreeBins.snap @@ -1 +1 @@ -222788 \ No newline at end of file +222600 \ 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 afe20e5..bacd213 100644 --- a/.forge-snapshots/BinFungiblePositionManager_RemoveLiquidityTest#testBatch_RemoveLiquidityWithActiveId_ThreeBins_WithoutCloseCurrency.snap +++ b/.forge-snapshots/BinFungiblePositionManager_RemoveLiquidityTest#testBatch_RemoveLiquidityWithActiveId_ThreeBins_WithoutCloseCurrency.snap @@ -1 +1 @@ -212283 \ No newline at end of file +212096 \ 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 98c58ec..0ad2cf6 100644 --- a/.forge-snapshots/BinFungiblePositionManager_RemoveLiquidityTest#testRemoveLiquidityOutsideActiveId_ThreeBins.snap +++ b/.forge-snapshots/BinFungiblePositionManager_RemoveLiquidityTest#testRemoveLiquidityOutsideActiveId_ThreeBins.snap @@ -1 +1 @@ -146429 \ No newline at end of file +146273 \ 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 072db05..bacd213 100644 --- a/.forge-snapshots/BinFungiblePositionManager_RemoveLiquidityTest#testRemoveLiquidityWithActiveId_ThreeBins.snap +++ b/.forge-snapshots/BinFungiblePositionManager_RemoveLiquidityTest#testRemoveLiquidityWithActiveId_ThreeBins.snap @@ -1 +1 @@ -212282 \ No newline at end of file +212096 \ 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 ed790ca..61c9cb1 100644 --- a/.forge-snapshots/BinFungiblePositionManager_RemoveLiquidityTest#testRemoveLiquidity_Half.snap +++ b/.forge-snapshots/BinFungiblePositionManager_RemoveLiquidityTest#testRemoveLiquidity_Half.snap @@ -1 +1 @@ -237793 \ No newline at end of file +237562 \ No newline at end of file diff --git a/.forge-snapshots/BinMigratorFromPancakeswapV2Test#testMigrateFromV2IncludingInit.snap b/.forge-snapshots/BinMigratorFromPancakeswapV2Test#testMigrateFromV2IncludingInit.snap index 746b998..c778658 100644 --- a/.forge-snapshots/BinMigratorFromPancakeswapV2Test#testMigrateFromV2IncludingInit.snap +++ b/.forge-snapshots/BinMigratorFromPancakeswapV2Test#testMigrateFromV2IncludingInit.snap @@ -1 +1 @@ -1017338 \ No newline at end of file +1017192 \ No newline at end of file diff --git a/.forge-snapshots/BinMigratorFromPancakeswapV2Test#testMigrateFromV2WithoutInit.snap b/.forge-snapshots/BinMigratorFromPancakeswapV2Test#testMigrateFromV2WithoutInit.snap index 854366d..58bd8d7 100644 --- a/.forge-snapshots/BinMigratorFromPancakeswapV2Test#testMigrateFromV2WithoutInit.snap +++ b/.forge-snapshots/BinMigratorFromPancakeswapV2Test#testMigrateFromV2WithoutInit.snap @@ -1 +1 @@ -977526 \ No newline at end of file +977380 \ No newline at end of file diff --git a/.forge-snapshots/BinMigratorFromPancakeswapV2Test#testMigrateFromV2WithoutNativeToken.snap b/.forge-snapshots/BinMigratorFromPancakeswapV2Test#testMigrateFromV2WithoutNativeToken.snap index 483e421..2bfd6f2 100644 --- a/.forge-snapshots/BinMigratorFromPancakeswapV2Test#testMigrateFromV2WithoutNativeToken.snap +++ b/.forge-snapshots/BinMigratorFromPancakeswapV2Test#testMigrateFromV2WithoutNativeToken.snap @@ -1 +1 @@ -1021675 \ No newline at end of file +1021528 \ No newline at end of file diff --git a/.forge-snapshots/BinMigratorFromPancakeswapV3Test#testMigrateFromV3IncludingInit.snap b/.forge-snapshots/BinMigratorFromPancakeswapV3Test#testMigrateFromV3IncludingInit.snap index af4f805..b2daba8 100644 --- a/.forge-snapshots/BinMigratorFromPancakeswapV3Test#testMigrateFromV3IncludingInit.snap +++ b/.forge-snapshots/BinMigratorFromPancakeswapV3Test#testMigrateFromV3IncludingInit.snap @@ -1 +1 @@ -1096266 \ No newline at end of file +1096118 \ No newline at end of file diff --git a/.forge-snapshots/BinMigratorFromPancakeswapV3Test#testMigrateFromV3WithoutInit.snap b/.forge-snapshots/BinMigratorFromPancakeswapV3Test#testMigrateFromV3WithoutInit.snap index d414579..d8b6c3c 100644 --- a/.forge-snapshots/BinMigratorFromPancakeswapV3Test#testMigrateFromV3WithoutInit.snap +++ b/.forge-snapshots/BinMigratorFromPancakeswapV3Test#testMigrateFromV3WithoutInit.snap @@ -1 +1 @@ -1056506 \ No newline at end of file +1056359 \ No newline at end of file diff --git a/.forge-snapshots/BinMigratorFromPancakeswapV3Test#testMigrateFromV3WithoutNativeToken.snap b/.forge-snapshots/BinMigratorFromPancakeswapV3Test#testMigrateFromV3WithoutNativeToken.snap index 9ec6274..72f5e21 100644 --- a/.forge-snapshots/BinMigratorFromPancakeswapV3Test#testMigrateFromV3WithoutNativeToken.snap +++ b/.forge-snapshots/BinMigratorFromPancakeswapV3Test#testMigrateFromV3WithoutNativeToken.snap @@ -1 +1 @@ -1094035 \ No newline at end of file +1093888 \ No newline at end of file diff --git a/.forge-snapshots/BinMigratorFromUniswapV2Test#testMigrateFromV2IncludingInit.snap b/.forge-snapshots/BinMigratorFromUniswapV2Test#testMigrateFromV2IncludingInit.snap index 9feb506..8b959a5 100644 --- a/.forge-snapshots/BinMigratorFromUniswapV2Test#testMigrateFromV2IncludingInit.snap +++ b/.forge-snapshots/BinMigratorFromUniswapV2Test#testMigrateFromV2IncludingInit.snap @@ -1 +1 @@ -1017350 \ No newline at end of file +1017204 \ No newline at end of file diff --git a/.forge-snapshots/BinMigratorFromUniswapV2Test#testMigrateFromV2WithoutInit.snap b/.forge-snapshots/BinMigratorFromUniswapV2Test#testMigrateFromV2WithoutInit.snap index 8fffe3e..d763003 100644 --- a/.forge-snapshots/BinMigratorFromUniswapV2Test#testMigrateFromV2WithoutInit.snap +++ b/.forge-snapshots/BinMigratorFromUniswapV2Test#testMigrateFromV2WithoutInit.snap @@ -1 +1 @@ -977538 \ No newline at end of file +977392 \ No newline at end of file diff --git a/.forge-snapshots/BinMigratorFromUniswapV2Test#testMigrateFromV2WithoutNativeToken.snap b/.forge-snapshots/BinMigratorFromUniswapV2Test#testMigrateFromV2WithoutNativeToken.snap index ba9b232..a7009b7 100644 --- a/.forge-snapshots/BinMigratorFromUniswapV2Test#testMigrateFromV2WithoutNativeToken.snap +++ b/.forge-snapshots/BinMigratorFromUniswapV2Test#testMigrateFromV2WithoutNativeToken.snap @@ -1 +1 @@ -1021672 \ No newline at end of file +1021525 \ No newline at end of file diff --git a/.forge-snapshots/BinMigratorFromUniswapV3Test#testMigrateFromV3IncludingInit.snap b/.forge-snapshots/BinMigratorFromUniswapV3Test#testMigrateFromV3IncludingInit.snap index c2d2eb7..1106799 100644 --- a/.forge-snapshots/BinMigratorFromUniswapV3Test#testMigrateFromV3IncludingInit.snap +++ b/.forge-snapshots/BinMigratorFromUniswapV3Test#testMigrateFromV3IncludingInit.snap @@ -1 +1 @@ -1094248 \ No newline at end of file +1094100 \ No newline at end of file diff --git a/.forge-snapshots/BinMigratorFromUniswapV3Test#testMigrateFromV3WithoutInit.snap b/.forge-snapshots/BinMigratorFromUniswapV3Test#testMigrateFromV3WithoutInit.snap index 3b19055..de98d9a 100644 --- a/.forge-snapshots/BinMigratorFromUniswapV3Test#testMigrateFromV3WithoutInit.snap +++ b/.forge-snapshots/BinMigratorFromUniswapV3Test#testMigrateFromV3WithoutInit.snap @@ -1 +1 @@ -1054488 \ No newline at end of file +1054341 \ No newline at end of file diff --git a/.forge-snapshots/BinMigratorFromUniswapV3Test#testMigrateFromV3WithoutNativeToken.snap b/.forge-snapshots/BinMigratorFromUniswapV3Test#testMigrateFromV3WithoutNativeToken.snap index 63d1766..aa709ce 100644 --- a/.forge-snapshots/BinMigratorFromUniswapV3Test#testMigrateFromV3WithoutNativeToken.snap +++ b/.forge-snapshots/BinMigratorFromUniswapV3Test#testMigrateFromV3WithoutNativeToken.snap @@ -1 +1 @@ -1092013 \ No newline at end of file +1091866 \ No newline at end of file diff --git a/src/pool-bin/BinMigrator.sol b/src/pool-bin/BinMigrator.sol index f6b61fb..1156ebc 100644 --- a/src/pool-bin/BinMigrator.sol +++ b/src/pool-bin/BinMigrator.sol @@ -47,10 +47,10 @@ contract BinMigrator is IBinMigrator, BaseMigrator { deltaIds: v4PoolParams.deltaIds, distributionX: v4PoolParams.distributionX, distributionY: v4PoolParams.distributionY, - to: v4PoolParams.to, - deadline: v4PoolParams.deadline + to: v4PoolParams.to }); - (uint256 amount0Consumed, uint256 amount1Consumed,,) = _addLiquidityToTargetPool(addLiquidityParams); + (uint256 amount0Consumed, uint256 amount1Consumed,,) = + _addLiquidityToTargetPool(addLiquidityParams, v4PoolParams.deadline); // refund if necessary, ETH is supported by CurrencyLib unchecked { @@ -94,10 +94,10 @@ contract BinMigrator is IBinMigrator, BaseMigrator { deltaIds: v4PoolParams.deltaIds, distributionX: v4PoolParams.distributionX, distributionY: v4PoolParams.distributionY, - to: v4PoolParams.to, - deadline: v4PoolParams.deadline + to: v4PoolParams.to }); - (uint256 amount0Consumed, uint256 amount1Consumed,,) = _addLiquidityToTargetPool(addLiquidityParams); + (uint256 amount0Consumed, uint256 amount1Consumed,,) = + _addLiquidityToTargetPool(addLiquidityParams, v4PoolParams.deadline); // refund if necessary, ETH is supported by CurrencyLib unchecked { @@ -112,11 +112,12 @@ contract BinMigrator is IBinMigrator, BaseMigrator { /// @dev adding liquidity to target bin pool, collect surplus ETH if necessary /// @param params bin position manager add liquidity params + /// @param deadline the deadline of the transaction /// @return amount0Consumed the actual amount of token0 consumed /// @return amount1Consumed the actual amount of token1 consumed /// @return tokenIds the list of the id of the position token minted /// @return liquidityMinted the list of the amount of the position token minted - function _addLiquidityToTargetPool(IBinFungiblePositionManager.AddLiquidityParams memory params) + function _addLiquidityToTargetPool(IBinFungiblePositionManager.AddLiquidityParams memory params, uint256 deadline) internal returns ( uint128 amount0Consumed, @@ -142,7 +143,7 @@ contract BinMigrator is IBinMigrator, BaseMigrator { (amount0Consumed, amount1Consumed, tokenIds, liquidityMinted) = abi.decode( binFungiblePositionManager.modifyLiquidities{value: nativePair ? params.amount0 : 0}( - abi.encode(lockData), params.deadline + abi.encode(lockData), deadline )[0], (uint128, uint128, uint256[], uint256[]) ); diff --git a/src/pool-bin/interfaces/IBinFungiblePositionManager.sol b/src/pool-bin/interfaces/IBinFungiblePositionManager.sol index 4eb92c3..954ba6e 100644 --- a/src/pool-bin/interfaces/IBinFungiblePositionManager.sol +++ b/src/pool-bin/interfaces/IBinFungiblePositionManager.sol @@ -36,7 +36,6 @@ interface IBinFungiblePositionManager is IBinFungibleToken, IPeripheryPayments, /// - distributionX: Distribution of tokenX with sum(distributionX) = 100e18 (100%) or 0 (0%) /// - distributionY: Distribution of tokenY with sum(distributionY) = 100e18 (100%) or 0 (0%) /// - to: Address of recipient - /// - deadline: Deadline of transaction struct AddLiquidityParams { PoolKey poolKey; uint128 amount0; @@ -49,7 +48,6 @@ interface IBinFungiblePositionManager is IBinFungibleToken, IPeripheryPayments, uint256[] distributionX; uint256[] distributionY; address to; - uint256 deadline; } /// @notice RemoveLiquidityParams @@ -59,7 +57,6 @@ interface IBinFungiblePositionManager is IBinFungibleToken, IPeripheryPayments, /// - amounts: List of share amount to remove for each bin /// - from: Address of NFT holder to burn the NFT /// - to: Address of recipient for amount0 and amount1 recieved - /// - deadline: Deadline of transaction struct RemoveLiquidityParams { PoolKey poolKey; uint128 amount0Min; @@ -68,7 +65,6 @@ interface IBinFungiblePositionManager is IBinFungibleToken, IPeripheryPayments, uint256[] amounts; address from; address to; - uint256 deadline; } enum CallbackDataType { diff --git a/test/pool-bin/BinFungiblePositionManager_AddLiquidity.t.sol b/test/pool-bin/BinFungiblePositionManager_AddLiquidity.t.sol index 40dff96..0d3b652 100644 --- a/test/pool-bin/BinFungiblePositionManager_AddLiquidity.t.sol +++ b/test/pool-bin/BinFungiblePositionManager_AddLiquidity.t.sol @@ -108,7 +108,7 @@ contract BinFungiblePositionManager_AddLiquidityTest is Test, GasSnapshot, Liqui // generate modifyLiquidities data bytes memory payload = _getModifyLiquiditiesAddPayload(params, false); - bytes[] memory returnDataArrayBytes = binFungiblePositionManager.modifyLiquidities(payload, params.deadline); + bytes[] memory returnDataArrayBytes = binFungiblePositionManager.modifyLiquidities(payload, block.timestamp + 1); return abi.decode(returnDataArrayBytes[0], (uint128, uint128, uint256[], uint256[])); } @@ -119,7 +119,6 @@ contract BinFungiblePositionManager_AddLiquidityTest is Test, GasSnapshot, Liqui vm.warp(1000); // set block.timestamp IBinFungiblePositionManager.AddLiquidityParams memory params = _getAddParams(key1, binIds, 1 ether, 1 ether, activeId, alice); - params.deadline = 900; // set deadline before block.timestamp bytes memory payload = _getModifyLiquiditiesAddPayload(params, false); vm.expectRevert(abi.encodeWithSelector(PeripheryValidation.TransactionTooOld.selector)); @@ -668,8 +667,7 @@ contract BinFungiblePositionManager_AddLiquidityTest is Test, GasSnapshot, Liqui deltaIds: convertToRelative(binIds, activeId), distributionX: distribX, distributionY: distribY, - to: alice, - deadline: block.timestamp + 600 + to: alice }); } diff --git a/test/pool-bin/BinFungiblePositionManager_RemoveLiquidity.t.sol b/test/pool-bin/BinFungiblePositionManager_RemoveLiquidity.t.sol index 5a09253..8eb7e5d 100644 --- a/test/pool-bin/BinFungiblePositionManager_RemoveLiquidity.t.sol +++ b/test/pool-bin/BinFungiblePositionManager_RemoveLiquidity.t.sol @@ -106,7 +106,7 @@ contract BinFungiblePositionManager_RemoveLiquidityTest is Test, GasSnapshot, Li // generate modifyLiquidities data bytes memory payload = _getModifyLiquiditiesAddPayload(params, false); - bytes[] memory returnDataArrayBytes = binFungiblePositionManager.modifyLiquidities(payload, params.deadline); + bytes[] memory returnDataArrayBytes = binFungiblePositionManager.modifyLiquidities(payload, block.timestamp + 1); return abi.decode(returnDataArrayBytes[0], (uint128, uint128, uint256[], uint256[])); } @@ -118,7 +118,7 @@ contract BinFungiblePositionManager_RemoveLiquidityTest is Test, GasSnapshot, Li // generate modifyLiquidities data bytes memory payload = _getModifyLiquiditiesRemovePayload(params, false); - bytes[] memory returnDataArrayBytes = binFungiblePositionManager.modifyLiquidities(payload, params.deadline); + bytes[] memory returnDataArrayBytes = binFungiblePositionManager.modifyLiquidities(payload, block.timestamp + 1); return abi.decode(returnDataArrayBytes[0], (uint128, uint128, uint256[])); } @@ -136,7 +136,6 @@ contract BinFungiblePositionManager_RemoveLiquidityTest is Test, GasSnapshot, Li // Remove liquidity vm.warp(1000); removeParams = _getRemoveParams(key1, binIds, liquidityMinted); - removeParams.deadline = 900; // set deadline before block.timestamp bytes memory payload = _getModifyLiquiditiesRemovePayload(removeParams, false); vm.expectRevert(abi.encodeWithSelector(PeripheryValidation.TransactionTooOld.selector)); @@ -618,8 +617,7 @@ contract BinFungiblePositionManager_RemoveLiquidityTest is Test, GasSnapshot, Li ids: ids, amounts: amounts, from: alice, - to: alice, - deadline: block.timestamp + 600 + to: alice }); } diff --git a/test/pool-bin/helpers/LiquidityParamsHelper.sol b/test/pool-bin/helpers/LiquidityParamsHelper.sol index c23b27f..a08fd3d 100644 --- a/test/pool-bin/helpers/LiquidityParamsHelper.sol +++ b/test/pool-bin/helpers/LiquidityParamsHelper.sol @@ -65,7 +65,7 @@ contract LiquidityParamsHelper { uint128 amountY, uint24 activeId, address recipient - ) internal view returns (IBinFungiblePositionManager.AddLiquidityParams memory params) { + ) internal pure returns (IBinFungiblePositionManager.AddLiquidityParams memory params) { uint256 totalBins = binIds.length; uint8 nbBinX; // num of bins to the right @@ -94,8 +94,7 @@ contract LiquidityParamsHelper { deltaIds: convertToRelative(binIds, activeId), distributionX: distribX, distributionY: distribY, - to: recipient, - deadline: block.timestamp + 600 + to: recipient }); } } diff --git a/test/pool-bin/migrator/BinMigratorFromV2.sol b/test/pool-bin/migrator/BinMigratorFromV2.sol index d03efe1..7d9457d 100644 --- a/test/pool-bin/migrator/BinMigratorFromV2.sol +++ b/test/pool-bin/migrator/BinMigratorFromV2.sol @@ -124,7 +124,7 @@ abstract contract BinMigratorFromV2 is OldVersionHelper, LiquidityParamsHelper, distributionX: params.distributionX, distributionY: params.distributionY, to: params.to, - deadline: params.deadline + deadline: block.timestamp + 1 }); // 3. multicall, combine initialize and migrateFromV2 @@ -212,7 +212,7 @@ abstract contract BinMigratorFromV2 is OldVersionHelper, LiquidityParamsHelper, distributionX: params.distributionX, distributionY: params.distributionY, to: params.to, - deadline: params.deadline + deadline: block.timestamp + 1 }); // 3. multicall, combine initialize and migrateFromV2 @@ -269,7 +269,7 @@ abstract contract BinMigratorFromV2 is OldVersionHelper, LiquidityParamsHelper, distributionX: params.distributionX, distributionY: params.distributionY, to: params.to, - deadline: params.deadline + deadline: block.timestamp + 1 }); // 4. migrateFromV2 @@ -354,7 +354,7 @@ abstract contract BinMigratorFromV2 is OldVersionHelper, LiquidityParamsHelper, distributionX: params.distributionX, distributionY: params.distributionY, to: params.to, - deadline: params.deadline + deadline: block.timestamp + 1 }); // 4. migrate from v2 to v4 @@ -438,7 +438,7 @@ abstract contract BinMigratorFromV2 is OldVersionHelper, LiquidityParamsHelper, distributionX: params.distributionX, distributionY: params.distributionY, to: params.to, - deadline: params.deadline + deadline: block.timestamp + 1 }); uint256 balance0Before = address(this).balance; @@ -530,7 +530,7 @@ abstract contract BinMigratorFromV2 is OldVersionHelper, LiquidityParamsHelper, distributionX: params.distributionX, distributionY: params.distributionY, to: params.to, - deadline: params.deadline + deadline: block.timestamp + 1 }); uint256 balance0Before = address(this).balance; @@ -640,7 +640,7 @@ abstract contract BinMigratorFromV2 is OldVersionHelper, LiquidityParamsHelper, distributionX: distributionX, distributionY: distributionY, to: params.to, - deadline: params.deadline + deadline: block.timestamp + 1 }); uint256 balance0Before = address(this).balance; @@ -744,7 +744,7 @@ abstract contract BinMigratorFromV2 is OldVersionHelper, LiquidityParamsHelper, distributionX: distributionX, distributionY: distributionY, to: params.to, - deadline: params.deadline + deadline: block.timestamp + 1 }); uint256 balance0Before = token0.balanceOf(address(this)); @@ -850,7 +850,7 @@ abstract contract BinMigratorFromV2 is OldVersionHelper, LiquidityParamsHelper, distributionX: params.distributionX, distributionY: params.distributionY, to: params.to, - deadline: params.deadline + deadline: block.timestamp + 1 }); // 3. multicall, combine permit, initialize and migrateFromV2 diff --git a/test/pool-bin/migrator/BinMigratorFromV3.sol b/test/pool-bin/migrator/BinMigratorFromV3.sol index 2f192d1..cad4686 100644 --- a/test/pool-bin/migrator/BinMigratorFromV3.sol +++ b/test/pool-bin/migrator/BinMigratorFromV3.sol @@ -159,7 +159,7 @@ abstract contract BinMigratorFromV3 is OldVersionHelper, LiquidityParamsHelper, distributionX: params.distributionX, distributionY: params.distributionY, to: params.to, - deadline: params.deadline + deadline: block.timestamp + 1 }); // 3. multicall, combine initialize and migrateFromV3 @@ -251,7 +251,7 @@ abstract contract BinMigratorFromV3 is OldVersionHelper, LiquidityParamsHelper, distributionX: params.distributionX, distributionY: params.distributionY, to: params.to, - deadline: params.deadline + deadline: block.timestamp + 1 }); // 3. multicall, combine initialize and migrateFromV3 @@ -311,7 +311,7 @@ abstract contract BinMigratorFromV3 is OldVersionHelper, LiquidityParamsHelper, distributionX: params.distributionX, distributionY: params.distributionY, to: params.to, - deadline: params.deadline + deadline: block.timestamp + 1 }); // 4. migrateFromV3 directly given pool has been initialized @@ -401,7 +401,7 @@ abstract contract BinMigratorFromV3 is OldVersionHelper, LiquidityParamsHelper, distributionX: params.distributionX, distributionY: params.distributionY, to: params.to, - deadline: params.deadline + deadline: block.timestamp + 1 }); // 4. migrate from v3 to v4 @@ -489,7 +489,7 @@ abstract contract BinMigratorFromV3 is OldVersionHelper, LiquidityParamsHelper, distributionX: params.distributionX, distributionY: params.distributionY, to: params.to, - deadline: params.deadline + deadline: block.timestamp + 1 }); uint256 balance0Before = address(this).balance; @@ -585,7 +585,7 @@ abstract contract BinMigratorFromV3 is OldVersionHelper, LiquidityParamsHelper, distributionX: params.distributionX, distributionY: params.distributionY, to: params.to, - deadline: params.deadline + deadline: block.timestamp + 1 }); uint256 balance0Before = address(this).balance; @@ -699,7 +699,7 @@ abstract contract BinMigratorFromV3 is OldVersionHelper, LiquidityParamsHelper, distributionX: distributionX, distributionY: distributionY, to: params.to, - deadline: params.deadline + deadline: block.timestamp + 1 }); uint256 balance0Before = address(this).balance; @@ -807,7 +807,7 @@ abstract contract BinMigratorFromV3 is OldVersionHelper, LiquidityParamsHelper, distributionX: distributionX, distributionY: distributionY, to: params.to, - deadline: params.deadline + deadline: block.timestamp + 1 }); uint256 balance0Before = token0.balanceOf(address(this)); @@ -915,7 +915,7 @@ abstract contract BinMigratorFromV3 is OldVersionHelper, LiquidityParamsHelper, distributionX: distributionX, distributionY: distributionY, to: params.to, - deadline: params.deadline + deadline: block.timestamp + 1 }); // 4. migrate half @@ -976,7 +976,7 @@ abstract contract BinMigratorFromV3 is OldVersionHelper, LiquidityParamsHelper, distributionX: params.distributionX, distributionY: params.distributionY, to: params.to, - deadline: params.deadline + deadline: block.timestamp + 1 }); // 3. multicall, combine selfPermitERC721, initialize and migrateFromV3 @@ -1076,7 +1076,7 @@ abstract contract BinMigratorFromV3 is OldVersionHelper, LiquidityParamsHelper, distributionX: params.distributionX, distributionY: params.distributionY, to: params.to, - deadline: params.deadline + deadline: block.timestamp + 1 }); // make the guy rich