Data depenencies printer: add example and improve output

pull/179/head
Josselin 6 years ago
parent 3665108cf8
commit 41fc20ae90
  1. 15
      examples/printers/data_dependencies.sol
  2. 4
      slither/printers/summary/data_depenency.py

@ -0,0 +1,15 @@
contract MyContract{
uint a = 0;
uint b = 0;
uint c = 0;
function setA(uint input_a, uint input_b) public{
setB(input_b);
a = input_a;
}
function setB(uint input) internal{
b = input;
}
}

@ -8,8 +8,8 @@ from slither.analyses.data_dependency.data_dependency import get_dependencies
from slither.slithir.variables import TemporaryVariable, ReferenceVariable
def _get(v, c):
return [d.name for d in get_dependencies(v, c) if not isinstance(d, (TemporaryVariable,
ReferenceVariable))]
return list(set([d.name for d in get_dependencies(v, c) if not isinstance(d, (TemporaryVariable,
ReferenceVariable))]))
class DataDependency(AbstractPrinter):

Loading…
Cancel
Save