Skip to content

Commit

Permalink
fix: infuraTransfer logic
Browse files Browse the repository at this point in the history
  • Loading branch information
min-96 committed Jul 29, 2024
1 parent c5e51b7 commit bed431a
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/main/kotlin/com/api/admin/service/TransferService.kt
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@ class TransferService(
when {
log.topics[0] == nativeTransferEventSignature ->
handleERC20Transfer(log, wallet, accountType, chainType,TransferType.NATIVE)
log.topics[0] == transferEventSignature && log.topics.size == 3 ->
handleERC20Transfer(log, wallet, accountType, chainType, TransferType.ERC20)
// log.topics[0] == transferEventSignature && log.topics.size == 3 ->
// handleERC20Transfer(log, wallet, accountType, chainType, TransferType.ERC20)
log.topics[0] == transferEventSignature && log.topics.size == 4 ->
handleERC721Transfer(log, wallet, accountType, chainType)
else -> Mono.empty()
Expand All @@ -98,12 +98,10 @@ class TransferService(
val to = parseAddress(log.topics[3])
val amount = when (transferType) {
TransferType.NATIVE -> parseNativeTransferAmount(log.data)
TransferType.ERC20 -> toBigDecimal(log.data)
// TransferType.ERC20 -> toBigDecimal(log.data)
else -> BigDecimal.ZERO
}

println("amount : " + amount)

val isRelevantTransfer = when (accountType) {
AccountType.DEPOSIT -> from.equals(wallet, ignoreCase = true) && to.equals(adminInfoProperties.address, ignoreCase = true)
AccountType.WITHDRAW -> from.equals(adminInfoProperties.address, ignoreCase = true) && to.equals(wallet, ignoreCase = true)
Expand Down

0 comments on commit bed431a

Please sign in to comment.