tx · 9WRNgwZzkKoMeUf3HUoV1xn6JuNbiKdscPx7vrb7q1So 3N8GKGgDPGGUaAhPMNtsxTJWafHDRnwL7GQ: -0.01000000 Waves 2023.05.31 01:12 [2601288] smart account 3N8GKGgDPGGUaAhPMNtsxTJWafHDRnwL7GQ > SELF 0.00000000 Waves
{ "type": 13, "id": "9WRNgwZzkKoMeUf3HUoV1xn6JuNbiKdscPx7vrb7q1So", "fee": 1000000, "feeAssetId": null, "timestamp": 1685484759374, "version": 2, "chainId": 84, "sender": "3N8GKGgDPGGUaAhPMNtsxTJWafHDRnwL7GQ", "senderPublicKey": "y5twTW93XMmi75S5bati2cok9QLLFivsrwJedxJeUkX", "proofs": [ "3V7DyDv6XLjMoHgNboDuPnXUiTjg2hruqN9ndDFM6tbQrj5BNb9uuBskNZWLDer1scid2wkPqSmuHn4ipBotZ48W" ], "script": "base64:BgIECAISAAUBD2dldFJhbmRvbU51bWJlcgAED3JhbmRvbVNlZWRCbG9jawkBBXZhbHVlAQkA7QcBCQBlAgUGaGVpZ2h0AAEECnJhbmRvbUhhc2gJANQWAQkBBXZhbHVlAQgFD3JhbmRvbVNlZWRCbG9jawN2cmYEA3N0cgkA2AQBBQpyYW5kb21IYXNoBAhsYXN0Q2hhcgkAsgICBQNzdHIAAgUIbGFzdENoYXIBEGdldFJhbmRvbU51bWJlcjIABA9yYW5kb21TZWVkQmxvY2sJAQV2YWx1ZQEJAO0HAQkAZQIFBmhlaWdodAABBApyYW5kb21IYXNoCQDUFgEJAQV2YWx1ZQEIBQ9yYW5kb21TZWVkQmxvY2sDdnJmCQCyAgIJAKQDAQkAsQkBBQpyYW5kb21IYXNoAAEBBnJhbmRvbQEBaQQPcmFuZG9tU2VlZEJsb2NrCQEFdmFsdWUBCQDtBwEJAGUCBQZoZWlnaHQAAQQKcmFuZG9tSGFzaAkA1BYBCQEFdmFsdWUBCAUPcmFuZG9tU2VlZEJsb2NrA3ZyZgQIbGFzdENoYXIJALICAgkApAMBCQCxCQEFCnJhbmRvbUhhc2gAAQQJbGFzdENoYXIyCQCyAgIJAKQDAQkAsQkBCAUBaQ10cmFuc2FjdGlvbklkAAEJAKwCAgUIbGFzdENoYXIFCWxhc3RDaGFyMgEHcmFuZG9tMgMBaQNtaW4DbWF4BAVvZnNldAkBDXBhcnNlSW50VmFsdWUBCQCyAgIJAKQDAQkAsQkBCAUBaQ10cmFuc2FjdGlvbklkAAEED3JhbmRvbVNlZWRCbG9jawkBBXZhbHVlAQkA7QcBCQBlAgUGaGVpZ2h0BQVvZnNldAQKcmFuZG9tSGFzaAkA1BYBCQEFdmFsdWUBCAUPcmFuZG9tU2VlZEJsb2NrA3ZyZgQIbGFzdENoYXIJALICAgkApAMBCQCxCQEFCnJhbmRvbUhhc2gABQQMcmFuZG9tTnVtYmVyCQBkAgkAagIJAQ1wYXJzZUludFZhbHVlAQUIbGFzdENoYXIJAGQCCQBlAgUDbWF4BQNtaW4AAQUDbWluBQxyYW5kb21OdW1iZXIBEGdldFJhbmRvbU51bWJlcjQBAWkED3JhbmRvbVNlZWRCbG9jawkBBXZhbHVlAQkA7QcBCQBlAgUGaGVpZ2h0AAEECnJhbmRvbUhhc2gJANQWAQkBBXZhbHVlAQgFD3JhbmRvbVNlZWRCbG9jawN2cmYJAKQDAQkAsQkBBQpyYW5kb21IYXNoAQFpAQV0ZXN0NwAEB2FkZHJlc3MJANgEAQgIBQFpBmNhbGxlcgVieXRlcwQCcjMJAQdyYW5kb20yAwUBaQABAAwJAJQKAgkAzAgCCQEMSW50ZWdlckVudHJ5AgIGcmFuZG9tBQJyMwUDbmlsAAEA3VbaDw==", "height": 2601288, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 7ZsHnM4gnvET5E79xx5VhA58Uk7LhyGoZTSDeVBEhbUP Next: 95BMFVXcZb3kZdYkULqydLoqLnwQGZYx1TqXWrreWBm8 Diff:
Old | New | Differences | |
---|---|---|---|
46 | 46 | @Callable(i) | |
47 | 47 | func test7 () = { | |
48 | 48 | let address = toBase58String(i.caller.bytes) | |
49 | - | let r3 = random2(i, 1, | |
49 | + | let r3 = random2(i, 1, 12) | |
50 | 50 | $Tuple2([IntegerEntry("random", r3)], 1) | |
51 | 51 | } | |
52 | 52 |
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 random (i) = { | |
21 | 21 | let randomSeedBlock = value(blockInfoByHeight((height - 1))) | |
22 | 22 | let randomHash = sha256_16Kb(value(randomSeedBlock.vrf)) | |
23 | 23 | let lastChar = takeRight(toString(toInt(randomHash)), 1) | |
24 | 24 | let lastChar2 = takeRight(toString(toInt(i.transactionId)), 1) | |
25 | 25 | (lastChar + lastChar2) | |
26 | 26 | } | |
27 | 27 | ||
28 | 28 | ||
29 | 29 | func random2 (i,min,max) = { | |
30 | 30 | let ofset = parseIntValue(takeRight(toString(toInt(i.transactionId)), 1)) | |
31 | 31 | let randomSeedBlock = value(blockInfoByHeight((height - ofset))) | |
32 | 32 | let randomHash = sha256_16Kb(value(randomSeedBlock.vrf)) | |
33 | 33 | let lastChar = takeRight(toString(toInt(randomHash)), 5) | |
34 | 34 | let randomNumber = ((parseIntValue(lastChar) % ((max - min) + 1)) + min) | |
35 | 35 | randomNumber | |
36 | 36 | } | |
37 | 37 | ||
38 | 38 | ||
39 | 39 | func getRandomNumber4 (i) = { | |
40 | 40 | let randomSeedBlock = value(blockInfoByHeight((height - 1))) | |
41 | 41 | let randomHash = sha256_16Kb(value(randomSeedBlock.vrf)) | |
42 | 42 | toString(toInt(randomHash)) | |
43 | 43 | } | |
44 | 44 | ||
45 | 45 | ||
46 | 46 | @Callable(i) | |
47 | 47 | func test7 () = { | |
48 | 48 | let address = toBase58String(i.caller.bytes) | |
49 | - | let r3 = random2(i, 1, | |
49 | + | let r3 = random2(i, 1, 12) | |
50 | 50 | $Tuple2([IntegerEntry("random", r3)], 1) | |
51 | 51 | } | |
52 | 52 | ||
53 | 53 |
github/deemru/w8io/169f3d6 40.52 ms ◑