这是我在运行这段代码后遇到的错误
from solcx import compile_standard, install_solc
install_solc("0.6.0")
#from my crowdFund.sol file i call the whole file
with open("./CrowdFund.sol", "r") as file:
FromOld = file.read()
#compile our solidity
compiled_Sol = compile_standard(
{
"language": "solidity",
"sources": {"CrowdFund.sol": {"content":FromOld}},
"settings": {
"outputSelection": {
"*": {"*":["abi", "metadata", "evm.bytecode", "evm.sourceMap"]}
}
},
},
solc_version="0.6.0",
)
print("compiled_Sol")----------------------------------------------------------------------------
INFO: Could not find files for the given pattern(s).
Traceback (most recent call last):
File "C:\Users\SpiderHunter\Desktop\Solidity_Pro\deploy.py", line 13, in <module>
compiled_Sol = compile_standard(
File "C:\Users\SpiderHunter\AppData\Local\Programs\Python\Python39\lib\site-packages\solcx\main.py", line 394, in compile_standard
raise SolcError(
solcx.exceptions.SolcError: Only "Solidity" or "Yul" is supported as a language.
> command: `C:\Users\SpiderHunter\.solcx\solc-v0.6.0\solc.exe --standard-json`
> return code: `0`
> stdout:
{"errors":[{"component":"general","formattedMessage":"Only \"Solidity\" or \"Yul\" is supported as a language.","message":"Only \"Solidity\" or \"Yul\" is supported as a language.","severity":"error","type":"JSONError"}]}
> stderr:发布于 2022-01-04 13:55:18
对于language,您使用了小写的solidity,但它必须是精确的Solidity。
这里是官方文档:https://docs.soliditylang.org/en/v0.8.11/using-the-compiler.html#input-description
https://ethereum.stackexchange.com/questions/117958
复制相似问题