[question] why do some events from contract.queryfilter not contain event/args fields?
See original GitHub issueHi, when using Contract.queryFilter
like this:
let eventFilter = [myContract.filters.Transfer()];
let events = await myContract.queryFilter(eventFilter, start, end);
I will get some events in the result which have more fields, for example:
{
blockNumber: 10789332,
blockHash: '0xfbe6daf633495f2a93cbf5bc1a6689e0706988f99a880a50737a6cbf97c6382c',
transactionIndex: 87,
removed: false,
address: '0x5d3a536E4D6DbD6114cc1Ead35777bAB948E3643',
data: '0x00000000000000000000000000000000000000000000000000007b7ba1e9f76f',
topics: [Array],
transactionHash: '0xd6baeaba7efe0a3ac68780d0989529f352f5b864792999c88ab9717fb770e35c',
logIndex: 115,
removeListener: [Function (anonymous)],
getBlock: [Function (anonymous)],
getTransaction: [Function (anonymous)],
getTransactionReceipt: [Function (anonymous)],
event: 'Transfer',
eventSignature: 'Transfer(address,address,uint256)',
decode: [Function (anonymous)],
args: [Array]
}
and then some that are missing the event
and args
fields:
{
blockNumber: 10789343,
blockHash: '0x289150bd3ede2232d22c7942cc08536ccfc0a946d07363f57450ca46418dcdc0',
transactionIndex: 161,
removed: false,
address: '0x5d3a536E4D6DbD6114cc1Ead35777bAB948E3643',
data: '0x0000000000000000000000000000000000000000008774d0e485a3ec063a456c000000000000000000000000000000000000000000000006758649801e7630120000000000000000000000000000000000000000000000000e660927316e4048000000000000000000000000000000000000000001e23cbabd51e00c615e49c4',
topics: [Array],
transactionHash: '0x8d309caf871307c45ac0e54ee79b04d8538a7ebd90b833faf320c8aa9a2e217c',
logIndex: 150,
removeListener: [Function (anonymous)],
getBlock: [Function (anonymous)],
getTransaction: [Function (anonymous)],
getTransactionReceipt: [Function (anonymous)]
}
what is the reason for both appearing in the result set? Can these events safely be skipped?
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (1 by maintainers)
Top Results From Across the Web
[question] why do some events from contract.queryfilter not ...
Hi, when using Contract.queryFilter like this: let eventFilter = [myContract.filters.Transfer()]; let events = await myContract.
Read more >To get event args when I using ethers.js
I suggest to try OpenZeppelin test helpers. They have a check expectEvent that reads events from the transaction's receipt.
Read more >ethers-io/Lobby - Gitter
I make a call that trigger lost of events in contract further down the chain, and since the caller contract does not have...
Read more >EventArgs Constructor (System) - Microsoft Learn
EventArgs Class (System) ... Represents the base class for classes that contain event data, and provides a value to use for events that...
Read more >Contract event listener is not firing when running hardhat tests ...
The full answer is here: https://github.com/nomiclabs/hardhat/issues/1692#issuecomment-905674692. But to summarise, the reason this doesn't ...
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
I was able to solve this with your tip, thanks
I tried to get events for “TransferSingle” event, but I can not get them , and it is not returning any value. const _events = await contract.queryFilter(“TransferSingle”, collection.fetchedLastBlockNumber);