tx · GWWneMizPEiBHsFUvDugy1fBKxE2Pv8LuuALAXK5GpgA 3NA8MoNPikwC3J5qFE4bJNyb234chSY61sV: -0.01500000 Waves 2022.11.05 04:57 [2303169] smart account 3NA8MoNPikwC3J5qFE4bJNyb234chSY61sV > SELF 0.00000000 Waves
{ "type": 13, "id": "GWWneMizPEiBHsFUvDugy1fBKxE2Pv8LuuALAXK5GpgA", "fee": 1500000, "feeAssetId": null, "timestamp": 1667613494127, "version": 2, "chainId": 84, "sender": "3NA8MoNPikwC3J5qFE4bJNyb234chSY61sV", "senderPublicKey": "9DhkQ7ZkQPRhQPKPcvpn8J9G9kBWYmZaLGNFxUzf1UJd", "proofs": [ "4ZeR95z1MpwVnSBVdmAwh6ZMGkob5Gwi7hsrPL1zWqrX5yUfLZHsHkJaYcpPywpiBckkR37wsjs8bcrCPht7kWTV" ], "script": "base64:BgI4CAISBAoCCAgSBAoCBAgSAwoBARIECgIIARIDCgEIEgMKAQgSAwoBCBIFCgMICAgSBwoFCAgICAgoAAdWRVJTSU9OAgUxLjAuMAEJZ2V0U3RyQnlLAQNrZXkJAQt2YWx1ZU9yRWxzZQIJAJ0IAgUEdGhpcwUDa2V5AgABCWdldEludEJ5SwEDa2V5CQELdmFsdWVPckVsc2UCCQCaCAIFBHRoaXMFA2tleQAAAAtmZWVSZWNlaXZlcgkBCWdldFN0ckJ5SwECEWNvbmZfZmVlX3JlY2VpdmVyAApldmVudHNEYXBwCQEFdmFsdWUBCQCmCAEJAQlnZXRTdHJCeUsBAhBjb25mX2V2ZW50c19kYXBwAAh1c2VyRGFwcAkBBXZhbHVlAQkApggBCQEJZ2V0U3RyQnlLAQIPY29uZl91c2Vyc19kYXBwAAdzaWduQ3V0CQEJZ2V0SW50QnlLAQIMY29uZl9zaWduY3V0AAtzaWduQXNzZXRJZAkA2QQBCQEJZ2V0U3RyQnlLAQIYY29uZl9hY2NlcHRlZF9hc3NldF9TSUdOAAVjaHJpcwkBCWdldFN0ckJ5SwECDGNvbmZ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xNDIwMjE0MjU3Al8yBAdiaWREYXRhCAUNJHQwMTQyMDIxNDI1NwJfMwkAzAgCCQELRGVsZXRlRW50cnkBCQCsAgIFBmJpZEtleQIFX09QRU4JAMwIAgkBC1N0cmluZ0VudHJ5AgkArAICBQZiaWRLZXkCCl9DQU5DRUxMRUQJAKwCAgkArAICCQCsAgIJAKwCAgUHYmlkRGF0YQILX0NBTkNFTExFRF8JAKQDAQUEZGF0ZQIBXwUCaWQJAMwIAgkBDlNjcmlwdFRyYW5zZmVyAwkBB0FkZHJlc3MBCQDZBAEFBmNhbGxlcgkBDXBhcnNlSW50VmFsdWUBCQCRAwIFCmJpZERhdGFBcnIAAQUHYXNzZXRJZAUDbmlsAD+wJEM=", "height": 2303169, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: none Next: 5C5mUVEzribAiGDfrMADLN6wszVS2pmM4SS8ewhz2Tp1 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 getStrByK (key) = valueOrElse(getString(this, key), "") | |
7 | + | ||
8 | + | ||
9 | + | func getIntByK (key) = valueOrElse(getInteger(this, key), 0) | |
10 | + | ||
11 | + | ||
12 | + | let feeReceiver = getStrByK("conf_fee_receiver") | |
13 | + | ||
14 | + | let eventsDapp = value(addressFromString(getStrByK("conf_events_dapp"))) | |
15 | + | ||
16 | + | let userDapp = value(addressFromString(getStrByK("conf_users_dapp"))) | |
17 | + | ||
18 | + | let signCut = getIntByK("conf_signcut") | |
19 | + | ||
20 | + | let signAssetId = fromBase58String(getStrByK("conf_accepted_asset_SIGN")) | |
21 | + | ||
22 | + | let chris = getStrByK("conf_admin_1") | |
23 | + | ||
24 | + | let userSuspended = "SUSPENDED" | |
25 | + | ||
26 | + | let eventIllegal = "ILLEGAL" | |
27 | + | ||
28 | + | let eventSuspended = "SUSPENDED" | |
29 | + | ||
30 | + | let dappRunningKey = "conf_dapp_is_running" | |
31 | + | ||
32 | + | let maintenanceMSGKey = "conf_maintenance_msg" | |
33 | + | ||
34 | + | let dappRunning = valueOrElse(getBoolean(this, dappRunningKey), true) | |
35 | + | ||
36 | + | let maintenanceMSG = valueOrElse(getString(this, maintenanceMSGKey), "") | |
37 | + | ||
38 | + | let numSalesK = "num_sales" | |
39 | + | ||
40 | + | func getUserStrByK (key) = valueOrElse(getString(userDapp, key), "Error") | |
41 | + | ||
42 | + | ||
43 | + | func getEventStrByK (key) = valueOrElse(getString(eventsDapp, key), "") | |
44 | + | ||
45 | + | ||
46 | + | func keyUserStatus (addr) = ("user_status_" + addr) | |
47 | + | ||
48 | + | ||
49 | + | func keyFlag (organizerAddr,eventId) = ((("event_flag_" + eventId) + "_") + organizerAddr) | |
50 | + | ||
51 | + | ||
52 | + | func keyNFTData (id) = ("nft_" + id) | |
53 | + | ||
54 | + | ||
55 | + | func getSaleKey (caller,ticketId,eventId,organizerAddr,nftId) = ((((((((("sale2nd_info_" + caller) + "_") + ticketId) + "_") + eventId) + "_") + organizerAddr) + "_") + nftId) | |
56 | + | ||
57 | + | ||
58 | + | func getBidKey (offerOwner,ticketId,saleOwner,offerId,nftId) = ((((((((("offer2nd_" + offerOwner) + "_") + ticketId) + "_") + saleOwner) + "_") + offerId) + "_") + nftId) | |
59 | + | ||
60 | + | ||
61 | + | func idCallerDate (i) = if (!(dappRunning)) | |
62 | + | then throw(maintenanceMSG) | |
63 | + | else $Tuple3(toBase58String(i.transactionId), toBase58String(i.caller.bytes), lastBlock.timestamp) | |
64 | + | ||
65 | + | ||
66 | + | func isPayment (i) = if ((size(i.payments) == 0)) | |
67 | + | then throw("No payment attached") | |
68 | + | else { | |
69 | + | let payment = value(i.payments[0]) | |
70 | + | let amount = value(payment.amount) | |
71 | + | $Tuple2(payment, amount) | |
72 | + | } | |
73 | + | ||
74 | + | ||
75 | + | func assetIsValid (assetDetails) = if (if (if ((assetDetails.quantity == 1)) | |
76 | + | then (assetDetails.decimals == 0) | |
77 | + | else false) | |
78 | + | then (assetDetails.reissuable == false) | |
79 | + | else false) | |
80 | + | then (assetDetails.issuer == eventsDapp) | |
81 | + | else false | |
82 | + | ||
83 | + | ||
84 | + | func isSignEventNFT (id) = { | |
85 | + | let assetDetails = value(assetInfo(id)) | |
86 | + | assetIsValid(assetDetails) | |
87 | + | } | |
88 | + | ||
89 | + | ||
90 | + | func acceptedAssetIds (assetId) = if ((assetId != toBase58String(signAssetId))) | |
91 | + | then false | |
92 | + | else true | |
93 | + | ||
94 | + | ||
95 | + | func getBidAssetId (assetId) = fromBase58String(assetId) | |
96 | + | ||
97 | + | ||
98 | + | func getSaleOwnerAndStatus (ticketId) = { | |
99 | + | let saleOwner = getStrByK(("current_owner_on_dapp_" + ticketId)) | |
100 | + | if ((size(saleOwner) == 0)) | |
101 | + | then throw("Ticket not found") | |
102 | + | else { | |
103 | + | let saleStatus = getStrByK(((("sale2nd_status_" + saleOwner) + "_") + ticketId)) | |
104 | + | if ((saleStatus != "OPEN")) | |
105 | + | then throw("Ticket not for sale") | |
106 | + | else saleOwner | |
107 | + | } | |
108 | + | } | |
109 | + | ||
110 | + | ||
111 | + | func getBidData (key) = { | |
112 | + | let bidData = getStrByK((key + "_OPEN")) | |
113 | + | if ((bidData == "")) | |
114 | + | then throw("Offer not found") | |
115 | + | else { | |
116 | + | let bidDataArr = split(bidData, "_") | |
117 | + | let assetId = getBidAssetId(bidDataArr[2]) | |
118 | + | $Tuple3(bidDataArr, assetId, bidData) | |
119 | + | } | |
120 | + | } | |
121 | + | ||
122 | + | ||
123 | + | func eventIsValid (eventStatus) = if ((eventStatus != eventIllegal)) | |
124 | + | then (eventStatus != eventSuspended) | |
125 | + | else false | |
126 | + | ||
127 | + | ||
128 | + | func checkEventStatus (addr,id) = { | |
129 | + | let eventStatus = getEventStrByK(keyFlag(addr, id)) | |
130 | + | if (eventIsValid(eventStatus)) | |
131 | + | then true | |
132 | + | else throw(("Original event flagged as " + eventStatus)) | |
133 | + | } | |
134 | + | ||
135 | + | ||
136 | + | func checkOrganizerStatus (addr) = { | |
137 | + | let organizerStatus = getUserStrByK(keyUserStatus(addr)) | |
138 | + | if (containsElement([userSuspended], organizerStatus)) | |
139 | + | then throw(("Original organizer " + organizerStatus)) | |
140 | + | else true | |
141 | + | } | |
142 | + | ||
143 | + | ||
144 | + | func checkNFTInfo (assetId) = { | |
145 | + | let nftData = split(getEventStrByK(keyNFTData(assetId)), "_") | |
146 | + | if (if (!(checkEventStatus(nftData[6], nftData[5]))) | |
147 | + | then !(checkOrganizerStatus(nftData[6])) | |
148 | + | else false) | |
149 | + | then $Tuple4(false, nftData[6], nftData[7], nftData[5]) | |
150 | + | else $Tuple4(true, nftData[6], nftData[7], nftData[5]) | |
151 | + | } | |
152 | + | ||
153 | + | ||
154 | + | func checkEVENTExist (eventId,organizerAddr) = if (if (!(checkEventStatus(organizerAddr, eventId))) | |
155 | + | then !(checkOrganizerStatus(organizerAddr)) | |
156 | + | else false) | |
157 | + | then false | |
158 | + | else true | |
159 | + | ||
160 | + | ||
161 | + | func setTransfers (amount,assetId,nftId,organizerAddr,saleOwner,caller,eventId,ticketId) = { | |
162 | + | let organizerCut = getIntByK(((((("ticket_royalties_" + eventId) + "_") + organizerAddr) + "_") + ticketId)) | |
163 | + | let amountForSign = fraction(amount, signCut, 100) | |
164 | + | let amountForOrganizer = fraction(amount, organizerCut, 100) | |
165 | + | let amountForOwner = (amount - (amountForSign + amountForOrganizer)) | |
166 | + | let commissions = [ScriptTransfer(Address(fromBase58String(feeReceiver)), amountForSign, assetId)] | |
167 | + | let organizerFee = ScriptTransfer(Address(fromBase58String(organizerAddr)), amountForOrganizer, assetId) | |
168 | + | let ownerFee = ScriptTransfer(Address(fromBase58String(saleOwner)), amountForOwner, assetId) | |
169 | + | let collectorNFT = ScriptTransfer(Address(fromBase58String(caller)), 1, fromBase58String(nftId)) | |
170 | + | $Tuple4(commissions, organizerFee, ownerFee, collectorNFT) | |
171 | + | } | |
172 | + | ||
173 | + | ||
174 | + | func provideBaseData (i,nftId) = { | |
175 | + | let $t059405979 = idCallerDate(i) | |
176 | + | let id = $t059405979._1 | |
177 | + | let caller = $t059405979._2 | |
178 | + | let date = $t059405979._3 | |
179 | + | let $t059826054 = checkNFTInfo(nftId) | |
180 | + | let isValidNFT = $t059826054._1 | |
181 | + | let eventId = $t059826054._2 | |
182 | + | let organizerAddr = $t059826054._3 | |
183 | + | let ticketId = $t059826054._4 | |
184 | + | $Tuple7(id, caller, date, isValidNFT, eventId, organizerAddr, ticketId) | |
185 | + | } | |
186 | + | ||
187 | + | ||
188 | + | func updateNumSales () = { | |
189 | + | let numSales = getIntByK(numSalesK) | |
190 | + | IntegerEntry(numSalesK, (numSales + 1)) | |
191 | + | } | |
192 | + | ||
193 | + | ||
194 | + | @Callable(invoke) | |
195 | + | func setConf (key,val) = { | |
196 | + | let caller = toString(invoke.caller) | |
197 | + | if (containsElement([chris, toString(this)], caller)) | |
198 | + | then if (contains(key, "conf_")) | |
199 | + | then [StringEntry(key, val)] | |
200 | + | else throw("Entries starting with conf_ only") | |
201 | + | else throw("You are not allowed to change this") | |
202 | + | } | |
203 | + | ||
204 | + | ||
205 | + | ||
206 | + | @Callable(invoke) | |
207 | + | func appRunning (isLive,message) = { | |
208 | + | let caller = toString(invoke.caller) | |
209 | + | let id = toBase58String(invoke.transactionId) | |
210 | + | if (containsElement([chris, toString(this)], caller)) | |
211 | + | then [BooleanEntry(dappRunningKey, isLive), StringEntry(maintenanceMSGKey, message)] | |
212 | + | else throw("You are not allowed to change this") | |
213 | + | } | |
214 | + | ||
215 | + | ||
216 | + | ||
217 | + | @Callable(i) | |
218 | + | func sellNFT (price) = { | |
219 | + | let $t071077143 = isPayment(i) | |
220 | + | let payment = $t071077143._1 | |
221 | + | let amount = $t071077143._2 | |
222 | + | if ((amount != 1)) | |
223 | + | then throw("No Ticket attached") | |
224 | + | else { | |
225 | + | let nftId = if (if (isDefined(payment.assetId)) | |
226 | + | then isSignEventNFT(value(payment.assetId)) | |
227 | + | else false) | |
228 | + | then toBase58String(value(payment.assetId)) | |
229 | + | else throw("Only SIGN Event NFT accepted.") | |
230 | + | let $t073847479 = provideBaseData(i, nftId) | |
231 | + | let id = $t073847479._1 | |
232 | + | let caller = $t073847479._2 | |
233 | + | let date = $t073847479._3 | |
234 | + | let isValidNFT = $t073847479._4 | |
235 | + | let eventId = $t073847479._5 | |
236 | + | let organizerAddr = $t073847479._6 | |
237 | + | let ticketId = $t073847479._7 | |
238 | + | if (!(isValidNFT)) | |
239 | + | then throw("Not a valid ticket") | |
240 | + | 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)] | |
241 | + | } | |
242 | + | } | |
243 | + | ||
244 | + | ||
245 | + | ||
246 | + | @Callable(i) | |
247 | + | func updateSalePrice (nftId,price) = { | |
248 | + | let $t080178112 = provideBaseData(i, nftId) | |
249 | + | let id = $t080178112._1 | |
250 | + | let caller = $t080178112._2 | |
251 | + | let date = $t080178112._3 | |
252 | + | let isValidNFT = $t080178112._4 | |
253 | + | let eventId = $t080178112._5 | |
254 | + | let organizerAddr = $t080178112._6 | |
255 | + | let ticketId = $t080178112._7 | |
256 | + | if (!(isValidNFT)) | |
257 | + | then throw("Not a valid ticket") | |
258 | + | else { | |
259 | + | let saleOwner = getStrByK(("current_owner_on_dapp_" + nftId)) | |
260 | + | if ((saleOwner != caller)) | |
261 | + | then throw("You don't own this ticket") | |
262 | + | else { | |
263 | + | let saleStatus = getStrByK(((("sale2nd_status_" + caller) + "_") + nftId)) | |
264 | + | if ((saleStatus != "OPEN")) | |
265 | + | then throw("Sale not active") | |
266 | + | else { | |
267 | + | let saleKey = getSaleKey(caller, ticketId, eventId, organizerAddr, nftId) | |
268 | + | let saleInfo = split(getStrByK((saleKey + "_OPEN")), "_") | |
269 | + | [StringEntry((saleKey + "_OPEN"), ((((((((((((((saleInfo[0] + "_") + toString(price)) + "_") + toBase58String(signAssetId)) + "_") + saleInfo[3]) + "_") + saleInfo[4]) + "_") + saleInfo[5]) + "_") + saleInfo[6]) + "_") + saleInfo[7]))] | |
270 | + | } | |
271 | + | } | |
272 | + | } | |
273 | + | } | |
274 | + | ||
275 | + | ||
276 | + | ||
277 | + | @Callable(i) | |
278 | + | func cancelSale (nftId) = { | |
279 | + | let $t090459288 = provideBaseData(i, nftId) | |
280 | + | let id = $t090459288._1 | |
281 | + | let caller = $t090459288._2 | |
282 | + | let date = $t090459288._3 | |
283 | + | let isValidNFT = $t090459288._4 | |
284 | + | let eventId = $t090459288._5 | |
285 | + | let organizerAddr = $t090459288._6 | |
286 | + | let ticketId = $t090459288._7 | |
287 | + | let saleOwner = getStrByK(("current_owner_on_dapp_" + nftId)) | |
288 | + | if ((saleOwner != caller)) | |
289 | + | then throw("You don't own this ticket") | |
290 | + | else { | |
291 | + | let saleStatus = getStrByK(((("sale2nd_status_" + caller) + "_") + nftId)) | |
292 | + | if ((saleStatus != "OPEN")) | |
293 | + | then throw("Sale not active") | |
294 | + | else { | |
295 | + | let saleKey = getSaleKey(caller, ticketId, eventId, organizerAddr, nftId) | |
296 | + | let saleInfo = getStrByK((saleKey + "_OPEN")) | |
297 | + | [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))] | |
298 | + | } | |
299 | + | } | |
300 | + | } | |
301 | + | ||
302 | + | ||
303 | + | ||
304 | + | @Callable(i) | |
305 | + | func buyNFT (nftId) = { | |
306 | + | let $t01013810262 = provideBaseData(i, nftId) | |
307 | + | let id = $t01013810262._1 | |
308 | + | let caller = $t01013810262._2 | |
309 | + | let date = $t01013810262._3 | |
310 | + | let isValidNFT = $t01013810262._4 | |
311 | + | let eventId = $t01013810262._5 | |
312 | + | let organizerAddr = $t01013810262._6 | |
313 | + | let ticketId = $t01013810262._7 | |
314 | + | if (!(isValidNFT)) | |
315 | + | then throw("Not a valid ticket") | |
316 | + | else { | |
317 | + | let saleOwner = getSaleOwnerAndStatus(nftId) | |
318 | + | let saleKey = getSaleKey(saleOwner, ticketId, eventId, organizerAddr, nftId) | |
319 | + | let saleInfo = getStrByK((saleKey + "_OPEN")) | |
320 | + | if ((size(saleInfo) == 0)) | |
321 | + | then throw("Sale Not found!") | |
322 | + | else { | |
323 | + | let saleInfoArray = split(saleInfo, "_") | |
324 | + | if ((parseInt(saleInfoArray[1]) == 0)) | |
325 | + | then throw("Offer only") | |
326 | + | else { | |
327 | + | let $t01067710713 = isPayment(i) | |
328 | + | let payment = $t01067710713._1 | |
329 | + | let amount = $t01067710713._2 | |
330 | + | let paymentAssetStr = toBase58String(value(payment.assetId)) | |
331 | + | if (if ((saleInfoArray[1] != toString(amount))) | |
332 | + | then true | |
333 | + | else (saleInfoArray[2] != paymentAssetStr)) | |
334 | + | then throw("Payment infos don't match.") | |
335 | + | else { | |
336 | + | let $t01091411067 = setTransfers(amount, payment.assetId, nftId, organizerAddr, saleOwner, caller, eventId, ticketId) | |
337 | + | let commissions = $t01091411067._1 | |
338 | + | let creatorFee = $t01091411067._2 | |
339 | + | let ownerFee = $t01091411067._3 | |
340 | + | let collectorNFT = $t01091411067._4 | |
341 | + | ([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) | |
342 | + | } | |
343 | + | } | |
344 | + | } | |
345 | + | } | |
346 | + | } | |
347 | + | ||
348 | + | ||
349 | + | ||
350 | + | @Callable(i) | |
351 | + | func setOffer (nftId) = { | |
352 | + | let $t01147811577 = provideBaseData(i, nftId) | |
353 | + | let id = $t01147811577._1 | |
354 | + | let offerOwner = $t01147811577._2 | |
355 | + | let date = $t01147811577._3 | |
356 | + | let isValidNFT = $t01147811577._4 | |
357 | + | let eventId = $t01147811577._5 | |
358 | + | let organizerAddr = $t01147811577._6 | |
359 | + | let ticketId = $t01147811577._7 | |
360 | + | if (!(isValidNFT)) | |
361 | + | then throw("Not a valid ticket") | |
362 | + | else { | |
363 | + | let $t01164111677 = isPayment(i) | |
364 | + | let payment = $t01164111677._1 | |
365 | + | let amount = $t01164111677._2 | |
366 | + | let assetId = toBase58String(value(payment.assetId)) | |
367 | + | if (!(acceptedAssetIds(assetId))) | |
368 | + | then throw("asset not accepted") | |
369 | + | else if ((amount == 0)) | |
370 | + | then throw("Offer of 0 not allowed") | |
371 | + | else { | |
372 | + | let saleOwner = getSaleOwnerAndStatus(nftId) | |
373 | + | [StringEntry((getBidKey(offerOwner, ticketId, saleOwner, id, nftId) + "_OPEN"), ((((((((((((((toString(date) + "_") + toString(amount)) + "_") + assetId) + "_") + nftId) + "_") + eventId) + "_") + organizerAddr) + "_") + offerOwner) + "_") + id))] | |
374 | + | } | |
375 | + | } | |
376 | + | } | |
377 | + | ||
378 | + | ||
379 | + | ||
380 | + | @Callable(i) | |
381 | + | func acceptOffer (nftId,offerId,offerOwner) = { | |
382 | + | let $t01235612451 = provideBaseData(i, nftId) | |
383 | + | let id = $t01235612451._1 | |
384 | + | let caller = $t01235612451._2 | |
385 | + | let date = $t01235612451._3 | |
386 | + | let isValidNFT = $t01235612451._4 | |
387 | + | let eventId = $t01235612451._5 | |
388 | + | let organizerAddr = $t01235612451._6 | |
389 | + | let ticketId = $t01235612451._7 | |
390 | + | if (!(isValidNFT)) | |
391 | + | then throw("Not a valid ticket") | |
392 | + | else { | |
393 | + | let saleOwner = getSaleOwnerAndStatus(nftId) | |
394 | + | if ((caller != saleOwner)) | |
395 | + | then throw("Only sale owner can accept offer") | |
396 | + | else { | |
397 | + | let bidKey = getBidKey(offerOwner, ticketId, saleOwner, offerId, nftId) | |
398 | + | let $t01271712772 = getBidData(bidKey) | |
399 | + | let bidDataArr = $t01271712772._1 | |
400 | + | let assetId = $t01271712772._2 | |
401 | + | let bidData = $t01271712772._3 | |
402 | + | let saleKey = getSaleKey(saleOwner, ticketId, eventId, organizerAddr, nftId) | |
403 | + | let saleInfo = getStrByK((saleKey + "_OPEN")) | |
404 | + | if ((size(saleInfo) == 0)) | |
405 | + | then throw("Sale Not found!") | |
406 | + | else { | |
407 | + | let amount = value(parseInt(bidDataArr[1])) | |
408 | + | let $t01302113173 = setTransfers(amount, assetId, nftId, organizerAddr, saleOwner, bidDataArr[6], eventId, ticketId) | |
409 | + | let commissions = $t01302113173._1 | |
410 | + | let creatorFee = $t01302113173._2 | |
411 | + | let ownerFee = $t01302113173._3 | |
412 | + | let collectorNFT = $t01302113173._4 | |
413 | + | let assetIdStr = toBase58String(value(assetId)) | |
414 | + | ([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) | |
415 | + | } | |
416 | + | } | |
417 | + | } | |
418 | + | } | |
419 | + | ||
420 | + | ||
421 | + | ||
422 | + | @Callable(i) | |
423 | + | func cancelOffer (nftId,offerId,offerOwner,saleOwner,ticketId) = { | |
424 | + | let $t01394914021 = idCallerDate(i) | |
425 | + | let id = $t01394914021._1 | |
426 | + | let caller = $t01394914021._2 | |
427 | + | let date = $t01394914021._3 | |
428 | + | if (if ((caller != offerOwner)) | |
429 | + | then (caller != saleOwner) | |
430 | + | else false) | |
431 | + | then throw("You cannot cancel this offer.") | |
432 | + | else { | |
433 | + | let bidKey = getBidKey(offerOwner, ticketId, saleOwner, offerId, nftId) | |
434 | + | let $t01420214257 = getBidData(bidKey) | |
435 | + | let bidDataArr = $t01420214257._1 | |
436 | + | let assetId = $t01420214257._2 | |
437 | + | let bidData = $t01420214257._3 | |
438 | + | [DeleteEntry((bidKey + "_OPEN")), StringEntry((bidKey + "_CANCELLED"), ((((bidData + "_CANCELLED_") + toString(date)) + "_") + id)), ScriptTransfer(Address(fromBase58String(caller)), parseIntValue(bidDataArr[1]), assetId)] | |
439 | + | } | |
440 | + | } | |
441 | + | ||
442 | + |
github/deemru/w8io/169f3d6 30.07 ms ◑