Skip to content

Lesson 10 : TypeError: Cannot read properties of undefined (reading 'toString') #6136

Discussion options

You must be logged in to vote

Hii @wwwbaraccuda, don't worry
You just need to replace your updateAbi function in 99-update-front-end.js file with below function

async function updateAbi(){
const lottery = await ethers.getContract("Lottery");
fs.writeFileSync(FRONT_END_ABI, JSON.stringify(lottery.interface.fragments))
}
and rerun harhdat node which will update your abi.json file
Following above steps will fix your issue.

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@DarshanJain-Techuz
Comment options

Answer selected by wwwbaraccuda
@wwwbaraccuda
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants