RapBattle::goOnStageOrBattle
allows one rapper to be stored in the contract waiting for a battle. The second user calling this function will fight against the rapper on stage. However, nothing prevents defenders from being the second caller of this function and "fight against themselves". In that case, the defender can only win. With this bug, any defender can front-run a challenger who will win to prevent a defeat.
Likelyhood: High
Every time a defender calls the function twice before a different rapper calls it.
Impact: High
Defenders always win, which can be used to front-run a defeat in the mempool.
Add this require at the top of the else
condition:
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.