tx · H3DWjkznvZfxRAjQXMqJqiDDyUP2CdTAgARUBUnj2iXg 3N4ishKFoRooDxWoaCWSp3CUEoDmVepA1bz: -0.01300000 Waves 2024.01.18 08:21 [2936563] smart account 3N4ishKFoRooDxWoaCWSp3CUEoDmVepA1bz > SELF 0.00000000 Waves
{ "type": 13, "id": "H3DWjkznvZfxRAjQXMqJqiDDyUP2CdTAgARUBUnj2iXg", "fee": 1300000, "feeAssetId": null, "timestamp": 1705555323585, "version": 2, "chainId": 84, "sender": "3N4ishKFoRooDxWoaCWSp3CUEoDmVepA1bz", "senderPublicKey": "9p5EiEVtTgiMBxj67TfVfstKuQs1LHPxoZRiRhyS5oiN", "proofs": [ "3Vd3H3LZwc9s1yAuMoUTC9GtQPQY2P64vmjm4jPkrAxYKjvvjhTe1VcyMaP7GAsgXys28siWnHtAQUTxctPzTkkT" ], "script": "base64:BgI5CAISBAoCCAgSBAoCBAgSBAoCAQgSBQoDCAEIEgMKAQgSAwoBCBIDCgEIEgUKAwgICBIGCgQICAgILQAHVkVSU0lPTgIFMS4wLjABCWdldFN0ckJ5SwEDa2V5CQELdmFsdWVPckVsc2UCCQCdCAIFBHRoaXMFA2tleQIAAAlvcmFjbGVGZWUJAQV2YWx1ZQEJAKYIAQkBCWdldFN0ckJ5SwECD2NvbmZfb3JhY2xlX2ZlZQALZmVlUmVjZWl2ZXIJAQlnZXRTdHJCeUsBAhFjb25mX2ZlZV9yZWNlaXZlcgAPcHV6emxlX2FydF9wb29sCQEJZ2V0U3RyQnlLAQIUY29uZl9wdXp6bGVfYXJ0X3Bvb2wAE3NpZ25BcnRBcnR3b3Jrc0RhcHAJAQV2YWx1ZQEJAKYIAQkBCWdldFN0ckJ5SwECEmNvbmZfYXJ0d29ya3NfZGFwcAARdXNkdFBQQXNzZXRJZF9zdHIJAQlnZXRTdHJCeUsBAhtjb25mX2FjY2VwdGVkX2Fzc2V0X1VTRFRfUFAADmFydEFzc2V0SWRfc3RyCQEJZ2V0U3RyQnlLAQ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JfMgQHYmlkRGF0YQgFDSR0MDE0MzEyMTQzNjcCXzMJAMwIAgkBC0RlbGV0ZUVudHJ5AQkArAICBQZiaWRLZXkCBV9PUEVOCQDMCAIJAQtTdHJpbmdFbnRyeQIJAKwCAgUGYmlkS2V5AgpfQ0FOQ0VMTEVECQCsAgIJAKwCAgkArAICCQCsAgIFB2JpZERhdGECC19DQU5DRUxMRURfCQCkAwEFBGRhdGUCAV8FAmlkCQDMCAIJAQ5TY3JpcHRUcmFuc2ZlcgMJAQdBZGRyZXNzAQkA2QQBBQZjYWxsZXIJAQ1wYXJzZUludFZhbHVlAQkAkQMCBQpiaWREYXRhQXJyAAEFB2Fzc2V0SWQFA25pbAAIDV77", "height": 2936563, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 5p8LUKmcLET4n6q1Ck9r3YqQDJGHqL6dv4qdkPFWDpqp Next: g38CSJCWb58AafANszskhHY6eufugB11GXZw3SDrH8Q Diff:
Old | New | Differences | |
---|---|---|---|
187 | 187 | ||
188 | 188 | ||
189 | 189 | func haveSTD (issuer,ndftId) = { | |
190 | - | let data = valueOrElse(getString(Address(fromBase58String(issuer)), (("std_nft_" + ndftId) + "_metadata")), "") | |
191 | - | (data != "") | |
190 | + | let data_cid = valueOrElse(getString(Address(fromBase58String(issuer)), (("std_nft_" + ndftId) + "_cid")), "") | |
191 | + | let data_json = valueOrElse(getString(Address(fromBase58String(issuer)), (("std_nft_" + ndftId) + "_json")), "") | |
192 | + | if ((data_cid != "")) | |
193 | + | then true | |
194 | + | else (data_json != "") | |
192 | 195 | } | |
193 | 196 | ||
194 | 197 | ||
217 | 220 | ||
218 | 221 | @Callable(i) | |
219 | 222 | func sellNFT (price,asset) = { | |
220 | - | let $ | |
221 | - | let payment = $ | |
222 | - | let amount = $ | |
223 | + | let $t067006736 = isPayment(i) | |
224 | + | let payment = $t067006736._1 | |
225 | + | let amount = $t067006736._2 | |
223 | 226 | if ((amount != 1)) | |
224 | 227 | then throw("No NFT attached") | |
225 | 228 | else { | |
226 | 229 | let nftId = if (isDefined(payment.assetId)) | |
227 | 230 | then toBase58String(value(payment.assetId)) | |
228 | 231 | else throw("Waves is not a NFT.") | |
229 | - | let $ | |
230 | - | let id = $ | |
231 | - | let caller = $ | |
232 | - | let date = $ | |
233 | - | let isValidNFT = $ | |
234 | - | let issuer = $ | |
232 | + | let $t069226992 = provideBaseData(i, nftId) | |
233 | + | let id = $t069226992._1 | |
234 | + | let caller = $t069226992._2 | |
235 | + | let date = $t069226992._3 | |
236 | + | let isValidNFT = $t069226992._4 | |
237 | + | let issuer = $t069226992._5 | |
235 | 238 | if (!(isValidNFT)) | |
236 | 239 | then throw("Not a valid nft") | |
237 | 240 | else if ((issuer == signArtArtworksDapp)) | |
250 | 253 | ||
251 | 254 | @Callable(i) | |
252 | 255 | func updateSalePrice (nftId,price,asset) = { | |
253 | - | let $ | |
254 | - | let id = $ | |
255 | - | let caller = $ | |
256 | - | let date = $ | |
257 | - | let isValidNFT = $ | |
258 | - | let issuer = $ | |
256 | + | let $t079017971 = provideBaseData(i, nftId) | |
257 | + | let id = $t079017971._1 | |
258 | + | let caller = $t079017971._2 | |
259 | + | let date = $t079017971._3 | |
260 | + | let isValidNFT = $t079017971._4 | |
261 | + | let issuer = $t079017971._5 | |
259 | 262 | if (!(isValidNFT)) | |
260 | 263 | then throw("Not a valid nft") | |
261 | 264 | else { | |
283 | 286 | ||
284 | 287 | @Callable(i) | |
285 | 288 | func cancelSale (nftId) = { | |
286 | - | let $ | |
287 | - | let id = $ | |
288 | - | let caller = $ | |
289 | - | let date = $ | |
290 | - | let isValidNFT = $ | |
291 | - | let issuer = $ | |
289 | + | let $t090239241 = provideBaseData(i, nftId) | |
290 | + | let id = $t090239241._1 | |
291 | + | let caller = $t090239241._2 | |
292 | + | let date = $t090239241._3 | |
293 | + | let isValidNFT = $t090239241._4 | |
294 | + | let issuer = $t090239241._5 | |
292 | 295 | let saleOwner = getStrByK(("current_owner_on_dapp_" + nftId)) | |
293 | 296 | if ((saleOwner != caller)) | |
294 | 297 | then throw("You don't own this NFT") | |
308 | 311 | ||
309 | 312 | @Callable(i) | |
310 | 313 | func buyNFT (nftId) = { | |
311 | - | let $ | |
312 | - | let id = $ | |
313 | - | let caller = $ | |
314 | - | let date = $ | |
315 | - | let isValidNFT = $ | |
316 | - | let issuer = $ | |
314 | + | let $t01007210142 = provideBaseData(i, nftId) | |
315 | + | let id = $t01007210142._1 | |
316 | + | let caller = $t01007210142._2 | |
317 | + | let date = $t01007210142._3 | |
318 | + | let isValidNFT = $t01007210142._4 | |
319 | + | let issuer = $t01007210142._5 | |
317 | 320 | if (!(isValidNFT)) | |
318 | 321 | then throw("Not a valid nft") | |
319 | 322 | else { | |
327 | 330 | if ((parseInt(saleInfoArray[1]) == 0)) | |
328 | 331 | then throw("Offer only") | |
329 | 332 | else { | |
330 | - | let $ | |
331 | - | let payment = $ | |
332 | - | let amount = $ | |
333 | + | let $t01054110577 = isPayment(i) | |
334 | + | let payment = $t01054110577._1 | |
335 | + | let amount = $t01054110577._2 | |
333 | 336 | let paymentAssetStr = if (isDefined(payment.assetId)) | |
334 | 337 | then toBase58String(value(payment.assetId)) | |
335 | 338 | else "" | |
338 | 341 | else (saleInfoArray[2] != paymentAssetStr)) | |
339 | 342 | then throw("Payment infos don't match.") | |
340 | 343 | else { | |
341 | - | let $ | |
342 | - | let commissions = $ | |
343 | - | let ownerFee = $ | |
344 | - | let collectorNFT = $ | |
344 | + | let $t01109111198 = setTransfers(amount, payment.assetId, nftId, saleOwner, caller) | |
345 | + | let commissions = $t01109111198._1 | |
346 | + | let ownerFee = $t01109111198._2 | |
347 | + | let collectorNFT = $t01109111198._3 | |
345 | 348 | [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 | 349 | } | |
347 | 350 | } | |
353 | 356 | ||
354 | 357 | @Callable(i) | |
355 | 358 | func setOffer (nftId) = { | |
356 | - | let $ | |
357 | - | let id = $ | |
358 | - | let offerOwner = $ | |
359 | - | let date = $ | |
360 | - | let isValidNFT = $ | |
361 | - | let issuer = $ | |
359 | + | let $t01159711671 = provideBaseData(i, nftId) | |
360 | + | let id = $t01159711671._1 | |
361 | + | let offerOwner = $t01159711671._2 | |
362 | + | let date = $t01159711671._3 | |
363 | + | let isValidNFT = $t01159711671._4 | |
364 | + | let issuer = $t01159711671._5 | |
362 | 365 | if (!(isValidNFT)) | |
363 | 366 | then throw("Not a valid nft") | |
364 | 367 | else { | |
365 | - | let $ | |
366 | - | let payment = $ | |
367 | - | let amount = $ | |
368 | + | let $t01173211768 = isPayment(i) | |
369 | + | let payment = $t01173211768._1 | |
370 | + | let amount = $t01173211768._2 | |
368 | 371 | let assetId = if (!(isDefined(payment.assetId))) | |
369 | 372 | then "WAVES" | |
370 | 373 | else toBase58String(value(payment.assetId)) | |
385 | 388 | ||
386 | 389 | @Callable(i) | |
387 | 390 | func acceptOffer (nftId,offerId,offerOwner) = { | |
388 | - | let $ | |
389 | - | let id = $ | |
390 | - | let caller = $ | |
391 | - | let date = $ | |
392 | - | let isValidNFT = $ | |
393 | - | let issuer = $ | |
391 | + | let $t01255712627 = provideBaseData(i, nftId) | |
392 | + | let id = $t01255712627._1 | |
393 | + | let caller = $t01255712627._2 | |
394 | + | let date = $t01255712627._3 | |
395 | + | let isValidNFT = $t01255712627._4 | |
396 | + | let issuer = $t01255712627._5 | |
394 | 397 | if (!(isValidNFT)) | |
395 | 398 | then throw("Not a valid nft") | |
396 | 399 | else { | |
399 | 402 | then throw("Only sale owner can accept offer") | |
400 | 403 | else { | |
401 | 404 | let bidKey = getBidKey(offerOwner, nftId, saleOwner, offerId) | |
402 | - | let $ | |
403 | - | let bidDataArr = $ | |
404 | - | let assetId = $ | |
405 | - | let bidData = $ | |
405 | + | let $t01288112936 = getBidData(bidKey) | |
406 | + | let bidDataArr = $t01288112936._1 | |
407 | + | let assetId = $t01288112936._2 | |
408 | + | let bidData = $t01288112936._3 | |
406 | 409 | let saleKey = getSaleKey(saleOwner, nftId, toString(issuer)) | |
407 | 410 | let saleInfo = getStrByK((saleKey + "_OPEN")) | |
408 | 411 | if ((size(saleInfo) == 0)) | |
409 | 412 | then throw("Sale Not found!") | |
410 | 413 | else { | |
411 | 414 | let amount = value(parseInt(bidDataArr[1])) | |
412 | - | let $ | |
413 | - | let commissions = $ | |
414 | - | let ownerFee = $ | |
415 | - | let collectorNFT = $ | |
415 | + | let $t01317213278 = setTransfers(amount, assetId, nftId, saleOwner, bidDataArr[6]) | |
416 | + | let commissions = $t01317213278._1 | |
417 | + | let ownerFee = $t01317213278._2 | |
418 | + | let collectorNFT = $t01317213278._3 | |
416 | 419 | let assetIdStr = if (isDefined(assetId)) | |
417 | 420 | then toBase58String(value(assetId)) | |
418 | 421 | else "WAVES" | |
426 | 429 | ||
427 | 430 | @Callable(i) | |
428 | 431 | func cancelOffer (nftId,offerId,offerOwner,saleOwner) = { | |
429 | - | let $ | |
430 | - | let id = $ | |
431 | - | let caller = $ | |
432 | - | let date = $ | |
432 | + | let $t01406614140 = idCallerDate(i) | |
433 | + | let id = $t01406614140._1 | |
434 | + | let caller = $t01406614140._2 | |
435 | + | let date = $t01406614140._3 | |
433 | 436 | if (if ((caller != offerOwner)) | |
434 | 437 | then (caller != saleOwner) | |
435 | 438 | else false) | |
436 | 439 | then throw("You cannot cancel this offer.") | |
437 | 440 | else { | |
438 | 441 | let bidKey = getBidKey(offerOwner, nftId, saleOwner, offerId) | |
439 | - | let $ | |
440 | - | let bidDataArr = $ | |
441 | - | let assetId = $ | |
442 | - | let bidData = $ | |
442 | + | let $t01431214367 = getBidData(bidKey) | |
443 | + | let bidDataArr = $t01431214367._1 | |
444 | + | let assetId = $t01431214367._2 | |
445 | + | let bidData = $t01431214367._3 | |
443 | 446 | [DeleteEntry((bidKey + "_OPEN")), StringEntry((bidKey + "_CANCELLED"), ((((bidData + "_CANCELLED_") + toString(date)) + "_") + id)), ScriptTransfer(Address(fromBase58String(caller)), parseIntValue(bidDataArr[1]), assetId)] | |
444 | 447 | } | |
445 | 448 | } |
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 | 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 | 173 | let $t051955235 = idCallerDate(i) | |
174 | 174 | let id = $t051955235._1 | |
175 | 175 | let caller = $t051955235._2 | |
176 | 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 | - | let data = valueOrElse(getString(Address(fromBase58String(issuer)), (("std_nft_" + ndftId) + "_metadata")), "") | |
191 | - | (data != "") | |
190 | + | let data_cid = valueOrElse(getString(Address(fromBase58String(issuer)), (("std_nft_" + ndftId) + "_cid")), "") | |
191 | + | let data_json = valueOrElse(getString(Address(fromBase58String(issuer)), (("std_nft_" + ndftId) + "_json")), "") | |
192 | + | if ((data_cid != "")) | |
193 | + | then true | |
194 | + | else (data_json != "") | |
192 | 195 | } | |
193 | 196 | ||
194 | 197 | ||
195 | 198 | @Callable(invoke) | |
196 | 199 | func setConf (key,val) = { | |
197 | 200 | let caller = toString(invoke.caller) | |
198 | 201 | if (containsElement([chris, toString(this)], caller)) | |
199 | 202 | then if (contains(key, "conf_")) | |
200 | 203 | then [StringEntry(key, val)] | |
201 | 204 | else throw("Entries starting with conf_ only") | |
202 | 205 | else throw("You are not allowed to change this") | |
203 | 206 | } | |
204 | 207 | ||
205 | 208 | ||
206 | 209 | ||
207 | 210 | @Callable(invoke) | |
208 | 211 | func appRunning (isLive,message) = { | |
209 | 212 | let caller = toString(invoke.caller) | |
210 | 213 | let id = toBase58String(invoke.transactionId) | |
211 | 214 | if (containsElement([chris, toString(this)], caller)) | |
212 | 215 | then [BooleanEntry(dappRunningKey, isLive), StringEntry(maintenanceMSGKey, message)] | |
213 | 216 | else throw("You are not allowed to change this") | |
214 | 217 | } | |
215 | 218 | ||
216 | 219 | ||
217 | 220 | ||
218 | 221 | @Callable(i) | |
219 | 222 | func sellNFT (price,asset) = { | |
220 | - | let $ | |
221 | - | let payment = $ | |
222 | - | let amount = $ | |
223 | + | let $t067006736 = isPayment(i) | |
224 | + | let payment = $t067006736._1 | |
225 | + | let amount = $t067006736._2 | |
223 | 226 | if ((amount != 1)) | |
224 | 227 | then throw("No NFT attached") | |
225 | 228 | else { | |
226 | 229 | let nftId = if (isDefined(payment.assetId)) | |
227 | 230 | then toBase58String(value(payment.assetId)) | |
228 | 231 | else throw("Waves is not a NFT.") | |
229 | - | let $ | |
230 | - | let id = $ | |
231 | - | let caller = $ | |
232 | - | let date = $ | |
233 | - | let isValidNFT = $ | |
234 | - | let issuer = $ | |
232 | + | let $t069226992 = provideBaseData(i, nftId) | |
233 | + | let id = $t069226992._1 | |
234 | + | let caller = $t069226992._2 | |
235 | + | let date = $t069226992._3 | |
236 | + | let isValidNFT = $t069226992._4 | |
237 | + | let issuer = $t069226992._5 | |
235 | 238 | if (!(isValidNFT)) | |
236 | 239 | then throw("Not a valid nft") | |
237 | 240 | else if ((issuer == signArtArtworksDapp)) | |
238 | 241 | then throw("This dApp is only for NFT issued outside SIGN Art dApp.") | |
239 | 242 | else if (!(haveSTD(toString(issuer), nftId))) | |
240 | 243 | then throw("No nft standard found on issuer account") | |
241 | 244 | else if (!(acceptedAssetIds(asset))) | |
242 | 245 | then throw("Only $ART, USDT-PP, USDC-PP, EAST, PUZZLE, ETH or WAVES accepted") | |
243 | 246 | else if (!(validateMinSell(price))) | |
244 | 247 | then throw("Wrong minimum sell price") | |
245 | 248 | 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 | 249 | } | |
247 | 250 | } | |
248 | 251 | ||
249 | 252 | ||
250 | 253 | ||
251 | 254 | @Callable(i) | |
252 | 255 | func updateSalePrice (nftId,price,asset) = { | |
253 | - | let $ | |
254 | - | let id = $ | |
255 | - | let caller = $ | |
256 | - | let date = $ | |
257 | - | let isValidNFT = $ | |
258 | - | let issuer = $ | |
256 | + | let $t079017971 = provideBaseData(i, nftId) | |
257 | + | let id = $t079017971._1 | |
258 | + | let caller = $t079017971._2 | |
259 | + | let date = $t079017971._3 | |
260 | + | let isValidNFT = $t079017971._4 | |
261 | + | let issuer = $t079017971._5 | |
259 | 262 | if (!(isValidNFT)) | |
260 | 263 | then throw("Not a valid nft") | |
261 | 264 | else { | |
262 | 265 | let saleOwner = getStrByK(("current_owner_on_dapp_" + nftId)) | |
263 | 266 | if ((saleOwner != caller)) | |
264 | 267 | then throw("You don't own this NFT") | |
265 | 268 | else { | |
266 | 269 | let saleStatus = getStrByK(((("sale2nd_status_" + caller) + "_") + nftId)) | |
267 | 270 | if ((saleStatus != "OPEN")) | |
268 | 271 | then throw("Sale not active") | |
269 | 272 | else if (!(acceptedAssetIds(asset))) | |
270 | 273 | then throw("Only $ART, USDT-PP, USDC-PP, EAST, PUZZLE, ETH or WAVES accepted") | |
271 | 274 | else if (!(validateMinSell(price))) | |
272 | 275 | then throw("Wrong minimum sell price") | |
273 | 276 | else { | |
274 | 277 | let saleKey = getSaleKey(caller, nftId, toString(issuer)) | |
275 | 278 | let saleInfo = split(getStrByK((saleKey + "_OPEN")), "_") | |
276 | 279 | [StringEntry((saleKey + "_OPEN"), ((((((((((saleInfo[0] + "_") + toString(price)) + "_") + asset) + "_") + saleInfo[3]) + "_") + saleInfo[4]) + "_") + saleInfo[5]))] | |
277 | 280 | } | |
278 | 281 | } | |
279 | 282 | } | |
280 | 283 | } | |
281 | 284 | ||
282 | 285 | ||
283 | 286 | ||
284 | 287 | @Callable(i) | |
285 | 288 | func cancelSale (nftId) = { | |
286 | - | let $ | |
287 | - | let id = $ | |
288 | - | let caller = $ | |
289 | - | let date = $ | |
290 | - | let isValidNFT = $ | |
291 | - | let issuer = $ | |
289 | + | let $t090239241 = provideBaseData(i, nftId) | |
290 | + | let id = $t090239241._1 | |
291 | + | let caller = $t090239241._2 | |
292 | + | let date = $t090239241._3 | |
293 | + | let isValidNFT = $t090239241._4 | |
294 | + | let issuer = $t090239241._5 | |
292 | 295 | let saleOwner = getStrByK(("current_owner_on_dapp_" + nftId)) | |
293 | 296 | if ((saleOwner != caller)) | |
294 | 297 | then throw("You don't own this NFT") | |
295 | 298 | else { | |
296 | 299 | let saleStatus = getStrByK(((("sale2nd_status_" + caller) + "_") + nftId)) | |
297 | 300 | if ((saleStatus != "OPEN")) | |
298 | 301 | then throw("Sale not active") | |
299 | 302 | else { | |
300 | 303 | let saleKey = getSaleKey(caller, nftId, toString(issuer)) | |
301 | 304 | let saleInfo = getStrByK((saleKey + "_OPEN")) | |
302 | 305 | [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 | 306 | } | |
304 | 307 | } | |
305 | 308 | } | |
306 | 309 | ||
307 | 310 | ||
308 | 311 | ||
309 | 312 | @Callable(i) | |
310 | 313 | func buyNFT (nftId) = { | |
311 | - | let $ | |
312 | - | let id = $ | |
313 | - | let caller = $ | |
314 | - | let date = $ | |
315 | - | let isValidNFT = $ | |
316 | - | let issuer = $ | |
314 | + | let $t01007210142 = provideBaseData(i, nftId) | |
315 | + | let id = $t01007210142._1 | |
316 | + | let caller = $t01007210142._2 | |
317 | + | let date = $t01007210142._3 | |
318 | + | let isValidNFT = $t01007210142._4 | |
319 | + | let issuer = $t01007210142._5 | |
317 | 320 | if (!(isValidNFT)) | |
318 | 321 | then throw("Not a valid nft") | |
319 | 322 | else { | |
320 | 323 | let saleOwner = getSaleOwnerAndStatus(nftId) | |
321 | 324 | let saleKey = getSaleKey(saleOwner, nftId, toString(issuer)) | |
322 | 325 | let saleInfo = getStrByK((saleKey + "_OPEN")) | |
323 | 326 | if ((size(saleInfo) == 0)) | |
324 | 327 | then throw("Sale Not found!") | |
325 | 328 | else { | |
326 | 329 | let saleInfoArray = split(saleInfo, "_") | |
327 | 330 | if ((parseInt(saleInfoArray[1]) == 0)) | |
328 | 331 | then throw("Offer only") | |
329 | 332 | else { | |
330 | - | let $ | |
331 | - | let payment = $ | |
332 | - | let amount = $ | |
333 | + | let $t01054110577 = isPayment(i) | |
334 | + | let payment = $t01054110577._1 | |
335 | + | let amount = $t01054110577._2 | |
333 | 336 | let paymentAssetStr = if (isDefined(payment.assetId)) | |
334 | 337 | then toBase58String(value(payment.assetId)) | |
335 | 338 | else "" | |
336 | 339 | if (if ((saleInfoArray[1] != toString(amount))) | |
337 | 340 | then true | |
338 | 341 | else (saleInfoArray[2] != paymentAssetStr)) | |
339 | 342 | then throw("Payment infos don't match.") | |
340 | 343 | else { | |
341 | - | let $ | |
342 | - | let commissions = $ | |
343 | - | let ownerFee = $ | |
344 | - | let collectorNFT = $ | |
344 | + | let $t01109111198 = setTransfers(amount, payment.assetId, nftId, saleOwner, caller) | |
345 | + | let commissions = $t01109111198._1 | |
346 | + | let ownerFee = $t01109111198._2 | |
347 | + | let collectorNFT = $t01109111198._3 | |
345 | 348 | [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 | 349 | } | |
347 | 350 | } | |
348 | 351 | } | |
349 | 352 | } | |
350 | 353 | } | |
351 | 354 | ||
352 | 355 | ||
353 | 356 | ||
354 | 357 | @Callable(i) | |
355 | 358 | func setOffer (nftId) = { | |
356 | - | let $ | |
357 | - | let id = $ | |
358 | - | let offerOwner = $ | |
359 | - | let date = $ | |
360 | - | let isValidNFT = $ | |
361 | - | let issuer = $ | |
359 | + | let $t01159711671 = provideBaseData(i, nftId) | |
360 | + | let id = $t01159711671._1 | |
361 | + | let offerOwner = $t01159711671._2 | |
362 | + | let date = $t01159711671._3 | |
363 | + | let isValidNFT = $t01159711671._4 | |
364 | + | let issuer = $t01159711671._5 | |
362 | 365 | if (!(isValidNFT)) | |
363 | 366 | then throw("Not a valid nft") | |
364 | 367 | else { | |
365 | - | let $ | |
366 | - | let payment = $ | |
367 | - | let amount = $ | |
368 | + | let $t01173211768 = isPayment(i) | |
369 | + | let payment = $t01173211768._1 | |
370 | + | let amount = $t01173211768._2 | |
368 | 371 | let assetId = if (!(isDefined(payment.assetId))) | |
369 | 372 | then "WAVES" | |
370 | 373 | else toBase58String(value(payment.assetId)) | |
371 | 374 | if (!(acceptedAssetIds(assetId))) | |
372 | 375 | then throw("asset not accepted") | |
373 | 376 | else if ((amount == 0)) | |
374 | 377 | then throw("Offer of 0 not allowed") | |
375 | 378 | else if (!(validateMinSell(amount))) | |
376 | 379 | then throw("Wrong minimum sell price") | |
377 | 380 | else { | |
378 | 381 | let saleOwner = getSaleOwnerAndStatus(nftId) | |
379 | 382 | [StringEntry((getBidKey(offerOwner, nftId, saleOwner, id) + "_OPEN"), ((((((((((((toString(date) + "_") + toString(amount)) + "_") + assetId) + "_") + nftId) + "_") + toString(issuer)) + "_") + offerOwner) + "_") + id))] | |
380 | 383 | } | |
381 | 384 | } | |
382 | 385 | } | |
383 | 386 | ||
384 | 387 | ||
385 | 388 | ||
386 | 389 | @Callable(i) | |
387 | 390 | func acceptOffer (nftId,offerId,offerOwner) = { | |
388 | - | let $ | |
389 | - | let id = $ | |
390 | - | let caller = $ | |
391 | - | let date = $ | |
392 | - | let isValidNFT = $ | |
393 | - | let issuer = $ | |
391 | + | let $t01255712627 = provideBaseData(i, nftId) | |
392 | + | let id = $t01255712627._1 | |
393 | + | let caller = $t01255712627._2 | |
394 | + | let date = $t01255712627._3 | |
395 | + | let isValidNFT = $t01255712627._4 | |
396 | + | let issuer = $t01255712627._5 | |
394 | 397 | if (!(isValidNFT)) | |
395 | 398 | then throw("Not a valid nft") | |
396 | 399 | else { | |
397 | 400 | let saleOwner = getSaleOwnerAndStatus(nftId) | |
398 | 401 | if ((caller != saleOwner)) | |
399 | 402 | then throw("Only sale owner can accept offer") | |
400 | 403 | else { | |
401 | 404 | let bidKey = getBidKey(offerOwner, nftId, saleOwner, offerId) | |
402 | - | let $ | |
403 | - | let bidDataArr = $ | |
404 | - | let assetId = $ | |
405 | - | let bidData = $ | |
405 | + | let $t01288112936 = getBidData(bidKey) | |
406 | + | let bidDataArr = $t01288112936._1 | |
407 | + | let assetId = $t01288112936._2 | |
408 | + | let bidData = $t01288112936._3 | |
406 | 409 | let saleKey = getSaleKey(saleOwner, nftId, toString(issuer)) | |
407 | 410 | let saleInfo = getStrByK((saleKey + "_OPEN")) | |
408 | 411 | if ((size(saleInfo) == 0)) | |
409 | 412 | then throw("Sale Not found!") | |
410 | 413 | else { | |
411 | 414 | let amount = value(parseInt(bidDataArr[1])) | |
412 | - | let $ | |
413 | - | let commissions = $ | |
414 | - | let ownerFee = $ | |
415 | - | let collectorNFT = $ | |
415 | + | let $t01317213278 = setTransfers(amount, assetId, nftId, saleOwner, bidDataArr[6]) | |
416 | + | let commissions = $t01317213278._1 | |
417 | + | let ownerFee = $t01317213278._2 | |
418 | + | let collectorNFT = $t01317213278._3 | |
416 | 419 | let assetIdStr = if (isDefined(assetId)) | |
417 | 420 | then toBase58String(value(assetId)) | |
418 | 421 | else "WAVES" | |
419 | 422 | [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 | 423 | } | |
421 | 424 | } | |
422 | 425 | } | |
423 | 426 | } | |
424 | 427 | ||
425 | 428 | ||
426 | 429 | ||
427 | 430 | @Callable(i) | |
428 | 431 | func cancelOffer (nftId,offerId,offerOwner,saleOwner) = { | |
429 | - | let $ | |
430 | - | let id = $ | |
431 | - | let caller = $ | |
432 | - | let date = $ | |
432 | + | let $t01406614140 = idCallerDate(i) | |
433 | + | let id = $t01406614140._1 | |
434 | + | let caller = $t01406614140._2 | |
435 | + | let date = $t01406614140._3 | |
433 | 436 | if (if ((caller != offerOwner)) | |
434 | 437 | then (caller != saleOwner) | |
435 | 438 | else false) | |
436 | 439 | then throw("You cannot cancel this offer.") | |
437 | 440 | else { | |
438 | 441 | let bidKey = getBidKey(offerOwner, nftId, saleOwner, offerId) | |
439 | - | let $ | |
440 | - | let bidDataArr = $ | |
441 | - | let assetId = $ | |
442 | - | let bidData = $ | |
442 | + | let $t01431214367 = getBidData(bidKey) | |
443 | + | let bidDataArr = $t01431214367._1 | |
444 | + | let assetId = $t01431214367._2 | |
445 | + | let bidData = $t01431214367._3 | |
443 | 446 | [DeleteEntry((bidKey + "_OPEN")), StringEntry((bidKey + "_CANCELLED"), ((((bidData + "_CANCELLED_") + toString(date)) + "_") + id)), ScriptTransfer(Address(fromBase58String(caller)), parseIntValue(bidDataArr[1]), assetId)] | |
444 | 447 | } | |
445 | 448 | } | |
446 | 449 | ||
447 | 450 |
github/deemru/w8io/169f3d6 110.93 ms ◑