tx · FznHkJJJPAsNpsEpLwq1Cx43EpDcFNZ7BF9HupjBjkfN

3MvjAaDYHpS4A5K4CV3kZMMEH9m9JdBSvbq:  -0.50000000 Waves

2022.11.30 16:56 [2339925] smart account 3MvjAaDYHpS4A5K4CV3kZMMEH9m9JdBSvbq > SELF 0.00000000 Waves

{ "type": 13, "id": "FznHkJJJPAsNpsEpLwq1Cx43EpDcFNZ7BF9HupjBjkfN", "fee": 50000000, "feeAssetId": null, "timestamp": 1669816548671, "version": 2, "chainId": 84, "sender": "3MvjAaDYHpS4A5K4CV3kZMMEH9m9JdBSvbq", "senderPublicKey": "H6UqxUDcJamDRg1uykVcWMn4zhAMTV7i1nfPq1moLWmJ", "proofs": [ "495Gm11SNHGEoGkrXQ37LC5cgskwJyPvW3rcRTiWdFKJ8PU29TccjDJSVCh14ks9ydERjoKCQMPcSnSUcFARncoD" ], "script": "base64:BgJQCAISBgoECAgBARIAEgQKAggIEgsKCQgICAgIAQgICBIECgIICBIDCgEIEgMKAQESAwoBARIFCgMBCAgSAwoBCBIDCgEIEgMKAQgSBAoCCAEnAAlzZXBhcmF0b3ICAV8ACGtBdWN0aW9uAgdhdWN0aW9uAAVrU2VsbAIEc2VsbAAIa1RydXN0ZWQCB3RydXN0ZWQABmtQcmljZQIFcHJpY2UBCmdldFNsb3RLZXkCBnByZWZpeAVuZnRJZAkArAICCQCsAgIFBnByZWZpeAUJc2VwYXJhdG9yCQDYBAEFBW5mdElkAQtnZXRQcmljZUtleQEFbmZ0SWQJAKwCAgkArAICBQZrUHJpY2UFCXNlcGFyYXRvcgkA2AQBBQVuZnRJZAEKZ2V0U2VsbEtleQEFbmZ0SWQJAKwCAgkArAICBQVrU2VsbAUJc2VwYXJhdG9yCQDYBAEFBW5mdElkAQ1nZXRBdWN0aW9uS2V5AQVuZnRJZAkArAICCQCsAgIFCGtBdWN0aW9uBQlzZXBhcmF0b3IJANgEAQUFbmZ0SWQBDWdldFRydXN0ZWRLZXkBBmlzc3VlcgkArAIC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W4BCAUBaQZjYWxsZXIJAAIBAgpPbmx5IGFkbWluCQDMCAIJAQxCb29sZWFuRW50cnkCCQENZ2V0VHJ1c3RlZEtleQEJARFAZXh0ck5hdGl2ZSgxMDYyKQEFC3RydXN0ZWRBZGRyBgUDbmlsAWkBF2dldFByaWNlQXRDdXJyZW50TW9tZW50AgVuZnRJZAZtb21lbnQEB2Fzc2V0SWQJANkEAQUFbmZ0SWQEDSR0MDExNTE5MTE1ODIJARhjYWxjUHJpY2VBdEN1cnJlbnRNb21lbnQCBQdhc3NldElkBQZtb21lbnQEBnNlbGxlcggFDSR0MDExNTE5MTE1ODICXzEEBXByaWNlCAUNJHQwMTE1MTkxMTU4MgJfMgkAzAgCCQEMSW50ZWdlckVudHJ5AgkBC2dldFByaWNlS2V5AQUHYXNzZXRJZAUFcHJpY2UFA25pbADRIOmp", "height": 2339925, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 8DHKAReNEPMw6h3HmzD61THrJy7nTsc7b9j6vAuSfRG3 Next: 6NFHo1FoknEyz8bWCHrvuVb2SCuwz8KqtkZiT738Vrex Diff:
OldNewDifferences
248248
249249 let kBuy = "buy"
250250
251-let statusForNFT = $Tuple4("OPEN", "CLOSED", "REWARDED", "CANCELED")
252-
253-let dAppAddress = base58'3MvjAaDYHpS4A5K4CV3kZMMEH9m9JdBSvbq'
251+let kBid = "bid"
254252
255253 @Callable(i)
256-func createNFT (nft_name,nft_owner,nft_dAppAddress,nft_type,nft_tags,nft_selling_price,nft_description,nft_onSell,nft_data) = {
254+func placeBid (nftId,nft_owner,min_price,bid_price) = {
255+ let assetId = fromBase58String(nftId)
256+ let amount = value(i.payments[0].amount)
257+ if ((i.payments[0].assetId != unit))
258+ then throw("Pay in waves")
259+ 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)]
260+ }
261+
262+
263+
264+@Callable(i)
265+func pay () = {
266+ let amount = value(i.payments[0].amount)
267+ if ((i.payments[0].assetId != unit))
268+ then throw("Pay in waves")
269+ else nil
270+ }
271+
272+
273+
274+@Callable(i)
275+func confirmBid (nftId,userAddress) = [StringEntry("bid_winner", userAddress)]
276+
277+
278+
279+@Callable(i)
280+func createNft (nft_name,nft_owner,nft_dAppAddress,nft_type,nft_tags,nft_selling_price,nft_description,nft_onSell,nft_data) = {
257281 let newToken = Issue(nft_name, nft_description, 1, 0, false)
258282 let issueId = calculateAssetId(newToken)
259- let txId = i.transactionId
260-[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))]
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)]
261284 }
262285
263286
288311
289312 @Callable(i)
290313 func sellNFT (price) = {
291- let $t074627547 = $Tuple2(value(i.payments[0].assetId), value(i.payments[0].amount))
292- let token0 = $t074627547._1
293- let amount0 = $t074627547._2
314+ let $t082248309 = $Tuple2(value(i.payments[0].assetId), value(i.payments[0].amount))
315+ let token0 = $t082248309._1
316+ let amount0 = $t082248309._2
294317 if (!(isNft(token0)))
295318 then throw("Token is not NFT")
296319 else [StringEntry(((kPrice + separator) + toBase58String(value(i.payments[0].assetId))), toString(price)), StringEntry(((toString(i.caller) + separator) + kSell), ((toBase58String(token0) + separator) + toString(amount0)))]
309332
310333
311334 @Callable(i)
312-func addAuction (start,end,startPrice) = {
335+func addAuction (startPrice,start,end) = {
313336 let nftId = value(i.payments[0].assetId)
314- let price = value(startPrice)
315- let auction = $Tuple4(i.caller, price, start, end)
316- let caller = i.caller.bytes
317- let checkNftAuctioned = match getString(this, (((toBase58String(nftId) + separator) + "nft_status_") + toBase58String(caller))) {
318- case a: String =>
319- a
320- case _ =>
321- false
322- }
323- if ((checkNftAuctioned == statusForNFT._1))
324- then throw("Already in Auction list")
325- else [StringEntry(((toBase58String(nftId) + "_nft_start_auction_date_") + toBase58String(caller)), start), StringEntry(((toBase58String(nftId) + "_nft_end_auction_date_") + toBase58String(caller)), end), IntegerEntry(((toBase58String(nftId) + "_nft_start_price_") + toBase58String(caller)), startPrice), StringEntry(((toBase58String(nftId) + separator) + "nft_owner"), toString(i.caller)), StringEntry((((toBase58String(nftId) + separator) + "nft_status_") + toBase58String(caller)), statusForNFT._1)]
337+ valueOrElse(isCorrectNft(nftId), [setAuction(i.caller, nftId, startPrice, start, end), StringEntry(((toBase58String(nftId) + separator) + "nft_owner"), toString(i.caller))])
326338 }
327339
328340
329341
330342 @Callable(i)
331343 func buyFromSlot (nftId) = {
332- let $t093409429 = $Tuple2(i.payments[0].assetId, value(i.payments[0].amount))
333- let paymentAsset = $t093409429._1
334- let paymentAmount = $t093409429._2
344+ let $t092299318 = $Tuple2(i.payments[0].assetId, value(i.payments[0].amount))
345+ let paymentAsset = $t092299318._1
346+ let paymentAmount = $t092299318._2
335347 let assetId = fromBase58String(nftId)
336- let $t094739511 = getSlot(assetId)
337- let type = $t094739511._1
338- let details = $t094739511._2
348+ let $t093629400 = getSlot(assetId)
349+ let type = $t093629400._1
350+ let details = $t093629400._2
339351 let baseRes = [ScriptTransfer(i.caller, 1, assetId), DeleteEntry(getSlotKey(type, assetId))]
340352 if ((type == kSell))
341353 then {
342- let $t096539700 = parseAsSell(details)
343- let seller = $t096539700._1
344- let priceValue = $t096539700._2
354+ let $t095429589 = parseAsSell(details)
355+ let seller = $t095429589._1
356+ let priceValue = $t095429589._2
345357 valueOrElse(isCorrectPayments(paymentAsset, paymentAmount, priceValue), {
346- let $t097859887 = resultFundsAmounts(isTrustedNft(assetId), paymentAmount, priceValue)
347- let sellerAmount = $t097859887._1
348- let buyerAmount = $t097859887._2
358+ let $t096749776 = resultFundsAmounts(isTrustedNft(assetId), paymentAmount, priceValue)
359+ let sellerAmount = $t096749776._1
360+ let buyerAmount = $t096749776._2
349361 let updatedRes = (baseRes ++ [ScriptTransfer(seller, sellerAmount, unit)])
350362 if ((buyerAmount > 0))
351363 then (updatedRes ++ [ScriptTransfer(i.caller, buyerAmount, unit)])
353365 })
354366 }
355367 else {
356- let $t01010410173 = calcPriceAtCurrentMoment(assetId, height)
357- let seller = $t01010410173._1
358- let actualPrice = $t01010410173._2
368+ let $t0999310062 = calcPriceAtCurrentMoment(assetId, height)
369+ let seller = $t0999310062._1
370+ let actualPrice = $t0999310062._2
359371 valueOrElse(isCorrectPayments(paymentAsset, paymentAmount, actualPrice), {
360- let $t01025910362 = resultFundsAmounts(isTrustedNft(assetId), paymentAmount, actualPrice)
361- let sellerAmount = $t01025910362._1
362- let buyerAmount = $t01025910362._2
372+ let $t01014810251 = resultFundsAmounts(isTrustedNft(assetId), paymentAmount, actualPrice)
373+ let sellerAmount = $t01014810251._1
374+ let buyerAmount = $t01014810251._2
363375 let updatedRes = (baseRes ++ [ScriptTransfer(seller, sellerAmount, unit)])
364376 if ((buyerAmount > 0))
365377 then (updatedRes ++ [ScriptTransfer(i.caller, buyerAmount, unit)])
373385 @Callable(i)
374386 func declineSlot (nftId) = {
375387 let assetId = fromBase58String(nftId)
376- let $t01066310701 = getSlot(assetId)
377- let type = $t01066310701._1
378- let details = $t01066310701._2
388+ let $t01055210590 = getSlot(assetId)
389+ let type = $t01055210590._1
390+ let details = $t01055210590._2
379391 let baseRes = [DeleteEntry(getSlotKey(type, assetId))]
380392 if ((type == kSell))
381393 then {
382- let $t01079310840 = parseAsSell(details)
383- let seller = $t01079310840._1
384- let priceValue = $t01079310840._2
394+ let $t01068210729 = parseAsSell(details)
395+ let seller = $t01068210729._1
396+ let priceValue = $t01068210729._2
385397 if (!(isValidCaller(i.caller, seller)))
386398 then throw("Invalid caller")
387399 else (baseRes ++ [ScriptTransfer(seller, 1, assetId)])
388400 }
389401 else {
390- let $t01098511089 = parseAsAuction(details)
391- let seller = $t01098511089._1
392- let startPriceValue = $t01098511089._2
393- let endPriceValue = $t01098511089._3
394- let startPeriodValue = $t01098511089._4
395- let endPeriodValue = $t01098511089._5
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
396408 if (!(isValidCaller(i.caller, seller)))
397409 then throw("Invalid caller")
398410 else if (!(isAuctionEnded(height, endPeriodValue)))
413425 @Callable(i)
414426 func getPriceAtCurrentMoment (nftId,moment) = {
415427 let assetId = fromBase58String(nftId)
416- let $t01163011693 = calcPriceAtCurrentMoment(assetId, moment)
417- let seller = $t01163011693._1
418- let price = $t01163011693._2
428+ let $t01151911582 = calcPriceAtCurrentMoment(assetId, moment)
429+ let seller = $t01151911582._1
430+ let price = $t01151911582._2
419431 [IntegerEntry(getPriceKey(assetId), price)]
420432 }
421-
422-
423-
424-@Callable(i)
425-func placeBid (nftId,nft_owner,min_price,bid_price) = {
426- let caller = i.caller
427- let assetId = fromBase58String(nftId)
428- let amount = value(i.payments[0].amount)
429- let checkNftAuctioned = match getString(this, (((nftId + separator) + "nft_status_") + nft_owner)) {
430- case a: String =>
431- a
432- case _ =>
433- false
434- }
435- if ((i.payments[0].assetId != unit))
436- then throw("Pay in waves")
437- else if ((checkNftAuctioned != statusForNFT._1))
438- then throw("Not open in auction list")
439- 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)), StringEntry(((("transfer_bid_price_for" + nftId) + "_by_") + toBase58String(caller.bytes)), toBase58String(dAppAddress))]
440- }
441-
442-
443-
444-@Callable(i)
445-func aceptOffer (message) = [ScriptTransfer(i.caller, 100000000, unit)]
446433
447434
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 statusForNFT = $Tuple4("OPEN", "CLOSED", "REWARDED", "CANCELED")
252-
253-let dAppAddress = base58'3MvjAaDYHpS4A5K4CV3kZMMEH9m9JdBSvbq'
251+let kBid = "bid"
254252
255253 @Callable(i)
256-func createNFT (nft_name,nft_owner,nft_dAppAddress,nft_type,nft_tags,nft_selling_price,nft_description,nft_onSell,nft_data) = {
254+func placeBid (nftId,nft_owner,min_price,bid_price) = {
255+ let assetId = fromBase58String(nftId)
256+ let amount = value(i.payments[0].amount)
257+ if ((i.payments[0].assetId != unit))
258+ then throw("Pay in waves")
259+ 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)]
260+ }
261+
262+
263+
264+@Callable(i)
265+func pay () = {
266+ let amount = value(i.payments[0].amount)
267+ if ((i.payments[0].assetId != unit))
268+ then throw("Pay in waves")
269+ else nil
270+ }
271+
272+
273+
274+@Callable(i)
275+func confirmBid (nftId,userAddress) = [StringEntry("bid_winner", userAddress)]
276+
277+
278+
279+@Callable(i)
280+func createNft (nft_name,nft_owner,nft_dAppAddress,nft_type,nft_tags,nft_selling_price,nft_description,nft_onSell,nft_data) = {
257281 let newToken = Issue(nft_name, nft_description, 1, 0, false)
258282 let issueId = calculateAssetId(newToken)
259- let txId = i.transactionId
260-[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))]
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)]
261284 }
262285
263286
264287
265288 @Callable(i)
266289 func issueNft (name,meta) = {
267290 let newToken = Issue(name, meta, 1, 0, false)
268291 let issueId = calculateAssetId(newToken)
269292 [newToken, ScriptTransfer(i.caller, 1, issueId), StringEntry(((toBase58String(issueId) + separator) + "Owner"), toString(i.caller))]
270293 }
271294
272295
273296
274297 @Callable(i)
275298 func buyNFT (nftID) = {
276299 let assetId = fromBase58String(nftID)
277300 let amount = value(i.payments[0].amount)
278301 let price = valueOrErrorMessage(getString(((kPrice + separator) + nftID)), "There is no price for this NFT")
279302 let owner = valueOrErrorMessage(getStringValue(((nftID + separator) + "Owner")), "No owner")
280303 if ((i.payments[0].assetId != unit))
281304 then throw("Pay in waves")
282305 else if ((parseIntValue(price) > amount))
283306 then throw("Invalid payment")
284307 else [ScriptTransfer(i.caller, 1, assetId), ScriptTransfer(value(addressFromString(owner)), parseIntValue(price), unit), StringEntry(((toString(i.caller) + separator) + kBuy), ((nftID + separator) + toString(amount)))]
285308 }
286309
287310
288311
289312 @Callable(i)
290313 func sellNFT (price) = {
291- let $t074627547 = $Tuple2(value(i.payments[0].assetId), value(i.payments[0].amount))
292- let token0 = $t074627547._1
293- let amount0 = $t074627547._2
314+ let $t082248309 = $Tuple2(value(i.payments[0].assetId), value(i.payments[0].amount))
315+ let token0 = $t082248309._1
316+ let amount0 = $t082248309._2
294317 if (!(isNft(token0)))
295318 then throw("Token is not NFT")
296319 else [StringEntry(((kPrice + separator) + toBase58String(value(i.payments[0].assetId))), toString(price)), StringEntry(((toString(i.caller) + separator) + kSell), ((toBase58String(token0) + separator) + toString(amount0)))]
297320 }
298321
299322
300323
301324 @Callable(i)
302325 func addSell (price) = {
303326 let nftId = value(i.payments[0].assetId)
304327 valueOrElse(isCorrectNft(nftId), if (!(isCorrectSellPrice(price)))
305328 then throw("Price must be > 0")
306329 else [setSell(nftId, i.caller, price)])
307330 }
308331
309332
310333
311334 @Callable(i)
312-func addAuction (start,end,startPrice) = {
335+func addAuction (startPrice,start,end) = {
313336 let nftId = value(i.payments[0].assetId)
314- let price = value(startPrice)
315- let auction = $Tuple4(i.caller, price, start, end)
316- let caller = i.caller.bytes
317- let checkNftAuctioned = match getString(this, (((toBase58String(nftId) + separator) + "nft_status_") + toBase58String(caller))) {
318- case a: String =>
319- a
320- case _ =>
321- false
322- }
323- if ((checkNftAuctioned == statusForNFT._1))
324- then throw("Already in Auction list")
325- else [StringEntry(((toBase58String(nftId) + "_nft_start_auction_date_") + toBase58String(caller)), start), StringEntry(((toBase58String(nftId) + "_nft_end_auction_date_") + toBase58String(caller)), end), IntegerEntry(((toBase58String(nftId) + "_nft_start_price_") + toBase58String(caller)), startPrice), StringEntry(((toBase58String(nftId) + separator) + "nft_owner"), toString(i.caller)), StringEntry((((toBase58String(nftId) + separator) + "nft_status_") + toBase58String(caller)), statusForNFT._1)]
337+ valueOrElse(isCorrectNft(nftId), [setAuction(i.caller, nftId, startPrice, start, end), StringEntry(((toBase58String(nftId) + separator) + "nft_owner"), toString(i.caller))])
326338 }
327339
328340
329341
330342 @Callable(i)
331343 func buyFromSlot (nftId) = {
332- let $t093409429 = $Tuple2(i.payments[0].assetId, value(i.payments[0].amount))
333- let paymentAsset = $t093409429._1
334- let paymentAmount = $t093409429._2
344+ let $t092299318 = $Tuple2(i.payments[0].assetId, value(i.payments[0].amount))
345+ let paymentAsset = $t092299318._1
346+ let paymentAmount = $t092299318._2
335347 let assetId = fromBase58String(nftId)
336- let $t094739511 = getSlot(assetId)
337- let type = $t094739511._1
338- let details = $t094739511._2
348+ let $t093629400 = getSlot(assetId)
349+ let type = $t093629400._1
350+ let details = $t093629400._2
339351 let baseRes = [ScriptTransfer(i.caller, 1, assetId), DeleteEntry(getSlotKey(type, assetId))]
340352 if ((type == kSell))
341353 then {
342- let $t096539700 = parseAsSell(details)
343- let seller = $t096539700._1
344- let priceValue = $t096539700._2
354+ let $t095429589 = parseAsSell(details)
355+ let seller = $t095429589._1
356+ let priceValue = $t095429589._2
345357 valueOrElse(isCorrectPayments(paymentAsset, paymentAmount, priceValue), {
346- let $t097859887 = resultFundsAmounts(isTrustedNft(assetId), paymentAmount, priceValue)
347- let sellerAmount = $t097859887._1
348- let buyerAmount = $t097859887._2
358+ let $t096749776 = resultFundsAmounts(isTrustedNft(assetId), paymentAmount, priceValue)
359+ let sellerAmount = $t096749776._1
360+ let buyerAmount = $t096749776._2
349361 let updatedRes = (baseRes ++ [ScriptTransfer(seller, sellerAmount, unit)])
350362 if ((buyerAmount > 0))
351363 then (updatedRes ++ [ScriptTransfer(i.caller, buyerAmount, unit)])
352364 else updatedRes
353365 })
354366 }
355367 else {
356- let $t01010410173 = calcPriceAtCurrentMoment(assetId, height)
357- let seller = $t01010410173._1
358- let actualPrice = $t01010410173._2
368+ let $t0999310062 = calcPriceAtCurrentMoment(assetId, height)
369+ let seller = $t0999310062._1
370+ let actualPrice = $t0999310062._2
359371 valueOrElse(isCorrectPayments(paymentAsset, paymentAmount, actualPrice), {
360- let $t01025910362 = resultFundsAmounts(isTrustedNft(assetId), paymentAmount, actualPrice)
361- let sellerAmount = $t01025910362._1
362- let buyerAmount = $t01025910362._2
372+ let $t01014810251 = resultFundsAmounts(isTrustedNft(assetId), paymentAmount, actualPrice)
373+ let sellerAmount = $t01014810251._1
374+ let buyerAmount = $t01014810251._2
363375 let updatedRes = (baseRes ++ [ScriptTransfer(seller, sellerAmount, unit)])
364376 if ((buyerAmount > 0))
365377 then (updatedRes ++ [ScriptTransfer(i.caller, buyerAmount, unit)])
366378 else updatedRes
367379 })
368380 }
369381 }
370382
371383
372384
373385 @Callable(i)
374386 func declineSlot (nftId) = {
375387 let assetId = fromBase58String(nftId)
376- let $t01066310701 = getSlot(assetId)
377- let type = $t01066310701._1
378- let details = $t01066310701._2
388+ let $t01055210590 = getSlot(assetId)
389+ let type = $t01055210590._1
390+ let details = $t01055210590._2
379391 let baseRes = [DeleteEntry(getSlotKey(type, assetId))]
380392 if ((type == kSell))
381393 then {
382- let $t01079310840 = parseAsSell(details)
383- let seller = $t01079310840._1
384- let priceValue = $t01079310840._2
394+ let $t01068210729 = parseAsSell(details)
395+ let seller = $t01068210729._1
396+ let priceValue = $t01068210729._2
385397 if (!(isValidCaller(i.caller, seller)))
386398 then throw("Invalid caller")
387399 else (baseRes ++ [ScriptTransfer(seller, 1, assetId)])
388400 }
389401 else {
390- let $t01098511089 = parseAsAuction(details)
391- let seller = $t01098511089._1
392- let startPriceValue = $t01098511089._2
393- let endPriceValue = $t01098511089._3
394- let startPeriodValue = $t01098511089._4
395- let endPeriodValue = $t01098511089._5
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
396408 if (!(isValidCaller(i.caller, seller)))
397409 then throw("Invalid caller")
398410 else if (!(isAuctionEnded(height, endPeriodValue)))
399411 then throw("Wait for end of auction")
400412 else (baseRes ++ [ScriptTransfer(seller, 1, assetId)])
401413 }
402414 }
403415
404416
405417
406418 @Callable(i)
407419 func setTrustedIssuer (trustedAddr) = if (!(isAdmin(i.caller)))
408420 then throw("Only admin")
409421 else [BooleanEntry(getTrustedKey(addressFromStringValue(trustedAddr)), true)]
410422
411423
412424
413425 @Callable(i)
414426 func getPriceAtCurrentMoment (nftId,moment) = {
415427 let assetId = fromBase58String(nftId)
416- let $t01163011693 = calcPriceAtCurrentMoment(assetId, moment)
417- let seller = $t01163011693._1
418- let price = $t01163011693._2
428+ let $t01151911582 = calcPriceAtCurrentMoment(assetId, moment)
429+ let seller = $t01151911582._1
430+ let price = $t01151911582._2
419431 [IntegerEntry(getPriceKey(assetId), price)]
420432 }
421-
422-
423-
424-@Callable(i)
425-func placeBid (nftId,nft_owner,min_price,bid_price) = {
426- let caller = i.caller
427- let assetId = fromBase58String(nftId)
428- let amount = value(i.payments[0].amount)
429- let checkNftAuctioned = match getString(this, (((nftId + separator) + "nft_status_") + nft_owner)) {
430- case a: String =>
431- a
432- case _ =>
433- false
434- }
435- if ((i.payments[0].assetId != unit))
436- then throw("Pay in waves")
437- else if ((checkNftAuctioned != statusForNFT._1))
438- then throw("Not open in auction list")
439- 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)), StringEntry(((("transfer_bid_price_for" + nftId) + "_by_") + toBase58String(caller.bytes)), toBase58String(dAppAddress))]
440- }
441-
442-
443-
444-@Callable(i)
445-func aceptOffer (message) = [ScriptTransfer(i.caller, 100000000, unit)]
446433
447434

github/deemru/w8io/026f985 
75.04 ms