tx · 5p8LUKmcLET4n6q1Ck9r3YqQDJGHqL6dv4qdkPFWDpqp 3N4ishKFoRooDxWoaCWSp3CUEoDmVepA1bz: -0.01700000 Waves 2023.12.02 08:57 [2868628] smart account 3N4ishKFoRooDxWoaCWSp3CUEoDmVepA1bz > SELF 0.00000000 Waves
{ "type": 13, "id": "5p8LUKmcLET4n6q1Ck9r3YqQDJGHqL6dv4qdkPFWDpqp", "fee": 1700000, "feeAssetId": null, "timestamp": 1701496669608, "version": 2, "chainId": 84, "sender": "3N4ishKFoRooDxWoaCWSp3CUEoDmVepA1bz", "senderPublicKey": "9p5EiEVtTgiMBxj67TfVfstKuQs1LHPxoZRiRhyS5oiN", "proofs": [ "5vP42UTsFAPmZwtCfdLj2CDtDKpXNr187PzD5WGc9oDLs1GGKoFkvzDUD8BrZE1PcUeda8mt6H3TUiBS757zDw8n" ], "script": "base64:BgI5CAISBAoCCAgSBAoCBAgSBAoCAQgSBQoDCAEIEgMKAQgSAwoBCBIDCgEIEgUKAwgICBIGCgQICAgILQAHVkVSU0lPTgIFMS4wLjABCWdldFN0ckJ5SwEDa2V5CQELdmFsdWVPckVsc2UCCQCdCAIFBHRoaXMFA2tleQIAAAlvcmFjbGVGZWUJAQV2YWx1ZQEJAKYIAQkBCWdldFN0ckJ5SwECD2NvbmZfb3JhY2xlX2ZlZQALZmVlUmVjZWl2ZXIJAQlnZXRTdHJCeUsBAhFjb25mX2ZlZV9yZWNlaXZlcgAPcHV6emxlX2FydF9wb29sCQEJZ2V0U3RyQnlLAQIUY29uZl9wdXp6bGVfYXJ0X3Bvb2wAE3NpZ25BcnRBcnR3b3Jrc0RhcHAJAQV2YWx1ZQEJAKYIAQkBCWdldFN0ckJ5SwECEmNvbmZfYXJ0d29ya3NfZGFwcAARdXNkdFBQQXNzZXRJZF9zdHIJAQlnZXRTdHJCeUsBAhtjb25mX2FjY2VwdGVkX2Fzc2V0X1VTRFRfUFAADmFydEFzc2V0SWRfc3RyCQEJZ2V0U3RyQnl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FTExFRAkArAICCQCsAgIJAKwCAgkArAICBQdiaWREYXRhAgtfQ0FOQ0VMTEVEXwkApAMBBQRkYXRlAgFfBQJpZAkAzAgCCQEOU2NyaXB0VHJhbnNmZXIDCQEHQWRkcmVzcwEJANkEAQUGY2FsbGVyCQENcGFyc2VJbnRWYWx1ZQEJAJEDAgUKYmlkRGF0YUFycgABBQdhc3NldElkBQNuaWwAb5/Raw==", "height": 2868628, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 6x6BFzVViP7SrVmLsgNstymLW2yUySjaygCz1366RHTc Next: H3DWjkznvZfxRAjQXMqJqiDDyUP2CdTAgARUBUnj2iXg Diff:
Old | New | Differences | |
---|---|---|---|
164 | 164 | } | |
165 | 165 | ||
166 | 166 | ||
167 | - | func validateMinSell (price) = if ((0 > | |
167 | + | func validateMinSell (price) = if ((0 > price)) | |
168 | 168 | then throw("Wrong minimum sell price") | |
169 | 169 | else true | |
170 | 170 | ||
171 | 171 | ||
172 | 172 | func provideBaseData (i,nftId) = { | |
173 | - | let $ | |
174 | - | let id = $ | |
175 | - | let caller = $ | |
176 | - | let date = $ | |
173 | + | let $t051955235 = idCallerDate(i) | |
174 | + | let id = $t051955235._1 | |
175 | + | let caller = $t051955235._2 | |
176 | + | let date = $t051955235._3 | |
177 | 177 | let assetDetails = value(assetInfo(fromBase58String(nftId))) | |
178 | 178 | let isValidNFT = NFTIsValid(assetDetails) | |
179 | 179 | $Tuple5(id, caller, date, isValidNFT, assetDetails.issuer) | |
217 | 217 | ||
218 | 218 | @Callable(i) | |
219 | 219 | func sellNFT (price,asset) = { | |
220 | - | let $ | |
221 | - | let payment = $ | |
222 | - | let amount = $ | |
220 | + | let $t065706606 = isPayment(i) | |
221 | + | let payment = $t065706606._1 | |
222 | + | let amount = $t065706606._2 | |
223 | 223 | if ((amount != 1)) | |
224 | 224 | then throw("No NFT attached") | |
225 | 225 | else { | |
226 | 226 | let nftId = if (isDefined(payment.assetId)) | |
227 | 227 | then toBase58String(value(payment.assetId)) | |
228 | 228 | else throw("Waves is not a NFT.") | |
229 | - | let $ | |
230 | - | let id = $ | |
231 | - | let caller = $ | |
232 | - | let date = $ | |
233 | - | let isValidNFT = $ | |
234 | - | let issuer = $ | |
229 | + | let $t067926862 = provideBaseData(i, nftId) | |
230 | + | let id = $t067926862._1 | |
231 | + | let caller = $t067926862._2 | |
232 | + | let date = $t067926862._3 | |
233 | + | let isValidNFT = $t067926862._4 | |
234 | + | let issuer = $t067926862._5 | |
235 | 235 | if (!(isValidNFT)) | |
236 | 236 | then throw("Not a valid nft") | |
237 | 237 | else if ((issuer == signArtArtworksDapp)) | |
250 | 250 | ||
251 | 251 | @Callable(i) | |
252 | 252 | func updateSalePrice (nftId,price,asset) = { | |
253 | - | let $ | |
254 | - | let id = $ | |
255 | - | let caller = $ | |
256 | - | let date = $ | |
257 | - | let isValidNFT = $ | |
258 | - | let issuer = $ | |
253 | + | let $t077717841 = provideBaseData(i, nftId) | |
254 | + | let id = $t077717841._1 | |
255 | + | let caller = $t077717841._2 | |
256 | + | let date = $t077717841._3 | |
257 | + | let isValidNFT = $t077717841._4 | |
258 | + | let issuer = $t077717841._5 | |
259 | 259 | if (!(isValidNFT)) | |
260 | 260 | then throw("Not a valid nft") | |
261 | 261 | else { | |
283 | 283 | ||
284 | 284 | @Callable(i) | |
285 | 285 | func cancelSale (nftId) = { | |
286 | - | let $ | |
287 | - | let id = $ | |
288 | - | let caller = $ | |
289 | - | let date = $ | |
290 | - | let isValidNFT = $ | |
291 | - | let issuer = $ | |
286 | + | let $t088939111 = provideBaseData(i, nftId) | |
287 | + | let id = $t088939111._1 | |
288 | + | let caller = $t088939111._2 | |
289 | + | let date = $t088939111._3 | |
290 | + | let isValidNFT = $t088939111._4 | |
291 | + | let issuer = $t088939111._5 | |
292 | 292 | let saleOwner = getStrByK(("current_owner_on_dapp_" + nftId)) | |
293 | 293 | if ((saleOwner != caller)) | |
294 | 294 | then throw("You don't own this NFT") | |
308 | 308 | ||
309 | 309 | @Callable(i) | |
310 | 310 | func buyNFT (nftId) = { | |
311 | - | let $ | |
312 | - | let id = $ | |
313 | - | let caller = $ | |
314 | - | let date = $ | |
315 | - | let isValidNFT = $ | |
316 | - | let issuer = $ | |
311 | + | let $t0994210012 = provideBaseData(i, nftId) | |
312 | + | let id = $t0994210012._1 | |
313 | + | let caller = $t0994210012._2 | |
314 | + | let date = $t0994210012._3 | |
315 | + | let isValidNFT = $t0994210012._4 | |
316 | + | let issuer = $t0994210012._5 | |
317 | 317 | if (!(isValidNFT)) | |
318 | 318 | then throw("Not a valid nft") | |
319 | 319 | else { | |
327 | 327 | if ((parseInt(saleInfoArray[1]) == 0)) | |
328 | 328 | then throw("Offer only") | |
329 | 329 | else { | |
330 | - | let $ | |
331 | - | let payment = $ | |
332 | - | let amount = $ | |
330 | + | let $t01041110447 = isPayment(i) | |
331 | + | let payment = $t01041110447._1 | |
332 | + | let amount = $t01041110447._2 | |
333 | 333 | let paymentAssetStr = if (isDefined(payment.assetId)) | |
334 | 334 | then toBase58String(value(payment.assetId)) | |
335 | 335 | else "" | |
338 | 338 | else (saleInfoArray[2] != paymentAssetStr)) | |
339 | 339 | then throw("Payment infos don't match.") | |
340 | 340 | else { | |
341 | - | let $ | |
342 | - | let commissions = $ | |
343 | - | let ownerFee = $ | |
344 | - | let collectorNFT = $ | |
341 | + | let $t01096111068 = setTransfers(amount, payment.assetId, nftId, saleOwner, caller) | |
342 | + | let commissions = $t01096111068._1 | |
343 | + | let ownerFee = $t01096111068._2 | |
344 | + | let collectorNFT = $t01096111068._3 | |
345 | 345 | [DeleteEntry((saleKey + "_OPEN")), DeleteEntry(((("sale2nd_status_" + saleOwner) + "_") + nftId)), DeleteEntry(("current_owner_on_dapp_" + nftId)), StringEntry((((saleKey + "_") + id) + "_CLOSED"), ((((((saleInfo + "_CLOSED_") + toString(date)) + "_") + id) + "_") + caller)), updateNumSales(), ownerFee, collectorNFT, commissions] | |
346 | 346 | } | |
347 | 347 | } | |
353 | 353 | ||
354 | 354 | @Callable(i) | |
355 | 355 | func setOffer (nftId) = { | |
356 | - | let $ | |
357 | - | let id = $ | |
358 | - | let offerOwner = $ | |
359 | - | let date = $ | |
360 | - | let isValidNFT = $ | |
361 | - | let issuer = $ | |
356 | + | let $t01146711541 = provideBaseData(i, nftId) | |
357 | + | let id = $t01146711541._1 | |
358 | + | let offerOwner = $t01146711541._2 | |
359 | + | let date = $t01146711541._3 | |
360 | + | let isValidNFT = $t01146711541._4 | |
361 | + | let issuer = $t01146711541._5 | |
362 | 362 | if (!(isValidNFT)) | |
363 | 363 | then throw("Not a valid nft") | |
364 | 364 | else { | |
365 | - | let $ | |
366 | - | let payment = $ | |
367 | - | let amount = $ | |
365 | + | let $t01160211638 = isPayment(i) | |
366 | + | let payment = $t01160211638._1 | |
367 | + | let amount = $t01160211638._2 | |
368 | 368 | let assetId = if (!(isDefined(payment.assetId))) | |
369 | 369 | then "WAVES" | |
370 | 370 | else toBase58String(value(payment.assetId)) | |
385 | 385 | ||
386 | 386 | @Callable(i) | |
387 | 387 | func acceptOffer (nftId,offerId,offerOwner) = { | |
388 | - | let $ | |
389 | - | let id = $ | |
390 | - | let caller = $ | |
391 | - | let date = $ | |
392 | - | let isValidNFT = $ | |
393 | - | let issuer = $ | |
388 | + | let $t01242712497 = provideBaseData(i, nftId) | |
389 | + | let id = $t01242712497._1 | |
390 | + | let caller = $t01242712497._2 | |
391 | + | let date = $t01242712497._3 | |
392 | + | let isValidNFT = $t01242712497._4 | |
393 | + | let issuer = $t01242712497._5 | |
394 | 394 | if (!(isValidNFT)) | |
395 | 395 | then throw("Not a valid nft") | |
396 | 396 | else { | |
399 | 399 | then throw("Only sale owner can accept offer") | |
400 | 400 | else { | |
401 | 401 | let bidKey = getBidKey(offerOwner, nftId, saleOwner, offerId) | |
402 | - | let $ | |
403 | - | let bidDataArr = $ | |
404 | - | let assetId = $ | |
405 | - | let bidData = $ | |
402 | + | let $t01275112806 = getBidData(bidKey) | |
403 | + | let bidDataArr = $t01275112806._1 | |
404 | + | let assetId = $t01275112806._2 | |
405 | + | let bidData = $t01275112806._3 | |
406 | 406 | let saleKey = getSaleKey(saleOwner, nftId, toString(issuer)) | |
407 | 407 | let saleInfo = getStrByK((saleKey + "_OPEN")) | |
408 | 408 | if ((size(saleInfo) == 0)) | |
409 | 409 | then throw("Sale Not found!") | |
410 | 410 | else { | |
411 | 411 | let amount = value(parseInt(bidDataArr[1])) | |
412 | - | let $ | |
413 | - | let commissions = $ | |
414 | - | let ownerFee = $ | |
415 | - | let collectorNFT = $ | |
412 | + | let $t01304213148 = setTransfers(amount, assetId, nftId, saleOwner, bidDataArr[6]) | |
413 | + | let commissions = $t01304213148._1 | |
414 | + | let ownerFee = $t01304213148._2 | |
415 | + | let collectorNFT = $t01304213148._3 | |
416 | 416 | let assetIdStr = if (isDefined(assetId)) | |
417 | 417 | then toBase58String(value(assetId)) | |
418 | 418 | else "WAVES" | |
426 | 426 | ||
427 | 427 | @Callable(i) | |
428 | 428 | func cancelOffer (nftId,offerId,offerOwner,saleOwner) = { | |
429 | - | let $ | |
430 | - | let id = $ | |
431 | - | let caller = $ | |
432 | - | let date = $ | |
429 | + | let $t01393614010 = idCallerDate(i) | |
430 | + | let id = $t01393614010._1 | |
431 | + | let caller = $t01393614010._2 | |
432 | + | let date = $t01393614010._3 | |
433 | 433 | if (if ((caller != offerOwner)) | |
434 | 434 | then (caller != saleOwner) | |
435 | 435 | else false) | |
436 | 436 | then throw("You cannot cancel this offer.") | |
437 | 437 | else { | |
438 | 438 | let bidKey = getBidKey(offerOwner, nftId, saleOwner, offerId) | |
439 | - | let $ | |
440 | - | let bidDataArr = $ | |
441 | - | let assetId = $ | |
442 | - | let bidData = $ | |
439 | + | let $t01418214237 = getBidData(bidKey) | |
440 | + | let bidDataArr = $t01418214237._1 | |
441 | + | let assetId = $t01418214237._2 | |
442 | + | let bidData = $t01418214237._3 | |
443 | 443 | [DeleteEntry((bidKey + "_OPEN")), StringEntry((bidKey + "_CANCELLED"), ((((bidData + "_CANCELLED_") + toString(date)) + "_") + id)), ScriptTransfer(Address(fromBase58String(caller)), parseIntValue(bidDataArr[1]), assetId)] | |
444 | 444 | } | |
445 | 445 | } |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let VERSION = "1.0.0" | |
5 | 5 | ||
6 | 6 | func getStrByK (key) = valueOrElse(getString(this, key), "") | |
7 | 7 | ||
8 | 8 | ||
9 | 9 | let oracleFee = value(addressFromString(getStrByK("conf_oracle_fee"))) | |
10 | 10 | ||
11 | 11 | let feeReceiver = getStrByK("conf_fee_receiver") | |
12 | 12 | ||
13 | 13 | let puzzle_art_pool = getStrByK("conf_puzzle_art_pool") | |
14 | 14 | ||
15 | 15 | let signArtArtworksDapp = value(addressFromString(getStrByK("conf_artworks_dapp"))) | |
16 | 16 | ||
17 | 17 | let usdtPPAssetId_str = getStrByK("conf_accepted_asset_USDT_PP") | |
18 | 18 | ||
19 | 19 | let artAssetId_str = getStrByK("conf_accepted_asset_ART") | |
20 | 20 | ||
21 | 21 | let usdcPPAssetId_str = getStrByK("conf_accepted_asset_USDC_PP") | |
22 | 22 | ||
23 | 23 | let eastAssetId_str = getStrByK("conf_accepted_asset_EAST") | |
24 | 24 | ||
25 | 25 | let puzzleAssetId_str = getStrByK("conf_accepted_asset_PUZZLE") | |
26 | 26 | ||
27 | 27 | let ethPPAssetId_str = getStrByK("conf_accepted_asset_ETH_PP") | |
28 | 28 | ||
29 | 29 | let wavesAssetId_str = "WAVES" | |
30 | 30 | ||
31 | 31 | let usdtPPAssetId = fromBase58String(usdtPPAssetId_str) | |
32 | 32 | ||
33 | 33 | let artAssetId = fromBase58String(artAssetId_str) | |
34 | 34 | ||
35 | 35 | let usdcPPAssetId = fromBase58String(usdcPPAssetId_str) | |
36 | 36 | ||
37 | 37 | let eastAssetId = fromBase58String(eastAssetId_str) | |
38 | 38 | ||
39 | 39 | let puzzleAssetId = fromBase58String(puzzleAssetId_str) | |
40 | 40 | ||
41 | 41 | let ethPPAssetId = fromBase58String(ethPPAssetId_str) | |
42 | 42 | ||
43 | 43 | let wavesAssetId = base58'' | |
44 | 44 | ||
45 | 45 | let all_accepted_assets = [usdtPPAssetId_str, artAssetId_str, usdcPPAssetId_str, eastAssetId_str, puzzleAssetId_str, wavesAssetId_str, ethPPAssetId_str] | |
46 | 46 | ||
47 | 47 | let chris = getStrByK("conf_admin_1") | |
48 | 48 | ||
49 | 49 | let commission_fee = 3 | |
50 | 50 | ||
51 | 51 | let dappRunningKey = "conf_dapp_is_running" | |
52 | 52 | ||
53 | 53 | let maintenanceMSGKey = "conf_maintenance_msg" | |
54 | 54 | ||
55 | 55 | let dappRunning = valueOrElse(getBoolean(this, dappRunningKey), true) | |
56 | 56 | ||
57 | 57 | let maintenanceMSG = valueOrElse(getString(this, maintenanceMSGKey), "") | |
58 | 58 | ||
59 | 59 | let numSalesK = "num_sales" | |
60 | 60 | ||
61 | 61 | func getIntByK (key) = valueOrElse(getInteger(this, key), 0) | |
62 | 62 | ||
63 | 63 | ||
64 | 64 | func getSaleKey (caller,nftId,issuer) = ((((("sale2nd_info_" + caller) + "_") + nftId) + "_") + issuer) | |
65 | 65 | ||
66 | 66 | ||
67 | 67 | func getBidKey (offerOwner,nftId,saleOwner,offerId) = ((((((("offer2nd_" + offerOwner) + "_") + nftId) + "_") + saleOwner) + "_") + offerId) | |
68 | 68 | ||
69 | 69 | ||
70 | 70 | func getIntByKFromOracle (key) = valueOrErrorMessage(getInteger(oracleFee, key), "Integer undefine or 0 in oracle") | |
71 | 71 | ||
72 | 72 | ||
73 | 73 | func idCallerDate (i) = if (!(dappRunning)) | |
74 | 74 | then throw(maintenanceMSG) | |
75 | 75 | else $Tuple3(toBase58String(i.transactionId), toBase58String(i.caller.bytes), lastBlock.timestamp) | |
76 | 76 | ||
77 | 77 | ||
78 | 78 | func isPayment (i) = if ((size(i.payments) == 0)) | |
79 | 79 | then throw("No payment attached") | |
80 | 80 | else { | |
81 | 81 | let payment = value(i.payments[0]) | |
82 | 82 | let amount = value(payment.amount) | |
83 | 83 | $Tuple2(payment, amount) | |
84 | 84 | } | |
85 | 85 | ||
86 | 86 | ||
87 | 87 | func NFTIsValid (assetDetails) = if (if ((assetDetails.quantity == 1)) | |
88 | 88 | then (assetDetails.decimals == 0) | |
89 | 89 | else false) | |
90 | 90 | then (assetDetails.reissuable == false) | |
91 | 91 | else false | |
92 | 92 | ||
93 | 93 | ||
94 | 94 | func acceptedAssetIds (assetId) = if (!(containsElement(all_accepted_assets, assetId))) | |
95 | 95 | then throw("Only $ART, USDT-PP, USDC-PP, EAST, PUZZLE, ETH or WAVES accepted") | |
96 | 96 | else true | |
97 | 97 | ||
98 | 98 | ||
99 | 99 | func getBidAssetId (assetId) = if ((assetId == "WAVES")) | |
100 | 100 | then unit | |
101 | 101 | else fromBase58String(assetId) | |
102 | 102 | ||
103 | 103 | ||
104 | 104 | func getSaleOwnerAndStatus (nftid) = { | |
105 | 105 | let saleOwner = getStrByK(("current_owner_on_dapp_" + nftid)) | |
106 | 106 | if ((size(saleOwner) == 0)) | |
107 | 107 | then throw("NFT not found") | |
108 | 108 | else { | |
109 | 109 | let saleStatus = getStrByK(((("sale2nd_status_" + saleOwner) + "_") + nftid)) | |
110 | 110 | if ((saleStatus != "OPEN")) | |
111 | 111 | then throw("NFT not for sale") | |
112 | 112 | else saleOwner | |
113 | 113 | } | |
114 | 114 | } | |
115 | 115 | ||
116 | 116 | ||
117 | 117 | func getBidData (key) = { | |
118 | 118 | let bidData = getStrByK((key + "_OPEN")) | |
119 | 119 | if ((bidData == "")) | |
120 | 120 | then throw("Offer not found") | |
121 | 121 | else { | |
122 | 122 | let bidDataArr = split(bidData, "_") | |
123 | 123 | let assetId = getBidAssetId(bidDataArr[2]) | |
124 | 124 | $Tuple3(bidDataArr, assetId, bidData) | |
125 | 125 | } | |
126 | 126 | } | |
127 | 127 | ||
128 | 128 | ||
129 | 129 | func getBalance (assetId) = match assetId { | |
130 | 130 | case b: ByteVector => | |
131 | 131 | assetBalance(this, b) | |
132 | 132 | case _ => | |
133 | 133 | wavesBalance(this).available | |
134 | 134 | } | |
135 | 135 | ||
136 | 136 | ||
137 | 137 | func setTransfers (amount,assetId,nftid,saleOwner,caller) = { | |
138 | 138 | let amountForSign = fraction(amount, commission_fee, 100) | |
139 | 139 | let amountForOwner = (amount - amountForSign) | |
140 | 140 | let amount_commission_for_sign_to_swap = amountForSign | |
141 | 141 | let amount_art_before = getBalance(artAssetId) | |
142 | 142 | if ((amount_art_before == amount_art_before)) | |
143 | 143 | then { | |
144 | 144 | let swap_fee_to_art = if ((assetId != artAssetId)) | |
145 | 145 | then invoke(Address(fromBase58String(puzzle_art_pool)), "swap", [artAssetId_str, 1], [AttachedPayment(assetId, amount_commission_for_sign_to_swap)]) | |
146 | 146 | else unit | |
147 | 147 | if ((swap_fee_to_art == swap_fee_to_art)) | |
148 | 148 | then { | |
149 | 149 | let amount_art_after = getBalance(artAssetId) | |
150 | 150 | if ((amount_art_after == amount_art_after)) | |
151 | 151 | then { | |
152 | 152 | let commissions = ScriptTransfer(Address(fromBase58String(feeReceiver)), if ((assetId == artAssetId)) | |
153 | 153 | then amountForSign | |
154 | 154 | else (amount_art_after - amount_art_before), artAssetId) | |
155 | 155 | let ownerFee = ScriptTransfer(Address(fromBase58String(saleOwner)), amountForOwner, assetId) | |
156 | 156 | let collectorNFT = ScriptTransfer(Address(fromBase58String(caller)), 1, fromBase58String(nftid)) | |
157 | 157 | $Tuple3(commissions, ownerFee, collectorNFT) | |
158 | 158 | } | |
159 | 159 | else throw("Strict value is not equal to itself.") | |
160 | 160 | } | |
161 | 161 | else throw("Strict value is not equal to itself.") | |
162 | 162 | } | |
163 | 163 | else throw("Strict value is not equal to itself.") | |
164 | 164 | } | |
165 | 165 | ||
166 | 166 | ||
167 | - | func validateMinSell (price) = if ((0 > | |
167 | + | func validateMinSell (price) = if ((0 > price)) | |
168 | 168 | then throw("Wrong minimum sell price") | |
169 | 169 | else true | |
170 | 170 | ||
171 | 171 | ||
172 | 172 | func provideBaseData (i,nftId) = { | |
173 | - | let $ | |
174 | - | let id = $ | |
175 | - | let caller = $ | |
176 | - | let date = $ | |
173 | + | let $t051955235 = idCallerDate(i) | |
174 | + | let id = $t051955235._1 | |
175 | + | let caller = $t051955235._2 | |
176 | + | let date = $t051955235._3 | |
177 | 177 | let assetDetails = value(assetInfo(fromBase58String(nftId))) | |
178 | 178 | let isValidNFT = NFTIsValid(assetDetails) | |
179 | 179 | $Tuple5(id, caller, date, isValidNFT, assetDetails.issuer) | |
180 | 180 | } | |
181 | 181 | ||
182 | 182 | ||
183 | 183 | func updateNumSales () = { | |
184 | 184 | let numSales = getIntByK(numSalesK) | |
185 | 185 | IntegerEntry(numSalesK, (numSales + 1)) | |
186 | 186 | } | |
187 | 187 | ||
188 | 188 | ||
189 | 189 | func haveSTD (issuer,ndftId) = { | |
190 | 190 | let data = valueOrElse(getString(Address(fromBase58String(issuer)), (("std_nft_" + ndftId) + "_metadata")), "") | |
191 | 191 | (data != "") | |
192 | 192 | } | |
193 | 193 | ||
194 | 194 | ||
195 | 195 | @Callable(invoke) | |
196 | 196 | func setConf (key,val) = { | |
197 | 197 | let caller = toString(invoke.caller) | |
198 | 198 | if (containsElement([chris, toString(this)], caller)) | |
199 | 199 | then if (contains(key, "conf_")) | |
200 | 200 | then [StringEntry(key, val)] | |
201 | 201 | else throw("Entries starting with conf_ only") | |
202 | 202 | else throw("You are not allowed to change this") | |
203 | 203 | } | |
204 | 204 | ||
205 | 205 | ||
206 | 206 | ||
207 | 207 | @Callable(invoke) | |
208 | 208 | func appRunning (isLive,message) = { | |
209 | 209 | let caller = toString(invoke.caller) | |
210 | 210 | let id = toBase58String(invoke.transactionId) | |
211 | 211 | if (containsElement([chris, toString(this)], caller)) | |
212 | 212 | then [BooleanEntry(dappRunningKey, isLive), StringEntry(maintenanceMSGKey, message)] | |
213 | 213 | else throw("You are not allowed to change this") | |
214 | 214 | } | |
215 | 215 | ||
216 | 216 | ||
217 | 217 | ||
218 | 218 | @Callable(i) | |
219 | 219 | func sellNFT (price,asset) = { | |
220 | - | let $ | |
221 | - | let payment = $ | |
222 | - | let amount = $ | |
220 | + | let $t065706606 = isPayment(i) | |
221 | + | let payment = $t065706606._1 | |
222 | + | let amount = $t065706606._2 | |
223 | 223 | if ((amount != 1)) | |
224 | 224 | then throw("No NFT attached") | |
225 | 225 | else { | |
226 | 226 | let nftId = if (isDefined(payment.assetId)) | |
227 | 227 | then toBase58String(value(payment.assetId)) | |
228 | 228 | else throw("Waves is not a NFT.") | |
229 | - | let $ | |
230 | - | let id = $ | |
231 | - | let caller = $ | |
232 | - | let date = $ | |
233 | - | let isValidNFT = $ | |
234 | - | let issuer = $ | |
229 | + | let $t067926862 = provideBaseData(i, nftId) | |
230 | + | let id = $t067926862._1 | |
231 | + | let caller = $t067926862._2 | |
232 | + | let date = $t067926862._3 | |
233 | + | let isValidNFT = $t067926862._4 | |
234 | + | let issuer = $t067926862._5 | |
235 | 235 | if (!(isValidNFT)) | |
236 | 236 | then throw("Not a valid nft") | |
237 | 237 | else if ((issuer == signArtArtworksDapp)) | |
238 | 238 | then throw("This dApp is only for NFT issued outside SIGN Art dApp.") | |
239 | 239 | else if (!(haveSTD(toString(issuer), nftId))) | |
240 | 240 | then throw("No nft standard found on issuer account") | |
241 | 241 | else if (!(acceptedAssetIds(asset))) | |
242 | 242 | then throw("Only $ART, USDT-PP, USDC-PP, EAST, PUZZLE, ETH or WAVES accepted") | |
243 | 243 | else if (!(validateMinSell(price))) | |
244 | 244 | then throw("Wrong minimum sell price") | |
245 | 245 | else [StringEntry((getSaleKey(caller, nftId, toString(issuer)) + "_OPEN"), ((((((((((toString(date) + "_") + toString(price)) + "_") + asset) + "_") + nftId) + "_") + toString(issuer)) + "_") + id)), StringEntry(((("sale2nd_status_" + caller) + "_") + nftId), "OPEN"), StringEntry(("current_owner_on_dapp_" + nftId), caller)] | |
246 | 246 | } | |
247 | 247 | } | |
248 | 248 | ||
249 | 249 | ||
250 | 250 | ||
251 | 251 | @Callable(i) | |
252 | 252 | func updateSalePrice (nftId,price,asset) = { | |
253 | - | let $ | |
254 | - | let id = $ | |
255 | - | let caller = $ | |
256 | - | let date = $ | |
257 | - | let isValidNFT = $ | |
258 | - | let issuer = $ | |
253 | + | let $t077717841 = provideBaseData(i, nftId) | |
254 | + | let id = $t077717841._1 | |
255 | + | let caller = $t077717841._2 | |
256 | + | let date = $t077717841._3 | |
257 | + | let isValidNFT = $t077717841._4 | |
258 | + | let issuer = $t077717841._5 | |
259 | 259 | if (!(isValidNFT)) | |
260 | 260 | then throw("Not a valid nft") | |
261 | 261 | else { | |
262 | 262 | let saleOwner = getStrByK(("current_owner_on_dapp_" + nftId)) | |
263 | 263 | if ((saleOwner != caller)) | |
264 | 264 | then throw("You don't own this NFT") | |
265 | 265 | else { | |
266 | 266 | let saleStatus = getStrByK(((("sale2nd_status_" + caller) + "_") + nftId)) | |
267 | 267 | if ((saleStatus != "OPEN")) | |
268 | 268 | then throw("Sale not active") | |
269 | 269 | else if (!(acceptedAssetIds(asset))) | |
270 | 270 | then throw("Only $ART, USDT-PP, USDC-PP, EAST, PUZZLE, ETH or WAVES accepted") | |
271 | 271 | else if (!(validateMinSell(price))) | |
272 | 272 | then throw("Wrong minimum sell price") | |
273 | 273 | else { | |
274 | 274 | let saleKey = getSaleKey(caller, nftId, toString(issuer)) | |
275 | 275 | let saleInfo = split(getStrByK((saleKey + "_OPEN")), "_") | |
276 | 276 | [StringEntry((saleKey + "_OPEN"), ((((((((((saleInfo[0] + "_") + toString(price)) + "_") + asset) + "_") + saleInfo[3]) + "_") + saleInfo[4]) + "_") + saleInfo[5]))] | |
277 | 277 | } | |
278 | 278 | } | |
279 | 279 | } | |
280 | 280 | } | |
281 | 281 | ||
282 | 282 | ||
283 | 283 | ||
284 | 284 | @Callable(i) | |
285 | 285 | func cancelSale (nftId) = { | |
286 | - | let $ | |
287 | - | let id = $ | |
288 | - | let caller = $ | |
289 | - | let date = $ | |
290 | - | let isValidNFT = $ | |
291 | - | let issuer = $ | |
286 | + | let $t088939111 = provideBaseData(i, nftId) | |
287 | + | let id = $t088939111._1 | |
288 | + | let caller = $t088939111._2 | |
289 | + | let date = $t088939111._3 | |
290 | + | let isValidNFT = $t088939111._4 | |
291 | + | let issuer = $t088939111._5 | |
292 | 292 | let saleOwner = getStrByK(("current_owner_on_dapp_" + nftId)) | |
293 | 293 | if ((saleOwner != caller)) | |
294 | 294 | then throw("You don't own this NFT") | |
295 | 295 | else { | |
296 | 296 | let saleStatus = getStrByK(((("sale2nd_status_" + caller) + "_") + nftId)) | |
297 | 297 | if ((saleStatus != "OPEN")) | |
298 | 298 | then throw("Sale not active") | |
299 | 299 | else { | |
300 | 300 | let saleKey = getSaleKey(caller, nftId, toString(issuer)) | |
301 | 301 | let saleInfo = getStrByK((saleKey + "_OPEN")) | |
302 | 302 | [DeleteEntry((saleKey + "_OPEN")), DeleteEntry(((("sale2nd_status_" + caller) + "_") + nftId)), DeleteEntry(("current_owner_on_dapp_" + nftId)), StringEntry((((saleKey + "_") + id) + "_CANCELLED"), ((((saleInfo + "_CANCELLED_") + toString(date)) + "_") + id)), ScriptTransfer(Address(fromBase58String(caller)), 1, fromBase58String(nftId))] | |
303 | 303 | } | |
304 | 304 | } | |
305 | 305 | } | |
306 | 306 | ||
307 | 307 | ||
308 | 308 | ||
309 | 309 | @Callable(i) | |
310 | 310 | func buyNFT (nftId) = { | |
311 | - | let $ | |
312 | - | let id = $ | |
313 | - | let caller = $ | |
314 | - | let date = $ | |
315 | - | let isValidNFT = $ | |
316 | - | let issuer = $ | |
311 | + | let $t0994210012 = provideBaseData(i, nftId) | |
312 | + | let id = $t0994210012._1 | |
313 | + | let caller = $t0994210012._2 | |
314 | + | let date = $t0994210012._3 | |
315 | + | let isValidNFT = $t0994210012._4 | |
316 | + | let issuer = $t0994210012._5 | |
317 | 317 | if (!(isValidNFT)) | |
318 | 318 | then throw("Not a valid nft") | |
319 | 319 | else { | |
320 | 320 | let saleOwner = getSaleOwnerAndStatus(nftId) | |
321 | 321 | let saleKey = getSaleKey(saleOwner, nftId, toString(issuer)) | |
322 | 322 | let saleInfo = getStrByK((saleKey + "_OPEN")) | |
323 | 323 | if ((size(saleInfo) == 0)) | |
324 | 324 | then throw("Sale Not found!") | |
325 | 325 | else { | |
326 | 326 | let saleInfoArray = split(saleInfo, "_") | |
327 | 327 | if ((parseInt(saleInfoArray[1]) == 0)) | |
328 | 328 | then throw("Offer only") | |
329 | 329 | else { | |
330 | - | let $ | |
331 | - | let payment = $ | |
332 | - | let amount = $ | |
330 | + | let $t01041110447 = isPayment(i) | |
331 | + | let payment = $t01041110447._1 | |
332 | + | let amount = $t01041110447._2 | |
333 | 333 | let paymentAssetStr = if (isDefined(payment.assetId)) | |
334 | 334 | then toBase58String(value(payment.assetId)) | |
335 | 335 | else "" | |
336 | 336 | if (if ((saleInfoArray[1] != toString(amount))) | |
337 | 337 | then true | |
338 | 338 | else (saleInfoArray[2] != paymentAssetStr)) | |
339 | 339 | then throw("Payment infos don't match.") | |
340 | 340 | else { | |
341 | - | let $ | |
342 | - | let commissions = $ | |
343 | - | let ownerFee = $ | |
344 | - | let collectorNFT = $ | |
341 | + | let $t01096111068 = setTransfers(amount, payment.assetId, nftId, saleOwner, caller) | |
342 | + | let commissions = $t01096111068._1 | |
343 | + | let ownerFee = $t01096111068._2 | |
344 | + | let collectorNFT = $t01096111068._3 | |
345 | 345 | [DeleteEntry((saleKey + "_OPEN")), DeleteEntry(((("sale2nd_status_" + saleOwner) + "_") + nftId)), DeleteEntry(("current_owner_on_dapp_" + nftId)), StringEntry((((saleKey + "_") + id) + "_CLOSED"), ((((((saleInfo + "_CLOSED_") + toString(date)) + "_") + id) + "_") + caller)), updateNumSales(), ownerFee, collectorNFT, commissions] | |
346 | 346 | } | |
347 | 347 | } | |
348 | 348 | } | |
349 | 349 | } | |
350 | 350 | } | |
351 | 351 | ||
352 | 352 | ||
353 | 353 | ||
354 | 354 | @Callable(i) | |
355 | 355 | func setOffer (nftId) = { | |
356 | - | let $ | |
357 | - | let id = $ | |
358 | - | let offerOwner = $ | |
359 | - | let date = $ | |
360 | - | let isValidNFT = $ | |
361 | - | let issuer = $ | |
356 | + | let $t01146711541 = provideBaseData(i, nftId) | |
357 | + | let id = $t01146711541._1 | |
358 | + | let offerOwner = $t01146711541._2 | |
359 | + | let date = $t01146711541._3 | |
360 | + | let isValidNFT = $t01146711541._4 | |
361 | + | let issuer = $t01146711541._5 | |
362 | 362 | if (!(isValidNFT)) | |
363 | 363 | then throw("Not a valid nft") | |
364 | 364 | else { | |
365 | - | let $ | |
366 | - | let payment = $ | |
367 | - | let amount = $ | |
365 | + | let $t01160211638 = isPayment(i) | |
366 | + | let payment = $t01160211638._1 | |
367 | + | let amount = $t01160211638._2 | |
368 | 368 | let assetId = if (!(isDefined(payment.assetId))) | |
369 | 369 | then "WAVES" | |
370 | 370 | else toBase58String(value(payment.assetId)) | |
371 | 371 | if (!(acceptedAssetIds(assetId))) | |
372 | 372 | then throw("asset not accepted") | |
373 | 373 | else if ((amount == 0)) | |
374 | 374 | then throw("Offer of 0 not allowed") | |
375 | 375 | else if (!(validateMinSell(amount))) | |
376 | 376 | then throw("Wrong minimum sell price") | |
377 | 377 | else { | |
378 | 378 | let saleOwner = getSaleOwnerAndStatus(nftId) | |
379 | 379 | [StringEntry((getBidKey(offerOwner, nftId, saleOwner, id) + "_OPEN"), ((((((((((((toString(date) + "_") + toString(amount)) + "_") + assetId) + "_") + nftId) + "_") + toString(issuer)) + "_") + offerOwner) + "_") + id))] | |
380 | 380 | } | |
381 | 381 | } | |
382 | 382 | } | |
383 | 383 | ||
384 | 384 | ||
385 | 385 | ||
386 | 386 | @Callable(i) | |
387 | 387 | func acceptOffer (nftId,offerId,offerOwner) = { | |
388 | - | let $ | |
389 | - | let id = $ | |
390 | - | let caller = $ | |
391 | - | let date = $ | |
392 | - | let isValidNFT = $ | |
393 | - | let issuer = $ | |
388 | + | let $t01242712497 = provideBaseData(i, nftId) | |
389 | + | let id = $t01242712497._1 | |
390 | + | let caller = $t01242712497._2 | |
391 | + | let date = $t01242712497._3 | |
392 | + | let isValidNFT = $t01242712497._4 | |
393 | + | let issuer = $t01242712497._5 | |
394 | 394 | if (!(isValidNFT)) | |
395 | 395 | then throw("Not a valid nft") | |
396 | 396 | else { | |
397 | 397 | let saleOwner = getSaleOwnerAndStatus(nftId) | |
398 | 398 | if ((caller != saleOwner)) | |
399 | 399 | then throw("Only sale owner can accept offer") | |
400 | 400 | else { | |
401 | 401 | let bidKey = getBidKey(offerOwner, nftId, saleOwner, offerId) | |
402 | - | let $ | |
403 | - | let bidDataArr = $ | |
404 | - | let assetId = $ | |
405 | - | let bidData = $ | |
402 | + | let $t01275112806 = getBidData(bidKey) | |
403 | + | let bidDataArr = $t01275112806._1 | |
404 | + | let assetId = $t01275112806._2 | |
405 | + | let bidData = $t01275112806._3 | |
406 | 406 | let saleKey = getSaleKey(saleOwner, nftId, toString(issuer)) | |
407 | 407 | let saleInfo = getStrByK((saleKey + "_OPEN")) | |
408 | 408 | if ((size(saleInfo) == 0)) | |
409 | 409 | then throw("Sale Not found!") | |
410 | 410 | else { | |
411 | 411 | let amount = value(parseInt(bidDataArr[1])) | |
412 | - | let $ | |
413 | - | let commissions = $ | |
414 | - | let ownerFee = $ | |
415 | - | let collectorNFT = $ | |
412 | + | let $t01304213148 = setTransfers(amount, assetId, nftId, saleOwner, bidDataArr[6]) | |
413 | + | let commissions = $t01304213148._1 | |
414 | + | let ownerFee = $t01304213148._2 | |
415 | + | let collectorNFT = $t01304213148._3 | |
416 | 416 | let assetIdStr = if (isDefined(assetId)) | |
417 | 417 | then toBase58String(value(assetId)) | |
418 | 418 | else "WAVES" | |
419 | 419 | [DeleteEntry((saleKey + "_OPEN")), DeleteEntry((bidKey + "_OPEN")), DeleteEntry(((("sale2nd_status_" + saleOwner) + "_") + nftId)), DeleteEntry(("current_owner_on_dapp_" + nftId)), StringEntry((bidKey + "_CLOSED"), ((((bidData + "_CLOSED_") + toString(date)) + "_") + id)), StringEntry((((saleKey + "_") + id) + "_CLOSED"), ((((((((((saleInfo + "_CLOSED-OFFER_") + toString(date)) + "_") + id) + "_") + offerOwner) + "_") + toString(amount)) + "_") + assetIdStr)), updateNumSales(), ownerFee, collectorNFT, commissions] | |
420 | 420 | } | |
421 | 421 | } | |
422 | 422 | } | |
423 | 423 | } | |
424 | 424 | ||
425 | 425 | ||
426 | 426 | ||
427 | 427 | @Callable(i) | |
428 | 428 | func cancelOffer (nftId,offerId,offerOwner,saleOwner) = { | |
429 | - | let $ | |
430 | - | let id = $ | |
431 | - | let caller = $ | |
432 | - | let date = $ | |
429 | + | let $t01393614010 = idCallerDate(i) | |
430 | + | let id = $t01393614010._1 | |
431 | + | let caller = $t01393614010._2 | |
432 | + | let date = $t01393614010._3 | |
433 | 433 | if (if ((caller != offerOwner)) | |
434 | 434 | then (caller != saleOwner) | |
435 | 435 | else false) | |
436 | 436 | then throw("You cannot cancel this offer.") | |
437 | 437 | else { | |
438 | 438 | let bidKey = getBidKey(offerOwner, nftId, saleOwner, offerId) | |
439 | - | let $ | |
440 | - | let bidDataArr = $ | |
441 | - | let assetId = $ | |
442 | - | let bidData = $ | |
439 | + | let $t01418214237 = getBidData(bidKey) | |
440 | + | let bidDataArr = $t01418214237._1 | |
441 | + | let assetId = $t01418214237._2 | |
442 | + | let bidData = $t01418214237._3 | |
443 | 443 | [DeleteEntry((bidKey + "_OPEN")), StringEntry((bidKey + "_CANCELLED"), ((((bidData + "_CANCELLED_") + toString(date)) + "_") + id)), ScriptTransfer(Address(fromBase58String(caller)), parseIntValue(bidDataArr[1]), assetId)] | |
444 | 444 | } | |
445 | 445 | } | |
446 | 446 | ||
447 | 447 |
github/deemru/w8io/169f3d6 134.76 ms ◑