tx · 9iyUtxZsqFLEJr6q4MR3taxD2AFnxMCYPXssR3FuvZC5
3N8GKGgDPGGUaAhPMNtsxTJWafHDRnwL7GQ: -0.01000000 Waves
2023.05.31 00:35 [2601258] smart account 3N8GKGgDPGGUaAhPMNtsxTJWafHDRnwL7GQ > SELF 0.00000000 Waves
{
"type": 13,
"id": "9iyUtxZsqFLEJr6q4MR3taxD2AFnxMCYPXssR3FuvZC5",
"fee": 1000000,
"feeAssetId": null,
"timestamp": 1685482550335,
"version": 2,
"chainId": 84,
"sender": "3N8GKGgDPGGUaAhPMNtsxTJWafHDRnwL7GQ",
"senderPublicKey": "y5twTW93XMmi75S5bati2cok9QLLFivsrwJedxJeUkX",
"proofs": [
"yDg6H9NzT2Qc956iHD7n1Chg9wBZLxa3kyWUpXkEAHNVNxPvBCr9V6rWSyPLteozqJgi22NjPVodqLTrKMf3ttQ"
],
"script": "base64:BgIECAISAAIBD2dldFJhbmRvbU51bWJlcgAED3JhbmRvbVNlZWRCbG9jawkBBXZhbHVlAQkA7QcBCQBlAgUGaGVpZ2h0AAEECnJhbmRvbUhhc2gJANQWAQkBBXZhbHVlAQgFD3JhbmRvbVNlZWRCbG9jawN2cmYEA3N0cgkA2AQBBQpyYW5kb21IYXNoBAhsYXN0Q2hhcgkAsgICBQNzdHIAAgUIbGFzdENoYXIBEGdldFJhbmRvbU51bWJlcjIABA9yYW5kb21TZWVkQmxvY2sJAQV2YWx1ZQEJAO0HAQkAZQIFBmhlaWdodAABBApyYW5kb21IYXNoCQDUFgEJAQV2YWx1ZQEIBQ9yYW5kb21TZWVkQmxvY2sDdnJmCQCyAgIJAKQDAQkAsQkBBQpyYW5kb21IYXNoAAEBAWkBBXRlc3Q3AAQHYWRkcmVzcwkA2AQBCAgFAWkGY2FsbGVyBWJ5dGVzBAFyCQEPZ2V0UmFuZG9tTnVtYmVyAAQCcjIJARBnZXRSYW5kb21OdW1iZXIyAAkAlAoCCQDMCAIJAQtTdHJpbmdFbnRyeQICA1hYWAUBcgkAzAgCCQELU3RyaW5nRW50cnkCAgRYWFgyBQJyMgUDbmlsAAEAaR4RYg==",
"height": 2601258,
"applicationStatus": "succeeded",
"spentComplexity": 0
}
View: original | compacted
Prev: DQLqqkML3tNNptJR8R2P5YpHBCMmi9Bq1C1Dw9KVqX7o
Next: CzeQdqxeCqL9fh64rYqXf8kP9uSew4pfnAefF145x52
Diff:
Old | New | | Differences |
---|
13 | 13 | | func getRandomNumber2 () = { |
---|
14 | 14 | | let randomSeedBlock = value(blockInfoByHeight((height - 1))) |
---|
15 | 15 | | let randomHash = sha256_16Kb(value(randomSeedBlock.vrf)) |
---|
16 | | - | toString(toInt(randomHash)) |
---|
| 16 | + | takeRight(toString(toInt(randomHash)), 1) |
---|
17 | 17 | | } |
---|
18 | 18 | | |
---|
19 | 19 | | |
---|
Full:
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 | | - | toString(toInt(randomHash)) |
---|
| 16 | + | takeRight(toString(toInt(randomHash)), 1) |
---|
17 | 17 | | } |
---|
18 | 18 | | |
---|
19 | 19 | | |
---|
20 | 20 | | @Callable(i) |
---|
21 | 21 | | func test7 () = { |
---|
22 | 22 | | let address = toBase58String(i.caller.bytes) |
---|
23 | 23 | | let r = getRandomNumber() |
---|
24 | 24 | | let r2 = getRandomNumber2() |
---|
25 | 25 | | $Tuple2([StringEntry("XXX", r), StringEntry("XXX2", r2)], 1) |
---|
26 | 26 | | } |
---|
27 | 27 | | |
---|
28 | 28 | | |
---|