|
|
@ -24,7 +24,7 @@ contract Delegatecall{ |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
``` |
|
|
|
``` |
|
|
|
Bob calls `delegate` and delegate the execution to its malicious contract. As a result, Bob withdraws the funds of the contract and destruct it.''' |
|
|
|
Bob calls `delegate` and delegates the execution to its malicious contract. As a result, Bob withdraws the funds of the contract and destructs it.''' |
|
|
|
|
|
|
|
|
|
|
|
WIKI_RECOMMENDATION = 'Avoid using `delegatecall`. Use only trusted destinations.' |
|
|
|
WIKI_RECOMMENDATION = 'Avoid using `delegatecall`. Use only trusted destinations.' |
|
|
|
|
|
|
|
|
|
|
@ -32,7 +32,7 @@ Bob calls `delegate` and delegate the execution to its malicious contract. As a |
|
|
|
ret = [] |
|
|
|
ret = [] |
|
|
|
for node in function.nodes: |
|
|
|
for node in function.nodes: |
|
|
|
for ir in node.irs: |
|
|
|
for ir in node.irs: |
|
|
|
if isinstance(ir, LowLevelCall) and ir.function_name in ['delegatecall', 'codecall']: |
|
|
|
if isinstance(ir, LowLevelCall) and ir.function_name in ['delegatecall', 'callcode']: |
|
|
|
if is_tainted(ir.destination, function.contract): |
|
|
|
if is_tainted(ir.destination, function.contract): |
|
|
|
ret.append(node) |
|
|
|
ret.append(node) |
|
|
|
return ret |
|
|
|
return ret |
|
|
|