Eggstravaganza

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

Eggs found counter is not reset between games

Summary

The number of eggs found by a user is the sum of eggs found in all games.

Vulnerability Details

When a game is stopped and restarted by the admin, the eggsFound mapping stays the same. Therfore, if a user has found eggs in previous games, he/she will have an advantage in following games.

Impact

What is defined as "game" is not really a game. It defeats the whole purpose of the time boxed "games".

Tools Used

Manual review.

Recommendations

The counter of eggs found by users should be done by game. Another option would be to keep track of the current winner for each round. Whenever a user finds an egg, if it makes this user the winner (max amount of eggs found), the winner variable is set to his/her address. When a game is reset, the variables to keep track of the winner is also reset.

Updates

Lead Judging Commences

m3dython Lead Judge 3 months ago
Submission Judgement Published
Invalidated
Reason: Design choice

Support

FAQs

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