-
const ethers = require("ethers");
const fs = require("fs-extra");
async function main() {
// http://172.18.192.1:8545
const provider = new ethers.JsonRpcProvider("http://172.18.192.1:8545");
const wallet = new ethers.Wallet(
"0x718b70f79ec1efd63c47957c57b0c274e4d31fec2783ee18d015bc28bab5baf1",
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 Contract Please wait...");
const contract = await contractFactory.deploy(); // Wait for the contract to deploy
console.log(contract);
}
main()
.then(() => process.exit(0))
.catch((error) => {
console.error(error);
process.exit(1);
}); I am not able to understand the error in the code. Can anyone help.
|
Beta Was this translation helpful? Give feedback.
Answered by
zafi5
Dec 27, 2023
Replies: 1 comment 2 replies
-
@nik-arjun check this thread #6220 (comment) |
Beta Was this translation helpful? Give feedback.
2 replies
Answer selected by
nraj07054
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@nik-arjun check this thread #6220 (comment)