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