Eggstravaganza

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

User not being able to mint NFT, even when he meets the threshold

Vulnerability Details

  • Due to this less than check, even when random number is equal to eggFindThreshold, NFT will not be minted.

  • Take a look at this comment, which says Default is a 20% chance , meaning there is a chance of upto 20% and not less than 20%.

Impact

  • User not being able to mint NFT, even when he meets the threshold.

Recommendations

  • Make the following change in this line

--- if (random < eggFindThreshold) {
+++ if (random <= eggFindThreshold) {

POC

  1. Alice calls EggHuntGame::searchForEgg.

  2. random comes to 20.

  3. NFT will not be minted because random is not less than eggFindThreshold(which is 20 by default)

Updates

Lead Judging Commences

m3dython Lead Judge 4 months ago
Submission Judgement Published
Invalidated
Reason: Lack of quality

Appeal created

boi Submitter
4 months ago
m3dython Lead Judge
4 months ago
m3dython Lead Judge 4 months ago
Submission Judgement Published
Invalidated
Reason: Incorrect statement

Support

FAQs

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