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.
26 lines
586 B
26 lines
586 B
6 years ago
|
contract C{
|
||
|
|
||
6 years ago
|
address addr_good = address(0x41);
|
||
6 years ago
|
address addr_bad ;
|
||
6 years ago
|
|
||
|
bytes4 func_id;
|
||
|
|
||
6 years ago
|
function bad_delegate_call(bytes memory data) public{
|
||
6 years ago
|
addr_good.delegatecall(data);
|
||
|
addr_bad.delegatecall(data);
|
||
6 years ago
|
}
|
||
|
|
||
6 years ago
|
function set(bytes4 id) public{
|
||
6 years ago
|
func_id = id;
|
||
6 years ago
|
addr_bad = msg.sender;
|
||
6 years ago
|
}
|
||
|
|
||
6 years ago
|
function bad_delegate_call2(bytes memory data) public{
|
||
|
addr_bad.delegatecall(abi.encode(func_id, data));
|
||
6 years ago
|
}
|
||
|
|
||
6 years ago
|
function good_delegate_call(bytes memory data) public{
|
||
|
addr_good.delegatecall(abi.encode(bytes4(""), data));
|
||
6 years ago
|
}
|
||
|
}
|