Here's an example contract:


pragma solidity ^0.4.17;

contract Nobody {
    function die() public {

The solc JSON specification to compile the contract is


    "language": "Solidity",
    "sources": {
        "./Nobody.sol": {
            "urls": [

If the contract is compiled with solc v0.4.17 on an Ubuntu 18.04 system, it errors out.

$ cat nobody.json | solc --standard-json --allow-paths .
{"contracts":{},"errors":[{"component":"general","formattedMessage":"Cannot import url (\"./Nobody.sol\"): File outside of allowed directories.","message":"Cannot import url (\"./Nobody.sol\"): File outside of allowed directories.","severity":"error","type":"IOError"}],"sources":{}}

But the same contract compiles fine with solc v0.4.18. Why do these solc versions behave differently when it comes to the error File outside of allowed directories? What does it mean even? What did change from Solidity version 0.4.17 to 0.4.18?


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.