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