Wrong time calculation closes predictions too early
ThePredicter::makePredicter uses wrong formula for calculating when to close predictions.
68400 seconds is 19 hours so predictions will close too early. Substracting this value in second part of formula is also wrong. According to this - predictions for first match will end "Thu Aug 15 2024 1:00:00 GMT+0000" it is 19 hours before start of the tournament.
Same wrong calculations also occurs in ScoreBoard::setPrediction.
Documentation is not clear whether first match starts the same day as tournament or the day after. I assumed that it's the first option
Copy this test to ThePredicter.test.sol
Run command forge test --mt test_timeCalculation -vvv
We should be able to make prediction but this test will fail and revert with ThePredicter__PredictionsAreClosed() error
High, predictions are closed too early
Manual review
If first match starts the same day as tournament the proper formula will be
So change this in both functions
ThePredictor.sol
ScoreBoard.sol
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.