tx · 6aKQV6drCTzvfTXuWmq9n3JjHfFgD29uS5LaVRpifEKr 3N43JYG2V93YFoqRKwVv8wdihrSAzLGAyE9: -0.01300000 Waves 2022.11.03 12:41 [2300764] smart account 3N43JYG2V93YFoqRKwVv8wdihrSAzLGAyE9 > SELF 0.00000000 Waves
{ "type": 13, "id": "6aKQV6drCTzvfTXuWmq9n3JjHfFgD29uS5LaVRpifEKr", "fee": 1300000, "feeAssetId": null, "timestamp": 1667468527385, "version": 2, "chainId": 84, "sender": "3N43JYG2V93YFoqRKwVv8wdihrSAzLGAyE9", "senderPublicKey": "GZ21uawsKqsN4vtEvjBExAk9KuMX97aS3T8otU7RjFn", "proofs": [ "YvtsMrTSoPXLJyyGyiNG9dLd5bn62YfVvP8UnSJy6C8dykeM7S24vQYhq1dQbsFBbtWp22rDFcEWRdHrXwN9Lqf" ], "script": "base64:BgI5CAISBAoCCAgSBAoCBAgSBAoCAQgSBQoDCAEIEgMKAQgSAwoBCBIDCgEIEgUKAwgICBIGCgQICAgIKQAHVkVSU0lPTgIFMS4wLjABCWdldFN0ckJ5SwEDa2V5CQELdmFsdWVPckVsc2UCCQCdCAIFBHRoaXMFA2tleQIAAAtmZWVSZWNlaXZlcgkBCWdldFN0ckJ5SwECEWNvbmZfZmVlX3JlY2VpdmVyAApldmVudHNEYXBwCQEFdmFsdWUBCQCmCAEJAQlnZXRTdHJCeUsBAhBjb25mX2V2ZW50c19kYXBwAAh1c2VyRGFwcAkBBXZhbHVlAQkApggBCQEJZ2V0U3RyQnlLAQIPY29uZl91c2Vyc19kYXBwAAtzaWduQXNzZXRJZAkA2QQBCQEJZ2V0U3RyQnlLAQIYY29uZl9hY2NlcHRlZF9hc3NldF9TSUdOAAVjaHJpcwkBCWdldFN0ckJ5SwECDGNvbmZfYWRtaW5fMQAHc2lnbkN1dAADAAxvcmdhbml6ZXJDdXQACgANdXNlclN1c3BlbmRlZAIJU1VTUEVOREVEAAxldmVudElsbGVnYWwCB0lMTEVHQUwADmV2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3JORlQFA25pbAULY29tbWlzc2lvbnMBaQELY2FuY2VsT2ZmZXIECHRpY2tldElkB29mZmVySWQKb2ZmZXJPd25lcglzYWxlT3duZXIEDSR0MDEzODM0MTM5MDYJAQxpZENhbGxlckRhdGUBBQFpBAJpZAgFDSR0MDEzODM0MTM5MDYCXzEEBmNhbGxlcggFDSR0MDEzODM0MTM5MDYCXzIEBGRhdGUIBQ0kdDAxMzgzNDEzOTA2Al8zAwMJAQIhPQIFBmNhbGxlcgUKb2ZmZXJPd25lcgkBAiE9AgUGY2FsbGVyBQlzYWxlT3duZXIHCQACAQIdWW91IGNhbm5vdCBjYW5jZWwgdGhpcyBvZmZlci4EBmJpZEtleQkBCWdldEJpZEtleQQFCm9mZmVyT3duZXIFCHRpY2tldElkBQlzYWxlT3duZXIFB29mZmVySWQEDSR0MDE0MDgxMTQxMzYJAQpnZXRCaWREYXRhAQUGYmlkS2V5BApiaWREYXRhQXJyCAUNJHQwMTQwODExNDEzNgJfMQQHYXNzZXRJZAgFDSR0MDE0MDgxMTQxMzYCXzIEB2JpZERhdGEIBQ0kdDAxNDA4MTE0MTM2Al8zCQDMCAIJAQtEZWxldGVFbnRyeQEJAKwCAgUGYmlkS2V5AgVfT1BFTgkAzAgCCQELU3RyaW5nRW50cnkCCQCsAgIFBmJpZEtleQIKX0NBTkNFTExFRAkArAICCQCsAgIJAKwCAgkArAICBQdiaWREYXRhAgtfQ0FOQ0VMTEVEXwkApAMBBQRkYXRlAgFfBQJpZAkAzAgCCQEOU2NyaXB0VHJhbnNmZXIDCQEHQWRkcmVzcwEJANkEAQUGY2FsbGVyCQENcGFyc2VJbnRWYWx1ZQEJAJEDAgUKYmlkRGF0YUFycgABBQdhc3NldElkBQNuaWwAPQ5Phw==", "height": 2300764, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 3BnBQwfJ5Udob2mKaDHcqGMXcLnGoy9TSnn9rADFAeMd Next: W9tAEVSLB2SRMND8KRnbLbJewt543pgeArLyWBZ47nE Diff:
Old | New | Differences | |
---|---|---|---|
194 | 194 | @Callable(invoke) | |
195 | 195 | func setConf (key,val) = { | |
196 | 196 | let caller = toString(invoke.caller) | |
197 | - | if (containsElement([chris, toString(this)], caller)) | |
198 | - | then if (contains(key, "conf_")) | |
199 | - | then [StringEntry(key, val)] | |
200 | - | else throw("Entries starting with conf_ only") | |
201 | - | else throw("You are not allowed to change this") | |
197 | + | if (true) | |
198 | + | then throw(((caller + "_") + toString(this))) | |
199 | + | else if (containsElement([chris, toString(this)], caller)) | |
200 | + | then if (contains(key, "conf_")) | |
201 | + | then [StringEntry(key, val)] | |
202 | + | else throw("Entries starting with conf_ only") | |
203 | + | else throw("You are not allowed to change this") | |
202 | 204 | } | |
203 | 205 | ||
204 | 206 | ||
216 | 218 | ||
217 | 219 | @Callable(i) | |
218 | 220 | func sellNFT (price,asset) = { | |
219 | - | let $ | |
220 | - | let payment = $ | |
221 | - | let amount = $ | |
221 | + | let $t069717007 = isPayment(i) | |
222 | + | let payment = $t069717007._1 | |
223 | + | let amount = $t069717007._2 | |
222 | 224 | if ((amount != 1)) | |
223 | 225 | then throw("No Ticket attached") | |
224 | 226 | else { | |
227 | 229 | else false) | |
228 | 230 | then toBase58String(value(payment.assetId)) | |
229 | 231 | else throw("Only SIGN Art NFT accepted.") | |
230 | - | let $ | |
231 | - | let id = $ | |
232 | - | let caller = $ | |
233 | - | let date = $ | |
234 | - | let isValidNFT = $ | |
235 | - | let artId = $ | |
236 | - | let creatorAddr = $ | |
232 | + | let $t072497333 = provideBaseData(i, ticketId) | |
233 | + | let id = $t072497333._1 | |
234 | + | let caller = $t072497333._2 | |
235 | + | let date = $t072497333._3 | |
236 | + | let isValidNFT = $t072497333._4 | |
237 | + | let artId = $t072497333._5 | |
238 | + | let creatorAddr = $t072497333._6 | |
237 | 239 | if (!(isValidNFT)) | |
238 | 240 | then throw("Not a valid ticket") | |
239 | 241 | else if (!(acceptedAssetIds(asset))) | |
246 | 248 | ||
247 | 249 | @Callable(i) | |
248 | 250 | func updateSalePrice (ticketId,price,asset) = { | |
249 | - | let $ | |
250 | - | let id = $ | |
251 | - | let caller = $ | |
252 | - | let date = $ | |
253 | - | let isValidNFT = $ | |
254 | - | let artId = $ | |
255 | - | let creatorAddr = $ | |
251 | + | let $t079278011 = provideBaseData(i, ticketId) | |
252 | + | let id = $t079278011._1 | |
253 | + | let caller = $t079278011._2 | |
254 | + | let date = $t079278011._3 | |
255 | + | let isValidNFT = $t079278011._4 | |
256 | + | let artId = $t079278011._5 | |
257 | + | let creatorAddr = $t079278011._6 | |
256 | 258 | if (!(isValidNFT)) | |
257 | 259 | then throw("Not a valid ticket") | |
258 | 260 | else { | |
278 | 280 | ||
279 | 281 | @Callable(i) | |
280 | 282 | func cancelSale (ticketId) = { | |
281 | - | let $ | |
282 | - | let id = $ | |
283 | - | let caller = $ | |
284 | - | let date = $ | |
285 | - | let isValidNFT = $ | |
286 | - | let artId = $ | |
287 | - | let creatorAddr = $ | |
283 | + | let $t089819213 = provideBaseData(i, ticketId) | |
284 | + | let id = $t089819213._1 | |
285 | + | let caller = $t089819213._2 | |
286 | + | let date = $t089819213._3 | |
287 | + | let isValidNFT = $t089819213._4 | |
288 | + | let artId = $t089819213._5 | |
289 | + | let creatorAddr = $t089819213._6 | |
288 | 290 | let saleOwner = getStrByK(("current_owner_on_dapp_" + ticketId)) | |
289 | 291 | if ((saleOwner != caller)) | |
290 | 292 | then throw("You don't own this ticket") | |
304 | 306 | ||
305 | 307 | @Callable(i) | |
306 | 308 | func buyNFT (ticketId) = { | |
307 | - | let $ | |
308 | - | let id = $ | |
309 | - | let caller = $ | |
310 | - | let date = $ | |
311 | - | let isValidNFT = $ | |
312 | - | let artId = $ | |
313 | - | let creatorAddr = $ | |
309 | + | let $t01006810181 = provideBaseData(i, ticketId) | |
310 | + | let id = $t01006810181._1 | |
311 | + | let caller = $t01006810181._2 | |
312 | + | let date = $t01006810181._3 | |
313 | + | let isValidNFT = $t01006810181._4 | |
314 | + | let artId = $t01006810181._5 | |
315 | + | let creatorAddr = $t01006810181._6 | |
314 | 316 | if (!(isValidNFT)) | |
315 | 317 | then throw("Not a valid ticket") | |
316 | 318 | else { | |
324 | 326 | if ((parseInt(saleInfoArray[1]) == 0)) | |
325 | 327 | then throw("Offer only") | |
326 | 328 | else { | |
327 | - | let $ | |
328 | - | let payment = $ | |
329 | - | let amount = $ | |
329 | + | let $t01058910625 = isPayment(i) | |
330 | + | let payment = $t01058910625._1 | |
331 | + | let amount = $t01058910625._2 | |
330 | 332 | let paymentAssetStr = if (isDefined(payment.assetId)) | |
331 | 333 | then toBase58String(value(payment.assetId)) | |
332 | 334 | else "" | |
335 | 337 | else (saleInfoArray[2] != paymentAssetStr)) | |
336 | 338 | then throw("Payment infos don't match.") | |
337 | 339 | else { | |
338 | - | let $ | |
339 | - | let commissions = $ | |
340 | - | let creatorFee = $ | |
341 | - | let ownerFee = $ | |
342 | - | let collectorNFT = $ | |
340 | + | let $t01086911004 = setTransfers(amount, payment.assetId, ticketId, creatorAddr, saleOwner, caller) | |
341 | + | let commissions = $t01086911004._1 | |
342 | + | let creatorFee = $t01086911004._2 | |
343 | + | let ownerFee = $t01086911004._3 | |
344 | + | let collectorNFT = $t01086911004._4 | |
343 | 345 | ([DeleteEntry((saleKey + "_OPEN")), DeleteEntry(((("sale2nd_status_" + saleOwner) + "_") + ticketId)), DeleteEntry(("current_owner_on_dapp_" + ticketId)), StringEntry((((saleKey + "_") + id) + "_CLOSED"), ((((((saleInfo + "_CLOSED_") + toString(date)) + "_") + id) + "_") + caller)), updateNumSales(), creatorFee, ownerFee, collectorNFT] ++ commissions) | |
344 | 346 | } | |
345 | 347 | } | |
351 | 353 | ||
352 | 354 | @Callable(i) | |
353 | 355 | func setOffer (ticketId) = { | |
354 | - | let $ | |
355 | - | let id = $ | |
356 | - | let offerOwner = $ | |
357 | - | let date = $ | |
358 | - | let isValidNFT = $ | |
359 | - | let artId = $ | |
360 | - | let creatorAddr = $ | |
356 | + | let $t01142411512 = provideBaseData(i, ticketId) | |
357 | + | let id = $t01142411512._1 | |
358 | + | let offerOwner = $t01142411512._2 | |
359 | + | let date = $t01142411512._3 | |
360 | + | let isValidNFT = $t01142411512._4 | |
361 | + | let artId = $t01142411512._5 | |
362 | + | let creatorAddr = $t01142411512._6 | |
361 | 363 | if (!(isValidNFT)) | |
362 | 364 | then throw("Not a valid ticket") | |
363 | 365 | else { | |
364 | - | let $ | |
365 | - | let payment = $ | |
366 | - | let amount = $ | |
366 | + | let $t01157611612 = isPayment(i) | |
367 | + | let payment = $t01157611612._1 | |
368 | + | let amount = $t01157611612._2 | |
367 | 369 | let assetId = toBase58String(value(payment.assetId)) | |
368 | 370 | if (!(acceptedAssetIds(assetId))) | |
369 | 371 | then throw("asset not accepted") | |
380 | 382 | ||
381 | 383 | @Callable(i) | |
382 | 384 | func acceptOffer (ticketId,offerId,offerOwner) = { | |
383 | - | let $ | |
384 | - | let id = $ | |
385 | - | let caller = $ | |
386 | - | let date = $ | |
387 | - | let isValidNFT = $ | |
388 | - | let artId = $ | |
389 | - | let creatorAddr = $ | |
385 | + | let $t01229012374 = provideBaseData(i, ticketId) | |
386 | + | let id = $t01229012374._1 | |
387 | + | let caller = $t01229012374._2 | |
388 | + | let date = $t01229012374._3 | |
389 | + | let isValidNFT = $t01229012374._4 | |
390 | + | let artId = $t01229012374._5 | |
391 | + | let creatorAddr = $t01229012374._6 | |
390 | 392 | if (!(isValidNFT)) | |
391 | 393 | then throw("Not a valid ticket") | |
392 | 394 | else { | |
395 | 397 | then throw("Only sale owner can accept offer") | |
396 | 398 | else { | |
397 | 399 | let bidKey = getBidKey(offerOwner, ticketId, saleOwner, offerId) | |
398 | - | let $ | |
399 | - | let bidDataArr = $ | |
400 | - | let assetId = $ | |
401 | - | let bidData = $ | |
400 | + | let $t01263712692 = getBidData(bidKey) | |
401 | + | let bidDataArr = $t01263712692._1 | |
402 | + | let assetId = $t01263712692._2 | |
403 | + | let bidData = $t01263712692._3 | |
402 | 404 | let saleKey = getSaleKey(saleOwner, ticketId, artId, creatorAddr) | |
403 | 405 | let saleInfo = getStrByK((saleKey + "_OPEN")) | |
404 | 406 | if ((size(saleInfo) == 0)) | |
405 | 407 | then throw("Sale Not found!") | |
406 | 408 | else { | |
407 | 409 | let amount = value(parseInt(bidDataArr[1])) | |
408 | - | let $ | |
409 | - | let commissions = $ | |
410 | - | let creatorFee = $ | |
411 | - | let ownerFee = $ | |
412 | - | let collectorNFT = $ | |
410 | + | let $t01293113065 = setTransfers(amount, assetId, ticketId, creatorAddr, saleOwner, bidDataArr[6]) | |
411 | + | let commissions = $t01293113065._1 | |
412 | + | let creatorFee = $t01293113065._2 | |
413 | + | let ownerFee = $t01293113065._3 | |
414 | + | let collectorNFT = $t01293113065._4 | |
413 | 415 | let assetIdStr = toBase58String(value(assetId)) | |
414 | 416 | ([DeleteEntry((saleKey + "_OPEN")), DeleteEntry((bidKey + "_OPEN")), DeleteEntry(((("sale2nd_status_" + saleOwner) + "_") + ticketId)), DeleteEntry(("current_owner_on_dapp_" + ticketId)), 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 | 417 | } | |
421 | 423 | ||
422 | 424 | @Callable(i) | |
423 | 425 | func cancelOffer (ticketId,offerId,offerOwner,saleOwner) = { | |
424 | - | let $ | |
425 | - | let id = $ | |
426 | - | let caller = $ | |
427 | - | let date = $ | |
426 | + | let $t01383413906 = idCallerDate(i) | |
427 | + | let id = $t01383413906._1 | |
428 | + | let caller = $t01383413906._2 | |
429 | + | let date = $t01383413906._3 | |
428 | 430 | if (if ((caller != offerOwner)) | |
429 | 431 | then (caller != saleOwner) | |
430 | 432 | else false) | |
431 | 433 | then throw("You cannot cancel this offer.") | |
432 | 434 | else { | |
433 | 435 | let bidKey = getBidKey(offerOwner, ticketId, saleOwner, offerId) | |
434 | - | let $ | |
435 | - | let bidDataArr = $ | |
436 | - | let assetId = $ | |
437 | - | let bidData = $ | |
436 | + | let $t01408114136 = getBidData(bidKey) | |
437 | + | let bidDataArr = $t01408114136._1 | |
438 | + | let assetId = $t01408114136._2 | |
439 | + | let bidData = $t01408114136._3 | |
438 | 440 | [DeleteEntry((bidKey + "_OPEN")), StringEntry((bidKey + "_CANCELLED"), ((((bidData + "_CANCELLED_") + toString(date)) + "_") + id)), ScriptTransfer(Address(fromBase58String(caller)), parseIntValue(bidDataArr[1]), assetId)] | |
439 | 441 | } | |
440 | 442 | } |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let VERSION = "1.0.0" | |
5 | 5 | ||
6 | 6 | func getStrByK (key) = valueOrElse(getString(this, key), "") | |
7 | 7 | ||
8 | 8 | ||
9 | 9 | let feeReceiver = getStrByK("conf_fee_receiver") | |
10 | 10 | ||
11 | 11 | let eventsDapp = value(addressFromString(getStrByK("conf_events_dapp"))) | |
12 | 12 | ||
13 | 13 | let userDapp = value(addressFromString(getStrByK("conf_users_dapp"))) | |
14 | 14 | ||
15 | 15 | let signAssetId = fromBase58String(getStrByK("conf_accepted_asset_SIGN")) | |
16 | 16 | ||
17 | 17 | let chris = getStrByK("conf_admin_1") | |
18 | 18 | ||
19 | 19 | let signCut = 3 | |
20 | 20 | ||
21 | 21 | let organizerCut = 10 | |
22 | 22 | ||
23 | 23 | let userSuspended = "SUSPENDED" | |
24 | 24 | ||
25 | 25 | let eventIllegal = "ILLEGAL" | |
26 | 26 | ||
27 | 27 | let eventSuspended = "SUSPENDED" | |
28 | 28 | ||
29 | 29 | let dappRunningKey = "conf_dapp_is_running" | |
30 | 30 | ||
31 | 31 | let maintenanceMSGKey = "conf_maintenance_msg" | |
32 | 32 | ||
33 | 33 | let dappRunning = valueOrElse(getBoolean(this, dappRunningKey), true) | |
34 | 34 | ||
35 | 35 | let maintenanceMSG = valueOrElse(getString(this, maintenanceMSGKey), "") | |
36 | 36 | ||
37 | 37 | let numSalesK = "num_sales" | |
38 | 38 | ||
39 | 39 | func getUserStrByK (key) = valueOrElse(getString(userDapp, key), "Error") | |
40 | 40 | ||
41 | 41 | ||
42 | 42 | func getEventStrByK (key) = valueOrElse(getString(eventsDapp, key), "") | |
43 | 43 | ||
44 | 44 | ||
45 | 45 | func getIntByK (key) = valueOrElse(getInteger(this, key), 0) | |
46 | 46 | ||
47 | 47 | ||
48 | 48 | func keyUserStatus (addr) = ("user_status_" + addr) | |
49 | 49 | ||
50 | 50 | ||
51 | 51 | func keyFlag (organizerAddr,eventId) = ((("event_flag_" + eventId) + "_") + organizerAddr) | |
52 | 52 | ||
53 | 53 | ||
54 | 54 | func keyNFTData (id) = ("nft_" + id) | |
55 | 55 | ||
56 | 56 | ||
57 | 57 | func getSaleKey (caller,ticketId,eventId,organizerAddr) = ((((((("sale2nd_info_" + caller) + "_") + ticketId) + "_") + eventId) + "_") + organizerAddr) | |
58 | 58 | ||
59 | 59 | ||
60 | 60 | func getBidKey (offerOwner,ticketId,saleOwner,offerId) = ((((((("offer2nd_" + offerOwner) + "_") + ticketId) + "_") + saleOwner) + "_") + offerId) | |
61 | 61 | ||
62 | 62 | ||
63 | 63 | func idCallerDate (i) = if (!(dappRunning)) | |
64 | 64 | then throw(maintenanceMSG) | |
65 | 65 | else $Tuple3(toBase58String(i.transactionId), toBase58String(i.caller.bytes), lastBlock.timestamp) | |
66 | 66 | ||
67 | 67 | ||
68 | 68 | func isPayment (i) = if ((size(i.payments) == 0)) | |
69 | 69 | then throw("No payment attached") | |
70 | 70 | else { | |
71 | 71 | let payment = value(i.payments[0]) | |
72 | 72 | let amount = value(payment.amount) | |
73 | 73 | $Tuple2(payment, amount) | |
74 | 74 | } | |
75 | 75 | ||
76 | 76 | ||
77 | 77 | func assetIsValid (assetDetails) = if (if (if ((assetDetails.quantity == 1)) | |
78 | 78 | then (assetDetails.decimals == 0) | |
79 | 79 | else false) | |
80 | 80 | then (assetDetails.reissuable == false) | |
81 | 81 | else false) | |
82 | 82 | then (assetDetails.issuer == eventsDapp) | |
83 | 83 | else false | |
84 | 84 | ||
85 | 85 | ||
86 | 86 | func isSignEventNFT (id) = { | |
87 | 87 | let assetDetails = value(assetInfo(id)) | |
88 | 88 | assetIsValid(assetDetails) | |
89 | 89 | } | |
90 | 90 | ||
91 | 91 | ||
92 | 92 | func acceptedAssetIds (assetId) = if ((assetId != toBase58String(signAssetId))) | |
93 | 93 | then false | |
94 | 94 | else true | |
95 | 95 | ||
96 | 96 | ||
97 | 97 | func getBidAssetId (assetId) = fromBase58String(assetId) | |
98 | 98 | ||
99 | 99 | ||
100 | 100 | func getSaleOwnerAndStatus (ticketId) = { | |
101 | 101 | let saleOwner = getStrByK(("current_owner_on_dapp_" + ticketId)) | |
102 | 102 | if ((size(saleOwner) == 0)) | |
103 | 103 | then throw("Ticket not found") | |
104 | 104 | else { | |
105 | 105 | let saleStatus = getStrByK(((("sale2nd_status_" + saleOwner) + "_") + ticketId)) | |
106 | 106 | if ((saleStatus != "OPEN")) | |
107 | 107 | then throw("Ticket not for sale") | |
108 | 108 | else saleOwner | |
109 | 109 | } | |
110 | 110 | } | |
111 | 111 | ||
112 | 112 | ||
113 | 113 | func getBidData (key) = { | |
114 | 114 | let bidData = getStrByK((key + "_OPEN")) | |
115 | 115 | if ((bidData == "")) | |
116 | 116 | then throw("Offer not found") | |
117 | 117 | else { | |
118 | 118 | let bidDataArr = split(bidData, "_") | |
119 | 119 | let assetId = getBidAssetId(bidDataArr[2]) | |
120 | 120 | $Tuple3(bidDataArr, assetId, bidData) | |
121 | 121 | } | |
122 | 122 | } | |
123 | 123 | ||
124 | 124 | ||
125 | 125 | func eventIsValid (eventStatus) = if ((eventStatus != eventIllegal)) | |
126 | 126 | then (eventStatus != eventSuspended) | |
127 | 127 | else false | |
128 | 128 | ||
129 | 129 | ||
130 | 130 | func checkEventStatus (addr,id) = { | |
131 | 131 | let eventStatus = getEventStrByK(keyFlag(addr, id)) | |
132 | 132 | if (eventIsValid(eventStatus)) | |
133 | 133 | then true | |
134 | 134 | else throw(("Original event flagged as " + eventStatus)) | |
135 | 135 | } | |
136 | 136 | ||
137 | 137 | ||
138 | 138 | func checkOrganizerStatus (addr) = { | |
139 | 139 | let organizerStatus = getUserStrByK(keyUserStatus(addr)) | |
140 | 140 | if (containsElement([userSuspended], organizerStatus)) | |
141 | 141 | then throw(("Original organizer " + organizerStatus)) | |
142 | 142 | else true | |
143 | 143 | } | |
144 | 144 | ||
145 | 145 | ||
146 | 146 | func checkNFTInfo (assetId) = { | |
147 | 147 | let nftData = split(getEventStrByK(keyNFTData(assetId)), "_") | |
148 | 148 | if (if (!(checkEventStatus(nftData[6], nftData[5]))) | |
149 | 149 | then !(checkOrganizerStatus(nftData[6])) | |
150 | 150 | else false) | |
151 | 151 | then $Tuple3(false, nftData[5], nftData[6]) | |
152 | 152 | else $Tuple3(true, nftData[5], nftData[6]) | |
153 | 153 | } | |
154 | 154 | ||
155 | 155 | ||
156 | 156 | func checkEVENTExist (artId,creatorAddr) = if (if (!(checkEventStatus(creatorAddr, artId))) | |
157 | 157 | then !(checkOrganizerStatus(creatorAddr)) | |
158 | 158 | else false) | |
159 | 159 | then false | |
160 | 160 | else true | |
161 | 161 | ||
162 | 162 | ||
163 | 163 | func setTransfers (amount,assetId,ticketId,organizerAddr,saleOwner,caller) = { | |
164 | 164 | let amountForSign = fraction(amount, signCut, 100) | |
165 | 165 | let amountForOrganizer = fraction(amount, organizerCut, 100) | |
166 | 166 | let amountForOwner = (amount - (amountForSign + amountForOrganizer)) | |
167 | 167 | let commissions = [ScriptTransfer(Address(fromBase58String(feeReceiver)), amountForSign, assetId)] | |
168 | 168 | let organizerFee = ScriptTransfer(Address(fromBase58String(organizerAddr)), amountForOrganizer, assetId) | |
169 | 169 | let ownerFee = ScriptTransfer(Address(fromBase58String(saleOwner)), amountForOwner, assetId) | |
170 | 170 | let collectorNFT = ScriptTransfer(Address(fromBase58String(caller)), 1, fromBase58String(ticketId)) | |
171 | 171 | $Tuple4(commissions, organizerFee, ownerFee, collectorNFT) | |
172 | 172 | } | |
173 | 173 | ||
174 | 174 | ||
175 | 175 | func provideBaseData (i,ticketId) = { | |
176 | 176 | let $t057605799 = idCallerDate(i) | |
177 | 177 | let id = $t057605799._1 | |
178 | 178 | let caller = $t057605799._2 | |
179 | 179 | let date = $t057605799._3 | |
180 | 180 | let $t058025863 = checkNFTInfo(ticketId) | |
181 | 181 | let isValidNFT = $t058025863._1 | |
182 | 182 | let artId = $t058025863._2 | |
183 | 183 | let creatorAddr = $t058025863._3 | |
184 | 184 | $Tuple6(id, caller, date, isValidNFT, artId, creatorAddr) | |
185 | 185 | } | |
186 | 186 | ||
187 | 187 | ||
188 | 188 | func updateNumSales () = { | |
189 | 189 | let numSales = getIntByK(numSalesK) | |
190 | 190 | IntegerEntry(numSalesK, (numSales + 1)) | |
191 | 191 | } | |
192 | 192 | ||
193 | 193 | ||
194 | 194 | @Callable(invoke) | |
195 | 195 | func setConf (key,val) = { | |
196 | 196 | let caller = toString(invoke.caller) | |
197 | - | if (containsElement([chris, toString(this)], caller)) | |
198 | - | then if (contains(key, "conf_")) | |
199 | - | then [StringEntry(key, val)] | |
200 | - | else throw("Entries starting with conf_ only") | |
201 | - | else throw("You are not allowed to change this") | |
197 | + | if (true) | |
198 | + | then throw(((caller + "_") + toString(this))) | |
199 | + | else if (containsElement([chris, toString(this)], caller)) | |
200 | + | then if (contains(key, "conf_")) | |
201 | + | then [StringEntry(key, val)] | |
202 | + | else throw("Entries starting with conf_ only") | |
203 | + | else throw("You are not allowed to change this") | |
202 | 204 | } | |
203 | 205 | ||
204 | 206 | ||
205 | 207 | ||
206 | 208 | @Callable(invoke) | |
207 | 209 | func appRunning (isLive,message) = { | |
208 | 210 | let caller = toString(invoke.caller) | |
209 | 211 | let id = toBase58String(invoke.transactionId) | |
210 | 212 | if (containsElement([chris, toString(this)], caller)) | |
211 | 213 | then [BooleanEntry(dappRunningKey, isLive), StringEntry(maintenanceMSGKey, message)] | |
212 | 214 | else throw("You are not allowed to change this") | |
213 | 215 | } | |
214 | 216 | ||
215 | 217 | ||
216 | 218 | ||
217 | 219 | @Callable(i) | |
218 | 220 | func sellNFT (price,asset) = { | |
219 | - | let $ | |
220 | - | let payment = $ | |
221 | - | let amount = $ | |
221 | + | let $t069717007 = isPayment(i) | |
222 | + | let payment = $t069717007._1 | |
223 | + | let amount = $t069717007._2 | |
222 | 224 | if ((amount != 1)) | |
223 | 225 | then throw("No Ticket attached") | |
224 | 226 | else { | |
225 | 227 | let ticketId = if (if (isDefined(payment.assetId)) | |
226 | 228 | then isSignEventNFT(value(payment.assetId)) | |
227 | 229 | else false) | |
228 | 230 | then toBase58String(value(payment.assetId)) | |
229 | 231 | else throw("Only SIGN Art NFT accepted.") | |
230 | - | let $ | |
231 | - | let id = $ | |
232 | - | let caller = $ | |
233 | - | let date = $ | |
234 | - | let isValidNFT = $ | |
235 | - | let artId = $ | |
236 | - | let creatorAddr = $ | |
232 | + | let $t072497333 = provideBaseData(i, ticketId) | |
233 | + | let id = $t072497333._1 | |
234 | + | let caller = $t072497333._2 | |
235 | + | let date = $t072497333._3 | |
236 | + | let isValidNFT = $t072497333._4 | |
237 | + | let artId = $t072497333._5 | |
238 | + | let creatorAddr = $t072497333._6 | |
237 | 239 | if (!(isValidNFT)) | |
238 | 240 | then throw("Not a valid ticket") | |
239 | 241 | else if (!(acceptedAssetIds(asset))) | |
240 | 242 | then throw("Only SIGN token accepted") | |
241 | 243 | else [StringEntry((getSaleKey(caller, ticketId, artId, creatorAddr) + "_OPEN"), ((((((((((((toString(date) + "_") + toString(price)) + "_") + asset) + "_") + ticketId) + "_") + artId) + "_") + creatorAddr) + "_") + id)), StringEntry(((("sale2nd_status_" + caller) + "_") + ticketId), "OPEN"), StringEntry(("current_owner_on_dapp_" + ticketId), caller)] | |
242 | 244 | } | |
243 | 245 | } | |
244 | 246 | ||
245 | 247 | ||
246 | 248 | ||
247 | 249 | @Callable(i) | |
248 | 250 | func updateSalePrice (ticketId,price,asset) = { | |
249 | - | let $ | |
250 | - | let id = $ | |
251 | - | let caller = $ | |
252 | - | let date = $ | |
253 | - | let isValidNFT = $ | |
254 | - | let artId = $ | |
255 | - | let creatorAddr = $ | |
251 | + | let $t079278011 = provideBaseData(i, ticketId) | |
252 | + | let id = $t079278011._1 | |
253 | + | let caller = $t079278011._2 | |
254 | + | let date = $t079278011._3 | |
255 | + | let isValidNFT = $t079278011._4 | |
256 | + | let artId = $t079278011._5 | |
257 | + | let creatorAddr = $t079278011._6 | |
256 | 258 | if (!(isValidNFT)) | |
257 | 259 | then throw("Not a valid ticket") | |
258 | 260 | else { | |
259 | 261 | let saleOwner = getStrByK(("current_owner_on_dapp_" + ticketId)) | |
260 | 262 | if ((saleOwner != caller)) | |
261 | 263 | then throw("You don't own this ticket") | |
262 | 264 | else { | |
263 | 265 | let saleStatus = getStrByK(((("sale2nd_status_" + caller) + "_") + ticketId)) | |
264 | 266 | if ((saleStatus != "OPEN")) | |
265 | 267 | then throw("Sale not active") | |
266 | 268 | else if (!(acceptedAssetIds(asset))) | |
267 | 269 | then throw("Only SIGN token accepted") | |
268 | 270 | else { | |
269 | 271 | let saleKey = getSaleKey(caller, ticketId, artId, creatorAddr) | |
270 | 272 | let saleInfo = split(getStrByK((saleKey + "_OPEN")), "_") | |
271 | 273 | [StringEntry((saleKey + "_OPEN"), ((((((((((((saleInfo[0] + "_") + toString(price)) + "_") + asset) + "_") + saleInfo[3]) + "_") + saleInfo[4]) + "_") + saleInfo[5]) + "_") + saleInfo[6]))] | |
272 | 274 | } | |
273 | 275 | } | |
274 | 276 | } | |
275 | 277 | } | |
276 | 278 | ||
277 | 279 | ||
278 | 280 | ||
279 | 281 | @Callable(i) | |
280 | 282 | func cancelSale (ticketId) = { | |
281 | - | let $ | |
282 | - | let id = $ | |
283 | - | let caller = $ | |
284 | - | let date = $ | |
285 | - | let isValidNFT = $ | |
286 | - | let artId = $ | |
287 | - | let creatorAddr = $ | |
283 | + | let $t089819213 = provideBaseData(i, ticketId) | |
284 | + | let id = $t089819213._1 | |
285 | + | let caller = $t089819213._2 | |
286 | + | let date = $t089819213._3 | |
287 | + | let isValidNFT = $t089819213._4 | |
288 | + | let artId = $t089819213._5 | |
289 | + | let creatorAddr = $t089819213._6 | |
288 | 290 | let saleOwner = getStrByK(("current_owner_on_dapp_" + ticketId)) | |
289 | 291 | if ((saleOwner != caller)) | |
290 | 292 | then throw("You don't own this ticket") | |
291 | 293 | else { | |
292 | 294 | let saleStatus = getStrByK(((("sale2nd_status_" + caller) + "_") + ticketId)) | |
293 | 295 | if ((saleStatus != "OPEN")) | |
294 | 296 | then throw("Sale not active") | |
295 | 297 | else { | |
296 | 298 | let saleKey = getSaleKey(caller, ticketId, artId, creatorAddr) | |
297 | 299 | let saleInfo = getStrByK((saleKey + "_OPEN")) | |
298 | 300 | [DeleteEntry((saleKey + "_OPEN")), DeleteEntry(((("sale2nd_status_" + caller) + "_") + ticketId)), DeleteEntry(("current_owner_on_dapp_" + ticketId)), StringEntry((((saleKey + "_") + id) + "_CANCELLED"), ((((saleInfo + "_CANCELLED_") + toString(date)) + "_") + id)), ScriptTransfer(Address(fromBase58String(caller)), 1, fromBase58String(ticketId))] | |
299 | 301 | } | |
300 | 302 | } | |
301 | 303 | } | |
302 | 304 | ||
303 | 305 | ||
304 | 306 | ||
305 | 307 | @Callable(i) | |
306 | 308 | func buyNFT (ticketId) = { | |
307 | - | let $ | |
308 | - | let id = $ | |
309 | - | let caller = $ | |
310 | - | let date = $ | |
311 | - | let isValidNFT = $ | |
312 | - | let artId = $ | |
313 | - | let creatorAddr = $ | |
309 | + | let $t01006810181 = provideBaseData(i, ticketId) | |
310 | + | let id = $t01006810181._1 | |
311 | + | let caller = $t01006810181._2 | |
312 | + | let date = $t01006810181._3 | |
313 | + | let isValidNFT = $t01006810181._4 | |
314 | + | let artId = $t01006810181._5 | |
315 | + | let creatorAddr = $t01006810181._6 | |
314 | 316 | if (!(isValidNFT)) | |
315 | 317 | then throw("Not a valid ticket") | |
316 | 318 | else { | |
317 | 319 | let saleOwner = getSaleOwnerAndStatus(ticketId) | |
318 | 320 | let saleKey = getSaleKey(saleOwner, ticketId, artId, creatorAddr) | |
319 | 321 | let saleInfo = getStrByK((saleKey + "_OPEN")) | |
320 | 322 | if ((size(saleInfo) == 0)) | |
321 | 323 | then throw("Sale Not found!") | |
322 | 324 | else { | |
323 | 325 | let saleInfoArray = split(saleInfo, "_") | |
324 | 326 | if ((parseInt(saleInfoArray[1]) == 0)) | |
325 | 327 | then throw("Offer only") | |
326 | 328 | else { | |
327 | - | let $ | |
328 | - | let payment = $ | |
329 | - | let amount = $ | |
329 | + | let $t01058910625 = isPayment(i) | |
330 | + | let payment = $t01058910625._1 | |
331 | + | let amount = $t01058910625._2 | |
330 | 332 | let paymentAssetStr = if (isDefined(payment.assetId)) | |
331 | 333 | then toBase58String(value(payment.assetId)) | |
332 | 334 | else "" | |
333 | 335 | if (if ((saleInfoArray[1] != toString(amount))) | |
334 | 336 | then true | |
335 | 337 | else (saleInfoArray[2] != paymentAssetStr)) | |
336 | 338 | then throw("Payment infos don't match.") | |
337 | 339 | else { | |
338 | - | let $ | |
339 | - | let commissions = $ | |
340 | - | let creatorFee = $ | |
341 | - | let ownerFee = $ | |
342 | - | let collectorNFT = $ | |
340 | + | let $t01086911004 = setTransfers(amount, payment.assetId, ticketId, creatorAddr, saleOwner, caller) | |
341 | + | let commissions = $t01086911004._1 | |
342 | + | let creatorFee = $t01086911004._2 | |
343 | + | let ownerFee = $t01086911004._3 | |
344 | + | let collectorNFT = $t01086911004._4 | |
343 | 345 | ([DeleteEntry((saleKey + "_OPEN")), DeleteEntry(((("sale2nd_status_" + saleOwner) + "_") + ticketId)), DeleteEntry(("current_owner_on_dapp_" + ticketId)), StringEntry((((saleKey + "_") + id) + "_CLOSED"), ((((((saleInfo + "_CLOSED_") + toString(date)) + "_") + id) + "_") + caller)), updateNumSales(), creatorFee, ownerFee, collectorNFT] ++ commissions) | |
344 | 346 | } | |
345 | 347 | } | |
346 | 348 | } | |
347 | 349 | } | |
348 | 350 | } | |
349 | 351 | ||
350 | 352 | ||
351 | 353 | ||
352 | 354 | @Callable(i) | |
353 | 355 | func setOffer (ticketId) = { | |
354 | - | let $ | |
355 | - | let id = $ | |
356 | - | let offerOwner = $ | |
357 | - | let date = $ | |
358 | - | let isValidNFT = $ | |
359 | - | let artId = $ | |
360 | - | let creatorAddr = $ | |
356 | + | let $t01142411512 = provideBaseData(i, ticketId) | |
357 | + | let id = $t01142411512._1 | |
358 | + | let offerOwner = $t01142411512._2 | |
359 | + | let date = $t01142411512._3 | |
360 | + | let isValidNFT = $t01142411512._4 | |
361 | + | let artId = $t01142411512._5 | |
362 | + | let creatorAddr = $t01142411512._6 | |
361 | 363 | if (!(isValidNFT)) | |
362 | 364 | then throw("Not a valid ticket") | |
363 | 365 | else { | |
364 | - | let $ | |
365 | - | let payment = $ | |
366 | - | let amount = $ | |
366 | + | let $t01157611612 = isPayment(i) | |
367 | + | let payment = $t01157611612._1 | |
368 | + | let amount = $t01157611612._2 | |
367 | 369 | let assetId = toBase58String(value(payment.assetId)) | |
368 | 370 | if (!(acceptedAssetIds(assetId))) | |
369 | 371 | then throw("asset not accepted") | |
370 | 372 | else if ((amount == 0)) | |
371 | 373 | then throw("Offer of 0 not allowed") | |
372 | 374 | else { | |
373 | 375 | let saleOwner = getSaleOwnerAndStatus(ticketId) | |
374 | 376 | [StringEntry((getBidKey(offerOwner, ticketId, saleOwner, id) + "_OPEN"), ((((((((((((((toString(date) + "_") + toString(amount)) + "_") + assetId) + "_") + ticketId) + "_") + artId) + "_") + creatorAddr) + "_") + offerOwner) + "_") + id))] | |
375 | 377 | } | |
376 | 378 | } | |
377 | 379 | } | |
378 | 380 | ||
379 | 381 | ||
380 | 382 | ||
381 | 383 | @Callable(i) | |
382 | 384 | func acceptOffer (ticketId,offerId,offerOwner) = { | |
383 | - | let $ | |
384 | - | let id = $ | |
385 | - | let caller = $ | |
386 | - | let date = $ | |
387 | - | let isValidNFT = $ | |
388 | - | let artId = $ | |
389 | - | let creatorAddr = $ | |
385 | + | let $t01229012374 = provideBaseData(i, ticketId) | |
386 | + | let id = $t01229012374._1 | |
387 | + | let caller = $t01229012374._2 | |
388 | + | let date = $t01229012374._3 | |
389 | + | let isValidNFT = $t01229012374._4 | |
390 | + | let artId = $t01229012374._5 | |
391 | + | let creatorAddr = $t01229012374._6 | |
390 | 392 | if (!(isValidNFT)) | |
391 | 393 | then throw("Not a valid ticket") | |
392 | 394 | else { | |
393 | 395 | let saleOwner = getSaleOwnerAndStatus(ticketId) | |
394 | 396 | if ((caller != saleOwner)) | |
395 | 397 | then throw("Only sale owner can accept offer") | |
396 | 398 | else { | |
397 | 399 | let bidKey = getBidKey(offerOwner, ticketId, saleOwner, offerId) | |
398 | - | let $ | |
399 | - | let bidDataArr = $ | |
400 | - | let assetId = $ | |
401 | - | let bidData = $ | |
400 | + | let $t01263712692 = getBidData(bidKey) | |
401 | + | let bidDataArr = $t01263712692._1 | |
402 | + | let assetId = $t01263712692._2 | |
403 | + | let bidData = $t01263712692._3 | |
402 | 404 | let saleKey = getSaleKey(saleOwner, ticketId, artId, creatorAddr) | |
403 | 405 | let saleInfo = getStrByK((saleKey + "_OPEN")) | |
404 | 406 | if ((size(saleInfo) == 0)) | |
405 | 407 | then throw("Sale Not found!") | |
406 | 408 | else { | |
407 | 409 | let amount = value(parseInt(bidDataArr[1])) | |
408 | - | let $ | |
409 | - | let commissions = $ | |
410 | - | let creatorFee = $ | |
411 | - | let ownerFee = $ | |
412 | - | let collectorNFT = $ | |
410 | + | let $t01293113065 = setTransfers(amount, assetId, ticketId, creatorAddr, saleOwner, bidDataArr[6]) | |
411 | + | let commissions = $t01293113065._1 | |
412 | + | let creatorFee = $t01293113065._2 | |
413 | + | let ownerFee = $t01293113065._3 | |
414 | + | let collectorNFT = $t01293113065._4 | |
413 | 415 | let assetIdStr = toBase58String(value(assetId)) | |
414 | 416 | ([DeleteEntry((saleKey + "_OPEN")), DeleteEntry((bidKey + "_OPEN")), DeleteEntry(((("sale2nd_status_" + saleOwner) + "_") + ticketId)), DeleteEntry(("current_owner_on_dapp_" + ticketId)), 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 | 417 | } | |
416 | 418 | } | |
417 | 419 | } | |
418 | 420 | } | |
419 | 421 | ||
420 | 422 | ||
421 | 423 | ||
422 | 424 | @Callable(i) | |
423 | 425 | func cancelOffer (ticketId,offerId,offerOwner,saleOwner) = { | |
424 | - | let $ | |
425 | - | let id = $ | |
426 | - | let caller = $ | |
427 | - | let date = $ | |
426 | + | let $t01383413906 = idCallerDate(i) | |
427 | + | let id = $t01383413906._1 | |
428 | + | let caller = $t01383413906._2 | |
429 | + | let date = $t01383413906._3 | |
428 | 430 | if (if ((caller != offerOwner)) | |
429 | 431 | then (caller != saleOwner) | |
430 | 432 | else false) | |
431 | 433 | then throw("You cannot cancel this offer.") | |
432 | 434 | else { | |
433 | 435 | let bidKey = getBidKey(offerOwner, ticketId, saleOwner, offerId) | |
434 | - | let $ | |
435 | - | let bidDataArr = $ | |
436 | - | let assetId = $ | |
437 | - | let bidData = $ | |
436 | + | let $t01408114136 = getBidData(bidKey) | |
437 | + | let bidDataArr = $t01408114136._1 | |
438 | + | let assetId = $t01408114136._2 | |
439 | + | let bidData = $t01408114136._3 | |
438 | 440 | [DeleteEntry((bidKey + "_OPEN")), StringEntry((bidKey + "_CANCELLED"), ((((bidData + "_CANCELLED_") + toString(date)) + "_") + id)), ScriptTransfer(Address(fromBase58String(caller)), parseIntValue(bidDataArr[1]), assetId)] | |
439 | 441 | } | |
440 | 442 | } | |
441 | 443 | ||
442 | 444 |
github/deemru/w8io/169f3d6 78.99 ms ◑