Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

contract.on still fire past events #3535

Closed
svianney opened this issue Nov 22, 2022 · 2 comments
Closed

contract.on still fire past events #3535

svianney opened this issue Nov 22, 2022 · 2 comments
Assignees
Labels
investigate Under investigation and may be a bug.

Comments

@svianney
Copy link

Ethers Version

5.7.2

Search Terms

subscribe, past events, events

Describe the Problem

First of all, Thanks @ricmoo for this package :)
I've read this issue about the problems of the event subscription function contract.on() that fires up past events. It seems that this bug have been fixed in the 5.7+ version. However I'm still experiencing the issue on the BSC.
Is this a bug ?

Thanks for your time

Code Snippet

contract.on(contract.filters.Mint(), (sender, amount0, amount1, ...args) => {});

Contract ABI

[
  {
    "anonymous": false,
    "inputs": [
      {
        "indexed": true,
        "internalType": "address",
        "name": "sender",
        "type": "address"
      },
      {
        "indexed": false,
        "internalType": "uint256",
        "name": "amount0",
        "type": "uint256"
      },
      {
        "indexed": false,
        "internalType": "uint256",
        "name": "amount1",
        "type": "uint256"
      }
    ],
    "name": "Mint",
    "type": "event"
  }
]

Errors

As mentionned above, I'm still experiencing the issue of the past events being fired up.

Environment

node.js (v12 or newer), Other (please specify)

Environment (Other)

NodeJS 18, QuickNode RPC Provider, BSC mainnet

@svianney svianney added the investigate Under investigation and may be a bug. label Nov 22, 2022
@ricmoo
Copy link
Member

ricmoo commented Nov 22, 2022

Can you provide more info? Like how far in the past? The current blockNumber and the blockNumber of the events? What backend you are using, etc.

@svianney
Copy link
Author

I'm sorry I've bothered you, I was experiencing this issue with an old version of Ethers, I thought I was still experiencing the issue after I have upgraded to the newest version. Turns out, this time my code at fault and my research on the Github issues misled me to think the problem was from your wonderful package.
Thank you for your fast answer, I can close the non-issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
investigate Under investigation and may be a bug.
Projects
None yet
Development

No branches or pull requests

2 participants