I have a contract in which I imports a package which in return imports IERC20.sol from openzeppelin which has ^0.7.0
solidity version and my contract has 0.8.10
solidity version. I have mentioned both the solidity versions in hardhat.config.js file but still it's throwing me this error:
Error HH606: The project cannot be compiled, see reasons below.
These files depend on other files that use a different and incompatible version of Solidity:
* contracts/Test.sol (0.8.10) depends on @openzeppelin/contracts/token/ERC20/IERC20.sol (^0.7.0)
To learn more, run the command again with --verbose
Read about compiler configuration at https://hardhat.org/config
I have the hardhat.config.js
file like this:
require("@nomicfoundation/hardhat-toolbox");
/** @type import('hardhat/config').HardhatUserConfig */
module.exports = {
solidity: {
compilers: [
{
version: "0.8.10",
},
{
version: "0.6.12",
},
{
version:"0.7.0",
}
],
},
};
I have mentioned all the solidity versions I need for my contract but still hardhat throwing me the error on compiling the smart contract. Does anyone know what I am doing wrong here?