tx · GZMrG7JyroYqqGmd9FjGxe9S8JVQQzSqJHRAXCeKw5Us

3N7Gg64FJ3ESaqn41qu1ete7zmzbmoP1AAV:  -0.01000000 Waves

2021.12.09 11:33 [1826467] smart account 3N7Gg64FJ3ESaqn41qu1ete7zmzbmoP1AAV > SELF 0.00000000 Waves

{ "type": 13, "id": "GZMrG7JyroYqqGmd9FjGxe9S8JVQQzSqJHRAXCeKw5Us", "fee": 1000000, "feeAssetId": null, "timestamp": 1639038831325, "version": 2, "chainId": 84, "sender": "3N7Gg64FJ3ESaqn41qu1ete7zmzbmoP1AAV", "senderPublicKey": "5amLtMwixiEesBDKPy9dkFWntG2fNxhTs5n69JbQE9F7", "proofs": [ "2we1U2n7nDudkMeHvcaoyPNMdesvAwWuxb1m6JuL86YirxQEhs2HCWRqk63q9N1mRKSLAakhY1zDQPuguwoLCLHT" ], "script": "base64:AAIFAAAAAAAAAB4IAhIAEgASBwoFCAEBAQESAwoBCBIDCgEIEgMKAQgAAAABAAAAAAVzZXBhcgIAAAABfAAAAAYAAAABaQEAAAAFcmVzZXQAAAAACQAETAAAAAIJAQAAAAtTdHJpbmdFbnRyeQAAAAICAAAACmxhc3RnYW1laWQCAAAAATAJAARMAAAAAgkBAAAAC1N0cmluZ0VudHJ5AAAAAgIAAAAPbGFzdGNoYWxsZW5nZWlkAgAAAAEwBQAAAANuaWwAAAABaQEAAAAIc2V0cnVsZXMAAAAACQAETAAAAAIJAQAAAAtTdHJpbmdFbnRyeQAAAAICAAAABG1iZisCAAAACi0xLC0xfDEsLTEJAARMAAAAAgkBAAAAC1N0cmluZ0VudHJ5AAAAAgIAAAAEbWJmLQIAAAAACQAETAAAAAIJAQAAAAtTdHJpbmdFbnRyeQAAAAICAAAABG13ZisCAAAACC0xLDF8MSwxCQAETAAAAAIJAQAAAAtTdHJpbmdFbnRyeQAAAAICAAAABG13Zi0CAAAAAAUAAAADbmlsAAAAAWkBAAAABG1vdmUAAAAFAAAABmdhbWVpZAAAAAVmcm9te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AAADbmlsCQAAAgAAAAECAAAAFGNoYWxsZW5nZSBub3QgZXhpc3RzCQAAAgAAAAECAAAAFGNoYWxsZW5nZSBub3QgZXhpc3RzAAAAALAUqvA=", "height": 1826467, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 25WvUy1u3nNvmdtSEsLmqGQbgeBMi14Lc6PKtwihd7ra Next: CX9YSC8TWoA2Mk2nXvFEjDzpaJQ8hVwww45gWQCpKi8r Diff:
OldNewDifferences
1414
1515
1616 @Callable(b)
17-func move (c,d,e) = {
18- let f = split(getStringValue(("game-" + c)), a)
19- if ((f == f))
17+func move (c,d,e,f,g) = {
18+ let h = split(getStringValue(("game-" + c)), a)
19+ if ((h == h))
2020 then {
21- let g = toBase58String(b.caller.bytes)
22- if ((g == g))
21+ let i = toBase58String(b.caller.bytes)
22+ if ((i == i))
2323 then {
24- let h = if ((f[0] == "ongoing"))
24+ let j = if ((h[0] == "ongoing"))
2525 then true
2626 else throw("not ongoing game")
27- if ((h == h))
27+ if ((j == j))
2828 then {
29- let i = if (if (h)
30- then if ((f[1] == g))
29+ let k = if (if (j)
30+ then if ((h[1] == i))
3131 then true
32- else (f[2] == g)
32+ else (h[2] == i)
3333 else false)
34- then if ((f[1] == g))
34+ then if ((h[1] == i))
3535 then "w"
3636 else "b"
3737 else throw("not gamer")
38- if ((i == i))
38+ if ((k == k))
3939 then {
40- let j = if ((i == "w"))
40+ let l = if ((k == "w"))
4141 then "b"
4242 else "w"
43- let k = if ((i == f[5]))
43+ let m = if ((k == h[5]))
4444 then true
4545 else throw("not your turn")
46- if ((k == k))
46+ if ((m == m))
4747 then {
48- let l = split(f[8], "!")
49- let m = [split(l[0], "-"), split(l[1], "|"), split(l[2], "|"), split(l[3], "|"), split(l[4], "|"), split(l[5], "|"), split(l[6], "|"), split(l[7], "|")]
50- if ((m == m))
48+ let n = split(h[8], "!")
49+ let o = [split(n[0], "-"), split(n[1], "|"), split(n[2], "|"), split(n[3], "|"), split(n[4], "|"), split(n[5], "|"), split(n[6], "|"), split(n[7], "|")]
50+ if ((o == o))
5151 then {
52- let n = parseIntValue(take(d, 1))
53- let o = parseIntValue(takeRight(d, 1))
54- let p = parseIntValue(take(e, 1))
55- let q = parseIntValue(takeRight(e, 1))
56- let r = takeRight(m[n][o], 1)
57- let s = if ((take(m[p][q], 1) == "0"))
52+ let p = takeRight(o[d][e], 1)
53+ let q = if ((take(o[f][g], 1) == "0"))
5854 then "m"
59- else if ((take(m[p][q], 1) == j))
55+ else if ((take(o[f][g], 1) == l))
6056 then "e"
6157 else throw("can not eat himself")
62- let t = ((toString((n - p)) + ",") + toString((o - q)))
63- let u = split(getStringValue(((s + i) + r)), "|")
64- let v = if (containsElement(u, t))
58+ let r = ((toString((d - f)) + ",") + toString((e - g)))
59+ let s = split(getStringValue(((q + k) + p)), "|")
60+ let t = if (containsElement(s, r))
6561 then true
6662 else throw("incorrect movement")
67- if (v)
63+ if (t)
6864 then [StringEntry("_", "possible")]
69- else [StringEntry("_", "_")]
65+ else throw("impossible movement")
7066 }
7167 else throw("Strict value is not equal to itself.")
7268 }
8480
8581
8682 @Callable(b)
87-func startgame (w) = {
88- let x = if ((size(b.payments) == 1))
83+func startgame (u) = {
84+ let v = if ((size(b.payments) == 1))
8985 then b.payments[0]
9086 else throw("must stake some waves")
91- if (isDefined(x.assetId))
87+ if (isDefined(v.assetId))
9288 then throw("works with waves only")
9389 else {
94- let g = toBase58String(b.caller.bytes)
95- let y = split(getStringValue(("challenge-" + w)), a)
96- if ((size(y) > 0))
97- then if ((x.amount >= parseIntValue(y[3])))
98- then if ((y[0] == "awaiting"))
90+ let i = toBase58String(b.caller.bytes)
91+ let w = split(getStringValue(("challenge-" + u)), a)
92+ if ((size(w) > 0))
93+ then if ((v.amount >= parseIntValue(w[3])))
94+ then if ((w[0] == "awaiting"))
9995 then {
100- let z = if ((y[2] == "b"))
101- then y[1]
102- else g
103- let A = if ((y[2] == "w"))
104- then y[1]
105- else g
96+ let x = if ((w[2] == "b"))
97+ then w[1]
98+ else i
99+ let y = if ((w[2] == "w"))
100+ then w[1]
101+ else i
106102 let c = toString((parseIntValue(getStringValue("lastgameid")) + 1))
107-[StringEntry(("challenge-" + w), makeString([c, y[1], y[2], y[3], g], a)), {
108- let l = "wf-00-wf-00-wf-00-wf-00!00-wf-00-wf-00-wf-00-wf!wf-00-wf-00-wf-00-wf-00!00-00-00-00-00-00-00-00!00-00-00-00-00-00-00-00!00-bf-00-bf-00-bf-00-bf!bf-00-bf-00-bf-00-bf-00!00-bf-00-bf-00-bf-00-bf"
109- StringEntry(("game-" + c), makeString(["ongoing", A, z, y[3], "0", "w", "startblock", "laststepblock", l], a))
110- }, StringEntry("lastgameid", c), ScriptTransfer(b.caller, (x.amount - parseIntValue(y[3])), unit)]
103+[StringEntry(("challenge-" + u), makeString([c, w[1], w[2], w[3], i], a)), {
104+ let n = "wf-00-wf-00-wf-00-wf-00!00-wf-00-wf-00-wf-00-wf!wf-00-wf-00-wf-00-wf-00!00-00-00-00-00-00-00-00!00-00-00-00-00-00-00-00!00-bf-00-bf-00-bf-00-bf!bf-00-bf-00-bf-00-bf-00!00-bf-00-bf-00-bf-00-bf"
105+ StringEntry(("game-" + c), makeString(["ongoing", y, x, w[3], "0", "w", "startblock", "laststepblock", n], a))
106+ }, StringEntry("lastgameid", c), ScriptTransfer(b.caller, (v.amount - parseIntValue(w[3])), unit)]
111107 }
112108 else throw("no challenge awaiting")
113109 else throw("need more money")
118114
119115
120116 @Callable(b)
121-func setchallenge (i) = if (if ((i == "b"))
117+func setchallenge (k) = if (if ((k == "b"))
122118 then true
123- else (i == "w"))
119+ else (k == "w"))
124120 then {
125- let x = if ((size(b.payments) == 1))
121+ let v = if ((size(b.payments) == 1))
126122 then b.payments[0]
127123 else throw("must stake some waves")
128- if (isDefined(x.assetId))
124+ if (isDefined(v.assetId))
129125 then throw("works with waves only")
130126 else {
131- let g = toBase58String(b.caller.bytes)
132- let w = toString((parseIntValue(getStringValue("lastchallengeid")) + 1))
133-[StringEntry(("challenge-" + w), makeString(["awaiting", g, i, toString(x.amount)], a)), StringEntry("lastchallengeid", w)]
127+ let i = toBase58String(b.caller.bytes)
128+ let u = toString((parseIntValue(getStringValue("lastchallengeid")) + 1))
129+[StringEntry(("challenge-" + u), makeString(["awaiting", i, k, toString(v.amount)], a)), StringEntry("lastchallengeid", u)]
134130 }
135131 }
136132 else throw("invalid side")
138134
139135
140136 @Callable(b)
141-func unsetchallenge (B) = {
142- let g = toBase58String(b.caller.bytes)
143- func C (B) = {
144- let D = getString(("challenge-" + B))
145- if ($isInstanceOf(D, "String"))
137+func unsetchallenge (z) = {
138+ let i = toBase58String(b.caller.bytes)
139+ func A (z) = {
140+ let B = getString(("challenge-" + z))
141+ if ($isInstanceOf(B, "String"))
146142 then {
147- let E = D
148- getStringValue(("challenge-" + B))
143+ let C = B
144+ getStringValue(("challenge-" + z))
149145 }
150146 else ""
151147 }
152148
153- let F = split(C(B), a)
154- if ((size(F) > 0))
155- then if ((F[0] == "awaiting"))
156- then [StringEntry(("challenge-" + B), makeString(["unset", F[1], F[2], F[3]], a))]
149+ let D = split(A(z), a)
150+ if ((size(D) > 0))
151+ then if ((D[0] == "awaiting"))
152+ then [StringEntry(("challenge-" + z), makeString(["unset", D[1], D[2], D[3]], a))]
157153 else throw("challenge not exists")
158154 else throw("challenge not exists")
159155 }
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)
1212 func setrules () = [StringEntry("mbf+", "-1,-1|1,-1"), StringEntry("mbf-", ""), StringEntry("mwf+", "-1,1|1,1"), StringEntry("mwf-", "")]
1313
1414
1515
1616 @Callable(b)
17-func move (c,d,e) = {
18- let f = split(getStringValue(("game-" + c)), a)
19- if ((f == f))
17+func move (c,d,e,f,g) = {
18+ let h = split(getStringValue(("game-" + c)), a)
19+ if ((h == h))
2020 then {
21- let g = toBase58String(b.caller.bytes)
22- if ((g == g))
21+ let i = toBase58String(b.caller.bytes)
22+ if ((i == i))
2323 then {
24- let h = if ((f[0] == "ongoing"))
24+ let j = if ((h[0] == "ongoing"))
2525 then true
2626 else throw("not ongoing game")
27- if ((h == h))
27+ if ((j == j))
2828 then {
29- let i = if (if (h)
30- then if ((f[1] == g))
29+ let k = if (if (j)
30+ then if ((h[1] == i))
3131 then true
32- else (f[2] == g)
32+ else (h[2] == i)
3333 else false)
34- then if ((f[1] == g))
34+ then if ((h[1] == i))
3535 then "w"
3636 else "b"
3737 else throw("not gamer")
38- if ((i == i))
38+ if ((k == k))
3939 then {
40- let j = if ((i == "w"))
40+ let l = if ((k == "w"))
4141 then "b"
4242 else "w"
43- let k = if ((i == f[5]))
43+ let m = if ((k == h[5]))
4444 then true
4545 else throw("not your turn")
46- if ((k == k))
46+ if ((m == m))
4747 then {
48- let l = split(f[8], "!")
49- let m = [split(l[0], "-"), split(l[1], "|"), split(l[2], "|"), split(l[3], "|"), split(l[4], "|"), split(l[5], "|"), split(l[6], "|"), split(l[7], "|")]
50- if ((m == m))
48+ let n = split(h[8], "!")
49+ let o = [split(n[0], "-"), split(n[1], "|"), split(n[2], "|"), split(n[3], "|"), split(n[4], "|"), split(n[5], "|"), split(n[6], "|"), split(n[7], "|")]
50+ if ((o == o))
5151 then {
52- let n = parseIntValue(take(d, 1))
53- let o = parseIntValue(takeRight(d, 1))
54- let p = parseIntValue(take(e, 1))
55- let q = parseIntValue(takeRight(e, 1))
56- let r = takeRight(m[n][o], 1)
57- let s = if ((take(m[p][q], 1) == "0"))
52+ let p = takeRight(o[d][e], 1)
53+ let q = if ((take(o[f][g], 1) == "0"))
5854 then "m"
59- else if ((take(m[p][q], 1) == j))
55+ else if ((take(o[f][g], 1) == l))
6056 then "e"
6157 else throw("can not eat himself")
62- let t = ((toString((n - p)) + ",") + toString((o - q)))
63- let u = split(getStringValue(((s + i) + r)), "|")
64- let v = if (containsElement(u, t))
58+ let r = ((toString((d - f)) + ",") + toString((e - g)))
59+ let s = split(getStringValue(((q + k) + p)), "|")
60+ let t = if (containsElement(s, r))
6561 then true
6662 else throw("incorrect movement")
67- if (v)
63+ if (t)
6864 then [StringEntry("_", "possible")]
69- else [StringEntry("_", "_")]
65+ else throw("impossible movement")
7066 }
7167 else throw("Strict value is not equal to itself.")
7268 }
7369 else throw("Strict value is not equal to itself.")
7470 }
7571 else throw("Strict value is not equal to itself.")
7672 }
7773 else throw("Strict value is not equal to itself.")
7874 }
7975 else throw("Strict value is not equal to itself.")
8076 }
8177 else throw("Strict value is not equal to itself.")
8278 }
8379
8480
8581
8682 @Callable(b)
87-func startgame (w) = {
88- let x = if ((size(b.payments) == 1))
83+func startgame (u) = {
84+ let v = if ((size(b.payments) == 1))
8985 then b.payments[0]
9086 else throw("must stake some waves")
91- if (isDefined(x.assetId))
87+ if (isDefined(v.assetId))
9288 then throw("works with waves only")
9389 else {
94- let g = toBase58String(b.caller.bytes)
95- let y = split(getStringValue(("challenge-" + w)), a)
96- if ((size(y) > 0))
97- then if ((x.amount >= parseIntValue(y[3])))
98- then if ((y[0] == "awaiting"))
90+ let i = toBase58String(b.caller.bytes)
91+ let w = split(getStringValue(("challenge-" + u)), a)
92+ if ((size(w) > 0))
93+ then if ((v.amount >= parseIntValue(w[3])))
94+ then if ((w[0] == "awaiting"))
9995 then {
100- let z = if ((y[2] == "b"))
101- then y[1]
102- else g
103- let A = if ((y[2] == "w"))
104- then y[1]
105- else g
96+ let x = if ((w[2] == "b"))
97+ then w[1]
98+ else i
99+ let y = if ((w[2] == "w"))
100+ then w[1]
101+ else i
106102 let c = toString((parseIntValue(getStringValue("lastgameid")) + 1))
107-[StringEntry(("challenge-" + w), makeString([c, y[1], y[2], y[3], g], a)), {
108- let l = "wf-00-wf-00-wf-00-wf-00!00-wf-00-wf-00-wf-00-wf!wf-00-wf-00-wf-00-wf-00!00-00-00-00-00-00-00-00!00-00-00-00-00-00-00-00!00-bf-00-bf-00-bf-00-bf!bf-00-bf-00-bf-00-bf-00!00-bf-00-bf-00-bf-00-bf"
109- StringEntry(("game-" + c), makeString(["ongoing", A, z, y[3], "0", "w", "startblock", "laststepblock", l], a))
110- }, StringEntry("lastgameid", c), ScriptTransfer(b.caller, (x.amount - parseIntValue(y[3])), unit)]
103+[StringEntry(("challenge-" + u), makeString([c, w[1], w[2], w[3], i], a)), {
104+ let n = "wf-00-wf-00-wf-00-wf-00!00-wf-00-wf-00-wf-00-wf!wf-00-wf-00-wf-00-wf-00!00-00-00-00-00-00-00-00!00-00-00-00-00-00-00-00!00-bf-00-bf-00-bf-00-bf!bf-00-bf-00-bf-00-bf-00!00-bf-00-bf-00-bf-00-bf"
105+ StringEntry(("game-" + c), makeString(["ongoing", y, x, w[3], "0", "w", "startblock", "laststepblock", n], a))
106+ }, StringEntry("lastgameid", c), ScriptTransfer(b.caller, (v.amount - parseIntValue(w[3])), unit)]
111107 }
112108 else throw("no challenge awaiting")
113109 else throw("need more money")
114110 else throw("no challenge")
115111 }
116112 }
117113
118114
119115
120116 @Callable(b)
121-func setchallenge (i) = if (if ((i == "b"))
117+func setchallenge (k) = if (if ((k == "b"))
122118 then true
123- else (i == "w"))
119+ else (k == "w"))
124120 then {
125- let x = if ((size(b.payments) == 1))
121+ let v = if ((size(b.payments) == 1))
126122 then b.payments[0]
127123 else throw("must stake some waves")
128- if (isDefined(x.assetId))
124+ if (isDefined(v.assetId))
129125 then throw("works with waves only")
130126 else {
131- let g = toBase58String(b.caller.bytes)
132- let w = toString((parseIntValue(getStringValue("lastchallengeid")) + 1))
133-[StringEntry(("challenge-" + w), makeString(["awaiting", g, i, toString(x.amount)], a)), StringEntry("lastchallengeid", w)]
127+ let i = toBase58String(b.caller.bytes)
128+ let u = toString((parseIntValue(getStringValue("lastchallengeid")) + 1))
129+[StringEntry(("challenge-" + u), makeString(["awaiting", i, k, toString(v.amount)], a)), StringEntry("lastchallengeid", u)]
134130 }
135131 }
136132 else throw("invalid side")
137133
138134
139135
140136 @Callable(b)
141-func unsetchallenge (B) = {
142- let g = toBase58String(b.caller.bytes)
143- func C (B) = {
144- let D = getString(("challenge-" + B))
145- if ($isInstanceOf(D, "String"))
137+func unsetchallenge (z) = {
138+ let i = toBase58String(b.caller.bytes)
139+ func A (z) = {
140+ let B = getString(("challenge-" + z))
141+ if ($isInstanceOf(B, "String"))
146142 then {
147- let E = D
148- getStringValue(("challenge-" + B))
143+ let C = B
144+ getStringValue(("challenge-" + z))
149145 }
150146 else ""
151147 }
152148
153- let F = split(C(B), a)
154- if ((size(F) > 0))
155- then if ((F[0] == "awaiting"))
156- then [StringEntry(("challenge-" + B), makeString(["unset", F[1], F[2], F[3]], a))]
149+ let D = split(A(z), a)
150+ if ((size(D) > 0))
151+ then if ((D[0] == "awaiting"))
152+ then [StringEntry(("challenge-" + z), makeString(["unset", D[1], D[2], D[3]], a))]
157153 else throw("challenge not exists")
158154 else throw("challenge not exists")
159155 }
160156
161157

github/deemru/w8io/026f985 
66.75 ms