We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
ganache-cli
solc
There seems to be an issue with how contracts are loaded into the project.
When run on a clean directory (no build), imported contracts are loaded into the project's namespace.
When run a second time when the contracts were already built, only project contracts are loaded into the namespace.
It can be consistently reproduced:
brownie init reproducer cd reproducer
contracts/HelloWorld.sol
pragma solidity ^0.8.0; import {ERC1967Proxy} from "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol"; contract HelloWorld { string public message; constructor(string memory initMessage) { message = initMessage; } }
compiler: solc: remappings: - "@openzeppelin=node_modules/@openzeppelin"
npm i @openzeppelin/contracts
brownie run scripts/reproducer.py
import brownie def main(): try: getattr(brownie.project.ReproducerProject, "ERC1967Proxy") print("GOOD") except AttributeError: print(f"BAD {dir(brownie.project.ReproducerProject)}")
It should print "GOOD". Run it again: brownie run scripts/reproducer.py and it should print "BAD" followed by the listing of project attributes.
Remove the build directory and run again, it prints "GOOD"
build
I've been looking at the code but am not sure how to fix it. The problem seems to have been introduced by #1411
Up until then, because all the contracts were always compiled all imported contracts were also loaded into the project.
If someone can point me in the right direction I may be able to provide a working patch.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Environment information
brownie
Version: v1.19.0ganache-cli
Version: v7.3.2solc
Version: 0.8.6What was wrong?
There seems to be an issue with how contracts are loaded into the project.
When run on a clean directory (no build), imported contracts are loaded into the project's namespace.
When run a second time when the contracts were already built, only project contracts are loaded into the namespace.
It can be consistently reproduced:
brownie init reproducer cd reproducer
contracts/HelloWorld.sol
:brownie run scripts/reproducer.py
:It should print "GOOD". Run it again:
brownie run scripts/reproducer.py
and it should print "BAD" followed by the listing of project attributes.Remove the
build
directory and run again, it prints "GOOD"How can it be fixed?
I've been looking at the code but am not sure how to fix it. The problem seems to have been introduced by #1411
Up until then, because all the contracts were always compiled all imported contracts were also loaded into the project.
If someone can point me in the right direction I may be able to provide a working patch.
The text was updated successfully, but these errors were encountered: