public static byte [ ] generateContractAddress ( byte [ ] address , BigInteger nonce ) { List < RlpType > values = new ArrayList <> ( ) ; values . add ( RlpString . create ( address ) ) ; values . add ( RlpString . create ( nonce ) ) ; RlpList rlpList = new RlpList ( values ) ; byte [ ] encoded = RlpEncoder . encode ( rlpList ) ; byte [ ] hashed = Hash . sha3 ( encoded ) ; return Arrays . copyOfRange ( hashed , 12 , hashed . length ) ; }
Generate a smart contract address . This enables you to identify what address a smart contract will be deployed to on the network .