I get this error when trying to deploy with hardhat #5860
Unanswered
oceanwillo
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
"TypeError: Cannot use 'in' operator to search for 'chainId' in 40
at copyRequest (/Users/itechresetelectronics/epic-game/node_modules/ethers/src.ts/providers/provider.ts:337:18)"
I get this error when trying to deploy with hardhat ^.
The file i'm deploying is below:
const main = async () => {
const gameContractFactory = await hre.ethers.getContractFactory('MyEpicGame');
const gameContract = await gameContractFactory.deploy(
["Alaskan Bull Worm", "Saint", "Frost", "Starboy"],
["https://imgur.com/6vqXEk2", "https://imgur.com/J8WmXCB",
"https://imgur.com/tisltP2", "https://imgur.com/2b8a0PN"],
["Heart", "Soul", "Spirit", "Character"],
[170, 110, 140, 90],
[160, 120, 80, 160],
[140, 80, 160, 100],
[2, 3, 2, 4],
"The Idea",
"https://imgur.com/a/VXEuNyI",
"anomalous",
1600,
1600,
30,
40
);
await gameContract.waitForDeployment();
console.log("Contract deployed to:", await gameContract.getAddress());
let txn;
txn = await gameContract.mintCharacterNFT(2);
await txn.wait();
};
const runMain = async () => {
try {
await main();
process.exit(0);
} catch (error) {
console.log(error);
process.exit(1);
}
};
runMain();
My Config file:
require("@nomicfoundation/hardhat-toolbox");
/** @type import('hardhat/config').HardhatUserConfig /
module.exports = {
solidity: {
version: "0.8.18",
settings: {
optimizer: {
enabled: true,
runs: 100,
},
viaIR: true,
},
},
networks: {
sepolia: {
url: 'https://distinguished-newest-brook.ethereum-sepolia.discover.quiknode.pro/1fcf0ee98d4fe175e6313c00ee8b09e6e43d470e/',
accounts: [Private Key***'],
},
},
};
Beta Was this translation helpful? Give feedback.
All reactions