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

PuppyRaffle::selectWinner the RNG is deterministic

Summary

The RNG at PuppyRaffle.selectWinner()
uint256 winnerIndex = uint256(keccak256(abi.encodePacked(msg.sender, block.timestamp, block.difficulty))) % players.length; is deterministic because the hash can be predetermined, so the winnerIndex is also deterministic.

Vulnerability Details

Impact

  • severity : high

  • likelihood : high

Tools Used

  • manual review

Recommendations

  • Implement Chainlink's VRFv2 to implement randomness / determining the winnerIndex.

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.