Skip to content

Latest commit

 

History

History
11 lines (7 loc) · 629 Bytes

File metadata and controls

11 lines (7 loc) · 629 Bytes

Bad Source of Randomness

Description:

Randomness is hard to get right in Ethereum. While Solidity offers functions and variables that can access apparently hard-to-predict values, they are generally either more public than they seem or subject to miners' influence. Because these sources of randomness are to an extent predictable, malicious users can generally replicate it and attack the function relying on its unpredictablility.

Remediation:

Don't use blockhash and block.timestamp as source of randomness. Use services like Chainlink VRF to generate Random Numbers.

References:

https://www.dasp.co/#item-6