我正在尝试使用A编译对合同B(位于B.sol中)的依赖关系的契约D1(位于B.sol中),其中A的可靠性版本0.8.0和B版本0.7.6。我使用的solcjs版本是0.7.6,因此A无法编译错误:
A.sol:4:1: ParserError: Source file requires different compiler version (current compiler is 0.7.6+commit.7338295f.Emscripten.clang) - note that nightly builds are considered to be strictly less than the released version我使用以下命令编译契约A:
solcjs --bin ./contracts/A.sol --optimize --optimize-runs 1000将solc-js更新为0.8.0将导致同样的问题,但现在B无法编译。
问题似乎是每个文件/契约都应该使用各自的编译器进行编译,我如何使solc-js使用所需的版本进行编译?
发布于 2022-08-06 03:24:40
在B.sol中,只需更新solidity版本
从0.7.6到0.8.0
https://ethereum.stackexchange.com/questions/133093
复制相似问题