tx · B1Z39kB2bum2xZJ4eYEu7ptrhNLBovzm38Ls8v44aPLm 3N7Gg64FJ3ESaqn41qu1ete7zmzbmoP1AAV: -0.01000000 Waves 2021.12.10 09:46 [1827793] smart account 3N7Gg64FJ3ESaqn41qu1ete7zmzbmoP1AAV > SELF 0.00000000 Waves
{ "type": 13, "id": "B1Z39kB2bum2xZJ4eYEu7ptrhNLBovzm38Ls8v44aPLm", "fee": 1000000, "feeAssetId": null, "timestamp": 1639118824741, "version": 2, "chainId": 84, "sender": "3N7Gg64FJ3ESaqn41qu1ete7zmzbmoP1AAV", "senderPublicKey": "5amLtMwixiEesBDKPy9dkFWntG2fNxhTs5n69JbQE9F7", "proofs": [ "bcGALz14SCLGZQkifh2gEk61Hc8NWMGFyMoFVRcmhR4mXVrHtG7j5JSupfTseYAyqfy1R3iMEJNzQ8H1ttv8vqh" ], "script": "base64:AAIFAAAAAAAAAB4IAhIAEgASBwoFCAEBAQESAwoBCBIDCgEIEgMKAQgAAAABAAAAAAVzZXBhcgIAAAABfAAAAAYAAAABaQEAAAAFcmVzZXQAAAAACQAETAAAAAIJAQAAAAtTdHJpbmdFbnRyeQAAAAICAAAACmxhc3RnYW1laWQCAAAAATAJAARMAAAAAgkBAAAAC1N0cmluZ0VudHJ5AAAAAgIAAAAPbGFzdGNoYWxsZW5nZWlkAgAAAAEwBQAAAANuaWwAAAABaQEAAAAIc2V0cnVsZXMAAAAACQAETAAAAAIJAQAAAAtTdHJpbmdFbnRyeQAAAAICAAAABG1iZisCAAAACC0xLDF8MSwxCQAETAAAAAIJAQAAAAtTdHJpbmdFbnRyeQAAAAICAAAABG1iZi0CAAAAAAkABEwAAAACCQEAAAALU3RyaW5nRW50cnkAAAACAgAAAARtd2YrAgAAAAotMSwtMXwxLC0xCQAETAAAAAIJAQAAAAtTdHJpbmdFbnRyeQAAAAICAAAABG13Zi0CAAAAAAkABEwAAAACCQEAAAALU3RyaW5nRW50cnkAAAACAgAAAARld2YrAgAAAAotMiwtMnwy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AljaGFsbGVuZ2UJAAS1AAAAAgkBAAAADGdldGNoYWxsZW5nZQAAAAEFAAAADGNoYWxsZW5kZ2VpZAUAAAAFc2VwYXIDCQAAZgAAAAIJAAGQAAAAAQUAAAAJY2hhbGxlbmdlAAAAAAAAAAAAAwkAAAAAAAACCQABkQAAAAIFAAAACWNoYWxsZW5nZQAAAAAAAAAAAAIAAAAIYXdhaXRpbmcJAARMAAAAAgkBAAAAC1N0cmluZ0VudHJ5AAAAAgkAASwAAAACAgAAAApjaGFsbGVuZ2UtBQAAAAxjaGFsbGVuZGdlaWQJAAS5AAAAAgkABEwAAAACAgAAAAV1bnNldAkABEwAAAACCQABkQAAAAIFAAAACWNoYWxsZW5nZQAAAAAAAAAAAQkABEwAAAACCQABkQAAAAIFAAAACWNoYWxsZW5nZQAAAAAAAAAAAgkABEwAAAACCQABkQAAAAIFAAAACWNoYWxsZW5nZQAAAAAAAAAAAwUAAAADbmlsBQAAAAVzZXBhcgUAAAADbmlsCQAAAgAAAAECAAAAFGNoYWxsZW5nZSBub3QgZXhpc3RzCQAAAgAAAAECAAAAFGNoYWxsZW5nZSBub3QgZXhpc3RzAAAAALra+R8=", "height": 1827793, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: BcFUd1DTjTuieRMEXndmxq9GEeNjJ98pfK4L8gJkC6rQ Next: 8Po4rDdVunXM2U9LgEephc4QP6CyoZ3ze5AQXyypHMs8 Diff:
Old | New | Differences | |
---|---|---|---|
9 | 9 | ||
10 | 10 | ||
11 | 11 | @Callable(b) | |
12 | - | func setrules () = [StringEntry("mbf+", "-1,1|1,1"), StringEntry("mbf-", ""), StringEntry("mwf+", "-1,-1|1,-1"), StringEntry("mwf-", "")] | |
12 | + | func setrules () = [StringEntry("mbf+", "-1,1|1,1"), StringEntry("mbf-", ""), StringEntry("mwf+", "-1,-1|1,-1"), StringEntry("mwf-", ""), StringEntry("ewf+", "-2,-2|2,-2"), StringEntry("ewf-", "")] | |
13 | 13 | ||
14 | 14 | ||
15 | 15 | ||
71 | 71 | let s = if ((takeRight(r[e][d], 1) == "0")) | |
72 | 72 | then throw("empty cell") | |
73 | 73 | else takeRight(r[e][d], 1) | |
74 | - | let t = if ((take(r[g][f], 1) == "0")) | |
75 | - | then "m" | |
76 | - | else if ((take(r[g][f], 1) == o)) | |
77 | - | then "e" | |
78 | - | else throw("can not eat himself") | |
79 | - | let u = ((toString((d - f)) + ",") + toString((e - g))) | |
80 | - | let v = { | |
81 | - | let i = getString((((t + n) + s) + "+")) | |
82 | - | if ($isInstanceOf(i, "String")) | |
83 | - | then { | |
84 | - | let j = i | |
85 | - | split(getStringValue((((t + n) + s) + "+")), "|") | |
74 | + | let t = if ((r[g][f] == "00")) | |
75 | + | then true | |
76 | + | else throw("cell not free") | |
77 | + | if ((t == t)) | |
78 | + | then { | |
79 | + | let u = if (if ((((g - e) * (g - e)) == 1)) | |
80 | + | then (s == "f") | |
81 | + | else false) | |
82 | + | then "m" | |
83 | + | else if ((take(r[g][f], 1) == o)) | |
84 | + | then "e" | |
85 | + | else throw("can not eat himself") | |
86 | + | let v = ((toString((d - f)) + ",") + toString((e - g))) | |
87 | + | let w = { | |
88 | + | let i = getString((((u + n) + s) + "+")) | |
89 | + | if ($isInstanceOf(i, "String")) | |
90 | + | then { | |
91 | + | let j = i | |
92 | + | split(getStringValue((((u + n) + s) + "+")), "|") | |
93 | + | } | |
94 | + | else throw((((("no rules for " + u) + n) + s) + "+")) | |
86 | 95 | } | |
87 | - | | |
88 | - | | |
89 | - | | |
90 | - | | |
91 | - | | |
92 | - | | |
93 | - | | |
94 | - | | |
96 | + | let x = { | |
97 | + | let i = getString((((u + n) + s) + "-")) | |
98 | + | if ($isInstanceOf(i, "String")) | |
99 | + | then { | |
100 | + | let j = i | |
101 | + | split(getStringValue((((u + n) + s) + "-")), "|") | |
102 | + | } | |
103 | + | else throw((((("no rules for " + u) + n) + s) + "-")) | |
95 | 104 | } | |
96 | - | | |
97 | - | | |
98 | - | | |
99 | - | | |
100 | - | | |
101 | - | | |
102 | - | | |
103 | - | | |
104 | - | | |
105 | - | | |
106 | - | let | |
107 | - | | |
108 | - | | |
109 | - | | |
105 | + | let y = if (containsElement(w, v)) | |
106 | + | then true | |
107 | + | else throw(((((("incorrect movement+: fig=" + s) + " side=") + n) + " mtype=") + u)) | |
108 | + | let z = if (containsElement(x, v)) | |
109 | + | then throw(((((((("incorrect (" + v) + ")movement-: fig=") + s) + " side=") + n) + " mtype=") + u)) | |
110 | + | else true | |
111 | + | if (z) | |
112 | + | then { | |
113 | + | let A = h[8] | |
114 | + | let B = ((take(A, ((d * 3) + ((e * 8) * 3))) + "00") + takeRight(A, ((191 - ((d * 3) + ((e * 8) * 3))) - 2))) | |
115 | + | let C = (((take(B, ((f * 3) + ((g * 8) * 3))) + n) + s) + takeRight(B, ((191 - ((f * 3) + ((g * 8) * 3))) - 2))) | |
116 | + | $Tuple2([StringEntry(("game-" + c), makeString([h[0], h[1], h[2], h[3], toString((parseIntValue(h[4]) + 1)), o, h[6], h[7], C], a))], [StringEntry("_", "possible")]) | |
117 | + | } | |
118 | + | else throw(((((("impossible movement: fig=" + s) + " side=") + n) + " mtype=") + u)) | |
110 | 119 | } | |
111 | - | else throw( | |
120 | + | else throw("Strict value is not equal to itself.") | |
112 | 121 | } | |
113 | 122 | else throw("Strict value is not equal to itself.") | |
114 | 123 | } | |
128 | 137 | ||
129 | 138 | ||
130 | 139 | @Callable(b) | |
131 | - | func startgame ( | |
132 | - | let | |
140 | + | func startgame (D) = { | |
141 | + | let E = if ((size(b.payments) == 1)) | |
133 | 142 | then b.payments[0] | |
134 | 143 | else throw("must stake some waves") | |
135 | - | if (isDefined( | |
144 | + | if (isDefined(E.assetId)) | |
136 | 145 | then throw("works with waves only") | |
137 | 146 | else { | |
138 | 147 | let l = toBase58String(b.caller.bytes) | |
139 | - | let | |
140 | - | if ((size( | |
141 | - | then if (( | |
142 | - | then if (( | |
148 | + | let F = split(getStringValue(("challenge-" + D)), a) | |
149 | + | if ((size(F) > 0)) | |
150 | + | then if ((E.amount >= parseIntValue(F[3]))) | |
151 | + | then if ((F[0] == "awaiting")) | |
143 | 152 | then { | |
144 | - | let | |
145 | - | then | |
153 | + | let G = if ((F[2] == "b")) | |
154 | + | then F[1] | |
146 | 155 | else l | |
147 | - | let | |
148 | - | then | |
156 | + | let H = if ((F[2] == "w")) | |
157 | + | then F[1] | |
149 | 158 | else l | |
150 | 159 | let c = toString((parseIntValue(getStringValue("lastgameid")) + 1)) | |
151 | - | [StringEntry(("challenge-" + | |
160 | + | [StringEntry(("challenge-" + D), makeString([c, F[1], F[2], F[3], l], a)), { | |
152 | 161 | let q = "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" | |
153 | - | StringEntry(("game-" + c), makeString(["ongoing", G, F | |
154 | - | }, StringEntry("lastgameid", c), ScriptTransfer(b.caller, ( | |
162 | + | StringEntry(("game-" + c), makeString(["ongoing", H, G, F[3], "0", "w", "startblock", "laststepblock", q], a)) | |
163 | + | }, StringEntry("lastgameid", c), ScriptTransfer(b.caller, (E.amount - parseIntValue(F[3])), unit)] | |
155 | 164 | } | |
156 | 165 | else throw("no challenge awaiting") | |
157 | 166 | else throw("need more money") | |
166 | 175 | then true | |
167 | 176 | else (n == "w")) | |
168 | 177 | then { | |
169 | - | let | |
178 | + | let E = if ((size(b.payments) == 1)) | |
170 | 179 | then b.payments[0] | |
171 | 180 | else throw("must stake some waves") | |
172 | - | if (isDefined( | |
181 | + | if (isDefined(E.assetId)) | |
173 | 182 | then throw("works with waves only") | |
174 | 183 | else { | |
175 | 184 | let l = toBase58String(b.caller.bytes) | |
176 | - | let | |
177 | - | [StringEntry(("challenge-" + | |
185 | + | let D = toString((parseIntValue(getStringValue("lastchallengeid")) + 1)) | |
186 | + | [StringEntry(("challenge-" + D), makeString(["awaiting", l, n, toString(E.amount)], a)), StringEntry("lastchallengeid", D)] | |
178 | 187 | } | |
179 | 188 | } | |
180 | 189 | else throw("invalid side") | |
182 | 191 | ||
183 | 192 | ||
184 | 193 | @Callable(b) | |
185 | - | func unsetchallenge ( | |
194 | + | func unsetchallenge (I) = { | |
186 | 195 | let l = toBase58String(b.caller.bytes) | |
187 | - | func | |
188 | - | let i = getString(("challenge-" + | |
196 | + | func J (I) = { | |
197 | + | let i = getString(("challenge-" + I)) | |
189 | 198 | if ($isInstanceOf(i, "String")) | |
190 | 199 | then { | |
191 | 200 | let j = i | |
192 | - | getStringValue(("challenge-" + | |
201 | + | getStringValue(("challenge-" + I)) | |
193 | 202 | } | |
194 | 203 | else "" | |
195 | 204 | } | |
196 | 205 | ||
197 | - | let | |
198 | - | if ((size( | |
199 | - | then if (( | |
200 | - | then [StringEntry(("challenge-" + | |
206 | + | let K = split(J(I), a) | |
207 | + | if ((size(K) > 0)) | |
208 | + | then if ((K[0] == "awaiting")) | |
209 | + | then [StringEntry(("challenge-" + I), makeString(["unset", K[1], K[2], K[3]], a))] | |
201 | 210 | else throw("challenge not exists") | |
202 | 211 | else throw("challenge not exists") | |
203 | 212 | } |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let a = "|" | |
5 | 5 | ||
6 | 6 | @Callable(b) | |
7 | 7 | func reset () = [StringEntry("lastgameid", "0"), StringEntry("lastchallengeid", "0")] | |
8 | 8 | ||
9 | 9 | ||
10 | 10 | ||
11 | 11 | @Callable(b) | |
12 | - | func setrules () = [StringEntry("mbf+", "-1,1|1,1"), StringEntry("mbf-", ""), StringEntry("mwf+", "-1,-1|1,-1"), StringEntry("mwf-", "")] | |
12 | + | func setrules () = [StringEntry("mbf+", "-1,1|1,1"), StringEntry("mbf-", ""), StringEntry("mwf+", "-1,-1|1,-1"), StringEntry("mwf-", ""), StringEntry("ewf+", "-2,-2|2,-2"), StringEntry("ewf-", "")] | |
13 | 13 | ||
14 | 14 | ||
15 | 15 | ||
16 | 16 | @Callable(b) | |
17 | 17 | func move (c,d,e,f,g) = { | |
18 | 18 | let h = { | |
19 | 19 | let i = getString(("game-" + c)) | |
20 | 20 | if ($isInstanceOf(i, "String")) | |
21 | 21 | then { | |
22 | 22 | let j = i | |
23 | 23 | split(getStringValue(("game-" + c)), a) | |
24 | 24 | } | |
25 | 25 | else throw("no game") | |
26 | 26 | } | |
27 | 27 | if ((h == h)) | |
28 | 28 | then { | |
29 | 29 | let k = if (if (if (if ((d > -1)) | |
30 | 30 | then (f > -1) | |
31 | 31 | else false) | |
32 | 32 | then (8 > e) | |
33 | 33 | else false) | |
34 | 34 | then (8 > g) | |
35 | 35 | else false) | |
36 | 36 | then true | |
37 | 37 | else throw("incorrect xy") | |
38 | 38 | if ((k == k)) | |
39 | 39 | then { | |
40 | 40 | let l = toBase58String(b.caller.bytes) | |
41 | 41 | if ((l == l)) | |
42 | 42 | then { | |
43 | 43 | let m = if ((h[0] == "ongoing")) | |
44 | 44 | then true | |
45 | 45 | else throw("not ongoing game") | |
46 | 46 | if ((m == m)) | |
47 | 47 | then { | |
48 | 48 | let n = if (if (m) | |
49 | 49 | then if ((h[1] == l)) | |
50 | 50 | then true | |
51 | 51 | else (h[2] == l) | |
52 | 52 | else false) | |
53 | 53 | then if ((h[1] == l)) | |
54 | 54 | then "w" | |
55 | 55 | else "b" | |
56 | 56 | else throw("not gamer") | |
57 | 57 | if ((n == n)) | |
58 | 58 | then { | |
59 | 59 | let o = if ((n == "w")) | |
60 | 60 | then "b" | |
61 | 61 | else "w" | |
62 | 62 | let p = if ((n == h[5])) | |
63 | 63 | then true | |
64 | 64 | else throw("not your turn") | |
65 | 65 | if ((p == p)) | |
66 | 66 | then { | |
67 | 67 | let q = split(h[8], "!") | |
68 | 68 | 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], "-")] | |
69 | 69 | if ((r == r)) | |
70 | 70 | then { | |
71 | 71 | let s = if ((takeRight(r[e][d], 1) == "0")) | |
72 | 72 | then throw("empty cell") | |
73 | 73 | else takeRight(r[e][d], 1) | |
74 | - | let t = if ((take(r[g][f], 1) == "0")) | |
75 | - | then "m" | |
76 | - | else if ((take(r[g][f], 1) == o)) | |
77 | - | then "e" | |
78 | - | else throw("can not eat himself") | |
79 | - | let u = ((toString((d - f)) + ",") + toString((e - g))) | |
80 | - | let v = { | |
81 | - | let i = getString((((t + n) + s) + "+")) | |
82 | - | if ($isInstanceOf(i, "String")) | |
83 | - | then { | |
84 | - | let j = i | |
85 | - | split(getStringValue((((t + n) + s) + "+")), "|") | |
74 | + | let t = if ((r[g][f] == "00")) | |
75 | + | then true | |
76 | + | else throw("cell not free") | |
77 | + | if ((t == t)) | |
78 | + | then { | |
79 | + | let u = if (if ((((g - e) * (g - e)) == 1)) | |
80 | + | then (s == "f") | |
81 | + | else false) | |
82 | + | then "m" | |
83 | + | else if ((take(r[g][f], 1) == o)) | |
84 | + | then "e" | |
85 | + | else throw("can not eat himself") | |
86 | + | let v = ((toString((d - f)) + ",") + toString((e - g))) | |
87 | + | let w = { | |
88 | + | let i = getString((((u + n) + s) + "+")) | |
89 | + | if ($isInstanceOf(i, "String")) | |
90 | + | then { | |
91 | + | let j = i | |
92 | + | split(getStringValue((((u + n) + s) + "+")), "|") | |
93 | + | } | |
94 | + | else throw((((("no rules for " + u) + n) + s) + "+")) | |
86 | 95 | } | |
87 | - | | |
88 | - | | |
89 | - | | |
90 | - | | |
91 | - | | |
92 | - | | |
93 | - | | |
94 | - | | |
96 | + | let x = { | |
97 | + | let i = getString((((u + n) + s) + "-")) | |
98 | + | if ($isInstanceOf(i, "String")) | |
99 | + | then { | |
100 | + | let j = i | |
101 | + | split(getStringValue((((u + n) + s) + "-")), "|") | |
102 | + | } | |
103 | + | else throw((((("no rules for " + u) + n) + s) + "-")) | |
95 | 104 | } | |
96 | - | | |
97 | - | | |
98 | - | | |
99 | - | | |
100 | - | | |
101 | - | | |
102 | - | | |
103 | - | | |
104 | - | | |
105 | - | | |
106 | - | let | |
107 | - | | |
108 | - | | |
109 | - | | |
105 | + | let y = if (containsElement(w, v)) | |
106 | + | then true | |
107 | + | else throw(((((("incorrect movement+: fig=" + s) + " side=") + n) + " mtype=") + u)) | |
108 | + | let z = if (containsElement(x, v)) | |
109 | + | then throw(((((((("incorrect (" + v) + ")movement-: fig=") + s) + " side=") + n) + " mtype=") + u)) | |
110 | + | else true | |
111 | + | if (z) | |
112 | + | then { | |
113 | + | let A = h[8] | |
114 | + | let B = ((take(A, ((d * 3) + ((e * 8) * 3))) + "00") + takeRight(A, ((191 - ((d * 3) + ((e * 8) * 3))) - 2))) | |
115 | + | let C = (((take(B, ((f * 3) + ((g * 8) * 3))) + n) + s) + takeRight(B, ((191 - ((f * 3) + ((g * 8) * 3))) - 2))) | |
116 | + | $Tuple2([StringEntry(("game-" + c), makeString([h[0], h[1], h[2], h[3], toString((parseIntValue(h[4]) + 1)), o, h[6], h[7], C], a))], [StringEntry("_", "possible")]) | |
117 | + | } | |
118 | + | else throw(((((("impossible movement: fig=" + s) + " side=") + n) + " mtype=") + u)) | |
110 | 119 | } | |
111 | - | else throw( | |
120 | + | else throw("Strict value is not equal to itself.") | |
112 | 121 | } | |
113 | 122 | else throw("Strict value is not equal to itself.") | |
114 | 123 | } | |
115 | 124 | else throw("Strict value is not equal to itself.") | |
116 | 125 | } | |
117 | 126 | else throw("Strict value is not equal to itself.") | |
118 | 127 | } | |
119 | 128 | else throw("Strict value is not equal to itself.") | |
120 | 129 | } | |
121 | 130 | else throw("Strict value is not equal to itself.") | |
122 | 131 | } | |
123 | 132 | else throw("Strict value is not equal to itself.") | |
124 | 133 | } | |
125 | 134 | else throw("Strict value is not equal to itself.") | |
126 | 135 | } | |
127 | 136 | ||
128 | 137 | ||
129 | 138 | ||
130 | 139 | @Callable(b) | |
131 | - | func startgame ( | |
132 | - | let | |
140 | + | func startgame (D) = { | |
141 | + | let E = if ((size(b.payments) == 1)) | |
133 | 142 | then b.payments[0] | |
134 | 143 | else throw("must stake some waves") | |
135 | - | if (isDefined( | |
144 | + | if (isDefined(E.assetId)) | |
136 | 145 | then throw("works with waves only") | |
137 | 146 | else { | |
138 | 147 | let l = toBase58String(b.caller.bytes) | |
139 | - | let | |
140 | - | if ((size( | |
141 | - | then if (( | |
142 | - | then if (( | |
148 | + | let F = split(getStringValue(("challenge-" + D)), a) | |
149 | + | if ((size(F) > 0)) | |
150 | + | then if ((E.amount >= parseIntValue(F[3]))) | |
151 | + | then if ((F[0] == "awaiting")) | |
143 | 152 | then { | |
144 | - | let | |
145 | - | then | |
153 | + | let G = if ((F[2] == "b")) | |
154 | + | then F[1] | |
146 | 155 | else l | |
147 | - | let | |
148 | - | then | |
156 | + | let H = if ((F[2] == "w")) | |
157 | + | then F[1] | |
149 | 158 | else l | |
150 | 159 | let c = toString((parseIntValue(getStringValue("lastgameid")) + 1)) | |
151 | - | [StringEntry(("challenge-" + | |
160 | + | [StringEntry(("challenge-" + D), makeString([c, F[1], F[2], F[3], l], a)), { | |
152 | 161 | let q = "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" | |
153 | - | StringEntry(("game-" + c), makeString(["ongoing", G, F | |
154 | - | }, StringEntry("lastgameid", c), ScriptTransfer(b.caller, ( | |
162 | + | StringEntry(("game-" + c), makeString(["ongoing", H, G, F[3], "0", "w", "startblock", "laststepblock", q], a)) | |
163 | + | }, StringEntry("lastgameid", c), ScriptTransfer(b.caller, (E.amount - parseIntValue(F[3])), unit)] | |
155 | 164 | } | |
156 | 165 | else throw("no challenge awaiting") | |
157 | 166 | else throw("need more money") | |
158 | 167 | else throw("no challenge") | |
159 | 168 | } | |
160 | 169 | } | |
161 | 170 | ||
162 | 171 | ||
163 | 172 | ||
164 | 173 | @Callable(b) | |
165 | 174 | func setchallenge (n) = if (if ((n == "b")) | |
166 | 175 | then true | |
167 | 176 | else (n == "w")) | |
168 | 177 | then { | |
169 | - | let | |
178 | + | let E = if ((size(b.payments) == 1)) | |
170 | 179 | then b.payments[0] | |
171 | 180 | else throw("must stake some waves") | |
172 | - | if (isDefined( | |
181 | + | if (isDefined(E.assetId)) | |
173 | 182 | then throw("works with waves only") | |
174 | 183 | else { | |
175 | 184 | let l = toBase58String(b.caller.bytes) | |
176 | - | let | |
177 | - | [StringEntry(("challenge-" + | |
185 | + | let D = toString((parseIntValue(getStringValue("lastchallengeid")) + 1)) | |
186 | + | [StringEntry(("challenge-" + D), makeString(["awaiting", l, n, toString(E.amount)], a)), StringEntry("lastchallengeid", D)] | |
178 | 187 | } | |
179 | 188 | } | |
180 | 189 | else throw("invalid side") | |
181 | 190 | ||
182 | 191 | ||
183 | 192 | ||
184 | 193 | @Callable(b) | |
185 | - | func unsetchallenge ( | |
194 | + | func unsetchallenge (I) = { | |
186 | 195 | let l = toBase58String(b.caller.bytes) | |
187 | - | func | |
188 | - | let i = getString(("challenge-" + | |
196 | + | func J (I) = { | |
197 | + | let i = getString(("challenge-" + I)) | |
189 | 198 | if ($isInstanceOf(i, "String")) | |
190 | 199 | then { | |
191 | 200 | let j = i | |
192 | - | getStringValue(("challenge-" + | |
201 | + | getStringValue(("challenge-" + I)) | |
193 | 202 | } | |
194 | 203 | else "" | |
195 | 204 | } | |
196 | 205 | ||
197 | - | let | |
198 | - | if ((size( | |
199 | - | then if (( | |
200 | - | then [StringEntry(("challenge-" + | |
206 | + | let K = split(J(I), a) | |
207 | + | if ((size(K) > 0)) | |
208 | + | then if ((K[0] == "awaiting")) | |
209 | + | then [StringEntry(("challenge-" + I), makeString(["unset", K[1], K[2], K[3]], a))] | |
201 | 210 | else throw("challenge not exists") | |
202 | 211 | else throw("challenge not exists") | |
203 | 212 | } | |
204 | 213 | ||
205 | 214 |
github/deemru/w8io/169f3d6 99.90 ms ◑