ethereum-compass
ethereum-compass copied to clipboard
编译 Vault.sol 报错
solc 版本 : 0.8.16+commit.07a7930e.Linux.g++
Vault.sol 中的版本也已经改成了 0.8.16
编译命令:solc --optimize --combined-json abi,bin,interface Vault.sol
报错内容:Invalid option to --combined-json: interface
自己的解决办法:删除编译命令中的 interface 选项
得到的结果:
Warning: SPDX license identifier not provided in source file. Before publishing, consider adding a comment containing "SPDX-License-Identifier: <SPDX-License>" to each source file. Use "SPDX-License-Identifier: UNLICENSED" for non-open-source code. Please see https://spdx.org for more information.
--> vault.sol
{"contracts":{"vault.sol:Vault":{"abi":[{"inputs":[],"name":"get","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"data","type":"uint256"}],"name":"set","outputs":[],"stateMutability":"nonpayable","type":"function"}],"bin":"6080604052348015600f57600080fd5b5060ac8061001e6000396000f3fe6080604052348015600f57600080fd5b506004361060325760003560e01c806360fe47b11460375780636d4ce63c146049575b600080fd5b60476042366004605e565b600055565b005b60005460405190815260200160405180910390f35b600060208284031215606f57600080fd5b503591905056fea2646970667358221220b31a34ecbff3669e6d04f07befff711201739a9b23791901eb9788f4f400ddcd64736f6c63430008100033"}},"version":"0.8.16+commit.07a7930e.Linux.g++"}
我的问题: 为什么会报错说 Invalid option to --combined-json: interface