crytic / crytic-compile

Abstraction layer for smart contract build systems
GNU Affero General Public License v3.0
154 stars 83 forks source link

[Bug-Candidate]: Running Slither with `--compile-force-framework hardhat` flag doesn't works while contract compiles with Hardhat #570

Open ds-rgangavasi opened 3 months ago

ds-rgangavasi commented 3 months ago

Describe the issue:

Repo: Steadefi

Code example to reproduce the issue:

Repo: Steadefi

Version:

python --version node --version npm --version yarn --version npx hardhat --version forge --version slither --version

Python 3.11.7
v20.15.1
10.7.0
1.22.22
2.18.2
forge 0.2.0 (fe2acca 2024-07-22T00:20:15.468269927Z)
0.10.3

Relevant log output:

ERROR:Slither:Unable to compile all targets.
elopez commented 3 months ago

Hi, thanks for the report! Can you confirm what happens if you run the following?

slither . --compile-force-framework hardhat
ds-rgangavasi commented 3 months ago

Hi, thanks for the report! Can you confirm what happens if you run the following?

slither . --compile-force-framework hardhat

image

elopez commented 3 months ago

Does crytic-compile . print any different error?

ds-rgangavasi commented 3 months ago

crytic-compile .

crytic-compile --version 0.3.3

elopez commented 3 months ago

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)