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