-
Notifications
You must be signed in to change notification settings - Fork 987
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, keeps deleting the build-info
folder when slither .
is used
#2446
Comments
build-info
folder when sltiher .
is usedbuild-info
folder when slither .
is used
build-info
folder when slither .
is usedbuild-info
folder when slither .
is used
What version of foundry are you using? Alos, does |
this is my version of foundry: and no
|
I am able to successfully build and analyze this repo (https://github.com/sherlock-audit/2024-04-interest-rate-model) as follows, using forge:
npm i
slither . --foundry-out-directory artifacts/foundry/ --foundry-compile-all It also works if you use hardhat as follows:
npm i
slither . --compile-force-framework hardhat --hardhat-artifacts-directory artifacts/hardhat/ Note 1: if you use the default arguments that skip tests and scripts, foundry for some reason won't build the repo, it will produce zero artifacts, and yet claim all is good and up to date. It can be worked around by using
Note 2: normally, the Hardhat artifacts directory is auto-detected by extracting the config via the hardhat console, but in this case the console unconditionally prints a table every time it's opened, so the autodetection breaks ( |
yeah it doesnt work for me. I build the project and create the build-info files but when i run |
@SquilliamX can you post the log of running the following commands?
|
when i run these commands, these are my outputs:
|
@SquilliamX do you still have foundry configured to write artifacts to |
Describe the issue:
I have a project that uses both foundry and hardhat. Slither throws an error whenever I run it
slither .
I have already upgraded slither with
using python3 -m pip install slither-analyzer -U
When I run
slither .
it throws this error:Now i thought this was because of my foundry.toml which is here:
and I thought the
out = "artifacts/foundry"
line was causing the error, but this is not the case. I changed theout = "artifacts/foundry"
toout = "out"
and then ranforge build
and thenslither .
it still throws an error. Now this error is very weird because when I compile the project withforge build
, it creates the out folder with all the data inside of it. But when i runslither .
right after, it deletes everything in theout
folder and says it is empty! The error this is:I searched the issues in the slither repo and I found that i could run this command in my terminal:
slither . --compile-force-framework hardhat --ignore-compile
However this throws another error. the error this time is
The last line in the error says artifacts/build-info is not a directory, which is true because in my artifacts folder there is two sub folders,
foundry
andhardhat
with data inside of each sub-folder. However when I change my foundry.toml toout = "artifacts"
, I runforge build
and then runslither . --compile-force-framework hardhat --ignore-compile
, it throws another error:Now this is very interesting because after I run
forge build
with myfoundry.toml
without = "artifacts"
it created thebuild-info
folder, but when i runslither . --compile-force-framework hardhat --ignore-compile
, it deletes the entirebuild-info
in myartifacts
folder.Code example to reproduce the issue:
The github repo is here: https://github.com/exactly/protocol
Version:
0.10.2
The text was updated successfully, but these errors were encountered: