Replies: 4 comments 5 replies
-
Hi, I also had issue at the beginnging when working with Ganache installed on Windows OS and running script from WSL you can go to Ganache->Settings -> Server and choose WSL in hostname part, then use given URI in script. |
Beta Was this translation helpful? Give feedback.
-
What worked for me: |
Beta Was this translation helpful? Give feedback.
-
I downgraded my ethers version and now a different error is coming up const { ethers } = require("ethers")
const fs = require("fs-extra")
async function main() {
// code
// http://127.0.0.1:7545
const provider = new ethers.providers.JsonRpcProvider("http://127.0.0.1:7545")
const wallet = new ethers.Wallet(
"0xd31b3dce5b524b69eeb41033581c0d6f094587e19cec3cd121a67d1ee33dc423",
provider
);
const abi = fs.readFileSync("./SimpleStorage_sol_SimpleStorage.abi", "utf-8")
const binary = fs.readFileSync("./SimpleStorage_sol_SimpleStorage.bin", "utf-8")
const contractFactory = new ethers.ContractFactory(abi, binary, wallet);
console.log("Deploying, please wait....")
const contract = await contractFactory.deploy();
console.log(contract)
}
main()
.then(() => process.exit(0))
.catch((error) => {
console.error(error);
process.exit(1);
});
|
Beta Was this translation helpful? Give feedback.
-
please review my code to deploy the smart contract:- const ethers = require("ethers") async function main() {
} main() its giving this error- |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm not able to deploy my contract, can someone look at the code and tell what's wrong?
Beta Was this translation helpful? Give feedback.
All reactions