Skip to content

Why does contract event fire when no events have happened? #2353

Answered by ricmoo
adriandelgg asked this question in Q&A
Discussion options

You must be logged in to vote

No, v6 is still just local on my computer. For v5, the best way to accomplish what you want above is:

provider.once("block", () => {
    factoryContract.on('TokenCreated', newToken);
});

That will start the event handler after the next block occurs.

Replies: 4 comments 5 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
3 replies
@adriandelgg
Comment options

@sebastiandine
Comment options

@mkaya13
Comment options

Answer selected by adriandelgg
Comment options

You must be logged in to vote
2 replies
@mkaya13
Comment options

@ricmoo
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
investigate Under investigation and may be a bug.
5 participants
Converted from issue

This discussion was converted from issue #2310 on November 30, 2021 15:39.