Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Event listener does not catch anything from provider or contract when using multiple topics in a filter. #5

Open
creamcroutons opened this issue Feb 23, 2022 · 0 comments

Comments

@creamcroutons
Copy link

When using a contract or provider event listener, the listener will NOT catch any logs if there are multiple topics in the filter.
Ex. 1:

const filter = {
	address: contract_address,
	topics: [
		utils.id('Transfer(address,address,uint256)'),
		utils.hexZeroPad(address, 32)
	]
}

This will not catch any logs/events at all. Whereas just one topic will work as expected.
Ex. 2:

const filter = {
	address: contract_address,
	topics: [
		utils.id('Transfer(address,address,uint256)')
	]
}

This returns the expected transaction. I have tried with more topics, null placeholders, and ensured proper formatting. When using the second provided filter, the topics in the returned transaction match exactly what the topics of the first filter would look like.
I was stumped on this for a long time before I switched to a BscScan JsonRpcProvider where the first filter worked as intended. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant