Beginner FriendlyFoundryNFT
100 EXP
View results
Submission Details
Severity: low
Valid

event is emiting a losser as a winner when `random == defenderRapperSkill`

Summary

  • when random == defenderRapperSkill the event is emiting a losser as a winner which can create conficts

Vulnerability Details

  • In RapBattle.sol the battle function is emitting a Battle event with winner. but, when random == defenderRapperSkill the event is emiting a losser as a winner which can create conficts

@> emit Battle(msg.sender, _tokenId, random < defenderRapperSkill ? _defender : msg.sender);

Impact

  • this can create conficts in the battle result

  • Off-chain systems that rely on the event logs to determine the outcome of the battle may be affected

Tools Used

  • manual review

Recommendations

  • Create this change to emit the correct winner

- emit Battle(msg.sender, _tokenId, random < defenderRapperSkill ? _defender : msg.sender);
+ emit Battle(msg.sender, _tokenId, random <= defenderRapperSkill ? _defender : msg.sender);
Updates

Lead Judging Commences

inallhonesty Lead Judge over 1 year ago
Submission Judgement Published
Validated
Assigned finding tags:

Contradictory battle result event

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.