I got compilation error from the source code below. IERC20 is ^0.8.0 but the rests are ^0.6.0. What is my choice here? Should I just copy IERC20 to another file and made it ^0.6.0 with pragma?
Thanks You.
$npx hardhat compile
Solidity 0.8.0 is not fully supported yet. You can still use Hardhat, but some features, like stack traces, might not work correctly.
Learn more at https://hardhat.org/reference/solidity-support"
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/Hexo.sol (^0.6.0) imports @openzeppelin/contracts/token/ERC20/IERC20.sol (^0.8.0) and @openzeppelin/contracts/proxy/utils/Initializable.sol (^0.8.0)
Code to reproduce
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/proxy/utils/Initializable.sol";
import "@openzeppelin/contracts-ethereum-package/contracts/access/Ownable.sol";
contract Boxo is Initializable, OwnableUpgradeSafe {
address xyz;
function initialize(address _xyz) public initializer {
xyz =_xyz
}
}
Environment
I’m using the latest version hardhat.