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]: Contract is "unknown contract" but should be able to be identified #1259

Open
0xalpharush opened this issue May 17, 2024 · 2 comments

Comments

@0xalpharush
Copy link

0xalpharush commented May 17, 2024

Describe the issue:

Running echidna allContract.sol --test-mode assertion --contract T fails to identify the other contract despite the source being available.

As an aside, I think it is confusing that running echidna allContract.sol --test-mode assertion does not tell you which contract is selected as the target. It's a source of ambiguity/error that could be clarified (it seems to always pick O)

Code example to reproduce the issue:

contract T {
function t() public {
O o = new O();
o.o();
assert(true);
}
}

contract O {
function o() public {
assert(false);
}
}

Version:

2.2.3

Relevant log output:

[2024-05-17 12:18:14.47] Compiling allContract.sol... Done! (0.443455s)
Analyzing contract: /Users/alpharush/allContract.sol:T
[2024-05-17 12:18:14.92] Running slither on allContract.sol... Done! (0.471598s)
t(): failed!💥  
  Call sequence:
    T.t()

Traces: 
create <unknown contract>@0xb4c79daB8f259C7Aee6E5b2Aa729821864227e84 (/Users/alpharush/allContract.sol:3)
 └╴← 161 bytes of code
call 0xb4c79daB8f259C7Aee6E5b2Aa729821864227e84::o() (/Users/alpharush/allContract.sol:4)
 └╴error Revert Panic(1) (/Users/alpharush/allContract.sol:11)

AssertionFailed(..): passing


Unique instructions: 157
Unique codehashes: 2
Corpus size: 2
Seed: 4473559282936699324
@ggrieco-tob
Copy link
Member

The unknown contract is an issue in hevm traces, can you open an issue in their tracker?

@ggrieco-tob
Copy link
Member

Actually, it says:

Analyzing contract: /Users/alpharush/allContract.sol:T

but the language is confusing, it should be "Targeting contract". It also specifies which is the target in the call sequence (e.g. T.t()) as well as the relevant source lines in the trace. What is failing is the identification of the naming of the contract in the create of the trace.

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

2 participants