question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

File outside of allowed directories

See original GitHub issue

Description

If i run myth on our truffle project i get File outside of allowed directories.

/Users/sebastian/ocean/keeper-contracts/contracts/auth/OceanAuth.sol:3:1: Error: Source "/Users/sebastian/ocean/keeper-contracts/contracts/OceanMarket.sol" not found: File outside of allowed directories.
import '../OceanMarket.sol';
^--------------------------^

I am using the most recent version 18.12. It was working with 18.11.

$ myth -V Mythril version v0.18.12

How to Reproduce

clone https://github.com/oceanprotocol/keeper-contracts

run myth -x --truffle

I also tried --sold-args “–allow-paths xxx” but got the same results.

Expected behavior

should output the results

Environment

macOS 10.13.6

$ python --version Python 3.7.0

$ pip --version pip 18.1 from /usr/local/lib/python3.7/site-packages/pip (python 3.7)

$ solc --version solc, the solidity compiler commandline interface Version: 0.4.25+commit.59dbf8f1.Darwin.appleclang

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:20

github_iconTop GitHub Comments

1reaction
tina1998612commented, Nov 8, 2018

I’m also facing the same problem.

0reactions
enderphan94commented, Nov 11, 2019

Yes, it works with solv 0.4.15 as solc integer_overflow_1.sol, no error at all. Hence, I got this far

Without sudo

There was a bunch of permission errors, I changed them and got: $myth a integer_overflow_1.sol

myth a integer_overflow_1.sol mythril.interfaces.cli [ERROR]: Traceback (most recent call last):
  File "/usr/local/lib/python3.6/dist-packages/mythril/interfaces/cli.py", line 796, in parse_args_and_execute
    address = load_code(disassembler, args)
  File "/usr/local/lib/python3.6/dist-packages/mythril/interfaces/cli.py", line 602, in load_code
    args.solidity_files
  File "/usr/local/lib/python3.6/dist-packages/mythril/mythril/mythril_disassembler.py", line 186, in load_from_solidity
    solc_settings_json=self.solc_settings_json,
  File "/usr/local/lib/python3.6/dist-packages/mythril/support/signatures.py", line 249, in import_solidity_file
    self.add("0x" + hash, name)
  File "/usr/local/lib/python3.6/dist-packages/mythril/support/signatures.py", line 184, in add
    (byte_sig, text_sig),
sqlite3.OperationalError: attempt to write a readonly database

With sudo:

$sudo myth a integer_overflow_1.sol

  File "/usr/local/lib/python3.6/dist-packages/mythril/interfaces/cli.py", line 796, in parse_args_and_execute
    address = load_code(disassembler, args)
  File "/usr/local/lib/python3.6/dist-packages/mythril/interfaces/cli.py", line 602, in load_code
    args.solidity_files
  File "/usr/local/lib/python3.6/dist-packages/mythril/mythril/mythril_disassembler.py", line 186, in load_from_solidity
    solc_settings_json=self.solc_settings_json,
  File "/usr/local/lib/python3.6/dist-packages/mythril/support/signatures.py", line 247, in import_solidity_file
    for contract in solc_json["contracts"][file_path].values():
KeyError: 'contracts'
Read more comments on GitHub >

github_iconTop Results From Across the Web

File outside of allowed directories issue #2742 - GitHub
I have zeppelin as a submodule, and I am trying to import a solidity contract from inside of the zeppelin submodule. solc is...
Read more >
File outside of allowed directories. [solidity/solc]
I'm using vim with the syntastic plugin. I'm getting this message: Source "zeppelin-solidity/contracts/token/StandardToken.sol" not found: File ...
Read more >
Brownie: CompilerError: File outside of allowed directories
it doesn't find aggregatorV3interface.sol. Have you installed it? try pip3 install @chainlink/contracts or npm install @chainlink/contracts.
Read more >
Help needed - File outside of allowed directories error
Whenever I try to run a script using brownie, I keep getting an error from my contract about the openzeppelin and chainlink imports....
Read more >
ethereum/solidity - Gitter
sol" not found: File outside of allowed directories. import "../storage/IAddressManager.sol";. Does solc not like relative paths?
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found