Skip to content

Commit

Permalink
Fix bug detecting incoming USDC HTLC redeem transfers
Browse files Browse the repository at this point in the history
Against its type definition, receipt.contractAddress was `null` here, and not a `string`. Falling back to `log.address` will always produce the actual token address.
  • Loading branch information
sisou committed Jan 29, 2024
1 parent 90675ee commit 6c22c0b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/ethers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ async function transactionListener(from: string, to: string, value: BigNumber, l

let tx: Transaction;
if (receipt) {
tx = await receiptToTransaction(receipt.contractAddress, receipt, undefined, block);
tx = await receiptToTransaction(log.address, receipt, undefined, block);
} else {
tx = logAndBlockToPlain(log, block);
}
Expand All @@ -283,7 +283,7 @@ async function transactionListener(from: string, to: string, value: BigNumber, l
addresses.push(to);
}

if (receipt?.contractAddress === config.usdc.nativeUsdcContract || log.address === config.usdc.nativeUsdcContract) {
if (log.address === config.usdc.nativeUsdcContract) {
updateNativeBalances(addresses);
} else {
updateBalances(addresses);
Expand Down

0 comments on commit 6c22c0b

Please sign in to comment.