Network sepolia doesn't exist, please help immediately

This is the tutorial I’ve been trying to follow here:
Flash Loan Arbitrage | Aave Flash Loan Tutorial - YouTube

I left off at like 27:25.

I intended to use Sepolia instead of Goerli because it looks like Sepolia is the network necessary to get test funds from AAVE now.

This is my env:

PRIVATE_KEY="0x$(private key hidden)"
INFURA_SEPOLIA_ENDPOINT="https://sepolia.infura.io/v3/(API key hidden)"

And this is my hardhat.config.js, and it appears that I’ve done everything absolutely right:

require("@nomicfoundation/hardhat-toolbox");
require("dotenv").config();

/** @type import('hardhat/config').HardhatUserConfig */
module.exports = {
  solidity: "0.8.10",
  networks: {
    sepolia: {
      url: process.env.INFURA_SEPOLIA_ENDPOINT,
      accounts: [process.env.PRIVATE_KEY],
    },
  },
};

However, I’ve tried running this countless times:

npx hardhat run --network sepolia scripts/deployFlashLoan.js

And it’s failed every single time, this is the error I get:

Hardhat config is returning an empty config object, check the export from the config file if this is unexpected.

Learn more about configuring Hardhat at https://hardhat.org/config

Error HH100: Network sepolia doesn't exist

For more info go to https://hardhat.org/HH100 or run Hardhat with --show-stack-traces

To say I’ve tried countless means of finding a fix is an understatement. I had already done everything the uploader told me to do up to where I left off in the tutorial. I really don’t understand how he’s able to deploy the contract and not me!!!

Help me, please and thanks in advance.

2 Likes

Hi @plankton5165,

at 8:20 in the video he sets up mumbi as a network in the hardhat.config.js file. It does indeed look like everything is correct. The env can be tricky though. You can add a console.log(process.env) after your require(“dotenv”) to confirm that the required info is really imported ok. you can also hard code (temporarily) the values to eliminate the dotenv import as a factor.

Regards,

2 Likes

This is my hardhat.config.js:

require("@nomicfoundation/hardhat-toolbox");
require("dotenv").config();
console.log(process.env)

/** @type import('hardhat/config').HardhatUserConfig */
module.exports = {
  solidity: "0.8.10",
  networks: {
    sepolia: {
      url: process.env.INFURA_SEPOLIA_ENDPOINT,
      accounts: [process.env.PRIVATE_KEY],
    },
  },
};

I tried running the script, it still says network Sepolia doesn’t exist!

Maybe you didn’t specify exactly what the console.log(process.env) is supposed to look like?

By the way, it looks like he set up Goerli as the network, not Mumbai. But like I said, my network has to be set to Sepolia in order for me to receive test funds from AAVE.

He left a link in the description to receive test ETH for Goerli, it turns out you’d be getting tokens for Sepolia as well!

2 Likes

I just deployed the contract a different way. By doing it on Remix IDE. The man in the video loaded a contract address, but I copied and pasted the PAP and then pressed the deploy button. It worked just as well.

2 Likes

This topic was automatically closed after 30 days. New replies are no longer allowed.