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:CryticCompile:Invalid solc compilation Error: Identifier not found or not unique. #17

Closed
rappie opened this issue Jul 23, 2023 · 2 comments

Comments

@rappie
Copy link
Contributor

rappie commented Jul 23, 2023

Describe the issue:

Running diffusc on 2 onchain implementation contracts on BSC

Code example to reproduce the issue:

diffusc 0x8990Ca8fFCBa28541C8825aC74fb77F3ad5972f5 0xa778088a07669EBFE5d3c5BAb357E526D39142C5 -V 0.8.17 -r -R https://bsc-dataseed1.binance.org/ -n bsc

Version:

❯ diffusc --version
0.1.0

Relevant log output:

Switched global version to 0.8.17
* Calling echidna from ./ using echidna DiffFuzzUpgrades.sol --config CryticConfig.yaml --contract DiffFuzzUpgrades --format json --workers 1

echidna: Couldn't compile given file
stdout:
stderr:
INFO:CryticCompile:'solc --version' running
INFO:CryticCompile:'solc DiffFuzzUpgrades.sol --combined-json abi,ast,bin,bin-runtime,srcmap,srcmap-runtime,userdoc,devdoc,hashes --allow-paths .,/home/rappie/Desktop/repos/diffusc' running
ERROR:CryticCompile:Invalid solc compilation Error: Identifier not found or not unique.
--> DiffFuzzUpgrades.sol:37:9:
|
37 |         Fee fees;
|         ^^^
@webthethird
Copy link
Collaborator

webthethird commented Jul 27, 2023

Hmm, I am not getting the same result when I try to reproduce this on my end.

* Calling echidna from ./ using echidna DiffFuzzUpgrades.sol --config CryticConfig.yaml --contract DiffFuzzUpgrades --format json --workers 1
Loaded 32 transaction sequences from corpus/reproducers
Loaded 10 transaction sequences from corpus/coverage
[2023-07-26 20:55:13.83] [Worker 0] New coverage: 43 instr, 1 contracts, 1 seqs in corpus

I suspect the issue is that my fork of Slither, which gets installed when you install Diffusc, does a bit more complex handling of structs in the code generation util, which is responsible for generating interfaces. You've probably got the latest release of Slither installed, which does have the interface code generation but doesn't go out of its way to include all structs referenced in the contract's function signatures.

For a short term solution you could reinstall Diffusc, which will reinstall the necessary version of Slither. Alternatively, you could manually add the missing Fee struct to the interfaces and run Echidna on the fixed wrapper contract outside of run mode. For a more permanent solution, I'll need to get the more advanced interface generation code merged into Slither's next release, which could take some time.

@rappie
Copy link
Contributor Author

rappie commented Jul 27, 2023

I've reinstalled diffusc and it's working now. Thanks! 😄

@rappie rappie closed this as completed Jul 27, 2023
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