Replies: 3 comments 7 replies
-
Hello @Saber1Y You are probably using ethers v6 and that is why you are getting this error. Whole course was made on ethers v5, so downgrade your ethers to 5 and it should be resolved Here is solution for ethers v6: link |
Beta Was this translation helpful? Give feedback.
-
The line |
Beta Was this translation helpful? Give feedback.
-
The error "TypeError: Cannot read properties of undefined (reading 'wait')" happens because deployTransaction is undefined when you're calling .wait(). |
Beta Was this translation helpful? Give feedback.
-
who else is watching on sep 2023 and is unable to use "deployTransaction.wait()."?
const contractFactory = new ethers.ContractFactory(abi, binary, wallet);
console.log("Deplyoing, please wait...")
const contract = await contractFactory.deploy();
await contract.deployTransaction.wait("1");
const favouriteNumber = await contractFactory.retrieve();
console.log(favouriteNumber);
error: PS C:\Users\PC\hh-fcc\ehters-simple-storage> node deploy.js
Deplyoing, please wait...
TypeError: Cannot read properties of undefined (reading 'wait')
at main (C:\Users\PC\hh-fcc\ehters-simple-storage\deploy.js:16:38)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
PS C:\Users\PC\hh-fcc\ehters-simple-storage>
Beta Was this translation helpful? Give feedback.
All reactions