const ethers = require("ethers");
const fs = require("fs-extra");
async function main() {
// http://127.0.0.1:7545
let provider = new ethers.JsonRpcProvider("http://127.0.0.1:7545");
const wallet = new ethers.Wallet(
"0xb837e61da0f71b2b895e3b165dac7e883e25cf34b6284f6e1118a45e99013e14",
provider
);
const abi = fs.readFileSync(
"./ethers-simple-storage_SimpleStorage_sol_SimpleStorage.abi",
"utf8"
);
const binary = fs.readFileSync(
"./ethers-simple-storage_SimpleStorage_sol_SimpleStorage.bin",
"utf8"
);
const contractFactory = new ethers.ContractFactory(abi, binary, wallet);
console.log("Deploying, please wait....");
const contract = await contractFactory.deploy(); //STOP here! Wait for contrat to be deployed.
const transactionReceipt = await contract.deploymentTransaction.wait(1);
console.log(transactionReceipt);
console.log("Done!");
}
main()
.then(() => process.exit(0))
.catch((error) => {
console.error(error);
process.exit(1);
});
My instructor used this code
const deploymentReceipt = await contract.deployTransaction.wait(1)
but when I try to write deploy.Transaction
it automatically writes deploymentTransaction
. Please help me with this Im stuck for hours now!!!!!