The VestedAirdrop contract lacks validation to ensure that vesting_start_time
is less than vesting_end_time
during contract deployment, which could lead to a permanently broken vesting schedule.
In the contract's constructor, the vesting start and end times are set without any validation:
If vesting_start_time >= vesting_end_time
, the vesting calculation in _calculate_vested_amount()
will be broken due to division by zero or incorrect vesting duration calculations:
If deployed with vesting_start_time >= vesting_end_time
:
Division by zero errors would occur in the vesting calculations
Users would be unable to claim their tokens
The entire contract would be permanently broken
A new contract deployment would be required, causing confusion and potential loss of trust
This is a medium severity issue as it doesn't directly lead to fund loss but could render the contract unusable.
Manual code review
Add validation in the constructor to ensure that vesting_start_time
is strictly less than vesting_end_time
:
This simple check prevents deployment with invalid vesting parameters, ensuring the contract will function as intended.
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.