In some rare cases, wrong winner can be emitted in the RapBattle::Battle
event due to faulty boolean expression used in the ternary operator.
In cases when the random
number is equal to defenderRapperSkill
, the defender should win the battle and their address should be emitted as the last parameter of the RapBattle::Battle
event. But because <
is used in place of <=
in the expression random < defenderRapperSkill
on line 67 of RapBattle
contract, the challenger's address will be emitted instead.
Wrong winner could be emitted that can lead to inconsistencies in the frontend.
Foundry
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.