I'm currently running a full node and am trying to loop through some transactions. Whenever I do so with Web3j and use the EthBlock.TransactionObject
and I get to a transaction that contains a contract (Like this one) and use the .getTo()
function it returns a null value. Is there any way for me to retrieve the contract address?
EDIT: This is the code im using to get the transaction
EthBlock.Block block = web3.ethGetBlockByNumber(DefaultBlockParameter.valueOf(BigInteger.valueOf(1397553)), true).send().getBlock();
List<EthBlock.TransactionResult> transactionResults = block.getTransactions();
transactionResults.forEach(tx -> {
EthBlock.TransactionObject transaction = (EthBlock.TransactionObject) tx.get();
System.out.println(transaction.getCreates());
});
This returns a "null"