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 does not handle non-default Truffle build folders #187

Closed
kliu128 opened this issue Mar 12, 2019 · 3 comments
Closed

Slither does not handle non-default Truffle build folders #187

kliu128 opened this issue Mar 12, 2019 · 3 comments

Comments

@kliu128
Copy link

kliu128 commented Mar 12, 2019

As seen in

if not os.path.isdir(os.path.join(contract, 'build'))\
or not os.path.isdir(os.path.join(contract, 'build', 'contracts')):
logger.info(red('No truffle build directory found, did you run `truffle compile`?'))
sys.exit(-1)
, it hardcodes the default directory for Truffle: build/contracts.

However, this location can actually be customized; see https://truffleframework.com/docs/truffle/reference/configuration#contracts_build_directory.

I may try to submit a PR if I can find time this week.

@montyly
Copy link
Member

montyly commented Mar 14, 2019

That's a good idea, thank you for reporting the limitation!

montyly added a commit that referenced this issue Apr 2, 2019
@montyly montyly closed this as completed in f6bb905 Apr 2, 2019
@montyly
Copy link
Member

montyly commented Apr 2, 2019

Hi @Pneumaticat , I added the option --truffle-build-directory to specify a custom build path.

You can also set the option directly in slither config file, if you don't want to specify the flag at every run. Example of config:

$ cat slither.config.json 
{
    "truffle_build_directory":"custom/build_dir"
}

Note that Slither could parse the information directly from truffle.js, but I used a solution that does not require JS parsing.

This feature will be present in the upcomig 0.6.2 release.

@kliu128
Copy link
Author

kliu128 commented Apr 2, 2019

Awesome! 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

2 participants