-
Notifications
You must be signed in to change notification settings - Fork 553
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
Brownie does not generate proper compilation artifacts for interfaces #941
Comments
Hi, is there any update on this issue? It prevents our users from running Slither on brownie's codebases |
Sorry just haven't found the bandwidth to address yet 😬 |
Hi @iamdefinitelyahuman , is there any update on this? |
+1, Waiting for this to resolve for a long time. |
We might need to bounty this bad larry |
Has there been any change to this? |
@iamdefinitelyahuman can we put out a gitcoin grant perhaps? |
+1 |
I know how to solve it, but my solution is fairly bootleg and can be refined. |
Hi,
It looks like the interfaces compilation artifacts generated in
build/interfaces
are not generated with the same compiler call thatbuild/contracts.
So some references ID in the interfaces AST do not match the references frombuild/contracts.
For example, in the AST generated, the
src
field is composed of three elementsstart:length:fileID
. When solc generates the compilation artifactfileID
will be unique per filename. Becausebuild/interfaces
is not generated at the same time thatbuild/contracts
, thefileID
can collide, breaking integration with third-party tools (such as slither)For example, if the codebase has two files:
Running
$ solc contracts/implementation.sol --ast-compact-json --allow-paths .
will lead thesrc
fields in the AST to bex:y:0
forcontracts/implementation.sol
elements andx:y:1
forinterfaces/interface.sol
elements.However, running
brownie compile
will lead all thesrc
to be in the formx:y:0
, making it difficult to distinguish if the source mapscontracts/implementation.sol
orinterfaces/interface.sol
.I am not too familiar with how brownie generates
build/interfaces
, but would it be possible to either:build/contracts
(so both inbuild/contracts
for consistency and inbuild/interfaces
for other usages)build/interfaces
to be generated with the same call to solc that forbuild/contracts
This issue is similar to #772.
The text was updated successfully, but these errors were encountered: