From 3b8d801aa767b86d6d81442dd0ff2bf687269819 Mon Sep 17 00:00:00 2001 From: saucepoint <98790946+saucepoint@users.noreply.github.com> Date: Wed, 4 Dec 2024 19:55:42 -0500 Subject: [PATCH 1/2] Natspec: Inflated feeGrowthGlobal (#366) * natspec around inflated fee growth global * updated note * lint --- src/interfaces/ISubscriber.sol | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/interfaces/ISubscriber.sol b/src/interfaces/ISubscriber.sol index f2fc94df..238c88f3 100644 --- a/src/interfaces/ISubscriber.sol +++ b/src/interfaces/ISubscriber.sol @@ -6,14 +6,17 @@ import {PositionInfo} from "../libraries/PositionInfoLibrary.sol"; /// @notice Interface that a Subscriber contract should implement to receive updates from the v4 position manager interface ISubscriber { + /// @notice Called when a position subscribes to this subscriber contract /// @param tokenId the token ID of the position /// @param data additional data passed in by the caller function notifySubscribe(uint256 tokenId, bytes memory data) external; + /// @notice Called when a position unsubscribes from the subscriber /// @dev This call's gas is capped at `unsubscribeGasLimit` (set at deployment) /// @dev Because of EIP-150, solidity may only allocate 63/64 of gasleft() /// @param tokenId the token ID of the position function notifyUnsubscribe(uint256 tokenId) external; + /// @notice Called when a position is burned /// @param tokenId the token ID of the position /// @param owner the current owner of the tokenId @@ -22,8 +25,13 @@ interface ISubscriber { /// @param feesAccrued the fees accrued by the position if liquidity was decreased function notifyBurn(uint256 tokenId, address owner, PositionInfo info, uint256 liquidity, BalanceDelta feesAccrued) external; + + /// @notice Called when a position modifies its liquidity or collects fees /// @param tokenId the token ID of the position /// @param liquidityChange the change in liquidity on the underlying position /// @param feesAccrued the fees to be collected from the position as a result of the modifyLiquidity call + /// @dev Note that feesAccrued can be artificially inflated by a malicious user + /// Pools with a single liquidity position can inflate feeGrowthGlobal (and consequently feesAccrued) by donating to themselves; + /// atomically donating and collecting fees within the same unlockCallback may further inflate feeGrowthGlobal/feesAccrued function notifyModifyLiquidity(uint256 tokenId, int256 liquidityChange, BalanceDelta feesAccrued) external; } From 51df60a67366d3ca9a4f90e0dc4a5a12b56b18aa Mon Sep 17 00:00:00 2001 From: marktoda Date: Fri, 6 Dec 2024 08:09:41 -0800 Subject: [PATCH 2/2] feat: update to use native snapshots (#385) * feat: update to use native snapshots * fix: merge conflicts * fix: ues core forge-std * use native snap * remove dep --------- Co-authored-by: Sara Reynolds Co-authored-by: Sara Reynolds <30504811+snreynolds@users.noreply.github.com> --- .../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 - .../positionManager bytecode size.snap | 1 - .gitmodules | 3 - lib/forge-gas-snapshot | 1 - remappings.txt | 1 - snapshots/BaseActionsRouterTest.json | 3 + snapshots/PaymentsTests.json | 6 ++ snapshots/PosMGasTest.json | 42 ++++++++++ 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/StateViewTest.t.sol | 23 +++-- test/V4Quoter.t.sol | 29 ++++--- .../PositionManager.gas.t.sol | 83 +++++++++---------- .../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 ++++++------ 113 files changed, 210 insertions(+), 211 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 delete mode 100644 .forge-snapshots/positionManager bytecode size.snap delete mode 160000 lib/forge-gas-snapshot 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 20e1c5f4..00000000 --- a/.forge-snapshots/BaseActionsRouter_mock10commands.snap +++ /dev/null @@ -1 +0,0 @@ -61332 \ 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 770caaf9..00000000 --- a/.forge-snapshots/Payments_swap_settleFromCaller_takeAllToMsgSender.snap +++ /dev/null @@ -1 +0,0 @@ -132997 \ 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 3541eaf3..00000000 --- a/.forge-snapshots/Payments_swap_settleFromCaller_takeAllToSpecifiedAddress.snap +++ /dev/null @@ -1 +0,0 @@ -134973 \ 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 e05cffe7..00000000 --- a/.forge-snapshots/Payments_swap_settleWithBalance_takeAllToMsgSender.snap +++ /dev/null @@ -1 +0,0 @@ -127102 \ 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 9166a87d..00000000 --- a/.forge-snapshots/Payments_swap_settleWithBalance_takeAllToSpecifiedAddress.snap +++ /dev/null @@ -1 +0,0 @@ -127212 \ 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 88081af8..00000000 --- a/.forge-snapshots/PositionManager_burn_empty.snap +++ /dev/null @@ -1 +0,0 @@ -51576 \ 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 88081af8..00000000 --- a/.forge-snapshots/PositionManager_burn_empty_native.snap +++ /dev/null @@ -1 +0,0 @@ -51576 \ 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 b8ad8f5e..00000000 --- a/.forge-snapshots/PositionManager_burn_nonEmpty_native_withClose.snap +++ /dev/null @@ -1 +0,0 @@ -128316 \ 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 5f7fe3b4..00000000 --- a/.forge-snapshots/PositionManager_burn_nonEmpty_native_withTakePair.snap +++ /dev/null @@ -1 +0,0 @@ -127696 \ 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 f821b49c..00000000 --- a/.forge-snapshots/PositionManager_burn_nonEmpty_withClose.snap +++ /dev/null @@ -1 +0,0 @@ -135236 \ 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 46630b5d..00000000 --- a/.forge-snapshots/PositionManager_burn_nonEmpty_withTakePair.snap +++ /dev/null @@ -1 +0,0 @@ -134615 \ 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 86f96529..00000000 --- a/.forge-snapshots/PositionManager_collect_native.snap +++ /dev/null @@ -1 +0,0 @@ -148571 \ 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 e2b8005b..00000000 --- a/.forge-snapshots/PositionManager_collect_sameRange.snap +++ /dev/null @@ -1 +0,0 @@ -157220 \ 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 e2b8005b..00000000 --- a/.forge-snapshots/PositionManager_collect_withClose.snap +++ /dev/null @@ -1 +0,0 @@ -157220 \ 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 ccb34392..00000000 --- a/.forge-snapshots/PositionManager_collect_withTakePair.snap +++ /dev/null @@ -1 +0,0 @@ -156456 \ 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 c2b5120a..00000000 --- a/.forge-snapshots/PositionManager_decreaseLiquidity_native.snap +++ /dev/null @@ -1 +0,0 @@ -114165 \ 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 bdea68d3..00000000 --- a/.forge-snapshots/PositionManager_decreaseLiquidity_withClose.snap +++ /dev/null @@ -1 +0,0 @@ -122555 \ 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 8c20e971..00000000 --- a/.forge-snapshots/PositionManager_decreaseLiquidity_withTakePair.snap +++ /dev/null @@ -1 +0,0 @@ -121791 \ 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 dbd7a9ac..00000000 --- a/.forge-snapshots/PositionManager_decrease_burnEmpty.snap +++ /dev/null @@ -1 +0,0 @@ -138177 \ 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 4622f7b4..00000000 --- a/.forge-snapshots/PositionManager_decrease_burnEmpty_native.snap +++ /dev/null @@ -1 +0,0 @@ -131258 \ 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 105b3001..00000000 --- a/.forge-snapshots/PositionManager_decrease_sameRange_allLiquidity.snap +++ /dev/null @@ -1 +0,0 @@ -135218 \ 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 a34b498c..00000000 --- a/.forge-snapshots/PositionManager_decrease_take_take.snap +++ /dev/null @@ -1 +0,0 @@ -123169 \ 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 0c144b4d..00000000 --- a/.forge-snapshots/PositionManager_increaseLiquidity_erc20_withClose.snap +++ /dev/null @@ -1 +0,0 @@ -162419 \ 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 5b88c621..00000000 --- a/.forge-snapshots/PositionManager_increaseLiquidity_erc20_withSettlePair.snap +++ /dev/null @@ -1 +0,0 @@ -161283 \ 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 dd90e5a5..00000000 --- a/.forge-snapshots/PositionManager_increaseLiquidity_native.snap +++ /dev/null @@ -1 +0,0 @@ -145296 \ 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 6312e8dd..00000000 --- a/.forge-snapshots/PositionManager_increase_autocompoundExactUnclaimedFees.snap +++ /dev/null @@ -1 +0,0 @@ -138010 \ 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 cf908d5c..00000000 --- a/.forge-snapshots/PositionManager_increase_autocompoundExcessFeesCredit.snap +++ /dev/null @@ -1 +0,0 @@ -180194 \ 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 c9779d02..00000000 --- a/.forge-snapshots/PositionManager_increase_autocompound_clearExcess.snap +++ /dev/null @@ -1 +0,0 @@ -150782 \ 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 ad9b48ff..00000000 --- a/.forge-snapshots/PositionManager_mint_native.snap +++ /dev/null @@ -1 +0,0 @@ -369623 \ 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 6d4460fb..00000000 --- a/.forge-snapshots/PositionManager_mint_nativeWithSweep_withClose.snap +++ /dev/null @@ -1 +0,0 @@ -378280 \ 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 351997f8..00000000 --- a/.forge-snapshots/PositionManager_mint_nativeWithSweep_withSettlePair.snap +++ /dev/null @@ -1 +0,0 @@ -377364 \ 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 dcb8d5ae..00000000 --- a/.forge-snapshots/PositionManager_mint_onSameTickLower.snap +++ /dev/null @@ -1 +0,0 @@ -321205 \ 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 3a7c7c34..00000000 --- a/.forge-snapshots/PositionManager_mint_onSameTickUpper.snap +++ /dev/null @@ -1 +0,0 @@ -321875 \ 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 7d8a2686..00000000 --- a/.forge-snapshots/PositionManager_mint_sameRange.snap +++ /dev/null @@ -1 +0,0 @@ -247444 \ 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 4d62f1da..00000000 --- a/.forge-snapshots/PositionManager_mint_settleWithBalance_sweep.snap +++ /dev/null @@ -1 +0,0 @@ -423280 \ 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 fcd47aaf..00000000 --- a/.forge-snapshots/PositionManager_mint_warmedPool_differentRange.snap +++ /dev/null @@ -1 +0,0 @@ -327236 \ 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 59610f85..00000000 --- a/.forge-snapshots/PositionManager_mint_withClose.snap +++ /dev/null @@ -1 +0,0 @@ -423986 \ 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 b3a6480c..00000000 --- a/.forge-snapshots/PositionManager_mint_withSettlePair.snap +++ /dev/null @@ -1 +0,0 @@ -422936 \ 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 19380f4f..00000000 --- a/.forge-snapshots/PositionManager_multicall_initialize_mint.snap +++ /dev/null @@ -1 +0,0 @@ -460558 \ 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 53dd01e7..00000000 --- a/.forge-snapshots/PositionManager_permit.snap +++ /dev/null @@ -1 +0,0 @@ -79259 \ 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 ac17c65c..00000000 --- a/.forge-snapshots/PositionManager_permit_secondPosition.snap +++ /dev/null @@ -1 +0,0 @@ -62159 \ 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 532d2de9..00000000 --- a/.forge-snapshots/PositionManager_permit_twice.snap +++ /dev/null @@ -1 +0,0 @@ -45035 \ 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 f6081d8d..00000000 --- a/.forge-snapshots/PositionManager_subscribe.snap +++ /dev/null @@ -1 +0,0 @@ -88475 \ 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 3651ba8a..00000000 --- a/.forge-snapshots/PositionManager_unsubscribe.snap +++ /dev/null @@ -1 +0,0 @@ -63253 \ 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 cb86556e..00000000 --- a/.forge-snapshots/Quoter_exactInputSingle_oneForZero_multiplePositions.snap +++ /dev/null @@ -1 +0,0 @@ -146317 \ 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 8cf53dc8..00000000 --- a/.forge-snapshots/Quoter_exactInputSingle_zeroForOne_multiplePositions.snap +++ /dev/null @@ -1 +0,0 @@ -151973 \ 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 2f2aa6ed..00000000 --- a/.forge-snapshots/Quoter_exactOutputSingle_oneForZero.snap +++ /dev/null @@ -1 +0,0 @@ -80048 \ 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 9606490a..00000000 --- a/.forge-snapshots/Quoter_exactOutputSingle_zeroForOne.snap +++ /dev/null @@ -1 +0,0 @@ -84626 \ 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 9aebeeca..00000000 --- a/.forge-snapshots/Quoter_quoteExactInput_oneHop_1TickLoaded.snap +++ /dev/null @@ -1 +0,0 @@ -122994 \ 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 1a3ae713..00000000 --- a/.forge-snapshots/Quoter_quoteExactInput_oneHop_initializedAfter.snap +++ /dev/null @@ -1 +0,0 @@ -147949 \ 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 1ce389ff..00000000 --- a/.forge-snapshots/Quoter_quoteExactInput_oneHop_startingInitialized.snap +++ /dev/null @@ -1 +0,0 @@ -81420 \ 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 7fe1af46..00000000 --- a/.forge-snapshots/Quoter_quoteExactInput_twoHops.snap +++ /dev/null @@ -1 +0,0 @@ -205421 \ 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 6233611d..00000000 --- a/.forge-snapshots/Quoter_quoteExactOutput_oneHop_1TickLoaded.snap +++ /dev/null @@ -1 +0,0 @@ -122296 \ 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 ee524ce0..00000000 --- a/.forge-snapshots/Quoter_quoteExactOutput_oneHop_2TicksLoaded.snap +++ /dev/null @@ -1 +0,0 @@ -152648 \ 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 f965907a..00000000 --- a/.forge-snapshots/Quoter_quoteExactOutput_oneHop_initializedAfter.snap +++ /dev/null @@ -1 +0,0 @@ -122364 \ 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 f813bc4b..00000000 --- a/.forge-snapshots/Quoter_quoteExactOutput_oneHop_startingInitialized.snap +++ /dev/null @@ -1 +0,0 @@ -98875 \ 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 584ea142..00000000 --- a/.forge-snapshots/Quoter_quoteExactOutput_twoHops.snap +++ /dev/null @@ -1 +0,0 @@ -204897 \ 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 a9e72c33..00000000 --- a/.forge-snapshots/StateView_extsload_getFeeGrowthGlobals.snap +++ /dev/null @@ -1 +0,0 @@ -2367 \ 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 b1b49287..00000000 --- a/.forge-snapshots/StateView_extsload_getFeeGrowthInside.snap +++ /dev/null @@ -1 +0,0 @@ -8444 \ 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 ab57eb1e..00000000 --- a/.forge-snapshots/StateView_extsload_getLiquidity.snap +++ /dev/null @@ -1 +0,0 @@ -1480 \ 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 0a1ca398..00000000 --- a/.forge-snapshots/StateView_extsload_getPositionInfo.snap +++ /dev/null @@ -1 +0,0 @@ -2973 \ 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 8d643083..00000000 --- a/.forge-snapshots/StateView_extsload_getPositionLiquidity.snap +++ /dev/null @@ -1 +0,0 @@ -1750 \ 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 466fe402..00000000 --- a/.forge-snapshots/StateView_extsload_getSlot0.snap +++ /dev/null @@ -1 +0,0 @@ -1548 \ 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 0e8ebf59..00000000 --- a/.forge-snapshots/StateView_extsload_getTickBitmap.snap +++ /dev/null @@ -1 +0,0 @@ -1476 \ 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 7c43ea01..00000000 --- a/.forge-snapshots/StateView_extsload_getTickFeeGrowthOutside.snap +++ /dev/null @@ -1 +0,0 @@ -2672 \ 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 3582118c..00000000 --- a/.forge-snapshots/StateView_extsload_getTickInfo.snap +++ /dev/null @@ -1 +0,0 @@ -2896 \ 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 0504b068..00000000 --- a/.forge-snapshots/StateView_extsload_getTickLiquidity.snap +++ /dev/null @@ -1 +0,0 @@ -1748 \ 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 ec718f71..00000000 --- a/.forge-snapshots/V4Router_Bytecode.snap +++ /dev/null @@ -1 +0,0 @@ -5137 \ 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 56a7e65e..00000000 --- a/.forge-snapshots/V4Router_ExactIn1Hop_nativeIn.snap +++ /dev/null @@ -1 +0,0 @@ -121819 \ 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 cbfeb1a9..00000000 --- a/.forge-snapshots/V4Router_ExactIn1Hop_nativeOut.snap +++ /dev/null @@ -1 +0,0 @@ -120826 \ 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 6bf2eef7..00000000 --- a/.forge-snapshots/V4Router_ExactIn1Hop_oneForZero.snap +++ /dev/null @@ -1 +0,0 @@ -129715 \ 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 891422a7..00000000 --- a/.forge-snapshots/V4Router_ExactIn1Hop_zeroForOne.snap +++ /dev/null @@ -1 +0,0 @@ -135623 \ 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 a7bc469a..00000000 --- a/.forge-snapshots/V4Router_ExactIn2Hops.snap +++ /dev/null @@ -1 +0,0 @@ -191979 \ 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 ef0bcd5f..00000000 --- a/.forge-snapshots/V4Router_ExactIn2Hops_nativeIn.snap +++ /dev/null @@ -1 +0,0 @@ -178175 \ 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 89acd064..00000000 --- a/.forge-snapshots/V4Router_ExactIn3Hops.snap +++ /dev/null @@ -1 +0,0 @@ -248385 \ 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 a93abe95..00000000 --- a/.forge-snapshots/V4Router_ExactIn3Hops_nativeIn.snap +++ /dev/null @@ -1 +0,0 @@ -234581 \ 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 24fe6dec..00000000 --- a/.forge-snapshots/V4Router_ExactInputSingle.snap +++ /dev/null @@ -1 +0,0 @@ -134546 \ 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 7f06d7f0..00000000 --- a/.forge-snapshots/V4Router_ExactInputSingle_nativeIn.snap +++ /dev/null @@ -1 +0,0 @@ -120742 \ 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 4e26e853..00000000 --- a/.forge-snapshots/V4Router_ExactInputSingle_nativeOut.snap +++ /dev/null @@ -1 +0,0 @@ -119714 \ 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 1fdaa9cd..00000000 --- a/.forge-snapshots/V4Router_ExactOut1Hop_nativeIn_sweepETH.snap +++ /dev/null @@ -1 +0,0 @@ -128078 \ 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 5680b027..00000000 --- a/.forge-snapshots/V4Router_ExactOut1Hop_nativeOut.snap +++ /dev/null @@ -1 +0,0 @@ -121895 \ 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 85542b79..00000000 --- a/.forge-snapshots/V4Router_ExactOut1Hop_oneForZero.snap +++ /dev/null @@ -1 +0,0 @@ -130784 \ 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 a883e880..00000000 --- a/.forge-snapshots/V4Router_ExactOut1Hop_zeroForOne.snap +++ /dev/null @@ -1 +0,0 @@ -134905 \ 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 eb9099cb..00000000 --- a/.forge-snapshots/V4Router_ExactOut2Hops.snap +++ /dev/null @@ -1 +0,0 @@ -190319 \ 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 c2de3e9b..00000000 --- a/.forge-snapshots/V4Router_ExactOut2Hops_nativeIn.snap +++ /dev/null @@ -1 +0,0 @@ -183492 \ 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 ddf200aa..00000000 --- a/.forge-snapshots/V4Router_ExactOut3Hops.snap +++ /dev/null @@ -1 +0,0 @@ -245811 \ 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 583269ae..00000000 --- a/.forge-snapshots/V4Router_ExactOut3Hops_nativeIn.snap +++ /dev/null @@ -1 +0,0 @@ -238984 \ 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 0ff3d5c8..00000000 --- a/.forge-snapshots/V4Router_ExactOut3Hops_nativeOut.snap +++ /dev/null @@ -1 +0,0 @@ -224567 \ 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 d44e2734..00000000 --- a/.forge-snapshots/V4Router_ExactOutputSingle.snap +++ /dev/null @@ -1 +0,0 @@ -133809 \ 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 fc1ac568..00000000 --- a/.forge-snapshots/V4Router_ExactOutputSingle_nativeIn_sweepETH.snap +++ /dev/null @@ -1 +0,0 @@ -126982 \ 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 dacad49f..00000000 --- a/.forge-snapshots/V4Router_ExactOutputSingle_nativeOut.snap +++ /dev/null @@ -1 +0,0 @@ -120876 \ 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 60d759c4..00000000 --- a/.forge-snapshots/positionDescriptor bytecode size.snap +++ /dev/null @@ -1 +0,0 @@ -24110 \ No newline at end of file diff --git a/.forge-snapshots/positionManager bytecode size.snap b/.forge-snapshots/positionManager bytecode size.snap deleted file mode 100644 index 404029b9..00000000 --- a/.forge-snapshots/positionManager bytecode size.snap +++ /dev/null @@ -1 +0,0 @@ -19060 \ No newline at end of file diff --git a/.gitmodules b/.gitmodules index fb9fdc7d..9d6618d5 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 9fc447c7..00000000 --- a/lib/forge-gas-snapshot +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 9fc447c732c89b6dd6352c096042d8d82b44faed diff --git a/remappings.txt b/remappings.txt index c4f006e7..822fdd15 100644 --- a/remappings.txt +++ b/remappings.txt @@ -1,5 +1,4 @@ @uniswap/v4-core/=lib/v4-core/ -forge-gas-snapshot/=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/ diff --git a/snapshots/BaseActionsRouterTest.json b/snapshots/BaseActionsRouterTest.json new file mode 100644 index 00000000..7290bb57 --- /dev/null +++ b/snapshots/BaseActionsRouterTest.json @@ -0,0 +1,3 @@ +{ + "BaseActionsRouter_mock10commands": "61332" +} \ No newline at end of file diff --git a/snapshots/PaymentsTests.json b/snapshots/PaymentsTests.json new file mode 100644 index 00000000..f2523f09 --- /dev/null +++ b/snapshots/PaymentsTests.json @@ -0,0 +1,6 @@ +{ + "Payments_swap_settleFromCaller_takeAllToMsgSender": "132997", + "Payments_swap_settleFromCaller_takeAllToSpecifiedAddress": "134973", + "Payments_swap_settleWithBalance_takeAllToMsgSender": "127102", + "Payments_swap_settleWithBalance_takeAllToSpecifiedAddress": "127212" +} \ No newline at end of file diff --git a/snapshots/PosMGasTest.json b/snapshots/PosMGasTest.json new file mode 100644 index 00000000..10bfc9b2 --- /dev/null +++ b/snapshots/PosMGasTest.json @@ -0,0 +1,42 @@ +{ + "PositionManager_burn_empty": "51576", + "PositionManager_burn_empty_native": "51576", + "PositionManager_burn_nonEmpty_native_withClose": "128316", + "PositionManager_burn_nonEmpty_native_withTakePair": "127696", + "PositionManager_burn_nonEmpty_withClose": "135236", + "PositionManager_burn_nonEmpty_withTakePair": "134615", + "PositionManager_collect_native": "148571", + "PositionManager_collect_sameRange": "157220", + "PositionManager_collect_withClose": "157220", + "PositionManager_collect_withTakePair": "156456", + "PositionManager_decreaseLiquidity_native": "114165", + "PositionManager_decreaseLiquidity_withClose": "122555", + "PositionManager_decreaseLiquidity_withTakePair": "121791", + "PositionManager_decrease_burnEmpty": "138177", + "PositionManager_decrease_burnEmpty_native": "131258", + "PositionManager_decrease_sameRange_allLiquidity": "135218", + "PositionManager_decrease_take_take": "123169", + "PositionManager_increaseLiquidity_erc20_withClose": "162419", + "PositionManager_increaseLiquidity_erc20_withSettlePair": "161283", + "PositionManager_increaseLiquidity_native": "145296", + "PositionManager_increase_autocompoundExactUnclaimedFees": "138010", + "PositionManager_increase_autocompoundExcessFeesCredit": "180194", + "PositionManager_increase_autocompound_clearExcess": "150782", + "PositionManager_mint_native": "369623", + "PositionManager_mint_nativeWithSweep_withClose": "378280", + "PositionManager_mint_nativeWithSweep_withSettlePair": "377364", + "PositionManager_mint_onSameTickLower": "321205", + "PositionManager_mint_onSameTickUpper": "321875", + "PositionManager_mint_sameRange": "247444", + "PositionManager_mint_settleWithBalance_sweep": "423280", + "PositionManager_mint_warmedPool_differentRange": "327236", + "PositionManager_mint_withClose": "423986", + "PositionManager_mint_withSettlePair": "422936", + "PositionManager_multicall_initialize_mint": "460558", + "PositionManager_permit": "79259", + "PositionManager_permit_secondPosition": "62159", + "PositionManager_permit_twice": "45035", + "PositionManager_subscribe": "88475", + "PositionManager_unsubscribe": "63253", + "positionManager bytecode size": "19060" +} \ No newline at end of file diff --git a/snapshots/PositionDescriptorTest.json b/snapshots/PositionDescriptorTest.json new file mode 100644 index 00000000..32cd6922 --- /dev/null +++ b/snapshots/PositionDescriptorTest.json @@ -0,0 +1,3 @@ +{ + "positionDescriptor bytecode size": "24179" +} \ No newline at end of file diff --git a/snapshots/QuoterTest.json b/snapshots/QuoterTest.json new file mode 100644 index 00000000..34049732 --- /dev/null +++ b/snapshots/QuoterTest.json @@ -0,0 +1,15 @@ +{ + "Quoter_exactInputSingle_oneForZero_multiplePositions": "146317", + "Quoter_exactInputSingle_zeroForOne_multiplePositions": "151973", + "Quoter_exactOutputSingle_oneForZero": "80048", + "Quoter_exactOutputSingle_zeroForOne": "84626", + "Quoter_quoteExactInput_oneHop_1TickLoaded": "122994", + "Quoter_quoteExactInput_oneHop_initializedAfter": "147949", + "Quoter_quoteExactInput_oneHop_startingInitialized": "81420", + "Quoter_quoteExactInput_twoHops": "205421", + "Quoter_quoteExactOutput_oneHop_1TickLoaded": "122296", + "Quoter_quoteExactOutput_oneHop_2TicksLoaded": "152648", + "Quoter_quoteExactOutput_oneHop_initializedAfter": "122364", + "Quoter_quoteExactOutput_oneHop_startingInitialized": "98875", + "Quoter_quoteExactOutput_twoHops": "204897" +} \ No newline at end of file diff --git a/snapshots/StateViewTest.json b/snapshots/StateViewTest.json new file mode 100644 index 00000000..8da85637 --- /dev/null +++ b/snapshots/StateViewTest.json @@ -0,0 +1,12 @@ +{ + "StateView_extsload_getFeeGrowthGlobals": "2367", + "StateView_extsload_getFeeGrowthInside": "8444", + "StateView_extsload_getLiquidity": "1480", + "StateView_extsload_getPositionInfo": "2973", + "StateView_extsload_getPositionLiquidity": "1750", + "StateView_extsload_getSlot0": "1548", + "StateView_extsload_getTickBitmap": "1476", + "StateView_extsload_getTickFeeGrowthOutside": "2672", + "StateView_extsload_getTickInfo": "2896", + "StateView_extsload_getTickLiquidity": "1748" +} \ No newline at end of file diff --git a/snapshots/V4RouterTest.json b/snapshots/V4RouterTest.json new file mode 100644 index 00000000..0b39471b --- /dev/null +++ b/snapshots/V4RouterTest.json @@ -0,0 +1,26 @@ +{ + "V4Router_Bytecode": "5137", + "V4Router_ExactIn1Hop_nativeIn": "121819", + "V4Router_ExactIn1Hop_nativeOut": "120826", + "V4Router_ExactIn1Hop_oneForZero": "129715", + "V4Router_ExactIn1Hop_zeroForOne": "135623", + "V4Router_ExactIn2Hops": "191979", + "V4Router_ExactIn2Hops_nativeIn": "178175", + "V4Router_ExactIn3Hops": "248385", + "V4Router_ExactIn3Hops_nativeIn": "234581", + "V4Router_ExactInputSingle": "134546", + "V4Router_ExactInputSingle_nativeIn": "120742", + "V4Router_ExactInputSingle_nativeOut": "119714", + "V4Router_ExactOut1Hop_nativeIn_sweepETH": "128078", + "V4Router_ExactOut1Hop_nativeOut": "121895", + "V4Router_ExactOut1Hop_oneForZero": "130784", + "V4Router_ExactOut1Hop_zeroForOne": "134905", + "V4Router_ExactOut2Hops": "190319", + "V4Router_ExactOut2Hops_nativeIn": "183492", + "V4Router_ExactOut3Hops": "245811", + "V4Router_ExactOut3Hops_nativeIn": "238984", + "V4Router_ExactOut3Hops_nativeOut": "224567", + "V4Router_ExactOutputSingle": "133809", + "V4Router_ExactOutputSingle_nativeIn_sweepETH": "126982", + "V4Router_ExactOutputSingle_nativeOut": "120876" +} \ No newline at end of file diff --git a/test/BaseActionsRouter.t.sol b/test/BaseActionsRouter.t.sol index 0a6bbc76..33a39add 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 212939b6..e1f1ce6a 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 4b326814..c20465f0 100644 --- a/test/PositionDescriptor.t.sol +++ b/test/PositionDescriptor.t.sol @@ -11,13 +11,12 @@ 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"; import {Currency, CurrencyLibrary} from "@uniswap/v4-core/src/types/Currency.sol"; import {SafeCurrencyMetadata} from "../src/libraries/SafeCurrencyMetadata.sol"; import {AddressStringUtil} from "../src/libraries/AddressStringUtil.sol"; import {Descriptor} from "../src/libraries/Descriptor.sol"; -contract PositionDescriptorTest is Test, PosmTestSetup, GasSnapshot { +contract PositionDescriptorTest is Test, PosmTestSetup { using Base64 for string; using CurrencyLibrary for Currency; @@ -43,7 +42,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/StateViewTest.t.sol b/test/StateViewTest.t.sol index c243f12f..64a6e750 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/V4Quoter.t.sol b/test/V4Quoter.t.sol index fc91ce47..3b8b03f8 100644 --- a/test/V4Quoter.t.sol +++ b/test/V4Quoter.t.sol @@ -7,7 +7,6 @@ import {PathKey} from "../src/libraries/PathKey.sol"; import {IV4Quoter} from "../src/interfaces/IV4Quoter.sol"; import {V4Quoter} from "../src/lens/V4Quoter.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/position-managers/PositionManager.gas.t.sol b/test/position-managers/PositionManager.gas.t.sol index bf27604f..fec63940 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; @@ -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 { @@ -95,7 +94,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 { @@ -114,7 +113,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 { @@ -140,7 +139,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 { @@ -166,7 +165,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 { @@ -192,7 +191,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 { @@ -206,7 +205,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 { @@ -220,7 +219,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 { @@ -266,7 +265,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 { @@ -315,7 +314,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 @@ -361,7 +360,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 { @@ -375,7 +374,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 { @@ -389,7 +388,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 { @@ -424,7 +423,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 { @@ -441,7 +440,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 { @@ -458,7 +457,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 @@ -481,7 +480,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 { @@ -500,7 +499,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 { @@ -521,7 +520,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 { @@ -534,7 +533,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 { @@ -547,7 +546,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 { @@ -562,7 +561,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 { @@ -582,7 +581,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. @@ -601,7 +600,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 { @@ -634,7 +633,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 { @@ -666,7 +665,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 { @@ -682,7 +681,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 { @@ -692,7 +691,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 { @@ -704,7 +703,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 { @@ -717,7 +716,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 { @@ -730,7 +729,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 { @@ -745,7 +744,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 { @@ -763,7 +762,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 { @@ -783,7 +782,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 { @@ -817,7 +816,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 { @@ -847,7 +846,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 { @@ -879,7 +878,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 @@ -895,7 +894,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 { @@ -903,9 +902,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 de25bc41..5dd2aea8 100644 --- a/test/position-managers/PositionManager.notifier.t.sol +++ b/test/position-managers/PositionManager.notifier.t.sol @@ -11,7 +11,6 @@ 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 {Hooks} from "@uniswap/v4-core/src/libraries/Hooks.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"; @@ -24,7 +23,7 @@ import {MockReturnDataSubscriber, MockRevertSubscriber} from "../mocks/MockBadSu import {PositionInfoLibrary, PositionInfo} from "../../src/libraries/PositionInfoLibrary.sol"; import {MockReenterHook} from "../mocks/MockReenterHook.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 6ee98bff..06d13918 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 { @@ -44,7 +43,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 { @@ -61,7 +60,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 { @@ -79,6 +78,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 cb50c172..832159cc 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 c49f96dc..3be32029 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"); } }