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

Flaky randomness in selectWinner()

Summary

Randomness is calculated using on-chain information in selectWinner()

Vulnerability Details

Anyone can call the selectWinner() function and because the winner is selected by using on-chain information the "random" index of the winner could be predicted. Additionally in PoS the block.difficulty==0 always additionally making the randomness wicker.

Impact

Winner's index could be engineered.

Tools Used

Manual review

Recommendations

Use Chainlink VRF for randomness

Updates

Lead Judging Commences

Hamiltonite Lead Judge almost 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.