0

I'm using web3J library in my java app. I got an address of a deployed contract and would like to get it's binary or abi from the blockchain using my java app, how can I do that?

1

here is how to read the bytecode using web3j:

    EthGetCode ethGetCode = web3j.ethGetCode("0x248b73642eab74b3cfb32f5ecd0ff1a12a5e6a4f",DefaultBlockParameterName.LATEST).send();
    String s=ethGetCode.getCode();
    System.out.println(s);

for the ABI you can't read it from the blockchain but you have to generate it from the code if you have it.

  • Thanks Badr. Do you happen to know how can I get the contract creator address via web3j? – forhas Jul 26 '18 at 7:43

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.