tx · 9UJfb1FGi8q23ZuKnmBA2AjutZKFwjbYqEngQTy5djbu

3Mr1J95HgTFuj93Uh61WS1PBrxc5hSx5uE5:  -0.05000000 Waves

2024.07.28 12:39 [3213762] smart account 3Mr1J95HgTFuj93Uh61WS1PBrxc5hSx5uE5 > SELF 0.00000000 Waves

{ "type": 13, "id": "9UJfb1FGi8q23ZuKnmBA2AjutZKFwjbYqEngQTy5djbu", "fee": 5000000, "feeAssetId": null, "timestamp": 1722159535914, "version": 2, "chainId": 84, "sender": "3Mr1J95HgTFuj93Uh61WS1PBrxc5hSx5uE5", "senderPublicKey": "DhKSnv34wE65np8uDd8E6ygEbNsn6fHx9p7q4hJTcgRw", "proofs": [ "2xUnrZGhN9tY1qaZUqmBJg5WgR28jeTTZydXjpiVbeFsb8JKggP219udYidyNRQmkRGW5dz8z1RzEmng5gton2DX" ], "script": "base64:AAIFAAAAAAAAAA0IAhIDCgEIEgQKAggIAAAACQAAAAAMQkFJX0NPTlRSQUNUAgAAACMzTjl0S2l4enFUWVduRVhReHJEUTVwQlRHdlFkNnNGc3ZtVgAAAAAMQkFJX0FTU0VUX0lEAQAAACCT4XI4cQSbauiaYx8EJLdkU5csPrxmC4N0r2i7JI3iQgAAAAAGUExBWUVSAgAAAAExAAAAAAJBSQIAAAABMgAAAAAOV0lOTklOR19BTU9VTlQAAAAAAAX14QABAAAABmNoYXJBdAAAAAIAAAADc3RyAAAAAWkJAAGRAAAAAgkABLUAAAACBQAAAANzdHICAAAAAAUAAAABaQEAAAASY2hlY2tJZk1vdmVJc1ZhbGlkAAAAAgAAAAZnYW1lSWQAAAAFYm9hcmQEAAAADGN1cnJlbnRCb2FyZAQAAAAHJG1hdGNoMAkABCIAAAABCQABLAAAAAICAAAADWN1cnJlbnRCb2FyZF8FAAAABmdhbWVJZAMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAGU3RyaW5nBAAAAAFzBQAAAAckbWF0Y2gwBQAAAAFzAgAAAAkwMDAwMDAwMDAEAAA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AAFYm9hcmQJAARMAAAAAgIAAAAJdGljdGFjdG9lCQAETAAAAAICAAAACGNhbGxiYWNrBQAAAANuaWwJAARMAAAAAgkBAAAAD0F0dGFjaGVkUGF5bWVudAAAAAIFAAAADEJBSV9BU1NFVF9JRAAAAAAAAJiWgAUAAAADbmlsAwkAAAAAAAACBQAAAAhuZXh0TW92ZQUAAAAIbmV4dE1vdmUJAARMAAAAAgkBAAAAC1N0cmluZ0VudHJ5AAAAAgkAASwAAAACAgAAAA1jdXJyZW50Qm9hcmRfBQAAAAZnYW1lSWQFAAAABWJvYXJkCQAETAAAAAIJAQAAAAtTdHJpbmdFbnRyeQAAAAIJAAEsAAAAAgIAAAAKaW5pdGlhdG9yXwUAAAAGZ2FtZUlkCQAEJQAAAAEFAAAABnNlbmRlcgkABEwAAAACCQEAAAALU3RyaW5nRW50cnkAAAACCQABLAAAAAICAAAADG5leHRfcGxheWVyXwUAAAAGZ2FtZUlkBQAAAAJBSQUAAAADbmlsCQAAAgAAAAECAAAAJFN0cmljdCB2YWx1ZSBpcyBub3QgZXF1YWwgdG8gaXRzZWxmLgAAAAEAAAACdHgBAAAABnZlcmlmeQAAAAAJAAH0AAAAAwgFAAAAAnR4AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACdHgAAAAGcHJvb2ZzAAAAAAAAAAAACAUAAAACdHgAAAAPc2VuZGVyUHVibGljS2V53AYHQg==", "height": 3213762, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: BKyNJQfPSFqqGiw9KhkiitbSi5SuPDLAxkaBA1NhnXbL Next: GcQaDNHmT1syezTKm3oevMiBGiNkXnrPsF41So8rqWyd Diff:
OldNewDifferences
194194 }
195195
196196
197+func U (k) = {
198+ let V = if ((f(k, 0) == "0"))
199+ then 1
200+ else 0
201+ let W = if ((f(k, 1) == "0"))
202+ then 1
203+ else 0
204+ let X = if ((f(k, 2) == "0"))
205+ then 1
206+ else 0
207+ let Y = if ((f(k, 3) == "0"))
208+ then 1
209+ else 0
210+ let Z = if ((f(k, 4) == "0"))
211+ then 1
212+ else 0
213+ let aa = if ((f(k, 5) == "0"))
214+ then 1
215+ else 0
216+ let ab = if ((f(k, 6) == "0"))
217+ then 1
218+ else 0
219+ let ac = if ((f(k, 7) == "0"))
220+ then 1
221+ else 0
222+ let ad = if ((f(k, 8) == "0"))
223+ then 1
224+ else 0
225+ ((((((((V + W) + X) + Y) + Z) + aa) + ab) + ac) + ad)
226+ }
227+
228+
197229 @Callable(h)
198-func callback (U) = {
199- let V = split(U, "_")
200- let j = V[0]
201- let k = V[1]
202- let W = i(j, k)
203- if (!(W))
230+func callback (ae) = {
231+ let af = split(ae, "_")
232+ let j = af[0]
233+ let k = af[1]
234+ let ag = {
235+ let m = getString(("next_player_" + j))
236+ if ($isInstanceOf(m, "String"))
237+ then {
238+ let n = m
239+ n
240+ }
241+ else ""
242+ }
243+ let ah = i(j, k)
244+ if (!(ah))
204245 then throw("Illegal move!")
205- else {
206- let X = J(j, k, d)
207- if (X)
208- then [StringEntry(("currentBoard_" + j), k), StringEntry(("winner_" + j), "ai")]
209- else [StringEntry(("currentBoard_" + j), k)]
210- }
246+ else if ((ag != d))
247+ then throw("Player has to move first!")
248+ else {
249+ let ai = J(j, k, d)
250+ if (ai)
251+ then [StringEntry(("currentBoard_" + j), k), StringEntry(("winner_" + j), "ai")]
252+ else [StringEntry(("currentBoard_" + j), k), StringEntry(("next_player_" + j), c)]
253+ }
211254 }
212255
213256
214257
215258 @Callable(h)
216-func playTTT (Y,k) = {
217- let Z = size(h.payments)
218- if ((Z != 1))
259+func playTTT (aj,k) = {
260+ let ak = size(h.payments)
261+ if ((ak != 1))
219262 then throw("Payment necessary!")
220263 else {
221- let aa = h.payments[0]
222- let ab = aa.amount
223- let ac = aa.assetId
224- let ad = {
264+ let al = h.payments[0]
265+ let am = al.amount
266+ let an = al.assetId
267+ let ao = {
225268 let m = getInteger(Address(fromBase58String(a)), "price_tictactoe")
226269 if ($isInstanceOf(m, "Int"))
227270 then {
228- let ae = m
229- ae
271+ let ap = m
272+ ap
230273 }
231274 else 0
232275 }
233- if (if ((ac != b))
276+ if (if ((an != b))
234277 then true
235- else (ad > ab))
278+ else (ao > am))
236279 then throw("Payment of the minimal BAI amount necessary!")
237280 else {
238- let af = h.caller
239- let j = if ((size(Y) == 0))
281+ let aq = h.caller
282+ let j = if ((size(aj) == 0))
240283 then toBase58String(h.transactionId)
241- else Y
242- let l = {
243- let m = getString(("currentBoard_" + j))
284+ else aj
285+ let ag = {
286+ let m = getString(("next_player_" + j))
244287 if ($isInstanceOf(m, "String"))
245288 then {
246289 let n = m
247290 n
248291 }
249- else k
292+ else c
250293 }
251- let ag = {
252- let m = getString(("initiator_" + j))
253- if ($isInstanceOf(m, "String"))
254- then {
255- let n = m
256- n
294+ if ((ag != c))
295+ then throw("AI hast to move first!")
296+ else {
297+ let l = {
298+ let m = getString(("currentBoard_" + j))
299+ if ($isInstanceOf(m, "String"))
300+ then {
301+ let n = m
302+ n
303+ }
304+ else k
257305 }
258- else toString(af)
259- }
260- if ((toString(af) != ag))
261- then throw("Only initiator is allowed to make moves!")
262- else {
263- let ah = i(j, k)
264- if (!(ah))
265- then throw("Illegal move!")
306+ let ar = {
307+ let m = getString(("initiator_" + j))
308+ if ($isInstanceOf(m, "String"))
309+ then {
310+ let n = m
311+ n
312+ }
313+ else toString(aq)
314+ }
315+ if ((toString(aq) != ar))
316+ then throw("Only initiator is allowed to make moves!")
266317 else {
267- let ai = J(j, k, c)
268- if (ai)
269- then [StringEntry(("currentBoard_" + j), k), StringEntry(("winner_" + j), "player"), ScriptTransfer(af, e, b)]
318+ let as = i(j, k)
319+ if (!(as))
320+ then throw("Illegal move!")
270321 else {
271- let aj = invoke(Address(fromBase58String(a)), "registerTaskCallback", [((j + "_") + k), "tictactoe", "callback"], [AttachedPayment(b, 10000000)])
272- if ((aj == aj))
273- then [StringEntry(("currentBoard_" + j), k), StringEntry(("initiator_" + j), toString(af))]
274- else throw("Strict value is not equal to itself.")
322+ let at = J(j, k, c)
323+ let au = U(k)
324+ if (at)
325+ then [StringEntry(("currentBoard_" + j), k), StringEntry(("winner_" + j), "player"), ScriptTransfer(aq, e, b)]
326+ else if ((au == 0))
327+ then [StringEntry(("currentBoard_" + j), k), StringEntry(("winner_" + j), "draw")]
328+ else {
329+ let av = invoke(Address(fromBase58String(a)), "registerTaskCallback", [((j + "_") + k), "tictactoe", "callback"], [AttachedPayment(b, 10000000)])
330+ if ((av == av))
331+ then [StringEntry(("currentBoard_" + j), k), StringEntry(("initiator_" + j), toString(aq)), StringEntry(("next_player_" + j), d)]
332+ else throw("Strict value is not equal to itself.")
333+ }
275334 }
276335 }
277336 }
280339 }
281340
282341
283-@Verifier(ak)
284-func al () = sigVerify(ak.bodyBytes, ak.proofs[0], ak.senderPublicKey)
342+@Verifier(aw)
343+func ax () = sigVerify(aw.bodyBytes, aw.proofs[0], aw.senderPublicKey)
285344
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let a = "3N9tKixzqTYWnEXQxrDQ5pBTGvQd6sFsvmV"
55
66 let b = base58'AxGKQRxKo4F2EbhrRq6N2tdLsxtMnpzQsS4QemV6V1W1'
77
88 let c = "1"
99
1010 let d = "2"
1111
1212 let e = 100000000
1313
1414 func f (g,h) = split(g, "")[h]
1515
1616
1717 func i (j,k) = {
1818 let l = {
1919 let m = getString(("currentBoard_" + j))
2020 if ($isInstanceOf(m, "String"))
2121 then {
2222 let n = m
2323 n
2424 }
2525 else "000000000"
2626 }
2727 let o = if ((f(k, 0) != f(l, 0)))
2828 then 1
2929 else 0
3030 let p = if ((f(k, 1) != f(l, 1)))
3131 then 1
3232 else 0
3333 let q = if ((f(k, 2) != f(l, 2)))
3434 then 1
3535 else 0
3636 let r = if ((f(k, 3) != f(l, 3)))
3737 then 1
3838 else 0
3939 let s = if ((f(k, 4) != f(l, 4)))
4040 then 1
4141 else 0
4242 let t = if ((f(k, 5) != f(l, 5)))
4343 then 1
4444 else 0
4545 let u = if ((f(k, 6) != f(l, 6)))
4646 then 1
4747 else 0
4848 let v = if ((f(k, 7) != f(l, 7)))
4949 then 1
5050 else 0
5151 let w = if ((f(k, 8) != f(l, 8)))
5252 then 1
5353 else 0
5454 let x = if (if ((f(k, 0) == f(l, 0)))
5555 then true
5656 else (f(l, 0) == "0"))
5757 then true
5858 else false
5959 let y = if (if ((f(k, 1) == f(l, 1)))
6060 then true
6161 else (f(l, 1) == "0"))
6262 then true
6363 else false
6464 let z = if (if ((f(k, 2) == f(l, 2)))
6565 then true
6666 else (f(l, 2) == "0"))
6767 then true
6868 else false
6969 let A = if (if ((f(k, 3) == f(l, 3)))
7070 then true
7171 else (f(l, 3) == "0"))
7272 then true
7373 else false
7474 let B = if (if ((f(k, 4) == f(l, 4)))
7575 then true
7676 else (f(l, 4) == "0"))
7777 then true
7878 else false
7979 let C = if (if ((f(k, 5) == f(l, 5)))
8080 then true
8181 else (f(l, 5) == "0"))
8282 then true
8383 else false
8484 let D = if (if ((f(k, 6) == f(l, 6)))
8585 then true
8686 else (f(l, 6) == "0"))
8787 then true
8888 else false
8989 let E = if (if ((f(k, 7) == f(l, 7)))
9090 then true
9191 else (f(l, 7) == "0"))
9292 then true
9393 else false
9494 let F = if (if ((f(k, 8) == f(l, 8)))
9595 then true
9696 else (f(l, 8) == "0"))
9797 then true
9898 else false
9999 let G = if (if (if (if (if (if (if (if (x)
100100 then y
101101 else false)
102102 then z
103103 else false)
104104 then A
105105 else false)
106106 then B
107107 else false)
108108 then C
109109 else false)
110110 then D
111111 else false)
112112 then E
113113 else false)
114114 then F
115115 else false
116116 let H = ((((((((o + p) + q) + r) + s) + t) + u) + v) + w)
117117 let I = (1 >= H)
118118 if ((H > 1))
119119 then throw("More than move made!")
120120 else if (!(G))
121121 then throw("Former position overwritten!")
122122 else if (G)
123123 then I
124124 else false
125125 }
126126
127127
128128 func J (j,k,K) = {
129129 let l = {
130130 let m = getString(("currentBoard_" + j))
131131 if ($isInstanceOf(m, "String"))
132132 then {
133133 let n = m
134134 n
135135 }
136136 else "000000000"
137137 }
138138 let L = [[0, 1, 2], [3, 4, 5], [6, 7, 8], [0, 3, 6], [1, 4, 7], [2, 5, 8], [0, 4, 8], [2, 4, 6]]
139139 let M = if (if ((f(l, L[0][0]) == K))
140140 then (f(l, L[0][1]) == K)
141141 else false)
142142 then (f(l, L[0][2]) == K)
143143 else false
144144 let N = if (if ((f(l, L[1][0]) == K))
145145 then (f(l, L[1][1]) == K)
146146 else false)
147147 then (f(l, L[1][2]) == K)
148148 else false
149149 let O = if (if ((f(l, L[2][0]) == K))
150150 then (f(l, L[2][1]) == K)
151151 else false)
152152 then (f(l, L[2][2]) == K)
153153 else false
154154 let P = if (if ((f(l, L[3][0]) == K))
155155 then (f(l, L[3][1]) == K)
156156 else false)
157157 then (f(l, L[3][2]) == K)
158158 else false
159159 let Q = if (if ((f(l, L[4][0]) == K))
160160 then (f(l, L[4][1]) == K)
161161 else false)
162162 then (f(l, L[4][2]) == K)
163163 else false
164164 let R = if (if ((f(l, L[5][0]) == K))
165165 then (f(l, L[5][1]) == K)
166166 else false)
167167 then (f(l, L[5][2]) == K)
168168 else false
169169 let S = if (if ((f(l, L[6][0]) == K))
170170 then (f(l, L[6][1]) == K)
171171 else false)
172172 then (f(l, L[6][2]) == K)
173173 else false
174174 let T = if (if ((f(l, L[7][0]) == K))
175175 then (f(l, L[7][1]) == K)
176176 else false)
177177 then (f(l, L[7][2]) == K)
178178 else false
179179 if (if (if (if (if (if (if (M)
180180 then true
181181 else N)
182182 then true
183183 else O)
184184 then true
185185 else P)
186186 then true
187187 else N)
188188 then true
189189 else R)
190190 then true
191191 else S)
192192 then true
193193 else T
194194 }
195195
196196
197+func U (k) = {
198+ let V = if ((f(k, 0) == "0"))
199+ then 1
200+ else 0
201+ let W = if ((f(k, 1) == "0"))
202+ then 1
203+ else 0
204+ let X = if ((f(k, 2) == "0"))
205+ then 1
206+ else 0
207+ let Y = if ((f(k, 3) == "0"))
208+ then 1
209+ else 0
210+ let Z = if ((f(k, 4) == "0"))
211+ then 1
212+ else 0
213+ let aa = if ((f(k, 5) == "0"))
214+ then 1
215+ else 0
216+ let ab = if ((f(k, 6) == "0"))
217+ then 1
218+ else 0
219+ let ac = if ((f(k, 7) == "0"))
220+ then 1
221+ else 0
222+ let ad = if ((f(k, 8) == "0"))
223+ then 1
224+ else 0
225+ ((((((((V + W) + X) + Y) + Z) + aa) + ab) + ac) + ad)
226+ }
227+
228+
197229 @Callable(h)
198-func callback (U) = {
199- let V = split(U, "_")
200- let j = V[0]
201- let k = V[1]
202- let W = i(j, k)
203- if (!(W))
230+func callback (ae) = {
231+ let af = split(ae, "_")
232+ let j = af[0]
233+ let k = af[1]
234+ let ag = {
235+ let m = getString(("next_player_" + j))
236+ if ($isInstanceOf(m, "String"))
237+ then {
238+ let n = m
239+ n
240+ }
241+ else ""
242+ }
243+ let ah = i(j, k)
244+ if (!(ah))
204245 then throw("Illegal move!")
205- else {
206- let X = J(j, k, d)
207- if (X)
208- then [StringEntry(("currentBoard_" + j), k), StringEntry(("winner_" + j), "ai")]
209- else [StringEntry(("currentBoard_" + j), k)]
210- }
246+ else if ((ag != d))
247+ then throw("Player has to move first!")
248+ else {
249+ let ai = J(j, k, d)
250+ if (ai)
251+ then [StringEntry(("currentBoard_" + j), k), StringEntry(("winner_" + j), "ai")]
252+ else [StringEntry(("currentBoard_" + j), k), StringEntry(("next_player_" + j), c)]
253+ }
211254 }
212255
213256
214257
215258 @Callable(h)
216-func playTTT (Y,k) = {
217- let Z = size(h.payments)
218- if ((Z != 1))
259+func playTTT (aj,k) = {
260+ let ak = size(h.payments)
261+ if ((ak != 1))
219262 then throw("Payment necessary!")
220263 else {
221- let aa = h.payments[0]
222- let ab = aa.amount
223- let ac = aa.assetId
224- let ad = {
264+ let al = h.payments[0]
265+ let am = al.amount
266+ let an = al.assetId
267+ let ao = {
225268 let m = getInteger(Address(fromBase58String(a)), "price_tictactoe")
226269 if ($isInstanceOf(m, "Int"))
227270 then {
228- let ae = m
229- ae
271+ let ap = m
272+ ap
230273 }
231274 else 0
232275 }
233- if (if ((ac != b))
276+ if (if ((an != b))
234277 then true
235- else (ad > ab))
278+ else (ao > am))
236279 then throw("Payment of the minimal BAI amount necessary!")
237280 else {
238- let af = h.caller
239- let j = if ((size(Y) == 0))
281+ let aq = h.caller
282+ let j = if ((size(aj) == 0))
240283 then toBase58String(h.transactionId)
241- else Y
242- let l = {
243- let m = getString(("currentBoard_" + j))
284+ else aj
285+ let ag = {
286+ let m = getString(("next_player_" + j))
244287 if ($isInstanceOf(m, "String"))
245288 then {
246289 let n = m
247290 n
248291 }
249- else k
292+ else c
250293 }
251- let ag = {
252- let m = getString(("initiator_" + j))
253- if ($isInstanceOf(m, "String"))
254- then {
255- let n = m
256- n
294+ if ((ag != c))
295+ then throw("AI hast to move first!")
296+ else {
297+ let l = {
298+ let m = getString(("currentBoard_" + j))
299+ if ($isInstanceOf(m, "String"))
300+ then {
301+ let n = m
302+ n
303+ }
304+ else k
257305 }
258- else toString(af)
259- }
260- if ((toString(af) != ag))
261- then throw("Only initiator is allowed to make moves!")
262- else {
263- let ah = i(j, k)
264- if (!(ah))
265- then throw("Illegal move!")
306+ let ar = {
307+ let m = getString(("initiator_" + j))
308+ if ($isInstanceOf(m, "String"))
309+ then {
310+ let n = m
311+ n
312+ }
313+ else toString(aq)
314+ }
315+ if ((toString(aq) != ar))
316+ then throw("Only initiator is allowed to make moves!")
266317 else {
267- let ai = J(j, k, c)
268- if (ai)
269- then [StringEntry(("currentBoard_" + j), k), StringEntry(("winner_" + j), "player"), ScriptTransfer(af, e, b)]
318+ let as = i(j, k)
319+ if (!(as))
320+ then throw("Illegal move!")
270321 else {
271- let aj = invoke(Address(fromBase58String(a)), "registerTaskCallback", [((j + "_") + k), "tictactoe", "callback"], [AttachedPayment(b, 10000000)])
272- if ((aj == aj))
273- then [StringEntry(("currentBoard_" + j), k), StringEntry(("initiator_" + j), toString(af))]
274- else throw("Strict value is not equal to itself.")
322+ let at = J(j, k, c)
323+ let au = U(k)
324+ if (at)
325+ then [StringEntry(("currentBoard_" + j), k), StringEntry(("winner_" + j), "player"), ScriptTransfer(aq, e, b)]
326+ else if ((au == 0))
327+ then [StringEntry(("currentBoard_" + j), k), StringEntry(("winner_" + j), "draw")]
328+ else {
329+ let av = invoke(Address(fromBase58String(a)), "registerTaskCallback", [((j + "_") + k), "tictactoe", "callback"], [AttachedPayment(b, 10000000)])
330+ if ((av == av))
331+ then [StringEntry(("currentBoard_" + j), k), StringEntry(("initiator_" + j), toString(aq)), StringEntry(("next_player_" + j), d)]
332+ else throw("Strict value is not equal to itself.")
333+ }
275334 }
276335 }
277336 }
278337 }
279338 }
280339 }
281340
282341
283-@Verifier(ak)
284-func al () = sigVerify(ak.bodyBytes, ak.proofs[0], ak.senderPublicKey)
342+@Verifier(aw)
343+func ax () = sigVerify(aw.bodyBytes, aw.proofs[0], aw.senderPublicKey)
285344

github/deemru/w8io/169f3d6 
50.12 ms