2

In web3JS, when I get past events, I can see the event and the tx hash, I can then do getTransaction on the corresponding tx hash and then see the sender address, but this is wasteful as I have to iterate over all the events and compare it with a desired address (say browser client address).

Is it possible through web3js to access who triggered the event in the filtering itself ?

1

I believe you're looking for the indexed keyword used in Events.

This allows searching and filtering on events.

See: What does the indexed keyword do?

  • Yeah I was wondering if I were able to find that without adding another byte32 to every event emitted, but I guess that'll do, thanks :) – Random Jan 15 '18 at 20:45

Your Answer

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

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