Open 13813385093 opened 11 months ago
请提供 0.4.25调用编译时使用的参数。
在使用SolidityCompiler.compile(byte[] source, boolean sm, boolean combinedJson, Option... options) 接口时,当solc版本高于0.5的时候,要带上 “-” 的option,和注释描述的一样,在0.5的solc之后对于stdin都需要加上 '-' 的参数。
使用释例:
File file = new File(url.getFile());
byte[] bytes = new byte[(int) file.length()];
try (FileInputStream fileInputStream = new FileInputStream(file)) {
if (fileInputStream.read(bytes) != bytes.length) {
throw new IOException("incomplete reading of file: " + file);
}
}
SolidityCompiler.Option option = new SolidityCompiler.CustomOption("", "-");
Result compile = SolidityCompiler.compile(bytes, false, true, ABI, BIN, METADATA,option);
我使用v0.4.25.0编译HelloWorld.sol可以编译通过,但是当我切换成v0.6.10.0或0.8.11.1编译同样的合约的时候,就报错了。错误提示:"No input files given. If you wish to use the standard input please specify "-" explicitly."。请问应该如何解决。