crytic / crytic-compile

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

ERROR:CryticCompile:Unknown file: @chainlink/contracts/src/v0.8/VRFConsumerBaseV2.sol #380

Open asmitadhungana opened 1 year ago

asmitadhungana commented 1 year ago

Originally posted by @0xalpharush in https://github.com/crytic/crytic-compile/issues/279#issuecomment-1427972499

Hi, I'm getting this error when fuzz-testing one of my contracts with echidna in a monorepo structure that looks like the one in the repo I've linked below to reproduce the error.

I tried to follow various suggestions like utilizing hardhat-dependency-compiler or utilizing solc-remappings within cryticArgs in the echidna-config, to no avail.

You can reproduce the error by following the readme in the following repo: https://github.com/asmitadhungana/echidna-crytic-error-reproduction

MY SETUP: node: v18.12.1 echidna: stable 2.0.5 crytic-compile: stable 0.3.0 solc-select: stable 1.0.3

0xalpharush commented 1 year ago

If you don't mind, would you see if this branch resolves your issue by running pip uinstall crytic-compile && pip install https://github.com/crytic/crytic-compile/archive/normalize-abs-paths.zip and trying Echidna again?

asmitadhungana commented 1 year ago

Thanks. I did that, seems like I hadn't installed crytic-compile using pip before. But now, I'm getting a new error:

Warning: unused option: corupsDir
Warning: unused option: intialize
Analyzing contract: /echidna-crytic-compile-error/contracts/contracts/crytic/e2e-fuzz/EchidnaE2E.sol:EchdinaE2E
echidna-test: Error running slither:

Btw, why are the corpusDir and initialize not being used? My echidna-config.yaml looks like this for reference:

corupsDir: 'corpus'
intialize: 'contracts/crytic/init.json'
testMode: assertion
testLimit: 10000
shrinkLimit: 500 # how many times to iterate over/shrink the code/input if echidna found a failure
testMaxGas: 1000000000000
timeout: 3600 # 1 hour
codeSize: 0xfffffffffffff #maximize code size
# sender: []
filterFunctions: []
estimateGas: true
# provide solc remappings to crytic-compile
cryticArgs: ['--solc-remaps', '@openzeppelin/=$(pwd)/node_modules/@openzeppelin/']
cryticArgs: ['--solc-remaps', '@chainlink/=$(pwd)/node_modules/@chainlink/']