Ray
Ray

Reputation: 51

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

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?

Upvotes: 4

Views: 3670

Answers (2)

Danijel Enoch
Danijel Enoch

Reputation: 1

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.

Upvotes: 0

Patrick Collins
Patrick Collins

Reputation: 6131

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

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

Upvotes: 6

Related Questions