Solidity,安全帽未能编译多个Solidity版本



我遇到了这个问题,甚至在hardhat.config文件中添加了版本。

module.exports = {
solidity: {
compilers: [{version: "0.6.6"}, {version: "0.4.19"}, {version: "0.6.12"}, {version: "0.8.8"}, {version: "0.7.0"}]
},

这里仍然是错误,我能做什么??合同在混音中非常有效。

Error HH606: The project cannot be compiled, see reasons below.
These files import other files that use a different and incompatible version of Solidity:
* contracts/MarketOrder.sol (^0.8.8) imports @openzeppelin/contracts/token/ERC20/ERC20.sol (^0.7.0)
To learn more, run the command again with --verbose
Read about compiler configuration at https://hardhat.org/config

您的MarketOrder.sol合约已配置为Solidity 0.8,而导入的OpenZeppelin合约是Solidity 0.7

将您的@openzeppelin/contents包更新到最新版本或至少一个支持^0.8.0的版本

最新更新