tx · 6NFHo1FoknEyz8bWCHrvuVb2SCuwz8KqtkZiT738Vrex

3MvjAaDYHpS4A5K4CV3kZMMEH9m9JdBSvbq:  -0.50000000 Waves

2022.11.30 16:58 [2339927] smart account 3MvjAaDYHpS4A5K4CV3kZMMEH9m9JdBSvbq > SELF 0.00000000 Waves

{ "type": 13, "id": "6NFHo1FoknEyz8bWCHrvuVb2SCuwz8KqtkZiT738Vrex", "fee": 50000000, "feeAssetId": null, "timestamp": 1669816689340, "version": 2, "chainId": 84, "sender": "3MvjAaDYHpS4A5K4CV3kZMMEH9m9JdBSvbq", "senderPublicKey": "H6UqxUDcJamDRg1uykVcWMn4zhAMTV7i1nfPq1moLWmJ", "proofs": [ "281j243UeHFhtt6uQm4cG77bov2Th2QrcgYrz1sNtmWxWZzMWNbffz7EYPu9NtAWi6a7JV1Y7TcRehnho7Wo1Hpg" ], "script": "base64:BgJQCAISBgoECAgBARIAEgQKAggIEgsKCQgICAgIAQgICBIECgIICBIDCgEIEgMKAQESAwoBARIFCgMBCAgSAwoBCBIDCgEIEgMKAQgSBAoCCAEnAAlzZXBhcmF0b3ICAV8ACGtBdWN0aW9uAgdhdWN0aW9uAAVrU2VsbAIEc2VsbAAIa1RydXN0ZWQCB3RydXN0ZWQABmtQcmljZQIFcHJpY2UBCmdldFNsb3RLZXkCBnByZWZpeAVuZnRJZAkArAICCQCsAgIFBnByZWZpeAUJc2VwYXJhdG9yCQDYBAEFBW5mdElkAQtnZXRQcmljZUtleQEFbmZ0SWQJAKwCAgkArAICBQZrUHJpY2UFCXNlcGFyYXRvcgkA2AQBBQVuZnRJZAEKZ2V0U2VsbEtleQEFbmZ0SWQJAKwCAgkArAICBQVrU2VsbAUJc2VwYXJhdG9yCQDYBAEFBW5mdElkAQ1nZXRBdWN0aW9uS2V5AQVuZnRJZAkArAICCQCsAgIFCGtBdWN0aW9uBQlzZXBhcmF0b3IJANgEAQUFbmZ0SWQBDWdldFRydXN0ZWRLZXkBBmlzc3VlcgkArAICC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0VHJhbnNmZXIDBQZzZWxsZXIAAQUHYXNzZXRJZAUDbmlsAWkBEHNldFRydXN0ZWRJc3N1ZXIBC3RydXN0ZWRBZGRyAwkBASEBCQEHaXNBZG1pbgEIBQFpBmNhbGxlcgkAAgECCk9ubHkgYWRtaW4JAMwIAgkBDEJvb2xlYW5FbnRyeQIJAQ1nZXRUcnVzdGVkS2V5AQkBEUBleHRyTmF0aXZlKDEwNjIpAQULdHJ1c3RlZEFkZHIGBQNuaWwBaQEXZ2V0UHJpY2VBdEN1cnJlbnRNb21lbnQCBW5mdElkBm1vbWVudAQHYXNzZXRJZAkA2QQBBQVuZnRJZAQNJHQwMTE2NDIxMTcwNQkBGGNhbGNQcmljZUF0Q3VycmVudE1vbWVudAIFB2Fzc2V0SWQFBm1vbWVudAQGc2VsbGVyCAUNJHQwMTE2NDIxMTcwNQJfMQQFcHJpY2UIBQ0kdDAxMTY0MjExNzA1Al8yCQDMCAIJAQxJbnRlZ2VyRW50cnkCCQELZ2V0UHJpY2VLZXkBBQdhc3NldElkBQVwcmljZQUDbmlsAI/UFbk=", "height": 2339927, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: FznHkJJJPAsNpsEpLwq1Cx43EpDcFNZ7BF9HupjBjkfN Next: 3nTSVJXmLtPzb3pUTUYNqsSUq9oNkSxXjVEzfo2ACLmh Diff:
OldNewDifferences
280280 func createNft (nft_name,nft_owner,nft_dAppAddress,nft_type,nft_tags,nft_selling_price,nft_description,nft_onSell,nft_data) = {
281281 let newToken = Issue(nft_name, nft_description, 1, 0, false)
282282 let issueId = calculateAssetId(newToken)
283-[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)]
283+ let txId = i.transactionId
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))]
284285 }
285286
286287
311312
312313 @Callable(i)
313314 func sellNFT (price) = {
314- let $t082248309 = $Tuple2(value(i.payments[0].assetId), value(i.payments[0].amount))
315- let token0 = $t082248309._1
316- let amount0 = $t082248309._2
315+ let $t083478432 = $Tuple2(value(i.payments[0].assetId), value(i.payments[0].amount))
316+ let token0 = $t083478432._1
317+ let amount0 = $t083478432._2
317318 if (!(isNft(token0)))
318319 then throw("Token is not NFT")
319320 else [StringEntry(((kPrice + separator) + toBase58String(value(i.payments[0].assetId))), toString(price)), StringEntry(((toString(i.caller) + separator) + kSell), ((toBase58String(token0) + separator) + toString(amount0)))]
341342
342343 @Callable(i)
343344 func buyFromSlot (nftId) = {
344- let $t092299318 = $Tuple2(i.payments[0].assetId, value(i.payments[0].amount))
345- let paymentAsset = $t092299318._1
346- let paymentAmount = $t092299318._2
345+ let $t093529441 = $Tuple2(i.payments[0].assetId, value(i.payments[0].amount))
346+ let paymentAsset = $t093529441._1
347+ let paymentAmount = $t093529441._2
347348 let assetId = fromBase58String(nftId)
348- let $t093629400 = getSlot(assetId)
349- let type = $t093629400._1
350- let details = $t093629400._2
349+ let $t094859523 = getSlot(assetId)
350+ let type = $t094859523._1
351+ let details = $t094859523._2
351352 let baseRes = [ScriptTransfer(i.caller, 1, assetId), DeleteEntry(getSlotKey(type, assetId))]
352353 if ((type == kSell))
353354 then {
354- let $t095429589 = parseAsSell(details)
355- let seller = $t095429589._1
356- let priceValue = $t095429589._2
355+ let $t096659712 = parseAsSell(details)
356+ let seller = $t096659712._1
357+ let priceValue = $t096659712._2
357358 valueOrElse(isCorrectPayments(paymentAsset, paymentAmount, priceValue), {
358- let $t096749776 = resultFundsAmounts(isTrustedNft(assetId), paymentAmount, priceValue)
359- let sellerAmount = $t096749776._1
360- let buyerAmount = $t096749776._2
359+ let $t097979899 = resultFundsAmounts(isTrustedNft(assetId), paymentAmount, priceValue)
360+ let sellerAmount = $t097979899._1
361+ let buyerAmount = $t097979899._2
361362 let updatedRes = (baseRes ++ [ScriptTransfer(seller, sellerAmount, unit)])
362363 if ((buyerAmount > 0))
363364 then (updatedRes ++ [ScriptTransfer(i.caller, buyerAmount, unit)])
365366 })
366367 }
367368 else {
368- let $t0999310062 = calcPriceAtCurrentMoment(assetId, height)
369- let seller = $t0999310062._1
370- let actualPrice = $t0999310062._2
369+ let $t01011610185 = calcPriceAtCurrentMoment(assetId, height)
370+ let seller = $t01011610185._1
371+ let actualPrice = $t01011610185._2
371372 valueOrElse(isCorrectPayments(paymentAsset, paymentAmount, actualPrice), {
372- let $t01014810251 = resultFundsAmounts(isTrustedNft(assetId), paymentAmount, actualPrice)
373- let sellerAmount = $t01014810251._1
374- let buyerAmount = $t01014810251._2
373+ let $t01027110374 = resultFundsAmounts(isTrustedNft(assetId), paymentAmount, actualPrice)
374+ let sellerAmount = $t01027110374._1
375+ let buyerAmount = $t01027110374._2
375376 let updatedRes = (baseRes ++ [ScriptTransfer(seller, sellerAmount, unit)])
376377 if ((buyerAmount > 0))
377378 then (updatedRes ++ [ScriptTransfer(i.caller, buyerAmount, unit)])
385386 @Callable(i)
386387 func declineSlot (nftId) = {
387388 let assetId = fromBase58String(nftId)
388- let $t01055210590 = getSlot(assetId)
389- let type = $t01055210590._1
390- let details = $t01055210590._2
389+ let $t01067510713 = getSlot(assetId)
390+ let type = $t01067510713._1
391+ let details = $t01067510713._2
391392 let baseRes = [DeleteEntry(getSlotKey(type, assetId))]
392393 if ((type == kSell))
393394 then {
394- let $t01068210729 = parseAsSell(details)
395- let seller = $t01068210729._1
396- let priceValue = $t01068210729._2
395+ let $t01080510852 = parseAsSell(details)
396+ let seller = $t01080510852._1
397+ let priceValue = $t01080510852._2
397398 if (!(isValidCaller(i.caller, seller)))
398399 then throw("Invalid caller")
399400 else (baseRes ++ [ScriptTransfer(seller, 1, assetId)])
400401 }
401402 else {
402- let $t01087410978 = parseAsAuction(details)
403- let seller = $t01087410978._1
404- let startPriceValue = $t01087410978._2
405- let endPriceValue = $t01087410978._3
406- let startPeriodValue = $t01087410978._4
407- let endPeriodValue = $t01087410978._5
403+ let $t01099711101 = parseAsAuction(details)
404+ let seller = $t01099711101._1
405+ let startPriceValue = $t01099711101._2
406+ let endPriceValue = $t01099711101._3
407+ let startPeriodValue = $t01099711101._4
408+ let endPeriodValue = $t01099711101._5
408409 if (!(isValidCaller(i.caller, seller)))
409410 then throw("Invalid caller")
410411 else if (!(isAuctionEnded(height, endPeriodValue)))
425426 @Callable(i)
426427 func getPriceAtCurrentMoment (nftId,moment) = {
427428 let assetId = fromBase58String(nftId)
428- let $t01151911582 = calcPriceAtCurrentMoment(assetId, moment)
429- let seller = $t01151911582._1
430- let price = $t01151911582._2
429+ let $t01164211705 = calcPriceAtCurrentMoment(assetId, moment)
430+ let seller = $t01164211705._1
431+ let price = $t01164211705._2
431432 [IntegerEntry(getPriceKey(assetId), price)]
432433 }
433434
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 let kBid = "bid"
252252
253253 @Callable(i)
254254 func placeBid (nftId,nft_owner,min_price,bid_price) = {
255255 let assetId = fromBase58String(nftId)
256256 let amount = value(i.payments[0].amount)
257257 if ((i.payments[0].assetId != unit))
258258 then throw("Pay in waves")
259259 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)]
260260 }
261261
262262
263263
264264 @Callable(i)
265265 func pay () = {
266266 let amount = value(i.payments[0].amount)
267267 if ((i.payments[0].assetId != unit))
268268 then throw("Pay in waves")
269269 else nil
270270 }
271271
272272
273273
274274 @Callable(i)
275275 func confirmBid (nftId,userAddress) = [StringEntry("bid_winner", userAddress)]
276276
277277
278278
279279 @Callable(i)
280280 func createNft (nft_name,nft_owner,nft_dAppAddress,nft_type,nft_tags,nft_selling_price,nft_description,nft_onSell,nft_data) = {
281281 let newToken = Issue(nft_name, nft_description, 1, 0, false)
282282 let issueId = calculateAssetId(newToken)
283-[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)]
283+ let txId = i.transactionId
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))]
284285 }
285286
286287
287288
288289 @Callable(i)
289290 func issueNft (name,meta) = {
290291 let newToken = Issue(name, meta, 1, 0, false)
291292 let issueId = calculateAssetId(newToken)
292293 [newToken, ScriptTransfer(i.caller, 1, issueId), StringEntry(((toBase58String(issueId) + separator) + "Owner"), toString(i.caller))]
293294 }
294295
295296
296297
297298 @Callable(i)
298299 func buyNFT (nftID) = {
299300 let assetId = fromBase58String(nftID)
300301 let amount = value(i.payments[0].amount)
301302 let price = valueOrErrorMessage(getString(((kPrice + separator) + nftID)), "There is no price for this NFT")
302303 let owner = valueOrErrorMessage(getStringValue(((nftID + separator) + "Owner")), "No owner")
303304 if ((i.payments[0].assetId != unit))
304305 then throw("Pay in waves")
305306 else if ((parseIntValue(price) > amount))
306307 then throw("Invalid payment")
307308 else [ScriptTransfer(i.caller, 1, assetId), ScriptTransfer(value(addressFromString(owner)), parseIntValue(price), unit), StringEntry(((toString(i.caller) + separator) + kBuy), ((nftID + separator) + toString(amount)))]
308309 }
309310
310311
311312
312313 @Callable(i)
313314 func sellNFT (price) = {
314- let $t082248309 = $Tuple2(value(i.payments[0].assetId), value(i.payments[0].amount))
315- let token0 = $t082248309._1
316- let amount0 = $t082248309._2
315+ let $t083478432 = $Tuple2(value(i.payments[0].assetId), value(i.payments[0].amount))
316+ let token0 = $t083478432._1
317+ let amount0 = $t083478432._2
317318 if (!(isNft(token0)))
318319 then throw("Token is not NFT")
319320 else [StringEntry(((kPrice + separator) + toBase58String(value(i.payments[0].assetId))), toString(price)), StringEntry(((toString(i.caller) + separator) + kSell), ((toBase58String(token0) + separator) + toString(amount0)))]
320321 }
321322
322323
323324
324325 @Callable(i)
325326 func addSell (price) = {
326327 let nftId = value(i.payments[0].assetId)
327328 valueOrElse(isCorrectNft(nftId), if (!(isCorrectSellPrice(price)))
328329 then throw("Price must be > 0")
329330 else [setSell(nftId, i.caller, price)])
330331 }
331332
332333
333334
334335 @Callable(i)
335336 func addAuction (startPrice,start,end) = {
336337 let nftId = value(i.payments[0].assetId)
337338 valueOrElse(isCorrectNft(nftId), [setAuction(i.caller, nftId, startPrice, start, end), StringEntry(((toBase58String(nftId) + separator) + "nft_owner"), toString(i.caller))])
338339 }
339340
340341
341342
342343 @Callable(i)
343344 func buyFromSlot (nftId) = {
344- let $t092299318 = $Tuple2(i.payments[0].assetId, value(i.payments[0].amount))
345- let paymentAsset = $t092299318._1
346- let paymentAmount = $t092299318._2
345+ let $t093529441 = $Tuple2(i.payments[0].assetId, value(i.payments[0].amount))
346+ let paymentAsset = $t093529441._1
347+ let paymentAmount = $t093529441._2
347348 let assetId = fromBase58String(nftId)
348- let $t093629400 = getSlot(assetId)
349- let type = $t093629400._1
350- let details = $t093629400._2
349+ let $t094859523 = getSlot(assetId)
350+ let type = $t094859523._1
351+ let details = $t094859523._2
351352 let baseRes = [ScriptTransfer(i.caller, 1, assetId), DeleteEntry(getSlotKey(type, assetId))]
352353 if ((type == kSell))
353354 then {
354- let $t095429589 = parseAsSell(details)
355- let seller = $t095429589._1
356- let priceValue = $t095429589._2
355+ let $t096659712 = parseAsSell(details)
356+ let seller = $t096659712._1
357+ let priceValue = $t096659712._2
357358 valueOrElse(isCorrectPayments(paymentAsset, paymentAmount, priceValue), {
358- let $t096749776 = resultFundsAmounts(isTrustedNft(assetId), paymentAmount, priceValue)
359- let sellerAmount = $t096749776._1
360- let buyerAmount = $t096749776._2
359+ let $t097979899 = resultFundsAmounts(isTrustedNft(assetId), paymentAmount, priceValue)
360+ let sellerAmount = $t097979899._1
361+ let buyerAmount = $t097979899._2
361362 let updatedRes = (baseRes ++ [ScriptTransfer(seller, sellerAmount, unit)])
362363 if ((buyerAmount > 0))
363364 then (updatedRes ++ [ScriptTransfer(i.caller, buyerAmount, unit)])
364365 else updatedRes
365366 })
366367 }
367368 else {
368- let $t0999310062 = calcPriceAtCurrentMoment(assetId, height)
369- let seller = $t0999310062._1
370- let actualPrice = $t0999310062._2
369+ let $t01011610185 = calcPriceAtCurrentMoment(assetId, height)
370+ let seller = $t01011610185._1
371+ let actualPrice = $t01011610185._2
371372 valueOrElse(isCorrectPayments(paymentAsset, paymentAmount, actualPrice), {
372- let $t01014810251 = resultFundsAmounts(isTrustedNft(assetId), paymentAmount, actualPrice)
373- let sellerAmount = $t01014810251._1
374- let buyerAmount = $t01014810251._2
373+ let $t01027110374 = resultFundsAmounts(isTrustedNft(assetId), paymentAmount, actualPrice)
374+ let sellerAmount = $t01027110374._1
375+ let buyerAmount = $t01027110374._2
375376 let updatedRes = (baseRes ++ [ScriptTransfer(seller, sellerAmount, unit)])
376377 if ((buyerAmount > 0))
377378 then (updatedRes ++ [ScriptTransfer(i.caller, buyerAmount, unit)])
378379 else updatedRes
379380 })
380381 }
381382 }
382383
383384
384385
385386 @Callable(i)
386387 func declineSlot (nftId) = {
387388 let assetId = fromBase58String(nftId)
388- let $t01055210590 = getSlot(assetId)
389- let type = $t01055210590._1
390- let details = $t01055210590._2
389+ let $t01067510713 = getSlot(assetId)
390+ let type = $t01067510713._1
391+ let details = $t01067510713._2
391392 let baseRes = [DeleteEntry(getSlotKey(type, assetId))]
392393 if ((type == kSell))
393394 then {
394- let $t01068210729 = parseAsSell(details)
395- let seller = $t01068210729._1
396- let priceValue = $t01068210729._2
395+ let $t01080510852 = parseAsSell(details)
396+ let seller = $t01080510852._1
397+ let priceValue = $t01080510852._2
397398 if (!(isValidCaller(i.caller, seller)))
398399 then throw("Invalid caller")
399400 else (baseRes ++ [ScriptTransfer(seller, 1, assetId)])
400401 }
401402 else {
402- let $t01087410978 = parseAsAuction(details)
403- let seller = $t01087410978._1
404- let startPriceValue = $t01087410978._2
405- let endPriceValue = $t01087410978._3
406- let startPeriodValue = $t01087410978._4
407- let endPeriodValue = $t01087410978._5
403+ let $t01099711101 = parseAsAuction(details)
404+ let seller = $t01099711101._1
405+ let startPriceValue = $t01099711101._2
406+ let endPriceValue = $t01099711101._3
407+ let startPeriodValue = $t01099711101._4
408+ let endPeriodValue = $t01099711101._5
408409 if (!(isValidCaller(i.caller, seller)))
409410 then throw("Invalid caller")
410411 else if (!(isAuctionEnded(height, endPeriodValue)))
411412 then throw("Wait for end of auction")
412413 else (baseRes ++ [ScriptTransfer(seller, 1, assetId)])
413414 }
414415 }
415416
416417
417418
418419 @Callable(i)
419420 func setTrustedIssuer (trustedAddr) = if (!(isAdmin(i.caller)))
420421 then throw("Only admin")
421422 else [BooleanEntry(getTrustedKey(addressFromStringValue(trustedAddr)), true)]
422423
423424
424425
425426 @Callable(i)
426427 func getPriceAtCurrentMoment (nftId,moment) = {
427428 let assetId = fromBase58String(nftId)
428- let $t01151911582 = calcPriceAtCurrentMoment(assetId, moment)
429- let seller = $t01151911582._1
430- let price = $t01151911582._2
429+ let $t01164211705 = calcPriceAtCurrentMoment(assetId, moment)
430+ let seller = $t01164211705._1
431+ let price = $t01164211705._2
431432 [IntegerEntry(getPriceKey(assetId), price)]
432433 }
433434
434435

github/deemru/w8io/026f985 
75.35 ms