tx · GhN8QV1Z67tpAc8Ng12Di2WdpUhPLRf5mMCMLNBhioLq 3Mu7bwtYrymjrXt1ttcqaQbFc1PqGhZndhv: -0.01400000 Waves 2019.10.01 17:50 [700785] smart account 3Mu7bwtYrymjrXt1ttcqaQbFc1PqGhZndhv > SELF 0.00000000 Waves
{ "type": 13, "id": "GhN8QV1Z67tpAc8Ng12Di2WdpUhPLRf5mMCMLNBhioLq", "fee": 1400000, "feeAssetId": null, "timestamp": 1569941416921, "version": 1, "sender": "3Mu7bwtYrymjrXt1ttcqaQbFc1PqGhZndhv", "senderPublicKey": "BxHnTcjvN9ZtnKfdKYp6aKRdkMB4ZHxHnTDr5dWx5Vz2", "proofs": [ "2Zpa4p5NBs94RxELdvM6fQVH4NS7xzMYx5EJv1mQsECmUyhUVucvMZp8ke5yMyZsicmDoDLCMbjFqNujojvDfvWy" ], "script": "base64:AAIDAAAAAAAAAAAAAAADAAAAAAh1VG9rZW5JZAEAAAAgg1ag/CIT1AiojH1skJ2ufidI0Eb3a9g5aB0rTX7UN7gBAAAAC2NoZWNrU3RhdHVzAAAAAQAAAAdhZGRyZXNzBAAAAA9zdGF0dXNVbmxpbWl0ZWQEAAAAByRtYXRjaDAJAAQbAAAAAgUAAAAEdGhpcwkAASwAAAACBQAAAAdhZGRyZXNzAgAAAApfdW5saW1pdGVkAwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAAdCb29sZWFuBAAAAARib29sBQAAAAckbWF0Y2gwBQAAAARib29sAwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAARVbml0BwkBAAAABXRocm93AAAAAAQAAAAKc3RhdHVzVGltZQQAAAAHJG1hdGNoMAkABBoAAAACBQAAAAR0aGlzCQABLAAAAAIFAAAAB2FkZHJlc3MCAAAABV90aW1lAwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAANJbnQEAAAAA2ludAUAAAAHJG1hdGNoMAUAAAADaW50AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAARVbml0AAAAA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EYXRhRW50cnkAAAACAgAAAAZvcmRlcnMFAAAACW5ld09yZGVycwkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgUAAAAHb3JkZXJJZAUAAAAHbmV3RGF0YQUAAAADbmlsCQEAAAALVHJhbnNmZXJTZXQAAAABCQAETAAAAAIJAQAAAA5TY3JpcHRUcmFuc2ZlcgAAAAMIBQAAAAFpAAAABmNhbGxlcgUAAAAMcmV0dXJuQW1vdW50AwkAAAAAAAACBQAAAA9vcmRlclByaWNlQXNzZXQCAAAABVdBVkVTBQAAAAR1bml0CQACWQAAAAEFAAAAD29yZGVyUHJpY2VBc3NldAUAAAADbmlsAAAAALnx/8c=", "chainId": 84, "height": 700785, "spentComplexity": 0 } View: original | compacted Prev: Do9boHeu51KxmWGzdqvKSVHdSNrJ6c1EKyFaKrHexBmN Next: none Diff:
Old | New | Differences | |
---|---|---|---|
32 | 32 | } | |
33 | 33 | ||
34 | 34 | ||
35 | - | @Callable(i) | |
36 | - | func addAsset (j) = { | |
37 | - | let k = (100 * 100000000) | |
38 | - | let l = "100" | |
39 | - | let m = valueOrErrorMessage(i.payment, "Where is payment?") | |
40 | - | if (if (isDefined(m.assetId)) | |
41 | - | then (m.assetId != a) | |
35 | + | func i (j,k) = { | |
36 | + | let l = if ((j == "WAVES")) | |
37 | + | then 8 | |
38 | + | else value(assetInfo(fromBase58String(j))).decimals | |
39 | + | let m = if ((k == "WAVES")) | |
40 | + | then 8 | |
41 | + | else value(assetInfo(fromBase58String(k))).decimals | |
42 | + | (m >= l) | |
43 | + | } | |
44 | + | ||
45 | + | ||
46 | + | @Callable(n) | |
47 | + | func addAsset (o) = { | |
48 | + | let p = (100 * 100000000) | |
49 | + | let q = "100" | |
50 | + | let r = valueOrErrorMessage(n.payment, "Where is payment?") | |
51 | + | if (if (isDefined(r.assetId)) | |
52 | + | then (r.assetId != a) | |
42 | 53 | else false) | |
43 | 54 | then throw("OTCu or WAVES only") | |
44 | - | else if (( | |
45 | - | then throw((("You have to pay " + | |
46 | - | else if (!(isDefined(assetInfo(fromBase58String( | |
55 | + | else if ((r.amount != p)) | |
56 | + | then throw((("You have to pay " + q) + " OTCu or WAVES")) | |
57 | + | else if (!(isDefined(assetInfo(fromBase58String(o))))) | |
47 | 58 | then throw("There is no asset with specified id") | |
48 | 59 | else { | |
49 | - | let | |
60 | + | let s = { | |
50 | 61 | let e = getString(this, "assets") | |
51 | 62 | if ($isInstanceOf(e, "String")) | |
52 | 63 | then { | |
53 | - | let | |
54 | - | | |
64 | + | let t = e | |
65 | + | t | |
55 | 66 | } | |
56 | 67 | else if ($isInstanceOf(e, "Unit")) | |
57 | 68 | then "" | |
58 | 69 | else throw() | |
59 | 70 | } | |
60 | - | if (isDefined(indexOf( | |
71 | + | if (isDefined(indexOf(s, o))) | |
61 | 72 | then throw("Asset is already available") | |
62 | - | else WriteSet([DataEntry("assets", ( | |
73 | + | else WriteSet([DataEntry("assets", (s + o))]) | |
63 | 74 | } | |
64 | 75 | } | |
65 | 76 | ||
66 | 77 | ||
67 | 78 | ||
68 | - | @Callable( | |
69 | - | func pro ( | |
70 | - | let c = toBase58String( | |
71 | - | let | |
72 | - | let | |
73 | - | let | |
74 | - | let | |
75 | - | let | |
76 | - | if (if (isDefined( | |
77 | - | then ( | |
79 | + | @Callable(n) | |
80 | + | func pro (u) = { | |
81 | + | let c = toBase58String(n.caller.bytes) | |
82 | + | let v = (50 * 100000000) | |
83 | + | let w = "50" | |
84 | + | let x = (10 * 100000000) | |
85 | + | let y = "10" | |
86 | + | let r = valueOrErrorMessage(n.payment, "Where is payment?") | |
87 | + | if (if (isDefined(r.assetId)) | |
88 | + | then (r.assetId != a) | |
78 | 89 | else false) | |
79 | 90 | then throw("OTCu or WAVES only") | |
80 | - | else if (if ( | |
81 | - | then ( | |
91 | + | else if (if (u) | |
92 | + | then (r.amount != v) | |
82 | 93 | else false) | |
83 | - | then throw((("You have to pay " + | |
84 | - | else if (if (!( | |
85 | - | then ( | |
94 | + | then throw((("You have to pay " + w) + " OTCu or WAVES")) | |
95 | + | else if (if (!(u)) | |
96 | + | then (r.amount != x) | |
86 | 97 | else false) | |
87 | - | then throw((("You have to pay " + | |
98 | + | then throw((("You have to pay " + y) + " OTCu or WAVES")) | |
88 | 99 | else { | |
89 | - | let | |
100 | + | let z = { | |
90 | 101 | let e = getBoolean(this, (c + "_unlimited")) | |
91 | 102 | if ($isInstanceOf(e, "Boolean")) | |
92 | 103 | then { | |
97 | 108 | then false | |
98 | 109 | else throw() | |
99 | 110 | } | |
100 | - | let | |
111 | + | let A = { | |
101 | 112 | let e = getInteger(this, (c + "_time")) | |
102 | 113 | if ($isInstanceOf(e, "Int")) | |
103 | 114 | then { | |
108 | 119 | then 0 | |
109 | 120 | else throw() | |
110 | 121 | } | |
111 | - | if ( | |
122 | + | if (z) | |
112 | 123 | then throw("You have unlimited PRO status already. What do you want?") | |
113 | 124 | else { | |
114 | - | let | |
115 | - | WriteSet([DataEntry((c + "_unlimited"), | |
125 | + | let B = 2629743000 | |
126 | + | WriteSet([DataEntry((c + "_unlimited"), u), DataEntry((c + "_time"), if (u) | |
116 | 127 | then 0 | |
117 | - | else ( | |
128 | + | else (A + B))]) | |
118 | 129 | } | |
119 | 130 | } | |
120 | 131 | } | |
121 | 132 | ||
122 | 133 | ||
123 | 134 | ||
124 | - | @Callable( | |
125 | - | func makeSell ( | |
126 | - | then !(isDefined(assetInfo(fromBase58String( | |
135 | + | @Callable(n) | |
136 | + | func makeSell (k,C,D,E) = if (if ((k != "WAVES")) | |
137 | + | then !(isDefined(assetInfo(fromBase58String(k)))) | |
127 | 138 | else false) | |
128 | 139 | then throw("There is no asset with specified id") | |
129 | - | else if ((0 >= | |
130 | - | then throw("price must be positive") | |
140 | + | else if ((0 >= C)) | |
141 | + | then throw("Amount of price asset must be positive") | |
131 | 142 | else { | |
132 | - | let | |
133 | - | if ((0 >= | |
134 | - | then throw(" | |
143 | + | let r = valueOrErrorMessage(n.payment, "Where is payment?") | |
144 | + | if ((0 >= r.amount)) | |
145 | + | then throw("Amount must be positive") | |
135 | 146 | else { | |
136 | - | let | |
137 | - | let e = | |
147 | + | let j = { | |
148 | + | let e = r.assetId | |
138 | 149 | if ($isInstanceOf(e, "ByteVector")) | |
139 | 150 | then { | |
140 | - | let | |
141 | - | toBase58String( | |
151 | + | let F = e | |
152 | + | toBase58String(F) | |
142 | 153 | } | |
143 | 154 | else "WAVES" | |
144 | 155 | } | |
145 | - | let | |
146 | - | if (if (!(isDefined(indexOf( | |
156 | + | let s = valueOrErrorMessage(getString(this, "assets"), "There are not available assets") | |
157 | + | if (if (!(isDefined(indexOf(s, k)))) | |
147 | 158 | then true | |
148 | - | else !(isDefined(indexOf( | |
159 | + | else !(isDefined(indexOf(s, j)))) | |
149 | 160 | then throw("Asset are not available for trading") | |
150 | 161 | else { | |
151 | - | let c = toBase58String( | |
162 | + | let c = toBase58String(n.caller.bytes) | |
152 | 163 | if (if (!(b(c))) | |
153 | - | then if ( | |
164 | + | then if (D) | |
154 | 165 | then true | |
155 | - | else ( | |
166 | + | else (E != "") | |
156 | 167 | else false) | |
157 | 168 | then throw("You must have pro status to use these features") | |
158 | 169 | else { | |
159 | - | let | |
160 | - | let | |
170 | + | let G = toBase58String(n.transactionId) | |
171 | + | let H = { | |
161 | 172 | let e = getString(this, "orders") | |
162 | 173 | if ($isInstanceOf(e, "String")) | |
163 | 174 | then { | |
164 | - | let | |
165 | - | | |
175 | + | let I = e | |
176 | + | I | |
166 | 177 | } | |
167 | 178 | else if ($isInstanceOf(e, "Unit")) | |
168 | 179 | then "" | |
169 | 180 | else throw() | |
170 | 181 | } | |
171 | - | let | |
172 | - | let | |
173 | - | WriteSet([DataEntry("orders", ( | |
182 | + | let J = fromBase58String(E) | |
183 | + | let K = (((((((((((((((("sell" + "_") + toString(r.amount)) + "_") + j) + "_") + toString(C)) + "_") + k) + "_") + c) + "_") + toString(D)) + "_") + E) + "_") + toString(0)) | |
184 | + | WriteSet([DataEntry("orders", (H + G)), DataEntry(G, K)]) | |
174 | 185 | } | |
175 | 186 | } | |
176 | 187 | } | |
178 | 189 | ||
179 | 190 | ||
180 | 191 | ||
181 | - | @Callable( | |
182 | - | func makeBuy ( | |
183 | - | then !(isDefined(assetInfo(fromBase58String( | |
192 | + | @Callable(n) | |
193 | + | func makeBuy (j,L,D,E) = if (if ((j != "WAVES")) | |
194 | + | then !(isDefined(assetInfo(fromBase58String(j)))) | |
184 | 195 | else false) | |
185 | 196 | then throw("There is no asset with specified id") | |
186 | - | else if ((0 >= | |
187 | - | then throw(" | |
197 | + | else if ((0 >= L)) | |
198 | + | then throw("Amount must be positive") | |
188 | 199 | else { | |
189 | - | let m = valueOrErrorMessage(i.payment, "where is payment?") | |
190 | - | if ((0 >= m.amount)) | |
200 | + | let r = valueOrErrorMessage(n.payment, "where is payment?") | |
201 | + | let C = r.amount | |
202 | + | if ((0 >= C)) | |
191 | 203 | then throw("amount must be positive") | |
192 | 204 | else { | |
193 | - | let | |
194 | - | let e = | |
205 | + | let k = { | |
206 | + | let e = r.assetId | |
195 | 207 | if ($isInstanceOf(e, "ByteVector")) | |
196 | 208 | then { | |
197 | - | let | |
198 | - | toBase58String( | |
209 | + | let F = e | |
210 | + | toBase58String(F) | |
199 | 211 | } | |
200 | 212 | else "WAVES" | |
201 | 213 | } | |
202 | - | let | |
203 | - | if (if (!(isDefined(indexOf( | |
214 | + | let s = valueOrErrorMessage(getString(this, "assets"), "There are not available assets") | |
215 | + | if (if (!(isDefined(indexOf(s, k)))) | |
204 | 216 | then true | |
205 | - | else !(isDefined(indexOf( | |
217 | + | else !(isDefined(indexOf(s, j)))) | |
206 | 218 | then throw("Asset are not available for trading") | |
207 | 219 | else { | |
208 | - | let c = toBase58String( | |
220 | + | let c = toBase58String(n.caller.bytes) | |
209 | 221 | if (if (!(b(c))) | |
210 | - | then if ( | |
222 | + | then if (D) | |
211 | 223 | then true | |
212 | - | else ( | |
224 | + | else (E != "") | |
213 | 225 | else false) | |
214 | 226 | then throw("You must have pro status to use these features") | |
215 | 227 | else { | |
216 | - | let | |
217 | - | let | |
228 | + | let G = toBase58String(n.transactionId) | |
229 | + | let H = { | |
218 | 230 | let e = getString(this, "orders") | |
219 | 231 | if ($isInstanceOf(e, "String")) | |
220 | 232 | then { | |
221 | - | let | |
222 | - | | |
233 | + | let I = e | |
234 | + | I | |
223 | 235 | } | |
224 | 236 | else if ($isInstanceOf(e, "Unit")) | |
225 | 237 | then "" | |
226 | 238 | else throw() | |
227 | 239 | } | |
228 | - | let I = if ((B == "WAVES")) | |
229 | - | then 8 | |
230 | - | else value(assetInfo(fromBase58String(B))).decimals | |
231 | - | let J = ((m.amount * pow(10, 0, I, 0, 0, CEILING)) / y) | |
232 | - | if ((J == 0)) | |
240 | + | if ((L == 0)) | |
233 | 241 | then throw("invalid buy amount") | |
234 | 242 | else { | |
235 | - | let | |
236 | - | WriteSet([DataEntry("orders", ( | |
243 | + | let K = (((((((((((((((("buy" + "_") + toString(L)) + "_") + j) + "_") + toString(C)) + "_") + k) + "_") + c) + "_") + toString(D)) + "_") + E) + "_") + toString(0)) | |
244 | + | WriteSet([DataEntry("orders", (H + G)), DataEntry(("buy_" + G), K)]) | |
237 | 245 | } | |
238 | 246 | } | |
239 | 247 | } | |
242 | 250 | ||
243 | 251 | ||
244 | 252 | ||
245 | - | @Callable(i) | |
246 | - | func takeSell (D,K) = { | |
247 | - | let m = valueOrErrorMessage(i.payment, "where is payment?") | |
248 | - | if ((0 >= m.amount)) | |
249 | - | then throw("amount must be positive") | |
253 | + | @Callable(n) | |
254 | + | func takeSell (G,M) = { | |
255 | + | let r = valueOrErrorMessage(n.payment, "Where is payment?") | |
256 | + | let C = r.amount | |
257 | + | if ((0 >= C)) | |
258 | + | then throw("Amount must be positive") | |
250 | 259 | else { | |
251 | - | let | |
252 | - | let e = | |
260 | + | let k = { | |
261 | + | let e = r.assetId | |
253 | 262 | if ($isInstanceOf(e, "ByteVector")) | |
254 | 263 | then { | |
255 | - | let | |
256 | - | toBase58String( | |
264 | + | let F = e | |
265 | + | toBase58String(F) | |
257 | 266 | } | |
258 | 267 | else "WAVES" | |
259 | 268 | } | |
260 | - | let H = valueOrErrorMessage(getString(this, D), "Invalid order id") | |
261 | - | let M = parseIntValue(split(H, "_")[0]) | |
262 | - | let B = split(H, "_")[1] | |
263 | - | let y = parseIntValue(split(H, "_")[2]) | |
264 | - | let x = split(H, "_")[3] | |
265 | - | let N = value(addressFromString(split(H, "_")[4])) | |
266 | - | let z = if ((split(H, "_")[5] == "true")) | |
269 | + | let K = valueOrErrorMessage(getString(this, G), "Invalid order id") | |
270 | + | let N = split(K, "_")[0] | |
271 | + | let O = parseIntValue(split(K, "_")[1]) | |
272 | + | let P = split(K, "_")[2] | |
273 | + | let Q = parseIntValue(split(K, "_")[3]) | |
274 | + | let R = split(K, "_")[4] | |
275 | + | let S = value(addressFromString(split(K, "_")[5])) | |
276 | + | let T = if ((split(K, "_")[6] == "true")) | |
267 | 277 | then true | |
268 | 278 | else false | |
269 | - | let A = split(H, "_")[6] | |
270 | - | let O = parseIntValue(split(H, "_")[7]) | |
271 | - | if ((x != L)) | |
272 | - | then throw(("Payment asset must be " + x)) | |
273 | - | else { | |
274 | - | let P = if ((A != "")) | |
275 | - | then sigVerify(i.callerPublicKey, fromBase58String(K), fromBase58String(A)) | |
276 | - | else true | |
277 | - | if (!(P)) | |
278 | - | then throw("The order is private") | |
279 | - | else { | |
280 | - | let I = if ((B == "WAVES")) | |
281 | - | then 8 | |
282 | - | else value(assetInfo(fromBase58String(B))).decimals | |
283 | - | let J = ((m.amount * pow(10, 0, I, 0, 0, CEILING)) / y) | |
284 | - | if ((J == 0)) | |
285 | - | then throw("Invalid amount") | |
286 | - | else if (if (z) | |
287 | - | then (M > J) | |
288 | - | else false) | |
289 | - | then throw("You must take all or none") | |
290 | - | else if ((J > (M - O))) | |
291 | - | then throw("Not enougth asset in order") | |
292 | - | else { | |
293 | - | let E = { | |
294 | - | let e = getString(this, "orders") | |
295 | - | if ($isInstanceOf(e, "String")) | |
296 | - | then { | |
297 | - | let F = e | |
298 | - | F | |
299 | - | } | |
300 | - | else if ($isInstanceOf(e, "Unit")) | |
301 | - | then "" | |
302 | - | else throw() | |
279 | + | let U = split(K, "_")[7] | |
280 | + | let V = parseIntValue(split(K, "_")[8]) | |
281 | + | if ((N != "sell")) | |
282 | + | then throw("Invalid order type") | |
283 | + | else if ((R != k)) | |
284 | + | then throw(("Payment asset must be " + R)) | |
285 | + | else { | |
286 | + | let W = if ((U != "")) | |
287 | + | then sigVerify(n.callerPublicKey, fromBase58String(M), fromBase58String(U)) | |
288 | + | else true | |
289 | + | if (!(W)) | |
290 | + | then throw("The order is private") | |
291 | + | else { | |
292 | + | let L = ((C * O) / Q) | |
293 | + | if ((L == 0)) | |
294 | + | then throw("Invalid amount") | |
295 | + | else if (if (T) | |
296 | + | then (O > L) | |
297 | + | else false) | |
298 | + | then throw("You must take all or none") | |
299 | + | else if ((L > (O - V))) | |
300 | + | then throw("Not enougth asset in order") | |
301 | + | else { | |
302 | + | let H = { | |
303 | + | let e = getString(this, "orders") | |
304 | + | if ($isInstanceOf(e, "String")) | |
305 | + | then { | |
306 | + | let I = e | |
307 | + | I | |
308 | + | } | |
309 | + | else if ($isInstanceOf(e, "Unit")) | |
310 | + | then "" | |
311 | + | else throw() | |
312 | + | } | |
313 | + | let X = (dropRight(K, size(split(K, "_")[7])) + toString((V + L))) | |
314 | + | let Y = value(indexOf(H, G)) | |
315 | + | let Z = if ((O == (L + V))) | |
316 | + | then (take(H, Y) + drop(H, (Y + size(G)))) | |
317 | + | else H | |
318 | + | ScriptResult(WriteSet([DataEntry("orders", Z), DataEntry(G, X)]), TransferSet([ScriptTransfer(n.caller, L, if ((P == "WAVES")) | |
319 | + | then unit | |
320 | + | else fromBase58String(P)), ScriptTransfer(S, C, if ((R == "WAVES")) | |
321 | + | then unit | |
322 | + | else fromBase58String(R))])) | |
303 | 323 | } | |
304 | - | let Q = (dropRight(H, size(split(H, "_")[7])) + toString((O + J))) | |
305 | - | let R = value(indexOf(E, D)) | |
306 | - | let S = if ((M == (J + O))) | |
307 | - | then (take(E, R) + drop(E, (R + size(D)))) | |
308 | - | else E | |
309 | - | ScriptResult(WriteSet([DataEntry("orders", S), DataEntry(D, Q)]), TransferSet([ScriptTransfer(i.caller, J, if ((B == "WAVES")) | |
310 | - | then unit | |
311 | - | else fromBase58String(B)), ScriptTransfer(N, m.amount, if ((x == "WAVES")) | |
312 | - | then unit | |
313 | - | else fromBase58String(x))])) | |
314 | - | } | |
315 | - | } | |
316 | - | } | |
324 | + | } | |
325 | + | } | |
317 | 326 | } | |
318 | 327 | } | |
319 | 328 | ||
320 | 329 | ||
321 | 330 | ||
322 | - | @Callable(i) | |
323 | - | func takeBuy (D,K) = { | |
324 | - | let m = valueOrErrorMessage(i.payment, "where is payment?") | |
325 | - | if ((0 >= m.amount)) | |
331 | + | @Callable(n) | |
332 | + | func takeBuy (G,M) = { | |
333 | + | let r = valueOrErrorMessage(n.payment, "where is payment?") | |
334 | + | let L = r.amount | |
335 | + | if ((0 >= L)) | |
326 | 336 | then throw("amount must be positive") | |
327 | 337 | else { | |
328 | - | let | |
329 | - | let e = | |
338 | + | let j = { | |
339 | + | let e = r.assetId | |
330 | 340 | if ($isInstanceOf(e, "ByteVector")) | |
331 | 341 | then { | |
332 | - | let | |
333 | - | toBase58String( | |
342 | + | let F = e | |
343 | + | toBase58String(F) | |
334 | 344 | } | |
335 | 345 | else "WAVES" | |
336 | 346 | } | |
337 | - | let H = valueOrErrorMessage(getString(this, D), "Invalid order id") | |
338 | - | let M = parseIntValue(split(H, "_")[0]) | |
339 | - | let B = split(H, "_")[1] | |
340 | - | let y = parseIntValue(split(H, "_")[2]) | |
341 | - | let x = split(H, "_")[3] | |
342 | - | let N = value(addressFromString(split(H, "_")[4])) | |
343 | - | let z = if ((split(H, "_")[5] == "true")) | |
347 | + | let K = valueOrErrorMessage(getString(this, G), "Invalid order id") | |
348 | + | let N = split(K, "_")[0] | |
349 | + | let O = parseIntValue(split(K, "_")[1]) | |
350 | + | let P = split(K, "_")[2] | |
351 | + | let Q = parseIntValue(split(K, "_")[3]) | |
352 | + | let R = split(K, "_")[4] | |
353 | + | let S = value(addressFromString(split(K, "_")[5])) | |
354 | + | let T = if ((split(K, "_")[6] == "true")) | |
344 | 355 | then true | |
345 | 356 | else false | |
346 | - | let A = split(H, "_")[6] | |
347 | - | let O = parseIntValue(split(H, "_")[7]) | |
348 | - | if ((B != L)) | |
349 | - | then throw(("payment asset must be " + B)) | |
350 | - | else { | |
351 | - | let P = if ((A != "")) | |
352 | - | then sigVerify(i.callerPublicKey, fromBase58String(K), fromBase58String(A)) | |
353 | - | else true | |
354 | - | if (!(P)) | |
355 | - | then throw("The order is private") | |
356 | - | else { | |
357 | - | let I = if ((B == "WAVES")) | |
358 | - | then 8 | |
359 | - | else value(assetInfo(fromBase58String(B))).decimals | |
360 | - | let T = ((m.amount * y) / pow(10, 0, I, 0, 0, CEILING)) | |
361 | - | if ((T == 0)) | |
362 | - | then throw("invalid amount") | |
363 | - | else if (if (z) | |
364 | - | then (M > T) | |
365 | - | else false) | |
366 | - | then throw("You must take all or none") | |
367 | - | else if ((m.amount > (M - O))) | |
368 | - | then throw("not enougth asset in order") | |
369 | - | else { | |
370 | - | let E = { | |
371 | - | let e = getString(this, "orders") | |
372 | - | if ($isInstanceOf(e, "String")) | |
373 | - | then { | |
374 | - | let F = e | |
375 | - | F | |
376 | - | } | |
377 | - | else if ($isInstanceOf(e, "Unit")) | |
378 | - | then "" | |
379 | - | else throw() | |
357 | + | let U = split(K, "_")[7] | |
358 | + | let V = parseIntValue(split(K, "_")[8]) | |
359 | + | if ((N != "buy")) | |
360 | + | then throw("Invalid order type") | |
361 | + | else if ((P != j)) | |
362 | + | then throw(("payment asset must be " + P)) | |
363 | + | else { | |
364 | + | let W = if ((U != "")) | |
365 | + | then sigVerify(n.callerPublicKey, fromBase58String(M), fromBase58String(U)) | |
366 | + | else true | |
367 | + | if (!(W)) | |
368 | + | then throw("The order is private") | |
369 | + | else { | |
370 | + | let C = ((L * Q) / O) | |
371 | + | if ((C == 0)) | |
372 | + | then throw("Invalid amount") | |
373 | + | else if (if (T) | |
374 | + | then (Q > C) | |
375 | + | else false) | |
376 | + | then throw("You must take all or none") | |
377 | + | else if ((C > (Q - V))) | |
378 | + | then throw("not enougth asset in order") | |
379 | + | else { | |
380 | + | let H = { | |
381 | + | let e = getString(this, "orders") | |
382 | + | if ($isInstanceOf(e, "String")) | |
383 | + | then { | |
384 | + | let I = e | |
385 | + | I | |
386 | + | } | |
387 | + | else if ($isInstanceOf(e, "Unit")) | |
388 | + | then "" | |
389 | + | else throw() | |
390 | + | } | |
391 | + | let X = (dropRight(K, size(split(K, "_")[7])) + toString((V + C))) | |
392 | + | let Y = value(indexOf(H, G)) | |
393 | + | let Z = if ((Q == (C + V))) | |
394 | + | then (take(H, Y) + drop(H, (Y + size(G)))) | |
395 | + | else H | |
396 | + | ScriptResult(WriteSet([DataEntry("orders", Z), DataEntry(G, X)]), TransferSet([ScriptTransfer(n.caller, C, if ((R == "WAVES")) | |
397 | + | then unit | |
398 | + | else fromBase58String(R)), ScriptTransfer(S, L, if ((P == "WAVES")) | |
399 | + | then unit | |
400 | + | else fromBase58String(P))])) | |
380 | 401 | } | |
381 | - | let Q = (dropRight(H, size(split(H, "_")[7])) + toString((O + m.amount))) | |
382 | - | let R = value(indexOf(E, D)) | |
383 | - | let S = if ((M == (m.amount + O))) | |
384 | - | then (take(E, R) + drop(E, (R + size(D)))) | |
385 | - | else E | |
386 | - | ScriptResult(WriteSet([DataEntry("orders", S), DataEntry(D, Q)]), TransferSet([ScriptTransfer(i.caller, T, if ((x == "WAVES")) | |
387 | - | then unit | |
388 | - | else fromBase58String(x)), ScriptTransfer(N, m.amount, if ((B == "WAVES")) | |
389 | - | then unit | |
390 | - | else fromBase58String(B))])) | |
391 | - | } | |
392 | - | } | |
393 | - | } | |
402 | + | } | |
403 | + | } | |
394 | 404 | } | |
395 | 405 | } | |
396 | 406 | ||
397 | 407 | ||
398 | 408 | ||
399 | - | @Callable(i) | |
400 | - | func returnBuy (D) = { | |
401 | - | let H = valueOrErrorMessage(getString(this, D), "Invalid order id") | |
402 | - | let M = parseIntValue(split(H, "_")[0]) | |
403 | - | let B = split(H, "_")[1] | |
404 | - | let y = parseIntValue(split(H, "_")[2]) | |
405 | - | let x = split(H, "_")[3] | |
406 | - | let N = value(addressFromString(split(H, "_")[4])) | |
407 | - | let z = if ((split(H, "_")[5] == "true")) | |
409 | + | @Callable(n) | |
410 | + | func returnSell (G) = { | |
411 | + | let K = valueOrErrorMessage(getString(this, ("sell_" + G)), "Invalid order id") | |
412 | + | let N = split(K, "_")[0] | |
413 | + | let O = parseIntValue(split(K, "_")[1]) | |
414 | + | let P = split(K, "_")[2] | |
415 | + | let Q = parseIntValue(split(K, "_")[3]) | |
416 | + | let R = split(K, "_")[4] | |
417 | + | let S = value(addressFromString(split(K, "_")[5])) | |
418 | + | let T = if ((split(K, "_")[6] == "true")) | |
408 | 419 | then true | |
409 | 420 | else false | |
410 | - | let A = split(H, "_")[6] | |
411 | - | let O = parseIntValue(split(H, "_")[7]) | |
412 | - | if ((N != i.caller)) | |
413 | - | then throw("Return should be called by order owner") | |
414 | - | else { | |
415 | - | let I = if ((B == "WAVES")) | |
416 | - | then 8 | |
417 | - | else value(assetInfo(fromBase58String(B))).decimals | |
418 | - | let U = (((M - O) * y) / pow(10, 0, I, 0, 0, CEILING)) | |
419 | - | if ((0 >= U)) | |
420 | - | then throw("nothing to return") | |
421 | - | else { | |
422 | - | let E = { | |
423 | - | let e = getString(this, "orders") | |
424 | - | if ($isInstanceOf(e, "String")) | |
425 | - | then { | |
426 | - | let F = e | |
427 | - | F | |
428 | - | } | |
429 | - | else if ($isInstanceOf(e, "Unit")) | |
430 | - | then "" | |
431 | - | else throw() | |
421 | + | let U = split(K, "_")[7] | |
422 | + | let V = parseIntValue(split(K, "_")[8]) | |
423 | + | if ((N != "sell")) | |
424 | + | then throw("Invalid order type") | |
425 | + | else if ((S != n.caller)) | |
426 | + | then throw("return should be called by order owner") | |
427 | + | else { | |
428 | + | let aa = (O - V) | |
429 | + | if ((0 >= aa)) | |
430 | + | then throw("nothing to return") | |
431 | + | else { | |
432 | + | let H = { | |
433 | + | let e = getString(this, "orders") | |
434 | + | if ($isInstanceOf(e, "String")) | |
435 | + | then { | |
436 | + | let I = e | |
437 | + | I | |
438 | + | } | |
439 | + | else if ($isInstanceOf(e, "Unit")) | |
440 | + | then "" | |
441 | + | else throw() | |
442 | + | } | |
443 | + | let X = (dropRight(K, size(split(K, "_")[7])) + toString(O)) | |
444 | + | let Y = value(indexOf(H, G)) | |
445 | + | let Z = (take(H, Y) + drop(H, (Y + size(G)))) | |
446 | + | ScriptResult(WriteSet([DataEntry("orders", Z), DataEntry(G, X)]), TransferSet([ScriptTransfer(n.caller, aa, if ((P == "WAVES")) | |
447 | + | then unit | |
448 | + | else fromBase58String(P))])) | |
432 | 449 | } | |
433 | - | let Q = (dropRight(H, size(split(H, "_")[7])) + toString(M)) | |
434 | - | let R = value(indexOf(E, D)) | |
435 | - | let S = (take(E, R) + drop(E, (R + size(D)))) | |
436 | - | ScriptResult(WriteSet([DataEntry("orders", S), DataEntry(D, Q)]), TransferSet([ScriptTransfer(i.caller, U, if ((x == "WAVES")) | |
437 | - | then unit | |
438 | - | else fromBase58String(x))])) | |
439 | - | } | |
440 | - | } | |
450 | + | } | |
441 | 451 | } | |
442 | 452 | ||
443 | 453 | ||
444 | 454 | ||
445 | - | @Callable(i) | |
446 | - | func returnSell (D) = { | |
447 | - | let H = valueOrErrorMessage(getString(this, D), "Invalid order id") | |
448 | - | let M = parseIntValue(split(H, "_")[0]) | |
449 | - | let B = split(H, "_")[1] | |
450 | - | let y = parseIntValue(split(H, "_")[2]) | |
451 | - | let x = split(H, "_")[3] | |
452 | - | let N = value(addressFromString(split(H, "_")[4])) | |
453 | - | let z = if ((split(H, "_")[5] == "true")) | |
455 | + | @Callable(n) | |
456 | + | func returnBuy (G) = { | |
457 | + | let K = valueOrErrorMessage(getString(this, G), "Invalid order id") | |
458 | + | let N = split(K, "_")[0] | |
459 | + | let O = parseIntValue(split(K, "_")[1]) | |
460 | + | let P = split(K, "_")[2] | |
461 | + | let Q = parseIntValue(split(K, "_")[3]) | |
462 | + | let R = split(K, "_")[4] | |
463 | + | let S = value(addressFromString(split(K, "_")[5])) | |
464 | + | let T = if ((split(K, "_")[6] == "true")) | |
454 | 465 | then true | |
455 | 466 | else false | |
456 | - | let A = split(H, "_")[6] | |
457 | - | let O = parseIntValue(split(H, "_")[7]) | |
458 | - | if ((N != i.caller)) | |
459 | - | then throw("return should be called by order owner") | |
460 | - | else { | |
461 | - | let U = (M - O) | |
462 | - | if ((0 >= U)) | |
463 | - | then throw("nothing to return") | |
464 | - | else { | |
465 | - | let E = { | |
466 | - | let e = getString(this, "orders") | |
467 | - | if ($isInstanceOf(e, "String")) | |
468 | - | then { | |
469 | - | let F = e | |
470 | - | F | |
471 | - | } | |
472 | - | else if ($isInstanceOf(e, "Unit")) | |
473 | - | then "" | |
474 | - | else throw() | |
467 | + | let U = split(K, "_")[7] | |
468 | + | let V = parseIntValue(split(K, "_")[8]) | |
469 | + | if ((N != "buy")) | |
470 | + | then throw("Invalid order type") | |
471 | + | else if ((S != n.caller)) | |
472 | + | then throw("Return should be called by order owner") | |
473 | + | else { | |
474 | + | let aa = (Q - V) | |
475 | + | if ((0 >= aa)) | |
476 | + | then throw("nothing to return") | |
477 | + | else { | |
478 | + | let H = { | |
479 | + | let e = getString(this, "orders") | |
480 | + | if ($isInstanceOf(e, "String")) | |
481 | + | then { | |
482 | + | let I = e | |
483 | + | I | |
484 | + | } | |
485 | + | else if ($isInstanceOf(e, "Unit")) | |
486 | + | then "" | |
487 | + | else throw() | |
488 | + | } | |
489 | + | let X = (dropRight(K, size(split(K, "_")[7])) + toString(Q)) | |
490 | + | let Y = value(indexOf(H, G)) | |
491 | + | let Z = (take(H, Y) + drop(H, (Y + size(G)))) | |
492 | + | ScriptResult(WriteSet([DataEntry("orders", Z), DataEntry(G, X)]), TransferSet([ScriptTransfer(n.caller, aa, if ((R == "WAVES")) | |
493 | + | then unit | |
494 | + | else fromBase58String(R))])) | |
475 | 495 | } | |
476 | - | let Q = (dropRight(H, size(split(H, "_")[7])) + toString(M)) | |
477 | - | let R = value(indexOf(E, D)) | |
478 | - | let S = (take(E, R) + drop(E, (R + size(D)))) | |
479 | - | ScriptResult(WriteSet([DataEntry("orders", S), DataEntry(D, Q)]), TransferSet([ScriptTransfer(i.caller, U, if ((B == "WAVES")) | |
480 | - | then unit | |
481 | - | else fromBase58String(B))])) | |
482 | - | } | |
483 | - | } | |
496 | + | } | |
484 | 497 | } | |
485 | 498 | ||
486 | 499 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 3 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let a = base58'9qh2MiJhfqNS1o3R5wcUrAAWpeqZs9R8SLwQvCx88Vaf' | |
5 | 5 | ||
6 | 6 | func b (c) = { | |
7 | 7 | let d = { | |
8 | 8 | let e = getBoolean(this, (c + "_unlimited")) | |
9 | 9 | if ($isInstanceOf(e, "Boolean")) | |
10 | 10 | then { | |
11 | 11 | let f = e | |
12 | 12 | f | |
13 | 13 | } | |
14 | 14 | else if ($isInstanceOf(e, "Unit")) | |
15 | 15 | then false | |
16 | 16 | else throw() | |
17 | 17 | } | |
18 | 18 | let g = { | |
19 | 19 | let e = getInteger(this, (c + "_time")) | |
20 | 20 | if ($isInstanceOf(e, "Int")) | |
21 | 21 | then { | |
22 | 22 | let h = e | |
23 | 23 | h | |
24 | 24 | } | |
25 | 25 | else if ($isInstanceOf(e, "Unit")) | |
26 | 26 | then 0 | |
27 | 27 | else throw() | |
28 | 28 | } | |
29 | 29 | if (d) | |
30 | 30 | then true | |
31 | 31 | else (g > lastBlock.timestamp) | |
32 | 32 | } | |
33 | 33 | ||
34 | 34 | ||
35 | - | @Callable(i) | |
36 | - | func addAsset (j) = { | |
37 | - | let k = (100 * 100000000) | |
38 | - | let l = "100" | |
39 | - | let m = valueOrErrorMessage(i.payment, "Where is payment?") | |
40 | - | if (if (isDefined(m.assetId)) | |
41 | - | then (m.assetId != a) | |
35 | + | func i (j,k) = { | |
36 | + | let l = if ((j == "WAVES")) | |
37 | + | then 8 | |
38 | + | else value(assetInfo(fromBase58String(j))).decimals | |
39 | + | let m = if ((k == "WAVES")) | |
40 | + | then 8 | |
41 | + | else value(assetInfo(fromBase58String(k))).decimals | |
42 | + | (m >= l) | |
43 | + | } | |
44 | + | ||
45 | + | ||
46 | + | @Callable(n) | |
47 | + | func addAsset (o) = { | |
48 | + | let p = (100 * 100000000) | |
49 | + | let q = "100" | |
50 | + | let r = valueOrErrorMessage(n.payment, "Where is payment?") | |
51 | + | if (if (isDefined(r.assetId)) | |
52 | + | then (r.assetId != a) | |
42 | 53 | else false) | |
43 | 54 | then throw("OTCu or WAVES only") | |
44 | - | else if (( | |
45 | - | then throw((("You have to pay " + | |
46 | - | else if (!(isDefined(assetInfo(fromBase58String( | |
55 | + | else if ((r.amount != p)) | |
56 | + | then throw((("You have to pay " + q) + " OTCu or WAVES")) | |
57 | + | else if (!(isDefined(assetInfo(fromBase58String(o))))) | |
47 | 58 | then throw("There is no asset with specified id") | |
48 | 59 | else { | |
49 | - | let | |
60 | + | let s = { | |
50 | 61 | let e = getString(this, "assets") | |
51 | 62 | if ($isInstanceOf(e, "String")) | |
52 | 63 | then { | |
53 | - | let | |
54 | - | | |
64 | + | let t = e | |
65 | + | t | |
55 | 66 | } | |
56 | 67 | else if ($isInstanceOf(e, "Unit")) | |
57 | 68 | then "" | |
58 | 69 | else throw() | |
59 | 70 | } | |
60 | - | if (isDefined(indexOf( | |
71 | + | if (isDefined(indexOf(s, o))) | |
61 | 72 | then throw("Asset is already available") | |
62 | - | else WriteSet([DataEntry("assets", ( | |
73 | + | else WriteSet([DataEntry("assets", (s + o))]) | |
63 | 74 | } | |
64 | 75 | } | |
65 | 76 | ||
66 | 77 | ||
67 | 78 | ||
68 | - | @Callable( | |
69 | - | func pro ( | |
70 | - | let c = toBase58String( | |
71 | - | let | |
72 | - | let | |
73 | - | let | |
74 | - | let | |
75 | - | let | |
76 | - | if (if (isDefined( | |
77 | - | then ( | |
79 | + | @Callable(n) | |
80 | + | func pro (u) = { | |
81 | + | let c = toBase58String(n.caller.bytes) | |
82 | + | let v = (50 * 100000000) | |
83 | + | let w = "50" | |
84 | + | let x = (10 * 100000000) | |
85 | + | let y = "10" | |
86 | + | let r = valueOrErrorMessage(n.payment, "Where is payment?") | |
87 | + | if (if (isDefined(r.assetId)) | |
88 | + | then (r.assetId != a) | |
78 | 89 | else false) | |
79 | 90 | then throw("OTCu or WAVES only") | |
80 | - | else if (if ( | |
81 | - | then ( | |
91 | + | else if (if (u) | |
92 | + | then (r.amount != v) | |
82 | 93 | else false) | |
83 | - | then throw((("You have to pay " + | |
84 | - | else if (if (!( | |
85 | - | then ( | |
94 | + | then throw((("You have to pay " + w) + " OTCu or WAVES")) | |
95 | + | else if (if (!(u)) | |
96 | + | then (r.amount != x) | |
86 | 97 | else false) | |
87 | - | then throw((("You have to pay " + | |
98 | + | then throw((("You have to pay " + y) + " OTCu or WAVES")) | |
88 | 99 | else { | |
89 | - | let | |
100 | + | let z = { | |
90 | 101 | let e = getBoolean(this, (c + "_unlimited")) | |
91 | 102 | if ($isInstanceOf(e, "Boolean")) | |
92 | 103 | then { | |
93 | 104 | let f = e | |
94 | 105 | f | |
95 | 106 | } | |
96 | 107 | else if ($isInstanceOf(e, "Unit")) | |
97 | 108 | then false | |
98 | 109 | else throw() | |
99 | 110 | } | |
100 | - | let | |
111 | + | let A = { | |
101 | 112 | let e = getInteger(this, (c + "_time")) | |
102 | 113 | if ($isInstanceOf(e, "Int")) | |
103 | 114 | then { | |
104 | 115 | let h = e | |
105 | 116 | h | |
106 | 117 | } | |
107 | 118 | else if ($isInstanceOf(e, "Unit")) | |
108 | 119 | then 0 | |
109 | 120 | else throw() | |
110 | 121 | } | |
111 | - | if ( | |
122 | + | if (z) | |
112 | 123 | then throw("You have unlimited PRO status already. What do you want?") | |
113 | 124 | else { | |
114 | - | let | |
115 | - | WriteSet([DataEntry((c + "_unlimited"), | |
125 | + | let B = 2629743000 | |
126 | + | WriteSet([DataEntry((c + "_unlimited"), u), DataEntry((c + "_time"), if (u) | |
116 | 127 | then 0 | |
117 | - | else ( | |
128 | + | else (A + B))]) | |
118 | 129 | } | |
119 | 130 | } | |
120 | 131 | } | |
121 | 132 | ||
122 | 133 | ||
123 | 134 | ||
124 | - | @Callable( | |
125 | - | func makeSell ( | |
126 | - | then !(isDefined(assetInfo(fromBase58String( | |
135 | + | @Callable(n) | |
136 | + | func makeSell (k,C,D,E) = if (if ((k != "WAVES")) | |
137 | + | then !(isDefined(assetInfo(fromBase58String(k)))) | |
127 | 138 | else false) | |
128 | 139 | then throw("There is no asset with specified id") | |
129 | - | else if ((0 >= | |
130 | - | then throw("price must be positive") | |
140 | + | else if ((0 >= C)) | |
141 | + | then throw("Amount of price asset must be positive") | |
131 | 142 | else { | |
132 | - | let | |
133 | - | if ((0 >= | |
134 | - | then throw(" | |
143 | + | let r = valueOrErrorMessage(n.payment, "Where is payment?") | |
144 | + | if ((0 >= r.amount)) | |
145 | + | then throw("Amount must be positive") | |
135 | 146 | else { | |
136 | - | let | |
137 | - | let e = | |
147 | + | let j = { | |
148 | + | let e = r.assetId | |
138 | 149 | if ($isInstanceOf(e, "ByteVector")) | |
139 | 150 | then { | |
140 | - | let | |
141 | - | toBase58String( | |
151 | + | let F = e | |
152 | + | toBase58String(F) | |
142 | 153 | } | |
143 | 154 | else "WAVES" | |
144 | 155 | } | |
145 | - | let | |
146 | - | if (if (!(isDefined(indexOf( | |
156 | + | let s = valueOrErrorMessage(getString(this, "assets"), "There are not available assets") | |
157 | + | if (if (!(isDefined(indexOf(s, k)))) | |
147 | 158 | then true | |
148 | - | else !(isDefined(indexOf( | |
159 | + | else !(isDefined(indexOf(s, j)))) | |
149 | 160 | then throw("Asset are not available for trading") | |
150 | 161 | else { | |
151 | - | let c = toBase58String( | |
162 | + | let c = toBase58String(n.caller.bytes) | |
152 | 163 | if (if (!(b(c))) | |
153 | - | then if ( | |
164 | + | then if (D) | |
154 | 165 | then true | |
155 | - | else ( | |
166 | + | else (E != "") | |
156 | 167 | else false) | |
157 | 168 | then throw("You must have pro status to use these features") | |
158 | 169 | else { | |
159 | - | let | |
160 | - | let | |
170 | + | let G = toBase58String(n.transactionId) | |
171 | + | let H = { | |
161 | 172 | let e = getString(this, "orders") | |
162 | 173 | if ($isInstanceOf(e, "String")) | |
163 | 174 | then { | |
164 | - | let | |
165 | - | | |
175 | + | let I = e | |
176 | + | I | |
166 | 177 | } | |
167 | 178 | else if ($isInstanceOf(e, "Unit")) | |
168 | 179 | then "" | |
169 | 180 | else throw() | |
170 | 181 | } | |
171 | - | let | |
172 | - | let | |
173 | - | WriteSet([DataEntry("orders", ( | |
182 | + | let J = fromBase58String(E) | |
183 | + | let K = (((((((((((((((("sell" + "_") + toString(r.amount)) + "_") + j) + "_") + toString(C)) + "_") + k) + "_") + c) + "_") + toString(D)) + "_") + E) + "_") + toString(0)) | |
184 | + | WriteSet([DataEntry("orders", (H + G)), DataEntry(G, K)]) | |
174 | 185 | } | |
175 | 186 | } | |
176 | 187 | } | |
177 | 188 | } | |
178 | 189 | ||
179 | 190 | ||
180 | 191 | ||
181 | - | @Callable( | |
182 | - | func makeBuy ( | |
183 | - | then !(isDefined(assetInfo(fromBase58String( | |
192 | + | @Callable(n) | |
193 | + | func makeBuy (j,L,D,E) = if (if ((j != "WAVES")) | |
194 | + | then !(isDefined(assetInfo(fromBase58String(j)))) | |
184 | 195 | else false) | |
185 | 196 | then throw("There is no asset with specified id") | |
186 | - | else if ((0 >= | |
187 | - | then throw(" | |
197 | + | else if ((0 >= L)) | |
198 | + | then throw("Amount must be positive") | |
188 | 199 | else { | |
189 | - | let m = valueOrErrorMessage(i.payment, "where is payment?") | |
190 | - | if ((0 >= m.amount)) | |
200 | + | let r = valueOrErrorMessage(n.payment, "where is payment?") | |
201 | + | let C = r.amount | |
202 | + | if ((0 >= C)) | |
191 | 203 | then throw("amount must be positive") | |
192 | 204 | else { | |
193 | - | let | |
194 | - | let e = | |
205 | + | let k = { | |
206 | + | let e = r.assetId | |
195 | 207 | if ($isInstanceOf(e, "ByteVector")) | |
196 | 208 | then { | |
197 | - | let | |
198 | - | toBase58String( | |
209 | + | let F = e | |
210 | + | toBase58String(F) | |
199 | 211 | } | |
200 | 212 | else "WAVES" | |
201 | 213 | } | |
202 | - | let | |
203 | - | if (if (!(isDefined(indexOf( | |
214 | + | let s = valueOrErrorMessage(getString(this, "assets"), "There are not available assets") | |
215 | + | if (if (!(isDefined(indexOf(s, k)))) | |
204 | 216 | then true | |
205 | - | else !(isDefined(indexOf( | |
217 | + | else !(isDefined(indexOf(s, j)))) | |
206 | 218 | then throw("Asset are not available for trading") | |
207 | 219 | else { | |
208 | - | let c = toBase58String( | |
220 | + | let c = toBase58String(n.caller.bytes) | |
209 | 221 | if (if (!(b(c))) | |
210 | - | then if ( | |
222 | + | then if (D) | |
211 | 223 | then true | |
212 | - | else ( | |
224 | + | else (E != "") | |
213 | 225 | else false) | |
214 | 226 | then throw("You must have pro status to use these features") | |
215 | 227 | else { | |
216 | - | let | |
217 | - | let | |
228 | + | let G = toBase58String(n.transactionId) | |
229 | + | let H = { | |
218 | 230 | let e = getString(this, "orders") | |
219 | 231 | if ($isInstanceOf(e, "String")) | |
220 | 232 | then { | |
221 | - | let | |
222 | - | | |
233 | + | let I = e | |
234 | + | I | |
223 | 235 | } | |
224 | 236 | else if ($isInstanceOf(e, "Unit")) | |
225 | 237 | then "" | |
226 | 238 | else throw() | |
227 | 239 | } | |
228 | - | let I = if ((B == "WAVES")) | |
229 | - | then 8 | |
230 | - | else value(assetInfo(fromBase58String(B))).decimals | |
231 | - | let J = ((m.amount * pow(10, 0, I, 0, 0, CEILING)) / y) | |
232 | - | if ((J == 0)) | |
240 | + | if ((L == 0)) | |
233 | 241 | then throw("invalid buy amount") | |
234 | 242 | else { | |
235 | - | let | |
236 | - | WriteSet([DataEntry("orders", ( | |
243 | + | let K = (((((((((((((((("buy" + "_") + toString(L)) + "_") + j) + "_") + toString(C)) + "_") + k) + "_") + c) + "_") + toString(D)) + "_") + E) + "_") + toString(0)) | |
244 | + | WriteSet([DataEntry("orders", (H + G)), DataEntry(("buy_" + G), K)]) | |
237 | 245 | } | |
238 | 246 | } | |
239 | 247 | } | |
240 | 248 | } | |
241 | 249 | } | |
242 | 250 | ||
243 | 251 | ||
244 | 252 | ||
245 | - | @Callable(i) | |
246 | - | func takeSell (D,K) = { | |
247 | - | let m = valueOrErrorMessage(i.payment, "where is payment?") | |
248 | - | if ((0 >= m.amount)) | |
249 | - | then throw("amount must be positive") | |
253 | + | @Callable(n) | |
254 | + | func takeSell (G,M) = { | |
255 | + | let r = valueOrErrorMessage(n.payment, "Where is payment?") | |
256 | + | let C = r.amount | |
257 | + | if ((0 >= C)) | |
258 | + | then throw("Amount must be positive") | |
250 | 259 | else { | |
251 | - | let | |
252 | - | let e = | |
260 | + | let k = { | |
261 | + | let e = r.assetId | |
253 | 262 | if ($isInstanceOf(e, "ByteVector")) | |
254 | 263 | then { | |
255 | - | let | |
256 | - | toBase58String( | |
264 | + | let F = e | |
265 | + | toBase58String(F) | |
257 | 266 | } | |
258 | 267 | else "WAVES" | |
259 | 268 | } | |
260 | - | let H = valueOrErrorMessage(getString(this, D), "Invalid order id") | |
261 | - | let M = parseIntValue(split(H, "_")[0]) | |
262 | - | let B = split(H, "_")[1] | |
263 | - | let y = parseIntValue(split(H, "_")[2]) | |
264 | - | let x = split(H, "_")[3] | |
265 | - | let N = value(addressFromString(split(H, "_")[4])) | |
266 | - | let z = if ((split(H, "_")[5] == "true")) | |
269 | + | let K = valueOrErrorMessage(getString(this, G), "Invalid order id") | |
270 | + | let N = split(K, "_")[0] | |
271 | + | let O = parseIntValue(split(K, "_")[1]) | |
272 | + | let P = split(K, "_")[2] | |
273 | + | let Q = parseIntValue(split(K, "_")[3]) | |
274 | + | let R = split(K, "_")[4] | |
275 | + | let S = value(addressFromString(split(K, "_")[5])) | |
276 | + | let T = if ((split(K, "_")[6] == "true")) | |
267 | 277 | then true | |
268 | 278 | else false | |
269 | - | let A = split(H, "_")[6] | |
270 | - | let O = parseIntValue(split(H, "_")[7]) | |
271 | - | if ((x != L)) | |
272 | - | then throw(("Payment asset must be " + x)) | |
273 | - | else { | |
274 | - | let P = if ((A != "")) | |
275 | - | then sigVerify(i.callerPublicKey, fromBase58String(K), fromBase58String(A)) | |
276 | - | else true | |
277 | - | if (!(P)) | |
278 | - | then throw("The order is private") | |
279 | - | else { | |
280 | - | let I = if ((B == "WAVES")) | |
281 | - | then 8 | |
282 | - | else value(assetInfo(fromBase58String(B))).decimals | |
283 | - | let J = ((m.amount * pow(10, 0, I, 0, 0, CEILING)) / y) | |
284 | - | if ((J == 0)) | |
285 | - | then throw("Invalid amount") | |
286 | - | else if (if (z) | |
287 | - | then (M > J) | |
288 | - | else false) | |
289 | - | then throw("You must take all or none") | |
290 | - | else if ((J > (M - O))) | |
291 | - | then throw("Not enougth asset in order") | |
292 | - | else { | |
293 | - | let E = { | |
294 | - | let e = getString(this, "orders") | |
295 | - | if ($isInstanceOf(e, "String")) | |
296 | - | then { | |
297 | - | let F = e | |
298 | - | F | |
299 | - | } | |
300 | - | else if ($isInstanceOf(e, "Unit")) | |
301 | - | then "" | |
302 | - | else throw() | |
279 | + | let U = split(K, "_")[7] | |
280 | + | let V = parseIntValue(split(K, "_")[8]) | |
281 | + | if ((N != "sell")) | |
282 | + | then throw("Invalid order type") | |
283 | + | else if ((R != k)) | |
284 | + | then throw(("Payment asset must be " + R)) | |
285 | + | else { | |
286 | + | let W = if ((U != "")) | |
287 | + | then sigVerify(n.callerPublicKey, fromBase58String(M), fromBase58String(U)) | |
288 | + | else true | |
289 | + | if (!(W)) | |
290 | + | then throw("The order is private") | |
291 | + | else { | |
292 | + | let L = ((C * O) / Q) | |
293 | + | if ((L == 0)) | |
294 | + | then throw("Invalid amount") | |
295 | + | else if (if (T) | |
296 | + | then (O > L) | |
297 | + | else false) | |
298 | + | then throw("You must take all or none") | |
299 | + | else if ((L > (O - V))) | |
300 | + | then throw("Not enougth asset in order") | |
301 | + | else { | |
302 | + | let H = { | |
303 | + | let e = getString(this, "orders") | |
304 | + | if ($isInstanceOf(e, "String")) | |
305 | + | then { | |
306 | + | let I = e | |
307 | + | I | |
308 | + | } | |
309 | + | else if ($isInstanceOf(e, "Unit")) | |
310 | + | then "" | |
311 | + | else throw() | |
312 | + | } | |
313 | + | let X = (dropRight(K, size(split(K, "_")[7])) + toString((V + L))) | |
314 | + | let Y = value(indexOf(H, G)) | |
315 | + | let Z = if ((O == (L + V))) | |
316 | + | then (take(H, Y) + drop(H, (Y + size(G)))) | |
317 | + | else H | |
318 | + | ScriptResult(WriteSet([DataEntry("orders", Z), DataEntry(G, X)]), TransferSet([ScriptTransfer(n.caller, L, if ((P == "WAVES")) | |
319 | + | then unit | |
320 | + | else fromBase58String(P)), ScriptTransfer(S, C, if ((R == "WAVES")) | |
321 | + | then unit | |
322 | + | else fromBase58String(R))])) | |
303 | 323 | } | |
304 | - | let Q = (dropRight(H, size(split(H, "_")[7])) + toString((O + J))) | |
305 | - | let R = value(indexOf(E, D)) | |
306 | - | let S = if ((M == (J + O))) | |
307 | - | then (take(E, R) + drop(E, (R + size(D)))) | |
308 | - | else E | |
309 | - | ScriptResult(WriteSet([DataEntry("orders", S), DataEntry(D, Q)]), TransferSet([ScriptTransfer(i.caller, J, if ((B == "WAVES")) | |
310 | - | then unit | |
311 | - | else fromBase58String(B)), ScriptTransfer(N, m.amount, if ((x == "WAVES")) | |
312 | - | then unit | |
313 | - | else fromBase58String(x))])) | |
314 | - | } | |
315 | - | } | |
316 | - | } | |
324 | + | } | |
325 | + | } | |
317 | 326 | } | |
318 | 327 | } | |
319 | 328 | ||
320 | 329 | ||
321 | 330 | ||
322 | - | @Callable(i) | |
323 | - | func takeBuy (D,K) = { | |
324 | - | let m = valueOrErrorMessage(i.payment, "where is payment?") | |
325 | - | if ((0 >= m.amount)) | |
331 | + | @Callable(n) | |
332 | + | func takeBuy (G,M) = { | |
333 | + | let r = valueOrErrorMessage(n.payment, "where is payment?") | |
334 | + | let L = r.amount | |
335 | + | if ((0 >= L)) | |
326 | 336 | then throw("amount must be positive") | |
327 | 337 | else { | |
328 | - | let | |
329 | - | let e = | |
338 | + | let j = { | |
339 | + | let e = r.assetId | |
330 | 340 | if ($isInstanceOf(e, "ByteVector")) | |
331 | 341 | then { | |
332 | - | let | |
333 | - | toBase58String( | |
342 | + | let F = e | |
343 | + | toBase58String(F) | |
334 | 344 | } | |
335 | 345 | else "WAVES" | |
336 | 346 | } | |
337 | - | let H = valueOrErrorMessage(getString(this, D), "Invalid order id") | |
338 | - | let M = parseIntValue(split(H, "_")[0]) | |
339 | - | let B = split(H, "_")[1] | |
340 | - | let y = parseIntValue(split(H, "_")[2]) | |
341 | - | let x = split(H, "_")[3] | |
342 | - | let N = value(addressFromString(split(H, "_")[4])) | |
343 | - | let z = if ((split(H, "_")[5] == "true")) | |
347 | + | let K = valueOrErrorMessage(getString(this, G), "Invalid order id") | |
348 | + | let N = split(K, "_")[0] | |
349 | + | let O = parseIntValue(split(K, "_")[1]) | |
350 | + | let P = split(K, "_")[2] | |
351 | + | let Q = parseIntValue(split(K, "_")[3]) | |
352 | + | let R = split(K, "_")[4] | |
353 | + | let S = value(addressFromString(split(K, "_")[5])) | |
354 | + | let T = if ((split(K, "_")[6] == "true")) | |
344 | 355 | then true | |
345 | 356 | else false | |
346 | - | let A = split(H, "_")[6] | |
347 | - | let O = parseIntValue(split(H, "_")[7]) | |
348 | - | if ((B != L)) | |
349 | - | then throw(("payment asset must be " + B)) | |
350 | - | else { | |
351 | - | let P = if ((A != "")) | |
352 | - | then sigVerify(i.callerPublicKey, fromBase58String(K), fromBase58String(A)) | |
353 | - | else true | |
354 | - | if (!(P)) | |
355 | - | then throw("The order is private") | |
356 | - | else { | |
357 | - | let I = if ((B == "WAVES")) | |
358 | - | then 8 | |
359 | - | else value(assetInfo(fromBase58String(B))).decimals | |
360 | - | let T = ((m.amount * y) / pow(10, 0, I, 0, 0, CEILING)) | |
361 | - | if ((T == 0)) | |
362 | - | then throw("invalid amount") | |
363 | - | else if (if (z) | |
364 | - | then (M > T) | |
365 | - | else false) | |
366 | - | then throw("You must take all or none") | |
367 | - | else if ((m.amount > (M - O))) | |
368 | - | then throw("not enougth asset in order") | |
369 | - | else { | |
370 | - | let E = { | |
371 | - | let e = getString(this, "orders") | |
372 | - | if ($isInstanceOf(e, "String")) | |
373 | - | then { | |
374 | - | let F = e | |
375 | - | F | |
376 | - | } | |
377 | - | else if ($isInstanceOf(e, "Unit")) | |
378 | - | then "" | |
379 | - | else throw() | |
357 | + | let U = split(K, "_")[7] | |
358 | + | let V = parseIntValue(split(K, "_")[8]) | |
359 | + | if ((N != "buy")) | |
360 | + | then throw("Invalid order type") | |
361 | + | else if ((P != j)) | |
362 | + | then throw(("payment asset must be " + P)) | |
363 | + | else { | |
364 | + | let W = if ((U != "")) | |
365 | + | then sigVerify(n.callerPublicKey, fromBase58String(M), fromBase58String(U)) | |
366 | + | else true | |
367 | + | if (!(W)) | |
368 | + | then throw("The order is private") | |
369 | + | else { | |
370 | + | let C = ((L * Q) / O) | |
371 | + | if ((C == 0)) | |
372 | + | then throw("Invalid amount") | |
373 | + | else if (if (T) | |
374 | + | then (Q > C) | |
375 | + | else false) | |
376 | + | then throw("You must take all or none") | |
377 | + | else if ((C > (Q - V))) | |
378 | + | then throw("not enougth asset in order") | |
379 | + | else { | |
380 | + | let H = { | |
381 | + | let e = getString(this, "orders") | |
382 | + | if ($isInstanceOf(e, "String")) | |
383 | + | then { | |
384 | + | let I = e | |
385 | + | I | |
386 | + | } | |
387 | + | else if ($isInstanceOf(e, "Unit")) | |
388 | + | then "" | |
389 | + | else throw() | |
390 | + | } | |
391 | + | let X = (dropRight(K, size(split(K, "_")[7])) + toString((V + C))) | |
392 | + | let Y = value(indexOf(H, G)) | |
393 | + | let Z = if ((Q == (C + V))) | |
394 | + | then (take(H, Y) + drop(H, (Y + size(G)))) | |
395 | + | else H | |
396 | + | ScriptResult(WriteSet([DataEntry("orders", Z), DataEntry(G, X)]), TransferSet([ScriptTransfer(n.caller, C, if ((R == "WAVES")) | |
397 | + | then unit | |
398 | + | else fromBase58String(R)), ScriptTransfer(S, L, if ((P == "WAVES")) | |
399 | + | then unit | |
400 | + | else fromBase58String(P))])) | |
380 | 401 | } | |
381 | - | let Q = (dropRight(H, size(split(H, "_")[7])) + toString((O + m.amount))) | |
382 | - | let R = value(indexOf(E, D)) | |
383 | - | let S = if ((M == (m.amount + O))) | |
384 | - | then (take(E, R) + drop(E, (R + size(D)))) | |
385 | - | else E | |
386 | - | ScriptResult(WriteSet([DataEntry("orders", S), DataEntry(D, Q)]), TransferSet([ScriptTransfer(i.caller, T, if ((x == "WAVES")) | |
387 | - | then unit | |
388 | - | else fromBase58String(x)), ScriptTransfer(N, m.amount, if ((B == "WAVES")) | |
389 | - | then unit | |
390 | - | else fromBase58String(B))])) | |
391 | - | } | |
392 | - | } | |
393 | - | } | |
402 | + | } | |
403 | + | } | |
394 | 404 | } | |
395 | 405 | } | |
396 | 406 | ||
397 | 407 | ||
398 | 408 | ||
399 | - | @Callable(i) | |
400 | - | func returnBuy (D) = { | |
401 | - | let H = valueOrErrorMessage(getString(this, D), "Invalid order id") | |
402 | - | let M = parseIntValue(split(H, "_")[0]) | |
403 | - | let B = split(H, "_")[1] | |
404 | - | let y = parseIntValue(split(H, "_")[2]) | |
405 | - | let x = split(H, "_")[3] | |
406 | - | let N = value(addressFromString(split(H, "_")[4])) | |
407 | - | let z = if ((split(H, "_")[5] == "true")) | |
409 | + | @Callable(n) | |
410 | + | func returnSell (G) = { | |
411 | + | let K = valueOrErrorMessage(getString(this, ("sell_" + G)), "Invalid order id") | |
412 | + | let N = split(K, "_")[0] | |
413 | + | let O = parseIntValue(split(K, "_")[1]) | |
414 | + | let P = split(K, "_")[2] | |
415 | + | let Q = parseIntValue(split(K, "_")[3]) | |
416 | + | let R = split(K, "_")[4] | |
417 | + | let S = value(addressFromString(split(K, "_")[5])) | |
418 | + | let T = if ((split(K, "_")[6] == "true")) | |
408 | 419 | then true | |
409 | 420 | else false | |
410 | - | let A = split(H, "_")[6] | |
411 | - | let O = parseIntValue(split(H, "_")[7]) | |
412 | - | if ((N != i.caller)) | |
413 | - | then throw("Return should be called by order owner") | |
414 | - | else { | |
415 | - | let I = if ((B == "WAVES")) | |
416 | - | then 8 | |
417 | - | else value(assetInfo(fromBase58String(B))).decimals | |
418 | - | let U = (((M - O) * y) / pow(10, 0, I, 0, 0, CEILING)) | |
419 | - | if ((0 >= U)) | |
420 | - | then throw("nothing to return") | |
421 | - | else { | |
422 | - | let E = { | |
423 | - | let e = getString(this, "orders") | |
424 | - | if ($isInstanceOf(e, "String")) | |
425 | - | then { | |
426 | - | let F = e | |
427 | - | F | |
428 | - | } | |
429 | - | else if ($isInstanceOf(e, "Unit")) | |
430 | - | then "" | |
431 | - | else throw() | |
421 | + | let U = split(K, "_")[7] | |
422 | + | let V = parseIntValue(split(K, "_")[8]) | |
423 | + | if ((N != "sell")) | |
424 | + | then throw("Invalid order type") | |
425 | + | else if ((S != n.caller)) | |
426 | + | then throw("return should be called by order owner") | |
427 | + | else { | |
428 | + | let aa = (O - V) | |
429 | + | if ((0 >= aa)) | |
430 | + | then throw("nothing to return") | |
431 | + | else { | |
432 | + | let H = { | |
433 | + | let e = getString(this, "orders") | |
434 | + | if ($isInstanceOf(e, "String")) | |
435 | + | then { | |
436 | + | let I = e | |
437 | + | I | |
438 | + | } | |
439 | + | else if ($isInstanceOf(e, "Unit")) | |
440 | + | then "" | |
441 | + | else throw() | |
442 | + | } | |
443 | + | let X = (dropRight(K, size(split(K, "_")[7])) + toString(O)) | |
444 | + | let Y = value(indexOf(H, G)) | |
445 | + | let Z = (take(H, Y) + drop(H, (Y + size(G)))) | |
446 | + | ScriptResult(WriteSet([DataEntry("orders", Z), DataEntry(G, X)]), TransferSet([ScriptTransfer(n.caller, aa, if ((P == "WAVES")) | |
447 | + | then unit | |
448 | + | else fromBase58String(P))])) | |
432 | 449 | } | |
433 | - | let Q = (dropRight(H, size(split(H, "_")[7])) + toString(M)) | |
434 | - | let R = value(indexOf(E, D)) | |
435 | - | let S = (take(E, R) + drop(E, (R + size(D)))) | |
436 | - | ScriptResult(WriteSet([DataEntry("orders", S), DataEntry(D, Q)]), TransferSet([ScriptTransfer(i.caller, U, if ((x == "WAVES")) | |
437 | - | then unit | |
438 | - | else fromBase58String(x))])) | |
439 | - | } | |
440 | - | } | |
450 | + | } | |
441 | 451 | } | |
442 | 452 | ||
443 | 453 | ||
444 | 454 | ||
445 | - | @Callable(i) | |
446 | - | func returnSell (D) = { | |
447 | - | let H = valueOrErrorMessage(getString(this, D), "Invalid order id") | |
448 | - | let M = parseIntValue(split(H, "_")[0]) | |
449 | - | let B = split(H, "_")[1] | |
450 | - | let y = parseIntValue(split(H, "_")[2]) | |
451 | - | let x = split(H, "_")[3] | |
452 | - | let N = value(addressFromString(split(H, "_")[4])) | |
453 | - | let z = if ((split(H, "_")[5] == "true")) | |
455 | + | @Callable(n) | |
456 | + | func returnBuy (G) = { | |
457 | + | let K = valueOrErrorMessage(getString(this, G), "Invalid order id") | |
458 | + | let N = split(K, "_")[0] | |
459 | + | let O = parseIntValue(split(K, "_")[1]) | |
460 | + | let P = split(K, "_")[2] | |
461 | + | let Q = parseIntValue(split(K, "_")[3]) | |
462 | + | let R = split(K, "_")[4] | |
463 | + | let S = value(addressFromString(split(K, "_")[5])) | |
464 | + | let T = if ((split(K, "_")[6] == "true")) | |
454 | 465 | then true | |
455 | 466 | else false | |
456 | - | let A = split(H, "_")[6] | |
457 | - | let O = parseIntValue(split(H, "_")[7]) | |
458 | - | if ((N != i.caller)) | |
459 | - | then throw("return should be called by order owner") | |
460 | - | else { | |
461 | - | let U = (M - O) | |
462 | - | if ((0 >= U)) | |
463 | - | then throw("nothing to return") | |
464 | - | else { | |
465 | - | let E = { | |
466 | - | let e = getString(this, "orders") | |
467 | - | if ($isInstanceOf(e, "String")) | |
468 | - | then { | |
469 | - | let F = e | |
470 | - | F | |
471 | - | } | |
472 | - | else if ($isInstanceOf(e, "Unit")) | |
473 | - | then "" | |
474 | - | else throw() | |
467 | + | let U = split(K, "_")[7] | |
468 | + | let V = parseIntValue(split(K, "_")[8]) | |
469 | + | if ((N != "buy")) | |
470 | + | then throw("Invalid order type") | |
471 | + | else if ((S != n.caller)) | |
472 | + | then throw("Return should be called by order owner") | |
473 | + | else { | |
474 | + | let aa = (Q - V) | |
475 | + | if ((0 >= aa)) | |
476 | + | then throw("nothing to return") | |
477 | + | else { | |
478 | + | let H = { | |
479 | + | let e = getString(this, "orders") | |
480 | + | if ($isInstanceOf(e, "String")) | |
481 | + | then { | |
482 | + | let I = e | |
483 | + | I | |
484 | + | } | |
485 | + | else if ($isInstanceOf(e, "Unit")) | |
486 | + | then "" | |
487 | + | else throw() | |
488 | + | } | |
489 | + | let X = (dropRight(K, size(split(K, "_")[7])) + toString(Q)) | |
490 | + | let Y = value(indexOf(H, G)) | |
491 | + | let Z = (take(H, Y) + drop(H, (Y + size(G)))) | |
492 | + | ScriptResult(WriteSet([DataEntry("orders", Z), DataEntry(G, X)]), TransferSet([ScriptTransfer(n.caller, aa, if ((R == "WAVES")) | |
493 | + | then unit | |
494 | + | else fromBase58String(R))])) | |
475 | 495 | } | |
476 | - | let Q = (dropRight(H, size(split(H, "_")[7])) + toString(M)) | |
477 | - | let R = value(indexOf(E, D)) | |
478 | - | let S = (take(E, R) + drop(E, (R + size(D)))) | |
479 | - | ScriptResult(WriteSet([DataEntry("orders", S), DataEntry(D, Q)]), TransferSet([ScriptTransfer(i.caller, U, if ((B == "WAVES")) | |
480 | - | then unit | |
481 | - | else fromBase58String(B))])) | |
482 | - | } | |
483 | - | } | |
496 | + | } | |
484 | 497 | } | |
485 | 498 | ||
486 | 499 |
github/deemru/w8io/169f3d6 121.57 ms ◑