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:
OldNewDifferences
4646 @Callable(i)
4747 func test7 () = {
4848 let address = toBase58String(i.caller.bytes)
49- let r3 = random2(i, 1, 120)
49+ let r3 = random2(i, 1, 12)
5050 $Tuple2([IntegerEntry("random", r3)], 1)
5151 }
5252
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
2020 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)
2424 let lastChar2 = takeRight(toString(toInt(i.transactionId)), 1)
2525 (lastChar + lastChar2)
2626 }
2727
2828
2929 func random2 (i,min,max) = {
3030 let ofset = parseIntValue(takeRight(toString(toInt(i.transactionId)), 1))
3131 let randomSeedBlock = value(blockInfoByHeight((height - ofset)))
3232 let randomHash = sha256_16Kb(value(randomSeedBlock.vrf))
3333 let lastChar = takeRight(toString(toInt(randomHash)), 5)
3434 let randomNumber = ((parseIntValue(lastChar) % ((max - min) + 1)) + min)
3535 randomNumber
3636 }
3737
3838
3939 func getRandomNumber4 (i) = {
4040 let randomSeedBlock = value(blockInfoByHeight((height - 1)))
4141 let randomHash = sha256_16Kb(value(randomSeedBlock.vrf))
4242 toString(toInt(randomHash))
4343 }
4444
4545
4646 @Callable(i)
4747 func test7 () = {
4848 let address = toBase58String(i.caller.bytes)
49- let r3 = random2(i, 1, 120)
49+ let r3 = random2(i, 1, 12)
5050 $Tuple2([IntegerEntry("random", r3)], 1)
5151 }
5252
5353

github/deemru/w8io/169f3d6 
40.52 ms