Solidity编译器的python sintax问题
我的问题与Python有关。我想使用Python编译固体文件。但是出现错误。
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我会在其中遇到错误和第二固体,其'fine **
I have problem connected to python. I want to compile solidity files using python. But getting error.
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)
**first python where I get error and second solidity its' fine **
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
目前还没有
0.9.0
solc 版本。检查官方版本列表并使用可用的版本。如果你想使用最新的,请将代码修改为:There isn't
0.9.0
solc version yet. Check official releases list and use available one. If you want to use the latest one, modify you code into: