Lesson 4 : solcx.exceptions.ContractsNotFound: Input JSON does not contain any sources #66
Answered
by
0x3N3jVhPUV
0x3N3jVhPUV
asked this question in
Q&A
-
Here is my code: from solcx import compile_standard, install_solc
with open("./SimpleStorage.sol", "r") as file:
Simple_Storage_file = file.read()
# Compile our solidity
install_solc("0.6.0")
compiled_sol = compile_standard(
{
"language": "Solidity",
"source": {"SimpleStorage.sol": {"content": Simple_Storage_file}},
"settings": {
"outputSelection": {
"*": {"*": ["abi", "metadata", "evm.bytecode", "evm.sourceMap"]}
}
},
},
solc_version="0.6.0",
)
print(compiled_sol) Here is my output: Traceback (most recent call last):
File "deploy.py", line 9, in <module>
compiled_sol = compile_standard(
File "/home/andyafene/.local/lib/python3.8/site-packages/solcx/main.py", line 362, in compile_standard
raise ContractsNotFound(
solcx.exceptions.ContractsNotFound: Input JSON does not contain any sources
> command: ``
> return code: `None`
> stdout:
None
> stder Can you help me? please |
Beta Was this translation helpful? Give feedback.
Answered by
0x3N3jVhPUV
Sep 23, 2021
Replies: 2 comments 4 replies
-
are you sure to have ```python
from X import Y
``` |
Beta Was this translation helpful? Give feedback.
4 replies
-
@AlbertoSinigaglia, I figured out what was the problem. I wrote : "source": {"SimpleStorage.sol": {"content": Simple_Storage_file}}, Instead of : "sources": {"SimpleStorage.sol": {"content": Simple_Storage_file}}, |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
0x3N3jVhPUV
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@AlbertoSinigaglia, I figured out what was the problem.
I wrote :
Instead of :