tx · 2da6GYLK2yF3pPRrSDiU4J7TWGVxCEFJ2ARn121HNjqZ

3MvjAaDYHpS4A5K4CV3kZMMEH9m9JdBSvbq:  -0.50000000 Waves

2022.11.30 12:33 [2339669] smart account 3MvjAaDYHpS4A5K4CV3kZMMEH9m9JdBSvbq > SELF 0.00000000 Waves

{ "type": 13, "id": "2da6GYLK2yF3pPRrSDiU4J7TWGVxCEFJ2ARn121HNjqZ", "fee": 50000000, "feeAssetId": null, "timestamp": 1669800833508, "version": 2, "chainId": 84, "sender": "3MvjAaDYHpS4A5K4CV3kZMMEH9m9JdBSvbq", "senderPublicKey": "H6UqxUDcJamDRg1uykVcWMn4zhAMTV7i1nfPq1moLWmJ", "proofs": [ "2weMasFaTTxhGfGJPw8AZByN8iAE7JcPMFJNwjnxULzLKpfQQtVQBrSB3h3MsBZ3XRkUomrgGizxeCvcukoYqAwQ" ], "script": "base64:BgJNCAISCwoJCAgICAgBCAgIEgQKAggIEgMKAQgSAwoBARIDCgEBEgUKAwgICBIDCgEIEgMKAQgSAwoBCBIECgIIARIGCgQICAEBEgMKAQgoAAlzZXBhcmF0b3ICAV8ACGtBdWN0aW9uAgdhdWN0aW9uAAVrU2VsbAIEc2VsbAAIa1RydXN0ZWQCB3RydXN0ZWQABmtQcmljZQIFcHJpY2UBCmdldFNsb3RLZXkCBnByZWZpeAVuZnRJZAkArAICCQCsAgIFBnByZWZpeAUJc2VwYXJhdG9yCQDYBAEFBW5mdElkAQtnZXRQcmljZUtleQEFbmZ0SWQJAKwCAgkArAICBQZrUHJpY2UFCXNlcGFyYXRvcgkA2AQBBQVuZnRJZAEKZ2V0U2VsbEtleQEFbmZ0SWQJAKwCAgkArAICBQVrU2VsbAUJc2VwYXJhdG9yCQDYBAEFBW5mdElkAQ1nZXRBdWN0aW9uS2V5AQVuZnRJZAkArAICCQCsAgIFCGtBdWN0aW9uBQlzZXBhcmF0b3IJANgEAQUFbmZ0SWQBDWdldFRydXN0ZWRLZXkBBmlzc3VlcgkAr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acted Prev: 5r9eYKF1egfEGm7STEZod96Gprs4RE5R7sApHccqJqKn Next: 9i6ygQvUQUJemRTpVawdSWR7QFt9tecJkgFLn7us76Ta Diff:
OldNewDifferences
313313 let nftId = value(i.payments[0].assetId)
314314 let price = value(startPrice)
315315 let auction = $Tuple4(i.caller, price, start, end)
316- valueOrElse(isCorrectNft(nftId), [StringEntry(getAuctionKey(nftId), ((((((toString(auction._1) + "_") + value(startPrice)) + "_") + auction._3) + "_") + auction._4)), StringEntry(((toBase58String(nftId) + separator) + "nft_owner"), toString(i.caller))])
316+ let caller = i.caller.bytes
317+ valueOrElse(isCorrectNft(nftId), [StringEntry(((toBase58String(nftId) + "_nft_start_price") + toBase58String(caller)), value(startPrice)), StringEntry(((toBase58String(nftId) + "_nft_start_auction_date") + toBase58String(caller)), start), StringEntry(((toBase58String(nftId) + "_nft_end_auction_date") + toBase58String(caller)), end), StringEntry(((toBase58String(nftId) + separator) + "nft_owner"), toString(i.caller))])
317318 }
318319
319320
320321
321322 @Callable(i)
322323 func buyFromSlot (nftId) = {
323- let $t086068695 = $Tuple2(i.payments[0].assetId, value(i.payments[0].amount))
324- let paymentAsset = $t086068695._1
325- let paymentAmount = $t086068695._2
324+ let $t089349023 = $Tuple2(i.payments[0].assetId, value(i.payments[0].amount))
325+ let paymentAsset = $t089349023._1
326+ let paymentAmount = $t089349023._2
326327 let assetId = fromBase58String(nftId)
327- let $t087398777 = getSlot(assetId)
328- let type = $t087398777._1
329- let details = $t087398777._2
328+ let $t090679105 = getSlot(assetId)
329+ let type = $t090679105._1
330+ let details = $t090679105._2
330331 let baseRes = [ScriptTransfer(i.caller, 1, assetId), DeleteEntry(getSlotKey(type, assetId))]
331332 if ((type == kSell))
332333 then {
333- let $t089198966 = parseAsSell(details)
334- let seller = $t089198966._1
335- let priceValue = $t089198966._2
334+ let $t092479294 = parseAsSell(details)
335+ let seller = $t092479294._1
336+ let priceValue = $t092479294._2
336337 valueOrElse(isCorrectPayments(paymentAsset, paymentAmount, priceValue), {
337- let $t090519153 = resultFundsAmounts(isTrustedNft(assetId), paymentAmount, priceValue)
338- let sellerAmount = $t090519153._1
339- let buyerAmount = $t090519153._2
338+ let $t093799481 = resultFundsAmounts(isTrustedNft(assetId), paymentAmount, priceValue)
339+ let sellerAmount = $t093799481._1
340+ let buyerAmount = $t093799481._2
340341 let updatedRes = (baseRes ++ [ScriptTransfer(seller, sellerAmount, unit)])
341342 if ((buyerAmount > 0))
342343 then (updatedRes ++ [ScriptTransfer(i.caller, buyerAmount, unit)])
344345 })
345346 }
346347 else {
347- let $t093709439 = calcPriceAtCurrentMoment(assetId, height)
348- let seller = $t093709439._1
349- let actualPrice = $t093709439._2
348+ let $t096989767 = calcPriceAtCurrentMoment(assetId, height)
349+ let seller = $t096989767._1
350+ let actualPrice = $t096989767._2
350351 valueOrElse(isCorrectPayments(paymentAsset, paymentAmount, actualPrice), {
351- let $t095259628 = resultFundsAmounts(isTrustedNft(assetId), paymentAmount, actualPrice)
352- let sellerAmount = $t095259628._1
353- let buyerAmount = $t095259628._2
352+ let $t098539956 = resultFundsAmounts(isTrustedNft(assetId), paymentAmount, actualPrice)
353+ let sellerAmount = $t098539956._1
354+ let buyerAmount = $t098539956._2
354355 let updatedRes = (baseRes ++ [ScriptTransfer(seller, sellerAmount, unit)])
355356 if ((buyerAmount > 0))
356357 then (updatedRes ++ [ScriptTransfer(i.caller, buyerAmount, unit)])
364365 @Callable(i)
365366 func declineSlot (nftId) = {
366367 let assetId = fromBase58String(nftId)
367- let $t099299967 = getSlot(assetId)
368- let type = $t099299967._1
369- let details = $t099299967._2
368+ let $t01025710295 = getSlot(assetId)
369+ let type = $t01025710295._1
370+ let details = $t01025710295._2
370371 let baseRes = [DeleteEntry(getSlotKey(type, assetId))]
371372 if ((type == kSell))
372373 then {
373- let $t01005910106 = parseAsSell(details)
374- let seller = $t01005910106._1
375- let priceValue = $t01005910106._2
374+ let $t01038710434 = parseAsSell(details)
375+ let seller = $t01038710434._1
376+ let priceValue = $t01038710434._2
376377 if (!(isValidCaller(i.caller, seller)))
377378 then throw("Invalid caller")
378379 else (baseRes ++ [ScriptTransfer(seller, 1, assetId)])
379380 }
380381 else {
381- let $t01025110355 = parseAsAuction(details)
382- let seller = $t01025110355._1
383- let startPriceValue = $t01025110355._2
384- let endPriceValue = $t01025110355._3
385- let startPeriodValue = $t01025110355._4
386- let endPeriodValue = $t01025110355._5
382+ let $t01057910683 = parseAsAuction(details)
383+ let seller = $t01057910683._1
384+ let startPriceValue = $t01057910683._2
385+ let endPriceValue = $t01057910683._3
386+ let startPeriodValue = $t01057910683._4
387+ let endPeriodValue = $t01057910683._5
387388 if (!(isValidCaller(i.caller, seller)))
388389 then throw("Invalid caller")
389390 else if (!(isAuctionEnded(height, endPeriodValue)))
404405 @Callable(i)
405406 func getPriceAtCurrentMoment (nftId,moment) = {
406407 let assetId = fromBase58String(nftId)
407- let $t01089610959 = calcPriceAtCurrentMoment(assetId, moment)
408- let seller = $t01089610959._1
409- let price = $t01089610959._2
408+ let $t01122411287 = calcPriceAtCurrentMoment(assetId, moment)
409+ let seller = $t01122411287._1
410+ let price = $t01122411287._2
410411 [IntegerEntry(getPriceKey(assetId), price)]
411412 }
412413
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 statusForNFT = $Tuple4("OPEN", "CLOSED", "REWARDED", "CANCELED")
252252
253253 let dAppAddress = base58'3MvjAaDYHpS4A5K4CV3kZMMEH9m9JdBSvbq'
254254
255255 @Callable(i)
256256 func createNFT (nft_name,nft_owner,nft_dAppAddress,nft_type,nft_tags,nft_selling_price,nft_description,nft_onSell,nft_data) = {
257257 let newToken = Issue(nft_name, nft_description, 1, 0, false)
258258 let issueId = calculateAssetId(newToken)
259259 let txId = i.transactionId
260260 [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))]
261261 }
262262
263263
264264
265265 @Callable(i)
266266 func issueNft (name,meta) = {
267267 let newToken = Issue(name, meta, 1, 0, false)
268268 let issueId = calculateAssetId(newToken)
269269 [newToken, ScriptTransfer(i.caller, 1, issueId), StringEntry(((toBase58String(issueId) + separator) + "Owner"), toString(i.caller))]
270270 }
271271
272272
273273
274274 @Callable(i)
275275 func buyNFT (nftID) = {
276276 let assetId = fromBase58String(nftID)
277277 let amount = value(i.payments[0].amount)
278278 let price = valueOrErrorMessage(getString(((kPrice + separator) + nftID)), "There is no price for this NFT")
279279 let owner = valueOrErrorMessage(getStringValue(((nftID + separator) + "Owner")), "No owner")
280280 if ((i.payments[0].assetId != unit))
281281 then throw("Pay in waves")
282282 else if ((parseIntValue(price) > amount))
283283 then throw("Invalid payment")
284284 else [ScriptTransfer(i.caller, 1, assetId), ScriptTransfer(value(addressFromString(owner)), parseIntValue(price), unit), StringEntry(((toString(i.caller) + separator) + kBuy), ((nftID + separator) + toString(amount)))]
285285 }
286286
287287
288288
289289 @Callable(i)
290290 func sellNFT (price) = {
291291 let $t074627547 = $Tuple2(value(i.payments[0].assetId), value(i.payments[0].amount))
292292 let token0 = $t074627547._1
293293 let amount0 = $t074627547._2
294294 if (!(isNft(token0)))
295295 then throw("Token is not NFT")
296296 else [StringEntry(((kPrice + separator) + toBase58String(value(i.payments[0].assetId))), toString(price)), StringEntry(((toString(i.caller) + separator) + kSell), ((toBase58String(token0) + separator) + toString(amount0)))]
297297 }
298298
299299
300300
301301 @Callable(i)
302302 func addSell (price) = {
303303 let nftId = value(i.payments[0].assetId)
304304 valueOrElse(isCorrectNft(nftId), if (!(isCorrectSellPrice(price)))
305305 then throw("Price must be > 0")
306306 else [setSell(nftId, i.caller, price)])
307307 }
308308
309309
310310
311311 @Callable(i)
312312 func addAuction (startPrice,start,end) = {
313313 let nftId = value(i.payments[0].assetId)
314314 let price = value(startPrice)
315315 let auction = $Tuple4(i.caller, price, start, end)
316- valueOrElse(isCorrectNft(nftId), [StringEntry(getAuctionKey(nftId), ((((((toString(auction._1) + "_") + value(startPrice)) + "_") + auction._3) + "_") + auction._4)), StringEntry(((toBase58String(nftId) + separator) + "nft_owner"), toString(i.caller))])
316+ let caller = i.caller.bytes
317+ valueOrElse(isCorrectNft(nftId), [StringEntry(((toBase58String(nftId) + "_nft_start_price") + toBase58String(caller)), value(startPrice)), StringEntry(((toBase58String(nftId) + "_nft_start_auction_date") + toBase58String(caller)), start), StringEntry(((toBase58String(nftId) + "_nft_end_auction_date") + toBase58String(caller)), end), StringEntry(((toBase58String(nftId) + separator) + "nft_owner"), toString(i.caller))])
317318 }
318319
319320
320321
321322 @Callable(i)
322323 func buyFromSlot (nftId) = {
323- let $t086068695 = $Tuple2(i.payments[0].assetId, value(i.payments[0].amount))
324- let paymentAsset = $t086068695._1
325- let paymentAmount = $t086068695._2
324+ let $t089349023 = $Tuple2(i.payments[0].assetId, value(i.payments[0].amount))
325+ let paymentAsset = $t089349023._1
326+ let paymentAmount = $t089349023._2
326327 let assetId = fromBase58String(nftId)
327- let $t087398777 = getSlot(assetId)
328- let type = $t087398777._1
329- let details = $t087398777._2
328+ let $t090679105 = getSlot(assetId)
329+ let type = $t090679105._1
330+ let details = $t090679105._2
330331 let baseRes = [ScriptTransfer(i.caller, 1, assetId), DeleteEntry(getSlotKey(type, assetId))]
331332 if ((type == kSell))
332333 then {
333- let $t089198966 = parseAsSell(details)
334- let seller = $t089198966._1
335- let priceValue = $t089198966._2
334+ let $t092479294 = parseAsSell(details)
335+ let seller = $t092479294._1
336+ let priceValue = $t092479294._2
336337 valueOrElse(isCorrectPayments(paymentAsset, paymentAmount, priceValue), {
337- let $t090519153 = resultFundsAmounts(isTrustedNft(assetId), paymentAmount, priceValue)
338- let sellerAmount = $t090519153._1
339- let buyerAmount = $t090519153._2
338+ let $t093799481 = resultFundsAmounts(isTrustedNft(assetId), paymentAmount, priceValue)
339+ let sellerAmount = $t093799481._1
340+ let buyerAmount = $t093799481._2
340341 let updatedRes = (baseRes ++ [ScriptTransfer(seller, sellerAmount, unit)])
341342 if ((buyerAmount > 0))
342343 then (updatedRes ++ [ScriptTransfer(i.caller, buyerAmount, unit)])
343344 else updatedRes
344345 })
345346 }
346347 else {
347- let $t093709439 = calcPriceAtCurrentMoment(assetId, height)
348- let seller = $t093709439._1
349- let actualPrice = $t093709439._2
348+ let $t096989767 = calcPriceAtCurrentMoment(assetId, height)
349+ let seller = $t096989767._1
350+ let actualPrice = $t096989767._2
350351 valueOrElse(isCorrectPayments(paymentAsset, paymentAmount, actualPrice), {
351- let $t095259628 = resultFundsAmounts(isTrustedNft(assetId), paymentAmount, actualPrice)
352- let sellerAmount = $t095259628._1
353- let buyerAmount = $t095259628._2
352+ let $t098539956 = resultFundsAmounts(isTrustedNft(assetId), paymentAmount, actualPrice)
353+ let sellerAmount = $t098539956._1
354+ let buyerAmount = $t098539956._2
354355 let updatedRes = (baseRes ++ [ScriptTransfer(seller, sellerAmount, unit)])
355356 if ((buyerAmount > 0))
356357 then (updatedRes ++ [ScriptTransfer(i.caller, buyerAmount, unit)])
357358 else updatedRes
358359 })
359360 }
360361 }
361362
362363
363364
364365 @Callable(i)
365366 func declineSlot (nftId) = {
366367 let assetId = fromBase58String(nftId)
367- let $t099299967 = getSlot(assetId)
368- let type = $t099299967._1
369- let details = $t099299967._2
368+ let $t01025710295 = getSlot(assetId)
369+ let type = $t01025710295._1
370+ let details = $t01025710295._2
370371 let baseRes = [DeleteEntry(getSlotKey(type, assetId))]
371372 if ((type == kSell))
372373 then {
373- let $t01005910106 = parseAsSell(details)
374- let seller = $t01005910106._1
375- let priceValue = $t01005910106._2
374+ let $t01038710434 = parseAsSell(details)
375+ let seller = $t01038710434._1
376+ let priceValue = $t01038710434._2
376377 if (!(isValidCaller(i.caller, seller)))
377378 then throw("Invalid caller")
378379 else (baseRes ++ [ScriptTransfer(seller, 1, assetId)])
379380 }
380381 else {
381- let $t01025110355 = parseAsAuction(details)
382- let seller = $t01025110355._1
383- let startPriceValue = $t01025110355._2
384- let endPriceValue = $t01025110355._3
385- let startPeriodValue = $t01025110355._4
386- let endPeriodValue = $t01025110355._5
382+ let $t01057910683 = parseAsAuction(details)
383+ let seller = $t01057910683._1
384+ let startPriceValue = $t01057910683._2
385+ let endPriceValue = $t01057910683._3
386+ let startPeriodValue = $t01057910683._4
387+ let endPeriodValue = $t01057910683._5
387388 if (!(isValidCaller(i.caller, seller)))
388389 then throw("Invalid caller")
389390 else if (!(isAuctionEnded(height, endPeriodValue)))
390391 then throw("Wait for end of auction")
391392 else (baseRes ++ [ScriptTransfer(seller, 1, assetId)])
392393 }
393394 }
394395
395396
396397
397398 @Callable(i)
398399 func setTrustedIssuer (trustedAddr) = if (!(isAdmin(i.caller)))
399400 then throw("Only admin")
400401 else [BooleanEntry(getTrustedKey(addressFromStringValue(trustedAddr)), true)]
401402
402403
403404
404405 @Callable(i)
405406 func getPriceAtCurrentMoment (nftId,moment) = {
406407 let assetId = fromBase58String(nftId)
407- let $t01089610959 = calcPriceAtCurrentMoment(assetId, moment)
408- let seller = $t01089610959._1
409- let price = $t01089610959._2
408+ let $t01122411287 = calcPriceAtCurrentMoment(assetId, moment)
409+ let seller = $t01122411287._1
410+ let price = $t01122411287._2
410411 [IntegerEntry(getPriceKey(assetId), price)]
411412 }
412413
413414
414415
415416 @Callable(i)
416417 func placeBid (nftId,nft_owner,min_price,bid_price) = {
417418 let caller = i.caller
418419 let assetId = fromBase58String(nftId)
419420 let amount = value(i.payments[0].amount)
420421 if ((i.payments[0].assetId != unit))
421422 then throw("Pay in waves")
422423 else [StringEntry(((("nft_id_" + nftId) + "_") + toBase58String(caller.bytes)), nftId), StringEntry(((("nft_owner_" + nftId) + "_") + toBase58String(caller.bytes)), nft_owner), StringEntry(((("bidding_for_" + nftId) + "_by_") + toBase58String(caller.bytes)), ((nftId + "_") + toBase58String(caller.bytes))), StringEntry(((("min_price_for_" + nftId) + "_by_") + toBase58String(caller.bytes)), toString(min_price)), StringEntry(((("bid_price_for" + nftId) + "_by_") + toBase58String(caller.bytes)), toString(bid_price))]
423424 }
424425
425426
426427
427428 @Callable(i)
428429 func aceptOffer (message) = [ScriptTransfer(i.caller, 100000000, unit)]
429430
430431

github/deemru/w8io/026f985 
102.98 ms