fuzzland / ityfuzz

Blazing Fast Bytecode-Level Hybrid Fuzzer for Smart Contracts
https://docs.ityfuzz.rs
MIT License
735 stars 116 forks source link

Pranker.sol not found #462

Closed qianqianpang closed 3 months ago

qianqianpang commented 3 months ago

Hello, I'm experiencing an issue with ityfuzz.

When testing the CounterTest contract located at tests/evm_manual/foundry1/test/Counter.t.sol, I encountered the error "ParserError: Source './Pranker.sol' not found: File not found." It seems that the file Pranker.sol is missing from the project.

Could you please provide it to me? Thank you very much for your assistance!

jacob-chia commented 3 months ago

Please try the following steps:

  1. Make sure foundry is installed: https://book.getfoundry.sh/getting-started/installation
  2. cd tests/evm_manual/foundry1
  3. cargo run evm -m CounterTest -- forge build. The -- forge build indicates the use of forge build to compile solidity files before running ityfuzz.
qianqianpang commented 3 months ago

@jacob-chia Could you please clarify the difference between these two commands? I often see them in issues, but I'm a bit confused: 1)cargo run evm -m CounterTest and -- forge test 2)ityfuzz evm -m Counter.t.sol:CounterTest -- forge test

jacob-chia commented 3 months ago
  1. cargo run = cargo build & ./target/debug/ityfuzz.
  2. "CounterTest" is the name of the test contract. -m CounterTest will match CounterTest in all files in the current directory, while -m Counter.t.sol:CounterTest will only match in the Counter.t.sol file.
  3. -- forge test is the build command。Both forge build and forge test will build, but forge test not only builds but also tests afterwards, which is redundant. Moreover, some test cases can only be executed through ityfuzz, and forge test would fail. Therefore, -- forge build is the correct build command.
qianqianpang commented 3 months ago

thank you very much!