Eggstravaganza

First Flight #37
Beginner FriendlySolidity
100 EXP
View results
Submission Details
Severity: low
Invalid

`gameActive` should be private/internal instead of public as it can be misleading.

Summary

`gameActive` can be true even though the game is over for a long time. `getGameStatus` already checks if the game is active in the correct manner.

Vulnerability Details

`gameActive` should be private since it can be misleading because the `endTime` variable can be already over and `gameActive` will still be true unless the owner manually deactivates the game.

https://github.com/CodeHawks-Contests/2025-04-eggstravaganza/blob/main/src/EggHuntGame.sol#L14

bool public gameActive;

Impact

gameActive being public can be deceiving as the game might be over already.

Tools Used

manual

Recommendations

set `gameActive` to private since `getGameStatus` already fixes it to check if the game is active in the proper way.

Updates

Lead Judging Commences

m3dython Lead Judge 8 months ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity

Support

FAQs

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

Give us feedback!