web3j gasused gasprice Transaction input__web

Source: Internet
Author: User
//ethgettransactionreceipt send = web3jclient.getweb3j (). Ethgettransactionreceipt (Txhash). Send (
);
Ethtransaction send1 = web3jclient.getweb3j (). Ethgettransactionbyhash (Txhash). Send ();
BigInteger transactionreceipt = Send1.gettransaction (). Get (). Getgasprice (); BigInteger gasused = Send.gettransactionreceipt (). Get (). getgasused (); 
 public void Parseinput () {String inputdata = "0xa9059cbb0000000000000000000000006a2972e43f38f0b8217c119394d9b5a4c
        d116e9c000000000000000000000000000000000000000000000001bc16d674ec800000 ";
        String method = Inputdata.substring (0,10);
        String to = inputdata.substring (10,74);
        String value = inputdata.substring (74);
        Method refmethod = null;
        try {Refmethod = TypeDecoder.class.getDeclaredMethod ("decode", String.class,int.class,class.class);
        catch (Nosuchmethodexception e) {e.printstacktrace ();
        } refmethod.setaccessible (True);
        Address address = null;
        try {address = Refmethod.invoke (Null,to,0,address.class);
        catch (Illegalaccessexception e) {e.printstacktrace ();
        catch (InvocationTargetException e) {e.printstacktrace ();
        } Uint256 amount = null; try {amount = (Uint256) REFMETHOD.INVOke (Null,value,0,uint256.class);
        catch (Illegalaccessexception e) {e.printstacktrace ();
        catch (InvocationTargetException e) {e.printstacktrace (); } System.out.println ("method=" +method+ "\nto=" +to+ "\nvalue=" +value+ "\naddress=" +address.getvalue () + "\namount=" +
    Amount.getvalue ());
 }


Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.