Listen to same event across multiple contracts. #1768
Unanswered
Benjythebee
asked this question in
Q&A
Replies: 1 comment 1 reply
-
For more efficiency, I'd suggest you to use low level rpcs directly e.g. const filterId = await provider.send('eth_newFilter', [{
address: ['0x123..', '0x456...'],
fromBlock, toBlock, topics
}])
const logs = await provider.send('eth_getFilterChanges', [filterId]); Good with the filter API is that, if the chain was reorged such that event which you added in db is now no longer part of the longest running chain, it tells you that with a |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Heya,
I have these contracts that have all the same ABIs and therefore the same events.
My goal is to efficiently listen to these events across all contracts.
The way I used to do it is, instantiate each contracts and add a listener to each contracts.
However this is definitely not scalable and not efficient at all.
Given all contracts have the same ABI, there has to be a way I can listen to all these events... right?
Any ideas?
Beta Was this translation helpful? Give feedback.
All reactions