tx · 2g1LSyZQYnkTk1SpMxLGcv9GwGBdPFMShqphRtf9KVzi

3Mwb8GE6NHaDxJTby35u2sNAEmDQMWYupCn:  -0.01000000 Waves

2023.06.11 17:53 [2618153] smart account 3Mwb8GE6NHaDxJTby35u2sNAEmDQMWYupCn > SELF 0.00000000 Waves

{ "type": 13, "id": "2g1LSyZQYnkTk1SpMxLGcv9GwGBdPFMShqphRtf9KVzi", "fee": 1000000, "feeAssetId": null, "timestamp": 1686495215471, "version": 2, "chainId": 84, "sender": "3Mwb8GE6NHaDxJTby35u2sNAEmDQMWYupCn", "senderPublicKey": "6oJuynzr7rKRYRDWhDrENciDLidQuVGfe82pK7hr5nev", "proofs": [ "57rBq2Grn9LQR8RNB2qShYRfyV1skzJEipweYG3J5Ggqwb2FULTk5RSUNJXm8rJo11WRwz7Z2q5pCamAfP9vvcsv" ], "script": "base64:BgIJCAISABIDCgEBBAALcmFuZG9tRGVsYXkAAgEJa2V5Q29tbWl0AQdhZGRyZXNzCQCsAgICE2ZpbmlzaEJsb2NrRm9yQWRkcl8FB2FkZHJlc3MBD2dldFJhbmRvbU51bWJlcgIIbWF4VmFsdWUMZmluaXNoSGVpZ2h0BA9yYW5kb21TZWVkQmxvY2sJAQV2YWx1ZQEJAO0HAQUMZmluaXNoSGVpZ2h0BApyYW5kb21IYXNoCQD3AwEJAQV2YWx1ZQEIBQ9yYW5kb21TZWVkQmxvY2sDdnJmCQBqAgkAsgkCBQpyYW5kb21IYXNoABAFCG1heFZhbHVlAQZwc2V1ZG8BAW4ECnJhbmRvbUhhc2gJAPcDAQkAywECCQEFdmFsdWUBCAkBBXZhbHVlAQkA7QcBBQZoZWlnaHQDdnJmCQCaAwEFAW4EB2hhc2hJbnQJALIJAgUKcmFuZG9tSGFzaAAYCQCUCgIFB2hhc2hJbnQJAGoCBQdoYXNoSW50ACUCAWkBBmNvbW1pdAAEC2ZpbmlzaEJsb2NrCQBkAgUGaGVpZ2h0BQtyYW5kb21EZWxheQkAlAoCCQDMCAIJAQxJbnRlZ2VyRW50cnkCCQEJa2V5Q29tbWl0AQkApQgBCAUBaQZjYWxsZXIFC2ZpbmlzaEJsb2NrBQNuaWwFC2ZpbmlzaEJsb2NrAWkBBnJldmVhbAEIbWF4VmFsdWUEB2NvbW1LZXkJAQlrZXlDb21taXQBCQClCAEIBQFpBmNhbGxlcgQLZmluaXNoQmxvY2sJARN2YWx1ZU9yRXJyb3JNZXNzYWdlAgkAnwgBBQdjb21tS2V5AhtZb3UgaGF2ZSB0byBjb21taXQoKSBmaXJzdCEDCQBmAgULZmluaXNoQmxvY2sFBmhlaWdodAkAAgECHlJhbmRvbSBudW1iZXIgaXMgbm90IHJlYWR5IHlldAQEcmFuZAkBD2dldFJhbmRvbU51bWJlcgIFCG1heFZhbHVlBQtmaW5pc2hCbG9jawkAlAoCCQDMCAIJAQtEZWxldGVFbnRyeQEFB2NvbW1LZXkFA25pbAUEcmFuZADkVdtd", "height": 2618153, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: A233XTEiF5FEpvnXHgj9LjwR8h9u37eTKp2qNQGJhmAW Next: 6V8Pd3AwFcYnxwALZywD5QnoQuu6QLJPDemrrq45ixRX Diff:
OldNewDifferences
1515
1616 func i (j) = {
1717 let h = sha256((value(value(blockInfoByHeight(height)).vrf) + toBytes(j)))
18- (toInt(h, 25) % 37)
18+ let k = toInt(h, 24)
19+ $Tuple2(k, (k % 37))
1920 }
2021
2122
22-@Callable(k)
23+@Callable(l)
2324 func commit () = {
24- let l = (height + a)
25- $Tuple2([IntegerEntry(b(toString(k.caller)), l)], l)
25+ let m = (height + a)
26+ $Tuple2([IntegerEntry(b(toString(l.caller)), m)], m)
2627 }
2728
2829
2930
30-@Callable(k)
31+@Callable(l)
3132 func reveal (e) = {
32- let m = b(toString(k.caller))
33- let l = valueOrErrorMessage(getInteger(m), "You have to commit() first!")
34- if ((l > height))
33+ let n = b(toString(l.caller))
34+ let m = valueOrErrorMessage(getInteger(n), "You have to commit() first!")
35+ if ((m > height))
3536 then throw("Random number is not ready yet")
3637 else {
37- let n = d(e, l)
38- $Tuple2([DeleteEntry(m)], n)
38+ let o = d(e, m)
39+ $Tuple2([DeleteEntry(n)], o)
3940 }
4041 }
4142
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let a = 2
55
66 func b (c) = ("finishBlockForAddr_" + c)
77
88
99 func d (e,f) = {
1010 let g = value(blockInfoByHeight(f))
1111 let h = sha256(value(g.vrf))
1212 (toInt(h, 16) % e)
1313 }
1414
1515
1616 func i (j) = {
1717 let h = sha256((value(value(blockInfoByHeight(height)).vrf) + toBytes(j)))
18- (toInt(h, 25) % 37)
18+ let k = toInt(h, 24)
19+ $Tuple2(k, (k % 37))
1920 }
2021
2122
22-@Callable(k)
23+@Callable(l)
2324 func commit () = {
24- let l = (height + a)
25- $Tuple2([IntegerEntry(b(toString(k.caller)), l)], l)
25+ let m = (height + a)
26+ $Tuple2([IntegerEntry(b(toString(l.caller)), m)], m)
2627 }
2728
2829
2930
30-@Callable(k)
31+@Callable(l)
3132 func reveal (e) = {
32- let m = b(toString(k.caller))
33- let l = valueOrErrorMessage(getInteger(m), "You have to commit() first!")
34- if ((l > height))
33+ let n = b(toString(l.caller))
34+ let m = valueOrErrorMessage(getInteger(n), "You have to commit() first!")
35+ if ((m > height))
3536 then throw("Random number is not ready yet")
3637 else {
37- let n = d(e, l)
38- $Tuple2([DeleteEntry(m)], n)
38+ let o = d(e, m)
39+ $Tuple2([DeleteEntry(n)], o)
3940 }
4041 }
4142
4243

github/deemru/w8io/026f985 
21.95 ms