tx · 44B9YfDAxiv2YeGa3hyY6q1fNCBnLqWzFNSpykXQtiqT

3MrWmZaT2EbepZbjCUMCZUaoaVLdJyuF1GS:  -0.01300000 Waves

2022.11.03 14:07 [2300856] smart account 3MrWmZaT2EbepZbjCUMCZUaoaVLdJyuF1GS > SELF 0.00000000 Waves

{ "type": 13, "id": "44B9YfDAxiv2YeGa3hyY6q1fNCBnLqWzFNSpykXQtiqT", "fee": 1300000, "feeAssetId": null, "timestamp": 1667473690575, "version": 2, "chainId": 84, "sender": "3MrWmZaT2EbepZbjCUMCZUaoaVLdJyuF1GS", "senderPublicKey": "4P3GWdtoxzZm4hgroUCqWxduGY1Zg1LPMMz6SWPc9gMi", "proofs": [ "4qUnjoTHNtY3D5Ln1EbEDPgtvbzCsG2sfmiX6YgQRHCnpcdZ86w1iNv3nqqbA1ZHw4UybcFqBEYpiD659UHBvPhz" ], "script": "base64:BgI4CAISBAoCCAgSBAoCBAgSAwoBARIECgIIARIDCgEIEgMKAQgSAwoBCBIFCgMICAgSBwoFCAgICAgpAAdWRVJTSU9OAgUxLjAuMAEJZ2V0U3RyQnlLAQNrZXkJAQt2YWx1ZU9yRWxzZQIJAJ0IAgUEdGhpcwUDa2V5AgAAC2ZlZVJlY2VpdmVyCQEJZ2V0U3RyQnlLAQIRY29uZl9mZWVfcmVjZWl2ZXIACmV2ZW50c0RhcHAJAQV2YWx1ZQEJAKYIAQkBCWdldFN0ckJ5SwECEGNvbmZfZXZlbnRzX2RhcHAACHVzZXJEYXBwCQEFdmFsdWUBCQCmCAEJAQlnZXRTdHJCeUsBAg9jb25mX3VzZXJzX2RhcHAAC3NpZ25Bc3NldElkCQDZBAEJAQlnZXRTdHJCeUsBAhhjb25mX2FjY2VwdGVkX2Fzc2V0X1NJR04ABWNocmlzCQEJZ2V0U3RyQnlLAQIMY29uZl9hZG1pbl8xAAdzaWduQ3V0AAMADG9yZ2FuaXplckN1dAAKAA11c2VyU3VzcGVuZGVkAglTVVNQRU5ERUQADGV2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YXRhAgtfQ0FOQ0VMTEVEXwkApAMBBQRkYXRlAgFfBQJpZAkAzAgCCQEOU2NyaXB0VHJhbnNmZXIDCQEHQWRkcmVzcwEJANkEAQUGY2FsbGVyCQENcGFyc2VJbnRWYWx1ZQEJAJEDAgUKYmlkRGF0YUFycgABBQdhc3NldElkBQNuaWwAPfqFeA==", "height": 2300856, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 6QGjizNy9AsStvktpSqGGfxdxCtTfFwu8ihg2DZuAjyo Next: none Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let VERSION = "1.0.0"
55
66 func getStrByK (key) = valueOrElse(getString(this, key), "")
77
88
99 let feeReceiver = getStrByK("conf_fee_receiver")
1010
1111 let eventsDapp = value(addressFromString(getStrByK("conf_events_dapp")))
1212
1313 let userDapp = value(addressFromString(getStrByK("conf_users_dapp")))
1414
1515 let signAssetId = fromBase58String(getStrByK("conf_accepted_asset_SIGN"))
1616
1717 let chris = getStrByK("conf_admin_1")
1818
1919 let signCut = 3
2020
2121 let organizerCut = 10
2222
2323 let userSuspended = "SUSPENDED"
2424
2525 let eventIllegal = "ILLEGAL"
2626
2727 let eventSuspended = "SUSPENDED"
2828
2929 let dappRunningKey = "conf_dapp_is_running"
3030
3131 let maintenanceMSGKey = "conf_maintenance_msg"
3232
3333 let dappRunning = valueOrElse(getBoolean(this, dappRunningKey), true)
3434
3535 let maintenanceMSG = valueOrElse(getString(this, maintenanceMSGKey), "")
3636
3737 let numSalesK = "num_sales"
3838
3939 func getUserStrByK (key) = valueOrElse(getString(userDapp, key), "Error")
4040
4141
4242 func getEventStrByK (key) = valueOrElse(getString(eventsDapp, key), "")
4343
4444
4545 func getIntByK (key) = valueOrElse(getInteger(this, key), 0)
4646
4747
4848 func keyUserStatus (addr) = ("user_status_" + addr)
4949
5050
5151 func keyFlag (organizerAddr,eventId) = ((("event_flag_" + eventId) + "_") + organizerAddr)
5252
5353
5454 func keyNFTData (id) = ("nft_" + id)
5555
5656
5757 func getSaleKey (caller,ticketId,eventId,organizerAddr,nftId) = ((((((((("sale2nd_info_" + caller) + "_") + ticketId) + "_") + eventId) + "_") + organizerAddr) + "_") + nftId)
5858
5959
6060 func getBidKey (offerOwner,ticketId,saleOwner,offerId,nftId) = ((((((((("offer2nd_" + offerOwner) + "_") + ticketId) + "_") + saleOwner) + "_") + offerId) + "_") + nftId)
6161
6262
6363 func idCallerDate (i) = if (!(dappRunning))
6464 then throw(maintenanceMSG)
6565 else $Tuple3(toBase58String(i.transactionId), toBase58String(i.caller.bytes), lastBlock.timestamp)
6666
6767
6868 func isPayment (i) = if ((size(i.payments) == 0))
6969 then throw("No payment attached")
7070 else {
7171 let payment = value(i.payments[0])
7272 let amount = value(payment.amount)
7373 $Tuple2(payment, amount)
7474 }
7575
7676
7777 func assetIsValid (assetDetails) = if (if (if ((assetDetails.quantity == 1))
7878 then (assetDetails.decimals == 0)
7979 else false)
8080 then (assetDetails.reissuable == false)
8181 else false)
8282 then (assetDetails.issuer == eventsDapp)
8383 else false
8484
8585
8686 func isSignEventNFT (id) = {
8787 let assetDetails = value(assetInfo(id))
8888 assetIsValid(assetDetails)
8989 }
9090
9191
9292 func acceptedAssetIds (assetId) = if ((assetId != toBase58String(signAssetId)))
9393 then false
9494 else true
9595
9696
9797 func getBidAssetId (assetId) = fromBase58String(assetId)
9898
9999
100100 func getSaleOwnerAndStatus (ticketId) = {
101101 let saleOwner = getStrByK(("current_owner_on_dapp_" + ticketId))
102102 if ((size(saleOwner) == 0))
103103 then throw("Ticket not found")
104104 else {
105105 let saleStatus = getStrByK(((("sale2nd_status_" + saleOwner) + "_") + ticketId))
106106 if ((saleStatus != "OPEN"))
107107 then throw("Ticket not for sale")
108108 else saleOwner
109109 }
110110 }
111111
112112
113113 func getBidData (key) = {
114114 let bidData = getStrByK((key + "_OPEN"))
115115 if ((bidData == ""))
116116 then throw("Offer not found")
117117 else {
118118 let bidDataArr = split(bidData, "_")
119119 let assetId = getBidAssetId(bidDataArr[2])
120120 $Tuple3(bidDataArr, assetId, bidData)
121121 }
122122 }
123123
124124
125125 func eventIsValid (eventStatus) = if ((eventStatus != eventIllegal))
126126 then (eventStatus != eventSuspended)
127127 else false
128128
129129
130130 func checkEventStatus (addr,id) = {
131131 let eventStatus = getEventStrByK(keyFlag(addr, id))
132132 if (eventIsValid(eventStatus))
133133 then true
134134 else throw(("Original event flagged as " + eventStatus))
135135 }
136136
137137
138138 func checkOrganizerStatus (addr) = {
139139 let organizerStatus = getUserStrByK(keyUserStatus(addr))
140140 if (containsElement([userSuspended], organizerStatus))
141141 then throw(("Original organizer " + organizerStatus))
142142 else true
143143 }
144144
145145
146146 func checkNFTInfo (assetId) = {
147147 let nftData = split(getEventStrByK(keyNFTData(assetId)), "_")
148148 if (if (!(checkEventStatus(nftData[6], nftData[5])))
149149 then !(checkOrganizerStatus(nftData[6]))
150150 else false)
151151 then $Tuple4(false, nftData[5], nftData[6], nftData[7])
152152 else $Tuple4(true, nftData[5], nftData[6], nftData[7])
153153 }
154154
155155
156156 func checkEVENTExist (eventId,organizerAddr) = if (if (!(checkEventStatus(organizerAddr, eventId)))
157157 then !(checkOrganizerStatus(organizerAddr))
158158 else false)
159159 then false
160160 else true
161161
162162
163163 func setTransfers (amount,assetId,nftId,organizerAddr,saleOwner,caller) = {
164164 let amountForSign = fraction(amount, signCut, 100)
165165 let amountForOrganizer = fraction(amount, organizerCut, 100)
166166 let amountForOwner = (amount - (amountForSign + amountForOrganizer))
167167 let commissions = [ScriptTransfer(Address(fromBase58String(feeReceiver)), amountForSign, assetId)]
168168 let organizerFee = ScriptTransfer(Address(fromBase58String(organizerAddr)), amountForOrganizer, assetId)
169169 let ownerFee = ScriptTransfer(Address(fromBase58String(saleOwner)), amountForOwner, assetId)
170170 let collectorNFT = ScriptTransfer(Address(fromBase58String(caller)), 1, fromBase58String(nftId))
171171 $Tuple4(commissions, organizerFee, ownerFee, collectorNFT)
172172 }
173173
174174
175175 func provideBaseData (i,nftId) = {
176176 let $t058355874 = idCallerDate(i)
177177 let id = $t058355874._1
178178 let caller = $t058355874._2
179179 let date = $t058355874._3
180180 let $t058775949 = checkNFTInfo(nftId)
181181 let isValidNFT = $t058775949._1
182182 let eventId = $t058775949._2
183183 let organizerAddr = $t058775949._3
184184 let ticketId = $t058775949._4
185185 $Tuple7(id, caller, date, isValidNFT, eventId, organizerAddr, ticketId)
186186 }
187187
188188
189189 func updateNumSales () = {
190190 let numSales = getIntByK(numSalesK)
191191 IntegerEntry(numSalesK, (numSales + 1))
192192 }
193193
194194
195195 @Callable(invoke)
196196 func setConf (key,val) = {
197197 let caller = toString(invoke.caller)
198198 if (containsElement([chris, toString(this)], caller))
199199 then if (contains(key, "conf_"))
200200 then [StringEntry(key, val)]
201201 else throw("Entries starting with conf_ only")
202202 else throw("You are not allowed to change this")
203203 }
204204
205205
206206
207207 @Callable(invoke)
208208 func appRunning (isLive,message) = {
209209 let caller = toString(invoke.caller)
210210 let id = toBase58String(invoke.transactionId)
211211 if (containsElement([chris, toString(this)], caller))
212212 then [BooleanEntry(dappRunningKey, isLive), StringEntry(maintenanceMSGKey, message)]
213213 else throw("You are not allowed to change this")
214214 }
215215
216216
217217
218218 @Callable(i)
219219 func sellNFT (price) = {
220220 let $t070027038 = isPayment(i)
221221 let payment = $t070027038._1
222222 let amount = $t070027038._2
223223 if ((amount != 1))
224224 then throw("No Ticket attached")
225225 else {
226226 let nftId = if (if (isDefined(payment.assetId))
227227 then isSignEventNFT(value(payment.assetId))
228228 else false)
229229 then toBase58String(value(payment.assetId))
230230 else throw("Only SIGN Event NFT accepted.")
231231 let $t072797374 = provideBaseData(i, nftId)
232232 let id = $t072797374._1
233233 let caller = $t072797374._2
234234 let date = $t072797374._3
235235 let isValidNFT = $t072797374._4
236236 let eventId = $t072797374._5
237237 let organizerAddr = $t072797374._6
238238 let ticketId = $t072797374._7
239239 if (!(isValidNFT))
240240 then throw("Not a valid ticket")
241241 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)]
242242 }
243243 }
244244
245245
246246
247247 @Callable(i)
248248 func updateSalePrice (nftId,price) = {
249249 let $t079128007 = provideBaseData(i, nftId)
250250 let id = $t079128007._1
251251 let caller = $t079128007._2
252252 let date = $t079128007._3
253253 let isValidNFT = $t079128007._4
254254 let eventId = $t079128007._5
255255 let organizerAddr = $t079128007._6
256256 let ticketId = $t079128007._7
257257 if (!(isValidNFT))
258258 then throw("Not a valid ticket")
259259 else {
260260 let saleOwner = getStrByK(("current_owner_on_dapp_" + nftId))
261261 if ((saleOwner != caller))
262262 then throw("You don't own this ticket")
263263 else {
264264 let saleStatus = getStrByK(((("sale2nd_status_" + caller) + "_") + nftId))
265265 if ((saleStatus != "OPEN"))
266266 then throw("Sale not active")
267267 else {
268268 let saleKey = getSaleKey(caller, ticketId, eventId, organizerAddr, nftId)
269269 let saleInfo = split(getStrByK((saleKey + "_OPEN")), "_")
270270 [StringEntry((saleKey + "_OPEN"), ((((((((((((((saleInfo[0] + "_") + toString(price)) + "_") + toBase58String(signAssetId)) + "_") + saleInfo[3]) + "_") + saleInfo[4]) + "_") + saleInfo[5]) + "_") + saleInfo[6]) + "_") + saleInfo[7]))]
271271 }
272272 }
273273 }
274274 }
275275
276276
277277
278278 @Callable(i)
279279 func cancelSale (nftId) = {
280280 let $t089409183 = provideBaseData(i, nftId)
281281 let id = $t089409183._1
282282 let caller = $t089409183._2
283283 let date = $t089409183._3
284284 let isValidNFT = $t089409183._4
285285 let eventId = $t089409183._5
286286 let organizerAddr = $t089409183._6
287287 let ticketId = $t089409183._7
288288 let saleOwner = getStrByK(("current_owner_on_dapp_" + nftId))
289289 if ((saleOwner != caller))
290290 then throw("You don't own this ticket")
291291 else {
292292 let saleStatus = getStrByK(((("sale2nd_status_" + caller) + "_") + nftId))
293293 if ((saleStatus != "OPEN"))
294294 then throw("Sale not active")
295295 else {
296296 let saleKey = getSaleKey(caller, ticketId, eventId, organizerAddr, nftId)
297297 let saleInfo = getStrByK((saleKey + "_OPEN"))
298298 [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))]
299299 }
300300 }
301301 }
302302
303303
304304
305305 @Callable(i)
306306 func buyNFT (nftId) = {
307307 let $t01003310157 = provideBaseData(i, nftId)
308308 let id = $t01003310157._1
309309 let caller = $t01003310157._2
310310 let date = $t01003310157._3
311311 let isValidNFT = $t01003310157._4
312312 let eventId = $t01003310157._5
313313 let organizerAddr = $t01003310157._6
314314 let ticketId = $t01003310157._7
315315 if (!(isValidNFT))
316316 then throw("Not a valid ticket")
317317 else {
318318 let saleOwner = getSaleOwnerAndStatus(nftId)
319319 let saleKey = getSaleKey(saleOwner, ticketId, eventId, organizerAddr, nftId)
320320 let saleInfo = getStrByK((saleKey + "_OPEN"))
321321 if ((size(saleInfo) == 0))
322322 then throw("Sale Not found!")
323323 else {
324324 let saleInfoArray = split(saleInfo, "_")
325325 if ((parseInt(saleInfoArray[1]) == 0))
326326 then throw("Offer only")
327327 else {
328328 let $t01057210608 = isPayment(i)
329329 let payment = $t01057210608._1
330330 let amount = $t01057210608._2
331331 let paymentAssetStr = toBase58String(value(payment.assetId))
332332 if (if ((saleInfoArray[1] != toString(amount)))
333333 then true
334334 else (saleInfoArray[2] != paymentAssetStr))
335335 then throw("Payment infos don't match.")
336336 else {
337337 let $t01080910943 = setTransfers(amount, payment.assetId, nftId, organizerAddr, saleOwner, caller)
338338 let commissions = $t01080910943._1
339339 let creatorFee = $t01080910943._2
340340 let ownerFee = $t01080910943._3
341341 let collectorNFT = $t01080910943._4
342342 ([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)
343343 }
344344 }
345345 }
346346 }
347347 }
348348
349349
350350
351351 @Callable(i)
352352 func setOffer (nftId) = {
353353 let $t01135411453 = provideBaseData(i, nftId)
354354 let id = $t01135411453._1
355355 let offerOwner = $t01135411453._2
356356 let date = $t01135411453._3
357357 let isValidNFT = $t01135411453._4
358358 let eventId = $t01135411453._5
359359 let organizerAddr = $t01135411453._6
360360 let ticketId = $t01135411453._7
361361 if (!(isValidNFT))
362362 then throw("Not a valid ticket")
363363 else {
364364 let $t01151711553 = isPayment(i)
365365 let payment = $t01151711553._1
366366 let amount = $t01151711553._2
367367 let assetId = toBase58String(value(payment.assetId))
368368 if (!(acceptedAssetIds(assetId)))
369369 then throw("asset not accepted")
370370 else if ((amount == 0))
371371 then throw("Offer of 0 not allowed")
372372 else {
373373 let saleOwner = getSaleOwnerAndStatus(nftId)
374374 [StringEntry((getBidKey(offerOwner, ticketId, saleOwner, id, nftId) + "_OPEN"), ((((((((((((((toString(date) + "_") + toString(amount)) + "_") + assetId) + "_") + nftId) + "_") + eventId) + "_") + organizerAddr) + "_") + offerOwner) + "_") + id))]
375375 }
376376 }
377377 }
378378
379379
380380
381381 @Callable(i)
382382 func acceptOffer (nftId,offerId,offerOwner) = {
383383 let $t01223212327 = provideBaseData(i, nftId)
384384 let id = $t01223212327._1
385385 let caller = $t01223212327._2
386386 let date = $t01223212327._3
387387 let isValidNFT = $t01223212327._4
388388 let eventId = $t01223212327._5
389389 let organizerAddr = $t01223212327._6
390390 let ticketId = $t01223212327._7
391391 if (!(isValidNFT))
392392 then throw("Not a valid ticket")
393393 else {
394394 let saleOwner = getSaleOwnerAndStatus(nftId)
395395 if ((caller != saleOwner))
396396 then throw("Only sale owner can accept offer")
397397 else {
398398 let bidKey = getBidKey(offerOwner, ticketId, saleOwner, offerId, nftId)
399399 let $t01259312648 = getBidData(bidKey)
400400 let bidDataArr = $t01259312648._1
401401 let assetId = $t01259312648._2
402402 let bidData = $t01259312648._3
403403 let saleKey = getSaleKey(saleOwner, ticketId, eventId, organizerAddr, nftId)
404404 let saleInfo = getStrByK((saleKey + "_OPEN"))
405405 if ((size(saleInfo) == 0))
406406 then throw("Sale Not found!")
407407 else {
408408 let amount = value(parseInt(bidDataArr[1]))
409409 let $t01289713030 = setTransfers(amount, assetId, nftId, organizerAddr, saleOwner, bidDataArr[6])
410410 let commissions = $t01289713030._1
411411 let creatorFee = $t01289713030._2
412412 let ownerFee = $t01289713030._3
413413 let collectorNFT = $t01289713030._4
414414 let assetIdStr = toBase58String(value(assetId))
415415 ([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)
416416 }
417417 }
418418 }
419419 }
420420
421421
422422
423423 @Callable(i)
424424 func cancelOffer (nftId,offerId,offerOwner,saleOwner,ticketId) = {
425425 let $t01380613878 = idCallerDate(i)
426426 let id = $t01380613878._1
427427 let caller = $t01380613878._2
428428 let date = $t01380613878._3
429429 if (if ((caller != offerOwner))
430430 then (caller != saleOwner)
431431 else false)
432432 then throw("You cannot cancel this offer.")
433433 else {
434434 let bidKey = getBidKey(offerOwner, ticketId, saleOwner, offerId, nftId)
435435 let $t01405914114 = getBidData(bidKey)
436436 let bidDataArr = $t01405914114._1
437437 let assetId = $t01405914114._2
438438 let bidData = $t01405914114._3
439439 [DeleteEntry((bidKey + "_OPEN")), StringEntry((bidKey + "_CANCELLED"), ((((bidData + "_CANCELLED_") + toString(date)) + "_") + id)), ScriptTransfer(Address(fromBase58String(caller)), parseIntValue(bidDataArr[1]), assetId)]
440440 }
441441 }
442442
443443

github/deemru/w8io/169f3d6 
49.08 ms