Open HasaTan opened 1 year ago
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.
Environment information
py-solc-ast
Version: 1.2.9solc
Version: 0.5.4What was wrong?
Please include information like:
when i run the code : source = dict()
the log shows that:
Traceback (most recent call last): File "D:\Project\Python\cfg_builder\main.py", line 27, in
contrasts_units = solcast.from_standard_output(source)
File "D:\Project\Python\cfg_builder\venv\lib\site-packages\solcast\main.py", line 33, in from_standard_output
source_nodes = set_dependencies(source_nodes)
File "D:\Project\Python\cfg_builder\venv\lib\site-packages\solcast\dependencies.py", line 12, in set_dependencies
symbol_map = get_symbol_map(source_nodes)
File "D:\Project\Python\cfg_builder\venv\lib\site-packages\solcast\dependencies.py", line 98, in get_symbol_map
for key, value in ((k, x) for k, v in node.exportedSymbols.items() for x in v):
AttributeError: 'dict' object has no attribute 'exportedSymbols'
How can it be fixed?
Fill this in if you know how the bug could be fixed.