tx · ZcWuPVLVaCx4apnEpDD7yyM7QwGrUu2VCdxycmpRzMG 3NBynfbXC2KastUxhukcMUaE58K9cBdB9UY: -0.19000000 Waves 2023.03.24 07:18 [2503597] smart account 3NBynfbXC2KastUxhukcMUaE58K9cBdB9UY > SELF 0.00000000 Waves
{ "type": 13, "id": "ZcWuPVLVaCx4apnEpDD7yyM7QwGrUu2VCdxycmpRzMG", "fee": 19000000, "feeAssetId": null, "timestamp": 1679631599034, "version": 2, "chainId": 84, "sender": "3NBynfbXC2KastUxhukcMUaE58K9cBdB9UY", "senderPublicKey": "J9DCtJJxJBWZdtDR12BA1U94Q3cZzMi4R6k5hYkAzmzC", "proofs": [ "2hdjteUNLYXPokXdzFUCFuWmPaSnjegC4g8JsdCTPw7iXsuzdQTjzJ6RvqTh5kcRM862uJ5M2K9MirLzSZFW8TFA" ], "script": "base64:BgL+FAgCEgQKAggIEhAKDggICAgICAgICAgICAEIEg8KDQgICAgICAgICAgIAQgSBgoECAgICBIECgIICBIICgYIAQEIAQgSBAoCCAgSBAoCCAgSBwoFCAgICAgSBgoECAgICCIOZ2V0U3RyaW5nQnlLZXkiA2tleSIIdW5pdFRlc3QiCW9yYWNsZUZlZSIIc2lnbkRhcHAiC2ZlZVJlY2VpdmVyIgh1c2VyRGFwcCINd2hpdGVsaXN0RGFwcCILc2lnbkFzc2V0SWQiC3VzZG5Bc3NldElkIgt1c2R0QXNzZXRJZCIMd2F2ZXNBc3NldElkIgVjaHJpcyIZZ2V0SW50ZWdlckJ5S2V5RnJvbU9yYWNsZSIPZ2V0SW50ZWdlckJ5S2V5Ig5jaGVja1doaXRlbGlzdCIPZ2V0Qm9vbGVhbkJ5S2V5IgdzaWduQ3V0Igt1c2RuV2F2ZUN1dCIOZGVmYXVsdExpY2VuY2UiEmRlZmF1bHRIYXNoTGljZW5jZSILZGFwcFJ1bm5pbmciDm1haW50ZW5hbmNlTVNHIg11c2VyU3VzcGVuZGVkIgt1c2VyUmVtb3ZlZCIQdXNlcl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DCHgcJAAACCAUCY1gKZmVlQXNzZXRJZAUEdW5pdAcJAMgTAwgFAmNWCWJvZHlCeXRlcwkAkQMCCAUCY1YGcHJvb2ZzAAAJANkEAQkBAmNtAQkAkQMCCAUCY1gEYXJncwAECQD0AwMIBQJjVglib2R5Qnl0ZXMJAJEDAggFAmNWBnByb29mcwAACAUCY1YPc2VuZGVyUHVibGljS2V5CQD0AwMIBQJjVglib2R5Qnl0ZXMJAJEDAggFAmNWBnByb29mcwAACAUCY1YPc2VuZGVyUHVibGljS2V5SXeYWQ==", "height": 2503597, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: FkuTsD32pNZdaBBLGokWqL4FPdosVqonf1uzEfJsNME9 Next: J8zf2vhEUaVQ3VaBE3CuEXHDMcr5km2bvvRX2pEz2Gk6 Diff:
Old | New | Differences | |
---|---|---|---|
380 | 380 | let isSponsored = if ((pubKey != "")) | |
381 | 381 | then valueOrElse(checkWhitelist((toString(addressFromPublicKey(fromBase58String(pubKey))) + "_free_txs")), 0) | |
382 | 382 | else 0 | |
383 | - | if ((isSponsored == isSponsored)) | |
384 | - | then { | |
385 | - | let caller = if (if ((toBase58String(i.caller.bytes) == toString(this))) | |
386 | - | then (isSponsored > 0) | |
387 | - | else false) | |
388 | - | then toString(addressFromPublicKey(fromBase58String(pubKey))) | |
389 | - | else toBase58String(i.caller.bytes) | |
390 | - | let get_sponsored_waves = if (if ((pubKey != "")) | |
391 | - | then (isSponsored > 0) | |
392 | - | else false) | |
393 | - | then invoke(whitelistDapp, "useFreeTx", [toString(addressFromPublicKey(fromBase58String(pubKey)))], nil) | |
394 | - | else unit | |
395 | - | if ((get_sponsored_waves == get_sponsored_waves)) | |
396 | - | then $Tuple4(toBase58String(i.transactionId), caller, lastBlock.timestamp, (isSponsored > 0)) | |
397 | - | else throw("Strict value is not equal to itself.") | |
398 | - | } | |
383 | + | let caller = if (if ((toBase58String(i.caller.bytes) == toString(this))) | |
384 | + | then (isSponsored > 0) | |
385 | + | else false) | |
386 | + | then toString(addressFromPublicKey(fromBase58String(pubKey))) | |
387 | + | else toBase58String(i.caller.bytes) | |
388 | + | let get_sponsored_waves = if (if ((pubKey != "")) | |
389 | + | then (isSponsored > 0) | |
390 | + | else false) | |
391 | + | then invoke(whitelistDapp, "useFreeTx", [toString(addressFromPublicKey(fromBase58String(pubKey)))], nil) | |
392 | + | else unit | |
393 | + | if ((get_sponsored_waves == get_sponsored_waves)) | |
394 | + | then $Tuple4(toBase58String(i.transactionId), caller, lastBlock.timestamp, (isSponsored > 0)) | |
399 | 395 | else throw("Strict value is not equal to itself.") | |
400 | 396 | } | |
401 | 397 | ||
406 | 402 | ||
407 | 403 | ||
408 | 404 | func buyMint (i,artId,issuer,bidId,bidOwner,pubKey) = { | |
409 | - | let $ | |
410 | - | let id = $ | |
411 | - | let caller = $ | |
412 | - | let date = $ | |
413 | - | let isSponsored = $ | |
405 | + | let $t01304113111 = idCallerDateSponsored(i, pubKey) | |
406 | + | let id = $t01304113111._1 | |
407 | + | let caller = $t01304113111._2 | |
408 | + | let date = $t01304113111._3 | |
409 | + | let isSponsored = $t01304113111._4 | |
414 | 410 | if (true) | |
415 | 411 | then throw(((toString((caller == issuer)) + " / ") + toString(isSponsored))) | |
416 | 412 | else { | |
469 | 465 | then throw(checkUser) | |
470 | 466 | else { | |
471 | 467 | let bidDataKey = ((((((("bid_" + artId) + "_") + issuer) + "_") + bidOwner) + "_") + bidId) | |
472 | - | let $ | |
468 | + | let $t01473714929 = if (isBid) | |
473 | 469 | then getPriceAssetIdFromBid(bidDataKey) | |
474 | 470 | else validatePriceAssetId(i, priceAssetId, artworkPrice) | |
475 | - | let amount = $ | |
476 | - | let assetId = $ | |
471 | + | let amount = $t01473714929._1 | |
472 | + | let assetId = $t01473714929._2 | |
477 | 473 | let agent = valueOrElse(getString(userDapp, keyArtistAgentAddr(issuer)), feeReceiver) | |
478 | 474 | let agentShare = valueOrElse(getInteger(userDapp, keyPrimaryShareAgent(issuer)), 0) | |
479 | 475 | let publicAgent = valueOrElse(getString(userDapp, keyArtistPublicAgentAddr(issuer)), feeReceiver) | |
578 | 574 | ||
579 | 575 | @Callable(i) | |
580 | 576 | func addArtwork (sha256Hash,signID,name,description,tags,type,cidDisplay,sha256Export,cidExport,sha256Licence,cidLicence,crawler,royalties,pubKey) = { | |
581 | - | let $ | |
582 | - | let artId = $ | |
583 | - | let caller = $ | |
584 | - | let date = $ | |
585 | - | let isSponsored = $ | |
577 | + | let $t02010520178 = idCallerDateSponsored(i, pubKey) | |
578 | + | let artId = $t02010520178._1 | |
579 | + | let caller = $t02010520178._2 | |
580 | + | let date = $t02010520178._3 | |
581 | + | let isSponsored = $t02010520178._4 | |
586 | 582 | if (!(validateHash(sha256Hash))) | |
587 | 583 | then throw("Hash should be 64 characters maximum") | |
588 | 584 | else { | |
589 | - | let $ | |
590 | - | let licenceCID = $ | |
591 | - | let licenceHash = $ | |
585 | + | let $t02027920348 = setLIcence(cidLicence, sha256Licence) | |
586 | + | let licenceCID = $t02027920348._1 | |
587 | + | let licenceHash = $t02027920348._2 | |
592 | 588 | let validateArtwork = validateArtworkData(caller, cidDisplay, cidExport, licenceCID, sha256Export, licenceHash, name, description, tags, royalties) | |
593 | 589 | if ((validateArtwork != "")) | |
594 | 590 | then throw("Something went wrong!") | |
595 | 591 | else { | |
596 | 592 | let whitelisted_drop = (checkWhitelist((caller + "_free_drops")) > 0) | |
597 | - | let $ | |
593 | + | let $t02064720731 = if (whitelisted_drop) | |
598 | 594 | then $Tuple2(0, signID) | |
599 | 595 | else validatePayment(i) | |
600 | - | let amount = $ | |
601 | - | let assetId = $ | |
596 | + | let amount = $t02064720731._1 | |
597 | + | let assetId = $t02064720731._2 | |
602 | 598 | if (!(isDefined(amount))) | |
603 | 599 | then throw("Something went wrong") | |
604 | 600 | else { | |
639 | 635 | func updateArtwork (txid,name,description,tags,type,cidDisplay,sha256Export,cidExport,sha256Licence,cidLicence,crawler,royalties,pubKey) = if (!(dappRunning)) | |
640 | 636 | then throw(maintenanceMSG) | |
641 | 637 | else { | |
642 | - | let $ | |
643 | - | let id = $ | |
644 | - | let caller = $ | |
645 | - | let date = $ | |
646 | - | let isSponsored = $ | |
647 | - | let $ | |
648 | - | let licenceCID = $ | |
649 | - | let licenceHash = $ | |
638 | + | let $t02376523835 = idCallerDateSponsored(i, pubKey) | |
639 | + | let id = $t02376523835._1 | |
640 | + | let caller = $t02376523835._2 | |
641 | + | let date = $t02376523835._3 | |
642 | + | let isSponsored = $t02376523835._4 | |
643 | + | let $t02384523914 = setLIcence(cidLicence, sha256Licence) | |
644 | + | let licenceCID = $t02384523914._1 | |
645 | + | let licenceHash = $t02384523914._2 | |
650 | 646 | let validateArtwork = validateArtworkData(caller, cidDisplay, cidExport, licenceCID, sha256Export, licenceHash, name, description, tags, royalties) | |
651 | 647 | if ((validateArtwork != "")) | |
652 | 648 | then throw("Something went wrong!") | |
674 | 670 | ||
675 | 671 | @Callable(i) | |
676 | 672 | func flagArtwork (artId,addr,flag,note) = { | |
677 | - | let $ | |
678 | - | let id = $ | |
679 | - | let caller = $ | |
673 | + | let $t02554125575 = idCallerDate(i) | |
674 | + | let id = $t02554125575._1 | |
675 | + | let caller = $t02554125575._2 | |
680 | 676 | if (containsElement([chris, toString(this)], caller)) | |
681 | 677 | then if (containsElement(["CONSENT", "", "CHANGE_REQUIRED", "FLAGGED", "ILLEGAL"], flag)) | |
682 | 678 | then [StringEntry(keyFlag(addr, artId), flag), StringEntry(keyNote(addr, artId), note)] | |
688 | 684 | ||
689 | 685 | @Callable(i) | |
690 | 686 | func deleteArtwork (artId,addr) = { | |
691 | - | let $ | |
692 | - | let id = $ | |
693 | - | let caller = $ | |
687 | + | let $t02601126045 = idCallerDate(i) | |
688 | + | let id = $t02601126045._1 | |
689 | + | let caller = $t02601126045._2 | |
694 | 690 | let addrToUse = if (containsElement([chris, toString(this)], caller)) | |
695 | 691 | then addr | |
696 | 692 | else caller | |
723 | 719 | ||
724 | 720 | @Callable(i) | |
725 | 721 | func sellArtwork (artId,price,maxMint,assetId,blockEnd,pubKey) = { | |
726 | - | let $ | |
727 | - | let id = $ | |
728 | - | let caller = $ | |
729 | - | let date = $ | |
730 | - | let isSponsored = $ | |
722 | + | let $t02888128951 = idCallerDateSponsored(i, pubKey) | |
723 | + | let id = $t02888128951._1 | |
724 | + | let caller = $t02888128951._2 | |
725 | + | let date = $t02888128951._3 | |
726 | + | let isSponsored = $t02888128951._4 | |
731 | 727 | let artworkName = getStringByKey(keyName(caller, artId)) | |
732 | 728 | if ((artworkName == "")) | |
733 | 729 | then throw("This art doesn't match your account") | |
801 | 797 | ||
802 | 798 | @Callable(i) | |
803 | 799 | func setBid (artId,issuer) = { | |
804 | - | let $ | |
805 | - | let id = $ | |
806 | - | let caller = $ | |
807 | - | let date = $ | |
808 | - | let $ | |
809 | - | let payment = $ | |
810 | - | let amount = $ | |
800 | + | let $t03133331373 = idCallerDate(i) | |
801 | + | let id = $t03133331373._1 | |
802 | + | let caller = $t03133331373._2 | |
803 | + | let date = $t03133331373._3 | |
804 | + | let $t03137831414 = isPayment(i) | |
805 | + | let payment = $t03137831414._1 | |
806 | + | let amount = $t03137831414._2 | |
811 | 807 | let assetId = if (!(isDefined(payment.assetId))) | |
812 | 808 | then "WAVES" | |
813 | 809 | else toBase58String(value(payment.assetId)) | |
838 | 834 | ||
839 | 835 | @Callable(i) | |
840 | 836 | func acceptBid (artId,issuer,bidId,bidOwner,pubKey) = { | |
841 | - | let $ | |
842 | - | let id = $ | |
843 | - | let caller1 = $ | |
844 | - | let date = $ | |
845 | - | let isSponsored = $ | |
837 | + | let $t03263432705 = idCallerDateSponsored(i, pubKey) | |
838 | + | let id = $t03263432705._1 | |
839 | + | let caller1 = $t03263432705._2 | |
840 | + | let date = $t03263432705._3 | |
841 | + | let isSponsored = $t03263432705._4 | |
846 | 842 | if ((caller1 != issuer)) | |
847 | 843 | then throw("You cannot do this action") | |
848 | 844 | else buyMint(i, artId, issuer, bidId, bidOwner, pubKey) | |
852 | 848 | ||
853 | 849 | @Callable(i) | |
854 | 850 | func cancelBid (artId,issuer,bidId,bidOwner) = { | |
855 | - | let $ | |
856 | - | let id = $ | |
857 | - | let caller = $ | |
858 | - | let date = $ | |
851 | + | let $t03294033001 = idCallerDate(i) | |
852 | + | let id = $t03294033001._1 | |
853 | + | let caller = $t03294033001._2 | |
854 | + | let date = $t03294033001._3 | |
859 | 855 | if (if ((caller != bidOwner)) | |
860 | 856 | then (caller != issuer) | |
861 | 857 | 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 | - | if ((isSponsored == isSponsored)) | |
384 | - | then { | |
385 | - | let caller = if (if ((toBase58String(i.caller.bytes) == toString(this))) | |
386 | - | then (isSponsored > 0) | |
387 | - | else false) | |
388 | - | then toString(addressFromPublicKey(fromBase58String(pubKey))) | |
389 | - | else toBase58String(i.caller.bytes) | |
390 | - | let get_sponsored_waves = if (if ((pubKey != "")) | |
391 | - | then (isSponsored > 0) | |
392 | - | else false) | |
393 | - | then invoke(whitelistDapp, "useFreeTx", [toString(addressFromPublicKey(fromBase58String(pubKey)))], nil) | |
394 | - | else unit | |
395 | - | if ((get_sponsored_waves == get_sponsored_waves)) | |
396 | - | then $Tuple4(toBase58String(i.transactionId), caller, lastBlock.timestamp, (isSponsored > 0)) | |
397 | - | else throw("Strict value is not equal to itself.") | |
398 | - | } | |
383 | + | let caller = if (if ((toBase58String(i.caller.bytes) == toString(this))) | |
384 | + | then (isSponsored > 0) | |
385 | + | else false) | |
386 | + | then toString(addressFromPublicKey(fromBase58String(pubKey))) | |
387 | + | else toBase58String(i.caller.bytes) | |
388 | + | let get_sponsored_waves = if (if ((pubKey != "")) | |
389 | + | then (isSponsored > 0) | |
390 | + | else false) | |
391 | + | then invoke(whitelistDapp, "useFreeTx", [toString(addressFromPublicKey(fromBase58String(pubKey)))], nil) | |
392 | + | else unit | |
393 | + | if ((get_sponsored_waves == get_sponsored_waves)) | |
394 | + | then $Tuple4(toBase58String(i.transactionId), caller, lastBlock.timestamp, (isSponsored > 0)) | |
399 | 395 | else throw("Strict value is not equal to itself.") | |
400 | 396 | } | |
401 | 397 | ||
402 | 398 | ||
403 | 399 | func idCallerDate (i) = if (!(dappRunning)) | |
404 | 400 | then throw(maintenanceMSG) | |
405 | 401 | else $Tuple3(toBase58String(i.transactionId), toBase58String(i.caller.bytes), lastBlock.timestamp) | |
406 | 402 | ||
407 | 403 | ||
408 | 404 | func buyMint (i,artId,issuer,bidId,bidOwner,pubKey) = { | |
409 | - | let $ | |
410 | - | let id = $ | |
411 | - | let caller = $ | |
412 | - | let date = $ | |
413 | - | let isSponsored = $ | |
405 | + | let $t01304113111 = idCallerDateSponsored(i, pubKey) | |
406 | + | let id = $t01304113111._1 | |
407 | + | let caller = $t01304113111._2 | |
408 | + | let date = $t01304113111._3 | |
409 | + | let isSponsored = $t01304113111._4 | |
414 | 410 | if (true) | |
415 | 411 | then throw(((toString((caller == issuer)) + " / ") + toString(isSponsored))) | |
416 | 412 | else { | |
417 | 413 | let isBid = if (if (if ((caller == issuer)) | |
418 | 414 | then (bidOwner != "") | |
419 | 415 | else false) | |
420 | 416 | then (bidId != "") | |
421 | 417 | else false) | |
422 | 418 | then true | |
423 | 419 | else false | |
424 | 420 | let blockEnd = getIntegerByKey(keyEndSale(caller, artId)) | |
425 | 421 | if (if (if ((blockEnd != 0)) | |
426 | 422 | then (height >= blockEnd) | |
427 | 423 | else false) | |
428 | 424 | then !(isBid) | |
429 | 425 | else false) | |
430 | 426 | then throw("Sale ended.") | |
431 | 427 | else { | |
432 | 428 | let callerIsIssuer = (caller == issuer) | |
433 | 429 | let totalNFT = getIntegerByKey("total_nft_issued") | |
434 | 430 | let signID = getStringByKey(keySignID(issuer, artId)) | |
435 | 431 | let artworkName = getStringByKey(keyName(issuer, artId)) | |
436 | 432 | if ((artworkName == "")) | |
437 | 433 | then throw("Art doesn't exist") | |
438 | 434 | else { | |
439 | 435 | let isOnSale = getBooleanByKey(keyOnSale(issuer, artId)) | |
440 | 436 | let amountSold = getIntegerByKey(keyIssued(issuer, artId)) | |
441 | 437 | let artworkPrice = if (callerIsIssuer) | |
442 | 438 | then (currentCertificationPrice * 2) | |
443 | 439 | else getIntegerByKey(keyPrice(issuer, artId)) | |
444 | 440 | let priceAssetId = if (callerIsIssuer) | |
445 | 441 | then toBase58String(signAssetId) | |
446 | 442 | else getStringByKey(keyAssetIdAccepted(issuer, artId)) | |
447 | 443 | let maxCanSell = getIntegerByKey(keyMaxMint(issuer, artId)) | |
448 | 444 | if (if (if (!(isBid)) | |
449 | 445 | then !(callerIsIssuer) | |
450 | 446 | else false) | |
451 | 447 | then if (if ((0 >= artworkPrice)) | |
452 | 448 | then true | |
453 | 449 | else !(isOnSale)) | |
454 | 450 | then true | |
455 | 451 | else (0 >= maxCanSell) | |
456 | 452 | else false) | |
457 | 453 | then throw("Art not for sale") | |
458 | 454 | else if (if (if (!(isBid)) | |
459 | 455 | then callerIsIssuer | |
460 | 456 | else false) | |
461 | 457 | then (0 >= maxCanSell) | |
462 | 458 | else false) | |
463 | 459 | then throw("Max issuable not set") | |
464 | 460 | else { | |
465 | 461 | let checkUser = validateUser(issuer) | |
466 | 462 | if (if (isBid) | |
467 | 463 | then (checkUser != "") | |
468 | 464 | else false) | |
469 | 465 | then throw(checkUser) | |
470 | 466 | else { | |
471 | 467 | let bidDataKey = ((((((("bid_" + artId) + "_") + issuer) + "_") + bidOwner) + "_") + bidId) | |
472 | - | let $ | |
468 | + | let $t01473714929 = if (isBid) | |
473 | 469 | then getPriceAssetIdFromBid(bidDataKey) | |
474 | 470 | else validatePriceAssetId(i, priceAssetId, artworkPrice) | |
475 | - | let amount = $ | |
476 | - | let assetId = $ | |
471 | + | let amount = $t01473714929._1 | |
472 | + | let assetId = $t01473714929._2 | |
477 | 473 | let agent = valueOrElse(getString(userDapp, keyArtistAgentAddr(issuer)), feeReceiver) | |
478 | 474 | let agentShare = valueOrElse(getInteger(userDapp, keyPrimaryShareAgent(issuer)), 0) | |
479 | 475 | let publicAgent = valueOrElse(getString(userDapp, keyArtistPublicAgentAddr(issuer)), feeReceiver) | |
480 | 476 | let publicAgentShare = valueOrElse(getInteger(userDapp, keyPrimarySharePublicAgent(issuer)), 0) | |
481 | 477 | let isWhitelisted = checkWhitelist(issuer) | |
482 | 478 | let cut = if ((isWhitelisted > height)) | |
483 | 479 | then 0 | |
484 | 480 | else if ((assetId == signAssetId)) | |
485 | 481 | then signCut | |
486 | 482 | else usdnWaveCut | |
487 | 483 | let amountForSign = fraction(amount, cut, 100) | |
488 | 484 | let amountForAgent = if (if (if ((agent != feeReceiver)) | |
489 | 485 | then (agentShare > 0) | |
490 | 486 | else false) | |
491 | 487 | then (height > isWhitelisted) | |
492 | 488 | else false) | |
493 | 489 | then fraction(amount, agentShare, 10000) | |
494 | 490 | else 0 | |
495 | 491 | let amountForPublicAgent = if (if (if ((publicAgent != feeReceiver)) | |
496 | 492 | then (publicAgentShare > 0) | |
497 | 493 | else false) | |
498 | 494 | then (height > isWhitelisted) | |
499 | 495 | else false) | |
500 | 496 | then fraction(amount, publicAgentShare, 10000) | |
501 | 497 | else 0 | |
502 | 498 | let amountForCreator = (amount - amountForSign) | |
503 | 499 | if ((amountSold == maxCanSell)) | |
504 | 500 | then throw("Art sold out") | |
505 | 501 | else { | |
506 | 502 | let newAmountSold = (amountSold + 1) | |
507 | 503 | let issueMeta = ((((((((((("Creator: " + issuer) + ", | |
508 | 504 | ArtID: ") + artId) + ", | |
509 | 505 | SignID: ") + signID) + ", | |
510 | 506 | Artwork name: ") + artworkName) + ", | |
511 | 507 | Issue: ") + toString(newAmountSold)) + "/") + toString(maxCanSell)) | |
512 | 508 | let issueNFT = Issue(("SA_" + toString((totalNFT + 1))), issueMeta, 1, 0, false) | |
513 | 509 | let idNFT = calculateAssetId(issueNFT) | |
514 | 510 | let sellStatus = if (if ((newAmountSold == maxCanSell)) | |
515 | 511 | then true | |
516 | 512 | else !(isOnSale)) | |
517 | 513 | then false | |
518 | 514 | else true | |
519 | 515 | let receiveNFT = if (if (if ((caller == issuer)) | |
520 | 516 | then (bidOwner != "") | |
521 | 517 | else false) | |
522 | 518 | then (bidId != "") | |
523 | 519 | else false) | |
524 | 520 | then addressFromStringValue(bidOwner) | |
525 | 521 | else i.caller | |
526 | 522 | let assetIdBid = if (!(isDefined(assetId))) | |
527 | 523 | then "WAVES" | |
528 | 524 | else toBase58String(value(assetId)) | |
529 | 525 | let bidData = getStringByKey((bidDataKey + "_OPEN")) | |
530 | 526 | let bidDelOld = DeleteEntry((bidDataKey + "_OPEN")) | |
531 | 527 | let bidUpdate = StringEntry((bidDataKey + "_CLOSED"), ((bidData + "_") + toString(date))) | |
532 | 528 | let soldKey = ((((((("art_sold_" + toString(newAmountSold)) + "_of_") + toString(maxCanSell)) + "_") + artId) + "_") + issuer) | |
533 | 529 | let soldValue = if (!(isBid)) | |
534 | 530 | then ((((((((((caller + "_") + toString(date)) + "_") + id) + "_") + toString(artworkPrice)) + "_") + priceAssetId) + "_") + toBase58String(idNFT)) | |
535 | 531 | else ((((((((((toString(receiveNFT) + "_") + toString(date)) + "_") + id) + "_") + toString(amount)) + "_") + assetIdBid) + "_") + toBase58String(idNFT)) | |
536 | 532 | let soldData = StringEntry(soldKey, soldValue) | |
537 | 533 | let commissionsWithAgent = if ((amountForAgent != 0)) | |
538 | 534 | then [ScriptTransfer(Address(fromBase58String(feeReceiver)), (amountForSign - amountForAgent), assetId), ScriptTransfer(Address(fromBase58String(agent)), amountForAgent, assetId)] | |
539 | 535 | else [ScriptTransfer(Address(fromBase58String(feeReceiver)), amountForSign, assetId)] | |
540 | 536 | let commissionsWithPublicAgent = if ((amountForPublicAgent != 0)) | |
541 | 537 | then [ScriptTransfer(Address(fromBase58String(publicAgent)), amountForPublicAgent, assetId), ScriptTransfer(Address(fromBase58String(issuer)), (amountForCreator - amountForPublicAgent), assetId)] | |
542 | 538 | else [ScriptTransfer(Address(fromBase58String(issuer)), amountForCreator, assetId)] | |
543 | 539 | let txToCaller = if (isSponsored) | |
544 | 540 | then [ScriptTransfer(Address(fromBase58String(caller)), 0, unit)] | |
545 | 541 | else nil | |
546 | 542 | 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) | |
547 | 543 | if (isBid) | |
548 | 544 | then [soldData, bidUpdate, bidDelOld] :: buyRes | |
549 | 545 | else soldData :: buyRes | |
550 | 546 | } | |
551 | 547 | } | |
552 | 548 | } | |
553 | 549 | } | |
554 | 550 | } | |
555 | 551 | } | |
556 | 552 | } | |
557 | 553 | ||
558 | 554 | ||
559 | 555 | func asString (bv) = match bv { | |
560 | 556 | case bv0: String => | |
561 | 557 | bv0 | |
562 | 558 | case _ => | |
563 | 559 | throw("Sponsored Public Key String expected") | |
564 | 560 | } | |
565 | 561 | ||
566 | 562 | ||
567 | 563 | @Callable(invoke) | |
568 | 564 | func setConf (key,val) = { | |
569 | 565 | let caller = toString(invoke.caller) | |
570 | 566 | if (containsElement([chris, toString(this)], caller)) | |
571 | 567 | then if (contains(key, "conf_")) | |
572 | 568 | then [StringEntry(key, val)] | |
573 | 569 | else throw("Entries starting with conf_ only") | |
574 | 570 | else throw("You are not allowed to change this") | |
575 | 571 | } | |
576 | 572 | ||
577 | 573 | ||
578 | 574 | ||
579 | 575 | @Callable(i) | |
580 | 576 | func addArtwork (sha256Hash,signID,name,description,tags,type,cidDisplay,sha256Export,cidExport,sha256Licence,cidLicence,crawler,royalties,pubKey) = { | |
581 | - | let $ | |
582 | - | let artId = $ | |
583 | - | let caller = $ | |
584 | - | let date = $ | |
585 | - | let isSponsored = $ | |
577 | + | let $t02010520178 = idCallerDateSponsored(i, pubKey) | |
578 | + | let artId = $t02010520178._1 | |
579 | + | let caller = $t02010520178._2 | |
580 | + | let date = $t02010520178._3 | |
581 | + | let isSponsored = $t02010520178._4 | |
586 | 582 | if (!(validateHash(sha256Hash))) | |
587 | 583 | then throw("Hash should be 64 characters maximum") | |
588 | 584 | else { | |
589 | - | let $ | |
590 | - | let licenceCID = $ | |
591 | - | let licenceHash = $ | |
585 | + | let $t02027920348 = setLIcence(cidLicence, sha256Licence) | |
586 | + | let licenceCID = $t02027920348._1 | |
587 | + | let licenceHash = $t02027920348._2 | |
592 | 588 | let validateArtwork = validateArtworkData(caller, cidDisplay, cidExport, licenceCID, sha256Export, licenceHash, name, description, tags, royalties) | |
593 | 589 | if ((validateArtwork != "")) | |
594 | 590 | then throw("Something went wrong!") | |
595 | 591 | else { | |
596 | 592 | let whitelisted_drop = (checkWhitelist((caller + "_free_drops")) > 0) | |
597 | - | let $ | |
593 | + | let $t02064720731 = if (whitelisted_drop) | |
598 | 594 | then $Tuple2(0, signID) | |
599 | 595 | else validatePayment(i) | |
600 | - | let amount = $ | |
601 | - | let assetId = $ | |
596 | + | let amount = $t02064720731._1 | |
597 | + | let assetId = $t02064720731._2 | |
602 | 598 | if (!(isDefined(amount))) | |
603 | 599 | then throw("Something went wrong") | |
604 | 600 | else { | |
605 | 601 | let entryExist = getStringByKey(keyTxidByHashOwner(sha256Hash, caller)) | |
606 | 602 | if ((entryExist != "")) | |
607 | 603 | then throw("You already added it") | |
608 | 604 | else { | |
609 | 605 | let hashExist = getStringByKey(keyOwnerByHash(sha256Hash)) | |
610 | 606 | if ((hashExist != "")) | |
611 | 607 | then throw("Hash already registered") | |
612 | 608 | else { | |
613 | 609 | let isSignCertified = checkSignCertificate(signID, caller, sha256Hash) | |
614 | 610 | if (!(isSignCertified)) | |
615 | 611 | then throw("Sign Certificate not found for this address.") | |
616 | 612 | else { | |
617 | 613 | let decrease_whitelist_drop = if (whitelisted_drop) | |
618 | 614 | then invoke(whitelistDapp, "useFreeDrop", [caller], nil) | |
619 | 615 | else unit | |
620 | 616 | if ((decrease_whitelist_drop == decrease_whitelist_drop)) | |
621 | 617 | then { | |
622 | 618 | let txToCaller = if (isSponsored) | |
623 | 619 | then [ScriptTransfer(Address(fromBase58String(caller)), 0, unit)] | |
624 | 620 | else nil | |
625 | 621 | ([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) | |
626 | 622 | } | |
627 | 623 | else throw("Strict value is not equal to itself.") | |
628 | 624 | } | |
629 | 625 | } | |
630 | 626 | } | |
631 | 627 | } | |
632 | 628 | } | |
633 | 629 | } | |
634 | 630 | } | |
635 | 631 | ||
636 | 632 | ||
637 | 633 | ||
638 | 634 | @Callable(i) | |
639 | 635 | func updateArtwork (txid,name,description,tags,type,cidDisplay,sha256Export,cidExport,sha256Licence,cidLicence,crawler,royalties,pubKey) = if (!(dappRunning)) | |
640 | 636 | then throw(maintenanceMSG) | |
641 | 637 | else { | |
642 | - | let $ | |
643 | - | let id = $ | |
644 | - | let caller = $ | |
645 | - | let date = $ | |
646 | - | let isSponsored = $ | |
647 | - | let $ | |
648 | - | let licenceCID = $ | |
649 | - | let licenceHash = $ | |
638 | + | let $t02376523835 = idCallerDateSponsored(i, pubKey) | |
639 | + | let id = $t02376523835._1 | |
640 | + | let caller = $t02376523835._2 | |
641 | + | let date = $t02376523835._3 | |
642 | + | let isSponsored = $t02376523835._4 | |
643 | + | let $t02384523914 = setLIcence(cidLicence, sha256Licence) | |
644 | + | let licenceCID = $t02384523914._1 | |
645 | + | let licenceHash = $t02384523914._2 | |
650 | 646 | let validateArtwork = validateArtworkData(caller, cidDisplay, cidExport, licenceCID, sha256Export, licenceHash, name, description, tags, royalties) | |
651 | 647 | if ((validateArtwork != "")) | |
652 | 648 | then throw("Something went wrong!") | |
653 | 649 | else { | |
654 | 650 | let entryExist = getStringByKey(keyName(caller, txid)) | |
655 | 651 | if ((entryExist == "")) | |
656 | 652 | then throw("Entry not found") | |
657 | 653 | else { | |
658 | 654 | let flag = getStringByKey(keyFlag(caller, txid)) | |
659 | 655 | if ((flag == "ILLEGAL")) | |
660 | 656 | then throw("Cannot update ILLEGAL artwork") | |
661 | 657 | else if (!(isArtMinted(caller, txid))) | |
662 | 658 | then { | |
663 | 659 | let txToCaller = if (isSponsored) | |
664 | 660 | then [ScriptTransfer(Address(fromBase58String(caller)), 0, unit)] | |
665 | 661 | else nil | |
666 | 662 | ([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) | |
667 | 663 | } | |
668 | 664 | else throw("Already minted") | |
669 | 665 | } | |
670 | 666 | } | |
671 | 667 | } | |
672 | 668 | ||
673 | 669 | ||
674 | 670 | ||
675 | 671 | @Callable(i) | |
676 | 672 | func flagArtwork (artId,addr,flag,note) = { | |
677 | - | let $ | |
678 | - | let id = $ | |
679 | - | let caller = $ | |
673 | + | let $t02554125575 = idCallerDate(i) | |
674 | + | let id = $t02554125575._1 | |
675 | + | let caller = $t02554125575._2 | |
680 | 676 | if (containsElement([chris, toString(this)], caller)) | |
681 | 677 | then if (containsElement(["CONSENT", "", "CHANGE_REQUIRED", "FLAGGED", "ILLEGAL"], flag)) | |
682 | 678 | then [StringEntry(keyFlag(addr, artId), flag), StringEntry(keyNote(addr, artId), note)] | |
683 | 679 | else throw(("Unknow status " + flag)) | |
684 | 680 | else throw("You are not allowed") | |
685 | 681 | } | |
686 | 682 | ||
687 | 683 | ||
688 | 684 | ||
689 | 685 | @Callable(i) | |
690 | 686 | func deleteArtwork (artId,addr) = { | |
691 | - | let $ | |
692 | - | let id = $ | |
693 | - | let caller = $ | |
687 | + | let $t02601126045 = idCallerDate(i) | |
688 | + | let id = $t02601126045._1 | |
689 | + | let caller = $t02601126045._2 | |
694 | 690 | let addrToUse = if (containsElement([chris, toString(this)], caller)) | |
695 | 691 | then addr | |
696 | 692 | else caller | |
697 | 693 | let entryExist = valueOrErrorMessage(getStringByKey(keyName(addrToUse, artId)), "No art matching for this address") | |
698 | 694 | if ((entryExist == "")) | |
699 | 695 | then throw("No art matching for this address") | |
700 | 696 | else { | |
701 | 697 | let sha256Hash = getStringByKey(keyHashByTxidAddr(addrToUse, artId)) | |
702 | 698 | if ((sha256Hash == "")) | |
703 | 699 | then throw("No art hash matching for this address") | |
704 | 700 | else { | |
705 | 701 | let signID = getStringByKey(keySignID(addrToUse, artId)) | |
706 | 702 | if ((signID == "")) | |
707 | 703 | then throw("No SIGN ID matching") | |
708 | 704 | else { | |
709 | 705 | 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))] | |
710 | 706 | if (!(isArtMinted(addrToUse, artId))) | |
711 | 707 | then if (!(dappRunning)) | |
712 | 708 | then throw(maintenanceMSG) | |
713 | 709 | else dataToDelete | |
714 | 710 | else if (containsElement([chris, toString(this)], caller)) | |
715 | 711 | then dataToDelete | |
716 | 712 | else throw("Art already minted, you cannot delete it") | |
717 | 713 | } | |
718 | 714 | } | |
719 | 715 | } | |
720 | 716 | } | |
721 | 717 | ||
722 | 718 | ||
723 | 719 | ||
724 | 720 | @Callable(i) | |
725 | 721 | func sellArtwork (artId,price,maxMint,assetId,blockEnd,pubKey) = { | |
726 | - | let $ | |
727 | - | let id = $ | |
728 | - | let caller = $ | |
729 | - | let date = $ | |
730 | - | let isSponsored = $ | |
722 | + | let $t02888128951 = idCallerDateSponsored(i, pubKey) | |
723 | + | let id = $t02888128951._1 | |
724 | + | let caller = $t02888128951._2 | |
725 | + | let date = $t02888128951._3 | |
726 | + | let isSponsored = $t02888128951._4 | |
731 | 727 | let artworkName = getStringByKey(keyName(caller, artId)) | |
732 | 728 | if ((artworkName == "")) | |
733 | 729 | then throw("This art doesn't match your account") | |
734 | 730 | else { | |
735 | 731 | let flag = getStringByKey(keyFlag(caller, artId)) | |
736 | 732 | if (containsElement(["CHANGE_REQUIRED", "FLAGGED", "ILLEGAL"], flag)) | |
737 | 733 | then throw("Flagged artwork") | |
738 | 734 | else { | |
739 | 735 | let bidNbr = getIntegerByKey(("current_bidamount_" + artId)) | |
740 | 736 | if ((0 > blockEnd)) | |
741 | 737 | then throw("Negative end") | |
742 | 738 | else if (if ((blockEnd > 0)) | |
743 | 739 | then if ((maxMint != 1)) | |
744 | 740 | then true | |
745 | 741 | else (price != 0) | |
746 | 742 | else false) | |
747 | 743 | then throw("Timed offer only allowed for unique edition and offer only") | |
748 | 744 | else { | |
749 | 745 | let baseHeight = if ((blockEnd == 0)) | |
750 | 746 | then 0 | |
751 | 747 | else height | |
752 | 748 | if (!(acceptedAssetIds(assetId))) | |
753 | 749 | then throw("Something went wrong!") | |
754 | 750 | else if (!(validateMinSell(assetId, price))) | |
755 | 751 | then throw("Something went wrong!") | |
756 | 752 | else { | |
757 | 753 | let checkUser = validateUser(caller) | |
758 | 754 | if ((checkUser != "")) | |
759 | 755 | then throw(checkUser) | |
760 | 756 | else { | |
761 | 757 | let amountSold = getIntegerByKey(keyIssued(caller, artId)) | |
762 | 758 | let maxCanSell = getIntegerByKey(keyMaxMint(caller, artId)) | |
763 | 759 | if ((maxMint > 100)) | |
764 | 760 | then throw("100 editions max per artwork") | |
765 | 761 | else if (if ((amountSold != 0)) | |
766 | 762 | then (amountSold == maxCanSell) | |
767 | 763 | else false) | |
768 | 764 | then throw("Max edition reached.") | |
769 | 765 | else if (if ((amountSold > 0)) | |
770 | 766 | then (maxCanSell != maxMint) | |
771 | 767 | else false) | |
772 | 768 | then throw("Cannot change maximum issuable anymore") | |
773 | 769 | else if (if ((bidNbr > 0)) | |
774 | 770 | then (maxCanSell != maxMint) | |
775 | 771 | else false) | |
776 | 772 | then throw("Cannot change maximum issuable with active orders") | |
777 | 773 | else { | |
778 | 774 | let sellStatus = if (if ((price > 0)) | |
779 | 775 | then (maxMint > 0) | |
780 | 776 | else false) | |
781 | 777 | then true | |
782 | 778 | else false | |
783 | 779 | let txToCaller = if (isSponsored) | |
784 | 780 | then [ScriptTransfer(Address(fromBase58String(caller)), 0, unit)] | |
785 | 781 | else nil | |
786 | 782 | ([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) | |
787 | 783 | } | |
788 | 784 | } | |
789 | 785 | } | |
790 | 786 | } | |
791 | 787 | } | |
792 | 788 | } | |
793 | 789 | } | |
794 | 790 | ||
795 | 791 | ||
796 | 792 | ||
797 | 793 | @Callable(i) | |
798 | 794 | func buyArtwork (artId,issuer) = buyMint(i, artId, issuer, "", "", "") | |
799 | 795 | ||
800 | 796 | ||
801 | 797 | ||
802 | 798 | @Callable(i) | |
803 | 799 | func setBid (artId,issuer) = { | |
804 | - | let $ | |
805 | - | let id = $ | |
806 | - | let caller = $ | |
807 | - | let date = $ | |
808 | - | let $ | |
809 | - | let payment = $ | |
810 | - | let amount = $ | |
800 | + | let $t03133331373 = idCallerDate(i) | |
801 | + | let id = $t03133331373._1 | |
802 | + | let caller = $t03133331373._2 | |
803 | + | let date = $t03133331373._3 | |
804 | + | let $t03137831414 = isPayment(i) | |
805 | + | let payment = $t03137831414._1 | |
806 | + | let amount = $t03137831414._2 | |
811 | 807 | let assetId = if (!(isDefined(payment.assetId))) | |
812 | 808 | then "WAVES" | |
813 | 809 | else toBase58String(value(payment.assetId)) | |
814 | 810 | let blockEnd = getIntegerByKey(keyEndSale(issuer, artId)) | |
815 | 811 | if (if ((blockEnd != 0)) | |
816 | 812 | then (height >= blockEnd) | |
817 | 813 | else false) | |
818 | 814 | then throw("Sale ended.") | |
819 | 815 | else { | |
820 | 816 | let bidNbr = getIntegerByKey(("current_bidamount_" + artId)) | |
821 | 817 | if (!(acceptedAssetIds(assetId))) | |
822 | 818 | then throw("asset not accepted") | |
823 | 819 | else if (!(validateMinSell(assetId, amount))) | |
824 | 820 | then throw("Wrong min sell") | |
825 | 821 | else { | |
826 | 822 | let amountSold = getIntegerByKey(keyIssued(issuer, artId)) | |
827 | 823 | let maxCanSell = getIntegerByKey(keyMaxMint(issuer, artId)) | |
828 | 824 | if ((0 >= maxCanSell)) | |
829 | 825 | then throw("No max edition set for this artwork") | |
830 | 826 | else if ((amountSold >= maxCanSell)) | |
831 | 827 | then throw("Sold out, you cannot bid") | |
832 | 828 | else [StringEntry((((((((("bid_" + artId) + "_") + issuer) + "_") + caller) + "_") + id) + "_OPEN"), ((((assetId + "_") + toString(amount)) + "_") + toString(date))), IntegerEntry(("current_bidamount_" + artId), (bidNbr + 1))] | |
833 | 829 | } | |
834 | 830 | } | |
835 | 831 | } | |
836 | 832 | ||
837 | 833 | ||
838 | 834 | ||
839 | 835 | @Callable(i) | |
840 | 836 | func acceptBid (artId,issuer,bidId,bidOwner,pubKey) = { | |
841 | - | let $ | |
842 | - | let id = $ | |
843 | - | let caller1 = $ | |
844 | - | let date = $ | |
845 | - | let isSponsored = $ | |
837 | + | let $t03263432705 = idCallerDateSponsored(i, pubKey) | |
838 | + | let id = $t03263432705._1 | |
839 | + | let caller1 = $t03263432705._2 | |
840 | + | let date = $t03263432705._3 | |
841 | + | let isSponsored = $t03263432705._4 | |
846 | 842 | if ((caller1 != issuer)) | |
847 | 843 | then throw("You cannot do this action") | |
848 | 844 | else buyMint(i, artId, issuer, bidId, bidOwner, pubKey) | |
849 | 845 | } | |
850 | 846 | ||
851 | 847 | ||
852 | 848 | ||
853 | 849 | @Callable(i) | |
854 | 850 | func cancelBid (artId,issuer,bidId,bidOwner) = { | |
855 | - | let $ | |
856 | - | let id = $ | |
857 | - | let caller = $ | |
858 | - | let date = $ | |
851 | + | let $t03294033001 = idCallerDate(i) | |
852 | + | let id = $t03294033001._1 | |
853 | + | let caller = $t03294033001._2 | |
854 | + | let date = $t03294033001._3 | |
859 | 855 | if (if ((caller != bidOwner)) | |
860 | 856 | then (caller != issuer) | |
861 | 857 | else false) | |
862 | 858 | then throw("You cannot do this action") | |
863 | 859 | else { | |
864 | 860 | let returnMoneyTo = if ((caller == issuer)) | |
865 | 861 | then bidOwner | |
866 | 862 | else caller | |
867 | 863 | let bidNbr = getIntegerByKey(("current_bidamount_" + artId)) | |
868 | 864 | let bidDataKey = ((((((("bid_" + artId) + "_") + issuer) + "_") + bidOwner) + "_") + bidId) | |
869 | 865 | let bidData = getStringByKey((bidDataKey + "_OPEN")) | |
870 | 866 | if ((bidData == "")) | |
871 | 867 | then throw("Bid not found") | |
872 | 868 | else { | |
873 | 869 | let bidDataArr = split(bidData, "_") | |
874 | 870 | let assetId = getBidAssetId(bidDataArr[0]) | |
875 | 871 | let bidStatus = "CANCELED" | |
876 | 872 | [DeleteEntry((bidDataKey + "_OPEN")), StringEntry(((bidDataKey + "_") + bidStatus), ((bidData + "_") + toString(date))), IntegerEntry(("current_bidamount_" + artId), (bidNbr - 1)), ScriptTransfer(Address(fromBase58String(returnMoneyTo)), parseIntValue(bidDataArr[1]), assetId)] | |
877 | 873 | } | |
878 | 874 | } | |
879 | 875 | } | |
880 | 876 | ||
881 | 877 | ||
882 | 878 | @Verifier(tx) | |
883 | 879 | func verifier () = match tx { | |
884 | 880 | case inv: InvokeScriptTransaction => | |
885 | 881 | if (if (if (if ((inv.function == "addArtwork")) | |
886 | 882 | then (inv.dApp == this) | |
887 | 883 | else false) | |
888 | 884 | then (inv.fee == 500000) | |
889 | 885 | else false) | |
890 | 886 | then (inv.feeAssetId == unit) | |
891 | 887 | else false) | |
892 | 888 | then sigVerify(tx.bodyBytes, tx.proofs[0], fromBase58String(asString(inv.args[13]))) | |
893 | 889 | else if (if (if (if ((inv.function == "updateArtwork")) | |
894 | 890 | then (inv.dApp == this) | |
895 | 891 | else false) | |
896 | 892 | then (inv.fee == 500000) | |
897 | 893 | else false) | |
898 | 894 | then (inv.feeAssetId == unit) | |
899 | 895 | else false) | |
900 | 896 | then sigVerify(tx.bodyBytes, tx.proofs[0], fromBase58String(asString(inv.args[12]))) | |
901 | 897 | else if (if (if (if ((inv.function == "sellArtwork")) | |
902 | 898 | then (inv.dApp == this) | |
903 | 899 | else false) | |
904 | 900 | then (inv.fee == 500000) | |
905 | 901 | else false) | |
906 | 902 | then (inv.feeAssetId == unit) | |
907 | 903 | else false) | |
908 | 904 | then sigVerify(tx.bodyBytes, tx.proofs[0], fromBase58String(asString(inv.args[5]))) | |
909 | 905 | else if (if (if (if ((inv.function == "acceptBid")) | |
910 | 906 | then (inv.dApp == this) | |
911 | 907 | else false) | |
912 | 908 | then (inv.fee == 500000) | |
913 | 909 | else false) | |
914 | 910 | then (inv.feeAssetId == unit) | |
915 | 911 | else false) | |
916 | 912 | then sigVerify_128Kb(tx.bodyBytes, tx.proofs[0], fromBase58String(asString(inv.args[4]))) | |
917 | 913 | else sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
918 | 914 | case _ => | |
919 | 915 | sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
920 | 916 | } | |
921 | 917 |
github/deemru/w8io/026f985 134.16 ms ◑