Skip to content

Commit

Permalink
PR nits
Browse files Browse the repository at this point in the history
  • Loading branch information
hensha256 committed Mar 8, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent 1a76db2 commit 4a1ccfa
Showing 3 changed files with 2 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/PoolManager.sol
Original file line number Diff line number Diff line change
@@ -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);
}
1 change: 0 additions & 1 deletion src/libraries/Pool.sol
Original file line number Diff line number Diff line change
@@ -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(
1 change: 0 additions & 1 deletion src/test/PoolSwapTest.sol
Original file line number Diff line number Diff line change
@@ -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";

0 comments on commit 4a1ccfa

Please sign in to comment.