-
Notifications
You must be signed in to change notification settings - Fork 979
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
[Bug-Candidate]: Fail to scan in a project that supports both Hardhat and Foundry #2316
Comments
Hi please upgrade to the latest slither version 0.10.0 as the foundry compilation is more robust. Let me know if that doesn't fix the issue |
@0xalpharush it looks like the issue persists in 0.10.0
|
@0xmichalis when both Foundry and Hardhat are present, crytic-compile chooses Foundry as it's usually more robust. You can however override this automatic choice and opt to use Hardhat by using |
^ Using |
We cannot avoid |
Both options should work well together, as long as you run a build with the chosen framework before running Slither. |
@0xmichalis Your comment references hardhat. I tested with the config removed and slither worked. Is there a reason using foundry for building can not be done instead (as is done by default when both frameworks are detected)? EDIT:
|
@0xalpharush I guess you are referencing #2026 (comment) ? We can use |
Can you explain the issue you're experiencing now that it is building? I can run |
Ah sorry about that but the code that requires path filtering is not currently pushed to the repo I have provided in the reproducer for the current issue and this really mixes two different issues, right? |
@0xmichalis @0xalpharush |
Go ahead and describe the issue with path filtering here, please. To answer your question, we would need some way to tell hardhat not to compile files yet still successfully resolve dependencies and compile to perform filtering ahead of analysis. Fwiw, I realize it may be annoying that we force recompilation, but often times the build framework retain outdated references (a file offset that was invalidated by editing the file). |
Ah, yes, this works fine with |
We have a
Cool, that explains why tricks like this are not enough and I would still see a Slither error. |
Closing as seems that we just need to upgrade to the latest version :) Thanks for the prompt responses! |
Describe the issue:
We have a project where we use Hardhat and Foundry in parallel. It seems that when Slither detects a
foundry.toml
file in the project and the Slither config specifies that compilation should be ignored, then if Slither does not find build artifacts produced by Foundry it will fail, although there may be build artifacts by Hardhat. Ideally Slither detects the Hardhat artifacts, or there is a way for us to trigger Slither to look for the Hardhat artifacts.Code example to reproduce the issue:
Version:
0.8.3
Relevant log output:
The text was updated successfully, but these errors were encountered: