Merge pull request #445 from crytic/dev-fix-sig-contract

Fix incorrect signature generation in case of contract
pull/446/head
Feist Josselin 5 years ago committed by GitHub
commit 8f74407268
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 59
      slither/core/declarations/function.py
  2. 1
      tests/expected_json/arbitrary_send-0.5.1.arbitrary-send.txt
  3. 1
      tests/expected_json/arbitrary_send.arbitrary-send.txt
  4. 1
      tests/expected_json/backdoor.backdoor.txt
  5. 1
      tests/expected_json/backdoor.suicidal.txt
  6. 1
      tests/expected_json/const_state_variables.constable-states.txt
  7. 2
      tests/expected_json/constant-0.5.1.constant-function-asm.txt
  8. 2
      tests/expected_json/constant-0.5.1.constant-function-state.txt
  9. 5
      tests/expected_json/constant.constant-function-asm.txt
  10. 3
      tests/expected_json/constant.constant-function-state.txt
  11. 1
      tests/expected_json/controlled_delegatecall.controlled-delegatecall.txt
  12. 1
      tests/expected_json/deprecated_calls.deprecated-standards.txt
  13. 1
      tests/expected_json/erc20_indexed.erc20-indexed.txt
  14. 1
      tests/expected_json/external_function.external-function.txt
  15. 1
      tests/expected_json/external_function_2.external-function.txt
  16. 20
      tests/expected_json/incorrect_equality.incorrect-equality.json
  17. 5
      tests/expected_json/incorrect_equality.incorrect-equality.txt
  18. 1
      tests/expected_json/incorrect_erc20_interface.erc20-interface.txt
  19. 1
      tests/expected_json/incorrect_erc721_interface.erc721-interface.txt
  20. 1
      tests/expected_json/inline_assembly_contract-0.5.1.assembly.txt
  21. 1
      tests/expected_json/inline_assembly_contract.assembly.txt
  22. 1
      tests/expected_json/inline_assembly_library-0.5.1.assembly.txt
  23. 1
      tests/expected_json/inline_assembly_library.assembly.txt
  24. 1
      tests/expected_json/locked_ether-0.5.1.locked-ether.txt
  25. 1
      tests/expected_json/locked_ether.locked-ether.txt
  26. 1
      tests/expected_json/low_level_calls.low-level-calls.txt
  27. 1
      tests/expected_json/multiple_calls_in_loop.calls-loop.txt
  28. 1
      tests/expected_json/naming_convention.naming-convention.txt
  29. 2
      tests/expected_json/old_solc.sol.json.solc-version.json
  30. 1
      tests/expected_json/old_solc.sol.json.solc-version.txt
  31. 2
      tests/expected_json/pragma.0.4.24.pragma.json
  32. 1
      tests/expected_json/pragma.0.4.24.pragma.txt
  33. 12
      tests/expected_json/reentrancy-0.5.1-events.reentrancy-events.json
  34. 2
      tests/expected_json/reentrancy-0.5.1-events.reentrancy-events.txt
  35. 2
      tests/expected_json/right_to_left_override.rtlo.txt
  36. 1
      tests/expected_json/shadowing_abstract.shadowing-abstract.txt
  37. 1
      tests/expected_json/shadowing_builtin_symbols.shadowing-builtin.txt
  38. 1
      tests/expected_json/shadowing_local_variable.shadowing-local.txt
  39. 1
      tests/expected_json/shadowing_state_variable.shadowing-state.txt
  40. 1
      tests/expected_json/timestamp.timestamp.txt
  41. 1
      tests/expected_json/too_many_digits.too-many-digits.txt
  42. 1
      tests/expected_json/tx_origin-0.5.1.tx-origin.txt
  43. 1
      tests/expected_json/tx_origin.tx-origin.txt
  44. 1
      tests/expected_json/unchecked_lowlevel-0.5.1.unchecked-lowlevel.txt
  45. 1
      tests/expected_json/unchecked_lowlevel.unchecked-lowlevel.txt
  46. 1
      tests/expected_json/unchecked_send-0.5.1.unchecked-send.txt
  47. 1
      tests/expected_json/uninitialized-0.5.1.uninitialized-state.txt
  48. 1
      tests/expected_json/uninitialized.uninitialized-state.txt
  49. 20
      tests/expected_json/unused_return.unused-return.json
  50. 5
      tests/expected_json/unused_return.unused-return.txt
  51. 1
      tests/expected_json/unused_state.unused-state.txt
  52. 1
      tests/expected_json/void-cst.void-cst.txt
  53. 4
      tests/possible_paths/paths.txt

@ -13,6 +13,8 @@ from slither.core.declarations.solidity_variables import (SolidityFunction,
SolidityVariableComposed)
from slither.core.expressions import (Identifier, IndexAccess, MemberAccess,
UnaryOperation)
from slither.core.solidity_types import UserDefinedType
from slither.core.solidity_types.type import Type
from slither.core.source_mapping.source_mapping import SourceMapping
from slither.core.variables.state_variable import StateVariable
@ -22,6 +24,7 @@ logger = logging.getLogger("Function")
ReacheableNode = namedtuple('ReacheableNode', ['node', 'ir'])
class ModifierStatements:
def __init__(self, modifier, entry_point, nodes):
@ -29,7 +32,6 @@ class ModifierStatements:
self._entry_point = entry_point
self._nodes = nodes
@property
def modifier(self):
return self._modifier
@ -50,14 +52,16 @@ class ModifierStatements:
def nodes(self, nodes):
self._nodes = nodes
class FunctionType(Enum):
NORMAL = 0
CONSTRUCTOR = 1
FALLBACK = 2
RECEIVE = 3
CONSTRUCTOR_VARIABLES = 10 # Fake function to hold variable declaration statements
CONSTRUCTOR_VARIABLES = 10 # Fake function to hold variable declaration statements
CONSTRUCTOR_CONSTANT_VARIABLES = 11 # Fake function to hold variable declaration statements
class Function(ChildContract, ChildInheritance, SourceMapping):
"""
Function class
@ -76,7 +80,7 @@ class Function(ChildContract, ChildInheritance, SourceMapping):
self._entry_point = None
self._nodes = []
self._variables = {}
self._slithir_variables = set() # slithir Temporary and references variables (but not SSA)
self._slithir_variables = set() # slithir Temporary and references variables (but not SSA)
self._parameters = []
self._parameters_ssa = []
self._parameters_src = None
@ -173,7 +177,7 @@ class Function(ChildContract, ChildInheritance, SourceMapping):
Return the function signature without the return values
"""
name, parameters, _ = self.signature
return name+'('+','.join(parameters)+')'
return name + '(' + ','.join(parameters) + ')'
@property
def canonical_name(self):
@ -360,8 +364,6 @@ class Function(ChildContract, ChildInheritance, SourceMapping):
"""
return self._is_empty
# endregion
###################################################################################
###################################################################################
@ -485,7 +487,8 @@ class Function(ChildContract, ChildInheritance, SourceMapping):
included.
"""
# This is a list of contracts internally, so we convert it to a list of constructor functions.
return [c.modifier.constructors_declared for c in self._explicit_base_constructor_calls if c.modifier.constructors_declared]
return [c.modifier.constructors_declared for c in self._explicit_base_constructor_calls if
c.modifier.constructors_declared]
@property
def explicit_base_constructor_calls_statements(self):
@ -496,7 +499,6 @@ class Function(ChildContract, ChildInheritance, SourceMapping):
# This is a list of contracts internally, so we convert it to a list of constructor functions.
return list(self._explicit_base_constructor_calls)
# endregion
###################################################################################
###################################################################################
@ -628,7 +630,6 @@ class Function(ChildContract, ChildInheritance, SourceMapping):
"""
return list(self._low_level_calls)
@property
def external_calls_as_expressions(self):
"""
@ -726,13 +727,22 @@ class Function(ChildContract, ChildInheritance, SourceMapping):
###################################################################################
###################################################################################
@staticmethod
def _convert_type_for_signature(t: Type):
from slither.core.declarations.contract import Contract
if isinstance(t, UserDefinedType) and isinstance(t.type, Contract):
return "address"
return str(t)
@property
def signature(self):
"""
(str, list(str), list(str)): Function signature as
(name, list parameters type, list return values type)
"""
return self.name, [str(x.type) for x in self.parameters], [str(x.type) for x in self.returns]
return (self.name,
[self._convert_type_for_signature(x.type) for x in self.parameters],
[self._convert_type_for_signature(x.type) for x in self.returns])
@property
def signature_str(self):
@ -741,7 +751,7 @@ class Function(ChildContract, ChildInheritance, SourceMapping):
Return the function signature as a str (contains the return values)
"""
name, parameters, returnVars = self.signature
return name+'('+','.join(parameters)+') returns('+','.join(returnVars)+')'
return name + '(' + ','.join(parameters) + ') returns(' + ','.join(returnVars) + ')'
# endregion
###################################################################################
@ -762,7 +772,6 @@ class Function(ChildContract, ChildInheritance, SourceMapping):
candidates = [candidate for sublist in candidates for candidate in sublist]
return [f for f in candidates if f.full_name == self.full_name]
# endregion
###################################################################################
###################################################################################
@ -811,7 +820,7 @@ class Function(ChildContract, ChildInheritance, SourceMapping):
values += f_new_values(f)
to_explore += [c for c in f.internal_calls if\
to_explore += [c for c in f.internal_calls if \
isinstance(c, Function) and c not in explored and c not in to_explore]
to_explore += [c for (_, c) in f.library_calls if
isinstance(c, Function) and c not in explored and c not in to_explore]
@ -1059,12 +1068,14 @@ class Function(ChildContract, ChildInheritance, SourceMapping):
Args:
filename (str)
"""
def description(node):
desc ='{}\n'.format(node)
desc = '{}\n'.format(node)
desc += 'id: {}'.format(node.node_id)
if node.dominance_frontier:
desc += '\ndominance frontier: {}'.format([n.node_id for n in node.dominance_frontier])
return desc
with open(filename, 'w', encoding='utf8') as f:
f.write('digraph{\n')
for node in self.nodes:
@ -1189,7 +1200,6 @@ class Function(ChildContract, ChildInheritance, SourceMapping):
args_vars = self.all_solidity_variables_used_as_args()
return SolidityVariableComposed('msg.sender') in conditional_vars + args_vars
# endregion
###################################################################################
###################################################################################
@ -1220,22 +1230,22 @@ class Function(ChildContract, ChildInheritance, SourceMapping):
write_var = list(set(write_var))
# Remove dupplicate if they share the same string representation
write_var = [next(obj) for i, obj in groupby(sorted(write_var, key=lambda x: str(x)), lambda x: str(x))]
self._expression_vars_written = write_var
self._expression_vars_written = write_var
write_var = [x.variables_written for x in self.nodes]
write_var = [x for x in write_var if x]
write_var = [item for sublist in write_var for item in sublist]
write_var = list(set(write_var))
# Remove dupplicate if they share the same string representation
write_var = [next(obj) for i, obj in\
groupby(sorted(write_var, key=lambda x: str(x)), lambda x: str(x))]
write_var = [next(obj) for i, obj in \
groupby(sorted(write_var, key=lambda x: str(x)), lambda x: str(x))]
self._vars_written = write_var
read_var = [x.variables_read_as_expression for x in self.nodes]
read_var = [x for x in read_var if x]
read_var = [item for sublist in read_var for item in sublist]
# Remove dupplicate if they share the same string representation
read_var = [next(obj) for i, obj in\
read_var = [next(obj) for i, obj in \
groupby(sorted(read_var, key=lambda x: str(x)), lambda x: str(x))]
self._expression_vars_read = read_var
@ -1243,15 +1253,15 @@ class Function(ChildContract, ChildInheritance, SourceMapping):
read_var = [x for x in read_var if x]
read_var = [item for sublist in read_var for item in sublist]
# Remove dupplicate if they share the same string representation
read_var = [next(obj) for i, obj in\
read_var = [next(obj) for i, obj in \
groupby(sorted(read_var, key=lambda x: str(x)), lambda x: str(x))]
self._vars_read = read_var
self._state_vars_written = [x for x in self.variables_written if\
self._state_vars_written = [x for x in self.variables_written if \
isinstance(x, StateVariable)]
self._state_vars_read = [x for x in self.variables_read if\
isinstance(x, (StateVariable))]
self._solidity_vars_read = [x for x in self.variables_read if\
self._state_vars_read = [x for x in self.variables_read if \
isinstance(x, (StateVariable))]
self._solidity_vars_read = [x for x in self.variables_read if \
isinstance(x, (SolidityVariable))]
self._vars_read_or_written = self._vars_written + self._vars_read
@ -1398,7 +1408,6 @@ class Function(ChildContract, ChildInheritance, SourceMapping):
for node in self.nodes:
node.slithir_generation()
self._analyze_read_write()
self._analyze_calls()

@ -7,3 +7,4 @@ Test.indirect() (tests/arbitrary_send-0.5.1.sol#19-21) sends eth to arbitrary us
- destination.send(address(this).balance) (tests/arbitrary_send-0.5.1.sol#20)
Reference: https://github.com/crytic/slither/wiki/Detector-Documentation#functions-that-send-ether-to-arbitrary-destinations
tests/arbitrary_send-0.5.1.sol analyzed (1 contracts with 1 detectors), 2 result(s) found
Use https://crytic.io/ to get access to additional detectors and Github integration

@ -7,3 +7,4 @@ Test.indirect() (tests/arbitrary_send.sol#19-21) sends eth to arbitrary user
- destination.send(address(this).balance) (tests/arbitrary_send.sol#20)
Reference: https://github.com/crytic/slither/wiki/Detector-Documentation#functions-that-send-ether-to-arbitrary-destinations
tests/arbitrary_send.sol analyzed (1 contracts with 1 detectors), 2 result(s) found
Use https://crytic.io/ to get access to additional detectors and Github integration

@ -2,4 +2,5 @@
Backdoor function found in C.i_am_a_backdoor() (tests/backdoor.sol#4-6)
Reference: https://github.com/trailofbits/slither/wiki/Adding-a-new-detector
tests/backdoor.sol analyzed (1 contracts with 1 detectors), 1 result(s) found
Use https://crytic.io/ to get access to additional detectors and Github integration
INFO:Slither:/home/travis/build/crytic/slither/scripts/../tests/expected_json/backdoor.backdoor.json exists already, the overwrite is prevented

@ -2,4 +2,5 @@
C.i_am_a_backdoor() (tests/backdoor.sol#4-6) allows anyone to destruct the contract
Reference: https://github.com/crytic/slither/wiki/Detector-Documentation#suicidal
tests/backdoor.sol analyzed (1 contracts with 1 detectors), 1 result(s) found
Use https://crytic.io/ to get access to additional detectors and Github integration
INFO:Slither:/home/travis/build/crytic/slither/scripts/../tests/expected_json/backdoor.suicidal.json exists already, the overwrite is prevented

@ -7,3 +7,4 @@ MyConc.should_be_constant (tests/const_state_variables.sol#42) should be constan
MyConc.should_be_constant_2 (tests/const_state_variables.sol#43) should be constant
Reference: https://github.com/crytic/slither/wiki/Detector-Documentation#state-variables-that-could-be-declared-constant
tests/const_state_variables.sol analyzed (3 contracts with 1 detectors), 6 result(s) found
Use https://crytic.io/ to get access to additional detectors and Github integration

@ -0,0 +1,2 @@
tests/constant-0.5.1.sol analyzed (1 contracts with 1 detectors), 0 result(s) found
Use https://crytic.io/ to get access to additional detectors and Github integration

@ -0,0 +1,2 @@
tests/constant-0.5.1.sol analyzed (1 contracts with 1 detectors), 0 result(s) found
Use https://crytic.io/ to get access to additional detectors and Github integration

@ -1,4 +1,5 @@

Constant.test_assembly_bug() (tests/constant.sol#22-24) is declared view but contains assembly code
Reference: https://github.com/crytic/slither/wiki/Detector-Documentation#constant-functions-changing-the-state
tests/constant.sol analyzed (1 contracts with 1 detectors), 3 result(s) found
Reference: https://github.com/crytic/slither/wiki/Detector-Documentation#constant-functions-using-assembly-code
tests/constant.sol analyzed (1 contracts with 1 detectors), 1 result(s) found
Use https://crytic.io/ to get access to additional detectors and Github integration

@ -4,4 +4,5 @@ Constant.test_view_bug() (tests/constant.sol#5-7) is declared view but changes s
Constant.test_constant_bug() (tests/constant.sol#9-11) is declared view but changes state variables:
- Constant.a (tests/constant.sol#3)
Reference: https://github.com/crytic/slither/wiki/Detector-Documentation#constant-functions-changing-the-state
tests/constant.sol analyzed (1 contracts with 1 detectors), 3 result(s) found
tests/constant.sol analyzed (1 contracts with 1 detectors), 2 result(s) found
Use https://crytic.io/ to get access to additional detectors and Github integration

@ -5,3 +5,4 @@ C.bad_delegate_call2(bytes) (tests/controlled_delegatecall.sol#18-20) uses deleg
- addr_bad.delegatecall(abi.encode(func_id,data)) (tests/controlled_delegatecall.sol#19)
Reference: https://github.com/crytic/slither/wiki/Detector-Documentation#controlled-delegatecall
tests/controlled_delegatecall.sol analyzed (1 contracts with 1 detectors), 2 result(s) found
Use https://crytic.io/ to get access to additional detectors and Github integration

@ -17,3 +17,4 @@ Deprecated standard detected globalBlockHash = block.blockhash(0) (tests/depreca
- Usage of "block.blockhash()" should be replaced with "blockhash()"
Reference: https://github.com/crytic/slither/wiki/Detector-Documentation#deprecated-standards
tests/deprecated_calls.sol analyzed (1 contracts with 1 detectors), 8 result(s) found
Use https://crytic.io/ to get access to additional detectors and Github integration

@ -5,3 +5,4 @@ ERC20 event IERC20BadApproval(address,address,uint256) (tests/erc20_indexed.sol#
ERC20 event IERC20BadApproval(address,address,uint256) (tests/erc20_indexed.sol#20)does not index parameter spender
Reference: https://github.com/crytic/slither/wiki/Detector-Documentation#unindexed-erc20-event-parameters
tests/erc20_indexed.sol analyzed (3 contracts with 1 detectors), 4 result(s) found
Use https://crytic.io/ to get access to additional detectors and Github integration

@ -11,3 +11,4 @@ parameter_read_ok_for_external(uint256) should be declared external:
- FunctionParameterWrite.parameter_read_ok_for_external(uint256) (tests/external_function.sol#74-76)
Reference: https://github.com/crytic/slither/wiki/Detector-Documentation#public-function-that-could-be-declared-as-external
tests/external_function.sol analyzed (6 contracts with 1 detectors), 5 result(s) found
Use https://crytic.io/ to get access to additional detectors and Github integration

@ -1 +1,2 @@
tests/external_function_2.sol analyzed (4 contracts with 1 detectors), 0 result(s) found
Use https://crytic.io/ to get access to additional detectors and Github integration

@ -61,7 +61,7 @@
"ending_column": 2
}
},
"signature": "bad0(ERC20Function)"
"signature": "bad0(address)"
}
},
{
@ -138,15 +138,15 @@
"ending_column": 2
}
},
"signature": "bad0(ERC20Function)"
"signature": "bad0(address)"
}
}
}
}
],
"description": "ERC20TestBalance.bad0(ERC20Function) (tests/incorrect_equality.sol#21-23) uses a dangerous strict equality:\n\t- require(bool)(erc.balanceOf(address(this)) == 10) (tests/incorrect_equality.sol#22)\n",
"markdown": "[ERC20TestBalance.bad0(ERC20Function)](tests/incorrect_equality.sol#L21-L23) uses a dangerous strict equality:\n\t- [require(bool)(erc.balanceOf(address(this)) == 10)](tests/incorrect_equality.sol#L22)\n",
"id": "75aa0ac0f7038b6a92030dee5c4c8f4cc6ab3f491558e18c61b6db5fbbf971e4",
"description": "ERC20TestBalance.bad0(address) (tests/incorrect_equality.sol#21-23) uses a dangerous strict equality:\n\t- require(bool)(erc.balanceOf(address(this)) == 10) (tests/incorrect_equality.sol#22)\n",
"markdown": "[ERC20TestBalance.bad0(address)](tests/incorrect_equality.sol#L21-L23) uses a dangerous strict equality:\n\t- [require(bool)(erc.balanceOf(address(this)) == 10)](tests/incorrect_equality.sol#L22)\n",
"id": "15f4a74f8bfef6d5ccb8053319e212576a8f453ca411bbde81fecac9dd9c7581",
"check": "incorrect-equality",
"impact": "Medium",
"confidence": "High"
@ -209,7 +209,7 @@
"ending_column": 2
}
},
"signature": "bad1(ERC20Variable)"
"signature": "bad1(address)"
}
},
{
@ -286,15 +286,15 @@
"ending_column": 2
}
},
"signature": "bad1(ERC20Variable)"
"signature": "bad1(address)"
}
}
}
}
],
"description": "ERC20TestBalance.bad1(ERC20Variable) (tests/incorrect_equality.sol#25-27) uses a dangerous strict equality:\n\t- require(bool)(erc.balanceOf(msg.sender) == 10) (tests/incorrect_equality.sol#26)\n",
"markdown": "[ERC20TestBalance.bad1(ERC20Variable)](tests/incorrect_equality.sol#L25-L27) uses a dangerous strict equality:\n\t- [require(bool)(erc.balanceOf(msg.sender) == 10)](tests/incorrect_equality.sol#L26)\n",
"id": "747d47c020b94e00fa06cc310b205306c37fda3811bafde5ee820ff84656127e",
"description": "ERC20TestBalance.bad1(address) (tests/incorrect_equality.sol#25-27) uses a dangerous strict equality:\n\t- require(bool)(erc.balanceOf(msg.sender) == 10) (tests/incorrect_equality.sol#26)\n",
"markdown": "[ERC20TestBalance.bad1(address)](tests/incorrect_equality.sol#L25-L27) uses a dangerous strict equality:\n\t- [require(bool)(erc.balanceOf(msg.sender) == 10)](tests/incorrect_equality.sol#L26)\n",
"id": "0f24486a6a14e20f6afccb0450cfcd9580308cef29fe011e05fb6a83aaa24da5",
"check": "incorrect-equality",
"impact": "Medium",
"confidence": "High"

@ -1,7 +1,7 @@

ERC20TestBalance.bad0(ERC20Function) (tests/incorrect_equality.sol#21-23) uses a dangerous strict equality:
ERC20TestBalance.bad0(address) (tests/incorrect_equality.sol#21-23) uses a dangerous strict equality:
- require(bool)(erc.balanceOf(address(this)) == 10) (tests/incorrect_equality.sol#22)
ERC20TestBalance.bad1(ERC20Variable) (tests/incorrect_equality.sol#25-27) uses a dangerous strict equality:
ERC20TestBalance.bad1(address) (tests/incorrect_equality.sol#25-27) uses a dangerous strict equality:
- require(bool)(erc.balanceOf(msg.sender) == 10) (tests/incorrect_equality.sol#26)
TestContractBalance.bad0() (tests/incorrect_equality.sol#32-35) uses a dangerous strict equality:
- require(bool)(address(address(this)).balance == 10000000000000000000) (tests/incorrect_equality.sol#33)
@ -25,3 +25,4 @@ TestSolidityKeyword.bad2() (tests/incorrect_equality.sol#131-133) uses a dangero
- require(bool)(block.number == 0) (tests/incorrect_equality.sol#132)
Reference: https://github.com/crytic/slither/wiki/Detector-Documentation#dangerous-strict-equalities
tests/incorrect_equality.sol analyzed (5 contracts with 1 detectors), 12 result(s) found
Use https://crytic.io/ to get access to additional detectors and Github integration

@ -7,3 +7,4 @@ Token (tests/incorrect_erc20_interface.sol#3-10) has incorrect ERC20 function in
Token (tests/incorrect_erc20_interface.sol#3-10) has incorrect ERC20 function interface:Token.allowance(address,address) (tests/incorrect_erc20_interface.sol#9)
Reference: https://github.com/crytic/slither/wiki/Detector-Documentation#incorrect-erc20-interface
tests/incorrect_erc20_interface.sol analyzed (1 contracts with 1 detectors), 6 result(s) found
Use https://crytic.io/ to get access to additional detectors and Github integration

@ -11,3 +11,4 @@ Token (tests/incorrect_erc721_interface.sol#6-16) has incorrect ERC721 function
Token (tests/incorrect_erc721_interface.sol#6-16) has incorrect ERC721 function interface:Token.isApprovedForAll(address,address) (tests/incorrect_erc721_interface.sol#15)
Reference: https://github.com/crytic/slither/wiki/Detector-Documentation#incorrect-erc721-interface
tests/incorrect_erc721_interface.sol analyzed (2 contracts with 1 detectors), 10 result(s) found
Use https://crytic.io/ to get access to additional detectors and Github integration

@ -3,3 +3,4 @@ GetCode.at(address) (tests/inline_assembly_contract-0.5.1.sol#6-20) uses assembl
- INLINE ASM None (tests/inline_assembly_contract-0.5.1.sol#7-20)
Reference: https://github.com/crytic/slither/wiki/Detector-Documentation#assembly-usage
tests/inline_assembly_contract-0.5.1.sol analyzed (1 contracts with 1 detectors), 1 result(s) found
Use https://crytic.io/ to get access to additional detectors and Github integration

@ -3,3 +3,4 @@ GetCode.at(address) (tests/inline_assembly_contract.sol#6-20) uses assembly
- INLINE ASM None (tests/inline_assembly_contract.sol#7-20)
Reference: https://github.com/crytic/slither/wiki/Detector-Documentation#assembly-usage
tests/inline_assembly_contract.sol analyzed (1 contracts with 1 detectors), 1 result(s) found
Use https://crytic.io/ to get access to additional detectors and Github integration

@ -5,3 +5,4 @@ VectorSum.sumPureAsm(uint256[]) (tests/inline_assembly_library-0.5.1.sol#25-47)
- INLINE ASM None (tests/inline_assembly_library-0.5.1.sol#26-47)
Reference: https://github.com/crytic/slither/wiki/Detector-Documentation#assembly-usage
tests/inline_assembly_library-0.5.1.sol analyzed (1 contracts with 1 detectors), 2 result(s) found
Use https://crytic.io/ to get access to additional detectors and Github integration

@ -5,3 +5,4 @@ VectorSum.sumPureAsm(uint256[]) (tests/inline_assembly_library.sol#25-47) uses a
- INLINE ASM None (tests/inline_assembly_library.sol#26-47)
Reference: https://github.com/crytic/slither/wiki/Detector-Documentation#assembly-usage
tests/inline_assembly_library.sol analyzed (1 contracts with 1 detectors), 2 result(s) found
Use https://crytic.io/ to get access to additional detectors and Github integration

@ -5,3 +5,4 @@ Contract locking ether found in :
But does not have a function to withdraw the ether
Reference: https://github.com/crytic/slither/wiki/Detector-Documentation#contracts-that-lock-ether
tests/locked_ether-0.5.1.sol analyzed (4 contracts with 1 detectors), 1 result(s) found
Use https://crytic.io/ to get access to additional detectors and Github integration

@ -5,3 +5,4 @@ Contract locking ether found in :
But does not have a function to withdraw the ether
Reference: https://github.com/crytic/slither/wiki/Detector-Documentation#contracts-that-lock-ether
tests/locked_ether.sol analyzed (4 contracts with 1 detectors), 1 result(s) found
Use https://crytic.io/ to get access to additional detectors and Github integration

@ -3,3 +3,4 @@ Low level call in Sender.send(address) (tests/low_level_calls.sol#5-7):
- _receiver.call.value(msg.value).gas(7777)() (tests/low_level_calls.sol#6)
Reference: https://github.com/crytic/slither/wiki/Detector-Documentation#low-level-calls
tests/low_level_calls.sol analyzed (2 contracts with 1 detectors), 1 result(s) found
Use https://crytic.io/ to get access to additional detectors and Github integration

@ -2,3 +2,4 @@
CallInLoop.bad() (tests/multiple_calls_in_loop.sol#9-13) has external calls inside a loop: destinations[i].transfer(i) (tests/multiple_calls_in_loop.sol#11)
Reference: https://github.com/crytic/slither/wiki/Detector-Documentation/#calls-inside-a-loop
tests/multiple_calls_in_loop.sol analyzed (1 contracts with 1 detectors), 1 result(s) found
Use https://crytic.io/ to get access to additional detectors and Github integration

@ -13,3 +13,4 @@ Variable T._myPublicVar (tests/naming_convention.sol#56) is not in mixedCase
Variable T.l (tests/naming_convention.sol#67) used l, O, I, which should not be used
Reference: https://github.com/crytic/slither/wiki/Detector-Documentation#conformance-to-solidity-naming-conventions
tests/naming_convention.sol analyzed (4 contracts with 1 detectors), 12 result(s) found
Use https://crytic.io/ to get access to additional detectors and Github integration

@ -2,4 +2,5 @@
Pragma version0.4.21 (None) allows old versions
Reference: https://github.com/crytic/slither/wiki/Detector-Documentation#incorrect-versions-of-solidity
tests/old_solc.sol.json analyzed (1 contracts with 1 detectors), 1 result(s) found
Use https://crytic.io/ to get access to additional detectors and Github integration
INFO:Slither:/home/travis/build/crytic/slither/scripts/../tests/expected_json/old_solc.sol.json.solc-version.json exists already, the overwrite is prevented

@ -5,3 +5,4 @@ Different versions of Solidity is used in :
- ^0.4.24 (tests/pragma.0.4.24.sol#1)
Reference: https://github.com/crytic/slither/wiki/Detector-Documentation#different-pragma-directives-are-used
tests/pragma.0.4.24.sol analyzed (1 contracts with 1 detectors), 1 result(s) found
Use https://crytic.io/ to get access to additional detectors and Github integration

@ -57,7 +57,7 @@
"ending_column": 2
}
},
"signature": "bug(C)"
"signature": "bug(address)"
}
},
{
@ -130,7 +130,7 @@
"ending_column": 2
}
},
"signature": "bug(C)"
"signature": "bug(address)"
}
}
},
@ -208,7 +208,7 @@
"ending_column": 2
}
},
"signature": "bug(C)"
"signature": "bug(address)"
}
}
},
@ -217,9 +217,9 @@
}
}
],
"description": "Reentrancy in Test.bug(C) (tests/reentrancy-0.5.1-events.sol#14-17):\n\tExternal calls:\n\t- c.f() (tests/reentrancy-0.5.1-events.sol#15)\n\tEvent emitted after the call(s):\n\t- E() (tests/reentrancy-0.5.1-events.sol#16)\n",
"markdown": "Reentrancy in [Test.bug(C)](tests/reentrancy-0.5.1-events.sol#L14-L17):\n\tExternal calls:\n\t- [c.f()](tests/reentrancy-0.5.1-events.sol#L15)\n\tEvent emitted after the call(s):\n\t- [E()](tests/reentrancy-0.5.1-events.sol#L16)\n",
"id": "9654da7d8b8d85c90bc2ee1ddaea365f98f14d9981149b354f8a3d84f98ea576",
"description": "Reentrancy in Test.bug(address) (tests/reentrancy-0.5.1-events.sol#14-17):\n\tExternal calls:\n\t- c.f() (tests/reentrancy-0.5.1-events.sol#15)\n\tEvent emitted after the call(s):\n\t- E() (tests/reentrancy-0.5.1-events.sol#16)\n",
"markdown": "Reentrancy in [Test.bug(address)](tests/reentrancy-0.5.1-events.sol#L14-L17):\n\tExternal calls:\n\t- [c.f()](tests/reentrancy-0.5.1-events.sol#L15)\n\tEvent emitted after the call(s):\n\t- [E()](tests/reentrancy-0.5.1-events.sol#L16)\n",
"id": "379907e63f185d72b3e767e005ba76247024692c633a93d4415c0a0be4ec1d8d",
"check": "reentrancy-events",
"impact": "Low",
"confidence": "Medium"

@ -1,5 +1,5 @@

Reentrancy in Test.bug(C) (tests/reentrancy-0.5.1-events.sol#14-17):
Reentrancy in Test.bug(address) (tests/reentrancy-0.5.1-events.sol#14-17):
External calls:
- c.f() (tests/reentrancy-0.5.1-events.sol#15)
Event emitted after the call(s):

@ -3,4 +3,4 @@ tests/right_to_left_override.sol contains a unicode right-to-left-override chara
- b' test1(/*A\xe2\x80\xae/*B*/2 , 1/*\xe2\x80\xad'
Reference: https://github.com/crytic/slither/wiki/Detector-Documentation#right-to-left-override-character
tests/right_to_left_override.sol analyzed (1 contracts with 1 detectors), 1 result(s) found
INFO:Slither:/home/travis/build/crytic/slither/scripts/../tests/expected_json/right_to_left_override.rtlo.json exists already, the overwrite is prevented
Use https://crytic.io/ to get access to additional detectors and Github integration

@ -3,3 +3,4 @@ DerivedContract.owner (tests/shadowing_abstract.sol#7) shadows:
- BaseContract.owner (tests/shadowing_abstract.sol#2)
Reference: https://github.com/crytic/slither/wiki/Detector-Documentation#state-variable-shadowing-from-abstract-contracts
tests/shadowing_abstract.sol analyzed (2 contracts with 1 detectors), 1 result(s) found
Use https://crytic.io/ to get access to additional detectors and Github integration

@ -14,3 +14,4 @@ FurtherExtendedContract.abi (tests/shadowing_builtin_symbols.sol#21) (state vari
Reserved.mutable (tests/shadowing_builtin_symbols.sol#32) (state variable) shadows built-in symbol"
Reference: https://github.com/crytic/slither/wiki/Detector-Documentation#builtin-symbol-shadowing
tests/shadowing_builtin_symbols.sol analyzed (4 contracts with 1 detectors), 13 result(s) found
Use https://crytic.io/ to get access to additional detectors and Github integration

@ -13,3 +13,4 @@ FurtherExtendedContract.shadowingParent(uint256).v (tests/shadowing_local_variab
- ExtendedContractv() (tests/shadowing_local_variable.sol#13) (event)
Reference: https://github.com/crytic/slither/wiki/Detector-Documentation#local-variable-shadowing
tests/shadowing_local_variable.sol analyzed (3 contracts with 1 detectors), 5 result(s) found
Use https://crytic.io/ to get access to additional detectors and Github integration

@ -3,3 +3,4 @@ DerivedContract.owner (tests/shadowing_state_variable.sol#12) shadows:
- BaseContract.owner (tests/shadowing_state_variable.sol#2)
Reference: https://github.com/crytic/slither/wiki/Detector-Documentation#state-variable-shadowing
tests/shadowing_state_variable.sol analyzed (2 contracts with 1 detectors), 1 result(s) found
Use https://crytic.io/ to get access to additional detectors and Github integration

@ -10,3 +10,4 @@ Timestamp.bad2() (tests/timestamp.sol#13-15) uses timestamp for comparisons
- block.timestamp > 0 (tests/timestamp.sol#14)
Reference: https://github.com/crytic/slither/wiki/Detector-Documentation#block-timestamp
tests/timestamp.sol analyzed (1 contracts with 1 detectors), 3 result(s) found
Use https://crytic.io/ to get access to additional detectors and Github integration

@ -11,3 +11,4 @@ C.h() (tests/too_many_digits.sol#20-24) uses literals with too many digits:
- x2 = 100000 (tests/too_many_digits.sol#22)
Reference: https://github.com/crytic/slither/wiki/Detector-Documentation#too-many-digits
tests/too_many_digits.sol analyzed (1 contracts with 1 detectors), 5 result(s) found
Use https://crytic.io/ to get access to additional detectors and Github integration

@ -3,3 +3,4 @@ TxOrigin.bug0() (tests/tx_origin-0.5.1.sol#9-11) uses tx.origin for authorizatio
TxOrigin.bug2() (tests/tx_origin-0.5.1.sol#13-17) uses tx.origin for authorization: tx.origin != owner (tests/tx_origin-0.5.1.sol#14)
Reference: https://github.com/crytic/slither/wiki/Detector-Documentation#dangerous-usage-of-txorigin
tests/tx_origin-0.5.1.sol analyzed (1 contracts with 1 detectors), 2 result(s) found
Use https://crytic.io/ to get access to additional detectors and Github integration

@ -3,3 +3,4 @@ TxOrigin.bug0() (tests/tx_origin.sol#9-11) uses tx.origin for authorization: req
TxOrigin.bug2() (tests/tx_origin.sol#13-17) uses tx.origin for authorization: tx.origin != owner (tests/tx_origin.sol#14)
Reference: https://github.com/crytic/slither/wiki/Detector-Documentation#dangerous-usage-of-txorigin
tests/tx_origin.sol analyzed (1 contracts with 1 detectors), 2 result(s) found
Use https://crytic.io/ to get access to additional detectors and Github integration

@ -2,3 +2,4 @@
MyConc.bad(address) (tests/unchecked_lowlevel-0.5.1.sol#2-4) ignores return value by dst.call.value(msg.value)() (tests/unchecked_lowlevel-0.5.1.sol#3)
Reference: https://github.com/crytic/slither/wiki/Detector-Documentation#unchecked-low-level-calls
tests/unchecked_lowlevel-0.5.1.sol analyzed (1 contracts with 1 detectors), 1 result(s) found
Use https://crytic.io/ to get access to additional detectors and Github integration

@ -2,3 +2,4 @@
MyConc.bad(address) (tests/unchecked_lowlevel.sol#2-4) ignores return value by dst.call.value(msg.value)() (tests/unchecked_lowlevel.sol#3)
Reference: https://github.com/crytic/slither/wiki/Detector-Documentation#unchecked-low-level-calls
tests/unchecked_lowlevel.sol analyzed (1 contracts with 1 detectors), 1 result(s) found
Use https://crytic.io/ to get access to additional detectors and Github integration

@ -2,3 +2,4 @@
MyConc.bad(address) (tests/unchecked_send-0.5.1.sol#2-4) ignores return value by dst.send(msg.value) (tests/unchecked_send-0.5.1.sol#3)
Reference: https://github.com/crytic/slither/wiki/Detector-Documentation#unchecked-send
tests/unchecked_send-0.5.1.sol analyzed (1 contracts with 1 detectors), 1 result(s) found
Use https://crytic.io/ to get access to additional detectors and Github integration

@ -9,3 +9,4 @@ Test2.v (tests/uninitialized-0.5.1.sol#47) is never initialized. It is used in:
- Test2.init() (tests/uninitialized-0.5.1.sol#49-51)
Reference: https://github.com/crytic/slither/wiki/Detector-Documentation#uninitialized-state-variables
tests/uninitialized-0.5.1.sol analyzed (4 contracts with 1 detectors), 4 result(s) found
Use https://crytic.io/ to get access to additional detectors and Github integration

@ -9,3 +9,4 @@ Test2.v (tests/uninitialized.sol#47) is never initialized. It is used in:
- Test2.init() (tests/uninitialized.sol#49-51)
Reference: https://github.com/crytic/slither/wiki/Detector-Documentation#uninitialized-state-variables
tests/uninitialized.sol analyzed (4 contracts with 1 detectors), 4 result(s) found
Use https://crytic.io/ to get access to additional detectors and Github integration

@ -70,7 +70,7 @@
"ending_column": 2
}
},
"signature": "test(Target)"
"signature": "test(address)"
}
},
{
@ -156,15 +156,15 @@
"ending_column": 2
}
},
"signature": "test(Target)"
"signature": "test(address)"
}
}
}
}
],
"description": "User.test(Target) (tests/unused_return.sol#17-29) ignores return value by t.f() (tests/unused_return.sol#18)\n",
"markdown": "[User.test(Target)](tests/unused_return.sol#L17-L29) ignores return value by [t.f()](tests/unused_return.sol#L18)\n",
"id": "69f2810e24dbba754b406ce8b47e37543e9e491c0aa60d4dd2198c960e82b096",
"description": "User.test(address) (tests/unused_return.sol#17-29) ignores return value by t.f() (tests/unused_return.sol#18)\n",
"markdown": "[User.test(address)](tests/unused_return.sol#L17-L29) ignores return value by [t.f()](tests/unused_return.sol#L18)\n",
"id": "accd4d71c13bd3ecae16bfa554bf755bf5a8923080e640089970e00ead85d51c",
"check": "unused-return",
"impact": "Medium",
"confidence": "Medium"
@ -236,7 +236,7 @@
"ending_column": 2
}
},
"signature": "test(Target)"
"signature": "test(address)"
}
},
{
@ -322,15 +322,15 @@
"ending_column": 2
}
},
"signature": "test(Target)"
"signature": "test(address)"
}
}
}
}
],
"description": "User.test(Target) (tests/unused_return.sol#17-29) ignores return value by a.add(0) (tests/unused_return.sol#22)\n",
"markdown": "[User.test(Target)](tests/unused_return.sol#L17-L29) ignores return value by [a.add(0)](tests/unused_return.sol#L22)\n",
"id": "502f40d2e259e5e0268547489b716077dff7ce3df82fb05eb76ccb5ffa38f72b",
"description": "User.test(address) (tests/unused_return.sol#17-29) ignores return value by a.add(0) (tests/unused_return.sol#22)\n",
"markdown": "[User.test(address)](tests/unused_return.sol#L17-L29) ignores return value by [a.add(0)](tests/unused_return.sol#L22)\n",
"id": "78b4f6169d988d70d342626d7bc77ba6e04f9f256a2379949de6f5081d72c752",
"check": "unused-return",
"impact": "Medium",
"confidence": "Medium"

@ -1,5 +1,6 @@

User.test(Target) (tests/unused_return.sol#17-29) ignores return value by t.f() (tests/unused_return.sol#18)
User.test(Target) (tests/unused_return.sol#17-29) ignores return value by a.add(0) (tests/unused_return.sol#22)
User.test(address) (tests/unused_return.sol#17-29) ignores return value by t.f() (tests/unused_return.sol#18)
User.test(address) (tests/unused_return.sol#17-29) ignores return value by a.add(0) (tests/unused_return.sol#22)
Reference: https://github.com/crytic/slither/wiki/Detector-Documentation#unused-return
tests/unused_return.sol analyzed (3 contracts with 1 detectors), 2 result(s) found
Use https://crytic.io/ to get access to additional detectors and Github integration

@ -5,3 +5,4 @@ A.unused3 (tests/unused_state.sol#6) is never used in B (tests/unused_state.sol#
A.unused4 (tests/unused_state.sol#7) is never used in B (tests/unused_state.sol#11-16)
Reference: https://github.com/crytic/slither/wiki/Detector-Documentation#unused-state-variables
tests/unused_state.sol analyzed (2 contracts with 1 detectors), 4 result(s) found
Use https://crytic.io/ to get access to additional detectors and Github integration

@ -3,3 +3,4 @@ Void constructor called in D.constructor() (tests/void-cst.sol#10-12):
- C() (tests/void-cst.sol#10)
Reference: https://github.com/crytic/slither/wiki/Detector-Documentation#void-constructor
tests/void-cst.sol analyzed (2 contracts with 1 detectors), 1 result(s) found
Use https://crytic.io/ to get access to additional detectors and Github integration

@ -4,11 +4,11 @@ Target functions:
The following functions reach the specified targets:
- A.call()
- B.call2(A)
- B.call2(address)
The following paths reach the specified targets:
A.call() -> A.destination()
B.call2(A) -> A.call() -> A.destination()
B.call2(address) -> A.call() -> A.destination()

Loading…
Cancel
Save