Static Analyzer for Solidity
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.
slither/tests/e2e/detectors/test_data/write-after-write/0.8.0/write-after-write.sol

60 lines
994 B

contract Test{
uint state;
function read_state() internal returns(uint){
return state;
}
function buggy_state() internal{
state = 10;
state = 20;
}
function not_buggy_state() internal{
state = 10;
read_state();
state = 20;
}
function buggy_local() internal{
uint a;
a = 10;
a = 20;
}
function not_buggy_if() internal{
uint a = 0;
if(true){
a = 10;
}
}
function not_buggy_loop() internal{
for(uint i; i< 10; i++){
uint a = 10;
}
}
function not_bugy_ternary() internal{
uint a = true? 1 : 0;
}
function not_bugy_external_state() internal{
state = 10;
address a;
a.call("");
state = 11;
}
function bugy_external_local() internal{
uint local;
local = 10;
address a;
a.call("");
local = 11;
}
}