Not able to run deploy.js
#5312
Answered
by
alymurtazamemon
kartikver15gr8
asked this question in
Q&A
-
While studying Can anyone help me with this This is the code, I've written const ethers = require("ethers");
const fs = require("fs-extra");
async function main() {
// compile them in our code
// compile them separately
// http://127.0.0.1:7545
const provider = new ethers.providers.JsonRpcProvider(
"HTTP://127.0.0.1:7545"
);
const wallet = new ethers.Wallet(
"0x4d287f129e868566efaea5e9c1f65ded8176b796e226a357cedb54726c67353d",
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.
Answered by
alymurtazamemon
Apr 17, 2023
Replies: 2 comments 5 replies
-
I guess you should uncapitalize HTTP. const provider = new ethers.providers.JsonRpcProvider( |
Beta Was this translation helpful? Give feedback.
4 replies
-
@kartikver15gr8 Please check it out this discussion, we have answered this issue here #286 |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
kartikver15gr8
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@kartikver15gr8 Please check it out this discussion, we have answered this issue here #286