tx · 48UeP9bBswD4NPobUyZXZXqQLTAWVw8tYF55NGKBiUQ4 3N4ishKFoRooDxWoaCWSp3CUEoDmVepA1bz: -0.01300000 Waves 2023.11.14 10:34 [2842711] smart account 3N4ishKFoRooDxWoaCWSp3CUEoDmVepA1bz > SELF 0.00000000 Waves
{ "type": 13, "id": "48UeP9bBswD4NPobUyZXZXqQLTAWVw8tYF55NGKBiUQ4", "fee": 1300000, "feeAssetId": null, "timestamp": 1699947354580, "version": 2, "chainId": 84, "sender": "3N4ishKFoRooDxWoaCWSp3CUEoDmVepA1bz", "senderPublicKey": "9p5EiEVtTgiMBxj67TfVfstKuQs1LHPxoZRiRhyS5oiN", "proofs": [ "3fyxQP8T2EsLK9Hbuy7NVWB4kb7FFGqmJiVnJCHQsmGR5Rs3GQgiBJj7pioepogAfBFHczSAQkJbjiwABXHuysv2" ], "script": "base64:BgI5CAISBAoCCAgSBAoCBAgSBAoCAQgSBQoDCAEIEgMKAQgSAwoBCBIDCgEIEgUKAwgICBIGCgQICAgILQAHVkVSU0lPTgIFMS4wLjABCWdldFN0ckJ5SwEDa2V5CQELdmFsdWVPckVsc2UCCQCdCAIFBHRoaXMFA2tleQIAAAlvcmFjbGVGZWUJAQV2YWx1ZQEJAKYIAQkBCWdldFN0ckJ5SwECD2NvbmZfb3JhY2xlX2ZlZQAIdXNlckRhcHAJAQV2YWx1ZQEJAKYIAQkBCWdldFN0ckJ5SwECD2NvbmZfdXNlcnNfZGFwcAALZmVlUmVjZWl2ZXIJAQlnZXRTdHJCeUsBAhFjb25mX2ZlZV9yZWNlaXZlcgAPcHV6emxlX2FydF9wb29sCQEJZ2V0U3RyQnlLAQIUY29uZl9wdXp6bGVfYXJ0X3Bvb2wAEXVzZHRQUEFzc2V0SWRfc3RyCQEJZ2V0U3RyQnlLAQIbY29uZl9hY2NlcHRlZF9hc3NldF9VU0RUX1BQAA5hcnRBc3NldElkX3N0cgkBCWdldFN0ckJ5SwECF2NvbmZfYWNjZXB0ZWRfYX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BAEFBmNhbGxlcgkBDXBhcnNlSW50VmFsdWUBCQCRAwIFCmJpZERhdGFBcnIAAQUHYXNzZXRJZAUDbmlsAPQKNhg=", "height": 2842711, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: none Next: 9MVDuhoKEa8VzhKYBxqeLeHpAppz91D6ezQYgUdvP5aG 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 | + | let oracleFee = value(addressFromString(getStrByK("conf_oracle_fee"))) | |
10 | + | ||
11 | + | let userDapp = value(addressFromString(getStrByK("conf_users_dapp"))) | |
12 | + | ||
13 | + | let feeReceiver = getStrByK("conf_fee_receiver") | |
14 | + | ||
15 | + | let puzzle_art_pool = getStrByK("conf_puzzle_art_pool") | |
16 | + | ||
17 | + | let usdtPPAssetId_str = getStrByK("conf_accepted_asset_USDT_PP") | |
18 | + | ||
19 | + | let artAssetId_str = getStrByK("conf_accepted_asset_ART") | |
20 | + | ||
21 | + | let usdcPPAssetId_str = getStrByK("conf_accepted_asset_USDC_PP") | |
22 | + | ||
23 | + | let eastAssetId_str = getStrByK("conf_accepted_asset_EAST") | |
24 | + | ||
25 | + | let puzzleAssetId_str = getStrByK("conf_accepted_asset_PUZZLE") | |
26 | + | ||
27 | + | let ethPPAssetId_str = getStrByK("conf_accepted_asset_ETH_PP") | |
28 | + | ||
29 | + | let wavesAssetId_str = "WAVES" | |
30 | + | ||
31 | + | let usdtPPAssetId = fromBase58String(usdtPPAssetId_str) | |
32 | + | ||
33 | + | let artAssetId = fromBase58String(artAssetId_str) | |
34 | + | ||
35 | + | let usdcPPAssetId = fromBase58String(usdcPPAssetId_str) | |
36 | + | ||
37 | + | let eastAssetId = fromBase58String(eastAssetId_str) | |
38 | + | ||
39 | + | let puzzleAssetId = fromBase58String(puzzleAssetId_str) | |
40 | + | ||
41 | + | let ethPPAssetId = fromBase58String(ethPPAssetId_str) | |
42 | + | ||
43 | + | let wavesAssetId = base58'' | |
44 | + | ||
45 | + | let all_accepted_assets = [usdtPPAssetId_str, artAssetId_str, usdcPPAssetId_str, eastAssetId_str, puzzleAssetId_str, wavesAssetId_str, ethPPAssetId_str] | |
46 | + | ||
47 | + | let chris = getStrByK("conf_admin_1") | |
48 | + | ||
49 | + | let commission_fee = 3 | |
50 | + | ||
51 | + | let dappRunningKey = "conf_dapp_is_running" | |
52 | + | ||
53 | + | let maintenanceMSGKey = "conf_maintenance_msg" | |
54 | + | ||
55 | + | let dappRunning = valueOrElse(getBoolean(this, dappRunningKey), true) | |
56 | + | ||
57 | + | let maintenanceMSG = valueOrElse(getString(this, maintenanceMSGKey), "") | |
58 | + | ||
59 | + | let numSalesK = "num_sales" | |
60 | + | ||
61 | + | func getIntByK (key) = valueOrElse(getInteger(this, key), 0) | |
62 | + | ||
63 | + | ||
64 | + | func getSaleKey (caller,nftId,issuer) = ((((("sale2nd_info_" + caller) + "_") + nftId) + "_") + issuer) | |
65 | + | ||
66 | + | ||
67 | + | func getBidKey (offerOwner,nftId,saleOwner,offerId) = ((((((("offer2nd_" + offerOwner) + "_") + nftId) + "_") + saleOwner) + "_") + offerId) | |
68 | + | ||
69 | + | ||
70 | + | func getIntByKFromOracle (key) = valueOrErrorMessage(getInteger(oracleFee, key), "Integer undefine or 0 in oracle") | |
71 | + | ||
72 | + | ||
73 | + | func idCallerDate (i) = if (!(dappRunning)) | |
74 | + | then throw(maintenanceMSG) | |
75 | + | else $Tuple3(toBase58String(i.transactionId), toBase58String(i.caller.bytes), lastBlock.timestamp) | |
76 | + | ||
77 | + | ||
78 | + | func isPayment (i) = if ((size(i.payments) == 0)) | |
79 | + | then throw("No payment attached") | |
80 | + | else { | |
81 | + | let payment = value(i.payments[0]) | |
82 | + | let amount = value(payment.amount) | |
83 | + | $Tuple2(payment, amount) | |
84 | + | } | |
85 | + | ||
86 | + | ||
87 | + | func NFTIsValid (assetDetails) = if (if ((assetDetails.quantity == 1)) | |
88 | + | then (assetDetails.decimals == 0) | |
89 | + | else false) | |
90 | + | then (assetDetails.reissuable == false) | |
91 | + | else false | |
92 | + | ||
93 | + | ||
94 | + | func acceptedAssetIds (assetId) = if (!(containsElement(all_accepted_assets, assetId))) | |
95 | + | then throw("Only $ART, USDT-PP, USDC-PP, EAST, PUZZLE, ETH or WAVES accepted") | |
96 | + | else true | |
97 | + | ||
98 | + | ||
99 | + | func getBidAssetId (assetId) = if ((assetId == "WAVES")) | |
100 | + | then unit | |
101 | + | else fromBase58String(assetId) | |
102 | + | ||
103 | + | ||
104 | + | func getSaleOwnerAndStatus (nftid) = { | |
105 | + | let saleOwner = getStrByK(("current_owner_on_dapp_" + nftid)) | |
106 | + | if ((size(saleOwner) == 0)) | |
107 | + | then throw("NFT not found") | |
108 | + | else { | |
109 | + | let saleStatus = getStrByK(((("sale2nd_status_" + saleOwner) + "_") + nftid)) | |
110 | + | if ((saleStatus != "OPEN")) | |
111 | + | then throw("NFT not for sale") | |
112 | + | else saleOwner | |
113 | + | } | |
114 | + | } | |
115 | + | ||
116 | + | ||
117 | + | func getBidData (key) = { | |
118 | + | let bidData = getStrByK((key + "_OPEN")) | |
119 | + | if ((bidData == "")) | |
120 | + | then throw("Offer not found") | |
121 | + | else { | |
122 | + | let bidDataArr = split(bidData, "_") | |
123 | + | let assetId = getBidAssetId(bidDataArr[2]) | |
124 | + | $Tuple3(bidDataArr, assetId, bidData) | |
125 | + | } | |
126 | + | } | |
127 | + | ||
128 | + | ||
129 | + | func getBalance (assetId) = match assetId { | |
130 | + | case b: ByteVector => | |
131 | + | assetBalance(this, b) | |
132 | + | case _ => | |
133 | + | wavesBalance(this).available | |
134 | + | } | |
135 | + | ||
136 | + | ||
137 | + | func setTransfers (amount,assetId,nftid,saleOwner,caller) = { | |
138 | + | let amountForSign = fraction(amount, commission_fee, 100) | |
139 | + | let amountForOwner = (amount - amountForSign) | |
140 | + | let amount_commission_for_sign_to_swap = amountForSign | |
141 | + | let amount_art_before = getBalance(artAssetId) | |
142 | + | if ((amount_art_before == amount_art_before)) | |
143 | + | then { | |
144 | + | let swap_fee_to_art = if ((assetId != artAssetId)) | |
145 | + | then invoke(Address(fromBase58String(puzzle_art_pool)), "swap", [artAssetId_str, 1], [AttachedPayment(assetId, amount_commission_for_sign_to_swap)]) | |
146 | + | else unit | |
147 | + | if ((swap_fee_to_art == swap_fee_to_art)) | |
148 | + | then { | |
149 | + | let amount_art_after = getBalance(artAssetId) | |
150 | + | if ((amount_art_after == amount_art_after)) | |
151 | + | then { | |
152 | + | let commissions = ScriptTransfer(Address(fromBase58String(feeReceiver)), if ((assetId == artAssetId)) | |
153 | + | then amountForSign | |
154 | + | else (amount_art_after - amount_art_before), artAssetId) | |
155 | + | let ownerFee = ScriptTransfer(Address(fromBase58String(saleOwner)), amountForOwner, assetId) | |
156 | + | let collectorNFT = ScriptTransfer(Address(fromBase58String(caller)), 1, fromBase58String(nftid)) | |
157 | + | $Tuple3(commissions, ownerFee, collectorNFT) | |
158 | + | } | |
159 | + | else throw("Strict value is not equal to itself.") | |
160 | + | } | |
161 | + | else throw("Strict value is not equal to itself.") | |
162 | + | } | |
163 | + | else throw("Strict value is not equal to itself.") | |
164 | + | } | |
165 | + | ||
166 | + | ||
167 | + | func validateMinSell (price) = if ((0 >= price)) | |
168 | + | then throw("Wrong minimum sell price") | |
169 | + | else true | |
170 | + | ||
171 | + | ||
172 | + | func provideBaseData (i,nftId) = { | |
173 | + | let $t051625202 = idCallerDate(i) | |
174 | + | let id = $t051625202._1 | |
175 | + | let caller = $t051625202._2 | |
176 | + | let date = $t051625202._3 | |
177 | + | let assetDetails = value(assetInfo(fromBase58String(nftId))) | |
178 | + | let isValidNFT = NFTIsValid(assetDetails) | |
179 | + | $Tuple5(id, caller, date, isValidNFT, assetDetails.issuer) | |
180 | + | } | |
181 | + | ||
182 | + | ||
183 | + | func updateNumSales () = { | |
184 | + | let numSales = getIntByK(numSalesK) | |
185 | + | IntegerEntry(numSalesK, (numSales + 1)) | |
186 | + | } | |
187 | + | ||
188 | + | ||
189 | + | func haveSTD (issuer,ndftId) = { | |
190 | + | let data = valueOrElse(getString(addressFromStringValue(issuer), (("std_nft_" + ndftId) + "_metadata")), "") | |
191 | + | (data != "") | |
192 | + | } | |
193 | + | ||
194 | + | ||
195 | + | @Callable(invoke) | |
196 | + | func setConf (key,val) = { | |
197 | + | let caller = toString(invoke.caller) | |
198 | + | if (containsElement([chris, toString(this)], caller)) | |
199 | + | then if (contains(key, "conf_")) | |
200 | + | then [StringEntry(key, val)] | |
201 | + | else throw("Entries starting with conf_ only") | |
202 | + | else throw("You are not allowed to change this") | |
203 | + | } | |
204 | + | ||
205 | + | ||
206 | + | ||
207 | + | @Callable(invoke) | |
208 | + | func appRunning (isLive,message) = { | |
209 | + | let caller = toString(invoke.caller) | |
210 | + | let id = toBase58String(invoke.transactionId) | |
211 | + | if (containsElement([chris, toString(this)], caller)) | |
212 | + | then [BooleanEntry(dappRunningKey, isLive), StringEntry(maintenanceMSGKey, message)] | |
213 | + | else throw("You are not allowed to change this") | |
214 | + | } | |
215 | + | ||
216 | + | ||
217 | + | ||
218 | + | @Callable(i) | |
219 | + | func sellNFT (price,asset) = { | |
220 | + | let $t065346570 = isPayment(i) | |
221 | + | let payment = $t065346570._1 | |
222 | + | let amount = $t065346570._2 | |
223 | + | if ((amount != 1)) | |
224 | + | then throw("No NFT attached") | |
225 | + | else { | |
226 | + | let nftId = if (isDefined(payment.assetId)) | |
227 | + | then toBase58String(value(payment.assetId)) | |
228 | + | else throw("Waves is not a NFT.") | |
229 | + | let $t067566826 = provideBaseData(i, nftId) | |
230 | + | let id = $t067566826._1 | |
231 | + | let caller = $t067566826._2 | |
232 | + | let date = $t067566826._3 | |
233 | + | let isValidNFT = $t067566826._4 | |
234 | + | let issuer = $t067566826._5 | |
235 | + | if (!(isValidNFT)) | |
236 | + | then throw("Not a valid nft") | |
237 | + | else if (!(haveSTD(nftId, toString(issuer)))) | |
238 | + | then throw("No nft standard found on issuer account") | |
239 | + | else if (!(acceptedAssetIds(asset))) | |
240 | + | then throw("Only $ART, USDT-PP, USDC-PP, EAST, PUZZLE, ETH or WAVES accepted") | |
241 | + | else if (!(validateMinSell(price))) | |
242 | + | then throw("Wrong minimum sell price") | |
243 | + | else [StringEntry((getSaleKey(caller, nftId, toString(issuer)) + "_OPEN"), ((((((((((toString(date) + "_") + toString(price)) + "_") + asset) + "_") + nftId) + "_") + toString(issuer)) + "_") + id)), StringEntry(((("sale2nd_status_" + caller) + "_") + nftId), "OPEN"), StringEntry(("current_owner_on_dapp_" + nftId), caller)] | |
244 | + | } | |
245 | + | } | |
246 | + | ||
247 | + | ||
248 | + | ||
249 | + | @Callable(i) | |
250 | + | func updateSalePrice (nftId,price,asset) = { | |
251 | + | let $t076217691 = provideBaseData(i, nftId) | |
252 | + | let id = $t076217691._1 | |
253 | + | let caller = $t076217691._2 | |
254 | + | let date = $t076217691._3 | |
255 | + | let isValidNFT = $t076217691._4 | |
256 | + | let issuer = $t076217691._5 | |
257 | + | if (!(isValidNFT)) | |
258 | + | then throw("Not a valid nft") | |
259 | + | else { | |
260 | + | let saleOwner = getStrByK(("current_owner_on_dapp_" + nftId)) | |
261 | + | if ((saleOwner != caller)) | |
262 | + | then throw("You don't own this NFT") | |
263 | + | else { | |
264 | + | let saleStatus = getStrByK(((("sale2nd_status_" + caller) + "_") + nftId)) | |
265 | + | if ((saleStatus != "OPEN")) | |
266 | + | then throw("Sale not active") | |
267 | + | else if (!(acceptedAssetIds(asset))) | |
268 | + | then throw("Only $ART, USDT-PP, USDC-PP, EAST, PUZZLE, ETH or WAVES accepted") | |
269 | + | else if (!(validateMinSell(price))) | |
270 | + | then throw("Wrong minimum sell price") | |
271 | + | else { | |
272 | + | let saleKey = getSaleKey(caller, nftId, toString(issuer)) | |
273 | + | let saleInfo = split(getStrByK((saleKey + "_OPEN")), "_") | |
274 | + | [StringEntry((saleKey + "_OPEN"), ((((((((((saleInfo[0] + "_") + toString(price)) + "_") + asset) + "_") + saleInfo[3]) + "_") + saleInfo[4]) + "_") + saleInfo[5]))] | |
275 | + | } | |
276 | + | } | |
277 | + | } | |
278 | + | } | |
279 | + | ||
280 | + | ||
281 | + | ||
282 | + | @Callable(i) | |
283 | + | func cancelSale (nftId) = { | |
284 | + | let $t087438961 = provideBaseData(i, nftId) | |
285 | + | let id = $t087438961._1 | |
286 | + | let caller = $t087438961._2 | |
287 | + | let date = $t087438961._3 | |
288 | + | let isValidNFT = $t087438961._4 | |
289 | + | let issuer = $t087438961._5 | |
290 | + | let saleOwner = getStrByK(("current_owner_on_dapp_" + nftId)) | |
291 | + | if ((saleOwner != caller)) | |
292 | + | then throw("You don't own this NFT") | |
293 | + | else { | |
294 | + | let saleStatus = getStrByK(((("sale2nd_status_" + caller) + "_") + nftId)) | |
295 | + | if ((saleStatus != "OPEN")) | |
296 | + | then throw("Sale not active") | |
297 | + | else { | |
298 | + | let saleKey = getSaleKey(caller, nftId, toString(issuer)) | |
299 | + | let saleInfo = getStrByK((saleKey + "_OPEN")) | |
300 | + | [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))] | |
301 | + | } | |
302 | + | } | |
303 | + | } | |
304 | + | ||
305 | + | ||
306 | + | ||
307 | + | @Callable(i) | |
308 | + | func buyNFT (nftId) = { | |
309 | + | let $t097929862 = provideBaseData(i, nftId) | |
310 | + | let id = $t097929862._1 | |
311 | + | let caller = $t097929862._2 | |
312 | + | let date = $t097929862._3 | |
313 | + | let isValidNFT = $t097929862._4 | |
314 | + | let issuer = $t097929862._5 | |
315 | + | if (!(isValidNFT)) | |
316 | + | then throw("Not a valid nft") | |
317 | + | else { | |
318 | + | let saleOwner = getSaleOwnerAndStatus(nftId) | |
319 | + | let saleKey = getSaleKey(saleOwner, nftId, toString(issuer)) | |
320 | + | let saleInfo = getStrByK((saleKey + "_OPEN")) | |
321 | + | if ((size(saleInfo) == 0)) | |
322 | + | then throw("Sale Not found!") | |
323 | + | else { | |
324 | + | let saleInfoArray = split(saleInfo, "_") | |
325 | + | if ((parseInt(saleInfoArray[1]) == 0)) | |
326 | + | then throw("Offer only") | |
327 | + | else { | |
328 | + | let $t01026110297 = isPayment(i) | |
329 | + | let payment = $t01026110297._1 | |
330 | + | let amount = $t01026110297._2 | |
331 | + | let paymentAssetStr = if (isDefined(payment.assetId)) | |
332 | + | then toBase58String(value(payment.assetId)) | |
333 | + | else "" | |
334 | + | if (if ((saleInfoArray[1] != toString(amount))) | |
335 | + | then true | |
336 | + | else (saleInfoArray[2] != paymentAssetStr)) | |
337 | + | then throw("Payment infos don't match.") | |
338 | + | else { | |
339 | + | let $t01081110918 = setTransfers(amount, payment.assetId, nftId, saleOwner, caller) | |
340 | + | let commissions = $t01081110918._1 | |
341 | + | let ownerFee = $t01081110918._2 | |
342 | + | let collectorNFT = $t01081110918._3 | |
343 | + | [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(), ownerFee, collectorNFT, commissions] | |
344 | + | } | |
345 | + | } | |
346 | + | } | |
347 | + | } | |
348 | + | } | |
349 | + | ||
350 | + | ||
351 | + | ||
352 | + | @Callable(i) | |
353 | + | func setOffer (nftId) = { | |
354 | + | let $t01131711391 = provideBaseData(i, nftId) | |
355 | + | let id = $t01131711391._1 | |
356 | + | let offerOwner = $t01131711391._2 | |
357 | + | let date = $t01131711391._3 | |
358 | + | let isValidNFT = $t01131711391._4 | |
359 | + | let issuer = $t01131711391._5 | |
360 | + | if (!(isValidNFT)) | |
361 | + | then throw("Not a valid nft") | |
362 | + | else { | |
363 | + | let $t01145211488 = isPayment(i) | |
364 | + | let payment = $t01145211488._1 | |
365 | + | let amount = $t01145211488._2 | |
366 | + | let assetId = if (!(isDefined(payment.assetId))) | |
367 | + | then "WAVES" | |
368 | + | else toBase58String(value(payment.assetId)) | |
369 | + | if (!(acceptedAssetIds(assetId))) | |
370 | + | then throw("asset not accepted") | |
371 | + | else if ((amount == 0)) | |
372 | + | then throw("Offer of 0 not allowed") | |
373 | + | else if (!(validateMinSell(amount))) | |
374 | + | then throw("Wrong minimum sell price") | |
375 | + | else { | |
376 | + | let saleOwner = getSaleOwnerAndStatus(nftId) | |
377 | + | [StringEntry((getBidKey(offerOwner, nftId, saleOwner, id) + "_OPEN"), ((((((((((((toString(date) + "_") + toString(amount)) + "_") + assetId) + "_") + nftId) + "_") + toString(issuer)) + "_") + offerOwner) + "_") + id))] | |
378 | + | } | |
379 | + | } | |
380 | + | } | |
381 | + | ||
382 | + | ||
383 | + | ||
384 | + | @Callable(i) | |
385 | + | func acceptOffer (nftId,offerId,offerOwner) = { | |
386 | + | let $t01227712347 = provideBaseData(i, nftId) | |
387 | + | let id = $t01227712347._1 | |
388 | + | let caller = $t01227712347._2 | |
389 | + | let date = $t01227712347._3 | |
390 | + | let isValidNFT = $t01227712347._4 | |
391 | + | let issuer = $t01227712347._5 | |
392 | + | if (!(isValidNFT)) | |
393 | + | then throw("Not a valid nft") | |
394 | + | else { | |
395 | + | let saleOwner = getSaleOwnerAndStatus(nftId) | |
396 | + | if ((caller != saleOwner)) | |
397 | + | then throw("Only sale owner can accept offer") | |
398 | + | else { | |
399 | + | let bidKey = getBidKey(offerOwner, nftId, saleOwner, offerId) | |
400 | + | let $t01260112656 = getBidData(bidKey) | |
401 | + | let bidDataArr = $t01260112656._1 | |
402 | + | let assetId = $t01260112656._2 | |
403 | + | let bidData = $t01260112656._3 | |
404 | + | let saleKey = getSaleKey(saleOwner, nftId, toString(issuer)) | |
405 | + | let saleInfo = getStrByK((saleKey + "_OPEN")) | |
406 | + | if ((size(saleInfo) == 0)) | |
407 | + | then throw("Sale Not found!") | |
408 | + | else { | |
409 | + | let amount = value(parseInt(bidDataArr[1])) | |
410 | + | let $t01289212998 = setTransfers(amount, assetId, nftId, saleOwner, bidDataArr[6]) | |
411 | + | let commissions = $t01289212998._1 | |
412 | + | let ownerFee = $t01289212998._2 | |
413 | + | let collectorNFT = $t01289212998._3 | |
414 | + | let assetIdStr = if (isDefined(assetId)) | |
415 | + | then toBase58String(value(assetId)) | |
416 | + | else "WAVES" | |
417 | + | [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(), ownerFee, collectorNFT, commissions] | |
418 | + | } | |
419 | + | } | |
420 | + | } | |
421 | + | } | |
422 | + | ||
423 | + | ||
424 | + | ||
425 | + | @Callable(i) | |
426 | + | func cancelOffer (nftId,offerId,offerOwner,saleOwner) = { | |
427 | + | let $t01378613860 = idCallerDate(i) | |
428 | + | let id = $t01378613860._1 | |
429 | + | let caller = $t01378613860._2 | |
430 | + | let date = $t01378613860._3 | |
431 | + | if (if ((caller != offerOwner)) | |
432 | + | then (caller != saleOwner) | |
433 | + | else false) | |
434 | + | then throw("You cannot cancel this offer.") | |
435 | + | else { | |
436 | + | let bidKey = getBidKey(offerOwner, nftId, saleOwner, offerId) | |
437 | + | let $t01403214087 = getBidData(bidKey) | |
438 | + | let bidDataArr = $t01403214087._1 | |
439 | + | let assetId = $t01403214087._2 | |
440 | + | let bidData = $t01403214087._3 | |
441 | + | [DeleteEntry((bidKey + "_OPEN")), StringEntry((bidKey + "_CANCELLED"), ((((bidData + "_CANCELLED_") + toString(date)) + "_") + id)), ScriptTransfer(Address(fromBase58String(caller)), parseIntValue(bidDataArr[1]), assetId)] | |
442 | + | } | |
443 | + | } | |
444 | + | ||
445 | + |
github/deemru/w8io/026f985 50.89 ms ◑