用Java来说,用于汽油的资金不足*价格+价值

时间:2019-09-29 15:27:26

标签: java webdeploy

private static final Web3j web3j = Web3j.build(new HttpService("https://ropsten.infura.io/v3/d11459c1c17049628f462a1492c7df36"));

private static final Credentials hostCredentials = Credentials.create("666A82FC33F8134577A7BEB1BDEAA689BB72740178727691D63032432B83E0FB");

private static final BigInteger gasLimit = BigInteger.valueOf(6721975L);
private static final BigInteger gasPrice =  BigInteger.valueOf(2000000000000L);

在连接Ropsten之前,ganache已被链接。

GaslimitsGasprices是当时使用的来自ganache的信息。

但是,当我第一次连接到Ropsten时,标题没有错误。

 public String depart_wallet(String code) {
        String walletCode = "";
        switch(code) {
            case "ct_01" : 
                    walletCode = "83E094366642F531189D56DF33AC870DB53AF8C7F7F60A7A8B20CB85BC43A59F";
                    break;
            case "ft_01" :
                    walletCode = "666A82FC33F8134577A7BEB1BDEAA689BB72740178727691D63032432B83E0FB";
                    break;
            case "ms_01" :
                    walletCode = "3F0B5C58378DE554534A5A8C630AAC075886E74A6B3229000AE78F4500E153E3";
                    break;
            case "st_01" :
                    walletCode = "3B69CC479DBAC9B02D2B7C39F7829A2E5DF850203A1766355D854DD89FCC6848";
                    break;
            case "hr_01" :
                    walletCode = "3F1E2BD4EF8941731D244359F0CDF1EF079E5EAFFD57EA6D31ADDEB55E20D426";
                    break;
            case "mf_01" :
                    walletCode = "C6FD20908CDC2326A8A5E366228C149FA7632E9C4EF035F5B7EBEE1A04158B7E";
                    break;

        }
        return walletCode;
    }

 @SuppressWarnings("deprecation")
    public void budgetAdd(HttpServletRequest req, Model model) throws Exception {

        String department_code = req.getParameter("dept_code");

        String deptWallet = depart_wallet(department_code);

        Credentials dept_AccountNumber = Credentials.create(deptWallet);

        System.out.println(gasPrice);
        System.out.println(gasLimit);

        **String contractAddress2 = Materal.deploy(web3j, dept_AccountNumber, gasPrice, gasLimit).send().getContractAddress();**
    }
  

insufficient funds for gas * price + value

运行Service deploy()我遇到了。

您是否可以向我解释是否有人对此错误有任何了解?

使用方法deploy()时主题发生错误。

Of course there are enough ethers in metamask.

0 个答案:

没有答案