-
Notifications
You must be signed in to change notification settings - Fork 377
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
Support for Solidity libraries that require deployment is limited #651
Comments
@anishnaik should we discuss something here, according to your latest research? |
tldr; I will be pushing up a few fixes to CC that should aid in this endeavor. At the end of the day, the library linking process in echidna will be "best effort" and it is hard to guarantee a 100% success rate. Longer response:
From echidna's perspective, it will just have to deploy all libraries first, cache the addresses of the deployed libraries, and update the init bytecode for any contract that relies on a deployed library using the cached addresses + the |
bumping this. is it still considered "wont fix" ? |
Actually no, there is documentation on a workaround here |
Oh, good to know. I just tried that method: echidna.yml:
Getting either with foundry:
or truffle:
|
Which crytic-compile version are you using? |
|
Can you try manually executing crytic-compile with the command line: |
|
I extracted these from the above output (I used --print-libraries of crytic-compile)
|
It seems like an issue in crytic-compile, right? There should be no unlinked libraries, assuming you list them all. |
I don't know what's the expected behavior from crytic-compile though. I can do a small repo real quick |
|
Indeed, for a small example |
Did I hit some limitation? |
Feel free to try to reproduce here, I am calling a day. https://github.com/superfluid-finance/protocol-monorepo/tree/gda-slither
|
Should I create a bug report to crytic-compile? |
Yes, please, create a crytic-compile report and link it here. |
@hellwolf The issue is that the addresses provided e.g. |
Thanks for the fast response. And I see. I haven't done deeper investigation, but I haven't found any sign that there is any "canonical" way of defining library holes. You may say defacto standard is from foundry for now, but truffle do differ; I haven't tried hardhat neither. I would be in favor of not "pretending" there is a "canonical" format in absence of any evident of that. |
@hellwolf Is the workaround of using values smaller than 0xff working for you? |
@ggrieco-tob I am not sure if it would still be a problem any more since crytic/crytic-compile#477 had been merged. |
We have some documentation for a workaround, let's close it |
Solidity allows to define libraries. If the libraries contain only internal functions, Echidna will work fine. If the library contains external functions, our tool only support linking libraries when
solc
is using directly using thesolcLibs
argument. In any other case, the result can be unexpected (e.g. if the contract is linked during by a third-party framework).The text was updated successfully, but these errors were encountered: