Lesson 12: CompilerError #195
Answered
by
cromewar
toddabraham
asked this question in
Q&A
-
Getting the following error when compiling..... CompilerError: solc returned the following errors:
ParserError: Source "@openzeppelin/contracts/access/Ownable.sol" not found: File outside of allowed directories.
--> contracts/transparent_proxy/ProxyAdmin.sol:6:1:
|
6 | import "@openzeppelin/contracts/access/Ownable.sol";
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ParserError: Source "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol" not found: File outside of allowed directories.
--> contracts/transparent_proxy/TransparentUpgradeableProxy.sol:5:1:
|
5 | import "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol"; Code snippets from ProxyAdmin.sol & TransparentUpgradeableProxy.sol.... // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "./TransparentUpgradeableProxy.sol";
import "@openzeppelin/contracts/access/Ownable.sol"; / SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol"; |
Beta Was this translation helpful? Give feedback.
Answered by
cromewar
Oct 14, 2021
Replies: 1 comment 3 replies
-
Do not forget to set up your dependencies:
- OpenZeppelin/openzeppelin-contracts@3.4.0
compiler:
solc:
remappings:
- '@openzeppelin=OpenZeppelin/openzeppelin-contracts@3.4.0' If no thing works you can always install the npm module for openzeppelin using:
|
Beta Was this translation helpful? Give feedback.
3 replies
Answer selected by
PatrickAlphaC
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Do not forget to set up your
brownie-config.yaml
and set the oppenzepelin replacement for the solc compiler, something like this:If no thing works you can always install the npm module for openzeppelin using:
npm install @openzeppelin/contracts