tx · DisfU15e4cr416cn758h9x4HAXKqQxytYTWB29fc3Q6N 3MrfLFw1uz3BDr45RQLvrRnAwT2nHpB4KiX: -0.01000000 Waves 2023.06.11 12:34 [2617846] smart account 3MrfLFw1uz3BDr45RQLvrRnAwT2nHpB4KiX > SELF 0.00000000 Waves
{ "type": 13, "id": "DisfU15e4cr416cn758h9x4HAXKqQxytYTWB29fc3Q6N", "fee": 1000000, "feeAssetId": null, "timestamp": 1686476106154, "version": 2, "chainId": 84, "sender": "3MrfLFw1uz3BDr45RQLvrRnAwT2nHpB4KiX", "senderPublicKey": "5iiNX4Sz3qZzcerumQLc1y7u9TH2X46jDV4f9Xivtmtv", "proofs": [ "2AqyrKVEenrgLaDrXsDNBXp4kdfG1yfC2st7qtmkuxttJaPdQuKyrVHSWr4YhG3PNcmzyuqYqRsTC93Qf7vU4sWe" ], "script": "base64:BgIECAISABwBCm51bVRvV2F2ZXMBA251bQkAaAIFA251bQCAwtcvAQtpc1BheW1lbnRPawIBaQNzdW0EEWFjY2VwdGFibGVBc3NldElkAQQTq9kzBAFwCQCRAwIIBQFpCHBheW1lbnRzAAADCQBnAggFAXAGYW1vdW50CQEKbnVtVG9XYXZlcwEFA3N1bQkAAAIIBQFwB2Fzc2V0SWQFBHVuaXQHAQttYXBJbnRUb1N0cgIFYWNjdW0EbmV4dAkAzAgCCQCkAwEFBG5leHQFBWFjY3VtAQttYXBTdHJUb0ludAIFYWNjdW0EbmV4dAkAzAgCCQENcGFyc2VJbnRWYWx1ZQEFBG5leHQFBWFjY3VtAQttYXBJbnRUb1N1bQIFYWNjdW0EbmV4dAkAZAIFBWFjY3VtBQRuZXh0AQxsaXN0SW50VG9TdW0BA2FycgoAAiRsBQNhcnIKAAIkcwkAkAMBBQIkbAoABSRhY2MwAAAKAQUkZjBfMQICJGECJGkDCQBnAgUCJGkFAiRzBQIkYQkBC21hcEludFRvU3VtAgUCJGEJAJEDAgUCJGwFAiRpCgEFJGYwXzICAiRhAiRpAwkAZwIFAi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MQIJAQUkZjBfMQIJAQUkZjBfMQIJAQUkZjBfMQIJAQUkZjBfMQIJAQUkZjBfMQIJAQUkZjBfMQIJAQUkZjBfMQIJAQUkZjBfMQIJAQUkZjBfMQIJAQUkZjBfMQIJAQUkZjBfMQIJAQUkZjBfMQIJAQUkZjBfMQIJAQUkZjBfMQIJAQUkZjBfMQIFBSRhY2MwAAAAAQACAAMABAAFAAYABwAIAAkACgALAAwADQAOAA8AEAARABIAEwAUABUAFgAXABgAGQAaABsAHAAdAB4AHwAgACEAIgAjACQAJQAmACcAKAApACoAKwAsAC0ALgAvADAAMQAyAQFpAQRUZXN0AAQDcmVkCQEHdGVzdFJlZAEJAMwIAgABCQDMCAIAAgkAzAgCAAMJAMwIAgAECQDMCAIABQkAzAgCAAYJAMwIAgAHCQDMCAIACAkAzAgCAAkJAMwIAgAKCQDMCAIACwkAzAgCAAwJAMwIAgANCQDMCAIADgkAzAgCAA8JAMwIAgAPCQDMCAIAEAkAzAgCABEJAMwIAgASCQDMCAIAEwkAzAgCABQJAMwIAgAVCQDMCAIAFgkAzAgCABcJAMwIAgAYCQDMCAIAGQkAzAgCABoJAMwIAgAbCQDMCAIAHAkAzAgCAB0JAMwIAgAeBQNuaWwJAMwIAgkBC1N0cmluZ0VudHJ5AgIEdGVzdAkArAICAgVyZWQ6IAkApAMBBQNyZWQFA25pbACfcGqh", "height": 2617846, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: A3K4tD2vmkXdAALVDSBnoTTEmwR3NfL5cUbVka5zs5Zc Next: 4FRvNeTm8AxJtPYn3rDz7qupaS1L6AX7dXimnYRHfjH8 Diff:
Old | New | Differences | |
---|---|---|---|
82 | 82 | func B (C) = w(split(C, "|")) | |
83 | 83 | ||
84 | 84 | ||
85 | - | func D (E,F,G,H) = { | |
86 | - | let I = [32, 19, 21, 25, 34, 27, 36, 30, 23, 5, 16, 1, 14, 9, 18, 7, 12, 3] | |
87 | - | if (if ((size(G) == 1)) | |
88 | - | then (H == "num") | |
85 | + | func D (E) = { | |
86 | + | let F = valueOrErrorMessage(blockInfoByHeight(E), "unexcpected error") | |
87 | + | let G = valueOrErrorMessage(blockInfoByHeight((E - 10)), "unexcpected error") | |
88 | + | let H = valueOrErrorMessage(F.vrf, "unexcpected error") | |
89 | + | let I = valueOrErrorMessage(G.vrf, "unexcpected error") | |
90 | + | let J = sha256(value(H)) | |
91 | + | let K = sha256(value(I)) | |
92 | + | let L = (toInt(J, 16) - (toInt(K, 16) * toInt(J, 16))) | |
93 | + | (L % 37) | |
94 | + | } | |
95 | + | ||
96 | + | ||
97 | + | func M (N,O,P,Q) = { | |
98 | + | let R = [32, 19, 21, 25, 34, 27, 36, 30, 23, 5, 16, 1, 14, 9, 18, 7, 12, 3] | |
99 | + | if (if ((size(P) == 1)) | |
100 | + | then (Q == "num") | |
89 | 101 | else false) | |
90 | - | then if (( | |
91 | - | then ( | |
102 | + | then if ((P[0] == N)) | |
103 | + | then (O * 36) | |
92 | 104 | else 0 | |
93 | - | else if ((size( | |
94 | - | then if (containsElement( | |
95 | - | then ( | |
105 | + | else if ((size(P) == 2)) | |
106 | + | then if (containsElement(P, N)) | |
107 | + | then (O * 18) | |
96 | 108 | else 0 | |
97 | - | else if ((size( | |
98 | - | then if (containsElement( | |
99 | - | then ( | |
109 | + | else if ((size(P) == 3)) | |
110 | + | then if (containsElement(P, N)) | |
111 | + | then (O * 12) | |
100 | 112 | else 0 | |
101 | - | else if ((size( | |
102 | - | then if (containsElement( | |
103 | - | then ( | |
113 | + | else if ((size(P) == 4)) | |
114 | + | then if (containsElement(P, N)) | |
115 | + | then (O * 9) | |
104 | 116 | else 0 | |
105 | - | else if ((size( | |
106 | - | then if (containsElement( | |
107 | - | then ( | |
117 | + | else if ((size(P) == 12)) | |
118 | + | then if (containsElement(P, N)) | |
119 | + | then (O * 3) | |
108 | 120 | else 0 | |
109 | - | else if (( | |
110 | - | then if (containsElement( | |
111 | - | then ( | |
121 | + | else if ((Q == "red")) | |
122 | + | then if (containsElement(R, N)) | |
123 | + | then (O * 2) | |
112 | 124 | else 0 | |
113 | - | else if (( | |
114 | - | then if (if (!(containsElement( | |
115 | - | then ( | |
125 | + | else if ((Q == "black")) | |
126 | + | then if (if (!(containsElement(R, N))) | |
127 | + | then (N != 0) | |
116 | 128 | else false) | |
117 | - | then ( | |
129 | + | then (O * 2) | |
118 | 130 | else 0 | |
119 | - | else if (( | |
120 | - | then if ((( | |
121 | - | then ( | |
131 | + | else if ((Q == "odd")) | |
132 | + | then if (((N % 2) != 0)) | |
133 | + | then (O * 2) | |
122 | 134 | else 0 | |
123 | - | else if (( | |
124 | - | then if ((( | |
125 | - | then ( | |
135 | + | else if ((Q == "even")) | |
136 | + | then if (((N % 2) == 0)) | |
137 | + | then (O * 2) | |
126 | 138 | else 0 | |
127 | - | else if ((size( | |
128 | - | then if (containsElement( | |
129 | - | then ( | |
139 | + | else if ((size(P) == 18)) | |
140 | + | then if (containsElement(P, N)) | |
141 | + | then (O * 2) | |
130 | 142 | else 0 | |
131 | 143 | else 0 | |
132 | 144 | } | |
133 | 145 | ||
134 | 146 | ||
135 | - | func | |
147 | + | func S (d) = ("bet_Roulette_" + toString(d.caller)) | |
136 | 148 | ||
137 | 149 | ||
138 | - | func | |
150 | + | func T (d) = ("betAmount_Roulette_" + toString(d.caller)) | |
139 | 151 | ||
140 | 152 | ||
141 | - | func | |
153 | + | func U (d) = ("selectedNumbers_Roulette_" + toString(d.caller)) | |
142 | 154 | ||
143 | 155 | ||
144 | - | func | |
156 | + | func V (d) = ("direction_Roulette_" + toString(d.caller)) | |
145 | 157 | ||
146 | 158 | ||
147 | - | func | |
159 | + | func W (d) = ((("log_Roulette_" + toString(d.caller)) + "_") + toBase58String(d.transactionId)) | |
148 | 160 | ||
149 | 161 | ||
150 | - | func | |
162 | + | func X (d) = ("status_Roulette_" + toString(d.caller)) | |
151 | 163 | ||
152 | 164 | ||
153 | - | func | |
165 | + | func Y (d) = ("bet_LuckyWheel_" + toString(d.caller)) | |
154 | 166 | ||
155 | 167 | ||
156 | - | func | |
168 | + | func Z (d) = ("won_LuckyWheel_" + toString(d.caller)) | |
157 | 169 | ||
158 | 170 | ||
159 | - | func | |
171 | + | func aa (d) = ("randomNumber_LuckyWheel_" + toString(d.caller)) | |
160 | 172 | ||
161 | 173 | ||
162 | - | func | |
174 | + | func ab (d) = ((("log_LuckyWheel_" + toString(d.caller)) + "_") + toBase58String(d.transactionId)) | |
163 | 175 | ||
164 | 176 | ||
165 | - | func | |
166 | - | let | |
167 | - | if ((1 == | |
177 | + | func ac (ad) = { | |
178 | + | let ae = ad | |
179 | + | if ((1 == ae)) | |
168 | 180 | then a(2) | |
169 | - | else if ((3 == | |
181 | + | else if ((3 == ae)) | |
170 | 182 | then a(1) | |
171 | - | else if ((7 == | |
183 | + | else if ((7 == ae)) | |
172 | 184 | then a(6) | |
173 | - | else if ((9 == | |
185 | + | else if ((9 == ae)) | |
174 | 186 | then a(1) | |
175 | 187 | else 0 | |
176 | 188 | } | |
177 | 189 | ||
178 | 190 | ||
179 | - | func W (d) = ("status_Roulette_" + toString(d.caller)) | |
191 | + | func af (d) = ("status_Roulette_" + toString(d.caller)) | |
192 | + | ||
193 | + | ||
194 | + | func ag (i,j) = { | |
195 | + | let ah = D((height - j)) | |
196 | + | let ai = M(ah, 1, nil, "red") | |
197 | + | (i + ai) | |
198 | + | } | |
199 | + | ||
200 | + | ||
201 | + | func aj (n) = { | |
202 | + | let o = n | |
203 | + | let p = size(o) | |
204 | + | let q = 30 | |
205 | + | func r (s,t) = if ((t >= p)) | |
206 | + | then s | |
207 | + | else ag(s, o[t]) | |
208 | + | ||
209 | + | func u (s,t) = if ((t >= p)) | |
210 | + | then s | |
211 | + | else throw("List size exceeds 50") | |
212 | + | ||
213 | + | u(r(r(r(r(r(r(r(r(r(r(r(r(r(r(r(r(r(r(r(r(r(r(r(r(r(r(r(r(r(r(r(r(r(r(r(r(r(r(r(r(r(r(r(r(r(r(r(r(r(r(q, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15), 16), 17), 18), 19), 20), 21), 22), 23), 24), 25), 26), 27), 28), 29), 30), 31), 32), 33), 34), 35), 36), 37), 38), 39), 40), 41), 42), 43), 44), 45), 46), 47), 48), 49), 50) | |
214 | + | } | |
180 | 215 | ||
181 | 216 | ||
182 | 217 | @Callable(d) | |
183 | - | func Roulette_commit (F,G,H) = { | |
184 | - | let g = d.payments[0] | |
185 | - | if (!(c(d, F))) | |
186 | - | then throw("Wrong payment amount or asset!") | |
187 | - | else [IntegerEntry(J(d), (height + 1)), IntegerEntry(K(d), F), StringEntry(L(d), A(G)), StringEntry(M(d), H), StringEntry(O(d), ((((("| status: commit | revealBlock: " + toString((height + 1))) + " | betAmount: ") + toString(F)) + " | selectedNumbers: ") + A(G)))] | |
188 | - | } | |
189 | - | ||
190 | - | ||
191 | - | ||
192 | - | @Callable(d) | |
193 | - | func Roulette_reveal () = { | |
194 | - | let X = valueOrErrorMessage(getIntegerValue(J(d)), "Bet not found") | |
195 | - | let F = valueOrErrorMessage(getIntegerValue(K(d)), "Bet amount not found") | |
196 | - | let Y = valueOrErrorMessage(getStringValue(L(d)), "Selected numbers not found") | |
197 | - | let Z = valueOrErrorMessage(getStringValue(M(d)), "Direction not found") | |
198 | - | let aa = B(Y) | |
199 | - | if ((X > height)) | |
200 | - | then throw((("Wait " + toString((X - height))) + " blocks to reveal this id")) | |
201 | - | else { | |
202 | - | let ab = valueOrErrorMessage(blockInfoByHeight(X), "unexcpected error") | |
203 | - | let ac = valueOrErrorMessage(ab.vrf, "unexcpected error") | |
204 | - | let ad = sha256(value(ac)) | |
205 | - | let E = (toInt(ad, 16) % 37) | |
206 | - | let ae = a(D(E, F, aa, Z)) | |
207 | - | let af = ((((((((("| commitHeight: " + toString(X)) + " | betAmount: ") + toString(F)) + " | winningAmount: ") + toString(ae)) + " | selectedNumbers: ") + A(aa)) + " | randomNumber: ") + toString(E)) | |
208 | - | let ag = ((((((((("| status: reveal | winningAmount: " + toString(ae)) + " | selectedNumbers: ") + A(aa)) + " | randomNumber: ") + toString(E)) + " | betAmount: ") + toString(F)) + " | selectedNumbers: ") + A(aa)) | |
209 | - | if ((ae > 0)) | |
210 | - | then [DeleteEntry(J(d)), DeleteEntry(K(d)), DeleteEntry(L(d)), DeleteEntry(M(d)), ScriptTransfer(d.caller, ae, unit), StringEntry(N(d), af), StringEntry(O(d), ag)] | |
211 | - | else [DeleteEntry(J(d)), DeleteEntry(K(d)), DeleteEntry(L(d)), DeleteEntry(M(d)), IntegerEntry(N(d), ae), StringEntry(N(d), af), StringEntry(O(d), ag)] | |
212 | - | } | |
213 | - | } | |
214 | - | ||
215 | - | ||
216 | - | ||
217 | - | @Callable(d) | |
218 | - | func LuckyWheel_commit () = if (!(c(d, 1))) | |
219 | - | then throw("Wrong payment amount or asset") | |
220 | - | else [IntegerEntry(P(d), (height + 1)), DeleteEntry(R(d)), DeleteEntry(Q(d)), StringEntry(W(d), "| status: commit")] | |
221 | - | ||
222 | - | ||
223 | - | ||
224 | - | @Callable(d) | |
225 | - | func LuckyWheel_reveal () = { | |
226 | - | let X = valueOrErrorMessage(getIntegerValue(P(d)), "Bet not found") | |
227 | - | if ((X > height)) | |
228 | - | then throw((("Wait " + toString((X - height))) + " blocks to reveal this id")) | |
229 | - | else { | |
230 | - | let ab = valueOrErrorMessage(blockInfoByHeight(X), "unexcpected error") | |
231 | - | let ac = valueOrErrorMessage(ab.vrf, "unexcpected error") | |
232 | - | let ad = sha256(value(ac)) | |
233 | - | let ah = valueOrErrorMessage(blockInfoByHeight((X - 1)), "unexcpected error") | |
234 | - | let ai = valueOrErrorMessage(ab.vrf, "unexcpected error") | |
235 | - | let aj = sha256(value(ac)) | |
236 | - | let ak = (toInt(ad, 16) + (toInt(ad, 10) / toInt(ad, 5))) | |
237 | - | let E = (ak % 12) | |
238 | - | let ae = T(E) | |
239 | - | let ag = (((("| status: reveal | winningAmount: " + toString(ae)) + " | selectedNumbers: ") + " | randomNumber: ") + toString(E)) | |
240 | - | if ((ae > 0)) | |
241 | - | then [DeleteEntry(P(d)), ScriptTransfer(d.caller, ae, unit), IntegerEntry(Q(d), ae), IntegerEntry(R(d), E), StringEntry(W(d), ag)] | |
242 | - | else [DeleteEntry(P(d)), IntegerEntry(Q(d), ae), IntegerEntry(R(d), E), StringEntry(W(d), ag)] | |
243 | - | } | |
218 | + | func Test () = { | |
219 | + | let ak = aj([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30]) | |
220 | + | [StringEntry("test", ("red: " + toString(ak)))] | |
244 | 221 | } | |
245 | 222 | ||
246 | 223 |
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,e) = { | |
8 | 8 | let f = base58'WAVES' | |
9 | 9 | let g = d.payments[0] | |
10 | 10 | if ((g.amount >= a(e))) | |
11 | 11 | then (g.assetId == unit) | |
12 | 12 | else false | |
13 | 13 | } | |
14 | 14 | ||
15 | 15 | ||
16 | 16 | func h (i,j) = toString(j) :: i | |
17 | 17 | ||
18 | 18 | ||
19 | 19 | func k (i,j) = parseIntValue(j) :: i | |
20 | 20 | ||
21 | 21 | ||
22 | 22 | func l (i,j) = (i + j) | |
23 | 23 | ||
24 | 24 | ||
25 | 25 | func m (n) = { | |
26 | 26 | let o = n | |
27 | 27 | let p = size(o) | |
28 | 28 | let q = 0 | |
29 | 29 | func r (s,t) = if ((t >= p)) | |
30 | 30 | then s | |
31 | 31 | else l(s, o[t]) | |
32 | 32 | ||
33 | 33 | func u (s,t) = if ((t >= p)) | |
34 | 34 | then s | |
35 | 35 | else throw("List size exceeds 50") | |
36 | 36 | ||
37 | 37 | u(r(r(r(r(r(r(r(r(r(r(r(r(r(r(r(r(r(r(r(r(r(r(r(r(r(r(r(r(r(r(r(r(r(r(r(r(r(r(r(r(r(r(r(r(r(r(r(r(r(r(q, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15), 16), 17), 18), 19), 20), 21), 22), 23), 24), 25), 26), 27), 28), 29), 30), 31), 32), 33), 34), 35), 36), 37), 38), 39), 40), 41), 42), 43), 44), 45), 46), 47), 48), 49), 50) | |
38 | 38 | } | |
39 | 39 | ||
40 | 40 | ||
41 | 41 | func v (n) = { | |
42 | 42 | let o = n | |
43 | 43 | let p = size(o) | |
44 | 44 | let q = nil | |
45 | 45 | func r (s,t) = if ((t >= p)) | |
46 | 46 | then s | |
47 | 47 | else h(s, o[t]) | |
48 | 48 | ||
49 | 49 | func u (s,t) = if ((t >= p)) | |
50 | 50 | then s | |
51 | 51 | else throw("List size exceeds 50") | |
52 | 52 | ||
53 | 53 | u(r(r(r(r(r(r(r(r(r(r(r(r(r(r(r(r(r(r(r(r(r(r(r(r(r(r(r(r(r(r(r(r(r(r(r(r(r(r(r(r(r(r(r(r(r(r(r(r(r(r(q, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15), 16), 17), 18), 19), 20), 21), 22), 23), 24), 25), 26), 27), 28), 29), 30), 31), 32), 33), 34), 35), 36), 37), 38), 39), 40), 41), 42), 43), 44), 45), 46), 47), 48), 49), 50) | |
54 | 54 | } | |
55 | 55 | ||
56 | 56 | ||
57 | 57 | func w (n) = { | |
58 | 58 | let o = n | |
59 | 59 | let p = size(o) | |
60 | 60 | let q = nil | |
61 | 61 | func r (s,t) = if ((t >= p)) | |
62 | 62 | then s | |
63 | 63 | else k(s, o[t]) | |
64 | 64 | ||
65 | 65 | func u (s,t) = if ((t >= p)) | |
66 | 66 | then s | |
67 | 67 | else throw("List size exceeds 50") | |
68 | 68 | ||
69 | 69 | u(r(r(r(r(r(r(r(r(r(r(r(r(r(r(r(r(r(r(r(r(r(r(r(r(r(r(r(r(r(r(r(r(r(r(r(r(r(r(r(r(r(r(r(r(r(r(r(r(r(r(q, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15), 16), 17), 18), 19), 20), 21), 22), 23), 24), 25), 26), 27), 28), 29), 30), 31), 32), 33), 34), 35), 36), 37), 38), 39), 40), 41), 42), 43), 44), 45), 46), 47), 48), 49), 50) | |
70 | 70 | } | |
71 | 71 | ||
72 | 72 | ||
73 | 73 | func x (n) = makeString(n, "|") | |
74 | 74 | ||
75 | 75 | ||
76 | 76 | func y (z) = split(z, "|") | |
77 | 77 | ||
78 | 78 | ||
79 | 79 | func A (n) = makeString(v(n), "|") | |
80 | 80 | ||
81 | 81 | ||
82 | 82 | func B (C) = w(split(C, "|")) | |
83 | 83 | ||
84 | 84 | ||
85 | - | func D (E,F,G,H) = { | |
86 | - | let I = [32, 19, 21, 25, 34, 27, 36, 30, 23, 5, 16, 1, 14, 9, 18, 7, 12, 3] | |
87 | - | if (if ((size(G) == 1)) | |
88 | - | then (H == "num") | |
85 | + | func D (E) = { | |
86 | + | let F = valueOrErrorMessage(blockInfoByHeight(E), "unexcpected error") | |
87 | + | let G = valueOrErrorMessage(blockInfoByHeight((E - 10)), "unexcpected error") | |
88 | + | let H = valueOrErrorMessage(F.vrf, "unexcpected error") | |
89 | + | let I = valueOrErrorMessage(G.vrf, "unexcpected error") | |
90 | + | let J = sha256(value(H)) | |
91 | + | let K = sha256(value(I)) | |
92 | + | let L = (toInt(J, 16) - (toInt(K, 16) * toInt(J, 16))) | |
93 | + | (L % 37) | |
94 | + | } | |
95 | + | ||
96 | + | ||
97 | + | func M (N,O,P,Q) = { | |
98 | + | let R = [32, 19, 21, 25, 34, 27, 36, 30, 23, 5, 16, 1, 14, 9, 18, 7, 12, 3] | |
99 | + | if (if ((size(P) == 1)) | |
100 | + | then (Q == "num") | |
89 | 101 | else false) | |
90 | - | then if (( | |
91 | - | then ( | |
102 | + | then if ((P[0] == N)) | |
103 | + | then (O * 36) | |
92 | 104 | else 0 | |
93 | - | else if ((size( | |
94 | - | then if (containsElement( | |
95 | - | then ( | |
105 | + | else if ((size(P) == 2)) | |
106 | + | then if (containsElement(P, N)) | |
107 | + | then (O * 18) | |
96 | 108 | else 0 | |
97 | - | else if ((size( | |
98 | - | then if (containsElement( | |
99 | - | then ( | |
109 | + | else if ((size(P) == 3)) | |
110 | + | then if (containsElement(P, N)) | |
111 | + | then (O * 12) | |
100 | 112 | else 0 | |
101 | - | else if ((size( | |
102 | - | then if (containsElement( | |
103 | - | then ( | |
113 | + | else if ((size(P) == 4)) | |
114 | + | then if (containsElement(P, N)) | |
115 | + | then (O * 9) | |
104 | 116 | else 0 | |
105 | - | else if ((size( | |
106 | - | then if (containsElement( | |
107 | - | then ( | |
117 | + | else if ((size(P) == 12)) | |
118 | + | then if (containsElement(P, N)) | |
119 | + | then (O * 3) | |
108 | 120 | else 0 | |
109 | - | else if (( | |
110 | - | then if (containsElement( | |
111 | - | then ( | |
121 | + | else if ((Q == "red")) | |
122 | + | then if (containsElement(R, N)) | |
123 | + | then (O * 2) | |
112 | 124 | else 0 | |
113 | - | else if (( | |
114 | - | then if (if (!(containsElement( | |
115 | - | then ( | |
125 | + | else if ((Q == "black")) | |
126 | + | then if (if (!(containsElement(R, N))) | |
127 | + | then (N != 0) | |
116 | 128 | else false) | |
117 | - | then ( | |
129 | + | then (O * 2) | |
118 | 130 | else 0 | |
119 | - | else if (( | |
120 | - | then if ((( | |
121 | - | then ( | |
131 | + | else if ((Q == "odd")) | |
132 | + | then if (((N % 2) != 0)) | |
133 | + | then (O * 2) | |
122 | 134 | else 0 | |
123 | - | else if (( | |
124 | - | then if ((( | |
125 | - | then ( | |
135 | + | else if ((Q == "even")) | |
136 | + | then if (((N % 2) == 0)) | |
137 | + | then (O * 2) | |
126 | 138 | else 0 | |
127 | - | else if ((size( | |
128 | - | then if (containsElement( | |
129 | - | then ( | |
139 | + | else if ((size(P) == 18)) | |
140 | + | then if (containsElement(P, N)) | |
141 | + | then (O * 2) | |
130 | 142 | else 0 | |
131 | 143 | else 0 | |
132 | 144 | } | |
133 | 145 | ||
134 | 146 | ||
135 | - | func | |
147 | + | func S (d) = ("bet_Roulette_" + toString(d.caller)) | |
136 | 148 | ||
137 | 149 | ||
138 | - | func | |
150 | + | func T (d) = ("betAmount_Roulette_" + toString(d.caller)) | |
139 | 151 | ||
140 | 152 | ||
141 | - | func | |
153 | + | func U (d) = ("selectedNumbers_Roulette_" + toString(d.caller)) | |
142 | 154 | ||
143 | 155 | ||
144 | - | func | |
156 | + | func V (d) = ("direction_Roulette_" + toString(d.caller)) | |
145 | 157 | ||
146 | 158 | ||
147 | - | func | |
159 | + | func W (d) = ((("log_Roulette_" + toString(d.caller)) + "_") + toBase58String(d.transactionId)) | |
148 | 160 | ||
149 | 161 | ||
150 | - | func | |
162 | + | func X (d) = ("status_Roulette_" + toString(d.caller)) | |
151 | 163 | ||
152 | 164 | ||
153 | - | func | |
165 | + | func Y (d) = ("bet_LuckyWheel_" + toString(d.caller)) | |
154 | 166 | ||
155 | 167 | ||
156 | - | func | |
168 | + | func Z (d) = ("won_LuckyWheel_" + toString(d.caller)) | |
157 | 169 | ||
158 | 170 | ||
159 | - | func | |
171 | + | func aa (d) = ("randomNumber_LuckyWheel_" + toString(d.caller)) | |
160 | 172 | ||
161 | 173 | ||
162 | - | func | |
174 | + | func ab (d) = ((("log_LuckyWheel_" + toString(d.caller)) + "_") + toBase58String(d.transactionId)) | |
163 | 175 | ||
164 | 176 | ||
165 | - | func | |
166 | - | let | |
167 | - | if ((1 == | |
177 | + | func ac (ad) = { | |
178 | + | let ae = ad | |
179 | + | if ((1 == ae)) | |
168 | 180 | then a(2) | |
169 | - | else if ((3 == | |
181 | + | else if ((3 == ae)) | |
170 | 182 | then a(1) | |
171 | - | else if ((7 == | |
183 | + | else if ((7 == ae)) | |
172 | 184 | then a(6) | |
173 | - | else if ((9 == | |
185 | + | else if ((9 == ae)) | |
174 | 186 | then a(1) | |
175 | 187 | else 0 | |
176 | 188 | } | |
177 | 189 | ||
178 | 190 | ||
179 | - | func W (d) = ("status_Roulette_" + toString(d.caller)) | |
191 | + | func af (d) = ("status_Roulette_" + toString(d.caller)) | |
192 | + | ||
193 | + | ||
194 | + | func ag (i,j) = { | |
195 | + | let ah = D((height - j)) | |
196 | + | let ai = M(ah, 1, nil, "red") | |
197 | + | (i + ai) | |
198 | + | } | |
199 | + | ||
200 | + | ||
201 | + | func aj (n) = { | |
202 | + | let o = n | |
203 | + | let p = size(o) | |
204 | + | let q = 30 | |
205 | + | func r (s,t) = if ((t >= p)) | |
206 | + | then s | |
207 | + | else ag(s, o[t]) | |
208 | + | ||
209 | + | func u (s,t) = if ((t >= p)) | |
210 | + | then s | |
211 | + | else throw("List size exceeds 50") | |
212 | + | ||
213 | + | u(r(r(r(r(r(r(r(r(r(r(r(r(r(r(r(r(r(r(r(r(r(r(r(r(r(r(r(r(r(r(r(r(r(r(r(r(r(r(r(r(r(r(r(r(r(r(r(r(r(r(q, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15), 16), 17), 18), 19), 20), 21), 22), 23), 24), 25), 26), 27), 28), 29), 30), 31), 32), 33), 34), 35), 36), 37), 38), 39), 40), 41), 42), 43), 44), 45), 46), 47), 48), 49), 50) | |
214 | + | } | |
180 | 215 | ||
181 | 216 | ||
182 | 217 | @Callable(d) | |
183 | - | func Roulette_commit (F,G,H) = { | |
184 | - | let g = d.payments[0] | |
185 | - | if (!(c(d, F))) | |
186 | - | then throw("Wrong payment amount or asset!") | |
187 | - | else [IntegerEntry(J(d), (height + 1)), IntegerEntry(K(d), F), StringEntry(L(d), A(G)), StringEntry(M(d), H), StringEntry(O(d), ((((("| status: commit | revealBlock: " + toString((height + 1))) + " | betAmount: ") + toString(F)) + " | selectedNumbers: ") + A(G)))] | |
188 | - | } | |
189 | - | ||
190 | - | ||
191 | - | ||
192 | - | @Callable(d) | |
193 | - | func Roulette_reveal () = { | |
194 | - | let X = valueOrErrorMessage(getIntegerValue(J(d)), "Bet not found") | |
195 | - | let F = valueOrErrorMessage(getIntegerValue(K(d)), "Bet amount not found") | |
196 | - | let Y = valueOrErrorMessage(getStringValue(L(d)), "Selected numbers not found") | |
197 | - | let Z = valueOrErrorMessage(getStringValue(M(d)), "Direction not found") | |
198 | - | let aa = B(Y) | |
199 | - | if ((X > height)) | |
200 | - | then throw((("Wait " + toString((X - height))) + " blocks to reveal this id")) | |
201 | - | else { | |
202 | - | let ab = valueOrErrorMessage(blockInfoByHeight(X), "unexcpected error") | |
203 | - | let ac = valueOrErrorMessage(ab.vrf, "unexcpected error") | |
204 | - | let ad = sha256(value(ac)) | |
205 | - | let E = (toInt(ad, 16) % 37) | |
206 | - | let ae = a(D(E, F, aa, Z)) | |
207 | - | let af = ((((((((("| commitHeight: " + toString(X)) + " | betAmount: ") + toString(F)) + " | winningAmount: ") + toString(ae)) + " | selectedNumbers: ") + A(aa)) + " | randomNumber: ") + toString(E)) | |
208 | - | let ag = ((((((((("| status: reveal | winningAmount: " + toString(ae)) + " | selectedNumbers: ") + A(aa)) + " | randomNumber: ") + toString(E)) + " | betAmount: ") + toString(F)) + " | selectedNumbers: ") + A(aa)) | |
209 | - | if ((ae > 0)) | |
210 | - | then [DeleteEntry(J(d)), DeleteEntry(K(d)), DeleteEntry(L(d)), DeleteEntry(M(d)), ScriptTransfer(d.caller, ae, unit), StringEntry(N(d), af), StringEntry(O(d), ag)] | |
211 | - | else [DeleteEntry(J(d)), DeleteEntry(K(d)), DeleteEntry(L(d)), DeleteEntry(M(d)), IntegerEntry(N(d), ae), StringEntry(N(d), af), StringEntry(O(d), ag)] | |
212 | - | } | |
213 | - | } | |
214 | - | ||
215 | - | ||
216 | - | ||
217 | - | @Callable(d) | |
218 | - | func LuckyWheel_commit () = if (!(c(d, 1))) | |
219 | - | then throw("Wrong payment amount or asset") | |
220 | - | else [IntegerEntry(P(d), (height + 1)), DeleteEntry(R(d)), DeleteEntry(Q(d)), StringEntry(W(d), "| status: commit")] | |
221 | - | ||
222 | - | ||
223 | - | ||
224 | - | @Callable(d) | |
225 | - | func LuckyWheel_reveal () = { | |
226 | - | let X = valueOrErrorMessage(getIntegerValue(P(d)), "Bet not found") | |
227 | - | if ((X > height)) | |
228 | - | then throw((("Wait " + toString((X - height))) + " blocks to reveal this id")) | |
229 | - | else { | |
230 | - | let ab = valueOrErrorMessage(blockInfoByHeight(X), "unexcpected error") | |
231 | - | let ac = valueOrErrorMessage(ab.vrf, "unexcpected error") | |
232 | - | let ad = sha256(value(ac)) | |
233 | - | let ah = valueOrErrorMessage(blockInfoByHeight((X - 1)), "unexcpected error") | |
234 | - | let ai = valueOrErrorMessage(ab.vrf, "unexcpected error") | |
235 | - | let aj = sha256(value(ac)) | |
236 | - | let ak = (toInt(ad, 16) + (toInt(ad, 10) / toInt(ad, 5))) | |
237 | - | let E = (ak % 12) | |
238 | - | let ae = T(E) | |
239 | - | let ag = (((("| status: reveal | winningAmount: " + toString(ae)) + " | selectedNumbers: ") + " | randomNumber: ") + toString(E)) | |
240 | - | if ((ae > 0)) | |
241 | - | then [DeleteEntry(P(d)), ScriptTransfer(d.caller, ae, unit), IntegerEntry(Q(d), ae), IntegerEntry(R(d), E), StringEntry(W(d), ag)] | |
242 | - | else [DeleteEntry(P(d)), IntegerEntry(Q(d), ae), IntegerEntry(R(d), E), StringEntry(W(d), ag)] | |
243 | - | } | |
218 | + | func Test () = { | |
219 | + | let ak = aj([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30]) | |
220 | + | [StringEntry("test", ("red: " + toString(ak)))] | |
244 | 221 | } | |
245 | 222 | ||
246 | 223 |
github/deemru/w8io/169f3d6 79.72 ms ◑