nimbus-eth1/nimbus/utils/addresses.nim

5 lines
207 B
Nim
Raw Normal View History

2019-02-05 20:15:50 +01:00
import nimcrypto, eth/[common, rlp]
2018-09-04 12:23:47 +01:00
2018-09-04 12:27:07 +01:00
func generateAddress*(address: EthAddress, nonce: AccountNonce): EthAddress =
result[0..19] = keccak256.digest(rlp.encodeList(address, nonce)).data.toOpenArray(12, 31)