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

Unnecessary memory variable reset in `RapBattle::_battle`

Summary

The RapBattle::_battle function includes an unnecessary reset of the totalPrize memory variable to 0, which does not affect gas usage or functionality, indicating a potential misunderstanding of memory variables' impact.

Vulnerability Details

Within the RapBattle::_battle function, after calculating and distributing prizes based on NFT battle outcomes, the `totalPrize`` memory variable is reset to 0. This operation is redundant because memory variables are temporary and do not influence gas costs or the contract's state post-execution.

Impact

LOW or INFORMATIONAL

Tools Used

Manual review

Recommendations

Remove the line resetting totalPrize to 0 to simplify the code without impacting functionality.

Updates

Lead Judging Commences

inallhonesty Lead Judge over 1 year ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity

Support

FAQs

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