I'm using Alchemy API with Hardhat and every time I run the deploy script I get the above error. I am also getting requests to my API every time I run this and the method is eth_accounts, in the request the Params Raw Request the API is getting says this:
{ jsonrpc:"2.0", method:"eth_accounts", params:[ ], id:1 }
The Return Raw Response is:
{ jsonrpc:"2.0", id:1, result:[ ] }
It can't possibly be that my Keys aren't working if I am getting requests and responses to my API. I have tried every type of deploy and getContractFactory function and combination. Does this have to do with Metamask maybe? Is there something with the signer that I am missing?
Here is my hardhat.config:
/** @type import('hardhat/config').HardhatUserConfig */
require("@nomiclabs/hardhat-ethers");
require("@nomicfoundation/hardhat-toolbox");
require("dotenv").config();
const { API_KEY, PRIVATE_KEY } = process.env;
module.exports = {
solidity: "0.8.19",
defaultNetwork: "sepolia",
networks: {
sepolia: {
url: `${API_KEY}`,
account: [`0x${PRIVATE_KEY}`],
gas: 2100000,
gasPrice: 8000000000,
saveDeployments: true,
}
}
};