tx · 864xNvJnBUwTCzZirzdsRzE6TPcHiAWuqeka1L9W3xwp

3N7Gg64FJ3ESaqn41qu1ete7zmzbmoP1AAV:  -0.01000000 Waves

2021.12.09 08:50 [1826307] smart account 3N7Gg64FJ3ESaqn41qu1ete7zmzbmoP1AAV > SELF 0.00000000 Waves

{ "type": 13, "id": "864xNvJnBUwTCzZirzdsRzE6TPcHiAWuqeka1L9W3xwp", "fee": 1000000, "feeAssetId": null, "timestamp": 1639029035349, "version": 2, "chainId": 84, "sender": "3N7Gg64FJ3ESaqn41qu1ete7zmzbmoP1AAV", "senderPublicKey": "5amLtMwixiEesBDKPy9dkFWntG2fNxhTs5n69JbQE9F7", "proofs": [ "4q8b6C5Xamb1tTMcP5Dfy5yQnoGYjccvu4Yrzy8efWAYCL6gXCxkZRfKE89BK5VB8MtrCShtGAQ6gPwrV65U8bFK" ], "script": "base64:AAIFAAAAAAAAABoIAhIAEgUKAwgICBIDCgEIEgMKAQgSAwoBCAAAAAEAAAAABXNlcGFyAgAAAAF8AAAABQAAAAFpAQAAAAVyZXNldAAAAAAJAARMAAAAAgkBAAAAC1N0cmluZ0VudHJ5AAAAAgIAAAAKbGFzdGdhbWVpZAIAAAABMAkABEwAAAACCQEAAAALU3RyaW5nRW50cnkAAAACAgAAAA9sYXN0Y2hhbGxlbmdlaWQCAAAAATAFAAAAA25pbAAAAAFpAQAAAARtb3ZlAAAAAwAAAAZnYW1laWQAAAAEZnJvbQAAAAJ0bwQAAAAEZ2FtZQkABLUAAAACCQEAAAARQGV4dHJOYXRpdmUoMTA1OCkAAAABCQABLAAAAAICAAAABWdhbWUtBQAAAAZnYW1laWQFAAAABXNlcGFyAwkAAAAAAAACBQAAAARnYW1lBQAAAARnYW1lBAAAAAxjYWxsZXJBZHJlc3MJAAJYAAAAAQgIBQAAAAFpAAAABmNhbGxlcgAAAAVieXRlcwMJAAAAAAAAAgUAAAAMY2FsbGVyQWRyZXNzBQAAAAxjYWxsZXJBZHJlc3MEAAAABmlzZ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MAkABCIAAAABCQABLAAAAAICAAAACmNoYWxsZW5nZS0FAAAADGNoYWxsZW5kZ2VpZAMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAGU3RyaW5nBAAAAAFhBQAAAAckbWF0Y2gwCQEAAAARQGV4dHJOYXRpdmUoMTA1OCkAAAABCQABLAAAAAICAAAACmNoYWxsZW5nZS0FAAAADGNoYWxsZW5kZ2VpZAIAAAAABAAAAAljaGFsbGVuZ2UJAAS1AAAAAgkBAAAADGdldGNoYWxsZW5nZQAAAAEFAAAADGNoYWxsZW5kZ2VpZAUAAAAFc2VwYXIDCQAAZgAAAAIJAAGQAAAAAQUAAAAJY2hhbGxlbmdlAAAAAAAAAAAAAwkAAAAAAAACCQABkQAAAAIFAAAACWNoYWxsZW5nZQAAAAAAAAAAAAIAAAAIYXdhaXRpbmcJAARMAAAAAgkBAAAAC1N0cmluZ0VudHJ5AAAAAgkAASwAAAACAgAAAApjaGFsbGVuZ2UtBQAAAAxjaGFsbGVuZGdlaWQJAAS5AAAAAgkABEwAAAACAgAAAAV1bnNldAkABEwAAAACCQABkQAAAAIFAAAACWNoYWxsZW5nZQAAAAAAAAAAAQkABEwAAAACCQABkQAAAAIFAAAACWNoYWxsZW5nZQAAAAAAAAAAAgkABEwAAAACCQABkQAAAAIFAAAACWNoYWxsZW5nZQAAAAAAAAAAAwUAAAADbmlsBQAAAAVzZXBhcgUAAAADbmlsCQAAAgAAAAECAAAAFGNoYWxsZW5nZSBub3QgZXhpc3RzCQAAAgAAAAECAAAAFGNoYWxsZW5nZSBub3QgZXhpc3RzAAAAACDseAY=", "height": 1826307, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 4QxjvxHg76BRbog9kQer2hUfmQuaeF7hPWjy7ozWYGLA Next: HymfQyQYfauW4g7s6GCVPJpQRAFbXr2UeYmMEDHhDBby Diff:
OldNewDifferences
99
1010
1111 @Callable(b)
12-func moove (c,d,e) = {
12+func move (c,d,e) = {
1313 let f = split(getStringValue(("game-" + c)), a)
14- if ((f[0] == "ongoing"))
14+ if ((f == f))
1515 then {
1616 let g = toBase58String(b.caller.bytes)
17- if (if ((f[1] == g))
18- then true
19- else (f[2] == g))
17+ if ((g == g))
2018 then {
21- let h = if ((f[1] == g))
22- then "w"
23- else "b"
24- if ((f[5] == h))
19+ let h = if ((f[0] == "ongoing"))
20+ then true
21+ else throw("not ongoing game")
22+ if ((h == h))
2523 then {
26- let i = split(e, "")
27- let j = split(d, "")
28- let k = j[5]
29- let l = parseIntValue(j[0])
30- let m = parseIntValue(j[1])
31- let n = parseIntValue(i[0])
32- let o = parseIntValue(i[1])
33- let p = f[8]
34- let q = split(p, "||")
35- let r = [split(q[0], "|"), split(q[1], "|"), split(q[2], "|"), split(q[3], "|"), split(q[4], "|"), split(q[5], "|"), split(q[6], "|"), split(q[7], "|")]
36- if (if ((r[l][m] == d))
37- then (r[n][o] == e)
24+ let i = if (if (h)
25+ then if ((f[1] == g))
26+ then true
27+ else (f[2] == g)
3828 else false)
39- then if ((k == "p"))
40- then if ((h == "w"))
41- then if ((i[3] == "b"))
42- then if (if (((m - o) == 1))
43- then if (((l - n) == 1))
44- then true
45- else ((l - n) == 1)
46- else false)
47- then [StringEntry("-", "-")]
48- else throw("incorrect eating")
49- else {
50- let s = split(r[l][(m - 1)], "")
51- let t = if ((s[3] == "0"))
52- then true
53- else false
54- if (if ((l == n))
55- then if (((m - n) == 1))
29+ then if ((f[1] == g))
30+ then "w"
31+ else "b"
32+ else throw("not gamer")
33+ if ((i == i))
34+ then {
35+ let j = if ((i == f[5]))
36+ then true
37+ else throw("not your turn")
38+ if ((j == j))
39+ then {
40+ let k = split(f[8], "||")
41+ let l = [split(k[0], "|"), split(k[1], "|"), split(k[2], "|"), split(k[3], "|"), split(k[4], "|"), split(k[5], "|"), split(k[6], "|"), split(k[7], "|")]
42+ if ((l == l))
43+ then {
44+ let m = split(d, "")
45+ let n = split(e, "")
46+ let o = parseIntValue(m[0])
47+ let p = parseIntValue(m[1])
48+ let q = parseIntValue(n[0])
49+ let r = parseIntValue(n[1])
50+ let s = if (if ((take(l[o][p], 1) == i))
51+ then (take(l[q][r], 1) != i)
52+ else false)
5653 then true
57- else if (((l - n) == 2))
58- then t
59- else false
60- else false)
61- then [StringEntry("moved", ((("from-" + d) + " to-") + e))]
62- else throw("incorrect move")
63- }
64- else [StringEntry("-", "-")]
65- else [StringEntry("-", "-")]
66- else throw("not situation")
54+ else throw("wrong position")
55+ if ((s == s))
56+ then {
57+ let t = l[o][p]
58+ if (s)
59+ then [StringEntry("_", "figure")]
60+ else [StringEntry("_", "_")]
61+ }
62+ else throw("Strict value is not equal to itself.")
63+ }
64+ else throw("Strict value is not equal to itself.")
65+ }
66+ else throw("Strict value is not equal to itself.")
67+ }
68+ else throw("Strict value is not equal to itself.")
6769 }
68- else throw("not your turn")
70+ else throw("Strict value is not equal to itself.")
6971 }
70- else throw("not gamer")
72+ else throw("Strict value is not equal to itself.")
7173 }
72- else throw("not ongoing game")
74+ else throw("Strict value is not equal to itself.")
7375 }
7476
7577
9698 else g
9799 let c = toString((parseIntValue(getStringValue("lastgameid")) + 1))
98100 [StringEntry(("challenge-" + u), makeString([c, w[1], w[2], w[3], g], a)), {
99- let p = "00:w:l|10:w:h|20:w:e|30:w:f|40:w:q|50:w:e|60:w:h|70:w:l||01:w:p|11:w:p|21:w:p|31:w:p|41:w:p|51:w:p|61:w:p|71:w:p||02:0:0|12:0:0|22:0:0|32:0:0|42:0:0|52:0:0|62:0:0|72:0:0||03:0:0|13:0:0|23:0:0|33:0:0|43:0:0|53:0:0|63:0:0|73:0:0||04:0:0|14:0:0|24:0:0|34:0:0|44:0:0|54:0:0|64:0:0|74:0:0||05:0:0|15:0:0|25:0:0|35:0:0|45:0:0|55:0:0|65:0:0|75:0:0||06:b:p|16:w:p|26:w:p|36:w:p|46:w:p|56:w:p|66:w:p|76:w:p||07:b:l|17:b:h|27:b:e|37:b:f|47:b:q|57:b:e|67:b:h|77:b:l"
100- StringEntry(("game-" + c), makeString(["ongoing", y, x, w[3], "0", "w", "startblock", "laststepblock", p], a))
101+ let k = "wl|wh|we|wf|wq|we|wh|wl||wp|wp|wp|wp|wp|wp|wp|wp||00|00|00|00|00|00|00|00||00|00|00|00|00|00|00|00||00|00|00|00|00|00|00|00||00|00|00|00|00|00|00|00||bp|bp|bp|bp|bp|bp|bp|bp||bl|bh|be|bf|bq|be|bh|bl"
102+ StringEntry(("game-" + c), makeString(["ongoing", y, x, w[3], "0", "w", "startblock", "laststepblock", k], a))
101103 }, StringEntry("lastgameid", c), ScriptTransfer(b.caller, (v.amount - parseIntValue(w[3])), unit)]
102104 }
103105 else throw("no challenge awaiting")
109111
110112
111113 @Callable(b)
112-func setchallenge (h) = if (if ((h == "b"))
114+func setchallenge (i) = if (if ((i == "b"))
113115 then true
114- else (h == "w"))
116+ else (i == "w"))
115117 then {
116118 let v = if ((size(b.payments) == 1))
117119 then b.payments[0]
121123 else {
122124 let g = toBase58String(b.caller.bytes)
123125 let u = toString((parseIntValue(getStringValue("lastchallengeid")) + 1))
124-[StringEntry(("challenge-" + u), makeString(["awaiting", g, h, toString(v.amount)], a)), StringEntry("lastchallengeid", u)]
126+[StringEntry(("challenge-" + u), makeString(["awaiting", g, i, toString(v.amount)], a)), StringEntry("lastchallengeid", u)]
125127 }
126128 }
127129 else throw("invalid side")
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let a = "|"
55
66 @Callable(b)
77 func reset () = [StringEntry("lastgameid", "0"), StringEntry("lastchallengeid", "0")]
88
99
1010
1111 @Callable(b)
12-func moove (c,d,e) = {
12+func move (c,d,e) = {
1313 let f = split(getStringValue(("game-" + c)), a)
14- if ((f[0] == "ongoing"))
14+ if ((f == f))
1515 then {
1616 let g = toBase58String(b.caller.bytes)
17- if (if ((f[1] == g))
18- then true
19- else (f[2] == g))
17+ if ((g == g))
2018 then {
21- let h = if ((f[1] == g))
22- then "w"
23- else "b"
24- if ((f[5] == h))
19+ let h = if ((f[0] == "ongoing"))
20+ then true
21+ else throw("not ongoing game")
22+ if ((h == h))
2523 then {
26- let i = split(e, "")
27- let j = split(d, "")
28- let k = j[5]
29- let l = parseIntValue(j[0])
30- let m = parseIntValue(j[1])
31- let n = parseIntValue(i[0])
32- let o = parseIntValue(i[1])
33- let p = f[8]
34- let q = split(p, "||")
35- let r = [split(q[0], "|"), split(q[1], "|"), split(q[2], "|"), split(q[3], "|"), split(q[4], "|"), split(q[5], "|"), split(q[6], "|"), split(q[7], "|")]
36- if (if ((r[l][m] == d))
37- then (r[n][o] == e)
24+ let i = if (if (h)
25+ then if ((f[1] == g))
26+ then true
27+ else (f[2] == g)
3828 else false)
39- then if ((k == "p"))
40- then if ((h == "w"))
41- then if ((i[3] == "b"))
42- then if (if (((m - o) == 1))
43- then if (((l - n) == 1))
44- then true
45- else ((l - n) == 1)
46- else false)
47- then [StringEntry("-", "-")]
48- else throw("incorrect eating")
49- else {
50- let s = split(r[l][(m - 1)], "")
51- let t = if ((s[3] == "0"))
52- then true
53- else false
54- if (if ((l == n))
55- then if (((m - n) == 1))
29+ then if ((f[1] == g))
30+ then "w"
31+ else "b"
32+ else throw("not gamer")
33+ if ((i == i))
34+ then {
35+ let j = if ((i == f[5]))
36+ then true
37+ else throw("not your turn")
38+ if ((j == j))
39+ then {
40+ let k = split(f[8], "||")
41+ let l = [split(k[0], "|"), split(k[1], "|"), split(k[2], "|"), split(k[3], "|"), split(k[4], "|"), split(k[5], "|"), split(k[6], "|"), split(k[7], "|")]
42+ if ((l == l))
43+ then {
44+ let m = split(d, "")
45+ let n = split(e, "")
46+ let o = parseIntValue(m[0])
47+ let p = parseIntValue(m[1])
48+ let q = parseIntValue(n[0])
49+ let r = parseIntValue(n[1])
50+ let s = if (if ((take(l[o][p], 1) == i))
51+ then (take(l[q][r], 1) != i)
52+ else false)
5653 then true
57- else if (((l - n) == 2))
58- then t
59- else false
60- else false)
61- then [StringEntry("moved", ((("from-" + d) + " to-") + e))]
62- else throw("incorrect move")
63- }
64- else [StringEntry("-", "-")]
65- else [StringEntry("-", "-")]
66- else throw("not situation")
54+ else throw("wrong position")
55+ if ((s == s))
56+ then {
57+ let t = l[o][p]
58+ if (s)
59+ then [StringEntry("_", "figure")]
60+ else [StringEntry("_", "_")]
61+ }
62+ else throw("Strict value is not equal to itself.")
63+ }
64+ else throw("Strict value is not equal to itself.")
65+ }
66+ else throw("Strict value is not equal to itself.")
67+ }
68+ else throw("Strict value is not equal to itself.")
6769 }
68- else throw("not your turn")
70+ else throw("Strict value is not equal to itself.")
6971 }
70- else throw("not gamer")
72+ else throw("Strict value is not equal to itself.")
7173 }
72- else throw("not ongoing game")
74+ else throw("Strict value is not equal to itself.")
7375 }
7476
7577
7678
7779 @Callable(b)
7880 func startgame (u) = {
7981 let v = if ((size(b.payments) == 1))
8082 then b.payments[0]
8183 else throw("must stake some waves")
8284 if (isDefined(v.assetId))
8385 then throw("works with waves only")
8486 else {
8587 let g = toBase58String(b.caller.bytes)
8688 let w = split(getStringValue(("challenge-" + u)), a)
8789 if ((size(w) > 0))
8890 then if ((v.amount >= parseIntValue(w[3])))
8991 then if ((w[0] == "awaiting"))
9092 then {
9193 let x = if ((w[2] == "b"))
9294 then w[1]
9395 else g
9496 let y = if ((w[2] == "w"))
9597 then w[1]
9698 else g
9799 let c = toString((parseIntValue(getStringValue("lastgameid")) + 1))
98100 [StringEntry(("challenge-" + u), makeString([c, w[1], w[2], w[3], g], a)), {
99- let p = "00:w:l|10:w:h|20:w:e|30:w:f|40:w:q|50:w:e|60:w:h|70:w:l||01:w:p|11:w:p|21:w:p|31:w:p|41:w:p|51:w:p|61:w:p|71:w:p||02:0:0|12:0:0|22:0:0|32:0:0|42:0:0|52:0:0|62:0:0|72:0:0||03:0:0|13:0:0|23:0:0|33:0:0|43:0:0|53:0:0|63:0:0|73:0:0||04:0:0|14:0:0|24:0:0|34:0:0|44:0:0|54:0:0|64:0:0|74:0:0||05:0:0|15:0:0|25:0:0|35:0:0|45:0:0|55:0:0|65:0:0|75:0:0||06:b:p|16:w:p|26:w:p|36:w:p|46:w:p|56:w:p|66:w:p|76:w:p||07:b:l|17:b:h|27:b:e|37:b:f|47:b:q|57:b:e|67:b:h|77:b:l"
100- StringEntry(("game-" + c), makeString(["ongoing", y, x, w[3], "0", "w", "startblock", "laststepblock", p], a))
101+ let k = "wl|wh|we|wf|wq|we|wh|wl||wp|wp|wp|wp|wp|wp|wp|wp||00|00|00|00|00|00|00|00||00|00|00|00|00|00|00|00||00|00|00|00|00|00|00|00||00|00|00|00|00|00|00|00||bp|bp|bp|bp|bp|bp|bp|bp||bl|bh|be|bf|bq|be|bh|bl"
102+ StringEntry(("game-" + c), makeString(["ongoing", y, x, w[3], "0", "w", "startblock", "laststepblock", k], a))
101103 }, StringEntry("lastgameid", c), ScriptTransfer(b.caller, (v.amount - parseIntValue(w[3])), unit)]
102104 }
103105 else throw("no challenge awaiting")
104106 else throw("need more money")
105107 else throw("no challenge")
106108 }
107109 }
108110
109111
110112
111113 @Callable(b)
112-func setchallenge (h) = if (if ((h == "b"))
114+func setchallenge (i) = if (if ((i == "b"))
113115 then true
114- else (h == "w"))
116+ else (i == "w"))
115117 then {
116118 let v = if ((size(b.payments) == 1))
117119 then b.payments[0]
118120 else throw("must stake some waves")
119121 if (isDefined(v.assetId))
120122 then throw("works with waves only")
121123 else {
122124 let g = toBase58String(b.caller.bytes)
123125 let u = toString((parseIntValue(getStringValue("lastchallengeid")) + 1))
124-[StringEntry(("challenge-" + u), makeString(["awaiting", g, h, toString(v.amount)], a)), StringEntry("lastchallengeid", u)]
126+[StringEntry(("challenge-" + u), makeString(["awaiting", g, i, toString(v.amount)], a)), StringEntry("lastchallengeid", u)]
125127 }
126128 }
127129 else throw("invalid side")
128130
129131
130132
131133 @Callable(b)
132134 func unsetchallenge (z) = {
133135 let g = toBase58String(b.caller.bytes)
134136 func A (z) = {
135137 let B = getString(("challenge-" + z))
136138 if ($isInstanceOf(B, "String"))
137139 then {
138140 let C = B
139141 getStringValue(("challenge-" + z))
140142 }
141143 else ""
142144 }
143145
144146 let D = split(A(z), a)
145147 if ((size(D) > 0))
146148 then if ((D[0] == "awaiting"))
147149 then [StringEntry(("challenge-" + z), makeString(["unset", D[1], D[2], D[3]], a))]
148150 else throw("challenge not exists")
149151 else throw("challenge not exists")
150152 }
151153
152154

github/deemru/w8io/169f3d6 
91.82 ms