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:
OldNewDifferences
1717 }
1818
1919
20-func getRandomNumber3 () = {
20+func random (i) = {
2121 let randomSeedBlock = value(blockInfoByHeight((height - 1)))
2222 let randomHash = sha256_16Kb(value(randomSeedBlock.vrf))
2323 let lastChar = takeRight(toString(toInt(randomHash)), 1)
24- lastChar
24+ let lastChar2 = takeRight(toString(toInt(i.transactionId)), 1)
25+ (lastChar + lastChar2)
2526 }
2627
2728
3536 @Callable(i)
3637 func test7 () = {
3738 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)
4341 }
4442
4543
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 func getRandomNumber () = {
55 let randomSeedBlock = value(blockInfoByHeight((height - 1)))
66 let randomHash = sha256_16Kb(value(randomSeedBlock.vrf))
77 let str = toBase58String(randomHash)
88 let lastChar = takeRight(str, 2)
99 lastChar
1010 }
1111
1212
1313 func getRandomNumber2 () = {
1414 let randomSeedBlock = value(blockInfoByHeight((height - 1)))
1515 let randomHash = sha256_16Kb(value(randomSeedBlock.vrf))
1616 takeRight(toString(toInt(randomHash)), 1)
1717 }
1818
1919
20-func getRandomNumber3 () = {
20+func random (i) = {
2121 let randomSeedBlock = value(blockInfoByHeight((height - 1)))
2222 let randomHash = sha256_16Kb(value(randomSeedBlock.vrf))
2323 let lastChar = takeRight(toString(toInt(randomHash)), 1)
24- lastChar
24+ let lastChar2 = takeRight(toString(toInt(i.transactionId)), 1)
25+ (lastChar + lastChar2)
2526 }
2627
2728
2829 func getRandomNumber4 (i) = {
2930 let randomSeedBlock = value(blockInfoByHeight((height - 1)))
3031 let randomHash = sha256_16Kb(value(randomSeedBlock.vrf))
3132 toString(toInt(randomHash))
3233 }
3334
3435
3536 @Callable(i)
3637 func test7 () = {
3738 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)
4341 }
4442
4543

github/deemru/w8io/169f3d6 
36.98 ms