Closed rin-st closed 1 day ago
If I understood correctly, I think this is not a bug on Scaffold-ETH nor Wagmi nor Viem but a shortcoming of free public RPC providers which don't store event filters forever and sometimes not even at all. So maybe this issue should be closed? Or perhaps some documentation (which?) could be enhanced to warn users about this shortcoming?
Yup closing this and should be documented in https://github.com/scaffold-eth/se2-docs/pull/74, thanks all!!
Is there an existing issue for this?
Which method was used to setup Scaffold-ETH 2 ?
git clone, npx create-eth@latest
Current Behavior
When using
useScaffoldWatchContractEvent
with a watched hook oruseScaffoldEventHistory
,onLogs
doesn't fire or fire sometimes. Tried to make it work, but no luck inhardhat
andfoundry
, onsepolia
it works from time to time. ButonError
fromuseScaffoldWatchContractEvent
fires often.Also tried to make an app without
<ScaffoldApp>
wrapper to minimize rerenders and logic that can cause the bug, used purewagmi
hookuseWatchContractEvent
and watcheduseBalance
onhardhat
. Result -onLogs
fires sometimes, but not in 100% of cases. So looks like it's onwagmi
side. Raised an issue .Probably I'm missing something, so if you know what's wrong please let me know
Expected Behavior
onLogs
fires in 100% casesSteps To Reproduce
Example of app without scaffold hooks (based on sre challenge 3). You'll need to start second app on localhost:3001 and send eth to your account from localhost:3000
Example 2 with our hooks. Challenge 3 with wagmi v2 (working on this)
Anything else?
see also last part of Shiv's message https://github.com/scaffold-eth/scaffold-eth-2/pull/700#issuecomment-2048117489