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