Player can register twice and mess up rewards
ThePredicter::register reverts only if playerStatus is Pending but when player is already Approved he can register again. Futhermore he can call cancelRegistration then as his status changed to Pending in second registration. He will still be in players[] array so it will mess up rewards calculation as we multiply there by players.length
Add this to ThePredicter.sol
and this test to ThePredicter.test.sol
run command forge test --mt test_canRegisterTwice -vvv
Test will pass. User is unregistered but players array length return 1 as he is still registered in this array.
Medium, malicious user can mess up rewards distribution
Manual review
Don't allow Approved users to register
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.