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