The function _calculateStreamedAmountForMultipleSegments
is not checking whether the first segment time is fully passed or not.
This lead to case where, even if the first tranche is not fully passed, the function return full amount of that tranche.
_calculateStreamedAmountForMultipleSegments
function is called inside the _calculateStreamedAmount
if the number of segements are more than 1.
SablierV2LockupDynamic.sol#L204-L207
Inside the _calculateStreamedAmountForMultipleSegments
each segment is passed on and the corresponding amount vested is computed using the exponent factor.
SablierV2LockupDynamic.sol#L228-L263
For first segment, the index is zero.
For the first segment, thought the time for that segment is not fully passed, the function use the full time to calculate the transche amount.
Even if the full time is passed for the first tranche, the _calculateStreamedAmountForOneSegment
returns the full amount for that particular tranche.
It would be something, like, an employee earn their first month salary at the first day itself.
Manual review
This one need some code changes, we would suggest to update the code to handle the total time elapsed exactly.
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.