The endGame function in the EggHuntGame contract fails to properly reset game state, potentially leading to state confusion between game cycles and possible game mechanic exploits.
The current endGame function only updates the gameActive flag without resetting other game state variables:
This means that key game states like eggCounter, startTime, and endTime remain unchanged after a game ends. If the game is restarted, these persistent states could lead to inconsistencies or unexpected behavior.
State confusion between game cycles
Potential inconsistencies in NFT ID sequencing
Game logic errors and unpredictable behavior
Possible game mechanic exploits
Manual code review
State management analysis
Implement a comprehensive state reset mechanism to ensure clear separation between game cycles:
Incorrect values reported when a game is ended early
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.