The scoreBoard::setPrediction
function contains a flawed time calculation that always results in zero, potentially allowing predictions to be set at any time, regardless of intended restrictions.
In the setPrediction
function, there's a commented-out calculation:
This calculation simplifies to:
However, the actual implementation results in:
This means the time check is always comparing block.timestamp
to START_TIME
, regardless of the matchNumber
.
The vulnerability allows users to set predictions before the start time so Users cant set prediction.
Manual Code Review
Correct the time calculation to properly account for the matchNumber
:
Consider adding a constant for the time interval (68400 seconds) to improve readability and maintainability:
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.