I am having issues deploying my smart contract in hardhat using the sepolia test net. I keep getting the "Network sepolia doesnt exist" error as well as "Option moduleresolution must be set next to NodeNext" error when I switch over to typescript( I would rather use javaScript). Here is my configuration file with my deploy script below it. Please help as I am very frustrated as to what is going wrong( This is my first project so I am anxious haha).
require("@nomicfoundation/hardhat-toolbox");
/** @type import('hardhat/config').HardhatUserConfig */
const { API_URL, PRIVATE_KEY } = process.env;
require("dotenv").config();
require("@nomicfoundation/hardhat-ethers");
import("@nomicfoundation/hardhat-chai-matchers");
import("@nomicfoundation/hardhat-ethers");
module.exports = {
solidity: {
compilers: [
{
version: "0.5.9",
},
{
version: "0.8.0",
},
{
version: "0.8.19",
},
{
version: "0.8.9",
},
{
version: "0.8.21",
},
],
defaultNetwork: "sepolia",
networks: {
hardhat: {},
sepolia: {
url: API_URL,
accounts: ["0x${PRIVATE_KEY}"],
chainId: 11155111,
},
},
},
};
my deploy script named SpiderVerseDeploy.js
import { ethers } from "hardhat";
import "hardhat/console.sol";
async function main() {
const SpiderVerse = await ethers.getContractFactory("SpiderVerse");
const spiderVerse = await SpiderVerse.deploy("SpiderVerse");
await spiderVerse.deployed();
console.log("Contract deployed to address:", spiderVerse.address);
}
main();
main().catch((error) => {
console.error(error);
process.exitCode = 1;
});
I have my private information stored as variables in a .env file and set up my sepolia testnet account in my metamask wallet.