-
Hi guys, I am at Lesson 5, 07:14, when I run my code I always get this Below is my code: 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(
"c5c41008fb6d9d2e62e78b25d42be7b2ba1924e62d94fc42036fe06787f81a7d",
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, please wait....");
const contract = await contractFactory.deploy();
const deploymentReceipt = await contract.deployTransaction.wait(1);
console.log("Here is the deployment transaction: ");
console.log(contract.deployTransaction);
console.log("Here is the transaction receipt: ");
console.log(transactionReceipt);
}
main()
.then(() => Process.exit(0))
.catch((error) => {
console.error(error);
process.exit(1);
}); Thanks guys. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 6 replies
-
The problem is in the last console log, that is,
Let me know if this helps! |
Beta Was this translation helpful? Give feedback.
-
@SakanaSachi Process.exit(0) here p is capital it show be small. |
Beta Was this translation helpful? Give feedback.
The problem is in the last console log, that is,
console.log(transactionReceipt)
You should replace it with:
Let me know if this helps!