Skip to content
This repository was archived by the owner on Mar 5, 2025. It is now read-only.
This repository was archived by the owner on Mar 5, 2025. It is now read-only.

Contract past events could not be fetched from zero block  #5717

@nazarhussain

Description

@nazarhussain

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

Contract past events when fetched with options fromBlock: 0 does not fetch all events.

Expected Behavior

It should return all the events starting from zero block.

Steps to Reproduce

This works for any contract.

await example.getPastEvents("ExampleEvent", { fromBlock: 0, toBlock: "latest" })

Web3.js Version

4.0.1-alpha.2

Environment

  • Operating System: Mac
  • Browser: Brave
  • Node.js Version: 16x
  • NPM Version: 8x

Anything Else?

Interesting the following code works fine, but does not if we specify fromBlock: 0

await example.getPastEvents("ExampleEvent", { fromBlock: "earliest", toBlock: "latest" })

Metadata

Metadata

Assignees

Labels

4.x4.0 relatedBugAddressing a bug

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions