The RapBattle
smart contract contains an inconsistency between the condition used to determine the winner of a battle in the _battle
function and the condition specified in the Battle
event emission.
The RapBattle::_battle
function performs the battle between the rappers tokens and transfer the reward to the winner.
In the comment is written: If random <= defenderRapperSkill -> defenderRapperSkill wins, otherwise they lose
, but in the event Battle
the winner
is defined in another way: random < defenderRapperSkill ? _defender : msg.sender
.
The event Battle
in the RapBattle::_battle
function can emit an incorrect winner. The inconsistency between the winning condition in the if
statement and the Battle
event could confuse off-chain services and users interpreting the battle outcomes.
Manual Review
Change the condition in the Battle
event to be the same as the condition in the if
statement.
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.