tx · 6BNL4m6vDzz4hDnKZLAR9m2DUQKwkXd8f7HfKrDM33Ty

3MvjAaDYHpS4A5K4CV3kZMMEH9m9JdBSvbq:  -0.01000000 Waves

2022.11.29 09:07 [2338019] smart account 3MvjAaDYHpS4A5K4CV3kZMMEH9m9JdBSvbq > SELF 0.00000000 Waves

{ "type": 13, "id": "6BNL4m6vDzz4hDnKZLAR9m2DUQKwkXd8f7HfKrDM33Ty", "fee": 1000000, "feeAssetId": null, "timestamp": 1669702080615, "version": 2, "chainId": 84, "sender": "3MvjAaDYHpS4A5K4CV3kZMMEH9m9JdBSvbq", "senderPublicKey": "H6UqxUDcJamDRg1uykVcWMn4zhAMTV7i1nfPq1moLWmJ", "proofs": [ "4CaPWfmAVqYFFYqGrnb1EMvzMR3hqEgtD3GXz36scTvSyLKjNN5DS2SJJMqRn6msuWzvhsCakYcT4t87ZZMYP6qN" ], "script": "base64:BgJACAISCwoJCAgICAgBCAgIEgQKAggIEgMKAQgSAwoBARIDCgEBEgUKAwEICBIDCgEIEgMKAQgSAwoBCBIECgIIASYACXNlcGFyYXRvcgIBXwAIa0F1Y3Rpb24CB2F1Y3Rpb24ABWtTZWxsAgRzZWxsAAhrVHJ1c3RlZAIHdHJ1c3RlZAAGa1ByaWNlAgVwcmljZQEKZ2V0U2xvdEtleQIGcHJlZml4BW5mdElkCQCsAgIJAKwCAgUGcHJlZml4BQlzZXBhcmF0b3IJANgEAQUFbmZ0SWQBC2dldFByaWNlS2V5AQVuZnRJZAkArAICCQCsAgIFBmtQcmljZQUJc2VwYXJhdG9yCQDYBAEFBW5mdElkAQpnZXRTZWxsS2V5AQVuZnRJZAkArAICCQCsAgIFBWtTZWxsBQlzZXBhcmF0b3IJANgEAQUFbmZ0SWQBDWdldEF1Y3Rpb25LZXkBBW5mdElkCQCsAgIJAKwCAgUIa0F1Y3Rpb24FCXNlcGFyYXRvcgkA2AQBBQVuZnRJZAENZ2V0VHJ1c3RlZEtleQEGaXNzdWVyCQCsAgIJAKw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FAZXh0ck5hdGl2ZSgxMDYyKQEFC3RydXN0ZWRBZGRyBgUDbmlsAWkBF2dldFByaWNlQXRDdXJyZW50TW9tZW50AgVuZnRJZAZtb21lbnQEB2Fzc2V0SWQJANkEAQUFbmZ0SWQEDSR0MDEwNTQyMTA2MDUJARhjYWxjUHJpY2VBdEN1cnJlbnRNb21lbnQCBQdhc3NldElkBQZtb21lbnQEBnNlbGxlcggFDSR0MDEwNTQyMTA2MDUCXzEEBXByaWNlCAUNJHQwMTA1NDIxMDYwNQJfMgkAzAgCCQEMSW50ZWdlckVudHJ5AgkBC2dldFByaWNlS2V5AQUHYXNzZXRJZAUFcHJpY2UFA25pbADKD6Ds", "height": 2338019, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: BZ3PP3WqgXPGrzD2bDKWkS9nVTeV1osr3QqabG7QENrj Next: F2fdKpnTMiFKYso7wBLr3PAsBBEUHBdmeiBSLMzAJ7zF Diff:
OldNewDifferences
249249 let kBuy = "buy"
250250
251251 @Callable(i)
252-func issueNft (nft_name,nft_owner,nft_dAppAddress,nft_type,nft_tags,nft_selling_price,nft_description,nft_onSell,nft_data) = {
252+func createNFT (nft_name,nft_owner,nft_dAppAddress,nft_type,nft_tags,nft_selling_price,nft_description,nft_onSell,nft_data) = {
253253 let newToken = Issue(nft_name, nft_description, 1, 0, false)
254254 let issueId = calculateAssetId(newToken)
255255 let txId = i.transactionId
256-[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))]
256+[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)]
257+ }
258+
259+
260+
261+@Callable(i)
262+func issueNft (name,meta) = {
263+ let newToken = Issue(name, meta, 1, 0, false)
264+ let issueId = calculateAssetId(newToken)
265+[newToken, ScriptTransfer(i.caller, 1, issueId), StringEntry(((toBase58String(issueId) + separator) + "Owner"), toString(i.caller))]
257266 }
258267
259268
275284
276285 @Callable(i)
277286 func sellNFT (price) = {
278- let $t073577442 = $Tuple2(value(i.payments[0].assetId), value(i.payments[0].amount))
279- let token0 = $t073577442._1
280- let amount0 = $t073577442._2
287+ let $t072477332 = $Tuple2(value(i.payments[0].assetId), value(i.payments[0].amount))
288+ let token0 = $t072477332._1
289+ let amount0 = $t072477332._2
281290 if (!(isNft(token0)))
282291 then throw("Token is not NFT")
283292 else [StringEntry(((kPrice + separator) + toBase58String(value(i.payments[0].assetId))), toString(price)), StringEntry(((toString(i.caller) + separator) + kSell), ((toBase58String(token0) + separator) + toString(amount0)))]
305314
306315 @Callable(i)
307316 func buyFromSlot (nftId) = {
308- let $t083628451 = $Tuple2(i.payments[0].assetId, value(i.payments[0].amount))
309- let paymentAsset = $t083628451._1
310- let paymentAmount = $t083628451._2
317+ let $t082528341 = $Tuple2(i.payments[0].assetId, value(i.payments[0].amount))
318+ let paymentAsset = $t082528341._1
319+ let paymentAmount = $t082528341._2
311320 let assetId = fromBase58String(nftId)
312- let $t084958533 = getSlot(assetId)
313- let type = $t084958533._1
314- let details = $t084958533._2
321+ let $t083858423 = getSlot(assetId)
322+ let type = $t083858423._1
323+ let details = $t083858423._2
315324 let baseRes = [ScriptTransfer(i.caller, 1, assetId), DeleteEntry(getSlotKey(type, assetId))]
316325 if ((type == kSell))
317326 then {
318- let $t086758722 = parseAsSell(details)
319- let seller = $t086758722._1
320- let priceValue = $t086758722._2
327+ let $t085658612 = parseAsSell(details)
328+ let seller = $t085658612._1
329+ let priceValue = $t085658612._2
321330 valueOrElse(isCorrectPayments(paymentAsset, paymentAmount, priceValue), {
322- let $t088078909 = resultFundsAmounts(isTrustedNft(assetId), paymentAmount, priceValue)
323- let sellerAmount = $t088078909._1
324- let buyerAmount = $t088078909._2
331+ let $t086978799 = resultFundsAmounts(isTrustedNft(assetId), paymentAmount, priceValue)
332+ let sellerAmount = $t086978799._1
333+ let buyerAmount = $t086978799._2
325334 let updatedRes = (baseRes ++ [ScriptTransfer(seller, sellerAmount, unit)])
326335 if ((buyerAmount > 0))
327336 then (updatedRes ++ [ScriptTransfer(i.caller, buyerAmount, unit)])
329338 })
330339 }
331340 else {
332- let $t091269195 = calcPriceAtCurrentMoment(assetId, height)
333- let seller = $t091269195._1
334- let actualPrice = $t091269195._2
341+ let $t090169085 = calcPriceAtCurrentMoment(assetId, height)
342+ let seller = $t090169085._1
343+ let actualPrice = $t090169085._2
335344 valueOrElse(isCorrectPayments(paymentAsset, paymentAmount, actualPrice), {
336- let $t092819384 = resultFundsAmounts(isTrustedNft(assetId), paymentAmount, actualPrice)
337- let sellerAmount = $t092819384._1
338- let buyerAmount = $t092819384._2
345+ let $t091719274 = resultFundsAmounts(isTrustedNft(assetId), paymentAmount, actualPrice)
346+ let sellerAmount = $t091719274._1
347+ let buyerAmount = $t091719274._2
339348 let updatedRes = (baseRes ++ [ScriptTransfer(seller, sellerAmount, unit)])
340349 if ((buyerAmount > 0))
341350 then (updatedRes ++ [ScriptTransfer(i.caller, buyerAmount, unit)])
349358 @Callable(i)
350359 func declineSlot (nftId) = {
351360 let assetId = fromBase58String(nftId)
352- let $t096859723 = getSlot(assetId)
353- let type = $t096859723._1
354- let details = $t096859723._2
361+ let $t095759613 = getSlot(assetId)
362+ let type = $t095759613._1
363+ let details = $t095759613._2
355364 let baseRes = [DeleteEntry(getSlotKey(type, assetId))]
356365 if ((type == kSell))
357366 then {
358- let $t098159862 = parseAsSell(details)
359- let seller = $t098159862._1
360- let priceValue = $t098159862._2
367+ let $t097059752 = parseAsSell(details)
368+ let seller = $t097059752._1
369+ let priceValue = $t097059752._2
361370 if (!(isValidCaller(i.caller, seller)))
362371 then throw("Invalid caller")
363372 else (baseRes ++ [ScriptTransfer(seller, 1, assetId)])
364373 }
365374 else {
366- let $t01000710111 = parseAsAuction(details)
367- let seller = $t01000710111._1
368- let startPriceValue = $t01000710111._2
369- let endPriceValue = $t01000710111._3
370- let startPeriodValue = $t01000710111._4
371- let endPeriodValue = $t01000710111._5
375+ let $t0989710001 = parseAsAuction(details)
376+ let seller = $t0989710001._1
377+ let startPriceValue = $t0989710001._2
378+ let endPriceValue = $t0989710001._3
379+ let startPeriodValue = $t0989710001._4
380+ let endPeriodValue = $t0989710001._5
372381 if (!(isValidCaller(i.caller, seller)))
373382 then throw("Invalid caller")
374383 else if (!(isAuctionEnded(height, endPeriodValue)))
389398 @Callable(i)
390399 func getPriceAtCurrentMoment (nftId,moment) = {
391400 let assetId = fromBase58String(nftId)
392- let $t01065210715 = calcPriceAtCurrentMoment(assetId, moment)
393- let seller = $t01065210715._1
394- let price = $t01065210715._2
401+ let $t01054210605 = calcPriceAtCurrentMoment(assetId, moment)
402+ let seller = $t01054210605._1
403+ let price = $t01054210605._2
395404 [IntegerEntry(getPriceKey(assetId), price)]
396405 }
397406
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let separator = "_"
55
66 let kAuction = "auction"
77
88 let kSell = "sell"
99
1010 let kTrusted = "trusted"
1111
1212 let kPrice = "price"
1313
1414 func getSlotKey (prefix,nftId) = ((prefix + separator) + toBase58String(nftId))
1515
1616
1717 func getPriceKey (nftId) = ((kPrice + separator) + toBase58String(nftId))
1818
1919
2020 func getSellKey (nftId) = ((kSell + separator) + toBase58String(nftId))
2121
2222
2323 func getAuctionKey (nftId) = ((kAuction + separator) + toBase58String(nftId))
2424
2525
2626 func getTrustedKey (issuer) = ((kTrusted + separator) + toString(issuer))
2727
2828
2929 func addToList (accum,nextValue) = (accum ++ [nextValue])
3030
3131
3232 func joinString (params) = {
3333 let length = size(params)
3434 if ((length == 0))
3535 then throw("Empty params")
3636 else if ((length == 1))
3737 then makeString({
3838 let $l = params
3939 let $s = size($l)
4040 let $acc0 = nil
4141 func $f0_1 ($a,$i) = if (($i >= $s))
4242 then $a
4343 else addToList($a, $l[$i])
4444
4545 func $f0_2 ($a,$i) = if (($i >= $s))
4646 then $a
4747 else throw("List size exceeds 1")
4848
4949 $f0_2($f0_1($acc0, 0), 1)
5050 }, separator)
5151 else if ((length == 2))
5252 then makeString({
5353 let $l = params
5454 let $s = size($l)
5555 let $acc0 = nil
5656 func $f0_1 ($a,$i) = if (($i >= $s))
5757 then $a
5858 else addToList($a, $l[$i])
5959
6060 func $f0_2 ($a,$i) = if (($i >= $s))
6161 then $a
6262 else throw("List size exceeds 2")
6363
6464 $f0_2($f0_1($f0_1($acc0, 0), 1), 2)
6565 }, separator)
6666 else if ((length == 3))
6767 then makeString({
6868 let $l = params
6969 let $s = size($l)
7070 let $acc0 = nil
7171 func $f0_1 ($a,$i) = if (($i >= $s))
7272 then $a
7373 else addToList($a, $l[$i])
7474
7575 func $f0_2 ($a,$i) = if (($i >= $s))
7676 then $a
7777 else throw("List size exceeds 3")
7878
7979 $f0_2($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3)
8080 }, separator)
8181 else if ((length == 4))
8282 then makeString({
8383 let $l = params
8484 let $s = size($l)
8585 let $acc0 = nil
8686 func $f0_1 ($a,$i) = if (($i >= $s))
8787 then $a
8888 else addToList($a, $l[$i])
8989
9090 func $f0_2 ($a,$i) = if (($i >= $s))
9191 then $a
9292 else throw("List size exceeds 4")
9393
9494 $f0_2($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4)
9595 }, separator)
9696 else if ((length == 5))
9797 then makeString({
9898 let $l = params
9999 let $s = size($l)
100100 let $acc0 = nil
101101 func $f0_1 ($a,$i) = if (($i >= $s))
102102 then $a
103103 else addToList($a, $l[$i])
104104
105105 func $f0_2 ($a,$i) = if (($i >= $s))
106106 then $a
107107 else throw("List size exceeds 5")
108108
109109 $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5)
110110 }, separator)
111111 else throw("Max number of parameters exceeded")
112112 }
113113
114114
115115 func parseAsAuction (details) = {
116116 let res = split(details, separator)
117117 $Tuple5(addressFromStringValue(res[0]), parseIntValue(res[1]), parseIntValue(res[2]), parseIntValue(res[3]), parseIntValue(res[4]))
118118 }
119119
120120
121121 func parseAsSell (details) = {
122122 let res = split(details, separator)
123123 $Tuple2(addressFromStringValue(res[0]), parseIntValue(res[1]))
124124 }
125125
126126
127127 func joinStruct (params) = match params {
128128 case auction: (Address, Int, String, String) =>
129129 joinString([toString(auction._1), toString(auction._2), auction._3, auction._4])
130130 case sell: (Address, Int) =>
131131 joinString([toString(sell._1), toString(sell._2)])
132132 case _ =>
133133 throw("Wrong params tupple")
134134 }
135135
136136
137137 func setAuction (seller,nftId,startPrice,start,end) = StringEntry(getAuctionKey(nftId), joinStruct($Tuple4(seller, startPrice, start, end)))
138138
139139
140140 func setSell (nftId,celler,price) = StringEntry(getSellKey(nftId), joinStruct($Tuple2(celler, price)))
141141
142142
143143 func getAuction (nftId) = value(getString(this, getAuctionKey(nftId)))
144144
145145
146146 func getSell (nftId) = value(getString(this, getSellKey(nftId)))
147147
148148
149149 func calcPriceAtCurrentMoment (assetId,moment) = {
150150 let details = getAuction(assetId)
151151 let $t027552859 = parseAsAuction(details)
152152 let seller = $t027552859._1
153153 let startPriceValue = $t027552859._2
154154 let endPriceValue = $t027552859._3
155155 let startPeriodValue = $t027552859._4
156156 let endPeriodValue = $t027552859._5
157157 if ((moment >= endPeriodValue))
158158 then $Tuple2(seller, endPriceValue)
159159 else {
160160 let deltaPrice = (startPriceValue - endPriceValue)
161161 let period = (endPeriodValue - startPeriodValue)
162162 let spended = (moment - startPeriodValue)
163163 $Tuple2(seller, (startPriceValue - fraction(spended, deltaPrice, period)))
164164 }
165165 }
166166
167167
168168 func isNft (assetId) = match assetInfo(assetId) {
169169 case token: Asset =>
170170 if (if ((token.decimals == 0))
171171 then (token.quantity == 1)
172172 else false)
173173 then (token.reissuable == false)
174174 else false
175175 case _ =>
176176 false
177177 }
178178
179179
180180 func isTrustedNft (assetId) = {
181181 let issuer = value(assetInfo(assetId)).issuer
182182 valueOrElse(getBoolean(this, getTrustedKey(issuer)), false)
183183 }
184184
185185
186186 func isSellExist (assetId) = isDefined(getString(this, getSellKey(assetId)))
187187
188188
189189 func isAuctionExist (assetId) = isDefined(getString(this, getAuctionKey(assetId)))
190190
191191
192192 func isCorrectSellPrice (price) = (price > 0)
193193
194194
195195 func isCorrectAuctionPrices (startPrice,endPrice) = (startPrice > endPrice)
196196
197197
198198 func isAdmin (caller) = (caller == this)
199199
200200
201201 func isValidCaller (caller,seller) = if ((caller == this))
202202 then true
203203 else (caller == seller)
204204
205205
206206 func isAuctionEnded (now,end) = (now > end)
207207
208208
209209 func isEnoughFunds (payment,currentMomentPrice) = (payment >= currentMomentPrice)
210210
211211
212212 func isWawes (assetId) = (assetId == unit)
213213
214214
215215 func isCorrectNft (nftId) = if (!(isNft(nftId)))
216216 then throw("Token is not Nft")
217217 else if (isSellExist(nftId))
218218 then throw("Sell already exists")
219219 else if (isAuctionExist(nftId))
220220 then throw("Auction already exists")
221221 else unit
222222
223223
224224 func isCorrectPayments (paymentAsset,paymentAmount,price) = if (!(isWawes(paymentAsset)))
225225 then throw("Payment must be at WAVES")
226226 else if (!(isEnoughFunds(paymentAmount, price)))
227227 then throw("Not enough funds")
228228 else unit
229229
230230
231231 func calcFee () = 0
232232
233233
234234 func calcTrustedFee () = 0
235235
236236
237237 func resultFundsAmounts (isTrusted,paymentAmount,actualPrice) = if (isTrusted)
238238 then $Tuple2((actualPrice - calcTrustedFee()), (paymentAmount - actualPrice))
239239 else $Tuple2((actualPrice - calcFee()), (paymentAmount - actualPrice))
240240
241241
242242 func getSlot (nftId) = if (isSellExist(nftId))
243243 then $Tuple2(kSell, getSell(nftId))
244244 else if (isAuctionExist(nftId))
245245 then $Tuple2(kAuction, getAuction(nftId))
246246 else throw("Slot doesn`t exist")
247247
248248
249249 let kBuy = "buy"
250250
251251 @Callable(i)
252-func issueNft (nft_name,nft_owner,nft_dAppAddress,nft_type,nft_tags,nft_selling_price,nft_description,nft_onSell,nft_data) = {
252+func createNFT (nft_name,nft_owner,nft_dAppAddress,nft_type,nft_tags,nft_selling_price,nft_description,nft_onSell,nft_data) = {
253253 let newToken = Issue(nft_name, nft_description, 1, 0, false)
254254 let issueId = calculateAssetId(newToken)
255255 let txId = i.transactionId
256-[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))]
256+[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)]
257+ }
258+
259+
260+
261+@Callable(i)
262+func issueNft (name,meta) = {
263+ let newToken = Issue(name, meta, 1, 0, false)
264+ let issueId = calculateAssetId(newToken)
265+[newToken, ScriptTransfer(i.caller, 1, issueId), StringEntry(((toBase58String(issueId) + separator) + "Owner"), toString(i.caller))]
257266 }
258267
259268
260269
261270 @Callable(i)
262271 func buyNFT (nftID) = {
263272 let assetId = fromBase58String(nftID)
264273 let amount = value(i.payments[0].amount)
265274 let price = valueOrErrorMessage(getString(((kPrice + separator) + nftID)), "There is no price for this NFT")
266275 let owner = valueOrErrorMessage(getStringValue(((nftID + separator) + "Owner")), "No owner")
267276 if ((i.payments[0].assetId != unit))
268277 then throw("Pay in waves")
269278 else if ((parseIntValue(price) > amount))
270279 then throw("Invalid payment")
271280 else [ScriptTransfer(i.caller, 1, assetId), ScriptTransfer(value(addressFromString(owner)), parseIntValue(price), unit), StringEntry(((toString(i.caller) + separator) + kBuy), ((nftID + separator) + toString(amount)))]
272281 }
273282
274283
275284
276285 @Callable(i)
277286 func sellNFT (price) = {
278- let $t073577442 = $Tuple2(value(i.payments[0].assetId), value(i.payments[0].amount))
279- let token0 = $t073577442._1
280- let amount0 = $t073577442._2
287+ let $t072477332 = $Tuple2(value(i.payments[0].assetId), value(i.payments[0].amount))
288+ let token0 = $t072477332._1
289+ let amount0 = $t072477332._2
281290 if (!(isNft(token0)))
282291 then throw("Token is not NFT")
283292 else [StringEntry(((kPrice + separator) + toBase58String(value(i.payments[0].assetId))), toString(price)), StringEntry(((toString(i.caller) + separator) + kSell), ((toBase58String(token0) + separator) + toString(amount0)))]
284293 }
285294
286295
287296
288297 @Callable(i)
289298 func addSell (price) = {
290299 let nftId = value(i.payments[0].assetId)
291300 valueOrElse(isCorrectNft(nftId), if (!(isCorrectSellPrice(price)))
292301 then throw("Price must be > 0")
293302 else [setSell(nftId, i.caller, price)])
294303 }
295304
296305
297306
298307 @Callable(i)
299308 func addAuction (startPrice,start,end) = {
300309 let nftId = value(i.payments[0].assetId)
301310 valueOrElse(isCorrectNft(nftId), [setAuction(i.caller, nftId, startPrice, start, end), StringEntry(((toBase58String(nftId) + separator) + "nft_owner"), toString(i.caller))])
302311 }
303312
304313
305314
306315 @Callable(i)
307316 func buyFromSlot (nftId) = {
308- let $t083628451 = $Tuple2(i.payments[0].assetId, value(i.payments[0].amount))
309- let paymentAsset = $t083628451._1
310- let paymentAmount = $t083628451._2
317+ let $t082528341 = $Tuple2(i.payments[0].assetId, value(i.payments[0].amount))
318+ let paymentAsset = $t082528341._1
319+ let paymentAmount = $t082528341._2
311320 let assetId = fromBase58String(nftId)
312- let $t084958533 = getSlot(assetId)
313- let type = $t084958533._1
314- let details = $t084958533._2
321+ let $t083858423 = getSlot(assetId)
322+ let type = $t083858423._1
323+ let details = $t083858423._2
315324 let baseRes = [ScriptTransfer(i.caller, 1, assetId), DeleteEntry(getSlotKey(type, assetId))]
316325 if ((type == kSell))
317326 then {
318- let $t086758722 = parseAsSell(details)
319- let seller = $t086758722._1
320- let priceValue = $t086758722._2
327+ let $t085658612 = parseAsSell(details)
328+ let seller = $t085658612._1
329+ let priceValue = $t085658612._2
321330 valueOrElse(isCorrectPayments(paymentAsset, paymentAmount, priceValue), {
322- let $t088078909 = resultFundsAmounts(isTrustedNft(assetId), paymentAmount, priceValue)
323- let sellerAmount = $t088078909._1
324- let buyerAmount = $t088078909._2
331+ let $t086978799 = resultFundsAmounts(isTrustedNft(assetId), paymentAmount, priceValue)
332+ let sellerAmount = $t086978799._1
333+ let buyerAmount = $t086978799._2
325334 let updatedRes = (baseRes ++ [ScriptTransfer(seller, sellerAmount, unit)])
326335 if ((buyerAmount > 0))
327336 then (updatedRes ++ [ScriptTransfer(i.caller, buyerAmount, unit)])
328337 else updatedRes
329338 })
330339 }
331340 else {
332- let $t091269195 = calcPriceAtCurrentMoment(assetId, height)
333- let seller = $t091269195._1
334- let actualPrice = $t091269195._2
341+ let $t090169085 = calcPriceAtCurrentMoment(assetId, height)
342+ let seller = $t090169085._1
343+ let actualPrice = $t090169085._2
335344 valueOrElse(isCorrectPayments(paymentAsset, paymentAmount, actualPrice), {
336- let $t092819384 = resultFundsAmounts(isTrustedNft(assetId), paymentAmount, actualPrice)
337- let sellerAmount = $t092819384._1
338- let buyerAmount = $t092819384._2
345+ let $t091719274 = resultFundsAmounts(isTrustedNft(assetId), paymentAmount, actualPrice)
346+ let sellerAmount = $t091719274._1
347+ let buyerAmount = $t091719274._2
339348 let updatedRes = (baseRes ++ [ScriptTransfer(seller, sellerAmount, unit)])
340349 if ((buyerAmount > 0))
341350 then (updatedRes ++ [ScriptTransfer(i.caller, buyerAmount, unit)])
342351 else updatedRes
343352 })
344353 }
345354 }
346355
347356
348357
349358 @Callable(i)
350359 func declineSlot (nftId) = {
351360 let assetId = fromBase58String(nftId)
352- let $t096859723 = getSlot(assetId)
353- let type = $t096859723._1
354- let details = $t096859723._2
361+ let $t095759613 = getSlot(assetId)
362+ let type = $t095759613._1
363+ let details = $t095759613._2
355364 let baseRes = [DeleteEntry(getSlotKey(type, assetId))]
356365 if ((type == kSell))
357366 then {
358- let $t098159862 = parseAsSell(details)
359- let seller = $t098159862._1
360- let priceValue = $t098159862._2
367+ let $t097059752 = parseAsSell(details)
368+ let seller = $t097059752._1
369+ let priceValue = $t097059752._2
361370 if (!(isValidCaller(i.caller, seller)))
362371 then throw("Invalid caller")
363372 else (baseRes ++ [ScriptTransfer(seller, 1, assetId)])
364373 }
365374 else {
366- let $t01000710111 = parseAsAuction(details)
367- let seller = $t01000710111._1
368- let startPriceValue = $t01000710111._2
369- let endPriceValue = $t01000710111._3
370- let startPeriodValue = $t01000710111._4
371- let endPeriodValue = $t01000710111._5
375+ let $t0989710001 = parseAsAuction(details)
376+ let seller = $t0989710001._1
377+ let startPriceValue = $t0989710001._2
378+ let endPriceValue = $t0989710001._3
379+ let startPeriodValue = $t0989710001._4
380+ let endPeriodValue = $t0989710001._5
372381 if (!(isValidCaller(i.caller, seller)))
373382 then throw("Invalid caller")
374383 else if (!(isAuctionEnded(height, endPeriodValue)))
375384 then throw("Wait for end of auction")
376385 else (baseRes ++ [ScriptTransfer(seller, 1, assetId)])
377386 }
378387 }
379388
380389
381390
382391 @Callable(i)
383392 func setTrustedIssuer (trustedAddr) = if (!(isAdmin(i.caller)))
384393 then throw("Only admin")
385394 else [BooleanEntry(getTrustedKey(addressFromStringValue(trustedAddr)), true)]
386395
387396
388397
389398 @Callable(i)
390399 func getPriceAtCurrentMoment (nftId,moment) = {
391400 let assetId = fromBase58String(nftId)
392- let $t01065210715 = calcPriceAtCurrentMoment(assetId, moment)
393- let seller = $t01065210715._1
394- let price = $t01065210715._2
401+ let $t01054210605 = calcPriceAtCurrentMoment(assetId, moment)
402+ let seller = $t01054210605._1
403+ let price = $t01054210605._2
395404 [IntegerEntry(getPriceKey(assetId), price)]
396405 }
397406
398407

github/deemru/w8io/026f985 
81.46 ms