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 Answer 1


here is how to read the bytecode using web3j:

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

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, 2018 at 7:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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