nimbus-eth1/nimbus/utils/addresses.nim
2018-09-26 12:58:23 +03:00

5 lines
205 B
Nim

import nimcrypto, eth_common, rlp
func generateAddress*(address: EthAddress, nonce: AccountNonce): EthAddress =
result[0..19] = keccak256.digest(rlp.encodeList(address, nonce)).data.toOpenArray(12, 31)