tx · F1T9jL21SiYgoqz2yFnLacJhjVFZcvRxnoe9DC6D4ExS

3N7KPSUwpMgvDEVGw1DYBnKDiixSQUXhn2P:  -0.05000000 Waves

2023.05.30 20:31 [2601015] smart account 3N7KPSUwpMgvDEVGw1DYBnKDiixSQUXhn2P > SELF 0.00000000 Waves

{ "type": 13, "id": "F1T9jL21SiYgoqz2yFnLacJhjVFZcvRxnoe9DC6D4ExS", "fee": 5000000, "feeAssetId": null, "timestamp": 1685467951661, "version": 2, "chainId": 84, "sender": "3N7KPSUwpMgvDEVGw1DYBnKDiixSQUXhn2P", "senderPublicKey": "BTvXQMmkgSf57dbcqWxpEvbi3ZYcEeWFkkXDZC6FrneM", "proofs": [ "3ijLKJLS34SU847U8E16fLWNjCU9hGxok6dQNqYUYyu6FwdSw6m1DKvUZD1DzBeARxYYanQaFTJiK5uFK5uMkgvG" ], "script": "base64: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", "height": 2601015, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 4V5vYRzKt33yariGxNVhBp4DgJLim8YjwTK5eeYSjBnD Next: 3kCgctn8UTQtPQPzqTq415tFqZjJFrHGjwRY4TcwnaDj Full:
OldNewDifferences
1-{-# STDLIB_VERSION 6 #-}
1+{-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
4-let separator = "_"
5-
6-let kAuction = "auction"
7-
8-let kSell = "sell"
9-
10-let kTrusted = "trusted"
11-
12-let kPrice = "price"
13-
14-func getSlotKey (prefix,nftId) = ((prefix + separator) + toBase58String(nftId))
15-
16-
17-func getPriceKey (nftId) = ((kPrice + separator) + toBase58String(nftId))
18-
19-
20-func getSellKey (nftId) = ((kSell + separator) + toBase58String(nftId))
21-
22-
23-func getAuctionKey (nftId) = ((kAuction + separator) + toBase58String(nftId))
24-
25-
26-func getTrustedKey (issuer) = ((kTrusted + separator) + toString(issuer))
27-
28-
29-func addToList (accum,nextValue) = (accum ++ [nextValue])
30-
31-
32-func joinString (params) = {
33- let length = size(params)
34- if ((length == 0))
35- then throw("Empty params")
36- else if ((length == 1))
37- then makeString({
38- let $l = params
39- let $s = size($l)
40- let $acc0 = nil
41- func $f0_1 ($a,$i) = if (($i >= $s))
42- then $a
43- else addToList($a, $l[$i])
44-
45- func $f0_2 ($a,$i) = if (($i >= $s))
46- then $a
47- else throw("List size exceeds 1")
48-
49- $f0_2($f0_1($acc0, 0), 1)
50- }, separator)
51- else if ((length == 2))
52- then makeString({
53- let $l = params
54- let $s = size($l)
55- let $acc0 = nil
56- func $f0_1 ($a,$i) = if (($i >= $s))
57- then $a
58- else addToList($a, $l[$i])
59-
60- func $f0_2 ($a,$i) = if (($i >= $s))
61- then $a
62- else throw("List size exceeds 2")
63-
64- $f0_2($f0_1($f0_1($acc0, 0), 1), 2)
65- }, separator)
66- else if ((length == 3))
67- then makeString({
68- let $l = params
69- let $s = size($l)
70- let $acc0 = nil
71- func $f0_1 ($a,$i) = if (($i >= $s))
72- then $a
73- else addToList($a, $l[$i])
74-
75- func $f0_2 ($a,$i) = if (($i >= $s))
76- then $a
77- else throw("List size exceeds 3")
78-
79- $f0_2($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3)
80- }, separator)
81- else if ((length == 4))
82- then makeString({
83- let $l = params
84- let $s = size($l)
85- let $acc0 = nil
86- func $f0_1 ($a,$i) = if (($i >= $s))
87- then $a
88- else addToList($a, $l[$i])
89-
90- func $f0_2 ($a,$i) = if (($i >= $s))
91- then $a
92- else throw("List size exceeds 4")
93-
94- $f0_2($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4)
95- }, separator)
96- else if ((length == 5))
97- then makeString({
98- let $l = params
99- let $s = size($l)
100- let $acc0 = nil
101- func $f0_1 ($a,$i) = if (($i >= $s))
102- then $a
103- else addToList($a, $l[$i])
104-
105- func $f0_2 ($a,$i) = if (($i >= $s))
106- then $a
107- else throw("List size exceeds 5")
108-
109- $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5)
110- }, separator)
111- else throw("Max number of parameters exceeded")
112- }
113-
114-
115-func parseAsAuction (details) = {
116- let res = split(details, separator)
117- $Tuple5(addressFromStringValue(res[0]), parseIntValue(res[1]), parseIntValue(res[2]), parseIntValue(res[3]), parseIntValue(res[4]))
118- }
119-
120-
121-func parseAsSell (details) = {
122- let res = split(details, separator)
123- $Tuple2(addressFromStringValue(res[0]), parseIntValue(res[1]))
124- }
125-
126-
127-func joinStruct (params) = match params {
128- case auction: (Address, Int, String, String) =>
129- joinString([toString(auction._1), toString(auction._2), auction._3, auction._4])
130- case sell: (Address, Int) =>
131- joinString([toString(sell._1), toString(sell._2)])
132- case _ =>
133- throw("Wrong params tupple")
134-}
135-
136-
137-func setAuction (seller,nftId,startPrice,start,end) = StringEntry(getAuctionKey(nftId), joinStruct($Tuple4(seller, startPrice, start, end)))
138-
139-
140-func setSell (nftId,celler,price) = StringEntry(getSellKey(nftId), joinStruct($Tuple2(celler, price)))
141-
142-
143-func getAuction (nftId) = value(getString(this, getAuctionKey(nftId)))
144-
145-
146-func getSell (nftId) = value(getString(this, getSellKey(nftId)))
147-
148-
149-func calcPriceAtCurrentMoment (assetId,moment) = {
150- let details = getAuction(assetId)
151- let $t027552859 = parseAsAuction(details)
152- let seller = $t027552859._1
153- let startPriceValue = $t027552859._2
154- let endPriceValue = $t027552859._3
155- let startPeriodValue = $t027552859._4
156- let endPeriodValue = $t027552859._5
157- if ((moment >= endPeriodValue))
158- then $Tuple2(seller, endPriceValue)
159- else {
160- let deltaPrice = (startPriceValue - endPriceValue)
161- let period = (endPeriodValue - startPeriodValue)
162- let spended = (moment - startPeriodValue)
163- $Tuple2(seller, (startPriceValue - fraction(spended, deltaPrice, period)))
164- }
165- }
166-
167-
168-func isNft (assetId) = match assetInfo(assetId) {
169- case token: Asset =>
170- if (if ((token.decimals == 0))
171- then (token.quantity == 1)
172- else false)
173- then (token.reissuable == false)
174- else false
175- case _ =>
176- false
177-}
178-
179-
180-func isTrustedNft (assetId) = {
181- let issuer = value(assetInfo(assetId)).issuer
182- valueOrElse(getBoolean(this, getTrustedKey(issuer)), false)
183- }
184-
185-
186-func isSellExist (assetId) = isDefined(getString(this, getSellKey(assetId)))
187-
188-
189-func isAuctionExist (assetId) = isDefined(getString(this, getAuctionKey(assetId)))
190-
191-
192-func isCorrectSellPrice (price) = (price > 0)
193-
194-
195-func isCorrectAuctionPrices (startPrice,endPrice) = (startPrice > endPrice)
196-
197-
198-func isAdmin (caller) = (caller == this)
199-
200-
201-func isValidCaller (caller,seller) = if ((caller == this))
202- then true
203- else (caller == seller)
204-
205-
206-func isAuctionEnded (now,end) = (now > end)
207-
208-
209-func isEnoughFunds (payment,currentMomentPrice) = (payment >= currentMomentPrice)
210-
211-
212-func isWawes (assetId) = (assetId == unit)
213-
214-
215-func isCorrectNft (nftId) = if (!(isNft(nftId)))
216- then throw("Token is not Nft")
217- else if (isSellExist(nftId))
218- then throw("Sell already exists")
219- else if (isAuctionExist(nftId))
220- then throw("Auction already exists")
221- else unit
222-
223-
224-func isCorrectPayments (paymentAsset,paymentAmount,price) = if (!(isWawes(paymentAsset)))
225- then throw("Payment must be at WAVES")
226- else if (!(isEnoughFunds(paymentAmount, price)))
227- then throw("Not enough funds")
228- else unit
229-
230-
231-func calcFee () = 0
232-
233-
234-func calcTrustedFee () = 0
235-
236-
237-func resultFundsAmounts (isTrusted,paymentAmount,actualPrice) = if (isTrusted)
238- then $Tuple2((actualPrice - calcTrustedFee()), (paymentAmount - actualPrice))
239- else $Tuple2((actualPrice - calcFee()), (paymentAmount - actualPrice))
240-
241-
242-func getSlot (nftId) = if (isSellExist(nftId))
243- then $Tuple2(kSell, getSell(nftId))
244- else if (isAuctionExist(nftId))
245- then $Tuple2(kAuction, getAuction(nftId))
246- else throw("Slot doesn`t exist")
247-
248-
249-let kBuy = "buy"
250-
251-let kBid = "bid"
252-
253-let statusForNFT = $Tuple4("OPEN", "CLOSED", "REWARDED", "CANCELED")
254-
255-let dAppAddress = base58'3N85YW6NZ9pLYvSdt1ASMQTGxvncnU1vUNx'
4+let ownerAddress = "3MvjAaDYHpS4A5K4CV3kZMMEH9m9JdBSvbq"
2565
2576 @Callable(i)
258-func createNft (nft_name,nft_owner,nft_dAppAddress,nft_type,nft_tags,nft_selling_price,nft_description,nft_onSell,nft_data) = {
259- let newToken = Issue(nft_name, nft_description, 1, 0, false)
260- let issueId = calculateAssetId(newToken)
261- let txId = i.transactionId
262-[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))]
7+func call () = {
8+ let asset = Issue("Asset", "", 1, 0, true, unit, 0)
9+ let assetId = calculateAssetId(asset)
10+[BinaryEntry("bin", base58''), BooleanEntry("bool", true), IntegerEntry("int", 1), StringEntry("str", ""), DeleteEntry("str"), asset, Reissue(assetId, 1, false), Burn(assetId, 1), ScriptTransfer(i.caller, 1, assetId)]
26311 }
26412
26513
26614
26715 @Callable(i)
268-func sellNFT (price) = {
269- let txId = i.transactionId
270- let seller = i.caller.bytes
271- let $t066056690 = $Tuple2(value(i.payments[0].assetId), value(i.payments[0].amount))
272- let token0 = $t066056690._1
273- let amount0 = $t066056690._2
274- if (!(isNft(token0)))
275- then throw("Token is not NFT")
276- else [StringEntry(((kPrice + separator) + toBase58String(value(i.payments[0].assetId))), toString(price)), StringEntry(((toString(i.caller) + separator) + kSell), ((toBase58String(token0) + separator) + toString(amount0)))]
16+func deposit () = {
17+ let currentKey = toBase58String(i.caller.bytes)
18+ let amount = i.payments[0].amount
19+ let totalPlatformFee = getIntegerValue(this, ("platform_bal" + ownerAddress))
20+ let platformFeeInc = (totalPlatformFee + i.payments[1].amount)
21+[IntegerEntry(("balance_" + currentKey), amount), IntegerEntry(("platform_bal_" + ownerAddress), platformFeeInc)]
27722 }
27823
27924
28025
28126 @Callable(i)
282-func buyNFT (nftID,current_nft_owner) = {
283- let assetId = fromBase58String(nftID)
284- let amount = value(i.payments[0].amount)
285- let checkOwnerIsSame = match getString(this, (("nft_" + current_nft_owner) + "_owner")) {
286- case a: String =>
27+func withDraw (amountToWithDraw) = {
28+ let Caller = toBase58String(i.caller.bytes)
29+ let currentKey = toBase58String(i.caller.bytes)
30+ let currentAmount = match getInteger(this, ("platform_bal_" + Caller)) {
31+ case a: Int =>
28732 a
28833 case _ =>
289- false
34+ 0
29035 }
291- let price = getStringValue(((((kPrice + separator) + nftID) + "_") + current_nft_owner))
292- let owner = valueOrErrorMessage(getStringValue(((nftID + separator) + "Owner")), "No owner")
293- if ((i.payments[0].assetId != unit))
294- then throw("Pay in waves")
295- else if ((checkOwnerIsSame == toString(i.caller)))
296- then throw("Owner of NFT not able to purchase")
297- else [ScriptTransfer(i.caller, 1, assetId), ScriptTransfer(Address(fromBase58String(owner)), amount, unit), StringEntry(((toString(i.caller) + separator) + kBuy), ((nftID + separator) + toString(amount))), DeleteEntry((("nft_" + current_nft_owner) + "_owner"))]
36+ let newAmount = (currentAmount - amountToWithDraw)
37+ if ((Caller != ownerAddress))
38+ then throw("Not Authorized")
39+ else if ((currentAmount == 0))
40+ then throw("No sufficent amount available")
41+ else [IntegerEntry(("platform_bal" + ownerAddress), newAmount), ScriptTransfer(i.caller, amountToWithDraw, unit)]
29842 }
29943
30044
301-
302-@Callable(i)
303-func addAuction (start,end,startPrice,duration) = {
304- let txId = toBase58String(i.transactionId)
305- let nftId = value(i.payments[0].assetId)
306- let price = value(startPrice)
307- let caller = i.caller.bytes
308- let checkNftAuctioned = match getString(this, (((toBase58String(nftId) + separator) + "nft_status_") + toBase58String(caller))) {
309- case a: String =>
310- true
311- case _ =>
312- false
313- }
314- if ((i.payments[0].assetId == unit))
315- then throw("NFT not attached")
316- else if ((checkNftAuctioned == true))
317- then throw("Already in auction list")
318- else [StringEntry(((txId + "_nft_start_auction_date_") + toBase58String(caller)), start), StringEntry(((txId + "_nft_end_auction_date_") + toBase58String(caller)), end), StringEntry((txId + "_nft_start_price"), startPrice), StringEntry((txId + "duration_of_auction"), duration), StringEntry((txId + "_nft_owner"), toString(i.caller)), StringEntry((txId + "_nft_on_auction"), toBase58String(nftId)), StringEntry((txId + "_previous_bidder"), "none"), StringEntry((txId + "_highest_bid"), "0"), StringEntry((txId + "_winner_of_nft"), "0"), StringEntry((txId + "_bidder_count"), "0"), StringEntry((txId + "_nft_status"), "OPEN")]
319- }
320-
321-
322-
323-@Callable(i)
324-func placeBid (auctionId,nftId,nft_owner,bid_price) = {
325- let txId = toBase58String(i.transactionId)
326- let caller = i.caller.bytes
327- let assetId = fromBase58String(nftId)
328- let currentBidPrice = i.payments[0].amount
329- let getLastWinnerBidPrice = getStringValue(this, (auctionId + "_highest_bid"))
330- let getPreviousBidderAddress = getString(this, (auctionId + "_previous_bidder"))
331- let currentBidCount = getStringValue(this, (auctionId + "_bidder_count"))
332- let getLastWinnerAddress = getStringValue(this, (auctionId + "_winner_of_nft"))
333- let checkNftAuctioned = getStringValue(this, (auctionId + "_nft_status"))
334- if ((i.payments[0].assetId != unit))
335- then throw("Pay in waves")
336- else if ((checkNftAuctioned != "OPEN"))
337- then throw("Not open for auction")
338- else if ((parseIntValue(getLastWinnerBidPrice) >= currentBidPrice))
339- then throw("Bid is less then starting/highest Bid")
340- else if ((getLastWinnerBidPrice == "0"))
341- then [StringEntry((auctionId + "_highest_bid"), toString(currentBidPrice)), StringEntry((auctionId + "_winner_of_nft"), toBase58String(i.caller.bytes)), StringEntry((auctionId + "_bidder_count"), toString((parseIntValue(currentBidCount) + 1))), StringEntry((auctionId + "_nft_id"), toBase58String(assetId)), StringEntry((auctionId + "_nft_owner"), nft_owner), StringEntry((((txId + "_") + auctionId) + "_highest_bid"), toString(currentBidPrice)), StringEntry((((txId + "_") + auctionId) + "_winner"), toBase58String(i.caller.bytes)), StringEntry((((txId + "_") + auctionId) + "_bidder_count"), toString((parseIntValue(currentBidCount) + 1))), StringEntry((((txId + "_") + auctionId) + "_nft_id"), toBase58String(assetId)), StringEntry((((txId + "_") + auctionId) + "_nft_owner"), nft_owner), StringEntry((txId + "_bid_for_nft_by"), toBase58String(caller)), StringEntry((txId + "_bid_price_place"), bid_price), StringEntry((txId + "_previous_bid_amount_refund_to_address"), getLastWinnerAddress), StringEntry((txId + "_prevoius_bid_amount_refund"), getLastWinnerBidPrice)]
342- else [StringEntry((auctionId + "_highest_bid"), toString(currentBidPrice)), StringEntry((auctionId + "_winner_of_nft"), toBase58String(i.caller.bytes)), StringEntry((auctionId + "_bidder_count"), toString((parseIntValue(currentBidCount) + 1))), StringEntry((auctionId + "_nft_id"), toBase58String(assetId)), StringEntry((auctionId + "_nft_owner"), nft_owner), StringEntry((((txId + "_") + auctionId) + "_highest_bid"), toString(currentBidPrice)), StringEntry((((txId + "_") + auctionId) + "_winner"), toBase58String(i.caller.bytes)), StringEntry((((txId + "_") + auctionId) + "_bidder_count"), toString((parseIntValue(currentBidCount) + 1))), StringEntry((((txId + "_") + auctionId) + "_nft_id"), toBase58String(assetId)), StringEntry((((txId + "_") + auctionId) + "_nft_owner"), nft_owner), StringEntry((txId + "_bid_for_nft_by"), toBase58String(caller)), StringEntry((txId + "_bid_price_place"), bid_price), StringEntry((txId + "_previous_bid_amount_refund_to_address"), getLastWinnerAddress), StringEntry((txId + "_prevoius_bid_amount_refund"), getLastWinnerBidPrice), ScriptTransfer(Address(fromBase58String(getLastWinnerAddress)), parseIntValue(getLastWinnerBidPrice), unit)]
343- }
344-
345-
346-
347-@Callable(i)
348-func acceptBidOffer (auctionId,nftId,bid_amount_from_user) = {
349- let txId = toBase58String(i.transactionId)
350- let caller = i.caller.bytes
351- let assetId = fromBase58String(nftId)
352- let getNftWinningPrice = getStringValue(this, (auctionId + "_highest_bid"))
353- let getAuctionWinner = getStringValue(this, (auctionId + "_winner_of_nft"))
354-[ScriptTransfer(Address(caller), parseIntValue(getNftWinningPrice), unit), ScriptTransfer(Address(fromBase58String(getAuctionWinner)), 1, assetId), StringEntry((txId + "_amount_paid_to_owner"), getNftWinningPrice), StringEntry((txId + "_nft_transfer_to"), getAuctionWinner), StringEntry((txId + "_nft_status"), "REWARDED"), StringEntry((auctionId + "_amount_paid_to_owner"), getNftWinningPrice), StringEntry((auctionId + "_nft_transfer_to"), getAuctionWinner), StringEntry((auctionId + "_nft_status"), "REWARDED")]
355- }
356-
357-
358-
359-@Callable(i)
360-func cancelAuction (auctionId) = {
361- let txId = toBase58String(i.transactionId)
362- let caller = i.caller.bytes
363- let auctionStatus = getStringValue(this, (auctionId + "_nft_status"))
364- let biddingWinner = getStringValue(this, (auctionId + "_winner_of_nft"))
365- let nftOwner = getStringValue(this, (auctionId + "_nft_owner"))
366- let nftId = getStringValue(this, (auctionId + "_nft_on_auction"))
367- let biddingPrice = getStringValue(this, (auctionId + "_highest_bid"))
368-[StringEntry((auctionId + "_nft_status"), "CANCELED"), StringEntry((auctionId + "_previous_bid_amount_refund_to_address"), biddingWinner), StringEntry((auctionId + "_prevoius_bid_amount_refund"), biddingPrice), StringEntry((txId + "_nft_status"), "CANCELED"), StringEntry((txId + "_previous_bid_amount_refund_to_address"), biddingWinner), StringEntry((txId + "_prevoius_bid_amount_refund"), biddingPrice), ScriptTransfer(Address(fromBase58String(nftOwner)), 1, fromBase58String(nftId)), ScriptTransfer(Address(fromBase58String(biddingWinner)), parseIntValue(biddingPrice), unit)]
369- }
370-
371-
372-
373-@Callable(i)
374-func withdrawBid (bidTxId) = {
375- let caller = i.caller.bytes
376- let bidPrice = getStringValue(this, (bidTxId + "_highest_bid"))
377- let asBidder = getStringValue(this, (bidTxId + "_winner"))
378- let bidForNFT = getStringValue(this, (bidTxId + "_nft_id"))
379- if ((toBase58String(caller) != asBidder))
380- then throw("No bid")
381- else [StringEntry((bidTxId + "_nft_bid"), "WITHDRAW"), StringEntry((bidTxId + "_nft_id"), bidForNFT), StringEntry((bidTxId + "_bidding_price_refund_amount"), bidPrice), ScriptTransfer(i.caller, parseIntValue(bidPrice), unit)]
382- }
383-
384-
385-
386-@Callable(i)
387-func testBid (data) = [StringEntry("E8kkFBYCy44JJaq6pAZ6KizsuResi5UKNhbD1WNZwhhY_highest_bid", "0")]
388-
45+@Verifier(tx)
46+func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
38947

github/deemru/w8io/026f985 
39.34 ms