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]: If deployContracts is used, the generated test probably won't work #48

Open
glarregay-tob opened this issue Apr 19, 2024 · 3 comments

Comments

@glarregay-tob
Copy link
Contributor

glarregay-tob commented Apr 19, 2024

Describe the issue:

Echidna allows contracts to be deployed to specific addresses using the deployContracts configuration option. However, when the tests are generated, only the harness is constructed and the other contracts are not deployed.

Not sure if this is an easy fix, just leaving it here for reference.

Code example to reproduce the issue:

Not an exact reproducer, but a general idea.

In echidna config file:

deployContracts:  [["0x12345", "ExampleContract"]]

In the echidna test contract:

constructor() {
    ExampleContract ec = ExampleContract(0x12345);
    uint256 value1 = ec.doSomething();
    assert(value1 == 123);
}

Version:

0.2.0

Relevant log output:

No response

@ggrieco-tob
Copy link
Member

Are you saying that the constructor will revert during the external call? 🤔

@glarregay-tob
Copy link
Contributor Author

Not necessarily. I fixed the example. Anyway, as I said, it's just a general idea and not a proper reproducer. I'm working on private code.

@montyly
Copy link
Member

montyly commented Apr 22, 2024

We should be able to leverage deployCodeTo here https://book.getfoundry.sh/reference/forge-std/deployCodeTo#deploycodeto

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

3 participants