tx · 4vBWRhoh2qb5iSri55czCtQBfNSx8RLca2T18g7CV3s9 3N9fzexZxi7HrPcfizpvpFcaAnvpyuuMKPg: -0.01400000 Waves 2019.08.27 23:30 [650080] smart account 3N9fzexZxi7HrPcfizpvpFcaAnvpyuuMKPg > SELF 0.00000000 Waves
{ "type": 13, "id": "4vBWRhoh2qb5iSri55czCtQBfNSx8RLca2T18g7CV3s9", "fee": 1400000, "feeAssetId": null, "timestamp": 1566937883772, "version": 1, "sender": "3N9fzexZxi7HrPcfizpvpFcaAnvpyuuMKPg", "senderPublicKey": "BJB5QS4iQna1z8idKb5QQ5cACUmNgxzHc81Y7AW6ZZY7", "proofs": [ "3ovhiXEds13qi4HDWHw882zVZRHQvWtHFpQ5jhVCCnczZHP9jWzg9qEyvwAh29MyR38GYBfMkT4c1Ch9AbWYxPbD" ], "script": "base64:AAIDAAAAAAAAAAAAAAAGAAAAABBzdGFydFJvdW5kSGVpZ2h0AAAAAAAAAAAFAQAAAApyYW5kb21pemVyAAAAAQAAAANpbnYEAAAACGxhc3RQbGF5BAAAAAckbWF0Y2gwCQAEHAAAAAIFAAAABHRoaXMCAAAACGxhc3RQbGF5AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAApCeXRlVmVjdG9yBAAAAAFzBQAAAAckbWF0Y2gwBQAAAAFzAwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAARVbml0BAAAAAFhBQAAAAckbWF0Y2gwAQAAAAxXYXZlc0xvdHRvVjIJAQAAAAV0aHJvdwAAAAAEAAAABHJhbmQJAADLAAAAAgkAAMsAAAACCQAAywAAAAIJAADLAAAAAgkAAMsAAAACBQAAAAhsYXN0UGxheQgFAAAAA2ludgAAAA10cmFuc2FjdGlvbklkCAUAAAADaW52AAAAD2NhbGxlclB1YmxpY0tleQgFAAAACWxhc3RCbG9jawAAABNnZW5lcmF0aW9uU2lnbmF0dXJlCQABmgAAAAEIBQAAAAlsYXN0QmxvY2sAAAAJdGltZXN0YW1wCQABmgAAA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Sb3VuZAIAAAAOX2NvdW50R2FtZXJzVXADCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAA0ludAQAAAABZwUAAAAHJG1hdGNoMAUAAAABZwAAAAAAAAAAAAkBAAAACFdyaXRlU2V0AAAAAQkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgkAASwAAAACCQABLAAAAAIJAAGkAAAAAQUAAAAMY3VycmVudFJvdW5kAgAAAAZfbW9yZV8FAAAADGFkZHJlc3NHYW1lcggFAAAAA3BtdAAAAAZhbW91bnQJAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAIJAAEsAAAAAgkAAaQAAAABBQAAAAxjdXJyZW50Um91bmQCAAAADl9jb3VudEdhbWVyc1VwCQAAZAAAAAIFAAAAEG51bWJlck9mR2FtZXJzVXAAAAAAAAAAAAEFAAAAA25pbAMJAABmAAAAAgUAAAAIY291bnRCZXQIBQAAAANwbXQAAAAGYW1vdW50CQAAAgAAAAECAAAAI1BheW1lbnQgbXVzdCBiZSBtb3JlIGZvciB0aGUgcm91bmQhCQAAAgAAAAECAAAAFXdvcmtzIHdpdGggd2F2ZXMgb25seQAAAABcsyWP", "chainId": 84, "height": 650080, "spentComplexity": 0 } View: original | compacted Prev: 1j3JjfzFmJEGkgUzCgT7DrsaP5D8f5EjtZ4AjvvZiiP Next: 46ogj69H7LC1d1DmUAz8sX9KrnVWkToDb2rfraTNYPPW Full:
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 3 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let a = 5 | |
5 | 5 | ||
6 | 6 | func b (c) = { | |
7 | 7 | let d = { | |
8 | 8 | let e = getBinary(this, "lastPlay") | |
9 | 9 | if ($isInstanceOf(e, "ByteVector")) | |
10 | 10 | then { | |
11 | 11 | let f = e | |
12 | 12 | f | |
13 | 13 | } | |
14 | 14 | else if ($isInstanceOf(e, "Unit")) | |
15 | 15 | then { | |
16 | 16 | let g = e | |
17 | 17 | base58'2ee4oFDYriWJ9EMeR' | |
18 | 18 | } | |
19 | 19 | else throw() | |
20 | 20 | } | |
21 | 21 | let h = (((((d + c.transactionId) + c.callerPublicKey) + lastBlock.generationSignature) + toBytes(lastBlock.timestamp)) + toBytes(lastBlock.height)) | |
22 | 22 | sha256(h) | |
23 | 23 | } | |
24 | 24 | ||
25 | 25 | ||
26 | 26 | func i (j,k) = { | |
27 | 27 | let l = (j - 1) | |
28 | 28 | if ((k > 500)) | |
29 | 29 | then WriteSet([DataEntry("lastRoundWinner", (toString(l) + "_more_")), DataEntry("numberRound", j), DataEntry("startGame", true), DataEntry("randhash", k)]) | |
30 | 30 | else WriteSet([DataEntry("lastRoundWinner", (toString(l) + "_less_")), DataEntry("numberRound", j), DataEntry("startGame", true), DataEntry("randhash", k)]) | |
31 | 31 | } | |
32 | 32 | ||
33 | 33 | ||
34 | 34 | func m () = { | |
35 | 35 | let e = getInteger(this, "numberRound") | |
36 | 36 | if ($isInstanceOf(e, "Int")) | |
37 | 37 | then { | |
38 | 38 | let g = e | |
39 | 39 | g | |
40 | 40 | } | |
41 | 41 | else 1 | |
42 | 42 | } | |
43 | 43 | ||
44 | 44 | ||
45 | 45 | func n (o,p,q) = if ((p >= 1)) | |
46 | 46 | then { | |
47 | 47 | let r = { | |
48 | 48 | let e = getString(this, "lastRoundWinner") | |
49 | 49 | if ($isInstanceOf(e, "String")) | |
50 | 50 | then { | |
51 | 51 | let s = e | |
52 | 52 | s | |
53 | 53 | } | |
54 | 54 | else "" | |
55 | 55 | } | |
56 | 56 | let t = { | |
57 | 57 | let e = getString(this, (r + q)) | |
58 | 58 | if ($isInstanceOf(e, "String")) | |
59 | 59 | then { | |
60 | 60 | let s = e | |
61 | 61 | s | |
62 | 62 | } | |
63 | 63 | else "" | |
64 | 64 | } | |
65 | 65 | if (if ((p > 1)) | |
66 | 66 | then (t == "") | |
67 | 67 | else false) | |
68 | 68 | then (p * 2) | |
69 | 69 | else 1 | |
70 | 70 | } | |
71 | 71 | else 1 | |
72 | 72 | ||
73 | 73 | ||
74 | 74 | func u () = { | |
75 | 75 | let e = getInteger(this, "numberGame") | |
76 | 76 | if ($isInstanceOf(e, "Int")) | |
77 | 77 | then { | |
78 | 78 | let g = e | |
79 | 79 | (g + 1) | |
80 | 80 | } | |
81 | 81 | else 1 | |
82 | 82 | } | |
83 | 83 | ||
84 | 84 | ||
85 | 85 | @Callable(v) | |
86 | 86 | func startRound () = { | |
87 | 87 | let w = { | |
88 | 88 | let e = getInteger(this, "numberRound") | |
89 | 89 | if ($isInstanceOf(e, "Int")) | |
90 | 90 | then { | |
91 | 91 | let g = e | |
92 | 92 | (g + 1) | |
93 | 93 | } | |
94 | 94 | else 1 | |
95 | 95 | } | |
96 | 96 | let k = b(v) | |
97 | 97 | let x = { | |
98 | 98 | let e = getBoolean(this, "startGame") | |
99 | 99 | if ($isInstanceOf(e, "Boolean")) | |
100 | 100 | then { | |
101 | 101 | let y = e | |
102 | 102 | y | |
103 | 103 | } | |
104 | 104 | else false | |
105 | 105 | } | |
106 | 106 | if (if (if ((w == 1)) | |
107 | 107 | then (v.caller == this) | |
108 | 108 | else false) | |
109 | 109 | then !(x) | |
110 | 110 | else false) | |
111 | 111 | then { | |
112 | 112 | let z = u() | |
113 | 113 | WriteSet([DataEntry("numberGame", z), DataEntry("startGame", !(x)), DataEntry("numberRound", w)]) | |
114 | 114 | } | |
115 | 115 | else if (if ((w > 1)) | |
116 | 116 | then (v.caller == this) | |
117 | 117 | else false) | |
118 | 118 | then i(w, (toInt(k) % 1000)) | |
119 | 119 | else throw("Only owner can start the game.") | |
120 | 120 | } | |
121 | 121 | ||
122 | 122 | ||
123 | 123 | ||
124 | 124 | @Callable(v) | |
125 | 125 | func forwardRound () = { | |
126 | 126 | let x = { | |
127 | 127 | let e = getBoolean(this, "startGame") | |
128 | 128 | if ($isInstanceOf(e, "Boolean")) | |
129 | 129 | then { | |
130 | 130 | let y = e | |
131 | 131 | y | |
132 | 132 | } | |
133 | 133 | else false | |
134 | 134 | } | |
135 | 135 | let w = { | |
136 | 136 | let e = getInteger(this, "numberRound") | |
137 | 137 | if ($isInstanceOf(e, "Int")) | |
138 | 138 | then { | |
139 | 139 | let g = e | |
140 | 140 | g | |
141 | 141 | } | |
142 | 142 | else 1 | |
143 | 143 | } | |
144 | 144 | let A = { | |
145 | 145 | let e = getInteger(this, (toString(w) + "_countGamersUp")) | |
146 | 146 | if ($isInstanceOf(e, "Int")) | |
147 | 147 | then { | |
148 | 148 | let y = e | |
149 | 149 | y | |
150 | 150 | } | |
151 | 151 | else 0 | |
152 | 152 | } | |
153 | 153 | let B = { | |
154 | 154 | let e = getInteger(this, (toString(w) + "_countGamersDown")) | |
155 | 155 | if ($isInstanceOf(e, "Int")) | |
156 | 156 | then { | |
157 | 157 | let y = e | |
158 | 158 | y | |
159 | 159 | } | |
160 | 160 | else 0 | |
161 | 161 | } | |
162 | 162 | if (if (if (if ((A > 0)) | |
163 | 163 | then (v.caller == this) | |
164 | 164 | else false) | |
165 | 165 | then x | |
166 | 166 | else false) | |
167 | 167 | then (B > 0) | |
168 | 168 | else false) | |
169 | 169 | then WriteSet([DataEntry("startGame", !(x))]) | |
170 | 170 | else throw("Only owner can start the game.") | |
171 | 171 | } | |
172 | 172 | ||
173 | 173 | ||
174 | 174 | ||
175 | 175 | @Callable(v) | |
176 | 176 | func makeBetLess () = { | |
177 | 177 | let C = extract(v.payment) | |
178 | 178 | let q = toBase58String(v.caller.bytes) | |
179 | 179 | let D = m() | |
180 | 180 | let E = n(C.amount, D, q) | |
181 | 181 | if (if (!(isDefined(C.assetId))) | |
182 | 182 | then (C.amount >= E) | |
183 | 183 | else false) | |
184 | 184 | then { | |
185 | 185 | let w = { | |
186 | 186 | let e = getInteger(this, "numberRound") | |
187 | 187 | if ($isInstanceOf(e, "Int")) | |
188 | 188 | then { | |
189 | 189 | let g = e | |
190 | 190 | g | |
191 | 191 | } | |
192 | 192 | else 1 | |
193 | 193 | } | |
194 | 194 | let B = { | |
195 | 195 | let e = getInteger(this, (toString(w) + "_countGamersDown")) | |
196 | 196 | if ($isInstanceOf(e, "Int")) | |
197 | 197 | then { | |
198 | 198 | let y = e | |
199 | 199 | y | |
200 | 200 | } | |
201 | 201 | else 0 | |
202 | 202 | } | |
203 | 203 | WriteSet([DataEntry(((toString(D) + "_less_") + q), C.amount), DataEntry((toString(D) + "_countGamersDown"), (B + 1))]) | |
204 | 204 | } | |
205 | 205 | else if ((E > C.amount)) | |
206 | 206 | then throw("Payment must be more for the round!") | |
207 | 207 | else throw("works with waves only") | |
208 | 208 | } | |
209 | 209 | ||
210 | 210 | ||
211 | 211 | ||
212 | 212 | @Callable(v) | |
213 | 213 | func makeBetMore () = { | |
214 | 214 | let C = extract(v.payment) | |
215 | 215 | let q = toBase58String(v.caller.bytes) | |
216 | 216 | let D = m() | |
217 | 217 | let E = n(C.amount, D, q) | |
218 | 218 | if (if (!(isDefined(C.assetId))) | |
219 | 219 | then (C.amount >= E) | |
220 | 220 | else false) | |
221 | 221 | then { | |
222 | 222 | let w = { | |
223 | 223 | let e = getInteger(this, "numberRound") | |
224 | 224 | if ($isInstanceOf(e, "Int")) | |
225 | 225 | then { | |
226 | 226 | let g = e | |
227 | 227 | g | |
228 | 228 | } | |
229 | 229 | else 1 | |
230 | 230 | } | |
231 | 231 | let A = { | |
232 | 232 | let e = getInteger(this, (toString(w) + "_countGamersUp")) | |
233 | 233 | if ($isInstanceOf(e, "Int")) | |
234 | 234 | then { | |
235 | 235 | let y = e | |
236 | 236 | y | |
237 | 237 | } | |
238 | 238 | else 0 | |
239 | 239 | } | |
240 | 240 | WriteSet([DataEntry(((toString(D) + "_more_") + q), C.amount), DataEntry((toString(D) + "_countGamersUp"), (A + 1))]) | |
241 | 241 | } | |
242 | 242 | else if ((E > C.amount)) | |
243 | 243 | then throw("Payment must be more for the round!") | |
244 | 244 | else throw("works with waves only") | |
245 | 245 | } | |
246 | 246 | ||
247 | 247 |
github/deemru/w8io/169f3d6 42.99 ms ◑