tx · aor7LFVpHayLX9ZCExAuiPS5SXEm1MvkFMG2tmvqZr7 3NCCNgEjGtWKLt78jWc9DiA3Jd2jmfg7BZX: -0.10000000 Waves 2022.01.14 02:19 [1877836] smart account 3NCCNgEjGtWKLt78jWc9DiA3Jd2jmfg7BZX > SELF 0.00000000 Waves
{ "type": 13, "id": "aor7LFVpHayLX9ZCExAuiPS5SXEm1MvkFMG2tmvqZr7", "fee": 10000000, "feeAssetId": null, "timestamp": 1642116019471, "version": 2, "chainId": 84, "sender": "3NCCNgEjGtWKLt78jWc9DiA3Jd2jmfg7BZX", "senderPublicKey": "AcdhXSF5aWK6Lmdtv3cyCZ7vehbxsNNGagWCd2FpZo1M", "proofs": [ "53ikMgE9TE9sCmW6T1fZUTwRe1XWdkbv4FvGqNo4CCXGCH1ur5c4FbcPbSVwgPpXLuXNgnQVYcTZQmxngc6X8T3N" ], "script": "base64:AAIFAAAAAAAAABQIAhIFCgMIAQESABIHCgUBCAgICAAAAA8AAAAAE2dhbWVNYXN0ZXJQdWJsaWNLZXkBAAAAIF1t2Oq4Jp6DRGnJV2x+n66xACBB37xnTL7cQnLLqBNvAAAAAAlSU0FQVUJMSUMJAAJbAAAAAQIAAAGTYmFzZTY0Ok1JSUJJekFOQmdrcWhraUc5dzBCQVFFRkFBT0NBUkFBTUlJQkN3S0NBUUlBK0NwYnpNQktwcSs3VmFyU0RITFcwd1FTb2gyTFRiZ2wxckFoZnJ1WkdDanQ2TU80bzF2MWlMcUt5TkgzRkpzdndsTFVxbXFFN0UyV2w3TGJJUEEyNlB4TzJYQ0RmdmowT1dwN2NFSmtVQkVpeVBZQ24raXVQWFVQd3Vkb0ZnTTRXSGYwSVBiREoyTzZPZ3pRbEJCbU51Nk93cjduYUlUaUpyUEF2YWtQZ0FkbVVQdjRyT3pjdTZCUjBUOEd3c3p3cHJ2d1dabEtGNkFkMDBvbUxGRG14NjZIdkJFNTFzUkJpWElSYkpuakRobG9waXplNExvUjFGSXJRYUF1MXNmczViRUh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ABmNhcmRzMgUAAAAGY2FyZHMzCQAAAgAAAAECAAAAEUluaXRHYW1lIFJlcXVpcmVkAAAAAQAAAAJ0eAEAAAAGdmVyaWZ5AAAAAAkAAfQAAAADCAUAAAACdHgAAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAAJ0eAAAAAZwcm9vZnMAAAAAAAAAAAAIBQAAAAJ0eAAAAA9zZW5kZXJQdWJsaWNLZXnI2iCP", "height": 1877836, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: Bx6s2W9sv91RCp19DALgsMeR5t43NJQC1ZZzZ68Ju6aE Next: none Full:
Old | New | Differences | |
---|---|---|---|
1 | - | {-# STDLIB_VERSION | |
1 | + | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | - | let a = base58' | |
4 | + | let a = base58'7Hi4o6vBstRs79NMVMjEove52dmP87RAcvNDAXN8C4Wi' | |
5 | 5 | ||
6 | - | let b = fromBase64String("base64: | |
6 | + | let b = fromBase64String("base64:MIIBIzANBgkqhkiG9w0BAQEFAAOCARAAMIIBCwKCAQIA+CpbzMBKpq+7VarSDHLW0wQSoh2LTbgl1rAhfruZGCjt6MO4o1v1iLqKyNH3FJsvwlLUqmqE7E2Wl7LbIPA26PxO2XCDfvj0OWp7cEJkUBEiyPYCn+iuPXUPwudoFgM4WHf0IPbDJ2O6OgzQlBBmNu6Owr7naITiJrPAvakPgAdmUPv4rOzcu6BR0T8GwszwprvwWZlKF6Ad00omLFDmx66HvBE51sRBiXIRbJnjDhlopize4LoR1FIrQaAu1sfs5bEHLA33jvKybne+IDawCsiINZYdPZV1WWcURC+XAFfBiYCw4PYyguxaBRHotzLc2dOsBV1HDNIjLKVoRknyt50CAwEAAQ==") | |
7 | 7 | ||
8 | - | let c = | |
8 | + | let c = "G_SETUPGAMESCOUNTER" | |
9 | 9 | ||
10 | - | let d = "G_ | |
10 | + | let d = "G_USEDGAMESCOUNTER" | |
11 | 11 | ||
12 | - | let e = "G_ | |
12 | + | let e = "G_DEALERQUEUE" | |
13 | 13 | ||
14 | - | let f = "G_ | |
14 | + | let f = "G_MAXBET" | |
15 | 15 | ||
16 | - | let g = "G_MAXBET" | |
17 | - | ||
18 | - | let h = "G_MINBET" | |
19 | - | ||
20 | - | func i () = getInteger(this, g) | |
16 | + | func g () = getInteger(this, c) | |
21 | 17 | ||
22 | 18 | ||
23 | - | func | |
19 | + | func h () = getInteger(this, d) | |
24 | 20 | ||
25 | 21 | ||
26 | - | func | |
22 | + | func i (j) = (j != a) | |
27 | 23 | ||
28 | 24 | ||
29 | - | func | |
25 | + | func k (l,m) = ((("G_" + toString(l)) + "_CARDSIGNATURE_") + toString(m)) | |
30 | 26 | ||
31 | 27 | ||
32 | - | func | |
28 | + | func n (l,m) = getString(this, k(l, m)) | |
33 | 29 | ||
34 | 30 | ||
35 | - | func | |
31 | + | func o (l,m) = ((("G_" + toString(l)) + "_CARD_") + toString(m)) | |
36 | 32 | ||
37 | 33 | ||
38 | - | func p ( | |
34 | + | func p (l) = (("G_" + toString(l)) + "_STATE") | |
39 | 35 | ||
40 | 36 | ||
41 | - | func | |
37 | + | func q (l) = (("G_" + toString(l)) + "_OFFSET") | |
42 | 38 | ||
43 | 39 | ||
44 | - | func | |
40 | + | func r (l,s,t,u,v,w) = [IntegerEntry(c, l), IntegerEntry(p(l), 0), IntegerEntry(q(l), s), StringEntry(k(l, 0), t), StringEntry(k(l, 1), u), StringEntry(k(l, 2), v), StringEntry(k(l, 3), w)] | |
45 | 41 | ||
46 | 42 | ||
47 | - | func t (q) = (("G_" + toString(q)) + "_PAYOUT") | |
48 | - | ||
49 | - | ||
50 | - | func u (q) = (("G_" + toString(q)) + "_STATE") | |
51 | - | ||
52 | - | ||
53 | - | func v (q) = (("G_" + toString(q)) + "_OFFSET") | |
54 | - | ||
55 | - | ||
56 | - | func w (q,x) = ((("G_" + toString(q)) + "_CARDSIGNATURE_") + toString(x)) | |
57 | - | ||
58 | - | ||
59 | - | func y (z) = (("P_" + z) + "_CURRENTGAME") | |
60 | - | ||
61 | - | ||
62 | - | func A (z) = getInteger(this, y(z)) | |
63 | - | ||
64 | - | ||
65 | - | func B (q) = getInteger(this, p(q)) | |
66 | - | ||
67 | - | ||
68 | - | func C (q) = getInteger(this, r(q)) | |
69 | - | ||
70 | - | ||
71 | - | func D (q) = getInteger(this, u(q)) | |
72 | - | ||
73 | - | ||
74 | - | func E (q) = getString(this, s(q)) | |
75 | - | ||
76 | - | ||
77 | - | func F (q,x) = getString(this, w(q, x)) | |
78 | - | ||
79 | - | ||
80 | - | func G (q,x) = ((("G_" + toString(q)) + "_CARD_") + toString(x)) | |
81 | - | ||
82 | - | ||
83 | - | func H (q,I,J,K,L,M) = [IntegerEntry(d, q), IntegerEntry(u(q), 0), IntegerEntry(v(q), I), StringEntry(w(q, 0), J), StringEntry(w(q, 1), K), StringEntry(w(q, 2), L), StringEntry(w(q, 3), M)] | |
84 | - | ||
85 | - | ||
86 | - | func N (z,O,P) = { | |
87 | - | let Q = (value(l()) + 1) | |
88 | - | let R = value(m()) | |
89 | - | [IntegerEntry(e, Q), IntegerEntry(y(z), Q), IntegerEntry(u(Q), 1), IntegerEntry(p(Q), O), IntegerEntry(r(Q), P), StringEntry(f, ((value(m()) + ",") + toString(Q))), StringEntry(s(Q), z)] | |
43 | + | @Callable(x) | |
44 | + | func verifyCard (m,l,y) = { | |
45 | + | let z = rsaVerify_16Kb(SHA256, toBytes(m), fromBase64String(split(value(n(l, y)), " ")[0]), b) | |
46 | + | throw(toString(z)) | |
90 | 47 | } | |
91 | 48 | ||
92 | 49 | ||
93 | - | func S (T) = parseIntValue(take(T, 2)) | |
94 | 50 | ||
95 | - | ||
96 | - | func U (V) = if ((size(V.payments) == 0)) | |
97 | - | then throw("Payment must be attached") | |
98 | - | else if ((size(V.payments) == 1)) | |
99 | - | then { | |
100 | - | let W = V.payments[0] | |
101 | - | W.amount | |
102 | - | } | |
103 | - | else throw("There should be only one payment") | |
104 | - | ||
105 | - | ||
106 | - | func X (x,q,Y) = rsaVerify_16Kb(SHA256, toBytes(x), fromBase64String(split(value(F(q, Y)), " ")[0]), b) | |
107 | - | ||
108 | - | ||
109 | - | @Callable(V) | |
110 | - | func revealRound2 (Z,aa,ab) = if (n(V.callerPublicKey)) | |
111 | - | then throw("revealRound2_FORBBIDEN") | |
51 | + | @Callable(x) | |
52 | + | func initGame () = if (i(x.callerPublicKey)) | |
53 | + | then throw("initGame_FORBBIDEN") | |
112 | 54 | else { | |
113 | - | let R = value(m()) | |
114 | - | let ac = split(R, ",")[1] | |
115 | - | if ((ac == toString(Z))) | |
116 | - | then if (if (if ((value(D(Z)) == 3)) | |
117 | - | then X(aa, Z, 2) | |
118 | - | else false) | |
119 | - | then X(ab, Z, 3) | |
120 | - | else false) | |
121 | - | then { | |
122 | - | let ad = S(split(aa, "+")[2]) | |
123 | - | let ae = S(split(ab, "+")[2]) | |
124 | - | if ((ad >= ae)) | |
125 | - | then { | |
126 | - | let af = value(B(Z)) | |
127 | - | let z = value(addressFromString(value(E(Z)))) | |
128 | - | [StringEntry(G(Z, 2), aa), StringEntry(G(Z, 3), ab), IntegerEntry(u(Z), 6), StringEntry(f, takeRight(R, (size(R) - (1 + size(toString(Z)))))), ScriptTransfer(z, ((af * 2) + (af - V.fee)), unit)] | |
129 | - | } | |
130 | - | else [StringEntry(G(Z, 2), aa), StringEntry(G(Z, 3), ab), IntegerEntry(u(Z), 6), StringEntry(f, takeRight(R, (size(R) - (1 + size(toString(Z))))))] | |
131 | - | } | |
132 | - | else throw("One of the cards failed to be verified or game is not in state 1.") | |
133 | - | else throw(("The next game to process is " + ac)) | |
55 | + | let A = g() | |
56 | + | if ($isInstanceOf(A, "Int")) | |
57 | + | then { | |
58 | + | let B = A | |
59 | + | throw("INIT_ALREADY_DONE") | |
60 | + | } | |
61 | + | else [IntegerEntry(c, 0), IntegerEntry(d, 0), IntegerEntry(f, 100000000), StringEntry(e, "")] | |
134 | 62 | } | |
135 | 63 | ||
136 | 64 | ||
137 | 65 | ||
138 | - | @Callable(V) | |
139 | - | func war () = { | |
140 | - | let z = toBase58String(V.caller.bytes) | |
141 | - | let Z = value(A(z)) | |
142 | - | if ((value(D(Z)) != 2)) | |
143 | - | then throw("Game is not in correct state.") | |
144 | - | else { | |
145 | - | let O = value(B(Z)) | |
146 | - | let ag = U(V) | |
147 | - | if (((ag + V.fee) != O)) | |
148 | - | then throw((("Payment must me same as the original bet (" + toString(O)) + ")")) | |
149 | - | else [IntegerEntry(u(Z), 3), StringEntry(f, ((value(m()) + ",") + toString(Z)))] | |
150 | - | } | |
151 | - | } | |
152 | - | ||
153 | - | ||
154 | - | ||
155 | - | @Callable(V) | |
156 | - | func surrender () = { | |
157 | - | let z = toBase58String(V.caller.bytes) | |
158 | - | let Z = value(A(z)) | |
159 | - | if ((value(D(Z)) != 2)) | |
160 | - | then throw("Game is not in correct state.") | |
161 | - | else { | |
162 | - | let O = value(B(Z)) | |
163 | - | let R = value(m()) | |
164 | - | [IntegerEntry(u(Z), 5), ScriptTransfer(V.caller, (O / 2), unit)] | |
165 | - | } | |
166 | - | } | |
167 | - | ||
168 | - | ||
169 | - | ||
170 | - | @Callable(V) | |
171 | - | func revealRound1 (Z,ah,ai) = if (n(V.callerPublicKey)) | |
172 | - | then throw("revealRound1_FORBBIDEN") | |
66 | + | @Callable(x) | |
67 | + | func setupGame (l,t,u,v,w) = if (i(x.callerPublicKey)) | |
68 | + | then throw("setupGame_FORBIDEN") | |
173 | 69 | else { | |
174 | - | let R = value(m()) | |
175 | - | let ac = split(R, ",")[1] | |
176 | - | if ((ac == toString(Z))) | |
177 | - | then if (if (if ((value(D(Z)) == 1)) | |
178 | - | then X(ah, Z, 0) | |
179 | - | else false) | |
180 | - | then X(ai, Z, 1) | |
181 | - | else false) | |
182 | - | then { | |
183 | - | let ad = S(split(ah, "+")[2]) | |
184 | - | let ae = S(split(ai, "+")[2]) | |
185 | - | if ((ad == ae)) | |
186 | - | then { | |
187 | - | let aj = value(C(Z)) | |
188 | - | let z = value(addressFromString(value(E(Z)))) | |
189 | - | if ((aj != 0)) | |
190 | - | then [StringEntry(G(Z, 0), ah), StringEntry(G(Z, 1), ai), IntegerEntry(u(Z), 2), StringEntry(f, takeRight(R, (size(R) - (1 + size(toString(Z)))))), ScriptTransfer(z, ((aj * 10) + aj), unit)] | |
191 | - | else [StringEntry(G(Z, 0), ah), StringEntry(G(Z, 1), ai), IntegerEntry(u(Z), 2), StringEntry(f, takeRight(R, (size(R) - (1 + size(toString(Z))))))] | |
192 | - | } | |
193 | - | else if ((ad > ae)) | |
194 | - | then { | |
195 | - | let af = value(B(Z)) | |
196 | - | let z = value(addressFromString(value(E(Z)))) | |
197 | - | [StringEntry(G(Z, 0), ah), StringEntry(G(Z, 1), ai), IntegerEntry(u(Z), 4), StringEntry(f, takeRight(R, (size(R) - (1 + size(toString(Z)))))), ScriptTransfer(z, af, unit)] | |
198 | - | } | |
199 | - | else [StringEntry(G(Z, 0), ah), StringEntry(G(Z, 1), ai), IntegerEntry(u(Z), 4), StringEntry(f, takeRight(R, (size(R) - (1 + size(toString(Z))))))] | |
200 | - | } | |
201 | - | else throw("One of the cards failed to be verified or game is not in state 1.") | |
202 | - | else throw(("The next game to process is " + ac)) | |
203 | - | } | |
204 | - | ||
205 | - | ||
206 | - | ||
207 | - | @Callable(V) | |
208 | - | func bet (af,aj) = { | |
209 | - | let ak = toBase58String(V.caller.bytes) | |
210 | - | let ag = U(V) | |
211 | - | let O = (af + V.fee) | |
212 | - | let P = aj | |
213 | - | let z = toBase58String(V.caller.bytes) | |
214 | - | if ((ag != (af + aj))) | |
215 | - | then throw("normal bet + tie bet should be equal to the payment") | |
216 | - | else if (if ((value(j()) > ag)) | |
217 | - | then true | |
218 | - | else (ag > value(i()))) | |
219 | - | then throw((((("Payment needs to be in the following interval [" + toString(value(j()))) + " ") + toString(value(i()))) + "]")) | |
220 | - | else if ((value(l()) >= value(k()))) | |
221 | - | then throw("No available set up games to use.") | |
222 | - | else { | |
223 | - | let al = A(z) | |
224 | - | if ($isInstanceOf(al, "Int")) | |
225 | - | then { | |
226 | - | let am = al | |
227 | - | if ((4 > value(D(am)))) | |
228 | - | then throw((("Game " + toString(am)) + " is still in progress.")) | |
229 | - | else N(z, O, P) | |
230 | - | } | |
231 | - | else if ($isInstanceOf(al, "Unit")) | |
232 | - | then N(z, O, P) | |
233 | - | else throw("Match error") | |
234 | - | } | |
235 | - | } | |
236 | - | ||
237 | - | ||
238 | - | ||
239 | - | @Callable(V) | |
240 | - | func setupGame (q,ah,ai,aa,ab) = if (n(V.callerPublicKey)) | |
241 | - | then throw("setupGame_FORBBIDEN") | |
242 | - | else { | |
243 | - | let al = k() | |
244 | - | if ($isInstanceOf(al, "Int")) | |
70 | + | let A = g() | |
71 | + | if ($isInstanceOf(A, "Int")) | |
245 | 72 | then { | |
246 | - | let | |
247 | - | let | |
248 | - | let | |
249 | - | if (( | |
73 | + | let C = A | |
74 | + | let s = (toInt(sha256((take(lastBlock.generationSignature, 16) + take(x.transactionId, 16)))) % 2) | |
75 | + | let D = (C + 1) | |
76 | + | if ((l != D)) | |
250 | 77 | then throw("Wrong game number.") | |
251 | - | else if (((I % 2) == 1)) | |
252 | - | then H(Z, I, ab, aa, ai, ah) | |
253 | - | else H(Z, I, ah, ai, aa, ab) | |
78 | + | else r(D, s, t, u, v, w) | |
254 | 79 | } | |
255 | 80 | else throw("InitGame Required") | |
256 | 81 | } | |
257 | 82 | ||
258 | 83 | ||
259 | - | ||
260 | - | @Callable(V) | |
261 | - | func initGame (ao,ap) = if (n(V.callerPublicKey)) | |
262 | - | then throw("initGame_FORBBIDEN") | |
263 | - | else { | |
264 | - | let al = k() | |
265 | - | if ($isInstanceOf(al, "Int")) | |
266 | - | then { | |
267 | - | let aq = al | |
268 | - | throw("INIT_ALREADY_DONE") | |
269 | - | } | |
270 | - | else [IntegerEntry(d, 0), IntegerEntry(e, 0), IntegerEntry(g, ao), IntegerEntry(h, ap), StringEntry(f, "")] | |
271 | - | } | |
272 | - | ||
273 | - | ||
274 | - | @Verifier(ar) | |
275 | - | func as () = sigVerify(ar.bodyBytes, ar.proofs[0], ar.senderPublicKey) | |
84 | + | @Verifier(E) | |
85 | + | func F () = sigVerify(E.bodyBytes, E.proofs[0], E.senderPublicKey) | |
276 | 86 |
github/deemru/w8io/169f3d6 57.72 ms ◑