Eggstravaganza

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

Since the randomness is only pseudo-random, it is not secure and can be exploited through front-running

Description: In the EggHuntGame::searchForEgg() function, a pseudo-random number is generated using block.timestamp, block.prevrandao, msg.sender, and eggCounter. However, validators can access all of these values when they create a block. This means a validator can predict the outcome before the transaction is finalized. As a result, a validator could call searchForEgg() only when they know it will mint a new NFT.

Impact: A large number of NFTs will be minted, exceeding the original 20% allocation. This will reduce the overall value of the NFTs.

Recommended Mitigation: Consider generating random numbers off-chain, either using services like Chainlink VRF or using your own internal server.

Updates

Lead Judging Commences

m3dython Lead Judge 3 months ago
Submission Judgement Published
Validated
Assigned finding tags:

Insecure Randomness

Insecure methods to generate pseudo-random numbers

Support

FAQs

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