Imagine a scenario where a player has made only one prediction, and that prediction turns out to be correct. In that case, the user would be able to withdraw the reward for the correct prediction. But it's not all that simple. In the function ThePredicter::withdraw
, which is used for withdrawing funds, there is a call to the function isEligibleForReward
, which is defined as follows in ScoreBoard
:
As we can see in the highlighted line, this function will return TRUE
if the match is not pending and if predictionsCount
(which represents the count of predictions made by the player) is met. Otherwise, if any condition is not satisfied, it will return FALSE
.
In the ThePredicter::withdraw
function, there is a check that will cause a revert if ScoreBoard::isEligibleForReward
returns FALSE
.
So, in a scenario where the user has made only one prediction and it turns out to be correct, the function ThePredicter::withdraw
will always revert.
As a result of this bug, a user who has made only one prediction and it turns out to be correct will never be able to withdraw their reward!
One possible solution to the given problem is to modify the ScoreBoard::isEligibleForReward
function as follows:
Players with only one prediction cannot withdraw.
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.