Closed smol-ninja closed 4 weeks ago
Agree that we should document this as an assumption, but there should be no need for exponents that large.
When you get that to double-digit ranges and above, the streaming function is so slow that it becomes effectively equivalent to a timelock (within that segment).
From the docs:
[!WARNING] Because x is a percentage, the streaming rate is inversely proportional to the exponent. For example, if the exponent is 0.5, the rate is quadratically faster compared to the baseline when the exponent is 1. Conversely, if exponent is 2, the rate is quadratically slower compared to baseline.
A Codehawk auditor asked a really good question about the max value of
UD2x18
.Since its max value is capped by
type(uint64).max
, the exponent cannot represent a value bigger than18.446744073709551615
. Thus, we should add this in the Assumptions section of SECURITY.md:In Lockup dynamic, the fixed-point representation of a segment's
exponent
does not exceed18.446744073709551615
.