tx · 6QGjizNy9AsStvktpSqGGfxdxCtTfFwu8ihg2DZuAjyo

3MrWmZaT2EbepZbjCUMCZUaoaVLdJyuF1GS:  -0.01300000 Waves

2022.11.03 13:57 [2300842] smart account 3MrWmZaT2EbepZbjCUMCZUaoaVLdJyuF1GS > SELF 0.00000000 Waves

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

github/deemru/w8io/169f3d6 
28.51 ms