mirror of https://github.com/crytic/slither
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
501 B
28 lines
501 B
contract BadPRNG{
|
|
event Time(uint);
|
|
|
|
function bad0() external{
|
|
uint i = block.timestamp % 10;
|
|
}
|
|
|
|
function bad1() external{
|
|
uint i = now % 10;
|
|
}
|
|
|
|
function bad2() external{
|
|
uint i = uint256(blockhash(10000)) % 10;
|
|
}
|
|
|
|
function foo() public returns (uint) {
|
|
return(uint256(blockhash(10000)));
|
|
}
|
|
|
|
function bad3() external{
|
|
uint i = foo() % 10;
|
|
}
|
|
|
|
function good() external{
|
|
emit Time(block.timestamp);
|
|
}
|
|
}
|
|
|
|
|