tx · 4Y8Z9cWR9s7QZzhiaCcLXpTb9WX3r2zFV7jvbgoqHAu6

3N85YW6NZ9pLYvSdt1ASMQTGxvncnU1vUNx:  -0.10000000 Waves

2022.11.25 14:07 [2332550] smart account 3N85YW6NZ9pLYvSdt1ASMQTGxvncnU1vUNx > SELF 0.00000000 Waves

{ "type": 13, "id": "4Y8Z9cWR9s7QZzhiaCcLXpTb9WX3r2zFV7jvbgoqHAu6", "fee": 10000000, "feeAssetId": null, "timestamp": 1669374429011, "version": 2, "chainId": 84, "sender": "3N85YW6NZ9pLYvSdt1ASMQTGxvncnU1vUNx", "senderPublicKey": "EKZmHJ5bK3qKKgRdq8rAamt9qrDbVMLARzRqXoQW258v", "proofs": [ "5SQnMW1d6ZAZAipyhMCg59vxfoYZQHEMDqB8d1rhqDdWYyAC2x8KhKBFeR6DCMJecg2PmCFuk8qWkGxpFTL4MJ32" ], "script": "base64:BgJACAISCwoJCAgICAgBCAgIEgQKAggIEgMKAQgSAwoBARIDCgEBEgUKAwEBARIDCgEIEgMKAQgSAwoBCBIECgIIAScACXNlcGFyYXRvcgIBXwAIa0F1Y3Rpb24CB2F1Y3Rpb24ABWtTZWxsAgRzZWxsAAhrVHJ1c3RlZAIHdHJ1c3RlZAAGa1ByaWNlAgVwcmljZQEKZ2V0U2xvdEtleQIGcHJlZml4BW5mdElkCQCsAgIJAKwCAgUGcHJlZml4BQlzZXBhcmF0b3IJANgEAQUFbmZ0SWQBC2dldFByaWNlS2V5AQVuZnRJZAkArAICCQCsAgIFBmtQcmljZQUJc2VwYXJhdG9yCQDYBAEFBW5mdElkAQpnZXRTZWxsS2V5AQVuZnRJZAkArAICCQCsAgIFBWtTZWxsBQlzZXBhcmF0b3IJANgEAQUFbmZ0SWQBDWdldEF1Y3Rpb25LZXkBBW5mdElkCQCsAgIJAKwCAgUIa0F1Y3Rpb24FCXNlcGFyYXRvcgkA2AQBBQVuZnRJZAENZ2V0VHJ1c3RlZEtleQEGaXNzdWVyCQCsAgIJA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0VHJhbnNmZXIDBQZzZWxsZXIAAQUHYXNzZXRJZAUDbmlsAWkBEHNldFRydXN0ZWRJc3N1ZXIBC3RydXN0ZWRBZGRyAwkBASEBCQEHaXNBZG1pbgEIBQFpBmNhbGxlcgkAAgECCk9ubHkgYWRtaW4JAMwIAgkBDEJvb2xlYW5FbnRyeQIJAQ1nZXRUcnVzdGVkS2V5AQkBEUBleHRyTmF0aXZlKDEwNjIpAQULdHJ1c3RlZEFkZHIGBQNuaWwBaQEXZ2V0UHJpY2VBdEN1cnJlbnRNb21lbnQCBW5mdElkBm1vbWVudAQHYXNzZXRJZAkA2QQBBQVuZnRJZAQNJHQwMTA3MDUxMDc2OAkBGGNhbGNQcmljZUF0Q3VycmVudE1vbWVudAIFB2Fzc2V0SWQFBm1vbWVudAQGc2VsbGVyCAUNJHQwMTA3MDUxMDc2OAJfMQQFcHJpY2UIBQ0kdDAxMDcwNTEwNzY4Al8yCQDMCAIJAQxJbnRlZ2VyRW50cnkCCQELZ2V0UHJpY2VLZXkBBQdhc3NldElkBQVwcmljZQUDbmlsAP4CYgQ=", "height": 2332550, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: E9ev8VUisQ1ZrXJzscSL3RuN2uYxYKQXNvC6h8ejX6F3 Next: GAVjSyw788D5FD3fn21cAdgK7oG8eLzEHkbqjJFBnxBE Diff:
OldNewDifferences
192192 func isCorrectSellPrice (price) = (price > 0)
193193
194194
195-func isCorrectAuctionPeriod (start,end) = (end > start)
196-
197-
198195 func isCorrectAuctionPrices (startPrice,endPrice) = (startPrice > endPrice)
199196
200197
291288
292289 @Callable(i)
293290 func sellNFT (price) = {
294- let $t074797564 = $Tuple2(value(i.payments[0].assetId), value(i.payments[0].amount))
295- let token0 = $t074797564._1
296- let amount0 = $t074797564._2
291+ let $t074157500 = $Tuple2(value(i.payments[0].assetId), value(i.payments[0].amount))
292+ let token0 = $t074157500._1
293+ let amount0 = $t074157500._2
297294 if (!(isNft(token0)))
298295 then throw("Token is not NFT")
299296 else [StringEntry(((kPrice + separator) + toBase58String(value(i.payments[0].assetId))), toString(price)), StringEntry(((toString(i.caller) + separator) + kSell), ((toBase58String(token0) + separator) + toString(amount0)))]
314311 @Callable(i)
315312 func addAuction (startPrice,start,end) = {
316313 let nftId = value(i.payments[0].assetId)
317- valueOrElse(isCorrectNft(nftId), if (!(isCorrectAuctionPeriod(start, end)))
318- then throw("Period is not correct")
319- else [setAuction(i.caller, nftId, startPrice, start, end), StringEntry(((toBase58String(nftId) + separator) + "nft_owner"), toString(i.caller))])
314+ valueOrElse(isCorrectNft(nftId), [setAuction(i.caller, nftId, startPrice, start, end), StringEntry(((toBase58String(nftId) + separator) + "nft_owner"), toString(i.caller))])
320315 }
321316
322317
323318
324319 @Callable(i)
325320 func buyFromSlot (nftId) = {
326- let $t085648653 = $Tuple2(i.payments[0].assetId, value(i.payments[0].amount))
327- let paymentAsset = $t085648653._1
328- let paymentAmount = $t085648653._2
321+ let $t084158504 = $Tuple2(i.payments[0].assetId, value(i.payments[0].amount))
322+ let paymentAsset = $t084158504._1
323+ let paymentAmount = $t084158504._2
329324 let assetId = fromBase58String(nftId)
330- let $t086978735 = getSlot(assetId)
331- let type = $t086978735._1
332- let details = $t086978735._2
325+ let $t085488586 = getSlot(assetId)
326+ let type = $t085488586._1
327+ let details = $t085488586._2
333328 let baseRes = [ScriptTransfer(i.caller, 1, assetId), DeleteEntry(getSlotKey(type, assetId))]
334329 if ((type == kSell))
335330 then {
336- let $t088778924 = parseAsSell(details)
337- let seller = $t088778924._1
338- let priceValue = $t088778924._2
331+ let $t087288775 = parseAsSell(details)
332+ let seller = $t087288775._1
333+ let priceValue = $t087288775._2
339334 valueOrElse(isCorrectPayments(paymentAsset, paymentAmount, priceValue), {
340- let $t090099111 = resultFundsAmounts(isTrustedNft(assetId), paymentAmount, priceValue)
341- let sellerAmount = $t090099111._1
342- let buyerAmount = $t090099111._2
335+ let $t088608962 = resultFundsAmounts(isTrustedNft(assetId), paymentAmount, priceValue)
336+ let sellerAmount = $t088608962._1
337+ let buyerAmount = $t088608962._2
343338 let updatedRes = (baseRes ++ [ScriptTransfer(seller, sellerAmount, unit)])
344339 if ((buyerAmount > 0))
345340 then (updatedRes ++ [ScriptTransfer(i.caller, buyerAmount, unit)])
347342 })
348343 }
349344 else {
350- let $t093289397 = calcPriceAtCurrentMoment(assetId, height)
351- let seller = $t093289397._1
352- let actualPrice = $t093289397._2
345+ let $t091799248 = calcPriceAtCurrentMoment(assetId, height)
346+ let seller = $t091799248._1
347+ let actualPrice = $t091799248._2
353348 valueOrElse(isCorrectPayments(paymentAsset, paymentAmount, actualPrice), {
354- let $t094839586 = resultFundsAmounts(isTrustedNft(assetId), paymentAmount, actualPrice)
355- let sellerAmount = $t094839586._1
356- let buyerAmount = $t094839586._2
349+ let $t093349437 = resultFundsAmounts(isTrustedNft(assetId), paymentAmount, actualPrice)
350+ let sellerAmount = $t093349437._1
351+ let buyerAmount = $t093349437._2
357352 let updatedRes = (baseRes ++ [ScriptTransfer(seller, sellerAmount, unit)])
358353 if ((buyerAmount > 0))
359354 then (updatedRes ++ [ScriptTransfer(i.caller, buyerAmount, unit)])
367362 @Callable(i)
368363 func declineSlot (nftId) = {
369364 let assetId = fromBase58String(nftId)
370- let $t098879925 = getSlot(assetId)
371- let type = $t098879925._1
372- let details = $t098879925._2
365+ let $t097389776 = getSlot(assetId)
366+ let type = $t097389776._1
367+ let details = $t097389776._2
373368 let baseRes = [DeleteEntry(getSlotKey(type, assetId))]
374369 if ((type == kSell))
375370 then {
376- let $t01001710064 = parseAsSell(details)
377- let seller = $t01001710064._1
378- let priceValue = $t01001710064._2
371+ let $t098689915 = parseAsSell(details)
372+ let seller = $t098689915._1
373+ let priceValue = $t098689915._2
379374 if (!(isValidCaller(i.caller, seller)))
380375 then throw("Invalid caller")
381376 else (baseRes ++ [ScriptTransfer(seller, 1, assetId)])
382377 }
383378 else {
384- let $t01020910313 = parseAsAuction(details)
385- let seller = $t01020910313._1
386- let startPriceValue = $t01020910313._2
387- let endPriceValue = $t01020910313._3
388- let startPeriodValue = $t01020910313._4
389- let endPeriodValue = $t01020910313._5
379+ let $t01006010164 = parseAsAuction(details)
380+ let seller = $t01006010164._1
381+ let startPriceValue = $t01006010164._2
382+ let endPriceValue = $t01006010164._3
383+ let startPeriodValue = $t01006010164._4
384+ let endPeriodValue = $t01006010164._5
390385 if (!(isValidCaller(i.caller, seller)))
391386 then throw("Invalid caller")
392387 else if (!(isAuctionEnded(height, endPeriodValue)))
407402 @Callable(i)
408403 func getPriceAtCurrentMoment (nftId,moment) = {
409404 let assetId = fromBase58String(nftId)
410- let $t01085410917 = calcPriceAtCurrentMoment(assetId, moment)
411- let seller = $t01085410917._1
412- let price = $t01085410917._2
405+ let $t01070510768 = calcPriceAtCurrentMoment(assetId, moment)
406+ let seller = $t01070510768._1
407+ let price = $t01070510768._2
413408 [IntegerEntry(getPriceKey(assetId), price)]
414409 }
415410
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, Int, Int) =>
129129 joinString([toString(auction._1), toString(auction._2), toString(auction._3), toString(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 $t027592863 = parseAsAuction(details)
152152 let seller = $t027592863._1
153153 let startPriceValue = $t027592863._2
154154 let endPriceValue = $t027592863._3
155155 let startPeriodValue = $t027592863._4
156156 let endPeriodValue = $t027592863._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
195-func isCorrectAuctionPeriod (start,end) = (end > start)
196-
197-
198195 func isCorrectAuctionPrices (startPrice,endPrice) = (startPrice > endPrice)
199196
200197
201198 func isAdmin (caller) = (caller == this)
202199
203200
204201 func isValidCaller (caller,seller) = if ((caller == this))
205202 then true
206203 else (caller == seller)
207204
208205
209206 func isAuctionEnded (now,end) = (now > end)
210207
211208
212209 func isEnoughFunds (payment,currentMomentPrice) = (payment >= currentMomentPrice)
213210
214211
215212 func isWawes (assetId) = (assetId == unit)
216213
217214
218215 func isCorrectNft (nftId) = if (!(isNft(nftId)))
219216 then throw("Token is not Nft")
220217 else if (isSellExist(nftId))
221218 then throw("Sell already exists")
222219 else if (isAuctionExist(nftId))
223220 then throw("Auction already exists")
224221 else unit
225222
226223
227224 func isCorrectPayments (paymentAsset,paymentAmount,price) = if (!(isWawes(paymentAsset)))
228225 then throw("Payment must be at WAVES")
229226 else if (!(isEnoughFunds(paymentAmount, price)))
230227 then throw("Not enough funds")
231228 else unit
232229
233230
234231 func calcFee () = 0
235232
236233
237234 func calcTrustedFee () = 0
238235
239236
240237 func resultFundsAmounts (isTrusted,paymentAmount,actualPrice) = if (isTrusted)
241238 then $Tuple2((actualPrice - calcTrustedFee()), (paymentAmount - actualPrice))
242239 else $Tuple2((actualPrice - calcFee()), (paymentAmount - actualPrice))
243240
244241
245242 func getSlot (nftId) = if (isSellExist(nftId))
246243 then $Tuple2(kSell, getSell(nftId))
247244 else if (isAuctionExist(nftId))
248245 then $Tuple2(kAuction, getAuction(nftId))
249246 else throw("Slot doesn`t exist")
250247
251248
252249 let kBuy = "buy"
253250
254251 let ASIMI_TOKEN = base58'EbLVSrAi6vS3AkLwBinzZCvAXP2yYiFJEzj1MBVHcwZ5'
255252
256253 @Callable(i)
257254 func createNft (nft_name,nft_owner,nft_dAppAddress,nft_type,nft_tags,nft_selling_price,nft_description,nft_onSell,nft_data) = {
258255 let newToken = Issue(nft_name, nft_description, 1, 0, false)
259256 let issueId = calculateAssetId(newToken)
260257 [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)]
261258 }
262259
263260
264261
265262 @Callable(i)
266263 func issueNft (name,meta) = {
267264 let newToken = Issue(name, meta, 1, 0, false)
268265 let issueId = calculateAssetId(newToken)
269266 [newToken, ScriptTransfer(i.caller, 1, issueId), StringEntry(((toBase58String(issueId) + separator) + "Owner"), toString(i.caller))]
270267 }
271268
272269
273270
274271 @Callable(i)
275272 func buyNFT (nftID) = {
276273 let assetId = fromBase58String(nftID)
277274 let amount = value(i.payments[0].amount)
278275 let amount1 = value(i.payments[1].amount)
279276 let price = valueOrErrorMessage(getString(((kPrice + separator) + nftID)), "There is no price for this NFT")
280277 let owner = valueOrErrorMessage(getStringValue(((nftID + separator) + "Owner")), "No owner")
281278 if ((i.payments[0].assetId != unit))
282279 then throw("Pay in waves")
283280 else if ((i.payments[1].assetId != ASIMI_TOKEN))
284281 then throw("Pay in ASIMI")
285282 else if ((parseIntValue(price) > amount))
286283 then throw("Invalid payment WAVES")
287284 else [ScriptTransfer(i.caller, 1, assetId), ScriptTransfer(value(addressFromString(owner)), parseIntValue(price), unit), StringEntry(((toString(i.caller) + separator) + kBuy), ((nftID + separator) + toString(amount)))]
288285 }
289286
290287
291288
292289 @Callable(i)
293290 func sellNFT (price) = {
294- let $t074797564 = $Tuple2(value(i.payments[0].assetId), value(i.payments[0].amount))
295- let token0 = $t074797564._1
296- let amount0 = $t074797564._2
291+ let $t074157500 = $Tuple2(value(i.payments[0].assetId), value(i.payments[0].amount))
292+ let token0 = $t074157500._1
293+ let amount0 = $t074157500._2
297294 if (!(isNft(token0)))
298295 then throw("Token is not NFT")
299296 else [StringEntry(((kPrice + separator) + toBase58String(value(i.payments[0].assetId))), toString(price)), StringEntry(((toString(i.caller) + separator) + kSell), ((toBase58String(token0) + separator) + toString(amount0)))]
300297 }
301298
302299
303300
304301 @Callable(i)
305302 func addSell (price) = {
306303 let nftId = value(i.payments[0].assetId)
307304 valueOrElse(isCorrectNft(nftId), if (!(isCorrectSellPrice(price)))
308305 then throw("Price must be > 0")
309306 else [setSell(nftId, i.caller, price)])
310307 }
311308
312309
313310
314311 @Callable(i)
315312 func addAuction (startPrice,start,end) = {
316313 let nftId = value(i.payments[0].assetId)
317- valueOrElse(isCorrectNft(nftId), if (!(isCorrectAuctionPeriod(start, end)))
318- then throw("Period is not correct")
319- else [setAuction(i.caller, nftId, startPrice, start, end), StringEntry(((toBase58String(nftId) + separator) + "nft_owner"), toString(i.caller))])
314+ valueOrElse(isCorrectNft(nftId), [setAuction(i.caller, nftId, startPrice, start, end), StringEntry(((toBase58String(nftId) + separator) + "nft_owner"), toString(i.caller))])
320315 }
321316
322317
323318
324319 @Callable(i)
325320 func buyFromSlot (nftId) = {
326- let $t085648653 = $Tuple2(i.payments[0].assetId, value(i.payments[0].amount))
327- let paymentAsset = $t085648653._1
328- let paymentAmount = $t085648653._2
321+ let $t084158504 = $Tuple2(i.payments[0].assetId, value(i.payments[0].amount))
322+ let paymentAsset = $t084158504._1
323+ let paymentAmount = $t084158504._2
329324 let assetId = fromBase58String(nftId)
330- let $t086978735 = getSlot(assetId)
331- let type = $t086978735._1
332- let details = $t086978735._2
325+ let $t085488586 = getSlot(assetId)
326+ let type = $t085488586._1
327+ let details = $t085488586._2
333328 let baseRes = [ScriptTransfer(i.caller, 1, assetId), DeleteEntry(getSlotKey(type, assetId))]
334329 if ((type == kSell))
335330 then {
336- let $t088778924 = parseAsSell(details)
337- let seller = $t088778924._1
338- let priceValue = $t088778924._2
331+ let $t087288775 = parseAsSell(details)
332+ let seller = $t087288775._1
333+ let priceValue = $t087288775._2
339334 valueOrElse(isCorrectPayments(paymentAsset, paymentAmount, priceValue), {
340- let $t090099111 = resultFundsAmounts(isTrustedNft(assetId), paymentAmount, priceValue)
341- let sellerAmount = $t090099111._1
342- let buyerAmount = $t090099111._2
335+ let $t088608962 = resultFundsAmounts(isTrustedNft(assetId), paymentAmount, priceValue)
336+ let sellerAmount = $t088608962._1
337+ let buyerAmount = $t088608962._2
343338 let updatedRes = (baseRes ++ [ScriptTransfer(seller, sellerAmount, unit)])
344339 if ((buyerAmount > 0))
345340 then (updatedRes ++ [ScriptTransfer(i.caller, buyerAmount, unit)])
346341 else updatedRes
347342 })
348343 }
349344 else {
350- let $t093289397 = calcPriceAtCurrentMoment(assetId, height)
351- let seller = $t093289397._1
352- let actualPrice = $t093289397._2
345+ let $t091799248 = calcPriceAtCurrentMoment(assetId, height)
346+ let seller = $t091799248._1
347+ let actualPrice = $t091799248._2
353348 valueOrElse(isCorrectPayments(paymentAsset, paymentAmount, actualPrice), {
354- let $t094839586 = resultFundsAmounts(isTrustedNft(assetId), paymentAmount, actualPrice)
355- let sellerAmount = $t094839586._1
356- let buyerAmount = $t094839586._2
349+ let $t093349437 = resultFundsAmounts(isTrustedNft(assetId), paymentAmount, actualPrice)
350+ let sellerAmount = $t093349437._1
351+ let buyerAmount = $t093349437._2
357352 let updatedRes = (baseRes ++ [ScriptTransfer(seller, sellerAmount, unit)])
358353 if ((buyerAmount > 0))
359354 then (updatedRes ++ [ScriptTransfer(i.caller, buyerAmount, unit)])
360355 else updatedRes
361356 })
362357 }
363358 }
364359
365360
366361
367362 @Callable(i)
368363 func declineSlot (nftId) = {
369364 let assetId = fromBase58String(nftId)
370- let $t098879925 = getSlot(assetId)
371- let type = $t098879925._1
372- let details = $t098879925._2
365+ let $t097389776 = getSlot(assetId)
366+ let type = $t097389776._1
367+ let details = $t097389776._2
373368 let baseRes = [DeleteEntry(getSlotKey(type, assetId))]
374369 if ((type == kSell))
375370 then {
376- let $t01001710064 = parseAsSell(details)
377- let seller = $t01001710064._1
378- let priceValue = $t01001710064._2
371+ let $t098689915 = parseAsSell(details)
372+ let seller = $t098689915._1
373+ let priceValue = $t098689915._2
379374 if (!(isValidCaller(i.caller, seller)))
380375 then throw("Invalid caller")
381376 else (baseRes ++ [ScriptTransfer(seller, 1, assetId)])
382377 }
383378 else {
384- let $t01020910313 = parseAsAuction(details)
385- let seller = $t01020910313._1
386- let startPriceValue = $t01020910313._2
387- let endPriceValue = $t01020910313._3
388- let startPeriodValue = $t01020910313._4
389- let endPeriodValue = $t01020910313._5
379+ let $t01006010164 = parseAsAuction(details)
380+ let seller = $t01006010164._1
381+ let startPriceValue = $t01006010164._2
382+ let endPriceValue = $t01006010164._3
383+ let startPeriodValue = $t01006010164._4
384+ let endPeriodValue = $t01006010164._5
390385 if (!(isValidCaller(i.caller, seller)))
391386 then throw("Invalid caller")
392387 else if (!(isAuctionEnded(height, endPeriodValue)))
393388 then throw("Wait for end of auction")
394389 else (baseRes ++ [ScriptTransfer(seller, 1, assetId)])
395390 }
396391 }
397392
398393
399394
400395 @Callable(i)
401396 func setTrustedIssuer (trustedAddr) = if (!(isAdmin(i.caller)))
402397 then throw("Only admin")
403398 else [BooleanEntry(getTrustedKey(addressFromStringValue(trustedAddr)), true)]
404399
405400
406401
407402 @Callable(i)
408403 func getPriceAtCurrentMoment (nftId,moment) = {
409404 let assetId = fromBase58String(nftId)
410- let $t01085410917 = calcPriceAtCurrentMoment(assetId, moment)
411- let seller = $t01085410917._1
412- let price = $t01085410917._2
405+ let $t01070510768 = calcPriceAtCurrentMoment(assetId, moment)
406+ let seller = $t01070510768._1
407+ let price = $t01070510768._2
413408 [IntegerEntry(getPriceKey(assetId), price)]
414409 }
415410
416411

github/deemru/w8io/026f985 
59.89 ms