tx · 4VUqYAADzkwhBGQrmTWFgovMSCEHqndmqogSgdJwqPcX 3MvjAaDYHpS4A5K4CV3kZMMEH9m9JdBSvbq: -0.50000000 Waves 2022.11.30 18:10 [2339996] smart account 3MvjAaDYHpS4A5K4CV3kZMMEH9m9JdBSvbq > SELF 0.00000000 Waves
{ "type": 13, "id": "4VUqYAADzkwhBGQrmTWFgovMSCEHqndmqogSgdJwqPcX", "fee": 50000000, "feeAssetId": null, "timestamp": 1669821087114, "version": 2, "chainId": 84, "sender": "3MvjAaDYHpS4A5K4CV3kZMMEH9m9JdBSvbq", "senderPublicKey": "H6UqxUDcJamDRg1uykVcWMn4zhAMTV7i1nfPq1moLWmJ", "proofs": [ "5bLMkCTpLwfsVhfrAVAZbtQQpeBzPrTbCPfLGPG3baWUfmcrNxPqiF1uW9DEwbMAk79NbJvqmU5SU49Gm2Bdroao" ], "script": "base64:BgJRCAISBgoECAgBARIAEgQKAggIEgsKCQgICAgIAQgICBIECgIICBIECgIICBIDCgEIEgMKAQESBQoDAQgIEgMKAQgSAwoBCBIDCgEIEgQKAggBJwAJc2VwYXJhdG9yAgFfAAhrQXVjdGlvbgIHYXVjdGlvbgAFa1NlbGwCBHNlbGwACGtUcnVzdGVkAgd0cnVzdGVkAAZrUHJpY2UCBXByaWNlAQpnZXRTbG90S2V5AgZwcmVmaXgFbmZ0SWQJAKwCAgkArAICBQZwcmVmaXgFCXNlcGFyYXRvcgkA2AQBBQVuZnRJZAELZ2V0UHJpY2VLZXkBBW5mdElkCQCsAgIJAKwCAgUGa1ByaWNlBQlzZXBhcmF0b3IJANgEAQUFbmZ0SWQBCmdldFNlbGxLZXkBBW5mdElkCQCsAgIJAKwCAgUFa1NlbGwFCXNlcGFyYXRvcgkA2AQBBQVuZnRJZAENZ2V0QXVjdGlvbktleQEFbmZ0SWQJAKwCAgkArAICBQhrQXVjdGlvbgUJc2VwYXJhdG9yCQDYBAEFBW5mdElkAQ1nZXRUcnVzdGVkS2V5AQZpc3N1ZXI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QwMTIxNTExMjIxNAJfMgkAzAgCCQEMSW50ZWdlckVudHJ5AgkBC2dldFByaWNlS2V5AQUHYXNzZXRJZAUFcHJpY2UFA25pbAB8TZJj", "height": 2339996, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: CrpCHarKnzB2617uESkN533DtWyNssfRDcvPJvx2ADpS Next: DxBcdo9SZAgvwCG7yweQS7Z5Qu4SfzcvKMJXpFzwaE2X Diff:
Old | New | Differences | |
---|---|---|---|
305 | 305 | case _ => | |
306 | 306 | false | |
307 | 307 | } | |
308 | - | let price = valueOrErrorMessage(getString(((kPrice + separator) + nftID)), "There is no price for this NFT") | |
308 | + | let price = valueOrErrorMessage(getString(((((kPrice + separator) + nftID) + "_") + current_nft_owner)), "There is no price for this NFT") | |
309 | 309 | let owner = valueOrErrorMessage(getStringValue(((nftID + separator) + "Owner")), "No owner") | |
310 | 310 | if ((i.payments[0].assetId != unit)) | |
311 | 311 | then throw("Pay in waves") | |
321 | 321 | @Callable(i) | |
322 | 322 | func sellNFT (price) = { | |
323 | 323 | let seller = i.caller.bytes | |
324 | - | let $ | |
325 | - | let token0 = $ | |
326 | - | let amount0 = $ | |
324 | + | let $t087578842 = $Tuple2(value(i.payments[0].assetId), value(i.payments[0].amount)) | |
325 | + | let token0 = $t087578842._1 | |
326 | + | let amount0 = $t087578842._2 | |
327 | 327 | if (!(isNft(token0))) | |
328 | 328 | then throw("Token is not NFT") | |
329 | - | else [StringEntry((("nft_" + toBase58String(seller)) + "_owner"), toBase58String(seller)), StringEntry(((kPrice + separator) + toBase58String(value(i.payments[0].assetId))), price), StringEntry(((toString(i.caller) + separator) + kSell), ((toBase58String(token0) + separator) + toString(amount0)))] | |
329 | + | else [StringEntry((("nft_" + toBase58String(seller)) + "_owner"), toBase58String(seller)), StringEntry(((((kPrice + separator) + toBase58String(value(i.payments[0].assetId))) + "_") + toString(i.caller)), price), StringEntry(((toString(i.caller) + separator) + kSell), ((toBase58String(token0) + separator) + toString(amount0)))] | |
330 | 330 | } | |
331 | 331 | ||
332 | 332 | ||
351 | 351 | ||
352 | 352 | @Callable(i) | |
353 | 353 | func buyFromSlot (nftId) = { | |
354 | - | let $ | |
355 | - | let paymentAsset = $ | |
356 | - | let paymentAmount = $ | |
354 | + | let $t098619950 = $Tuple2(i.payments[0].assetId, value(i.payments[0].amount)) | |
355 | + | let paymentAsset = $t098619950._1 | |
356 | + | let paymentAmount = $t098619950._2 | |
357 | 357 | let assetId = fromBase58String(nftId) | |
358 | - | let $ | |
359 | - | let type = $ | |
360 | - | let details = $ | |
358 | + | let $t0999410032 = getSlot(assetId) | |
359 | + | let type = $t0999410032._1 | |
360 | + | let details = $t0999410032._2 | |
361 | 361 | let baseRes = [ScriptTransfer(i.caller, 1, assetId), DeleteEntry(getSlotKey(type, assetId))] | |
362 | 362 | if ((type == kSell)) | |
363 | 363 | then { | |
364 | - | let $ | |
365 | - | let seller = $ | |
366 | - | let priceValue = $ | |
364 | + | let $t01017410221 = parseAsSell(details) | |
365 | + | let seller = $t01017410221._1 | |
366 | + | let priceValue = $t01017410221._2 | |
367 | 367 | valueOrElse(isCorrectPayments(paymentAsset, paymentAmount, priceValue), { | |
368 | - | let $ | |
369 | - | let sellerAmount = $ | |
370 | - | let buyerAmount = $ | |
368 | + | let $t01030610408 = resultFundsAmounts(isTrustedNft(assetId), paymentAmount, priceValue) | |
369 | + | let sellerAmount = $t01030610408._1 | |
370 | + | let buyerAmount = $t01030610408._2 | |
371 | 371 | let updatedRes = (baseRes ++ [ScriptTransfer(seller, sellerAmount, unit)]) | |
372 | 372 | if ((buyerAmount > 0)) | |
373 | 373 | then (updatedRes ++ [ScriptTransfer(i.caller, buyerAmount, unit)]) | |
375 | 375 | }) | |
376 | 376 | } | |
377 | 377 | else { | |
378 | - | let $ | |
379 | - | let seller = $ | |
380 | - | let actualPrice = $ | |
378 | + | let $t01062510694 = calcPriceAtCurrentMoment(assetId, height) | |
379 | + | let seller = $t01062510694._1 | |
380 | + | let actualPrice = $t01062510694._2 | |
381 | 381 | valueOrElse(isCorrectPayments(paymentAsset, paymentAmount, actualPrice), { | |
382 | - | let $ | |
383 | - | let sellerAmount = $ | |
384 | - | let buyerAmount = $ | |
382 | + | let $t01078010883 = resultFundsAmounts(isTrustedNft(assetId), paymentAmount, actualPrice) | |
383 | + | let sellerAmount = $t01078010883._1 | |
384 | + | let buyerAmount = $t01078010883._2 | |
385 | 385 | let updatedRes = (baseRes ++ [ScriptTransfer(seller, sellerAmount, unit)]) | |
386 | 386 | if ((buyerAmount > 0)) | |
387 | 387 | then (updatedRes ++ [ScriptTransfer(i.caller, buyerAmount, unit)]) | |
395 | 395 | @Callable(i) | |
396 | 396 | func declineSlot (nftId) = { | |
397 | 397 | let assetId = fromBase58String(nftId) | |
398 | - | let $ | |
399 | - | let type = $ | |
400 | - | let details = $ | |
398 | + | let $t01118411222 = getSlot(assetId) | |
399 | + | let type = $t01118411222._1 | |
400 | + | let details = $t01118411222._2 | |
401 | 401 | let baseRes = [DeleteEntry(getSlotKey(type, assetId))] | |
402 | 402 | if ((type == kSell)) | |
403 | 403 | then { | |
404 | - | let $ | |
405 | - | let seller = $ | |
406 | - | let priceValue = $ | |
404 | + | let $t01131411361 = parseAsSell(details) | |
405 | + | let seller = $t01131411361._1 | |
406 | + | let priceValue = $t01131411361._2 | |
407 | 407 | if (!(isValidCaller(i.caller, seller))) | |
408 | 408 | then throw("Invalid caller") | |
409 | 409 | else (baseRes ++ [ScriptTransfer(seller, 1, assetId)]) | |
410 | 410 | } | |
411 | 411 | else { | |
412 | - | let $ | |
413 | - | let seller = $ | |
414 | - | let startPriceValue = $ | |
415 | - | let endPriceValue = $ | |
416 | - | let startPeriodValue = $ | |
417 | - | let endPeriodValue = $ | |
412 | + | let $t01150611610 = parseAsAuction(details) | |
413 | + | let seller = $t01150611610._1 | |
414 | + | let startPriceValue = $t01150611610._2 | |
415 | + | let endPriceValue = $t01150611610._3 | |
416 | + | let startPeriodValue = $t01150611610._4 | |
417 | + | let endPeriodValue = $t01150611610._5 | |
418 | 418 | if (!(isValidCaller(i.caller, seller))) | |
419 | 419 | then throw("Invalid caller") | |
420 | 420 | else if (!(isAuctionEnded(height, endPeriodValue))) | |
435 | 435 | @Callable(i) | |
436 | 436 | func getPriceAtCurrentMoment (nftId,moment) = { | |
437 | 437 | let assetId = fromBase58String(nftId) | |
438 | - | let $ | |
439 | - | let seller = $ | |
440 | - | let price = $ | |
438 | + | let $t01215112214 = calcPriceAtCurrentMoment(assetId, moment) | |
439 | + | let seller = $t01215112214._1 | |
440 | + | let price = $t01215112214._2 | |
441 | 441 | [IntegerEntry(getPriceKey(assetId), price)] | |
442 | 442 | } | |
443 | 443 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let separator = "_" | |
5 | 5 | ||
6 | 6 | let kAuction = "auction" | |
7 | 7 | ||
8 | 8 | let kSell = "sell" | |
9 | 9 | ||
10 | 10 | let kTrusted = "trusted" | |
11 | 11 | ||
12 | 12 | let kPrice = "price" | |
13 | 13 | ||
14 | 14 | func getSlotKey (prefix,nftId) = ((prefix + separator) + toBase58String(nftId)) | |
15 | 15 | ||
16 | 16 | ||
17 | 17 | func getPriceKey (nftId) = ((kPrice + separator) + toBase58String(nftId)) | |
18 | 18 | ||
19 | 19 | ||
20 | 20 | func getSellKey (nftId) = ((kSell + separator) + toBase58String(nftId)) | |
21 | 21 | ||
22 | 22 | ||
23 | 23 | func getAuctionKey (nftId) = ((kAuction + separator) + toBase58String(nftId)) | |
24 | 24 | ||
25 | 25 | ||
26 | 26 | func getTrustedKey (issuer) = ((kTrusted + separator) + toString(issuer)) | |
27 | 27 | ||
28 | 28 | ||
29 | 29 | func addToList (accum,nextValue) = (accum ++ [nextValue]) | |
30 | 30 | ||
31 | 31 | ||
32 | 32 | func joinString (params) = { | |
33 | 33 | let length = size(params) | |
34 | 34 | if ((length == 0)) | |
35 | 35 | then throw("Empty params") | |
36 | 36 | else if ((length == 1)) | |
37 | 37 | then makeString({ | |
38 | 38 | let $l = params | |
39 | 39 | let $s = size($l) | |
40 | 40 | let $acc0 = nil | |
41 | 41 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
42 | 42 | then $a | |
43 | 43 | else addToList($a, $l[$i]) | |
44 | 44 | ||
45 | 45 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
46 | 46 | then $a | |
47 | 47 | else throw("List size exceeds 1") | |
48 | 48 | ||
49 | 49 | $f0_2($f0_1($acc0, 0), 1) | |
50 | 50 | }, separator) | |
51 | 51 | else if ((length == 2)) | |
52 | 52 | then makeString({ | |
53 | 53 | let $l = params | |
54 | 54 | let $s = size($l) | |
55 | 55 | let $acc0 = nil | |
56 | 56 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
57 | 57 | then $a | |
58 | 58 | else addToList($a, $l[$i]) | |
59 | 59 | ||
60 | 60 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
61 | 61 | then $a | |
62 | 62 | else throw("List size exceeds 2") | |
63 | 63 | ||
64 | 64 | $f0_2($f0_1($f0_1($acc0, 0), 1), 2) | |
65 | 65 | }, separator) | |
66 | 66 | else if ((length == 3)) | |
67 | 67 | then makeString({ | |
68 | 68 | let $l = params | |
69 | 69 | let $s = size($l) | |
70 | 70 | let $acc0 = nil | |
71 | 71 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
72 | 72 | then $a | |
73 | 73 | else addToList($a, $l[$i]) | |
74 | 74 | ||
75 | 75 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
76 | 76 | then $a | |
77 | 77 | else throw("List size exceeds 3") | |
78 | 78 | ||
79 | 79 | $f0_2($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3) | |
80 | 80 | }, separator) | |
81 | 81 | else if ((length == 4)) | |
82 | 82 | then makeString({ | |
83 | 83 | let $l = params | |
84 | 84 | let $s = size($l) | |
85 | 85 | let $acc0 = nil | |
86 | 86 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
87 | 87 | then $a | |
88 | 88 | else addToList($a, $l[$i]) | |
89 | 89 | ||
90 | 90 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
91 | 91 | then $a | |
92 | 92 | else throw("List size exceeds 4") | |
93 | 93 | ||
94 | 94 | $f0_2($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4) | |
95 | 95 | }, separator) | |
96 | 96 | else if ((length == 5)) | |
97 | 97 | then makeString({ | |
98 | 98 | let $l = params | |
99 | 99 | let $s = size($l) | |
100 | 100 | let $acc0 = nil | |
101 | 101 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
102 | 102 | then $a | |
103 | 103 | else addToList($a, $l[$i]) | |
104 | 104 | ||
105 | 105 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
106 | 106 | then $a | |
107 | 107 | else throw("List size exceeds 5") | |
108 | 108 | ||
109 | 109 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5) | |
110 | 110 | }, separator) | |
111 | 111 | else throw("Max number of parameters exceeded") | |
112 | 112 | } | |
113 | 113 | ||
114 | 114 | ||
115 | 115 | func parseAsAuction (details) = { | |
116 | 116 | let res = split(details, separator) | |
117 | 117 | $Tuple5(addressFromStringValue(res[0]), parseIntValue(res[1]), parseIntValue(res[2]), parseIntValue(res[3]), parseIntValue(res[4])) | |
118 | 118 | } | |
119 | 119 | ||
120 | 120 | ||
121 | 121 | func parseAsSell (details) = { | |
122 | 122 | let res = split(details, separator) | |
123 | 123 | $Tuple2(addressFromStringValue(res[0]), parseIntValue(res[1])) | |
124 | 124 | } | |
125 | 125 | ||
126 | 126 | ||
127 | 127 | func joinStruct (params) = match params { | |
128 | 128 | case auction: (Address, Int, String, String) => | |
129 | 129 | joinString([toString(auction._1), toString(auction._2), auction._3, auction._4]) | |
130 | 130 | case sell: (Address, Int) => | |
131 | 131 | joinString([toString(sell._1), toString(sell._2)]) | |
132 | 132 | case _ => | |
133 | 133 | throw("Wrong params tupple") | |
134 | 134 | } | |
135 | 135 | ||
136 | 136 | ||
137 | 137 | func setAuction (seller,nftId,startPrice,start,end) = StringEntry(getAuctionKey(nftId), joinStruct($Tuple4(seller, startPrice, start, end))) | |
138 | 138 | ||
139 | 139 | ||
140 | 140 | func setSell (nftId,celler,price) = StringEntry(getSellKey(nftId), joinStruct($Tuple2(celler, price))) | |
141 | 141 | ||
142 | 142 | ||
143 | 143 | func getAuction (nftId) = value(getString(this, getAuctionKey(nftId))) | |
144 | 144 | ||
145 | 145 | ||
146 | 146 | func getSell (nftId) = value(getString(this, getSellKey(nftId))) | |
147 | 147 | ||
148 | 148 | ||
149 | 149 | func calcPriceAtCurrentMoment (assetId,moment) = { | |
150 | 150 | let details = getAuction(assetId) | |
151 | 151 | let $t027552859 = parseAsAuction(details) | |
152 | 152 | let seller = $t027552859._1 | |
153 | 153 | let startPriceValue = $t027552859._2 | |
154 | 154 | let endPriceValue = $t027552859._3 | |
155 | 155 | let startPeriodValue = $t027552859._4 | |
156 | 156 | let endPeriodValue = $t027552859._5 | |
157 | 157 | if ((moment >= endPeriodValue)) | |
158 | 158 | then $Tuple2(seller, endPriceValue) | |
159 | 159 | else { | |
160 | 160 | let deltaPrice = (startPriceValue - endPriceValue) | |
161 | 161 | let period = (endPeriodValue - startPeriodValue) | |
162 | 162 | let spended = (moment - startPeriodValue) | |
163 | 163 | $Tuple2(seller, (startPriceValue - fraction(spended, deltaPrice, period))) | |
164 | 164 | } | |
165 | 165 | } | |
166 | 166 | ||
167 | 167 | ||
168 | 168 | func isNft (assetId) = match assetInfo(assetId) { | |
169 | 169 | case token: Asset => | |
170 | 170 | if (if ((token.decimals == 0)) | |
171 | 171 | then (token.quantity == 1) | |
172 | 172 | else false) | |
173 | 173 | then (token.reissuable == false) | |
174 | 174 | else false | |
175 | 175 | case _ => | |
176 | 176 | false | |
177 | 177 | } | |
178 | 178 | ||
179 | 179 | ||
180 | 180 | func isTrustedNft (assetId) = { | |
181 | 181 | let issuer = value(assetInfo(assetId)).issuer | |
182 | 182 | valueOrElse(getBoolean(this, getTrustedKey(issuer)), false) | |
183 | 183 | } | |
184 | 184 | ||
185 | 185 | ||
186 | 186 | func isSellExist (assetId) = isDefined(getString(this, getSellKey(assetId))) | |
187 | 187 | ||
188 | 188 | ||
189 | 189 | func isAuctionExist (assetId) = isDefined(getString(this, getAuctionKey(assetId))) | |
190 | 190 | ||
191 | 191 | ||
192 | 192 | func isCorrectSellPrice (price) = (price > 0) | |
193 | 193 | ||
194 | 194 | ||
195 | 195 | func isCorrectAuctionPrices (startPrice,endPrice) = (startPrice > endPrice) | |
196 | 196 | ||
197 | 197 | ||
198 | 198 | func isAdmin (caller) = (caller == this) | |
199 | 199 | ||
200 | 200 | ||
201 | 201 | func isValidCaller (caller,seller) = if ((caller == this)) | |
202 | 202 | then true | |
203 | 203 | else (caller == seller) | |
204 | 204 | ||
205 | 205 | ||
206 | 206 | func isAuctionEnded (now,end) = (now > end) | |
207 | 207 | ||
208 | 208 | ||
209 | 209 | func isEnoughFunds (payment,currentMomentPrice) = (payment >= currentMomentPrice) | |
210 | 210 | ||
211 | 211 | ||
212 | 212 | func isWawes (assetId) = (assetId == unit) | |
213 | 213 | ||
214 | 214 | ||
215 | 215 | func isCorrectNft (nftId) = if (!(isNft(nftId))) | |
216 | 216 | then throw("Token is not Nft") | |
217 | 217 | else if (isSellExist(nftId)) | |
218 | 218 | then throw("Sell already exists") | |
219 | 219 | else if (isAuctionExist(nftId)) | |
220 | 220 | then throw("Auction already exists") | |
221 | 221 | else unit | |
222 | 222 | ||
223 | 223 | ||
224 | 224 | func isCorrectPayments (paymentAsset,paymentAmount,price) = if (!(isWawes(paymentAsset))) | |
225 | 225 | then throw("Payment must be at WAVES") | |
226 | 226 | else if (!(isEnoughFunds(paymentAmount, price))) | |
227 | 227 | then throw("Not enough funds") | |
228 | 228 | else unit | |
229 | 229 | ||
230 | 230 | ||
231 | 231 | func calcFee () = 0 | |
232 | 232 | ||
233 | 233 | ||
234 | 234 | func calcTrustedFee () = 0 | |
235 | 235 | ||
236 | 236 | ||
237 | 237 | func resultFundsAmounts (isTrusted,paymentAmount,actualPrice) = if (isTrusted) | |
238 | 238 | then $Tuple2((actualPrice - calcTrustedFee()), (paymentAmount - actualPrice)) | |
239 | 239 | else $Tuple2((actualPrice - calcFee()), (paymentAmount - actualPrice)) | |
240 | 240 | ||
241 | 241 | ||
242 | 242 | func getSlot (nftId) = if (isSellExist(nftId)) | |
243 | 243 | then $Tuple2(kSell, getSell(nftId)) | |
244 | 244 | else if (isAuctionExist(nftId)) | |
245 | 245 | then $Tuple2(kAuction, getAuction(nftId)) | |
246 | 246 | else throw("Slot doesn`t exist") | |
247 | 247 | ||
248 | 248 | ||
249 | 249 | let kBuy = "buy" | |
250 | 250 | ||
251 | 251 | let kBid = "bid" | |
252 | 252 | ||
253 | 253 | @Callable(i) | |
254 | 254 | func placeBid (nftId,nft_owner,min_price,bid_price) = { | |
255 | 255 | let assetId = fromBase58String(nftId) | |
256 | 256 | let amount = value(i.payments[0].amount) | |
257 | 257 | if ((i.payments[0].assetId != unit)) | |
258 | 258 | then throw("Pay in waves") | |
259 | 259 | else [ScriptTransfer(i.caller, amount, unit), StringEntry(((toString(i.caller) + separator) + kBid), ((nftId + separator) + toString(amount))), StringEntry(((toString(i.caller) + separator) + "nft_owner"), nft_owner), IntegerEntry(((toString(i.caller) + separator) + "min_price"), min_price), IntegerEntry(((toString(i.caller) + separator) + "bid_price"), bid_price), StringEntry(((toString(i.caller) + separator) + "nftId"), nftId)] | |
260 | 260 | } | |
261 | 261 | ||
262 | 262 | ||
263 | 263 | ||
264 | 264 | @Callable(i) | |
265 | 265 | func pay () = { | |
266 | 266 | let amount = value(i.payments[0].amount) | |
267 | 267 | if ((i.payments[0].assetId != unit)) | |
268 | 268 | then throw("Pay in waves") | |
269 | 269 | else nil | |
270 | 270 | } | |
271 | 271 | ||
272 | 272 | ||
273 | 273 | ||
274 | 274 | @Callable(i) | |
275 | 275 | func confirmBid (nftId,userAddress) = [StringEntry("bid_winner", userAddress)] | |
276 | 276 | ||
277 | 277 | ||
278 | 278 | ||
279 | 279 | @Callable(i) | |
280 | 280 | func createNft (nft_name,nft_owner,nft_dAppAddress,nft_type,nft_tags,nft_selling_price,nft_description,nft_onSell,nft_data) = { | |
281 | 281 | let newToken = Issue(nft_name, nft_description, 1, 0, false) | |
282 | 282 | let issueId = calculateAssetId(newToken) | |
283 | 283 | let txId = i.transactionId | |
284 | 284 | [newToken, ScriptTransfer(i.caller, 1, issueId), StringEntry(((toBase58String(issueId) + separator) + "Owner"), toString(i.caller)), StringEntry(((toBase58String(issueId) + separator) + "nft_type"), nft_type), StringEntry(((toBase58String(issueId) + separator) + "nft_tags"), nft_tags), StringEntry(((toBase58String(issueId) + separator) + "nft_dAppAddress"), nft_dAppAddress), IntegerEntry(((toBase58String(issueId) + separator) + "nft_selling_price"), nft_selling_price), StringEntry(((toBase58String(issueId) + separator) + "nft_onSell"), nft_onSell), StringEntry(((toBase58String(issueId) + separator) + "nft_data"), nft_data), StringEntry(((toBase58String(txId) + separator) + "issue_nft"), toBase58String(issueId))] | |
285 | 285 | } | |
286 | 286 | ||
287 | 287 | ||
288 | 288 | ||
289 | 289 | @Callable(i) | |
290 | 290 | func issueNft (name,meta) = { | |
291 | 291 | let newToken = Issue(name, meta, 1, 0, false) | |
292 | 292 | let issueId = calculateAssetId(newToken) | |
293 | 293 | [newToken, ScriptTransfer(i.caller, 1, issueId), StringEntry(((toBase58String(issueId) + separator) + "Owner"), toString(i.caller))] | |
294 | 294 | } | |
295 | 295 | ||
296 | 296 | ||
297 | 297 | ||
298 | 298 | @Callable(i) | |
299 | 299 | func buyNFT (nftID,current_nft_owner) = { | |
300 | 300 | let assetId = fromBase58String(nftID) | |
301 | 301 | let amount = value(i.payments[0].amount) | |
302 | 302 | let checkOwnerIsSame = match getString(this, (("nft_" + current_nft_owner) + "_owner")) { | |
303 | 303 | case a: String => | |
304 | 304 | a | |
305 | 305 | case _ => | |
306 | 306 | false | |
307 | 307 | } | |
308 | - | let price = valueOrErrorMessage(getString(((kPrice + separator) + nftID)), "There is no price for this NFT") | |
308 | + | let price = valueOrErrorMessage(getString(((((kPrice + separator) + nftID) + "_") + current_nft_owner)), "There is no price for this NFT") | |
309 | 309 | let owner = valueOrErrorMessage(getStringValue(((nftID + separator) + "Owner")), "No owner") | |
310 | 310 | if ((i.payments[0].assetId != unit)) | |
311 | 311 | then throw("Pay in waves") | |
312 | 312 | else if ((parseIntValue(price) > amount)) | |
313 | 313 | then throw("Invalid payment") | |
314 | 314 | else if ((checkOwnerIsSame == toString(i.caller))) | |
315 | 315 | then throw("Owner of NFT not able to purchase") | |
316 | 316 | else [ScriptTransfer(i.caller, 1, assetId), ScriptTransfer(Address(fromBase58String(owner)), parseIntValue(price), unit), StringEntry(((toString(i.caller) + separator) + kBuy), ((nftID + separator) + toString(amount))), DeleteEntry((("nft_" + current_nft_owner) + "_owner"))] | |
317 | 317 | } | |
318 | 318 | ||
319 | 319 | ||
320 | 320 | ||
321 | 321 | @Callable(i) | |
322 | 322 | func sellNFT (price) = { | |
323 | 323 | let seller = i.caller.bytes | |
324 | - | let $ | |
325 | - | let token0 = $ | |
326 | - | let amount0 = $ | |
324 | + | let $t087578842 = $Tuple2(value(i.payments[0].assetId), value(i.payments[0].amount)) | |
325 | + | let token0 = $t087578842._1 | |
326 | + | let amount0 = $t087578842._2 | |
327 | 327 | if (!(isNft(token0))) | |
328 | 328 | then throw("Token is not NFT") | |
329 | - | else [StringEntry((("nft_" + toBase58String(seller)) + "_owner"), toBase58String(seller)), StringEntry(((kPrice + separator) + toBase58String(value(i.payments[0].assetId))), price), StringEntry(((toString(i.caller) + separator) + kSell), ((toBase58String(token0) + separator) + toString(amount0)))] | |
329 | + | else [StringEntry((("nft_" + toBase58String(seller)) + "_owner"), toBase58String(seller)), StringEntry(((((kPrice + separator) + toBase58String(value(i.payments[0].assetId))) + "_") + toString(i.caller)), price), StringEntry(((toString(i.caller) + separator) + kSell), ((toBase58String(token0) + separator) + toString(amount0)))] | |
330 | 330 | } | |
331 | 331 | ||
332 | 332 | ||
333 | 333 | ||
334 | 334 | @Callable(i) | |
335 | 335 | func addSell (price) = { | |
336 | 336 | let nftId = value(i.payments[0].assetId) | |
337 | 337 | valueOrElse(isCorrectNft(nftId), if (!(isCorrectSellPrice(price))) | |
338 | 338 | then throw("Price must be > 0") | |
339 | 339 | else [setSell(nftId, i.caller, price)]) | |
340 | 340 | } | |
341 | 341 | ||
342 | 342 | ||
343 | 343 | ||
344 | 344 | @Callable(i) | |
345 | 345 | func addAuction (startPrice,start,end) = { | |
346 | 346 | let nftId = value(i.payments[0].assetId) | |
347 | 347 | valueOrElse(isCorrectNft(nftId), [setAuction(i.caller, nftId, startPrice, start, end), StringEntry(((toBase58String(nftId) + separator) + "nft_owner"), toString(i.caller))]) | |
348 | 348 | } | |
349 | 349 | ||
350 | 350 | ||
351 | 351 | ||
352 | 352 | @Callable(i) | |
353 | 353 | func buyFromSlot (nftId) = { | |
354 | - | let $ | |
355 | - | let paymentAsset = $ | |
356 | - | let paymentAmount = $ | |
354 | + | let $t098619950 = $Tuple2(i.payments[0].assetId, value(i.payments[0].amount)) | |
355 | + | let paymentAsset = $t098619950._1 | |
356 | + | let paymentAmount = $t098619950._2 | |
357 | 357 | let assetId = fromBase58String(nftId) | |
358 | - | let $ | |
359 | - | let type = $ | |
360 | - | let details = $ | |
358 | + | let $t0999410032 = getSlot(assetId) | |
359 | + | let type = $t0999410032._1 | |
360 | + | let details = $t0999410032._2 | |
361 | 361 | let baseRes = [ScriptTransfer(i.caller, 1, assetId), DeleteEntry(getSlotKey(type, assetId))] | |
362 | 362 | if ((type == kSell)) | |
363 | 363 | then { | |
364 | - | let $ | |
365 | - | let seller = $ | |
366 | - | let priceValue = $ | |
364 | + | let $t01017410221 = parseAsSell(details) | |
365 | + | let seller = $t01017410221._1 | |
366 | + | let priceValue = $t01017410221._2 | |
367 | 367 | valueOrElse(isCorrectPayments(paymentAsset, paymentAmount, priceValue), { | |
368 | - | let $ | |
369 | - | let sellerAmount = $ | |
370 | - | let buyerAmount = $ | |
368 | + | let $t01030610408 = resultFundsAmounts(isTrustedNft(assetId), paymentAmount, priceValue) | |
369 | + | let sellerAmount = $t01030610408._1 | |
370 | + | let buyerAmount = $t01030610408._2 | |
371 | 371 | let updatedRes = (baseRes ++ [ScriptTransfer(seller, sellerAmount, unit)]) | |
372 | 372 | if ((buyerAmount > 0)) | |
373 | 373 | then (updatedRes ++ [ScriptTransfer(i.caller, buyerAmount, unit)]) | |
374 | 374 | else updatedRes | |
375 | 375 | }) | |
376 | 376 | } | |
377 | 377 | else { | |
378 | - | let $ | |
379 | - | let seller = $ | |
380 | - | let actualPrice = $ | |
378 | + | let $t01062510694 = calcPriceAtCurrentMoment(assetId, height) | |
379 | + | let seller = $t01062510694._1 | |
380 | + | let actualPrice = $t01062510694._2 | |
381 | 381 | valueOrElse(isCorrectPayments(paymentAsset, paymentAmount, actualPrice), { | |
382 | - | let $ | |
383 | - | let sellerAmount = $ | |
384 | - | let buyerAmount = $ | |
382 | + | let $t01078010883 = resultFundsAmounts(isTrustedNft(assetId), paymentAmount, actualPrice) | |
383 | + | let sellerAmount = $t01078010883._1 | |
384 | + | let buyerAmount = $t01078010883._2 | |
385 | 385 | let updatedRes = (baseRes ++ [ScriptTransfer(seller, sellerAmount, unit)]) | |
386 | 386 | if ((buyerAmount > 0)) | |
387 | 387 | then (updatedRes ++ [ScriptTransfer(i.caller, buyerAmount, unit)]) | |
388 | 388 | else updatedRes | |
389 | 389 | }) | |
390 | 390 | } | |
391 | 391 | } | |
392 | 392 | ||
393 | 393 | ||
394 | 394 | ||
395 | 395 | @Callable(i) | |
396 | 396 | func declineSlot (nftId) = { | |
397 | 397 | let assetId = fromBase58String(nftId) | |
398 | - | let $ | |
399 | - | let type = $ | |
400 | - | let details = $ | |
398 | + | let $t01118411222 = getSlot(assetId) | |
399 | + | let type = $t01118411222._1 | |
400 | + | let details = $t01118411222._2 | |
401 | 401 | let baseRes = [DeleteEntry(getSlotKey(type, assetId))] | |
402 | 402 | if ((type == kSell)) | |
403 | 403 | then { | |
404 | - | let $ | |
405 | - | let seller = $ | |
406 | - | let priceValue = $ | |
404 | + | let $t01131411361 = parseAsSell(details) | |
405 | + | let seller = $t01131411361._1 | |
406 | + | let priceValue = $t01131411361._2 | |
407 | 407 | if (!(isValidCaller(i.caller, seller))) | |
408 | 408 | then throw("Invalid caller") | |
409 | 409 | else (baseRes ++ [ScriptTransfer(seller, 1, assetId)]) | |
410 | 410 | } | |
411 | 411 | else { | |
412 | - | let $ | |
413 | - | let seller = $ | |
414 | - | let startPriceValue = $ | |
415 | - | let endPriceValue = $ | |
416 | - | let startPeriodValue = $ | |
417 | - | let endPeriodValue = $ | |
412 | + | let $t01150611610 = parseAsAuction(details) | |
413 | + | let seller = $t01150611610._1 | |
414 | + | let startPriceValue = $t01150611610._2 | |
415 | + | let endPriceValue = $t01150611610._3 | |
416 | + | let startPeriodValue = $t01150611610._4 | |
417 | + | let endPeriodValue = $t01150611610._5 | |
418 | 418 | if (!(isValidCaller(i.caller, seller))) | |
419 | 419 | then throw("Invalid caller") | |
420 | 420 | else if (!(isAuctionEnded(height, endPeriodValue))) | |
421 | 421 | then throw("Wait for end of auction") | |
422 | 422 | else (baseRes ++ [ScriptTransfer(seller, 1, assetId)]) | |
423 | 423 | } | |
424 | 424 | } | |
425 | 425 | ||
426 | 426 | ||
427 | 427 | ||
428 | 428 | @Callable(i) | |
429 | 429 | func setTrustedIssuer (trustedAddr) = if (!(isAdmin(i.caller))) | |
430 | 430 | then throw("Only admin") | |
431 | 431 | else [BooleanEntry(getTrustedKey(addressFromStringValue(trustedAddr)), true)] | |
432 | 432 | ||
433 | 433 | ||
434 | 434 | ||
435 | 435 | @Callable(i) | |
436 | 436 | func getPriceAtCurrentMoment (nftId,moment) = { | |
437 | 437 | let assetId = fromBase58String(nftId) | |
438 | - | let $ | |
439 | - | let seller = $ | |
440 | - | let price = $ | |
438 | + | let $t01215112214 = calcPriceAtCurrentMoment(assetId, moment) | |
439 | + | let seller = $t01215112214._1 | |
440 | + | let price = $t01215112214._2 | |
441 | 441 | [IntegerEntry(getPriceKey(assetId), price)] | |
442 | 442 | } | |
443 | 443 | ||
444 | 444 |
github/deemru/w8io/026f985 58.92 ms ◑