-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
solc.exceptions.SolcError #5984
Comments
You seem to be using the "combined-json" way for compiling. This is a legacy feature we do not fully support anymore. The "clone binary" ( Please take a look at the py-solc documentation and look for Please reopen if you encounter further problems. |
@chriseth I tried following the doc you provided.
I get the following error:
|
@ammarqureshi Try:
|
@ekpyron I've tried running your code:
Seems to give the same issue:
|
Ah, sorry, I hadn't read the issue carefully and didn't realize that you're referring to python. You need a proper python multiline string, try:
|
@ekpyron got another error:
The contract code:
When I run
|
Well, you need to use the right compiler version - which one are you aiming for? |
From the error message it looks like you're using solc version 0.5.4, so you need to change the contract code to:
|
@ekpyron Thanks for the above response, learning quite a bit here. Now that the previous way of compiling is not fully supported, how would we go about getting the abi and the bytecode? The web3.py docs example shows:
After compiling the script:
I get:
|
For that you can refer to the documentation of the standard-json interface: https://solidity.readthedocs.io/en/v0.5.4/using-the-compiler.html#compiler-input-and-output-json-description |
Thanks for the response. I have managed to retrieve the bytecode object with:
However, having bit of a trouble with retrieving abi.
I thought to get abi it would be similar to getting the bytecode object.
but instead I get:
|
You should count the brackets in the output ;-). |
I still get the same error:
|
Actually this is the wrong place to ask these questions, since the issues you're having are specific to py-solc, resp. python, not to solidity :-). That being said I guess that the python API just passes you the metadata as string and does not parse it as a python data structure, so you can't access it using |
my bad I did not know. Anyways, thanks for the previous help! 👍 |
OS: MacOs Mojave
I am new to solidity and was following the docs to install the solidity compiler. I successfully installed the solidity compiler.
However, when following one the web3.py example:
I encounter the following error:
The text was updated successfully, but these errors were encountered: