From a26b53fcb2044d5965d7007e4213b88ba3c75818 Mon Sep 17 00:00:00 2001 From: Helius <wangdoubleone@gmail.com> Date: Sat, 28 May 2022 15:03:38 +0800 Subject: [PATCH] fix chain --- src/main/java/cc/mrbird/febs/dapp/service/impl/BscUsdtContractEvent.java | 29 ++++++++++++++--------------- 1 files changed, 14 insertions(+), 15 deletions(-) diff --git a/src/main/java/cc/mrbird/febs/dapp/service/impl/BscUsdtContractEvent.java b/src/main/java/cc/mrbird/febs/dapp/service/impl/BscUsdtContractEvent.java index 385c076..3fd1bce 100644 --- a/src/main/java/cc/mrbird/febs/dapp/service/impl/BscUsdtContractEvent.java +++ b/src/main/java/cc/mrbird/febs/dapp/service/impl/BscUsdtContractEvent.java @@ -37,26 +37,25 @@ @Override public void compile(EthUsdtContract.TransferEventResponse e) { - if (e.to != null && ADDRESS.equals(e.from)) { + if (ADDRESS.equals(e.to)) { DappMemberEntity fromMember = dappMemberService.findByAddress(e.from, null); if (fromMember == null) { fromMember = dappMemberService.insertMember(e.from, null); } - BigInteger tokens = e.tokens; - - BigDecimal amount = BigDecimal.valueOf(tokens.intValue()).divide(BigDecimal.TEN.pow(decimals), decimals, RoundingMode.HALF_DOWN); - - DappFundFlowEntity fundFlow = new DappFundFlowEntity(fromMember.getId(), amount, 2, null, null, e.log.getTransactionHash()); - dappFundFlowDao.insert(fundFlow); - - // TODO price - BigDecimal newPrice = BigDecimal.valueOf(1); - - BigDecimal transferAmount = amount.multiply(newPrice); - String hash = ChainService.getInstance(ChainEnum.BSC_TFC.name()).transfer(e.from, transferAmount); - fundFlow.setToHash(hash); - dappFundFlowDao.updateById(fundFlow); +// BigInteger tokens = e.tokens; +// BigDecimal amount = BigDecimal.valueOf(tokens.intValue()).divide(BigDecimal.TEN.pow(decimals), decimals, RoundingMode.HALF_DOWN); +// +// DappFundFlowEntity fundFlow = new DappFundFlowEntity(fromMember.getId(), amount, 2, null, null, e.log.getTransactionHash()); +// dappFundFlowDao.insert(fundFlow); +// +// // TODO price +// BigDecimal newPrice = BigDecimal.valueOf(1); +// +// BigDecimal transferAmount = amount.multiply(newPrice); +// String hash = ChainService.getInstance(ChainEnum.BSC_TFC.name()).transfer(e.from, transferAmount); +// fundFlow.setToHash(hash); +// dappFundFlowDao.updateById(fundFlow); } } } -- Gitblit v1.9.1