Skip to content

Instantly share code, notes, and snippets.

@0xCourtney
Created July 8, 2022 14:20
Show Gist options
  • Save 0xCourtney/c0508346edc139306d96e2edb82768aa to your computer and use it in GitHub Desktop.
Save 0xCourtney/c0508346edc139306d96e2edb82768aa to your computer and use it in GitHub Desktop.
Get event and event arguements emitted
async function getEvent(tx: any, event: string) {
let receipt = await tx.wait();
return receipt.events?.filter((x) => {
return x.event == event;
});
}
async function getEventArgs(tx: any, event: string) {
return (await getEvent(tx, event))[0].args;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment