The protocol has an invariant that requires token.balanceOf(SablierFlow) >= aggregateBalance[token]
, but lacks explicit validation in the code. While this may work with standard ERC20s, it could break with non-standard tokens.
Please do note that I am aware of the tokens like FoT, and rebase tokens are OOS but the invariant can be breaked if these tokens are used because it is not handled in the code.
The invariant check is missing from withdraw
, deposit
, and `refund`
Consider this real-world analogy:
Current Implementation Problem:
Real World Example:
HIGH - Like a protocol promising more money than it has:
Token balance inconsistencies can occur
Deflationary/fee-on-transfer tokens could break accounting
Protocol could promise more tokens than it has
Multiple streams could become insolvent
Let's do some pseudo code PoC
Add a generic invariant validation function like below and call it in all functions where it is needed e.g in withdraw, refund and deposit.
This ensures:
Actual token balance ≥ tracked balance
Accounting remains correct with non-standard tokens
Early detection of balance inconsistencies
Protocol solvency guarantee
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.