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

Add support for executing truffle locally #106

Merged
merged 1 commit into from
Dec 13, 2018

Conversation

mattaereal
Copy link
Contributor

Adds support to be able to run truffle compile without having to install it globally.

Closes #105

Truffle being used by default:

matt@delleite:contracts/ (master*) $ slither .                                                                                                                [18:11:18]
INFO:Slither:truffle compile running...
ERROR:root:Error in .
ERROR:root:Traceback (most recent call last):
  File "/usr/lib/python3.7/site-packages/slither_analyzer-0.3.1-py3.7.egg/slither/__main__.py", line 229, in main_impl
    (results, number_contracts) = process_truffle(filename, args, detector_classes, printer_classes)
  File "/usr/lib/python3.7/site-packages/slither_analyzer-0.3.1-py3.7.egg/slither/__main__.py", line 64, in process_truffle
    process = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
  File "/usr/lib/python3.7/subprocess.py", line 769, in __init__
    restore_signals, start_new_session)
  File "/usr/lib/python3.7/subprocess.py", line 1516, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'truffle': 'truffle'

With truffle locally (--truffle-local):

matt@delleite:contracts/ (master*) $ slither . --truffle-local                                                                                                [18:11:57]
INFO:Slither:truffle compile running...                                                                                                                                         
INFO:Slither:                                                                                                                                                                   
INFO:Detectors: 
....
INFO:Slither:. analyzed (10 contracts), 48 result(s) found

@CLAassistant
Copy link

CLAassistant commented Dec 11, 2018

CLA assistant check
All committers have signed the CLA.

@montyly
Copy link
Member

montyly commented Dec 12, 2018

Thanks @mattaereal for your contribution!

Could you sign the CLA?

Is there any potential issue to always run npx truffle? We can simply set it as the default command

@mattaereal
Copy link
Contributor Author

Signed, and not that I'm aware of. But it will prioritize the local installation over the global one, if that's what you want.

A good brief comparison.

@montyly montyly merged commit 514b94b into crytic:master Dec 13, 2018
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

Successfully merging this pull request may close these issues.

3 participants