tx · Dr7DN4Fwi7snEaeAuANYcSv8iQXk3NAvGJUBXZh4uNo4
3N8GKGgDPGGUaAhPMNtsxTJWafHDRnwL7GQ: -0.01000000 Waves
2023.05.31 00:58 [2601276] smart account 3N8GKGgDPGGUaAhPMNtsxTJWafHDRnwL7GQ > SELF 0.00000000 Waves
{
"type": 13,
"id": "Dr7DN4Fwi7snEaeAuANYcSv8iQXk3NAvGJUBXZh4uNo4",
"fee": 1000000,
"feeAssetId": null,
"timestamp": 1685483946481,
"version": 2,
"chainId": 84,
"sender": "3N8GKGgDPGGUaAhPMNtsxTJWafHDRnwL7GQ",
"senderPublicKey": "y5twTW93XMmi75S5bati2cok9QLLFivsrwJedxJeUkX",
"proofs": [
"3jDMnkRxNFgBUYtCr2uturbZwcNTYJYrWxREg8gMdtb84FyYdkMGTS5rT7MoXJbwFqhXo96kyoFxphHUjggji7gz"
],
"script": "base64:BgIECAISAAQBD2dldFJhbmRvbU51bWJlcgAED3JhbmRvbVNlZWRCbG9jawkBBXZhbHVlAQkA7QcBCQBlAgUGaGVpZ2h0AAEECnJhbmRvbUhhc2gJANQWAQkBBXZhbHVlAQgFD3JhbmRvbVNlZWRCbG9jawN2cmYEA3N0cgkA2AQBBQpyYW5kb21IYXNoBAhsYXN0Q2hhcgkAsgICBQNzdHIAAgUIbGFzdENoYXIBEGdldFJhbmRvbU51bWJlcjIABA9yYW5kb21TZWVkQmxvY2sJAQV2YWx1ZQEJAO0HAQkAZQIFBmhlaWdodAABBApyYW5kb21IYXNoCQDUFgEJAQV2YWx1ZQEIBQ9yYW5kb21TZWVkQmxvY2sDdnJmCQCyAgIJAKQDAQkAsQkBBQpyYW5kb21IYXNoAAEBBnJhbmRvbQEBaQQPcmFuZG9tU2VlZEJsb2NrCQEFdmFsdWUBCQDtBwEJAGUCBQZoZWlnaHQAAQQKcmFuZG9tSGFzaAkA1BYBCQEFdmFsdWUBCAUPcmFuZG9tU2VlZEJsb2NrA3ZyZgQIbGFzdENoYXIJALICAgkApAMBCQCxCQEFCnJhbmRvbUhhc2gAAQQJbGFzdENoYXIyCQCyAgIJAKQDAQkAsQkBCAUBaQ10cmFuc2FjdGlvbklkAAEJAKwCAgUIbGFzdENoYXIFCWxhc3RDaGFyMgEQZ2V0UmFuZG9tTnVtYmVyNAEBaQQPcmFuZG9tU2VlZEJsb2NrCQEFdmFsdWUBCQDtBwEJAGUCBQZoZWlnaHQAAQQKcmFuZG9tSGFzaAkA1BYBCQEFdmFsdWUBCAUPcmFuZG9tU2VlZEJsb2NrA3ZyZgkApAMBCQCxCQEFCnJhbmRvbUhhc2gBAWkBBXRlc3Q3AAQHYWRkcmVzcwkA2AQBCAgFAWkGY2FsbGVyBWJ5dGVzBAJyMwkBBnJhbmRvbQEFAWkJAJQKAgkAzAgCCQELU3RyaW5nRW50cnkCAgZyYW5kb20FAnIzBQNuaWwAAQBajyV9",
"height": 2601276,
"applicationStatus": "succeeded",
"spentComplexity": 0
}
View: original | compacted
Prev: B2onum3mA7GPi98S9R6y2NxFqzi8L3RDYGykbSYBno2z
Next: F6ftXhEUqGwT1DAo2gDUu8PtDKkwaNjLNmasNW9Xbh4J
Diff:
Old | New | | Differences |
---|
17 | 17 | | } |
---|
18 | 18 | | |
---|
19 | 19 | | |
---|
20 | | - | func getRandomNumber3 () = { |
---|
| 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 | | - | lastChar |
---|
| 24 | + | let lastChar2 = takeRight(toString(toInt(i.transactionId)), 1) |
---|
| 25 | + | (lastChar + lastChar2) |
---|
25 | 26 | | } |
---|
26 | 27 | | |
---|
27 | 28 | | |
---|
|
35 | 36 | | @Callable(i) |
---|
36 | 37 | | func test7 () = { |
---|
37 | 38 | | let address = toBase58String(i.caller.bytes) |
---|
38 | | - | let r = getRandomNumber() |
---|
39 | | - | let r2 = getRandomNumber2() |
---|
40 | | - | let r3 = getRandomNumber3() |
---|
41 | | - | let r4 = getRandomNumber4(i) |
---|
42 | | - | $Tuple2([StringEntry("XXX", r), StringEntry("XXX2", r2), StringEntry("XXX3", r3), StringEntry("XXX4", r4)], 1) |
---|
| 39 | + | let r3 = random(i) |
---|
| 40 | + | $Tuple2([StringEntry("random", r3)], 1) |
---|
43 | 41 | | } |
---|
44 | 42 | | |
---|
45 | 43 | | |
---|
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 | 16 | | takeRight(toString(toInt(randomHash)), 1) |
---|
17 | 17 | | } |
---|
18 | 18 | | |
---|
19 | 19 | | |
---|
20 | | - | func getRandomNumber3 () = { |
---|
| 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 | | - | lastChar |
---|
| 24 | + | let lastChar2 = takeRight(toString(toInt(i.transactionId)), 1) |
---|
| 25 | + | (lastChar + lastChar2) |
---|
25 | 26 | | } |
---|
26 | 27 | | |
---|
27 | 28 | | |
---|
28 | 29 | | func getRandomNumber4 (i) = { |
---|
29 | 30 | | let randomSeedBlock = value(blockInfoByHeight((height - 1))) |
---|
30 | 31 | | let randomHash = sha256_16Kb(value(randomSeedBlock.vrf)) |
---|
31 | 32 | | toString(toInt(randomHash)) |
---|
32 | 33 | | } |
---|
33 | 34 | | |
---|
34 | 35 | | |
---|
35 | 36 | | @Callable(i) |
---|
36 | 37 | | func test7 () = { |
---|
37 | 38 | | let address = toBase58String(i.caller.bytes) |
---|
38 | | - | let r = getRandomNumber() |
---|
39 | | - | let r2 = getRandomNumber2() |
---|
40 | | - | let r3 = getRandomNumber3() |
---|
41 | | - | let r4 = getRandomNumber4(i) |
---|
42 | | - | $Tuple2([StringEntry("XXX", r), StringEntry("XXX2", r2), StringEntry("XXX3", r3), StringEntry("XXX4", r4)], 1) |
---|
| 39 | + | let r3 = random(i) |
---|
| 40 | + | $Tuple2([StringEntry("random", r3)], 1) |
---|
43 | 41 | | } |
---|
44 | 42 | | |
---|
45 | 43 | | |
---|