I'm looking for the java version of the solution of this question.
How is the address of an Ethereum contract computed?
Actually I want have a solution of the problem below.
I have a master contract which creates many sub contracts. And I need to get the addresses of the sub contracts when it's created.
master contract creates sub contract with a function like this
function createForwarder() public returns (address) {
return new Forwarder();
}
But I can't get the address from this function. I'm using web3j and it has not internal transaction concept. So I need to get the address with another way.
What will be the best solution for me?