Eggstravaganza

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

Missing check for maximum eggs found allows unlimited minting per player

Vulnerability Details

The searchForEgg function lacks a mechanism to limit the number of eggs a single player can find. When the condition random < eggFindThreshold is met, an egg is minted and the player's count is incremented without any upper bound check.

if (random < eggFindThreshold) {
eggCounter++;
//@audit-issue no check for max eggs found, user can call this function as much as they want when random is below threshold (due to no randomness issue)
eggsFound[msg.sender] += 1;
eggNFT.mintEgg(msg.sender, eggCounter);
emit EggFound(msg.sender, eggCounter, eggsFound[msg.sender]);
}

Impact

A single player can mint an unlimited number of egg NFTs, especially if combined with the predictability of the pseudo-random number generation.

Recommendation

Implement a maximum limit on the number of eggs each user is allowed to find and mint.

Updates

Lead Judging Commences

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

Support

FAQs

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