The makePrediction
function in the ThePredicter
contract allows any user to make a prediction, even if they are not approved as a player by the organizer. Additionally, it does not prevent users from setting their prediction to the default Pending
value, which could be problematic.
Unauthorized Prediction Submission: The function does not check if the caller is an approved player. As a result, users who have not been approved by the organizer can make predictions, violating the expected participation criteria.
Invalid Prediction Values: The function does not enforce that the prediction must be different from the default Pending
value. This allows users to submit a prediction with the default value, which should be avoided since predictions should be actively set by players.
ThePredicter.sol
contract
Manual Review
The issues in this function lead to:
Unauthorized Predictions: Non-approved users can submit predictions, which could lead to unfair gameplay and manipulation.
Incorrect Prediction Handling: Users can set their prediction to Pending, which should not be allowed if a prediction is being actively made. This can affect the accuracy of the prediction records and rewards distribution.
Check Player Approval: Ensure that the user making the prediction is an approved player. This check should verify if the user has been approved by the organizer before allowing them to make a prediction. This can be done by using the playersStatus
mapping playersStatus[msg.sender] = Status.Approved
Validate Prediction Values: Prevent users from setting their prediction to the default Pending
value prediction != ScoreBoard.Result.Pending
makePrediction has no access controls and any unapproved user can make predictions causing an incorrect calculation and distribution of rewards.
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.