You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
async function main() {
// Ganache RPC:// http://127.0.0.1:7545
const provider =new ethers.providers.JsonRpcProvider(
"http://127.0.0.1:7545"
);
const wallet =new ethers.Wallet(
"0x7fafd5189c4bd84b77ec7e5ca92a81a999d75131b2696faeeb3bd533f19dd5c8",
provider
);
const abi = fs.readFileSync("./SimpleStorage_sol_SimpleStorage.abi", "utf8");
const binary = fs.readFileSync(
"./SimpleStorage_sol_SimpleStorage.bin",
"utf8"
);
const contractFactory =new ethers.ContractFactory(abi, binary, wallet);
console.log("Deploying, please wait...");
const contract = await contractFactory.deploy();
console.log(contract);
}```
Now the error is:
```Deploying, please wait...
Error: could not detect network (event="noNetwork", code=NETWORK_ERROR, version=providers/5.6.2)
at Logger.makeError (/home/amar/HardHat_FreeCodeCamp/Ethers_Simple_Storage/node_modules/@ethersproject/logger/lib/index.js:238:21)```
I have tried downgrading my ethers version to 5.6.2 but now I am clueless on how to preoceed forward with this
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Beta Was this translation helpful? Give feedback.
All reactions