Replies: 1 comment
-
Updated: when converting json into a string, depending on how you accomplish this, what happens is that this can become padded with extra spacing or characters like '\n' |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I am using Ethers to listen to a Swap event from UniswapV3Pool instance link to ABI
I took this ABI, put it into a json file, and import it into my code, then I do something like
contract = new ethers.Contract(constractAddress, UNISWAP_ROUTER_ABI_V3, ethProvider);
if I console.log(contract.filters.Swap()) the return value is something like
{
address: ,
topics: [
'0xd78ad95fa46c994b6551d0da85fc275fe613ce37657fb8d5e3d130840159d822'
]
}
note if you look at the topic0 hash from the etherscan for example, the hash for this topic is actually "0xc42079f94a6350d7e6235f29174924f928cc2ac818eb64fed8004e115fbcca67"
https://etherscan.io/address/0x11950d141ecb863f01007add7d1a342041227b58#events
now, if I create something like
myfilter = { address: testPairV3, topics: [ "0xc42079f94a6350d7e6235f29174924f928cc2ac818eb64fed8004e115fbcca67" ] }
and do contract.on(myfilter, ()....)
This will successfully filter things out. Why is the topic value incorrect with this ABI? why even put an ABI here if I just need this value?
Beta Was this translation helpful? Give feedback.
All reactions