carletex / ghofund

https://ghofund-platform.vercel.app
MIT License
0 stars 0 forks source link

Bug ghofund dao page #9

Closed technophile-04 closed 5 months ago

technophile-04 commented 5 months ago

Description :

Actually there was a bug in useEventHistory , We were not doing proper address check if its undefined or not, and even if it was undefined we were making a getLogs request.

When you call publicClient.getLogs passing address as undefined it finds all the logs from various contract addresses which matches the event. Hence we were getting random events from random contracts.

Checkout this example: https://stackblitz.com/edit/wevm-viem-gpjn8l?file=index.ts

Note related to this PR / discussion: But while tinkering found that while making eth_getLogs request your fromBlock - toBlock should be < 800 blocks others will error (at least public cloudfare node does it)

vercel[bot] commented 5 months ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
ghofund-platform ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 16, 2024 5:17pm
carletex commented 5 months ago

it finds all the logs from various contract addresses which matches the event

Lol. Now everything makes sense.

Thanks Shiv!