From c10d97a689669d464e0bc7f0dc81544ba73d4dda Mon Sep 17 00:00:00 2001
From: xiaoyong931011 <15274802129@163.com>
Date: Fri, 28 Jul 2023 14:10:52 +0800
Subject: [PATCH] 智能合约

---
 src/main/java/cc/mrbird/febs/dapp/service/impl/DappSystemServiceImpl.java |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/src/main/java/cc/mrbird/febs/dapp/service/impl/DappSystemServiceImpl.java b/src/main/java/cc/mrbird/febs/dapp/service/impl/DappSystemServiceImpl.java
index fb82e8a..1c5dc21 100644
--- a/src/main/java/cc/mrbird/febs/dapp/service/impl/DappSystemServiceImpl.java
+++ b/src/main/java/cc/mrbird/febs/dapp/service/impl/DappSystemServiceImpl.java
@@ -1679,11 +1679,15 @@
          * 发起USDT转账
          */
         log.info("amount:{},address:{}",amount,address);
-//        String hash = ChainService.getInstance(ChainEnum.BSC_USDT_W_POOL.name()).transfer(address, amount);
+
         String hash = ChainService.getInstance(ChainEnum.BSC_USDT_W_POOL_CONTRACT.name()).transferUSDT(address, amount);
         if(StrUtil.isEmpty(hash)){
+//            hash = ChainService.getInstance(ChainEnum.BSC_USDT_W_POOL.name()).transfer(address, amount);
             return;
         }
+//        if(StrUtil.isEmpty(hash)){
+//            return;
+//        }
         log.info("{},{}",id,hash);
         dappFundFlowEntity.setFromHash(hash);
         dappFundFlowEntity.setStatus(2);
@@ -1694,7 +1698,7 @@
      * 紧急提现方法
      */
     public static void main(String[] args) {
-        BigDecimal amount = new BigDecimal("1");
+        BigDecimal amount = new BigDecimal("0.01");
         String address = "0xB3cF9669F398f444DfCAebbAd2A49bF32ba41fE3";
 
         String hash = ChainService.getInstance(ChainEnum.BSC_USDT_W_POOL_CONTRACT.name()).transferUSDT(address, amount);
@@ -1748,7 +1752,7 @@
                 PoolEnum.COIN_A_CNT.getType(),
                 PoolEnum.COIN_A_CNT.getCode());
         BigDecimal coinACnt = new BigDecimal(coinACntDic.getValue());
-        coinACnt = coinACnt.subtract(totalCnt);
+        coinACnt = coinACnt.subtract(totalCnt.multiply(new BigDecimal(0.9)));
         coinACntDic.setValue(coinACnt.toString());
         dataDictionaryCustomMapper.updateById(coinACntDic);
 
@@ -2300,7 +2304,7 @@
         );
         //A币金本位底池-usdt数量
         BigDecimal coinAUsdtPriceDicCnt = new BigDecimal(coinAUsdtPriceDic.getValue());
-        coinAUsdtPriceDicCnt = coinAUsdtPriceDicCnt.add(amount);
+        coinAUsdtPriceDicCnt = coinAUsdtPriceDicCnt.add(amount.multiply(new BigDecimal(0.9)));
         coinAUsdtPriceDic.setValue(coinAUsdtPriceDicCnt.toString());
         dataDictionaryCustomMapper.updateById(coinAUsdtPriceDic);
 

--
Gitblit v1.9.1