Error in the calculation of available streams for withdrawal.
Whenever a recipient calls withdrawal, their withdrawable amount for their accumulated stream is checked and the value is what they will be able to withdraw
This _withdrawableAmountOf(streamId);
calls other internal functions that ultimately calls the _calculateStreamedAmount()
and this is where the issue lies.
Taking a look at the _calculateStreamedAmount()
in the Lockuplinear.sol contract.sol
In a given scenario where the
start time is (May 12) given as 1683991800
endtime = (May 30) 1717121400
Current timestamp = (May 23) 1716516600
A user intends on withdrawing his streamed amount on the 23rd of May after the stream started on the 12th of May.
The elapsed time will be computed as current timestamp - start time
elapsed time = 1716516600 - 1683991800 = 32524800
while total duration will be computed as endTime - startTime
totalduration = 1717121400 - 1683991800 = 33129600
Elapsed percentage will then be computed as elapsedtime/ totalduration
32524800/ 33129600 = 0.981744422
As can be seen above, elapsed time will always be a zero amount and it is used to multiply the deposited amount of the stream as seen in the code below:
Users won't be able to place withdrawals due to a zero amount that will be computed for them as their withdrawable amount despite their accumulated streams.
Manual review
Perform the calculations properly in a manner it won't round down to a zero amount.
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.