imports via https not working in hardhat (solidity)

Viewed 494

Error HH406: Invalid import https://github.com/... from contracts/MyContract.sol. Hardhat doesn't support imports via https.

Trying to import forked contract from my github but https imports are not working in hardhat but works in remix.

2 Answers

As @Kevin mentioned, Hardhat currently does not support https imports in Solidity.

A good workaround is to use npm packages that contain the smart contracts you need. Ex. importing using the @openzeppelin/contracts package.

Many established DApps will have their own npm package as well.

I just checked with them here; it seemes like they are currently not supporting this function yet.

Related