tx · 3qYUZ3511N7uvXLVpe862BVPK9MDr6JzwcQEGnvJKF97

3N6yPEN3qNbKESnUewrj3EYVr6eLAd9AYBB:  -0.01400000 Waves

2022.10.25 11:37 [2287691] smart account 3N6yPEN3qNbKESnUewrj3EYVr6eLAd9AYBB > SELF 0.00000000 Waves

{ "type": 13, "id": "3qYUZ3511N7uvXLVpe862BVPK9MDr6JzwcQEGnvJKF97", "fee": 1400000, "feeAssetId": null, "timestamp": 1666687084585, "version": 2, "chainId": 84, "sender": "3N6yPEN3qNbKESnUewrj3EYVr6eLAd9AYBB", "senderPublicKey": "9RjLrGXy4wnGfNiZRhKSUh5wDnj5rLGPzbCE75KaVemg", "proofs": [ "3hBAk7TVDHmbvhLFrnaygW1f8NdksFUEHK9URjqd7CipodUAHco75WPXZE7KqJge58wtZFDMwpEKn6VqcSitpYfn" ], "script": "base64:BgJICAISBAoCCAgSCQoHCAgICAgICBIKCggICAgICAgICBIGCgQICAgIEgcKBQgICAEBEggKBggICAgBARIFCgMIAQQSBQoDCAgIKgAHVkVSU0lPTgIFMS4wLjABDmdldFN0cmluZ0J5S2V5AQNrZXkJAQt2YWx1ZU9yRWxzZQIJAJ0IAgUEdGhpcwUDa2V5AgAACHVzZXJEYXBwCQEFdmFsdWUBCQCmCAEJAQ5nZXRTdHJpbmdCeUtleQECD2NvbmZfdXNlcnNfZGFwcAALZmVlUmVjZWl2ZXIJAQ5nZXRTdHJpbmdCeUtleQECEWNvbmZfZmVlX3JlY2VpdmVyAAtzaWduQXNzZXRJZAkA2QQBCQEOZ2V0U3RyaW5nQnlLZXkBAhhjb25mX2FjY2VwdGVkX2Fzc2V0X1NJR04ABWNocmlzCQEOZ2V0U3RyaW5nQnlLZXkBAgxjb25mX2FkbWluXzEBD2dldEludGVnZXJCeUtleQEDa2V5CQELdmFsdWVPckVsc2UCCQCaCAIFBHRoaXMFA2tleQAAAQ9nZXRCb29sZWFuQnlLZXkBA2tleQkBC3ZhbHVlT3JFbHNlAgkAmwgCB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dWVyBQdldmVudElkBQh0aWNrZXRJZAUNbmV3QW1vdW50U29sZAkAzAgCCQELU3RyaW5nRW50cnkCCQCsAgICBG5mdF8JANgEAQUFaWRORlQFB3NvbGRLZXkJAMwIAgkBDEludGVnZXJFbnRyeQICEHRvdGFsX25mdF9pc3N1ZWQJAGQCBQh0b3RhbE5GVAABCQDMCAIJAQxCb29sZWFuRW50cnkCCQEPa2V5VGlja2V0T25TYWxlAwUGaXNzdWVyBQdldmVudElkBQh0aWNrZXRJZAUKc2VsbFN0YXR1cwkAzAgCBQhpc3N1ZU5GVAkAzAgCCQEOU2NyaXB0VHJhbnNmZXIDCQEHQWRkcmVzcwEJANkEAQUGaXNzdWVyBRJhbW91bnRGb3JPcmdhbml6ZXIFB2Fzc2V0SWQJAMwIAgkBDlNjcmlwdFRyYW5zZmVyAwUKcmVjZWl2ZU5GVAABBQVpZE5GVAkAzAgCCQEOU2NyaXB0VHJhbnNmZXIDCQEHQWRkcmVzcwEJANkEAQULZmVlUmVjZWl2ZXIFDWFtb3VudEZvclNpZ24FB2Fzc2V0SWQFA25pbAkAzAgCBQhzb2xkRGF0YQUGYnV5UmVzAFh4/xk=", "height": 2287691, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: none Next: B8kSasrY3ieF7gbkMCo5bGiDtCvshSwkw1p1tmrSHe6h 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 getStringByKey (key) = valueOrElse(getString(this, key), "")
7+
8+
9+let userDapp = value(addressFromString(getStringByKey("conf_users_dapp")))
10+
11+let feeReceiver = getStringByKey("conf_fee_receiver")
12+
13+let signAssetId = fromBase58String(getStringByKey("conf_accepted_asset_SIGN"))
14+
15+let chris = getStringByKey("conf_admin_1")
16+
17+func getIntegerByKey (key) = valueOrElse(getInteger(this, key), 0)
18+
19+
20+func getBooleanByKey (key) = valueOrElse(getBoolean(this, key), false)
21+
22+
23+let dappRunning = valueOrElse(getBoolean(userDapp, "conf_dapp_is_running"), true)
24+
25+let maintenanceMSG = valueOrElse(getString(userDapp, "conf_maintenance_msg"), "")
26+
27+let userSuspended = "SUSPENDED"
28+
29+let userUnregistered = "UNREGISTERED"
30+
31+func validateCID (cid) = if (contains(cid, "/"))
32+ then if (if ((76 > size(cid)))
33+ then (size(split(cid, "/")[0]) == 59)
34+ else false)
35+ then (16 > size(split(cid, "/")[1]))
36+ else false
37+ else false
38+
39+
40+let signCut = 2
41+
42+func keyUserStatus (caller) = ("user_status_" + caller)
43+
44+
45+func keyEventOwnerByEventId (eventId) = ("event_owner_" + eventId)
46+
47+
48+func keyEventAddedDate (caller,eventId) = ((("event_added_date_" + eventId) + "_") + caller)
49+
50+
51+func keyEventDate (caller,eventId) = ((("event_date_" + eventId) + "_") + caller)
52+
53+
54+func keyEventName (caller,eventId) = ((("event_name_" + eventId) + "_") + caller)
55+
56+
57+func keyEventDesc (caller,eventId) = ((("event_desc_" + eventId) + "_") + caller)
58+
59+
60+func keyEventDisplayCid (caller,eventId) = ((("event_display_cid_" + eventId) + "_") + caller)
61+
62+
63+func keyEventTags (caller,eventId) = ((("event_tags_" + eventId) + "_") + caller)
64+
65+
66+func keyEventFlag (caller,eventId) = ((("event_flag_" + eventId) + "_") + caller)
67+
68+
69+func keyEventNote (caller,eventId) = ((("event_note_" + eventId) + "_") + caller)
70+
71+
72+func keyEventCrawler (caller,eventId) = ((("event_crawler_cid_" + eventId) + "_") + caller)
73+
74+
75+func keyEventType (caller,eventId) = ((("event_type_" + eventId) + "_") + caller)
76+
77+
78+func keyTicketName (caller,eventId,ticketId) = ((((("ticket_name_" + eventId) + "_") + caller) + "_") + ticketId)
79+
80+
81+func keyTicketDesc (caller,eventId,ticketId) = ((((("ticket_desc_" + eventId) + "_") + caller) + "_") + ticketId)
82+
83+
84+func keyTicketPrice (caller,eventId,ticketId) = ((((("ticket_price_" + eventId) + "_") + caller) + "_") + ticketId)
85+
86+
87+func keyTicketMaxAvailable (caller,eventId,ticketId) = ((((("ticket_maxAvailable_" + eventId) + "_") + caller) + "_") + ticketId)
88+
89+
90+func keyTicketSold (caller,eventId,ticketId) = ((((("ticket_sold_" + eventId) + "_") + caller) + "_") + ticketId)
91+
92+
93+func keyTicketOnSale (caller,eventId,ticketId) = ((((("ticket_sold_" + eventId) + "_") + caller) + "_") + ticketId)
94+
95+
96+func validateString (str,max) = if ((size(str) == 0))
97+ then throw("Field cannot be is empty")
98+ else if ((size(str) > max))
99+ then throw((str + " is too long"))
100+ else true
101+
102+
103+func validateInt (num) = (0 > num)
104+
105+
106+func getEventOwnerByEventId (eventId) = valueOrElse(getString(this, keyEventOwnerByEventId(eventId)), "")
107+
108+
109+func validateUser (caller) = {
110+ let userStatus = valueOrElse(getString(userDapp, keyUserStatus(caller)), userUnregistered)
111+ if ((userStatus == userUnregistered))
112+ then "Register this account first with \"Account\" tab"
113+ else if ((userStatus == userSuspended))
114+ then "Account suspended"
115+ else ""
116+ }
117+
118+
119+func validateType (type) = containsElement(["online", "offline", "both"], type)
120+
121+
122+func validateEventData (caller,cidDisplay,name,description,tags,type,date) = {
123+ let checkUser = validateUser(caller)
124+ if ((checkUser != ""))
125+ then throw(checkUser)
126+ else if ((size(cidDisplay) == 0))
127+ then throw("Display CID cannot be empty")
128+ else if (!(validateCID(cidDisplay)))
129+ then throw("Problem with CID")
130+ else if (!(validateString(name, 200)))
131+ then throw("100 Char. max name")
132+ else if (!(validateType(type)))
133+ then throw("Wrong event type")
134+ else if (!(validateString(description, 1000)))
135+ then throw("1000 Char. max description")
136+ else if (!(validateString(date, 1000)))
137+ then throw("1000 Char. max date")
138+ else if ((size(split(tags, ",")) > 5))
139+ then throw("5 tags max.")
140+ else ""
141+ }
142+
143+
144+func validateTicketData (eventId,caller,name,description,price,maxAvailable) = {
145+ let checkUser = validateUser(caller)
146+ if ((checkUser != ""))
147+ then throw(checkUser)
148+ else if (!(validateString(name, 200)))
149+ then throw("100 Char. max name")
150+ else if (!(validateString(description, 1000)))
151+ then throw("1000 Char. max description")
152+ else if (if (!(validateInt(price)))
153+ then true
154+ else !(validateInt(maxAvailable)))
155+ then throw("Positive amount only")
156+ else if (!(validateString(description, 1000)))
157+ then throw("1000 Char. max description")
158+ else ""
159+ }
160+
161+
162+func idCallerDate (i) = if (!(dappRunning))
163+ then throw(maintenanceMSG)
164+ else $Tuple3(toBase58String(i.transactionId), toBase58String(i.caller.bytes), lastBlock.timestamp)
165+
166+
167+func isPayment (i) = if ((size(i.payments) == 0))
168+ then throw("No payment attached")
169+ else {
170+ let payment = value(i.payments[0])
171+ let amount = value(payment.amount)
172+ $Tuple2(payment, amount)
173+ }
174+
175+
176+func validatePriceAssetId (i,priceAssetId,artworkPrice) = {
177+ let $t057785814 = isPayment(i)
178+ let payment = $t057785814._1
179+ let amount = $t057785814._2
180+ if (!(isDefined(payment.assetId)))
181+ then throw("Wrong asset attached")
182+ else {
183+ let assetId = if (if ((size(priceAssetId) > 0))
184+ then (toBase58String(value(payment.assetId)) == priceAssetId)
185+ else false)
186+ then payment.assetId
187+ else throw("Wrong asset attached")
188+ if ((artworkPrice != amount))
189+ then throw("Payment amount don't match")
190+ else $Tuple2(amount, assetId)
191+ }
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(i)
208+func addEvent (name,description,tags,cidDisplay,crawler,type,date) = {
209+ let $t066866735 = idCallerDate(i)
210+ let eventId = $t066866735._1
211+ let caller = $t066866735._2
212+ let addedDate = $t066866735._3
213+ let checkUser = validateUser(caller)
214+ if ((checkUser != ""))
215+ then throw(checkUser)
216+ else {
217+ let validateEvent = validateEventData(caller, cidDisplay, name, description, tags, type, date)
218+ if ((validateEvent != ""))
219+ then throw("Something went wrong!")
220+ else [IntegerEntry(keyEventAddedDate(caller, eventId), addedDate), StringEntry(keyEventDate(caller, eventId), date), StringEntry(keyEventName(caller, eventId), name), StringEntry(keyEventDesc(caller, eventId), description), StringEntry(keyEventDisplayCid(caller, eventId), cidDisplay), StringEntry(keyEventTags(caller, eventId), tags), StringEntry(keyEventCrawler(caller, eventId), crawler), StringEntry(keyEventType(caller, eventId), type), StringEntry(keyEventOwnerByEventId(eventId), caller)]
221+ }
222+ }
223+
224+
225+
226+@Callable(i)
227+func editEvent (eventId,name,description,tags,cidDisplay,crawler,type,date) = if (!(dappRunning))
228+ then throw(maintenanceMSG)
229+ else {
230+ let caller = toBase58String(i.caller.bytes)
231+ let checkUser = validateUser(caller)
232+ if ((checkUser != ""))
233+ then throw(checkUser)
234+ else {
235+ let validateEvent = validateEventData(caller, cidDisplay, name, description, tags, type, date)
236+ if ((validateEvent != ""))
237+ then throw("Something went wrong!")
238+ else {
239+ let entryExist = getStringByKey(keyEventName(caller, eventId))
240+ if ((entryExist == ""))
241+ then throw("Entry not found")
242+ else {
243+ let flag = getStringByKey(keyEventFlag(caller, eventId))
244+ if ((flag == "ILLEGAL"))
245+ then throw("Cannot update ILLEGAL Event")
246+ else [StringEntry(keyEventName(caller, eventId), name), StringEntry(keyEventDate(caller, eventId), date), StringEntry(keyEventDesc(caller, eventId), description), StringEntry(keyEventTags(caller, eventId), tags), StringEntry(keyEventType(caller, eventId), type), StringEntry(keyEventCrawler(caller, eventId), crawler)]
247+ }
248+ }
249+ }
250+ }
251+
252+
253+
254+@Callable(i)
255+func flagEvent (eventId,addr,flag,note) = {
256+ let $t090059038 = idCallerDate(i)
257+ let id = $t090059038._1
258+ let caller = $t090059038._2
259+ if (containsElement([chris, toString(this)], caller))
260+ then if (containsElement(["", "CHANGE_REQUIRED", "FLAGGED", "ILLEGAL"], flag))
261+ then [StringEntry(keyEventFlag(addr, eventId), flag), StringEntry(keyEventNote(addr, eventId), note)]
262+ else throw(("Unknow status " + flag))
263+ else throw("You are not allowed")
264+ }
265+
266+
267+
268+@Callable(i)
269+func addTicket (eventId,name,description,price,maxAvailable) = {
270+ let $t095269566 = idCallerDate(i)
271+ let id = $t095269566._1
272+ let caller = $t095269566._2
273+ let date = $t095269566._3
274+ let checkUser = validateUser(caller)
275+ if ((checkUser != ""))
276+ then throw(checkUser)
277+ else {
278+ let isEventOwner = getEventOwnerByEventId(eventId)
279+ if ((isEventOwner == ""))
280+ then throw("Event not found")
281+ else if ((isEventOwner != caller))
282+ then throw("You are not the owner of this event")
283+ else {
284+ let validateTicket = validateTicketData(eventId, caller, name, description, price, maxAvailable)
285+ if ((validateTicket != ""))
286+ then throw("Something went wrong!")
287+ else [StringEntry(keyTicketName(caller, eventId, id), name), StringEntry(keyTicketDesc(caller, eventId, id), description), IntegerEntry(keyTicketPrice(caller, eventId, id), price), IntegerEntry(keyTicketMaxAvailable(caller, eventId, id), maxAvailable), BooleanEntry(keyTicketOnSale(caller, eventId, id), true)]
288+ }
289+ }
290+ }
291+
292+
293+
294+@Callable(i)
295+func editTicket (ticketId,eventId,name,description,price,maxAvailable) = {
296+ let $t01052210562 = idCallerDate(i)
297+ let id = $t01052210562._1
298+ let caller = $t01052210562._2
299+ let date = $t01052210562._3
300+ let checkUser = validateUser(caller)
301+ if ((checkUser != ""))
302+ then throw(checkUser)
303+ else {
304+ let isEventOwner = getEventOwnerByEventId(eventId)
305+ if ((isEventOwner == ""))
306+ then throw("Event not found")
307+ else if ((isEventOwner != caller))
308+ then throw("You are not the owner of this event")
309+ else {
310+ let ticketExist = getStringByKey(keyTicketName(caller, eventId, ticketId))
311+ if ((size(ticketExist) == 0))
312+ then throw("Ticket not found")
313+ else {
314+ let validateTicket = validateTicketData(eventId, caller, name, description, price, maxAvailable)
315+ if ((validateTicket != ""))
316+ then throw("Something went wrong!")
317+ else {
318+ let ticketSold = valueOrElse(getInteger(keyTicketSold(caller, eventId, ticketId)), 0)
319+ if ((ticketSold > maxAvailable))
320+ then throw("Max tickets available cannot be lower than amount already sold")
321+ else [StringEntry(keyTicketName(caller, eventId, ticketId), name), StringEntry(keyTicketDesc(caller, eventId, ticketId), description), IntegerEntry(keyTicketPrice(caller, eventId, ticketId), price), IntegerEntry(keyTicketMaxAvailable(caller, eventId, ticketId), maxAvailable)]
322+ }
323+ }
324+ }
325+ }
326+ }
327+
328+
329+
330+@Callable(i)
331+func pauseTicket (eventId,ticketId,status) = {
332+ let $t01183511875 = idCallerDate(i)
333+ let id = $t01183511875._1
334+ let caller = $t01183511875._2
335+ let date = $t01183511875._3
336+ let checkUser = validateUser(caller)
337+ if ((checkUser != ""))
338+ then throw(checkUser)
339+ else {
340+ let isEventOwner = getEventOwnerByEventId(eventId)
341+ if ((isEventOwner == ""))
342+ then throw("Event not found")
343+ else if ((isEventOwner != caller))
344+ then throw("You are not the owner of this event")
345+ else [BooleanEntry(keyTicketOnSale(caller, eventId, id), status)]
346+ }
347+ }
348+
349+
350+
351+@Callable(i)
352+func buyTicket (ticketId,eventId,issuer) = {
353+ let $t01235612394 = idCallerDate(i)
354+ let id = $t01235612394._1
355+ let caller = $t01235612394._2
356+ let date = $t01235612394._3
357+ let totalNFT = valueOrElse(getIntegerByKey("total_tickets_issued"), 0)
358+ let eventOwner = getEventOwnerByEventId(eventId)
359+ if ((eventOwner == ""))
360+ then throw("Event not found")
361+ else if ((eventOwner != issuer))
362+ then throw("You are not the owner of this event")
363+ else {
364+ let ticketExist = getStringByKey(keyTicketName(issuer, eventId, ticketId))
365+ if ((size(ticketExist) == 0))
366+ then throw("Ticket not found")
367+ else {
368+ let eventName = getStringByKey(keyEventName(issuer, eventId))
369+ if ((eventName == ""))
370+ then throw("Art doesn't exist")
371+ else {
372+ let isOnSale = getBooleanByKey(keyTicketOnSale(issuer, eventId, ticketId))
373+ let amountSold = getIntegerByKey(keyTicketSold(issuer, eventId, ticketId))
374+ let ticketPrice = getIntegerByKey(keyTicketPrice(issuer, eventId, ticketId))
375+ let priceAssetId = toBase58String(signAssetId)
376+ let $t01331113385 = validatePriceAssetId(i, priceAssetId, ticketPrice)
377+ let amount = $t01331113385._1
378+ let assetId = $t01331113385._2
379+ let maxCanSell = getIntegerByKey(keyTicketMaxAvailable(issuer, eventId, ticketId))
380+ let amountForSign = fraction(amount, signCut, 100)
381+ let amountForOrganizer = (amount - amountForSign)
382+ if ((amountSold == maxCanSell))
383+ then throw("Art sold out")
384+ else {
385+ let newAmountSold = (amountSold + 1)
386+ let issueMeta = ((((((((((("Organizer: " + issuer) + ",
387+ EventID: ") + eventId) + ",
388+ TicketID: ") + ticketId) + ",
389+ EventName: ") + eventName) + ",
390+ Issue: ") + toString(newAmountSold)) + "/") + toString(maxCanSell))
391+ let issueNFT = Issue(("ST_" + toString((totalNFT + 1))), issueMeta, 1, 0, false)
392+ let idNFT = calculateAssetId(issueNFT)
393+ let sellStatus = if (if ((newAmountSold == maxCanSell))
394+ then true
395+ else !(isOnSale))
396+ then false
397+ else true
398+ let receiveNFT = i.caller
399+ let soldKey = ((((((((("ticket_sold_" + toString(newAmountSold)) + "_of_") + toString(maxCanSell)) + "_") + eventId) + "_") + issuer) + "_") + ticketId)
400+ let soldValue = ((((((((toString(receiveNFT) + "_") + toString(date)) + "_") + id) + "_") + toString(amount)) + "_") + toBase58String(idNFT))
401+ let soldData = StringEntry(soldKey, soldValue)
402+ let buyRes = [IntegerEntry(keyTicketSold(issuer, eventId, ticketId), newAmountSold), StringEntry(("nft_" + toBase58String(idNFT)), soldKey), IntegerEntry("total_nft_issued", (totalNFT + 1)), BooleanEntry(keyTicketOnSale(issuer, eventId, ticketId), sellStatus), issueNFT, ScriptTransfer(Address(fromBase58String(issuer)), amountForOrganizer, assetId), ScriptTransfer(receiveNFT, 1, idNFT), ScriptTransfer(Address(fromBase58String(feeReceiver)), amountForSign, assetId)]
403+soldData :: buyRes
404+ }
405+ }
406+ }
407+ }
408+ }
409+
410+

github/deemru/w8io/169f3d6 
29.85 ms