I'm running some tests on Hardhat network with the following config:

const config = {
  networks: {
    hardhat: {
      chainId: 1337,
      forking: {
        enabled: true,
        url: `https://eth-mainnet.alchemyapi.io/v2/${ALCHEMY_KEY}`,
        blockNumber: 11873448,

export default config;

I need to deploy a SimplePriceFeed contract, but when I have mainnet forking enabled I get this error:

Error: network does not support ENS (operation="ENS", network="unknown", code=UNSUPPORTED_OPERATION, version=providers/5.3.0)

This is the script I'm running to attempt deploying SimplePriceFeed:

const contract = await ethers.getContractFactory("SimplePriceFeed")
const SimplePriceFeed = await contract.deploy("WBTC / USD");

I tried the following script as well, but I encountered the same exact error:

const signer = (await ethers.getSigners())[0];
const artifact = await hre.artifacts.readArtifact("SimplePriceFeed");
const SimplePriceFeed = await deployContract(signer, artifact, ["WBTC / USD"])

Both scripts work just fine when mainnet forking is disabled, but I really need mainnet forking for my tests.

  • Update: this is looking more like an Ethers.js error than a Hardhat error. Jun 15, 2021 at 12:18

1 Answer 1


You get the error Error: network does not support ENS when the place where you need to pass in an address value, you're passing something else (in quite a lot of cases it's an undefined value because some address variable was not initialized before being passed in).

In the code snippets you've provided, I see only see the constructor on your contract, i.e. contract.deploy in which a UTF8 string is being passed. If that is correct, then something else in your code base must be throwing the error.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.