The _battle function emits an incorrect winner due to a discrepancy in the condition used to determine the winner.
The code specifies that the defender wins if random <= defenderRapperSkill:
However, the Battle event is emitted with the condition random < defenderRapperSkill:
The discrepancy between random <= defenderRapperSkill and random < defenderRapperSkill creates inconsistency in determining the winner. The documentation does not provide clarity on the correct condition, but the code suggests that the winner should be determined when random <= defenderRapperSkill.
This inconsistency affects the accuracy of transaction events, potentially leading to confusion for both users and developers regarding the outcome of battles.
Manual review
To ensure consistency in determining the winner, the following change is recommended:
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.