Description: The contract's constructor doesn't validate that the vesting end time is greater than the vesting start time. This could lead to a permanently broken vesting schedule if incorrect parameters are provided during deployment.
Lines 42-55 in the init function:
Impact: If vesting_end_time ≤ vesting_start_time
, the vesting calculation will break, potentially causing:
Division by zero if the times are equal (in the _calculate_vested_amount
function)
Negative elapsed time calculations if end time is before start time
Users unable to claim their rightful tokens due to broken vesting mechanics
Proof of Concept: If the contract is deployed with vesting_start_time = 1000
and vesting_end_time = 1000
, then:
vesting_duration = end_time - start_time = 0
In _calculate_vested_amount
, the calculation (linear_vesting * elapsed) // vesting_duration
would attempt to divide by zero, causing the transaction to revert
Recommended Mitigation: Add validation in the constructor to ensure the vesting timeframe is valid:
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.