Skip to content

Standard JSON compilation cannot find or read files. #2266

@pipermerriam

Description

@pipermerriam

The compiler throws an error when trying to compile using the --standard-json flag when reading from a file.

echo '{"language": "Solidity", "sources": {"Greeter.sol": {"urls": ["file:///Users/piper/sites/py-solc/tmp/Greeter.sol"]}}}' | solc --standard-json
{"contracts":{},"errors":[{"component":"general","formattedMessage":"Cannot import url (\"file:///Users/piper/sites/py-solc/tmp/Greeter.sol\"): Unknown exception in read callback.","message":"Cannot import url (\"file:///Users/piper/sites/py-solc/tmp/Greeter.sol\"): Unknown exception in read callback.","severity":"error","type":"IOError"}],"sources":{}}

I've also tried the following formats for the file path just in case I was formatting something a little wrong:

  • file:///Users/piper/sites/py-solc/tmp/Greeter.sol
  • file://Users/piper/sites/py-solc/tmp/Greeter.sol
  • file://tmp/Greeter.sol
  • file://./tmp/Greeter.sol
  • tmp/Greeter.sol
  • /Users/piper/sites/py-solc/tmp/Greeter.sol

Help please

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions