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 342163227..3a7de6606 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 @@ -144663 \ No newline at end of file +144425 \ No newline at end of file diff --git a/.forge-snapshots/addLiquidity CA fee.snap b/.forge-snapshots/addLiquidity CA fee.snap index d4dff6e54..d6d5405e1 100644 --- a/.forge-snapshots/addLiquidity CA fee.snap +++ b/.forge-snapshots/addLiquidity CA fee.snap @@ -1 +1 @@ -170959 \ No newline at end of file +170721 \ 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 9d9c26d43..cce113cd6 100644 --- a/.forge-snapshots/addLiquidity with empty hook.snap +++ b/.forge-snapshots/addLiquidity with empty hook.snap @@ -1 +1 @@ -274264 \ No newline at end of file +274026 \ 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 a7684fdf5..7ce5c036b 100644 --- a/.forge-snapshots/addLiquidity with native token.snap +++ b/.forge-snapshots/addLiquidity with native token.snap @@ -1 +1 @@ -135141 \ No newline at end of file +135022 \ 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 3c4d3e51e..9f41b5653 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 @@ -292855 \ No newline at end of file +292617 \ 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 cb54169dc..1957407f7 100644 --- a/.forge-snapshots/donate gas with 1 token.snap +++ b/.forge-snapshots/donate gas with 1 token.snap @@ -1 +1 @@ -106345 \ No newline at end of file +106226 \ 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 0f05365bd..4f56f3bf1 100644 --- a/.forge-snapshots/donate gas with 2 tokens.snap +++ b/.forge-snapshots/donate gas with 2 tokens.snap @@ -1 +1 @@ -145766 \ No newline at end of file +145528 \ 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 7606bacbf..fdc5dcc0f 100644 --- a/.forge-snapshots/erc20 collect protocol fees.snap +++ b/.forge-snapshots/erc20 collect protocol fees.snap @@ -1 +1 @@ -57454 \ No newline at end of file +57338 \ 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 1c6c78447..1f5b9a9fd 100644 --- a/.forge-snapshots/native collect protocol fees.snap +++ b/.forge-snapshots/native collect protocol fees.snap @@ -1 +1 @@ -59726 \ No newline at end of file +59610 \ No newline at end of file diff --git a/.forge-snapshots/poolManager bytecode size.snap b/.forge-snapshots/poolManager bytecode size.snap index 37be6af7a..53b94643d 100644 --- a/.forge-snapshots/poolManager bytecode size.snap +++ b/.forge-snapshots/poolManager bytecode size.snap @@ -1 +1 @@ -23621 \ No newline at end of file +23504 \ 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 85250c467..3788a673e 100644 --- a/.forge-snapshots/simple addLiquidity second addition same range.snap +++ b/.forge-snapshots/simple addLiquidity second addition same range.snap @@ -1 +1 @@ -98862 \ No newline at end of file +98743 \ No newline at end of file diff --git a/.forge-snapshots/simple addLiquidity.snap b/.forge-snapshots/simple addLiquidity.snap index 16a8472c7..adaea8624 100644 --- a/.forge-snapshots/simple addLiquidity.snap +++ b/.forge-snapshots/simple addLiquidity.snap @@ -1 +1 @@ -161407 \ No newline at end of file +161288 \ No newline at end of file diff --git a/.forge-snapshots/simple swap.snap b/.forge-snapshots/simple swap.snap index 141489c72..2da45ab6c 100644 --- a/.forge-snapshots/simple swap.snap +++ b/.forge-snapshots/simple swap.snap @@ -1 +1 @@ -123347 \ No newline at end of file +123228 \ 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 8ad9f5434..d55922597 100644 --- a/.forge-snapshots/swap CA custom curve + swap noop.snap +++ b/.forge-snapshots/swap CA custom curve + swap noop.snap @@ -1 +1 @@ -124653 \ No newline at end of file +124415 \ 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 6360928ab..9a4dee558 100644 --- a/.forge-snapshots/swap CA fee on unspecified.snap +++ b/.forge-snapshots/swap CA fee on unspecified.snap @@ -1 +1 @@ -154773 \ No newline at end of file +154654 \ No newline at end of file diff --git a/.forge-snapshots/swap against liquidity.snap b/.forge-snapshots/swap against liquidity.snap index 0452eb72f..8b00aa52e 100644 --- a/.forge-snapshots/swap against liquidity.snap +++ b/.forge-snapshots/swap against liquidity.snap @@ -1 +1 @@ -116717 \ No newline at end of file +116598 \ 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 63a0a75cf..276cb3353 100644 --- a/.forge-snapshots/swap mint native output as 6909.snap +++ b/.forge-snapshots/swap mint native output as 6909.snap @@ -1 +1 @@ -139747 \ No newline at end of file +139628 \ 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 72228b87c..11cee36c8 100644 --- a/.forge-snapshots/swap mint output as 6909.snap +++ b/.forge-snapshots/swap mint output as 6909.snap @@ -1 +1 @@ -155188 \ No newline at end of file +155069 \ 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 f1e126934..93dbce2bc 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 @@ -206403 \ No newline at end of file +206165 \ 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 feaacc0ab..cd57b2884 100644 --- a/.forge-snapshots/swap with dynamic fee.snap +++ b/.forge-snapshots/swap with dynamic fee.snap @@ -1 +1 @@ -139368 \ No newline at end of file +139249 \ No newline at end of file diff --git a/.forge-snapshots/swap with hooks.snap b/.forge-snapshots/swap with hooks.snap index f36933737..552bf8fb9 100644 --- a/.forge-snapshots/swap with hooks.snap +++ b/.forge-snapshots/swap with hooks.snap @@ -1 +1 @@ -132345 \ No newline at end of file +132226 \ 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 8c298d1fe..320e4e915 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 @@ -169593 \ No newline at end of file +169474 \ 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 bcbae20f7..84f5b56a2 100644 --- a/.forge-snapshots/swap with return dynamic fee.snap +++ b/.forge-snapshots/swap with return dynamic fee.snap @@ -1 +1 @@ -145661 \ No newline at end of file +145542 \ 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 8a6f38517..793c4532a 100644 --- a/.forge-snapshots/update dynamic fee in before swap.snap +++ b/.forge-snapshots/update dynamic fee in before swap.snap @@ -1 +1 @@ -147956 \ No newline at end of file +147837 \ No newline at end of file diff --git a/src/PoolManager.sol b/src/PoolManager.sol index 92b8148ad..6b3a83b13 100644 --- a/src/PoolManager.sol +++ b/src/PoolManager.sol @@ -272,7 +272,7 @@ contract PoolManager is IPoolManager, ProtocolFees, NoDelegateCall, ERC6909Claim } /// @inheritdoc IPoolManager - function sync(Currency currency) external onlyWhenUnlocked { + function sync(Currency currency) external { // address(0) is used for the native currency if (currency.isAddressZero()) { // The reserves balance is not used for native settling, so we only need to reset the currency. diff --git a/src/ProtocolFees.sol b/src/ProtocolFees.sol index ecea47484..6f00d5621 100644 --- a/src/ProtocolFees.sol +++ b/src/ProtocolFees.sol @@ -46,7 +46,6 @@ abstract contract ProtocolFees is IProtocolFees, Owned { returns (uint256 amountCollected) { if (msg.sender != address(protocolFeeController)) InvalidCaller.selector.revertWith(); - if (_isUnlocked()) ContractUnlocked.selector.revertWith(); amountCollected = (amount == 0) ? protocolFeesAccrued[currency] : amount; protocolFeesAccrued[currency] -= amountCollected; diff --git a/src/interfaces/IProtocolFees.sol b/src/interfaces/IProtocolFees.sol index 0717bfc88..4789266f7 100644 --- a/src/interfaces/IProtocolFees.sol +++ b/src/interfaces/IProtocolFees.sol @@ -11,9 +11,6 @@ interface IProtocolFees { /// @notice Thrown when protocol fee is set too high error ProtocolFeeTooLarge(uint24 fee); - /// @notice Thrown when the contract is unlocked - error ContractUnlocked(); - /// @notice Thrown when collectProtocolFees or setProtocolFee is not called by the controller. error InvalidCaller(); diff --git a/test/ProtocolFeesImplementation.t.sol b/test/ProtocolFeesImplementation.t.sol index f5f7007ea..f9692a133 100644 --- a/test/ProtocolFeesImplementation.t.sol +++ b/test/ProtocolFeesImplementation.t.sol @@ -104,16 +104,6 @@ contract ProtocolFeesTest is Test, GasSnapshot, Deployers { protocolFees.collectProtocolFees(address(1), currency0, 0); } - function test_collectProtocolFees_revertsWithContractUnlocked() public { - protocolFees.setIsUnlocked(true); - - protocolFees.setProtocolFeeController(feeController); - vm.prank(address(feeController)); - - vm.expectRevert(IProtocolFees.ContractUnlocked.selector); - protocolFees.collectProtocolFees(address(1), currency0, 0); - } - function test_collectProtocolFees_succeeds() public { // set a balance of protocol fees that can be collected protocolFees.updateProtocolFees(currency0, 100); diff --git a/test/Sync.t.sol b/test/Sync.t.sol index 74bf8e800..86250567c 100644 --- a/test/Sync.t.sol +++ b/test/Sync.t.sol @@ -33,8 +33,7 @@ contract SyncTest is Test, Deployers, GasSnapshot { currency2 = deployMintAndApproveCurrency(); } - function test_settle_failsIfLocked() public { - vm.expectRevert(IPoolManager.ManagerLocked.selector); + function test_settle_worksInIsolation() public { manager.sync(currency0); }