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