This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
Why does contract event fire when no events have happened? #2310
Labels
investigate
Under investigation and may be a bug.
Describe the bug
I'm using
contract.on();
& whenever I reload the page it triggers the event being fired even though no event has happened yet. I thought the expected behavior was that it ONLY triggers when an event is fired?Correct me if I'm wrong, but shouldn't it only fire if an event happens? Meaning that when you call
contract.on(event, listener)
it will listener passively but not trigger thelistener
until theevent
actually happens?Reproduction steps
Environment:
Hardhat, Ethers.js, Next.js/React
The text was updated successfully, but these errors were encountered: