File outside of allowed directories error.
See original GitHub issueHi, I was trying to flat a very simple contract just to test the library and python requirements:
pragma solidity ^0.4.24;
import "../node_modules/openzeppelin-solidity/contracts/ownership/Ownable.sol";
import "../node_modules/openzeppelin-solidity/contracts/token/ERC20/StandardBurnableToken.sol";
contract myToken is StandardBurnableToken, Ownable {
string public name = "";
string public symbol = "";
uint8 public decimals = 18;
}
and I get this:
solidity_flattener contracts/MyToken.sol
contracts/MyToken.sol:3:1: Error: Source "node_modules/openzeppelin-solidity/contracts/ownership/Ownable.sol" not found: File outside of allowed directories.
import "../node_modules/openzeppelin-solidity/contracts/ownership/Ownable.sol";
^-----------------------------------------------------------------------------^
contracts/MyToken.sol:4:1: Error: Source "node_modules/openzeppelin-solidity/contracts/token/ERC20/StandardBurnableToken.sol" not found: File outside of allowed directories.
import "../node_modules/openzeppelin-solidity/contracts/token/ERC20/StandardBurnableToken.sol";
^---------------------------------------------------------------------------------------------^
Traceback (most recent call last):
File "/Users/andreaspeziale/Repository/my-token/env/bin/solidity_flattener", line 4, in <module>
flattener.core.main()
File "/Users/andreaspeziale/Repository/my-token/env/lib/python3.7/site-packages/flattener/core.py", line 97, in main
solc_proc.check_returncode()
File "/usr/local/Cellar/python/3.7.0/Frameworks/Python.framework/Versions/3.7/lib/python3.7/subprocess.py", line 409, in check_returncode
self.stderr)
subprocess.CalledProcessError: Command '['solc', '--ast', 'contracts/MyToken.sol']' returned non-zero exit status 1.
The $ truffle compile
works well.
Thank you for the help.
Issue Analytics
- State:
- Created 5 years ago
- Comments:8
Top 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 tried creating a symlink in the contracts directory and running vim from the same directory, and still get the same warning. I...
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
I'm trying to compile with solc but receiving this error in relation to my paths: ... not found: File outside of allowed directories....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@XertroV Yes i noticed it. Actually I don’t know maybe I’m missing something else but it worked. Give a look to those two tracebacks. The first one worked the second one nope and the diff is only the solc prefix.
unrecognised option '--allow-paths...
Have a nice day!
@andreafspeziale glad you got it working.
It’s weird that adding
solc
to the start worked… I wouldn’t expect it to given this line: https://github.com/BlockCatIO/solidity-flattener/blob/53b01d1db12a5ef4dfe35adf4bd6e4f73d90d0f8/flattener/core.py#L93In any case 👍