I get an Error when I try to deploy my contract on Vscode #1527
Answered
by
krakxn
Itoro-Brown
asked this question in
Q&A
-
Here is the error I get any time I try to deploy my contract using the command "node deploy.js" Below is the code: const providers = require("ethers");
const ethers = require(ethers);
const fs = require("fs-extra");
async function main() {
// http://127.0.0.1:7545
const provider = new ethers.providers.JsonRpcProvider(
"http://127.0.0.1:7545"
);
const wallet = new ethers.wallet(
"7c45635f28065e05b565afa7039baa3a8dd0298a0c6be12578d9893c7d979bd7",
provider
);
const abi = fs.readFileSync("./SimpleStorage_sol_kucoin.abi", "utf8");
const binary = fs.readFileSync("./SimpleStorage_sol_kucoin.bin", "utf8");
const contractFactory = new ethers.contractFactory(abi, binary, wallet);
console.log("Please wait, contract is deploying");
const contract = await contractFactory.deploy();
console.log(contract);
}
main()
.then(() => process.exit(0))
.catch((error) => {
console.error(error);
process.exit(1);
});
Please what should I do? |
Beta Was this translation helpful? Give feedback.
Answered by
krakxn
Aug 4, 2022
Replies: 1 comment 4 replies
-
Your problem should be fixed via the following changes: -const ethers = require(ethers);
+const ethers = require("ethers"); |
Beta Was this translation helpful? Give feedback.
4 replies
Answer selected by
alymurtazamemon
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Your problem should be fixed via the following changes: