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