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
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?– forhasCommented Jul 26, 2018 at 7:43