Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Import file not found #17

Closed
k06a opened this issue Feb 9, 2018 · 9 comments
Closed

Import file not found #17

k06a opened this issue Feb 9, 2018 · 9 comments

Comments

@k06a
Copy link

k06a commented Feb 9, 2018

Have several solidity sources in src/main/resources:

StorageContract.sol
AccountContract.sol

Second one tries to import first one:

import './StorageContract.sol';
[ERROR] Failed to execute goal org.web3j:web3j-maven-plugin:0.1.4:generate-sources (default-cli) on project base-node: Could not compile solidity files
[ERROR] <stdin>:3:1: Error: Source "StorageContract.sol" not found: File not found.
[ERROR] import './StorageContract.sol';
[ERROR] ^-----------------------------^
[ERROR] -> [Help 1]
@k06a
Copy link
Author

k06a commented Feb 9, 2018

This also not works:

import 'src/main/resources/StorageContract.sol`

@k06a
Copy link
Author

k06a commented Feb 9, 2018

Even full path is not possible:

import '/Users/k06a/Projects/base-node/src/main/resources/StorageContract.sol';
[ERROR] Failed to execute goal org.web3j:web3j-maven-plugin:0.1.4:generate-sources (default-cli) on project base-node: Could not compile solidity files
[ERROR] <stdin>:3:1: Error: Source "/Users/k06a/Projects/base-node/src/main/resources/StorageContract.sol" not found: File outside of allowed directories.
[ERROR] import '/Users/k06a/Projects/base-node/src/main/resources/StorageContract.sol';
[ERROR] ^-----------------------------------------------------------------------------^
[ERROR] -> [Help 1]

@andrej-zirko
Copy link

Same issue here

@k06a
Copy link
Author

k06a commented Feb 9, 2018

@andrej-zirko right now I am writing all smart contracts in the single file, this works. But we need a good fix.

@h2mch
Copy link
Contributor

h2mch commented Feb 14, 2018

there is raised already an issue in the solc library:
ethereum/solidity#2928

@flefevre
Copy link
Contributor

It is definietively a problem for me also.
I have dispatched my smart contract into several files to have a clear vision, but now it seems i need to fusion them again?

@ogurcan
Copy link

ogurcan commented Apr 19, 2018

Same problem for me also...

@h2mch
Copy link
Contributor

h2mch commented Apr 26, 2018

thx a lot to @MykolaMarkov. This issue is fixed in the latest version (0.3.0)

@h2mch h2mch closed this as completed Apr 26, 2018
@Norphy
Copy link

Norphy commented Aug 17, 2018

@MykolaMarkov are we able to import from online sources? such as import "github.com/OpenZeppelin/openzeppelin-solidity/contracts/token/ERC721/ERC721Token.sol" because I get an error file not found.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants