3.2 PredictableCompetition
The PredictableCompetition contract builds upon the base Competition contract and allows users to register and create 'bracket predictions.' Participants can acquire points by accurately predicting match outcomes, enhancing user engagement and fostering a competitive environment.
Function 1: createBracketPrediction
This function allows a user to submit their bracket predictions for the competition.
_registrant
address
The address of the user submitting the prediction.
_matchPredictions
uint8[] calldata
An array containing the user's predictions for each match.
Function 2: getUserBracketPrediction
This function retrieves a user's bracket predictions for the competition.
_user
address
The address of the user whose predictions are to be fetched.
Function 3: hasUserRegistered
This function checks whether a user has registered for the competition or not.
_user
address
The address of the user whose registration status is to be checked.
Function 4: getTotalScore
This function calculates and returns the total score of the competition.
Function 5: getUserScorePercent
This function calculates and returns the user's score as a percentage of the total possible score.
_user
address
The address of the user whose score percentage is to be calculated.
Function 6: getUserBracketScore
This function calculates and returns the user's bracket score based on their predictions.
_user
address
The address of the user whose bracket score is to be calculated.
Last updated