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.
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
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
Manual code review
Implement a cleanup function to remove old game data after completion
Consider adding an auto-pruning mechanism for games older than a certain timeframe
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.