diff --git a/src/PoolManager.sol b/src/PoolManager.sol index 4b0c705eb..ff2e4e4af 100644 --- a/src/PoolManager.sol +++ b/src/PoolManager.sol @@ -259,7 +259,7 @@ contract PoolManager is IPoolManager, Fees, NoDelegateCall, ERC6909Claims { /// @inheritdoc IPoolManager function take(Currency currency, address to, uint256 amount) external override noDelegateCall isLocked { - // flipping a postive number in an int is always safe + // subtraction must be safe _accountDelta(currency, -(amount.toInt128())); reservesOf[currency] -= amount; currency.transfer(to, amount); @@ -275,7 +275,7 @@ contract PoolManager is IPoolManager, Fees, NoDelegateCall, ERC6909Claims { /// @inheritdoc IPoolManager function mint(address to, uint256 id, uint256 amount) external override noDelegateCall isLocked { - // flipping a postive number in an int is always safe + // subtraction must be safe _accountDelta(CurrencyLibrary.fromId(id), -(amount.toInt128())); _mint(to, id, amount); } diff --git a/src/libraries/Pool.sol b/src/libraries/Pool.sol index 72549922e..5deb01e2b 100644 --- a/src/libraries/Pool.sol +++ b/src/libraries/Pool.sol @@ -441,7 +441,6 @@ library Pool { self.feeGrowthGlobal1X128 = state.feeGrowthGlobalX128; } - // in an unchecked block so sign flipping is not safe without a helper function unchecked { if (params.zeroForOne == exactInput) { result = toBalanceDelta( diff --git a/src/test/PoolSwapTest.sol b/src/test/PoolSwapTest.sol index dde0e3119..757b8379d 100644 --- a/src/test/PoolSwapTest.sol +++ b/src/test/PoolSwapTest.sol @@ -9,7 +9,6 @@ import {IHooks} from "../interfaces/IHooks.sol"; import {Hooks} from "../libraries/Hooks.sol"; import {PoolTestBase} from "./PoolTestBase.sol"; import {Test} from "forge-std/Test.sol"; -import {console2} from "forge-std/console2.sol"; import {Hooks} from "../libraries/Hooks.sol"; import {IHooks} from "../interfaces/IHooks.sol";