tx · D6gbhA39Wfb7w2eRvjkZnXJYgaY762jdt7rK8jh4Fmk1 3Mynaio8coZLr58tu2AdBEhmCvB17vTBRkA: -0.01000000 Waves 2023.06.03 18:24 [2606675] smart account 3Mynaio8coZLr58tu2AdBEhmCvB17vTBRkA > SELF 0.00000000 Waves
{ "type": 13, "id": "D6gbhA39Wfb7w2eRvjkZnXJYgaY762jdt7rK8jh4Fmk1", "fee": 1000000, "feeAssetId": null, "timestamp": 1685805919544, "version": 2, "chainId": 84, "sender": "3Mynaio8coZLr58tu2AdBEhmCvB17vTBRkA", "senderPublicKey": "Dx7cJVhpJb4qUDGiDnSjj6Wfjdj5nmzwVLfaggkbjDtv", "proofs": [ "3aB4DAw4eSA3RBcAaU7sy3gifcNxi24rDQnjmrXNb1MFXfHjRTibWW4LjJXVLz7ug15nHvzAvPRWfGA9XBU4BzDg" ], "script": "base64:BgIGCAISABIABgEKbnVtVG9XYXZlcwEDbnVtCQBoAgUDbnVtAIDC1y8BC2lzUGF5bWVudE9rAQFpBBFhY2NlcHRhYmxlQXNzZXRJZAEgIkSm54hUfVEormpXug9p+nbhDnc37ahHq1IfaU2UQkcDCQAAAgkAkAMBCAUBaQhwYXltZW50cwAACQACAQIUUGF5bWVudCBub3QgYXR0YWNoZWQEAXAJAJEDAggFAWkIcGF5bWVudHMAAAQHJG1hdGNoMAgFAXAHYXNzZXRJZAMJAAECBQckbWF0Y2gwAgpCeXRlVmVjdG9yBAdhc3NldElkBQckbWF0Y2gwAwkAAAIFB2Fzc2V0SWQFEWFjY2VwdGFibGVBc3NldElkCQBnAggFAXAGYW1vdW50CQEKbnVtVG9XYXZlcwEAAQcJAGcCCAUBcAZhbW91bnQJAQpudW1Ub1dhdmVzAQABARNnZXRMdWNreVdoZWVsQmV0S2V5AQFpCQCsAgICD2JldF9MdWNreVdoZWVsXwkApQgBCAUBaQZjYWxsZXIBE2dldEx1Y2t5V2hlZWxXb25LZXkBAWkJAKwCAgIPd29uX0x1Y2t5V2hlZWxf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WdodAIRdW5leGNwZWN0ZWQgZXJyb3IEA3ZyZgkBE3ZhbHVlT3JFcnJvck1lc3NhZ2UCCAULcmV2ZWFsQmxvY2sDdnJmAhF1bmV4Y3BlY3RlZCBlcnJvcgQKcmFuZG9tU2VlZAkAsQkBCQD1AwEFA3ZyZgQMcmFuZG9tTnVtYmVyCQBkAgkAagIFCnJhbmRvbVNlZWQJAGQCCQBlAgAMAAEAAQABBA13aW5uaW5nQW1vdW50CQEZZ2FtZUx1Y2t5V2hlZWxXaGF0VXNlcldvbgEFDHJhbmRvbU51bWJlcgMJAGYCBQ13aW5uaW5nQW1vdW50AAAJAMwIAgkBC0RlbGV0ZUVudHJ5AQkBE2dldEx1Y2t5V2hlZWxCZXRLZXkBBQFpCQDMCAIJAQ5TY3JpcHRUcmFuc2ZlcgMIBQFpBmNhbGxlcgUNd2lubmluZ0Ftb3VudAUEdW5pdAkAzAgCCQEMSW50ZWdlckVudHJ5AgkBE2dldEx1Y2t5V2hlZWxXb25LZXkBBQFpBQ13aW5uaW5nQW1vdW50CQDMCAIJAQxJbnRlZ2VyRW50cnkCCQEcZ2V0THVja3lXaGVlbFJhbmRvbU51bWJlcktleQEFAWkFDHJhbmRvbU51bWJlcgUDbmlsCQDMCAIJAQtEZWxldGVFbnRyeQEJARNnZXRMdWNreVdoZWVsQmV0S2V5AQUBaQkAzAgCCQEMSW50ZWdlckVudHJ5AgkBE2dldEx1Y2t5V2hlZWxXb25LZXkBBQFpBQ13aW5uaW5nQW1vdW50CQDMCAIJAQxJbnRlZ2VyRW50cnkCCQEcZ2V0THVja3lXaGVlbFJhbmRvbU51bWJlcktleQEFAWkFDHJhbmRvbU51bWJlcgUDbmlsALb5Dzk=", "height": 2606675, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 4RG8Fit1vRGWGGHaBKGKsSo1gTuP8cgScYchQXv35yDK Next: 9LXAkVvc73oLyu77La1BUMfDFGdi7Cb11AXxdswNzwRt Diff:
Old | New | Differences | |
---|---|---|---|
39 | 39 | else if ((5 == g)) | |
40 | 40 | then a(1) | |
41 | 41 | else if ((7 == g)) | |
42 | - | then a( | |
42 | + | then a(6) | |
43 | 43 | else if ((11 == g)) | |
44 | 44 | then a(1) | |
45 | 45 | else 0 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | func a (b) = (b * 100000000) | |
5 | 5 | ||
6 | 6 | ||
7 | 7 | func c (d) = { | |
8 | 8 | let e = base58'3JmaWyFqWo8YSA8x3DXCBUW7veesxacvKx19dMv7wTMg' | |
9 | 9 | if ((size(d.payments) == 0)) | |
10 | 10 | then throw("Payment not attached") | |
11 | 11 | else { | |
12 | 12 | let f = d.payments[0] | |
13 | 13 | let g = f.assetId | |
14 | 14 | if ($isInstanceOf(g, "ByteVector")) | |
15 | 15 | then { | |
16 | 16 | let h = g | |
17 | 17 | if ((h == e)) | |
18 | 18 | then (f.amount >= a(1)) | |
19 | 19 | else false | |
20 | 20 | } | |
21 | 21 | else (f.amount >= a(1)) | |
22 | 22 | } | |
23 | 23 | } | |
24 | 24 | ||
25 | 25 | ||
26 | 26 | func i (d) = ("bet_LuckyWheel_" + toString(d.caller)) | |
27 | 27 | ||
28 | 28 | ||
29 | 29 | func j (d) = ("won_LuckyWheel_" + toString(d.caller)) | |
30 | 30 | ||
31 | 31 | ||
32 | 32 | func k (d) = ("randomNumber_LuckyWheel_" + toString(d.caller)) | |
33 | 33 | ||
34 | 34 | ||
35 | 35 | func l (m) = { | |
36 | 36 | let g = m | |
37 | 37 | if ((1 == g)) | |
38 | 38 | then a(2) | |
39 | 39 | else if ((5 == g)) | |
40 | 40 | then a(1) | |
41 | 41 | else if ((7 == g)) | |
42 | - | then a( | |
42 | + | then a(6) | |
43 | 43 | else if ((11 == g)) | |
44 | 44 | then a(1) | |
45 | 45 | else 0 | |
46 | 46 | } | |
47 | 47 | ||
48 | 48 | ||
49 | 49 | @Callable(d) | |
50 | 50 | func commitLuckyWheel () = if (!(c(d))) | |
51 | 51 | then throw("Wrong payment amount or asset") | |
52 | 52 | else [IntegerEntry(i(d), (height + 1)), DeleteEntry(k(d)), DeleteEntry(j(d))] | |
53 | 53 | ||
54 | 54 | ||
55 | 55 | ||
56 | 56 | @Callable(d) | |
57 | 57 | func revealLuckyWheel () = { | |
58 | 58 | let n = valueOrErrorMessage(getIntegerValue(i(d)), "Bet not found") | |
59 | 59 | if ((n > height)) | |
60 | 60 | then throw((("wait " + toString((n - height))) + " blocks to reveal this id")) | |
61 | 61 | else { | |
62 | 62 | let o = valueOrErrorMessage(blockInfoByHeight(n), "unexcpected error") | |
63 | 63 | let p = valueOrErrorMessage(o.vrf, "unexcpected error") | |
64 | 64 | let q = toInt(keccak256(p)) | |
65 | 65 | let r = ((q % ((12 - 1) + 1)) + 1) | |
66 | 66 | let s = l(r) | |
67 | 67 | if ((s > 0)) | |
68 | 68 | then [DeleteEntry(i(d)), ScriptTransfer(d.caller, s, unit), IntegerEntry(j(d), s), IntegerEntry(k(d), r)] | |
69 | 69 | else [DeleteEntry(i(d)), IntegerEntry(j(d), s), IntegerEntry(k(d), r)] | |
70 | 70 | } | |
71 | 71 | } | |
72 | 72 | ||
73 | 73 |
github/deemru/w8io/169f3d6 30.26 ms ◑