Rock Paper Scissors

First Flight #38
Beginner FriendlySolidity
100 EXP
View results
Submission Details
Severity: medium
Invalid

Unbounded Storage Growth in games Mapping

Unbounded Storage Growth in games Mapping

Summary

The contract permanently stores all game data in the games mapping with no cleanup mechanism, leading to unbounded storage growth and potential long-term performance degradation.

Vulnerability Details

Location:

mapping(uint256 => Game) public games

uint256 public gameCounter

Issue:

Every created game (via createGameWithEth/createGameWithToken) increments gameCounter and stores data permanently

Completed games (Finished/Cancelled state) remain in storage indefinitely

No mechanism to delete old game data

Impact

  • Continuously increases blockchain storage requirements

  • May lead to higher gas costs for contract interactions over time

  • Could eventually make the contract prohibitively expensive to use

Tools Used

Manual code review

Recommendations

  • Implement a cleanup function to remove old game data after completion

  • Consider adding an auto-pruning mechanism for games older than a certain timeframe

Updates

Appeal created

m3dython Lead Judge 2 months ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity
Assigned finding tags:

Gas Optimization

m3dython Lead Judge 2 months ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity
Assigned finding tags:

Gas Optimization

Support

FAQs

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