The SablierFlow protocol applies protocol fees during withdrawals while managing token streams, with fees configured per token type. The protocol's status system determines stream health through solvency checks, comparing stream balances against accumulated debt. Critical to the system's operation is the relationship between statusOf
, which determines stream state, and the withdrawal mechanism that applies protocol fees. The core issue emerges from the disconnection between these two systems: status calculations work with raw balances and debt, while actual withdrawals incur additional protocol fees, creating a fundamental disparity in solvency assessment versus realized token availability.
The issue centers around how fees are handled in debt and status calculations. Here's the key problem:
https://github.com/Cyfrin/2024-10-sablier/blob/main/src/SablierFlow.sol#L129
This creates a discrepancy: a stream might appear SOLVENT based on raw debt calculations, but becomes effectively INSOLVENT after protocol fees are applied. For example:
Stream balance: 100 tokens
Total debt: 98 tokens
Protocol fee: 3%
Status shows: SOLVENT (98 < 100)
Actual withdrawal: 98 * 0.97 = 95.06 tokens (insufficient to cover debt)
The status calculation needs to account for the maximum potential fee impact on debt coverage. This affects withdrawal calculations, solvency checks, and user fund accessibility.
The misalignment between protocol fee handling and status determination creates a deceptive state representation that undermines the protocol's financial guarantees. When streams report as solvent without accounting for protocol fees, they mask an effective insolvency that only materializes during withdrawal operations. This discrepancy allows streams to operate in an apparently healthy state while being unable to fulfill their intended token flow obligations after fee deduction. The impact ripples through the protocol's accounting system, where streams consistently over-report their effective balance coverage, leading to potential withdrawal failures and compromised stream reliability. This architectural flaw in fee consideration creates a persistent gap between reported and actual stream health, potentially trapping user funds in streams that appear solvent but cannot fulfill their streaming obligations due to unconsidered fee impacts.
This fix ensures status calculations account for maximum potential fee impact, aligning stream state representation with actual token availability during withdrawals.
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.