Beginner FriendlyFoundryNFT
100 EXP
View results
Submission Details
Severity: high
Valid

Using deterministic data like block.timestamp/difficulty for randomness, randomness can be predictable

Summary

PuppyRaffle::selectWinner function is using deterministic data for generating random number and rarity of NFT, winner can be predictable.

Vulnerability Details

Protocol is using block.timestamp, block.difficulty, msg.sender for generating random number but these can be manipulated by miners, and if that happens winner can be changed according to them also rarity of nft will be predictable.

Impact

Potential winner can be looser and vice-versa. Malicious actor can also make favourable for him to mint the rarest nft.

Tools Used

Manual Review

Recommendations

Use a decentralised oracle service like chainlink VRF.
Docs: https://docs.chain.link/vrf

Updates

Lead Judging Commences

Hamiltonite Lead Judge about 2 years ago
Submission Judgement Published
Validated
Assigned finding tags:

weak-randomness

Root cause: bad RNG Impact: manipulate winner

Support

FAQs

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

Give us feedback!