Eggstravaganza

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

No maximum eggCounter.

Summary

EggCounter can increase without an upper limit.

Vulnerability Details

There is no maximum number of eggs you can get.

Impact

This can cause the system to overflow and produce errors. Since uint 256 is used

Tools Used

Recommendations

Recommendation to set a maximum egg limit and the ability to change it.

uint256 public maxEggSupply = 10_000;

function setMaxEggSupply(uint256 newMaxSupply) external onlyOwner {

require(newMaxSupply > eggCounter, "New supply must exceed current count");

maxEggSupply = newMaxSupply;

Also with this you can regulate the end of the game, when all the eggs are found and the egg counter is full the game can be over, as further search will give an error. And the egg counter after transferring them to the deposit in the vault will need to be reset.

Updates

Lead Judging Commences

m3dython Lead Judge about 2 months ago
Submission Judgement Published
Invalidated
Reason: Too generic

Appeal created

nikita10012021 Submitter
about 2 months ago
m3dython Lead Judge
about 2 months ago
m3dython Lead Judge about 2 months ago
Submission Judgement Published
Invalidated
Reason: Too generic

Support

FAQs

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