-
Hi! I'm having troubles to find out what is the problem here? No one seems to have this problem but me. const ethers = require("ethers"); // const means can't change ethers. require just imports it
const fs = require("fs");
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(
"0x2c5356ad64cafb6ca44bb52e62064b1a0a1d51de31e4364e39a20aeab9e23b50",
provider
);
const abi = fs.readFileSync("./SimpleStorage_sol_SimpleStorage.abi", "utf8");
const binary = fs.readFileSync(
"./SimpleStorage_sol_SimpleStorage.abi",
"utf8"
);
const contractFactory = new ethers.ContractFactory(abi, binary, wallet); // used to deploy contract
console.log("Deploying, pleast wait...");
const contract = await ContractFactory.deploy(); // STEP here! Wait for contract to deploy --> "await"
console.log(contract);
}
main()
.then(() => process.exit(0))
.catch((error) => {
console.error(error);
process.exit(1);
}); |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 12 replies
-
|
Beta Was this translation helpful? Give feedback.
-
@jalenarko If it is not resolved then please leave your repository link, I will see it. |
Beta Was this translation helpful? Give feedback.
-
Hey @jalenarko its suppose to be .bin not abi for binary
to this
|
Beta Was this translation helpful? Give feedback.
Hey @jalenarko
its suppose to be .bin not abi for binary
change this
to this