crytic / medusa

Parallelized, coverage-guided, mutational Solidity smart contract fuzzing, powered by go-ethereum
https://secure-contracts.com/program-analysis/medusa/docs/src/
GNU Affero General Public License v3.0
303 stars 40 forks source link

contract deployment tx returned a failed status: execution reverted #351

Closed aviggiano closed 7 months ago

aviggiano commented 7 months ago

I am trying to run medusa on a codebase but it is failing with the following error:

[I] ➜ medusa fuzz
⇾ Reading the configuration file at: medusa.json
⇾ Compiling targets with crytic-compile
error Failed to initialize the test chain
‣ contract deployment tx returned a failed status: execution reverted

The same codebase works with Echidna

Unfortunately, it is still private, but I'd like to know if there are any recommendations on how to debug this issue. Is there a verbose/debug mode that I can use to understand why it is failing?

0xicingdeath commented 7 months ago

Have you tried using the coverage report to see what lines of the constructor are failing? I found Medusa's report to be pretty accurate for tracking what lines of the constructor ended up executing or reverting.

0xalpharush commented 7 months ago

Can you try the master branch? It should have better error reporting https://github.com/crytic/medusa/pull/337

aviggiano commented 7 months ago

Thanks for your responses.

The coverage report is not being generated. Here's the updated logs:

[I] ➜ medusa fuzz
⇾ Reading the configuration file at: medusa.json
⇾ Compiling targets with crytic-compile
⇾ Initializing corpus
⇾ Setting up base chain
error Failed to initialize the test chain
{
‣ contract deployment tx returned a failed status: execution reverted
‣ [Execution Trace]
 => [creation] CryticTester.constructor() (addr=0xA647ff3c36cFab592509E13860ab8c4F28781a66, value=300000000000000000000, sender=0x0000000000000000000000000000000000030000)
     => [revert]
aviggiano commented 7 months ago

Hmm actually I think the problem is that I had an old "targetContractsBalances": ["0x1043561a8829300000"] set to 3 ether.

I removed it and it now works.

The new logs did help!

Thank you