I need to listen for special events on some contract addresses in Polygon/Matic blockchain; However, my provider has limitations on the number of possible subscriptions. So, I have to get all the events (or if not possible, only the address of some desired smart contracts that have had at least one successful transaction in the last block). How can I do it through web3.js?

  • 1
    if you want all event logs then filter logs is a bad idea. some events could be anonymous and only have Data fields but not Topics field. Still such contract can be of importance, depending on what is your knowledge of the contract internals. So, I would go for scanning all blocks and all transactions. Once you get a transaction, you fetch it's receipt and inside the receipt there are logs.
    – Nulik
    Aug 2 at 13:24
  • All events for polygon will take about 80GB of space, this is what I have at least
    – Nulik
    Aug 2 at 13:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.