The function createVestingSchedule
lacks validation for the startTime
parameter, allowing schedules to be created with a start time in the past. This could lead to unexpected vesting behavior, potential unfair advantage, or incorrect accounting of vested tokens.
Start Time Can Be Set in the Past
The function does not check if startTime
is less than the current block timestamp (block.timestamp
).
A malicious or careless caller could set a vesting schedule as if it had started in the past, potentially allowing instant or accelerated vesting.
Potential Exploits
Early Claiming of Tokens: If vesting is based on time calculations, setting a past startTime
could immediately unlock tokens instead of following the intended vesting schedule.
Unnecessary creating vesting schedules that don't make sense expoliting gas and storage.
Tokens may vest earlier than expected, breaking the intended lockup period.
Users may gain an unfair advantage by setting a startTime
in the past and claiming tokens immediately.
Accounting and vesting calculations may be inaccurate, affecting treasury management.
Manual Review
Validate startTime
to Ensure It’s Not in the Past, Add the below line to the start of the function.
if (startTime < block.timestamp) { revert InvalidStartTime(); }
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.