Open ds-rgangavasi opened 3 months ago
Hi, thanks for the report! Can you confirm what happens if you run the following?
slither . --compile-force-framework hardhat
Hi, thanks for the report! Can you confirm what happens if you run the following?
slither . --compile-force-framework hardhat
ERROR:Slither:Unable to compile all targets.
Does crytic-compile .
print any different error?
crytic-compile .
crytic-compile . --compile-force-framework hardhat
gives following error:
ERROR:CryticCompile:Unknown file: forge-std/console.sol
crytic-compile --version 0.3.3
I had a look locally, the paths generated on the Hardhat artifacts seem to be a bit odd, in particular the ones for forge-std/console.sol. You can work around the issue meanwhile by running the following from the repo root ln -s ../lib/forge-std/src node_modules/forge-std
(or by using Foundry, which you noted works fine)
Describe the issue:
Repo: Steadefi
The repository includes two framework files: Hardhat and Foundry.
Goal: My goal is to always compile such repositories using Hardhat and provide the artifacts to Slither, making it mandatory for slither to use Hardhat artifacts exclusively.
Where I need Help?: When running slither with
--compile-force-framework hardhat
slither runs into error, but with default Foundry (no flag provided) works flawlessly. I need to run it using HH artifacts.The project compiles with hardhat:
npx hardhat compile --force
. |forge build
also works.Used tool: Slither
command try 1:
slither . --ignore-compile --filter-paths \.t\.sol$,\.s\.sol$ --compile-force-framework hardhat
| fails with error:ERROR:Slither:Unable to compile all targets.
command try 2:
slither . --filter-paths \.t\.sol$,\.s\.sol$ --compile-force-framework hardhat
| fails with error:ERROR:Slither:Unable to compile all targets.
command try 3:
slither . --filter-paths \.t\.sol$,\.s\.sol$
| works with foundry as default.command try 4:
slither . --filter-paths \.t\.sol$,\.s\.sol$ --compile-force-framework hardhat --exclude-dependencies
| fails with error:ERROR:Slither:Unable to compile all targets.
command try 5:
slither . --filter-paths \.t\.sol$,\.s\.sol$ --hardhat-artifacts-directory ./artifacts --exclude-dependencies --ignore-compile
| fails with error:ERROR:Slither:Unable to compile all targets.
Code example to reproduce the issue:
Repo: Steadefi
Version:
python --version node --version npm --version yarn --version npx hardhat --version forge --version slither --version
Relevant log output: