I've been trying to get the arguments of an event that was emitted from a contract function call. But had no luck so far.
based on what i've found something like this should work:
const tx = await eventEmitter.emitBothEvents(42, "foo");
const receipt = await tx.wait()
for (const event of receipt.events) {
console.log(`Event ${event.event} with args ${event.args}`);
}
(https://github.com/fvictorio/hardhat-examples/blob/master/reading-events/scripts/getEventsFromTx.js)
But receipt.events is always undefined no matter what function i call.
So.. been there any updates to this or something? any other ways i can achieve this?
found a solution: