| | |
| | | |
| | | //币种 |
| | | if (StringUtils.isNotEmpty(amountStr)) { |
| | | amount = new BigDecimal(amountStr).divide(new BigDecimal(1 + TransformUtil.getSeqNumByLong(0L, 6))); |
| | | if (TRC20_CONTRACT_ADDRESS.equals(contract_address)) { |
| | | // USDT精度为6 |
| | | amount = new BigDecimal(amountStr).divide(new BigDecimal(1 + TransformUtil.getSeqNumByLong(0L, 6))); |
| | | } else { |
| | | // 代币精度为8 |
| | | amount = new BigDecimal(amountStr).divide(new BigDecimal(1 + TransformUtil.getSeqNumByLong(0L, 8))); |
| | | } |
| | | } |
| | | for (String address : addressList) { |
| | | if (address.equals(to_address)) { |
| | |
| | | if (trc20_pool != null) { |
| | | poolList = (List) trc20_pool; |
| | | } |
| | | poolList.add(address); |
| | | |
| | | if (!poolList.contains(address)){ |
| | | poolList.add(address); |
| | | } |
| | | redisUtils.set("TRC20_POOL", poolList); |
| | | return true; |
| | | } |
| | |
| | | public boolean poolUsdt(String address) { |
| | | // 转 |
| | | BigDecimal trc20Balance = Trc20Service.getTrc20Balance(address); |
| | | if (trc20Balance == null) { |
| | | if (trc20Balance == null || BigDecimal.ZERO.compareTo(trc20Balance) <= 0) { |
| | | return false; |
| | | } |
| | | MemberCoinAddressEntity coinAddressEntity = memberCoinAddressDao.selectCoinAddressByAddressAndSymbolTag(address, "USDT", "TRC20"); |
| | |
| | | |
| | | Trc20Contract token = contractToken(coinAddress.getAddress(), coinAddress.getPrivateKey()); |
| | | BigInteger balance = token.balanceOf(address); |
| | | if (balance == null || balance.compareTo(BigInteger.ZERO) == 0) { |
| | | if (balance == null || balance.compareTo(BigInteger.ZERO) <= 0) { |
| | | return false; |
| | | } |
| | | |