crytic / crytic/fuzz-utils

[Bug-Candidate]: Parsing error when using Medusa corpus

Open
#28 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Solidity
Stars
115
Forks
6
PR merge metrics
No merged PRs in 30d

Description

### Describe the issue:

I'm getting the following parsing error when trying to run the tool on a corpus from a Medusa run

![image](https://github.com/crytic/fuzz-utils/assets/94120714/f992bc19-d50c-4bd9-9814-b4a033378ed0)

and the Foundry test it creates just contains the setup function for the target contract

![image](https://github.com/crytic/fuzz-utils/assets/94120714/b5bc9713-d0a3-47a9-af2f-2031a958c393)

When using an Echidna corpus it gives no parsing error but creates the same Foundry test

image

I'm unsure of whether this is due to a misconfiguration on my part or an actual bug in the tool.

### Code example to reproduce the issue:

This repo is the one on which the issue appeared, it uses the default Foundry template and the only thing that's been added is an invariant in the `FuzzCounter` contract: https://github.com/nican0r/fuzz-utils-repro

The `FuzzCounter` contract also includes the commands I used for running the tool along with the command I used for running Echidna. Please lmk if there's anything else I can add that might help.

### Version:

0.0.1

### Relevant log output:

```shell
Generating Foundry unit tests based on the Medusa reproducers...
Parsing fail on [{'call': {'from': '0x0000000000000000000000000000000000030000', 'to': '0xa647ff3c36cfab592509e13860ab8c4f28781a66', 'nonce': 1, 'value': '0x0', 'gasLimit': 12500000, 'gasPrice': '0x1', 'gasFeeCap': '0x0', 'gasTipCap': '0x0', 'data': '0x3fb5c1cb0000000000000000000000000000000000000000000000000000000000000000', 'dataAbiValues': {'methodSignature': 'setNumber(uint256)', 'inputValues': ['0']}, 'AccessList': None, 'SkipAccountChecks': False}, 'blockNumberDelay': 30636, 'blockTimestampDelay': 98207}]: index: 0
Parsing fail on [{'call': {'from': '0x0000000000000000000000000000000000010000', 'to': '0xa647ff3c36cfab592509e13860ab8c4f28781a66', 'nonce': 0, 'value': '0x0', 'gasLimit': 12500000, 'gasPrice': '0x1', 'gasFeeCap': '0x0', 'gasTipCap': '0x0', 'data': '0x3fb5c1cb0000000000000000000000000000000000000000000000000000000000000000', 'dataAbiValues': {'methodSignature': 'setNumber(uint256)', 'inputValues': ['0']}, 'AccessList': None, 'SkipAccountChecks': False}, 'blockNumberDelay': 4563, 'blockTimestampDelay': 45901}]: index: 1
Parsing fail on [{'call': {'from': '0x0000000000000000000000000000000000030000', 'to': '0xa647ff3c36cfab592509e13860ab8c4f28781a66', 'nonce': 1, 'value': '0x0', 'gasLimit': 12500000, 'gasPrice': '0x1', 'gasFeeCap': '0x0', 'gasTipCap': '0x0', 'data': '0x3fb5c1cb0000000000000000000000000000000000000000000000000000000000000000', 'dataAbiValues': {'methodSignature': 'setNumber(uint256)', 'inputValues': ['0']}, 'AccessList': None, 'SkipAccountChecks': False}, 'blockNumberDelay': 40210, 'blockTimestampDelay': 360624}]: index: 2
Parsing fail on [{'call': {'from': '0x0000000000000000000000000000000000020000', 'to': '0xa647ff3c36cfab592509e13860ab8c4f28781a66', 'nonce': 0, 'value': '0x0', 'gasLimit': 12500000, 'gasPrice': '0x1', 'gasFeeCap': '0x0', 'gasTipCap': '0x0', 'data': '0x3fb5c1cb0000000000000000000000000000000000000000000000000000000000000000', 'dataAbiValues': {'methodSignature': 'setNumber(uint256)', 'inputValues': ['0']}, 'AccessList': None, 'SkipAccountChecks': False}, 'blockNumberDelay': 23883, 'blockTimestampDelay': 157607}]: index: 3
Parsing fail on [{'call': {'from': '0x0000000000000000000000000000000000020000', 'to': '0xa647ff3c36cfab592509e13860ab8c4f28781a66', 'nonce': 0, 'value': '0x0', 'gasLimit': 12500000, 'gasPrice': '0x1', 'gasFeeCap': '0x0', 'gasTipCap': '0x0', 'data': '0x3fb5c1cb0000000000000000000000000000000000000000000000000000000000000000', 'dataAbiValues': {'methodSignature': 'setNumber(uint256)', 'inputValues': ['0']}, 'AccessList': None, 'SkipAccountChecks': False}, 'blockNumberDelay': 1, 'blockTimestampDelay': 56038}]: index: 4
Parsing fail on [{'call': {'from': '0x0000000000000000000000000000000000010000', 'to': '0xa647ff3c36cfab592509e13860ab8c4f28781a66', 'nonce': 0, 'value': '0x0', 'gasLimit': 12500000, 'gasPrice': '0x1', 'gasFeeCap': '0x0', 'gasTipCap': '0x0', 'data': '0x3fb5c1cb0000000000000000000000000000000000000000000000000000000000000000', 'dataAbiValues': {'methodSignature': 'setNumber(uint256)', 'inputValues': ['0']}, 'AccessList': None, 'SkipAccountChecks': False}, 'blockNumberDelay': 0, 'blockTimestampDelay': 267796}]: index: 5
Parsing fail on [{'call': {'from': '0x0000000000000000000000000000000000030000', 'to': '0xa647ff3c36cfab592509e13860ab8c4f28781a66', 'nonce': 1, 'value': '0x0', 'gasLimit': 12500000, 'gasPrice': '0x1', 'gasFeeCap': '0x0', 'gasTipCap': '0x0', 'data': '0x3fb5c1cb0000000000000000000000000000000000000000000000000000000000000000', 'dataAbiValues': {'methodSignature': 'setNumber(uint256)', 'inputValues': ['0']}, 'AccessList': None, 'SkipAccountChecks': False}, 'blockNumberDelay': 0, 'blockTimestampDelay': 2}]: index: 6
Parsing fail on [{'call': {'from': '0x0000000000000000000000000000000000010000', 'to': '0xa647ff3c36cfab592509e13860ab8c4f28781a66', 'nonce': 0, 'value': '0x0', 'gasLimit': 12500000, 'gasPrice': '0x1', 'gasFeeCap': '0x0', 'gasTipCap': '0x0', 'data': '0x3fb5c1cb0000000000000000000000000000000000000000000000000000000000000000', 'dataAbiValues': {'methodSignature': 'setNumber(uint256)', 'inputValues': ['0']}, 'AccessList': None, 'SkipAccountChecks': False}, 'blockNumberDelay': 0, 'blockTimestampDelay': 415822}]: index: 7
Parsing fail on [{'call': {'from': '0x0000000000000000000000000000000000030000', 'to': '0xa647ff3c36cfab592509e13860ab8c4f28781a66', 'nonce': 1, 'value': '0x0', 'gasLimit': 12500000, 'gasPrice': '0x1', 'gasFeeCap': '0x0', 'gasTipCap': '0x0', 'data': '0x3fb5c1cb0000000000000000000000000000000000000000000000000000000000000000', 'dataAbiValues': {'methodSignature': 'setNumber(uint256)', 'inputValues': ['0']}, 'AccessList': None, 'SkipAccountChecks': False}, 'blockNumberDelay': 8467, 'blockTimestampDelay': 15389}]: index: 8
Parsing fail on [{'call': {'from': '0x0000000000000000000000000000000000010000', 'to': '0xa647ff3c36cfab592509e13860ab8c4f28781a66', 'nonce': 0, 'value': '0x0', 'gasLimit': 12500000, 'gasPrice': '0x1', 'gasFeeCap': '0x0', 'gasTipCap': '0x0', 'data': '0x3fb5c1cb0000000000000000000000000000000000000000000000000000000000000000', 'dataAbiValues': {'methodSignature': 'setNumber(uint256)', 'inputValues': ['0']}, 'AccessList': None, 'SkipAccountChecks': False}, 'blockNumberDelay': 18801, 'blockTimestampDelay': 413907}]: index: 9
Generated a test file in ./test/FuzzCounter_Medusa_Test.t.sol
Done!
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.