Smart Contract
RandomKeyGenerator
A.73895b75543f996d.RandomKeyGenerator
1access(all) contract RandomKeyGenerator {
2
3 access(all) fun generateRandomKey(): UInt64 {
4 let blockHeight = getCurrentBlock().height
5 let blockTimestamp = getCurrentBlock().timestamp
6
7 let timestampAsUInt64 = UInt64(blockTimestamp)
8
9 let randomKey = blockHeight ^ timestampAsUInt64
10 return randomKey
11 }
12}
13
14
15
16
17
18
19
20
21