1

i'm following Patrick Collins tutorial to create NFTs and here is my problem:

i'm trying to import this:

pragma solidity 0.6.6;

import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@chainlink/contracts/src/v0.6/VRFConsumerBase.sol";

My brownie config is this :

dependencies:
  - OpenZeppelin/openzeppelin-contracts@3.4.0
  - smartcontractkit/chainlink-brownie-contracts@1.0.2

compiler:   
  solc:
    remappings:
      - ‘@openzeppelin=OpenZeppelin/openzeppelin-contracts@3.4.0’
      - ‘@chainlink=smartcontractkit/chainlink-brownie-contracts@1.0.2’

dotenv: .env

my .env is this

export PRIVATE_KEY=Here i've put my private Key
export WEB3_INFURA_PROJECT_ID=  Here i've put my infura project ID

and i've intalled chainlink and openzeppelin with pip

my error is this :

ParserError: Source "@openzeppelin/contracts/token/ERC721/ERC721.sol" not found: File outside of allowed directories.
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
^-------------------------------------------------------^

Thank you for your help :)

  • Dealing with the same issue here. It looks like no folder structure other than a flat folder is recognized by the compiler. I have to os.chdir to even compile a simple contract with no imports. – Jake OPJ Mar 17 '22 at 16:14

1 Answers1

0

Please install openzeppiln with below command -

npm install @openzeppelin/contracts

Now change the import statement to -

import "./node_modules/@openzeppelin/contracts/token/ERC721/ERC721.sol"; 
dhanesh24g
  • 344
  • 1
  • 6