_calculateStreamedAmount
is an overridden function that returns the amount already streamed to the recipient. This function includes a safety mechanism to prevent a specific bug where the streamedAmount
could exceed the depositedAmount
, in which case it returns the withdrawn amount. This mechanism allows the sender to cancel the stream and retrieve all the stuck funds if such a bug occurs. However, if the stream is non-cancellable due to any of the following reasons, this mechanism will not function:
isCancellable = false
was set at creation.
The sender
address used the renounce
function.
The sender is not a valid sender (it could be set to anything at the creation if the stream creator does not plan to cancel the stream).
Even though this safety mechanism is not intended to be used, since it exists for a purpose and it fails to fulfill it, I consider this finding to be at least of Low severity.
Likelyhood: Low
The safety mechanism does not work if the stream is non-cancellable.
Impact: High
The safety mechanism will not prevent funds from being stuck in the contract.
Return the deposited amount instead of the withdrawn amount to ensure that the recipient can retrieve the funds under any circumstances. These changes will not break any parent functions that call them.
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.