tx · GeUcjWtmgZrK1ehsDty2hQyQsh75yvQR5wXgM73MNewk 3N4boZRUJ2LxY5jLyp6hmxGktqnawQidu6H: -0.11000000 Waves 2022.11.25 14:16 [2332557] smart account 3N4boZRUJ2LxY5jLyp6hmxGktqnawQidu6H > SELF 0.00000000 Waves
{ "type": 13, "id": "GeUcjWtmgZrK1ehsDty2hQyQsh75yvQR5wXgM73MNewk", "fee": 11000000, "feeAssetId": null, "timestamp": 1669374961897, "version": 2, "chainId": 84, "sender": "3N4boZRUJ2LxY5jLyp6hmxGktqnawQidu6H", "senderPublicKey": "BDeCphaaC4MZvfmbJqQZ78EvuEBZTJ1VEW7fbxue8BUu", "proofs": [ "5wRbq2oNiR3mU4sp84R1hEVaVHdUVoZvqTU8HR9n61d2zYPwyrEPuRff9gMXtK9NvcCrwBzYeEyZmPyqvYRzsuTs" ], "script": "base64:BgJACAISCwoJCAgICAgBCAgIEgQKAggIEgMKAQgSAwoBARIDCgEBEgUKAwEICBIDCgEIEgMKAQgSAwoBCBIECgIIAScACXNlcGFyYXRvcgIBXwAIa0F1Y3Rpb24CB2F1Y3Rpb24ABWtTZWxsAgRzZWxsAAhrVHJ1c3RlZAIHdHJ1c3RlZAAGa1ByaWNlAgVwcmljZQEKZ2V0U2xvdEtleQIGcHJlZml4BW5mdElkCQCsAgIJAKwCAgUGcHJlZml4BQlzZXBhcmF0b3IJANgEAQUFbmZ0SWQBC2dldFByaWNlS2V5AQVuZnRJZAkArAICCQCsAgIFBmtQcmljZQUJc2VwYXJhdG9yCQDYBAEFBW5mdElkAQpnZXRTZWxsS2V5AQVuZnRJZAkArAICCQCsAgIFBWtTZWxsBQlzZXBhcmF0b3IJANgEAQUFbmZ0SWQBDWdldEF1Y3Rpb25LZXkBBW5mdElkCQCsAgIJAKwCAgUIa0F1Y3Rpb24FCXNlcGFyYXRvcgkA2AQBBQVuZnRJZAENZ2V0VHJ1c3RlZEtleQEGaXNzdWVyCQCsAgIJAKwCAgUIa1RydXN0ZWQF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gABBQdhc3NldElkBQNuaWwBaQEQc2V0VHJ1c3RlZElzc3VlcgELdHJ1c3RlZEFkZHIDCQEBIQEJAQdpc0FkbWluAQgFAWkGY2FsbGVyCQACAQIKT25seSBhZG1pbgkAzAgCCQEMQm9vbGVhbkVudHJ5AgkBDWdldFRydXN0ZWRLZXkBCQERQGV4dHJOYXRpdmUoMTA2MikBBQt0cnVzdGVkQWRkcgYFA25pbAFpARdnZXRQcmljZUF0Q3VycmVudE1vbWVudAIFbmZ0SWQGbW9tZW50BAdhc3NldElkCQDZBAEFBW5mdElkBA0kdDAxMDcwNzEwNzcwCQEYY2FsY1ByaWNlQXRDdXJyZW50TW9tZW50AgUHYXNzZXRJZAUGbW9tZW50BAZzZWxsZXIIBQ0kdDAxMDcwNzEwNzcwAl8xBAVwcmljZQgFDSR0MDEwNzA3MTA3NzACXzIJAMwIAgkBDEludGVnZXJFbnRyeQIJAQtnZXRQcmljZUtleQEFB2Fzc2V0SWQFBXByaWNlBQNuaWwAZrn/Wg==", "height": 2332557, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: ENQ2ao1hJpNA9UypZA39y8r1mRUPUnPzAXoom4iMoWro Next: 6MLHAedobyZN3VwFXFDwg8BjaDLf8tTnVRbzxd1m7TNE Diff:
Old | New | Differences | |
---|---|---|---|
125 | 125 | ||
126 | 126 | ||
127 | 127 | func joinStruct (params) = match params { | |
128 | - | case auction: (Address, Int, | |
129 | - | joinString([toString(auction._1), toString(auction._2), | |
128 | + | case auction: (Address, Int, String, String) => | |
129 | + | joinString([toString(auction._1), toString(auction._2), auction._3, auction._4]) | |
130 | 130 | case sell: (Address, Int) => | |
131 | 131 | joinString([toString(sell._1), toString(sell._2)]) | |
132 | 132 | case _ => | |
134 | 134 | } | |
135 | 135 | ||
136 | 136 | ||
137 | - | func setAuction (seller,nftId,startPrice | |
137 | + | func setAuction (seller,nftId,startPrice,start,end) = StringEntry(getAuctionKey(nftId), joinStruct($Tuple4(seller, startPrice, start, end))) | |
138 | 138 | ||
139 | 139 | ||
140 | 140 | func setSell (nftId,celler,price) = StringEntry(getSellKey(nftId), joinStruct($Tuple2(celler, price))) | |
148 | 148 | ||
149 | 149 | func calcPriceAtCurrentMoment (assetId,moment) = { | |
150 | 150 | let details = getAuction(assetId) | |
151 | - | let $ | |
152 | - | let seller = $ | |
153 | - | let startPriceValue = $ | |
154 | - | let endPriceValue = $ | |
155 | - | let startPeriodValue = $ | |
156 | - | let endPeriodValue = $ | |
151 | + | let $t027552859 = parseAsAuction(details) | |
152 | + | let seller = $t027552859._1 | |
153 | + | let startPriceValue = $t027552859._2 | |
154 | + | let endPriceValue = $t027552859._3 | |
155 | + | let startPeriodValue = $t027552859._4 | |
156 | + | let endPeriodValue = $t027552859._5 | |
157 | 157 | if ((moment >= endPeriodValue)) | |
158 | 158 | then $Tuple2(seller, endPriceValue) | |
159 | 159 | else { | |
190 | 190 | ||
191 | 191 | ||
192 | 192 | func isCorrectSellPrice (price) = (price > 0) | |
193 | - | ||
194 | - | ||
195 | - | func isCorrectAuctionPeriod (start,end) = (end > start) | |
196 | 193 | ||
197 | 194 | ||
198 | 195 | func isCorrectAuctionPrices (startPrice,endPrice) = (startPrice > endPrice) | |
251 | 248 | ||
252 | 249 | let kBuy = "buy" | |
253 | 250 | ||
251 | + | let ASIMI_TOKEN = base58'EbLVSrAi6vS3AkLwBinzZCvAXP2yYiFJEzj1MBVHcwZ5' | |
252 | + | ||
254 | 253 | @Callable(i) | |
255 | 254 | func createNft (nft_name,nft_owner,nft_dAppAddress,nft_type,nft_tags,nft_selling_price,nft_description,nft_onSell,nft_data) = { | |
256 | 255 | let newToken = Issue(nft_name, nft_description, 1, 0, false) | |
273 | 272 | func buyNFT (nftID) = { | |
274 | 273 | let assetId = fromBase58String(nftID) | |
275 | 274 | let amount = value(i.payments[0].amount) | |
275 | + | let amount1 = value(i.payments[1].amount) | |
276 | 276 | let price = valueOrErrorMessage(getString(((kPrice + separator) + nftID)), "There is no price for this NFT") | |
277 | 277 | let owner = valueOrErrorMessage(getStringValue(((nftID + separator) + "Owner")), "No owner") | |
278 | 278 | if ((i.payments[0].assetId != unit)) | |
279 | 279 | then throw("Pay in waves") | |
280 | - | else if ((parseIntValue(price) > amount)) | |
281 | - | then throw("Invalid payment") | |
282 | - | else [ScriptTransfer(i.caller, 1, assetId), ScriptTransfer(value(addressFromString(owner)), parseIntValue(price), unit), StringEntry(((toString(i.caller) + separator) + kBuy), ((nftID + separator) + toString(amount)))] | |
280 | + | else if ((i.payments[1].assetId != ASIMI_TOKEN)) | |
281 | + | then throw("Pay in ASIMI") | |
282 | + | else if ((parseIntValue(price) > amount)) | |
283 | + | then throw("Invalid payment WAVES") | |
284 | + | else [ScriptTransfer(i.caller, 1, assetId), ScriptTransfer(value(addressFromString(owner)), parseIntValue(price), unit), StringEntry(((toString(i.caller) + separator) + kBuy), ((nftID + separator) + toString(amount)))] | |
283 | 285 | } | |
284 | 286 | ||
285 | 287 | ||
286 | 288 | ||
287 | 289 | @Callable(i) | |
288 | 290 | func sellNFT (price) = { | |
289 | - | let $ | |
290 | - | let token0 = $ | |
291 | - | let amount0 = $ | |
291 | + | let $t074127497 = $Tuple2(value(i.payments[0].assetId), value(i.payments[0].amount)) | |
292 | + | let token0 = $t074127497._1 | |
293 | + | let amount0 = $t074127497._2 | |
292 | 294 | if (!(isNft(token0))) | |
293 | 295 | then throw("Token is not NFT") | |
294 | 296 | else [StringEntry(((kPrice + separator) + toBase58String(value(i.payments[0].assetId))), toString(price)), StringEntry(((toString(i.caller) + separator) + kSell), ((toBase58String(token0) + separator) + toString(amount0)))] | |
307 | 309 | ||
308 | 310 | ||
309 | 311 | @Callable(i) | |
310 | - | func addAuction (startPrice, | |
312 | + | func addAuction (startPrice,start,end) = { | |
311 | 313 | let nftId = value(i.payments[0].assetId) | |
312 | - | valueOrElse(isCorrectNft(nftId), if (!(isCorrectAuctionPeriod(start, end))) | |
313 | - | then throw("Period is not correct") | |
314 | - | else if (!(isCorrectAuctionPrices(startPrice, endPrice))) | |
315 | - | then throw("Start price must be > endPrice") | |
316 | - | else [setAuction(i.caller, nftId, startPrice, endPrice, start, end), StringEntry(((toBase58String(nftId) + separator) + "nft_owner"), toString(i.caller)), StringEntry(((toBase58String(nftId) + separator) + "nft_type"), nft_type), StringEntry(((toBase58String(nftId) + separator) + "nft_tags"), nft_tags), StringEntry(((toBase58String(nftId) + separator) + "nft_dAppAddress"), nft_dAppAddress), IntegerEntry(((toBase58String(nftId) + separator) + "nft_selling_price"), nft_selling_price), StringEntry(((toBase58String(nftId) + separator) + "nft_onSell"), nft_onSell), StringEntry(((toBase58String(nftId) + separator) + "nft_data"), nft_data)]) | |
314 | + | valueOrElse(isCorrectNft(nftId), [setAuction(i.caller, nftId, startPrice, start, end), StringEntry(((toBase58String(nftId) + separator) + "nft_owner"), toString(i.caller))]) | |
317 | 315 | } | |
318 | 316 | ||
319 | 317 | ||
320 | 318 | ||
321 | 319 | @Callable(i) | |
322 | 320 | func buyFromSlot (nftId) = { | |
323 | - | let $ | |
324 | - | let paymentAsset = $ | |
325 | - | let paymentAmount = $ | |
321 | + | let $t084178506 = $Tuple2(i.payments[0].assetId, value(i.payments[0].amount)) | |
322 | + | let paymentAsset = $t084178506._1 | |
323 | + | let paymentAmount = $t084178506._2 | |
326 | 324 | let assetId = fromBase58String(nftId) | |
327 | - | let $ | |
328 | - | let type = $ | |
329 | - | let details = $ | |
325 | + | let $t085508588 = getSlot(assetId) | |
326 | + | let type = $t085508588._1 | |
327 | + | let details = $t085508588._2 | |
330 | 328 | let baseRes = [ScriptTransfer(i.caller, 1, assetId), DeleteEntry(getSlotKey(type, assetId))] | |
331 | 329 | if ((type == kSell)) | |
332 | 330 | then { | |
333 | - | let $ | |
334 | - | let seller = $ | |
335 | - | let priceValue = $ | |
331 | + | let $t087308777 = parseAsSell(details) | |
332 | + | let seller = $t087308777._1 | |
333 | + | let priceValue = $t087308777._2 | |
336 | 334 | valueOrElse(isCorrectPayments(paymentAsset, paymentAmount, priceValue), { | |
337 | - | let $ | |
338 | - | let sellerAmount = $ | |
339 | - | let buyerAmount = $ | |
335 | + | let $t088628964 = resultFundsAmounts(isTrustedNft(assetId), paymentAmount, priceValue) | |
336 | + | let sellerAmount = $t088628964._1 | |
337 | + | let buyerAmount = $t088628964._2 | |
340 | 338 | let updatedRes = (baseRes ++ [ScriptTransfer(seller, sellerAmount, unit)]) | |
341 | 339 | if ((buyerAmount > 0)) | |
342 | 340 | then (updatedRes ++ [ScriptTransfer(i.caller, buyerAmount, unit)]) | |
344 | 342 | }) | |
345 | 343 | } | |
346 | 344 | else { | |
347 | - | let $ | |
348 | - | let seller = $ | |
349 | - | let actualPrice = $ | |
345 | + | let $t091819250 = calcPriceAtCurrentMoment(assetId, height) | |
346 | + | let seller = $t091819250._1 | |
347 | + | let actualPrice = $t091819250._2 | |
350 | 348 | valueOrElse(isCorrectPayments(paymentAsset, paymentAmount, actualPrice), { | |
351 | - | let $ | |
352 | - | let sellerAmount = $ | |
353 | - | let buyerAmount = $ | |
349 | + | let $t093369439 = resultFundsAmounts(isTrustedNft(assetId), paymentAmount, actualPrice) | |
350 | + | let sellerAmount = $t093369439._1 | |
351 | + | let buyerAmount = $t093369439._2 | |
354 | 352 | let updatedRes = (baseRes ++ [ScriptTransfer(seller, sellerAmount, unit)]) | |
355 | 353 | if ((buyerAmount > 0)) | |
356 | 354 | then (updatedRes ++ [ScriptTransfer(i.caller, buyerAmount, unit)]) | |
364 | 362 | @Callable(i) | |
365 | 363 | func declineSlot (nftId) = { | |
366 | 364 | let assetId = fromBase58String(nftId) | |
367 | - | let $ | |
368 | - | let type = $ | |
369 | - | let details = $ | |
365 | + | let $t097409778 = getSlot(assetId) | |
366 | + | let type = $t097409778._1 | |
367 | + | let details = $t097409778._2 | |
370 | 368 | let baseRes = [DeleteEntry(getSlotKey(type, assetId))] | |
371 | 369 | if ((type == kSell)) | |
372 | 370 | then { | |
373 | - | let $ | |
374 | - | let seller = $ | |
375 | - | let priceValue = $ | |
371 | + | let $t098709917 = parseAsSell(details) | |
372 | + | let seller = $t098709917._1 | |
373 | + | let priceValue = $t098709917._2 | |
376 | 374 | if (!(isValidCaller(i.caller, seller))) | |
377 | 375 | then throw("Invalid caller") | |
378 | 376 | else (baseRes ++ [ScriptTransfer(seller, 1, assetId)]) | |
379 | 377 | } | |
380 | 378 | else { | |
381 | - | let $ | |
382 | - | let seller = $ | |
383 | - | let startPriceValue = $ | |
384 | - | let endPriceValue = $ | |
385 | - | let startPeriodValue = $ | |
386 | - | let endPeriodValue = $ | |
379 | + | let $t01006210166 = parseAsAuction(details) | |
380 | + | let seller = $t01006210166._1 | |
381 | + | let startPriceValue = $t01006210166._2 | |
382 | + | let endPriceValue = $t01006210166._3 | |
383 | + | let startPeriodValue = $t01006210166._4 | |
384 | + | let endPeriodValue = $t01006210166._5 | |
387 | 385 | if (!(isValidCaller(i.caller, seller))) | |
388 | 386 | then throw("Invalid caller") | |
389 | 387 | else if (!(isAuctionEnded(height, endPeriodValue))) | |
404 | 402 | @Callable(i) | |
405 | 403 | func getPriceAtCurrentMoment (nftId,moment) = { | |
406 | 404 | let assetId = fromBase58String(nftId) | |
407 | - | let $ | |
408 | - | let seller = $ | |
409 | - | let price = $ | |
405 | + | let $t01070710770 = calcPriceAtCurrentMoment(assetId, moment) | |
406 | + | let seller = $t01070710770._1 | |
407 | + | let price = $t01070710770._2 | |
410 | 408 | [IntegerEntry(getPriceKey(assetId), price)] | |
411 | 409 | } | |
412 | 410 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let separator = "_" | |
5 | 5 | ||
6 | 6 | let kAuction = "auction" | |
7 | 7 | ||
8 | 8 | let kSell = "sell" | |
9 | 9 | ||
10 | 10 | let kTrusted = "trusted" | |
11 | 11 | ||
12 | 12 | let kPrice = "price" | |
13 | 13 | ||
14 | 14 | func getSlotKey (prefix,nftId) = ((prefix + separator) + toBase58String(nftId)) | |
15 | 15 | ||
16 | 16 | ||
17 | 17 | func getPriceKey (nftId) = ((kPrice + separator) + toBase58String(nftId)) | |
18 | 18 | ||
19 | 19 | ||
20 | 20 | func getSellKey (nftId) = ((kSell + separator) + toBase58String(nftId)) | |
21 | 21 | ||
22 | 22 | ||
23 | 23 | func getAuctionKey (nftId) = ((kAuction + separator) + toBase58String(nftId)) | |
24 | 24 | ||
25 | 25 | ||
26 | 26 | func getTrustedKey (issuer) = ((kTrusted + separator) + toString(issuer)) | |
27 | 27 | ||
28 | 28 | ||
29 | 29 | func addToList (accum,nextValue) = (accum ++ [nextValue]) | |
30 | 30 | ||
31 | 31 | ||
32 | 32 | func joinString (params) = { | |
33 | 33 | let length = size(params) | |
34 | 34 | if ((length == 0)) | |
35 | 35 | then throw("Empty params") | |
36 | 36 | else if ((length == 1)) | |
37 | 37 | then makeString({ | |
38 | 38 | let $l = params | |
39 | 39 | let $s = size($l) | |
40 | 40 | let $acc0 = nil | |
41 | 41 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
42 | 42 | then $a | |
43 | 43 | else addToList($a, $l[$i]) | |
44 | 44 | ||
45 | 45 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
46 | 46 | then $a | |
47 | 47 | else throw("List size exceeds 1") | |
48 | 48 | ||
49 | 49 | $f0_2($f0_1($acc0, 0), 1) | |
50 | 50 | }, separator) | |
51 | 51 | else if ((length == 2)) | |
52 | 52 | then makeString({ | |
53 | 53 | let $l = params | |
54 | 54 | let $s = size($l) | |
55 | 55 | let $acc0 = nil | |
56 | 56 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
57 | 57 | then $a | |
58 | 58 | else addToList($a, $l[$i]) | |
59 | 59 | ||
60 | 60 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
61 | 61 | then $a | |
62 | 62 | else throw("List size exceeds 2") | |
63 | 63 | ||
64 | 64 | $f0_2($f0_1($f0_1($acc0, 0), 1), 2) | |
65 | 65 | }, separator) | |
66 | 66 | else if ((length == 3)) | |
67 | 67 | then makeString({ | |
68 | 68 | let $l = params | |
69 | 69 | let $s = size($l) | |
70 | 70 | let $acc0 = nil | |
71 | 71 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
72 | 72 | then $a | |
73 | 73 | else addToList($a, $l[$i]) | |
74 | 74 | ||
75 | 75 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
76 | 76 | then $a | |
77 | 77 | else throw("List size exceeds 3") | |
78 | 78 | ||
79 | 79 | $f0_2($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3) | |
80 | 80 | }, separator) | |
81 | 81 | else if ((length == 4)) | |
82 | 82 | then makeString({ | |
83 | 83 | let $l = params | |
84 | 84 | let $s = size($l) | |
85 | 85 | let $acc0 = nil | |
86 | 86 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
87 | 87 | then $a | |
88 | 88 | else addToList($a, $l[$i]) | |
89 | 89 | ||
90 | 90 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
91 | 91 | then $a | |
92 | 92 | else throw("List size exceeds 4") | |
93 | 93 | ||
94 | 94 | $f0_2($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4) | |
95 | 95 | }, separator) | |
96 | 96 | else if ((length == 5)) | |
97 | 97 | then makeString({ | |
98 | 98 | let $l = params | |
99 | 99 | let $s = size($l) | |
100 | 100 | let $acc0 = nil | |
101 | 101 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
102 | 102 | then $a | |
103 | 103 | else addToList($a, $l[$i]) | |
104 | 104 | ||
105 | 105 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
106 | 106 | then $a | |
107 | 107 | else throw("List size exceeds 5") | |
108 | 108 | ||
109 | 109 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5) | |
110 | 110 | }, separator) | |
111 | 111 | else throw("Max number of parameters exceeded") | |
112 | 112 | } | |
113 | 113 | ||
114 | 114 | ||
115 | 115 | func parseAsAuction (details) = { | |
116 | 116 | let res = split(details, separator) | |
117 | 117 | $Tuple5(addressFromStringValue(res[0]), parseIntValue(res[1]), parseIntValue(res[2]), parseIntValue(res[3]), parseIntValue(res[4])) | |
118 | 118 | } | |
119 | 119 | ||
120 | 120 | ||
121 | 121 | func parseAsSell (details) = { | |
122 | 122 | let res = split(details, separator) | |
123 | 123 | $Tuple2(addressFromStringValue(res[0]), parseIntValue(res[1])) | |
124 | 124 | } | |
125 | 125 | ||
126 | 126 | ||
127 | 127 | func joinStruct (params) = match params { | |
128 | - | case auction: (Address, Int, | |
129 | - | joinString([toString(auction._1), toString(auction._2), | |
128 | + | case auction: (Address, Int, String, String) => | |
129 | + | joinString([toString(auction._1), toString(auction._2), auction._3, auction._4]) | |
130 | 130 | case sell: (Address, Int) => | |
131 | 131 | joinString([toString(sell._1), toString(sell._2)]) | |
132 | 132 | case _ => | |
133 | 133 | throw("Wrong params tupple") | |
134 | 134 | } | |
135 | 135 | ||
136 | 136 | ||
137 | - | func setAuction (seller,nftId,startPrice | |
137 | + | func setAuction (seller,nftId,startPrice,start,end) = StringEntry(getAuctionKey(nftId), joinStruct($Tuple4(seller, startPrice, start, end))) | |
138 | 138 | ||
139 | 139 | ||
140 | 140 | func setSell (nftId,celler,price) = StringEntry(getSellKey(nftId), joinStruct($Tuple2(celler, price))) | |
141 | 141 | ||
142 | 142 | ||
143 | 143 | func getAuction (nftId) = value(getString(this, getAuctionKey(nftId))) | |
144 | 144 | ||
145 | 145 | ||
146 | 146 | func getSell (nftId) = value(getString(this, getSellKey(nftId))) | |
147 | 147 | ||
148 | 148 | ||
149 | 149 | func calcPriceAtCurrentMoment (assetId,moment) = { | |
150 | 150 | let details = getAuction(assetId) | |
151 | - | let $ | |
152 | - | let seller = $ | |
153 | - | let startPriceValue = $ | |
154 | - | let endPriceValue = $ | |
155 | - | let startPeriodValue = $ | |
156 | - | let endPeriodValue = $ | |
151 | + | let $t027552859 = parseAsAuction(details) | |
152 | + | let seller = $t027552859._1 | |
153 | + | let startPriceValue = $t027552859._2 | |
154 | + | let endPriceValue = $t027552859._3 | |
155 | + | let startPeriodValue = $t027552859._4 | |
156 | + | let endPeriodValue = $t027552859._5 | |
157 | 157 | if ((moment >= endPeriodValue)) | |
158 | 158 | then $Tuple2(seller, endPriceValue) | |
159 | 159 | else { | |
160 | 160 | let deltaPrice = (startPriceValue - endPriceValue) | |
161 | 161 | let period = (endPeriodValue - startPeriodValue) | |
162 | 162 | let spended = (moment - startPeriodValue) | |
163 | 163 | $Tuple2(seller, (startPriceValue - fraction(spended, deltaPrice, period))) | |
164 | 164 | } | |
165 | 165 | } | |
166 | 166 | ||
167 | 167 | ||
168 | 168 | func isNft (assetId) = match assetInfo(assetId) { | |
169 | 169 | case token: Asset => | |
170 | 170 | if (if ((token.decimals == 0)) | |
171 | 171 | then (token.quantity == 1) | |
172 | 172 | else false) | |
173 | 173 | then (token.reissuable == false) | |
174 | 174 | else false | |
175 | 175 | case _ => | |
176 | 176 | false | |
177 | 177 | } | |
178 | 178 | ||
179 | 179 | ||
180 | 180 | func isTrustedNft (assetId) = { | |
181 | 181 | let issuer = value(assetInfo(assetId)).issuer | |
182 | 182 | valueOrElse(getBoolean(this, getTrustedKey(issuer)), false) | |
183 | 183 | } | |
184 | 184 | ||
185 | 185 | ||
186 | 186 | func isSellExist (assetId) = isDefined(getString(this, getSellKey(assetId))) | |
187 | 187 | ||
188 | 188 | ||
189 | 189 | func isAuctionExist (assetId) = isDefined(getString(this, getAuctionKey(assetId))) | |
190 | 190 | ||
191 | 191 | ||
192 | 192 | func isCorrectSellPrice (price) = (price > 0) | |
193 | - | ||
194 | - | ||
195 | - | func isCorrectAuctionPeriod (start,end) = (end > start) | |
196 | 193 | ||
197 | 194 | ||
198 | 195 | func isCorrectAuctionPrices (startPrice,endPrice) = (startPrice > endPrice) | |
199 | 196 | ||
200 | 197 | ||
201 | 198 | func isAdmin (caller) = (caller == this) | |
202 | 199 | ||
203 | 200 | ||
204 | 201 | func isValidCaller (caller,seller) = if ((caller == this)) | |
205 | 202 | then true | |
206 | 203 | else (caller == seller) | |
207 | 204 | ||
208 | 205 | ||
209 | 206 | func isAuctionEnded (now,end) = (now > end) | |
210 | 207 | ||
211 | 208 | ||
212 | 209 | func isEnoughFunds (payment,currentMomentPrice) = (payment >= currentMomentPrice) | |
213 | 210 | ||
214 | 211 | ||
215 | 212 | func isWawes (assetId) = (assetId == unit) | |
216 | 213 | ||
217 | 214 | ||
218 | 215 | func isCorrectNft (nftId) = if (!(isNft(nftId))) | |
219 | 216 | then throw("Token is not Nft") | |
220 | 217 | else if (isSellExist(nftId)) | |
221 | 218 | then throw("Sell already exists") | |
222 | 219 | else if (isAuctionExist(nftId)) | |
223 | 220 | then throw("Auction already exists") | |
224 | 221 | else unit | |
225 | 222 | ||
226 | 223 | ||
227 | 224 | func isCorrectPayments (paymentAsset,paymentAmount,price) = if (!(isWawes(paymentAsset))) | |
228 | 225 | then throw("Payment must be at WAVES") | |
229 | 226 | else if (!(isEnoughFunds(paymentAmount, price))) | |
230 | 227 | then throw("Not enough funds") | |
231 | 228 | else unit | |
232 | 229 | ||
233 | 230 | ||
234 | 231 | func calcFee () = 0 | |
235 | 232 | ||
236 | 233 | ||
237 | 234 | func calcTrustedFee () = 0 | |
238 | 235 | ||
239 | 236 | ||
240 | 237 | func resultFundsAmounts (isTrusted,paymentAmount,actualPrice) = if (isTrusted) | |
241 | 238 | then $Tuple2((actualPrice - calcTrustedFee()), (paymentAmount - actualPrice)) | |
242 | 239 | else $Tuple2((actualPrice - calcFee()), (paymentAmount - actualPrice)) | |
243 | 240 | ||
244 | 241 | ||
245 | 242 | func getSlot (nftId) = if (isSellExist(nftId)) | |
246 | 243 | then $Tuple2(kSell, getSell(nftId)) | |
247 | 244 | else if (isAuctionExist(nftId)) | |
248 | 245 | then $Tuple2(kAuction, getAuction(nftId)) | |
249 | 246 | else throw("Slot doesn`t exist") | |
250 | 247 | ||
251 | 248 | ||
252 | 249 | let kBuy = "buy" | |
253 | 250 | ||
251 | + | let ASIMI_TOKEN = base58'EbLVSrAi6vS3AkLwBinzZCvAXP2yYiFJEzj1MBVHcwZ5' | |
252 | + | ||
254 | 253 | @Callable(i) | |
255 | 254 | func createNft (nft_name,nft_owner,nft_dAppAddress,nft_type,nft_tags,nft_selling_price,nft_description,nft_onSell,nft_data) = { | |
256 | 255 | let newToken = Issue(nft_name, nft_description, 1, 0, false) | |
257 | 256 | let issueId = calculateAssetId(newToken) | |
258 | 257 | [newToken, ScriptTransfer(i.caller, 1, issueId), StringEntry(((toBase58String(issueId) + separator) + "Owner"), toString(i.caller)), StringEntry(((toBase58String(issueId) + separator) + "nft_type"), nft_type), StringEntry(((toBase58String(issueId) + separator) + "nft_tags"), nft_tags), StringEntry(((toBase58String(issueId) + separator) + "nft_dAppAddress"), nft_dAppAddress), IntegerEntry(((toBase58String(issueId) + separator) + "nft_selling_price"), nft_selling_price), StringEntry(((toBase58String(issueId) + separator) + "nft_onSell"), nft_onSell), StringEntry(((toBase58String(issueId) + separator) + "nft_data"), nft_data)] | |
259 | 258 | } | |
260 | 259 | ||
261 | 260 | ||
262 | 261 | ||
263 | 262 | @Callable(i) | |
264 | 263 | func issueNft (name,meta) = { | |
265 | 264 | let newToken = Issue(name, meta, 1, 0, false) | |
266 | 265 | let issueId = calculateAssetId(newToken) | |
267 | 266 | [newToken, ScriptTransfer(i.caller, 1, issueId), StringEntry(((toBase58String(issueId) + separator) + "Owner"), toString(i.caller))] | |
268 | 267 | } | |
269 | 268 | ||
270 | 269 | ||
271 | 270 | ||
272 | 271 | @Callable(i) | |
273 | 272 | func buyNFT (nftID) = { | |
274 | 273 | let assetId = fromBase58String(nftID) | |
275 | 274 | let amount = value(i.payments[0].amount) | |
275 | + | let amount1 = value(i.payments[1].amount) | |
276 | 276 | let price = valueOrErrorMessage(getString(((kPrice + separator) + nftID)), "There is no price for this NFT") | |
277 | 277 | let owner = valueOrErrorMessage(getStringValue(((nftID + separator) + "Owner")), "No owner") | |
278 | 278 | if ((i.payments[0].assetId != unit)) | |
279 | 279 | then throw("Pay in waves") | |
280 | - | else if ((parseIntValue(price) > amount)) | |
281 | - | then throw("Invalid payment") | |
282 | - | else [ScriptTransfer(i.caller, 1, assetId), ScriptTransfer(value(addressFromString(owner)), parseIntValue(price), unit), StringEntry(((toString(i.caller) + separator) + kBuy), ((nftID + separator) + toString(amount)))] | |
280 | + | else if ((i.payments[1].assetId != ASIMI_TOKEN)) | |
281 | + | then throw("Pay in ASIMI") | |
282 | + | else if ((parseIntValue(price) > amount)) | |
283 | + | then throw("Invalid payment WAVES") | |
284 | + | else [ScriptTransfer(i.caller, 1, assetId), ScriptTransfer(value(addressFromString(owner)), parseIntValue(price), unit), StringEntry(((toString(i.caller) + separator) + kBuy), ((nftID + separator) + toString(amount)))] | |
283 | 285 | } | |
284 | 286 | ||
285 | 287 | ||
286 | 288 | ||
287 | 289 | @Callable(i) | |
288 | 290 | func sellNFT (price) = { | |
289 | - | let $ | |
290 | - | let token0 = $ | |
291 | - | let amount0 = $ | |
291 | + | let $t074127497 = $Tuple2(value(i.payments[0].assetId), value(i.payments[0].amount)) | |
292 | + | let token0 = $t074127497._1 | |
293 | + | let amount0 = $t074127497._2 | |
292 | 294 | if (!(isNft(token0))) | |
293 | 295 | then throw("Token is not NFT") | |
294 | 296 | else [StringEntry(((kPrice + separator) + toBase58String(value(i.payments[0].assetId))), toString(price)), StringEntry(((toString(i.caller) + separator) + kSell), ((toBase58String(token0) + separator) + toString(amount0)))] | |
295 | 297 | } | |
296 | 298 | ||
297 | 299 | ||
298 | 300 | ||
299 | 301 | @Callable(i) | |
300 | 302 | func addSell (price) = { | |
301 | 303 | let nftId = value(i.payments[0].assetId) | |
302 | 304 | valueOrElse(isCorrectNft(nftId), if (!(isCorrectSellPrice(price))) | |
303 | 305 | then throw("Price must be > 0") | |
304 | 306 | else [setSell(nftId, i.caller, price)]) | |
305 | 307 | } | |
306 | 308 | ||
307 | 309 | ||
308 | 310 | ||
309 | 311 | @Callable(i) | |
310 | - | func addAuction (startPrice, | |
312 | + | func addAuction (startPrice,start,end) = { | |
311 | 313 | let nftId = value(i.payments[0].assetId) | |
312 | - | valueOrElse(isCorrectNft(nftId), if (!(isCorrectAuctionPeriod(start, end))) | |
313 | - | then throw("Period is not correct") | |
314 | - | else if (!(isCorrectAuctionPrices(startPrice, endPrice))) | |
315 | - | then throw("Start price must be > endPrice") | |
316 | - | else [setAuction(i.caller, nftId, startPrice, endPrice, start, end), StringEntry(((toBase58String(nftId) + separator) + "nft_owner"), toString(i.caller)), StringEntry(((toBase58String(nftId) + separator) + "nft_type"), nft_type), StringEntry(((toBase58String(nftId) + separator) + "nft_tags"), nft_tags), StringEntry(((toBase58String(nftId) + separator) + "nft_dAppAddress"), nft_dAppAddress), IntegerEntry(((toBase58String(nftId) + separator) + "nft_selling_price"), nft_selling_price), StringEntry(((toBase58String(nftId) + separator) + "nft_onSell"), nft_onSell), StringEntry(((toBase58String(nftId) + separator) + "nft_data"), nft_data)]) | |
314 | + | valueOrElse(isCorrectNft(nftId), [setAuction(i.caller, nftId, startPrice, start, end), StringEntry(((toBase58String(nftId) + separator) + "nft_owner"), toString(i.caller))]) | |
317 | 315 | } | |
318 | 316 | ||
319 | 317 | ||
320 | 318 | ||
321 | 319 | @Callable(i) | |
322 | 320 | func buyFromSlot (nftId) = { | |
323 | - | let $ | |
324 | - | let paymentAsset = $ | |
325 | - | let paymentAmount = $ | |
321 | + | let $t084178506 = $Tuple2(i.payments[0].assetId, value(i.payments[0].amount)) | |
322 | + | let paymentAsset = $t084178506._1 | |
323 | + | let paymentAmount = $t084178506._2 | |
326 | 324 | let assetId = fromBase58String(nftId) | |
327 | - | let $ | |
328 | - | let type = $ | |
329 | - | let details = $ | |
325 | + | let $t085508588 = getSlot(assetId) | |
326 | + | let type = $t085508588._1 | |
327 | + | let details = $t085508588._2 | |
330 | 328 | let baseRes = [ScriptTransfer(i.caller, 1, assetId), DeleteEntry(getSlotKey(type, assetId))] | |
331 | 329 | if ((type == kSell)) | |
332 | 330 | then { | |
333 | - | let $ | |
334 | - | let seller = $ | |
335 | - | let priceValue = $ | |
331 | + | let $t087308777 = parseAsSell(details) | |
332 | + | let seller = $t087308777._1 | |
333 | + | let priceValue = $t087308777._2 | |
336 | 334 | valueOrElse(isCorrectPayments(paymentAsset, paymentAmount, priceValue), { | |
337 | - | let $ | |
338 | - | let sellerAmount = $ | |
339 | - | let buyerAmount = $ | |
335 | + | let $t088628964 = resultFundsAmounts(isTrustedNft(assetId), paymentAmount, priceValue) | |
336 | + | let sellerAmount = $t088628964._1 | |
337 | + | let buyerAmount = $t088628964._2 | |
340 | 338 | let updatedRes = (baseRes ++ [ScriptTransfer(seller, sellerAmount, unit)]) | |
341 | 339 | if ((buyerAmount > 0)) | |
342 | 340 | then (updatedRes ++ [ScriptTransfer(i.caller, buyerAmount, unit)]) | |
343 | 341 | else updatedRes | |
344 | 342 | }) | |
345 | 343 | } | |
346 | 344 | else { | |
347 | - | let $ | |
348 | - | let seller = $ | |
349 | - | let actualPrice = $ | |
345 | + | let $t091819250 = calcPriceAtCurrentMoment(assetId, height) | |
346 | + | let seller = $t091819250._1 | |
347 | + | let actualPrice = $t091819250._2 | |
350 | 348 | valueOrElse(isCorrectPayments(paymentAsset, paymentAmount, actualPrice), { | |
351 | - | let $ | |
352 | - | let sellerAmount = $ | |
353 | - | let buyerAmount = $ | |
349 | + | let $t093369439 = resultFundsAmounts(isTrustedNft(assetId), paymentAmount, actualPrice) | |
350 | + | let sellerAmount = $t093369439._1 | |
351 | + | let buyerAmount = $t093369439._2 | |
354 | 352 | let updatedRes = (baseRes ++ [ScriptTransfer(seller, sellerAmount, unit)]) | |
355 | 353 | if ((buyerAmount > 0)) | |
356 | 354 | then (updatedRes ++ [ScriptTransfer(i.caller, buyerAmount, unit)]) | |
357 | 355 | else updatedRes | |
358 | 356 | }) | |
359 | 357 | } | |
360 | 358 | } | |
361 | 359 | ||
362 | 360 | ||
363 | 361 | ||
364 | 362 | @Callable(i) | |
365 | 363 | func declineSlot (nftId) = { | |
366 | 364 | let assetId = fromBase58String(nftId) | |
367 | - | let $ | |
368 | - | let type = $ | |
369 | - | let details = $ | |
365 | + | let $t097409778 = getSlot(assetId) | |
366 | + | let type = $t097409778._1 | |
367 | + | let details = $t097409778._2 | |
370 | 368 | let baseRes = [DeleteEntry(getSlotKey(type, assetId))] | |
371 | 369 | if ((type == kSell)) | |
372 | 370 | then { | |
373 | - | let $ | |
374 | - | let seller = $ | |
375 | - | let priceValue = $ | |
371 | + | let $t098709917 = parseAsSell(details) | |
372 | + | let seller = $t098709917._1 | |
373 | + | let priceValue = $t098709917._2 | |
376 | 374 | if (!(isValidCaller(i.caller, seller))) | |
377 | 375 | then throw("Invalid caller") | |
378 | 376 | else (baseRes ++ [ScriptTransfer(seller, 1, assetId)]) | |
379 | 377 | } | |
380 | 378 | else { | |
381 | - | let $ | |
382 | - | let seller = $ | |
383 | - | let startPriceValue = $ | |
384 | - | let endPriceValue = $ | |
385 | - | let startPeriodValue = $ | |
386 | - | let endPeriodValue = $ | |
379 | + | let $t01006210166 = parseAsAuction(details) | |
380 | + | let seller = $t01006210166._1 | |
381 | + | let startPriceValue = $t01006210166._2 | |
382 | + | let endPriceValue = $t01006210166._3 | |
383 | + | let startPeriodValue = $t01006210166._4 | |
384 | + | let endPeriodValue = $t01006210166._5 | |
387 | 385 | if (!(isValidCaller(i.caller, seller))) | |
388 | 386 | then throw("Invalid caller") | |
389 | 387 | else if (!(isAuctionEnded(height, endPeriodValue))) | |
390 | 388 | then throw("Wait for end of auction") | |
391 | 389 | else (baseRes ++ [ScriptTransfer(seller, 1, assetId)]) | |
392 | 390 | } | |
393 | 391 | } | |
394 | 392 | ||
395 | 393 | ||
396 | 394 | ||
397 | 395 | @Callable(i) | |
398 | 396 | func setTrustedIssuer (trustedAddr) = if (!(isAdmin(i.caller))) | |
399 | 397 | then throw("Only admin") | |
400 | 398 | else [BooleanEntry(getTrustedKey(addressFromStringValue(trustedAddr)), true)] | |
401 | 399 | ||
402 | 400 | ||
403 | 401 | ||
404 | 402 | @Callable(i) | |
405 | 403 | func getPriceAtCurrentMoment (nftId,moment) = { | |
406 | 404 | let assetId = fromBase58String(nftId) | |
407 | - | let $ | |
408 | - | let seller = $ | |
409 | - | let price = $ | |
405 | + | let $t01070710770 = calcPriceAtCurrentMoment(assetId, moment) | |
406 | + | let seller = $t01070710770._1 | |
407 | + | let price = $t01070710770._2 | |
410 | 408 | [IntegerEntry(getPriceKey(assetId), price)] | |
411 | 409 | } | |
412 | 410 | ||
413 | 411 |
github/deemru/w8io/169f3d6 76.13 ms ◑