diff --git a/.forge-snapshots/BinHookTest#testBurnSucceedsWithHook.snap b/.forge-snapshots/BinHookTest#testBurnSucceedsWithHook.snap index 583a9446..8d11b5c4 100644 --- a/.forge-snapshots/BinHookTest#testBurnSucceedsWithHook.snap +++ b/.forge-snapshots/BinHookTest#testBurnSucceedsWithHook.snap @@ -1 +1 @@ -181588 \ No newline at end of file +180685 \ No newline at end of file diff --git a/.forge-snapshots/BinHookTest#testDonateSucceedsWithHook.snap b/.forge-snapshots/BinHookTest#testDonateSucceedsWithHook.snap index 9af03e1f..09974509 100644 --- a/.forge-snapshots/BinHookTest#testDonateSucceedsWithHook.snap +++ b/.forge-snapshots/BinHookTest#testDonateSucceedsWithHook.snap @@ -1 +1 @@ -185653 \ No newline at end of file +184784 \ No newline at end of file diff --git a/.forge-snapshots/BinHookTest#testInitializeSucceedsWithHook.snap b/.forge-snapshots/BinHookTest#testInitializeSucceedsWithHook.snap index eb0299a4..033fcda0 100644 --- a/.forge-snapshots/BinHookTest#testInitializeSucceedsWithHook.snap +++ b/.forge-snapshots/BinHookTest#testInitializeSucceedsWithHook.snap @@ -1 +1 @@ -137576 \ No newline at end of file +137347 \ No newline at end of file diff --git a/.forge-snapshots/BinHookTest#testMintSucceedsWithHook.snap b/.forge-snapshots/BinHookTest#testMintSucceedsWithHook.snap index 0fc5db40..02b9d637 100644 --- a/.forge-snapshots/BinHookTest#testMintSucceedsWithHook.snap +++ b/.forge-snapshots/BinHookTest#testMintSucceedsWithHook.snap @@ -1 +1 @@ -331429 \ No newline at end of file +331202 \ No newline at end of file diff --git a/.forge-snapshots/BinHookTest#testSwapSucceedsWithHook.snap b/.forge-snapshots/BinHookTest#testSwapSucceedsWithHook.snap index c3b40423..00bc6ffb 100644 --- a/.forge-snapshots/BinHookTest#testSwapSucceedsWithHook.snap +++ b/.forge-snapshots/BinHookTest#testSwapSucceedsWithHook.snap @@ -1 +1 @@ -193689 \ No newline at end of file +192796 \ No newline at end of file diff --git a/.forge-snapshots/BinPoolManagerTest#testBurnNativeCurrency.snap b/.forge-snapshots/BinPoolManagerTest#testBurnNativeCurrency.snap index 543bcaed..25e06cb1 100644 --- a/.forge-snapshots/BinPoolManagerTest#testBurnNativeCurrency.snap +++ b/.forge-snapshots/BinPoolManagerTest#testBurnNativeCurrency.snap @@ -1 +1 @@ -138220 \ No newline at end of file +136931 \ No newline at end of file diff --git a/.forge-snapshots/BinPoolManagerTest#testFuzzUpdateDynamicLPFee.snap b/.forge-snapshots/BinPoolManagerTest#testFuzzUpdateDynamicLPFee.snap index 52547169..31fc91f1 100644 --- a/.forge-snapshots/BinPoolManagerTest#testFuzzUpdateDynamicLPFee.snap +++ b/.forge-snapshots/BinPoolManagerTest#testFuzzUpdateDynamicLPFee.snap @@ -1 +1 @@ -32575 \ No newline at end of file +32533 \ No newline at end of file diff --git a/.forge-snapshots/BinPoolManagerTest#testGasBurnHalfBin.snap b/.forge-snapshots/BinPoolManagerTest#testGasBurnHalfBin.snap index cae7a21c..5a99b3fd 100644 --- a/.forge-snapshots/BinPoolManagerTest#testGasBurnHalfBin.snap +++ b/.forge-snapshots/BinPoolManagerTest#testGasBurnHalfBin.snap @@ -1 +1 @@ -148243 \ No newline at end of file +146635 \ No newline at end of file diff --git a/.forge-snapshots/BinPoolManagerTest#testGasBurnNineBins.snap b/.forge-snapshots/BinPoolManagerTest#testGasBurnNineBins.snap index 687e2eb4..f6eb1c51 100644 --- a/.forge-snapshots/BinPoolManagerTest#testGasBurnNineBins.snap +++ b/.forge-snapshots/BinPoolManagerTest#testGasBurnNineBins.snap @@ -1 +1 @@ -296172 \ No newline at end of file +294227 \ No newline at end of file diff --git a/.forge-snapshots/BinPoolManagerTest#testGasBurnOneBin.snap b/.forge-snapshots/BinPoolManagerTest#testGasBurnOneBin.snap index fd32f1eb..b2aeefb8 100644 --- a/.forge-snapshots/BinPoolManagerTest#testGasBurnOneBin.snap +++ b/.forge-snapshots/BinPoolManagerTest#testGasBurnOneBin.snap @@ -1 +1 @@ -131429 \ No newline at end of file +130141 \ No newline at end of file diff --git a/.forge-snapshots/BinPoolManagerTest#testGasDonate.snap b/.forge-snapshots/BinPoolManagerTest#testGasDonate.snap index b4e21258..d9a0fef9 100644 --- a/.forge-snapshots/BinPoolManagerTest#testGasDonate.snap +++ b/.forge-snapshots/BinPoolManagerTest#testGasDonate.snap @@ -1 +1 @@ -120460 \ No newline at end of file +119261 \ No newline at end of file diff --git a/.forge-snapshots/BinPoolManagerTest#testGasMintNneBins-1.snap b/.forge-snapshots/BinPoolManagerTest#testGasMintNneBins-1.snap index b3dfb65e..7f26f583 100644 --- a/.forge-snapshots/BinPoolManagerTest#testGasMintNneBins-1.snap +++ b/.forge-snapshots/BinPoolManagerTest#testGasMintNneBins-1.snap @@ -1 +1 @@ -977463 \ No newline at end of file +975902 \ No newline at end of file diff --git a/.forge-snapshots/BinPoolManagerTest#testGasMintNneBins-2.snap b/.forge-snapshots/BinPoolManagerTest#testGasMintNneBins-2.snap index 38b7e68d..9c235f3c 100644 --- a/.forge-snapshots/BinPoolManagerTest#testGasMintNneBins-2.snap +++ b/.forge-snapshots/BinPoolManagerTest#testGasMintNneBins-2.snap @@ -1 +1 @@ -339653 \ No newline at end of file +338092 \ No newline at end of file diff --git a/.forge-snapshots/BinPoolManagerTest#testGasMintOneBin-1.snap b/.forge-snapshots/BinPoolManagerTest#testGasMintOneBin-1.snap index ed8fcbcc..ced025ae 100644 --- a/.forge-snapshots/BinPoolManagerTest#testGasMintOneBin-1.snap +++ b/.forge-snapshots/BinPoolManagerTest#testGasMintOneBin-1.snap @@ -1 +1 @@ -343130 \ No newline at end of file +341673 \ No newline at end of file diff --git a/.forge-snapshots/BinPoolManagerTest#testGasMintOneBin-2.snap b/.forge-snapshots/BinPoolManagerTest#testGasMintOneBin-2.snap index 1931727d..0eb6cb87 100644 --- a/.forge-snapshots/BinPoolManagerTest#testGasMintOneBin-2.snap +++ b/.forge-snapshots/BinPoolManagerTest#testGasMintOneBin-2.snap @@ -1 +1 @@ -146073 \ No newline at end of file +144616 \ No newline at end of file diff --git a/.forge-snapshots/BinPoolManagerTest#testGasSwapMultipleBins.snap b/.forge-snapshots/BinPoolManagerTest#testGasSwapMultipleBins.snap index 9c85b35e..716e9990 100644 --- a/.forge-snapshots/BinPoolManagerTest#testGasSwapMultipleBins.snap +++ b/.forge-snapshots/BinPoolManagerTest#testGasSwapMultipleBins.snap @@ -1 +1 @@ -180414 \ No newline at end of file +179041 \ No newline at end of file diff --git a/.forge-snapshots/BinPoolManagerTest#testGasSwapOverBigBinIdGate.snap b/.forge-snapshots/BinPoolManagerTest#testGasSwapOverBigBinIdGate.snap index 946204dc..3d661fd1 100644 --- a/.forge-snapshots/BinPoolManagerTest#testGasSwapOverBigBinIdGate.snap +++ b/.forge-snapshots/BinPoolManagerTest#testGasSwapOverBigBinIdGate.snap @@ -1 +1 @@ -186397 \ No newline at end of file +185024 \ No newline at end of file diff --git a/.forge-snapshots/BinPoolManagerTest#testGasSwapSingleBin.snap b/.forge-snapshots/BinPoolManagerTest#testGasSwapSingleBin.snap index ff1a208d..4efbe4df 100644 --- a/.forge-snapshots/BinPoolManagerTest#testGasSwapSingleBin.snap +++ b/.forge-snapshots/BinPoolManagerTest#testGasSwapSingleBin.snap @@ -1 +1 @@ -138837 \ No newline at end of file +137479 \ No newline at end of file diff --git a/.forge-snapshots/BinPoolManagerTest#testMintNativeCurrency.snap b/.forge-snapshots/BinPoolManagerTest#testMintNativeCurrency.snap index a48f50d8..5246259d 100644 --- a/.forge-snapshots/BinPoolManagerTest#testMintNativeCurrency.snap +++ b/.forge-snapshots/BinPoolManagerTest#testMintNativeCurrency.snap @@ -1 +1 @@ -309646 \ No newline at end of file +308185 \ No newline at end of file diff --git a/.forge-snapshots/CLPoolManagerTest#addLiquidity_fromEmpty.snap b/.forge-snapshots/CLPoolManagerTest#addLiquidity_fromEmpty.snap index 65687297..edf941ea 100644 --- a/.forge-snapshots/CLPoolManagerTest#addLiquidity_fromEmpty.snap +++ b/.forge-snapshots/CLPoolManagerTest#addLiquidity_fromEmpty.snap @@ -1 +1 @@ -362836 \ No newline at end of file +360013 \ No newline at end of file diff --git a/.forge-snapshots/CLPoolManagerTest#addLiquidity_fromNonEmpty.snap b/.forge-snapshots/CLPoolManagerTest#addLiquidity_fromNonEmpty.snap index dd25bb7b..c5b59360 100644 --- a/.forge-snapshots/CLPoolManagerTest#addLiquidity_fromNonEmpty.snap +++ b/.forge-snapshots/CLPoolManagerTest#addLiquidity_fromNonEmpty.snap @@ -1 +1 @@ -178004 \ No newline at end of file +175181 \ No newline at end of file diff --git a/.forge-snapshots/CLPoolManagerTest#addLiquidity_nativeToken.snap b/.forge-snapshots/CLPoolManagerTest#addLiquidity_nativeToken.snap index 09f11434..00c76600 100644 --- a/.forge-snapshots/CLPoolManagerTest#addLiquidity_nativeToken.snap +++ b/.forge-snapshots/CLPoolManagerTest#addLiquidity_nativeToken.snap @@ -1 +1 @@ -248032 \ No newline at end of file +245159 \ No newline at end of file diff --git a/.forge-snapshots/CLPoolManagerTest#donateBothTokens.snap b/.forge-snapshots/CLPoolManagerTest#donateBothTokens.snap index 18cdddca..f2a9fd1d 100644 --- a/.forge-snapshots/CLPoolManagerTest#donateBothTokens.snap +++ b/.forge-snapshots/CLPoolManagerTest#donateBothTokens.snap @@ -1 +1 @@ -170799 \ No newline at end of file +168435 \ No newline at end of file diff --git a/.forge-snapshots/CLPoolManagerTest#gasDonateOneToken.snap b/.forge-snapshots/CLPoolManagerTest#gasDonateOneToken.snap index d8440adf..3eac678f 100644 --- a/.forge-snapshots/CLPoolManagerTest#gasDonateOneToken.snap +++ b/.forge-snapshots/CLPoolManagerTest#gasDonateOneToken.snap @@ -1 +1 @@ -114635 \ No newline at end of file +112267 \ No newline at end of file diff --git a/.forge-snapshots/CLPoolManagerTest#removeLiquidity_toNonEmpty.snap b/.forge-snapshots/CLPoolManagerTest#removeLiquidity_toNonEmpty.snap index 25b88e96..1fbde7da 100644 --- a/.forge-snapshots/CLPoolManagerTest#removeLiquidity_toNonEmpty.snap +++ b/.forge-snapshots/CLPoolManagerTest#removeLiquidity_toNonEmpty.snap @@ -1 +1 @@ -124115 \ No newline at end of file +121284 \ No newline at end of file diff --git a/.forge-snapshots/CLPoolManagerTest#swap_againstLiquidity.snap b/.forge-snapshots/CLPoolManagerTest#swap_againstLiquidity.snap index 6fea92c4..6d970cc2 100644 --- a/.forge-snapshots/CLPoolManagerTest#swap_againstLiquidity.snap +++ b/.forge-snapshots/CLPoolManagerTest#swap_againstLiquidity.snap @@ -1 +1 @@ -141394 \ No newline at end of file +138632 \ No newline at end of file diff --git a/.forge-snapshots/CLPoolManagerTest#swap_leaveSurplusTokenInVault.snap b/.forge-snapshots/CLPoolManagerTest#swap_leaveSurplusTokenInVault.snap index 946c5b65..222ee60d 100644 --- a/.forge-snapshots/CLPoolManagerTest#swap_leaveSurplusTokenInVault.snap +++ b/.forge-snapshots/CLPoolManagerTest#swap_leaveSurplusTokenInVault.snap @@ -1 +1 @@ -174910 \ No newline at end of file +172143 \ No newline at end of file diff --git a/.forge-snapshots/CLPoolManagerTest#swap_runOutOfLiquidity.snap b/.forge-snapshots/CLPoolManagerTest#swap_runOutOfLiquidity.snap index d096136f..7d230889 100644 --- a/.forge-snapshots/CLPoolManagerTest#swap_runOutOfLiquidity.snap +++ b/.forge-snapshots/CLPoolManagerTest#swap_runOutOfLiquidity.snap @@ -1 +1 @@ -161272 \ No newline at end of file +158546 \ No newline at end of file diff --git a/.forge-snapshots/CLPoolManagerTest#swap_simple.snap b/.forge-snapshots/CLPoolManagerTest#swap_simple.snap index 5b8e1999..5b98bde8 100644 --- a/.forge-snapshots/CLPoolManagerTest#swap_simple.snap +++ b/.forge-snapshots/CLPoolManagerTest#swap_simple.snap @@ -1 +1 @@ -79336 \ No newline at end of file +76575 \ No newline at end of file diff --git a/.forge-snapshots/CLPoolManagerTest#swap_useSurplusTokenAsInput.snap b/.forge-snapshots/CLPoolManagerTest#swap_useSurplusTokenAsInput.snap index 444ab1e5..7ab32893 100644 --- a/.forge-snapshots/CLPoolManagerTest#swap_useSurplusTokenAsInput.snap +++ b/.forge-snapshots/CLPoolManagerTest#swap_useSurplusTokenAsInput.snap @@ -1 +1 @@ -153550 \ No newline at end of file +150789 \ No newline at end of file diff --git a/.forge-snapshots/CLPoolManagerTest#swap_withHooks.snap b/.forge-snapshots/CLPoolManagerTest#swap_withHooks.snap index adce9140..cdb2bf9a 100644 --- a/.forge-snapshots/CLPoolManagerTest#swap_withHooks.snap +++ b/.forge-snapshots/CLPoolManagerTest#swap_withHooks.snap @@ -1 +1 @@ -96143 \ No newline at end of file +93467 \ No newline at end of file diff --git a/.forge-snapshots/CLPoolManagerTest#swap_withNative.snap b/.forge-snapshots/CLPoolManagerTest#swap_withNative.snap index 6370d5ed..30883964 100644 --- a/.forge-snapshots/CLPoolManagerTest#swap_withNative.snap +++ b/.forge-snapshots/CLPoolManagerTest#swap_withNative.snap @@ -1 +1 @@ -79339 \ No newline at end of file +76578 \ No newline at end of file diff --git a/.forge-snapshots/CLPoolManagerTest#testFuzzUpdateDynamicLPFee.snap b/.forge-snapshots/CLPoolManagerTest#testFuzzUpdateDynamicLPFee.snap index e9b48a35..6e03401a 100644 --- a/.forge-snapshots/CLPoolManagerTest#testFuzzUpdateDynamicLPFee.snap +++ b/.forge-snapshots/CLPoolManagerTest#testFuzzUpdateDynamicLPFee.snap @@ -1 +1 @@ -32291 \ No newline at end of file +32316 \ No newline at end of file diff --git a/.forge-snapshots/ExtsloadTest#extsloadInBatch.snap b/.forge-snapshots/ExtsloadTest#extsloadInBatch.snap index 8f979894..6ed84f8e 100644 --- a/.forge-snapshots/ExtsloadTest#extsloadInBatch.snap +++ b/.forge-snapshots/ExtsloadTest#extsloadInBatch.snap @@ -1 +1 @@ -11374 \ No newline at end of file +11394 \ No newline at end of file diff --git a/.forge-snapshots/SqrtPriceMathTest#getAmount1Delta_gasCostForAmount1WhereRoundUpIsFalse.snap b/.forge-snapshots/SqrtPriceMathTest#getAmount1Delta_gasCostForAmount1WhereRoundUpIsFalse.snap index 1fc188de..e157b5b5 100644 --- a/.forge-snapshots/SqrtPriceMathTest#getAmount1Delta_gasCostForAmount1WhereRoundUpIsFalse.snap +++ b/.forge-snapshots/SqrtPriceMathTest#getAmount1Delta_gasCostForAmount1WhereRoundUpIsFalse.snap @@ -1 +1 @@ -525 \ No newline at end of file +520 \ No newline at end of file diff --git a/.forge-snapshots/SqrtPriceMathTest#getAmount1Delta_gasCostForAmount1WhereRoundUpIsTrue.snap b/.forge-snapshots/SqrtPriceMathTest#getAmount1Delta_gasCostForAmount1WhereRoundUpIsTrue.snap index 929530e8..70e36030 100644 --- a/.forge-snapshots/SqrtPriceMathTest#getAmount1Delta_gasCostForAmount1WhereRoundUpIsTrue.snap +++ b/.forge-snapshots/SqrtPriceMathTest#getAmount1Delta_gasCostForAmount1WhereRoundUpIsTrue.snap @@ -1 +1 @@ -653 \ No newline at end of file +648 \ No newline at end of file diff --git a/.forge-snapshots/SwapMathTest#SwapOneForZeroExactInCapped.snap b/.forge-snapshots/SwapMathTest#SwapOneForZeroExactInCapped.snap index 4c97b937..9a6039e9 100644 --- a/.forge-snapshots/SwapMathTest#SwapOneForZeroExactInCapped.snap +++ b/.forge-snapshots/SwapMathTest#SwapOneForZeroExactInCapped.snap @@ -1 +1 @@ -2239 \ No newline at end of file +2234 \ No newline at end of file diff --git a/.forge-snapshots/SwapMathTest#SwapOneForZeroExactInPartial.snap b/.forge-snapshots/SwapMathTest#SwapOneForZeroExactInPartial.snap index f8a37503..a71ad804 100644 --- a/.forge-snapshots/SwapMathTest#SwapOneForZeroExactInPartial.snap +++ b/.forge-snapshots/SwapMathTest#SwapOneForZeroExactInPartial.snap @@ -1 +1 @@ -3029 \ No newline at end of file +3019 \ No newline at end of file diff --git a/.forge-snapshots/SwapMathTest#SwapOneForZeroExactOutCapped.snap b/.forge-snapshots/SwapMathTest#SwapOneForZeroExactOutCapped.snap index 47c57f60..48e42dfb 100644 --- a/.forge-snapshots/SwapMathTest#SwapOneForZeroExactOutCapped.snap +++ b/.forge-snapshots/SwapMathTest#SwapOneForZeroExactOutCapped.snap @@ -1 +1 @@ -1981 \ No newline at end of file +1976 \ No newline at end of file diff --git a/.forge-snapshots/SwapMathTest#SwapOneForZeroExactOutPartial.snap b/.forge-snapshots/SwapMathTest#SwapOneForZeroExactOutPartial.snap index f8a37503..a71ad804 100644 --- a/.forge-snapshots/SwapMathTest#SwapOneForZeroExactOutPartial.snap +++ b/.forge-snapshots/SwapMathTest#SwapOneForZeroExactOutPartial.snap @@ -1 +1 @@ -3029 \ No newline at end of file +3019 \ No newline at end of file diff --git a/.forge-snapshots/SwapMathTest#SwapZeroForOneExactInCapped.snap b/.forge-snapshots/SwapMathTest#SwapZeroForOneExactInCapped.snap index 9606a0dd..21aeb5a6 100644 --- a/.forge-snapshots/SwapMathTest#SwapZeroForOneExactInCapped.snap +++ b/.forge-snapshots/SwapMathTest#SwapZeroForOneExactInCapped.snap @@ -1 +1 @@ -2229 \ No newline at end of file +2224 \ No newline at end of file diff --git a/.forge-snapshots/SwapMathTest#SwapZeroForOneExactInPartial.snap b/.forge-snapshots/SwapMathTest#SwapZeroForOneExactInPartial.snap index 80f7c30e..1a73c6cc 100644 --- a/.forge-snapshots/SwapMathTest#SwapZeroForOneExactInPartial.snap +++ b/.forge-snapshots/SwapMathTest#SwapZeroForOneExactInPartial.snap @@ -1 +1 @@ -3182 \ No newline at end of file +3177 \ No newline at end of file diff --git a/.forge-snapshots/SwapMathTest#SwapZeroForOneExactOutCapped.snap b/.forge-snapshots/SwapMathTest#SwapZeroForOneExactOutCapped.snap index 7237be0c..42e20350 100644 --- a/.forge-snapshots/SwapMathTest#SwapZeroForOneExactOutCapped.snap +++ b/.forge-snapshots/SwapMathTest#SwapZeroForOneExactOutCapped.snap @@ -1 +1 @@ -1971 \ No newline at end of file +1966 \ No newline at end of file diff --git a/.forge-snapshots/SwapMathTest#SwapZeroForOneExactOutPartial.snap b/.forge-snapshots/SwapMathTest#SwapZeroForOneExactOutPartial.snap index 80f7c30e..1a73c6cc 100644 --- a/.forge-snapshots/SwapMathTest#SwapZeroForOneExactOutPartial.snap +++ b/.forge-snapshots/SwapMathTest#SwapZeroForOneExactOutPartial.snap @@ -1 +1 @@ -3182 \ No newline at end of file +3177 \ No newline at end of file diff --git a/.forge-snapshots/TickTest#tickSpacingToMaxLiquidityPerTick.snap b/.forge-snapshots/TickTest#tickSpacingToMaxLiquidityPerTick.snap index 04170a36..5ec4258d 100644 --- a/.forge-snapshots/TickTest#tickSpacingToMaxLiquidityPerTick.snap +++ b/.forge-snapshots/TickTest#tickSpacingToMaxLiquidityPerTick.snap @@ -1 +1 @@ -1151 \ No newline at end of file +1159 \ No newline at end of file diff --git a/.forge-snapshots/TickTest#update.snap b/.forge-snapshots/TickTest#update.snap index 7b7e6841..201f1298 100644 --- a/.forge-snapshots/TickTest#update.snap +++ b/.forge-snapshots/TickTest#update.snap @@ -1 +1 @@ -134819 \ No newline at end of file +134827 \ No newline at end of file diff --git a/.forge-snapshots/VaultTest#lockSettledWhenAddLiquidity.snap b/.forge-snapshots/VaultTest#lockSettledWhenAddLiquidity.snap index f38ea76a..4b9ea1ed 100644 --- a/.forge-snapshots/VaultTest#lockSettledWhenAddLiquidity.snap +++ b/.forge-snapshots/VaultTest#lockSettledWhenAddLiquidity.snap @@ -1 +1 @@ -81647 \ No newline at end of file +81469 \ No newline at end of file diff --git a/.forge-snapshots/VaultTest#lockSettledWhenFlashloan.snap b/.forge-snapshots/VaultTest#lockSettledWhenFlashloan.snap index e188f56d..30c979e2 100644 --- a/.forge-snapshots/VaultTest#lockSettledWhenFlashloan.snap +++ b/.forge-snapshots/VaultTest#lockSettledWhenFlashloan.snap @@ -1 +1 @@ -121653 \ No newline at end of file +121465 \ No newline at end of file diff --git a/.forge-snapshots/VaultTest#lockSettledWhenMultiHopSwap.snap b/.forge-snapshots/VaultTest#lockSettledWhenMultiHopSwap.snap index ff3df376..4de5f0c6 100644 --- a/.forge-snapshots/VaultTest#lockSettledWhenMultiHopSwap.snap +++ b/.forge-snapshots/VaultTest#lockSettledWhenMultiHopSwap.snap @@ -1 +1 @@ -45235 \ No newline at end of file +45057 \ No newline at end of file diff --git a/.forge-snapshots/VaultTest#lockSettledWhenSwap.snap b/.forge-snapshots/VaultTest#lockSettledWhenSwap.snap index a8ef6127..5a398939 100644 --- a/.forge-snapshots/VaultTest#lockSettledWhenSwap.snap +++ b/.forge-snapshots/VaultTest#lockSettledWhenSwap.snap @@ -1 +1 @@ -45234 \ No newline at end of file +45056 \ No newline at end of file diff --git a/.forge-snapshots/VaultTest#testLock_NoOp.snap b/.forge-snapshots/VaultTest#testLock_NoOp.snap index dc6975ce..4aef5c16 100644 --- a/.forge-snapshots/VaultTest#testLock_NoOp.snap +++ b/.forge-snapshots/VaultTest#testLock_NoOp.snap @@ -1 +1 @@ -33260 \ No newline at end of file +33072 \ No newline at end of file diff --git a/foundry.toml b/foundry.toml index c96a6059..019a911e 100644 --- a/foundry.toml +++ b/foundry.toml @@ -1,14 +1,14 @@ [profile.default] src = 'src' out = 'foundry-out' -solc_version = '0.8.24' +solc_version = '0.8.26' optimizer_runs = 800 via_ir = false ffi = true fs_permissions = [ { access = "read-write", path = ".forge-snapshots/" }, { access = "read", path = "./foundry-out" }, - { access = "read", path = "./script/config"}, + { access = "read", path = "./script/config" }, ] evm_version = 'cancun' @@ -21,7 +21,7 @@ runs = 1000 runs = 10000 [profile.ci.invariant] -runs = 1000 # The number of calls to make in the invariant tests +runs = 1000 # The number of calls to make in the invariant tests call_override = false # Override calls fail_on_revert = false # Fail the test if the contract reverts diff --git a/src/libraries/LPFeeLibrary.sol b/src/libraries/LPFeeLibrary.sol index 6c3c1f8e..b34a5bb7 100644 --- a/src/libraries/LPFeeLibrary.sol +++ b/src/libraries/LPFeeLibrary.sol @@ -13,10 +13,9 @@ library LPFeeLibrary { error FeeTooLarge(); /// @dev the flag and mask - uint24 public constant FEE_MASK = 0x7FFFFF; uint24 public constant OVERRIDE_MASK = 0xBFFFFF; - // the top bit of the fee in a PoolKey is used to signal if a Pool's LP fee is dynamic + // a dynamic fee pool must have exactly same value for fee field uint24 public constant DYNAMIC_FEE_FLAG = 0x800000; // the second bit of the fee returned by beforeSwap is used to signal if the stored LP fee should be overridden in this swap @@ -29,7 +28,7 @@ library LPFeeLibrary { uint24 public constant TEN_PERCENT_FEE = 100_000; function isDynamicLPFee(uint24 self) internal pure returns (bool) { - return self & DYNAMIC_FEE_FLAG != 0; + return self == DYNAMIC_FEE_FLAG; } function validate(uint24 self, uint24 maxFee) internal pure { @@ -40,7 +39,7 @@ library LPFeeLibrary { function getInitialLPFee(uint24 self) internal pure returns (uint24 lpFee) { // the initial fee for a dynamic fee pool is 0 if (self.isDynamicLPFee()) return 0; - lpFee = self & FEE_MASK; + lpFee = self; } /// @notice returns true if the fee has the override flag set (top bit of the uint24) diff --git a/src/pool-bin/BinPoolManager.sol b/src/pool-bin/BinPoolManager.sol index 94b49cdb..48cbb411 100644 --- a/src/pool-bin/BinPoolManager.sol +++ b/src/pool-bin/BinPoolManager.sol @@ -196,7 +196,6 @@ contract BinPoolManager is IBinPoolManager, ProtocolFees, Extsload { msg.sender, key, swapForY, 0, amountOut ); } else { - // clear the top 4 bits since they may be flagged lpFee = key.fee.getInitialLPFee(); } lpFee.validate(LPFeeLibrary.TEN_PERCENT_FEE); diff --git a/src/types/BalanceDelta.sol b/src/types/BalanceDelta.sol index c7bef7c3..4bed98a9 100644 --- a/src/types/BalanceDelta.sol +++ b/src/types/BalanceDelta.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.20; +pragma solidity ^0.8.24; import {SafeCast} from "../libraries/SafeCast.sol"; diff --git a/src/types/PoolKey.sol b/src/types/PoolKey.sol index 818812a0..647576b3 100644 --- a/src/types/PoolKey.sol +++ b/src/types/PoolKey.sol @@ -15,7 +15,7 @@ struct PoolKey { IHooks hooks; /// @notice The pool manager of the pool IPoolManager poolManager; - /// @notice The pool lp fee, capped at 1_000_000. The upper 4 bits determine if the hook sets any fees. + /// @notice The pool lp fee, capped at 1_000_000. If the pool has a dynamic fee then it must be exactly equal to 0x800000 uint24 fee; /// @notice Hooks callback and pool specific parameters, i.e. tickSpacing for CL, binStep for bin bytes32 parameters; diff --git a/test/VaultToken.t.sol b/test/VaultToken.t.sol index 5590db12..38d69286 100644 --- a/test/VaultToken.t.sol +++ b/test/VaultToken.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: UNLICENSED -pragma solidity 0.8.24; +pragma solidity ^0.8.24; import {Test} from "forge-std/Test.sol"; import {VaultToken} from "../src/VaultToken.sol"; diff --git a/test/libraries/BalanceDelta.t.sol b/test/libraries/BalanceDelta.t.sol index 90f22e32..5ed0ce5e 100644 --- a/test/libraries/BalanceDelta.t.sol +++ b/test/libraries/BalanceDelta.t.sol @@ -131,7 +131,7 @@ contract TestBalanceDelta is Test { else assertFalse(isEqual); } - function test_fuzz_neq(int128 a, int128 b, int128 c, int128 d) public pure { + function test_fuzz_neq(int128 a, int128 b, int128 c, int128 d) public { bool isNotEqual = (toBalanceDelta(a, b) != toBalanceDelta(c, d)); if (a != c || b != d) assertTrue(isNotEqual); else assertFalse(isNotEqual); diff --git a/test/libraries/LPFeeLibrary.t.sol b/test/libraries/LPFeeLibrary.t.sol index 04ec1f01..030368f8 100644 --- a/test/libraries/LPFeeLibrary.t.sol +++ b/test/libraries/LPFeeLibrary.t.sol @@ -22,12 +22,20 @@ contract LPFeeLibraryTest is Test { assertEq(LPFeeLibrary.isDynamicLPFee(0x100000), false); // 1111 1111 1111 1111 1111 1111 - assertEq(LPFeeLibrary.isDynamicLPFee(0xFFFFFF), true); + assertEq(LPFeeLibrary.isDynamicLPFee(0xFFFFFF), false); // 0111 1111 1111 1111 1111 1111 assertEq(LPFeeLibrary.isDynamicLPFee(0x7FFFFF), false); } + function testIsDynamicLPFeeFuzz(uint24 fee) public { + if (fee != 0x800000) { + assertEq(LPFeeLibrary.isDynamicLPFee(fee), false); + } else { + assertEq(LPFeeLibrary.isDynamicLPFee(fee), true); + } + } + function testGetInitialLPFee() public { // static assertEq(LPFeeLibrary.getInitialLPFee(0x000001), 0x000001); @@ -36,12 +44,16 @@ contract LPFeeLibraryTest is Test { assertEq(LPFeeLibrary.getInitialLPFee(0x001004), 0x001004); assertEq(LPFeeLibrary.getInitialLPFee(0x111020), 0x111020); assertEq(LPFeeLibrary.getInitialLPFee(0x511020), 0x511020); - + assertEq(LPFeeLibrary.getInitialLPFee(0xF00F05), 0xF00F05); + assertEq(LPFeeLibrary.getInitialLPFee(0x800310), 0x800310); + assertEq(LPFeeLibrary.getInitialLPFee(0x901020), 0x901020); + assertEq(LPFeeLibrary.getInitialLPFee(0x800001), 0x800001); + assertEq(LPFeeLibrary.getInitialLPFee(0x800010), 0x800010); + assertEq(LPFeeLibrary.getInitialLPFee(0x800100), 0x800100); + assertEq(LPFeeLibrary.getInitialLPFee(0x801000), 0x801000); + assertEq(LPFeeLibrary.getInitialLPFee(0x810000), 0x810000); // dynamic - assertEq(LPFeeLibrary.getInitialLPFee(0xF00F05), 0); - assertEq(LPFeeLibrary.getInitialLPFee(0x800310), 0); assertEq(LPFeeLibrary.getInitialLPFee(0x800000), 0); - assertEq(LPFeeLibrary.getInitialLPFee(0x901020), 0); } function testFuzzValidate(uint24 self, uint24 maxFee) public { diff --git a/test/pool-bin/BinHookReturnsFee.t.sol b/test/pool-bin/BinHookReturnsFee.t.sol index 55b1514d..27f0cfca 100644 --- a/test/pool-bin/BinHookReturnsFee.t.sol +++ b/test/pool-bin/BinHookReturnsFee.t.sol @@ -88,7 +88,7 @@ contract BinHookReturnsFeeTest is Test, BinTestHelper { currency1: currency1, hooks: dynamicReturnsFeesHook, poolManager: poolManager, - fee: LPFeeLibrary.DYNAMIC_FEE_FLAG, // 3000 = 0.3% + fee: LPFeeLibrary.DYNAMIC_FEE_FLAG, parameters: bytes32(uint256(dynamicReturnsFeesHook.getHooksRegistrationBitmap())).setBinStep(10) }); diff --git a/test/pool-bin/BinPoolManager.t.sol b/test/pool-bin/BinPoolManager.t.sol index 5a2935d5..852e8159 100644 --- a/test/pool-bin/BinPoolManager.t.sol +++ b/test/pool-bin/BinPoolManager.t.sol @@ -213,7 +213,7 @@ contract BinPoolManagerTest is Test, GasSnapshot, BinTestHelper { currency1: currency1, hooks: IHooks(address(binFeeManagerHook)), poolManager: IPoolManager(address(poolManager)), - fee: LPFeeLibrary.DYNAMIC_FEE_FLAG + uint24(3000), // 3000 = 0.3% + fee: LPFeeLibrary.DYNAMIC_FEE_FLAG, parameters: bytes32(uint256(bitMap)).setBinStep(10) }); @@ -224,6 +224,24 @@ contract BinPoolManagerTest is Test, GasSnapshot, BinTestHelper { poolManager.updateDynamicLPFee(key, dynamicSwapFee); } + function testInitializeInvalidFee() public { + uint16 bitMap = 0x0040; // 0000 0000 0100 0000 (before swap call) + BinFeeManagerHook binFeeManagerHook = new BinFeeManagerHook(poolManager); + binFeeManagerHook.setHooksRegistrationBitmap(bitMap); + + key = PoolKey({ + currency0: currency0, + currency1: currency1, + hooks: IHooks(address(binFeeManagerHook)), + poolManager: IPoolManager(address(poolManager)), + fee: LPFeeLibrary.DYNAMIC_FEE_FLAG + 1, + parameters: bytes32(uint256(bitMap)).setBinStep(10) + }); + + vm.expectRevert(LPFeeLibrary.FeeTooLarge.selector); + poolManager.initialize(key, 10, new bytes(0)); + } + function testInitializeSwapFeeTooLarge() public { uint24 swapFee = LPFeeLibrary.TEN_PERCENT_FEE + 1; @@ -888,7 +906,7 @@ contract BinPoolManagerTest is Test, GasSnapshot, BinTestHelper { currency1: currency1, hooks: IHooks(address(binFeeManagerHook)), poolManager: IPoolManager(address(poolManager)), - fee: LPFeeLibrary.DYNAMIC_FEE_FLAG + uint24(3000), // 3000 = 0.3% + fee: LPFeeLibrary.DYNAMIC_FEE_FLAG, parameters: bytes32(uint256(bitMap)).setBinStep(10) }); @@ -925,7 +943,7 @@ contract BinPoolManagerTest is Test, GasSnapshot, BinTestHelper { currency1: currency1, hooks: IHooks(address(binFeeManagerHook)), poolManager: IPoolManager(address(poolManager)), - fee: LPFeeLibrary.DYNAMIC_FEE_FLAG + uint24(3000), // 3000 = 0.3% + fee: LPFeeLibrary.DYNAMIC_FEE_FLAG, parameters: bytes32(uint256(bitMap)).setBinStep(10) }); poolManager.initialize(key, activeId, new bytes(0)); diff --git a/test/pool-bin/libraries/BinPoolFee.t.sol b/test/pool-bin/libraries/BinPoolFee.t.sol index ccee087e..161ace40 100644 --- a/test/pool-bin/libraries/BinPoolFee.t.sol +++ b/test/pool-bin/libraries/BinPoolFee.t.sol @@ -138,7 +138,7 @@ contract BinPoolFeeTest is BinTestHelper { currency1: currency1, hooks: IHooks(address(binFeeManagerHook)), poolManager: IPoolManager(address(poolManager)), - fee: LPFeeLibrary.DYNAMIC_FEE_FLAG + uint24(10_000), // 10_000 = 1% + fee: LPFeeLibrary.DYNAMIC_FEE_FLAG, parameters: bytes32(uint256(bitMap)).setBinStep(10) }); @@ -158,7 +158,7 @@ contract BinPoolFeeTest is BinTestHelper { hooks: IHooks(address(mockFeeManagerHook)), poolManager: IPoolManager(address(poolManager)), /// @dev dynamic swap fee is 0 when pool is initialized, hence 0.3% will be ignored - fee: LPFeeLibrary.DYNAMIC_FEE_FLAG + uint24(3000), + fee: LPFeeLibrary.DYNAMIC_FEE_FLAG, parameters: BinPoolParametersHelper.setBinStep( bytes32(uint256(mockFeeManagerHook.getHooksRegistrationBitmap())), 10 ) @@ -291,7 +291,7 @@ contract BinPoolFeeTest is BinTestHelper { currency1: currency1, hooks: IHooks(address(binFeeManagerHook)), poolManager: IPoolManager(address(poolManager)), - fee: LPFeeLibrary.DYNAMIC_FEE_FLAG + poolFee, + fee: LPFeeLibrary.DYNAMIC_FEE_FLAG, // parameters: poolParam // binStep parameters: bytes32(uint256(bitMap)).setBinStep(10) }); @@ -332,7 +332,7 @@ contract BinPoolFeeTest is BinTestHelper { currency1: currency1, hooks: IHooks(address(binFeeManagerHook)), poolManager: IPoolManager(address(poolManager)), - fee: LPFeeLibrary.DYNAMIC_FEE_FLAG + uint24(10_000), // 10_000 = 1% + fee: LPFeeLibrary.DYNAMIC_FEE_FLAG, parameters: bytes32(uint256(bitMap)).setBinStep(10) }); diff --git a/test/pool-cl/CLPoolManager.t.sol b/test/pool-cl/CLPoolManager.t.sol index 8ff939f7..c525e79e 100644 --- a/test/pool-cl/CLPoolManager.t.sol +++ b/test/pool-cl/CLPoolManager.t.sol @@ -359,7 +359,7 @@ contract CLPoolManagerTest is Test, NoIsolate, Deployers, TokenFixture, GasSnaps } else if (!_validateHookPermissionsConflict(key)) { vm.expectRevert(abi.encodeWithSelector(Hooks.HookPermissionsValidationError.selector)); poolManager.initialize(key, sqrtPriceX96, ZERO_BYTES); - } else if (key.fee & LPFeeLibrary.FEE_MASK > LPFeeLibrary.ONE_HUNDRED_PERCENT_FEE) { + } else if (key.fee > LPFeeLibrary.ONE_HUNDRED_PERCENT_FEE) { vm.expectRevert(abi.encodeWithSelector(IProtocolFees.FeeTooLarge.selector)); poolManager.initialize(key, sqrtPriceX96, ZERO_BYTES); } else { @@ -662,7 +662,7 @@ contract CLPoolManagerTest is Test, NoIsolate, Deployers, TokenFixture, GasSnaps PoolKey memory key = PoolKey({ currency0: currency0, currency1: currency1, - fee: LPFeeLibrary.DYNAMIC_FEE_FLAG + uint24(3000), // 3000 = 0.3% + fee: LPFeeLibrary.DYNAMIC_FEE_FLAG, hooks: IHooks(address(clFeeManagerHook)), poolManager: poolManager, parameters: CLPoolParametersHelper.setTickSpacing( @@ -676,6 +676,23 @@ contract CLPoolManagerTest is Test, NoIsolate, Deployers, TokenFixture, GasSnaps poolManager.initialize(key, SQRT_RATIO_1_1, ZERO_BYTES); } + function test_initialize_failsDynamicFeeInvalid() public { + clFeeManagerHook.setHooksRegistrationBitmap(uint16(1 << HOOKS_AFTER_INITIALIZE_OFFSET)); + PoolKey memory key = PoolKey({ + currency0: currency0, + currency1: currency1, + fee: LPFeeLibrary.DYNAMIC_FEE_FLAG + 1, + hooks: IHooks(address(clFeeManagerHook)), + poolManager: poolManager, + parameters: CLPoolParametersHelper.setTickSpacing( + bytes32(uint256(clFeeManagerHook.getHooksRegistrationBitmap())), 10 + ) + }); + + vm.expectRevert(LPFeeLibrary.FeeTooLarge.selector); + poolManager.initialize(key, SQRT_RATIO_1_1, ZERO_BYTES); + } + // ************** *************** // // ************** modifyPosition *************** // // ************** *************** // @@ -1744,7 +1761,7 @@ contract CLPoolManagerTest is Test, NoIsolate, Deployers, TokenFixture, GasSnaps PoolKey memory key = PoolKey({ currency0: currency0, currency1: currency1, - fee: LPFeeLibrary.DYNAMIC_FEE_FLAG + uint24(3000), // 0.3% + fee: LPFeeLibrary.DYNAMIC_FEE_FLAG, // 0.3% hooks: IHooks(address(clFeeManagerHook)), poolManager: poolManager, parameters: bytes32(uint256((60 << 16) | clFeeManagerHook.getHooksRegistrationBitmap())) @@ -2725,7 +2742,7 @@ contract CLPoolManagerTest is Test, NoIsolate, Deployers, TokenFixture, GasSnaps PoolKey memory key = PoolKey({ currency0: currency0, currency1: currency1, - fee: LPFeeLibrary.DYNAMIC_FEE_FLAG + uint24(3000), // 3000 = 0.3% + fee: LPFeeLibrary.DYNAMIC_FEE_FLAG, hooks: IHooks(address(clFeeManagerHook)), poolManager: poolManager, parameters: bytes32(uint256(10) << 16) @@ -2761,7 +2778,7 @@ contract CLPoolManagerTest is Test, NoIsolate, Deployers, TokenFixture, GasSnaps PoolKey memory key = PoolKey({ currency0: currency0, currency1: currency1, - fee: LPFeeLibrary.DYNAMIC_FEE_FLAG + uint24(3000), // 3000 = 0.3% + fee: LPFeeLibrary.DYNAMIC_FEE_FLAG, hooks: IHooks(address(clFeeManagerHook)), poolManager: poolManager, parameters: bytes32(uint256((10 << 16) | clFeeManagerHook.getHooksRegistrationBitmap())) diff --git a/test/pool-cl/libraries/CLPool.t.sol b/test/pool-cl/libraries/CLPool.t.sol index 3bff44ed..3a7ba1d4 100644 --- a/test/pool-cl/libraries/CLPool.t.sol +++ b/test/pool-cl/libraries/CLPool.t.sol @@ -18,6 +18,7 @@ import {FixedPoint128} from "../../../src/pool-cl/libraries/FixedPoint128.sol"; import {ICLPoolManager} from "../../../src/pool-cl/interfaces/ICLPoolManager.sol"; import {LPFeeLibrary} from "../../../src/libraries/LPFeeLibrary.sol"; import {ProtocolFeeLibrary} from "../../../src/libraries/ProtocolFeeLibrary.sol"; +import {BalanceDelta, BalanceDeltaLibrary} from "../../../src/types/BalanceDelta.sol"; contract PoolTest is Test { using CLPool for CLPool.State; @@ -98,6 +99,28 @@ contract PoolTest is Test { CLPool.SwapParams memory swapParams, uint24 lpFee ) public { + // modifyLiquidityParams = CLPool.ModifyLiquidityParams({ + // owner: 0x250Eb93F2C350590E52cdb977b8BcF502a1Db7e7, + // tickLower: -402986, + // tickUpper: 50085, + // liquidityDelta: 33245614918536803008426086500145, + // tickSpacing: 1, + // salt: 0xfd9c91c4f1bbf3d855ba0a973b97c685c1dd51875a574392ef94ab56d7a72528 + // }); + // swapParams = CLPool.SwapParams({ + // tickSpacing: 8807, + // zeroForOne: true, + // amountSpecified: 20406714586857485490153777552586525, + // sqrtPriceLimitX96: 3669890892491818487, + // lpFeeOverride: 440 + // }); + // TODO: find a better way to cover following case: + // 1. when amountSpecified is large enough + // 2. and the effect price is either too large or too small (due to larger price slippage or inproper liquidity range) + // It will cause the amountUnspecified to be out of int128 range hence the tx reverts with SafeCastOverflow + // try to comment following three limitations and uncomment above case and rerun the test to verify + modifyLiquidityParams.tickLower = -100; + modifyLiquidityParams.tickUpper = 100; swapParams.amountSpecified = int256(bound(swapParams.amountSpecified, 0, type(int128).max)); testModifyPosition(sqrtPriceX96, modifyLiquidityParams, lpFee); @@ -149,7 +172,13 @@ contract PoolTest is Test { vm.expectRevert(CLPool.InvalidFeeForExactOut.selector); } - state.swap(swapParams); + (BalanceDelta delta,) = state.swap(swapParams); + + if (swapParams.amountSpecified == 0) { + // early return if amountSpecified is 0 + assertTrue(delta == BalanceDeltaLibrary.ZERO_DELTA); + return; + } if ( modifyLiquidityParams.liquidityDelta == 0