-
Hi everyone, I've managed to solve all my issues throughout this course so far, up until now. As the title suggests, I'm unable to get my browser to display the entrance fee, like seen in the video at 17:48:46. Instead it displays [object Promise] as seen in the image below. I've also attached the links to both my githubs associated with this project. Thanks in advance for your help. SmartContract Lottery Frontend: https://github.com/StroupZ/Smart-Contract-Lottery-Frontend SmartContract Lottery Backend: https://github.com/StroupZ/Smart-Contract-Lottery-Backend |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hey guys, I was able to solve it after some more troubleshooting. I was missing a set of parentheses in my LotteryEntrance.js. I needed to turn this: into this: Thank you to all those who took the time to look at this. |
Beta Was this translation helpful? Give feedback.
Hey guys,
I was able to solve it after some more troubleshooting. I was missing a set of parentheses in my LotteryEntrance.js. I needed to turn this:
async function updateUI() { const entranceFeeFromCall = await getEntranceFee().toString() setEntranceFee(ethers.utils.formatUnits(entranceFeeFromCall, "ether")) }
into this:
async function updateUI() { const entranceFeeFromCall = (await getEntranceFee()).toString() setEntranceFee(ethers.utils.formatUnits(entranceFeeFromCall, "ether")) }
Thank you to all those who took the time to look at this.