From bed431ac01eca9985d572d946da80481bf010319 Mon Sep 17 00:00:00 2001 From: min-96 Date: Mon, 29 Jul 2024 23:00:52 +0900 Subject: [PATCH] fix: infuraTransfer logic --- src/main/kotlin/com/api/admin/service/TransferService.kt | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/main/kotlin/com/api/admin/service/TransferService.kt b/src/main/kotlin/com/api/admin/service/TransferService.kt index 000b1df..62cf074 100644 --- a/src/main/kotlin/com/api/admin/service/TransferService.kt +++ b/src/main/kotlin/com/api/admin/service/TransferService.kt @@ -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() @@ -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)