-
Notifications
You must be signed in to change notification settings - Fork 232
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
Compiling a contract with import_remappings
fails
#44
Comments
A simple temporary workaround:
Execute:
|
Any advance on this? |
My workaround is just a function which reads a json passed in a command line argument, which is a compiled contract. Compilation itself is done in memory with Which part of it don't you understand exactly? |
I wasn't understanding that the issue was about compiling source code and you are loading an already compiled json |
For anyone else facing this issue, a simple solution is to send an extra dash at the end of the command:
The problem seems to be related to the way the solc compiler cli behaves when sending the source code via stdin AND sending the remapping arguments. The following command does not work if you try to send the source code via stdin (it returns immediately without waiting for input):
However the following DOES work:
So the simplest solution is to send an extra dash at the end of the command, and the import_remappings arguments provides an easy way to do so :) |
How does the above change apply when I do compile_files(....) |
py-solc
Version: 2.1.0solc
Version: 0.4.17What was wrong?
I tried to compile a contract, say like this one:
The
python
compilation code is as follows:Executing this function returns an error:
Notes:
import_remapings
.import_remappings
removed works fine (it's not needed in this example, but I have another case where I'm importing other contracts and I need to use it).solc --combined-json abi,asm,ast,bin,bin-runtime,clone-bin,devdoc,interface,opcodes,userdoc = blah.sol
directly from the command line works fine too (no errors, no warnings).solc 0.4.19
indocker
but problem persisted.Cute Animal Picture
The text was updated successfully, but these errors were encountered: