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

Incomplete state update in `RapBattle::_battle`

Summary

The RapBattle smart contract fails to update the battlesWon attribute in RapperStats after a battle concludes, missing an opportunity to accurately reflect a rapper's achievements within the game's ecosystem.

Vulnerability Details

This issue arises because the RapBattle.sol does not have direct access to modify the RapperStats which is in OneShot.sol. The stats can only be modified by Streets.sol contract.

Impact

LOW
This does not directly affect the game logic anyhow

Tools Used

Manual review

Recommendations

Establish a Mechanism for Updating RapperStats : Give RapBattle access to RapperStats by adding a function in OneShot.sol to only update battlesWon.

Code in OneShot.sol :

function updateBattlesWon(
uint256 tokenId,
) public onlyRapBattleContract {
RapperStats storage metadata = rapperStats[tokenId];
metadata.battlesWon++;
}
Updates

Lead Judging Commences

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

`battlesWon` is never updated

Support

FAQs

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