tx · BcFUd1DTjTuieRMEXndmxq9GEeNjJ98pfK4L8gJkC6rQ 3N7Gg64FJ3ESaqn41qu1ete7zmzbmoP1AAV: -0.01000000 Waves 2021.12.10 09:30 [1827777] smart account 3N7Gg64FJ3ESaqn41qu1ete7zmzbmoP1AAV > SELF 0.00000000 Waves
{ "type": 13, "id": "BcFUd1DTjTuieRMEXndmxq9GEeNjJ98pfK4L8gJkC6rQ", "fee": 1000000, "feeAssetId": null, "timestamp": 1639117860984, "version": 2, "chainId": 84, "sender": "3N7Gg64FJ3ESaqn41qu1ete7zmzbmoP1AAV", "senderPublicKey": "5amLtMwixiEesBDKPy9dkFWntG2fNxhTs5n69JbQE9F7", "proofs": [ "2Rzy81g7dp5oFhVkhbzaAoK8VnpaALBci8bj6NjXURowR6v6DG2KqYYeK3Gqxe18odk4wxAwoh1bGXH92w8zBweB" ], "script": "base64:AAIFAAAAAAAAAB4IAhIAEgASBwoFCAEBAQESAwoBCBIDCgEIEgMKAQgAAAABAAAAAAVzZXBhcgIAAAABfAAAAAYAAAABaQEAAAAFcmVzZXQAAAAACQAETAAAAAIJAQAAAAtTdHJpbmdFbnRyeQAAAAICAAAACmxhc3RnYW1laWQCAAAAATAJAARMAAAAAgkBAAAAC1N0cmluZ0VudHJ5AAAAAgIAAAAPbGFzdGNoYWxsZW5nZWlkAgAAAAEwBQAAAANuaWwAAAABaQEAAAAIc2V0cnVsZXMAAAAACQAETAAAAAIJAQAAAAtTdHJpbmdFbnRyeQAAAAICAAAABG1iZisCAAAACC0xLDF8MSwxCQAETAAAAAIJAQAAAAtTdHJpbmdFbnRyeQAAAAICAAAABG1iZi0CAAAAAAkABEwAAAACCQEAAAALU3RyaW5nRW50cnkAAAACAgAAAARtd2YrAgAAAAotMSwtMXwxLC0xCQAETAAAAAIJAQAAAAtTdHJpbmdFbnRyeQAAAAICAAAABG13Zi0CAAAAAAUAAAADbmlsAAAAAWkBAAAABG1vdmUAAAAFAAAABmdhbWVpZAAAAAVmcm9teAAA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FAAAACWNoYWxsZW5nZQAAAAAAAAAAAgkABEwAAAACCQABkQAAAAIFAAAACWNoYWxsZW5nZQAAAAAAAAAAAwUAAAADbmlsBQAAAAVzZXBhcgUAAAADbmlsCQAAAgAAAAECAAAAFGNoYWxsZW5nZSBub3QgZXhpc3RzCQAAAgAAAAECAAAAFGNoYWxsZW5nZSBub3QgZXhpc3RzAAAAAB25HSk=", "height": 1827777, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: EG65mp5vrGEzN8hx2KWP1ASX3PrN8sX1UroTk9J82WhR Next: B1Z39kB2bum2xZJ4eYEu7ptrhNLBovzm38Ls8v44aPLm Diff:
Old | New | Differences | |
---|---|---|---|
21 | 21 | case _ => | |
22 | 22 | throw("no game") | |
23 | 23 | } | |
24 | - | let correctxy = if (if (if (if ((fromx > -1)) | |
25 | - | then (tox > -1) | |
26 | - | else false) | |
27 | - | then (8 > fromy) | |
28 | - | else false) | |
29 | - | then (8 > toy) | |
30 | - | else false) | |
31 | - | then true | |
32 | - | else throw("incorrect xy") | |
33 | - | if ((correctxy == correctxy)) | |
24 | + | if ((game == game)) | |
34 | 25 | then { | |
35 | - | let callerAdress = toBase58String(i.caller.bytes) | |
36 | - | let isgame = if ((game[0] == "ongoing")) | |
26 | + | let correctxy = if (if (if (if ((fromx > -1)) | |
27 | + | then (tox > -1) | |
28 | + | else false) | |
29 | + | then (8 > fromy) | |
30 | + | else false) | |
31 | + | then (8 > toy) | |
32 | + | else false) | |
37 | 33 | then true | |
38 | - | else throw("not ongoing game") | |
39 | - | let side = if (if (isgame) | |
40 | - | then if ((game[1] == callerAdress)) | |
41 | - | then true | |
42 | - | else (game[2] == callerAdress) | |
43 | - | else false) | |
44 | - | then if ((game[1] == callerAdress)) | |
45 | - | then "w" | |
46 | - | else "b" | |
47 | - | else throw("not gamer") | |
48 | - | let otherside = if ((side == "w")) | |
49 | - | then "b" | |
50 | - | else "w" | |
51 | - | let turn = if ((side == game[5])) | |
52 | - | then true | |
53 | - | else throw("not your turn") | |
54 | - | let situation = split(game[8], "!") | |
55 | - | let cells = [split(situation[0], "-"), split(situation[1], "-"), split(situation[2], "-"), split(situation[3], "-"), split(situation[4], "-"), split(situation[5], "-"), split(situation[6], "-"), split(situation[7], "-")] | |
56 | - | let figure = if ((takeRight(cells[fromy][fromx], 1) == "0")) | |
57 | - | then throw("empty cell") | |
58 | - | else takeRight(cells[fromy][fromx], 1) | |
59 | - | let movetype = if ((take(cells[toy][tox], 1) == "0")) | |
60 | - | then "m" | |
61 | - | else if ((take(cells[toy][tox], 1) == otherside)) | |
62 | - | then "e" | |
63 | - | else throw("can not eat himself") | |
64 | - | let movement = ((toString((fromx - tox)) + ",") + toString((fromy - toy))) | |
65 | - | let possible = match getString((((movetype + side) + figure) + "+")) { | |
66 | - | case a: String => | |
67 | - | split(getStringValue((((movetype + side) + figure) + "+")), "|") | |
68 | - | case _ => | |
69 | - | throw((((("no rules for " + movetype) + side) + figure) + "+")) | |
70 | - | } | |
71 | - | let impossible = match getString((((movetype + side) + figure) + "-")) { | |
72 | - | case a: String => | |
73 | - | split(getStringValue((((movetype + side) + figure) + "-")), "|") | |
74 | - | case _ => | |
75 | - | throw((((("no rules for " + movetype) + side) + figure) + "-")) | |
76 | - | } | |
77 | - | let iscorrect1 = if (containsElement(possible, movement)) | |
78 | - | then true | |
79 | - | else throw(((((("incorrect movement+: fig=" + figure) + " side=") + side) + " mtype=") + movetype)) | |
80 | - | let iscorrect2 = if (containsElement(impossible, movement)) | |
81 | - | then throw(((((((("incorrect (" + movement) + ")movement-: fig=") + figure) + " side=") + side) + " mtype=") + movetype)) | |
82 | - | else true | |
83 | - | if (iscorrect2) | |
34 | + | else throw("incorrect xy") | |
35 | + | if ((correctxy == correctxy)) | |
84 | 36 | then { | |
85 | - | let old = game[8] | |
86 | - | let new = ((take(old, ((fromx * 3) + ((fromy * 8) * 3))) + "00") + takeRight(old, ((191 - ((fromx * 3) + ((fromy * 8) * 3))) - 2))) | |
87 | - | let newsituation = (((take(new, ((tox * 3) + ((toy * 8) * 3))) + side) + figure) + takeRight(new, ((191 - ((tox * 3) + ((toy * 8) * 3))) - 2))) | |
88 | - | $Tuple2([StringEntry(("game-" + gameid), makeString([game[0], game[1], game[2], game[3], toString((parseIntValue(game[4]) + 1)), otherside, game[6], game[7], newsituation], separ))], [StringEntry("_", "possible")]) | |
37 | + | let callerAdress = toBase58String(i.caller.bytes) | |
38 | + | if ((callerAdress == callerAdress)) | |
39 | + | then { | |
40 | + | let isgame = if ((game[0] == "ongoing")) | |
41 | + | then true | |
42 | + | else throw("not ongoing game") | |
43 | + | if ((isgame == isgame)) | |
44 | + | then { | |
45 | + | let side = if (if (isgame) | |
46 | + | then if ((game[1] == callerAdress)) | |
47 | + | then true | |
48 | + | else (game[2] == callerAdress) | |
49 | + | else false) | |
50 | + | then if ((game[1] == callerAdress)) | |
51 | + | then "w" | |
52 | + | else "b" | |
53 | + | else throw("not gamer") | |
54 | + | if ((side == side)) | |
55 | + | then { | |
56 | + | let otherside = if ((side == "w")) | |
57 | + | then "b" | |
58 | + | else "w" | |
59 | + | let turn = if ((side == game[5])) | |
60 | + | then true | |
61 | + | else throw("not your turn") | |
62 | + | if ((turn == turn)) | |
63 | + | then { | |
64 | + | let situation = split(game[8], "!") | |
65 | + | let cells = [split(situation[0], "-"), split(situation[1], "-"), split(situation[2], "-"), split(situation[3], "-"), split(situation[4], "-"), split(situation[5], "-"), split(situation[6], "-"), split(situation[7], "-")] | |
66 | + | if ((cells == cells)) | |
67 | + | then { | |
68 | + | let figure = if ((takeRight(cells[fromy][fromx], 1) == "0")) | |
69 | + | then throw("empty cell") | |
70 | + | else takeRight(cells[fromy][fromx], 1) | |
71 | + | let movetype = if ((take(cells[toy][tox], 1) == "0")) | |
72 | + | then "m" | |
73 | + | else if ((take(cells[toy][tox], 1) == otherside)) | |
74 | + | then "e" | |
75 | + | else throw("can not eat himself") | |
76 | + | let movement = ((toString((fromx - tox)) + ",") + toString((fromy - toy))) | |
77 | + | let possible = match getString((((movetype + side) + figure) + "+")) { | |
78 | + | case a: String => | |
79 | + | split(getStringValue((((movetype + side) + figure) + "+")), "|") | |
80 | + | case _ => | |
81 | + | throw((((("no rules for " + movetype) + side) + figure) + "+")) | |
82 | + | } | |
83 | + | let impossible = match getString((((movetype + side) + figure) + "-")) { | |
84 | + | case a: String => | |
85 | + | split(getStringValue((((movetype + side) + figure) + "-")), "|") | |
86 | + | case _ => | |
87 | + | throw((((("no rules for " + movetype) + side) + figure) + "-")) | |
88 | + | } | |
89 | + | let iscorrect1 = if (containsElement(possible, movement)) | |
90 | + | then true | |
91 | + | else throw(((((("incorrect movement+: fig=" + figure) + " side=") + side) + " mtype=") + movetype)) | |
92 | + | let iscorrect2 = if (containsElement(impossible, movement)) | |
93 | + | then throw(((((((("incorrect (" + movement) + ")movement-: fig=") + figure) + " side=") + side) + " mtype=") + movetype)) | |
94 | + | else true | |
95 | + | if (iscorrect2) | |
96 | + | then { | |
97 | + | let old = game[8] | |
98 | + | let new = ((take(old, ((fromx * 3) + ((fromy * 8) * 3))) + "00") + takeRight(old, ((191 - ((fromx * 3) + ((fromy * 8) * 3))) - 2))) | |
99 | + | let newsituation = (((take(new, ((tox * 3) + ((toy * 8) * 3))) + side) + figure) + takeRight(new, ((191 - ((tox * 3) + ((toy * 8) * 3))) - 2))) | |
100 | + | $Tuple2([StringEntry(("game-" + gameid), makeString([game[0], game[1], game[2], game[3], toString((parseIntValue(game[4]) + 1)), otherside, game[6], game[7], newsituation], separ))], [StringEntry("_", "possible")]) | |
101 | + | } | |
102 | + | else throw(((((("impossible movement: fig=" + figure) + " side=") + side) + " mtype=") + movetype)) | |
103 | + | } | |
104 | + | else throw("Strict value is not equal to itself.") | |
105 | + | } | |
106 | + | else throw("Strict value is not equal to itself.") | |
107 | + | } | |
108 | + | else throw("Strict value is not equal to itself.") | |
109 | + | } | |
110 | + | else throw("Strict value is not equal to itself.") | |
111 | + | } | |
112 | + | else throw("Strict value is not equal to itself.") | |
89 | 113 | } | |
90 | - | else throw( | |
114 | + | else throw("Strict value is not equal to itself.") | |
91 | 115 | } | |
92 | 116 | else throw("Strict value is not equal to itself.") | |
93 | 117 | } |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let separ = "|" | |
5 | 5 | ||
6 | 6 | @Callable(i) | |
7 | 7 | func reset () = [StringEntry("lastgameid", "0"), StringEntry("lastchallengeid", "0")] | |
8 | 8 | ||
9 | 9 | ||
10 | 10 | ||
11 | 11 | @Callable(i) | |
12 | 12 | func setrules () = [StringEntry("mbf+", "-1,1|1,1"), StringEntry("mbf-", ""), StringEntry("mwf+", "-1,-1|1,-1"), StringEntry("mwf-", "")] | |
13 | 13 | ||
14 | 14 | ||
15 | 15 | ||
16 | 16 | @Callable(i) | |
17 | 17 | func move (gameid,fromx,fromy,tox,toy) = { | |
18 | 18 | let game = match getString(("game-" + gameid)) { | |
19 | 19 | case a: String => | |
20 | 20 | split(getStringValue(("game-" + gameid)), separ) | |
21 | 21 | case _ => | |
22 | 22 | throw("no game") | |
23 | 23 | } | |
24 | - | let correctxy = if (if (if (if ((fromx > -1)) | |
25 | - | then (tox > -1) | |
26 | - | else false) | |
27 | - | then (8 > fromy) | |
28 | - | else false) | |
29 | - | then (8 > toy) | |
30 | - | else false) | |
31 | - | then true | |
32 | - | else throw("incorrect xy") | |
33 | - | if ((correctxy == correctxy)) | |
24 | + | if ((game == game)) | |
34 | 25 | then { | |
35 | - | let callerAdress = toBase58String(i.caller.bytes) | |
36 | - | let isgame = if ((game[0] == "ongoing")) | |
26 | + | let correctxy = if (if (if (if ((fromx > -1)) | |
27 | + | then (tox > -1) | |
28 | + | else false) | |
29 | + | then (8 > fromy) | |
30 | + | else false) | |
31 | + | then (8 > toy) | |
32 | + | else false) | |
37 | 33 | then true | |
38 | - | else throw("not ongoing game") | |
39 | - | let side = if (if (isgame) | |
40 | - | then if ((game[1] == callerAdress)) | |
41 | - | then true | |
42 | - | else (game[2] == callerAdress) | |
43 | - | else false) | |
44 | - | then if ((game[1] == callerAdress)) | |
45 | - | then "w" | |
46 | - | else "b" | |
47 | - | else throw("not gamer") | |
48 | - | let otherside = if ((side == "w")) | |
49 | - | then "b" | |
50 | - | else "w" | |
51 | - | let turn = if ((side == game[5])) | |
52 | - | then true | |
53 | - | else throw("not your turn") | |
54 | - | let situation = split(game[8], "!") | |
55 | - | let cells = [split(situation[0], "-"), split(situation[1], "-"), split(situation[2], "-"), split(situation[3], "-"), split(situation[4], "-"), split(situation[5], "-"), split(situation[6], "-"), split(situation[7], "-")] | |
56 | - | let figure = if ((takeRight(cells[fromy][fromx], 1) == "0")) | |
57 | - | then throw("empty cell") | |
58 | - | else takeRight(cells[fromy][fromx], 1) | |
59 | - | let movetype = if ((take(cells[toy][tox], 1) == "0")) | |
60 | - | then "m" | |
61 | - | else if ((take(cells[toy][tox], 1) == otherside)) | |
62 | - | then "e" | |
63 | - | else throw("can not eat himself") | |
64 | - | let movement = ((toString((fromx - tox)) + ",") + toString((fromy - toy))) | |
65 | - | let possible = match getString((((movetype + side) + figure) + "+")) { | |
66 | - | case a: String => | |
67 | - | split(getStringValue((((movetype + side) + figure) + "+")), "|") | |
68 | - | case _ => | |
69 | - | throw((((("no rules for " + movetype) + side) + figure) + "+")) | |
70 | - | } | |
71 | - | let impossible = match getString((((movetype + side) + figure) + "-")) { | |
72 | - | case a: String => | |
73 | - | split(getStringValue((((movetype + side) + figure) + "-")), "|") | |
74 | - | case _ => | |
75 | - | throw((((("no rules for " + movetype) + side) + figure) + "-")) | |
76 | - | } | |
77 | - | let iscorrect1 = if (containsElement(possible, movement)) | |
78 | - | then true | |
79 | - | else throw(((((("incorrect movement+: fig=" + figure) + " side=") + side) + " mtype=") + movetype)) | |
80 | - | let iscorrect2 = if (containsElement(impossible, movement)) | |
81 | - | then throw(((((((("incorrect (" + movement) + ")movement-: fig=") + figure) + " side=") + side) + " mtype=") + movetype)) | |
82 | - | else true | |
83 | - | if (iscorrect2) | |
34 | + | else throw("incorrect xy") | |
35 | + | if ((correctxy == correctxy)) | |
84 | 36 | then { | |
85 | - | let old = game[8] | |
86 | - | let new = ((take(old, ((fromx * 3) + ((fromy * 8) * 3))) + "00") + takeRight(old, ((191 - ((fromx * 3) + ((fromy * 8) * 3))) - 2))) | |
87 | - | let newsituation = (((take(new, ((tox * 3) + ((toy * 8) * 3))) + side) + figure) + takeRight(new, ((191 - ((tox * 3) + ((toy * 8) * 3))) - 2))) | |
88 | - | $Tuple2([StringEntry(("game-" + gameid), makeString([game[0], game[1], game[2], game[3], toString((parseIntValue(game[4]) + 1)), otherside, game[6], game[7], newsituation], separ))], [StringEntry("_", "possible")]) | |
37 | + | let callerAdress = toBase58String(i.caller.bytes) | |
38 | + | if ((callerAdress == callerAdress)) | |
39 | + | then { | |
40 | + | let isgame = if ((game[0] == "ongoing")) | |
41 | + | then true | |
42 | + | else throw("not ongoing game") | |
43 | + | if ((isgame == isgame)) | |
44 | + | then { | |
45 | + | let side = if (if (isgame) | |
46 | + | then if ((game[1] == callerAdress)) | |
47 | + | then true | |
48 | + | else (game[2] == callerAdress) | |
49 | + | else false) | |
50 | + | then if ((game[1] == callerAdress)) | |
51 | + | then "w" | |
52 | + | else "b" | |
53 | + | else throw("not gamer") | |
54 | + | if ((side == side)) | |
55 | + | then { | |
56 | + | let otherside = if ((side == "w")) | |
57 | + | then "b" | |
58 | + | else "w" | |
59 | + | let turn = if ((side == game[5])) | |
60 | + | then true | |
61 | + | else throw("not your turn") | |
62 | + | if ((turn == turn)) | |
63 | + | then { | |
64 | + | let situation = split(game[8], "!") | |
65 | + | let cells = [split(situation[0], "-"), split(situation[1], "-"), split(situation[2], "-"), split(situation[3], "-"), split(situation[4], "-"), split(situation[5], "-"), split(situation[6], "-"), split(situation[7], "-")] | |
66 | + | if ((cells == cells)) | |
67 | + | then { | |
68 | + | let figure = if ((takeRight(cells[fromy][fromx], 1) == "0")) | |
69 | + | then throw("empty cell") | |
70 | + | else takeRight(cells[fromy][fromx], 1) | |
71 | + | let movetype = if ((take(cells[toy][tox], 1) == "0")) | |
72 | + | then "m" | |
73 | + | else if ((take(cells[toy][tox], 1) == otherside)) | |
74 | + | then "e" | |
75 | + | else throw("can not eat himself") | |
76 | + | let movement = ((toString((fromx - tox)) + ",") + toString((fromy - toy))) | |
77 | + | let possible = match getString((((movetype + side) + figure) + "+")) { | |
78 | + | case a: String => | |
79 | + | split(getStringValue((((movetype + side) + figure) + "+")), "|") | |
80 | + | case _ => | |
81 | + | throw((((("no rules for " + movetype) + side) + figure) + "+")) | |
82 | + | } | |
83 | + | let impossible = match getString((((movetype + side) + figure) + "-")) { | |
84 | + | case a: String => | |
85 | + | split(getStringValue((((movetype + side) + figure) + "-")), "|") | |
86 | + | case _ => | |
87 | + | throw((((("no rules for " + movetype) + side) + figure) + "-")) | |
88 | + | } | |
89 | + | let iscorrect1 = if (containsElement(possible, movement)) | |
90 | + | then true | |
91 | + | else throw(((((("incorrect movement+: fig=" + figure) + " side=") + side) + " mtype=") + movetype)) | |
92 | + | let iscorrect2 = if (containsElement(impossible, movement)) | |
93 | + | then throw(((((((("incorrect (" + movement) + ")movement-: fig=") + figure) + " side=") + side) + " mtype=") + movetype)) | |
94 | + | else true | |
95 | + | if (iscorrect2) | |
96 | + | then { | |
97 | + | let old = game[8] | |
98 | + | let new = ((take(old, ((fromx * 3) + ((fromy * 8) * 3))) + "00") + takeRight(old, ((191 - ((fromx * 3) + ((fromy * 8) * 3))) - 2))) | |
99 | + | let newsituation = (((take(new, ((tox * 3) + ((toy * 8) * 3))) + side) + figure) + takeRight(new, ((191 - ((tox * 3) + ((toy * 8) * 3))) - 2))) | |
100 | + | $Tuple2([StringEntry(("game-" + gameid), makeString([game[0], game[1], game[2], game[3], toString((parseIntValue(game[4]) + 1)), otherside, game[6], game[7], newsituation], separ))], [StringEntry("_", "possible")]) | |
101 | + | } | |
102 | + | else throw(((((("impossible movement: fig=" + figure) + " side=") + side) + " mtype=") + movetype)) | |
103 | + | } | |
104 | + | else throw("Strict value is not equal to itself.") | |
105 | + | } | |
106 | + | else throw("Strict value is not equal to itself.") | |
107 | + | } | |
108 | + | else throw("Strict value is not equal to itself.") | |
109 | + | } | |
110 | + | else throw("Strict value is not equal to itself.") | |
111 | + | } | |
112 | + | else throw("Strict value is not equal to itself.") | |
89 | 113 | } | |
90 | - | else throw( | |
114 | + | else throw("Strict value is not equal to itself.") | |
91 | 115 | } | |
92 | 116 | else throw("Strict value is not equal to itself.") | |
93 | 117 | } | |
94 | 118 | ||
95 | 119 | ||
96 | 120 | ||
97 | 121 | @Callable(i) | |
98 | 122 | func startgame (challengeid) = { | |
99 | 123 | let pmt = if ((size(i.payments) == 1)) | |
100 | 124 | then i.payments[0] | |
101 | 125 | else throw("must stake some waves") | |
102 | 126 | if (isDefined(pmt.assetId)) | |
103 | 127 | then throw("works with waves only") | |
104 | 128 | else { | |
105 | 129 | let callerAdress = toBase58String(i.caller.bytes) | |
106 | 130 | let conditions = split(getStringValue(("challenge-" + challengeid)), separ) | |
107 | 131 | if ((size(conditions) > 0)) | |
108 | 132 | then if ((pmt.amount >= parseIntValue(conditions[3]))) | |
109 | 133 | then if ((conditions[0] == "awaiting")) | |
110 | 134 | then { | |
111 | 135 | let black = if ((conditions[2] == "b")) | |
112 | 136 | then conditions[1] | |
113 | 137 | else callerAdress | |
114 | 138 | let white = if ((conditions[2] == "w")) | |
115 | 139 | then conditions[1] | |
116 | 140 | else callerAdress | |
117 | 141 | let gameid = toString((parseIntValue(getStringValue("lastgameid")) + 1)) | |
118 | 142 | [StringEntry(("challenge-" + challengeid), makeString([gameid, conditions[1], conditions[2], conditions[3], callerAdress], separ)), { | |
119 | 143 | let situation = "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" | |
120 | 144 | StringEntry(("game-" + gameid), makeString(["ongoing", white, black, conditions[3], "0", "w", "startblock", "laststepblock", situation], separ)) | |
121 | 145 | }, StringEntry("lastgameid", gameid), ScriptTransfer(i.caller, (pmt.amount - parseIntValue(conditions[3])), unit)] | |
122 | 146 | } | |
123 | 147 | else throw("no challenge awaiting") | |
124 | 148 | else throw("need more money") | |
125 | 149 | else throw("no challenge") | |
126 | 150 | } | |
127 | 151 | } | |
128 | 152 | ||
129 | 153 | ||
130 | 154 | ||
131 | 155 | @Callable(i) | |
132 | 156 | func setchallenge (side) = if (if ((side == "b")) | |
133 | 157 | then true | |
134 | 158 | else (side == "w")) | |
135 | 159 | then { | |
136 | 160 | let pmt = if ((size(i.payments) == 1)) | |
137 | 161 | then i.payments[0] | |
138 | 162 | else throw("must stake some waves") | |
139 | 163 | if (isDefined(pmt.assetId)) | |
140 | 164 | then throw("works with waves only") | |
141 | 165 | else { | |
142 | 166 | let callerAdress = toBase58String(i.caller.bytes) | |
143 | 167 | let challengeid = toString((parseIntValue(getStringValue("lastchallengeid")) + 1)) | |
144 | 168 | [StringEntry(("challenge-" + challengeid), makeString(["awaiting", callerAdress, side, toString(pmt.amount)], separ)), StringEntry("lastchallengeid", challengeid)] | |
145 | 169 | } | |
146 | 170 | } | |
147 | 171 | else throw("invalid side") | |
148 | 172 | ||
149 | 173 | ||
150 | 174 | ||
151 | 175 | @Callable(i) | |
152 | 176 | func unsetchallenge (challendgeid) = { | |
153 | 177 | let callerAdress = toBase58String(i.caller.bytes) | |
154 | 178 | func getchallenge (challendgeid) = match getString(("challenge-" + challendgeid)) { | |
155 | 179 | case a: String => | |
156 | 180 | getStringValue(("challenge-" + challendgeid)) | |
157 | 181 | case _ => | |
158 | 182 | "" | |
159 | 183 | } | |
160 | 184 | ||
161 | 185 | let challenge = split(getchallenge(challendgeid), separ) | |
162 | 186 | if ((size(challenge) > 0)) | |
163 | 187 | then if ((challenge[0] == "awaiting")) | |
164 | 188 | then [StringEntry(("challenge-" + challendgeid), makeString(["unset", challenge[1], challenge[2], challenge[3]], separ))] | |
165 | 189 | else throw("challenge not exists") | |
166 | 190 | else throw("challenge not exists") | |
167 | 191 | } | |
168 | 192 | ||
169 | 193 |
github/deemru/w8io/026f985 32.59 ms ◑