The _battle
function in the RapBattle
contract emits Battle
event with incorrect data. In situation when random
== defenderRapperSkill
the winner
parameter is emitted incorrectly, resulting in inaccurate event logs.
In case when random
== defenderRapperSkill
the RapBattle._battle
function incorrectly emits msg.sender
as winner, whereas the actual winner is _defender
.
The incorrect event data poses a challenge for developers and external systems relying on event logs, as the information provided wrong winner. This discrepancy may result in confusion and hinder proper tracking of Battle events.
Manual review.
Make the following changes in RapBattle._battle()
:
https://github.com/Cyfrin/2024-02-one-shot/blob/47f820dfe0ffde32f5c713bbe112ab6566435bf7/src/RapBattle.sol#L67
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.