Bug: Listening to topic sets doesn't work
See original GitHub issueI am referring to the documentation provided here My goal is to listen to events on a list of addresses of my choice. I figured the topicset would be useful in this regard.
const topicSet = [
'0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef',
null,
[ '0xf687BfA503376e088C6032cD277EEbdf19af4c7d' ]
]
This is the topic set I tried using, and got this error
p.on(topicSet, (event) => console.log(event))
Uncaught:
Error: invalid topic (argument="topic", value="0xf687BfA503376e088C6032cD277EEbdf19af4c7d", code=INVALID_ARGUMENT, version=providers/5.0.14)
at Logger.makeError (@ethersproject/logger/lib/index.js:179:21)
at Logger.throwError (@ethersproject/logger/lib/index.js:188:20)
at Logger.throwArgumentError (@ethersproject/logger/lib/index.js:191:21)
at checkTopic (@ethersproject/providers/lib/base-provider.js:75:16)
at @ethersproject/providers/lib/base-provider.js:90:26
at Array.forEach (<anonymous>) {
reason: 'invalid topic',
code: 'INVALID_ARGUMENT',
argument: 'topic',
value: '0xf687BfA503376e088C6032cD277EEbdf19af4c7d'
}
Issue Analytics
- State:
- Created 3 years ago
- Comments:10 (5 by maintainers)
Top Results From Across the Web
Troubleshoot audio and video issues on your computer or ...
Running the audio troubleshooter may help resolve your issue, but it requires administrative access to your computer. To run troubleshooting ...
Read more >FM Listening Bug : 12 Steps (with Pictures) - Instructables
1. As you can see in the schematic below this is a very simple circuit and will be an easy build. On thing...
Read more >[Fixed] No Sound on Windows 10 - Quickly & Easily
If you get no sound error after upgrading to Windows 10 from a previous version of Window. Don't worry. Here are three simple...
Read more >How to Sweep For Bugs and Hidden Cameras | WIRED
First, take a close look at your surroundings. Carefully check for anything new or out of place, and listen to your gut about...
Read more >PulseAudio/Troubleshooting - ArchWiki
If sound does not play when PulseAudio's volume is set below a certain level, or if you hear clipping on output even at...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Sorry it’s been so long since I looked into this. Yes, after investigating, I see that the topics were incorrectly encoded. Every topic must be 32 bytes, so the address needs to be zero padded to be 32 bytes wide.
Thanks @andrevmatos! Yes, that is the easiest way to encode any of the static types. To encode any dynamic types, you will need to use
utils.id
for string andutils.keccak256
for bytes.I’m guessing that solution worked for you @rymnc?
I think that, when you’re passing raw topics, you need to encode them first. If you use the interface’s factories for events/topics, then it already encodes it for you. On your case, you’re trying to pass an
address
(20 bytes long) astopic[2]
. Try to encode it with[defaultAbiCoder.encode(['address'], [address])]
.