tx · DCujGG8XkELWk45tzZvPEXb6WPJzW7wSvdoRVRfQGN5V 3N2eA4yzXa4wTj7pP8r6G144RRxZW7cmq4p: -0.01400000 Waves 2021.06.28 12:43 [1590068] smart account 3N2eA4yzXa4wTj7pP8r6G144RRxZW7cmq4p > SELF 0.00000000 Waves
{ "type": 13, "id": "DCujGG8XkELWk45tzZvPEXb6WPJzW7wSvdoRVRfQGN5V", "fee": 1400000, "feeAssetId": null, "timestamp": 1624873455609, "version": 2, "chainId": 84, "sender": "3N2eA4yzXa4wTj7pP8r6G144RRxZW7cmq4p", "senderPublicKey": "Hh3eFP2XFetZSfTxQiM1Ps96f68zi8Zh5ghhCZdjgdFs", "proofs": [ "3FERpsJhdW8z11sHcysYG7tTJXLehxZZvmF3MQX6knbx5xx3bDmdRauxn2HeGb4H1nyFmW8Qbkc6oDJ2AGvtAy8V" ], "script": "base64:AAIEAAAAAAAAAB8IAhIECgIECBIECgIBCBIFCgMIAQgSAwoBCBIDCgEIAAAAMgAAAAAIdW5pdFRlc3QHAAAAAAlvcmFjbGVGZWUJAQAAAAV2YWx1ZQAAAAEJAAQmAAAAAQIAAAAjM04yczVSdGFIUEJlbkNzeDJFQ2NvRlJiWUh4M25vWmhYVzEAAAAACHNpZ25EYXBwCQEAAAAFdmFsdWUAAAABCQAEJgAAAAECAAAAIzNOQzI4aFNpdnJtc1RVWGFZRDF4NkwzNjJKNFpwVW5vVGRCAAAAAAxhcnR3b3Jrc0RhcHAJAQAAAAV2YWx1ZQAAAAEJAAQmAAAAAQIAAAAjM05CeW5mYlhDMkthc3RVeGh1a2NNVWFFNThLOWNCZEI5VVkAAAAAC2ZlZVJlY2VpdmVyAgAAACMzTjFFNnRYZGRSb1ZhUmZROWRRM3ZnNUxhVzJmc2Q4SEt1YgAAAAAIdXNlckRhcHADBQAAAAh1bml0VGVzdAkBAAAABXZhbHVlAAAAAQkABCYAAAABAgAAACMzTXQ0UkdNRXlqU1dZQW9jVFBxZDU1d2RIUVFCM1BVMl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lYXRvckZlZQgFAAAADSR0MDEzNzQ4MTM4NzYAAAACXzIEAAAACG93bmVyRmVlCAUAAAANJHQwMTM3NDgxMzg3NgAAAAJfMwQAAAAMY29sbGVjdG9yTkZUCAUAAAANJHQwMTM3NDgxMzg3NgAAAAJfNAkABEwAAAACCQEAAAALRGVsZXRlRW50cnkAAAABCQABLAAAAAIFAAAAB3NhbGVLZXkCAAAABV9PUEVOCQAETAAAAAIJAQAAAAtEZWxldGVFbnRyeQAAAAEJAAEsAAAAAgkAASwAAAACCQABLAAAAAICAAAAD3NhbGUybmRfc3RhdHVzXwUAAAAJc2FsZU93bmVyAgAAAAFfBQAAAAVuZnRJZAkABEwAAAACCQEAAAALRGVsZXRlRW50cnkAAAABCQABLAAAAAICAAAAFmN1cnJlbnRfb3duZXJfb25fZGFwcF8FAAAABW5mdElkCQAETAAAAAIJAQAAAAtTdHJpbmdFbnRyeQAAAAIJAAEsAAAAAgkAASwAAAACCQABLAAAAAIFAAAAB3NhbGVLZXkCAAAAAV8FAAAAAmlkAgAAAAdfQ0xPU0VECQABLAAAAAIJAAEsAAAAAgkAASwAAAACCQABLAAAAAIJAAEsAAAAAgkAASwAAAACBQAAAAhzYWxlSW5mbwIAAAAIX0NMT1NFRF8JAAGkAAAAAQUAAAAEZGF0ZQIAAAABXwUAAAACaWQCAAAAAV8FAAAABmNhbGxlcgkABEwAAAACCQEAAAAOdXBkYXRlTnVtU2FsZXMAAAAACQAETAAAAAIFAAAAB3NpZ25GZWUJAARMAAAAAgUAAAAKY3JlYXRvckZlZQkABEwAAAACBQAAAAhvd25lckZlZQkABEwAAAACBQAAAAxjb2xsZWN0b3JORlQFAAAAA25pbAAAAADR2fa5", "height": 1590068, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: CNJgPTSDRkBuNZPkNSPHFKyqoXD3MAtcXetXpeurLSfm Next: BYfHbe3ZnUDTCmJvdv1kjEf2dB7skXZi4q3KRrm9kBMV Diff:
Old | New | Differences | |
---|---|---|---|
29 | 29 | ||
30 | 30 | let creatorCut = 10 | |
31 | 31 | ||
32 | - | let dappRunning = valueOrElse(getBoolean(userDapp, "conf_dapp_is_running"), true) | |
33 | - | ||
34 | - | let maintenanceMSG = valueOrElse(getString(userDapp, "conf_maintenance_msg"), "") | |
35 | - | ||
36 | 32 | let userSuspended = "SUSPENDED" | |
37 | 33 | ||
38 | 34 | let userRemoved = "REMOVED" | |
40 | 36 | let artIllegal = "ILLEGAL" | |
41 | 37 | ||
42 | 38 | let artSuspended = "SUSPENDED" | |
39 | + | ||
40 | + | let dappRunningKey = "conf_dapp_is_running" | |
41 | + | ||
42 | + | let maintenanceMSGKey = "conf_maintenance_msg" | |
43 | + | ||
44 | + | let dappRunning = valueOrElse(getBoolean(this, dappRunningKey), true) | |
45 | + | ||
46 | + | let maintenanceMSG = valueOrElse(getString(this, maintenanceMSGKey), "") | |
47 | + | ||
48 | + | let numSalesK = "num_sales" | |
43 | 49 | ||
44 | 50 | func getUserStrByK (key) = valueOrElse(getString(userDapp, key), "Error") | |
45 | 51 | ||
87 | 93 | } | |
88 | 94 | ||
89 | 95 | ||
96 | + | func assetIsValid (assetDetails) = if (if (if ((assetDetails.quantity == 1)) | |
97 | + | then (assetDetails.decimals == 0) | |
98 | + | else false) | |
99 | + | then (assetDetails.reissuable == false) | |
100 | + | else false) | |
101 | + | then (assetDetails.issuer == artworksDapp) | |
102 | + | else false | |
103 | + | ||
104 | + | ||
90 | 105 | func isSignArtNFT (id) = { | |
91 | 106 | let assetDetails = value(assetInfo(id)) | |
92 | - | if (if (if (if ((assetDetails.quantity != 1)) | |
93 | - | then true | |
94 | - | else (assetDetails.decimals != 0)) | |
95 | - | then true | |
96 | - | else (assetDetails.reissuable != false)) | |
97 | - | then true | |
98 | - | else (assetDetails.issuer != artworksDapp)) | |
99 | - | then false | |
100 | - | else true | |
107 | + | assetIsValid(assetDetails) | |
101 | 108 | } | |
102 | 109 | ||
103 | 110 | ||
110 | 117 | else false) | |
111 | 118 | then false | |
112 | 119 | else true | |
120 | + | ||
121 | + | ||
122 | + | func getBidAssetId (assetId) = if ((assetId == "WAVES")) | |
123 | + | then unit | |
124 | + | else fromBase58String(assetId) | |
113 | 125 | ||
114 | 126 | ||
115 | 127 | func getSaleOwnerAndStatus (nftid) = { | |
125 | 137 | } | |
126 | 138 | ||
127 | 139 | ||
140 | + | func getBidData (key) = { | |
141 | + | let bidData = getStrByK((key + "_OPEN")) | |
142 | + | if ((bidData == "")) | |
143 | + | then throw("Offer not found") | |
144 | + | else { | |
145 | + | let bidDataArr = split(bidData, "_") | |
146 | + | let assetId = getBidAssetId(bidDataArr[2]) | |
147 | + | $Tuple3(bidDataArr, assetId, bidData) | |
148 | + | } | |
149 | + | } | |
150 | + | ||
151 | + | ||
152 | + | func artIsValid (artStatus) = if ((artStatus != artIllegal)) | |
153 | + | then (artStatus != artSuspended) | |
154 | + | else false | |
155 | + | ||
156 | + | ||
128 | 157 | func checkArtStatus (addr,id) = { | |
129 | 158 | let artStatus = getArtStrByK(keyFlag(addr, id)) | |
130 | - | if ( | |
159 | + | if (artIsValid(artStatus)) | |
131 | 160 | then true | |
132 | - | else (artStatus == artSuspended)) | |
133 | - | then throw(("Original Artwork flagged as " + artStatus)) | |
134 | - | else true | |
161 | + | else throw(("Original Artwork flagged as " + artStatus)) | |
135 | 162 | } | |
136 | 163 | ||
137 | 164 | ||
210 | 237 | } | |
211 | 238 | ||
212 | 239 | ||
240 | + | func provideBaseData (i,nftId) = { | |
241 | + | let $t083128351 = idCallerDate(i) | |
242 | + | let id = $t083128351._1 | |
243 | + | let caller = $t083128351._2 | |
244 | + | let date = $t083128351._3 | |
245 | + | let $t083548423 = checkNFTInfo(nftId) | |
246 | + | let isValidNFT = $t083548423._1 | |
247 | + | let artId = $t083548423._2 | |
248 | + | let creatorAddr = $t083548423._3 | |
249 | + | let artSignID = $t083548423._4 | |
250 | + | $Tuple7(id, caller, date, isValidNFT, artId, creatorAddr, artSignID) | |
251 | + | } | |
252 | + | ||
253 | + | ||
254 | + | func updateNumSales () = { | |
255 | + | let numSales = getIntByK(numSalesK) | |
256 | + | IntegerEntry(numSalesK, (numSales + 1)) | |
257 | + | } | |
258 | + | ||
259 | + | ||
260 | + | @Callable(invoke) | |
261 | + | func appRunning (isLive,message) = { | |
262 | + | let caller = toString(addressFromPublicKey(invoke.callerPublicKey)) | |
263 | + | let id = toBase58String(invoke.transactionId) | |
264 | + | if (containsElement([chris, toString(this)], caller)) | |
265 | + | then [BooleanEntry(dappRunningKey, isLive), StringEntry(maintenanceMSGKey, message)] | |
266 | + | else throw("You are not allowed to change this") | |
267 | + | } | |
268 | + | ||
269 | + | ||
270 | + | ||
213 | 271 | @Callable(i) | |
214 | 272 | func sellNFT (price,asset) = { | |
215 | - | let $t077167755 = idCallerDate(i) | |
216 | - | let id = $t077167755._1 | |
217 | - | let caller = $t077167755._2 | |
218 | - | let date = $t077167755._3 | |
219 | - | let $t077617797 = isPayment(i) | |
220 | - | let payment = $t077617797._1 | |
221 | - | let amount = $t077617797._2 | |
273 | + | let $t091379173 = isPayment(i) | |
274 | + | let payment = $t091379173._1 | |
275 | + | let amount = $t091379173._2 | |
222 | 276 | let nftId = if (if (isDefined(payment.assetId)) | |
223 | 277 | then isSignArtNFT(value(payment.assetId)) | |
224 | 278 | else false) | |
225 | 279 | then toBase58String(value(payment.assetId)) | |
226 | 280 | else throw("Only SIGN Art NFT accepted.") | |
227 | - | let $t079768045 = checkNFTInfo(nftId) | |
228 | - | let isValidNFT = $t079768045._1 | |
229 | - | let artId = $t079768045._2 | |
230 | - | let creatorAddr = $t079768045._3 | |
231 | - | let artSignID = $t079768045._4 | |
281 | + | let $t093529444 = provideBaseData(i, nftId) | |
282 | + | let id = $t093529444._1 | |
283 | + | let caller = $t093529444._2 | |
284 | + | let date = $t093529444._3 | |
285 | + | let isValidNFT = $t093529444._4 | |
286 | + | let artId = $t093529444._5 | |
287 | + | let creatorAddr = $t093529444._6 | |
288 | + | let artSignID = $t093529444._7 | |
232 | 289 | if ((size(artSignID) == 0)) | |
233 | 290 | then throw("Artwork not found on SIGN Art") | |
234 | 291 | else if (!(isValidNFT)) | |
235 | - | then throw(" | |
292 | + | then throw("Not a valid nft") | |
236 | 293 | else if (!(acceptedAssetIds(asset))) | |
237 | 294 | then throw("Only SIGN, USDN or WAVES accepted") | |
238 | 295 | else if ((price == 0)) | |
246 | 303 | ||
247 | 304 | @Callable(i) | |
248 | 305 | func updateSalePrice (nftId,price,asset) = { | |
249 | - | let $t089218960 = idCallerDate(i) | |
250 | - | let id = $t089218960._1 | |
251 | - | let caller = $t089218960._2 | |
252 | - | let date = $t089218960._3 | |
253 | - | let $t089669035 = checkNFTInfo(nftId) | |
254 | - | let isValidNFT = $t089669035._1 | |
255 | - | let artId = $t089669035._2 | |
256 | - | let creatorAddr = $t089669035._3 | |
257 | - | let artSignID = $t089669035._4 | |
306 | + | let $t01031710409 = provideBaseData(i, nftId) | |
307 | + | let id = $t01031710409._1 | |
308 | + | let caller = $t01031710409._2 | |
309 | + | let date = $t01031710409._3 | |
310 | + | let isValidNFT = $t01031710409._4 | |
311 | + | let artId = $t01031710409._5 | |
312 | + | let creatorAddr = $t01031710409._6 | |
313 | + | let artSignID = $t01031710409._7 | |
258 | 314 | if ((size(artSignID) == 0)) | |
259 | 315 | then throw("Artwork not found on SIGN Art, cancel your sale.") | |
260 | 316 | else if (!(isValidNFT)) | |
261 | - | then throw(" | |
317 | + | then throw("Not a valid nft") | |
262 | 318 | else { | |
263 | 319 | let saleOwner = getStrByK(("current_owner_on_dapp_" + nftId)) | |
264 | 320 | if ((saleOwner != caller)) | |
286 | 342 | ||
287 | 343 | @Callable(i) | |
288 | 344 | func cancelSale (nftId) = { | |
289 | - | let $t01017410213 = idCallerDate(i) | |
290 | - | let id = $t01017410213._1 | |
291 | - | let caller = $t01017410213._2 | |
292 | - | let date = $t01017410213._3 | |
293 | - | let $t01021910441 = checkNFTInfo(nftId) | |
294 | - | let isValidNFT = $t01021910441._1 | |
295 | - | let artId = $t01021910441._2 | |
296 | - | let creatorAddr = $t01021910441._3 | |
297 | - | let artSignID = $t01021910441._4 | |
345 | + | let $t01154911789 = provideBaseData(i, nftId) | |
346 | + | let id = $t01154911789._1 | |
347 | + | let caller = $t01154911789._2 | |
348 | + | let date = $t01154911789._3 | |
349 | + | let isValidNFT = $t01154911789._4 | |
350 | + | let artId = $t01154911789._5 | |
351 | + | let creatorAddr = $t01154911789._6 | |
352 | + | let artSignID = $t01154911789._7 | |
298 | 353 | let saleOwner = getStrByK(("current_owner_on_dapp_" + nftId)) | |
299 | 354 | if ((saleOwner != caller)) | |
300 | 355 | then throw("You don't own this NFT") | |
314 | 369 | ||
315 | 370 | @Callable(i) | |
316 | 371 | func buyNFT (nftId) = { | |
317 | - | let $t01127211311 = idCallerDate(i) | |
318 | - | let id = $t01127211311._1 | |
319 | - | let caller = $t01127211311._2 | |
320 | - | let date = $t01127211311._3 | |
321 | - | let saleOwner = getSaleOwnerAndStatus(nftId) | |
322 | - | let $t01136511434 = checkNFTInfo(nftId) | |
323 | - | let isValidNFT = $t01136511434._1 | |
324 | - | let artId = $t01136511434._2 | |
325 | - | let creatorAddr = $t01136511434._3 | |
326 | - | let artSignID = $t01136511434._4 | |
372 | + | let $t01262012712 = provideBaseData(i, nftId) | |
373 | + | let id = $t01262012712._1 | |
374 | + | let caller = $t01262012712._2 | |
375 | + | let date = $t01262012712._3 | |
376 | + | let isValidNFT = $t01262012712._4 | |
377 | + | let artId = $t01262012712._5 | |
378 | + | let creatorAddr = $t01262012712._6 | |
379 | + | let artSignID = $t01262012712._7 | |
327 | 380 | if ((size(artSignID) == 0)) | |
328 | 381 | then throw("Artwork not found on SIGN Art, cancel your sale.") | |
329 | 382 | else if (!(isValidNFT)) | |
330 | - | then throw(" | |
383 | + | then throw("Not a valid nft") | |
331 | 384 | else { | |
385 | + | let saleOwner = getSaleOwnerAndStatus(nftId) | |
332 | 386 | let saleKey = getSaleKey(saleOwner, nftId, artId, creatorAddr) | |
333 | 387 | let saleInfo = getStrByK((saleKey + "_OPEN")) | |
334 | 388 | if ((size(saleInfo) == 0)) | |
338 | 392 | if ((parseInt(saleInfoArray[1]) == 0)) | |
339 | 393 | then throw("Offer only") | |
340 | 394 | else { | |
341 | - | let $ | |
342 | - | let payment = $ | |
343 | - | let amount = $ | |
395 | + | let $t01320913245 = isPayment(i) | |
396 | + | let payment = $t01320913245._1 | |
397 | + | let amount = $t01320913245._2 | |
344 | 398 | let paymentAssetStr = if (isDefined(payment.assetId)) | |
345 | 399 | then toBase58String(value(payment.assetId)) | |
346 | 400 | else "" | |
352 | 406 | let amountForSign = fraction(amount, signCut, 100) | |
353 | 407 | let amountForCreator = fraction(amount, creatorCut, 100) | |
354 | 408 | let amountForOwner = (amount - (amountForSign + amountForCreator)) | |
355 | - | let $ | |
356 | - | let signFee = $ | |
357 | - | let creatorFee = $ | |
358 | - | let ownerFee = $ | |
359 | - | let collectorNFT = $ | |
360 | - | [DeleteEntry((saleKey + "_OPEN")), DeleteEntry(((("sale2nd_status_" + saleOwner) + "_") + nftId)), DeleteEntry(("current_owner_on_dapp_" + nftId)), StringEntry((((saleKey + "_") + id) + "_CLOSED"), (((((( | |
409 | + | let $t01374813876 = setTransfers(amount, payment.assetId, nftId, creatorAddr, saleOwner, caller) | |
410 | + | let signFee = $t01374813876._1 | |
411 | + | let creatorFee = $t01374813876._2 | |
412 | + | let ownerFee = $t01374813876._3 | |
413 | + | let collectorNFT = $t01374813876._4 | |
414 | + | [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(), signFee, creatorFee, ownerFee, collectorNFT] | |
361 | 415 | } | |
362 | 416 | } | |
363 | 417 | } |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 4 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let unitTest = false | |
5 | 5 | ||
6 | 6 | let oracleFee = value(addressFromString("3N2s5RtaHPBenCsx2ECcoFRbYHx3noZhXW1")) | |
7 | 7 | ||
8 | 8 | let signDapp = value(addressFromString("3NC28hSivrmsTUXaYD1x6L362J4ZpUnoTdB")) | |
9 | 9 | ||
10 | 10 | let artworksDapp = value(addressFromString("3NBynfbXC2KastUxhukcMUaE58K9cBdB9UY")) | |
11 | 11 | ||
12 | 12 | let feeReceiver = "3N1E6tXddRoVaRfQ9dQ3vg5LaW2fsd8HKub" | |
13 | 13 | ||
14 | 14 | let userDapp = if (unitTest) | |
15 | 15 | then value(addressFromString("3Mt4RGMEyjSWYAocTPqd55wdHQQB3PU2UCm")) | |
16 | 16 | else value(addressFromString("3N8xXaYjE27Aa79d5hHrhHu9HaFoTBmhDEj")) | |
17 | 17 | ||
18 | 18 | let whitelistDapp = value(addressFromString("3N6BaV1dCB4zg43goNNHaCtvR13BcyJ5Gsq")) | |
19 | 19 | ||
20 | 20 | let signAssetId = base58'Gf9t8FA4H3ssoZPCwrg3KwUFCci8zuUFP9ssRsUY3s6a' | |
21 | 21 | ||
22 | 22 | let usdnAssetId = base58'25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT' | |
23 | 23 | ||
24 | 24 | let wavesAssetId = base58'' | |
25 | 25 | ||
26 | 26 | let chris = "3MsG6jPNCrVJUtYB7XJBxS7utWsXAf4n9Vp" | |
27 | 27 | ||
28 | 28 | let signCut = 3 | |
29 | 29 | ||
30 | 30 | let creatorCut = 10 | |
31 | 31 | ||
32 | - | let dappRunning = valueOrElse(getBoolean(userDapp, "conf_dapp_is_running"), true) | |
33 | - | ||
34 | - | let maintenanceMSG = valueOrElse(getString(userDapp, "conf_maintenance_msg"), "") | |
35 | - | ||
36 | 32 | let userSuspended = "SUSPENDED" | |
37 | 33 | ||
38 | 34 | let userRemoved = "REMOVED" | |
39 | 35 | ||
40 | 36 | let artIllegal = "ILLEGAL" | |
41 | 37 | ||
42 | 38 | let artSuspended = "SUSPENDED" | |
39 | + | ||
40 | + | let dappRunningKey = "conf_dapp_is_running" | |
41 | + | ||
42 | + | let maintenanceMSGKey = "conf_maintenance_msg" | |
43 | + | ||
44 | + | let dappRunning = valueOrElse(getBoolean(this, dappRunningKey), true) | |
45 | + | ||
46 | + | let maintenanceMSG = valueOrElse(getString(this, maintenanceMSGKey), "") | |
47 | + | ||
48 | + | let numSalesK = "num_sales" | |
43 | 49 | ||
44 | 50 | func getUserStrByK (key) = valueOrElse(getString(userDapp, key), "Error") | |
45 | 51 | ||
46 | 52 | ||
47 | 53 | func getArtStrByK (key) = valueOrElse(getString(artworksDapp, key), "") | |
48 | 54 | ||
49 | 55 | ||
50 | 56 | func getStrByK (key) = valueOrElse(getString(this, key), "") | |
51 | 57 | ||
52 | 58 | ||
53 | 59 | func getIntByK (key) = valueOrElse(getInteger(this, key), 0) | |
54 | 60 | ||
55 | 61 | ||
56 | 62 | func keyUserStatus (addr) = ("user_status_" + addr) | |
57 | 63 | ||
58 | 64 | ||
59 | 65 | func keySignID (artistAddr,artId) = ((("art_signid_" + artId) + "_") + artistAddr) | |
60 | 66 | ||
61 | 67 | ||
62 | 68 | func keyFlag (artistAddr,artId) = ((("art_flag_" + artId) + "_") + artistAddr) | |
63 | 69 | ||
64 | 70 | ||
65 | 71 | func keyNFTData (id) = ("nft_" + id) | |
66 | 72 | ||
67 | 73 | ||
68 | 74 | func getSaleKey (caller,nftId,artId,creatorAddr) = ((((((("sale2nd_info_" + caller) + "_") + nftId) + "_") + artId) + "_") + creatorAddr) | |
69 | 75 | ||
70 | 76 | ||
71 | 77 | func getIntByKFromOracle (key) = valueOrErrorMessage(getInteger(oracleFee, key), "Integer undefine or 0 in oracle") | |
72 | 78 | ||
73 | 79 | ||
74 | 80 | let currentCertificationPrice = getIntByKFromOracle(("certification_fee_" + toBase58String(signAssetId))) | |
75 | 81 | ||
76 | 82 | func idCallerDate (i) = if (!(dappRunning)) | |
77 | 83 | then throw(maintenanceMSG) | |
78 | 84 | else $Tuple3(toBase58String(i.transactionId), toBase58String(i.caller.bytes), lastBlock.timestamp) | |
79 | 85 | ||
80 | 86 | ||
81 | 87 | func isPayment (i) = if ((size(i.payments) == 0)) | |
82 | 88 | then throw("No payment attached") | |
83 | 89 | else { | |
84 | 90 | let payment = value(i.payments[0]) | |
85 | 91 | let amount = value(payment.amount) | |
86 | 92 | $Tuple2(payment, amount) | |
87 | 93 | } | |
88 | 94 | ||
89 | 95 | ||
96 | + | func assetIsValid (assetDetails) = if (if (if ((assetDetails.quantity == 1)) | |
97 | + | then (assetDetails.decimals == 0) | |
98 | + | else false) | |
99 | + | then (assetDetails.reissuable == false) | |
100 | + | else false) | |
101 | + | then (assetDetails.issuer == artworksDapp) | |
102 | + | else false | |
103 | + | ||
104 | + | ||
90 | 105 | func isSignArtNFT (id) = { | |
91 | 106 | let assetDetails = value(assetInfo(id)) | |
92 | - | if (if (if (if ((assetDetails.quantity != 1)) | |
93 | - | then true | |
94 | - | else (assetDetails.decimals != 0)) | |
95 | - | then true | |
96 | - | else (assetDetails.reissuable != false)) | |
97 | - | then true | |
98 | - | else (assetDetails.issuer != artworksDapp)) | |
99 | - | then false | |
100 | - | else true | |
107 | + | assetIsValid(assetDetails) | |
101 | 108 | } | |
102 | 109 | ||
103 | 110 | ||
104 | 111 | func acceptedAssetIds (assetId) = if (if (if (if ((assetId != toBase58String(signAssetId))) | |
105 | 112 | then (assetId != toBase58String(wavesAssetId)) | |
106 | 113 | else false) | |
107 | 114 | then (assetId != "WAVES") | |
108 | 115 | else false) | |
109 | 116 | then (assetId != toBase58String(usdnAssetId)) | |
110 | 117 | else false) | |
111 | 118 | then false | |
112 | 119 | else true | |
120 | + | ||
121 | + | ||
122 | + | func getBidAssetId (assetId) = if ((assetId == "WAVES")) | |
123 | + | then unit | |
124 | + | else fromBase58String(assetId) | |
113 | 125 | ||
114 | 126 | ||
115 | 127 | func getSaleOwnerAndStatus (nftid) = { | |
116 | 128 | let saleOwner = getStrByK(("current_owner_on_dapp_" + nftid)) | |
117 | 129 | if ((size(saleOwner) == 0)) | |
118 | 130 | then throw("NFT not found") | |
119 | 131 | else { | |
120 | 132 | let saleStatus = getStrByK(((("sale2nd_status_" + saleOwner) + "_") + nftid)) | |
121 | 133 | if ((saleStatus != "OPEN")) | |
122 | 134 | then throw("NFT not for sale") | |
123 | 135 | else saleOwner | |
124 | 136 | } | |
125 | 137 | } | |
126 | 138 | ||
127 | 139 | ||
140 | + | func getBidData (key) = { | |
141 | + | let bidData = getStrByK((key + "_OPEN")) | |
142 | + | if ((bidData == "")) | |
143 | + | then throw("Offer not found") | |
144 | + | else { | |
145 | + | let bidDataArr = split(bidData, "_") | |
146 | + | let assetId = getBidAssetId(bidDataArr[2]) | |
147 | + | $Tuple3(bidDataArr, assetId, bidData) | |
148 | + | } | |
149 | + | } | |
150 | + | ||
151 | + | ||
152 | + | func artIsValid (artStatus) = if ((artStatus != artIllegal)) | |
153 | + | then (artStatus != artSuspended) | |
154 | + | else false | |
155 | + | ||
156 | + | ||
128 | 157 | func checkArtStatus (addr,id) = { | |
129 | 158 | let artStatus = getArtStrByK(keyFlag(addr, id)) | |
130 | - | if ( | |
159 | + | if (artIsValid(artStatus)) | |
131 | 160 | then true | |
132 | - | else (artStatus == artSuspended)) | |
133 | - | then throw(("Original Artwork flagged as " + artStatus)) | |
134 | - | else true | |
161 | + | else throw(("Original Artwork flagged as " + artStatus)) | |
135 | 162 | } | |
136 | 163 | ||
137 | 164 | ||
138 | 165 | func checkArtistStatus (addr) = { | |
139 | 166 | let artistStatus = getUserStrByK(keyUserStatus(addr)) | |
140 | 167 | if (containsElement([userSuspended, userRemoved], artistStatus)) | |
141 | 168 | then throw(("Original Artist " + artistStatus)) | |
142 | 169 | else true | |
143 | 170 | } | |
144 | 171 | ||
145 | 172 | ||
146 | 173 | func checkNFTInfo (assetId) = { | |
147 | 174 | let nftData = split(getArtStrByK(keyNFTData(assetId)), "_") | |
148 | 175 | let artSignID = getArtStrByK(keySignID(nftData[6], nftData[5])) | |
149 | 176 | if (if (!(checkArtStatus(nftData[6], nftData[5]))) | |
150 | 177 | then !(checkArtistStatus(nftData[6])) | |
151 | 178 | else false) | |
152 | 179 | then $Tuple4(false, nftData[5], nftData[6], artSignID) | |
153 | 180 | else $Tuple4(true, nftData[5], nftData[6], artSignID) | |
154 | 181 | } | |
155 | 182 | ||
156 | 183 | ||
157 | 184 | func checkARTExist (artId,creatorAddr) = { | |
158 | 185 | let artSignID = getArtStrByK(keySignID(creatorAddr, artId)) | |
159 | 186 | if ((size(artSignID) == 0)) | |
160 | 187 | then throw("Artwork not found on SIGN Art") | |
161 | 188 | else if (if (!(checkArtStatus(creatorAddr, artId))) | |
162 | 189 | then !(checkArtistStatus(creatorAddr)) | |
163 | 190 | else false) | |
164 | 191 | then false | |
165 | 192 | else true | |
166 | 193 | } | |
167 | 194 | ||
168 | 195 | ||
169 | 196 | func setTransfers (amount,assetId,nftid,creatorAddr,saleOwner,caller) = { | |
170 | 197 | let amountForSign = fraction(amount, signCut, 100) | |
171 | 198 | let amountForCreator = fraction(amount, creatorCut, 100) | |
172 | 199 | let amountForOwner = (amount - (amountForSign + amountForCreator)) | |
173 | 200 | let signFee = ScriptTransfer(Address(fromBase58String(feeReceiver)), amountForSign, assetId) | |
174 | 201 | let creatorFee = ScriptTransfer(Address(fromBase58String(creatorAddr)), amountForCreator, assetId) | |
175 | 202 | let ownerFee = ScriptTransfer(Address(fromBase58String(saleOwner)), amountForOwner, assetId) | |
176 | 203 | let collectorNFT = ScriptTransfer(Address(fromBase58String(caller)), 1, fromBase58String(nftid)) | |
177 | 204 | $Tuple4(signFee, creatorFee, ownerFee, collectorNFT) | |
178 | 205 | } | |
179 | 206 | ||
180 | 207 | ||
181 | 208 | func validateMinSell (assetId,price) = { | |
182 | 209 | let minSellWaves = if (unitTest) | |
183 | 210 | then 10 | |
184 | 211 | else getIntByKFromOracle("waves_min_sell") | |
185 | 212 | let minSellUsdn = 1000000 | |
186 | 213 | let minSellSign = if (unitTest) | |
187 | 214 | then 1 | |
188 | 215 | else (currentCertificationPrice * 2) | |
189 | 216 | if (if (if (if (if ((assetId == toBase58String(usdnAssetId))) | |
190 | 217 | then (minSellUsdn > price) | |
191 | 218 | else false) | |
192 | 219 | then (price != 0) | |
193 | 220 | else false) | |
194 | 221 | then true | |
195 | 222 | else if (if ((assetId == toBase58String(signAssetId))) | |
196 | 223 | then (minSellSign > price) | |
197 | 224 | else false) | |
198 | 225 | then (price != 0) | |
199 | 226 | else false) | |
200 | 227 | then true | |
201 | 228 | else if (if (if ((assetId == toBase58String(wavesAssetId))) | |
202 | 229 | then true | |
203 | 230 | else (assetId == "WAVES")) | |
204 | 231 | then (minSellWaves > price) | |
205 | 232 | else false) | |
206 | 233 | then (price != 0) | |
207 | 234 | else false) | |
208 | 235 | then false | |
209 | 236 | else true | |
210 | 237 | } | |
211 | 238 | ||
212 | 239 | ||
240 | + | func provideBaseData (i,nftId) = { | |
241 | + | let $t083128351 = idCallerDate(i) | |
242 | + | let id = $t083128351._1 | |
243 | + | let caller = $t083128351._2 | |
244 | + | let date = $t083128351._3 | |
245 | + | let $t083548423 = checkNFTInfo(nftId) | |
246 | + | let isValidNFT = $t083548423._1 | |
247 | + | let artId = $t083548423._2 | |
248 | + | let creatorAddr = $t083548423._3 | |
249 | + | let artSignID = $t083548423._4 | |
250 | + | $Tuple7(id, caller, date, isValidNFT, artId, creatorAddr, artSignID) | |
251 | + | } | |
252 | + | ||
253 | + | ||
254 | + | func updateNumSales () = { | |
255 | + | let numSales = getIntByK(numSalesK) | |
256 | + | IntegerEntry(numSalesK, (numSales + 1)) | |
257 | + | } | |
258 | + | ||
259 | + | ||
260 | + | @Callable(invoke) | |
261 | + | func appRunning (isLive,message) = { | |
262 | + | let caller = toString(addressFromPublicKey(invoke.callerPublicKey)) | |
263 | + | let id = toBase58String(invoke.transactionId) | |
264 | + | if (containsElement([chris, toString(this)], caller)) | |
265 | + | then [BooleanEntry(dappRunningKey, isLive), StringEntry(maintenanceMSGKey, message)] | |
266 | + | else throw("You are not allowed to change this") | |
267 | + | } | |
268 | + | ||
269 | + | ||
270 | + | ||
213 | 271 | @Callable(i) | |
214 | 272 | func sellNFT (price,asset) = { | |
215 | - | let $t077167755 = idCallerDate(i) | |
216 | - | let id = $t077167755._1 | |
217 | - | let caller = $t077167755._2 | |
218 | - | let date = $t077167755._3 | |
219 | - | let $t077617797 = isPayment(i) | |
220 | - | let payment = $t077617797._1 | |
221 | - | let amount = $t077617797._2 | |
273 | + | let $t091379173 = isPayment(i) | |
274 | + | let payment = $t091379173._1 | |
275 | + | let amount = $t091379173._2 | |
222 | 276 | let nftId = if (if (isDefined(payment.assetId)) | |
223 | 277 | then isSignArtNFT(value(payment.assetId)) | |
224 | 278 | else false) | |
225 | 279 | then toBase58String(value(payment.assetId)) | |
226 | 280 | else throw("Only SIGN Art NFT accepted.") | |
227 | - | let $t079768045 = checkNFTInfo(nftId) | |
228 | - | let isValidNFT = $t079768045._1 | |
229 | - | let artId = $t079768045._2 | |
230 | - | let creatorAddr = $t079768045._3 | |
231 | - | let artSignID = $t079768045._4 | |
281 | + | let $t093529444 = provideBaseData(i, nftId) | |
282 | + | let id = $t093529444._1 | |
283 | + | let caller = $t093529444._2 | |
284 | + | let date = $t093529444._3 | |
285 | + | let isValidNFT = $t093529444._4 | |
286 | + | let artId = $t093529444._5 | |
287 | + | let creatorAddr = $t093529444._6 | |
288 | + | let artSignID = $t093529444._7 | |
232 | 289 | if ((size(artSignID) == 0)) | |
233 | 290 | then throw("Artwork not found on SIGN Art") | |
234 | 291 | else if (!(isValidNFT)) | |
235 | - | then throw(" | |
292 | + | then throw("Not a valid nft") | |
236 | 293 | else if (!(acceptedAssetIds(asset))) | |
237 | 294 | then throw("Only SIGN, USDN or WAVES accepted") | |
238 | 295 | else if ((price == 0)) | |
239 | 296 | then throw("Wrong minimum sell price") | |
240 | 297 | else if (!(validateMinSell(asset, price))) | |
241 | 298 | then throw("Wrong minimum sell price") | |
242 | 299 | 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)] | |
243 | 300 | } | |
244 | 301 | ||
245 | 302 | ||
246 | 303 | ||
247 | 304 | @Callable(i) | |
248 | 305 | func updateSalePrice (nftId,price,asset) = { | |
249 | - | let $t089218960 = idCallerDate(i) | |
250 | - | let id = $t089218960._1 | |
251 | - | let caller = $t089218960._2 | |
252 | - | let date = $t089218960._3 | |
253 | - | let $t089669035 = checkNFTInfo(nftId) | |
254 | - | let isValidNFT = $t089669035._1 | |
255 | - | let artId = $t089669035._2 | |
256 | - | let creatorAddr = $t089669035._3 | |
257 | - | let artSignID = $t089669035._4 | |
306 | + | let $t01031710409 = provideBaseData(i, nftId) | |
307 | + | let id = $t01031710409._1 | |
308 | + | let caller = $t01031710409._2 | |
309 | + | let date = $t01031710409._3 | |
310 | + | let isValidNFT = $t01031710409._4 | |
311 | + | let artId = $t01031710409._5 | |
312 | + | let creatorAddr = $t01031710409._6 | |
313 | + | let artSignID = $t01031710409._7 | |
258 | 314 | if ((size(artSignID) == 0)) | |
259 | 315 | then throw("Artwork not found on SIGN Art, cancel your sale.") | |
260 | 316 | else if (!(isValidNFT)) | |
261 | - | then throw(" | |
317 | + | then throw("Not a valid nft") | |
262 | 318 | else { | |
263 | 319 | let saleOwner = getStrByK(("current_owner_on_dapp_" + nftId)) | |
264 | 320 | if ((saleOwner != caller)) | |
265 | 321 | then throw("You don't own this NFT") | |
266 | 322 | else { | |
267 | 323 | let saleStatus = getStrByK(((("sale2nd_status_" + caller) + "_") + nftId)) | |
268 | 324 | if ((saleStatus != "OPEN")) | |
269 | 325 | then throw("Sale not active") | |
270 | 326 | else if (!(acceptedAssetIds(asset))) | |
271 | 327 | then throw("Only SIGN, USDN or WAVES accepted") | |
272 | 328 | else if ((price == 0)) | |
273 | 329 | then throw("Wrong minimum sell price") | |
274 | 330 | else if (!(validateMinSell(asset, price))) | |
275 | 331 | then throw("Wrong minimum sell price") | |
276 | 332 | else { | |
277 | 333 | let saleKey = getSaleKey(caller, nftId, artId, creatorAddr) | |
278 | 334 | let saleInfo = split(getStrByK((saleKey + "_OPEN")), "_") | |
279 | 335 | [StringEntry((saleKey + "_OPEN"), ((((((((((((saleInfo[0] + "_") + toString(price)) + "_") + asset) + "_") + saleInfo[3]) + "_") + saleInfo[4]) + "_") + saleInfo[5]) + "_") + saleInfo[6]))] | |
280 | 336 | } | |
281 | 337 | } | |
282 | 338 | } | |
283 | 339 | } | |
284 | 340 | ||
285 | 341 | ||
286 | 342 | ||
287 | 343 | @Callable(i) | |
288 | 344 | func cancelSale (nftId) = { | |
289 | - | let $t01017410213 = idCallerDate(i) | |
290 | - | let id = $t01017410213._1 | |
291 | - | let caller = $t01017410213._2 | |
292 | - | let date = $t01017410213._3 | |
293 | - | let $t01021910441 = checkNFTInfo(nftId) | |
294 | - | let isValidNFT = $t01021910441._1 | |
295 | - | let artId = $t01021910441._2 | |
296 | - | let creatorAddr = $t01021910441._3 | |
297 | - | let artSignID = $t01021910441._4 | |
345 | + | let $t01154911789 = provideBaseData(i, nftId) | |
346 | + | let id = $t01154911789._1 | |
347 | + | let caller = $t01154911789._2 | |
348 | + | let date = $t01154911789._3 | |
349 | + | let isValidNFT = $t01154911789._4 | |
350 | + | let artId = $t01154911789._5 | |
351 | + | let creatorAddr = $t01154911789._6 | |
352 | + | let artSignID = $t01154911789._7 | |
298 | 353 | let saleOwner = getStrByK(("current_owner_on_dapp_" + nftId)) | |
299 | 354 | if ((saleOwner != caller)) | |
300 | 355 | then throw("You don't own this NFT") | |
301 | 356 | else { | |
302 | 357 | let saleStatus = getStrByK(((("sale2nd_status_" + caller) + "_") + nftId)) | |
303 | 358 | if ((saleStatus != "OPEN")) | |
304 | 359 | then throw("Sale not active") | |
305 | 360 | else { | |
306 | 361 | let saleKey = getSaleKey(caller, nftId, artId, creatorAddr) | |
307 | 362 | let saleInfo = getStrByK((saleKey + "_OPEN")) | |
308 | 363 | [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))] | |
309 | 364 | } | |
310 | 365 | } | |
311 | 366 | } | |
312 | 367 | ||
313 | 368 | ||
314 | 369 | ||
315 | 370 | @Callable(i) | |
316 | 371 | func buyNFT (nftId) = { | |
317 | - | let $t01127211311 = idCallerDate(i) | |
318 | - | let id = $t01127211311._1 | |
319 | - | let caller = $t01127211311._2 | |
320 | - | let date = $t01127211311._3 | |
321 | - | let saleOwner = getSaleOwnerAndStatus(nftId) | |
322 | - | let $t01136511434 = checkNFTInfo(nftId) | |
323 | - | let isValidNFT = $t01136511434._1 | |
324 | - | let artId = $t01136511434._2 | |
325 | - | let creatorAddr = $t01136511434._3 | |
326 | - | let artSignID = $t01136511434._4 | |
372 | + | let $t01262012712 = provideBaseData(i, nftId) | |
373 | + | let id = $t01262012712._1 | |
374 | + | let caller = $t01262012712._2 | |
375 | + | let date = $t01262012712._3 | |
376 | + | let isValidNFT = $t01262012712._4 | |
377 | + | let artId = $t01262012712._5 | |
378 | + | let creatorAddr = $t01262012712._6 | |
379 | + | let artSignID = $t01262012712._7 | |
327 | 380 | if ((size(artSignID) == 0)) | |
328 | 381 | then throw("Artwork not found on SIGN Art, cancel your sale.") | |
329 | 382 | else if (!(isValidNFT)) | |
330 | - | then throw(" | |
383 | + | then throw("Not a valid nft") | |
331 | 384 | else { | |
385 | + | let saleOwner = getSaleOwnerAndStatus(nftId) | |
332 | 386 | let saleKey = getSaleKey(saleOwner, nftId, artId, creatorAddr) | |
333 | 387 | let saleInfo = getStrByK((saleKey + "_OPEN")) | |
334 | 388 | if ((size(saleInfo) == 0)) | |
335 | 389 | then throw("Sale Not found!") | |
336 | 390 | else { | |
337 | 391 | let saleInfoArray = split(saleInfo, "_") | |
338 | 392 | if ((parseInt(saleInfoArray[1]) == 0)) | |
339 | 393 | then throw("Offer only") | |
340 | 394 | else { | |
341 | - | let $ | |
342 | - | let payment = $ | |
343 | - | let amount = $ | |
395 | + | let $t01320913245 = isPayment(i) | |
396 | + | let payment = $t01320913245._1 | |
397 | + | let amount = $t01320913245._2 | |
344 | 398 | let paymentAssetStr = if (isDefined(payment.assetId)) | |
345 | 399 | then toBase58String(value(payment.assetId)) | |
346 | 400 | else "" | |
347 | 401 | if (if ((saleInfoArray[1] != toString(amount))) | |
348 | 402 | then true | |
349 | 403 | else (saleInfoArray[2] != paymentAssetStr)) | |
350 | 404 | then throw("Payment infos don't match.") | |
351 | 405 | else { | |
352 | 406 | let amountForSign = fraction(amount, signCut, 100) | |
353 | 407 | let amountForCreator = fraction(amount, creatorCut, 100) | |
354 | 408 | let amountForOwner = (amount - (amountForSign + amountForCreator)) | |
355 | - | let $ | |
356 | - | let signFee = $ | |
357 | - | let creatorFee = $ | |
358 | - | let ownerFee = $ | |
359 | - | let collectorNFT = $ | |
360 | - | [DeleteEntry((saleKey + "_OPEN")), DeleteEntry(((("sale2nd_status_" + saleOwner) + "_") + nftId)), DeleteEntry(("current_owner_on_dapp_" + nftId)), StringEntry((((saleKey + "_") + id) + "_CLOSED"), (((((( | |
409 | + | let $t01374813876 = setTransfers(amount, payment.assetId, nftId, creatorAddr, saleOwner, caller) | |
410 | + | let signFee = $t01374813876._1 | |
411 | + | let creatorFee = $t01374813876._2 | |
412 | + | let ownerFee = $t01374813876._3 | |
413 | + | let collectorNFT = $t01374813876._4 | |
414 | + | [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(), signFee, creatorFee, ownerFee, collectorNFT] | |
361 | 415 | } | |
362 | 416 | } | |
363 | 417 | } | |
364 | 418 | } | |
365 | 419 | } | |
366 | 420 | ||
367 | 421 |
github/deemru/w8io/169f3d6 131.14 ms ◑