Merge branch 'dev' into dev-refactor-output

pull/72/head
Josselin 6 years ago
commit f529252f84
  1. 1
      README.md
  2. 9
      examples/scripts/convert_to_ir.py
  3. 2
      examples/scripts/export_to_dot.py
  4. 2
      examples/scripts/functions_called.py
  5. 2
      examples/scripts/functions_writing.py
  6. 2
      examples/scripts/slithIR.py
  7. 2
      examples/scripts/taint_mapping.py
  8. 2
      examples/scripts/variable_in_condition.py
  9. 2
      scripts/travis_test.sh
  10. 2
      setup.py
  11. 2
      slither/__main__.py
  12. 4
      slither/analyses/taint/specific_variable.py
  13. 5
      slither/solc_parsing/declarations/contract.py

@ -62,7 +62,6 @@ Num | Detector | What it Detects | Impact | Confidence
13 | `pragma` | If different pragma directives are used | Informational | High
14 | `solc-version` | Old versions of Solidity (< 0.4.23) | Informational | High
15 | `unused-state` | Unused state variables | Informational | High
16 | `complex-function` | Complex functions | Informational | Medium
[Contact us](https://www.trailofbits.com/contact/) to get access to additional detectors.

@ -3,19 +3,18 @@ from slither.slither import Slither
from slither.slithir.convert import convert_expression
if len(sys.argv) != 4:
print('python.py function_called.py functions_called.sol Contract function()')
if len(sys.argv) != 2:
print('python function_called.py functions_called.sol')
exit(-1)
# Init slither
slither = Slither(sys.argv[1])
# Get the contract
contract = slither.get_contract_from_name(sys.argv[2])
contract = slither.get_contract_from_name('Test')
# Get the variable
test = contract.get_function_from_signature(sys.argv[3])
#test = contract.get_function_from_signature('two()')
test = contract.get_function_from_signature('one()')
nodes = test.nodes

@ -3,7 +3,7 @@ from slither.slither import Slither
if len(sys.argv) != 2:
print('python.py function_called.py')
print('python function_called.py contract.sol')
exit(-1)
# Init slither

@ -2,7 +2,7 @@ import sys
from slither.slither import Slither
if len(sys.argv) != 2:
print('python.py function_called.py functions_called.sol')
print('python functions_called.py functions_called.sol')
exit(-1)
# Init slither

@ -2,7 +2,7 @@ import sys
from slither.slither import Slither
if len(sys.argv) != 2:
print('python.py function_writing.py functions_writing.sol')
print('python function_writing.py functions_writing.sol')
exit(-1)
# Init slither

@ -2,7 +2,7 @@ import sys
from slither import Slither
if len(sys.argv) != 2:
print('python.py slithIR.py contract.sol')
print('python slithIR.py contract.sol')
exit(-1)
# Init slither

@ -56,7 +56,7 @@ def check_call(func, taints):
if __name__ == "__main__":
if len(sys.argv) != 2:
print('python.py taint.py taint.sol')
print('python taint_mapping.py taint.sol')
exit(-1)
# Init slither

@ -2,7 +2,7 @@ import sys
from slither.slither import Slither
if len(sys.argv) != 2:
print('python.py variable_in_condition.py variable_in_condition.sol')
print('python variable_in_condition.py variable_in_condition.sol')
exit(-1)
# Init slither

@ -26,7 +26,7 @@ test_slither tests/tx_origin.sol "tx-origin" 2
test_slither tests/unused_state.sol "unused-state" 1
test_slither tests/locked_ether.sol "locked-ether" 1
test_slither tests/arbitrary_send.sol "arbitrary-send" 2
test_slither tests/complex_func.sol "complex-function" 3
#test_slither tests/complex_func.sol "complex-function" 3
test_slither tests/inline_assembly_contract.sol "assembly" 1
test_slither tests/inline_assembly_library.sol "assembly" 2
test_slither tests/low_level_calls.sol "low-level-calls" 1

@ -5,7 +5,7 @@ setup(
description='Slither is a Solidity static analysis framework written in Python 3.',
url='https://github.com/trailofbits/slither',
author='Trail of Bits',
version='0.1.0',
version='0.2.0',
packages=find_packages(),
python_requires='>=3.6',
install_requires=['prettytable>=0.7.2'],

@ -130,7 +130,7 @@ def get_detectors_and_printers():
LowLevelCalls,
NamingConvention,
ConstCandidateStateVars,
ComplexFunction,
#ComplexFunction,
ExternalFunction]
from slither.printers.summary.function import FunctionSummary

@ -15,9 +15,7 @@ from .common import iterate_over_irs
def make_key(variable):
if isinstance(variable, Variable):
key = 'TAINT_{}{}{}'.format(variable.contract.name,
variable.name,
str(type(variable)))
key = 'TAINT_{}'.format(id(variable))
else:
assert isinstance(variable, SolidityVariable)
key = 'TAINT_{}{}'.format(variable.name,

@ -235,9 +235,14 @@ class ContractSolc04(Contract):
self._variables[var.name] = var
def analyze_constant_state_variables(self):
from slither.solc_parsing.expressions.expression_parsing import VariableNotFound
for var in self.variables:
if var.is_constant:
# cant parse constant expression based on function calls
try:
var.analyze(self)
except VariableNotFound:
pass
return
def analyze_state_variables(self):

Loading…
Cancel
Save