ThePredicter::makePrediction
checks if the predictionFee
is paid and if the match not started but fails to check whether the msg.sender
are approved player or not. The unregistered/unapproved player can even withdraw from the contract after they make prediction and wait until the tournament is over.
makePrediction
are missing critical check where it checks msg.sender
actually approved player or not.
add this code to the ThePredicter.test.sol
then run the following command forge test --mt test_POCUnregisteredPlayerCanPredictAndWithdraw
the result should PASS:
the fee from contract can be taken by unregistered player who does not even pay the entrance fee.
foundry
add checks to the makePrediction
function to check if the msg.sender
are part of the approved player or not:
after that run the command forge test --mt test_POCUnregisteredPlayerCanPredictAndWithdraw
the test result should FAIL
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.