From 219c399c16229f21cbe8671db72608c451fae6ae Mon Sep 17 00:00:00 2001 From: Mark Toda Date: Thu, 24 Oct 2024 13:17:40 -0700 Subject: [PATCH 1/5] feat: update to use native snapshots --- .../BaseActionsRouter_mock10commands.snap | 1 - ...p_settleFromCaller_takeAllToMsgSender.snap | 1 - ...eFromCaller_takeAllToSpecifiedAddress.snap | 1 - ..._settleWithBalance_takeAllToMsgSender.snap | 1 - ...WithBalance_takeAllToSpecifiedAddress.snap | 1 - .../PositionManager_burn_empty.snap | 1 - .../PositionManager_burn_empty_native.snap | 1 - ...anager_burn_nonEmpty_native_withClose.snap | 1 - ...ger_burn_nonEmpty_native_withTakePair.snap | 1 - ...sitionManager_burn_nonEmpty_withClose.snap | 1 - ...ionManager_burn_nonEmpty_withTakePair.snap | 1 - .../PositionManager_collect_native.snap | 1 - .../PositionManager_collect_sameRange.snap | 1 - .../PositionManager_collect_withClose.snap | 1 - .../PositionManager_collect_withTakePair.snap | 1 - ...itionManager_decreaseLiquidity_native.snap | 1 - ...onManager_decreaseLiquidity_withClose.snap | 1 - ...anager_decreaseLiquidity_withTakePair.snap | 1 - .../PositionManager_decrease_burnEmpty.snap | 1 - ...tionManager_decrease_burnEmpty_native.snap | 1 - ...nager_decrease_sameRange_allLiquidity.snap | 1 - .../PositionManager_decrease_take_take.snap | 1 - ...ger_increaseLiquidity_erc20_withClose.snap | 1 - ...ncreaseLiquidity_erc20_withSettlePair.snap | 1 - ...itionManager_increaseLiquidity_native.snap | 1 - ...crease_autocompoundExactUnclaimedFees.snap | 1 - ...increase_autocompoundExcessFeesCredit.snap | 1 - ...ger_increase_autocompound_clearExcess.snap | 1 - .../PositionManager_mint_native.snap | 1 - ...anager_mint_nativeWithSweep_withClose.snap | 1 - ...r_mint_nativeWithSweep_withSettlePair.snap | 1 - .../PositionManager_mint_onSameTickLower.snap | 1 - .../PositionManager_mint_onSameTickUpper.snap | 1 - .../PositionManager_mint_sameRange.snap | 1 - ...nManager_mint_settleWithBalance_sweep.snap | 1 - ...anager_mint_warmedPool_differentRange.snap | 1 - .../PositionManager_mint_withClose.snap | 1 - .../PositionManager_mint_withSettlePair.snap | 1 - ...tionManager_multicall_initialize_mint.snap | 1 - .forge-snapshots/PositionManager_permit.snap | 1 - ...PositionManager_permit_secondPosition.snap | 1 - .../PositionManager_permit_twice.snap | 1 - .../PositionManager_subscribe.snap | 1 - .../PositionManager_unsubscribe.snap | 1 - ...utSingle_oneForZero_multiplePositions.snap | 1 - ...utSingle_zeroForOne_multiplePositions.snap | 1 - .../Quoter_exactOutputSingle_oneForZero.snap | 1 - .../Quoter_exactOutputSingle_zeroForOne.snap | 1 - ...er_quoteExactInput_oneHop_1TickLoaded.snap | 1 - ...oteExactInput_oneHop_initializedAfter.snap | 1 - ...ExactInput_oneHop_startingInitialized.snap | 1 - .../Quoter_quoteExactInput_twoHops.snap | 1 - ...r_quoteExactOutput_oneHop_1TickLoaded.snap | 1 - ..._quoteExactOutput_oneHop_2TicksLoaded.snap | 1 - ...teExactOutput_oneHop_initializedAfter.snap | 1 - ...xactOutput_oneHop_startingInitialized.snap | 1 - .../Quoter_quoteExactOutput_twoHops.snap | 1 - ...tateView_extsload_getFeeGrowthGlobals.snap | 1 - ...StateView_extsload_getFeeGrowthInside.snap | 1 - .../StateView_extsload_getLiquidity.snap | 1 - .../StateView_extsload_getPositionInfo.snap | 1 - ...ateView_extsload_getPositionLiquidity.snap | 1 - .../StateView_extsload_getSlot0.snap | 1 - .../StateView_extsload_getTickBitmap.snap | 1 - ...View_extsload_getTickFeeGrowthOutside.snap | 1 - .../StateView_extsload_getTickInfo.snap | 1 - .../StateView_extsload_getTickLiquidity.snap | 1 - .forge-snapshots/V4Router_Bytecode.snap | 1 - .../V4Router_ExactIn1Hop_nativeIn.snap | 1 - .../V4Router_ExactIn1Hop_nativeOut.snap | 1 - .../V4Router_ExactIn1Hop_oneForZero.snap | 1 - .../V4Router_ExactIn1Hop_zeroForOne.snap | 1 - .forge-snapshots/V4Router_ExactIn2Hops.snap | 1 - .../V4Router_ExactIn2Hops_nativeIn.snap | 1 - .forge-snapshots/V4Router_ExactIn3Hops.snap | 1 - .../V4Router_ExactIn3Hops_nativeIn.snap | 1 - .../V4Router_ExactInputSingle.snap | 1 - .../V4Router_ExactInputSingle_nativeIn.snap | 1 - .../V4Router_ExactInputSingle_nativeOut.snap | 1 - ...Router_ExactOut1Hop_nativeIn_sweepETH.snap | 1 - .../V4Router_ExactOut1Hop_nativeOut.snap | 1 - .../V4Router_ExactOut1Hop_oneForZero.snap | 1 - .../V4Router_ExactOut1Hop_zeroForOne.snap | 1 - .forge-snapshots/V4Router_ExactOut2Hops.snap | 1 - .../V4Router_ExactOut2Hops_nativeIn.snap | 1 - .forge-snapshots/V4Router_ExactOut3Hops.snap | 1 - .../V4Router_ExactOut3Hops_nativeIn.snap | 1 - .../V4Router_ExactOut3Hops_nativeOut.snap | 1 - .../V4Router_ExactOutputSingle.snap | 1 - ...r_ExactOutputSingle_nativeIn_sweepETH.snap | 1 - .../V4Router_ExactOutputSingle_nativeOut.snap | 1 - .../positionDescriptor bytecode size.snap | 1 - .gitmodules | 3 + lib/forge-std | 1 + remappings.txt | 4 +- snapshots/BaseActionsRouterTest.json | 3 + snapshots/PaymentsTests.json | 6 ++ snapshots/PosMGasTest.json | 41 ++++++++++ snapshots/PositionDescriptorTest.json | 3 + snapshots/QuoterTest.json | 15 ++++ snapshots/StateViewTest.json | 12 +++ snapshots/V4RouterTest.json | 26 ++++++ test/BaseActionsRouter.t.sol | 5 +- test/DeltaResolver.t.sol | 3 +- test/PositionDescriptor.t.sol | 5 +- test/Quoter.t.sol | 29 ++++--- test/StateViewTest.t.sol | 23 +++--- .../PositionManager.gas.t.sol | 81 +++++++++---------- .../PositionManager.notifier.t.sol | 3 +- test/router/Payments.gas.t.sol | 11 ++- test/router/Payments.t.sol | 3 +- test/router/V4Router.gas.t.sol | 51 ++++++------ 112 files changed, 213 insertions(+), 207 deletions(-) delete mode 100644 .forge-snapshots/BaseActionsRouter_mock10commands.snap delete mode 100644 .forge-snapshots/Payments_swap_settleFromCaller_takeAllToMsgSender.snap delete mode 100644 .forge-snapshots/Payments_swap_settleFromCaller_takeAllToSpecifiedAddress.snap delete mode 100644 .forge-snapshots/Payments_swap_settleWithBalance_takeAllToMsgSender.snap delete mode 100644 .forge-snapshots/Payments_swap_settleWithBalance_takeAllToSpecifiedAddress.snap delete mode 100644 .forge-snapshots/PositionManager_burn_empty.snap delete mode 100644 .forge-snapshots/PositionManager_burn_empty_native.snap delete mode 100644 .forge-snapshots/PositionManager_burn_nonEmpty_native_withClose.snap delete mode 100644 .forge-snapshots/PositionManager_burn_nonEmpty_native_withTakePair.snap delete mode 100644 .forge-snapshots/PositionManager_burn_nonEmpty_withClose.snap delete mode 100644 .forge-snapshots/PositionManager_burn_nonEmpty_withTakePair.snap delete mode 100644 .forge-snapshots/PositionManager_collect_native.snap delete mode 100644 .forge-snapshots/PositionManager_collect_sameRange.snap delete mode 100644 .forge-snapshots/PositionManager_collect_withClose.snap delete mode 100644 .forge-snapshots/PositionManager_collect_withTakePair.snap delete mode 100644 .forge-snapshots/PositionManager_decreaseLiquidity_native.snap delete mode 100644 .forge-snapshots/PositionManager_decreaseLiquidity_withClose.snap delete mode 100644 .forge-snapshots/PositionManager_decreaseLiquidity_withTakePair.snap delete mode 100644 .forge-snapshots/PositionManager_decrease_burnEmpty.snap delete mode 100644 .forge-snapshots/PositionManager_decrease_burnEmpty_native.snap delete mode 100644 .forge-snapshots/PositionManager_decrease_sameRange_allLiquidity.snap delete mode 100644 .forge-snapshots/PositionManager_decrease_take_take.snap delete mode 100644 .forge-snapshots/PositionManager_increaseLiquidity_erc20_withClose.snap delete mode 100644 .forge-snapshots/PositionManager_increaseLiquidity_erc20_withSettlePair.snap delete mode 100644 .forge-snapshots/PositionManager_increaseLiquidity_native.snap delete mode 100644 .forge-snapshots/PositionManager_increase_autocompoundExactUnclaimedFees.snap delete mode 100644 .forge-snapshots/PositionManager_increase_autocompoundExcessFeesCredit.snap delete mode 100644 .forge-snapshots/PositionManager_increase_autocompound_clearExcess.snap delete mode 100644 .forge-snapshots/PositionManager_mint_native.snap delete mode 100644 .forge-snapshots/PositionManager_mint_nativeWithSweep_withClose.snap delete mode 100644 .forge-snapshots/PositionManager_mint_nativeWithSweep_withSettlePair.snap delete mode 100644 .forge-snapshots/PositionManager_mint_onSameTickLower.snap delete mode 100644 .forge-snapshots/PositionManager_mint_onSameTickUpper.snap delete mode 100644 .forge-snapshots/PositionManager_mint_sameRange.snap delete mode 100644 .forge-snapshots/PositionManager_mint_settleWithBalance_sweep.snap delete mode 100644 .forge-snapshots/PositionManager_mint_warmedPool_differentRange.snap delete mode 100644 .forge-snapshots/PositionManager_mint_withClose.snap delete mode 100644 .forge-snapshots/PositionManager_mint_withSettlePair.snap delete mode 100644 .forge-snapshots/PositionManager_multicall_initialize_mint.snap delete mode 100644 .forge-snapshots/PositionManager_permit.snap delete mode 100644 .forge-snapshots/PositionManager_permit_secondPosition.snap delete mode 100644 .forge-snapshots/PositionManager_permit_twice.snap delete mode 100644 .forge-snapshots/PositionManager_subscribe.snap delete mode 100644 .forge-snapshots/PositionManager_unsubscribe.snap delete mode 100644 .forge-snapshots/Quoter_exactInputSingle_oneForZero_multiplePositions.snap delete mode 100644 .forge-snapshots/Quoter_exactInputSingle_zeroForOne_multiplePositions.snap delete mode 100644 .forge-snapshots/Quoter_exactOutputSingle_oneForZero.snap delete mode 100644 .forge-snapshots/Quoter_exactOutputSingle_zeroForOne.snap delete mode 100644 .forge-snapshots/Quoter_quoteExactInput_oneHop_1TickLoaded.snap delete mode 100644 .forge-snapshots/Quoter_quoteExactInput_oneHop_initializedAfter.snap delete mode 100644 .forge-snapshots/Quoter_quoteExactInput_oneHop_startingInitialized.snap delete mode 100644 .forge-snapshots/Quoter_quoteExactInput_twoHops.snap delete mode 100644 .forge-snapshots/Quoter_quoteExactOutput_oneHop_1TickLoaded.snap delete mode 100644 .forge-snapshots/Quoter_quoteExactOutput_oneHop_2TicksLoaded.snap delete mode 100644 .forge-snapshots/Quoter_quoteExactOutput_oneHop_initializedAfter.snap delete mode 100644 .forge-snapshots/Quoter_quoteExactOutput_oneHop_startingInitialized.snap delete mode 100644 .forge-snapshots/Quoter_quoteExactOutput_twoHops.snap delete mode 100644 .forge-snapshots/StateView_extsload_getFeeGrowthGlobals.snap delete mode 100644 .forge-snapshots/StateView_extsload_getFeeGrowthInside.snap delete mode 100644 .forge-snapshots/StateView_extsload_getLiquidity.snap delete mode 100644 .forge-snapshots/StateView_extsload_getPositionInfo.snap delete mode 100644 .forge-snapshots/StateView_extsload_getPositionLiquidity.snap delete mode 100644 .forge-snapshots/StateView_extsload_getSlot0.snap delete mode 100644 .forge-snapshots/StateView_extsload_getTickBitmap.snap delete mode 100644 .forge-snapshots/StateView_extsload_getTickFeeGrowthOutside.snap delete mode 100644 .forge-snapshots/StateView_extsload_getTickInfo.snap delete mode 100644 .forge-snapshots/StateView_extsload_getTickLiquidity.snap delete mode 100644 .forge-snapshots/V4Router_Bytecode.snap delete mode 100644 .forge-snapshots/V4Router_ExactIn1Hop_nativeIn.snap delete mode 100644 .forge-snapshots/V4Router_ExactIn1Hop_nativeOut.snap delete mode 100644 .forge-snapshots/V4Router_ExactIn1Hop_oneForZero.snap delete mode 100644 .forge-snapshots/V4Router_ExactIn1Hop_zeroForOne.snap delete mode 100644 .forge-snapshots/V4Router_ExactIn2Hops.snap delete mode 100644 .forge-snapshots/V4Router_ExactIn2Hops_nativeIn.snap delete mode 100644 .forge-snapshots/V4Router_ExactIn3Hops.snap delete mode 100644 .forge-snapshots/V4Router_ExactIn3Hops_nativeIn.snap delete mode 100644 .forge-snapshots/V4Router_ExactInputSingle.snap delete mode 100644 .forge-snapshots/V4Router_ExactInputSingle_nativeIn.snap delete mode 100644 .forge-snapshots/V4Router_ExactInputSingle_nativeOut.snap delete mode 100644 .forge-snapshots/V4Router_ExactOut1Hop_nativeIn_sweepETH.snap delete mode 100644 .forge-snapshots/V4Router_ExactOut1Hop_nativeOut.snap delete mode 100644 .forge-snapshots/V4Router_ExactOut1Hop_oneForZero.snap delete mode 100644 .forge-snapshots/V4Router_ExactOut1Hop_zeroForOne.snap delete mode 100644 .forge-snapshots/V4Router_ExactOut2Hops.snap delete mode 100644 .forge-snapshots/V4Router_ExactOut2Hops_nativeIn.snap delete mode 100644 .forge-snapshots/V4Router_ExactOut3Hops.snap delete mode 100644 .forge-snapshots/V4Router_ExactOut3Hops_nativeIn.snap delete mode 100644 .forge-snapshots/V4Router_ExactOut3Hops_nativeOut.snap delete mode 100644 .forge-snapshots/V4Router_ExactOutputSingle.snap delete mode 100644 .forge-snapshots/V4Router_ExactOutputSingle_nativeIn_sweepETH.snap delete mode 100644 .forge-snapshots/V4Router_ExactOutputSingle_nativeOut.snap delete mode 100644 .forge-snapshots/positionDescriptor bytecode size.snap create mode 160000 lib/forge-std create mode 100644 snapshots/BaseActionsRouterTest.json create mode 100644 snapshots/PaymentsTests.json create mode 100644 snapshots/PosMGasTest.json create mode 100644 snapshots/PositionDescriptorTest.json create mode 100644 snapshots/QuoterTest.json create mode 100644 snapshots/StateViewTest.json create mode 100644 snapshots/V4RouterTest.json diff --git a/.forge-snapshots/BaseActionsRouter_mock10commands.snap b/.forge-snapshots/BaseActionsRouter_mock10commands.snap deleted file mode 100644 index 8a065fc31..000000000 --- a/.forge-snapshots/BaseActionsRouter_mock10commands.snap +++ /dev/null @@ -1 +0,0 @@ -60677 \ No newline at end of file diff --git a/.forge-snapshots/Payments_swap_settleFromCaller_takeAllToMsgSender.snap b/.forge-snapshots/Payments_swap_settleFromCaller_takeAllToMsgSender.snap deleted file mode 100644 index 63e482c1a..000000000 --- a/.forge-snapshots/Payments_swap_settleFromCaller_takeAllToMsgSender.snap +++ /dev/null @@ -1 +0,0 @@ -129601 \ No newline at end of file diff --git a/.forge-snapshots/Payments_swap_settleFromCaller_takeAllToSpecifiedAddress.snap b/.forge-snapshots/Payments_swap_settleFromCaller_takeAllToSpecifiedAddress.snap deleted file mode 100644 index 1be91a8be..000000000 --- a/.forge-snapshots/Payments_swap_settleFromCaller_takeAllToSpecifiedAddress.snap +++ /dev/null @@ -1 +0,0 @@ -131664 \ No newline at end of file diff --git a/.forge-snapshots/Payments_swap_settleWithBalance_takeAllToMsgSender.snap b/.forge-snapshots/Payments_swap_settleWithBalance_takeAllToMsgSender.snap deleted file mode 100644 index e3d47b59c..000000000 --- a/.forge-snapshots/Payments_swap_settleWithBalance_takeAllToMsgSender.snap +++ /dev/null @@ -1 +0,0 @@ -123869 \ No newline at end of file diff --git a/.forge-snapshots/Payments_swap_settleWithBalance_takeAllToSpecifiedAddress.snap b/.forge-snapshots/Payments_swap_settleWithBalance_takeAllToSpecifiedAddress.snap deleted file mode 100644 index e8e1e8fae..000000000 --- a/.forge-snapshots/Payments_swap_settleWithBalance_takeAllToSpecifiedAddress.snap +++ /dev/null @@ -1 +0,0 @@ -124011 \ No newline at end of file diff --git a/.forge-snapshots/PositionManager_burn_empty.snap b/.forge-snapshots/PositionManager_burn_empty.snap deleted file mode 100644 index 0e85ca4a1..000000000 --- a/.forge-snapshots/PositionManager_burn_empty.snap +++ /dev/null @@ -1 +0,0 @@ -50446 \ No newline at end of file diff --git a/.forge-snapshots/PositionManager_burn_empty_native.snap b/.forge-snapshots/PositionManager_burn_empty_native.snap deleted file mode 100644 index 0e85ca4a1..000000000 --- a/.forge-snapshots/PositionManager_burn_empty_native.snap +++ /dev/null @@ -1 +0,0 @@ -50446 \ No newline at end of file diff --git a/.forge-snapshots/PositionManager_burn_nonEmpty_native_withClose.snap b/.forge-snapshots/PositionManager_burn_nonEmpty_native_withClose.snap deleted file mode 100644 index 9e62ab4df..000000000 --- a/.forge-snapshots/PositionManager_burn_nonEmpty_native_withClose.snap +++ /dev/null @@ -1 +0,0 @@ -125584 \ No newline at end of file diff --git a/.forge-snapshots/PositionManager_burn_nonEmpty_native_withTakePair.snap b/.forge-snapshots/PositionManager_burn_nonEmpty_native_withTakePair.snap deleted file mode 100644 index 33aa7739e..000000000 --- a/.forge-snapshots/PositionManager_burn_nonEmpty_native_withTakePair.snap +++ /dev/null @@ -1 +0,0 @@ -125031 \ No newline at end of file diff --git a/.forge-snapshots/PositionManager_burn_nonEmpty_withClose.snap b/.forge-snapshots/PositionManager_burn_nonEmpty_withClose.snap deleted file mode 100644 index 6a3bb39f1..000000000 --- a/.forge-snapshots/PositionManager_burn_nonEmpty_withClose.snap +++ /dev/null @@ -1 +0,0 @@ -132446 \ No newline at end of file diff --git a/.forge-snapshots/PositionManager_burn_nonEmpty_withTakePair.snap b/.forge-snapshots/PositionManager_burn_nonEmpty_withTakePair.snap deleted file mode 100644 index 62abe7a17..000000000 --- a/.forge-snapshots/PositionManager_burn_nonEmpty_withTakePair.snap +++ /dev/null @@ -1 +0,0 @@ -131893 \ No newline at end of file diff --git a/.forge-snapshots/PositionManager_collect_native.snap b/.forge-snapshots/PositionManager_collect_native.snap deleted file mode 100644 index 83e0e3d6d..000000000 --- a/.forge-snapshots/PositionManager_collect_native.snap +++ /dev/null @@ -1 +0,0 @@ -146294 \ No newline at end of file diff --git a/.forge-snapshots/PositionManager_collect_sameRange.snap b/.forge-snapshots/PositionManager_collect_sameRange.snap deleted file mode 100644 index ab27c01ba..000000000 --- a/.forge-snapshots/PositionManager_collect_sameRange.snap +++ /dev/null @@ -1 +0,0 @@ -154872 \ No newline at end of file diff --git a/.forge-snapshots/PositionManager_collect_withClose.snap b/.forge-snapshots/PositionManager_collect_withClose.snap deleted file mode 100644 index ab27c01ba..000000000 --- a/.forge-snapshots/PositionManager_collect_withClose.snap +++ /dev/null @@ -1 +0,0 @@ -154872 \ No newline at end of file diff --git a/.forge-snapshots/PositionManager_collect_withTakePair.snap b/.forge-snapshots/PositionManager_collect_withTakePair.snap deleted file mode 100644 index 47b66e440..000000000 --- a/.forge-snapshots/PositionManager_collect_withTakePair.snap +++ /dev/null @@ -1 +0,0 @@ -154193 \ No newline at end of file diff --git a/.forge-snapshots/PositionManager_decreaseLiquidity_native.snap b/.forge-snapshots/PositionManager_decreaseLiquidity_native.snap deleted file mode 100644 index e13e87a38..000000000 --- a/.forge-snapshots/PositionManager_decreaseLiquidity_native.snap +++ /dev/null @@ -1 +0,0 @@ -111980 \ No newline at end of file diff --git a/.forge-snapshots/PositionManager_decreaseLiquidity_withClose.snap b/.forge-snapshots/PositionManager_decreaseLiquidity_withClose.snap deleted file mode 100644 index f5f1f8b29..000000000 --- a/.forge-snapshots/PositionManager_decreaseLiquidity_withClose.snap +++ /dev/null @@ -1 +0,0 @@ -119753 \ No newline at end of file diff --git a/.forge-snapshots/PositionManager_decreaseLiquidity_withTakePair.snap b/.forge-snapshots/PositionManager_decreaseLiquidity_withTakePair.snap deleted file mode 100644 index e4b3cfdee..000000000 --- a/.forge-snapshots/PositionManager_decreaseLiquidity_withTakePair.snap +++ /dev/null @@ -1 +0,0 @@ -119074 \ No newline at end of file diff --git a/.forge-snapshots/PositionManager_decrease_burnEmpty.snap b/.forge-snapshots/PositionManager_decrease_burnEmpty.snap deleted file mode 100644 index 31c3a99ce..000000000 --- a/.forge-snapshots/PositionManager_decrease_burnEmpty.snap +++ /dev/null @@ -1 +0,0 @@ -135243 \ No newline at end of file diff --git a/.forge-snapshots/PositionManager_decrease_burnEmpty_native.snap b/.forge-snapshots/PositionManager_decrease_burnEmpty_native.snap deleted file mode 100644 index 5cbd7cccc..000000000 --- a/.forge-snapshots/PositionManager_decrease_burnEmpty_native.snap +++ /dev/null @@ -1 +0,0 @@ -128380 \ No newline at end of file diff --git a/.forge-snapshots/PositionManager_decrease_sameRange_allLiquidity.snap b/.forge-snapshots/PositionManager_decrease_sameRange_allLiquidity.snap deleted file mode 100644 index af29b36e3..000000000 --- a/.forge-snapshots/PositionManager_decrease_sameRange_allLiquidity.snap +++ /dev/null @@ -1 +0,0 @@ -132440 \ No newline at end of file diff --git a/.forge-snapshots/PositionManager_decrease_take_take.snap b/.forge-snapshots/PositionManager_decrease_take_take.snap deleted file mode 100644 index 9497d424d..000000000 --- a/.forge-snapshots/PositionManager_decrease_take_take.snap +++ /dev/null @@ -1 +0,0 @@ -120329 \ No newline at end of file diff --git a/.forge-snapshots/PositionManager_increaseLiquidity_erc20_withClose.snap b/.forge-snapshots/PositionManager_increaseLiquidity_erc20_withClose.snap deleted file mode 100644 index df7539ba9..000000000 --- a/.forge-snapshots/PositionManager_increaseLiquidity_erc20_withClose.snap +++ /dev/null @@ -1 +0,0 @@ -159057 \ No newline at end of file diff --git a/.forge-snapshots/PositionManager_increaseLiquidity_erc20_withSettlePair.snap b/.forge-snapshots/PositionManager_increaseLiquidity_erc20_withSettlePair.snap deleted file mode 100644 index d62921d36..000000000 --- a/.forge-snapshots/PositionManager_increaseLiquidity_erc20_withSettlePair.snap +++ /dev/null @@ -1 +0,0 @@ -157997 \ No newline at end of file diff --git a/.forge-snapshots/PositionManager_increaseLiquidity_native.snap b/.forge-snapshots/PositionManager_increaseLiquidity_native.snap deleted file mode 100644 index 5224273f7..000000000 --- a/.forge-snapshots/PositionManager_increaseLiquidity_native.snap +++ /dev/null @@ -1 +0,0 @@ -140872 \ No newline at end of file diff --git a/.forge-snapshots/PositionManager_increase_autocompoundExactUnclaimedFees.snap b/.forge-snapshots/PositionManager_increase_autocompoundExactUnclaimedFees.snap deleted file mode 100644 index 770899b46..000000000 --- a/.forge-snapshots/PositionManager_increase_autocompoundExactUnclaimedFees.snap +++ /dev/null @@ -1 +0,0 @@ -136359 \ No newline at end of file diff --git a/.forge-snapshots/PositionManager_increase_autocompoundExcessFeesCredit.snap b/.forge-snapshots/PositionManager_increase_autocompoundExcessFeesCredit.snap deleted file mode 100644 index d9726ba2c..000000000 --- a/.forge-snapshots/PositionManager_increase_autocompoundExcessFeesCredit.snap +++ /dev/null @@ -1 +0,0 @@ -177364 \ No newline at end of file diff --git a/.forge-snapshots/PositionManager_increase_autocompound_clearExcess.snap b/.forge-snapshots/PositionManager_increase_autocompound_clearExcess.snap deleted file mode 100644 index 21e55c88e..000000000 --- a/.forge-snapshots/PositionManager_increase_autocompound_clearExcess.snap +++ /dev/null @@ -1 +0,0 @@ -148040 \ No newline at end of file diff --git a/.forge-snapshots/PositionManager_mint_native.snap b/.forge-snapshots/PositionManager_mint_native.snap deleted file mode 100644 index 742cc68e6..000000000 --- a/.forge-snapshots/PositionManager_mint_native.snap +++ /dev/null @@ -1 +0,0 @@ -364745 \ No newline at end of file diff --git a/.forge-snapshots/PositionManager_mint_nativeWithSweep_withClose.snap b/.forge-snapshots/PositionManager_mint_nativeWithSweep_withClose.snap deleted file mode 100644 index 7c56236a2..000000000 --- a/.forge-snapshots/PositionManager_mint_nativeWithSweep_withClose.snap +++ /dev/null @@ -1 +0,0 @@ -373268 \ No newline at end of file diff --git a/.forge-snapshots/PositionManager_mint_nativeWithSweep_withSettlePair.snap b/.forge-snapshots/PositionManager_mint_nativeWithSweep_withSettlePair.snap deleted file mode 100644 index 822d688b2..000000000 --- a/.forge-snapshots/PositionManager_mint_nativeWithSweep_withSettlePair.snap +++ /dev/null @@ -1 +0,0 @@ -372491 \ No newline at end of file diff --git a/.forge-snapshots/PositionManager_mint_onSameTickLower.snap b/.forge-snapshots/PositionManager_mint_onSameTickLower.snap deleted file mode 100644 index ccfdb51fc..000000000 --- a/.forge-snapshots/PositionManager_mint_onSameTickLower.snap +++ /dev/null @@ -1 +0,0 @@ -317617 \ No newline at end of file diff --git a/.forge-snapshots/PositionManager_mint_onSameTickUpper.snap b/.forge-snapshots/PositionManager_mint_onSameTickUpper.snap deleted file mode 100644 index 9f9a6b773..000000000 --- a/.forge-snapshots/PositionManager_mint_onSameTickUpper.snap +++ /dev/null @@ -1 +0,0 @@ -318287 \ No newline at end of file diff --git a/.forge-snapshots/PositionManager_mint_sameRange.snap b/.forge-snapshots/PositionManager_mint_sameRange.snap deleted file mode 100644 index ccc454ddc..000000000 --- a/.forge-snapshots/PositionManager_mint_sameRange.snap +++ /dev/null @@ -1 +0,0 @@ -243856 \ No newline at end of file diff --git a/.forge-snapshots/PositionManager_mint_settleWithBalance_sweep.snap b/.forge-snapshots/PositionManager_mint_settleWithBalance_sweep.snap deleted file mode 100644 index 23648cc90..000000000 --- a/.forge-snapshots/PositionManager_mint_settleWithBalance_sweep.snap +++ /dev/null @@ -1 +0,0 @@ -419060 \ No newline at end of file diff --git a/.forge-snapshots/PositionManager_mint_warmedPool_differentRange.snap b/.forge-snapshots/PositionManager_mint_warmedPool_differentRange.snap deleted file mode 100644 index cedd06147..000000000 --- a/.forge-snapshots/PositionManager_mint_warmedPool_differentRange.snap +++ /dev/null @@ -1 +0,0 @@ -323648 \ No newline at end of file diff --git a/.forge-snapshots/PositionManager_mint_withClose.snap b/.forge-snapshots/PositionManager_mint_withClose.snap deleted file mode 100644 index cf0292c96..000000000 --- a/.forge-snapshots/PositionManager_mint_withClose.snap +++ /dev/null @@ -1 +0,0 @@ -420170 \ No newline at end of file diff --git a/.forge-snapshots/PositionManager_mint_withSettlePair.snap b/.forge-snapshots/PositionManager_mint_withSettlePair.snap deleted file mode 100644 index 549b6841d..000000000 --- a/.forge-snapshots/PositionManager_mint_withSettlePair.snap +++ /dev/null @@ -1 +0,0 @@ -419228 \ No newline at end of file diff --git a/.forge-snapshots/PositionManager_multicall_initialize_mint.snap b/.forge-snapshots/PositionManager_multicall_initialize_mint.snap deleted file mode 100644 index b51b3f660..000000000 --- a/.forge-snapshots/PositionManager_multicall_initialize_mint.snap +++ /dev/null @@ -1 +0,0 @@ -455975 \ No newline at end of file diff --git a/.forge-snapshots/PositionManager_permit.snap b/.forge-snapshots/PositionManager_permit.snap deleted file mode 100644 index 227e327e4..000000000 --- a/.forge-snapshots/PositionManager_permit.snap +++ /dev/null @@ -1 +0,0 @@ -79076 \ No newline at end of file diff --git a/.forge-snapshots/PositionManager_permit_secondPosition.snap b/.forge-snapshots/PositionManager_permit_secondPosition.snap deleted file mode 100644 index 31ad61876..000000000 --- a/.forge-snapshots/PositionManager_permit_secondPosition.snap +++ /dev/null @@ -1 +0,0 @@ -61976 \ No newline at end of file diff --git a/.forge-snapshots/PositionManager_permit_twice.snap b/.forge-snapshots/PositionManager_permit_twice.snap deleted file mode 100644 index 379f96111..000000000 --- a/.forge-snapshots/PositionManager_permit_twice.snap +++ /dev/null @@ -1 +0,0 @@ -44852 \ No newline at end of file diff --git a/.forge-snapshots/PositionManager_subscribe.snap b/.forge-snapshots/PositionManager_subscribe.snap deleted file mode 100644 index e4eada758..000000000 --- a/.forge-snapshots/PositionManager_subscribe.snap +++ /dev/null @@ -1 +0,0 @@ -84348 \ No newline at end of file diff --git a/.forge-snapshots/PositionManager_unsubscribe.snap b/.forge-snapshots/PositionManager_unsubscribe.snap deleted file mode 100644 index 0151c604d..000000000 --- a/.forge-snapshots/PositionManager_unsubscribe.snap +++ /dev/null @@ -1 +0,0 @@ -59238 \ No newline at end of file diff --git a/.forge-snapshots/Quoter_exactInputSingle_oneForZero_multiplePositions.snap b/.forge-snapshots/Quoter_exactInputSingle_oneForZero_multiplePositions.snap deleted file mode 100644 index 485e8f0d7..000000000 --- a/.forge-snapshots/Quoter_exactInputSingle_oneForZero_multiplePositions.snap +++ /dev/null @@ -1 +0,0 @@ -143930 \ No newline at end of file diff --git a/.forge-snapshots/Quoter_exactInputSingle_zeroForOne_multiplePositions.snap b/.forge-snapshots/Quoter_exactInputSingle_zeroForOne_multiplePositions.snap deleted file mode 100644 index f89390d96..000000000 --- a/.forge-snapshots/Quoter_exactInputSingle_zeroForOne_multiplePositions.snap +++ /dev/null @@ -1 +0,0 @@ -149382 \ No newline at end of file diff --git a/.forge-snapshots/Quoter_exactOutputSingle_oneForZero.snap b/.forge-snapshots/Quoter_exactOutputSingle_oneForZero.snap deleted file mode 100644 index a40f3f57a..000000000 --- a/.forge-snapshots/Quoter_exactOutputSingle_oneForZero.snap +++ /dev/null @@ -1 +0,0 @@ -78203 \ No newline at end of file diff --git a/.forge-snapshots/Quoter_exactOutputSingle_zeroForOne.snap b/.forge-snapshots/Quoter_exactOutputSingle_zeroForOne.snap deleted file mode 100644 index 23153115b..000000000 --- a/.forge-snapshots/Quoter_exactOutputSingle_zeroForOne.snap +++ /dev/null @@ -1 +0,0 @@ -82626 \ No newline at end of file diff --git a/.forge-snapshots/Quoter_quoteExactInput_oneHop_1TickLoaded.snap b/.forge-snapshots/Quoter_quoteExactInput_oneHop_1TickLoaded.snap deleted file mode 100644 index a3ea8ad76..000000000 --- a/.forge-snapshots/Quoter_quoteExactInput_oneHop_1TickLoaded.snap +++ /dev/null @@ -1 +0,0 @@ -120491 \ No newline at end of file diff --git a/.forge-snapshots/Quoter_quoteExactInput_oneHop_initializedAfter.snap b/.forge-snapshots/Quoter_quoteExactInput_oneHop_initializedAfter.snap deleted file mode 100644 index 6dcb3b78d..000000000 --- a/.forge-snapshots/Quoter_quoteExactInput_oneHop_initializedAfter.snap +++ /dev/null @@ -1 +0,0 @@ -145414 \ No newline at end of file diff --git a/.forge-snapshots/Quoter_quoteExactInput_oneHop_startingInitialized.snap b/.forge-snapshots/Quoter_quoteExactInput_oneHop_startingInitialized.snap deleted file mode 100644 index 1f604e115..000000000 --- a/.forge-snapshots/Quoter_quoteExactInput_oneHop_startingInitialized.snap +++ /dev/null @@ -1 +0,0 @@ -79437 \ No newline at end of file diff --git a/.forge-snapshots/Quoter_quoteExactInput_twoHops.snap b/.forge-snapshots/Quoter_quoteExactInput_twoHops.snap deleted file mode 100644 index bb203fa98..000000000 --- a/.forge-snapshots/Quoter_quoteExactInput_twoHops.snap +++ /dev/null @@ -1 +0,0 @@ -201179 \ No newline at end of file diff --git a/.forge-snapshots/Quoter_quoteExactOutput_oneHop_1TickLoaded.snap b/.forge-snapshots/Quoter_quoteExactOutput_oneHop_1TickLoaded.snap deleted file mode 100644 index e7385875b..000000000 --- a/.forge-snapshots/Quoter_quoteExactOutput_oneHop_1TickLoaded.snap +++ /dev/null @@ -1 +0,0 @@ -119782 \ No newline at end of file diff --git a/.forge-snapshots/Quoter_quoteExactOutput_oneHop_2TicksLoaded.snap b/.forge-snapshots/Quoter_quoteExactOutput_oneHop_2TicksLoaded.snap deleted file mode 100644 index 14b51340c..000000000 --- a/.forge-snapshots/Quoter_quoteExactOutput_oneHop_2TicksLoaded.snap +++ /dev/null @@ -1 +0,0 @@ -149919 \ No newline at end of file diff --git a/.forge-snapshots/Quoter_quoteExactOutput_oneHop_initializedAfter.snap b/.forge-snapshots/Quoter_quoteExactOutput_oneHop_initializedAfter.snap deleted file mode 100644 index c19a0a13c..000000000 --- a/.forge-snapshots/Quoter_quoteExactOutput_oneHop_initializedAfter.snap +++ /dev/null @@ -1 +0,0 @@ -119850 \ No newline at end of file diff --git a/.forge-snapshots/Quoter_quoteExactOutput_oneHop_startingInitialized.snap b/.forge-snapshots/Quoter_quoteExactOutput_oneHop_startingInitialized.snap deleted file mode 100644 index c0333d8aa..000000000 --- a/.forge-snapshots/Quoter_quoteExactOutput_oneHop_startingInitialized.snap +++ /dev/null @@ -1 +0,0 @@ -96549 \ No newline at end of file diff --git a/.forge-snapshots/Quoter_quoteExactOutput_twoHops.snap b/.forge-snapshots/Quoter_quoteExactOutput_twoHops.snap deleted file mode 100644 index 7acf5efcd..000000000 --- a/.forge-snapshots/Quoter_quoteExactOutput_twoHops.snap +++ /dev/null @@ -1 +0,0 @@ -200630 \ No newline at end of file diff --git a/.forge-snapshots/StateView_extsload_getFeeGrowthGlobals.snap b/.forge-snapshots/StateView_extsload_getFeeGrowthGlobals.snap deleted file mode 100644 index 98665bfc6..000000000 --- a/.forge-snapshots/StateView_extsload_getFeeGrowthGlobals.snap +++ /dev/null @@ -1 +0,0 @@ -2259 \ No newline at end of file diff --git a/.forge-snapshots/StateView_extsload_getFeeGrowthInside.snap b/.forge-snapshots/StateView_extsload_getFeeGrowthInside.snap deleted file mode 100644 index 7db58ace5..000000000 --- a/.forge-snapshots/StateView_extsload_getFeeGrowthInside.snap +++ /dev/null @@ -1 +0,0 @@ -8003 \ No newline at end of file diff --git a/.forge-snapshots/StateView_extsload_getLiquidity.snap b/.forge-snapshots/StateView_extsload_getLiquidity.snap deleted file mode 100644 index a900d0b24..000000000 --- a/.forge-snapshots/StateView_extsload_getLiquidity.snap +++ /dev/null @@ -1 +0,0 @@ -1399 \ No newline at end of file diff --git a/.forge-snapshots/StateView_extsload_getPositionInfo.snap b/.forge-snapshots/StateView_extsload_getPositionInfo.snap deleted file mode 100644 index 4b9661fc9..000000000 --- a/.forge-snapshots/StateView_extsload_getPositionInfo.snap +++ /dev/null @@ -1 +0,0 @@ -2829 \ No newline at end of file diff --git a/.forge-snapshots/StateView_extsload_getPositionLiquidity.snap b/.forge-snapshots/StateView_extsload_getPositionLiquidity.snap deleted file mode 100644 index 7f3589da4..000000000 --- a/.forge-snapshots/StateView_extsload_getPositionLiquidity.snap +++ /dev/null @@ -1 +0,0 @@ -1651 \ No newline at end of file diff --git a/.forge-snapshots/StateView_extsload_getSlot0.snap b/.forge-snapshots/StateView_extsload_getSlot0.snap deleted file mode 100644 index 585cf67a0..000000000 --- a/.forge-snapshots/StateView_extsload_getSlot0.snap +++ /dev/null @@ -1 +0,0 @@ -1446 \ No newline at end of file diff --git a/.forge-snapshots/StateView_extsload_getTickBitmap.snap b/.forge-snapshots/StateView_extsload_getTickBitmap.snap deleted file mode 100644 index 05fd8282c..000000000 --- a/.forge-snapshots/StateView_extsload_getTickBitmap.snap +++ /dev/null @@ -1 +0,0 @@ -1392 \ No newline at end of file diff --git a/.forge-snapshots/StateView_extsload_getTickFeeGrowthOutside.snap b/.forge-snapshots/StateView_extsload_getTickFeeGrowthOutside.snap deleted file mode 100644 index 6870d0f23..000000000 --- a/.forge-snapshots/StateView_extsload_getTickFeeGrowthOutside.snap +++ /dev/null @@ -1 +0,0 @@ -2546 \ No newline at end of file diff --git a/.forge-snapshots/StateView_extsload_getTickInfo.snap b/.forge-snapshots/StateView_extsload_getTickInfo.snap deleted file mode 100644 index cd5ecabca..000000000 --- a/.forge-snapshots/StateView_extsload_getTickInfo.snap +++ /dev/null @@ -1 +0,0 @@ -2761 \ No newline at end of file diff --git a/.forge-snapshots/StateView_extsload_getTickLiquidity.snap b/.forge-snapshots/StateView_extsload_getTickLiquidity.snap deleted file mode 100644 index 44e788259..000000000 --- a/.forge-snapshots/StateView_extsload_getTickLiquidity.snap +++ /dev/null @@ -1 +0,0 @@ -1646 \ No newline at end of file diff --git a/.forge-snapshots/V4Router_Bytecode.snap b/.forge-snapshots/V4Router_Bytecode.snap deleted file mode 100644 index 0528d9874..000000000 --- a/.forge-snapshots/V4Router_Bytecode.snap +++ /dev/null @@ -1 +0,0 @@ -7037 \ No newline at end of file diff --git a/.forge-snapshots/V4Router_ExactIn1Hop_nativeIn.snap b/.forge-snapshots/V4Router_ExactIn1Hop_nativeIn.snap deleted file mode 100644 index 2a724576f..000000000 --- a/.forge-snapshots/V4Router_ExactIn1Hop_nativeIn.snap +++ /dev/null @@ -1 +0,0 @@ -115708 \ No newline at end of file diff --git a/.forge-snapshots/V4Router_ExactIn1Hop_nativeOut.snap b/.forge-snapshots/V4Router_ExactIn1Hop_nativeOut.snap deleted file mode 100644 index 3afc230ee..000000000 --- a/.forge-snapshots/V4Router_ExactIn1Hop_nativeOut.snap +++ /dev/null @@ -1 +0,0 @@ -116029 \ No newline at end of file diff --git a/.forge-snapshots/V4Router_ExactIn1Hop_oneForZero.snap b/.forge-snapshots/V4Router_ExactIn1Hop_oneForZero.snap deleted file mode 100644 index 94d611dee..000000000 --- a/.forge-snapshots/V4Router_ExactIn1Hop_oneForZero.snap +++ /dev/null @@ -1 +0,0 @@ -124847 \ No newline at end of file diff --git a/.forge-snapshots/V4Router_ExactIn1Hop_zeroForOne.snap b/.forge-snapshots/V4Router_ExactIn1Hop_zeroForOne.snap deleted file mode 100644 index 01a3e91e0..000000000 --- a/.forge-snapshots/V4Router_ExactIn1Hop_zeroForOne.snap +++ /dev/null @@ -1 +0,0 @@ -130570 \ No newline at end of file diff --git a/.forge-snapshots/V4Router_ExactIn2Hops.snap b/.forge-snapshots/V4Router_ExactIn2Hops.snap deleted file mode 100644 index 9620022fb..000000000 --- a/.forge-snapshots/V4Router_ExactIn2Hops.snap +++ /dev/null @@ -1 +0,0 @@ -185411 \ No newline at end of file diff --git a/.forge-snapshots/V4Router_ExactIn2Hops_nativeIn.snap b/.forge-snapshots/V4Router_ExactIn2Hops_nativeIn.snap deleted file mode 100644 index a7d527920..000000000 --- a/.forge-snapshots/V4Router_ExactIn2Hops_nativeIn.snap +++ /dev/null @@ -1 +0,0 @@ -170549 \ No newline at end of file diff --git a/.forge-snapshots/V4Router_ExactIn3Hops.snap b/.forge-snapshots/V4Router_ExactIn3Hops.snap deleted file mode 100644 index aecf0666e..000000000 --- a/.forge-snapshots/V4Router_ExactIn3Hops.snap +++ /dev/null @@ -1 +0,0 @@ -240255 \ No newline at end of file diff --git a/.forge-snapshots/V4Router_ExactIn3Hops_nativeIn.snap b/.forge-snapshots/V4Router_ExactIn3Hops_nativeIn.snap deleted file mode 100644 index 3ea0d0bf6..000000000 --- a/.forge-snapshots/V4Router_ExactIn3Hops_nativeIn.snap +++ /dev/null @@ -1 +0,0 @@ -225393 \ No newline at end of file diff --git a/.forge-snapshots/V4Router_ExactInputSingle.snap b/.forge-snapshots/V4Router_ExactInputSingle.snap deleted file mode 100644 index 63e482c1a..000000000 --- a/.forge-snapshots/V4Router_ExactInputSingle.snap +++ /dev/null @@ -1 +0,0 @@ -129601 \ No newline at end of file diff --git a/.forge-snapshots/V4Router_ExactInputSingle_nativeIn.snap b/.forge-snapshots/V4Router_ExactInputSingle_nativeIn.snap deleted file mode 100644 index d9151a237..000000000 --- a/.forge-snapshots/V4Router_ExactInputSingle_nativeIn.snap +++ /dev/null @@ -1 +0,0 @@ -114739 \ No newline at end of file diff --git a/.forge-snapshots/V4Router_ExactInputSingle_nativeOut.snap b/.forge-snapshots/V4Router_ExactInputSingle_nativeOut.snap deleted file mode 100644 index e039a25da..000000000 --- a/.forge-snapshots/V4Router_ExactInputSingle_nativeOut.snap +++ /dev/null @@ -1 +0,0 @@ -115028 \ No newline at end of file diff --git a/.forge-snapshots/V4Router_ExactOut1Hop_nativeIn_sweepETH.snap b/.forge-snapshots/V4Router_ExactOut1Hop_nativeIn_sweepETH.snap deleted file mode 100644 index 5e64389a5..000000000 --- a/.forge-snapshots/V4Router_ExactOut1Hop_nativeIn_sweepETH.snap +++ /dev/null @@ -1 +0,0 @@ -121971 \ No newline at end of file diff --git a/.forge-snapshots/V4Router_ExactOut1Hop_nativeOut.snap b/.forge-snapshots/V4Router_ExactOut1Hop_nativeOut.snap deleted file mode 100644 index 4e7b78af5..000000000 --- a/.forge-snapshots/V4Router_ExactOut1Hop_nativeOut.snap +++ /dev/null @@ -1 +0,0 @@ -117093 \ No newline at end of file diff --git a/.forge-snapshots/V4Router_ExactOut1Hop_oneForZero.snap b/.forge-snapshots/V4Router_ExactOut1Hop_oneForZero.snap deleted file mode 100644 index 59f0e6917..000000000 --- a/.forge-snapshots/V4Router_ExactOut1Hop_oneForZero.snap +++ /dev/null @@ -1 +0,0 @@ -125911 \ No newline at end of file diff --git a/.forge-snapshots/V4Router_ExactOut1Hop_zeroForOne.snap b/.forge-snapshots/V4Router_ExactOut1Hop_zeroForOne.snap deleted file mode 100644 index 5e7fe01cd..000000000 --- a/.forge-snapshots/V4Router_ExactOut1Hop_zeroForOne.snap +++ /dev/null @@ -1 +0,0 @@ -129856 \ No newline at end of file diff --git a/.forge-snapshots/V4Router_ExactOut2Hops.snap b/.forge-snapshots/V4Router_ExactOut2Hops.snap deleted file mode 100644 index 87c5e7044..000000000 --- a/.forge-snapshots/V4Router_ExactOut2Hops.snap +++ /dev/null @@ -1 +0,0 @@ -183759 \ No newline at end of file diff --git a/.forge-snapshots/V4Router_ExactOut2Hops_nativeIn.snap b/.forge-snapshots/V4Router_ExactOut2Hops_nativeIn.snap deleted file mode 100644 index d15e6c894..000000000 --- a/.forge-snapshots/V4Router_ExactOut2Hops_nativeIn.snap +++ /dev/null @@ -1 +0,0 @@ -175874 \ No newline at end of file diff --git a/.forge-snapshots/V4Router_ExactOut3Hops.snap b/.forge-snapshots/V4Router_ExactOut3Hops.snap deleted file mode 100644 index 5df7f78e5..000000000 --- a/.forge-snapshots/V4Router_ExactOut3Hops.snap +++ /dev/null @@ -1 +0,0 @@ -237693 \ No newline at end of file diff --git a/.forge-snapshots/V4Router_ExactOut3Hops_nativeIn.snap b/.forge-snapshots/V4Router_ExactOut3Hops_nativeIn.snap deleted file mode 100644 index 72b7efd5e..000000000 --- a/.forge-snapshots/V4Router_ExactOut3Hops_nativeIn.snap +++ /dev/null @@ -1 +0,0 @@ -229808 \ No newline at end of file diff --git a/.forge-snapshots/V4Router_ExactOut3Hops_nativeOut.snap b/.forge-snapshots/V4Router_ExactOut3Hops_nativeOut.snap deleted file mode 100644 index 810acacb8..000000000 --- a/.forge-snapshots/V4Router_ExactOut3Hops_nativeOut.snap +++ /dev/null @@ -1 +0,0 @@ -217048 \ No newline at end of file diff --git a/.forge-snapshots/V4Router_ExactOutputSingle.snap b/.forge-snapshots/V4Router_ExactOutputSingle.snap deleted file mode 100644 index 1fb8a61af..000000000 --- a/.forge-snapshots/V4Router_ExactOutputSingle.snap +++ /dev/null @@ -1 +0,0 @@ -128884 \ No newline at end of file diff --git a/.forge-snapshots/V4Router_ExactOutputSingle_nativeIn_sweepETH.snap b/.forge-snapshots/V4Router_ExactOutputSingle_nativeIn_sweepETH.snap deleted file mode 100644 index cd9382b3d..000000000 --- a/.forge-snapshots/V4Router_ExactOutputSingle_nativeIn_sweepETH.snap +++ /dev/null @@ -1 +0,0 @@ -120999 \ No newline at end of file diff --git a/.forge-snapshots/V4Router_ExactOutputSingle_nativeOut.snap b/.forge-snapshots/V4Router_ExactOutputSingle_nativeOut.snap deleted file mode 100644 index a14cba0fa..000000000 --- a/.forge-snapshots/V4Router_ExactOutputSingle_nativeOut.snap +++ /dev/null @@ -1 +0,0 @@ -116195 \ No newline at end of file diff --git a/.forge-snapshots/positionDescriptor bytecode size.snap b/.forge-snapshots/positionDescriptor bytecode size.snap deleted file mode 100644 index 702b832f5..000000000 --- a/.forge-snapshots/positionDescriptor bytecode size.snap +++ /dev/null @@ -1 +0,0 @@ -31074 \ No newline at end of file diff --git a/.gitmodules b/.gitmodules index 9d6618d5b..a06b89c81 100644 --- a/.gitmodules +++ b/.gitmodules @@ -4,3 +4,6 @@ [submodule "lib/permit2"] path = lib/permit2 url = https://github.com/Uniswap/permit2 +[submodule "lib/forge-std"] + path = lib/forge-std + url = https://github.com/foundry-rs/forge-std diff --git a/lib/forge-std b/lib/forge-std new file mode 160000 index 000000000..1de6eecf8 --- /dev/null +++ b/lib/forge-std @@ -0,0 +1 @@ +Subproject commit 1de6eecf821de7fe2c908cc48d3ab3dced20717f diff --git a/remappings.txt b/remappings.txt index e7868fe96..a78d8c9d0 100644 --- a/remappings.txt +++ b/remappings.txt @@ -1,6 +1,4 @@ @uniswap/v4-core/=lib/v4-core/ -forge-gas-snapshot/=lib/v4-core/lib/forge-gas-snapshot/src/ ds-test/=lib/v4-core/lib/forge-std/lib/ds-test/src/ -forge-std/=lib/v4-core/lib/forge-std/src/ openzeppelin-contracts/=lib/v4-core/lib/openzeppelin-contracts/ -solmate/=lib/v4-core/lib/solmate/ \ No newline at end of file +solmate/=lib/v4-core/lib/solmate/ diff --git a/snapshots/BaseActionsRouterTest.json b/snapshots/BaseActionsRouterTest.json new file mode 100644 index 000000000..ce8326011 --- /dev/null +++ b/snapshots/BaseActionsRouterTest.json @@ -0,0 +1,3 @@ +{ + "BaseActionsRouter_mock10commands": "60677" +} \ No newline at end of file diff --git a/snapshots/PaymentsTests.json b/snapshots/PaymentsTests.json new file mode 100644 index 000000000..1a4fc6e10 --- /dev/null +++ b/snapshots/PaymentsTests.json @@ -0,0 +1,6 @@ +{ + "Payments_swap_settleFromCaller_takeAllToMsgSender": "129601", + "Payments_swap_settleFromCaller_takeAllToSpecifiedAddress": "131664", + "Payments_swap_settleWithBalance_takeAllToMsgSender": "123869", + "Payments_swap_settleWithBalance_takeAllToSpecifiedAddress": "124011" +} \ No newline at end of file diff --git a/snapshots/PosMGasTest.json b/snapshots/PosMGasTest.json new file mode 100644 index 000000000..ffde6ad0e --- /dev/null +++ b/snapshots/PosMGasTest.json @@ -0,0 +1,41 @@ +{ + "PositionManager_burn_empty": "50446", + "PositionManager_burn_empty_native": "50446", + "PositionManager_burn_nonEmpty_native_withClose": "125584", + "PositionManager_burn_nonEmpty_native_withTakePair": "125031", + "PositionManager_burn_nonEmpty_withClose": "132446", + "PositionManager_burn_nonEmpty_withTakePair": "131893", + "PositionManager_collect_native": "146294", + "PositionManager_collect_sameRange": "154872", + "PositionManager_collect_withClose": "154872", + "PositionManager_collect_withTakePair": "154193", + "PositionManager_decreaseLiquidity_native": "111980", + "PositionManager_decreaseLiquidity_withClose": "119753", + "PositionManager_decreaseLiquidity_withTakePair": "119074", + "PositionManager_decrease_burnEmpty": "135243", + "PositionManager_decrease_burnEmpty_native": "128380", + "PositionManager_decrease_sameRange_allLiquidity": "132440", + "PositionManager_decrease_take_take": "120329", + "PositionManager_increaseLiquidity_erc20_withClose": "159057", + "PositionManager_increaseLiquidity_erc20_withSettlePair": "157997", + "PositionManager_increaseLiquidity_native": "140872", + "PositionManager_increase_autocompoundExactUnclaimedFees": "136359", + "PositionManager_increase_autocompoundExcessFeesCredit": "177364", + "PositionManager_increase_autocompound_clearExcess": "148040", + "PositionManager_mint_native": "364745", + "PositionManager_mint_nativeWithSweep_withClose": "373268", + "PositionManager_mint_nativeWithSweep_withSettlePair": "372491", + "PositionManager_mint_onSameTickLower": "317617", + "PositionManager_mint_onSameTickUpper": "318287", + "PositionManager_mint_sameRange": "243856", + "PositionManager_mint_settleWithBalance_sweep": "419060", + "PositionManager_mint_warmedPool_differentRange": "323648", + "PositionManager_mint_withClose": "420170", + "PositionManager_mint_withSettlePair": "419228", + "PositionManager_multicall_initialize_mint": "455975", + "PositionManager_permit": "79076", + "PositionManager_permit_secondPosition": "61976", + "PositionManager_permit_twice": "44852", + "PositionManager_subscribe": "84348", + "PositionManager_unsubscribe": "59238" +} \ No newline at end of file diff --git a/snapshots/PositionDescriptorTest.json b/snapshots/PositionDescriptorTest.json new file mode 100644 index 000000000..47a1cc5c5 --- /dev/null +++ b/snapshots/PositionDescriptorTest.json @@ -0,0 +1,3 @@ +{ + "positionDescriptor bytecode size": "31074" +} \ No newline at end of file diff --git a/snapshots/QuoterTest.json b/snapshots/QuoterTest.json new file mode 100644 index 000000000..53525acd3 --- /dev/null +++ b/snapshots/QuoterTest.json @@ -0,0 +1,15 @@ +{ + "Quoter_exactInputSingle_oneForZero_multiplePositions": "143930", + "Quoter_exactInputSingle_zeroForOne_multiplePositions": "149382", + "Quoter_exactOutputSingle_oneForZero": "78203", + "Quoter_exactOutputSingle_zeroForOne": "82626", + "Quoter_quoteExactInput_oneHop_1TickLoaded": "120491", + "Quoter_quoteExactInput_oneHop_initializedAfter": "145414", + "Quoter_quoteExactInput_oneHop_startingInitialized": "79437", + "Quoter_quoteExactInput_twoHops": "201179", + "Quoter_quoteExactOutput_oneHop_1TickLoaded": "119782", + "Quoter_quoteExactOutput_oneHop_2TicksLoaded": "149919", + "Quoter_quoteExactOutput_oneHop_initializedAfter": "119850", + "Quoter_quoteExactOutput_oneHop_startingInitialized": "96549", + "Quoter_quoteExactOutput_twoHops": "200630" +} \ No newline at end of file diff --git a/snapshots/StateViewTest.json b/snapshots/StateViewTest.json new file mode 100644 index 000000000..15054496a --- /dev/null +++ b/snapshots/StateViewTest.json @@ -0,0 +1,12 @@ +{ + "StateView_extsload_getFeeGrowthGlobals": "2259", + "StateView_extsload_getFeeGrowthInside": "8003", + "StateView_extsload_getLiquidity": "1399", + "StateView_extsload_getPositionInfo": "2829", + "StateView_extsload_getPositionLiquidity": "1651", + "StateView_extsload_getSlot0": "1446", + "StateView_extsload_getTickBitmap": "1392", + "StateView_extsload_getTickFeeGrowthOutside": "2546", + "StateView_extsload_getTickInfo": "2761", + "StateView_extsload_getTickLiquidity": "1646" +} \ No newline at end of file diff --git a/snapshots/V4RouterTest.json b/snapshots/V4RouterTest.json new file mode 100644 index 000000000..c1153ec10 --- /dev/null +++ b/snapshots/V4RouterTest.json @@ -0,0 +1,26 @@ +{ + "V4Router_Bytecode": "7037", + "V4Router_ExactIn1Hop_nativeIn": "115708", + "V4Router_ExactIn1Hop_nativeOut": "116029", + "V4Router_ExactIn1Hop_oneForZero": "124847", + "V4Router_ExactIn1Hop_zeroForOne": "130570", + "V4Router_ExactIn2Hops": "185411", + "V4Router_ExactIn2Hops_nativeIn": "170549", + "V4Router_ExactIn3Hops": "240255", + "V4Router_ExactIn3Hops_nativeIn": "225393", + "V4Router_ExactInputSingle": "129601", + "V4Router_ExactInputSingle_nativeIn": "114739", + "V4Router_ExactInputSingle_nativeOut": "115028", + "V4Router_ExactOut1Hop_nativeIn_sweepETH": "121971", + "V4Router_ExactOut1Hop_nativeOut": "117093", + "V4Router_ExactOut1Hop_oneForZero": "125911", + "V4Router_ExactOut1Hop_zeroForOne": "129856", + "V4Router_ExactOut2Hops": "183759", + "V4Router_ExactOut2Hops_nativeIn": "175874", + "V4Router_ExactOut3Hops": "237693", + "V4Router_ExactOut3Hops_nativeIn": "229808", + "V4Router_ExactOut3Hops_nativeOut": "217048", + "V4Router_ExactOutputSingle": "128884", + "V4Router_ExactOutputSingle_nativeIn_sweepETH": "120999", + "V4Router_ExactOutputSingle_nativeOut": "116195" +} \ No newline at end of file diff --git a/test/BaseActionsRouter.t.sol b/test/BaseActionsRouter.t.sol index 57ca984fa..47d1f2ecc 100644 --- a/test/BaseActionsRouter.t.sol +++ b/test/BaseActionsRouter.t.sol @@ -8,9 +8,8 @@ import {ActionConstants} from "../src/libraries/ActionConstants.sol"; import {IPoolManager} from "@uniswap/v4-core/src/interfaces/IPoolManager.sol"; import {Test} from "forge-std/Test.sol"; import {Deployers} from "@uniswap/v4-core/test/utils/Deployers.sol"; -import {GasSnapshot} from "forge-gas-snapshot/GasSnapshot.sol"; -contract BaseActionsRouterTest is Test, Deployers, GasSnapshot { +contract BaseActionsRouterTest is Test, Deployers { using Planner for Plan; MockBaseActionsRouter router; @@ -31,7 +30,7 @@ contract BaseActionsRouterTest is Test, Deployers, GasSnapshot { assertEq(router.swapCount(), 0); router.executeActions(data); - snapLastCall("BaseActionsRouter_mock10commands"); + vm.snapshotGasLastCall("BaseActionsRouter_mock10commands"); assertEq(router.swapCount(), 10); } diff --git a/test/DeltaResolver.t.sol b/test/DeltaResolver.t.sol index 61c032038..ea03d3a61 100644 --- a/test/DeltaResolver.t.sol +++ b/test/DeltaResolver.t.sol @@ -5,12 +5,11 @@ import {Test} from "forge-std/Test.sol"; import {Deployers} from "@uniswap/v4-core/test/utils/Deployers.sol"; import {Currency, CurrencyLibrary} from "@uniswap/v4-core/src/types/Currency.sol"; import {IHooks} from "@uniswap/v4-core/src/interfaces/IHooks.sol"; -import {GasSnapshot} from "forge-gas-snapshot/GasSnapshot.sol"; import {ERC20} from "solmate/src/tokens/ERC20.sol"; import {MockDeltaResolver} from "./mocks/MockDeltaResolver.sol"; -contract DeltaResolverTest is Test, Deployers, GasSnapshot { +contract DeltaResolverTest is Test, Deployers { using CurrencyLibrary for Currency; MockDeltaResolver resolver; diff --git a/test/PositionDescriptor.t.sol b/test/PositionDescriptor.t.sol index dabe83930..ef745d5a7 100644 --- a/test/PositionDescriptor.t.sol +++ b/test/PositionDescriptor.t.sol @@ -11,9 +11,8 @@ import {PositionConfig} from "./shared/PositionConfig.sol"; import {PosmTestSetup} from "./shared/PosmTestSetup.sol"; import {ActionConstants} from "../src/libraries/ActionConstants.sol"; import {Base64} from "./base64.sol"; -import {GasSnapshot} from "forge-gas-snapshot/GasSnapshot.sol"; -contract PositionDescriptorTest is Test, PosmTestSetup, GasSnapshot { +contract PositionDescriptorTest is Test, PosmTestSetup { using Base64 for string; address public WETH9 = 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2; @@ -38,7 +37,7 @@ contract PositionDescriptorTest is Test, PosmTestSetup, GasSnapshot { } function test_bytecodeSize_positionDescriptor() public { - snapSize("positionDescriptor bytecode size", address(positionDescriptor)); + vm.snapshotValue("positionDescriptor bytecode size", address(positionDescriptor).code.length); } function test_setup_succeeds() public view { diff --git a/test/Quoter.t.sol b/test/Quoter.t.sol index 2dc1c8540..1d9e882f8 100644 --- a/test/Quoter.t.sol +++ b/test/Quoter.t.sol @@ -7,7 +7,6 @@ import {PathKey} from "../src/libraries/PathKey.sol"; import {IQuoter} from "../src/interfaces/IQuoter.sol"; import {Quoter} from "../src/lens/Quoter.sol"; import {BaseV4Quoter} from "../src/base/BaseV4Quoter.sol"; -import {GasSnapshot} from "forge-gas-snapshot/GasSnapshot.sol"; // v4-core import {LiquidityAmounts} from "@uniswap/v4-core/test/utils/LiquidityAmounts.sol"; @@ -25,7 +24,7 @@ import {StateLibrary} from "@uniswap/v4-core/src/libraries/StateLibrary.sol"; // solmate import {MockERC20} from "solmate/src/test/utils/mocks/MockERC20.sol"; -contract QuoterTest is Test, Deployers, GasSnapshot { +contract QuoterTest is Test, Deployers { using SafeCast for *; using PoolIdLibrary for PoolKey; using StateLibrary for IPoolManager; @@ -93,7 +92,7 @@ contract QuoterTest is Test, Deployers, GasSnapshot { hookData: ZERO_BYTES }) ); - snapLastCall("Quoter_exactInputSingle_zeroForOne_multiplePositions"); + vm.snapshotGasLastCall("Quoter_exactInputSingle_zeroForOne_multiplePositions"); assertGt(gasEstimate, 50000); assertLt(gasEstimate, 400000); @@ -112,7 +111,7 @@ contract QuoterTest is Test, Deployers, GasSnapshot { hookData: ZERO_BYTES }) ); - snapLastCall("Quoter_exactInputSingle_oneForZero_multiplePositions"); + vm.snapshotGasLastCall("Quoter_exactInputSingle_oneForZero_multiplePositions"); assertGt(gasEstimate, 50000); assertLt(gasEstimate, 400000); @@ -156,7 +155,7 @@ contract QuoterTest is Test, Deployers, GasSnapshot { (uint256 amountOut, uint256 gasEstimate) = quoter.quoteExactInput(params); - snapLastCall("Quoter_quoteExactInput_oneHop_1TickLoaded"); + vm.snapshotGasLastCall("Quoter_quoteExactInput_oneHop_1TickLoaded"); assertGt(gasEstimate, 50000); assertLt(gasEstimate, 400000); @@ -210,7 +209,7 @@ contract QuoterTest is Test, Deployers, GasSnapshot { (uint256 amountOut, uint256 gasEstimate) = quoter.quoteExactInput(params); - snapLastCall("Quoter_quoteExactInput_oneHop_initializedAfter"); + vm.snapshotGasLastCall("Quoter_quoteExactInput_oneHop_initializedAfter"); assertGt(gasEstimate, 50000); assertLt(gasEstimate, 400000); @@ -226,7 +225,7 @@ contract QuoterTest is Test, Deployers, GasSnapshot { // Tick 0 initialized. Tick after = 1 (uint256 amountOut, uint256 gasEstimate) = quoter.quoteExactInput(params); - snapLastCall("Quoter_quoteExactInput_oneHop_startingInitialized"); + vm.snapshotGasLastCall("Quoter_quoteExactInput_oneHop_startingInitialized"); assertGt(gasEstimate, 50000); assertLt(gasEstimate, 400000); @@ -265,7 +264,7 @@ contract QuoterTest is Test, Deployers, GasSnapshot { (uint256 amountOut, uint256 gasEstimate) = quoter.quoteExactInput(params); - snapLastCall("Quoter_quoteExactInput_twoHops"); + vm.snapshotGasLastCall("Quoter_quoteExactInput_twoHops"); assertGt(gasEstimate, 50000); assertLt(gasEstimate, 400000); @@ -282,7 +281,7 @@ contract QuoterTest is Test, Deployers, GasSnapshot { hookData: ZERO_BYTES }) ); - snapLastCall("Quoter_exactOutputSingle_zeroForOne"); + vm.snapshotGasLastCall("Quoter_exactOutputSingle_zeroForOne"); assertGt(gasEstimate, 50000); assertLt(gasEstimate, 400000); @@ -299,7 +298,7 @@ contract QuoterTest is Test, Deployers, GasSnapshot { hookData: ZERO_BYTES }) ); - snapLastCall("Quoter_exactOutputSingle_oneForZero"); + vm.snapshotGasLastCall("Quoter_exactOutputSingle_oneForZero"); assertGt(gasEstimate, 50000); assertLt(gasEstimate, 400000); @@ -313,7 +312,7 @@ contract QuoterTest is Test, Deployers, GasSnapshot { (uint256 amountIn, uint256 gasEstimate) = quoter.quoteExactOutput(params); - snapLastCall("Quoter_quoteExactOutput_oneHop_2TicksLoaded"); + vm.snapshotGasLastCall("Quoter_quoteExactOutput_oneHop_2TicksLoaded"); assertGt(gasEstimate, 50000); assertLt(gasEstimate, 400000); assertEq(amountIn, 15273); @@ -327,7 +326,7 @@ contract QuoterTest is Test, Deployers, GasSnapshot { (uint256 amountIn, uint256 gasEstimate) = quoter.quoteExactOutput(params); - snapLastCall("Quoter_quoteExactOutput_oneHop_initializedAfter"); + vm.snapshotGasLastCall("Quoter_quoteExactOutput_oneHop_initializedAfter"); assertGt(gasEstimate, 50000); assertLt(gasEstimate, 400000); assertEq(amountIn, 6200); @@ -341,7 +340,7 @@ contract QuoterTest is Test, Deployers, GasSnapshot { (uint256 amountIn, uint256 gasEstimate) = quoter.quoteExactOutput(params); - snapLastCall("Quoter_quoteExactOutput_oneHop_1TickLoaded"); + vm.snapshotGasLastCall("Quoter_quoteExactOutput_oneHop_1TickLoaded"); assertGt(gasEstimate, 50000); assertLt(gasEstimate, 400000); assertEq(amountIn, 4029); @@ -356,7 +355,7 @@ contract QuoterTest is Test, Deployers, GasSnapshot { // Tick 0 initialized. Tick after = 1 (uint256 amountIn, uint256 gasEstimate) = quoter.quoteExactOutput(params); - snapLastCall("Quoter_quoteExactOutput_oneHop_startingInitialized"); + vm.snapshotGasLastCall("Quoter_quoteExactOutput_oneHop_startingInitialized"); assertGt(gasEstimate, 50000); assertLt(gasEstimate, 400000); @@ -435,7 +434,7 @@ contract QuoterTest is Test, Deployers, GasSnapshot { (uint256 amountIn, uint256 gasEstimate) = quoter.quoteExactOutput(params); - snapLastCall("Quoter_quoteExactOutput_twoHops"); + vm.snapshotGasLastCall("Quoter_quoteExactOutput_twoHops"); assertGt(gasEstimate, 50000); assertLt(gasEstimate, 400000); diff --git a/test/StateViewTest.t.sol b/test/StateViewTest.t.sol index c243f12fa..64a6e750d 100644 --- a/test/StateViewTest.t.sol +++ b/test/StateViewTest.t.sol @@ -3,7 +3,6 @@ pragma solidity ^0.8.19; import "forge-std/Test.sol"; -import {GasSnapshot} from "forge-gas-snapshot/GasSnapshot.sol"; import {FixedPointMathLib} from "solmate/src/utils/FixedPointMathLib.sol"; import {IHooks} from "@uniswap/v4-core/src/interfaces/IHooks.sol"; import {Hooks} from "@uniswap/v4-core/src/libraries/Hooks.sol"; @@ -23,7 +22,7 @@ import {Position} from "@uniswap/v4-core/src/libraries/Position.sol"; import {StateView} from "../src/lens/StateView.sol"; /// This test was taken from StateLibrary.t.sol in v4-core and adapted to use the StateView contract instead. -contract StateViewTest is Test, Deployers, Fuzzers, GasSnapshot { +contract StateViewTest is Test, Deployers, Fuzzers { using FixedPointMathLib for uint256; using PoolIdLibrary for PoolKey; @@ -57,7 +56,7 @@ contract StateViewTest is Test, Deployers, Fuzzers, GasSnapshot { uint256 swapAmount = 100 ether; swap(key, true, -int256(swapAmount), ZERO_BYTES); (uint160 sqrtPriceX96, int24 tick, uint24 protocolFee, uint24 swapFee) = state.getSlot0(poolId); - snapLastCall("StateView_extsload_getSlot0"); + vm.snapshotGasLastCall("StateView_extsload_getSlot0"); assertEq(tick, -139); // magic number verified against a native getter @@ -71,7 +70,7 @@ contract StateViewTest is Test, Deployers, Fuzzers, GasSnapshot { modifyLiquidityRouter.modifyLiquidity(key, IPoolManager.ModifyLiquidityParams(-60, 60, 10 ether, 0), ZERO_BYTES); (uint128 liquidityGrossLower, int128 liquidityNetLower) = state.getTickLiquidity(poolId, -60); - snapLastCall("StateView_extsload_getTickLiquidity"); + vm.snapshotGasLastCall("StateView_extsload_getTickLiquidity"); assertEq(liquidityGrossLower, 10 ether); assertEq(liquidityNetLower, 10 ether); @@ -182,7 +181,7 @@ contract StateViewTest is Test, Deployers, Fuzzers, GasSnapshot { swap(key, true, -int256(swapAmount), ZERO_BYTES); (feeGrowthGlobal0, feeGrowthGlobal1) = state.getFeeGrowthGlobals(poolId); - snapLastCall("StateView_extsload_getFeeGrowthGlobals"); + vm.snapshotGasLastCall("StateView_extsload_getFeeGrowthGlobals"); uint256 feeGrowthGlobalCalc = swapAmount.mulWadDown(0.003e18).mulDivDown(FixedPoint128.Q128, liquidity); assertEq(feeGrowthGlobal0, feeGrowthGlobalCalc); @@ -218,7 +217,7 @@ contract StateViewTest is Test, Deployers, Fuzzers, GasSnapshot { ); uint128 liquidity = state.getLiquidity(poolId); - snapLastCall("StateView_extsload_getLiquidity"); + vm.snapshotGasLastCall("StateView_extsload_getLiquidity"); assertEq(liquidity, 20 ether); } @@ -246,7 +245,7 @@ contract StateViewTest is Test, Deployers, Fuzzers, GasSnapshot { (int16 wordPos, uint8 bitPos) = TickBitmap.position(tickLower / key.tickSpacing); uint256 tickBitmap = state.getTickBitmap(poolId, wordPos); - snapLastCall("StateView_extsload_getTickBitmap"); + vm.snapshotGasLastCall("StateView_extsload_getTickBitmap"); assertNotEq(tickBitmap, 0); assertEq(tickBitmap, 1 << bitPos); @@ -294,7 +293,7 @@ contract StateViewTest is Test, Deployers, Fuzzers, GasSnapshot { (uint128 liquidity, uint256 feeGrowthInside0X128, uint256 feeGrowthInside1X128) = state.getPositionInfo(poolId, positionId); - snapLastCall("StateView_extsload_getPositionInfo"); + vm.snapshotGasLastCall("StateView_extsload_getPositionInfo"); assertEq(liquidity, 10_000 ether); @@ -361,7 +360,7 @@ contract StateViewTest is Test, Deployers, Fuzzers, GasSnapshot { int24 tick = -60; (uint256 feeGrowthOutside0X128, uint256 feeGrowthOutside1X128) = state.getTickFeeGrowthOutside(poolId, tick); - snapLastCall("StateView_extsload_getTickFeeGrowthOutside"); + vm.snapshotGasLastCall("StateView_extsload_getTickFeeGrowthOutside"); // magic number verified against a native getter on PoolManager assertEq(feeGrowthOutside0X128, 3076214778951936192155253373200636); @@ -393,7 +392,7 @@ contract StateViewTest is Test, Deployers, Fuzzers, GasSnapshot { int24 tick = -60; (uint128 liquidityGross, int128 liquidityNet, uint256 feeGrowthOutside0X128, uint256 feeGrowthOutside1X128) = state.getTickInfo(poolId, tick); - snapLastCall("StateView_extsload_getTickInfo"); + vm.snapshotGasLastCall("StateView_extsload_getTickInfo"); (uint128 liquidityGross_, int128 liquidityNet_) = state.getTickLiquidity(poolId, tick); (uint256 feeGrowthOutside0X128_, uint256 feeGrowthOutside1X128_) = state.getTickFeeGrowthOutside(poolId, tick); @@ -426,7 +425,7 @@ contract StateViewTest is Test, Deployers, Fuzzers, GasSnapshot { // calculated live (uint256 feeGrowthInside0X128, uint256 feeGrowthInside1X128) = state.getFeeGrowthInside(poolId, -60, 60); - snapLastCall("StateView_extsload_getFeeGrowthInside"); + vm.snapshotGasLastCall("StateView_extsload_getFeeGrowthInside"); // poke the LP so that fees are updated modifyLiquidityRouter.modifyLiquidity(key, IPoolManager.ModifyLiquidityParams(-60, 60, 0, 0), ZERO_BYTES); @@ -483,7 +482,7 @@ contract StateViewTest is Test, Deployers, Fuzzers, GasSnapshot { Position.calculatePositionKey(address(modifyLiquidityRouter), int24(-60), int24(60), bytes32(0)); uint128 liquidity = state.getPositionLiquidity(poolId, positionId); - snapLastCall("StateView_extsload_getPositionLiquidity"); + vm.snapshotGasLastCall("StateView_extsload_getPositionLiquidity"); assertEq(liquidity, 10_000 ether); } diff --git a/test/position-managers/PositionManager.gas.t.sol b/test/position-managers/PositionManager.gas.t.sol index cf0777483..1504f9fb2 100644 --- a/test/position-managers/PositionManager.gas.t.sol +++ b/test/position-managers/PositionManager.gas.t.sol @@ -2,7 +2,6 @@ pragma solidity ^0.8.24; import "forge-std/Test.sol"; -import {GasSnapshot} from "forge-gas-snapshot/GasSnapshot.sol"; import {PoolManager} from "@uniswap/v4-core/src/PoolManager.sol"; import {IPoolManager} from "@uniswap/v4-core/src/interfaces/IPoolManager.sol"; import {IHooks} from "@uniswap/v4-core/src/interfaces/IHooks.sol"; @@ -26,7 +25,7 @@ import {PosmTestSetup} from "../shared/PosmTestSetup.sol"; import {ActionConstants} from "../../src/libraries/ActionConstants.sol"; import {MockSubscriber} from "../mocks/MockSubscriber.sol"; -contract PosMGasTest is Test, PosmTestSetup, GasSnapshot { +contract PosMGasTest is Test, PosmTestSetup { using FixedPointMathLib for uint256; using CurrencyLibrary for Currency; using PoolIdLibrary for PoolKey; @@ -91,7 +90,7 @@ contract PosMGasTest is Test, PosmTestSetup, GasSnapshot { ); bytes memory calls = planner.finalizeModifyLiquidityWithClose(config.poolKey); lpm.modifyLiquidities(calls, _deadline); - snapLastCall("PositionManager_mint_withClose"); + vm.snapshotGasLastCall("PositionManager_mint_withClose"); } function test_gas_mint_withSettlePair() public { @@ -110,7 +109,7 @@ contract PosMGasTest is Test, PosmTestSetup, GasSnapshot { ); bytes memory calls = planner.finalizeModifyLiquidityWithSettlePair(config.poolKey); lpm.modifyLiquidities(calls, _deadline); - snapLastCall("PositionManager_mint_withSettlePair"); + vm.snapshotGasLastCall("PositionManager_mint_withSettlePair"); } function test_gas_mint_differentRanges() public { @@ -136,7 +135,7 @@ contract PosMGasTest is Test, PosmTestSetup, GasSnapshot { bytes memory calls = planner.finalizeModifyLiquidityWithClose(config.poolKey); vm.prank(alice); lpm.modifyLiquidities(calls, _deadline); - snapLastCall("PositionManager_mint_warmedPool_differentRange"); + vm.snapshotGasLastCall("PositionManager_mint_warmedPool_differentRange"); } function test_gas_mint_sameTickLower() public { @@ -162,7 +161,7 @@ contract PosMGasTest is Test, PosmTestSetup, GasSnapshot { bytes memory calls = planner.finalizeModifyLiquidityWithClose(config.poolKey); vm.prank(alice); lpm.modifyLiquidities(calls, _deadline); - snapLastCall("PositionManager_mint_onSameTickLower"); + vm.snapshotGasLastCall("PositionManager_mint_onSameTickLower"); } function test_gas_mint_sameTickUpper() public { @@ -188,7 +187,7 @@ contract PosMGasTest is Test, PosmTestSetup, GasSnapshot { bytes memory calls = planner.finalizeModifyLiquidityWithClose(config.poolKey); vm.prank(alice); lpm.modifyLiquidities(calls, _deadline); - snapLastCall("PositionManager_mint_onSameTickUpper"); + vm.snapshotGasLastCall("PositionManager_mint_onSameTickUpper"); } function test_gas_increaseLiquidity_erc20_withClose() public { @@ -202,7 +201,7 @@ contract PosMGasTest is Test, PosmTestSetup, GasSnapshot { bytes memory calls = planner.finalizeModifyLiquidityWithClose(config.poolKey); lpm.modifyLiquidities(calls, _deadline); - snapLastCall("PositionManager_increaseLiquidity_erc20_withClose"); + vm.snapshotGasLastCall("PositionManager_increaseLiquidity_erc20_withClose"); } function test_gas_increaseLiquidity_erc20_withSettlePair() public { @@ -216,7 +215,7 @@ contract PosMGasTest is Test, PosmTestSetup, GasSnapshot { bytes memory calls = planner.finalizeModifyLiquidityWithSettlePair(config.poolKey); lpm.modifyLiquidities(calls, _deadline); - snapLastCall("PositionManager_increaseLiquidity_erc20_withSettlePair"); + vm.snapshotGasLastCall("PositionManager_increaseLiquidity_erc20_withSettlePair"); } function test_gas_autocompound_exactUnclaimedFees() public { @@ -262,7 +261,7 @@ contract PosMGasTest is Test, PosmTestSetup, GasSnapshot { vm.prank(alice); lpm.modifyLiquidities(calls, _deadline); - snapLastCall("PositionManager_increase_autocompoundExactUnclaimedFees"); + vm.snapshotGasLastCall("PositionManager_increase_autocompoundExactUnclaimedFees"); } function test_gas_autocompound_clearExcess() public { @@ -311,7 +310,7 @@ contract PosMGasTest is Test, PosmTestSetup, GasSnapshot { vm.prank(alice); lpm.modifyLiquidities(calls, _deadline); - snapLastCall("PositionManager_increase_autocompound_clearExcess"); + vm.snapshotGasLastCall("PositionManager_increase_autocompound_clearExcess"); } // Autocompounding but the excess fees are taken to the user @@ -357,7 +356,7 @@ contract PosMGasTest is Test, PosmTestSetup, GasSnapshot { vm.prank(alice); lpm.modifyLiquidities(calls, _deadline); - snapLastCall("PositionManager_increase_autocompoundExcessFeesCredit"); + vm.snapshotGasLastCall("PositionManager_increase_autocompoundExcessFeesCredit"); } function test_gas_decreaseLiquidity_withClose() public { @@ -371,7 +370,7 @@ contract PosMGasTest is Test, PosmTestSetup, GasSnapshot { bytes memory calls = planner.finalizeModifyLiquidityWithClose(config.poolKey); lpm.modifyLiquidities(calls, _deadline); - snapLastCall("PositionManager_decreaseLiquidity_withClose"); + vm.snapshotGasLastCall("PositionManager_decreaseLiquidity_withClose"); } function test_gas_decreaseLiquidity_withTakePair() public { @@ -385,7 +384,7 @@ contract PosMGasTest is Test, PosmTestSetup, GasSnapshot { bytes memory calls = planner.finalizeModifyLiquidityWithTakePair(config.poolKey, address(this)); lpm.modifyLiquidities(calls, _deadline); - snapLastCall("PositionManager_decreaseLiquidity_withTakePair"); + vm.snapshotGasLastCall("PositionManager_decreaseLiquidity_withTakePair"); } function test_gas_multicall_initialize_mint() public { @@ -420,7 +419,7 @@ contract PosMGasTest is Test, PosmTestSetup, GasSnapshot { calls[1] = abi.encodeWithSelector(IPositionManager.modifyLiquidities.selector, actions, _deadline); IMulticall_v4(lpm).multicall(calls); - snapLastCall("PositionManager_multicall_initialize_mint"); + vm.snapshotGasLastCall("PositionManager_multicall_initialize_mint"); } function test_gas_collect_withClose() public { @@ -437,7 +436,7 @@ contract PosMGasTest is Test, PosmTestSetup, GasSnapshot { bytes memory calls = planner.finalizeModifyLiquidityWithClose(config.poolKey); lpm.modifyLiquidities(calls, _deadline); - snapLastCall("PositionManager_collect_withClose"); + vm.snapshotGasLastCall("PositionManager_collect_withClose"); } function test_gas_collect_withTakePair() public { @@ -454,7 +453,7 @@ contract PosMGasTest is Test, PosmTestSetup, GasSnapshot { bytes memory calls = planner.finalizeModifyLiquidityWithTakePair(config.poolKey, address(this)); lpm.modifyLiquidities(calls, _deadline); - snapLastCall("PositionManager_collect_withTakePair"); + vm.snapshotGasLastCall("PositionManager_collect_withTakePair"); } // same-range gas tests @@ -477,7 +476,7 @@ contract PosMGasTest is Test, PosmTestSetup, GasSnapshot { bytes memory calls = planner.finalizeModifyLiquidityWithClose(config.poolKey); vm.prank(alice); lpm.modifyLiquidities(calls, _deadline); - snapLastCall("PositionManager_mint_sameRange"); + vm.snapshotGasLastCall("PositionManager_mint_sameRange"); } function test_gas_sameRange_decrease() public { @@ -496,7 +495,7 @@ contract PosMGasTest is Test, PosmTestSetup, GasSnapshot { bytes memory calls = planner.finalizeModifyLiquidityWithClose(config.poolKey); lpm.modifyLiquidities(calls, _deadline); - snapLastCall("PositionManager_decrease_sameRange_allLiquidity"); + vm.snapshotGasLastCall("PositionManager_decrease_sameRange_allLiquidity"); } function test_gas_sameRange_collect() public { @@ -517,7 +516,7 @@ contract PosMGasTest is Test, PosmTestSetup, GasSnapshot { bytes memory calls = planner.finalizeModifyLiquidityWithClose(config.poolKey); lpm.modifyLiquidities(calls, _deadline); - snapLastCall("PositionManager_collect_sameRange"); + vm.snapshotGasLastCall("PositionManager_collect_sameRange"); } function test_gas_burn_nonEmptyPosition_withClose() public { @@ -530,7 +529,7 @@ contract PosMGasTest is Test, PosmTestSetup, GasSnapshot { bytes memory calls = planner.finalizeModifyLiquidityWithClose(config.poolKey); lpm.modifyLiquidities(calls, _deadline); - snapLastCall("PositionManager_burn_nonEmpty_withClose"); + vm.snapshotGasLastCall("PositionManager_burn_nonEmpty_withClose"); } function test_gas_burn_nonEmptyPosition_withTakePair() public { @@ -543,7 +542,7 @@ contract PosMGasTest is Test, PosmTestSetup, GasSnapshot { bytes memory calls = planner.finalizeModifyLiquidityWithTakePair(config.poolKey, address(this)); lpm.modifyLiquidities(calls, _deadline); - snapLastCall("PositionManager_burn_nonEmpty_withTakePair"); + vm.snapshotGasLastCall("PositionManager_burn_nonEmpty_withTakePair"); } function test_gas_burnEmpty() public { @@ -558,7 +557,7 @@ contract PosMGasTest is Test, PosmTestSetup, GasSnapshot { // There is no need to include CLOSE commands. bytes memory calls = planner.encode(); lpm.modifyLiquidities(calls, _deadline); - snapLastCall("PositionManager_burn_empty"); + vm.snapshotGasLastCall("PositionManager_burn_empty"); } function test_gas_decrease_burnEmpty_batch() public { @@ -578,7 +577,7 @@ contract PosMGasTest is Test, PosmTestSetup, GasSnapshot { // We must include CLOSE commands. bytes memory calls = planner.finalizeModifyLiquidityWithClose(config.poolKey); lpm.modifyLiquidities(calls, _deadline); - snapLastCall("PositionManager_decrease_burnEmpty"); + vm.snapshotGasLastCall("PositionManager_decrease_burnEmpty"); } // TODO: ERC6909 Support. @@ -597,7 +596,7 @@ contract PosMGasTest is Test, PosmTestSetup, GasSnapshot { uint128(liquidityToAdd) ); lpm.modifyLiquidities{value: amount0 + 1}(calls, _deadline); - snapLastCall("PositionManager_mint_native"); + vm.snapshotGasLastCall("PositionManager_mint_native"); } function test_gas_mint_native_excess_withClose() public { @@ -630,7 +629,7 @@ contract PosMGasTest is Test, PosmTestSetup, GasSnapshot { ); // overpay on the native token lpm.modifyLiquidities{value: amount0 * 2}(calls, _deadline); - snapLastCall("PositionManager_mint_nativeWithSweep_withClose"); + vm.snapshotGasLastCall("PositionManager_mint_nativeWithSweep_withClose"); } function test_gas_mint_native_excess_withSettlePair() public { @@ -662,7 +661,7 @@ contract PosMGasTest is Test, PosmTestSetup, GasSnapshot { ); // overpay on the native token lpm.modifyLiquidities{value: amount0 * 2}(calls, _deadline); - snapLastCall("PositionManager_mint_nativeWithSweep_withSettlePair"); + vm.snapshotGasLastCall("PositionManager_mint_nativeWithSweep_withSettlePair"); } function test_gas_increase_native() public { @@ -678,7 +677,7 @@ contract PosMGasTest is Test, PosmTestSetup, GasSnapshot { uint128(liquidityToAdd) ); lpm.modifyLiquidities{value: amount0 + 1}(calls, _deadline); - snapLastCall("PositionManager_increaseLiquidity_native"); + vm.snapshotGasLastCall("PositionManager_increaseLiquidity_native"); } function test_gas_decrease_native() public { @@ -688,7 +687,7 @@ contract PosMGasTest is Test, PosmTestSetup, GasSnapshot { uint256 liquidityToRemove = 10_000 ether; bytes memory calls = getDecreaseEncoded(tokenId, configNative, liquidityToRemove, ZERO_BYTES); lpm.modifyLiquidities(calls, _deadline); - snapLastCall("PositionManager_decreaseLiquidity_native"); + vm.snapshotGasLastCall("PositionManager_decreaseLiquidity_native"); } function test_gas_collect_native() public { @@ -700,7 +699,7 @@ contract PosMGasTest is Test, PosmTestSetup, GasSnapshot { bytes memory calls = getCollectEncoded(tokenId, configNative, ZERO_BYTES); lpm.modifyLiquidities(calls, _deadline); - snapLastCall("PositionManager_collect_native"); + vm.snapshotGasLastCall("PositionManager_collect_native"); } function test_gas_burn_nonEmptyPosition_native_withClose() public { @@ -713,7 +712,7 @@ contract PosMGasTest is Test, PosmTestSetup, GasSnapshot { bytes memory calls = planner.finalizeModifyLiquidityWithClose(configNative.poolKey); lpm.modifyLiquidities(calls, _deadline); - snapLastCall("PositionManager_burn_nonEmpty_native_withClose"); + vm.snapshotGasLastCall("PositionManager_burn_nonEmpty_native_withClose"); } function test_gas_burn_nonEmptyPosition_native_withTakePair() public { @@ -726,7 +725,7 @@ contract PosMGasTest is Test, PosmTestSetup, GasSnapshot { bytes memory calls = planner.finalizeModifyLiquidityWithTakePair(configNative.poolKey, address(this)); lpm.modifyLiquidities(calls, _deadline); - snapLastCall("PositionManager_burn_nonEmpty_native_withTakePair"); + vm.snapshotGasLastCall("PositionManager_burn_nonEmpty_native_withTakePair"); } function test_gas_burnEmpty_native() public { @@ -741,7 +740,7 @@ contract PosMGasTest is Test, PosmTestSetup, GasSnapshot { // There is no need to include CLOSE commands. bytes memory calls = planner.encode(); lpm.modifyLiquidities(calls, _deadline); - snapLastCall("PositionManager_burn_empty_native"); + vm.snapshotGasLastCall("PositionManager_burn_empty_native"); } function test_gas_decrease_burnEmpty_batch_native() public { @@ -759,7 +758,7 @@ contract PosMGasTest is Test, PosmTestSetup, GasSnapshot { // We must include CLOSE commands. bytes memory calls = planner.finalizeModifyLiquidityWithClose(configNative.poolKey); lpm.modifyLiquidities(calls, _deadline); - snapLastCall("PositionManager_decrease_burnEmpty_native"); + vm.snapshotGasLastCall("PositionManager_decrease_burnEmpty_native"); } function test_gas_permit() public { @@ -779,7 +778,7 @@ contract PosMGasTest is Test, PosmTestSetup, GasSnapshot { vm.prank(bob); lpm.permit(bob, tokenIdAlice, block.timestamp + 1, nonce, signature); - snapLastCall("PositionManager_permit"); + vm.snapshotGasLastCall("PositionManager_permit"); } function test_gas_permit_secondPosition() public { @@ -813,7 +812,7 @@ contract PosMGasTest is Test, PosmTestSetup, GasSnapshot { vm.prank(bob); lpm.permit(bob, tokenIdAlice, block.timestamp + 1, nonce, signature); - snapLastCall("PositionManager_permit_secondPosition"); + vm.snapshotGasLastCall("PositionManager_permit_secondPosition"); } function test_gas_permit_twice() public { @@ -843,7 +842,7 @@ contract PosMGasTest is Test, PosmTestSetup, GasSnapshot { vm.prank(bob); lpm.permit(charlie, tokenIdAlice, block.timestamp + 1, nonce, signature); - snapLastCall("PositionManager_permit_twice"); + vm.snapshotGasLastCall("PositionManager_permit_twice"); } function test_gas_mint_settleWithBalance_sweep() public { @@ -875,7 +874,7 @@ contract PosMGasTest is Test, PosmTestSetup, GasSnapshot { vm.prank(alice); lpm.modifyLiquidities(calls, _deadline); - snapLastCall("PositionManager_mint_settleWithBalance_sweep"); + vm.snapshotGasLastCall("PositionManager_mint_settleWithBalance_sweep"); } // Does not encode a take pair @@ -891,7 +890,7 @@ contract PosMGasTest is Test, PosmTestSetup, GasSnapshot { bytes memory calls = plan.finalizeModifyLiquidityWithTake(config.poolKey, ActionConstants.MSG_SENDER); lpm.modifyLiquidities(calls, _deadline); - snapLastCall("PositionManager_decrease_take_take"); + vm.snapshotGasLastCall("PositionManager_decrease_take_take"); } function test_gas_subscribe_unsubscribe() public { @@ -899,9 +898,9 @@ contract PosMGasTest is Test, PosmTestSetup, GasSnapshot { mint(config, 1e18, ActionConstants.MSG_SENDER, ZERO_BYTES); lpm.subscribe(tokenId, address(sub), ZERO_BYTES); - snapLastCall("PositionManager_subscribe"); + vm.snapshotGasLastCall("PositionManager_subscribe"); lpm.unsubscribe(tokenId); - snapLastCall("PositionManager_unsubscribe"); + vm.snapshotGasLastCall("PositionManager_unsubscribe"); } } diff --git a/test/position-managers/PositionManager.notifier.t.sol b/test/position-managers/PositionManager.notifier.t.sol index 391446a84..40740084f 100644 --- a/test/position-managers/PositionManager.notifier.t.sol +++ b/test/position-managers/PositionManager.notifier.t.sol @@ -9,7 +9,6 @@ import {IPoolManager} from "@uniswap/v4-core/src/interfaces/IPoolManager.sol"; import {StateLibrary} from "@uniswap/v4-core/src/libraries/StateLibrary.sol"; import {PoolIdLibrary} from "@uniswap/v4-core/src/types/PoolId.sol"; import {BalanceDelta, toBalanceDelta} from "@uniswap/v4-core/src/types/BalanceDelta.sol"; -import {GasSnapshot} from "forge-gas-snapshot/GasSnapshot.sol"; import {PosmTestSetup} from "../shared/PosmTestSetup.sol"; import {MockSubscriber} from "../mocks/MockSubscriber.sol"; import {ISubscriber} from "../../src/interfaces/ISubscriber.sol"; @@ -21,7 +20,7 @@ import {INotifier} from "../../src/interfaces/INotifier.sol"; import {MockReturnDataSubscriber, MockRevertSubscriber} from "../mocks/MockBadSubscribers.sol"; import {PositionInfoLibrary, PositionInfo} from "../../src/libraries/PositionInfoLibrary.sol"; -contract PositionManagerNotifierTest is Test, PosmTestSetup, GasSnapshot { +contract PositionManagerNotifierTest is Test, PosmTestSetup { using PoolIdLibrary for PoolKey; using StateLibrary for IPoolManager; using Planner for Plan; diff --git a/test/router/Payments.gas.t.sol b/test/router/Payments.gas.t.sol index 2e42a9366..910e676bb 100644 --- a/test/router/Payments.gas.t.sol +++ b/test/router/Payments.gas.t.sol @@ -1,7 +1,6 @@ // SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.19; -import {GasSnapshot} from "forge-gas-snapshot/GasSnapshot.sol"; import {Currency, CurrencyLibrary} from "@uniswap/v4-core/src/types/Currency.sol"; import {IV4Router} from "../../src/interfaces/IV4Router.sol"; @@ -10,7 +9,7 @@ import {Plan, Planner} from "../shared/Planner.sol"; import {Actions} from "../../src/libraries/Actions.sol"; import {ActionConstants} from "../../src/libraries/ActionConstants.sol"; -contract PaymentsTests is RoutingTestHelpers, GasSnapshot { +contract PaymentsTests is RoutingTestHelpers { using CurrencyLibrary for Currency; using Planner for Plan; @@ -30,7 +29,7 @@ contract PaymentsTests is RoutingTestHelpers, GasSnapshot { bytes memory data = plan.encode(); router.executeActions(data); - snapLastCall("Payments_swap_settleFromCaller_takeAllToSpecifiedAddress"); + vm.snapshotGasLastCall("Payments_swap_settleFromCaller_takeAllToSpecifiedAddress"); } function test_gas_swap_settleFromCaller_takeAllToMsgSender() public { @@ -43,7 +42,7 @@ contract PaymentsTests is RoutingTestHelpers, GasSnapshot { bytes memory data = plan.encode(); router.executeActions(data); - snapLastCall("Payments_swap_settleFromCaller_takeAllToMsgSender"); + vm.snapshotGasLastCall("Payments_swap_settleFromCaller_takeAllToMsgSender"); } function test_gas_swap_settleWithBalance_takeAllToSpecifiedAddress() public { @@ -60,7 +59,7 @@ contract PaymentsTests is RoutingTestHelpers, GasSnapshot { bytes memory data = plan.encode(); router.executeActions(data); - snapLastCall("Payments_swap_settleWithBalance_takeAllToSpecifiedAddress"); + vm.snapshotGasLastCall("Payments_swap_settleWithBalance_takeAllToSpecifiedAddress"); } function test_gas_swap_settleWithBalance_takeAllToMsgSender() public { @@ -78,6 +77,6 @@ contract PaymentsTests is RoutingTestHelpers, GasSnapshot { bytes memory data = plan.encode(); router.executeActions(data); - snapLastCall("Payments_swap_settleWithBalance_takeAllToMsgSender"); + vm.snapshotGasLastCall("Payments_swap_settleWithBalance_takeAllToMsgSender"); } } diff --git a/test/router/Payments.t.sol b/test/router/Payments.t.sol index 29442f9cd..1a8e89609 100644 --- a/test/router/Payments.t.sol +++ b/test/router/Payments.t.sol @@ -1,7 +1,6 @@ // SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.19; -import {GasSnapshot} from "forge-gas-snapshot/GasSnapshot.sol"; import {Currency, CurrencyLibrary} from "@uniswap/v4-core/src/types/Currency.sol"; import {IV4Router} from "../../src/interfaces/IV4Router.sol"; @@ -11,7 +10,7 @@ import {Actions} from "../../src/libraries/Actions.sol"; import {ActionConstants} from "../../src/libraries/ActionConstants.sol"; import {BipsLibrary} from "../../src/libraries/BipsLibrary.sol"; -contract PaymentsTests is RoutingTestHelpers, GasSnapshot { +contract PaymentsTests is RoutingTestHelpers { using CurrencyLibrary for Currency; using Planner for Plan; diff --git a/test/router/V4Router.gas.t.sol b/test/router/V4Router.gas.t.sol index c49f96dcf..3be320291 100644 --- a/test/router/V4Router.gas.t.sol +++ b/test/router/V4Router.gas.t.sol @@ -1,7 +1,6 @@ // SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.19; -import {GasSnapshot} from "forge-gas-snapshot/GasSnapshot.sol"; import {Currency, CurrencyLibrary} from "@uniswap/v4-core/src/types/Currency.sol"; import {IV4Router} from "../../src/interfaces/IV4Router.sol"; @@ -10,7 +9,7 @@ import {Plan, Planner} from "../shared/Planner.sol"; import {Actions} from "../../src/libraries/Actions.sol"; import {ActionConstants} from "../../src/libraries/ActionConstants.sol"; -contract V4RouterTest is RoutingTestHelpers, GasSnapshot { +contract V4RouterTest is RoutingTestHelpers { using CurrencyLibrary for Currency; using Planner for Plan; @@ -20,7 +19,7 @@ contract V4RouterTest is RoutingTestHelpers, GasSnapshot { } function test_gas_bytecodeSize() public { - snapSize("V4Router_Bytecode", address(router)); + vm.snapshotValue("V4Router_Bytecode", address(router).code.length); } /*////////////////////////////////////////////////////////////// @@ -37,7 +36,7 @@ contract V4RouterTest is RoutingTestHelpers, GasSnapshot { bytes memory data = plan.finalizeSwap(key0.currency0, key0.currency1, ActionConstants.MSG_SENDER); router.executeActions(data); - snapLastCall("V4Router_ExactInputSingle"); + vm.snapshotGasLastCall("V4Router_ExactInputSingle"); } function test_gas_swapExactIn_1Hop_zeroForOne() public { @@ -51,7 +50,7 @@ contract V4RouterTest is RoutingTestHelpers, GasSnapshot { bytes memory data = plan.finalizeSwap(currency0, currency1, ActionConstants.MSG_SENDER); router.executeActions(data); - snapLastCall("V4Router_ExactIn1Hop_zeroForOne"); + vm.snapshotGasLastCall("V4Router_ExactIn1Hop_zeroForOne"); } function test_gas_swapExactIn_1Hop_oneForZero() public { @@ -65,7 +64,7 @@ contract V4RouterTest is RoutingTestHelpers, GasSnapshot { bytes memory data = plan.finalizeSwap(currency1, currency0, ActionConstants.MSG_SENDER); router.executeActions(data); - snapLastCall("V4Router_ExactIn1Hop_oneForZero"); + vm.snapshotGasLastCall("V4Router_ExactIn1Hop_oneForZero"); } function test_gas_swapExactIn_2Hops() public { @@ -80,7 +79,7 @@ contract V4RouterTest is RoutingTestHelpers, GasSnapshot { bytes memory data = plan.finalizeSwap(currency0, currency2, ActionConstants.MSG_SENDER); router.executeActions(data); - snapLastCall("V4Router_ExactIn2Hops"); + vm.snapshotGasLastCall("V4Router_ExactIn2Hops"); } function test_gas_swapExactIn_3Hops() public { @@ -96,7 +95,7 @@ contract V4RouterTest is RoutingTestHelpers, GasSnapshot { bytes memory data = plan.finalizeSwap(currency0, currency3, ActionConstants.MSG_SENDER); router.executeActions(data); - snapLastCall("V4Router_ExactIn3Hops"); + vm.snapshotGasLastCall("V4Router_ExactIn3Hops"); } /*////////////////////////////////////////////////////////////// @@ -113,7 +112,7 @@ contract V4RouterTest is RoutingTestHelpers, GasSnapshot { bytes memory data = plan.finalizeSwap(nativeKey.currency0, nativeKey.currency1, ActionConstants.MSG_SENDER); router.executeActions{value: amountIn}(data); - snapLastCall("V4Router_ExactInputSingle_nativeIn"); + vm.snapshotGasLastCall("V4Router_ExactInputSingle_nativeIn"); } function test_gas_nativeOut_swapExactInputSingle() public { @@ -126,7 +125,7 @@ contract V4RouterTest is RoutingTestHelpers, GasSnapshot { bytes memory data = plan.finalizeSwap(nativeKey.currency1, nativeKey.currency0, ActionConstants.MSG_SENDER); router.executeActions(data); - snapLastCall("V4Router_ExactInputSingle_nativeOut"); + vm.snapshotGasLastCall("V4Router_ExactInputSingle_nativeOut"); } function test_gas_nativeIn_swapExactIn_1Hop() public { @@ -140,7 +139,7 @@ contract V4RouterTest is RoutingTestHelpers, GasSnapshot { bytes memory data = plan.finalizeSwap(CurrencyLibrary.ADDRESS_ZERO, currency0, ActionConstants.MSG_SENDER); router.executeActions{value: amountIn}(data); - snapLastCall("V4Router_ExactIn1Hop_nativeIn"); + vm.snapshotGasLastCall("V4Router_ExactIn1Hop_nativeIn"); } function test_gas_nativeOut_swapExactIn_1Hop() public { @@ -154,7 +153,7 @@ contract V4RouterTest is RoutingTestHelpers, GasSnapshot { bytes memory data = plan.finalizeSwap(currency0, CurrencyLibrary.ADDRESS_ZERO, ActionConstants.MSG_SENDER); router.executeActions(data); - snapLastCall("V4Router_ExactIn1Hop_nativeOut"); + vm.snapshotGasLastCall("V4Router_ExactIn1Hop_nativeOut"); } function test_gas_nativeIn_swapExactIn_2Hops() public { @@ -169,7 +168,7 @@ contract V4RouterTest is RoutingTestHelpers, GasSnapshot { bytes memory data = plan.finalizeSwap(CurrencyLibrary.ADDRESS_ZERO, currency1, ActionConstants.MSG_SENDER); router.executeActions{value: amountIn}(data); - snapLastCall("V4Router_ExactIn2Hops_nativeIn"); + vm.snapshotGasLastCall("V4Router_ExactIn2Hops_nativeIn"); } function test_gas_nativeIn_swapExactIn_3Hops() public { @@ -185,7 +184,7 @@ contract V4RouterTest is RoutingTestHelpers, GasSnapshot { bytes memory data = plan.finalizeSwap(CurrencyLibrary.ADDRESS_ZERO, currency2, ActionConstants.MSG_SENDER); router.executeActions{value: amountIn}(data); - snapLastCall("V4Router_ExactIn3Hops_nativeIn"); + vm.snapshotGasLastCall("V4Router_ExactIn3Hops_nativeIn"); } /*////////////////////////////////////////////////////////////// @@ -202,7 +201,7 @@ contract V4RouterTest is RoutingTestHelpers, GasSnapshot { bytes memory data = plan.finalizeSwap(key0.currency0, key0.currency1, ActionConstants.MSG_SENDER); router.executeActions(data); - snapLastCall("V4Router_ExactOutputSingle"); + vm.snapshotGasLastCall("V4Router_ExactOutputSingle"); } function test_gas_swapExactOut_1Hop_zeroForOne() public { @@ -216,7 +215,7 @@ contract V4RouterTest is RoutingTestHelpers, GasSnapshot { bytes memory data = plan.finalizeSwap(currency0, currency1, ActionConstants.MSG_SENDER); router.executeActions(data); - snapLastCall("V4Router_ExactOut1Hop_zeroForOne"); + vm.snapshotGasLastCall("V4Router_ExactOut1Hop_zeroForOne"); } function test_gas_swapExactOut_1Hop_oneForZero() public { @@ -230,7 +229,7 @@ contract V4RouterTest is RoutingTestHelpers, GasSnapshot { bytes memory data = plan.finalizeSwap(currency1, currency0, ActionConstants.MSG_SENDER); router.executeActions(data); - snapLastCall("V4Router_ExactOut1Hop_oneForZero"); + vm.snapshotGasLastCall("V4Router_ExactOut1Hop_oneForZero"); } function test_gas_swapExactOut_2Hops() public { @@ -245,7 +244,7 @@ contract V4RouterTest is RoutingTestHelpers, GasSnapshot { bytes memory data = plan.finalizeSwap(currency0, currency2, ActionConstants.MSG_SENDER); router.executeActions(data); - snapLastCall("V4Router_ExactOut2Hops"); + vm.snapshotGasLastCall("V4Router_ExactOut2Hops"); } function test_gas_swapExactOut_3Hops() public { @@ -261,7 +260,7 @@ contract V4RouterTest is RoutingTestHelpers, GasSnapshot { bytes memory data = plan.finalizeSwap(currency0, currency3, ActionConstants.MSG_SENDER); router.executeActions(data); - snapLastCall("V4Router_ExactOut3Hops"); + vm.snapshotGasLastCall("V4Router_ExactOut3Hops"); } /*////////////////////////////////////////////////////////////// @@ -278,7 +277,7 @@ contract V4RouterTest is RoutingTestHelpers, GasSnapshot { bytes memory data = plan.finalizeSwap(nativeKey.currency0, nativeKey.currency1, ActionConstants.MSG_SENDER); router.executeActionsAndSweepExcessETH{value: 2 ether}(data); - snapLastCall("V4Router_ExactOutputSingle_nativeIn_sweepETH"); + vm.snapshotGasLastCall("V4Router_ExactOutputSingle_nativeIn_sweepETH"); } function test_gas_nativeOut_swapExactOutputSingle() public { @@ -291,7 +290,7 @@ contract V4RouterTest is RoutingTestHelpers, GasSnapshot { bytes memory data = plan.finalizeSwap(nativeKey.currency1, nativeKey.currency0, ActionConstants.MSG_SENDER); router.executeActionsAndSweepExcessETH(data); - snapLastCall("V4Router_ExactOutputSingle_nativeOut"); + vm.snapshotGasLastCall("V4Router_ExactOutputSingle_nativeOut"); } function test_gas_nativeIn_swapExactOut_1Hop_sweepExcessETH() public { @@ -305,7 +304,7 @@ contract V4RouterTest is RoutingTestHelpers, GasSnapshot { bytes memory data = plan.finalizeSwap(CurrencyLibrary.ADDRESS_ZERO, currency0, ActionConstants.MSG_SENDER); router.executeActionsAndSweepExcessETH{value: 2 ether}(data); - snapLastCall("V4Router_ExactOut1Hop_nativeIn_sweepETH"); + vm.snapshotGasLastCall("V4Router_ExactOut1Hop_nativeIn_sweepETH"); } function test_gas_nativeOut_swapExactOut_1Hop() public { @@ -319,7 +318,7 @@ contract V4RouterTest is RoutingTestHelpers, GasSnapshot { bytes memory data = plan.finalizeSwap(currency0, CurrencyLibrary.ADDRESS_ZERO, ActionConstants.MSG_SENDER); router.executeActions(data); - snapLastCall("V4Router_ExactOut1Hop_nativeOut"); + vm.snapshotGasLastCall("V4Router_ExactOut1Hop_nativeOut"); } function test_gas_nativeIn_swapExactOut_2Hops_sweepExcessETH() public { @@ -334,7 +333,7 @@ contract V4RouterTest is RoutingTestHelpers, GasSnapshot { bytes memory data = plan.finalizeSwap(CurrencyLibrary.ADDRESS_ZERO, currency1, ActionConstants.MSG_SENDER); router.executeActionsAndSweepExcessETH{value: 2 ether}(data); - snapLastCall("V4Router_ExactOut2Hops_nativeIn"); + vm.snapshotGasLastCall("V4Router_ExactOut2Hops_nativeIn"); } function test_gas_nativeIn_swapExactOut_3Hops_sweepExcessETH() public { @@ -350,7 +349,7 @@ contract V4RouterTest is RoutingTestHelpers, GasSnapshot { bytes memory data = plan.finalizeSwap(CurrencyLibrary.ADDRESS_ZERO, currency2, ActionConstants.MSG_SENDER); router.executeActionsAndSweepExcessETH{value: 2 ether}(data); - snapLastCall("V4Router_ExactOut3Hops_nativeIn"); + vm.snapshotGasLastCall("V4Router_ExactOut3Hops_nativeIn"); } function test_gas_nativeOut_swapExactOut_3Hops() public { @@ -367,6 +366,6 @@ contract V4RouterTest is RoutingTestHelpers, GasSnapshot { bytes memory data = plan.finalizeSwap(currency2, CurrencyLibrary.ADDRESS_ZERO, ActionConstants.MSG_SENDER); router.executeActions(data); - snapLastCall("V4Router_ExactOut3Hops_nativeOut"); + vm.snapshotGasLastCall("V4Router_ExactOut3Hops_nativeOut"); } } From 8065052e543fafe1c4c8bdbb4031e64d91ae6415 Mon Sep 17 00:00:00 2001 From: Mark Toda Date: Thu, 24 Oct 2024 14:26:00 -0700 Subject: [PATCH 2/5] fix: merge conflicts --- snapshots/PaymentsTests.json | 8 ++-- snapshots/PosMGasTest.json | 60 +++++++++++++-------------- snapshots/PositionDescriptorTest.json | 2 +- snapshots/V4RouterTest.json | 48 ++++++++++----------- 4 files changed, 59 insertions(+), 59 deletions(-) diff --git a/snapshots/PaymentsTests.json b/snapshots/PaymentsTests.json index 1a4fc6e10..e8fdbdeb5 100644 --- a/snapshots/PaymentsTests.json +++ b/snapshots/PaymentsTests.json @@ -1,6 +1,6 @@ { - "Payments_swap_settleFromCaller_takeAllToMsgSender": "129601", - "Payments_swap_settleFromCaller_takeAllToSpecifiedAddress": "131664", - "Payments_swap_settleWithBalance_takeAllToMsgSender": "123869", - "Payments_swap_settleWithBalance_takeAllToSpecifiedAddress": "124011" + "Payments_swap_settleFromCaller_takeAllToMsgSender": "129642", + "Payments_swap_settleFromCaller_takeAllToSpecifiedAddress": "131705", + "Payments_swap_settleWithBalance_takeAllToMsgSender": "123910", + "Payments_swap_settleWithBalance_takeAllToSpecifiedAddress": "124052" } \ No newline at end of file diff --git a/snapshots/PosMGasTest.json b/snapshots/PosMGasTest.json index ffde6ad0e..363c9a455 100644 --- a/snapshots/PosMGasTest.json +++ b/snapshots/PosMGasTest.json @@ -1,38 +1,38 @@ { "PositionManager_burn_empty": "50446", "PositionManager_burn_empty_native": "50446", - "PositionManager_burn_nonEmpty_native_withClose": "125584", - "PositionManager_burn_nonEmpty_native_withTakePair": "125031", - "PositionManager_burn_nonEmpty_withClose": "132446", - "PositionManager_burn_nonEmpty_withTakePair": "131893", - "PositionManager_collect_native": "146294", - "PositionManager_collect_sameRange": "154872", - "PositionManager_collect_withClose": "154872", - "PositionManager_collect_withTakePair": "154193", - "PositionManager_decreaseLiquidity_native": "111980", - "PositionManager_decreaseLiquidity_withClose": "119753", - "PositionManager_decreaseLiquidity_withTakePair": "119074", - "PositionManager_decrease_burnEmpty": "135243", - "PositionManager_decrease_burnEmpty_native": "128380", - "PositionManager_decrease_sameRange_allLiquidity": "132440", - "PositionManager_decrease_take_take": "120329", - "PositionManager_increaseLiquidity_erc20_withClose": "159057", - "PositionManager_increaseLiquidity_erc20_withSettlePair": "157997", - "PositionManager_increaseLiquidity_native": "140872", + "PositionManager_burn_nonEmpty_native_withClose": "125624", + "PositionManager_burn_nonEmpty_native_withTakePair": "125106", + "PositionManager_burn_nonEmpty_withClose": "132486", + "PositionManager_burn_nonEmpty_withTakePair": "131968", + "PositionManager_collect_native": "146344", + "PositionManager_collect_sameRange": "154922", + "PositionManager_collect_withClose": "154922", + "PositionManager_collect_withTakePair": "154287", + "PositionManager_decreaseLiquidity_native": "112020", + "PositionManager_decreaseLiquidity_withClose": "119803", + "PositionManager_decreaseLiquidity_withTakePair": "119168", + "PositionManager_decrease_burnEmpty": "135283", + "PositionManager_decrease_burnEmpty_native": "128420", + "PositionManager_decrease_sameRange_allLiquidity": "132490", + "PositionManager_decrease_take_take": "120423", + "PositionManager_increaseLiquidity_erc20_withClose": "159083", + "PositionManager_increaseLiquidity_erc20_withSettlePair": "158035", + "PositionManager_increaseLiquidity_native": "140898", "PositionManager_increase_autocompoundExactUnclaimedFees": "136359", - "PositionManager_increase_autocompoundExcessFeesCredit": "177364", + "PositionManager_increase_autocompoundExcessFeesCredit": "177414", "PositionManager_increase_autocompound_clearExcess": "148040", - "PositionManager_mint_native": "364745", - "PositionManager_mint_nativeWithSweep_withClose": "373268", - "PositionManager_mint_nativeWithSweep_withSettlePair": "372491", - "PositionManager_mint_onSameTickLower": "317617", - "PositionManager_mint_onSameTickUpper": "318287", - "PositionManager_mint_sameRange": "243856", - "PositionManager_mint_settleWithBalance_sweep": "419060", - "PositionManager_mint_warmedPool_differentRange": "323648", - "PositionManager_mint_withClose": "420170", - "PositionManager_mint_withSettlePair": "419228", - "PositionManager_multicall_initialize_mint": "455975", + "PositionManager_mint_native": "364771", + "PositionManager_mint_nativeWithSweep_withClose": "373294", + "PositionManager_mint_nativeWithSweep_withSettlePair": "372529", + "PositionManager_mint_onSameTickLower": "317643", + "PositionManager_mint_onSameTickUpper": "318313", + "PositionManager_mint_sameRange": "243882", + "PositionManager_mint_settleWithBalance_sweep": "419098", + "PositionManager_mint_warmedPool_differentRange": "323674", + "PositionManager_mint_withClose": "420196", + "PositionManager_mint_withSettlePair": "419266", + "PositionManager_multicall_initialize_mint": "456001", "PositionManager_permit": "79076", "PositionManager_permit_secondPosition": "61976", "PositionManager_permit_twice": "44852", diff --git a/snapshots/PositionDescriptorTest.json b/snapshots/PositionDescriptorTest.json index 47a1cc5c5..d3219789c 100644 --- a/snapshots/PositionDescriptorTest.json +++ b/snapshots/PositionDescriptorTest.json @@ -1,3 +1,3 @@ { - "positionDescriptor bytecode size": "31074" + "positionDescriptor bytecode size": "31236" } \ No newline at end of file diff --git a/snapshots/V4RouterTest.json b/snapshots/V4RouterTest.json index c1153ec10..f229dbf07 100644 --- a/snapshots/V4RouterTest.json +++ b/snapshots/V4RouterTest.json @@ -1,26 +1,26 @@ { - "V4Router_Bytecode": "7037", - "V4Router_ExactIn1Hop_nativeIn": "115708", - "V4Router_ExactIn1Hop_nativeOut": "116029", - "V4Router_ExactIn1Hop_oneForZero": "124847", - "V4Router_ExactIn1Hop_zeroForOne": "130570", - "V4Router_ExactIn2Hops": "185411", - "V4Router_ExactIn2Hops_nativeIn": "170549", - "V4Router_ExactIn3Hops": "240255", - "V4Router_ExactIn3Hops_nativeIn": "225393", - "V4Router_ExactInputSingle": "129601", - "V4Router_ExactInputSingle_nativeIn": "114739", - "V4Router_ExactInputSingle_nativeOut": "115028", - "V4Router_ExactOut1Hop_nativeIn_sweepETH": "121971", - "V4Router_ExactOut1Hop_nativeOut": "117093", - "V4Router_ExactOut1Hop_oneForZero": "125911", - "V4Router_ExactOut1Hop_zeroForOne": "129856", - "V4Router_ExactOut2Hops": "183759", - "V4Router_ExactOut2Hops_nativeIn": "175874", - "V4Router_ExactOut3Hops": "237693", - "V4Router_ExactOut3Hops_nativeIn": "229808", - "V4Router_ExactOut3Hops_nativeOut": "217048", - "V4Router_ExactOutputSingle": "128884", - "V4Router_ExactOutputSingle_nativeIn_sweepETH": "120999", - "V4Router_ExactOutputSingle_nativeOut": "116195" + "V4Router_Bytecode": "7063", + "V4Router_ExactIn1Hop_nativeIn": "115753", + "V4Router_ExactIn1Hop_nativeOut": "116070", + "V4Router_ExactIn1Hop_oneForZero": "124888", + "V4Router_ExactIn1Hop_zeroForOne": "130611", + "V4Router_ExactIn2Hops": "185452", + "V4Router_ExactIn2Hops_nativeIn": "170594", + "V4Router_ExactIn3Hops": "240296", + "V4Router_ExactIn3Hops_nativeIn": "225438", + "V4Router_ExactInputSingle": "129642", + "V4Router_ExactInputSingle_nativeIn": "114784", + "V4Router_ExactInputSingle_nativeOut": "115069", + "V4Router_ExactOut1Hop_nativeIn_sweepETH": "122016", + "V4Router_ExactOut1Hop_nativeOut": "117134", + "V4Router_ExactOut1Hop_oneForZero": "125952", + "V4Router_ExactOut1Hop_zeroForOne": "129897", + "V4Router_ExactOut2Hops": "183800", + "V4Router_ExactOut2Hops_nativeIn": "175919", + "V4Router_ExactOut3Hops": "237734", + "V4Router_ExactOut3Hops_nativeIn": "229853", + "V4Router_ExactOut3Hops_nativeOut": "217089", + "V4Router_ExactOutputSingle": "128925", + "V4Router_ExactOutputSingle_nativeIn_sweepETH": "121044", + "V4Router_ExactOutputSingle_nativeOut": "116236" } \ No newline at end of file From 5651f67d471276e6b5e352c0e76bb2336ad08c05 Mon Sep 17 00:00:00 2001 From: Mark Toda Date: Wed, 30 Oct 2024 08:35:49 -0700 Subject: [PATCH 3/5] fix: ues core forge-std --- .gitmodules | 3 --- lib/forge-std | 1 - remappings.txt | 1 + 3 files changed, 1 insertion(+), 4 deletions(-) delete mode 160000 lib/forge-std diff --git a/.gitmodules b/.gitmodules index a06b89c81..9d6618d5b 100644 --- a/.gitmodules +++ b/.gitmodules @@ -4,6 +4,3 @@ [submodule "lib/permit2"] path = lib/permit2 url = https://github.com/Uniswap/permit2 -[submodule "lib/forge-std"] - path = lib/forge-std - url = https://github.com/foundry-rs/forge-std diff --git a/lib/forge-std b/lib/forge-std deleted file mode 160000 index 1de6eecf8..000000000 --- a/lib/forge-std +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 1de6eecf821de7fe2c908cc48d3ab3dced20717f diff --git a/remappings.txt b/remappings.txt index a78d8c9d0..822fdd158 100644 --- a/remappings.txt +++ b/remappings.txt @@ -1,4 +1,5 @@ @uniswap/v4-core/=lib/v4-core/ ds-test/=lib/v4-core/lib/forge-std/lib/ds-test/src/ +forge-std/=lib/v4-core/lib/forge-std/src/ openzeppelin-contracts/=lib/v4-core/lib/openzeppelin-contracts/ solmate/=lib/v4-core/lib/solmate/ From 5528d009c2c6db40f654ab18abb79f75e7686f8b Mon Sep 17 00:00:00 2001 From: Sara Reynolds Date: Wed, 4 Dec 2024 13:46:52 -0500 Subject: [PATCH 4/5] use native snap --- .forge-snapshots/positionManager bytecode size.snap | 1 - snapshots/PosMGasTest.json | 3 ++- test/position-managers/PositionManager.gas.t.sol | 5 ++--- 3 files changed, 4 insertions(+), 5 deletions(-) delete mode 100644 .forge-snapshots/positionManager bytecode size.snap diff --git a/.forge-snapshots/positionManager bytecode size.snap b/.forge-snapshots/positionManager bytecode size.snap deleted file mode 100644 index 404029b94..000000000 --- a/.forge-snapshots/positionManager bytecode size.snap +++ /dev/null @@ -1 +0,0 @@ -19060 \ No newline at end of file diff --git a/snapshots/PosMGasTest.json b/snapshots/PosMGasTest.json index 44ace6ed7..10bfc9b2f 100644 --- a/snapshots/PosMGasTest.json +++ b/snapshots/PosMGasTest.json @@ -37,5 +37,6 @@ "PositionManager_permit_secondPosition": "62159", "PositionManager_permit_twice": "45035", "PositionManager_subscribe": "88475", - "PositionManager_unsubscribe": "63253" + "PositionManager_unsubscribe": "63253", + "positionManager bytecode size": "19060" } \ No newline at end of file diff --git a/test/position-managers/PositionManager.gas.t.sol b/test/position-managers/PositionManager.gas.t.sol index 715d4a85d..fec639407 100644 --- a/test/position-managers/PositionManager.gas.t.sol +++ b/test/position-managers/PositionManager.gas.t.sol @@ -12,7 +12,6 @@ import {LiquidityAmounts} from "@uniswap/v4-core/test/utils/LiquidityAmounts.sol import {TickMath} from "@uniswap/v4-core/src/libraries/TickMath.sol"; import {FixedPointMathLib} from "solmate/src/utils/FixedPointMathLib.sol"; import {StateLibrary} from "@uniswap/v4-core/src/libraries/StateLibrary.sol"; -import {GasSnapshot} from "forge-gas-snapshot/GasSnapshot.sol"; import {IERC20} from "forge-std/interfaces/IERC20.sol"; @@ -26,7 +25,7 @@ import {PosmTestSetup} from "../shared/PosmTestSetup.sol"; import {ActionConstants} from "../../src/libraries/ActionConstants.sol"; import {MockSubscriber} from "../mocks/MockSubscriber.sol"; -contract PosMGasTest is Test, PosmTestSetup, GasSnapshot { +contract PosMGasTest is Test, PosmTestSetup { using FixedPointMathLib for uint256; using CurrencyLibrary for Currency; using PoolIdLibrary for PoolKey; @@ -76,7 +75,7 @@ contract PosMGasTest is Test, PosmTestSetup, GasSnapshot { } function test_bytecodeSize_positionManager() public { - snapSize("positionManager bytecode size", address(lpm)); + vm.snapshotValue("positionManager bytecode size", address(lpm).code.length); } function test_gas_mint_withClose() public { From 7da1be0a19b7c9f642452a5bcab2ca432136339e Mon Sep 17 00:00:00 2001 From: Sara Reynolds Date: Thu, 5 Dec 2024 16:03:44 -0500 Subject: [PATCH 5/5] remove dep --- .gitmodules | 3 --- lib/forge-gas-snapshot | 1 - 2 files changed, 4 deletions(-) delete mode 160000 lib/forge-gas-snapshot diff --git a/.gitmodules b/.gitmodules index fb9fdc7d4..9d6618d5b 100644 --- a/.gitmodules +++ b/.gitmodules @@ -4,6 +4,3 @@ [submodule "lib/permit2"] path = lib/permit2 url = https://github.com/Uniswap/permit2 -[submodule "lib/forge-gas-snapshot"] - path = lib/forge-gas-snapshot - url = https://github.com/marktoda/forge-gas-snapshot diff --git a/lib/forge-gas-snapshot b/lib/forge-gas-snapshot deleted file mode 160000 index 9fc447c73..000000000 --- a/lib/forge-gas-snapshot +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 9fc447c732c89b6dd6352c096042d8d82b44faed