tx · 8A55QnKc8T26dqvS56mu1n45iPV2i91yNgg1iPUNK5CE 3NBynfbXC2KastUxhukcMUaE58K9cBdB9UY: -0.19000000 Waves 2023.03.24 07:00 [2503580] smart account 3NBynfbXC2KastUxhukcMUaE58K9cBdB9UY > SELF 0.00000000 Waves
{ "type": 13, "id": "8A55QnKc8T26dqvS56mu1n45iPV2i91yNgg1iPUNK5CE", "fee": 19000000, "feeAssetId": null, "timestamp": 1679630432846, "version": 2, "chainId": 84, "sender": "3NBynfbXC2KastUxhukcMUaE58K9cBdB9UY", "senderPublicKey": "J9DCtJJxJBWZdtDR12BA1U94Q3cZzMi4R6k5hYkAzmzC", "proofs": [ "44hVgKsBVT9DQZMbCLS66RTjNAz4bnRPFhkgW8tLg355pTocGmWVHP6adoyvFvvHTy4n7DWDC4S8x3yqoMX1hwoC" ], "script": "base64:BgKKFQgCEgQKAggIEhAKDggICAgICAgICAgICAEIEg8KDQgICAgICAgICAgIAQgSBgoECAgICBIECgIICBIICgYIAQEIAQgSBAoCCAgSBAoCCAgSBwoFCAgICAgSBgoECAgICCIOZ2V0U3RyaW5nQnlLZXkiA2tleSIIdW5pdFRlc3QiCW9yYWNsZUZlZSIIc2lnbkRhcHAiC2ZlZVJlY2VpdmVyIgh1c2VyRGFwcCINd2hpdGVsaXN0RGFwcCILc2lnbkFzc2V0SWQiC3VzZG5Bc3NldElkIgt1c2R0QXNzZXRJZCIMd2F2ZXNBc3NldElkIgVjaHJpcyIZZ2V0SW50ZWdlckJ5S2V5RnJvbU9yYWNsZSIPZ2V0SW50ZWdlckJ5S2V5Ig5jaGVja1doaXRlbGlzdCIPZ2V0Qm9vbGVhbkJ5S2V5IgdzaWduQ3V0Igt1c2RuV2F2ZUN1dCIOZGVmYXVsdExpY2VuY2UiEmRlZmF1bHRIYXNoTGljZW5jZSILZGFwcFJ1bm5pbmciDm1haW50ZW5hbmNlTVNHIg11c2VyU3VzcGVuZGVkIgt1c2VyUmVtb3ZlZCIQdXNlclVucmVnaX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l0ZXMJAJEDAggFAmNXBnByb29mcwAACQDZBAEJAQJjbgEJAJEDAggFAmNZBGFyZ3MABQMDAwMJAAACCAUCY1kIZnVuY3Rpb24CCWFjY2VwdEJpZAkAAAIIBQJjWQRkQXBwBQR0aGlzBwkAAAIIBQJjWQNmZWUAoMIeBwkAAAIIBQJjWQpmZWVBc3NldElkBQR1bml0BwkAyBMDCAUCY1cJYm9keUJ5dGVzCQCRAwIIBQJjVwZwcm9vZnMAAAkA2QQBCQECY24BCQCRAwIIBQJjWQRhcmdzAAQJAPQDAwgFAmNXCWJvZHlCeXRlcwkAkQMCCAUCY1cGcHJvb2ZzAAAIBQJjVw9zZW5kZXJQdWJsaWNLZXkJAPQDAwgFAmNXCWJvZHlCeXRlcwkAkQMCCAUCY1cGcHJvb2ZzAAAIBQJjVw9zZW5kZXJQdWJsaWNLZXkzuyac", "height": 2503580, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: BUWmPvsmKTKiion78DmS9xZrAgfxnnbvdQAyyGR6M7SA Next: F4ePAvJhj9mAsWMcfc8YpYFFiTVRfKRuVPDexPShyUwQ Diff:
Old | New | Differences | |
---|---|---|---|
405 | 405 | let caller = $t01303413104._2 | |
406 | 406 | let date = $t01303413104._3 | |
407 | 407 | let isSponsored = $t01303413104._4 | |
408 | + | let new_caller = if (if ((toBase58String(i.caller.bytes) == toString(this))) | |
409 | + | then (isSponsored > 0) | |
410 | + | else false) | |
411 | + | then toString(addressFromPublicKey(fromBase58String(pubKey))) | |
412 | + | else toBase58String(i.caller.bytes) | |
408 | 413 | if (true) | |
409 | - | then throw( | |
414 | + | then throw(((((((new_caller + " / ") + issuer) + " / ") + bidOwner) + " / ") + pubKey)) | |
410 | 415 | else { | |
411 | - | let | |
412 | - | then ( | |
416 | + | let isBid = if (if (if ((caller == issuer)) | |
417 | + | then (bidOwner != "") | |
413 | 418 | else false) | |
414 | - | then toString(addressFromPublicKey(fromBase58String(pubKey))) | |
415 | - | else toBase58String(i.caller.bytes) | |
416 | - | if (true) | |
417 | - | then throw(((((((new_caller + " / ") + issuer) + " / ") + bidOwner) + " / ") + pubKey)) | |
419 | + | then (bidId != "") | |
420 | + | else false) | |
421 | + | then true | |
422 | + | else false | |
423 | + | let blockEnd = getIntegerByKey(keyEndSale(caller, artId)) | |
424 | + | if (if (if ((blockEnd != 0)) | |
425 | + | then (height >= blockEnd) | |
426 | + | else false) | |
427 | + | then !(isBid) | |
428 | + | else false) | |
429 | + | then throw("Sale ended.") | |
418 | 430 | else { | |
419 | - | let isBid = if (if (if ((caller == issuer)) | |
420 | - | then (bidOwner != "") | |
421 | - | else false) | |
422 | - | then (bidId != "") | |
423 | - | else false) | |
424 | - | then true | |
425 | - | else false | |
426 | - | let blockEnd = getIntegerByKey(keyEndSale(caller, artId)) | |
427 | - | if (if (if ((blockEnd != 0)) | |
428 | - | then (height >= blockEnd) | |
429 | - | else false) | |
430 | - | then !(isBid) | |
431 | - | else false) | |
432 | - | then throw("Sale ended.") | |
431 | + | let callerIsIssuer = (caller == issuer) | |
432 | + | let totalNFT = getIntegerByKey("total_nft_issued") | |
433 | + | let signID = getStringByKey(keySignID(issuer, artId)) | |
434 | + | let artworkName = getStringByKey(keyName(issuer, artId)) | |
435 | + | if ((artworkName == "")) | |
436 | + | then throw("Art doesn't exist") | |
433 | 437 | else { | |
434 | - | let callerIsIssuer = (caller == issuer) | |
435 | - | let totalNFT = getIntegerByKey("total_nft_issued") | |
436 | - | let signID = getStringByKey(keySignID(issuer, artId)) | |
437 | - | let artworkName = getStringByKey(keyName(issuer, artId)) | |
438 | - | if ((artworkName == "")) | |
439 | - | then throw("Art doesn't exist") | |
440 | - | else { | |
441 | - | let isOnSale = getBooleanByKey(keyOnSale(issuer, artId)) | |
442 | - | let amountSold = getIntegerByKey(keyIssued(issuer, artId)) | |
443 | - | let artworkPrice = if (callerIsIssuer) | |
444 | - | then (currentCertificationPrice * 2) | |
445 | - | else getIntegerByKey(keyPrice(issuer, artId)) | |
446 | - | let priceAssetId = if (callerIsIssuer) | |
447 | - | then toBase58String(signAssetId) | |
448 | - | else getStringByKey(keyAssetIdAccepted(issuer, artId)) | |
449 | - | let maxCanSell = getIntegerByKey(keyMaxMint(issuer, artId)) | |
450 | - | if (if (if (!(isBid)) | |
451 | - | then !(callerIsIssuer) | |
452 | - | else false) | |
453 | - | then if (if ((0 >= artworkPrice)) | |
454 | - | then true | |
455 | - | else !(isOnSale)) | |
456 | - | then true | |
457 | - | else (0 >= maxCanSell) | |
458 | - | else false) | |
459 | - | then throw("Art not for sale") | |
460 | - | else if (if (if (!(isBid)) | |
461 | - | then callerIsIssuer | |
438 | + | let isOnSale = getBooleanByKey(keyOnSale(issuer, artId)) | |
439 | + | let amountSold = getIntegerByKey(keyIssued(issuer, artId)) | |
440 | + | let artworkPrice = if (callerIsIssuer) | |
441 | + | then (currentCertificationPrice * 2) | |
442 | + | else getIntegerByKey(keyPrice(issuer, artId)) | |
443 | + | let priceAssetId = if (callerIsIssuer) | |
444 | + | then toBase58String(signAssetId) | |
445 | + | else getStringByKey(keyAssetIdAccepted(issuer, artId)) | |
446 | + | let maxCanSell = getIntegerByKey(keyMaxMint(issuer, artId)) | |
447 | + | if (if (if (!(isBid)) | |
448 | + | then !(callerIsIssuer) | |
449 | + | else false) | |
450 | + | then if (if ((0 >= artworkPrice)) | |
451 | + | then true | |
452 | + | else !(isOnSale)) | |
453 | + | then true | |
454 | + | else (0 >= maxCanSell) | |
455 | + | else false) | |
456 | + | then throw("Art not for sale") | |
457 | + | else if (if (if (!(isBid)) | |
458 | + | then callerIsIssuer | |
459 | + | else false) | |
460 | + | then (0 >= maxCanSell) | |
461 | + | else false) | |
462 | + | then throw("Max issuable not set") | |
463 | + | else { | |
464 | + | let checkUser = validateUser(issuer) | |
465 | + | if (if (isBid) | |
466 | + | then (checkUser != "") | |
462 | 467 | else false) | |
463 | - | then (0 >= maxCanSell) | |
464 | - | else false) | |
465 | - | then throw("Max issuable not set") | |
468 | + | then throw(checkUser) | |
466 | 469 | else { | |
467 | - | let checkUser = validateUser(issuer) | |
468 | - | if (if (isBid) | |
469 | - | then (checkUser != "") | |
470 | + | let bidDataKey = ((((((("bid_" + artId) + "_") + issuer) + "_") + bidOwner) + "_") + bidId) | |
471 | + | let $t01492815120 = if (isBid) | |
472 | + | then getPriceAssetIdFromBid(bidDataKey) | |
473 | + | else validatePriceAssetId(i, priceAssetId, artworkPrice) | |
474 | + | let amount = $t01492815120._1 | |
475 | + | let assetId = $t01492815120._2 | |
476 | + | let agent = valueOrElse(getString(userDapp, keyArtistAgentAddr(issuer)), feeReceiver) | |
477 | + | let agentShare = valueOrElse(getInteger(userDapp, keyPrimaryShareAgent(issuer)), 0) | |
478 | + | let publicAgent = valueOrElse(getString(userDapp, keyArtistPublicAgentAddr(issuer)), feeReceiver) | |
479 | + | let publicAgentShare = valueOrElse(getInteger(userDapp, keyPrimarySharePublicAgent(issuer)), 0) | |
480 | + | let isWhitelisted = checkWhitelist(issuer) | |
481 | + | let cut = if ((isWhitelisted > height)) | |
482 | + | then 0 | |
483 | + | else if ((assetId == signAssetId)) | |
484 | + | then signCut | |
485 | + | else usdnWaveCut | |
486 | + | let amountForSign = fraction(amount, cut, 100) | |
487 | + | let amountForAgent = if (if (if ((agent != feeReceiver)) | |
488 | + | then (agentShare > 0) | |
470 | 489 | else false) | |
471 | - | then throw(checkUser) | |
490 | + | then (height > isWhitelisted) | |
491 | + | else false) | |
492 | + | then fraction(amount, agentShare, 10000) | |
493 | + | else 0 | |
494 | + | let amountForPublicAgent = if (if (if ((publicAgent != feeReceiver)) | |
495 | + | then (publicAgentShare > 0) | |
496 | + | else false) | |
497 | + | then (height > isWhitelisted) | |
498 | + | else false) | |
499 | + | then fraction(amount, publicAgentShare, 10000) | |
500 | + | else 0 | |
501 | + | let amountForCreator = (amount - amountForSign) | |
502 | + | if ((amountSold == maxCanSell)) | |
503 | + | then throw("Art sold out") | |
472 | 504 | else { | |
473 | - | let bidDataKey = ((((((("bid_" + artId) + "_") + issuer) + "_") + bidOwner) + "_") + bidId) | |
474 | - | let $t01498015172 = if (isBid) | |
475 | - | then getPriceAssetIdFromBid(bidDataKey) | |
476 | - | else validatePriceAssetId(i, priceAssetId, artworkPrice) | |
477 | - | let amount = $t01498015172._1 | |
478 | - | let assetId = $t01498015172._2 | |
479 | - | let agent = valueOrElse(getString(userDapp, keyArtistAgentAddr(issuer)), feeReceiver) | |
480 | - | let agentShare = valueOrElse(getInteger(userDapp, keyPrimaryShareAgent(issuer)), 0) | |
481 | - | let publicAgent = valueOrElse(getString(userDapp, keyArtistPublicAgentAddr(issuer)), feeReceiver) | |
482 | - | let publicAgentShare = valueOrElse(getInteger(userDapp, keyPrimarySharePublicAgent(issuer)), 0) | |
483 | - | let isWhitelisted = checkWhitelist(issuer) | |
484 | - | let cut = if ((isWhitelisted > height)) | |
485 | - | then 0 | |
486 | - | else if ((assetId == signAssetId)) | |
487 | - | then signCut | |
488 | - | else usdnWaveCut | |
489 | - | let amountForSign = fraction(amount, cut, 100) | |
490 | - | let amountForAgent = if (if (if ((agent != feeReceiver)) | |
491 | - | then (agentShare > 0) | |
492 | - | else false) | |
493 | - | then (height > isWhitelisted) | |
494 | - | else false) | |
495 | - | then fraction(amount, agentShare, 10000) | |
496 | - | else 0 | |
497 | - | let amountForPublicAgent = if (if (if ((publicAgent != feeReceiver)) | |
498 | - | then (publicAgentShare > 0) | |
499 | - | else false) | |
500 | - | then (height > isWhitelisted) | |
501 | - | else false) | |
502 | - | then fraction(amount, publicAgentShare, 10000) | |
503 | - | else 0 | |
504 | - | let amountForCreator = (amount - amountForSign) | |
505 | - | if ((amountSold == maxCanSell)) | |
506 | - | then throw("Art sold out") | |
507 | - | else { | |
508 | - | let newAmountSold = (amountSold + 1) | |
509 | - | let issueMeta = ((((((((((("Creator: " + issuer) + ", | |
505 | + | let newAmountSold = (amountSold + 1) | |
506 | + | let issueMeta = ((((((((((("Creator: " + issuer) + ", | |
510 | 507 | ArtID: ") + artId) + ", | |
511 | 508 | SignID: ") + signID) + ", | |
512 | 509 | Artwork name: ") + artworkName) + ", | |
513 | 510 | Issue: ") + toString(newAmountSold)) + "/") + toString(maxCanSell)) | |
514 | - | let issueNFT = Issue(("SA_" + toString((totalNFT + 1))), issueMeta, 1, 0, false) | |
515 | - | let idNFT = calculateAssetId(issueNFT) | |
516 | - | let sellStatus = if (if ((newAmountSold == maxCanSell)) | |
517 | - | then true | |
518 | - | else !(isOnSale)) | |
519 | - | then false | |
520 | - | else true | |
521 | - | let receiveNFT = if (if (if ((caller == issuer)) | |
522 | - | then (bidOwner != "") | |
523 | - | else false) | |
524 | - | then (bidId != "") | |
525 | - | else false) | |
526 | - | then addressFromStringValue(bidOwner) | |
527 | - | else i.caller | |
528 | - | let assetIdBid = if (!(isDefined(assetId))) | |
529 | - | then "WAVES" | |
530 | - | else toBase58String(value(assetId)) | |
531 | - | let bidData = getStringByKey((bidDataKey + "_OPEN")) | |
532 | - | let bidDelOld = DeleteEntry((bidDataKey + "_OPEN")) | |
533 | - | let bidUpdate = StringEntry((bidDataKey + "_CLOSED"), ((bidData + "_") + toString(date))) | |
534 | - | let soldKey = ((((((("art_sold_" + toString(newAmountSold)) + "_of_") + toString(maxCanSell)) + "_") + artId) + "_") + issuer) | |
535 | - | let soldValue = if (!(isBid)) | |
536 | - | then ((((((((((caller + "_") + toString(date)) + "_") + id) + "_") + toString(artworkPrice)) + "_") + priceAssetId) + "_") + toBase58String(idNFT)) | |
537 | - | else ((((((((((toString(receiveNFT) + "_") + toString(date)) + "_") + id) + "_") + toString(amount)) + "_") + assetIdBid) + "_") + toBase58String(idNFT)) | |
538 | - | let soldData = StringEntry(soldKey, soldValue) | |
539 | - | let commissionsWithAgent = if ((amountForAgent != 0)) | |
540 | - | then [ScriptTransfer(Address(fromBase58String(feeReceiver)), (amountForSign - amountForAgent), assetId), ScriptTransfer(Address(fromBase58String(agent)), amountForAgent, assetId)] | |
541 | - | else [ScriptTransfer(Address(fromBase58String(feeReceiver)), amountForSign, assetId)] | |
542 | - | let commissionsWithPublicAgent = if ((amountForPublicAgent != 0)) | |
543 | - | then [ScriptTransfer(Address(fromBase58String(publicAgent)), amountForPublicAgent, assetId), ScriptTransfer(Address(fromBase58String(issuer)), (amountForCreator - amountForPublicAgent), assetId)] | |
544 | - | else [ScriptTransfer(Address(fromBase58String(issuer)), amountForCreator, assetId)] | |
545 | - | let txToCaller = if ((isSponsored > 0)) | |
546 | - | then [ScriptTransfer(Address(fromBase58String(caller)), 0, unit)] | |
547 | - | else nil | |
548 | - | let buyRes = ((([IntegerEntry(keyIssued(issuer, artId), newAmountSold), StringEntry(("nft_" + toBase58String(idNFT)), soldKey), IntegerEntry("total_nft_issued", (totalNFT + 1)), IntegerEntry(keyEndSale(issuer, artId), 0), BooleanEntry(keyOnSale(issuer, artId), sellStatus), issueNFT, ScriptTransfer(receiveNFT, 1, idNFT)] ++ commissionsWithAgent) ++ commissionsWithPublicAgent) ++ txToCaller) | |
549 | - | if (isBid) | |
550 | - | then [soldData, bidUpdate, bidDelOld] :: buyRes | |
551 | - | else soldData :: buyRes | |
552 | - | } | |
511 | + | let issueNFT = Issue(("SA_" + toString((totalNFT + 1))), issueMeta, 1, 0, false) | |
512 | + | let idNFT = calculateAssetId(issueNFT) | |
513 | + | let sellStatus = if (if ((newAmountSold == maxCanSell)) | |
514 | + | then true | |
515 | + | else !(isOnSale)) | |
516 | + | then false | |
517 | + | else true | |
518 | + | let receiveNFT = if (if (if ((caller == issuer)) | |
519 | + | then (bidOwner != "") | |
520 | + | else false) | |
521 | + | then (bidId != "") | |
522 | + | else false) | |
523 | + | then addressFromStringValue(bidOwner) | |
524 | + | else i.caller | |
525 | + | let assetIdBid = if (!(isDefined(assetId))) | |
526 | + | then "WAVES" | |
527 | + | else toBase58String(value(assetId)) | |
528 | + | let bidData = getStringByKey((bidDataKey + "_OPEN")) | |
529 | + | let bidDelOld = DeleteEntry((bidDataKey + "_OPEN")) | |
530 | + | let bidUpdate = StringEntry((bidDataKey + "_CLOSED"), ((bidData + "_") + toString(date))) | |
531 | + | let soldKey = ((((((("art_sold_" + toString(newAmountSold)) + "_of_") + toString(maxCanSell)) + "_") + artId) + "_") + issuer) | |
532 | + | let soldValue = if (!(isBid)) | |
533 | + | then ((((((((((caller + "_") + toString(date)) + "_") + id) + "_") + toString(artworkPrice)) + "_") + priceAssetId) + "_") + toBase58String(idNFT)) | |
534 | + | else ((((((((((toString(receiveNFT) + "_") + toString(date)) + "_") + id) + "_") + toString(amount)) + "_") + assetIdBid) + "_") + toBase58String(idNFT)) | |
535 | + | let soldData = StringEntry(soldKey, soldValue) | |
536 | + | let commissionsWithAgent = if ((amountForAgent != 0)) | |
537 | + | then [ScriptTransfer(Address(fromBase58String(feeReceiver)), (amountForSign - amountForAgent), assetId), ScriptTransfer(Address(fromBase58String(agent)), amountForAgent, assetId)] | |
538 | + | else [ScriptTransfer(Address(fromBase58String(feeReceiver)), amountForSign, assetId)] | |
539 | + | let commissionsWithPublicAgent = if ((amountForPublicAgent != 0)) | |
540 | + | then [ScriptTransfer(Address(fromBase58String(publicAgent)), amountForPublicAgent, assetId), ScriptTransfer(Address(fromBase58String(issuer)), (amountForCreator - amountForPublicAgent), assetId)] | |
541 | + | else [ScriptTransfer(Address(fromBase58String(issuer)), amountForCreator, assetId)] | |
542 | + | let txToCaller = if ((isSponsored > 0)) | |
543 | + | then [ScriptTransfer(Address(fromBase58String(caller)), 0, unit)] | |
544 | + | else nil | |
545 | + | let buyRes = ((([IntegerEntry(keyIssued(issuer, artId), newAmountSold), StringEntry(("nft_" + toBase58String(idNFT)), soldKey), IntegerEntry("total_nft_issued", (totalNFT + 1)), IntegerEntry(keyEndSale(issuer, artId), 0), BooleanEntry(keyOnSale(issuer, artId), sellStatus), issueNFT, ScriptTransfer(receiveNFT, 1, idNFT)] ++ commissionsWithAgent) ++ commissionsWithPublicAgent) ++ txToCaller) | |
546 | + | if (isBid) | |
547 | + | then [soldData, bidUpdate, bidDelOld] :: buyRes | |
548 | + | else soldData :: buyRes | |
553 | 549 | } | |
554 | 550 | } | |
555 | - | } | |
551 | + | } | |
556 | 552 | } | |
557 | 553 | } | |
558 | 554 | } | |
581 | 577 | ||
582 | 578 | @Callable(i) | |
583 | 579 | func addArtwork (sha256Hash,signID,name,description,tags,type,cidDisplay,sha256Export,cidExport,sha256Licence,cidLicence,crawler,royalties,pubKey) = { | |
584 | - | let $ | |
585 | - | let artId = $ | |
586 | - | let caller = $ | |
587 | - | let date = $ | |
588 | - | let isSponsored = $ | |
580 | + | let $t02030020373 = idCallerDateSponsored(i, pubKey) | |
581 | + | let artId = $t02030020373._1 | |
582 | + | let caller = $t02030020373._2 | |
583 | + | let date = $t02030020373._3 | |
584 | + | let isSponsored = $t02030020373._4 | |
589 | 585 | if (!(validateHash(sha256Hash))) | |
590 | 586 | then throw("Hash should be 64 characters maximum") | |
591 | 587 | else { | |
592 | - | let $ | |
593 | - | let licenceCID = $ | |
594 | - | let licenceHash = $ | |
588 | + | let $t02047420543 = setLIcence(cidLicence, sha256Licence) | |
589 | + | let licenceCID = $t02047420543._1 | |
590 | + | let licenceHash = $t02047420543._2 | |
595 | 591 | let validateArtwork = validateArtworkData(caller, cidDisplay, cidExport, licenceCID, sha256Export, licenceHash, name, description, tags, royalties) | |
596 | 592 | if ((validateArtwork != "")) | |
597 | 593 | then throw("Something went wrong!") | |
598 | 594 | else { | |
599 | 595 | let whitelisted_drop = (checkWhitelist((caller + "_free_drops")) > 0) | |
600 | - | let $ | |
596 | + | let $t02084220926 = if (whitelisted_drop) | |
601 | 597 | then $Tuple2(0, signID) | |
602 | 598 | else validatePayment(i) | |
603 | - | let amount = $ | |
604 | - | let assetId = $ | |
599 | + | let amount = $t02084220926._1 | |
600 | + | let assetId = $t02084220926._2 | |
605 | 601 | if (!(isDefined(amount))) | |
606 | 602 | then throw("Something went wrong") | |
607 | 603 | else { | |
642 | 638 | func updateArtwork (txid,name,description,tags,type,cidDisplay,sha256Export,cidExport,sha256Licence,cidLicence,crawler,royalties,pubKey) = if (!(dappRunning)) | |
643 | 639 | then throw(maintenanceMSG) | |
644 | 640 | else { | |
645 | - | let $ | |
646 | - | let id = $ | |
647 | - | let caller = $ | |
648 | - | let date = $ | |
649 | - | let isSponsored = $ | |
650 | - | let $ | |
651 | - | let licenceCID = $ | |
652 | - | let licenceHash = $ | |
641 | + | let $t02396424034 = idCallerDateSponsored(i, pubKey) | |
642 | + | let id = $t02396424034._1 | |
643 | + | let caller = $t02396424034._2 | |
644 | + | let date = $t02396424034._3 | |
645 | + | let isSponsored = $t02396424034._4 | |
646 | + | let $t02404424113 = setLIcence(cidLicence, sha256Licence) | |
647 | + | let licenceCID = $t02404424113._1 | |
648 | + | let licenceHash = $t02404424113._2 | |
653 | 649 | let validateArtwork = validateArtworkData(caller, cidDisplay, cidExport, licenceCID, sha256Export, licenceHash, name, description, tags, royalties) | |
654 | 650 | if ((validateArtwork != "")) | |
655 | 651 | then throw("Something went wrong!") | |
677 | 673 | ||
678 | 674 | @Callable(i) | |
679 | 675 | func flagArtwork (artId,addr,flag,note) = { | |
680 | - | let $ | |
681 | - | let id = $ | |
682 | - | let caller = $ | |
676 | + | let $t02574425778 = idCallerDate(i) | |
677 | + | let id = $t02574425778._1 | |
678 | + | let caller = $t02574425778._2 | |
683 | 679 | if (containsElement([chris, toString(this)], caller)) | |
684 | 680 | then if (containsElement(["CONSENT", "", "CHANGE_REQUIRED", "FLAGGED", "ILLEGAL"], flag)) | |
685 | 681 | then [StringEntry(keyFlag(addr, artId), flag), StringEntry(keyNote(addr, artId), note)] | |
691 | 687 | ||
692 | 688 | @Callable(i) | |
693 | 689 | func deleteArtwork (artId,addr) = { | |
694 | - | let $ | |
695 | - | let id = $ | |
696 | - | let caller = $ | |
690 | + | let $t02621426248 = idCallerDate(i) | |
691 | + | let id = $t02621426248._1 | |
692 | + | let caller = $t02621426248._2 | |
697 | 693 | let addrToUse = if (containsElement([chris, toString(this)], caller)) | |
698 | 694 | then addr | |
699 | 695 | else caller | |
726 | 722 | ||
727 | 723 | @Callable(i) | |
728 | 724 | func sellArtwork (artId,price,maxMint,assetId,blockEnd,pubKey) = { | |
729 | - | let $ | |
730 | - | let id = $ | |
731 | - | let caller = $ | |
732 | - | let date = $ | |
733 | - | let isSponsored = $ | |
725 | + | let $t02908429154 = idCallerDateSponsored(i, pubKey) | |
726 | + | let id = $t02908429154._1 | |
727 | + | let caller = $t02908429154._2 | |
728 | + | let date = $t02908429154._3 | |
729 | + | let isSponsored = $t02908429154._4 | |
734 | 730 | let artworkName = getStringByKey(keyName(caller, artId)) | |
735 | 731 | if ((artworkName == "")) | |
736 | 732 | then throw("This art doesn't match your account") | |
804 | 800 | ||
805 | 801 | @Callable(i) | |
806 | 802 | func setBid (artId,issuer) = { | |
807 | - | let $ | |
808 | - | let id = $ | |
809 | - | let caller = $ | |
810 | - | let date = $ | |
811 | - | let $ | |
812 | - | let payment = $ | |
813 | - | let amount = $ | |
803 | + | let $t03154031580 = idCallerDate(i) | |
804 | + | let id = $t03154031580._1 | |
805 | + | let caller = $t03154031580._2 | |
806 | + | let date = $t03154031580._3 | |
807 | + | let $t03158531621 = isPayment(i) | |
808 | + | let payment = $t03158531621._1 | |
809 | + | let amount = $t03158531621._2 | |
814 | 810 | let assetId = if (!(isDefined(payment.assetId))) | |
815 | 811 | then "WAVES" | |
816 | 812 | else toBase58String(value(payment.assetId)) | |
841 | 837 | ||
842 | 838 | @Callable(i) | |
843 | 839 | func acceptBid (artId,issuer,bidId,bidOwner,pubKey) = { | |
844 | - | let $ | |
845 | - | let id = $ | |
846 | - | let caller1 = $ | |
847 | - | let date = $ | |
848 | - | let isSponsored = $ | |
840 | + | let $t03284132912 = idCallerDateSponsored(i, pubKey) | |
841 | + | let id = $t03284132912._1 | |
842 | + | let caller1 = $t03284132912._2 | |
843 | + | let date = $t03284132912._3 | |
844 | + | let isSponsored = $t03284132912._4 | |
849 | 845 | if ((caller1 != issuer)) | |
850 | 846 | then throw("You cannot do this action") | |
851 | 847 | else buyMint(i, artId, issuer, bidId, bidOwner, pubKey) | |
855 | 851 | ||
856 | 852 | @Callable(i) | |
857 | 853 | func cancelBid (artId,issuer,bidId,bidOwner) = { | |
858 | - | let $ | |
859 | - | let id = $ | |
860 | - | let caller = $ | |
861 | - | let date = $ | |
854 | + | let $t03314733208 = idCallerDate(i) | |
855 | + | let id = $t03314733208._1 | |
856 | + | let caller = $t03314733208._2 | |
857 | + | let date = $t03314733208._3 | |
862 | 858 | if (if ((caller != bidOwner)) | |
863 | 859 | then (caller != issuer) | |
864 | 860 | else false) |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | func getStringByKey (key) = valueOrElse(getString(this, key), "") | |
5 | 5 | ||
6 | 6 | ||
7 | 7 | let unitTest = false | |
8 | 8 | ||
9 | 9 | let oracleFee = value(addressFromString(getStringByKey("conf_oracle_fee"))) | |
10 | 10 | ||
11 | 11 | let signDapp = value(addressFromString(getStringByKey("conf_signweb_dapp"))) | |
12 | 12 | ||
13 | 13 | let feeReceiver = getStringByKey("conf_fee_receiver") | |
14 | 14 | ||
15 | 15 | let userDapp = if (unitTest) | |
16 | 16 | then value(addressFromString("3Mt4RGMEyjSWYAocTPqd55wdHQQB3PU2UCm")) | |
17 | 17 | else value(addressFromString(getStringByKey("conf_users_dapp"))) | |
18 | 18 | ||
19 | 19 | let whitelistDapp = value(addressFromString(getStringByKey("conf_whitelist_dapp"))) | |
20 | 20 | ||
21 | 21 | let signAssetId = fromBase58String(getStringByKey("conf_accepted_asset_SIGN")) | |
22 | 22 | ||
23 | 23 | let usdnAssetId = fromBase58String(getStringByKey("conf_accepted_asset_USDN")) | |
24 | 24 | ||
25 | 25 | let usdtAssetId = fromBase58String(getStringByKey("conf_accepted_asset_USDT")) | |
26 | 26 | ||
27 | 27 | let wavesAssetId = base58'' | |
28 | 28 | ||
29 | 29 | let chris = getStringByKey("conf_admin_1") | |
30 | 30 | ||
31 | 31 | func getIntegerByKeyFromOracle (key) = valueOrErrorMessage(getInteger(oracleFee, key), "Integer undefine or 0 in oracle") | |
32 | 32 | ||
33 | 33 | ||
34 | 34 | func getIntegerByKey (key) = valueOrElse(getInteger(this, key), 0) | |
35 | 35 | ||
36 | 36 | ||
37 | 37 | func checkWhitelist (key) = valueOrElse(getInteger(whitelistDapp, key), 0) | |
38 | 38 | ||
39 | 39 | ||
40 | 40 | func getBooleanByKey (key) = valueOrElse(getBoolean(this, key), false) | |
41 | 41 | ||
42 | 42 | ||
43 | 43 | let signCut = 7 | |
44 | 44 | ||
45 | 45 | let usdnWaveCut = 10 | |
46 | 46 | ||
47 | 47 | let defaultLicence = getStringByKey("conf_default_licence") | |
48 | 48 | ||
49 | 49 | let defaultHashLicence = getStringByKey("conf_default_licence_hash") | |
50 | 50 | ||
51 | 51 | let dappRunning = valueOrElse(getBoolean(userDapp, "conf_dapp_is_running"), true) | |
52 | 52 | ||
53 | 53 | let maintenanceMSG = valueOrElse(getString(userDapp, "conf_maintenance_msg"), "") | |
54 | 54 | ||
55 | 55 | let userSuspended = "SUSPENDED" | |
56 | 56 | ||
57 | 57 | let userRemoved = "REMOVED" | |
58 | 58 | ||
59 | 59 | let userUnregistered = "UNREGISTERED" | |
60 | 60 | ||
61 | 61 | let userAllowed = "ALLOWED" | |
62 | 62 | ||
63 | 63 | let currentCertificationPrice = getIntegerByKeyFromOracle(("certification_fee_" + toBase58String(signAssetId))) | |
64 | 64 | ||
65 | 65 | func checkSignCertificate (signID,Owner,sha256Hash) = match getString(signDapp, ((("data_fc_" + signID) + "_") + Owner)) { | |
66 | 66 | case a: String => | |
67 | 67 | if (contains(a, sha256Hash)) | |
68 | 68 | then true | |
69 | 69 | else false | |
70 | 70 | case _ => | |
71 | 71 | false | |
72 | 72 | } | |
73 | 73 | ||
74 | 74 | ||
75 | 75 | func validateCID (cid) = if (contains(cid, "/")) | |
76 | 76 | then if (if ((76 > size(cid))) | |
77 | 77 | then (size(split(cid, "/")[0]) == 59) | |
78 | 78 | else false) | |
79 | 79 | then (16 > size(split(cid, "/")[1])) | |
80 | 80 | else false | |
81 | 81 | else false | |
82 | 82 | ||
83 | 83 | ||
84 | 84 | func validateHash (hash) = (size(hash) == 64) | |
85 | 85 | ||
86 | 86 | ||
87 | 87 | func keyUserStatus (caller) = ("user_status_" + caller) | |
88 | 88 | ||
89 | 89 | ||
90 | 90 | func keyDate (caller,artId) = ((("art_date_" + artId) + "_") + caller) | |
91 | 91 | ||
92 | 92 | ||
93 | 93 | func keyName (caller,artId) = ((("art_name_" + artId) + "_") + caller) | |
94 | 94 | ||
95 | 95 | ||
96 | 96 | func keyDesc (caller,artId) = ((("art_desc_" + artId) + "_") + caller) | |
97 | 97 | ||
98 | 98 | ||
99 | 99 | func keyDisplayCid (caller,artId) = ((("art_display_cid_" + artId) + "_") + caller) | |
100 | 100 | ||
101 | 101 | ||
102 | 102 | func keyExportHash (caller,artId) = ((("art_export_hash_" + artId) + "_") + caller) | |
103 | 103 | ||
104 | 104 | ||
105 | 105 | func keyExportCid (caller,artId) = ((("art_export_cid_" + artId) + "_") + caller) | |
106 | 106 | ||
107 | 107 | ||
108 | 108 | func keyMaxMint (caller,artId) = ((("art_maxmint_" + artId) + "_") + caller) | |
109 | 109 | ||
110 | 110 | ||
111 | 111 | func keySignID (caller,artId) = ((("art_signid_" + artId) + "_") + caller) | |
112 | 112 | ||
113 | 113 | ||
114 | 114 | func keyIssued (caller,artId) = ((("art_issued_" + artId) + "_") + caller) | |
115 | 115 | ||
116 | 116 | ||
117 | 117 | func keyOnSale (caller,artId) = ((("art_onsale_" + artId) + "_") + caller) | |
118 | 118 | ||
119 | 119 | ||
120 | 120 | func keyLicenceHash (caller,artId) = ((("art_licence_hash_" + artId) + "_") + caller) | |
121 | 121 | ||
122 | 122 | ||
123 | 123 | func keyLicenceCid (caller,artId) = ((("art_licence_cid_" + artId) + "_") + caller) | |
124 | 124 | ||
125 | 125 | ||
126 | 126 | func keyTags (caller,artId) = ((("art_tags_" + artId) + "_") + caller) | |
127 | 127 | ||
128 | 128 | ||
129 | 129 | func keyType (caller,artId) = ((("art_type_" + artId) + "_") + caller) | |
130 | 130 | ||
131 | 131 | ||
132 | 132 | func keyNote (caller,artId) = ((("art_note_" + artId) + "_") + caller) | |
133 | 133 | ||
134 | 134 | ||
135 | 135 | func keyCrawler (caller,artId) = ((("art_crawler_cid_" + artId) + "_") + caller) | |
136 | 136 | ||
137 | 137 | ||
138 | 138 | func keyRoyalties (caller,artId) = ((("art_royalties_" + artId) + "_") + caller) | |
139 | 139 | ||
140 | 140 | ||
141 | 141 | func keyPrice (caller,artId) = ((("art_price_" + artId) + "_") + caller) | |
142 | 142 | ||
143 | 143 | ||
144 | 144 | func keyEndSale (caller,artId) = ((("art_endsale_" + artId) + "_") + caller) | |
145 | 145 | ||
146 | 146 | ||
147 | 147 | func keyAssetIdAccepted (caller,artId) = ((("art_assetAccepted_" + artId) + "_") + caller) | |
148 | 148 | ||
149 | 149 | ||
150 | 150 | func keyFlag (caller,artId) = ((("art_flag_" + artId) + "_") + caller) | |
151 | 151 | ||
152 | 152 | ||
153 | 153 | func keyArtistAgentAddr (artistAddr) = ("artist_agent_" + artistAddr) | |
154 | 154 | ||
155 | 155 | ||
156 | 156 | func keyPrimaryShareAgent (artistAddr) = ("artist_agent_primary_" + artistAddr) | |
157 | 157 | ||
158 | 158 | ||
159 | 159 | func keyArtistPublicAgentAddr (artistAddr) = ("artist_public_agent_" + artistAddr) | |
160 | 160 | ||
161 | 161 | ||
162 | 162 | func keyPrimarySharePublicAgent (artistAddr) = ("artist_public_agent_primary_" + artistAddr) | |
163 | 163 | ||
164 | 164 | ||
165 | 165 | func keyHashByTxidAddr (caller,txid) = ((("get_hashbytxidaddr_" + txid) + "_") + caller) | |
166 | 166 | ||
167 | 167 | ||
168 | 168 | func keyOwnerByHash (sha256Hash) = ("get_owner_by_hash_" + sha256Hash) | |
169 | 169 | ||
170 | 170 | ||
171 | 171 | func keyidBySignid (caller,signId) = ((("get_artidbysignid_" + signId) + "_") + caller) | |
172 | 172 | ||
173 | 173 | ||
174 | 174 | func keyTxidByHashOwner (sha256Hash,caller) = ("get_txid_by_hash_owner_" + toBase58String(sha256_16Kb(toBytes((sha256Hash + caller))))) | |
175 | 175 | ||
176 | 176 | ||
177 | 177 | func validateAllCID (cidDisplay,cidExport,cidLicence) = if (!(validateCID(cidDisplay))) | |
178 | 178 | then throw("Wrong Display CID") | |
179 | 179 | else if (!(validateCID(cidExport))) | |
180 | 180 | then throw("Wrong Export CID") | |
181 | 181 | else if (if ((cidLicence != "")) | |
182 | 182 | then !(validateCID(cidLicence)) | |
183 | 183 | else false) | |
184 | 184 | then throw("Wrong Licence CID") | |
185 | 185 | else true | |
186 | 186 | ||
187 | 187 | ||
188 | 188 | func validateAllHash (sha256Export,sha256Licence) = if (!(validateHash(sha256Export))) | |
189 | 189 | then throw("Export Hash 64 char. max") | |
190 | 190 | else if (!(validateHash(sha256Licence))) | |
191 | 191 | then throw("Licence Hash 64 char. max") | |
192 | 192 | else true | |
193 | 193 | ||
194 | 194 | ||
195 | 195 | func validateString (str,max) = if ((size(str) == 0)) | |
196 | 196 | then throw("Field cannot be is empty") | |
197 | 197 | else if ((size(str) > max)) | |
198 | 198 | then throw((str + " is too long")) | |
199 | 199 | else true | |
200 | 200 | ||
201 | 201 | ||
202 | 202 | func validateUser (caller) = { | |
203 | 203 | let userStatus = valueOrElse(getString(userDapp, keyUserStatus(caller)), userUnregistered) | |
204 | 204 | if (if ((userStatus == userUnregistered)) | |
205 | 205 | then true | |
206 | 206 | else (userStatus == userAllowed)) | |
207 | 207 | then "Register this account first with \"Account\" tab" | |
208 | 208 | else if ((userStatus == userSuspended)) | |
209 | 209 | then "Account suspended" | |
210 | 210 | else if ((userStatus == userRemoved)) | |
211 | 211 | then "Account removed" | |
212 | 212 | else "" | |
213 | 213 | } | |
214 | 214 | ||
215 | 215 | ||
216 | 216 | func setLIcence (cidLicence,sha256Licence) = { | |
217 | 217 | let cid = if ((size(cidLicence) == 0)) | |
218 | 218 | then defaultLicence | |
219 | 219 | else cidLicence | |
220 | 220 | let hash = if ((size(sha256Licence) == 0)) | |
221 | 221 | then defaultHashLicence | |
222 | 222 | else sha256Licence | |
223 | 223 | $Tuple2(cid, hash) | |
224 | 224 | } | |
225 | 225 | ||
226 | 226 | ||
227 | 227 | func validateArtworkData (caller,cidDisplay,cidExport,licenceCID,sha256Export,licenceHash,name,description,tags,royalties) = { | |
228 | 228 | let checkUser = validateUser(caller) | |
229 | 229 | if ((checkUser != "")) | |
230 | 230 | then throw(checkUser) | |
231 | 231 | else if ((size(cidDisplay) == 0)) | |
232 | 232 | then throw("Display CID cannot be empty") | |
233 | 233 | else if (!(validateAllCID(cidDisplay, cidExport, licenceCID))) | |
234 | 234 | then throw("Problem with CID") | |
235 | 235 | else if (!(validateAllHash(sha256Export, licenceHash))) | |
236 | 236 | then throw("Problem with Hashes") | |
237 | 237 | else if (!(validateString(name, 100))) | |
238 | 238 | then throw("100 Char. max name") | |
239 | 239 | else if (!(validateString(description, 1000))) | |
240 | 240 | then throw("1000 Char. max description") | |
241 | 241 | else if (if ((0 > royalties)) | |
242 | 242 | then true | |
243 | 243 | else (royalties > 1000)) | |
244 | 244 | then throw("Royalties cannot be less than 0% or higher than 10%") | |
245 | 245 | else if ((size(split(tags, ",")) > 5)) | |
246 | 246 | then throw("5 tags max.") | |
247 | 247 | else "" | |
248 | 248 | } | |
249 | 249 | ||
250 | 250 | ||
251 | 251 | func isPayment (i) = if ((size(i.payments) == 0)) | |
252 | 252 | then throw("No payment attached") | |
253 | 253 | else { | |
254 | 254 | let payment = value(i.payments[0]) | |
255 | 255 | let amount = value(payment.amount) | |
256 | 256 | $Tuple2(payment, amount) | |
257 | 257 | } | |
258 | 258 | ||
259 | 259 | ||
260 | 260 | func validatePayment (i) = { | |
261 | 261 | let $t091809216 = isPayment(i) | |
262 | 262 | let payment = $t091809216._1 | |
263 | 263 | let amount = $t091809216._2 | |
264 | 264 | let assetId = if (if (isDefined(payment.assetId)) | |
265 | 265 | then (payment.assetId == signAssetId) | |
266 | 266 | else false) | |
267 | 267 | then payment.assetId | |
268 | 268 | else throw("Only SIGN token accepted as transaction fee") | |
269 | 269 | if ((amount != currentCertificationPrice)) | |
270 | 270 | then throw(("Payment amount should be " + toString(currentCertificationPrice))) | |
271 | 271 | else $Tuple2(amount, assetId) | |
272 | 272 | } | |
273 | 273 | ||
274 | 274 | ||
275 | 275 | func isArtMinted (addrToUse,artId) = match getInteger(this, keyIssued(addrToUse, artId)) { | |
276 | 276 | case b: Int => | |
277 | 277 | if ((b != 0)) | |
278 | 278 | then true | |
279 | 279 | else false | |
280 | 280 | case _ => | |
281 | 281 | false | |
282 | 282 | } | |
283 | 283 | ||
284 | 284 | ||
285 | 285 | func validatePriceAssetId (i,priceAssetId,artworkPrice) = { | |
286 | 286 | let $t098049840 = isPayment(i) | |
287 | 287 | let payment = $t098049840._1 | |
288 | 288 | let amount = $t098049840._2 | |
289 | 289 | let assetId = if (!(isDefined(payment.assetId))) | |
290 | 290 | then unit | |
291 | 291 | else if (if ((size(priceAssetId) > 0)) | |
292 | 292 | then (toBase58String(value(payment.assetId)) == priceAssetId) | |
293 | 293 | else false) | |
294 | 294 | then payment.assetId | |
295 | 295 | else throw("Wrong asset id") | |
296 | 296 | if (if ((assetId == unit)) | |
297 | 297 | then (priceAssetId != "") | |
298 | 298 | else false) | |
299 | 299 | then throw("Wrong asset id") | |
300 | 300 | else if ((artworkPrice != amount)) | |
301 | 301 | then throw("Payment don't match") | |
302 | 302 | else $Tuple2(amount, assetId) | |
303 | 303 | } | |
304 | 304 | ||
305 | 305 | ||
306 | 306 | func acceptedAssetIds (assetId) = if (if (if (if (if ((assetId != toBase58String(signAssetId))) | |
307 | 307 | then (assetId != toBase58String(wavesAssetId)) | |
308 | 308 | else false) | |
309 | 309 | then (assetId != "WAVES") | |
310 | 310 | else false) | |
311 | 311 | then (assetId != toBase58String(usdnAssetId)) | |
312 | 312 | else false) | |
313 | 313 | then (assetId != toBase58String(usdtAssetId)) | |
314 | 314 | else false) | |
315 | 315 | then throw("Only SIGN, USDN,USDT or WAVES accepted") | |
316 | 316 | else true | |
317 | 317 | ||
318 | 318 | ||
319 | 319 | func validateMinSell (assetId,price) = { | |
320 | 320 | let minSellWaves = if (unitTest) | |
321 | 321 | then 10 | |
322 | 322 | else getIntegerByKeyFromOracle("waves_min_sell") | |
323 | 323 | let minSellUsdn = 1000000 | |
324 | 324 | let minSellSign = if (unitTest) | |
325 | 325 | then 1 | |
326 | 326 | else (currentCertificationPrice * 2) | |
327 | 327 | if (if (if (if (if (if ((assetId == toBase58String(usdnAssetId))) | |
328 | 328 | then (minSellUsdn > price) | |
329 | 329 | else false) | |
330 | 330 | then (price != 0) | |
331 | 331 | else false) | |
332 | 332 | then true | |
333 | 333 | else if (if ((assetId == toBase58String(usdtAssetId))) | |
334 | 334 | then (minSellUsdn > price) | |
335 | 335 | else false) | |
336 | 336 | then (price != 0) | |
337 | 337 | else false) | |
338 | 338 | then true | |
339 | 339 | else if (if ((assetId == toBase58String(signAssetId))) | |
340 | 340 | then (minSellSign > price) | |
341 | 341 | else false) | |
342 | 342 | then (price != 0) | |
343 | 343 | else false) | |
344 | 344 | then true | |
345 | 345 | else if (if (if ((assetId == toBase58String(wavesAssetId))) | |
346 | 346 | then true | |
347 | 347 | else (assetId == "WAVES")) | |
348 | 348 | then (minSellWaves > price) | |
349 | 349 | else false) | |
350 | 350 | then (price != 0) | |
351 | 351 | else false) | |
352 | 352 | then throw("Wrong minimum sell price") | |
353 | 353 | else true | |
354 | 354 | } | |
355 | 355 | ||
356 | 356 | ||
357 | 357 | func getBidAssetId (assetId) = if ((assetId == "WAVES")) | |
358 | 358 | then unit | |
359 | 359 | else fromBase58String(assetId) | |
360 | 360 | ||
361 | 361 | ||
362 | 362 | func getPriceAssetIdFromBid (bidDataKey) = { | |
363 | 363 | let bidData = getStringByKey((bidDataKey + "_OPEN")) | |
364 | 364 | if ((bidData == "")) | |
365 | 365 | then throw("Bid not found") | |
366 | 366 | else { | |
367 | 367 | let bidDataArr = split(bidData, "_") | |
368 | 368 | let bidAmount = parseIntValue(bidDataArr[1]) | |
369 | 369 | let bidAssetId = getBidAssetId(bidDataArr[0]) | |
370 | 370 | if ((0 >= bidAmount)) | |
371 | 371 | then throw("Wrong amount") | |
372 | 372 | else $Tuple2(bidAmount, bidAssetId) | |
373 | 373 | } | |
374 | 374 | } | |
375 | 375 | ||
376 | 376 | ||
377 | 377 | func idCallerDateSponsored (i,pubKey) = if (!(dappRunning)) | |
378 | 378 | then throw(maintenanceMSG) | |
379 | 379 | else { | |
380 | 380 | let isSponsored = if ((pubKey != "")) | |
381 | 381 | then valueOrElse(checkWhitelist((toString(addressFromPublicKey(fromBase58String(pubKey))) + "_free_txs")), 0) | |
382 | 382 | else 0 | |
383 | 383 | let caller = if (if ((toBase58String(i.caller.bytes) == toString(this))) | |
384 | 384 | then (isSponsored > 0) | |
385 | 385 | else false) | |
386 | 386 | then toString(addressFromPublicKey(fromBase58String(pubKey))) | |
387 | 387 | else toBase58String(i.caller.bytes) | |
388 | 388 | let get_sponsored_waves = if (if ((pubKey != "")) | |
389 | 389 | then (isSponsored > 0) | |
390 | 390 | else false) | |
391 | 391 | then invoke(whitelistDapp, "useFreeTx", [toString(addressFromPublicKey(fromBase58String(pubKey)))], nil) | |
392 | 392 | else unit | |
393 | 393 | $Tuple4(toBase58String(i.transactionId), caller, lastBlock.timestamp, isSponsored) | |
394 | 394 | } | |
395 | 395 | ||
396 | 396 | ||
397 | 397 | func idCallerDate (i) = if (!(dappRunning)) | |
398 | 398 | then throw(maintenanceMSG) | |
399 | 399 | else $Tuple3(toBase58String(i.transactionId), toBase58String(i.caller.bytes), lastBlock.timestamp) | |
400 | 400 | ||
401 | 401 | ||
402 | 402 | func buyMint (i,artId,issuer,bidId,bidOwner,pubKey) = { | |
403 | 403 | let $t01303413104 = idCallerDateSponsored(i, pubKey) | |
404 | 404 | let id = $t01303413104._1 | |
405 | 405 | let caller = $t01303413104._2 | |
406 | 406 | let date = $t01303413104._3 | |
407 | 407 | let isSponsored = $t01303413104._4 | |
408 | + | let new_caller = if (if ((toBase58String(i.caller.bytes) == toString(this))) | |
409 | + | then (isSponsored > 0) | |
410 | + | else false) | |
411 | + | then toString(addressFromPublicKey(fromBase58String(pubKey))) | |
412 | + | else toBase58String(i.caller.bytes) | |
408 | 413 | if (true) | |
409 | - | then throw( | |
414 | + | then throw(((((((new_caller + " / ") + issuer) + " / ") + bidOwner) + " / ") + pubKey)) | |
410 | 415 | else { | |
411 | - | let | |
412 | - | then ( | |
416 | + | let isBid = if (if (if ((caller == issuer)) | |
417 | + | then (bidOwner != "") | |
413 | 418 | else false) | |
414 | - | then toString(addressFromPublicKey(fromBase58String(pubKey))) | |
415 | - | else toBase58String(i.caller.bytes) | |
416 | - | if (true) | |
417 | - | then throw(((((((new_caller + " / ") + issuer) + " / ") + bidOwner) + " / ") + pubKey)) | |
419 | + | then (bidId != "") | |
420 | + | else false) | |
421 | + | then true | |
422 | + | else false | |
423 | + | let blockEnd = getIntegerByKey(keyEndSale(caller, artId)) | |
424 | + | if (if (if ((blockEnd != 0)) | |
425 | + | then (height >= blockEnd) | |
426 | + | else false) | |
427 | + | then !(isBid) | |
428 | + | else false) | |
429 | + | then throw("Sale ended.") | |
418 | 430 | else { | |
419 | - | let isBid = if (if (if ((caller == issuer)) | |
420 | - | then (bidOwner != "") | |
421 | - | else false) | |
422 | - | then (bidId != "") | |
423 | - | else false) | |
424 | - | then true | |
425 | - | else false | |
426 | - | let blockEnd = getIntegerByKey(keyEndSale(caller, artId)) | |
427 | - | if (if (if ((blockEnd != 0)) | |
428 | - | then (height >= blockEnd) | |
429 | - | else false) | |
430 | - | then !(isBid) | |
431 | - | else false) | |
432 | - | then throw("Sale ended.") | |
431 | + | let callerIsIssuer = (caller == issuer) | |
432 | + | let totalNFT = getIntegerByKey("total_nft_issued") | |
433 | + | let signID = getStringByKey(keySignID(issuer, artId)) | |
434 | + | let artworkName = getStringByKey(keyName(issuer, artId)) | |
435 | + | if ((artworkName == "")) | |
436 | + | then throw("Art doesn't exist") | |
433 | 437 | else { | |
434 | - | let callerIsIssuer = (caller == issuer) | |
435 | - | let totalNFT = getIntegerByKey("total_nft_issued") | |
436 | - | let signID = getStringByKey(keySignID(issuer, artId)) | |
437 | - | let artworkName = getStringByKey(keyName(issuer, artId)) | |
438 | - | if ((artworkName == "")) | |
439 | - | then throw("Art doesn't exist") | |
440 | - | else { | |
441 | - | let isOnSale = getBooleanByKey(keyOnSale(issuer, artId)) | |
442 | - | let amountSold = getIntegerByKey(keyIssued(issuer, artId)) | |
443 | - | let artworkPrice = if (callerIsIssuer) | |
444 | - | then (currentCertificationPrice * 2) | |
445 | - | else getIntegerByKey(keyPrice(issuer, artId)) | |
446 | - | let priceAssetId = if (callerIsIssuer) | |
447 | - | then toBase58String(signAssetId) | |
448 | - | else getStringByKey(keyAssetIdAccepted(issuer, artId)) | |
449 | - | let maxCanSell = getIntegerByKey(keyMaxMint(issuer, artId)) | |
450 | - | if (if (if (!(isBid)) | |
451 | - | then !(callerIsIssuer) | |
452 | - | else false) | |
453 | - | then if (if ((0 >= artworkPrice)) | |
454 | - | then true | |
455 | - | else !(isOnSale)) | |
456 | - | then true | |
457 | - | else (0 >= maxCanSell) | |
458 | - | else false) | |
459 | - | then throw("Art not for sale") | |
460 | - | else if (if (if (!(isBid)) | |
461 | - | then callerIsIssuer | |
438 | + | let isOnSale = getBooleanByKey(keyOnSale(issuer, artId)) | |
439 | + | let amountSold = getIntegerByKey(keyIssued(issuer, artId)) | |
440 | + | let artworkPrice = if (callerIsIssuer) | |
441 | + | then (currentCertificationPrice * 2) | |
442 | + | else getIntegerByKey(keyPrice(issuer, artId)) | |
443 | + | let priceAssetId = if (callerIsIssuer) | |
444 | + | then toBase58String(signAssetId) | |
445 | + | else getStringByKey(keyAssetIdAccepted(issuer, artId)) | |
446 | + | let maxCanSell = getIntegerByKey(keyMaxMint(issuer, artId)) | |
447 | + | if (if (if (!(isBid)) | |
448 | + | then !(callerIsIssuer) | |
449 | + | else false) | |
450 | + | then if (if ((0 >= artworkPrice)) | |
451 | + | then true | |
452 | + | else !(isOnSale)) | |
453 | + | then true | |
454 | + | else (0 >= maxCanSell) | |
455 | + | else false) | |
456 | + | then throw("Art not for sale") | |
457 | + | else if (if (if (!(isBid)) | |
458 | + | then callerIsIssuer | |
459 | + | else false) | |
460 | + | then (0 >= maxCanSell) | |
461 | + | else false) | |
462 | + | then throw("Max issuable not set") | |
463 | + | else { | |
464 | + | let checkUser = validateUser(issuer) | |
465 | + | if (if (isBid) | |
466 | + | then (checkUser != "") | |
462 | 467 | else false) | |
463 | - | then (0 >= maxCanSell) | |
464 | - | else false) | |
465 | - | then throw("Max issuable not set") | |
468 | + | then throw(checkUser) | |
466 | 469 | else { | |
467 | - | let checkUser = validateUser(issuer) | |
468 | - | if (if (isBid) | |
469 | - | then (checkUser != "") | |
470 | + | let bidDataKey = ((((((("bid_" + artId) + "_") + issuer) + "_") + bidOwner) + "_") + bidId) | |
471 | + | let $t01492815120 = if (isBid) | |
472 | + | then getPriceAssetIdFromBid(bidDataKey) | |
473 | + | else validatePriceAssetId(i, priceAssetId, artworkPrice) | |
474 | + | let amount = $t01492815120._1 | |
475 | + | let assetId = $t01492815120._2 | |
476 | + | let agent = valueOrElse(getString(userDapp, keyArtistAgentAddr(issuer)), feeReceiver) | |
477 | + | let agentShare = valueOrElse(getInteger(userDapp, keyPrimaryShareAgent(issuer)), 0) | |
478 | + | let publicAgent = valueOrElse(getString(userDapp, keyArtistPublicAgentAddr(issuer)), feeReceiver) | |
479 | + | let publicAgentShare = valueOrElse(getInteger(userDapp, keyPrimarySharePublicAgent(issuer)), 0) | |
480 | + | let isWhitelisted = checkWhitelist(issuer) | |
481 | + | let cut = if ((isWhitelisted > height)) | |
482 | + | then 0 | |
483 | + | else if ((assetId == signAssetId)) | |
484 | + | then signCut | |
485 | + | else usdnWaveCut | |
486 | + | let amountForSign = fraction(amount, cut, 100) | |
487 | + | let amountForAgent = if (if (if ((agent != feeReceiver)) | |
488 | + | then (agentShare > 0) | |
470 | 489 | else false) | |
471 | - | then throw(checkUser) | |
490 | + | then (height > isWhitelisted) | |
491 | + | else false) | |
492 | + | then fraction(amount, agentShare, 10000) | |
493 | + | else 0 | |
494 | + | let amountForPublicAgent = if (if (if ((publicAgent != feeReceiver)) | |
495 | + | then (publicAgentShare > 0) | |
496 | + | else false) | |
497 | + | then (height > isWhitelisted) | |
498 | + | else false) | |
499 | + | then fraction(amount, publicAgentShare, 10000) | |
500 | + | else 0 | |
501 | + | let amountForCreator = (amount - amountForSign) | |
502 | + | if ((amountSold == maxCanSell)) | |
503 | + | then throw("Art sold out") | |
472 | 504 | else { | |
473 | - | let bidDataKey = ((((((("bid_" + artId) + "_") + issuer) + "_") + bidOwner) + "_") + bidId) | |
474 | - | let $t01498015172 = if (isBid) | |
475 | - | then getPriceAssetIdFromBid(bidDataKey) | |
476 | - | else validatePriceAssetId(i, priceAssetId, artworkPrice) | |
477 | - | let amount = $t01498015172._1 | |
478 | - | let assetId = $t01498015172._2 | |
479 | - | let agent = valueOrElse(getString(userDapp, keyArtistAgentAddr(issuer)), feeReceiver) | |
480 | - | let agentShare = valueOrElse(getInteger(userDapp, keyPrimaryShareAgent(issuer)), 0) | |
481 | - | let publicAgent = valueOrElse(getString(userDapp, keyArtistPublicAgentAddr(issuer)), feeReceiver) | |
482 | - | let publicAgentShare = valueOrElse(getInteger(userDapp, keyPrimarySharePublicAgent(issuer)), 0) | |
483 | - | let isWhitelisted = checkWhitelist(issuer) | |
484 | - | let cut = if ((isWhitelisted > height)) | |
485 | - | then 0 | |
486 | - | else if ((assetId == signAssetId)) | |
487 | - | then signCut | |
488 | - | else usdnWaveCut | |
489 | - | let amountForSign = fraction(amount, cut, 100) | |
490 | - | let amountForAgent = if (if (if ((agent != feeReceiver)) | |
491 | - | then (agentShare > 0) | |
492 | - | else false) | |
493 | - | then (height > isWhitelisted) | |
494 | - | else false) | |
495 | - | then fraction(amount, agentShare, 10000) | |
496 | - | else 0 | |
497 | - | let amountForPublicAgent = if (if (if ((publicAgent != feeReceiver)) | |
498 | - | then (publicAgentShare > 0) | |
499 | - | else false) | |
500 | - | then (height > isWhitelisted) | |
501 | - | else false) | |
502 | - | then fraction(amount, publicAgentShare, 10000) | |
503 | - | else 0 | |
504 | - | let amountForCreator = (amount - amountForSign) | |
505 | - | if ((amountSold == maxCanSell)) | |
506 | - | then throw("Art sold out") | |
507 | - | else { | |
508 | - | let newAmountSold = (amountSold + 1) | |
509 | - | let issueMeta = ((((((((((("Creator: " + issuer) + ", | |
505 | + | let newAmountSold = (amountSold + 1) | |
506 | + | let issueMeta = ((((((((((("Creator: " + issuer) + ", | |
510 | 507 | ArtID: ") + artId) + ", | |
511 | 508 | SignID: ") + signID) + ", | |
512 | 509 | Artwork name: ") + artworkName) + ", | |
513 | 510 | Issue: ") + toString(newAmountSold)) + "/") + toString(maxCanSell)) | |
514 | - | let issueNFT = Issue(("SA_" + toString((totalNFT + 1))), issueMeta, 1, 0, false) | |
515 | - | let idNFT = calculateAssetId(issueNFT) | |
516 | - | let sellStatus = if (if ((newAmountSold == maxCanSell)) | |
517 | - | then true | |
518 | - | else !(isOnSale)) | |
519 | - | then false | |
520 | - | else true | |
521 | - | let receiveNFT = if (if (if ((caller == issuer)) | |
522 | - | then (bidOwner != "") | |
523 | - | else false) | |
524 | - | then (bidId != "") | |
525 | - | else false) | |
526 | - | then addressFromStringValue(bidOwner) | |
527 | - | else i.caller | |
528 | - | let assetIdBid = if (!(isDefined(assetId))) | |
529 | - | then "WAVES" | |
530 | - | else toBase58String(value(assetId)) | |
531 | - | let bidData = getStringByKey((bidDataKey + "_OPEN")) | |
532 | - | let bidDelOld = DeleteEntry((bidDataKey + "_OPEN")) | |
533 | - | let bidUpdate = StringEntry((bidDataKey + "_CLOSED"), ((bidData + "_") + toString(date))) | |
534 | - | let soldKey = ((((((("art_sold_" + toString(newAmountSold)) + "_of_") + toString(maxCanSell)) + "_") + artId) + "_") + issuer) | |
535 | - | let soldValue = if (!(isBid)) | |
536 | - | then ((((((((((caller + "_") + toString(date)) + "_") + id) + "_") + toString(artworkPrice)) + "_") + priceAssetId) + "_") + toBase58String(idNFT)) | |
537 | - | else ((((((((((toString(receiveNFT) + "_") + toString(date)) + "_") + id) + "_") + toString(amount)) + "_") + assetIdBid) + "_") + toBase58String(idNFT)) | |
538 | - | let soldData = StringEntry(soldKey, soldValue) | |
539 | - | let commissionsWithAgent = if ((amountForAgent != 0)) | |
540 | - | then [ScriptTransfer(Address(fromBase58String(feeReceiver)), (amountForSign - amountForAgent), assetId), ScriptTransfer(Address(fromBase58String(agent)), amountForAgent, assetId)] | |
541 | - | else [ScriptTransfer(Address(fromBase58String(feeReceiver)), amountForSign, assetId)] | |
542 | - | let commissionsWithPublicAgent = if ((amountForPublicAgent != 0)) | |
543 | - | then [ScriptTransfer(Address(fromBase58String(publicAgent)), amountForPublicAgent, assetId), ScriptTransfer(Address(fromBase58String(issuer)), (amountForCreator - amountForPublicAgent), assetId)] | |
544 | - | else [ScriptTransfer(Address(fromBase58String(issuer)), amountForCreator, assetId)] | |
545 | - | let txToCaller = if ((isSponsored > 0)) | |
546 | - | then [ScriptTransfer(Address(fromBase58String(caller)), 0, unit)] | |
547 | - | else nil | |
548 | - | let buyRes = ((([IntegerEntry(keyIssued(issuer, artId), newAmountSold), StringEntry(("nft_" + toBase58String(idNFT)), soldKey), IntegerEntry("total_nft_issued", (totalNFT + 1)), IntegerEntry(keyEndSale(issuer, artId), 0), BooleanEntry(keyOnSale(issuer, artId), sellStatus), issueNFT, ScriptTransfer(receiveNFT, 1, idNFT)] ++ commissionsWithAgent) ++ commissionsWithPublicAgent) ++ txToCaller) | |
549 | - | if (isBid) | |
550 | - | then [soldData, bidUpdate, bidDelOld] :: buyRes | |
551 | - | else soldData :: buyRes | |
552 | - | } | |
511 | + | let issueNFT = Issue(("SA_" + toString((totalNFT + 1))), issueMeta, 1, 0, false) | |
512 | + | let idNFT = calculateAssetId(issueNFT) | |
513 | + | let sellStatus = if (if ((newAmountSold == maxCanSell)) | |
514 | + | then true | |
515 | + | else !(isOnSale)) | |
516 | + | then false | |
517 | + | else true | |
518 | + | let receiveNFT = if (if (if ((caller == issuer)) | |
519 | + | then (bidOwner != "") | |
520 | + | else false) | |
521 | + | then (bidId != "") | |
522 | + | else false) | |
523 | + | then addressFromStringValue(bidOwner) | |
524 | + | else i.caller | |
525 | + | let assetIdBid = if (!(isDefined(assetId))) | |
526 | + | then "WAVES" | |
527 | + | else toBase58String(value(assetId)) | |
528 | + | let bidData = getStringByKey((bidDataKey + "_OPEN")) | |
529 | + | let bidDelOld = DeleteEntry((bidDataKey + "_OPEN")) | |
530 | + | let bidUpdate = StringEntry((bidDataKey + "_CLOSED"), ((bidData + "_") + toString(date))) | |
531 | + | let soldKey = ((((((("art_sold_" + toString(newAmountSold)) + "_of_") + toString(maxCanSell)) + "_") + artId) + "_") + issuer) | |
532 | + | let soldValue = if (!(isBid)) | |
533 | + | then ((((((((((caller + "_") + toString(date)) + "_") + id) + "_") + toString(artworkPrice)) + "_") + priceAssetId) + "_") + toBase58String(idNFT)) | |
534 | + | else ((((((((((toString(receiveNFT) + "_") + toString(date)) + "_") + id) + "_") + toString(amount)) + "_") + assetIdBid) + "_") + toBase58String(idNFT)) | |
535 | + | let soldData = StringEntry(soldKey, soldValue) | |
536 | + | let commissionsWithAgent = if ((amountForAgent != 0)) | |
537 | + | then [ScriptTransfer(Address(fromBase58String(feeReceiver)), (amountForSign - amountForAgent), assetId), ScriptTransfer(Address(fromBase58String(agent)), amountForAgent, assetId)] | |
538 | + | else [ScriptTransfer(Address(fromBase58String(feeReceiver)), amountForSign, assetId)] | |
539 | + | let commissionsWithPublicAgent = if ((amountForPublicAgent != 0)) | |
540 | + | then [ScriptTransfer(Address(fromBase58String(publicAgent)), amountForPublicAgent, assetId), ScriptTransfer(Address(fromBase58String(issuer)), (amountForCreator - amountForPublicAgent), assetId)] | |
541 | + | else [ScriptTransfer(Address(fromBase58String(issuer)), amountForCreator, assetId)] | |
542 | + | let txToCaller = if ((isSponsored > 0)) | |
543 | + | then [ScriptTransfer(Address(fromBase58String(caller)), 0, unit)] | |
544 | + | else nil | |
545 | + | let buyRes = ((([IntegerEntry(keyIssued(issuer, artId), newAmountSold), StringEntry(("nft_" + toBase58String(idNFT)), soldKey), IntegerEntry("total_nft_issued", (totalNFT + 1)), IntegerEntry(keyEndSale(issuer, artId), 0), BooleanEntry(keyOnSale(issuer, artId), sellStatus), issueNFT, ScriptTransfer(receiveNFT, 1, idNFT)] ++ commissionsWithAgent) ++ commissionsWithPublicAgent) ++ txToCaller) | |
546 | + | if (isBid) | |
547 | + | then [soldData, bidUpdate, bidDelOld] :: buyRes | |
548 | + | else soldData :: buyRes | |
553 | 549 | } | |
554 | 550 | } | |
555 | - | } | |
551 | + | } | |
556 | 552 | } | |
557 | 553 | } | |
558 | 554 | } | |
559 | 555 | } | |
560 | 556 | ||
561 | 557 | ||
562 | 558 | func asString (bv) = match bv { | |
563 | 559 | case bv0: String => | |
564 | 560 | bv0 | |
565 | 561 | case _ => | |
566 | 562 | throw("Sponsored Public Key String expected") | |
567 | 563 | } | |
568 | 564 | ||
569 | 565 | ||
570 | 566 | @Callable(invoke) | |
571 | 567 | func setConf (key,val) = { | |
572 | 568 | let caller = toString(invoke.caller) | |
573 | 569 | if (containsElement([chris, toString(this)], caller)) | |
574 | 570 | then if (contains(key, "conf_")) | |
575 | 571 | then [StringEntry(key, val)] | |
576 | 572 | else throw("Entries starting with conf_ only") | |
577 | 573 | else throw("You are not allowed to change this") | |
578 | 574 | } | |
579 | 575 | ||
580 | 576 | ||
581 | 577 | ||
582 | 578 | @Callable(i) | |
583 | 579 | func addArtwork (sha256Hash,signID,name,description,tags,type,cidDisplay,sha256Export,cidExport,sha256Licence,cidLicence,crawler,royalties,pubKey) = { | |
584 | - | let $ | |
585 | - | let artId = $ | |
586 | - | let caller = $ | |
587 | - | let date = $ | |
588 | - | let isSponsored = $ | |
580 | + | let $t02030020373 = idCallerDateSponsored(i, pubKey) | |
581 | + | let artId = $t02030020373._1 | |
582 | + | let caller = $t02030020373._2 | |
583 | + | let date = $t02030020373._3 | |
584 | + | let isSponsored = $t02030020373._4 | |
589 | 585 | if (!(validateHash(sha256Hash))) | |
590 | 586 | then throw("Hash should be 64 characters maximum") | |
591 | 587 | else { | |
592 | - | let $ | |
593 | - | let licenceCID = $ | |
594 | - | let licenceHash = $ | |
588 | + | let $t02047420543 = setLIcence(cidLicence, sha256Licence) | |
589 | + | let licenceCID = $t02047420543._1 | |
590 | + | let licenceHash = $t02047420543._2 | |
595 | 591 | let validateArtwork = validateArtworkData(caller, cidDisplay, cidExport, licenceCID, sha256Export, licenceHash, name, description, tags, royalties) | |
596 | 592 | if ((validateArtwork != "")) | |
597 | 593 | then throw("Something went wrong!") | |
598 | 594 | else { | |
599 | 595 | let whitelisted_drop = (checkWhitelist((caller + "_free_drops")) > 0) | |
600 | - | let $ | |
596 | + | let $t02084220926 = if (whitelisted_drop) | |
601 | 597 | then $Tuple2(0, signID) | |
602 | 598 | else validatePayment(i) | |
603 | - | let amount = $ | |
604 | - | let assetId = $ | |
599 | + | let amount = $t02084220926._1 | |
600 | + | let assetId = $t02084220926._2 | |
605 | 601 | if (!(isDefined(amount))) | |
606 | 602 | then throw("Something went wrong") | |
607 | 603 | else { | |
608 | 604 | let entryExist = getStringByKey(keyTxidByHashOwner(sha256Hash, caller)) | |
609 | 605 | if ((entryExist != "")) | |
610 | 606 | then throw("You already added it") | |
611 | 607 | else { | |
612 | 608 | let hashExist = getStringByKey(keyOwnerByHash(sha256Hash)) | |
613 | 609 | if ((hashExist != "")) | |
614 | 610 | then throw("Hash already registered") | |
615 | 611 | else { | |
616 | 612 | let isSignCertified = checkSignCertificate(signID, caller, sha256Hash) | |
617 | 613 | if (!(isSignCertified)) | |
618 | 614 | then throw("Sign Certificate not found for this address.") | |
619 | 615 | else { | |
620 | 616 | let decrease_whitelist_drop = if (whitelisted_drop) | |
621 | 617 | then invoke(whitelistDapp, "useFreeDrop", [caller], nil) | |
622 | 618 | else unit | |
623 | 619 | if ((decrease_whitelist_drop == decrease_whitelist_drop)) | |
624 | 620 | then { | |
625 | 621 | let txToCaller = if ((isSponsored > 0)) | |
626 | 622 | then [ScriptTransfer(Address(fromBase58String(caller)), 0, unit)] | |
627 | 623 | else nil | |
628 | 624 | ([StringEntry(keyOwnerByHash(sha256Hash), caller), StringEntry(keyTxidByHashOwner(sha256Hash, caller), artId), IntegerEntry(keyDate(caller, artId), date), StringEntry(keyName(caller, artId), name), StringEntry(keyDesc(caller, artId), description), StringEntry(keyDisplayCid(caller, artId), cidDisplay), StringEntry(keyExportCid(caller, artId), cidExport), StringEntry(keyExportHash(caller, artId), sha256Export), StringEntry(keyLicenceHash(caller, artId), licenceHash), StringEntry(keyLicenceCid(caller, artId), licenceCID), StringEntry(keyType(caller, artId), type), StringEntry(keyTags(caller, artId), tags), IntegerEntry(keyMaxMint(caller, artId), 0), StringEntry(keySignID(caller, artId), signID), IntegerEntry(keyIssued(caller, artId), 0), BooleanEntry(keyOnSale(caller, artId), false), StringEntry(keyidBySignid(caller, signID), artId), StringEntry(keyHashByTxidAddr(caller, artId), sha256Hash), StringEntry(keyCrawler(caller, artId), crawler), IntegerEntry(keyRoyalties(caller, artId), royalties), ScriptTransfer(Address(fromBase58String(feeReceiver)), amount, signAssetId)] ++ txToCaller) | |
629 | 625 | } | |
630 | 626 | else throw("Strict value is not equal to itself.") | |
631 | 627 | } | |
632 | 628 | } | |
633 | 629 | } | |
634 | 630 | } | |
635 | 631 | } | |
636 | 632 | } | |
637 | 633 | } | |
638 | 634 | ||
639 | 635 | ||
640 | 636 | ||
641 | 637 | @Callable(i) | |
642 | 638 | func updateArtwork (txid,name,description,tags,type,cidDisplay,sha256Export,cidExport,sha256Licence,cidLicence,crawler,royalties,pubKey) = if (!(dappRunning)) | |
643 | 639 | then throw(maintenanceMSG) | |
644 | 640 | else { | |
645 | - | let $ | |
646 | - | let id = $ | |
647 | - | let caller = $ | |
648 | - | let date = $ | |
649 | - | let isSponsored = $ | |
650 | - | let $ | |
651 | - | let licenceCID = $ | |
652 | - | let licenceHash = $ | |
641 | + | let $t02396424034 = idCallerDateSponsored(i, pubKey) | |
642 | + | let id = $t02396424034._1 | |
643 | + | let caller = $t02396424034._2 | |
644 | + | let date = $t02396424034._3 | |
645 | + | let isSponsored = $t02396424034._4 | |
646 | + | let $t02404424113 = setLIcence(cidLicence, sha256Licence) | |
647 | + | let licenceCID = $t02404424113._1 | |
648 | + | let licenceHash = $t02404424113._2 | |
653 | 649 | let validateArtwork = validateArtworkData(caller, cidDisplay, cidExport, licenceCID, sha256Export, licenceHash, name, description, tags, royalties) | |
654 | 650 | if ((validateArtwork != "")) | |
655 | 651 | then throw("Something went wrong!") | |
656 | 652 | else { | |
657 | 653 | let entryExist = getStringByKey(keyName(caller, txid)) | |
658 | 654 | if ((entryExist == "")) | |
659 | 655 | then throw("Entry not found") | |
660 | 656 | else { | |
661 | 657 | let flag = getStringByKey(keyFlag(caller, txid)) | |
662 | 658 | if ((flag == "ILLEGAL")) | |
663 | 659 | then throw("Cannot update ILLEGAL artwork") | |
664 | 660 | else if (!(isArtMinted(caller, txid))) | |
665 | 661 | then { | |
666 | 662 | let txToCaller = if ((isSponsored > 0)) | |
667 | 663 | then [ScriptTransfer(Address(fromBase58String(caller)), 0, unit)] | |
668 | 664 | else nil | |
669 | 665 | ([StringEntry(keyName(caller, txid), name), StringEntry(keyDesc(caller, txid), description), StringEntry(keyDisplayCid(caller, txid), cidDisplay), StringEntry(keyExportCid(caller, txid), cidExport), StringEntry(keyExportHash(caller, txid), sha256Export), StringEntry(keyLicenceCid(caller, txid), licenceCID), StringEntry(keyLicenceHash(caller, txid), licenceHash), StringEntry(keyTags(caller, txid), tags), StringEntry(keyType(caller, txid), type), StringEntry(keyCrawler(caller, txid), crawler), IntegerEntry(keyRoyalties(caller, txid), royalties)] ++ txToCaller) | |
670 | 666 | } | |
671 | 667 | else throw("Already minted") | |
672 | 668 | } | |
673 | 669 | } | |
674 | 670 | } | |
675 | 671 | ||
676 | 672 | ||
677 | 673 | ||
678 | 674 | @Callable(i) | |
679 | 675 | func flagArtwork (artId,addr,flag,note) = { | |
680 | - | let $ | |
681 | - | let id = $ | |
682 | - | let caller = $ | |
676 | + | let $t02574425778 = idCallerDate(i) | |
677 | + | let id = $t02574425778._1 | |
678 | + | let caller = $t02574425778._2 | |
683 | 679 | if (containsElement([chris, toString(this)], caller)) | |
684 | 680 | then if (containsElement(["CONSENT", "", "CHANGE_REQUIRED", "FLAGGED", "ILLEGAL"], flag)) | |
685 | 681 | then [StringEntry(keyFlag(addr, artId), flag), StringEntry(keyNote(addr, artId), note)] | |
686 | 682 | else throw(("Unknow status " + flag)) | |
687 | 683 | else throw("You are not allowed") | |
688 | 684 | } | |
689 | 685 | ||
690 | 686 | ||
691 | 687 | ||
692 | 688 | @Callable(i) | |
693 | 689 | func deleteArtwork (artId,addr) = { | |
694 | - | let $ | |
695 | - | let id = $ | |
696 | - | let caller = $ | |
690 | + | let $t02621426248 = idCallerDate(i) | |
691 | + | let id = $t02621426248._1 | |
692 | + | let caller = $t02621426248._2 | |
697 | 693 | let addrToUse = if (containsElement([chris, toString(this)], caller)) | |
698 | 694 | then addr | |
699 | 695 | else caller | |
700 | 696 | let entryExist = valueOrErrorMessage(getStringByKey(keyName(addrToUse, artId)), "No art matching for this address") | |
701 | 697 | if ((entryExist == "")) | |
702 | 698 | then throw("No art matching for this address") | |
703 | 699 | else { | |
704 | 700 | let sha256Hash = getStringByKey(keyHashByTxidAddr(addrToUse, artId)) | |
705 | 701 | if ((sha256Hash == "")) | |
706 | 702 | then throw("No art hash matching for this address") | |
707 | 703 | else { | |
708 | 704 | let signID = getStringByKey(keySignID(addrToUse, artId)) | |
709 | 705 | if ((signID == "")) | |
710 | 706 | then throw("No SIGN ID matching") | |
711 | 707 | else { | |
712 | 708 | let dataToDelete = [DeleteEntry(keyDate(addrToUse, artId)), DeleteEntry(keyName(addrToUse, artId)), DeleteEntry(keyDesc(addrToUse, artId)), DeleteEntry(keyDisplayCid(addrToUse, artId)), DeleteEntry(keyExportCid(addrToUse, artId)), DeleteEntry(keyExportHash(addrToUse, artId)), DeleteEntry(keyLicenceHash(addrToUse, artId)), DeleteEntry(keyLicenceCid(addrToUse, artId)), DeleteEntry(keyType(addrToUse, artId)), DeleteEntry(keyTags(addrToUse, artId)), DeleteEntry(keyMaxMint(addrToUse, artId)), DeleteEntry(keySignID(addrToUse, artId)), DeleteEntry(keyIssued(addrToUse, artId)), DeleteEntry(keyOnSale(addrToUse, artId)), DeleteEntry(keyFlag(addrToUse, artId)), DeleteEntry(keyPrice(addrToUse, artId)), DeleteEntry(keyAssetIdAccepted(addrToUse, artId)), DeleteEntry(keyOwnerByHash(sha256Hash)), DeleteEntry(keyidBySignid(addrToUse, signID)), DeleteEntry(keyTxidByHashOwner(sha256Hash, addrToUse)), DeleteEntry(keyEndSale(addrToUse, artId)), DeleteEntry(keyNote(addrToUse, artId)), DeleteEntry(keyCrawler(addrToUse, artId)), DeleteEntry(keyRoyalties(addrToUse, artId))] | |
713 | 709 | if (!(isArtMinted(addrToUse, artId))) | |
714 | 710 | then if (!(dappRunning)) | |
715 | 711 | then throw(maintenanceMSG) | |
716 | 712 | else dataToDelete | |
717 | 713 | else if (containsElement([chris, toString(this)], caller)) | |
718 | 714 | then dataToDelete | |
719 | 715 | else throw("Art already minted, you cannot delete it") | |
720 | 716 | } | |
721 | 717 | } | |
722 | 718 | } | |
723 | 719 | } | |
724 | 720 | ||
725 | 721 | ||
726 | 722 | ||
727 | 723 | @Callable(i) | |
728 | 724 | func sellArtwork (artId,price,maxMint,assetId,blockEnd,pubKey) = { | |
729 | - | let $ | |
730 | - | let id = $ | |
731 | - | let caller = $ | |
732 | - | let date = $ | |
733 | - | let isSponsored = $ | |
725 | + | let $t02908429154 = idCallerDateSponsored(i, pubKey) | |
726 | + | let id = $t02908429154._1 | |
727 | + | let caller = $t02908429154._2 | |
728 | + | let date = $t02908429154._3 | |
729 | + | let isSponsored = $t02908429154._4 | |
734 | 730 | let artworkName = getStringByKey(keyName(caller, artId)) | |
735 | 731 | if ((artworkName == "")) | |
736 | 732 | then throw("This art doesn't match your account") | |
737 | 733 | else { | |
738 | 734 | let flag = getStringByKey(keyFlag(caller, artId)) | |
739 | 735 | if (containsElement(["CHANGE_REQUIRED", "FLAGGED", "ILLEGAL"], flag)) | |
740 | 736 | then throw("Flagged artwork") | |
741 | 737 | else { | |
742 | 738 | let bidNbr = getIntegerByKey(("current_bidamount_" + artId)) | |
743 | 739 | if ((0 > blockEnd)) | |
744 | 740 | then throw("Negative end") | |
745 | 741 | else if (if ((blockEnd > 0)) | |
746 | 742 | then if ((maxMint != 1)) | |
747 | 743 | then true | |
748 | 744 | else (price != 0) | |
749 | 745 | else false) | |
750 | 746 | then throw("Timed offer only allowed for unique edition and offer only") | |
751 | 747 | else { | |
752 | 748 | let baseHeight = if ((blockEnd == 0)) | |
753 | 749 | then 0 | |
754 | 750 | else height | |
755 | 751 | if (!(acceptedAssetIds(assetId))) | |
756 | 752 | then throw("Something went wrong!") | |
757 | 753 | else if (!(validateMinSell(assetId, price))) | |
758 | 754 | then throw("Something went wrong!") | |
759 | 755 | else { | |
760 | 756 | let checkUser = validateUser(caller) | |
761 | 757 | if ((checkUser != "")) | |
762 | 758 | then throw(checkUser) | |
763 | 759 | else { | |
764 | 760 | let amountSold = getIntegerByKey(keyIssued(caller, artId)) | |
765 | 761 | let maxCanSell = getIntegerByKey(keyMaxMint(caller, artId)) | |
766 | 762 | if ((maxMint > 100)) | |
767 | 763 | then throw("100 editions max per artwork") | |
768 | 764 | else if (if ((amountSold != 0)) | |
769 | 765 | then (amountSold == maxCanSell) | |
770 | 766 | else false) | |
771 | 767 | then throw("Max edition reached.") | |
772 | 768 | else if (if ((amountSold > 0)) | |
773 | 769 | then (maxCanSell != maxMint) | |
774 | 770 | else false) | |
775 | 771 | then throw("Cannot change maximum issuable anymore") | |
776 | 772 | else if (if ((bidNbr > 0)) | |
777 | 773 | then (maxCanSell != maxMint) | |
778 | 774 | else false) | |
779 | 775 | then throw("Cannot change maximum issuable with active orders") | |
780 | 776 | else { | |
781 | 777 | let sellStatus = if (if ((price > 0)) | |
782 | 778 | then (maxMint > 0) | |
783 | 779 | else false) | |
784 | 780 | then true | |
785 | 781 | else false | |
786 | 782 | let txToCaller = if ((isSponsored > 0)) | |
787 | 783 | then [ScriptTransfer(Address(fromBase58String(caller)), 0, unit)] | |
788 | 784 | else nil | |
789 | 785 | ([BooleanEntry(keyOnSale(caller, artId), sellStatus), IntegerEntry(keyPrice(caller, artId), price), IntegerEntry(keyMaxMint(caller, artId), maxMint), StringEntry(keyAssetIdAccepted(caller, artId), assetId), IntegerEntry(keyEndSale(caller, artId), (baseHeight + blockEnd))] ++ txToCaller) | |
790 | 786 | } | |
791 | 787 | } | |
792 | 788 | } | |
793 | 789 | } | |
794 | 790 | } | |
795 | 791 | } | |
796 | 792 | } | |
797 | 793 | ||
798 | 794 | ||
799 | 795 | ||
800 | 796 | @Callable(i) | |
801 | 797 | func buyArtwork (artId,issuer) = buyMint(i, artId, issuer, "", "", "") | |
802 | 798 | ||
803 | 799 | ||
804 | 800 | ||
805 | 801 | @Callable(i) | |
806 | 802 | func setBid (artId,issuer) = { | |
807 | - | let $ | |
808 | - | let id = $ | |
809 | - | let caller = $ | |
810 | - | let date = $ | |
811 | - | let $ | |
812 | - | let payment = $ | |
813 | - | let amount = $ | |
803 | + | let $t03154031580 = idCallerDate(i) | |
804 | + | let id = $t03154031580._1 | |
805 | + | let caller = $t03154031580._2 | |
806 | + | let date = $t03154031580._3 | |
807 | + | let $t03158531621 = isPayment(i) | |
808 | + | let payment = $t03158531621._1 | |
809 | + | let amount = $t03158531621._2 | |
814 | 810 | let assetId = if (!(isDefined(payment.assetId))) | |
815 | 811 | then "WAVES" | |
816 | 812 | else toBase58String(value(payment.assetId)) | |
817 | 813 | let blockEnd = getIntegerByKey(keyEndSale(issuer, artId)) | |
818 | 814 | if (if ((blockEnd != 0)) | |
819 | 815 | then (height >= blockEnd) | |
820 | 816 | else false) | |
821 | 817 | then throw("Sale ended.") | |
822 | 818 | else { | |
823 | 819 | let bidNbr = getIntegerByKey(("current_bidamount_" + artId)) | |
824 | 820 | if (!(acceptedAssetIds(assetId))) | |
825 | 821 | then throw("asset not accepted") | |
826 | 822 | else if (!(validateMinSell(assetId, amount))) | |
827 | 823 | then throw("Wrong min sell") | |
828 | 824 | else { | |
829 | 825 | let amountSold = getIntegerByKey(keyIssued(issuer, artId)) | |
830 | 826 | let maxCanSell = getIntegerByKey(keyMaxMint(issuer, artId)) | |
831 | 827 | if ((0 >= maxCanSell)) | |
832 | 828 | then throw("No max edition set for this artwork") | |
833 | 829 | else if ((amountSold >= maxCanSell)) | |
834 | 830 | then throw("Sold out, you cannot bid") | |
835 | 831 | else [StringEntry((((((((("bid_" + artId) + "_") + issuer) + "_") + caller) + "_") + id) + "_OPEN"), ((((assetId + "_") + toString(amount)) + "_") + toString(date))), IntegerEntry(("current_bidamount_" + artId), (bidNbr + 1))] | |
836 | 832 | } | |
837 | 833 | } | |
838 | 834 | } | |
839 | 835 | ||
840 | 836 | ||
841 | 837 | ||
842 | 838 | @Callable(i) | |
843 | 839 | func acceptBid (artId,issuer,bidId,bidOwner,pubKey) = { | |
844 | - | let $ | |
845 | - | let id = $ | |
846 | - | let caller1 = $ | |
847 | - | let date = $ | |
848 | - | let isSponsored = $ | |
840 | + | let $t03284132912 = idCallerDateSponsored(i, pubKey) | |
841 | + | let id = $t03284132912._1 | |
842 | + | let caller1 = $t03284132912._2 | |
843 | + | let date = $t03284132912._3 | |
844 | + | let isSponsored = $t03284132912._4 | |
849 | 845 | if ((caller1 != issuer)) | |
850 | 846 | then throw("You cannot do this action") | |
851 | 847 | else buyMint(i, artId, issuer, bidId, bidOwner, pubKey) | |
852 | 848 | } | |
853 | 849 | ||
854 | 850 | ||
855 | 851 | ||
856 | 852 | @Callable(i) | |
857 | 853 | func cancelBid (artId,issuer,bidId,bidOwner) = { | |
858 | - | let $ | |
859 | - | let id = $ | |
860 | - | let caller = $ | |
861 | - | let date = $ | |
854 | + | let $t03314733208 = idCallerDate(i) | |
855 | + | let id = $t03314733208._1 | |
856 | + | let caller = $t03314733208._2 | |
857 | + | let date = $t03314733208._3 | |
862 | 858 | if (if ((caller != bidOwner)) | |
863 | 859 | then (caller != issuer) | |
864 | 860 | else false) | |
865 | 861 | then throw("You cannot do this action") | |
866 | 862 | else { | |
867 | 863 | let returnMoneyTo = if ((caller == issuer)) | |
868 | 864 | then bidOwner | |
869 | 865 | else caller | |
870 | 866 | let bidNbr = getIntegerByKey(("current_bidamount_" + artId)) | |
871 | 867 | let bidDataKey = ((((((("bid_" + artId) + "_") + issuer) + "_") + bidOwner) + "_") + bidId) | |
872 | 868 | let bidData = getStringByKey((bidDataKey + "_OPEN")) | |
873 | 869 | if ((bidData == "")) | |
874 | 870 | then throw("Bid not found") | |
875 | 871 | else { | |
876 | 872 | let bidDataArr = split(bidData, "_") | |
877 | 873 | let assetId = getBidAssetId(bidDataArr[0]) | |
878 | 874 | let bidStatus = "CANCELED" | |
879 | 875 | [DeleteEntry((bidDataKey + "_OPEN")), StringEntry(((bidDataKey + "_") + bidStatus), ((bidData + "_") + toString(date))), IntegerEntry(("current_bidamount_" + artId), (bidNbr - 1)), ScriptTransfer(Address(fromBase58String(returnMoneyTo)), parseIntValue(bidDataArr[1]), assetId)] | |
880 | 876 | } | |
881 | 877 | } | |
882 | 878 | } | |
883 | 879 | ||
884 | 880 | ||
885 | 881 | @Verifier(tx) | |
886 | 882 | func verifier () = match tx { | |
887 | 883 | case inv: InvokeScriptTransaction => | |
888 | 884 | if (if (if (if ((inv.function == "addArtwork")) | |
889 | 885 | then (inv.dApp == this) | |
890 | 886 | else false) | |
891 | 887 | then (inv.fee == 500000) | |
892 | 888 | else false) | |
893 | 889 | then (inv.feeAssetId == unit) | |
894 | 890 | else false) | |
895 | 891 | then sigVerify(tx.bodyBytes, tx.proofs[0], fromBase58String(asString(inv.args[13]))) | |
896 | 892 | else if (if (if (if ((inv.function == "updateArtwork")) | |
897 | 893 | then (inv.dApp == this) | |
898 | 894 | else false) | |
899 | 895 | then (inv.fee == 500000) | |
900 | 896 | else false) | |
901 | 897 | then (inv.feeAssetId == unit) | |
902 | 898 | else false) | |
903 | 899 | then sigVerify(tx.bodyBytes, tx.proofs[0], fromBase58String(asString(inv.args[12]))) | |
904 | 900 | else if (if (if (if ((inv.function == "sellArtwork")) | |
905 | 901 | then (inv.dApp == this) | |
906 | 902 | else false) | |
907 | 903 | then (inv.fee == 500000) | |
908 | 904 | else false) | |
909 | 905 | then (inv.feeAssetId == unit) | |
910 | 906 | else false) | |
911 | 907 | then sigVerify(tx.bodyBytes, tx.proofs[0], fromBase58String(asString(inv.args[5]))) | |
912 | 908 | else if (if (if (if ((inv.function == "acceptBid")) | |
913 | 909 | then (inv.dApp == this) | |
914 | 910 | else false) | |
915 | 911 | then (inv.fee == 500000) | |
916 | 912 | else false) | |
917 | 913 | then (inv.feeAssetId == unit) | |
918 | 914 | else false) | |
919 | 915 | then sigVerify_128Kb(tx.bodyBytes, tx.proofs[0], fromBase58String(asString(inv.args[4]))) | |
920 | 916 | else sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
921 | 917 | case _ => | |
922 | 918 | sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
923 | 919 | } | |
924 | 920 |
github/deemru/w8io/169f3d6 99.96 ms ◑