How to develop and compile with hardhat using imports with different pragma/compiler versions?

Viewed 2802

hardhat does not support https imports. After installing openzeppelin and chainlink with npm and using @openzeppelin/@chainlink, we get pragma/compiler version issues, even with different compiler versions in hardhat.config.js, and even with overwrites. How do you develop and compile with hardhat and these imports?

2 Answers

In your hardhat.config.js you can add multiple compilers.

module.exports = {
    solidity: {
        compilers: [
            {
                version: "0.6.6"
            },
            {
                version: "0.4.24"
            }
        ]
    }
}

I faced this problem, i wanted to interface with Venus protocol....so i basically put all the interfaces and the contract inside one file with the contract to avoid running multiple instances of the solidity compiler.

Related