The time calculations in ThePredicter.sol::makePrediction and ScoreBoard.sol::setPrediction for making a prediction are incorrect. As per the documentation, matches occur each day at 20:00:00 UTC, and predictions can be placed until 19:00:00 UTC of that day.
The start time for to protocol is 1723752000 or Thu Aug 15 2024 20:00:00 GMT+0000
Below is the calculations used to see if a prediction can be placed
If it is
matchNumber1, then this would be the equation:START_TIME + matchNumber * 68400 - 68400
1723752000 + (1 * 68400) - 68400 =
1723752000This is correct for the first match. However, the true "first" match should be match 0, otherwise the protocol will only have 8 matches.
This is the equation if
matchNumberis zero1723752000 + (0 * 68400) - 68400 =
1723683600orThursday, August 15, 2024 1:00:00 AMThis is an incorrect time because predictions should be able to be placed until 19:00:00 UTC
This is the equation if
matchNumberis two1723752000 + (2 * 68400) - 68400 =
1723810400orFriday, August 16, 2024 12:13:20 PMAgain this is an incorrect time.
68400 is equal to 19 hours, this is why these time calculations are incorrect, it is allowing predictions for each match in increments of 19 hours after the start time.
This test fails showing that you cannot make a bet at 18:59:59 UTC August 17, 2024 6:59:59 PM before the second match (matchNumber is two).
--Foundry
It is recommended to change the time calculations to ensure that predictions can be placed up to 19:00:00 UTC of the day of the match.
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.