Facing Some errors #6083
Unanswered
Asad-Stacker
asked this question in
Q&A
Replies: 1 comment 3 replies
-
Hi @Asad-Stacker await contract.deployTransaction.wait(1); // for ethersV5 to this await contract.deploymentTransaction().wait(); // for ethersV6 |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi
I am facing this error when I am running node deploy.js in my terminal , I am mentioning both my code and error, please have a look, I have done everything but as a newbie I cant catch up this error.. please explain me step by step as I cant catch whole thing directly...
Deploy.js(CODE):
const ethers = require("ethers");
const fs = require("fs-extra");
async function main() {
//http://127.0.0.1:7545 , http://172.19.16.1:7545 , 0x7d7f4bd6994e99ebeded9f02bfea5fb7c01690b2545d7cea4bcc876881db6e4e
//const provider = new ethers.providers.JsonRpcProvider("http://127.0.0.1:7545");
const provider = new ethers.JsonRpcProvider("http://172.19.16.1:7545");
const wallet = new ethers.Wallet(
"0x366b355671cc19736b2366e2d6aa58a52ae2203f24c07c731d556a8732b59b55",
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");
const contract = await contractFactory.deploy();
await contract.deployTransaction.wait(1);
// const transactionReciept = await contract.deployTransaction.wait(1);
const currentFavoriteNumber = await contract.retrieve();
console.log(currentFavoriteNumber);
}
main()
.then(() => process.exit(0))
.catch((error) => {
console.error(error);
process.exit(1);
});
ERROR:
asad124@DESKTOP-I9II3SB:~/ethers-simple-storage-fcc$ node deploy.js
Deploying
TypeError: Cannot read properties of undefined (reading 'wait')
at main (/home/asad124/ethers-simple-storage-fcc/deploy.js:20:36)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
Beta Was this translation helpful? Give feedback.
All reactions