I just completed the whole documentation for OpenZeppelin and everything was working fine except the import command.
I created a folder in the folder Contracts and placed Auth.sol in there.
Paths:
[myContract\contracts\Box.sol]
[myContract\contracts\access-control\Auth.sol]
In Box.sol i placed following line right before opening contract Box{}
import "./access-control/Auth.sol";
Then i want to compile with
npx oz compile
and get the following error:
× Compiling contracts with solc 0.7.0 (commit.9e61f22b)
Compilation errors:
contracts\Box.sol:4:1: ParserError: Source "access-control/Auth.sol" not found: File import callback not supported
import "./access-control/Auth.sol";
^-------------------------^
When i try
import "openzeppelin-solidity/contracts/access-control/Auth.sol";
I get:
Could not find openzeppelin-solidity/contracts/access-control/Auth.sol imported from C:\Users\R...\Desktop\dev\myContract\contracts\Box.sol
× Compiling contracts with solc 0.7.0 (commit.9e61f92b)
Compilation errors:
contracts\Box.sol:4:1: ParserError: Source "openzeppelin-solidity/contracts/access-control/Auth.sol" not found: File import callback not supported
import "openzeppelin-solidity/contracts/access-control/Auth.sol";
^-------------------------------------------------------^
I found out i cant even set something like: (which gives me same error)
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
I tried several things like changin to an absoluth path or do it without dot (.) but nothing worked for me. Could anyone help me here? I followed the Docs from A-Z and everything worked except this…