The checkCreateLockupDynamic function is designed to validate the creation of dynamic lockups with multiple segments. Each segment has an amount, exponent, and duration that define the release schedule of locked funds.
The checkCreateLockupDynamic function is expected to enforce that the lockup schedule starts at a valid time and that the segments are released in the future. However, if the startTime is not validated against the current block timestamp or if users can set the startTime themselves without proper checks, they could manipulate the start of the lockup period to a past time. This would effectively shorten the lockup duration and grant premature access to the funds.
The function assumes that the startTime provided is either the current time or a future time. If the startTime can be manipulated to a past timestamp, it could potentially allow a user to access the locked funds earlier than intended. This could undermine the purpose of the lockup, which is to restrict access to funds until certain conditions are met over time.
Manual review
To mitigate the issue of allowing startTime to be set in the past in the checkCreateLockupDynamic function, you should add an explicit check to ensure that startTime is in the future relative to the current block timestamp.
Here’s an enhanced version of the checkCreateLockupDynamic function with the added validation:
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.