The makePrediction
function in the ThePredicter
contract contains a bug in calculating the prediction deadline. The function incorrectly uses 68400
seconds (19 hours) to determine the cutoff time for predictions. This miscalculation results in inaccurate timing for the remaining 8 matches, allowing users to submit predictions after the prediction period has ended and potentially even during the match itself. This undermines the integrity of the prediction system and can lead to unfair advantages and distorted outcomes.
The function uses 68400
seconds to calculate the prediction deadline, which results in incorrect timing. The problem arises because 68400
seconds does not accurately represent the time from one match to the next, nor does it correctly set the prediction deadline to 19:00:00 UTC on match days. This miscalculation means that predictions might be closed at unintended times, causing disruptions in the prediction process.
Below is the test script using Foundry to show that a player can place a prediction after the prediction deadline
Predictions may be closed at unintended times, disrupting the prediction process.
manual review
Foundry
Use 86400
seconds (24 hours) to move the time forward by a day for each match and subtract 3600
seconds (1 hour) to set the deadline to 19:00:00 UTC.
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.