You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The following contract will cause slither to throw an error:
contract C {
uint constant x = 100;
uint constant y = 10;
function f(uint[x / y] z) public {
// the input parameter in this function is problematic
}
}
The issue is that array sizes can be specified by a literal or constant expression, and slither seems to fail to initialize arrays via constant expressions (tested with +, *, / )
Stack trace:
ERROR:root:Traceback (most recent call last):
File "c:\users\vyper\documents\github\slither\slither\__main__.py", line 278, in main_impl
(results_tmp, number_contracts_tmp) = process(filename, args, detector_classes, printer_classes)
File "c:\users\vyper\documents\github\slither\slither\__main__.py", line 40, in process
slither = Slither(filename, args.solc, args.disable_solc_warnings, args.solc_args, ast)
File "c:\users\vyper\documents\github\slither\slither\slither.py", line 41, in __init__
self._analyze_contracts()
File "c:\users\vyper\documents\github\slither\slither\solc_parsing\slitherSolc.py", line 210, in _analyze_contracts
self._analyze_third_part(contracts_to_be_analyzed, libraries)
File "c:\users\vyper\documents\github\slither\slither\solc_parsing\slitherSolc.py", line 294, in _analyze_third_part
self._analyze_variables_modifiers_functions(contract)
File "c:\users\vyper\documents\github\slither\slither\solc_parsing\slitherSolc.py", line 329, in _analyze_variables_modifiers_functions
contract.analyze_params_functions()
File "c:\users\vyper\documents\github\slither\slither\solc_parsing\declarations\contract.py", line 348, in analyze_params_functions
self._functions[function.full_name] = function
File "c:\users\vyper\documents\github\slither\slither\core\declarations\function.py", line 358, in full_name
name, parameters, _ = self.signature
File "c:\users\vyper\documents\github\slither\slither\core\declarations\function.py", line 341, in signature
return self.name, [str(x.type) for x in self.parameters], [str(x.type) for x in self.returns]
File "c:\users\vyper\documents\github\slither\slither\core\declarations\function.py", line 341, in <listcomp>
return self.name, [str(x.type) for x in self.parameters], [str(x.type) for x in self.returns]
File "c:\users\vyper\documents\github\slither\slither\core\solidity_types\array_type.py", line 25, in __str__
if isinstance(self._length.value, Variable) and self._length.value.is_constant:
AttributeError: 'BinaryOperation' object has no attribute 'value'
The text was updated successfully, but these errors were encountered:
The following contract will cause slither to throw an error:
The issue is that array sizes can be specified by a literal or constant expression, and slither seems to fail to initialize arrays via constant expressions (tested with
+
,*
,/
)Stack trace:
The text was updated successfully, but these errors were encountered: