crytic / crytic/slither

[Bug-Candidate]: Slither enable to run with echidna

Open
#2,769 2 comments 0 reactions 0 assignees View on GitHub
bug-candidate
Dominant language
Python
Stars
6.4k
Forks
1.1k
PR merge metrics
No merged PRs in 30d

Description

### Describe the issue:

I am trying to use echidna but Slither always fail.

I tried to run `slither .` it works but when I run `slither . --print echidna` it failed to.

### Code example to reproduce the issue:

I cannot share the code the command used is `slither . --print echidna` the command fail whatever I use `--foundry-compile-all` or not

### Version:

0.11.3

### Relevant log output:

```shell
Traceback (most recent call last):
File "/opt/homebrew/bin/slither", line 8, in
sys.exit(main())
~~~~^^
File "/opt/homebrew/Cellar/slither-analyzer/0.11.3_3/libexec/lib/python3.13/site-packages/slither/__main__.py", line 776, in main
main_impl(all_detector_classes=detectors, all_printer_classes=printers)
~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/Cellar/slither-analyzer/0.11.3_3/libexec/lib/python3.13/site-packages/slither/__main__.py", line 882, in main_impl
) = process_all(filename, args, detector_classes, printer_classes)
~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/Cellar/slither-analyzer/0.11.3_3/libexec/lib/python3.13/site-packages/slither/__main__.py", line 107, in process_all
) = process_single(compilation, args, detector_classes, printer_classes)
~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/Cellar/slither-analyzer/0.11.3_3/libexec/lib/python3.13/site-packages/slither/__main__.py", line 87, in process_single
return _process(slither, detector_classes, printer_classes)
File "/opt/homebrew/Cellar/slither-analyzer/0.11.3_3/libexec/lib/python3.13/site-packages/slither/__main__.py", line 143, in _process
printer_results = slither.run_printers()
File "/opt/homebrew/Cellar/slither-analyzer/0.11.3_3/libexec/lib/python3.13/site-packages/slither/slither.py", line 302, in run_printers
return [p.output(self._crytic_compile.target).data for p in self._printers]
~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/Cellar/slither-analyzer/0.11.3_3/libexec/lib/python3.13/site-packages/slither/printers/guidance/echidna.py", line 454, in output
(cst_used, cst_used_in_binary) = _extract_constants(contracts)
~~~~~~~~~~~~~~~~~~^^^^^^^^^^^
File "/opt/homebrew/Cellar/slither-analyzer/0.11.3_3/libexec/lib/python3.13/site-packages/slither/printers/guidance/echidna.py", line 285, in _extract_constants
_extract_constants_from_irs(
~~~~~~~~~~~~~~~~~~~~~~~~~~~^
function.all_slithir_operations(),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
...<2 lines>...
context_explored,
^^^^^^^^^^^^^^^^^
)
^
File "/opt/homebrew/Cellar/slither-analyzer/0.11.3_3/libexec/lib/python3.13/site-packages/slither/printers/guidance/echidna.py", line 266, in _extract_constants_from_irs
_extract_constant_from_read(
~~~~~~~~~~~~~~~~~~~~~~~~~~~^
ir, r, all_cst_used, all_cst_used_in_binary, context_explored
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
)
^
File "/opt/homebrew/Cellar/slither-analyzer/0.11.3_3/libexec/lib/python3.13/site-packages/slither/printers/guidance/echidna.py", line 199, in _extract_constant_from_read
value = ConstantFolding(var_read.expression, value_type).result()
~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/Cellar/slither-analyzer/0.11.3_3/libexec/lib/python3.13/site-packages/slither/visitors/expression/constants_folding.py", line 60, in __init__
super().__init__(expression)
~~~~~~~~~~~~~~~~^^^^^^^^^^^^
File "/opt/homebrew/Cellar/slither-analyzer/0.11.3_3/libexec/lib/python3.13/site-packages/slither/visitors/expression/expression.py", line 59, in __init__
self._visit_expression(self.expression)
~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
File "/opt/homebrew/Cellar/slither-analyzer/0.11.3_3/libexec/lib/python3.13/site-packages/slither/visitors/expression/expression.py", line 78, in _visit_expression
self._post_visit(expression)
~~~~~~~~~~~~~~~~^^^^^^^^^^^^
File "/opt/homebrew/Cellar/slither-analyzer/0.11.3_3/libexec/lib/python3.13/site-packages/slither/visitors/expression/expression.py", line 291, in _post_visit
self._post_type_conversion(expression)
~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^
File "/opt/homebrew/Cellar/slither-analyzer/0.11.3_3/libexec/lib/python3.13/site-packages/slither/visitors/expression/constants_folding.py", line 446, in _post_type_conversion
value = convert_string_to_fraction(expr.converted_value)
File "/opt/homebrew/Cellar/slither-analyzer/0.11.3_3/libexec/lib/python3.13/site-packages/slither/utils/integer_conversion.py", line 20, in convert_string_to_fraction
base, expo = Fraction(base), int(expo)
~~~~~~~~^^^^^^
File "/opt/homebrew/Cellar/python@3.13/3.13.5/Frameworks/Python.framework/Versions/3.13/lib/python3.13/fractions.py", line 256, in __new__
raise ValueError('Invalid literal for Fraction: %r' %
numerator)
ValueError: Invalid literal for Fraction: 'fail'
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.