AntFleet

Disagreement · 1e8fb4a1-anthropic-2

StreamableFeesLocker.distributeFees: last-beneficiary remainder added on top of share creates double-distribution

solo Opus
repo a7cc2ed7·PR #1·reviewed 1 week ago

Opus finding

StreamableFeesLocker.distributeFees: last-beneficiary remainder added on top of share creates double-distribution

highbughigh
  • src/StreamableFeesLocker.sol:189-206
`amount0Distributed` is incremented BEFORE the dust remainder block adds the leftover to `amount0`. Thus after adding `currency0ToDistribute - amount0Distributed` to `amount0`, the last beneficiary's recorded `_distributeFees(amount0)` becomes `share + remainder`, but `amount0Distributed` was already incremented by the original share (not the new `amount0`). This means: total credited to beneficiaries (sum of recorded `_distributeFees`) = sum_of_shares + remainder = currency0ToDistribute. That part is fine because remainder = currency0ToDistribute - sum_of_shares. So total credited matches `currencyBalances` increase. Actually re-reading: amount0Distributed counts only the original `amount0` for the last beneficiary; the remainder is added to amount0 (not to amount0Distributed). Sum credited = sum(shares for i<last) + (lastShare + remainder) = sum(shares) + remainder = currency0ToDistribute (since remainder = currency0ToDistribute - sum(shares)). This balances. So actually NOT a bug. Withdrawing finding.

Recommendation

N/A

Other reviewer

The other reviewer flagged nothing in this file/line range.

Why this didn't post

This finding didn't meet AntFleet's unanimous agreement threshold. Both frontier models review every PR independently; only findings they both flag with the same severity and category are posted to the PR. This one fell through.

read the methodology →