Docker solidity file outside of allowed directories

84 views Asked by At

I am compiling my smart contracts using Docker and have the following command.

docker run -v /home/user/go-ethereum-v1/contracts:/sources ethereum/solc:0.8.4 '--allow-paths=/home/user/.nvm/versions/node/v16.14.0/lib/' -o /sources/abi --optimize --overwrite --abi --bin /sources/solc/Pigfox.sol

I get the following error:

Error: Source "/home/user/.nvm/versions/node/v16.14.0/lib/node_modules/@openzeppelin/contracts/token/ERC20/ERC20.sol" not found: File outside of allowed directories.

The confirmed import path is:

/home/user/.nvm/versions/node/v16.14.0/lib/node_modules/@openzeppelin/contracts/token/ERC20/ERC20.sol

In the contract I have

import "/home/user/.nvm/versions/node/v16.14.0/lib/node_modules/@openzeppelin/contracts/token/ERC20/ERC20.sol";

I have tried putting the ERC20.sol file in the same directory but it has mulptiple dependencies so it become spaghetti code.

Any idea how I can fix the allow --allow-paths to the install directory?

0

There are 0 answers