tx · 25WvUy1u3nNvmdtSEsLmqGQbgeBMi14Lc6PKtwihd7ra 3N7Gg64FJ3ESaqn41qu1ete7zmzbmoP1AAV: -0.01000000 Waves 2021.12.09 11:27 [1826461] smart account 3N7Gg64FJ3ESaqn41qu1ete7zmzbmoP1AAV > SELF 0.00000000 Waves
{ "type": 13, "id": "25WvUy1u3nNvmdtSEsLmqGQbgeBMi14Lc6PKtwihd7ra", "fee": 1000000, "feeAssetId": null, "timestamp": 1639038478990, "version": 2, "chainId": 84, "sender": "3N7Gg64FJ3ESaqn41qu1ete7zmzbmoP1AAV", "senderPublicKey": "5amLtMwixiEesBDKPy9dkFWntG2fNxhTs5n69JbQE9F7", "proofs": [ "2TA1jGBC9SSnNxLNyV7roZ1fWujx7J5bjdxQBodCqSsKpqjug7wnmJi76qYTZnWbXpH1PYWzTaEaSVVBXoUruVzX" ], "script": "base64:AAIFAAAAAAAAABwIAhIAEgASBQoDCAgIEgMKAQgSAwoBCBIDCgEIAAAAAQAAAAAFc2VwYXICAAAAAXwAAAAGAAAAAWkBAAAABXJlc2V0AAAAAAkABEwAAAACCQEAAAALU3RyaW5nRW50cnkAAAACAgAAAApsYXN0Z2FtZWlkAgAAAAEwCQAETAAAAAIJAQAAAAtTdHJpbmdFbnRyeQAAAAICAAAAD2xhc3RjaGFsbGVuZ2VpZAIAAAABMAUAAAADbmlsAAAAAWkBAAAACHNldHJ1bGVzAAAAAAkABEwAAAACCQEAAAALU3RyaW5nRW50cnkAAAACAgAAAARtYmYrAgAAAAotMSwtMXwxLC0xCQAETAAAAAIJAQAAAAtTdHJpbmdFbnRyeQAAAAICAAAABG1iZi0CAAAAAAkABEwAAAACCQEAAAALU3RyaW5nRW50cnkAAAACAgAAAARtd2YrAgAAAAgtMSwxfDEsMQkABEwAAAACCQEAAAALU3RyaW5nRW50cnkAAAACAgAAAARtd2YtAgAAAAAFAAAAA25pbAAAAAFpAQAAAARtb3ZlAAAAAwAAAAZnYW1laWQAAAAEZnJvbQAAAAJ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mdFbnRyeQAAAAIJAAEsAAAAAgIAAAAKY2hhbGxlbmdlLQUAAAAMY2hhbGxlbmRnZWlkCQAEuQAAAAIJAARMAAAAAgIAAAAFdW5zZXQJAARMAAAAAgkAAZEAAAACBQAAAAljaGFsbGVuZ2UAAAAAAAAAAAEJAARMAAAAAgkAAZEAAAACBQAAAAljaGFsbGVuZ2UAAAAAAAAAAAIJAARMAAAAAgkAAZEAAAACBQAAAAljaGFsbGVuZ2UAAAAAAAAAAAMFAAAAA25pbAUAAAAFc2VwYXIFAAAAA25pbAkAAAIAAAABAgAAABRjaGFsbGVuZ2Ugbm90IGV4aXN0cwkAAAIAAAABAgAAABRjaGFsbGVuZ2Ugbm90IGV4aXN0cwAAAADAFgkh", "height": 1826461, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 8y2C3N3BzQKupBcKKues5evvGR3kara3EbGrfG9wPDHW Next: GZMrG7JyroYqqGmd9FjGxe9S8JVQQzSqJHRAXCeKw5Us Diff:
Old | New | Differences | |
---|---|---|---|
9 | 9 | ||
10 | 10 | ||
11 | 11 | @Callable(b) | |
12 | - | func setrules () = [StringEntry(" | |
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 | ||
60 | 60 | then "e" | |
61 | 61 | else throw("can not eat himself") | |
62 | 62 | let t = ((toString((n - p)) + ",") + toString((o - q))) | |
63 | - | let u = split(getStringValue((s + r)), "|") | |
63 | + | let u = split(getStringValue(((s + i) + r)), "|") | |
64 | 64 | let v = if (containsElement(u, t)) | |
65 | 65 | then true | |
66 | 66 | else throw("incorrect movement") | |
67 | 67 | if (v) | |
68 | - | then [StringEntry("_", " | |
68 | + | then [StringEntry("_", "possible")] | |
69 | 69 | else [StringEntry("_", "_")] | |
70 | 70 | } | |
71 | 71 | else throw("Strict value is not equal to itself.") | |
105 | 105 | else g | |
106 | 106 | let c = toString((parseIntValue(getStringValue("lastgameid")) + 1)) | |
107 | 107 | [StringEntry(("challenge-" + w), makeString([c, y[1], y[2], y[3], g], a)), { | |
108 | - | let l = " | |
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 | 109 | StringEntry(("game-" + c), makeString(["ongoing", A, z, y[3], "0", "w", "startblock", "laststepblock", l], a)) | |
110 | 110 | }, StringEntry("lastgameid", c), ScriptTransfer(b.caller, (x.amount - parseIntValue(y[3])), unit)] | |
111 | 111 | } |
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(" | |
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(b) | |
17 | 17 | func move (c,d,e) = { | |
18 | 18 | let f = split(getStringValue(("game-" + c)), a) | |
19 | 19 | if ((f == f)) | |
20 | 20 | then { | |
21 | 21 | let g = toBase58String(b.caller.bytes) | |
22 | 22 | if ((g == g)) | |
23 | 23 | then { | |
24 | 24 | let h = if ((f[0] == "ongoing")) | |
25 | 25 | then true | |
26 | 26 | else throw("not ongoing game") | |
27 | 27 | if ((h == h)) | |
28 | 28 | then { | |
29 | 29 | let i = if (if (h) | |
30 | 30 | then if ((f[1] == g)) | |
31 | 31 | then true | |
32 | 32 | else (f[2] == g) | |
33 | 33 | else false) | |
34 | 34 | then if ((f[1] == g)) | |
35 | 35 | then "w" | |
36 | 36 | else "b" | |
37 | 37 | else throw("not gamer") | |
38 | 38 | if ((i == i)) | |
39 | 39 | then { | |
40 | 40 | let j = if ((i == "w")) | |
41 | 41 | then "b" | |
42 | 42 | else "w" | |
43 | 43 | let k = if ((i == f[5])) | |
44 | 44 | then true | |
45 | 45 | else throw("not your turn") | |
46 | 46 | if ((k == k)) | |
47 | 47 | then { | |
48 | 48 | let l = split(f[8], "!") | |
49 | 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 | 50 | if ((m == m)) | |
51 | 51 | then { | |
52 | 52 | let n = parseIntValue(take(d, 1)) | |
53 | 53 | let o = parseIntValue(takeRight(d, 1)) | |
54 | 54 | let p = parseIntValue(take(e, 1)) | |
55 | 55 | let q = parseIntValue(takeRight(e, 1)) | |
56 | 56 | let r = takeRight(m[n][o], 1) | |
57 | 57 | let s = if ((take(m[p][q], 1) == "0")) | |
58 | 58 | then "m" | |
59 | 59 | else if ((take(m[p][q], 1) == j)) | |
60 | 60 | then "e" | |
61 | 61 | else throw("can not eat himself") | |
62 | 62 | let t = ((toString((n - p)) + ",") + toString((o - q))) | |
63 | - | let u = split(getStringValue((s + r)), "|") | |
63 | + | let u = split(getStringValue(((s + i) + r)), "|") | |
64 | 64 | let v = if (containsElement(u, t)) | |
65 | 65 | then true | |
66 | 66 | else throw("incorrect movement") | |
67 | 67 | if (v) | |
68 | - | then [StringEntry("_", " | |
68 | + | then [StringEntry("_", "possible")] | |
69 | 69 | else [StringEntry("_", "_")] | |
70 | 70 | } | |
71 | 71 | else throw("Strict value is not equal to itself.") | |
72 | 72 | } | |
73 | 73 | else throw("Strict value is not equal to itself.") | |
74 | 74 | } | |
75 | 75 | else throw("Strict value is not equal to itself.") | |
76 | 76 | } | |
77 | 77 | else throw("Strict value is not equal to itself.") | |
78 | 78 | } | |
79 | 79 | else throw("Strict value is not equal to itself.") | |
80 | 80 | } | |
81 | 81 | else throw("Strict value is not equal to itself.") | |
82 | 82 | } | |
83 | 83 | ||
84 | 84 | ||
85 | 85 | ||
86 | 86 | @Callable(b) | |
87 | 87 | func startgame (w) = { | |
88 | 88 | let x = if ((size(b.payments) == 1)) | |
89 | 89 | then b.payments[0] | |
90 | 90 | else throw("must stake some waves") | |
91 | 91 | if (isDefined(x.assetId)) | |
92 | 92 | then throw("works with waves only") | |
93 | 93 | else { | |
94 | 94 | let g = toBase58String(b.caller.bytes) | |
95 | 95 | let y = split(getStringValue(("challenge-" + w)), a) | |
96 | 96 | if ((size(y) > 0)) | |
97 | 97 | then if ((x.amount >= parseIntValue(y[3]))) | |
98 | 98 | then if ((y[0] == "awaiting")) | |
99 | 99 | then { | |
100 | 100 | let z = if ((y[2] == "b")) | |
101 | 101 | then y[1] | |
102 | 102 | else g | |
103 | 103 | let A = if ((y[2] == "w")) | |
104 | 104 | then y[1] | |
105 | 105 | else g | |
106 | 106 | let c = toString((parseIntValue(getStringValue("lastgameid")) + 1)) | |
107 | 107 | [StringEntry(("challenge-" + w), makeString([c, y[1], y[2], y[3], g], a)), { | |
108 | - | let l = " | |
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 | 109 | StringEntry(("game-" + c), makeString(["ongoing", A, z, y[3], "0", "w", "startblock", "laststepblock", l], a)) | |
110 | 110 | }, StringEntry("lastgameid", c), ScriptTransfer(b.caller, (x.amount - parseIntValue(y[3])), unit)] | |
111 | 111 | } | |
112 | 112 | else throw("no challenge awaiting") | |
113 | 113 | else throw("need more money") | |
114 | 114 | else throw("no challenge") | |
115 | 115 | } | |
116 | 116 | } | |
117 | 117 | ||
118 | 118 | ||
119 | 119 | ||
120 | 120 | @Callable(b) | |
121 | 121 | func setchallenge (i) = if (if ((i == "b")) | |
122 | 122 | then true | |
123 | 123 | else (i == "w")) | |
124 | 124 | then { | |
125 | 125 | let x = if ((size(b.payments) == 1)) | |
126 | 126 | then b.payments[0] | |
127 | 127 | else throw("must stake some waves") | |
128 | 128 | if (isDefined(x.assetId)) | |
129 | 129 | then throw("works with waves only") | |
130 | 130 | else { | |
131 | 131 | let g = toBase58String(b.caller.bytes) | |
132 | 132 | let w = toString((parseIntValue(getStringValue("lastchallengeid")) + 1)) | |
133 | 133 | [StringEntry(("challenge-" + w), makeString(["awaiting", g, i, toString(x.amount)], a)), StringEntry("lastchallengeid", w)] | |
134 | 134 | } | |
135 | 135 | } | |
136 | 136 | else throw("invalid side") | |
137 | 137 | ||
138 | 138 | ||
139 | 139 | ||
140 | 140 | @Callable(b) | |
141 | 141 | func unsetchallenge (B) = { | |
142 | 142 | let g = toBase58String(b.caller.bytes) | |
143 | 143 | func C (B) = { | |
144 | 144 | let D = getString(("challenge-" + B)) | |
145 | 145 | if ($isInstanceOf(D, "String")) | |
146 | 146 | then { | |
147 | 147 | let E = D | |
148 | 148 | getStringValue(("challenge-" + B)) | |
149 | 149 | } | |
150 | 150 | else "" | |
151 | 151 | } | |
152 | 152 | ||
153 | 153 | let F = split(C(B), a) | |
154 | 154 | if ((size(F) > 0)) | |
155 | 155 | then if ((F[0] == "awaiting")) | |
156 | 156 | then [StringEntry(("challenge-" + B), makeString(["unset", F[1], F[2], F[3]], a))] | |
157 | 157 | else throw("challenge not exists") | |
158 | 158 | else throw("challenge not exists") | |
159 | 159 | } | |
160 | 160 | ||
161 | 161 |
github/deemru/w8io/026f985 35.81 ms ◑