1

Did i miss something in configuration, or will this be fixed in an future version?

Best regards

# ls -al
Makefile
README.md
build
cmd
contracts
node_modules
package.json

# ls -al ./contracts
Wallet.sol
cat  ./contracts/Wallet.sol
pragma solidity ^0.5.0;

import "openzeppelin-eth/contracts/token/ERC20/IERC20.sol";
import "openzeppelin-eth/contracts/token/ERC20/StandaloneERC20.sol";
import "openzeppelin-eth/contracts/ownership/Ownable.sol";
import "zos-lib/contracts/Initializable.sol";

contract Wallet is Ownable {
    function transferERC20(IERC20 token, address to, uint256 amount) public onlyOwner returns (bool) {
        require(token.transfer(to, amount));
    }
}
# solc --abi --bin ./contracts/Wallet.sol -o ./build
./contracts/Wallet.sol:3:1: Error: Source "openzeppelin-eth/contracts/token/ERC20/IERC20.sol" not found: File outside of allowed directories.
import "openzeppelin-eth/contracts/token/ERC20/IERC20.sol";
^---------------------------------------------------------^
./contracts/Wallet.sol:4:1: Error: Source "openzeppelin-eth/contracts/token/ERC20/StandaloneERC20.sol" not found: File outside of allowed directories.
import "openzeppelin-eth/contracts/token/ERC20/StandaloneERC20.sol";
^------------------------------------------------------------------^
./contracts/Wallet.sol:5:1: Error: Source "openzeppelin-eth/contracts/ownership/Ownable.sol" not found: File outside of allowed directories.
import "openzeppelin-eth/contracts/ownership/Ownable.sol";
^--------------------------------------------------------^
./contracts/Wallet.sol:6:1: Error: Source "zos-lib/contracts/Initializable.sol" not found: File outside of allowed directories.
import "zos-lib/contracts/Initializable.sol";
  • 1
    If you're using solc directly, then you should run it from a path which is a parent of all source files. Alternatively, you can just use truffle compile. There's a long discussion about this issue in this GitHub thread. – goodvibration May 29 at 7:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.