tx · 3i1VawnMfgAgY9TxnX3DNhrExGy6pGT1fBa8zSWVD6kH 3N1PhK7vobC3HzVcYu1HEysKMvJDS8u9w99: -0.01400000 Waves 2022.10.22 11:48 [2283382] smart account 3N1PhK7vobC3HzVcYu1HEysKMvJDS8u9w99 > SELF 0.00000000 Waves
{ "type": 13, "id": "3i1VawnMfgAgY9TxnX3DNhrExGy6pGT1fBa8zSWVD6kH", "fee": 1400000, "feeAssetId": null, "timestamp": 1666428564790, "version": 2, "chainId": 84, "sender": "3N1PhK7vobC3HzVcYu1HEysKMvJDS8u9w99", "senderPublicKey": "HXPToVX68cRVQojFPvq2UHkNvBcMWbQXfTZtjim9UrfE", "proofs": [ "4JxuMUcRGkgCAUJBmwkx5g6ciZV6cfRnDpWWAi6FBjmH7TxaWh1KuX9Y1kBz9m6Bce1Sfciaubw4z7tjqBxRth1B" ], "script": "base64:BgI/CAISBAoCCAgSCAoGCAgICAgIEgkKBwgICAgICAgSBgoECAgICBIHCgUICAgBARIICgYICAgIAQESBQoDCAgIKgAHVkVSU0lPTgIFMS4wLjABDmdldFN0cmluZ0J5S2V5AQNrZXkJAQt2YWx1ZU9yRWxzZQIJAJ0IAgUEdGhpcwUDa2V5AgAACHVzZXJEYXBwCQEFdmFsdWUBCQCmCAEJAQ5nZXRTdHJpbmdCeUtleQECD2NvbmZfdXNlcnNfZGFwcAALZmVlUmVjZWl2ZXIJAQ5nZXRTdHJpbmdCeUtleQECEWNvbmZfZmVlX3JlY2VpdmVyAAtzaWduQXNzZXRJZAkA2QQBCQEOZ2V0U3RyaW5nQnlLZXkBAhhjb25mX2FjY2VwdGVkX2Fzc2V0X1NJR04ABWNocmlzCQEOZ2V0U3RyaW5nQnlLZXkBAgxjb25mX2FkbWluXzEBD2dldEludGVnZXJCeUtleQEDa2V5CQELdmFsdWVPckVsc2UCCQCaCAIFBHRoaXMFA2tleQAAAQ9nZXRCb29sZWFuQnlLZXkBA2tleQkBC3ZhbHVlT3JFbHNlAgkAmwgCBQ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IFB3NvbGRLZXkFCXNvbGRWYWx1ZQQGYnV5UmVzCQDMCAIJAQxJbnRlZ2VyRW50cnkCCQENa2V5VGlja2V0U29sZAMFBmlzc3VlcgUHZXZlbnRJZAUIdGlja2V0SWQFDW5ld0Ftb3VudFNvbGQJAMwIAgkBC1N0cmluZ0VudHJ5AgkArAICAgRuZnRfCQDYBAEFBWlkTkZUBQdzb2xkS2V5CQDMCAIJAQxJbnRlZ2VyRW50cnkCAhB0b3RhbF9uZnRfaXNzdWVkCQBkAgUIdG90YWxORlQAAQkAzAgCCQEMQm9vbGVhbkVudHJ5AgkBD2tleVRpY2tldE9uU2FsZQMFBmlzc3VlcgUHZXZlbnRJZAUIdGlja2V0SWQFCnNlbGxTdGF0dXMJAMwIAgUIaXNzdWVORlQJAMwIAgkBDlNjcmlwdFRyYW5zZmVyAwkBB0FkZHJlc3MBCQDZBAEFBmlzc3VlcgUSYW1vdW50Rm9yT3JnYW5pemVyBQdhc3NldElkCQDMCAIJAQ5TY3JpcHRUcmFuc2ZlcgMFCnJlY2VpdmVORlQAAQUFaWRORlQJAMwIAgkBDlNjcmlwdFRyYW5zZmVyAwkBB0FkZHJlc3MBCQDZBAEFC2ZlZVJlY2VpdmVyBQ1hbW91bnRGb3JTaWduBQdhc3NldElkBQNuaWwJAMwIAgUIc29sZERhdGEFBmJ1eVJlcwAf+IsQ", "height": 2283382, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: none Next: 26ARptrS4i5TD8twt1BvpgX9JeNjbqzexfzupwPwuRLN Full:
Old | New | Differences | |
---|---|---|---|
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) = { | |
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 ((size(split(tags, ",")) > 5)) | |
137 | + | then throw("5 tags max.") | |
138 | + | else "" | |
139 | + | } | |
140 | + | ||
141 | + | ||
142 | + | func validateTicketData (eventId,caller,name,description,price,maxAvailable) = { | |
143 | + | let checkUser = validateUser(caller) | |
144 | + | if ((checkUser != "")) | |
145 | + | then throw(checkUser) | |
146 | + | else if (!(validateString(name, 200))) | |
147 | + | then throw("100 Char. max name") | |
148 | + | else if (!(validateString(description, 1000))) | |
149 | + | then throw("1000 Char. max description") | |
150 | + | else if (if (!(validateInt(price))) | |
151 | + | then true | |
152 | + | else !(validateInt(maxAvailable))) | |
153 | + | then throw("Positive amount only") | |
154 | + | else if (!(validateString(description, 1000))) | |
155 | + | then throw("1000 Char. max description") | |
156 | + | else "" | |
157 | + | } | |
158 | + | ||
159 | + | ||
160 | + | func idCallerDate (i) = if (!(dappRunning)) | |
161 | + | then throw(maintenanceMSG) | |
162 | + | else $Tuple3(toBase58String(i.transactionId), toBase58String(i.caller.bytes), lastBlock.timestamp) | |
163 | + | ||
164 | + | ||
165 | + | func isPayment (i) = if ((size(i.payments) == 0)) | |
166 | + | then throw("No payment attached") | |
167 | + | else { | |
168 | + | let payment = value(i.payments[0]) | |
169 | + | let amount = value(payment.amount) | |
170 | + | $Tuple2(payment, amount) | |
171 | + | } | |
172 | + | ||
173 | + | ||
174 | + | func validatePriceAssetId (i,priceAssetId,artworkPrice) = { | |
175 | + | let $t056885724 = isPayment(i) | |
176 | + | let payment = $t056885724._1 | |
177 | + | let amount = $t056885724._2 | |
178 | + | if (!(isDefined(payment.assetId))) | |
179 | + | then throw("Wrong asset attached") | |
180 | + | else { | |
181 | + | let assetId = if (if ((size(priceAssetId) > 0)) | |
182 | + | then (toBase58String(value(payment.assetId)) == priceAssetId) | |
183 | + | else false) | |
184 | + | then payment.assetId | |
185 | + | else throw("Wrong asset attached") | |
186 | + | if ((artworkPrice != amount)) | |
187 | + | then throw("Payment amount don't match") | |
188 | + | else $Tuple2(amount, assetId) | |
189 | + | } | |
190 | + | } | |
191 | + | ||
192 | + | ||
193 | + | @Callable(invoke) | |
194 | + | func setConf (key,val) = { | |
195 | + | let caller = toString(invoke.caller) | |
196 | + | if (containsElement([chris, toString(this)], caller)) | |
197 | + | then if (contains(key, "conf_")) | |
198 | + | then [StringEntry(key, val)] | |
199 | + | else throw("Entries starting with conf_ only") | |
200 | + | else throw("You are not allowed to change this") | |
201 | + | } | |
202 | + | ||
203 | + | ||
204 | + | ||
205 | + | @Callable(i) | |
206 | + | func addEvent (name,description,tags,cidDisplay,crawler,type) = { | |
207 | + | let $t065826625 = idCallerDate(i) | |
208 | + | let eventId = $t065826625._1 | |
209 | + | let caller = $t065826625._2 | |
210 | + | let date = $t065826625._3 | |
211 | + | let checkUser = validateUser(caller) | |
212 | + | if ((checkUser != "")) | |
213 | + | then throw(checkUser) | |
214 | + | else { | |
215 | + | let validateEvent = validateEventData(caller, cidDisplay, name, description, tags, type) | |
216 | + | if ((validateEvent != "")) | |
217 | + | then throw("Something went wrong!") | |
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 | + | } | |
220 | + | } | |
221 | + | ||
222 | + | ||
223 | + | ||
224 | + | @Callable(i) | |
225 | + | func editEvent (eventId,name,description,tags,cidDisplay,crawler,type) = if (!(dappRunning)) | |
226 | + | then throw(maintenanceMSG) | |
227 | + | else { | |
228 | + | let caller = toBase58String(i.caller.bytes) | |
229 | + | let checkUser = validateUser(caller) | |
230 | + | if ((checkUser != "")) | |
231 | + | then throw(checkUser) | |
232 | + | else { | |
233 | + | let validateEvent = validateEventData(caller, cidDisplay, name, description, tags, type) | |
234 | + | if ((validateEvent != "")) | |
235 | + | then throw("Something went wrong!") | |
236 | + | else { | |
237 | + | let entryExist = getStringByKey(keyEventName(caller, eventId)) | |
238 | + | if ((entryExist == "")) | |
239 | + | then throw("Entry not found") | |
240 | + | else { | |
241 | + | let flag = getStringByKey(keyEventFlag(caller, eventId)) | |
242 | + | if ((flag == "ILLEGAL")) | |
243 | + | then throw("Cannot update ILLEGAL Event") | |
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 | + | } | |
246 | + | } | |
247 | + | } | |
248 | + | } | |
249 | + | ||
250 | + | ||
251 | + | ||
252 | + | @Callable(i) | |
253 | + | func flagEvent (eventId,addr,flag,note) = { | |
254 | + | let $t087138746 = idCallerDate(i) | |
255 | + | let id = $t087138746._1 | |
256 | + | let caller = $t087138746._2 | |
257 | + | if (containsElement([chris, toString(this)], caller)) | |
258 | + | then if (containsElement(["", "CHANGE_REQUIRED", "FLAGGED", "ILLEGAL"], flag)) | |
259 | + | then [StringEntry(keyEventFlag(addr, eventId), flag), StringEntry(keyEventNote(addr, eventId), note)] | |
260 | + | else throw(("Unknow status " + flag)) | |
261 | + | else throw("You are not allowed") | |
262 | + | } | |
263 | + | ||
264 | + | ||
265 | + | ||
266 | + | @Callable(i) | |
267 | + | func addTicket (eventId,name,description,price,maxAvailable) = { | |
268 | + | let $t092349274 = idCallerDate(i) | |
269 | + | let id = $t092349274._1 | |
270 | + | let caller = $t092349274._2 | |
271 | + | let date = $t092349274._3 | |
272 | + | let checkUser = validateUser(caller) | |
273 | + | if ((checkUser != "")) | |
274 | + | then throw(checkUser) | |
275 | + | else { | |
276 | + | let isEventOwner = getEventOwnerByEventId(eventId) | |
277 | + | if ((isEventOwner == "")) | |
278 | + | then throw("Event not found") | |
279 | + | else if ((isEventOwner != caller)) | |
280 | + | then throw("You are not the owner of this event") | |
281 | + | else { | |
282 | + | let validateTicket = validateTicketData(eventId, caller, name, description, price, maxAvailable) | |
283 | + | if ((validateTicket != "")) | |
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)] | |
286 | + | } | |
287 | + | } | |
288 | + | } | |
289 | + | ||
290 | + | ||
291 | + | ||
292 | + | @Callable(i) | |
293 | + | func editTicket (ticketId,eventId,name,description,price,maxAvailable) = { | |
294 | + | let $t01016610206 = idCallerDate(i) | |
295 | + | let id = $t01016610206._1 | |
296 | + | let caller = $t01016610206._2 | |
297 | + | let date = $t01016610206._3 | |
298 | + | let checkUser = validateUser(caller) | |
299 | + | if ((checkUser != "")) | |
300 | + | then throw(checkUser) | |
301 | + | else { | |
302 | + | let isEventOwner = getEventOwnerByEventId(eventId) | |
303 | + | if ((isEventOwner == "")) | |
304 | + | then throw("Event not found") | |
305 | + | else if ((isEventOwner != caller)) | |
306 | + | then throw("You are not the owner of this event") | |
307 | + | else { | |
308 | + | let ticketExist = getStringByKey(keyTicketName(caller, eventId, ticketId)) | |
309 | + | if ((size(ticketExist) == 0)) | |
310 | + | then throw("Ticket not found") | |
311 | + | else { | |
312 | + | let validateTicket = validateTicketData(eventId, caller, name, description, price, maxAvailable) | |
313 | + | if ((validateTicket != "")) | |
314 | + | then throw("Something went wrong!") | |
315 | + | else { | |
316 | + | let ticketSold = valueOrElse(getInteger(keyTicketSold(caller, eventId, ticketId)), 0) | |
317 | + | if ((ticketSold > maxAvailable)) | |
318 | + | then throw("Max tickets available cannot be lower than amount already sold") | |
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 | + | } | |
321 | + | } | |
322 | + | } | |
323 | + | } | |
324 | + | } | |
325 | + | ||
326 | + | ||
327 | + | ||
328 | + | @Callable(i) | |
329 | + | func buyTicket (ticketId,eventId,issuer) = { | |
330 | + | let $t01149511533 = idCallerDate(i) | |
331 | + | let id = $t01149511533._1 | |
332 | + | let caller = $t01149511533._2 | |
333 | + | let date = $t01149511533._3 | |
334 | + | let totalNFT = valueOrElse(getIntegerByKey("total_tickets_issued"), 0) | |
335 | + | let eventOwner = getEventOwnerByEventId(eventId) | |
336 | + | if ((eventOwner == "")) | |
337 | + | then throw("Event not found") | |
338 | + | else if ((eventOwner != issuer)) | |
339 | + | then throw("You are not the owner of this event") | |
340 | + | else { | |
341 | + | let ticketExist = getStringByKey(keyTicketName(issuer, eventId, ticketId)) | |
342 | + | if ((size(ticketExist) == 0)) | |
343 | + | then throw("Ticket not found") | |
344 | + | else { | |
345 | + | let eventName = getStringByKey(keyEventName(issuer, eventId)) | |
346 | + | if ((eventName == "")) | |
347 | + | then throw("Art doesn't exist") | |
348 | + | else { | |
349 | + | let isOnSale = getBooleanByKey(keyTicketOnSale(issuer, eventId, ticketId)) | |
350 | + | let amountSold = getIntegerByKey(keyTicketSold(issuer, eventId, ticketId)) | |
351 | + | let ticketPrice = getIntegerByKey(keyTicketPrice(issuer, eventId, ticketId)) | |
352 | + | let priceAssetId = toBase58String(signAssetId) | |
353 | + | let $t01245012524 = validatePriceAssetId(i, priceAssetId, ticketPrice) | |
354 | + | let amount = $t01245012524._1 | |
355 | + | let assetId = $t01245012524._2 | |
356 | + | let maxCanSell = getIntegerByKey(keyTicketMaxAvailable(issuer, eventId, ticketId)) | |
357 | + | let amountForSign = fraction(amount, signCut, 100) | |
358 | + | let amountForOrganizer = (amount - amountForSign) | |
359 | + | if ((amountSold == maxCanSell)) | |
360 | + | then throw("Art sold out") | |
361 | + | else { | |
362 | + | let newAmountSold = (amountSold + 1) | |
363 | + | let issueMeta = ((((((((((("Organizer: " + issuer) + ", | |
364 | + | EventID: ") + eventId) + ", | |
365 | + | TicketID: ") + ticketId) + ", | |
366 | + | EventName: ") + eventName) + ", | |
367 | + | Issue: ") + toString(newAmountSold)) + "/") + toString(maxCanSell)) | |
368 | + | let issueNFT = Issue(("ST_" + toString((totalNFT + 1))), issueMeta, 1, 0, false) | |
369 | + | let idNFT = calculateAssetId(issueNFT) | |
370 | + | let sellStatus = if (if ((newAmountSold == maxCanSell)) | |
371 | + | then true | |
372 | + | else !(isOnSale)) | |
373 | + | then false | |
374 | + | else true | |
375 | + | let receiveNFT = i.caller | |
376 | + | let soldKey = ((((((((("ticket_sold_" + toString(newAmountSold)) + "_of_") + toString(maxCanSell)) + "_") + eventId) + "_") + issuer) + "_") + ticketId) | |
377 | + | let soldValue = ((((((((toString(receiveNFT) + "_") + toString(date)) + "_") + id) + "_") + toString(amount)) + "_") + toBase58String(idNFT)) | |
378 | + | let soldData = StringEntry(soldKey, soldValue) | |
379 | + | 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 | + | soldData :: buyRes | |
381 | + | } | |
382 | + | } | |
383 | + | } | |
384 | + | } | |
385 | + | } | |
386 | + | ||
387 | + |
github/deemru/w8io/169f3d6 33.69 ms ◑