-
Notifications
You must be signed in to change notification settings - Fork 241
Open
Description
py-solcVersion: 2.1.0solcVersion: 0.4.17- Python Version: 3.5.2
- OS: Ubuntu 16.04, 4.4.0-104-generic
What was wrong?
I tried to compile a contract, say like this one:
pragma solidity 0.4.17;
contract Blah {
uint public a;
function Blah(uint _a) public {
a = _a;
}
function getA() public view returns(uint) {
return a;
}
}
The python compilation code is as follows:
class Chain:
...
@classmethod
def compileContract(cls, filename):
with open(filename,'r') as f:
contract_source_code = f.read()
compiled_sol = compile_source(contract_source_code, import_remappings=['='])
return compiled_sol ['<stdin>:Blah']
...
Executing this function returns an error:
Traceback (most recent call last):
File "compile.py", line 71, in <module>
compiled = Chain.compileContract(sys.argv[1])
File "compile.py", line 24, in compileContract
compiled_sol = compile_source(contract_source_code, import_remappings=["="])
File "/usr/local/lib/python3.5/dist-packages/solc/main.py", line 106, in compile_source
stdoutdata, stderrdata, command, proc = solc_wrapper(**compiler_kwargs)
File "/usr/local/lib/python3.5/dist-packages/solc/utils/string.py", line 85, in inner
return force_obj_to_text(fn(*args, **kwargs))
File "/usr/local/lib/python3.5/dist-packages/solc/wrapper.py", line 165, in solc_wrapper
stderr_data=stderrdata,
solc.exceptions.SolcError: An error occurred during execution
> command: `solc --combined-json abi,asm,ast,bin,bin-runtime,clone-bin,devdoc,interface,opcodes,userdoc =`
> return code: `1`
> stderr:
> stdout:
Notes:
- It fails whatever value I assign to
import_remapings. - Executing with
import_remappingsremoved 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). - Executing
solc --combined-json abi,asm,ast,bin,bin-runtime,clone-bin,devdoc,interface,opcodes,userdoc = blah.soldirectly from the command line works fine too (no errors, no warnings). - I tried also running with
solc 0.4.19indockerbut problem persisted. - All files I have in one directory and all commands were executed inside this directory.
Cute Animal Picture
Metadata
Metadata
Assignees
Labels
No labels
