py-solc-ast
py-solc-ast copied to clipboard
AttributeError: 'dict' object has no attribute 'exportedSymbols'
Environment information
py-solc-astVersion: 1.2.9solcVersion: 0.5.4- Python Version: 3.9.7
- OS: win
What was wrong?
Please include information like:
when i run the code : source = dict()
source["sources"] = solcx.compile_files([filename], output_values=['ast'])
file = filename + ".json"
with open(file, 'w') as file_obj:
json.dump(source, file_obj)
contrasts_units = solcast.from_standard_output(source)
the log shows that:
Traceback (most recent call last):
File "D:\Project\Python\cfg_builder\main.py", line 27, in
How can it be fixed?
Fill this in if you know how the bug could be fixed.
I think if you use from_standard_output, you have to use the standard output approach for compiling, and not compile_files().
try:
from solcx.main import _compile_combined_json
output = _compile_combined_json(source_files=[filename], output_values=["ast"])
also i think we are inheriting this package over here: https://github.com/ApeWorX/py-solc-ast
另外,我认为我们在这里继承了这个包:https://github.com/ApeWorX/py-solc-ast
thks,i use the sol that sloditity version 0.5.4,then i change it to version ^0.8.0, then i success .
i realized i imported the wrong method in my example, but the words are still right ,have to use standard input compile.