tx · GWwep4LEsHGmJ82eUcWSYa9eaYvo8tha3otThADEkfpv 3N6yPEN3qNbKESnUewrj3EYVr6eLAd9AYBB: -0.01400000 Waves 2022.10.25 12:55 [2287762] smart account 3N6yPEN3qNbKESnUewrj3EYVr6eLAd9AYBB > SELF 0.00000000 Waves
{ "type": 13, "id": "GWwep4LEsHGmJ82eUcWSYa9eaYvo8tha3otThADEkfpv", "fee": 1400000, "feeAssetId": null, "timestamp": 1666691732542, "version": 2, "chainId": 84, "sender": "3N6yPEN3qNbKESnUewrj3EYVr6eLAd9AYBB", "senderPublicKey": "9RjLrGXy4wnGfNiZRhKSUh5wDnj5rLGPzbCE75KaVemg", "proofs": [ "2fmRfeD2QZvgwUYrSPD8XWeWmy8vAkT2f3sDaVpxaHq1sxS99CyZjjVuZviAhYh5SvfwQZ7JBGW8AeLSyYaL1Jcd" ], "script": "base64:BgJOCAISBAoCCAgSCQoHCAgICAgICBIKCggICAgICAgICBIGCgQICAgIEgcKBQgICAEBEggKBggICAgBARIFCgMIAQQSBQoDCAgIEgQKAggIKgAHVkVSU0lPTgIFMS4wLjABDmdldFN0cmluZ0J5S2V5AQNrZXkJAQt2YWx1ZU9yRWxzZQIJAJ0IAgUEdGhpcwUDa2V5AgAACHVzZXJEYXBwCQEFdmFsdWUBCQCmCAEJAQ5nZXRTdHJpbmdCeUtleQECD2NvbmZfdXNlcnNfZGFwcAALZmVlUmVjZWl2ZXIJAQ5nZXRTdHJpbmdCeUtleQECEWNvbmZfZmVlX3JlY2VpdmVyAAtzaWduQXNzZXRJZAkA2QQBCQEOZ2V0U3RyaW5nQnlLZXkBAhhjb25mX2FjY2VwdGVkX2Fzc2V0X1NJR04ABWNocmlzCQEOZ2V0U3RyaW5nQnlLZXkBAgxjb25mX2FkbWluXzEBD2dldEludGVnZXJCeUtleQEDa2V5CQELdmFsdWVPckVsc2UCCQCaCAIFBHRoaXMFA2tleQAAAQ9nZXRCb29sZWFuQnlLZXkBA2tleQkBC3ZhbHVlT3J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R0MDE1MjgzMTUzMTkCXzIDCQEBIQEJAQlpc0RlZmluZWQBCAUHcGF5bWVudAdhc3NldElkCQACAQIUV3JvbmcgYXNzZXQgYXR0YWNoZWQECHRpY2tldElkCQDYBAEJAQV2YWx1ZQEIBQdwYXltZW50B2Fzc2V0SWQECWFzc2V0TmFtZQQHJG1hdGNoMAkA7AcBCQEFdmFsdWUBCAUHcGF5bWVudAdhc3NldElkAwkAAQIFByRtYXRjaDACBUFzc2V0BAVhc3NldAUHJG1hdGNoMAgFBWFzc2V0BG5hbWUJAAIBAhBDYW4ndCBmaW5kIGFzc2V0BAt0aWNrZXRFeGlzdAkBDmdldFN0cmluZ0J5S2V5AQkBDWtleVRpY2tldE5hbWUDBQZpc3N1ZXIFB2V2ZW50SWQFCHRpY2tldElkAwkAAAIJALECAQULdGlja2V0RXhpc3QAAAkAAgECEFRpY2tldCBub3QgZm91bmQJAMwIAgkBDEJvb2xlYW5FbnRyeQIJAKwCAgUJYXNzZXROYW1lAgVfdXNlZAYJAMwIAgkBDlNjcmlwdFRyYW5zZmVyAwkBB0FkZHJlc3MBCQDZBAEFBmNhbGxlcgABCAUHcGF5bWVudAdhc3NldElkBQNuaWwAiBdp9w==", "height": 2287762, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: B8kSasrY3ieF7gbkMCo5bGiDtCvshSwkw1p1tmrSHe6h Next: 5QjGsxzgUYaRbMnTXRU9hZ2SjQUQoQpYNsYKdPNtWwAG Diff:
Old | New | Differences | |
---|---|---|---|
399 | 399 | let soldKey = ((((((((("ticket_sold_" + toString(newAmountSold)) + "_of_") + toString(maxCanSell)) + "_") + eventId) + "_") + issuer) + "_") + ticketId) | |
400 | 400 | let soldValue = ((((((((toString(receiveNFT) + "_") + toString(date)) + "_") + id) + "_") + toString(amount)) + "_") + toBase58String(idNFT)) | |
401 | 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)] | |
402 | + | let buyRes = [IntegerEntry(keyTicketSold(issuer, eventId, ticketId), newAmountSold), StringEntry(("nft_" + toBase58String(idNFT)), soldKey), IntegerEntry("total_nft_issued", (totalNFT + 1)), BooleanEntry((("ST_" + toString((totalNFT + 1))) + "_used"), false), BooleanEntry(keyTicketOnSale(issuer, eventId, ticketId), sellStatus), issueNFT, ScriptTransfer(Address(fromBase58String(issuer)), amountForOrganizer, assetId), ScriptTransfer(receiveNFT, 1, idNFT), ScriptTransfer(Address(fromBase58String(feeReceiver)), amountForSign, assetId)] | |
403 | 403 | soldData :: buyRes | |
404 | 404 | } | |
405 | 405 | } | |
408 | 408 | } | |
409 | 409 | ||
410 | 410 | ||
411 | + | ||
412 | + | @Callable(i) | |
413 | + | func useTicket (eventId,issuer) = { | |
414 | + | let $t01523915277 = idCallerDate(i) | |
415 | + | let id = $t01523915277._1 | |
416 | + | let caller = $t01523915277._2 | |
417 | + | let date = $t01523915277._3 | |
418 | + | let $t01528315319 = isPayment(i) | |
419 | + | let payment = $t01528315319._1 | |
420 | + | let amount = $t01528315319._2 | |
421 | + | if (!(isDefined(payment.assetId))) | |
422 | + | then throw("Wrong asset attached") | |
423 | + | else { | |
424 | + | let ticketId = toBase58String(value(payment.assetId)) | |
425 | + | let assetName = match assetInfo(value(payment.assetId)) { | |
426 | + | case asset: Asset => | |
427 | + | asset.name | |
428 | + | case _ => | |
429 | + | throw("Can't find asset") | |
430 | + | } | |
431 | + | let ticketExist = getStringByKey(keyTicketName(issuer, eventId, ticketId)) | |
432 | + | if ((size(ticketExist) == 0)) | |
433 | + | then throw("Ticket not found") | |
434 | + | else [BooleanEntry((assetName + "_used"), true), ScriptTransfer(Address(fromBase58String(caller)), 1, payment.assetId)] | |
435 | + | } | |
436 | + | } | |
437 | + | ||
438 | + |
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) = ("get_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,date) = { | |
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 (!(validateString(date, 1000))) | |
137 | 137 | then throw("1000 Char. max date") | |
138 | 138 | else if ((size(split(tags, ",")) > 5)) | |
139 | 139 | then throw("5 tags max.") | |
140 | 140 | else "" | |
141 | 141 | } | |
142 | 142 | ||
143 | 143 | ||
144 | 144 | func validateTicketData (eventId,caller,name,description,price,maxAvailable) = { | |
145 | 145 | let checkUser = validateUser(caller) | |
146 | 146 | if ((checkUser != "")) | |
147 | 147 | then throw(checkUser) | |
148 | 148 | else if (!(validateString(name, 200))) | |
149 | 149 | then throw("100 Char. max name") | |
150 | 150 | else if (!(validateString(description, 1000))) | |
151 | 151 | then throw("1000 Char. max description") | |
152 | 152 | else if (if (!(validateInt(price))) | |
153 | 153 | then true | |
154 | 154 | else !(validateInt(maxAvailable))) | |
155 | 155 | then throw("Positive amount only") | |
156 | 156 | else if (!(validateString(description, 1000))) | |
157 | 157 | then throw("1000 Char. max description") | |
158 | 158 | else "" | |
159 | 159 | } | |
160 | 160 | ||
161 | 161 | ||
162 | 162 | func idCallerDate (i) = if (!(dappRunning)) | |
163 | 163 | then throw(maintenanceMSG) | |
164 | 164 | else $Tuple3(toBase58String(i.transactionId), toBase58String(i.caller.bytes), lastBlock.timestamp) | |
165 | 165 | ||
166 | 166 | ||
167 | 167 | func isPayment (i) = if ((size(i.payments) == 0)) | |
168 | 168 | then throw("No payment attached") | |
169 | 169 | else { | |
170 | 170 | let payment = value(i.payments[0]) | |
171 | 171 | let amount = value(payment.amount) | |
172 | 172 | $Tuple2(payment, amount) | |
173 | 173 | } | |
174 | 174 | ||
175 | 175 | ||
176 | 176 | func validatePriceAssetId (i,priceAssetId,artworkPrice) = { | |
177 | 177 | let $t057825818 = isPayment(i) | |
178 | 178 | let payment = $t057825818._1 | |
179 | 179 | let amount = $t057825818._2 | |
180 | 180 | if (!(isDefined(payment.assetId))) | |
181 | 181 | then throw("Wrong asset attached") | |
182 | 182 | else { | |
183 | 183 | let assetId = if (if ((size(priceAssetId) > 0)) | |
184 | 184 | then (toBase58String(value(payment.assetId)) == priceAssetId) | |
185 | 185 | else false) | |
186 | 186 | then payment.assetId | |
187 | 187 | else throw("Wrong asset attached") | |
188 | 188 | if ((artworkPrice != amount)) | |
189 | 189 | then throw("Payment amount don't match") | |
190 | 190 | else $Tuple2(amount, assetId) | |
191 | 191 | } | |
192 | 192 | } | |
193 | 193 | ||
194 | 194 | ||
195 | 195 | @Callable(invoke) | |
196 | 196 | func setConf (key,val) = { | |
197 | 197 | let caller = toString(invoke.caller) | |
198 | 198 | if (containsElement([chris, toString(this)], caller)) | |
199 | 199 | then if (contains(key, "conf_")) | |
200 | 200 | then [StringEntry(key, val)] | |
201 | 201 | else throw("Entries starting with conf_ only") | |
202 | 202 | else throw("You are not allowed to change this") | |
203 | 203 | } | |
204 | 204 | ||
205 | 205 | ||
206 | 206 | ||
207 | 207 | @Callable(i) | |
208 | 208 | func addEvent (name,description,tags,cidDisplay,crawler,type,date) = { | |
209 | 209 | let $t066906739 = idCallerDate(i) | |
210 | 210 | let eventId = $t066906739._1 | |
211 | 211 | let caller = $t066906739._2 | |
212 | 212 | let addedDate = $t066906739._3 | |
213 | 213 | let checkUser = validateUser(caller) | |
214 | 214 | if ((checkUser != "")) | |
215 | 215 | then throw(checkUser) | |
216 | 216 | else { | |
217 | 217 | let validateEvent = validateEventData(caller, cidDisplay, name, description, tags, type, date) | |
218 | 218 | if ((validateEvent != "")) | |
219 | 219 | then throw("Something went wrong!") | |
220 | 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 | 221 | } | |
222 | 222 | } | |
223 | 223 | ||
224 | 224 | ||
225 | 225 | ||
226 | 226 | @Callable(i) | |
227 | 227 | func editEvent (eventId,name,description,tags,cidDisplay,crawler,type,date) = if (!(dappRunning)) | |
228 | 228 | then throw(maintenanceMSG) | |
229 | 229 | else { | |
230 | 230 | let caller = toBase58String(i.caller.bytes) | |
231 | 231 | let checkUser = validateUser(caller) | |
232 | 232 | if ((checkUser != "")) | |
233 | 233 | then throw(checkUser) | |
234 | 234 | else { | |
235 | 235 | let validateEvent = validateEventData(caller, cidDisplay, name, description, tags, type, date) | |
236 | 236 | if ((validateEvent != "")) | |
237 | 237 | then throw("Something went wrong!") | |
238 | 238 | else { | |
239 | 239 | let entryExist = getStringByKey(keyEventName(caller, eventId)) | |
240 | 240 | if ((entryExist == "")) | |
241 | 241 | then throw("Entry not found") | |
242 | 242 | else { | |
243 | 243 | let flag = getStringByKey(keyEventFlag(caller, eventId)) | |
244 | 244 | if ((flag == "ILLEGAL")) | |
245 | 245 | then throw("Cannot update ILLEGAL Event") | |
246 | 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 | 247 | } | |
248 | 248 | } | |
249 | 249 | } | |
250 | 250 | } | |
251 | 251 | ||
252 | 252 | ||
253 | 253 | ||
254 | 254 | @Callable(i) | |
255 | 255 | func flagEvent (eventId,addr,flag,note) = { | |
256 | 256 | let $t090099042 = idCallerDate(i) | |
257 | 257 | let id = $t090099042._1 | |
258 | 258 | let caller = $t090099042._2 | |
259 | 259 | if (containsElement([chris, toString(this)], caller)) | |
260 | 260 | then if (containsElement(["", "CHANGE_REQUIRED", "FLAGGED", "ILLEGAL"], flag)) | |
261 | 261 | then [StringEntry(keyEventFlag(addr, eventId), flag), StringEntry(keyEventNote(addr, eventId), note)] | |
262 | 262 | else throw(("Unknow status " + flag)) | |
263 | 263 | else throw("You are not allowed") | |
264 | 264 | } | |
265 | 265 | ||
266 | 266 | ||
267 | 267 | ||
268 | 268 | @Callable(i) | |
269 | 269 | func addTicket (eventId,name,description,price,maxAvailable) = { | |
270 | 270 | let $t095309570 = idCallerDate(i) | |
271 | 271 | let id = $t095309570._1 | |
272 | 272 | let caller = $t095309570._2 | |
273 | 273 | let date = $t095309570._3 | |
274 | 274 | let checkUser = validateUser(caller) | |
275 | 275 | if ((checkUser != "")) | |
276 | 276 | then throw(checkUser) | |
277 | 277 | else { | |
278 | 278 | let isEventOwner = getEventOwnerByEventId(eventId) | |
279 | 279 | if ((isEventOwner == "")) | |
280 | 280 | then throw("Event not found") | |
281 | 281 | else if ((isEventOwner != caller)) | |
282 | 282 | then throw("You are not the owner of this event") | |
283 | 283 | else { | |
284 | 284 | let validateTicket = validateTicketData(eventId, caller, name, description, price, maxAvailable) | |
285 | 285 | if ((validateTicket != "")) | |
286 | 286 | then throw("Something went wrong!") | |
287 | 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 | 288 | } | |
289 | 289 | } | |
290 | 290 | } | |
291 | 291 | ||
292 | 292 | ||
293 | 293 | ||
294 | 294 | @Callable(i) | |
295 | 295 | func editTicket (ticketId,eventId,name,description,price,maxAvailable) = { | |
296 | 296 | let $t01052610566 = idCallerDate(i) | |
297 | 297 | let id = $t01052610566._1 | |
298 | 298 | let caller = $t01052610566._2 | |
299 | 299 | let date = $t01052610566._3 | |
300 | 300 | let checkUser = validateUser(caller) | |
301 | 301 | if ((checkUser != "")) | |
302 | 302 | then throw(checkUser) | |
303 | 303 | else { | |
304 | 304 | let isEventOwner = getEventOwnerByEventId(eventId) | |
305 | 305 | if ((isEventOwner == "")) | |
306 | 306 | then throw("Event not found") | |
307 | 307 | else if ((isEventOwner != caller)) | |
308 | 308 | then throw("You are not the owner of this event") | |
309 | 309 | else { | |
310 | 310 | let ticketExist = getStringByKey(keyTicketName(caller, eventId, ticketId)) | |
311 | 311 | if ((size(ticketExist) == 0)) | |
312 | 312 | then throw("Ticket not found") | |
313 | 313 | else { | |
314 | 314 | let validateTicket = validateTicketData(eventId, caller, name, description, price, maxAvailable) | |
315 | 315 | if ((validateTicket != "")) | |
316 | 316 | then throw("Something went wrong!") | |
317 | 317 | else { | |
318 | 318 | let ticketSold = valueOrElse(getInteger(keyTicketSold(caller, eventId, ticketId)), 0) | |
319 | 319 | if ((ticketSold > maxAvailable)) | |
320 | 320 | then throw("Max tickets available cannot be lower than amount already sold") | |
321 | 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 | 322 | } | |
323 | 323 | } | |
324 | 324 | } | |
325 | 325 | } | |
326 | 326 | } | |
327 | 327 | ||
328 | 328 | ||
329 | 329 | ||
330 | 330 | @Callable(i) | |
331 | 331 | func pauseTicket (eventId,ticketId,status) = { | |
332 | 332 | let $t01183911879 = idCallerDate(i) | |
333 | 333 | let id = $t01183911879._1 | |
334 | 334 | let caller = $t01183911879._2 | |
335 | 335 | let date = $t01183911879._3 | |
336 | 336 | let checkUser = validateUser(caller) | |
337 | 337 | if ((checkUser != "")) | |
338 | 338 | then throw(checkUser) | |
339 | 339 | else { | |
340 | 340 | let isEventOwner = getEventOwnerByEventId(eventId) | |
341 | 341 | if ((isEventOwner == "")) | |
342 | 342 | then throw("Event not found") | |
343 | 343 | else if ((isEventOwner != caller)) | |
344 | 344 | then throw("You are not the owner of this event") | |
345 | 345 | else [BooleanEntry(keyTicketOnSale(caller, eventId, id), status)] | |
346 | 346 | } | |
347 | 347 | } | |
348 | 348 | ||
349 | 349 | ||
350 | 350 | ||
351 | 351 | @Callable(i) | |
352 | 352 | func buyTicket (ticketId,eventId,issuer) = { | |
353 | 353 | let $t01236012398 = idCallerDate(i) | |
354 | 354 | let id = $t01236012398._1 | |
355 | 355 | let caller = $t01236012398._2 | |
356 | 356 | let date = $t01236012398._3 | |
357 | 357 | let totalNFT = valueOrElse(getIntegerByKey("total_tickets_issued"), 0) | |
358 | 358 | let eventOwner = getEventOwnerByEventId(eventId) | |
359 | 359 | if ((eventOwner == "")) | |
360 | 360 | then throw("Event not found") | |
361 | 361 | else if ((eventOwner != issuer)) | |
362 | 362 | then throw("You are not the owner of this event") | |
363 | 363 | else { | |
364 | 364 | let ticketExist = getStringByKey(keyTicketName(issuer, eventId, ticketId)) | |
365 | 365 | if ((size(ticketExist) == 0)) | |
366 | 366 | then throw("Ticket not found") | |
367 | 367 | else { | |
368 | 368 | let eventName = getStringByKey(keyEventName(issuer, eventId)) | |
369 | 369 | if ((eventName == "")) | |
370 | 370 | then throw("Art doesn't exist") | |
371 | 371 | else { | |
372 | 372 | let isOnSale = getBooleanByKey(keyTicketOnSale(issuer, eventId, ticketId)) | |
373 | 373 | let amountSold = getIntegerByKey(keyTicketSold(issuer, eventId, ticketId)) | |
374 | 374 | let ticketPrice = getIntegerByKey(keyTicketPrice(issuer, eventId, ticketId)) | |
375 | 375 | let priceAssetId = toBase58String(signAssetId) | |
376 | 376 | let $t01331513389 = validatePriceAssetId(i, priceAssetId, ticketPrice) | |
377 | 377 | let amount = $t01331513389._1 | |
378 | 378 | let assetId = $t01331513389._2 | |
379 | 379 | let maxCanSell = getIntegerByKey(keyTicketMaxAvailable(issuer, eventId, ticketId)) | |
380 | 380 | let amountForSign = fraction(amount, signCut, 100) | |
381 | 381 | let amountForOrganizer = (amount - amountForSign) | |
382 | 382 | if ((amountSold == maxCanSell)) | |
383 | 383 | then throw("Art sold out") | |
384 | 384 | else { | |
385 | 385 | let newAmountSold = (amountSold + 1) | |
386 | 386 | let issueMeta = ((((((((((("Organizer: " + issuer) + ", | |
387 | 387 | EventID: ") + eventId) + ", | |
388 | 388 | TicketID: ") + ticketId) + ", | |
389 | 389 | EventName: ") + eventName) + ", | |
390 | 390 | Issue: ") + toString(newAmountSold)) + "/") + toString(maxCanSell)) | |
391 | 391 | let issueNFT = Issue(("ST_" + toString((totalNFT + 1))), issueMeta, 1, 0, false) | |
392 | 392 | let idNFT = calculateAssetId(issueNFT) | |
393 | 393 | let sellStatus = if (if ((newAmountSold == maxCanSell)) | |
394 | 394 | then true | |
395 | 395 | else !(isOnSale)) | |
396 | 396 | then false | |
397 | 397 | else true | |
398 | 398 | let receiveNFT = i.caller | |
399 | 399 | let soldKey = ((((((((("ticket_sold_" + toString(newAmountSold)) + "_of_") + toString(maxCanSell)) + "_") + eventId) + "_") + issuer) + "_") + ticketId) | |
400 | 400 | let soldValue = ((((((((toString(receiveNFT) + "_") + toString(date)) + "_") + id) + "_") + toString(amount)) + "_") + toBase58String(idNFT)) | |
401 | 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)] | |
402 | + | let buyRes = [IntegerEntry(keyTicketSold(issuer, eventId, ticketId), newAmountSold), StringEntry(("nft_" + toBase58String(idNFT)), soldKey), IntegerEntry("total_nft_issued", (totalNFT + 1)), BooleanEntry((("ST_" + toString((totalNFT + 1))) + "_used"), false), BooleanEntry(keyTicketOnSale(issuer, eventId, ticketId), sellStatus), issueNFT, ScriptTransfer(Address(fromBase58String(issuer)), amountForOrganizer, assetId), ScriptTransfer(receiveNFT, 1, idNFT), ScriptTransfer(Address(fromBase58String(feeReceiver)), amountForSign, assetId)] | |
403 | 403 | soldData :: buyRes | |
404 | 404 | } | |
405 | 405 | } | |
406 | 406 | } | |
407 | 407 | } | |
408 | 408 | } | |
409 | 409 | ||
410 | 410 | ||
411 | + | ||
412 | + | @Callable(i) | |
413 | + | func useTicket (eventId,issuer) = { | |
414 | + | let $t01523915277 = idCallerDate(i) | |
415 | + | let id = $t01523915277._1 | |
416 | + | let caller = $t01523915277._2 | |
417 | + | let date = $t01523915277._3 | |
418 | + | let $t01528315319 = isPayment(i) | |
419 | + | let payment = $t01528315319._1 | |
420 | + | let amount = $t01528315319._2 | |
421 | + | if (!(isDefined(payment.assetId))) | |
422 | + | then throw("Wrong asset attached") | |
423 | + | else { | |
424 | + | let ticketId = toBase58String(value(payment.assetId)) | |
425 | + | let assetName = match assetInfo(value(payment.assetId)) { | |
426 | + | case asset: Asset => | |
427 | + | asset.name | |
428 | + | case _ => | |
429 | + | throw("Can't find asset") | |
430 | + | } | |
431 | + | let ticketExist = getStringByKey(keyTicketName(issuer, eventId, ticketId)) | |
432 | + | if ((size(ticketExist) == 0)) | |
433 | + | then throw("Ticket not found") | |
434 | + | else [BooleanEntry((assetName + "_used"), true), ScriptTransfer(Address(fromBase58String(caller)), 1, payment.assetId)] | |
435 | + | } | |
436 | + | } | |
437 | + | ||
438 | + |
github/deemru/w8io/169f3d6 56.27 ms ◑