Closed hexcowboy closed 3 years ago
I have the same issue as yours!
Could you delete the build folder and try again? It looks like your trying to work with 2 different versions of the folder.
Got the same warning as OP (but no error). Deleting the build folder and re-compiling was successful.
But @PatrickAlphaC can you give more details into what's causing this issue?
@omnifient, basically, you have 2 versions of the same package downloaded in your dependencies, hence the name collision. So deleting the build folder removes the downloaded incorrect dependencies.
I think this would be an improvement to put into brownie.
Closing for now, feel free to follow up.
I am having the same exact problem even after deleting the build
folder. It does not really look exactly the same as yours, however, very similar. The error is as following:
woosal@woosal:/media/woosal/1337/GitHub/blockchain/codes/brownie_fund_me$ brownie compile
Brownie v1.17.1 - Python development framework for Ethereum
Compiling contracts...
Solc version: 0.6.12
Optimizer: Enabled Runs: 200
EVM Version: Istanbul
CompilerError: solc returned the following errors:
contracts/FundMe.sol:5:1: ParserError: Source "@chainlink/contracts/src/v0.6/interfaces/AggregatorV3Interface.sol" not found: File outside of allowed directories.
import "@chainlink/contracts/src/v0.6/interfaces/AggregatorV3Interface.sol";
^--------------------------------------------------------------------------^
contracts/FundMe.sol:6:1: ParserError: Source "@chainlink/contracts/src/v0.6/vendor/SafeMathChainlink.sol" not found: File outside of allowed directories.
import "@chainlink/contracts/src/v0.6/vendor/SafeMathChainlink.sol";
^------------------------------------------------------------------^
My yaml
file is as following:
dotenv: .env
dependencies:
- smartcontractkit/chainlink-brownie-contracts@1.1.1
compiler:
solc:
ramappings:
- '@chainlink=smartcontractkit/chainlink-brownie-contracts@1.1.1'
Odd.
Whats in your ~/.brownie/packages/chainlink
folder?
hi, I've porbably found the sollution to this porblem on Win10 VScode :
hopefully it helps to follow this great tutotial of @PatrickAlphaC
Awesome work :)
And yes, hopefully this will help others!
I encountered the same problem and followed your instruction. It compiled but I received another error.
File "brownie/_cli/__main__.py", line 64, in main
importlib.import_module(f"brownie._cli.{cmd}").main()
File "brownie/_cli/compile.py", line 50, in main
proj = project.load()
File "brownie/project/main.py", line 751, in load
return Project(name, project_path)
File "brownie/project/main.py", line 183, in __init__
self.load()
File "brownie/project/main.py", line 238, in load
self._compile(changed, self._compiler_config, False)
File "brownie/project/main.py", line 95, in _compile
build_json = compiler.compile_and_format(
File "brownie/project/compiler/__init__.py", line 132, in compile_and_format
input_json = generate_input_json(
File "brownie/project/compiler/__init__.py", line 190, in generate_input_json
input_json["settings"]["remappings"] = _get_solc_remappings(remappings)
File "brownie/project/compiler/__init__.py", line 208, in _get_solc_remappings
remap_dict = dict(i.split("=") for i in remappings)
ValueError: dictionary update sequence element #0 has length 1; 2 is required
can anyone help me with this error? thanks
Please post your config
Hi, i have the same issue as everyone here, I just took a look at the chainlink/contracts/src/v0.8/interfaces path and found the AggregatorV3Interface, I just dont understand why the compiler keeps returning "source not found: file outside of allowed directries."
I switched to v0.6 and that worked for me. So try chainlink/contracts/src/v0.6/interfaces. Seems any version past 6 won't compile.
hi, I've porbably found the sollution to this porblem on Win10 VScode :
* 1 create **.vscode** folder and **setting.json** file ... [https://supunkavinda.blog/vscode-editing-settings-json#workspace](url) ![image](https://user-images.githubusercontent.com/15129218/148653324-bbe5c1b2-e9f4-4937-bba6-8211ebc97aaf.png) * 2 in setting just set up correct path to your smartcontractkit importet by brownie due to compile: * { "solidity.remappings": [ "@chainlink/=**C:\Users\XPS 15\**.brownie\packages\smartcontractkit\chainlink-brownie-contracts@1.1.1" ] } .... [https://stackoverflow.com/questions/69306209/imports-for-chainlink-and-openzeppelinn-are-broken](url) ![image](https://user-images.githubusercontent.com/15129218/148653345-2509ed78-c27d-4589-9e46-e81ffa22dc2f.png)
hopefully it helps to follow this great tutotial of @PatrickAlphaC
thanks mate. it worked for me, now it doesnt show error when i compile. but nothing came to build folder. its still empty.
check your brownie-config.yaml file. If not make one.
Getting a
NamespaceCollision
error with the latest release: