According to the readme, predictions should close one hour before each game starts. The implementation does not match this description. The formula for calculating the closing time is incorrect. Here is the formula block.timestamp > START_TIME + matchNumber * 68400 - 68400
. 68400
is 19 hours instead of the expected 1 hour which results in predictions closing 19 hours before the game starts i.e. at 1:00 AM instead of 7:00 PM. This formula is used in two functions ThePredicter::makePrediction
and ScoreBoard::setPrediction
.
Excerpt from the README.md:
Every day from 20:00:00 UTC one match is played. Until 19:00:00 UTC on the day of the match, predictions can be made by any approved Player. Players pay prediction fee when making their first prediction for each match.
The test should pass because the prediction for the first game is placed exactly 1 hour before the match starts.
Place the following test in the ThePredicter.test.sol
file:
Players placing their bets within 19 hours before the game starts will be unable to make predictions. Player's chances
of winning the tournament will be reduced when they cannot place bets.
Manual review and unit testing.
Remove the magic number a replace them with constants to make the closing time formula more readable.
In both contracts there is a similar error in the computation of the timestamps of the matches.
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.