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