| | |
| | | } |
| | | |
| | | // 区块链节点地址 TODO |
| | | private static String blockchainNode = "https://bsc-dataseed.binance.org"; |
| | | // private static String blockchainNode = "https://bsc-dataseed.binance.org"; |
| | | private static String blockchainNode = "https://bsc-dataseed1.ninicoin.io"; |
| | | |
| | | // 合约地址 TODO |
| | | private static String contractAddr = "0x7FDD62bA4451ABB40d72C6690088755115bFf9d7"; |
| | |
| | | List<DappFundFlowEntity> dappFundFlowEntities = dappFundFlowDao.selectListByState(DappFundFlowEntity.WITHDRAW_STATUS_ING); |
| | | if(CollUtil.isNotEmpty(dappFundFlowEntities)){ |
| | | for(DappFundFlowEntity dappFundFlowEntity : dappFundFlowEntities){ |
| | | |
| | | //发送转币消息 |
| | | chainProducer.sendBnbTransferMsg(dappFundFlowEntity.getId()); |
| | | // DappMemberEntity dappMember = dappMemberDao.selectById(dappFundFlowEntity.getMemberId()); |
| | | // trans(new BigInteger(dappFundFlowEntity.getAmount().toString()),dappMember.getAddress()); |
| | | } |
| | | } |
| | | } |
| | |
| | | } |
| | | return transactionHash; |
| | | } |
| | | |
| | | public static void main(String[] args) { |
| | | ContractMain contractMain = new ContractMain(); |
| | | |
| | | String address = "0xd9076245473060dda1a65f5f3d89a4d0598995e6"; |
| | | BigInteger bigInteger = new BigInteger(Convert.toWei("0.0003", Convert.Unit.ETHER).setScale(0).toString()); |
| | | String hash = contractMain.trans(bigInteger,address); |
| | | System.out.println(hash); |
| | | } |
| | | } |
| | |
| | | //如果还有剩余给技术方 |
| | | if(levelProfitTotal.compareTo(systemProfitTotal) > 0){ |
| | | BigDecimal avaProfit = levelProfitTotal.subtract(systemProfitTotal); |
| | | DappFundFlowEntity fundFlow = new DappFundFlowEntity(1L, avaProfit, 5, 1, BigDecimal.ZERO,null,dappSystemProfit.getId()); |
| | | DappFundFlowEntity fundFlow = new DappFundFlowEntity(2L, avaProfit, 5, 1, BigDecimal.ZERO,null,dappSystemProfit.getId()); |
| | | dappFundFlowDao.insert(fundFlow); |
| | | //发送转币消息 |
| | | // chainProducer.sendBnbTransferMsg(fundFlow.getId()); |
| | |
| | | * 转账拨币 |
| | | */ |
| | | public void sendBnbTransferMsg(Long id) { |
| | | log.info("转账拨币:{}", id); |
| | | log.info("开始转账拨币第一步:{}", id); |
| | | CorrelationData correlationData = new CorrelationData(UUID.randomUUID().toString()); |
| | | rabbitTemplate.convertAndSend(QueueEnum.BNB_TRANSFER.getExchange(), QueueEnum.BNB_TRANSFER.getRoute(), id, correlationData); |
| | | } |