There was a small discrepancy between the definition of "depletion timestamp" and its implementation.
Depletion time is defined as the UNIX timestamp at which the total debt exceeds stream balance by 1 wei. That is, at depletion time, $\text{total debt} = \text{stream balance} + 1$. This also means that at depletion time, $\text{uncovered debt} = 1$. At depletion time, the streamed accrues 1 wei of uncovered debt. Therefore, this PR closes the gap between the definition and the implementation.
Therefore, consider the following cases and the expected results:
Changelog
Adds clarity to the definition of depletionTimeOf function
Adds + 1 to the returned value of depletionTimeOf if division is not exact
Compare values 1 second before, at, and 1 second after depletion timestamp in fuzz tests
There was a small discrepancy between the definition of "depletion timestamp" and its implementation.
Depletion time is defined as the UNIX timestamp at which the total debt exceeds stream balance by 1 wei. That is, at depletion time, $\text{total debt} = \text{stream balance} + 1$. This also means that at depletion time, $\text{uncovered debt} = 1$. At depletion time, the streamed accrues 1 wei of uncovered debt. Therefore, this PR closes the gap between the definition and the implementation.
Therefore, consider the following cases and the expected results:
Changelog
depletionTimeOf
function+ 1
to the returned value ofdepletionTimeOf
if division is not exact