Opus finding
FeesManager.collectFees casts int128 amounts to uint128 without sign check; negative deltas would wrap
mediumbugmedium
- src/base/FeesManager.sol:86-94
`BalanceDelta.amount0/1` return int128. The cast `uint128(int128)` reinterprets bits: a negative value (which shouldn't occur for a collect, but could from a buggy or unusual `_collectFees` implementation) would become a huge uint128 and silently inflate `getCumulatedFees`. The override in StreamableFeesLockerV2 calls `_collect` which performs `poolManager.modifyLiquidity(..., liquidityDelta=0)` — feesAccrued from this is always non-negative for non-malicious pools. But a hostile/buggy hook could return negative. Adding a SafeCast.toUint128 guard would be safer.
Recommendation
Use `SafeCast.toUint128(int128)` or `require(fees.amount0() >= 0)` before casting.