tx · Dez1dPkYDaYL6oC29n2GoZiqrKrTo55otBVyWaZsrCrg

3MvjAaDYHpS4A5K4CV3kZMMEH9m9JdBSvbq:  -0.50000000 Waves

2022.12.02 12:21 [2342537] smart account 3MvjAaDYHpS4A5K4CV3kZMMEH9m9JdBSvbq > SELF 0.00000000 Waves

{ "type": 13, "id": "Dez1dPkYDaYL6oC29n2GoZiqrKrTo55otBVyWaZsrCrg", "fee": 50000000, "feeAssetId": null, "timestamp": 1669972856811, "version": 2, "chainId": 84, "sender": "3MvjAaDYHpS4A5K4CV3kZMMEH9m9JdBSvbq", "senderPublicKey": "H6UqxUDcJamDRg1uykVcWMn4zhAMTV7i1nfPq1moLWmJ", "proofs": [ "5dDDZcarECt3Y7rUwnqBLY6brJsgRKYRngsJYUboy8eyeD5ie8kzVnTLev3grmo7PUhXaoDaLjhN4oPtUSKkPHPh" ], "script": "base64:BgIwCAISCwoJCAgICAgBCAgIEgMKAQgSBAoCCAgSBQoDCAgBEgYKBAgICAESBQoDCAgBKQAJc2VwYXJhdG9yAgFfAAhrQXVjdGlvbgIHYXVjdGlvbgAFa1NlbGwCBHNlbGwACGtUcnVzdGVkAgd0cnVzdGVkAAZrUHJpY2UCBXByaWNlAQpnZXRTbG90S2V5AgZwcmVmaXgFbmZ0SWQJAKwCAgkArAICBQZwcmVmaXgFCXNlcGFyYXRvcgkA2AQBBQVuZnRJZAELZ2V0UHJpY2VLZXkBBW5mdElkCQCsAgIJAKwCAgUGa1ByaWNlBQlzZXBhcmF0b3IJANgEAQUFbmZ0SWQBCmdldFNlbGxLZXkBBW5mdElkCQCsAgIJAKwCAgUFa1NlbGwFCXNlcGFyYXRvcgkA2AQBBQVuZnRJZAENZ2V0QXVjdGlvbktleQEFbmZ0SWQJAKwCAgkArAICBQhrQXVjdGlvbgUJc2VwYXJhdG9yCQDYBAEFBW5mdElkAQ1nZXRUcnVzdGVkS2V5AQZpc3N1ZXIJAKwCAgkArAICBQhrVHJ1c3RlZAUJc2VwYXJhd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jhd8LLUdjFwCeDnzA2uWZmjvSWekVZRkAaY Full:
OldNewDifferences
1-{-# STDLIB_VERSION 3 #-}
1+{-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
4-let maxAuctionDuration = (1440 * 30)
4+let separator = "_"
55
6-let revealDuration = (1440 * 7)
6+let kAuction = "auction"
77
8-func hashString (data) = {
9- let result = toBase64String(sha256(toBytes(data)))
10- result
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")
11112 }
12113
13114
14-func addToList (list,whatToAdd) = {
15- let result = ((list + " ") + whatToAdd)
16- result
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]))
17118 }
18119
19120
20-func removeFromList (list,whatToRemove) = {
21- let idx = indexOf(list, whatToRemove)
22- let result = if (isDefined(idx))
23- then (take(list, value(idx)) + takeRight(list, (value(idx) + size(whatToRemove))))
24- else list
25- result
121+func parseAsSell (details) = {
122+ let res = split(details, separator)
123+ $Tuple2(addressFromStringValue(res[0]), parseIntValue(res[1]))
26124 }
27125
28126
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'3MvjAaDYHpS4A5K4CV3kZMMEH9m9JdBSvbq'
256+
29257 @Callable(i)
30-func startAuction (duration,startPrice,priceAssetId,deposit) = {
31- let auctionId = toBase58String(i.transactionId)
32- let revealStart = (lastBlock.height + duration)
33- let closingStart = (revealStart + revealDuration)
34- let organizer = toBase58String(i.caller.bytes)
35- let organizerKey = (organizer + "_organizer")
36- let maybeOrganizerList = getString(this, organizerKey)
37- let organizerList = if (isDefined(maybeOrganizerList))
38- then value(maybeOrganizerList)
39- else ""
40- let newOrganizerList = ((organizerList + " ") + auctionId)
41- let pmt = extract(i.payment)
42- if ((duration > maxAuctionDuration))
43- then throw(("Duration is too long. Must be less than " + toString(maxAuctionDuration)))
44- else if (!(isDefined(pmt.assetId)))
45- then throw("Payment currency should not be in WAVES")
46- else if ((pmt.amount != 1))
47- then throw("Payment amount should be only one NFT")
48- else if ((0 >= startPrice))
49- then throw("Start price should be > 0")
50- else if ((startPrice >= deposit))
51- then throw((("Start price should be < deposit (" + toString(deposit)) + ")"))
52- else if ((0 >= duration))
53- then throw("Duration should be > 0")
54- else WriteSet([DataEntry((auctionId + "_reveal_start"), revealStart), DataEntry((auctionId + "_closing_start"), closingStart), DataEntry((auctionId + "_deposit"), deposit), DataEntry((auctionId + "_unrevealed_count"), 0), DataEntry((auctionId + "_top_price"), 0), DataEntry((auctionId + "_second_price"), 0), DataEntry((auctionId + "_settle"), false), DataEntry((auctionId + "_organizer"), organizer), DataEntry((auctionId + "_lot_assetId"), if (isDefined(pmt.assetId))
55- then toBase58String(value(pmt.assetId))
56- else "WAVES"), DataEntry((auctionId + "_lot_amount"), pmt.amount), DataEntry((auctionId + "_startPrice"), startPrice), DataEntry((auctionId + "_priceAssetId"), priceAssetId), DataEntry(organizerKey, newOrganizerList), DataEntry("test", hashString(("123" + toString(startPrice))))])
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))]
57263 }
58264
59265
60266
61267 @Callable(i)
62-func bid (auctionId,hashBidAmount) = {
63- let pmt = extract(i.payment)
64- let pmtAssetIdStr = if (isDefined(pmt.assetId))
65- then toBase58String(value(pmt.assetId))
66- else "WAVES"
67- let callerAddressStr = toBase58String(i.caller.bytes)
68- let endHeight = getIntegerValue(this, (auctionId + "_reveal_start"))
69- let startPrice = getIntegerValue(this, (auctionId + "_startPrice"))
70- let priceAssetId = getStringValue(this, (auctionId + "_priceAssetId"))
71- let organizer = getStringValue(this, (auctionId + "_organizer"))
72- let deposit = getIntegerValue(this, (auctionId + "_deposit"))
73- let unrevealedCount = getIntegerValue(this, (auctionId + "_unrevealed_count"))
74- let bidder = getString(this, (callerAddressStr + "_bidder"))
75- let bidFromTheSameUser = isDefined(getString(this, ((auctionId + callerAddressStr) + "bid_hash")))
76- if ((lastBlock.height >= endHeight))
77- then throw("Auction already finished")
78- else if (if (!(bidFromTheSameUser))
79- then (priceAssetId != pmtAssetIdStr)
80- else false)
81- then throw((("Bid must be in asset '" + priceAssetId) + "'"))
82- else if (!(isDefined(organizer)))
83- then throw("Organizer should be defined")
84- else if (if (!(bidFromTheSameUser))
85- then (pmt.amount != deposit)
86- else false)
87- then throw("Payment should be equel to deposit")
88- else {
89- let inc = if (bidFromTheSameUser)
90- then 0
91- else 1
92- WriteSet([DataEntry(((auctionId + callerAddressStr) + "_revealed"), false), DataEntry(((auctionId + callerAddressStr) + "_bid_hash"), hashBidAmount), DataEntry(((auctionId + callerAddressStr) + "_settle"), false), DataEntry((auctionId + "_unrevealed_cont"), (unrevealedCount + inc)), DataEntry((callerAddressStr + "_bidder"), (((if (isDefined(bidder))
93- then value(bidder)
94- else "") + " ") + auctionId))])
95- }
268+func sellNFT (price) = {
269+ let txId = i.transactionId
270+ let seller = i.caller.bytes
271+ let $t065196604 = $Tuple2(value(i.payments[0].assetId), value(i.payments[0].amount))
272+ let token0 = $t065196604._1
273+ let amount0 = $t065196604._2
274+ if (!(isNft(token0)))
275+ then throw("Token is not NFT")
276+ else [StringEntry((("nft_" + toBase58String(seller)) + "_owner"), toBase58String(seller)), StringEntry(((((kPrice + separator) + toBase58String(value(i.payments[0].assetId))) + "_") + toString(i.caller)), price), StringEntry(((toString(i.caller) + separator) + kSell), ((toBase58String(token0) + separator) + toString(amount0)))]
96277 }
97278
98279
99280
100281 @Callable(i)
101-func reveal (auctionId,bidAmount,salt) = {
102- let callerAddressStr = toBase58String(i.caller.bytes)
103- let organizer = getStringValue(this, (auctionId + "_organizer"))
104- let bidHash = getStringValue(this, ((auctionId + callerAddressStr) + "_bid_hash"))
105- let revealed = getBooleanValue(this, ((auctionId + callerAddressStr) + "_revealed"))
106- let revealStart = getIntegerValue(this, (auctionId + "_reveal_start"))
107- let closingStart = getIntegerValue(this, (auctionId + "_closing_start"))
108- let topPrice = getIntegerValue(this, (auctionId + "_top_price"))
109- let secondPrice = getIntegerValue(this, (auctionId + "_second_price"))
110- let winner = getString(this, (auctionId + "_winner"))
111- let unrevealedCount = getIntegerValue(this, (auctionId + "_unrevealed_count"))
112- let bidAmountAsStr = toString(bidAmount)
113- let stringToHash = (salt + bidAmountAsStr)
114- let hash = hashString(stringToHash)
115- if (!(isDefined(organizer)))
116- then throw("Organizer is not defined")
117- else if (!(isDefined(bidHash)))
118- then throw("Bid is not defined")
119- else if (if ((revealStart > lastBlock.height))
120- then true
121- else (lastBlock.height > closingStart))
122- then throw(((((("Auction should be revealed between reveal (" + toString(revealStart)) + ") and closing (") + toString(closingStart)) + ") time, now is ") + toString(lastBlock.height)))
123- else if (isDefined(i.payment))
124- then throw("Payment shoud not exist")
125- else if ((hash != bidHash))
126- then throw("Bid hash from bidMount and sault is not equel with hash from the caller bid")
127- else if ((revealed == true))
128- then throw("The bid has been already revealed")
129- else {
130- let topPrice2 = if ((bidAmount > topPrice))
131- then bidAmount
132- else topPrice
133- let secondPrice2 = if ((bidAmount > topPrice))
134- then topPrice
135- else if ((bidAmount > secondPrice))
136- then bidAmount
137- else secondPrice
138- let winner2 = if ((bidAmount > topPrice))
139- then callerAddressStr
140- else value(winner)
141- WriteSet([DataEntry((auctionId + "_top_price"), topPrice2), DataEntry((auctionId + "_second_price"), secondPrice2), DataEntry((auctionId + "_winner"), winner2), DataEntry(((auctionId + callerAddressStr) + "_revealed"), true), DataEntry((auctionId + "_unrevealed_cont"), (unrevealedCount - 1))])
142- }
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 =>
287+ a
288+ case _ =>
289+ false
290+ }
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"))]
143298 }
144299
145300
146301
147302 @Callable(i)
148-func withdraw (auctionId) = {
149- let pmt = i.payment
150- let callerAddressStr = toBase58String(i.caller.bytes)
151- let closingStart = getIntegerValue(this, (auctionId + "_closing_start"))
152- let unrevealedCount = getIntegerValue(this, (auctionId + "_unrevealed_count"))
153- let organizer = getStringValue(this, (auctionId + "_organizer"))
154- let revealTime = getIntegerValue(this, (auctionId + "_reveal_start"))
155- let winner = getString(this, (auctionId + "_winner"))
156- let lotAssetId = getStringValue(this, (auctionId + "_lot_assetId"))
157- let lotAmount = getIntegerValue(this, (auctionId + "_lot_amount"))
158- let priceAssetId = getStringValue(this, (auctionId + "_priceAssetId"))
159- let settle = getBooleanValue(this, (auctionId + "_settle"))
160- let secondPrice = getIntegerValue(this, (auctionId + "_second_price"))
161- let deposit = getIntegerValue(this, (auctionId + "_deposit"))
162- let lotAsset = if ((lotAssetId == "WAVES"))
163- then unit
164- else fromBase58String(lotAssetId)
165- let priceAsset = if (if ((priceAssetId == "WAVES"))
166- then true
167- else (priceAssetId == ""))
168- then unit
169- else fromBase58String(priceAssetId)
170- if (isDefined(pmt))
171- then throw("Payment shoud not exist")
172- else if (!(isDefined(organizer)))
173- then throw("Organizer shoud exist")
174- else if (if ((closingStart > (revealTime - lastBlock.height)))
175- then (unrevealedCount != 0)
176- else false)
177- then throw("Its too early to withdraw")
178- else if (if ((callerAddressStr == organizer))
179- then true
180- else (callerAddressStr == winner))
181- then if ((settle == true))
182- then throw("Illegal state, settle shoould be false")
183- else if (!(isDefined(winner)))
184- then if (isDefined(getString(this, (auctionId + "_lot_passed"))))
185- then throw("Organizer has already got his lot back")
186- else {
187- let organizerAddr = addressFromStringValue(value(organizer))
188- ScriptResult(WriteSet([DataEntry((auctionId + "_settle"), true), DataEntry((organizer + "_organizer"), removeFromList(getStringValue(this, (organizer + "_organizer")), auctionId))]), TransferSet([ScriptTransfer(organizerAddr, lotAmount, lotAsset)]))
189- }
190- else {
191- let winnerAddr = addressFromStringValue(value(winner))
192- let organizerAddr = addressFromStringValue(value(organizer))
193- ScriptResult(WriteSet([DataEntry((auctionId + "_settle"), true), DataEntry((value(winner) + "_bidder"), removeFromList(getStringValue(this, (value(winner) + "_bidder")), auctionId)), DataEntry((organizer + "_organizer"), removeFromList(getStringValue(this, (organizer + "_organizer")), auctionId))]), TransferSet([ScriptTransfer(winnerAddr, lotAmount, lotAsset), ScriptTransfer(organizerAddr, secondPrice, priceAsset), ScriptTransfer(winnerAddr, (deposit - secondPrice), priceAsset), ScriptTransfer(winnerAddr, (deposit - secondPrice), priceAsset)]))
194- }
195- else if ((settle == true))
196- then throw("Illegal state, settle shoould be false")
197- else ScriptResult(WriteSet([DataEntry((auctionId + "_settle"), true), DataEntry((callerAddressStr + "_bidder"), removeFromList(getStringValue(this, (callerAddressStr + "_bidder")), auctionId))]), TransferSet([ScriptTransfer(i.caller, deposit, priceAsset)]))
303+func addAuction (start,end,startPrice) = {
304+ let txId = i.transactionId
305+ let nftId = value(i.payments[0].assetId)
306+ let price = value(startPrice)
307+ let auction = $Tuple4(i.caller, price, start, end)
308+ let caller = i.caller.bytes
309+ let checkNftAuctioned = match getString(this, (((toBase58String(nftId) + separator) + "nft_status_") + toBase58String(caller))) {
310+ case a: String =>
311+ a
312+ case _ =>
313+ false
314+ }
315+ if ((checkNftAuctioned == statusForNFT._1))
316+ then throw("Already in Auction list")
317+ else [StringEntry(((toBase58String(txId) + "_nft_start_auction_date_") + toBase58String(caller)), start), StringEntry(((toBase58String(txId) + "_nft_end_auction_date_") + toBase58String(caller)), end), IntegerEntry(((toBase58String(txId) + "_nft_start_price_") + toBase58String(caller)), startPrice), StringEntry((toBase58String(txId) + "_nft_owner"), toString(i.caller)), StringEntry((toBase58String(txId) + "_nft_on_auction"), toBase58String(nftId)), StringEntry(((toBase58String(txId) + "_nft_status_") + toBase58String(caller)), statusForNFT._1)]
318+ }
319+
320+
321+
322+@Callable(i)
323+func placeBid (tx_Id,nftId,nft_owner,bid_price) = {
324+ let txId = i.transactionId
325+ let caller = i.caller
326+ let assetId = fromBase58String(nftId)
327+ let amount = value(i.payments[0].amount)
328+ let checkNftAuctioned = match getString(this, (((nftId + separator) + "nft_status_") + nft_owner)) {
329+ case a: String =>
330+ a
331+ case _ =>
332+ false
333+ }
334+ if ((i.payments[0].assetId != unit))
335+ then throw("Pay in waves")
336+ else if ((checkNftAuctioned != statusForNFT._1))
337+ then throw("Not open in auction list")
338+ 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)), toBase58String(caller.bytes)), StringEntry(((("bid_price_for" + nftId) + "_by_") + toBase58String(caller.bytes)), toString(bid_price)), StringEntry(((("transfer_nft_to_dappwith_bid_price_for_" + nftId) + "_by_") + toBase58String(caller.bytes)), toBase58String(dAppAddress))]
339+ }
340+
341+
342+
343+@Callable(i)
344+func acceptBidOffer (nftId,accepted_address,bid_amount_from_user) = {
345+ let caller = i.caller.bytes
346+ let assetId = fromBase58String(nftId)
347+ let acceptedAddressOfBidder = fromBase58String(accepted_address)
348+[ScriptTransfer(Address(i.caller.bytes), bid_amount_from_user, unit), ScriptTransfer(Address(acceptedAddressOfBidder), 1, assetId), StringEntry(((nftId + "_rewarded_to_") + accepted_address), accepted_address), StringEntry(("nft_transfer_status_from" + toBase58String(caller)), statusForNFT._3), StringEntry(((("nft_transfer_status_" + nftId) + "_transfer_to_") + accepted_address), accepted_address), DeleteEntry((((nftId + separator) + "nft_status_") + toBase58String(caller)))]
198349 }
199350
200351

github/deemru/w8io/026f985 
57.19 ms