After matches are over and results are set players can withdraw their winnings based on the correctness of their prediction. It is intended to withdraw all winning at once.
It is possible to withdraw winnings multiple times thus taking more than the user should receive and in the same time other users wont be able to take out their winnings.
Withdrawal of winnings depends on scoreBoard.isEligibleForReward()
function which checks if the result for the last match is set and if the player has more than one predictions. Predictions count is set to 0 in order to stop users to make multiple withdrawals, but this check can be passed by calling the setPrediction()
function in ScoreBoard.sol
.
This can lead to a malicious player draining the funds of the contract and making other players unable to withdraw anything.
Manual review
Consider refactoring the whole function to:
revert if predictions are closed
update the predictions count only if there is a new prediction
for already predicted matches leave the count untouched
`ThePredicter.withdraw` combined with `ScoreBoard.setPrediction` allows a player to withdraw rewards multiple times leading to a drain of funds in the contract.
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.