Skip to content

Commit bb4f754

Browse files
authored
Merge pull request #1846 from oasisprotocol/lw/fix-burning-detect
Fix detecting burning events
2 parents e8b78d1 + 2dad3b9 commit bb4f754

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

.changelog/1846.bugfix.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix detecting burning events

src/app/utils/parseEvmEvent.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ const NULL_ADDRESS = '0x0000000000000000000000000000000000000000'
55
export function parseEvmEvent(event: RuntimeEvent) {
66
const fromAddress = event.evm_log_params?.find(param => param.name === 'from')?.value as string | undefined
77
const toAddress = event.evm_log_params?.find(param => param.name === 'to')?.value as string | undefined
8-
const isMinting = fromAddress === NULL_ADDRESS
9-
const isBurning = toAddress === NULL_ADDRESS
8+
const isMinting = event.evm_log_name === 'Transfer' && fromAddress === NULL_ADDRESS
9+
const isBurning = event.evm_log_name === 'Transfer' && toAddress === NULL_ADDRESS
1010
const parsedEvmLogName = isMinting ? 'Minting' : isBurning ? 'Burning' : event.evm_log_name || undefined
1111

1212
return {

0 commit comments

Comments
 (0)