tx · 6wZwVQ3xP2qJtrwQA8vgwnNM2xW81yR4j3aVSUPQgVLX

3N85YW6NZ9pLYvSdt1ASMQTGxvncnU1vUNx:  -0.10000000 Waves

2022.11.29 09:41 [2338050] smart account 3N85YW6NZ9pLYvSdt1ASMQTGxvncnU1vUNx > SELF 0.00000000 Waves

{ "type": 13, "id": "6wZwVQ3xP2qJtrwQA8vgwnNM2xW81yR4j3aVSUPQgVLX", "fee": 10000000, "feeAssetId": null, "timestamp": 1669704117236, "version": 2, "chainId": 84, "sender": "3N85YW6NZ9pLYvSdt1ASMQTGxvncnU1vUNx", "senderPublicKey": "EKZmHJ5bK3qKKgRdq8rAamt9qrDbVMLARzRqXoQW258v", "proofs": [ "521DA7oBRyj797TNgXJizr8FWhRdzEEhTS9MAqfDYEdEGBSrHcwMUGScT5zMnFpwqdTfX48Dij2zoUhQJb1ySjvr" ], "script": "base64:BgJACAISCwoJCAgICAgBCAgIEgQKAggIEgMKAQgSAwoBARIDCgEBEgUKAwEICBIDCgEIEgMKAQgSAwoBCBIECgIIAScACXNlcGFyYXRvcgIBXwAIa0F1Y3Rpb24CB2F1Y3Rpb24ABWtTZWxsAgRzZWxsAAhrVHJ1c3RlZAIHdHJ1c3RlZAAGa1ByaWNlAgVwcmljZQEKZ2V0U2xvdEtleQIGcHJlZml4BW5mdElkCQCsAgIJAKwCAgUGcHJlZml4BQlzZXBhcmF0b3IJANgEAQUFbmZ0SWQBC2dldFByaWNlS2V5AQVuZnRJZAkArAICCQCsAgIFBmtQcmljZQUJc2VwYXJhdG9yCQDYBAEFBW5mdElkAQpnZXRTZWxsS2V5AQVuZnRJZAkArAICCQCsAgIFBWtTZWxsBQlzZXBhcmF0b3IJANgEAQUFbmZ0SWQBDWdldEF1Y3Rpb25LZXkBBW5mdElkCQCsAgIJAKwCAgUIa0F1Y3Rpb24FCXNlcGFyYXRvcgkA2AQBBQVuZnRJZAENZ2V0VHJ1c3RlZEtleQEGaXNzdWVyCQCsAgIJAKwCAgUIa1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cgMFBnNlbGxlcgABBQdhc3NldElkBQNuaWwBaQEQc2V0VHJ1c3RlZElzc3VlcgELdHJ1c3RlZEFkZHIDCQEBIQEJAQdpc0FkbWluAQgFAWkGY2FsbGVyCQACAQIKT25seSBhZG1pbgkAzAgCCQEMQm9vbGVhbkVudHJ5AgkBDWdldFRydXN0ZWRLZXkBCQERQGV4dHJOYXRpdmUoMTA2MikBBQt0cnVzdGVkQWRkcgYFA25pbAFpARdnZXRQcmljZUF0Q3VycmVudE1vbWVudAIFbmZ0SWQGbW9tZW50BAdhc3NldElkCQDZBAEFBW5mdElkBA0kdDAxMDcwNjEwNzY5CQEYY2FsY1ByaWNlQXRDdXJyZW50TW9tZW50AgUHYXNzZXRJZAUGbW9tZW50BAZzZWxsZXIIBQ0kdDAxMDcwNjEwNzY5Al8xBAVwcmljZQgFDSR0MDEwNzA2MTA3NjkCXzIJAMwIAgkBDEludGVnZXJFbnRyeQIJAQtnZXRQcmljZUtleQEFB2Fzc2V0SWQFBXByaWNlBQNuaWwAT06XRQ==", "height": 2338050, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: CES7DBx3A2z1LWiT7nAZae1MLsstDkiPCuPiWyAXzsD5 Next: 5eVcrvHAFRFm2QWyqGCiNrTpknVMpbxjxUQjWydaFn5V Diff:
OldNewDifferences
248248
249249 let kBuy = "buy"
250250
251+let ASIMI_TOKEN = base58'EbLVSrAi6vS3AkLwBinzZCvAXP2yYiFJEzj1MBVHcwZ5'
252+
251253 @Callable(i)
252254 func createNft (nft_name,nft_owner,nft_dAppAddress,nft_type,nft_tags,nft_selling_price,nft_description,nft_onSell,nft_data) = {
253255 let newToken = Issue(nft_name, nft_description, 1, 0, false)
270272 func buyNFT (nftID) = {
271273 let assetId = fromBase58String(nftID)
272274 let amount = value(i.payments[0].amount)
275+ let amount1 = value(i.payments[1].amount)
273276 let price = valueOrErrorMessage(getString(((kPrice + separator) + nftID)), "There is no price for this NFT")
274277 let owner = valueOrErrorMessage(getStringValue(((nftID + separator) + "Owner")), "No owner")
275278 if ((i.payments[0].assetId != unit))
276279 then throw("Pay in waves")
277- else if ((parseIntValue(price) > amount))
278- then throw("Invalid payment")
279- else [ScriptTransfer(i.caller, 1, assetId), ScriptTransfer(value(addressFromString(owner)), parseIntValue(price), unit), StringEntry(((toString(i.caller) + separator) + kBuy), ((nftID + separator) + toString(amount)))]
280+ else if ((i.payments[1].assetId != ASIMI_TOKEN))
281+ then throw("Pay in ASIMI")
282+ else if ((parseIntValue(price) > amount))
283+ then throw("Invalid payment WAVES")
284+ else [ScriptTransfer(i.caller, 1, assetId), ScriptTransfer(value(addressFromString(owner)), parseIntValue(price), unit), StringEntry(((toString(i.caller) + separator) + kBuy), ((nftID + separator) + toString(amount)))]
280285 }
281286
282287
283288
284289 @Callable(i)
285290 func sellNFT (price) = {
286- let $t072147299 = $Tuple2(value(i.payments[0].assetId), value(i.payments[0].amount))
287- let token0 = $t072147299._1
288- let amount0 = $t072147299._2
291+ let $t074117496 = $Tuple2(value(i.payments[0].assetId), value(i.payments[0].amount))
292+ let token0 = $t074117496._1
293+ let amount0 = $t074117496._2
289294 if (!(isNft(token0)))
290295 then throw("Token is not NFT")
291296 else [StringEntry(((kPrice + separator) + toBase58String(value(i.payments[0].assetId))), toString(price)), StringEntry(((toString(i.caller) + separator) + kSell), ((toBase58String(token0) + separator) + toString(amount0)))]
313318
314319 @Callable(i)
315320 func buyFromSlot (nftId) = {
316- let $t082198308 = $Tuple2(i.payments[0].assetId, value(i.payments[0].amount))
317- let paymentAsset = $t082198308._1
318- let paymentAmount = $t082198308._2
321+ let $t084168505 = $Tuple2(i.payments[0].assetId, value(i.payments[0].amount))
322+ let paymentAsset = $t084168505._1
323+ let paymentAmount = $t084168505._2
319324 let assetId = fromBase58String(nftId)
320- let $t083528390 = getSlot(assetId)
321- let type = $t083528390._1
322- let details = $t083528390._2
325+ let $t085498587 = getSlot(assetId)
326+ let type = $t085498587._1
327+ let details = $t085498587._2
323328 let baseRes = [ScriptTransfer(i.caller, 1, assetId), DeleteEntry(getSlotKey(type, assetId))]
324329 if ((type == kSell))
325330 then {
326- let $t085328579 = parseAsSell(details)
327- let seller = $t085328579._1
328- let priceValue = $t085328579._2
331+ let $t087298776 = parseAsSell(details)
332+ let seller = $t087298776._1
333+ let priceValue = $t087298776._2
329334 valueOrElse(isCorrectPayments(paymentAsset, paymentAmount, priceValue), {
330- let $t086648766 = resultFundsAmounts(isTrustedNft(assetId), paymentAmount, priceValue)
331- let sellerAmount = $t086648766._1
332- let buyerAmount = $t086648766._2
335+ let $t088618963 = resultFundsAmounts(isTrustedNft(assetId), paymentAmount, priceValue)
336+ let sellerAmount = $t088618963._1
337+ let buyerAmount = $t088618963._2
333338 let updatedRes = (baseRes ++ [ScriptTransfer(seller, sellerAmount, unit)])
334339 if ((buyerAmount > 0))
335340 then (updatedRes ++ [ScriptTransfer(i.caller, buyerAmount, unit)])
337342 })
338343 }
339344 else {
340- let $t089839052 = calcPriceAtCurrentMoment(assetId, height)
341- let seller = $t089839052._1
342- let actualPrice = $t089839052._2
345+ let $t091809249 = calcPriceAtCurrentMoment(assetId, height)
346+ let seller = $t091809249._1
347+ let actualPrice = $t091809249._2
343348 valueOrElse(isCorrectPayments(paymentAsset, paymentAmount, actualPrice), {
344- let $t091389241 = resultFundsAmounts(isTrustedNft(assetId), paymentAmount, actualPrice)
345- let sellerAmount = $t091389241._1
346- let buyerAmount = $t091389241._2
349+ let $t093359438 = resultFundsAmounts(isTrustedNft(assetId), paymentAmount, actualPrice)
350+ let sellerAmount = $t093359438._1
351+ let buyerAmount = $t093359438._2
347352 let updatedRes = (baseRes ++ [ScriptTransfer(seller, sellerAmount, unit)])
348353 if ((buyerAmount > 0))
349354 then (updatedRes ++ [ScriptTransfer(i.caller, buyerAmount, unit)])
357362 @Callable(i)
358363 func declineSlot (nftId) = {
359364 let assetId = fromBase58String(nftId)
360- let $t095429580 = getSlot(assetId)
361- let type = $t095429580._1
362- let details = $t095429580._2
365+ let $t097399777 = getSlot(assetId)
366+ let type = $t097399777._1
367+ let details = $t097399777._2
363368 let baseRes = [DeleteEntry(getSlotKey(type, assetId))]
364369 if ((type == kSell))
365370 then {
366- let $t096729719 = parseAsSell(details)
367- let seller = $t096729719._1
368- let priceValue = $t096729719._2
371+ let $t098699916 = parseAsSell(details)
372+ let seller = $t098699916._1
373+ let priceValue = $t098699916._2
369374 if (!(isValidCaller(i.caller, seller)))
370375 then throw("Invalid caller")
371376 else (baseRes ++ [ScriptTransfer(seller, 1, assetId)])
372377 }
373378 else {
374- let $t098649968 = parseAsAuction(details)
375- let seller = $t098649968._1
376- let startPriceValue = $t098649968._2
377- let endPriceValue = $t098649968._3
378- let startPeriodValue = $t098649968._4
379- let endPeriodValue = $t098649968._5
379+ let $t01006110165 = parseAsAuction(details)
380+ let seller = $t01006110165._1
381+ let startPriceValue = $t01006110165._2
382+ let endPriceValue = $t01006110165._3
383+ let startPeriodValue = $t01006110165._4
384+ let endPeriodValue = $t01006110165._5
380385 if (!(isValidCaller(i.caller, seller)))
381386 then throw("Invalid caller")
382387 else if (!(isAuctionEnded(height, endPeriodValue)))
397402 @Callable(i)
398403 func getPriceAtCurrentMoment (nftId,moment) = {
399404 let assetId = fromBase58String(nftId)
400- let $t01050910572 = calcPriceAtCurrentMoment(assetId, moment)
401- let seller = $t01050910572._1
402- let price = $t01050910572._2
405+ let $t01070610769 = calcPriceAtCurrentMoment(assetId, moment)
406+ let seller = $t01070610769._1
407+ let price = $t01070610769._2
403408 [IntegerEntry(getPriceKey(assetId), price)]
404409 }
405410
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
251+let ASIMI_TOKEN = base58'EbLVSrAi6vS3AkLwBinzZCvAXP2yYiFJEzj1MBVHcwZ5'
252+
251253 @Callable(i)
252254 func createNft (nft_name,nft_owner,nft_dAppAddress,nft_type,nft_tags,nft_selling_price,nft_description,nft_onSell,nft_data) = {
253255 let newToken = Issue(nft_name, nft_description, 1, 0, false)
254256 let issueId = calculateAssetId(newToken)
255257 [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)]
256258 }
257259
258260
259261
260262 @Callable(i)
261263 func issueNft (name,meta) = {
262264 let newToken = Issue(name, meta, 1, 0, false)
263265 let issueId = calculateAssetId(newToken)
264266 [newToken, ScriptTransfer(i.caller, 1, issueId), StringEntry(((toBase58String(issueId) + separator) + "Owner"), toString(i.caller))]
265267 }
266268
267269
268270
269271 @Callable(i)
270272 func buyNFT (nftID) = {
271273 let assetId = fromBase58String(nftID)
272274 let amount = value(i.payments[0].amount)
275+ let amount1 = value(i.payments[1].amount)
273276 let price = valueOrErrorMessage(getString(((kPrice + separator) + nftID)), "There is no price for this NFT")
274277 let owner = valueOrErrorMessage(getStringValue(((nftID + separator) + "Owner")), "No owner")
275278 if ((i.payments[0].assetId != unit))
276279 then throw("Pay in waves")
277- else if ((parseIntValue(price) > amount))
278- then throw("Invalid payment")
279- else [ScriptTransfer(i.caller, 1, assetId), ScriptTransfer(value(addressFromString(owner)), parseIntValue(price), unit), StringEntry(((toString(i.caller) + separator) + kBuy), ((nftID + separator) + toString(amount)))]
280+ else if ((i.payments[1].assetId != ASIMI_TOKEN))
281+ then throw("Pay in ASIMI")
282+ else if ((parseIntValue(price) > amount))
283+ then throw("Invalid payment WAVES")
284+ else [ScriptTransfer(i.caller, 1, assetId), ScriptTransfer(value(addressFromString(owner)), parseIntValue(price), unit), StringEntry(((toString(i.caller) + separator) + kBuy), ((nftID + separator) + toString(amount)))]
280285 }
281286
282287
283288
284289 @Callable(i)
285290 func sellNFT (price) = {
286- let $t072147299 = $Tuple2(value(i.payments[0].assetId), value(i.payments[0].amount))
287- let token0 = $t072147299._1
288- let amount0 = $t072147299._2
291+ let $t074117496 = $Tuple2(value(i.payments[0].assetId), value(i.payments[0].amount))
292+ let token0 = $t074117496._1
293+ let amount0 = $t074117496._2
289294 if (!(isNft(token0)))
290295 then throw("Token is not NFT")
291296 else [StringEntry(((kPrice + separator) + toBase58String(value(i.payments[0].assetId))), toString(price)), StringEntry(((toString(i.caller) + separator) + kSell), ((toBase58String(token0) + separator) + toString(amount0)))]
292297 }
293298
294299
295300
296301 @Callable(i)
297302 func addSell (price) = {
298303 let nftId = value(i.payments[0].assetId)
299304 valueOrElse(isCorrectNft(nftId), if (!(isCorrectSellPrice(price)))
300305 then throw("Price must be > 0")
301306 else [setSell(nftId, i.caller, price)])
302307 }
303308
304309
305310
306311 @Callable(i)
307312 func addAuction (startPrice,start,end) = {
308313 let nftId = value(i.payments[0].assetId)
309314 valueOrElse(isCorrectNft(nftId), [setAuction(i.caller, nftId, startPrice, start, end), StringEntry(((toBase58String(nftId) + separator) + "nft_owner"), toString(i.caller))])
310315 }
311316
312317
313318
314319 @Callable(i)
315320 func buyFromSlot (nftId) = {
316- let $t082198308 = $Tuple2(i.payments[0].assetId, value(i.payments[0].amount))
317- let paymentAsset = $t082198308._1
318- let paymentAmount = $t082198308._2
321+ let $t084168505 = $Tuple2(i.payments[0].assetId, value(i.payments[0].amount))
322+ let paymentAsset = $t084168505._1
323+ let paymentAmount = $t084168505._2
319324 let assetId = fromBase58String(nftId)
320- let $t083528390 = getSlot(assetId)
321- let type = $t083528390._1
322- let details = $t083528390._2
325+ let $t085498587 = getSlot(assetId)
326+ let type = $t085498587._1
327+ let details = $t085498587._2
323328 let baseRes = [ScriptTransfer(i.caller, 1, assetId), DeleteEntry(getSlotKey(type, assetId))]
324329 if ((type == kSell))
325330 then {
326- let $t085328579 = parseAsSell(details)
327- let seller = $t085328579._1
328- let priceValue = $t085328579._2
331+ let $t087298776 = parseAsSell(details)
332+ let seller = $t087298776._1
333+ let priceValue = $t087298776._2
329334 valueOrElse(isCorrectPayments(paymentAsset, paymentAmount, priceValue), {
330- let $t086648766 = resultFundsAmounts(isTrustedNft(assetId), paymentAmount, priceValue)
331- let sellerAmount = $t086648766._1
332- let buyerAmount = $t086648766._2
335+ let $t088618963 = resultFundsAmounts(isTrustedNft(assetId), paymentAmount, priceValue)
336+ let sellerAmount = $t088618963._1
337+ let buyerAmount = $t088618963._2
333338 let updatedRes = (baseRes ++ [ScriptTransfer(seller, sellerAmount, unit)])
334339 if ((buyerAmount > 0))
335340 then (updatedRes ++ [ScriptTransfer(i.caller, buyerAmount, unit)])
336341 else updatedRes
337342 })
338343 }
339344 else {
340- let $t089839052 = calcPriceAtCurrentMoment(assetId, height)
341- let seller = $t089839052._1
342- let actualPrice = $t089839052._2
345+ let $t091809249 = calcPriceAtCurrentMoment(assetId, height)
346+ let seller = $t091809249._1
347+ let actualPrice = $t091809249._2
343348 valueOrElse(isCorrectPayments(paymentAsset, paymentAmount, actualPrice), {
344- let $t091389241 = resultFundsAmounts(isTrustedNft(assetId), paymentAmount, actualPrice)
345- let sellerAmount = $t091389241._1
346- let buyerAmount = $t091389241._2
349+ let $t093359438 = resultFundsAmounts(isTrustedNft(assetId), paymentAmount, actualPrice)
350+ let sellerAmount = $t093359438._1
351+ let buyerAmount = $t093359438._2
347352 let updatedRes = (baseRes ++ [ScriptTransfer(seller, sellerAmount, unit)])
348353 if ((buyerAmount > 0))
349354 then (updatedRes ++ [ScriptTransfer(i.caller, buyerAmount, unit)])
350355 else updatedRes
351356 })
352357 }
353358 }
354359
355360
356361
357362 @Callable(i)
358363 func declineSlot (nftId) = {
359364 let assetId = fromBase58String(nftId)
360- let $t095429580 = getSlot(assetId)
361- let type = $t095429580._1
362- let details = $t095429580._2
365+ let $t097399777 = getSlot(assetId)
366+ let type = $t097399777._1
367+ let details = $t097399777._2
363368 let baseRes = [DeleteEntry(getSlotKey(type, assetId))]
364369 if ((type == kSell))
365370 then {
366- let $t096729719 = parseAsSell(details)
367- let seller = $t096729719._1
368- let priceValue = $t096729719._2
371+ let $t098699916 = parseAsSell(details)
372+ let seller = $t098699916._1
373+ let priceValue = $t098699916._2
369374 if (!(isValidCaller(i.caller, seller)))
370375 then throw("Invalid caller")
371376 else (baseRes ++ [ScriptTransfer(seller, 1, assetId)])
372377 }
373378 else {
374- let $t098649968 = parseAsAuction(details)
375- let seller = $t098649968._1
376- let startPriceValue = $t098649968._2
377- let endPriceValue = $t098649968._3
378- let startPeriodValue = $t098649968._4
379- let endPeriodValue = $t098649968._5
379+ let $t01006110165 = parseAsAuction(details)
380+ let seller = $t01006110165._1
381+ let startPriceValue = $t01006110165._2
382+ let endPriceValue = $t01006110165._3
383+ let startPeriodValue = $t01006110165._4
384+ let endPeriodValue = $t01006110165._5
380385 if (!(isValidCaller(i.caller, seller)))
381386 then throw("Invalid caller")
382387 else if (!(isAuctionEnded(height, endPeriodValue)))
383388 then throw("Wait for end of auction")
384389 else (baseRes ++ [ScriptTransfer(seller, 1, assetId)])
385390 }
386391 }
387392
388393
389394
390395 @Callable(i)
391396 func setTrustedIssuer (trustedAddr) = if (!(isAdmin(i.caller)))
392397 then throw("Only admin")
393398 else [BooleanEntry(getTrustedKey(addressFromStringValue(trustedAddr)), true)]
394399
395400
396401
397402 @Callable(i)
398403 func getPriceAtCurrentMoment (nftId,moment) = {
399404 let assetId = fromBase58String(nftId)
400- let $t01050910572 = calcPriceAtCurrentMoment(assetId, moment)
401- let seller = $t01050910572._1
402- let price = $t01050910572._2
405+ let $t01070610769 = calcPriceAtCurrentMoment(assetId, moment)
406+ let seller = $t01070610769._1
407+ let price = $t01070610769._2
403408 [IntegerEntry(getPriceKey(assetId), price)]
404409 }
405410
406411

github/deemru/w8io/026f985 
63.78 ms