The function withdraw() is used to withdraw the provided `amount` minus the protocol fee to the provided `to` address. A protocol fee may be charged on the withdrawn amount if protocol fee is enabled for the streaming token.
Now, one of the protocol invariant is that the ∑ stream balances + protocol revenue = aggregate balance
From the implementation of the _withdraw(), we can see that the protocol fee isn't added to the stream balance and updated the aggregated balance which is break the invariant as revenue will increase but it is not reflected in the protocol aggregated balance.
Accounting of agregatedBalance
will be incorrect and one of main invariant of the protocol will be broken.
Manual Review
We recommend adding the protocol revenue to the aggregated amount on caliing _withdraw().
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.