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