refund() function is vulnerable to a reentrancy attack.
The function does not follow the pattern "Checks, Effects, Interactions" and that leaves the contract vulnerable to reentrancy attack.
A malicious contract could register its address as a player, after that call the 'refund' function with the index of that address and call the refund function again with the same index in its 'receive' function thus draining the funds of the contract.
Manual review
Follow "Checks, Effects, Interactions" patterns. Even better remove the 'refund' function as it creates further issues as describe in my other finding.
reentrancy in refund() function
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.