tx · 413QbaB38s6QNNH4LCLm6VvtLpX9sTaP68nsJQEeshKT 3N8GKGgDPGGUaAhPMNtsxTJWafHDRnwL7GQ: -0.01000000 Waves 2023.05.31 00:41 [2601263] smart account 3N8GKGgDPGGUaAhPMNtsxTJWafHDRnwL7GQ > SELF 0.00000000 Waves
{ "type": 13, "id": "413QbaB38s6QNNH4LCLm6VvtLpX9sTaP68nsJQEeshKT", "fee": 1000000, "feeAssetId": null, "timestamp": 1685482966578, "version": 2, "chainId": 84, "sender": "3N8GKGgDPGGUaAhPMNtsxTJWafHDRnwL7GQ", "senderPublicKey": "y5twTW93XMmi75S5bati2cok9QLLFivsrwJedxJeUkX", "proofs": [ "4r8FSDYtpAJMWQUHauoVeDyWyd3opbr7EhMjA5K7tHHdMsWzi1EB1AzH2U8oqRJ8e1JzcJ2YiNdb2aavsDPdtsXy" ], "script": "base64:BgIECAISAAQBD2dldFJhbmRvbU51bWJlcgAED3JhbmRvbVNlZWRCbG9jawkBBXZhbHVlAQkA7QcBCQBlAgUGaGVpZ2h0AAEECnJhbmRvbUhhc2gJANQWAQkBBXZhbHVlAQgFD3JhbmRvbVNlZWRCbG9jawN2cmYEA3N0cgkA2AQBBQpyYW5kb21IYXNoBAhsYXN0Q2hhcgkAsgICBQNzdHIAAgUIbGFzdENoYXIBEGdldFJhbmRvbU51bWJlcjIABA9yYW5kb21TZWVkQmxvY2sJAQV2YWx1ZQEJAO0HAQkAZQIFBmhlaWdodAABBApyYW5kb21IYXNoCQDUFgEJAQV2YWx1ZQEIBQ9yYW5kb21TZWVkQmxvY2sDdnJmCQCyAgIJAKQDAQkAsQkBBQpyYW5kb21IYXNoAAEBEGdldFJhbmRvbU51bWJlcjMABA9yYW5kb21TZWVkQmxvY2sJAQV2YWx1ZQEJAO0HAQkAZQIFBmhlaWdodAABBApyYW5kb21IYXNoCQDUFgEJAQV2YWx1ZQEIBQ9yYW5kb21TZWVkQmxvY2sDdnJmCQCkAwEJALEJAQUKcmFuZG9tSGFzaAEQZ2V0UmFuZG9tTnVtYmVyNAEBaQQKcmFuZG9tU2VlZAkAsQkBCQD1AwEIBQFpDXRyYW5zYWN0aW9uSWQEDHJhbmRvbU51bWJlcgkAZAIJAGoCBQpyYW5kb21TZWVkCQBkAgkAZQIA5wcA5wcAAQDnBwQPcmFuZG9tU2VlZEJsb2NrCQEFdmFsdWUBCQDtBwEJAGUCBQZoZWlnaHQFDHJhbmRvbU51bWJlcgQKcmFuZG9tSGFzaAkA1BYBCQEFdmFsdWUBCAUPcmFuZG9tU2VlZEJsb2NrA3ZyZgkApAMBCQCxCQEFCnJhbmRvbUhhc2gBAWkBBXRlc3Q3AAQHYWRkcmVzcwkA2AQBCAgFAWkGY2FsbGVyBWJ5dGVzBAFyCQEPZ2V0UmFuZG9tTnVtYmVyAAQCcjIJARBnZXRSYW5kb21OdW1iZXIyAAQCcjMJARBnZXRSYW5kb21OdW1iZXIzAAQCcjQJARBnZXRSYW5kb21OdW1iZXI0AQUBaQkAlAoCCQDMCAIJAQtTdHJpbmdFbnRyeQICA1hYWAUBcgkAzAgCCQELU3RyaW5nRW50cnkCAgRYWFgyBQJyMgkAzAgCCQELU3RyaW5nRW50cnkCAgRYWFgzBQJyMwkAzAgCCQELU3RyaW5nRW50cnkCAgRYWFg0BQJyNAUDbmlsAAEAuUBtEA==", "height": 2601263, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 13oCjiTfUYR3nDXPGe4qEhz5NF9HqsxwtqW92u8CUgG6 Next: B2onum3mA7GPi98S9R6y2NxFqzi8L3RDYGykbSYBno2z Diff:
Old | New | Differences | |
---|---|---|---|
39 | 39 | let r = getRandomNumber() | |
40 | 40 | let r2 = getRandomNumber2() | |
41 | 41 | let r3 = getRandomNumber3() | |
42 | - | $Tuple2([StringEntry("XXX", r), StringEntry("XXX2", r2), StringEntry("XXX3", r3)], 1) | |
42 | + | let r4 = getRandomNumber4(i) | |
43 | + | $Tuple2([StringEntry("XXX", r), StringEntry("XXX2", r2), StringEntry("XXX3", r3), StringEntry("XXX4", r4)], 1) | |
43 | 44 | } | |
44 | 45 | ||
45 | 46 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | func getRandomNumber () = { | |
5 | 5 | let randomSeedBlock = value(blockInfoByHeight((height - 1))) | |
6 | 6 | let randomHash = sha256_16Kb(value(randomSeedBlock.vrf)) | |
7 | 7 | let str = toBase58String(randomHash) | |
8 | 8 | let lastChar = takeRight(str, 2) | |
9 | 9 | lastChar | |
10 | 10 | } | |
11 | 11 | ||
12 | 12 | ||
13 | 13 | func getRandomNumber2 () = { | |
14 | 14 | let randomSeedBlock = value(blockInfoByHeight((height - 1))) | |
15 | 15 | let randomHash = sha256_16Kb(value(randomSeedBlock.vrf)) | |
16 | 16 | takeRight(toString(toInt(randomHash)), 1) | |
17 | 17 | } | |
18 | 18 | ||
19 | 19 | ||
20 | 20 | func getRandomNumber3 () = { | |
21 | 21 | let randomSeedBlock = value(blockInfoByHeight((height - 1))) | |
22 | 22 | let randomHash = sha256_16Kb(value(randomSeedBlock.vrf)) | |
23 | 23 | toString(toInt(randomHash)) | |
24 | 24 | } | |
25 | 25 | ||
26 | 26 | ||
27 | 27 | func getRandomNumber4 (i) = { | |
28 | 28 | let randomSeed = toInt(keccak256(i.transactionId)) | |
29 | 29 | let randomNumber = ((randomSeed % ((999 - 999) + 1)) + 999) | |
30 | 30 | let randomSeedBlock = value(blockInfoByHeight((height - randomNumber))) | |
31 | 31 | let randomHash = sha256_16Kb(value(randomSeedBlock.vrf)) | |
32 | 32 | toString(toInt(randomHash)) | |
33 | 33 | } | |
34 | 34 | ||
35 | 35 | ||
36 | 36 | @Callable(i) | |
37 | 37 | func test7 () = { | |
38 | 38 | let address = toBase58String(i.caller.bytes) | |
39 | 39 | let r = getRandomNumber() | |
40 | 40 | let r2 = getRandomNumber2() | |
41 | 41 | let r3 = getRandomNumber3() | |
42 | - | $Tuple2([StringEntry("XXX", r), StringEntry("XXX2", r2), StringEntry("XXX3", r3)], 1) | |
42 | + | let r4 = getRandomNumber4(i) | |
43 | + | $Tuple2([StringEntry("XXX", r), StringEntry("XXX2", r2), StringEntry("XXX3", r3), StringEntry("XXX4", r4)], 1) | |
43 | 44 | } | |
44 | 45 | ||
45 | 46 |
github/deemru/w8io/169f3d6 83.64 ms ◑