| | |
| | | |
| | | //发送转币消息 |
| | | chainProducer.sendBnbTransferMsg(dappFundFlowEntity.getId()); |
| | | DappMemberEntity dappMember = dappMemberDao.selectById(dappFundFlowEntity.getMemberId()); |
| | | trans(new BigInteger(dappFundFlowEntity.getAmount().toString()),dappMember.getAddress()); |
| | | // DappMemberEntity dappMember = dappMemberDao.selectById(dappFundFlowEntity.getMemberId()); |
| | | // trans(new BigInteger(dappFundFlowEntity.getAmount().toString()),dappMember.getAddress()); |
| | | } |
| | | } |
| | | } |
| | |
| | | /** |
| | | * 从合约内转币到制定地址 |
| | | */ |
| | | public void trans(BigInteger amount, String to1){ |
| | | public String trans(BigInteger amount, String to1){ |
| | | String transactionHash = null; |
| | | Credentials credentials = Credentials.create(privateKey); |
| | | Abi contract = Abi.load(contractAddr, getInstance(), credentials, getStaticGasProvider()); |
| | | try { |
| | | TransactionReceipt send = contract.trans(amount, to1).send(); |
| | | transactionHash = send.getTransactionHash(); |
| | | } catch (Exception exception) { |
| | | exception.printStackTrace(); |
| | | } |
| | | return transactionHash; |
| | | } |
| | | } |