From 35edd8eda629b4e6eedb486e7f6e5cb74a8e4071 Mon Sep 17 00:00:00 2001 From: Daniel Gretzke Date: Tue, 28 May 2024 14:45:29 +0200 Subject: [PATCH] Enable via IR compilation / memory safe issue fix (#692) * annotate functions as memory-safe to pass compilation via ir * Adjust solidity version and increase optimizer runs * Remove gas tests that fail because via IR optimizes the code in a way that the gas overhead subtraction in the gas snapshot library causes an underflow * regenerate gas snapshots * regenerate gas snapshots * increase optimizer runs --- .../BitMathLeastSignificantBitMaxUint128.snap | 2 +- .../BitMathLeastSignificantBitMaxUint256.snap | 2 +- .../BitMathLeastSignificantBitSmallNumber.snap | 2 +- .../BitMathMostSignificantBitMaxUint128.snap | 2 +- .../BitMathMostSignificantBitMaxUint256.snap | 2 +- .../BitMathMostSignificantBitSmallNumber.snap | 2 +- .forge-snapshots/ERC6909Claims approve.snap | 2 +- .forge-snapshots/ERC6909Claims burn.snap | 2 +- .forge-snapshots/ERC6909Claims mint.snap | 2 +- .forge-snapshots/ERC6909Claims transfer.snap | 2 +- .../ERC6909Claims transferFrom as operator.snap | 2 +- ...RC6909Claims transferFrom with approval.snap | 2 +- ...ims transferFrom with infinite approval.snap | 2 +- .forge-snapshots/HooksShouldCallBeforeSwap.snap | 1 - .forge-snapshots/NoDelegateCall.snap | 2 +- .../SwapMath_oneForZero_exactInCapped.snap | 2 +- .../SwapMath_oneForZero_exactInPartial.snap | 2 +- .../SwapMath_oneForZero_exactOutCapped.snap | 2 +- .../SwapMath_oneForZero_exactOutPartial.snap | 2 +- .../SwapMath_zeroForOne_exactInCapped.snap | 2 +- .../SwapMath_zeroForOne_exactInPartial.snap | 2 +- .../SwapMath_zeroForOne_exactOutCapped.snap | 2 +- .../SwapMath_zeroForOne_exactOutPartial.snap | 2 +- .../TickMathGetSqrtPriceAtTick.snap | 2 +- .../TickMathGetTickAtSqrtPrice.snap | 2 +- ... to already existing position with salt.snap | 2 +- .forge-snapshots/addLiquidity CA fee.snap | 2 +- .../addLiquidity with empty hook.snap | 2 +- .../addLiquidity with native token.snap | 2 +- .forge-snapshots/calculateSwapFee.snap | 1 - ...e new liquidity to a position with salt.snap | 2 +- .forge-snapshots/donate gas with 1 token.snap | 2 +- .forge-snapshots/donate gas with 2 tokens.snap | 2 +- .../erc20 collect protocol fees.snap | 2 +- .../extsload getFeeGrowthGlobals.snap | 2 +- .../extsload getFeeGrowthInside.snap | 2 +- .forge-snapshots/extsload getLiquidity.snap | 2 +- .forge-snapshots/extsload getPositionInfo.snap | 2 +- .../extsload getPositionLiquidity.snap | 2 +- .forge-snapshots/extsload getSlot0.snap | 2 +- .forge-snapshots/extsload getTickBitmap.snap | 2 +- .../extsload getTickFeeGrowthOutside.snap | 2 +- .forge-snapshots/extsload getTickInfo.snap | 2 +- .forge-snapshots/extsload getTickLiquidity.snap | 2 +- ...flippingATickThatResultsInDeletingAWord.snap | 2 +- ...ck_flippingFirstTickInWordToInitialized.snap | 2 +- ...k_flippingSecondTickInWordToInitialized.snap | 2 +- ...ta_gasCostForAmount0WhereRoundUpIsFalse.snap | 2 +- ...lta_gasCostForAmount0WhereRoundUpIsTrue.snap | 2 +- ...ta_gasCostForAmount1WhereRoundUpIsFalse.snap | 2 +- ...lta_gasCostForAmount1WhereRoundUpIsTrue.snap | 2 +- ...PriceFromInput_zeroForOneEqualsFalseGas.snap | 2 +- ...tPriceFromInput_zeroForOneEqualsTrueGas.snap | 2 +- ...riceFromOutput_zeroForOneEqualsFalseGas.snap | 2 +- ...PriceFromOutput_zeroForOneEqualsTrueGas.snap | 2 +- .forge-snapshots/getReserves.snap | 2 +- .forge-snapshots/initialize.snap | 2 +- .../native collect protocol fees.snap | 2 +- ...ickWithinOneWord_lteFalse_forEntireWord.snap | 2 +- ...ithinOneWord_lteFalse_justBelowBoundary.snap | 2 +- ...edTickWithinOneWord_lteFalse_onBoundary.snap | 2 +- ...TickWithinOneWord_lteTrue_forEntireWord.snap | 2 +- ...WithinOneWord_lteTrue_justBelowBoundary.snap | 2 +- ...ickWithinOneWord_lteTrue_onBoundary_gas.snap | 2 +- .forge-snapshots/poolManager bytecode size.snap | 2 +- .forge-snapshots/removeLiquidity CA fee.snap | 2 +- .../removeLiquidity with empty hook.snap | 2 +- .../removeLiquidity with native token.snap | 2 +- .forge-snapshots/set protocol fee.snap | 2 +- ...addLiquidity second addition same range.snap | 2 +- .forge-snapshots/simple addLiquidity.snap | 2 +- ... removeLiquidity some liquidity remains.snap | 2 +- .forge-snapshots/simple removeLiquidity.snap | 2 +- .forge-snapshots/simple swap with native.snap | 2 +- .forge-snapshots/simple swap.snap | 2 +- .forge-snapshots/sparse external sload.snap | 2 +- .../swap CA custom curve + swap noop.snap | 2 +- .../swap CA fee on unspecified.snap | 2 +- ...wap against liquidity with native token.snap | 2 +- .forge-snapshots/swap against liquidity.snap | 2 +- .forge-snapshots/swap burn 6909 for input.snap | 2 +- .../swap burn native 6909 for input.snap | 2 +- .../swap mint native output as 6909.snap | 2 +- .forge-snapshots/swap mint output as 6909.snap | 2 +- .../swap skips hook call if hook is caller.snap | 2 +- .forge-snapshots/swap with dynamic fee.snap | 2 +- .forge-snapshots/swap with hooks.snap | 2 +- .../swap with lp fee and protocol fee.snap | 2 +- .../swap with return dynamic fee.snap | 2 +- ...axLiquidityPerTick_gasCost60TickSpacing.snap | 2 +- ...xLiquidityPerTick_gasCostMaxTickSpacing.snap | 2 +- ...xLiquidityPerTick_gasCostMinTickSpacing.snap | 2 +- .../update dynamic fee in before swap.snap | 2 +- foundry.toml | 6 +++--- src/ProtocolFees.sol | 2 +- src/libraries/CurrencyDelta.sol | 2 +- src/libraries/LiquidityMath.sol | 2 +- src/libraries/ParseBytes.sol | 6 +++--- src/libraries/Reserves.sol | 2 +- test/bin/v3Factory.bytecode | Bin 0 -> 24939 bytes test/libraries/Hooks.t.sol | 6 ------ test/libraries/ProtocolFeeLibrary.t.sol | 8 -------- test/utils/V3Helper.sol | 5 +---- 103 files changed, 102 insertions(+), 121 deletions(-) delete mode 100644 .forge-snapshots/HooksShouldCallBeforeSwap.snap delete mode 100644 .forge-snapshots/calculateSwapFee.snap create mode 100644 test/bin/v3Factory.bytecode diff --git a/.forge-snapshots/BitMathLeastSignificantBitMaxUint128.snap b/.forge-snapshots/BitMathLeastSignificantBitMaxUint128.snap index 9d3f41701..d99e90eb9 100644 --- a/.forge-snapshots/BitMathLeastSignificantBitMaxUint128.snap +++ b/.forge-snapshots/BitMathLeastSignificantBitMaxUint128.snap @@ -1 +1 @@ -455 \ No newline at end of file +29 \ No newline at end of file diff --git a/.forge-snapshots/BitMathLeastSignificantBitMaxUint256.snap b/.forge-snapshots/BitMathLeastSignificantBitMaxUint256.snap index 2da432533..d99e90eb9 100644 --- a/.forge-snapshots/BitMathLeastSignificantBitMaxUint256.snap +++ b/.forge-snapshots/BitMathLeastSignificantBitMaxUint256.snap @@ -1 +1 @@ -457 \ No newline at end of file +29 \ No newline at end of file diff --git a/.forge-snapshots/BitMathLeastSignificantBitSmallNumber.snap b/.forge-snapshots/BitMathLeastSignificantBitSmallNumber.snap index 13ef0a79b..d99e90eb9 100644 --- a/.forge-snapshots/BitMathLeastSignificantBitSmallNumber.snap +++ b/.forge-snapshots/BitMathLeastSignificantBitSmallNumber.snap @@ -1 +1 @@ -453 \ No newline at end of file +29 \ No newline at end of file diff --git a/.forge-snapshots/BitMathMostSignificantBitMaxUint128.snap b/.forge-snapshots/BitMathMostSignificantBitMaxUint128.snap index cbafdca53..d99e90eb9 100644 --- a/.forge-snapshots/BitMathMostSignificantBitMaxUint128.snap +++ b/.forge-snapshots/BitMathMostSignificantBitMaxUint128.snap @@ -1 +1 @@ -393 \ No newline at end of file +29 \ No newline at end of file diff --git a/.forge-snapshots/BitMathMostSignificantBitMaxUint256.snap b/.forge-snapshots/BitMathMostSignificantBitMaxUint256.snap index 5c9fe11c0..d99e90eb9 100644 --- a/.forge-snapshots/BitMathMostSignificantBitMaxUint256.snap +++ b/.forge-snapshots/BitMathMostSignificantBitMaxUint256.snap @@ -1 +1 @@ -413 \ No newline at end of file +29 \ No newline at end of file diff --git a/.forge-snapshots/BitMathMostSignificantBitSmallNumber.snap b/.forge-snapshots/BitMathMostSignificantBitSmallNumber.snap index 9d239ff80..d99e90eb9 100644 --- a/.forge-snapshots/BitMathMostSignificantBitSmallNumber.snap +++ b/.forge-snapshots/BitMathMostSignificantBitSmallNumber.snap @@ -1 +1 @@ -321 \ No newline at end of file +29 \ No newline at end of file diff --git a/.forge-snapshots/ERC6909Claims approve.snap b/.forge-snapshots/ERC6909Claims approve.snap index 57c3a1024..3fd1f86d8 100644 --- a/.forge-snapshots/ERC6909Claims approve.snap +++ b/.forge-snapshots/ERC6909Claims approve.snap @@ -1 +1 @@ -46492 \ No newline at end of file +46323 \ No newline at end of file diff --git a/.forge-snapshots/ERC6909Claims burn.snap b/.forge-snapshots/ERC6909Claims burn.snap index 22d8221b1..ce114354d 100644 --- a/.forge-snapshots/ERC6909Claims burn.snap +++ b/.forge-snapshots/ERC6909Claims burn.snap @@ -1 +1 @@ -29428 \ No newline at end of file +29389 \ No newline at end of file diff --git a/.forge-snapshots/ERC6909Claims mint.snap b/.forge-snapshots/ERC6909Claims mint.snap index 7c9bc2025..dd2b6be6b 100644 --- a/.forge-snapshots/ERC6909Claims mint.snap +++ b/.forge-snapshots/ERC6909Claims mint.snap @@ -1 +1 @@ -46815 \ No newline at end of file +46603 \ No newline at end of file diff --git a/.forge-snapshots/ERC6909Claims transfer.snap b/.forge-snapshots/ERC6909Claims transfer.snap index e15c713ac..46563dfdc 100644 --- a/.forge-snapshots/ERC6909Claims transfer.snap +++ b/.forge-snapshots/ERC6909Claims transfer.snap @@ -1 +1 @@ -52046 \ No newline at end of file +51756 \ No newline at end of file diff --git a/.forge-snapshots/ERC6909Claims transferFrom as operator.snap b/.forge-snapshots/ERC6909Claims transferFrom as operator.snap index 5b633e5a9..666e4e2f7 100644 --- a/.forge-snapshots/ERC6909Claims transferFrom as operator.snap +++ b/.forge-snapshots/ERC6909Claims transferFrom as operator.snap @@ -1 +1 @@ -54699 \ No newline at end of file +54437 \ No newline at end of file diff --git a/.forge-snapshots/ERC6909Claims transferFrom with approval.snap b/.forge-snapshots/ERC6909Claims transferFrom with approval.snap index e7a90f539..a55a87caf 100644 --- a/.forge-snapshots/ERC6909Claims transferFrom with approval.snap +++ b/.forge-snapshots/ERC6909Claims transferFrom with approval.snap @@ -1 +1 @@ -60247 \ No newline at end of file +59939 \ No newline at end of file diff --git a/.forge-snapshots/ERC6909Claims transferFrom with infinite approval.snap b/.forge-snapshots/ERC6909Claims transferFrom with infinite approval.snap index b26ab21a9..53b9db994 100644 --- a/.forge-snapshots/ERC6909Claims transferFrom with infinite approval.snap +++ b/.forge-snapshots/ERC6909Claims transferFrom with infinite approval.snap @@ -1 +1 @@ -57049 \ No newline at end of file +56770 \ No newline at end of file diff --git a/.forge-snapshots/HooksShouldCallBeforeSwap.snap b/.forge-snapshots/HooksShouldCallBeforeSwap.snap deleted file mode 100644 index 615088b54..000000000 --- a/.forge-snapshots/HooksShouldCallBeforeSwap.snap +++ /dev/null @@ -1 +0,0 @@ -108 \ No newline at end of file diff --git a/.forge-snapshots/NoDelegateCall.snap b/.forge-snapshots/NoDelegateCall.snap index aaa6442fe..7003e7fe1 100644 --- a/.forge-snapshots/NoDelegateCall.snap +++ b/.forge-snapshots/NoDelegateCall.snap @@ -1 +1 @@ -41 \ No newline at end of file +51 \ No newline at end of file diff --git a/.forge-snapshots/SwapMath_oneForZero_exactInCapped.snap b/.forge-snapshots/SwapMath_oneForZero_exactInCapped.snap index c7f4ad925..646782c31 100644 --- a/.forge-snapshots/SwapMath_oneForZero_exactInCapped.snap +++ b/.forge-snapshots/SwapMath_oneForZero_exactInCapped.snap @@ -1 +1 @@ -1662 \ No newline at end of file +1157 \ No newline at end of file diff --git a/.forge-snapshots/SwapMath_oneForZero_exactInPartial.snap b/.forge-snapshots/SwapMath_oneForZero_exactInPartial.snap index efed77e14..05fd8282c 100644 --- a/.forge-snapshots/SwapMath_oneForZero_exactInPartial.snap +++ b/.forge-snapshots/SwapMath_oneForZero_exactInPartial.snap @@ -1 +1 @@ -2152 \ No newline at end of file +1392 \ No newline at end of file diff --git a/.forge-snapshots/SwapMath_oneForZero_exactOutCapped.snap b/.forge-snapshots/SwapMath_oneForZero_exactOutCapped.snap index 473aa3ce3..0ebf2af4f 100644 --- a/.forge-snapshots/SwapMath_oneForZero_exactOutCapped.snap +++ b/.forge-snapshots/SwapMath_oneForZero_exactOutCapped.snap @@ -1 +1 @@ -1413 \ No newline at end of file +951 \ No newline at end of file diff --git a/.forge-snapshots/SwapMath_oneForZero_exactOutPartial.snap b/.forge-snapshots/SwapMath_oneForZero_exactOutPartial.snap index 5ec250ecd..24ec8a0c0 100644 --- a/.forge-snapshots/SwapMath_oneForZero_exactOutPartial.snap +++ b/.forge-snapshots/SwapMath_oneForZero_exactOutPartial.snap @@ -1 +1 @@ -2120 \ No newline at end of file +1506 \ No newline at end of file diff --git a/.forge-snapshots/SwapMath_zeroForOne_exactInCapped.snap b/.forge-snapshots/SwapMath_zeroForOne_exactInCapped.snap index 7dd08159a..5568a0772 100644 --- a/.forge-snapshots/SwapMath_zeroForOne_exactInCapped.snap +++ b/.forge-snapshots/SwapMath_zeroForOne_exactInCapped.snap @@ -1 +1 @@ -1753 \ No newline at end of file +1118 \ No newline at end of file diff --git a/.forge-snapshots/SwapMath_zeroForOne_exactInPartial.snap b/.forge-snapshots/SwapMath_zeroForOne_exactInPartial.snap index 33c15029b..b514541d9 100644 --- a/.forge-snapshots/SwapMath_zeroForOne_exactInPartial.snap +++ b/.forge-snapshots/SwapMath_zeroForOne_exactInPartial.snap @@ -1 +1 @@ -2671 \ No newline at end of file +1832 \ No newline at end of file diff --git a/.forge-snapshots/SwapMath_zeroForOne_exactOutCapped.snap b/.forge-snapshots/SwapMath_zeroForOne_exactOutCapped.snap index 8f05b3360..06c2b9037 100644 --- a/.forge-snapshots/SwapMath_zeroForOne_exactOutCapped.snap +++ b/.forge-snapshots/SwapMath_zeroForOne_exactOutCapped.snap @@ -1 +1 @@ -1504 \ No newline at end of file +914 \ No newline at end of file diff --git a/.forge-snapshots/SwapMath_zeroForOne_exactOutPartial.snap b/.forge-snapshots/SwapMath_zeroForOne_exactOutPartial.snap index d1cd77334..63539d7bb 100644 --- a/.forge-snapshots/SwapMath_zeroForOne_exactOutPartial.snap +++ b/.forge-snapshots/SwapMath_zeroForOne_exactOutPartial.snap @@ -1 +1 @@ -1850 \ No newline at end of file +1119 \ No newline at end of file diff --git a/.forge-snapshots/TickMathGetSqrtPriceAtTick.snap b/.forge-snapshots/TickMathGetSqrtPriceAtTick.snap index 80e464c69..7983239ed 100644 --- a/.forge-snapshots/TickMathGetSqrtPriceAtTick.snap +++ b/.forge-snapshots/TickMathGetSqrtPriceAtTick.snap @@ -1 +1 @@ -74032 \ No newline at end of file +70953 \ No newline at end of file diff --git a/.forge-snapshots/TickMathGetTickAtSqrtPrice.snap b/.forge-snapshots/TickMathGetTickAtSqrtPrice.snap index f8501cbde..8f5814710 100644 --- a/.forge-snapshots/TickMathGetTickAtSqrtPrice.snap +++ b/.forge-snapshots/TickMathGetTickAtSqrtPrice.snap @@ -1 +1 @@ -216101 \ No newline at end of file +197704 \ No newline at end of file diff --git a/.forge-snapshots/add liquidity to already existing position with salt.snap b/.forge-snapshots/add liquidity to already existing position with salt.snap index 869e5830b..a9eed9add 100644 --- a/.forge-snapshots/add liquidity to already existing position with salt.snap +++ b/.forge-snapshots/add liquidity to already existing position with salt.snap @@ -1 +1 @@ -149323 \ No newline at end of file +146557 \ No newline at end of file diff --git a/.forge-snapshots/addLiquidity CA fee.snap b/.forge-snapshots/addLiquidity CA fee.snap index f0f83af59..0604fb71e 100644 --- a/.forge-snapshots/addLiquidity CA fee.snap +++ b/.forge-snapshots/addLiquidity CA fee.snap @@ -1 +1 @@ -325681 \ No newline at end of file +320738 \ No newline at end of file diff --git a/.forge-snapshots/addLiquidity with empty hook.snap b/.forge-snapshots/addLiquidity with empty hook.snap index 321b75523..3679da0b5 100644 --- a/.forge-snapshots/addLiquidity with empty hook.snap +++ b/.forge-snapshots/addLiquidity with empty hook.snap @@ -1 +1 @@ -279677 \ No newline at end of file +275714 \ No newline at end of file diff --git a/.forge-snapshots/addLiquidity with native token.snap b/.forge-snapshots/addLiquidity with native token.snap index cef89f9d8..2ef5dba23 100644 --- a/.forge-snapshots/addLiquidity with native token.snap +++ b/.forge-snapshots/addLiquidity with native token.snap @@ -1 +1 @@ -139505 \ No newline at end of file +136837 \ No newline at end of file diff --git a/.forge-snapshots/calculateSwapFee.snap b/.forge-snapshots/calculateSwapFee.snap deleted file mode 100644 index dc7b54ad0..000000000 --- a/.forge-snapshots/calculateSwapFee.snap +++ /dev/null @@ -1 +0,0 @@ -33 \ No newline at end of file diff --git a/.forge-snapshots/create new liquidity to a position with salt.snap b/.forge-snapshots/create new liquidity to a position with salt.snap index 241d6c28f..21edfca7b 100644 --- a/.forge-snapshots/create new liquidity to a position with salt.snap +++ b/.forge-snapshots/create new liquidity to a position with salt.snap @@ -1 +1 @@ -297501 \ No newline at end of file +294762 \ No newline at end of file diff --git a/.forge-snapshots/donate gas with 1 token.snap b/.forge-snapshots/donate gas with 1 token.snap index 1fe31d965..65ab0d319 100644 --- a/.forge-snapshots/donate gas with 1 token.snap +++ b/.forge-snapshots/donate gas with 1 token.snap @@ -1 +1 @@ -106609 \ No newline at end of file +106027 \ No newline at end of file diff --git a/.forge-snapshots/donate gas with 2 tokens.snap b/.forge-snapshots/donate gas with 2 tokens.snap index 99e5b99d0..1e0fe8e89 100644 --- a/.forge-snapshots/donate gas with 2 tokens.snap +++ b/.forge-snapshots/donate gas with 2 tokens.snap @@ -1 +1 @@ -147104 \ No newline at end of file +146035 \ No newline at end of file diff --git a/.forge-snapshots/erc20 collect protocol fees.snap b/.forge-snapshots/erc20 collect protocol fees.snap index c9959e32a..89f5c31b2 100644 --- a/.forge-snapshots/erc20 collect protocol fees.snap +++ b/.forge-snapshots/erc20 collect protocol fees.snap @@ -1 +1 @@ -57229 \ No newline at end of file +57224 \ No newline at end of file diff --git a/.forge-snapshots/extsload getFeeGrowthGlobals.snap b/.forge-snapshots/extsload getFeeGrowthGlobals.snap index c21b7b4a7..9c3167f28 100644 --- a/.forge-snapshots/extsload getFeeGrowthGlobals.snap +++ b/.forge-snapshots/extsload getFeeGrowthGlobals.snap @@ -1 +1 @@ -661 \ No newline at end of file +704 \ No newline at end of file diff --git a/.forge-snapshots/extsload getFeeGrowthInside.snap b/.forge-snapshots/extsload getFeeGrowthInside.snap index be6652a2a..5f5d9b11a 100644 --- a/.forge-snapshots/extsload getFeeGrowthInside.snap +++ b/.forge-snapshots/extsload getFeeGrowthInside.snap @@ -1 +1 @@ -415 \ No newline at end of file +375 \ No newline at end of file diff --git a/.forge-snapshots/extsload getLiquidity.snap b/.forge-snapshots/extsload getLiquidity.snap index be6652a2a..5f5d9b11a 100644 --- a/.forge-snapshots/extsload getLiquidity.snap +++ b/.forge-snapshots/extsload getLiquidity.snap @@ -1 +1 @@ -415 \ No newline at end of file +375 \ No newline at end of file diff --git a/.forge-snapshots/extsload getPositionInfo.snap b/.forge-snapshots/extsload getPositionInfo.snap index d2014d132..aabe32b8b 100644 --- a/.forge-snapshots/extsload getPositionInfo.snap +++ b/.forge-snapshots/extsload getPositionInfo.snap @@ -1 +1 @@ -817 \ No newline at end of file +874 \ No newline at end of file diff --git a/.forge-snapshots/extsload getPositionLiquidity.snap b/.forge-snapshots/extsload getPositionLiquidity.snap index be6652a2a..5f5d9b11a 100644 --- a/.forge-snapshots/extsload getPositionLiquidity.snap +++ b/.forge-snapshots/extsload getPositionLiquidity.snap @@ -1 +1 @@ -415 \ No newline at end of file +375 \ No newline at end of file diff --git a/.forge-snapshots/extsload getSlot0.snap b/.forge-snapshots/extsload getSlot0.snap index be6652a2a..5f5d9b11a 100644 --- a/.forge-snapshots/extsload getSlot0.snap +++ b/.forge-snapshots/extsload getSlot0.snap @@ -1 +1 @@ -415 \ No newline at end of file +375 \ No newline at end of file diff --git a/.forge-snapshots/extsload getTickBitmap.snap b/.forge-snapshots/extsload getTickBitmap.snap index be6652a2a..5f5d9b11a 100644 --- a/.forge-snapshots/extsload getTickBitmap.snap +++ b/.forge-snapshots/extsload getTickBitmap.snap @@ -1 +1 @@ -415 \ No newline at end of file +375 \ No newline at end of file diff --git a/.forge-snapshots/extsload getTickFeeGrowthOutside.snap b/.forge-snapshots/extsload getTickFeeGrowthOutside.snap index c21b7b4a7..9c3167f28 100644 --- a/.forge-snapshots/extsload getTickFeeGrowthOutside.snap +++ b/.forge-snapshots/extsload getTickFeeGrowthOutside.snap @@ -1 +1 @@ -661 \ No newline at end of file +704 \ No newline at end of file diff --git a/.forge-snapshots/extsload getTickInfo.snap b/.forge-snapshots/extsload getTickInfo.snap index d2014d132..aabe32b8b 100644 --- a/.forge-snapshots/extsload getTickInfo.snap +++ b/.forge-snapshots/extsload getTickInfo.snap @@ -1 +1 @@ -817 \ No newline at end of file +874 \ No newline at end of file diff --git a/.forge-snapshots/extsload getTickLiquidity.snap b/.forge-snapshots/extsload getTickLiquidity.snap index be6652a2a..5f5d9b11a 100644 --- a/.forge-snapshots/extsload getTickLiquidity.snap +++ b/.forge-snapshots/extsload getTickLiquidity.snap @@ -1 +1 @@ -415 \ No newline at end of file +375 \ No newline at end of file diff --git a/.forge-snapshots/flipTick_flippingATickThatResultsInDeletingAWord.snap b/.forge-snapshots/flipTick_flippingATickThatResultsInDeletingAWord.snap index a411878b5..c2fcf4010 100644 --- a/.forge-snapshots/flipTick_flippingATickThatResultsInDeletingAWord.snap +++ b/.forge-snapshots/flipTick_flippingATickThatResultsInDeletingAWord.snap @@ -1 +1 @@ -5244 \ No newline at end of file +5113 \ No newline at end of file diff --git a/.forge-snapshots/flipTick_flippingFirstTickInWordToInitialized.snap b/.forge-snapshots/flipTick_flippingFirstTickInWordToInitialized.snap index bbfdf6e04..d40f731c3 100644 --- a/.forge-snapshots/flipTick_flippingFirstTickInWordToInitialized.snap +++ b/.forge-snapshots/flipTick_flippingFirstTickInWordToInitialized.snap @@ -1 +1 @@ -22341 \ No newline at end of file +22213 \ No newline at end of file diff --git a/.forge-snapshots/flipTick_flippingSecondTickInWordToInitialized.snap b/.forge-snapshots/flipTick_flippingSecondTickInWordToInitialized.snap index e9d178a39..8fd9ccbb0 100644 --- a/.forge-snapshots/flipTick_flippingSecondTickInWordToInitialized.snap +++ b/.forge-snapshots/flipTick_flippingSecondTickInWordToInitialized.snap @@ -1 +1 @@ -5350 \ No newline at end of file +5174 \ No newline at end of file diff --git a/.forge-snapshots/getAmount0Delta_gasCostForAmount0WhereRoundUpIsFalse.snap b/.forge-snapshots/getAmount0Delta_gasCostForAmount0WhereRoundUpIsFalse.snap index 99f9f071d..34251f6b2 100644 --- a/.forge-snapshots/getAmount0Delta_gasCostForAmount0WhereRoundUpIsFalse.snap +++ b/.forge-snapshots/getAmount0Delta_gasCostForAmount0WhereRoundUpIsFalse.snap @@ -1 +1 @@ -502 \ No newline at end of file +247 \ No newline at end of file diff --git a/.forge-snapshots/getAmount0Delta_gasCostForAmount0WhereRoundUpIsTrue.snap b/.forge-snapshots/getAmount0Delta_gasCostForAmount0WhereRoundUpIsTrue.snap index a869e998c..e8930b6df 100644 --- a/.forge-snapshots/getAmount0Delta_gasCostForAmount0WhereRoundUpIsTrue.snap +++ b/.forge-snapshots/getAmount0Delta_gasCostForAmount0WhereRoundUpIsTrue.snap @@ -1 +1 @@ -638 \ No newline at end of file +364 \ No newline at end of file diff --git a/.forge-snapshots/getAmount1Delta_gasCostForAmount1WhereRoundUpIsFalse.snap b/.forge-snapshots/getAmount1Delta_gasCostForAmount1WhereRoundUpIsFalse.snap index 8c19d14d4..8e24a69a0 100644 --- a/.forge-snapshots/getAmount1Delta_gasCostForAmount1WhereRoundUpIsFalse.snap +++ b/.forge-snapshots/getAmount1Delta_gasCostForAmount1WhereRoundUpIsFalse.snap @@ -1 +1 @@ -369 \ No newline at end of file +198 \ No newline at end of file diff --git a/.forge-snapshots/getAmount1Delta_gasCostForAmount1WhereRoundUpIsTrue.snap b/.forge-snapshots/getAmount1Delta_gasCostForAmount1WhereRoundUpIsTrue.snap index 6c8526a81..8e24a69a0 100644 --- a/.forge-snapshots/getAmount1Delta_gasCostForAmount1WhereRoundUpIsTrue.snap +++ b/.forge-snapshots/getAmount1Delta_gasCostForAmount1WhereRoundUpIsTrue.snap @@ -1 +1 @@ -370 \ No newline at end of file +198 \ No newline at end of file diff --git a/.forge-snapshots/getNextSqrtPriceFromInput_zeroForOneEqualsFalseGas.snap b/.forge-snapshots/getNextSqrtPriceFromInput_zeroForOneEqualsFalseGas.snap index e157b5b5f..194ba8cc7 100644 --- a/.forge-snapshots/getNextSqrtPriceFromInput_zeroForOneEqualsFalseGas.snap +++ b/.forge-snapshots/getNextSqrtPriceFromInput_zeroForOneEqualsFalseGas.snap @@ -1 +1 @@ -520 \ No newline at end of file +320 \ No newline at end of file diff --git a/.forge-snapshots/getNextSqrtPriceFromInput_zeroForOneEqualsTrueGas.snap b/.forge-snapshots/getNextSqrtPriceFromInput_zeroForOneEqualsTrueGas.snap index 6bd680a65..878b70634 100644 --- a/.forge-snapshots/getNextSqrtPriceFromInput_zeroForOneEqualsTrueGas.snap +++ b/.forge-snapshots/getNextSqrtPriceFromInput_zeroForOneEqualsTrueGas.snap @@ -1 +1 @@ -711 \ No newline at end of file +543 \ No newline at end of file diff --git a/.forge-snapshots/getNextSqrtPriceFromOutput_zeroForOneEqualsFalseGas.snap b/.forge-snapshots/getNextSqrtPriceFromOutput_zeroForOneEqualsFalseGas.snap index 64a0b71f1..28621d35a 100644 --- a/.forge-snapshots/getNextSqrtPriceFromOutput_zeroForOneEqualsFalseGas.snap +++ b/.forge-snapshots/getNextSqrtPriceFromOutput_zeroForOneEqualsFalseGas.snap @@ -1 +1 @@ -746 \ No newline at end of file +542 \ No newline at end of file diff --git a/.forge-snapshots/getNextSqrtPriceFromOutput_zeroForOneEqualsTrueGas.snap b/.forge-snapshots/getNextSqrtPriceFromOutput_zeroForOneEqualsTrueGas.snap index 93168a9d7..274ccca8a 100644 --- a/.forge-snapshots/getNextSqrtPriceFromOutput_zeroForOneEqualsTrueGas.snap +++ b/.forge-snapshots/getNextSqrtPriceFromOutput_zeroForOneEqualsTrueGas.snap @@ -1 +1 @@ -398 \ No newline at end of file +209 \ No newline at end of file diff --git a/.forge-snapshots/getReserves.snap b/.forge-snapshots/getReserves.snap index 805f57488..4e010ec2c 100644 --- a/.forge-snapshots/getReserves.snap +++ b/.forge-snapshots/getReserves.snap @@ -1 +1 @@ -1167 \ No newline at end of file +1630 \ No newline at end of file diff --git a/.forge-snapshots/initialize.snap b/.forge-snapshots/initialize.snap index fc2848ba3..79e7c46f9 100644 --- a/.forge-snapshots/initialize.snap +++ b/.forge-snapshots/initialize.snap @@ -1 +1 @@ -61173 \ No newline at end of file +59576 \ No newline at end of file diff --git a/.forge-snapshots/native collect protocol fees.snap b/.forge-snapshots/native collect protocol fees.snap index 09fd49f8a..0b9a9e7eb 100644 --- a/.forge-snapshots/native collect protocol fees.snap +++ b/.forge-snapshots/native collect protocol fees.snap @@ -1 +1 @@ -59496 \ No newline at end of file +59588 \ No newline at end of file diff --git a/.forge-snapshots/nextInitializedTickWithinOneWord_lteFalse_forEntireWord.snap b/.forge-snapshots/nextInitializedTickWithinOneWord_lteFalse_forEntireWord.snap index 0203089ec..4d7de05ac 100644 --- a/.forge-snapshots/nextInitializedTickWithinOneWord_lteFalse_forEntireWord.snap +++ b/.forge-snapshots/nextInitializedTickWithinOneWord_lteFalse_forEntireWord.snap @@ -1 +1 @@ -2488 \ No newline at end of file +2270 \ No newline at end of file diff --git a/.forge-snapshots/nextInitializedTickWithinOneWord_lteFalse_justBelowBoundary.snap b/.forge-snapshots/nextInitializedTickWithinOneWord_lteFalse_justBelowBoundary.snap index 0203089ec..83ae3e671 100644 --- a/.forge-snapshots/nextInitializedTickWithinOneWord_lteFalse_justBelowBoundary.snap +++ b/.forge-snapshots/nextInitializedTickWithinOneWord_lteFalse_justBelowBoundary.snap @@ -1 +1 @@ -2488 \ No newline at end of file +2278 \ No newline at end of file diff --git a/.forge-snapshots/nextInitializedTickWithinOneWord_lteFalse_onBoundary.snap b/.forge-snapshots/nextInitializedTickWithinOneWord_lteFalse_onBoundary.snap index 0203089ec..cf04c8c6d 100644 --- a/.forge-snapshots/nextInitializedTickWithinOneWord_lteFalse_onBoundary.snap +++ b/.forge-snapshots/nextInitializedTickWithinOneWord_lteFalse_onBoundary.snap @@ -1 +1 @@ -2488 \ No newline at end of file +2285 \ No newline at end of file diff --git a/.forge-snapshots/nextInitializedTickWithinOneWord_lteTrue_forEntireWord.snap b/.forge-snapshots/nextInitializedTickWithinOneWord_lteTrue_forEntireWord.snap index de23d9ec9..a8964c48c 100644 --- a/.forge-snapshots/nextInitializedTickWithinOneWord_lteTrue_forEntireWord.snap +++ b/.forge-snapshots/nextInitializedTickWithinOneWord_lteTrue_forEntireWord.snap @@ -1 +1 @@ -2475 \ No newline at end of file +2262 \ No newline at end of file diff --git a/.forge-snapshots/nextInitializedTickWithinOneWord_lteTrue_justBelowBoundary.snap b/.forge-snapshots/nextInitializedTickWithinOneWord_lteTrue_justBelowBoundary.snap index a4e1baa59..a51f76e92 100644 --- a/.forge-snapshots/nextInitializedTickWithinOneWord_lteTrue_justBelowBoundary.snap +++ b/.forge-snapshots/nextInitializedTickWithinOneWord_lteTrue_justBelowBoundary.snap @@ -1 +1 @@ -2784 \ No newline at end of file +2615 \ No newline at end of file diff --git a/.forge-snapshots/nextInitializedTickWithinOneWord_lteTrue_onBoundary_gas.snap b/.forge-snapshots/nextInitializedTickWithinOneWord_lteTrue_onBoundary_gas.snap index de23d9ec9..b1957f2d1 100644 --- a/.forge-snapshots/nextInitializedTickWithinOneWord_lteTrue_onBoundary_gas.snap +++ b/.forge-snapshots/nextInitializedTickWithinOneWord_lteTrue_onBoundary_gas.snap @@ -1 +1 @@ -2475 \ No newline at end of file +2291 \ No newline at end of file diff --git a/.forge-snapshots/poolManager bytecode size.snap b/.forge-snapshots/poolManager bytecode size.snap index 209c7964e..c5ac9e9c6 100644 --- a/.forge-snapshots/poolManager bytecode size.snap +++ b/.forge-snapshots/poolManager bytecode size.snap @@ -1 +1 @@ -19769 \ No newline at end of file +23805 \ No newline at end of file diff --git a/.forge-snapshots/removeLiquidity CA fee.snap b/.forge-snapshots/removeLiquidity CA fee.snap index ef18e73d8..48de448ea 100644 --- a/.forge-snapshots/removeLiquidity CA fee.snap +++ b/.forge-snapshots/removeLiquidity CA fee.snap @@ -1 +1 @@ -181200 \ No newline at end of file +176325 \ No newline at end of file diff --git a/.forge-snapshots/removeLiquidity with empty hook.snap b/.forge-snapshots/removeLiquidity with empty hook.snap index 64e5b0f2b..d01ca1855 100644 --- a/.forge-snapshots/removeLiquidity with empty hook.snap +++ b/.forge-snapshots/removeLiquidity with empty hook.snap @@ -1 +1 @@ -135371 \ No newline at end of file +131597 \ No newline at end of file diff --git a/.forge-snapshots/removeLiquidity with native token.snap b/.forge-snapshots/removeLiquidity with native token.snap index 61ce40343..5c90b03af 100644 --- a/.forge-snapshots/removeLiquidity with native token.snap +++ b/.forge-snapshots/removeLiquidity with native token.snap @@ -1 +1 @@ -115664 \ No newline at end of file +113398 \ No newline at end of file diff --git a/.forge-snapshots/set protocol fee.snap b/.forge-snapshots/set protocol fee.snap index 082c9f443..d745d907d 100644 --- a/.forge-snapshots/set protocol fee.snap +++ b/.forge-snapshots/set protocol fee.snap @@ -1 +1 @@ -32478 \ No newline at end of file +31702 \ No newline at end of file diff --git a/.forge-snapshots/simple addLiquidity second addition same range.snap b/.forge-snapshots/simple addLiquidity second addition same range.snap index 2ce5aa17f..b2b1558e4 100644 --- a/.forge-snapshots/simple addLiquidity second addition same range.snap +++ b/.forge-snapshots/simple addLiquidity second addition same range.snap @@ -1 +1 @@ -102765 \ No newline at end of file +98747 \ No newline at end of file diff --git a/.forge-snapshots/simple addLiquidity.snap b/.forge-snapshots/simple addLiquidity.snap index baf6b2297..d6fb7e5ed 100644 --- a/.forge-snapshots/simple addLiquidity.snap +++ b/.forge-snapshots/simple addLiquidity.snap @@ -1 +1 @@ -165257 \ No newline at end of file +161227 \ No newline at end of file diff --git a/.forge-snapshots/simple removeLiquidity some liquidity remains.snap b/.forge-snapshots/simple removeLiquidity some liquidity remains.snap index 9ff39284a..f511d6d52 100644 --- a/.forge-snapshots/simple removeLiquidity some liquidity remains.snap +++ b/.forge-snapshots/simple removeLiquidity some liquidity remains.snap @@ -1 +1 @@ -96455 \ No newline at end of file +92503 \ No newline at end of file diff --git a/.forge-snapshots/simple removeLiquidity.snap b/.forge-snapshots/simple removeLiquidity.snap index 225dce7bf..902c16871 100644 --- a/.forge-snapshots/simple removeLiquidity.snap +++ b/.forge-snapshots/simple removeLiquidity.snap @@ -1 +1 @@ -88495 \ No newline at end of file +84560 \ No newline at end of file diff --git a/.forge-snapshots/simple swap with native.snap b/.forge-snapshots/simple swap with native.snap index e3a268110..cb1ad5d82 100644 --- a/.forge-snapshots/simple swap with native.snap +++ b/.forge-snapshots/simple swap with native.snap @@ -1 +1 @@ -114299 \ No newline at end of file +109712 \ No newline at end of file diff --git a/.forge-snapshots/simple swap.snap b/.forge-snapshots/simple swap.snap index 71e7528d5..ab0cf8d03 100644 --- a/.forge-snapshots/simple swap.snap +++ b/.forge-snapshots/simple swap.snap @@ -1 +1 @@ -129464 \ No newline at end of file +124538 \ No newline at end of file diff --git a/.forge-snapshots/sparse external sload.snap b/.forge-snapshots/sparse external sload.snap index 60b0241d7..09c6f19a3 100644 --- a/.forge-snapshots/sparse external sload.snap +++ b/.forge-snapshots/sparse external sload.snap @@ -1 +1 @@ -2007 \ No newline at end of file +2057 \ No newline at end of file diff --git a/.forge-snapshots/swap CA custom curve + swap noop.snap b/.forge-snapshots/swap CA custom curve + swap noop.snap index cb11d3cf2..ad5a6f017 100644 --- a/.forge-snapshots/swap CA custom curve + swap noop.snap +++ b/.forge-snapshots/swap CA custom curve + swap noop.snap @@ -1 +1 @@ -131734 \ No newline at end of file +128990 \ No newline at end of file diff --git a/.forge-snapshots/swap CA fee on unspecified.snap b/.forge-snapshots/swap CA fee on unspecified.snap index 8de3974f5..62fa8c493 100644 --- a/.forge-snapshots/swap CA fee on unspecified.snap +++ b/.forge-snapshots/swap CA fee on unspecified.snap @@ -1 +1 @@ -178608 \ No newline at end of file +174512 \ No newline at end of file diff --git a/.forge-snapshots/swap against liquidity with native token.snap b/.forge-snapshots/swap against liquidity with native token.snap index 84ab960aa..92ea94409 100644 --- a/.forge-snapshots/swap against liquidity with native token.snap +++ b/.forge-snapshots/swap against liquidity with native token.snap @@ -1 +1 @@ -109936 \ No newline at end of file +108127 \ No newline at end of file diff --git a/.forge-snapshots/swap against liquidity.snap b/.forge-snapshots/swap against liquidity.snap index acf30ff5e..46710db50 100644 --- a/.forge-snapshots/swap against liquidity.snap +++ b/.forge-snapshots/swap against liquidity.snap @@ -1 +1 @@ -121307 \ No newline at end of file +119479 \ No newline at end of file diff --git a/.forge-snapshots/swap burn 6909 for input.snap b/.forge-snapshots/swap burn 6909 for input.snap index 65e0ae539..d285794c3 100644 --- a/.forge-snapshots/swap burn 6909 for input.snap +++ b/.forge-snapshots/swap burn 6909 for input.snap @@ -1 +1 @@ -132695 \ No newline at end of file +131285 \ No newline at end of file diff --git a/.forge-snapshots/swap burn native 6909 for input.snap b/.forge-snapshots/swap burn native 6909 for input.snap index ce718f36a..51f4664e9 100644 --- a/.forge-snapshots/swap burn native 6909 for input.snap +++ b/.forge-snapshots/swap burn native 6909 for input.snap @@ -1 +1 @@ -122086 \ No newline at end of file +120369 \ No newline at end of file diff --git a/.forge-snapshots/swap mint native output as 6909.snap b/.forge-snapshots/swap mint native output as 6909.snap index c96b18e6e..864e42be4 100644 --- a/.forge-snapshots/swap mint native output as 6909.snap +++ b/.forge-snapshots/swap mint native output as 6909.snap @@ -1 +1 @@ -144293 \ No newline at end of file +142229 \ No newline at end of file diff --git a/.forge-snapshots/swap mint output as 6909.snap b/.forge-snapshots/swap mint output as 6909.snap index 78b454398..c471997eb 100644 --- a/.forge-snapshots/swap mint output as 6909.snap +++ b/.forge-snapshots/swap mint output as 6909.snap @@ -1 +1 @@ -160585 \ No newline at end of file +158199 \ No newline at end of file diff --git a/.forge-snapshots/swap skips hook call if hook is caller.snap b/.forge-snapshots/swap skips hook call if hook is caller.snap index a2cb939b5..48ffdca94 100644 --- a/.forge-snapshots/swap skips hook call if hook is caller.snap +++ b/.forge-snapshots/swap skips hook call if hook is caller.snap @@ -1 +1 @@ -216411 \ No newline at end of file +211054 \ No newline at end of file diff --git a/.forge-snapshots/swap with dynamic fee.snap b/.forge-snapshots/swap with dynamic fee.snap index 35f4f667d..5e7a69da6 100644 --- a/.forge-snapshots/swap with dynamic fee.snap +++ b/.forge-snapshots/swap with dynamic fee.snap @@ -1 +1 @@ -144737 \ No newline at end of file +142260 \ No newline at end of file diff --git a/.forge-snapshots/swap with hooks.snap b/.forge-snapshots/swap with hooks.snap index a6bec88bb..26d1b296d 100644 --- a/.forge-snapshots/swap with hooks.snap +++ b/.forge-snapshots/swap with hooks.snap @@ -1 +1 @@ -137849 \ No newline at end of file +134930 \ No newline at end of file diff --git a/.forge-snapshots/swap with lp fee and protocol fee.snap b/.forge-snapshots/swap with lp fee and protocol fee.snap index 85dca1609..f8a54567b 100644 --- a/.forge-snapshots/swap with lp fee and protocol fee.snap +++ b/.forge-snapshots/swap with lp fee and protocol fee.snap @@ -1 +1 @@ -175460 \ No newline at end of file +172061 \ No newline at end of file diff --git a/.forge-snapshots/swap with return dynamic fee.snap b/.forge-snapshots/swap with return dynamic fee.snap index 5aa307d47..8dae67f26 100644 --- a/.forge-snapshots/swap with return dynamic fee.snap +++ b/.forge-snapshots/swap with return dynamic fee.snap @@ -1 +1 @@ -151560 \ No newline at end of file +148491 \ No newline at end of file diff --git a/.forge-snapshots/tickSpacingToMaxLiquidityPerTick_gasCost60TickSpacing.snap b/.forge-snapshots/tickSpacingToMaxLiquidityPerTick_gasCost60TickSpacing.snap index 7b27b2519..d99e90eb9 100644 --- a/.forge-snapshots/tickSpacingToMaxLiquidityPerTick_gasCost60TickSpacing.snap +++ b/.forge-snapshots/tickSpacingToMaxLiquidityPerTick_gasCost60TickSpacing.snap @@ -1 +1 @@ -173 \ No newline at end of file +29 \ No newline at end of file diff --git a/.forge-snapshots/tickSpacingToMaxLiquidityPerTick_gasCostMaxTickSpacing.snap b/.forge-snapshots/tickSpacingToMaxLiquidityPerTick_gasCostMaxTickSpacing.snap index 7b27b2519..d99e90eb9 100644 --- a/.forge-snapshots/tickSpacingToMaxLiquidityPerTick_gasCostMaxTickSpacing.snap +++ b/.forge-snapshots/tickSpacingToMaxLiquidityPerTick_gasCostMaxTickSpacing.snap @@ -1 +1 @@ -173 \ No newline at end of file +29 \ No newline at end of file diff --git a/.forge-snapshots/tickSpacingToMaxLiquidityPerTick_gasCostMinTickSpacing.snap b/.forge-snapshots/tickSpacingToMaxLiquidityPerTick_gasCostMinTickSpacing.snap index 7b27b2519..d99e90eb9 100644 --- a/.forge-snapshots/tickSpacingToMaxLiquidityPerTick_gasCostMinTickSpacing.snap +++ b/.forge-snapshots/tickSpacingToMaxLiquidityPerTick_gasCostMinTickSpacing.snap @@ -1 +1 @@ -173 \ No newline at end of file +29 \ No newline at end of file diff --git a/.forge-snapshots/update dynamic fee in before swap.snap b/.forge-snapshots/update dynamic fee in before swap.snap index 095ecab96..b2df693e3 100644 --- a/.forge-snapshots/update dynamic fee in before swap.snap +++ b/.forge-snapshots/update dynamic fee in before swap.snap @@ -1 +1 @@ -154202 \ No newline at end of file +150749 \ No newline at end of file diff --git a/foundry.toml b/foundry.toml index b881c71f0..7a6457f62 100644 --- a/foundry.toml +++ b/foundry.toml @@ -1,8 +1,8 @@ [profile.default] -optimizer_runs = 800 -via_ir = false +optimizer_runs = 44444444 +via_ir = true ffi = true -fs_permissions = [{ access = "read-write", path = ".forge-snapshots/"}, { access = "read", path = "./out"}] +fs_permissions = [{ access = "read-write", path = ".forge-snapshots/"}, { access = "read", path = "./out"}, {access = "read", path = "./test/bin"}] solc = "0.8.26" evm_version = "cancun" diff --git a/src/ProtocolFees.sol b/src/ProtocolFees.sol index e067332ce..097541f02 100644 --- a/src/ProtocolFees.sol +++ b/src/ProtocolFees.sol @@ -76,7 +76,7 @@ abstract contract ProtocolFees is IProtocolFees, Owned { if (!_success || _data.length > 32) return (false, 0); uint256 returnData; - assembly { + assembly ("memory-safe") { returnData := mload(add(_data, 0x20)) } diff --git a/src/libraries/CurrencyDelta.sol b/src/libraries/CurrencyDelta.sol index 18458373b..12211704b 100644 --- a/src/libraries/CurrencyDelta.sol +++ b/src/libraries/CurrencyDelta.sol @@ -8,7 +8,7 @@ import {Currency} from "../types/Currency.sol"; library CurrencyDelta { /// @notice calculates which storage slot a delta should be stored in for a given caller and currency function _computeSlot(address caller_, Currency currency) internal pure returns (bytes32 hashSlot) { - assembly { + assembly ("memory-safe") { mstore(0, caller_) mstore(32, currency) hashSlot := keccak256(0, 64) diff --git a/src/libraries/LiquidityMath.sol b/src/libraries/LiquidityMath.sol index 02d94b4dd..c90a14af3 100644 --- a/src/libraries/LiquidityMath.sol +++ b/src/libraries/LiquidityMath.sol @@ -8,7 +8,7 @@ library LiquidityMath { /// @param y The delta by which liquidity should be changed /// @return z The liquidity delta function addDelta(uint128 x, int128 y) internal pure returns (uint128 z) { - assembly { + assembly ("memory-safe") { z := add(x, y) if shr(128, z) { // revert SafeCastOverflow() diff --git a/src/libraries/ParseBytes.sol b/src/libraries/ParseBytes.sol index 2d53b9694..3429b5463 100644 --- a/src/libraries/ParseBytes.sol +++ b/src/libraries/ParseBytes.sol @@ -8,21 +8,21 @@ pragma solidity ^0.8.20; library ParseBytes { function parseSelector(bytes memory result) internal pure returns (bytes4 selector) { // equivalent: (selector,) = abi.decode(result, (bytes4, int256)); - assembly { + assembly ("memory-safe") { selector := mload(add(result, 0x20)) } } function parseFee(bytes memory result) internal pure returns (uint24 lpFee) { // equivalent: (,, lpFee) = abi.decode(result, (bytes4, int256, uint24)); - assembly { + assembly ("memory-safe") { lpFee := mload(add(result, 0x60)) } } function parseReturnDelta(bytes memory result) internal pure returns (int256 hookReturn) { // equivalent: (, hookReturnDelta) = abi.decode(result, (bytes4, int256)); - assembly { + assembly ("memory-safe") { hookReturn := mload(add(result, 0x40)) } } diff --git a/src/libraries/Reserves.sol b/src/libraries/Reserves.sol index 1a5bfe178..f6d4eab29 100644 --- a/src/libraries/Reserves.sol +++ b/src/libraries/Reserves.sol @@ -34,7 +34,7 @@ library Reserves { function _getKey(Currency currency) private pure returns (bytes32 key) { uint256 slot = RESERVES_OF_SLOT; - assembly { + assembly ("memory-safe") { mstore(0, slot) mstore(32, currency) key := keccak256(0, 64) diff --git a/test/bin/v3Factory.bytecode b/test/bin/v3Factory.bytecode new file mode 100644 index 0000000000000000000000000000000000000000..0f35e7d32d38fa7b800160805a9fa9e07e0f9e64 GIT binary patch literal 24939 zcmd6P31C#!x&PdmAw&XZA#+2V03(|qpezOiL=r(3Wtkb0Ty(gWO6p)rsCWh^{{u^`i<%%?Xo1^;@3zFKv*ZPeJ=X4Vj49=r9f zSwj~by?f^Ie|~-B+KYSJKfC3w*sd?XTlwuL*Zi#e*&72_*`~dND<3hBVMLjqg`%zh z=y?B`iQAs(o%hn{iqlU^9MW^kA2&Vy!rK>p@y_*TWv=udy=i@4Utg`thUEvcb6HF% z!a|&%Xw5Ss*=TkLFWXtv>G^;B{7UoCmKUBn(PMvJcG}sGU-jUfzdHEt+r9|xSkv^A zn#K7}kJ*2xhgB4H+VM!k??&I!)z|dlg6F^e;Iqn#k0(6T5V>;2sNn0p$-t*m@}2J9 zZ>J11XLWqt^IZ8i=9#DSA(3bpkIeJoS4`g<=FC5*f_uJ)9jIro)ae`AeA?+^NS-jh;|Xjf8Yp`;Sc*o1!w~TvVZXqae-*w`*2pY<-zb-UK^>&^eAUjl+L^P|9Cn=mg;9HhmLDjfu$@8MZyPn2?7q>_j5jEX-mv>;jG5nxqDDgWcA2WDqBgou0=C;Ss@t}9dqx%9 z!AwQFL~$w=6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