Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug-Candidate]: Error when saving corpus for basic truffle project #1046

Closed
samalws-tob opened this issue May 12, 2023 · 5 comments
Closed

Comments

@samalws-tob
Copy link
Collaborator

Describe the issue:

Tried setting up a basic truffle project according to the truffle guides, then placing a basic echidna contract into the contracts folder:
mkdir metacoin; cd metacoin; truffle unbox metacoin; echo "contract Echidna { function echidna_false() public view returns (bool) { return false; } }" >> contracts/Echidna.sol; echidna . --contract Echidna --corpus-dir corpus
Echidna has the following error while saving the corpus:

[2023-05-12 15:30:09.92] Saving test reproducers... Done! (0.000003s)
[2023-05-12 15:30:09.92] Saving corpus... Done! (0.059305s)
echidna: invalid character at offset: 436
CallStack (from HasCallStack):
  error, called at src/EVM/Solidity.hs:524:18 in hevm-0.50.4-6J9JBf5E1KD3EQaWY274vQ:EVM.Solidity

This error message doesn't occur if --corpus-dir corpus is left out.
The corpus dir is created, but the covered. ... .txt file is empty, and no covered. ... .html file is made.
Judging by this issue on crytic-compile, truffle support doesn't seem particularly important and may be dropped anyway.

Code example to reproduce the issue:

mkdir metacoin; cd metacoin; truffle unbox metacoin; echo "contract Echidna { function echidna_false() public view returns (bool) { return false; } }" >> contracts/Echidna.sol; echidna . --contract Echidna --corpus-dir corpus

Version:

$ echidna --version
Echidna 2.1.1
$ slither --version
0.9.2

Relevant log output:

[2023-05-12 15:30:09.92] Saving test reproducers... Done! (0.000003s)
[2023-05-12 15:30:09.92] Saving corpus... Done! (0.059305s)
echidna: invalid character at offset: 436
CallStack (from HasCallStack):
  error, called at src/EVM/Solidity.hs:524:18 in hevm-0.50.4-6J9JBf5E1KD3EQaWY274vQ:EVM.Solidity
@ggrieco-tob
Copy link
Member

The metacoin example requires library linking, that will explain why it fails. It will be nice if you can reproduce this issue with hardhat or foundry so we can take a better look.

@chenrui333
Copy link

@arcz
Copy link
Member

arcz commented Feb 1, 2024

@samalws-tob can you take a look if this is still a problem?

@samalws-tob
Copy link
Collaborator Author

The problem still happens when I run the commands on echidna 2.2.2. This might not be important anymore though, since truffle is being sunset

@ggrieco-tob
Copy link
Member

Let's close this one, truffle is no longer relevant.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants