Event parsing function
ItsNickBarry opened this issue · 2 comments
ItsNickBarry commented
Draft provided by @Lumyo
import { ContractReceipt } from 'ethers';
import { Interface } from 'ethers/lib/utils';
import { LogDescription } from '@ethersproject/abi';
function getEvents(
contractInterface: Interface,
receipt: ContractReceipt,
) {
const events: LogDescription[] = [];
for (const log of receipt.logs) {
try {
events.push(contractInterface.parseLog(log));
} catch (e) {}
}
return events;
}
0xCourtney commented
This would probably go well inside the lib
package or it could be hardhat-plugin 🤔 . Was there anything that stopped this from being implemented?
ItsNickBarry commented
It should go in lib
. It's blocked by the fact that lib
is disorganized and lowest priority.