Lesson 7(8:41:09): I am unable to deploy my SimpleStorage.sol Contract #2209
-
const {ethers} = require("hardhat")
async function main(){
const SimpleStorageFactory = await ethers.getContractFactory("SimpleStorage")
console.log("Deploying,....")
const simpleStorage= SimpleStorageFactory.deploy()
await (await simpleStorage).deployed()
} On this function , I am running into an error:
Can someone tell me what's going on? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 5 replies
-
Hey @olaoyesalem since you are using hardhat-ethers rather than ethers itself, it might be causing the error you are experiencing. Try and replace |
Beta Was this translation helpful? Give feedback.
-
In your hardhat.config.js file, adding this (along with other imports) should fix the problem: require("@nomiclabs/hardhat-ethers"); Also, the only possibility besides this could be the naming scheme; please cross-check if it is |
Beta Was this translation helpful? Give feedback.
-
@olaoyesalem Make sure you have these dependencies: {
"name": "hardhat-simple-storage",
"version": "1.0.0",
"description": "",
"scripts": {},
"keywords": [],
"author": "",
"license": "ISC",
"devDependencies": {
"@nomiclabs/hardhat-ethers": "^2.0.6", // this one
"@nomiclabs/hardhat-etherscan": "^3.1.0",
"@nomiclabs/hardhat-waffle": "^2.0.3",
"chai": "^4.3.6",
"ethereum-waffle": "^3.4.4",
"ethers": "^5.6.8", // this one
"hardhat": "^2.9.9", // this one
"hardhat-gas-reporter": "^1.0.8",
"solidity-coverage": "^0.7.21"
},
"dependencies": {
"dotenv": "^16.0.1"
}
} you can copy/paste the entire and delete the node_modules folder and run |
Beta Was this translation helpful? Give feedback.
In your hardhat.config.js file, adding this (along with other imports) should fix the problem:
Also, the only possibility besides this could be the naming scheme; please cross-check if it is
SimpleStorage