tx · 6PaV3oCQCt4Tgh2BoysEtraes3fFmaD4dxYnhCwGyeGt 3N8VMRDjjw6kAuCviYwFq4yDWyctRuHPN7X: -0.00800000 Waves 2022.11.11 16:25 [2312546] smart account 3N8VMRDjjw6kAuCviYwFq4yDWyctRuHPN7X > SELF 0.00000000 Waves
{ "type": 13, "id": "6PaV3oCQCt4Tgh2BoysEtraes3fFmaD4dxYnhCwGyeGt", "fee": 800000, "feeAssetId": null, "timestamp": 1668173198810, "version": 2, "chainId": 84, "sender": "3N8VMRDjjw6kAuCviYwFq4yDWyctRuHPN7X", "senderPublicKey": "SrcQexq2T9cnMXmLqfJtc8AnQ91ZjeaJtXoi1HwDsx9", "proofs": [ "637rvUftATgUhTSbE3pT2pGUrZ8WhEW1ADbDpEWwy3btVceWwuNbxxTQCEtXnAXktBeUrSmkrhQcGLaix5WykAsV" ], "script": "base64:BgIhCAISBAoCCAESAwoBCBIDCgEIEgMKAQgSAwoBCBIDCgEIEQEIcHJpY2VLZXkBBWFzc2V0CQCsAgIFBWFzc2V0AgZfcHJpY2UBCG93bmVyS2V5AQVhc3NldAkArAICBQVhc3NldAIGX293bmVyAQlpc3N1ZXJLZXkBBWFzc2V0CQCsAgIFBWFzc2V0AgdfaXNzdWVyAQduYW1lS2V5AQVhc3NldAkArAICBQVhc3NldAIFX25hbWUBDmRlc2NyaXB0aW9uS2V5AQVhc3NldAkArAICBQVhc3NldAIMX2Rlc2NyaXB0aW9uAQthc3NldEFjY2VzcwEFYXNzZXQJAKwCAgUFYXNzZXQCCV9hc3NldEJ1eQEKYXNzZXRPZmZlcgEFYXNzZXQJAKwCAgUFYXNzZXQCBl9vZmZlcgEOYXNzZXRPZmZlclN3YXABBWFzc2V0CQCsAgIFBWFzc2V0AgZfb2ZmZXIBDXRyeUdldEludGVnZXIBA2tleQQDdmFsBAckbWF0Y2gwCQCaCAIFBHRoaXMFA2tleQMJAAECBQckbWF0Y2gwAgNJbnQEAWIFByRtYXRjaDAFAWIAAAUDdmFs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hcnNlSW50VmFsdWUBCQCRAwIFCWxpc3RQcmljZQABCQDZBAEJAJEDAgUJbGlzdEFzc2V0AAEJAMwIAgkBDlNjcmlwdFRyYW5zZmVyAwkBEUBleHRyTmF0aXZlKDEwNjIpAQUKb3duZXJPZmZlcgkBDXBhcnNlSW50VmFsdWUBCQCRAwIFCWxpc3RQcmljZQACBQR1bml0CQDMCAIJAQtEZWxldGVFbnRyeQEJAKwCAgkBCHByaWNlS2V5AQUHb2ZmZXJJZAIEU3dhcAkAzAgCCQELRGVsZXRlRW50cnkBCQCsAgIJAQhvd25lcktleQEFB29mZmVySWQCBFN3YXAJAMwIAgkBC0RlbGV0ZUVudHJ5AQkArAICCQEJaXNzdWVyS2V5AQUHb2ZmZXJJZAIEU3dhcAkAzAgCCQELRGVsZXRlRW50cnkBCQCsAgIJAQphc3NldE9mZmVyAQUHb2ZmZXJJZAIEU3dhcAUDbmlsAQJ0eAEGdmVyaWZ5AAkA9AMDCAUCdHgJYm9keUJ5dGVzCQCRAwIIBQJ0eAZwcm9vZnMAAAgFAnR4D3NlbmRlclB1YmxpY0tlefyuyts=", "height": 2312546, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: EN7aMR9m1tb7xZf67xxJUv5nKUnzEJ9oYuQW31FF1hEs Next: DAzxxT7y6e3FHgfsW4KwhQai7mtuSCg2yzsDaT3mGhS9 Diff:
Old | New | Differences | |
---|---|---|---|
249 | 249 | ||
250 | 250 | @Callable(r) | |
251 | 251 | func offerForSwap (I) = { | |
252 | - | let O = size(r.payments) | |
253 | 252 | let y = { | |
254 | - | let | |
255 | - | let | |
256 | - | let | |
257 | - | func | |
258 | - | then | |
259 | - | else x( | |
253 | + | let O = r.payments | |
254 | + | let P = size(O) | |
255 | + | let Q = true | |
256 | + | func R (S,T) = if ((T >= P)) | |
257 | + | then S | |
258 | + | else x(S, O[T]) | |
260 | 259 | ||
261 | - | func | |
262 | - | then | |
260 | + | func U (S,T) = if ((T >= P)) | |
261 | + | then S | |
263 | 262 | else throw("List size exceeds 2") | |
264 | 263 | ||
265 | - | | |
264 | + | U(R(R(Q, 0), 1), 2) | |
266 | 265 | } | |
267 | 266 | if (!(y)) | |
268 | 267 | then throw("Payments incorrect") | |
269 | 268 | else if ((j("commission") > r.payments[1].amount)) | |
270 | 269 | then throw("No minimum commission") | |
271 | 270 | else { | |
272 | - | let | |
273 | - | let | |
274 | - | let | |
275 | - | let | |
276 | - | func | |
277 | - | then | |
278 | - | else B( | |
271 | + | let V = { | |
272 | + | let O = r.payments | |
273 | + | let P = size(O) | |
274 | + | let Q = "Swap" | |
275 | + | func W (S,T) = if ((T >= P)) | |
276 | + | then S | |
277 | + | else B(S, O[T]) | |
279 | 278 | ||
280 | - | func | |
281 | - | then | |
279 | + | func X (S,T) = if ((T >= P)) | |
280 | + | then S | |
282 | 281 | else throw("List size exceeds 2") | |
283 | 282 | ||
284 | - | | |
283 | + | X(W(W(Q, 0), 1), 2) | |
285 | 284 | } | |
286 | 285 | let E = { | |
287 | - | let | |
288 | - | let | |
289 | - | let | |
290 | - | func | |
291 | - | then | |
292 | - | else D( | |
286 | + | let O = r.payments | |
287 | + | let P = size(O) | |
288 | + | let Q = "Swap" | |
289 | + | func Y (S,T) = if ((T >= P)) | |
290 | + | then S | |
291 | + | else D(S, O[T]) | |
293 | 292 | ||
294 | - | func | |
295 | - | then | |
293 | + | func Z (S,T) = if ((T >= P)) | |
294 | + | then S | |
296 | 295 | else throw("List size exceeds 2") | |
297 | 296 | ||
298 | - | | |
297 | + | Z(Y(Y(Q, 0), 1), 2) | |
299 | 298 | } | |
300 | 299 | let t = { | |
301 | - | let | |
302 | - | let | |
303 | - | let | |
304 | - | func | |
305 | - | then | |
306 | - | else C( | |
300 | + | let O = r.payments | |
301 | + | let P = size(O) | |
302 | + | let Q = "Swap" | |
303 | + | func aa (S,T) = if ((T >= P)) | |
304 | + | then S | |
305 | + | else C(S, O[T]) | |
307 | 306 | ||
308 | - | func | |
309 | - | then | |
307 | + | func ab (S,T) = if ((T >= P)) | |
308 | + | then S | |
310 | 309 | else throw("List size exceeds 2") | |
311 | 310 | ||
312 | - | | |
311 | + | ab(aa(aa(Q, 0), 1), 2) | |
313 | 312 | } | |
314 | - | [StringEntry((a( | |
313 | + | [StringEntry((a(V) + "Swap"), t), StringEntry((c(V) + "Swap"), toBase58String(r.caller.bytes)), StringEntry((d(V) + "Swap"), E), StringEntry((h(V) + "Swap"), I)] | |
315 | 314 | } | |
316 | 315 | } | |
317 | 316 | ||
318 | 317 | ||
319 | 318 | ||
320 | 319 | @Callable(r) | |
321 | - | func buy ( | |
322 | - | let t = j(a( | |
323 | - | let s = o(h( | |
324 | - | let | |
325 | - | let | |
326 | - | let m = addressFromString( | |
320 | + | func buy (ac) = { | |
321 | + | let t = j(a(ac)) | |
322 | + | let s = o(h(ac)) | |
323 | + | let ad = o(c(ac)) | |
324 | + | let ae = { | |
325 | + | let m = addressFromString(ad) | |
327 | 326 | if ($isInstanceOf(m, "Address")) | |
328 | 327 | then { | |
329 | 328 | let N = m | |
333 | 332 | } | |
334 | 333 | if (!(q(r, s, t))) | |
335 | 334 | then throw("Wrong payment amount or asset") | |
336 | - | else if (( | |
335 | + | else if ((ad == toBase58String(r.caller.bytes))) | |
337 | 336 | then throw("Owner cannot buy his NTF") | |
338 | 337 | else if ((t == 0)) | |
339 | 338 | then throw("This NFT is not for sale") | |
340 | 339 | else { | |
341 | - | let | |
342 | - | [ScriptTransfer(r.caller, 1, fromBase58String( | |
340 | + | let af = ((t / 100) * 5) | |
341 | + | [ScriptTransfer(r.caller, 1, fromBase58String(ac)), ScriptTransfer(ae, (t - af), unit), DeleteEntry(a(ac)), DeleteEntry(c(ac)), DeleteEntry(d(ac)), DeleteEntry(e(ac)), DeleteEntry(f(ac)), DeleteEntry(h(ac))] | |
343 | 342 | } | |
344 | 343 | } | |
345 | 344 | ||
346 | 345 | ||
347 | 346 | ||
348 | 347 | @Callable(r) | |
349 | - | func swapDone (ah) = { | |
350 | - | let t = o((a(ah) + "Swap")) | |
351 | - | let ai = o((h(ah) + "Swap")) | |
352 | - | let aj = o((c(ah) + "Swap")) | |
353 | - | let ak = o(c(ai)) | |
354 | - | let al = o((h(ah) + "Swap")) | |
355 | - | if ((ak != toBase58String(r.caller.bytes))) | |
348 | + | func swapDone (ag) = { | |
349 | + | let t = o((a(ag) + "Swap")) | |
350 | + | let ah = o((h(ag) + "Swap")) | |
351 | + | let ai = o((c(ag) + "Swap")) | |
352 | + | let aj = o(c(ah)) | |
353 | + | let ak = { | |
354 | + | let m = addressFromString(aj) | |
355 | + | if ($isInstanceOf(m, "Address")) | |
356 | + | then { | |
357 | + | let N = m | |
358 | + | N | |
359 | + | } | |
360 | + | else throw("This NFT is not for sale") | |
361 | + | } | |
362 | + | let al = o((h(ag) + "Swap")) | |
363 | + | if ((aj != toBase58String(r.caller.bytes))) | |
356 | 364 | then throw("The calling address is not the owner of the NFT token") | |
357 | - | else if ((t == "")) | |
358 | - | then throw("This NFT is not for sale") | |
359 | - | else { | |
360 | - | let ag = j("commission") | |
361 | - | let am = split(ah, "_") | |
362 | - | let an = split(t, "_") | |
363 | - | [ScriptTransfer(addressFromStringValue(ak), parseIntValue(an[1]), fromBase58String(am[1])), ScriptTransfer(addressFromStringValue(ak), (parseIntValue(an[2]) - ag), unit), ScriptTransfer(addressFromStringValue(aj), 1, fromBase58String(al)), DeleteEntry(a(al)), DeleteEntry(c(al)), DeleteEntry(d(al)), DeleteEntry(e(al)), DeleteEntry(f(al)), DeleteEntry((a(ah) + "Swap")), DeleteEntry((c(ah) + "Swap")), DeleteEntry((d(ah) + "Swap"))] | |
364 | - | } | |
365 | + | else { | |
366 | + | let af = j("commission") | |
367 | + | let am = split(ag, "_") | |
368 | + | let an = split(t, "_") | |
369 | + | [ScriptTransfer(addressFromStringValue(aj), parseIntValue(an[1]), fromBase58String(am[1])), ScriptTransfer(addressFromStringValue(aj), (parseIntValue(an[2]) - af), unit), ScriptTransfer(addressFromStringValue(ai), 1, fromBase58String(al)), DeleteEntry(a(al)), DeleteEntry(c(al)), DeleteEntry(d(al)), DeleteEntry(e(al)), DeleteEntry(h(al)), DeleteEntry(f(al)), DeleteEntry((a(ag) + "Swap")), DeleteEntry((c(ag) + "Swap")), DeleteEntry((d(ag) + "Swap")), DeleteEntry((h(ag) + "Swap"))] | |
370 | + | } | |
365 | 371 | } | |
366 | 372 | ||
367 | 373 | ||
368 | 374 | ||
369 | 375 | @Callable(r) | |
370 | - | func cancelSelling ( | |
371 | - | let | |
372 | - | let | |
373 | - | let m = addressFromString( | |
376 | + | func cancelSelling (ac) = { | |
377 | + | let ad = o(c(ac)) | |
378 | + | let ae = { | |
379 | + | let m = addressFromString(ad) | |
374 | 380 | if ($isInstanceOf(m, "Address")) | |
375 | 381 | then { | |
376 | 382 | let N = m | |
378 | 384 | } | |
379 | 385 | else throw("Address parsing error") | |
380 | 386 | } | |
381 | - | if (( | |
387 | + | if ((ad != toBase58String(r.caller.bytes))) | |
382 | 388 | then throw("The calling address is not the owner of the NFT token") | |
383 | - | else [ScriptTransfer(r.caller, 1, fromBase58String( | |
389 | + | else [ScriptTransfer(r.caller, 1, fromBase58String(ac)), DeleteEntry(a(ac)), DeleteEntry(c(ac)), DeleteEntry(d(ac)), DeleteEntry(e(ac)), DeleteEntry(f(ac))] | |
384 | 390 | } | |
385 | 391 | ||
386 | 392 | ||
387 | 393 | ||
388 | 394 | @Callable(r) | |
389 | - | func swapCancel ( | |
390 | - | let | |
391 | - | let t = o((a( | |
392 | - | if (( | |
395 | + | func swapCancel (ag) = { | |
396 | + | let ai = o((c(ag) + "Swap")) | |
397 | + | let t = o((a(ag) + "Swap")) | |
398 | + | if ((ai != toBase58String(r.caller.bytes))) | |
393 | 399 | then throw("The calling address is not the owner of the NFT token") | |
394 | 400 | else { | |
395 | - | let am = split( | |
401 | + | let am = split(ag, "_") | |
396 | 402 | let an = split(t, "_") | |
397 | - | [ScriptTransfer(addressFromStringValue( | |
403 | + | [ScriptTransfer(addressFromStringValue(ai), parseIntValue(an[1]), fromBase58String(am[1])), ScriptTransfer(addressFromStringValue(ai), parseIntValue(an[2]), unit), DeleteEntry((a(ag) + "Swap")), DeleteEntry((c(ag) + "Swap")), DeleteEntry((d(ag) + "Swap")), DeleteEntry((h(ag) + "Swap"))] | |
398 | 404 | } | |
399 | 405 | } | |
400 | 406 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | func a (b) = (b + "_price") | |
5 | 5 | ||
6 | 6 | ||
7 | 7 | func c (b) = (b + "_owner") | |
8 | 8 | ||
9 | 9 | ||
10 | 10 | func d (b) = (b + "_issuer") | |
11 | 11 | ||
12 | 12 | ||
13 | 13 | func e (b) = (b + "_name") | |
14 | 14 | ||
15 | 15 | ||
16 | 16 | func f (b) = (b + "_description") | |
17 | 17 | ||
18 | 18 | ||
19 | 19 | func g (b) = (b + "_assetBuy") | |
20 | 20 | ||
21 | 21 | ||
22 | 22 | func h (b) = (b + "_offer") | |
23 | 23 | ||
24 | 24 | ||
25 | 25 | func i (b) = (b + "_offer") | |
26 | 26 | ||
27 | 27 | ||
28 | 28 | func j (k) = { | |
29 | 29 | let l = { | |
30 | 30 | let m = getInteger(this, k) | |
31 | 31 | if ($isInstanceOf(m, "Int")) | |
32 | 32 | then { | |
33 | 33 | let n = m | |
34 | 34 | n | |
35 | 35 | } | |
36 | 36 | else 0 | |
37 | 37 | } | |
38 | 38 | l | |
39 | 39 | } | |
40 | 40 | ||
41 | 41 | ||
42 | 42 | func o (k) = { | |
43 | 43 | let l = { | |
44 | 44 | let m = getString(this, k) | |
45 | 45 | if ($isInstanceOf(m, "String")) | |
46 | 46 | then { | |
47 | 47 | let n = m | |
48 | 48 | n | |
49 | 49 | } | |
50 | 50 | else "" | |
51 | 51 | } | |
52 | 52 | l | |
53 | 53 | } | |
54 | 54 | ||
55 | 55 | ||
56 | 56 | func p (k) = { | |
57 | 57 | let l = { | |
58 | 58 | let m = getBoolean(this, k) | |
59 | 59 | if ($isInstanceOf(m, "Boolean")) | |
60 | 60 | then { | |
61 | 61 | let n = m | |
62 | 62 | n | |
63 | 63 | } | |
64 | 64 | else false | |
65 | 65 | } | |
66 | 66 | l | |
67 | 67 | } | |
68 | 68 | ||
69 | 69 | ||
70 | 70 | func q (r,s,t) = if ((size(r.payments) == 0)) | |
71 | 71 | then throw("Payment not attached") | |
72 | 72 | else { | |
73 | 73 | let u = value(r.payments[0]) | |
74 | 74 | let l = { | |
75 | 75 | let m = u.assetId | |
76 | 76 | if ($isInstanceOf(m, "ByteVector")) | |
77 | 77 | then { | |
78 | 78 | let v = m | |
79 | 79 | if ((toBase58String(v) == s)) | |
80 | 80 | then (u.amount >= t) | |
81 | 81 | else false | |
82 | 82 | } | |
83 | 83 | else if ($isInstanceOf(m, "Unit")) | |
84 | 84 | then { | |
85 | 85 | let w = m | |
86 | 86 | (u.amount >= t) | |
87 | 87 | } | |
88 | 88 | else throw("Match error") | |
89 | 89 | } | |
90 | 90 | l | |
91 | 91 | } | |
92 | 92 | ||
93 | 93 | ||
94 | 94 | func x (y,z) = { | |
95 | 95 | let A = { | |
96 | 96 | let m = z.assetId | |
97 | 97 | if ($isInstanceOf(m, "ByteVector")) | |
98 | 98 | then { | |
99 | 99 | let n = m | |
100 | 100 | n | |
101 | 101 | } | |
102 | 102 | else if ($isInstanceOf(m, "Unit")) | |
103 | 103 | then { | |
104 | 104 | let n = m | |
105 | 105 | base58'2CsAf' | |
106 | 106 | } | |
107 | 107 | else throw("Match error") | |
108 | 108 | } | |
109 | 109 | let b = { | |
110 | 110 | let m = assetInfo(A) | |
111 | 111 | if ($isInstanceOf(m, "Asset")) | |
112 | 112 | then { | |
113 | 113 | let n = m | |
114 | 114 | toBase58String(n.issuer.bytes) | |
115 | 115 | } | |
116 | 116 | else if ($isInstanceOf(m, "Unit")) | |
117 | 117 | then { | |
118 | 118 | let w = m | |
119 | 119 | "WAVES" | |
120 | 120 | } | |
121 | 121 | else throw("Match error") | |
122 | 122 | } | |
123 | 123 | if (p(b)) | |
124 | 124 | then y | |
125 | 125 | else false | |
126 | 126 | } | |
127 | 127 | ||
128 | 128 | ||
129 | 129 | func B (y,z) = { | |
130 | 130 | let A = { | |
131 | 131 | let m = z.assetId | |
132 | 132 | if ($isInstanceOf(m, "ByteVector")) | |
133 | 133 | then { | |
134 | 134 | let n = m | |
135 | 135 | toBase58String(n) | |
136 | 136 | } | |
137 | 137 | else if ($isInstanceOf(m, "Unit")) | |
138 | 138 | then { | |
139 | 139 | let n = m | |
140 | 140 | "WAVES" | |
141 | 141 | } | |
142 | 142 | else throw("Match error") | |
143 | 143 | } | |
144 | 144 | ((y + "_") + A) | |
145 | 145 | } | |
146 | 146 | ||
147 | 147 | ||
148 | 148 | func C (y,z) = { | |
149 | 149 | let t = toString(z.amount) | |
150 | 150 | ((y + "_") + t) | |
151 | 151 | } | |
152 | 152 | ||
153 | 153 | ||
154 | 154 | func D (y,z) = { | |
155 | 155 | let A = { | |
156 | 156 | let m = z.assetId | |
157 | 157 | if ($isInstanceOf(m, "ByteVector")) | |
158 | 158 | then { | |
159 | 159 | let n = m | |
160 | 160 | n | |
161 | 161 | } | |
162 | 162 | else if ($isInstanceOf(m, "Unit")) | |
163 | 163 | then { | |
164 | 164 | let n = m | |
165 | 165 | base58'2CsAf' | |
166 | 166 | } | |
167 | 167 | else throw("Match error") | |
168 | 168 | } | |
169 | 169 | let E = { | |
170 | 170 | let m = assetInfo(A) | |
171 | 171 | if ($isInstanceOf(m, "Asset")) | |
172 | 172 | then { | |
173 | 173 | let n = m | |
174 | 174 | toBase58String(n.issuer.bytes) | |
175 | 175 | } | |
176 | 176 | else if ($isInstanceOf(m, "Unit")) | |
177 | 177 | then { | |
178 | 178 | let n = m | |
179 | 179 | "WAVES" | |
180 | 180 | } | |
181 | 181 | else throw("Match error") | |
182 | 182 | } | |
183 | 183 | ((y + "_") + E) | |
184 | 184 | } | |
185 | 185 | ||
186 | 186 | ||
187 | 187 | func F (y,G) = { | |
188 | 188 | let H = { | |
189 | 189 | let m = addressFromString(G._1) | |
190 | 190 | if ($isInstanceOf(m, "Address")) | |
191 | 191 | then { | |
192 | 192 | let n = m | |
193 | 193 | n | |
194 | 194 | } | |
195 | 195 | else if ($isInstanceOf(m, "Unit")) | |
196 | 196 | then { | |
197 | 197 | let n = m | |
198 | 198 | this | |
199 | 199 | } | |
200 | 200 | else throw("Match error") | |
201 | 201 | } | |
202 | 202 | if ((G._3 != "WAVES")) | |
203 | 203 | then (y :+ ScriptTransfer(H, G._2, fromBase58String(G._3))) | |
204 | 204 | else (y :+ ScriptTransfer(H, G._2, unit)) | |
205 | 205 | } | |
206 | 206 | ||
207 | 207 | ||
208 | 208 | @Callable(r) | |
209 | 209 | func offerForSale (I,t) = if (!(if (p(g(I))) | |
210 | 210 | then (t > 0) | |
211 | 211 | else false)) | |
212 | 212 | then throw("Sale Asset incorrect") | |
213 | 213 | else { | |
214 | 214 | let J = value(r.payments[0]) | |
215 | 215 | let v = { | |
216 | 216 | let m = J.assetId | |
217 | 217 | if ($isInstanceOf(m, "ByteVector")) | |
218 | 218 | then { | |
219 | 219 | let K = m | |
220 | 220 | K | |
221 | 221 | } | |
222 | 222 | else if ($isInstanceOf(m, "Unit")) | |
223 | 223 | then { | |
224 | 224 | let L = m | |
225 | 225 | throw("Asset is not NFT") | |
226 | 226 | } | |
227 | 227 | else throw("Match error") | |
228 | 228 | } | |
229 | 229 | let M = toBase58String(v) | |
230 | 230 | let b = { | |
231 | 231 | let m = assetInfo(v) | |
232 | 232 | if ($isInstanceOf(m, "Asset")) | |
233 | 233 | then { | |
234 | 234 | let N = m | |
235 | 235 | N | |
236 | 236 | } | |
237 | 237 | else throw("Error getting information about asset") | |
238 | 238 | } | |
239 | 239 | if (if (if ((b.quantity != 1)) | |
240 | 240 | then (b.decimals != 0) | |
241 | 241 | else false) | |
242 | 242 | then b.reissuable | |
243 | 243 | else false) | |
244 | 244 | then throw("Asset is not NFT") | |
245 | 245 | else [IntegerEntry(a(M), t), StringEntry(c(M), toBase58String(r.caller.bytes)), StringEntry(d(M), toBase58String(b.issuer.bytes)), StringEntry(e(M), b.name), StringEntry(f(M), b.description), StringEntry(h(M), I)] | |
246 | 246 | } | |
247 | 247 | ||
248 | 248 | ||
249 | 249 | ||
250 | 250 | @Callable(r) | |
251 | 251 | func offerForSwap (I) = { | |
252 | - | let O = size(r.payments) | |
253 | 252 | let y = { | |
254 | - | let | |
255 | - | let | |
256 | - | let | |
257 | - | func | |
258 | - | then | |
259 | - | else x( | |
253 | + | let O = r.payments | |
254 | + | let P = size(O) | |
255 | + | let Q = true | |
256 | + | func R (S,T) = if ((T >= P)) | |
257 | + | then S | |
258 | + | else x(S, O[T]) | |
260 | 259 | ||
261 | - | func | |
262 | - | then | |
260 | + | func U (S,T) = if ((T >= P)) | |
261 | + | then S | |
263 | 262 | else throw("List size exceeds 2") | |
264 | 263 | ||
265 | - | | |
264 | + | U(R(R(Q, 0), 1), 2) | |
266 | 265 | } | |
267 | 266 | if (!(y)) | |
268 | 267 | then throw("Payments incorrect") | |
269 | 268 | else if ((j("commission") > r.payments[1].amount)) | |
270 | 269 | then throw("No minimum commission") | |
271 | 270 | else { | |
272 | - | let | |
273 | - | let | |
274 | - | let | |
275 | - | let | |
276 | - | func | |
277 | - | then | |
278 | - | else B( | |
271 | + | let V = { | |
272 | + | let O = r.payments | |
273 | + | let P = size(O) | |
274 | + | let Q = "Swap" | |
275 | + | func W (S,T) = if ((T >= P)) | |
276 | + | then S | |
277 | + | else B(S, O[T]) | |
279 | 278 | ||
280 | - | func | |
281 | - | then | |
279 | + | func X (S,T) = if ((T >= P)) | |
280 | + | then S | |
282 | 281 | else throw("List size exceeds 2") | |
283 | 282 | ||
284 | - | | |
283 | + | X(W(W(Q, 0), 1), 2) | |
285 | 284 | } | |
286 | 285 | let E = { | |
287 | - | let | |
288 | - | let | |
289 | - | let | |
290 | - | func | |
291 | - | then | |
292 | - | else D( | |
286 | + | let O = r.payments | |
287 | + | let P = size(O) | |
288 | + | let Q = "Swap" | |
289 | + | func Y (S,T) = if ((T >= P)) | |
290 | + | then S | |
291 | + | else D(S, O[T]) | |
293 | 292 | ||
294 | - | func | |
295 | - | then | |
293 | + | func Z (S,T) = if ((T >= P)) | |
294 | + | then S | |
296 | 295 | else throw("List size exceeds 2") | |
297 | 296 | ||
298 | - | | |
297 | + | Z(Y(Y(Q, 0), 1), 2) | |
299 | 298 | } | |
300 | 299 | let t = { | |
301 | - | let | |
302 | - | let | |
303 | - | let | |
304 | - | func | |
305 | - | then | |
306 | - | else C( | |
300 | + | let O = r.payments | |
301 | + | let P = size(O) | |
302 | + | let Q = "Swap" | |
303 | + | func aa (S,T) = if ((T >= P)) | |
304 | + | then S | |
305 | + | else C(S, O[T]) | |
307 | 306 | ||
308 | - | func | |
309 | - | then | |
307 | + | func ab (S,T) = if ((T >= P)) | |
308 | + | then S | |
310 | 309 | else throw("List size exceeds 2") | |
311 | 310 | ||
312 | - | | |
311 | + | ab(aa(aa(Q, 0), 1), 2) | |
313 | 312 | } | |
314 | - | [StringEntry((a( | |
313 | + | [StringEntry((a(V) + "Swap"), t), StringEntry((c(V) + "Swap"), toBase58String(r.caller.bytes)), StringEntry((d(V) + "Swap"), E), StringEntry((h(V) + "Swap"), I)] | |
315 | 314 | } | |
316 | 315 | } | |
317 | 316 | ||
318 | 317 | ||
319 | 318 | ||
320 | 319 | @Callable(r) | |
321 | - | func buy ( | |
322 | - | let t = j(a( | |
323 | - | let s = o(h( | |
324 | - | let | |
325 | - | let | |
326 | - | let m = addressFromString( | |
320 | + | func buy (ac) = { | |
321 | + | let t = j(a(ac)) | |
322 | + | let s = o(h(ac)) | |
323 | + | let ad = o(c(ac)) | |
324 | + | let ae = { | |
325 | + | let m = addressFromString(ad) | |
327 | 326 | if ($isInstanceOf(m, "Address")) | |
328 | 327 | then { | |
329 | 328 | let N = m | |
330 | 329 | N | |
331 | 330 | } | |
332 | 331 | else throw("Address parsing error") | |
333 | 332 | } | |
334 | 333 | if (!(q(r, s, t))) | |
335 | 334 | then throw("Wrong payment amount or asset") | |
336 | - | else if (( | |
335 | + | else if ((ad == toBase58String(r.caller.bytes))) | |
337 | 336 | then throw("Owner cannot buy his NTF") | |
338 | 337 | else if ((t == 0)) | |
339 | 338 | then throw("This NFT is not for sale") | |
340 | 339 | else { | |
341 | - | let | |
342 | - | [ScriptTransfer(r.caller, 1, fromBase58String( | |
340 | + | let af = ((t / 100) * 5) | |
341 | + | [ScriptTransfer(r.caller, 1, fromBase58String(ac)), ScriptTransfer(ae, (t - af), unit), DeleteEntry(a(ac)), DeleteEntry(c(ac)), DeleteEntry(d(ac)), DeleteEntry(e(ac)), DeleteEntry(f(ac)), DeleteEntry(h(ac))] | |
343 | 342 | } | |
344 | 343 | } | |
345 | 344 | ||
346 | 345 | ||
347 | 346 | ||
348 | 347 | @Callable(r) | |
349 | - | func swapDone (ah) = { | |
350 | - | let t = o((a(ah) + "Swap")) | |
351 | - | let ai = o((h(ah) + "Swap")) | |
352 | - | let aj = o((c(ah) + "Swap")) | |
353 | - | let ak = o(c(ai)) | |
354 | - | let al = o((h(ah) + "Swap")) | |
355 | - | if ((ak != toBase58String(r.caller.bytes))) | |
348 | + | func swapDone (ag) = { | |
349 | + | let t = o((a(ag) + "Swap")) | |
350 | + | let ah = o((h(ag) + "Swap")) | |
351 | + | let ai = o((c(ag) + "Swap")) | |
352 | + | let aj = o(c(ah)) | |
353 | + | let ak = { | |
354 | + | let m = addressFromString(aj) | |
355 | + | if ($isInstanceOf(m, "Address")) | |
356 | + | then { | |
357 | + | let N = m | |
358 | + | N | |
359 | + | } | |
360 | + | else throw("This NFT is not for sale") | |
361 | + | } | |
362 | + | let al = o((h(ag) + "Swap")) | |
363 | + | if ((aj != toBase58String(r.caller.bytes))) | |
356 | 364 | then throw("The calling address is not the owner of the NFT token") | |
357 | - | else if ((t == "")) | |
358 | - | then throw("This NFT is not for sale") | |
359 | - | else { | |
360 | - | let ag = j("commission") | |
361 | - | let am = split(ah, "_") | |
362 | - | let an = split(t, "_") | |
363 | - | [ScriptTransfer(addressFromStringValue(ak), parseIntValue(an[1]), fromBase58String(am[1])), ScriptTransfer(addressFromStringValue(ak), (parseIntValue(an[2]) - ag), unit), ScriptTransfer(addressFromStringValue(aj), 1, fromBase58String(al)), DeleteEntry(a(al)), DeleteEntry(c(al)), DeleteEntry(d(al)), DeleteEntry(e(al)), DeleteEntry(f(al)), DeleteEntry((a(ah) + "Swap")), DeleteEntry((c(ah) + "Swap")), DeleteEntry((d(ah) + "Swap"))] | |
364 | - | } | |
365 | + | else { | |
366 | + | let af = j("commission") | |
367 | + | let am = split(ag, "_") | |
368 | + | let an = split(t, "_") | |
369 | + | [ScriptTransfer(addressFromStringValue(aj), parseIntValue(an[1]), fromBase58String(am[1])), ScriptTransfer(addressFromStringValue(aj), (parseIntValue(an[2]) - af), unit), ScriptTransfer(addressFromStringValue(ai), 1, fromBase58String(al)), DeleteEntry(a(al)), DeleteEntry(c(al)), DeleteEntry(d(al)), DeleteEntry(e(al)), DeleteEntry(h(al)), DeleteEntry(f(al)), DeleteEntry((a(ag) + "Swap")), DeleteEntry((c(ag) + "Swap")), DeleteEntry((d(ag) + "Swap")), DeleteEntry((h(ag) + "Swap"))] | |
370 | + | } | |
365 | 371 | } | |
366 | 372 | ||
367 | 373 | ||
368 | 374 | ||
369 | 375 | @Callable(r) | |
370 | - | func cancelSelling ( | |
371 | - | let | |
372 | - | let | |
373 | - | let m = addressFromString( | |
376 | + | func cancelSelling (ac) = { | |
377 | + | let ad = o(c(ac)) | |
378 | + | let ae = { | |
379 | + | let m = addressFromString(ad) | |
374 | 380 | if ($isInstanceOf(m, "Address")) | |
375 | 381 | then { | |
376 | 382 | let N = m | |
377 | 383 | N | |
378 | 384 | } | |
379 | 385 | else throw("Address parsing error") | |
380 | 386 | } | |
381 | - | if (( | |
387 | + | if ((ad != toBase58String(r.caller.bytes))) | |
382 | 388 | then throw("The calling address is not the owner of the NFT token") | |
383 | - | else [ScriptTransfer(r.caller, 1, fromBase58String( | |
389 | + | else [ScriptTransfer(r.caller, 1, fromBase58String(ac)), DeleteEntry(a(ac)), DeleteEntry(c(ac)), DeleteEntry(d(ac)), DeleteEntry(e(ac)), DeleteEntry(f(ac))] | |
384 | 390 | } | |
385 | 391 | ||
386 | 392 | ||
387 | 393 | ||
388 | 394 | @Callable(r) | |
389 | - | func swapCancel ( | |
390 | - | let | |
391 | - | let t = o((a( | |
392 | - | if (( | |
395 | + | func swapCancel (ag) = { | |
396 | + | let ai = o((c(ag) + "Swap")) | |
397 | + | let t = o((a(ag) + "Swap")) | |
398 | + | if ((ai != toBase58String(r.caller.bytes))) | |
393 | 399 | then throw("The calling address is not the owner of the NFT token") | |
394 | 400 | else { | |
395 | - | let am = split( | |
401 | + | let am = split(ag, "_") | |
396 | 402 | let an = split(t, "_") | |
397 | - | [ScriptTransfer(addressFromStringValue( | |
403 | + | [ScriptTransfer(addressFromStringValue(ai), parseIntValue(an[1]), fromBase58String(am[1])), ScriptTransfer(addressFromStringValue(ai), parseIntValue(an[2]), unit), DeleteEntry((a(ag) + "Swap")), DeleteEntry((c(ag) + "Swap")), DeleteEntry((d(ag) + "Swap")), DeleteEntry((h(ag) + "Swap"))] | |
398 | 404 | } | |
399 | 405 | } | |
400 | 406 | ||
401 | 407 | ||
402 | 408 | @Verifier(ao) | |
403 | 409 | func ap () = sigVerify(ao.bodyBytes, ao.proofs[0], ao.senderPublicKey) | |
404 | 410 |
github/deemru/w8io/169f3d6 73.80 ms ◑