4

I have a constructor that is emitting an event, but cannot seem to see/catch/filter that event after deployment.

2
  • How are you catching/filtering events? Jul 24, 2019 at 22:08
  • I have tried filtering via ethers.js from block 0-latest with no luck, although future events come through just fine. I also tried using the Ganache GUI. Starting from a fresh state I deploy the contracts and everything looks fine except the expected events are not shown. Jul 25, 2019 at 0:03

1 Answer 1

3

Yes you can.

I put the answer in plain and simple language, in case future people find this question. But your problem is most likely related to how you're filtering events.

2
  • 1
    The problem was related to event filtering. I was able to see the events come through using web3.eth.getPastLogs({fromBlock: deployedBlockNumber, toBlock: deployedBlockNumber}). Going to try and figure out why ethers.js route was not working and post back. Jul 25, 2019 at 16:48
  • @NeilHarlow were you able to resolve this somehow?
    – Bob
    Nov 21, 2023 at 23:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.