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

Summary

Weak PRNG due to block.timestamp.

Vulnerability Details

'''solidity
@>uint256 winnerIndex =
uint256(keccak256(abi.encodePacked(msg.sender, block.timestamp, block.difficulty))) % players.length;
'''

Impact

Some function calls guessing and re-orders the block containing the transaction.

Tools Used

-slither

  • foundry

Recommendations

Do not use block.timestamp, now or blockhash as a source of randomness.

Updates

Lead Judging Commences

Hamiltonite Lead Judge over 1 year 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.