tx · 9wZRxJJs8sKk8MtLPUGqNTbW3aVKVzGecNjXqkPMqECN 3N2eA4yzXa4wTj7pP8r6G144RRxZW7cmq4p: -0.01500000 Waves 2022.11.30 07:18 [2339357] smart account 3N2eA4yzXa4wTj7pP8r6G144RRxZW7cmq4p > SELF 0.00000000 Waves
{ "type": 13, "id": "9wZRxJJs8sKk8MtLPUGqNTbW3aVKVzGecNjXqkPMqECN", "fee": 1500000, "feeAssetId": null, "timestamp": 1669781909424, "version": 2, "chainId": 84, "sender": "3N2eA4yzXa4wTj7pP8r6G144RRxZW7cmq4p", "senderPublicKey": "Hh3eFP2XFetZSfTxQiM1Ps96f68zi8Zh5ghhCZdjgdFs", "proofs": [ "4wZokJWFBhKtmdsFYZXWMtjPSyvB5qGTeSPjcB3mnq3efdLoKVF67ak66aDq7zS78HUvCPFETiktx3iPwdrfiaGG" ], "script": "base64:BgI5CAISBAoCCAgSBAoCBAgSBAoCAQgSBQoDCAEIEgMKAQgSAwoBCBIDCgEIEgUKAwgICBIGCgQICAgINAEJZ2V0U3RyQnlLAQNrZXkJAQt2YWx1ZU9yRWxzZQIJAJ0IAgUEdGhpcwUDa2V5AgAACHVuaXRUZXN0BwAJb3JhY2xlRmVlCQEFdmFsdWUBCQCmCAEJAQlnZXRTdHJCeUsBAg9jb25mX29yYWNsZV9mZWUAC2ZlZVJlY2VpdmVyCQEJZ2V0U3RyQnlLAQIRY29uZl9mZWVfcmVjZWl2ZXIADGFydHdvcmtzRGFwcAkBBXZhbHVlAQkApggBCQEJZ2V0U3RyQnlLAQISY29uZl9hcnR3b3Jrc19kYXBwAAh1c2VyRGFwcAMFCHVuaXRUZXN0CQEFdmFsdWUBCQCmCAECIzNNdDRSR01FeWpTV1lBb2NUUHFkNTV3ZEhRUUIzUFUyVUNtCQEFdmFsdWUBCQCmCAEJAQlnZXRTdHJCeUsBAg9jb25mX3VzZXJzX2RhcHAAC3NpZ25Bc3NldElkCQDZBAEJAQlnZXRTdHJCeUsBAhhjb25mX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NyaXB0VHJhbnNmZXIDCQEHQWRkcmVzcwEJANkEAQUGY2FsbGVyCQENcGFyc2VJbnRWYWx1ZQEJAJEDAgUKYmlkRGF0YUFycgABBQdhc3NldElkBQNuaWwA0jx8rg==", "height": 2339357, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 5Lcsh7p6YFtDxz5fktwyXHhWZqkXsW9NVQVSofdENWbR Next: 8XJcRSSKPzAJGhVTbMxdopfJM3XvLhLDgBEqCyjNq8hJ Diff:
Old | New | Differences | |
---|---|---|---|
196 | 196 | ||
197 | 197 | func setTransfers (amount,assetId,nftid,creatorAddr,saleOwner,caller,artId) = { | |
198 | 198 | let creatorCut = getArtworkRoyalties(keyArtworkRoyalties(creatorAddr, artId)) | |
199 | - | if (true) | |
200 | - | then throw(((((keyArtworkRoyalties(creatorAddr, nftid) + " / ") + toString(amount)) + " / ") + toString(creatorCut))) | |
201 | - | else { | |
202 | - | let agent = valueOrElse(getString(userDapp, keyArtistAgentAddr(creatorAddr)), feeReceiver) | |
203 | - | let agentShare = valueOrElse(getInteger(userDapp, keySecondaryShare(creatorAddr)), 0) | |
204 | - | let amountForSign = fraction(amount, signCut, 100) | |
205 | - | let amountForCreator = fraction(amount, creatorCut, 10000) | |
206 | - | let amountForOwner = (amount - (amountForSign + amountForCreator)) | |
207 | - | let amountForAgent = if (if ((agent != feeReceiver)) | |
208 | - | then (agentShare > 0) | |
209 | - | else false) | |
210 | - | then fraction(amount, agentShare, 100) | |
211 | - | else 0 | |
212 | - | let commissions = if ((amountForAgent != 0)) | |
213 | - | then [ScriptTransfer(Address(fromBase58String(feeReceiver)), (amountForSign - amountForAgent), assetId), ScriptTransfer(Address(fromBase58String(agent)), amountForAgent, assetId)] | |
214 | - | else [ScriptTransfer(Address(fromBase58String(feeReceiver)), amountForSign, assetId)] | |
215 | - | let creatorFee = ScriptTransfer(Address(fromBase58String(creatorAddr)), amountForCreator, assetId) | |
216 | - | let ownerFee = ScriptTransfer(Address(fromBase58String(saleOwner)), amountForOwner, assetId) | |
217 | - | let collectorNFT = ScriptTransfer(Address(fromBase58String(caller)), 1, fromBase58String(nftid)) | |
218 | - | $Tuple4(commissions, creatorFee, ownerFee, collectorNFT) | |
219 | - | } | |
199 | + | let agent = valueOrElse(getString(userDapp, keyArtistAgentAddr(creatorAddr)), feeReceiver) | |
200 | + | let agentShare = valueOrElse(getInteger(userDapp, keySecondaryShare(creatorAddr)), 0) | |
201 | + | let amountForSign = fraction(amount, signCut, 100) | |
202 | + | let amountForCreator = fraction(amount, creatorCut, 10000) | |
203 | + | let amountForOwner = (amount - (amountForSign + amountForCreator)) | |
204 | + | let amountForAgent = if (if ((agent != feeReceiver)) | |
205 | + | then (agentShare > 0) | |
206 | + | else false) | |
207 | + | then fraction(amount, agentShare, 100) | |
208 | + | else 0 | |
209 | + | let commissions = if ((amountForAgent != 0)) | |
210 | + | then [ScriptTransfer(Address(fromBase58String(feeReceiver)), (amountForSign - amountForAgent), assetId), ScriptTransfer(Address(fromBase58String(agent)), amountForAgent, assetId)] | |
211 | + | else [ScriptTransfer(Address(fromBase58String(feeReceiver)), amountForSign, assetId)] | |
212 | + | let creatorFee = ScriptTransfer(Address(fromBase58String(creatorAddr)), amountForCreator, assetId) | |
213 | + | let ownerFee = ScriptTransfer(Address(fromBase58String(saleOwner)), amountForOwner, assetId) | |
214 | + | let collectorNFT = ScriptTransfer(Address(fromBase58String(caller)), 1, fromBase58String(nftid)) | |
215 | + | $Tuple4(commissions, creatorFee, ownerFee, collectorNFT) | |
220 | 216 | } | |
221 | 217 | ||
222 | 218 | ||
259 | 255 | ||
260 | 256 | ||
261 | 257 | func provideBaseData (i,nftId) = { | |
262 | - | let $ | |
263 | - | let id = $ | |
264 | - | let caller = $ | |
265 | - | let date = $ | |
266 | - | let $ | |
267 | - | let isValidNFT = $ | |
268 | - | let artId = $ | |
269 | - | let creatorAddr = $ | |
270 | - | let artSignID = $ | |
258 | + | let $t098419881 = idCallerDate(i) | |
259 | + | let id = $t098419881._1 | |
260 | + | let caller = $t098419881._2 | |
261 | + | let date = $t098419881._3 | |
262 | + | let $t098859954 = checkNFTInfo(nftId) | |
263 | + | let isValidNFT = $t098859954._1 | |
264 | + | let artId = $t098859954._2 | |
265 | + | let creatorAddr = $t098859954._3 | |
266 | + | let artSignID = $t098859954._4 | |
271 | 267 | $Tuple7(id, caller, date, isValidNFT, artId, creatorAddr, artSignID) | |
272 | 268 | } | |
273 | 269 | ||
303 | 299 | ||
304 | 300 | @Callable(i) | |
305 | 301 | func sellNFT (price,asset) = { | |
306 | - | let $ | |
307 | - | let payment = $ | |
308 | - | let amount = $ | |
302 | + | let $t01105911095 = isPayment(i) | |
303 | + | let payment = $t01105911095._1 | |
304 | + | let amount = $t01105911095._2 | |
309 | 305 | if ((amount != 1)) | |
310 | 306 | then throw("No NFT attached") | |
311 | 307 | else { | |
314 | 310 | else false) | |
315 | 311 | then toBase58String(value(payment.assetId)) | |
316 | 312 | else throw("Only SIGN Art NFT accepted.") | |
317 | - | let $ | |
318 | - | let id = $ | |
319 | - | let caller = $ | |
320 | - | let date = $ | |
321 | - | let isValidNFT = $ | |
322 | - | let artId = $ | |
323 | - | let creatorAddr = $ | |
324 | - | let artSignID = $ | |
313 | + | let $t01133311426 = provideBaseData(i, nftId) | |
314 | + | let id = $t01133311426._1 | |
315 | + | let caller = $t01133311426._2 | |
316 | + | let date = $t01133311426._3 | |
317 | + | let isValidNFT = $t01133311426._4 | |
318 | + | let artId = $t01133311426._5 | |
319 | + | let creatorAddr = $t01133311426._6 | |
320 | + | let artSignID = $t01133311426._7 | |
325 | 321 | if ((size(artSignID) == 0)) | |
326 | 322 | then throw("Artwork not found on SIGN Art") | |
327 | 323 | else if (!(isValidNFT)) | |
338 | 334 | ||
339 | 335 | @Callable(i) | |
340 | 336 | func updateSalePrice (nftId,price,asset) = { | |
341 | - | let $ | |
342 | - | let id = $ | |
343 | - | let caller = $ | |
344 | - | let date = $ | |
345 | - | let isValidNFT = $ | |
346 | - | let artId = $ | |
347 | - | let creatorAddr = $ | |
348 | - | let artSignID = $ | |
337 | + | let $t01233012423 = provideBaseData(i, nftId) | |
338 | + | let id = $t01233012423._1 | |
339 | + | let caller = $t01233012423._2 | |
340 | + | let date = $t01233012423._3 | |
341 | + | let isValidNFT = $t01233012423._4 | |
342 | + | let artId = $t01233012423._5 | |
343 | + | let creatorAddr = $t01233012423._6 | |
344 | + | let artSignID = $t01233012423._7 | |
349 | 345 | if ((size(artSignID) == 0)) | |
350 | 346 | then throw("Artwork not found on SIGN Art, cancel your sale.") | |
351 | 347 | else if (!(isValidNFT)) | |
375 | 371 | ||
376 | 372 | @Callable(i) | |
377 | 373 | func cancelSale (nftId) = { | |
378 | - | let $ | |
379 | - | let id = $ | |
380 | - | let caller = $ | |
381 | - | let date = $ | |
382 | - | let isValidNFT = $ | |
383 | - | let artId = $ | |
384 | - | let creatorAddr = $ | |
385 | - | let artSignID = $ | |
374 | + | let $t01360013844 = provideBaseData(i, nftId) | |
375 | + | let id = $t01360013844._1 | |
376 | + | let caller = $t01360013844._2 | |
377 | + | let date = $t01360013844._3 | |
378 | + | let isValidNFT = $t01360013844._4 | |
379 | + | let artId = $t01360013844._5 | |
380 | + | let creatorAddr = $t01360013844._6 | |
381 | + | let artSignID = $t01360013844._7 | |
386 | 382 | let saleOwner = getStrByK(("current_owner_on_dapp_" + nftId)) | |
387 | 383 | if ((saleOwner != caller)) | |
388 | 384 | then throw("You don't own this NFT") | |
402 | 398 | ||
403 | 399 | @Callable(i) | |
404 | 400 | func buyNFT (nftId) = { | |
405 | - | let $ | |
406 | - | let id = $ | |
407 | - | let caller = $ | |
408 | - | let date = $ | |
409 | - | let isValidNFT = $ | |
410 | - | let artId = $ | |
411 | - | let creatorAddr = $ | |
412 | - | let artSignID = $ | |
401 | + | let $t01469814791 = provideBaseData(i, nftId) | |
402 | + | let id = $t01469814791._1 | |
403 | + | let caller = $t01469814791._2 | |
404 | + | let date = $t01469814791._3 | |
405 | + | let isValidNFT = $t01469814791._4 | |
406 | + | let artId = $t01469814791._5 | |
407 | + | let creatorAddr = $t01469814791._6 | |
408 | + | let artSignID = $t01469814791._7 | |
413 | 409 | if ((size(artSignID) == 0)) | |
414 | 410 | then throw("Artwork not found on SIGN Art, cancel your sale.") | |
415 | 411 | else if (!(isValidNFT)) | |
425 | 421 | if ((parseInt(saleInfoArray[1]) == 0)) | |
426 | 422 | then throw("Offer only") | |
427 | 423 | else { | |
428 | - | let $ | |
429 | - | let payment = $ | |
430 | - | let amount = $ | |
424 | + | let $t01530015336 = isPayment(i) | |
425 | + | let payment = $t01530015336._1 | |
426 | + | let amount = $t01530015336._2 | |
431 | 427 | let paymentAssetStr = if (isDefined(payment.assetId)) | |
432 | 428 | then toBase58String(value(payment.assetId)) | |
433 | 429 | else "" | |
436 | 432 | else (saleInfoArray[2] != paymentAssetStr)) | |
437 | 433 | then throw("Payment infos don't match.") | |
438 | 434 | else { | |
439 | - | let $ | |
440 | - | let commissions = $ | |
441 | - | let creatorFee = $ | |
442 | - | let ownerFee = $ | |
443 | - | let collectorNFT = $ | |
435 | + | let $t01585015989 = setTransfers(amount, payment.assetId, nftId, creatorAddr, saleOwner, caller, artId) | |
436 | + | let commissions = $t01585015989._1 | |
437 | + | let creatorFee = $t01585015989._2 | |
438 | + | let ownerFee = $t01585015989._3 | |
439 | + | let collectorNFT = $t01585015989._4 | |
444 | 440 | ([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(), creatorFee, ownerFee, collectorNFT] ++ commissions) | |
445 | 441 | } | |
446 | 442 | } | |
452 | 448 | ||
453 | 449 | @Callable(i) | |
454 | 450 | func setOffer (nftId) = { | |
455 | - | let $ | |
456 | - | let id = $ | |
457 | - | let offerOwner = $ | |
458 | - | let date = $ | |
459 | - | let isValidNFT = $ | |
460 | - | let artId = $ | |
461 | - | let creatorAddr = $ | |
462 | - | let artSignID = $ | |
451 | + | let $t01641716514 = provideBaseData(i, nftId) | |
452 | + | let id = $t01641716514._1 | |
453 | + | let offerOwner = $t01641716514._2 | |
454 | + | let date = $t01641716514._3 | |
455 | + | let isValidNFT = $t01641716514._4 | |
456 | + | let artId = $t01641716514._5 | |
457 | + | let creatorAddr = $t01641716514._6 | |
458 | + | let artSignID = $t01641716514._7 | |
463 | 459 | if (!(isValidNFT)) | |
464 | 460 | then throw("Not a valid nft") | |
465 | 461 | else { | |
466 | - | let $ | |
467 | - | let payment = $ | |
468 | - | let amount = $ | |
462 | + | let $t01657816614 = isPayment(i) | |
463 | + | let payment = $t01657816614._1 | |
464 | + | let amount = $t01657816614._2 | |
469 | 465 | let assetId = if (!(isDefined(payment.assetId))) | |
470 | 466 | then "WAVES" | |
471 | 467 | else toBase58String(value(payment.assetId)) | |
486 | 482 | ||
487 | 483 | @Callable(i) | |
488 | 484 | func acceptOffer (nftId,offerId,offerOwner) = { | |
489 | - | let $ | |
490 | - | let id = $ | |
491 | - | let caller = $ | |
492 | - | let date = $ | |
493 | - | let isValidNFT = $ | |
494 | - | let artId = $ | |
495 | - | let creatorAddr = $ | |
496 | - | let artSignID = $ | |
485 | + | let $t01743517528 = provideBaseData(i, nftId) | |
486 | + | let id = $t01743517528._1 | |
487 | + | let caller = $t01743517528._2 | |
488 | + | let date = $t01743517528._3 | |
489 | + | let isValidNFT = $t01743517528._4 | |
490 | + | let artId = $t01743517528._5 | |
491 | + | let creatorAddr = $t01743517528._6 | |
492 | + | let artSignID = $t01743517528._7 | |
497 | 493 | if (!(isValidNFT)) | |
498 | 494 | then throw("Not a valid nft") | |
499 | 495 | else { | |
502 | 498 | then throw("Only sale owner can accept offer") | |
503 | 499 | else { | |
504 | 500 | let bidKey = getBidKey(offerOwner, nftId, saleOwner, offerId) | |
505 | - | let $ | |
506 | - | let bidDataArr = $ | |
507 | - | let assetId = $ | |
508 | - | let bidData = $ | |
501 | + | let $t01778917844 = getBidData(bidKey) | |
502 | + | let bidDataArr = $t01778917844._1 | |
503 | + | let assetId = $t01778917844._2 | |
504 | + | let bidData = $t01778917844._3 | |
509 | 505 | let saleKey = getSaleKey(saleOwner, nftId, artId, creatorAddr) | |
510 | 506 | let saleInfo = getStrByK((saleKey + "_OPEN")) | |
511 | 507 | if ((size(saleInfo) == 0)) | |
512 | 508 | then throw("Sale Not found!") | |
513 | 509 | else { | |
514 | 510 | let amount = value(parseInt(bidDataArr[1])) | |
515 | - | let $ | |
516 | - | let commissions = $ | |
517 | - | let creatorFee = $ | |
518 | - | let ownerFee = $ | |
519 | - | let collectorNFT = $ | |
511 | + | let $t01808718225 = setTransfers(amount, assetId, nftId, creatorAddr, saleOwner, bidDataArr[6], artId) | |
512 | + | let commissions = $t01808718225._1 | |
513 | + | let creatorFee = $t01808718225._2 | |
514 | + | let ownerFee = $t01808718225._3 | |
515 | + | let collectorNFT = $t01808718225._4 | |
520 | 516 | let assetIdStr = if (isDefined(assetId)) | |
521 | 517 | then toBase58String(value(assetId)) | |
522 | 518 | else "WAVES" | |
530 | 526 | ||
531 | 527 | @Callable(i) | |
532 | 528 | func cancelOffer (nftId,offerId,offerOwner,saleOwner) = { | |
533 | - | let $ | |
534 | - | let id = $ | |
535 | - | let caller = $ | |
536 | - | let date = $ | |
529 | + | let $t01904519120 = idCallerDate(i) | |
530 | + | let id = $t01904519120._1 | |
531 | + | let caller = $t01904519120._2 | |
532 | + | let date = $t01904519120._3 | |
537 | 533 | if (if ((caller != offerOwner)) | |
538 | 534 | then (caller != saleOwner) | |
539 | 535 | else false) | |
540 | 536 | then throw("You cannot cancel this offer.") | |
541 | 537 | else { | |
542 | 538 | let bidKey = getBidKey(offerOwner, nftId, saleOwner, offerId) | |
543 | - | let $ | |
544 | - | let bidDataArr = $ | |
545 | - | let assetId = $ | |
546 | - | let bidData = $ | |
539 | + | let $t01929419349 = getBidData(bidKey) | |
540 | + | let bidDataArr = $t01929419349._1 | |
541 | + | let assetId = $t01929419349._2 | |
542 | + | let bidData = $t01929419349._3 | |
547 | 543 | [DeleteEntry((bidKey + "_OPEN")), StringEntry((bidKey + "_CANCELLED"), ((((bidData + "_CANCELLED_") + toString(date)) + "_") + id)), ScriptTransfer(Address(fromBase58String(caller)), parseIntValue(bidDataArr[1]), assetId)] | |
548 | 544 | } | |
549 | 545 | } |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | func getStrByK (key) = valueOrElse(getString(this, key), "") | |
5 | 5 | ||
6 | 6 | ||
7 | 7 | let unitTest = false | |
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 artworksDapp = value(addressFromString(getStrByK("conf_artworks_dapp"))) | |
14 | 14 | ||
15 | 15 | let userDapp = if (unitTest) | |
16 | 16 | then value(addressFromString("3Mt4RGMEyjSWYAocTPqd55wdHQQB3PU2UCm")) | |
17 | 17 | else value(addressFromString(getStrByK("conf_users_dapp"))) | |
18 | 18 | ||
19 | 19 | let signAssetId = fromBase58String(getStrByK("conf_accepted_asset_SIGN")) | |
20 | 20 | ||
21 | 21 | let usdnAssetId = fromBase58String(getStrByK("conf_accepted_asset_USDN")) | |
22 | 22 | ||
23 | 23 | let usdtAssetId = fromBase58String(getStrByK("conf_accepted_asset_USDT")) | |
24 | 24 | ||
25 | 25 | let wavesAssetId = base58'' | |
26 | 26 | ||
27 | 27 | let chris = getStrByK("conf_admin_1") | |
28 | 28 | ||
29 | 29 | let signCut = 3 | |
30 | 30 | ||
31 | 31 | let userSuspended = "SUSPENDED" | |
32 | 32 | ||
33 | 33 | let userRemoved = "REMOVED" | |
34 | 34 | ||
35 | 35 | let artIllegal = "ILLEGAL" | |
36 | 36 | ||
37 | 37 | let artSuspended = "SUSPENDED" | |
38 | 38 | ||
39 | 39 | let dappRunningKey = "conf_dapp_is_running" | |
40 | 40 | ||
41 | 41 | let maintenanceMSGKey = "conf_maintenance_msg" | |
42 | 42 | ||
43 | 43 | let dappRunning = valueOrElse(getBoolean(this, dappRunningKey), true) | |
44 | 44 | ||
45 | 45 | let maintenanceMSG = valueOrElse(getString(this, maintenanceMSGKey), "") | |
46 | 46 | ||
47 | 47 | let numSalesK = "num_sales" | |
48 | 48 | ||
49 | 49 | func getUserStrByK (key) = valueOrElse(getString(userDapp, key), "Error") | |
50 | 50 | ||
51 | 51 | ||
52 | 52 | func getArtworkRoyalties (key) = valueOrElse(getInteger(artworksDapp, key), 1000) | |
53 | 53 | ||
54 | 54 | ||
55 | 55 | func getArtStrByK (key) = valueOrElse(getString(artworksDapp, key), "") | |
56 | 56 | ||
57 | 57 | ||
58 | 58 | func getIntByK (key) = valueOrElse(getInteger(this, key), 0) | |
59 | 59 | ||
60 | 60 | ||
61 | 61 | func keyUserStatus (addr) = ("user_status_" + addr) | |
62 | 62 | ||
63 | 63 | ||
64 | 64 | func keyArtworkRoyalties (caller,artId) = ((("art_royalties_" + artId) + "_") + caller) | |
65 | 65 | ||
66 | 66 | ||
67 | 67 | func keySignID (artistAddr,artId) = ((("art_signid_" + artId) + "_") + artistAddr) | |
68 | 68 | ||
69 | 69 | ||
70 | 70 | func keyFlag (artistAddr,artId) = ((("art_flag_" + artId) + "_") + artistAddr) | |
71 | 71 | ||
72 | 72 | ||
73 | 73 | func keyNFTData (id) = ("nft_" + id) | |
74 | 74 | ||
75 | 75 | ||
76 | 76 | func getSaleKey (caller,nftId,artId,creatorAddr) = ((((((("sale2nd_info_" + caller) + "_") + nftId) + "_") + artId) + "_") + creatorAddr) | |
77 | 77 | ||
78 | 78 | ||
79 | 79 | func getBidKey (offerOwner,nftId,saleOwner,offerId) = ((((((("offer2nd_" + offerOwner) + "_") + nftId) + "_") + saleOwner) + "_") + offerId) | |
80 | 80 | ||
81 | 81 | ||
82 | 82 | func getIntByKFromOracle (key) = valueOrErrorMessage(getInteger(oracleFee, key), "Integer undefine or 0 in oracle") | |
83 | 83 | ||
84 | 84 | ||
85 | 85 | let currentCertificationPrice = getIntByKFromOracle(("certification_fee_" + toBase58String(signAssetId))) | |
86 | 86 | ||
87 | 87 | func keyArtistAgentAddr (artistAddr) = ("artist_agent_" + artistAddr) | |
88 | 88 | ||
89 | 89 | ||
90 | 90 | func keySecondaryShare (artistAddr) = ("artist_agent_secondary_" + artistAddr) | |
91 | 91 | ||
92 | 92 | ||
93 | 93 | func idCallerDate (i) = if (!(dappRunning)) | |
94 | 94 | then throw(maintenanceMSG) | |
95 | 95 | else $Tuple3(toBase58String(i.transactionId), toBase58String(i.caller.bytes), lastBlock.timestamp) | |
96 | 96 | ||
97 | 97 | ||
98 | 98 | func isPayment (i) = if ((size(i.payments) == 0)) | |
99 | 99 | then throw("No payment attached") | |
100 | 100 | else { | |
101 | 101 | let payment = value(i.payments[0]) | |
102 | 102 | let amount = value(payment.amount) | |
103 | 103 | $Tuple2(payment, amount) | |
104 | 104 | } | |
105 | 105 | ||
106 | 106 | ||
107 | 107 | func assetIsValid (assetDetails) = if (if (if ((assetDetails.quantity == 1)) | |
108 | 108 | then (assetDetails.decimals == 0) | |
109 | 109 | else false) | |
110 | 110 | then (assetDetails.reissuable == false) | |
111 | 111 | else false) | |
112 | 112 | then (assetDetails.issuer == artworksDapp) | |
113 | 113 | else false | |
114 | 114 | ||
115 | 115 | ||
116 | 116 | func isSignArtNFT (id) = { | |
117 | 117 | let assetDetails = value(assetInfo(id)) | |
118 | 118 | assetIsValid(assetDetails) | |
119 | 119 | } | |
120 | 120 | ||
121 | 121 | ||
122 | 122 | func acceptedAssetIds (assetId) = if (if (if (if (if ((assetId != toBase58String(signAssetId))) | |
123 | 123 | then (assetId != toBase58String(wavesAssetId)) | |
124 | 124 | else false) | |
125 | 125 | then (assetId != "WAVES") | |
126 | 126 | else false) | |
127 | 127 | then (assetId != toBase58String(usdnAssetId)) | |
128 | 128 | else false) | |
129 | 129 | then (assetId != toBase58String(usdtAssetId)) | |
130 | 130 | else false) | |
131 | 131 | then false | |
132 | 132 | else true | |
133 | 133 | ||
134 | 134 | ||
135 | 135 | func getBidAssetId (assetId) = if ((assetId == "WAVES")) | |
136 | 136 | then unit | |
137 | 137 | else fromBase58String(assetId) | |
138 | 138 | ||
139 | 139 | ||
140 | 140 | func getSaleOwnerAndStatus (nftid) = { | |
141 | 141 | let saleOwner = getStrByK(("current_owner_on_dapp_" + nftid)) | |
142 | 142 | if ((size(saleOwner) == 0)) | |
143 | 143 | then throw("NFT not found") | |
144 | 144 | else { | |
145 | 145 | let saleStatus = getStrByK(((("sale2nd_status_" + saleOwner) + "_") + nftid)) | |
146 | 146 | if ((saleStatus != "OPEN")) | |
147 | 147 | then throw("NFT not for sale") | |
148 | 148 | else saleOwner | |
149 | 149 | } | |
150 | 150 | } | |
151 | 151 | ||
152 | 152 | ||
153 | 153 | func getBidData (key) = { | |
154 | 154 | let bidData = getStrByK((key + "_OPEN")) | |
155 | 155 | if ((bidData == "")) | |
156 | 156 | then throw("Offer not found") | |
157 | 157 | else { | |
158 | 158 | let bidDataArr = split(bidData, "_") | |
159 | 159 | let assetId = getBidAssetId(bidDataArr[2]) | |
160 | 160 | $Tuple3(bidDataArr, assetId, bidData) | |
161 | 161 | } | |
162 | 162 | } | |
163 | 163 | ||
164 | 164 | ||
165 | 165 | func artIsValid (artStatus) = if ((artStatus != artIllegal)) | |
166 | 166 | then (artStatus != artSuspended) | |
167 | 167 | else false | |
168 | 168 | ||
169 | 169 | ||
170 | 170 | func checkArtStatus (addr,id) = { | |
171 | 171 | let artStatus = getArtStrByK(keyFlag(addr, id)) | |
172 | 172 | if (artIsValid(artStatus)) | |
173 | 173 | then true | |
174 | 174 | else throw(("Original Artwork flagged as " + artStatus)) | |
175 | 175 | } | |
176 | 176 | ||
177 | 177 | ||
178 | 178 | func checkArtistStatus (addr) = { | |
179 | 179 | let artistStatus = getUserStrByK(keyUserStatus(addr)) | |
180 | 180 | if (containsElement([userSuspended, userRemoved], artistStatus)) | |
181 | 181 | then throw(("Original Artist " + artistStatus)) | |
182 | 182 | else true | |
183 | 183 | } | |
184 | 184 | ||
185 | 185 | ||
186 | 186 | func checkNFTInfo (assetId) = { | |
187 | 187 | let nftData = split(getArtStrByK(keyNFTData(assetId)), "_") | |
188 | 188 | let artSignID = getArtStrByK(keySignID(nftData[6], nftData[5])) | |
189 | 189 | if (if (!(checkArtStatus(nftData[6], nftData[5]))) | |
190 | 190 | then !(checkArtistStatus(nftData[6])) | |
191 | 191 | else false) | |
192 | 192 | then $Tuple4(false, nftData[5], nftData[6], artSignID) | |
193 | 193 | else $Tuple4(true, nftData[5], nftData[6], artSignID) | |
194 | 194 | } | |
195 | 195 | ||
196 | 196 | ||
197 | 197 | func setTransfers (amount,assetId,nftid,creatorAddr,saleOwner,caller,artId) = { | |
198 | 198 | let creatorCut = getArtworkRoyalties(keyArtworkRoyalties(creatorAddr, artId)) | |
199 | - | if (true) | |
200 | - | then throw(((((keyArtworkRoyalties(creatorAddr, nftid) + " / ") + toString(amount)) + " / ") + toString(creatorCut))) | |
201 | - | else { | |
202 | - | let agent = valueOrElse(getString(userDapp, keyArtistAgentAddr(creatorAddr)), feeReceiver) | |
203 | - | let agentShare = valueOrElse(getInteger(userDapp, keySecondaryShare(creatorAddr)), 0) | |
204 | - | let amountForSign = fraction(amount, signCut, 100) | |
205 | - | let amountForCreator = fraction(amount, creatorCut, 10000) | |
206 | - | let amountForOwner = (amount - (amountForSign + amountForCreator)) | |
207 | - | let amountForAgent = if (if ((agent != feeReceiver)) | |
208 | - | then (agentShare > 0) | |
209 | - | else false) | |
210 | - | then fraction(amount, agentShare, 100) | |
211 | - | else 0 | |
212 | - | let commissions = if ((amountForAgent != 0)) | |
213 | - | then [ScriptTransfer(Address(fromBase58String(feeReceiver)), (amountForSign - amountForAgent), assetId), ScriptTransfer(Address(fromBase58String(agent)), amountForAgent, assetId)] | |
214 | - | else [ScriptTransfer(Address(fromBase58String(feeReceiver)), amountForSign, assetId)] | |
215 | - | let creatorFee = ScriptTransfer(Address(fromBase58String(creatorAddr)), amountForCreator, assetId) | |
216 | - | let ownerFee = ScriptTransfer(Address(fromBase58String(saleOwner)), amountForOwner, assetId) | |
217 | - | let collectorNFT = ScriptTransfer(Address(fromBase58String(caller)), 1, fromBase58String(nftid)) | |
218 | - | $Tuple4(commissions, creatorFee, ownerFee, collectorNFT) | |
219 | - | } | |
199 | + | let agent = valueOrElse(getString(userDapp, keyArtistAgentAddr(creatorAddr)), feeReceiver) | |
200 | + | let agentShare = valueOrElse(getInteger(userDapp, keySecondaryShare(creatorAddr)), 0) | |
201 | + | let amountForSign = fraction(amount, signCut, 100) | |
202 | + | let amountForCreator = fraction(amount, creatorCut, 10000) | |
203 | + | let amountForOwner = (amount - (amountForSign + amountForCreator)) | |
204 | + | let amountForAgent = if (if ((agent != feeReceiver)) | |
205 | + | then (agentShare > 0) | |
206 | + | else false) | |
207 | + | then fraction(amount, agentShare, 100) | |
208 | + | else 0 | |
209 | + | let commissions = if ((amountForAgent != 0)) | |
210 | + | then [ScriptTransfer(Address(fromBase58String(feeReceiver)), (amountForSign - amountForAgent), assetId), ScriptTransfer(Address(fromBase58String(agent)), amountForAgent, assetId)] | |
211 | + | else [ScriptTransfer(Address(fromBase58String(feeReceiver)), amountForSign, assetId)] | |
212 | + | let creatorFee = ScriptTransfer(Address(fromBase58String(creatorAddr)), amountForCreator, assetId) | |
213 | + | let ownerFee = ScriptTransfer(Address(fromBase58String(saleOwner)), amountForOwner, assetId) | |
214 | + | let collectorNFT = ScriptTransfer(Address(fromBase58String(caller)), 1, fromBase58String(nftid)) | |
215 | + | $Tuple4(commissions, creatorFee, ownerFee, collectorNFT) | |
220 | 216 | } | |
221 | 217 | ||
222 | 218 | ||
223 | 219 | func validateMinSell (assetId,price) = { | |
224 | 220 | let minSellWaves = if (unitTest) | |
225 | 221 | then 10 | |
226 | 222 | else getIntByKFromOracle("waves_min_sell") | |
227 | 223 | let minSellUsdn = 1000000 | |
228 | 224 | let minSellSign = if (unitTest) | |
229 | 225 | then 1 | |
230 | 226 | else (currentCertificationPrice * 2) | |
231 | 227 | if (if (if (if (if (if ((assetId == toBase58String(usdnAssetId))) | |
232 | 228 | then (minSellUsdn > price) | |
233 | 229 | else false) | |
234 | 230 | then (price != 0) | |
235 | 231 | else false) | |
236 | 232 | then true | |
237 | 233 | else if (if ((assetId == toBase58String(usdtAssetId))) | |
238 | 234 | then (minSellUsdn > price) | |
239 | 235 | else false) | |
240 | 236 | then (price != 0) | |
241 | 237 | else false) | |
242 | 238 | then true | |
243 | 239 | else if (if ((assetId == toBase58String(signAssetId))) | |
244 | 240 | then (minSellSign > price) | |
245 | 241 | else false) | |
246 | 242 | then (price != 0) | |
247 | 243 | else false) | |
248 | 244 | then true | |
249 | 245 | else if (if (if ((assetId == toBase58String(wavesAssetId))) | |
250 | 246 | then true | |
251 | 247 | else (assetId == "WAVES")) | |
252 | 248 | then (minSellWaves > price) | |
253 | 249 | else false) | |
254 | 250 | then (price != 0) | |
255 | 251 | else false) | |
256 | 252 | then false | |
257 | 253 | else true | |
258 | 254 | } | |
259 | 255 | ||
260 | 256 | ||
261 | 257 | func provideBaseData (i,nftId) = { | |
262 | - | let $ | |
263 | - | let id = $ | |
264 | - | let caller = $ | |
265 | - | let date = $ | |
266 | - | let $ | |
267 | - | let isValidNFT = $ | |
268 | - | let artId = $ | |
269 | - | let creatorAddr = $ | |
270 | - | let artSignID = $ | |
258 | + | let $t098419881 = idCallerDate(i) | |
259 | + | let id = $t098419881._1 | |
260 | + | let caller = $t098419881._2 | |
261 | + | let date = $t098419881._3 | |
262 | + | let $t098859954 = checkNFTInfo(nftId) | |
263 | + | let isValidNFT = $t098859954._1 | |
264 | + | let artId = $t098859954._2 | |
265 | + | let creatorAddr = $t098859954._3 | |
266 | + | let artSignID = $t098859954._4 | |
271 | 267 | $Tuple7(id, caller, date, isValidNFT, artId, creatorAddr, artSignID) | |
272 | 268 | } | |
273 | 269 | ||
274 | 270 | ||
275 | 271 | func updateNumSales () = { | |
276 | 272 | let numSales = getIntByK(numSalesK) | |
277 | 273 | IntegerEntry(numSalesK, (numSales + 1)) | |
278 | 274 | } | |
279 | 275 | ||
280 | 276 | ||
281 | 277 | @Callable(invoke) | |
282 | 278 | func setConf (key,val) = { | |
283 | 279 | let caller = toString(invoke.caller) | |
284 | 280 | if (containsElement([chris, toString(this)], caller)) | |
285 | 281 | then if (contains(key, "conf_")) | |
286 | 282 | then [StringEntry(key, val)] | |
287 | 283 | else throw("Entries starting with conf_ only") | |
288 | 284 | else throw("You are not allowed to change this") | |
289 | 285 | } | |
290 | 286 | ||
291 | 287 | ||
292 | 288 | ||
293 | 289 | @Callable(invoke) | |
294 | 290 | func appRunning (isLive,message) = { | |
295 | 291 | let caller = toString(invoke.caller) | |
296 | 292 | let id = toBase58String(invoke.transactionId) | |
297 | 293 | if (containsElement([chris, toString(this)], caller)) | |
298 | 294 | then [BooleanEntry(dappRunningKey, isLive), StringEntry(maintenanceMSGKey, message)] | |
299 | 295 | else throw("You are not allowed to change this") | |
300 | 296 | } | |
301 | 297 | ||
302 | 298 | ||
303 | 299 | ||
304 | 300 | @Callable(i) | |
305 | 301 | func sellNFT (price,asset) = { | |
306 | - | let $ | |
307 | - | let payment = $ | |
308 | - | let amount = $ | |
302 | + | let $t01105911095 = isPayment(i) | |
303 | + | let payment = $t01105911095._1 | |
304 | + | let amount = $t01105911095._2 | |
309 | 305 | if ((amount != 1)) | |
310 | 306 | then throw("No NFT attached") | |
311 | 307 | else { | |
312 | 308 | let nftId = if (if (isDefined(payment.assetId)) | |
313 | 309 | then isSignArtNFT(value(payment.assetId)) | |
314 | 310 | else false) | |
315 | 311 | then toBase58String(value(payment.assetId)) | |
316 | 312 | else throw("Only SIGN Art NFT accepted.") | |
317 | - | let $ | |
318 | - | let id = $ | |
319 | - | let caller = $ | |
320 | - | let date = $ | |
321 | - | let isValidNFT = $ | |
322 | - | let artId = $ | |
323 | - | let creatorAddr = $ | |
324 | - | let artSignID = $ | |
313 | + | let $t01133311426 = provideBaseData(i, nftId) | |
314 | + | let id = $t01133311426._1 | |
315 | + | let caller = $t01133311426._2 | |
316 | + | let date = $t01133311426._3 | |
317 | + | let isValidNFT = $t01133311426._4 | |
318 | + | let artId = $t01133311426._5 | |
319 | + | let creatorAddr = $t01133311426._6 | |
320 | + | let artSignID = $t01133311426._7 | |
325 | 321 | if ((size(artSignID) == 0)) | |
326 | 322 | then throw("Artwork not found on SIGN Art") | |
327 | 323 | else if (!(isValidNFT)) | |
328 | 324 | then throw("Not a valid nft") | |
329 | 325 | else if (!(acceptedAssetIds(asset))) | |
330 | 326 | then throw("Only SIGN, USDN, USDT or WAVES accepted") | |
331 | 327 | else if (!(validateMinSell(asset, price))) | |
332 | 328 | then throw("Wrong minimum sell price") | |
333 | 329 | else [StringEntry((getSaleKey(caller, nftId, artId, creatorAddr) + "_OPEN"), ((((((((((((toString(date) + "_") + toString(price)) + "_") + asset) + "_") + nftId) + "_") + artId) + "_") + creatorAddr) + "_") + id)), StringEntry(((("sale2nd_status_" + caller) + "_") + nftId), "OPEN"), StringEntry(("current_owner_on_dapp_" + nftId), caller)] | |
334 | 330 | } | |
335 | 331 | } | |
336 | 332 | ||
337 | 333 | ||
338 | 334 | ||
339 | 335 | @Callable(i) | |
340 | 336 | func updateSalePrice (nftId,price,asset) = { | |
341 | - | let $ | |
342 | - | let id = $ | |
343 | - | let caller = $ | |
344 | - | let date = $ | |
345 | - | let isValidNFT = $ | |
346 | - | let artId = $ | |
347 | - | let creatorAddr = $ | |
348 | - | let artSignID = $ | |
337 | + | let $t01233012423 = provideBaseData(i, nftId) | |
338 | + | let id = $t01233012423._1 | |
339 | + | let caller = $t01233012423._2 | |
340 | + | let date = $t01233012423._3 | |
341 | + | let isValidNFT = $t01233012423._4 | |
342 | + | let artId = $t01233012423._5 | |
343 | + | let creatorAddr = $t01233012423._6 | |
344 | + | let artSignID = $t01233012423._7 | |
349 | 345 | if ((size(artSignID) == 0)) | |
350 | 346 | then throw("Artwork not found on SIGN Art, cancel your sale.") | |
351 | 347 | else if (!(isValidNFT)) | |
352 | 348 | then throw("Not a valid nft") | |
353 | 349 | else { | |
354 | 350 | let saleOwner = getStrByK(("current_owner_on_dapp_" + nftId)) | |
355 | 351 | if ((saleOwner != caller)) | |
356 | 352 | then throw("You don't own this NFT") | |
357 | 353 | else { | |
358 | 354 | let saleStatus = getStrByK(((("sale2nd_status_" + caller) + "_") + nftId)) | |
359 | 355 | if ((saleStatus != "OPEN")) | |
360 | 356 | then throw("Sale not active") | |
361 | 357 | else if (!(acceptedAssetIds(asset))) | |
362 | 358 | then throw("Only SIGN, USDN, USDT or WAVES accepted") | |
363 | 359 | else if (!(validateMinSell(asset, price))) | |
364 | 360 | then throw("Wrong minimum sell price") | |
365 | 361 | else { | |
366 | 362 | let saleKey = getSaleKey(caller, nftId, artId, creatorAddr) | |
367 | 363 | let saleInfo = split(getStrByK((saleKey + "_OPEN")), "_") | |
368 | 364 | [StringEntry((saleKey + "_OPEN"), ((((((((((((saleInfo[0] + "_") + toString(price)) + "_") + asset) + "_") + saleInfo[3]) + "_") + saleInfo[4]) + "_") + saleInfo[5]) + "_") + saleInfo[6]))] | |
369 | 365 | } | |
370 | 366 | } | |
371 | 367 | } | |
372 | 368 | } | |
373 | 369 | ||
374 | 370 | ||
375 | 371 | ||
376 | 372 | @Callable(i) | |
377 | 373 | func cancelSale (nftId) = { | |
378 | - | let $ | |
379 | - | let id = $ | |
380 | - | let caller = $ | |
381 | - | let date = $ | |
382 | - | let isValidNFT = $ | |
383 | - | let artId = $ | |
384 | - | let creatorAddr = $ | |
385 | - | let artSignID = $ | |
374 | + | let $t01360013844 = provideBaseData(i, nftId) | |
375 | + | let id = $t01360013844._1 | |
376 | + | let caller = $t01360013844._2 | |
377 | + | let date = $t01360013844._3 | |
378 | + | let isValidNFT = $t01360013844._4 | |
379 | + | let artId = $t01360013844._5 | |
380 | + | let creatorAddr = $t01360013844._6 | |
381 | + | let artSignID = $t01360013844._7 | |
386 | 382 | let saleOwner = getStrByK(("current_owner_on_dapp_" + nftId)) | |
387 | 383 | if ((saleOwner != caller)) | |
388 | 384 | then throw("You don't own this NFT") | |
389 | 385 | else { | |
390 | 386 | let saleStatus = getStrByK(((("sale2nd_status_" + caller) + "_") + nftId)) | |
391 | 387 | if ((saleStatus != "OPEN")) | |
392 | 388 | then throw("Sale not active") | |
393 | 389 | else { | |
394 | 390 | let saleKey = getSaleKey(caller, nftId, artId, creatorAddr) | |
395 | 391 | let saleInfo = getStrByK((saleKey + "_OPEN")) | |
396 | 392 | [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))] | |
397 | 393 | } | |
398 | 394 | } | |
399 | 395 | } | |
400 | 396 | ||
401 | 397 | ||
402 | 398 | ||
403 | 399 | @Callable(i) | |
404 | 400 | func buyNFT (nftId) = { | |
405 | - | let $ | |
406 | - | let id = $ | |
407 | - | let caller = $ | |
408 | - | let date = $ | |
409 | - | let isValidNFT = $ | |
410 | - | let artId = $ | |
411 | - | let creatorAddr = $ | |
412 | - | let artSignID = $ | |
401 | + | let $t01469814791 = provideBaseData(i, nftId) | |
402 | + | let id = $t01469814791._1 | |
403 | + | let caller = $t01469814791._2 | |
404 | + | let date = $t01469814791._3 | |
405 | + | let isValidNFT = $t01469814791._4 | |
406 | + | let artId = $t01469814791._5 | |
407 | + | let creatorAddr = $t01469814791._6 | |
408 | + | let artSignID = $t01469814791._7 | |
413 | 409 | if ((size(artSignID) == 0)) | |
414 | 410 | then throw("Artwork not found on SIGN Art, cancel your sale.") | |
415 | 411 | else if (!(isValidNFT)) | |
416 | 412 | then throw("Not a valid nft") | |
417 | 413 | else { | |
418 | 414 | let saleOwner = getSaleOwnerAndStatus(nftId) | |
419 | 415 | let saleKey = getSaleKey(saleOwner, nftId, artId, creatorAddr) | |
420 | 416 | let saleInfo = getStrByK((saleKey + "_OPEN")) | |
421 | 417 | if ((size(saleInfo) == 0)) | |
422 | 418 | then throw("Sale Not found!") | |
423 | 419 | else { | |
424 | 420 | let saleInfoArray = split(saleInfo, "_") | |
425 | 421 | if ((parseInt(saleInfoArray[1]) == 0)) | |
426 | 422 | then throw("Offer only") | |
427 | 423 | else { | |
428 | - | let $ | |
429 | - | let payment = $ | |
430 | - | let amount = $ | |
424 | + | let $t01530015336 = isPayment(i) | |
425 | + | let payment = $t01530015336._1 | |
426 | + | let amount = $t01530015336._2 | |
431 | 427 | let paymentAssetStr = if (isDefined(payment.assetId)) | |
432 | 428 | then toBase58String(value(payment.assetId)) | |
433 | 429 | else "" | |
434 | 430 | if (if ((saleInfoArray[1] != toString(amount))) | |
435 | 431 | then true | |
436 | 432 | else (saleInfoArray[2] != paymentAssetStr)) | |
437 | 433 | then throw("Payment infos don't match.") | |
438 | 434 | else { | |
439 | - | let $ | |
440 | - | let commissions = $ | |
441 | - | let creatorFee = $ | |
442 | - | let ownerFee = $ | |
443 | - | let collectorNFT = $ | |
435 | + | let $t01585015989 = setTransfers(amount, payment.assetId, nftId, creatorAddr, saleOwner, caller, artId) | |
436 | + | let commissions = $t01585015989._1 | |
437 | + | let creatorFee = $t01585015989._2 | |
438 | + | let ownerFee = $t01585015989._3 | |
439 | + | let collectorNFT = $t01585015989._4 | |
444 | 440 | ([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(), creatorFee, ownerFee, collectorNFT] ++ commissions) | |
445 | 441 | } | |
446 | 442 | } | |
447 | 443 | } | |
448 | 444 | } | |
449 | 445 | } | |
450 | 446 | ||
451 | 447 | ||
452 | 448 | ||
453 | 449 | @Callable(i) | |
454 | 450 | func setOffer (nftId) = { | |
455 | - | let $ | |
456 | - | let id = $ | |
457 | - | let offerOwner = $ | |
458 | - | let date = $ | |
459 | - | let isValidNFT = $ | |
460 | - | let artId = $ | |
461 | - | let creatorAddr = $ | |
462 | - | let artSignID = $ | |
451 | + | let $t01641716514 = provideBaseData(i, nftId) | |
452 | + | let id = $t01641716514._1 | |
453 | + | let offerOwner = $t01641716514._2 | |
454 | + | let date = $t01641716514._3 | |
455 | + | let isValidNFT = $t01641716514._4 | |
456 | + | let artId = $t01641716514._5 | |
457 | + | let creatorAddr = $t01641716514._6 | |
458 | + | let artSignID = $t01641716514._7 | |
463 | 459 | if (!(isValidNFT)) | |
464 | 460 | then throw("Not a valid nft") | |
465 | 461 | else { | |
466 | - | let $ | |
467 | - | let payment = $ | |
468 | - | let amount = $ | |
462 | + | let $t01657816614 = isPayment(i) | |
463 | + | let payment = $t01657816614._1 | |
464 | + | let amount = $t01657816614._2 | |
469 | 465 | let assetId = if (!(isDefined(payment.assetId))) | |
470 | 466 | then "WAVES" | |
471 | 467 | else toBase58String(value(payment.assetId)) | |
472 | 468 | if (!(acceptedAssetIds(assetId))) | |
473 | 469 | then throw("asset not accepted") | |
474 | 470 | else if ((amount == 0)) | |
475 | 471 | then throw("Offer of 0 not allowed") | |
476 | 472 | else if (!(validateMinSell(assetId, amount))) | |
477 | 473 | then throw("Wrong minimum sell price") | |
478 | 474 | else { | |
479 | 475 | let saleOwner = getSaleOwnerAndStatus(nftId) | |
480 | 476 | [StringEntry((getBidKey(offerOwner, nftId, saleOwner, id) + "_OPEN"), ((((((((((((((toString(date) + "_") + toString(amount)) + "_") + assetId) + "_") + nftId) + "_") + artId) + "_") + creatorAddr) + "_") + offerOwner) + "_") + id))] | |
481 | 477 | } | |
482 | 478 | } | |
483 | 479 | } | |
484 | 480 | ||
485 | 481 | ||
486 | 482 | ||
487 | 483 | @Callable(i) | |
488 | 484 | func acceptOffer (nftId,offerId,offerOwner) = { | |
489 | - | let $ | |
490 | - | let id = $ | |
491 | - | let caller = $ | |
492 | - | let date = $ | |
493 | - | let isValidNFT = $ | |
494 | - | let artId = $ | |
495 | - | let creatorAddr = $ | |
496 | - | let artSignID = $ | |
485 | + | let $t01743517528 = provideBaseData(i, nftId) | |
486 | + | let id = $t01743517528._1 | |
487 | + | let caller = $t01743517528._2 | |
488 | + | let date = $t01743517528._3 | |
489 | + | let isValidNFT = $t01743517528._4 | |
490 | + | let artId = $t01743517528._5 | |
491 | + | let creatorAddr = $t01743517528._6 | |
492 | + | let artSignID = $t01743517528._7 | |
497 | 493 | if (!(isValidNFT)) | |
498 | 494 | then throw("Not a valid nft") | |
499 | 495 | else { | |
500 | 496 | let saleOwner = getSaleOwnerAndStatus(nftId) | |
501 | 497 | if ((caller != saleOwner)) | |
502 | 498 | then throw("Only sale owner can accept offer") | |
503 | 499 | else { | |
504 | 500 | let bidKey = getBidKey(offerOwner, nftId, saleOwner, offerId) | |
505 | - | let $ | |
506 | - | let bidDataArr = $ | |
507 | - | let assetId = $ | |
508 | - | let bidData = $ | |
501 | + | let $t01778917844 = getBidData(bidKey) | |
502 | + | let bidDataArr = $t01778917844._1 | |
503 | + | let assetId = $t01778917844._2 | |
504 | + | let bidData = $t01778917844._3 | |
509 | 505 | let saleKey = getSaleKey(saleOwner, nftId, artId, creatorAddr) | |
510 | 506 | let saleInfo = getStrByK((saleKey + "_OPEN")) | |
511 | 507 | if ((size(saleInfo) == 0)) | |
512 | 508 | then throw("Sale Not found!") | |
513 | 509 | else { | |
514 | 510 | let amount = value(parseInt(bidDataArr[1])) | |
515 | - | let $ | |
516 | - | let commissions = $ | |
517 | - | let creatorFee = $ | |
518 | - | let ownerFee = $ | |
519 | - | let collectorNFT = $ | |
511 | + | let $t01808718225 = setTransfers(amount, assetId, nftId, creatorAddr, saleOwner, bidDataArr[6], artId) | |
512 | + | let commissions = $t01808718225._1 | |
513 | + | let creatorFee = $t01808718225._2 | |
514 | + | let ownerFee = $t01808718225._3 | |
515 | + | let collectorNFT = $t01808718225._4 | |
520 | 516 | let assetIdStr = if (isDefined(assetId)) | |
521 | 517 | then toBase58String(value(assetId)) | |
522 | 518 | else "WAVES" | |
523 | 519 | ([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(), creatorFee, ownerFee, collectorNFT] ++ commissions) | |
524 | 520 | } | |
525 | 521 | } | |
526 | 522 | } | |
527 | 523 | } | |
528 | 524 | ||
529 | 525 | ||
530 | 526 | ||
531 | 527 | @Callable(i) | |
532 | 528 | func cancelOffer (nftId,offerId,offerOwner,saleOwner) = { | |
533 | - | let $ | |
534 | - | let id = $ | |
535 | - | let caller = $ | |
536 | - | let date = $ | |
529 | + | let $t01904519120 = idCallerDate(i) | |
530 | + | let id = $t01904519120._1 | |
531 | + | let caller = $t01904519120._2 | |
532 | + | let date = $t01904519120._3 | |
537 | 533 | if (if ((caller != offerOwner)) | |
538 | 534 | then (caller != saleOwner) | |
539 | 535 | else false) | |
540 | 536 | then throw("You cannot cancel this offer.") | |
541 | 537 | else { | |
542 | 538 | let bidKey = getBidKey(offerOwner, nftId, saleOwner, offerId) | |
543 | - | let $ | |
544 | - | let bidDataArr = $ | |
545 | - | let assetId = $ | |
546 | - | let bidData = $ | |
539 | + | let $t01929419349 = getBidData(bidKey) | |
540 | + | let bidDataArr = $t01929419349._1 | |
541 | + | let assetId = $t01929419349._2 | |
542 | + | let bidData = $t01929419349._3 | |
547 | 543 | [DeleteEntry((bidKey + "_OPEN")), StringEntry((bidKey + "_CANCELLED"), ((((bidData + "_CANCELLED_") + toString(date)) + "_") + id)), ScriptTransfer(Address(fromBase58String(caller)), parseIntValue(bidDataArr[1]), assetId)] | |
548 | 544 | } | |
549 | 545 | } | |
550 | 546 | ||
551 | 547 |
github/deemru/w8io/026f985 91.29 ms ◑