Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Slither failing to compile #464

Closed
jpthor opened this issue Apr 26, 2020 · 3 comments
Closed

Slither failing to compile #464

jpthor opened this issue Apr 26, 2020 · 3 comments

Comments

@jpthor
Copy link

jpthor commented Apr 26, 2020

Machine: macOS Mojave && macOS Catalina
Python: 3.8 && 3.7
Attempted re-installs of both Python3 and Pip3
Verified install of cryptic-compile: 01.8
Slither: 0.6.12
Error reproduced on calling both slither . and slither <file.sol>

ERROR:root:Error in .
ERROR:root:Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/crytic_compile-0.1.8-py3.8.egg/crytic_compile/platform/solc.py", line 242, in get_version
    process = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/subprocess.py", line 854, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/subprocess.py", line 1702, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'solc'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/slither_analyzer-0.6.12-py3.8.egg/slither/__main__.py", line 604, in main_impl
    (slither_instances, results_detectors, results_printers, number_contracts) = process_all(filename, args,
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/slither_analyzer-0.6.12-py3.8.egg/slither/__main__.py", line 61, in process_all
    compilations = compile_all(target, **vars(args))
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/crytic_compile-0.1.8-py3.8.egg/crytic_compile/crytic_compile.py", line 1034, in compile_all
    compilations.append(CryticCompile(filename, **kwargs))
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/crytic_compile-0.1.8-py3.8.egg/crytic_compile/crytic_compile.py", line 119, in __init__
    self._compile(**kwargs)
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/crytic_compile-0.1.8-py3.8.egg/crytic_compile/crytic_compile.py", line 924, in _compile
    self._platform.compile(self, **kwargs)
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/crytic_compile-0.1.8-py3.8.egg/crytic_compile/platform/solc.py", line 106, in compile
    compiler="solc", version=get_version(solc), optimized=is_optimized(solc_arguments)
  File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/crytic_compile-0.1.8-py3.8.egg/crytic_compile/platform/solc.py", line 244, in get_version
    raise InvalidCompilation(error)
crytic_compile.platform.exceptions.InvalidCompilation: [Errno 2] No such file or directory: 'solc'
@jpthor
Copy link
Author

jpthor commented Apr 27, 2020

I have a feeling now it might be to do with py-solc or something along those lines. Will go debug that, but it should be installed as a dependency?

@montyly
Copy link
Member

montyly commented Apr 27, 2020

Hi @jpthor.

Slither uses solc (or any compiler framework, such as Truffle) to compile the contracts. If you don't have solc installed, I would recommend to use solc-select, it allows to quickly switch between solc version.

@nazariyv
Copy link

solc-select worked perfectly for me. Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants