solidity编译器的python sintax问题



我连接到python时遇到问题。我想使用python编译solidity文件。但是出错了。

import json

from solcx import compile_standard, install_solc

with open("./SimpleStorage.sol", "r") as file:
simple_storage_file = file.read()

# Solidity source code
compiled_sol = compile_standard(
{
"language": "Solidity",
"sources": {"SimpleStorage.sol": {"content": simple_storage_file}},
"settings": {
"outputSelection": {
"*": {
"*": ["abi", "metadata", "evm.bytecode", "evm.bytecode.sourceMap"]
}
}
},
},
solc_version="0.9.0",
)
with open("compiled_code.json", "w") as file:
json.dump(compiled_sol, file)

**第一条python出现错误,第二条solidity出现"精细**">

在此处输入图像描述

在此处输入图像描述

目前还没有0.9.0solc版本。查看官方发布列表并使用可用列表。如果你想使用最新的,请将代码修改为:

solc_version="0.8.13",

最新更新