The SablierV2LockupDynamic::_calculateStreamedAmountForOneSegment
is meant to calculate for 1 segment, but the SablierV2LockupDynamic::_calculateStreamedAmount
passes any segment less than 1 to it, including zero. And the function SablierV2LockupDynamic::_calculateStreamedAmountForOneSegment
is not designed to handle a zero segment which ends up in a panic error.
The issue starts with the SablierV2LockupDynamic::_calculateStreamedAmount
checking for segment.length
in
And not accounting for a zero segment, which is possible to occur before segment[streamId] reaches 1.
It could lead to a panic error when a user try to see their streamed amount when the segment is still at zero. Depending on time before a segment appear, users could keep spamming the function and lead to network congestion
manual review
Add a requirement for segment to be more than 0 in the SablierV2LockupDynamic::_calculateStreamedAmountForOneSegment
function
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.