Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: Cannot read properties of undefined (reading 'wait') #6279

Open
herculeskan opened this issue Nov 9, 2023 · 1 comment
Open
Labels

Comments

@herculeskan
Copy link

Lesson

Lesson 6

Could you please leave a link to the timestamp in the video where this error occurs? (You can right click a video and "copy video URL at current time")

https://youtu.be/gyMwXuJrbJQ?si=Wbuv7TWeQmUF4ICh&t=32522

Operating System

Windows

Describe the bug

I posted in Q&A without knowing that issues tab on github could work
hello, I unable to deploy my contract for some issues like for example, deployed() keyword changed to waitForDeployment(), now I have the same issue in my terminal but with another function:

 // update transaction
    const transactionResponse = await simpleStorage.store(7)
    await transactionResponse.wait(1)
    const updatedValue = await simpleStorage.retrieve()
    console.log(`updated value is: ${updatedValue}`)
}

I checked in the simpleStorage part, however I realized that deployTransaction.wait(6) could has an error

console.log(`Deployed contract to: ${simpleStorage.target}`)
    if (network.config.chainId == 11155111 && process.env.ETHERSCAN_API_KEY) {
        console.log("waiting for the block taxes   ")
        await simpleStorage.deployTransaction.wait(6)
        await verify(simpleStorage.address, [])
    }

I know because the error jumps after console.log("waiting for the block taxes ") in the terminal

I suspect that probably ethers.getContractFactoryHas a different function, however is not the same as deployTransaction.wait
and if is it correct. How can I fix this issue?

@v4ss
Copy link

v4ss commented Nov 29, 2023

Hi @herculeskan,
You have to change await simpleStorage.deployTransaction.wait(6)
by
await simpleStorage.deploymentTransaction().wait(6)

And it could work :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants