tx · 3aKXZ9BA1hPMgCMMZnMvxf69pDyDD6sAR4hj42VPnzdn

3MvjAaDYHpS4A5K4CV3kZMMEH9m9JdBSvbq:  -0.05000000 Waves

2022.12.02 20:00 [2343001] smart account 3MvjAaDYHpS4A5K4CV3kZMMEH9m9JdBSvbq > SELF 0.00000000 Waves

{ "type": 13, "id": "3aKXZ9BA1hPMgCMMZnMvxf69pDyDD6sAR4hj42VPnzdn", "fee": 5000000, "feeAssetId": null, "timestamp": 1670000403929, "version": 2, "chainId": 84, "sender": "3MvjAaDYHpS4A5K4CV3kZMMEH9m9JdBSvbq", "senderPublicKey": "H6UqxUDcJamDRg1uykVcWMn4zhAMTV7i1nfPq1moLWmJ", "proofs": [ "5r1LUfKxuEEJAkK29zfybkQZMcnX32TZRp7XeNzSup6vSeVuxRz77TW33Hhwj227pZXUXgasrGRBJBLyEx2mMR2r" ], "script": "base64:BgI2CAISCwoJCAgICAgBCAgIEgMKAQgSBAoCCAgSBgoECAgBARIGCgQICAgBEgUKAwgIARIDCgEIKQAJc2VwYXJhdG9yAgFfAAhrQXVjdGlvbgIHYXVjdGlvbgAFa1NlbGwCBHNlbGwACGtUcnVzdGVkAgd0cnVzdGVkAAZrUHJpY2UCBXByaWNlAQpnZXRTbG90S2V5AgZwcmVmaXgFbmZ0SWQJAKwCAgkArAICBQZwcmVmaXgFCXNlcGFyYXRvcgkA2AQBBQVuZnRJZAELZ2V0UHJpY2VLZXkBBW5mdElkCQCsAgIJAKwCAgUGa1ByaWNlBQlzZXBhcmF0b3IJANgEAQUFbmZ0SWQBCmdldFNlbGxLZXkBBW5mdElkCQCsAgIJAKwCAgUFa1NlbGwFCXNlcGFyYXRvcgkA2AQBBQVuZnRJZAENZ2V0QXVjdGlvbktleQEFbmZ0SWQJAKwCAgkArAICBQhrQXVjdGlvbgUJc2VwYXJhdG9yCQDYBAEFBW5mdElkAQ1nZXRUcnVzdGVkS2V5AQZpc3N1ZXIJAKwCAgkArAICBQhrVHJ1c3RlZAUJ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HJlc3MBCAgFAWkGY2FsbGVyBWJ5dGVzBRRiaWRfYW1vdW50X2Zyb21fdXNlcgUEdW5pdAkAzAgCCQEOU2NyaXB0VHJhbnNmZXIDCQEHQWRkcmVzcwEFF2FjY2VwdGVkQWRkcmVzc09mQmlkZGVyAAEFB2Fzc2V0SWQJAMwIAgkBC1N0cmluZ0VudHJ5AgkArAICCQCsAgIJANgEAQUHYXNzZXRJZAINX3Jld2FyZGVkX3RvXwUQYWNjZXB0ZWRfYWRkcmVzcwUQYWNjZXB0ZWRfYWRkcmVzcwkAzAgCCQELU3RyaW5nRW50cnkCCQCsAgICGG5mdF90cmFuc2Zlcl9zdGF0dXNfZnJvbQkA2AQBBQZjYWxsZXIIBQxzdGF0dXNGb3JORlQCXzMJAMwIAgkBC1N0cmluZ0VudHJ5AgkArAICCQCsAgIJAKwCAgIUbmZ0X3RyYW5zZmVyX3N0YXR1c18FBW5mdElkAg1fdHJhbnNmZXJfdG9fBRBhY2NlcHRlZF9hZGRyZXNzBRBhY2NlcHRlZF9hZGRyZXNzCQDMCAIJAQtEZWxldGVFbnRyeQEJAKwCAgkArAICCQCsAgIJANgEAQUHYXNzZXRJZAUJc2VwYXJhdG9yAgtuZnRfc3RhdHVzXwkA2AQBBQZjYWxsZXIFA25pbAFpAQd0ZXN0QmlkAQRkYXRhCQDMCAIJAQtTdHJpbmdFbnRyeQICA2JpZAUEZGF0YQUDbmlsANF/A4k=", "height": 2343001, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 28p2F2b4LH1uNV1QJqVG591yydEUxAW8FwEmmstvoz6u Next: EbShpF1YgUdTe8CeaM1WBtbnvyxuJPf6ZkbPsoscpCVc Diff:
OldNewDifferences
331331 let getPreviousBidderAddress = getString(this, (auctionId + "_previous_bidder"))
332332 let currentBidCount = getStringValue(this, (auctionId + "_bidder_count"))
333333 let getLastWinnerAddress = getStringValue(this, (auctionId + "_winner_of_nft"))
334- let checkNftAuctioned = getStringValue(((auctionId + "_nft_status_") + toBase58String(caller)))
334+ let checkNftAuctioned = getStringValue(this, ((auctionId + "_nft_status_") + toBase58String(caller)))
335335 if ((i.payments[0].assetId != unit))
336336 then throw("Pay in waves")
337337 else if ((checkNftAuctioned != "OPEN"))
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let separator = "_"
55
66 let kAuction = "auction"
77
88 let kSell = "sell"
99
1010 let kTrusted = "trusted"
1111
1212 let kPrice = "price"
1313
1414 func getSlotKey (prefix,nftId) = ((prefix + separator) + toBase58String(nftId))
1515
1616
1717 func getPriceKey (nftId) = ((kPrice + separator) + toBase58String(nftId))
1818
1919
2020 func getSellKey (nftId) = ((kSell + separator) + toBase58String(nftId))
2121
2222
2323 func getAuctionKey (nftId) = ((kAuction + separator) + toBase58String(nftId))
2424
2525
2626 func getTrustedKey (issuer) = ((kTrusted + separator) + toString(issuer))
2727
2828
2929 func addToList (accum,nextValue) = (accum ++ [nextValue])
3030
3131
3232 func joinString (params) = {
3333 let length = size(params)
3434 if ((length == 0))
3535 then throw("Empty params")
3636 else if ((length == 1))
3737 then makeString({
3838 let $l = params
3939 let $s = size($l)
4040 let $acc0 = nil
4141 func $f0_1 ($a,$i) = if (($i >= $s))
4242 then $a
4343 else addToList($a, $l[$i])
4444
4545 func $f0_2 ($a,$i) = if (($i >= $s))
4646 then $a
4747 else throw("List size exceeds 1")
4848
4949 $f0_2($f0_1($acc0, 0), 1)
5050 }, separator)
5151 else if ((length == 2))
5252 then makeString({
5353 let $l = params
5454 let $s = size($l)
5555 let $acc0 = nil
5656 func $f0_1 ($a,$i) = if (($i >= $s))
5757 then $a
5858 else addToList($a, $l[$i])
5959
6060 func $f0_2 ($a,$i) = if (($i >= $s))
6161 then $a
6262 else throw("List size exceeds 2")
6363
6464 $f0_2($f0_1($f0_1($acc0, 0), 1), 2)
6565 }, separator)
6666 else if ((length == 3))
6767 then makeString({
6868 let $l = params
6969 let $s = size($l)
7070 let $acc0 = nil
7171 func $f0_1 ($a,$i) = if (($i >= $s))
7272 then $a
7373 else addToList($a, $l[$i])
7474
7575 func $f0_2 ($a,$i) = if (($i >= $s))
7676 then $a
7777 else throw("List size exceeds 3")
7878
7979 $f0_2($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3)
8080 }, separator)
8181 else if ((length == 4))
8282 then makeString({
8383 let $l = params
8484 let $s = size($l)
8585 let $acc0 = nil
8686 func $f0_1 ($a,$i) = if (($i >= $s))
8787 then $a
8888 else addToList($a, $l[$i])
8989
9090 func $f0_2 ($a,$i) = if (($i >= $s))
9191 then $a
9292 else throw("List size exceeds 4")
9393
9494 $f0_2($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4)
9595 }, separator)
9696 else if ((length == 5))
9797 then makeString({
9898 let $l = params
9999 let $s = size($l)
100100 let $acc0 = nil
101101 func $f0_1 ($a,$i) = if (($i >= $s))
102102 then $a
103103 else addToList($a, $l[$i])
104104
105105 func $f0_2 ($a,$i) = if (($i >= $s))
106106 then $a
107107 else throw("List size exceeds 5")
108108
109109 $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5)
110110 }, separator)
111111 else throw("Max number of parameters exceeded")
112112 }
113113
114114
115115 func parseAsAuction (details) = {
116116 let res = split(details, separator)
117117 $Tuple5(addressFromStringValue(res[0]), parseIntValue(res[1]), parseIntValue(res[2]), parseIntValue(res[3]), parseIntValue(res[4]))
118118 }
119119
120120
121121 func parseAsSell (details) = {
122122 let res = split(details, separator)
123123 $Tuple2(addressFromStringValue(res[0]), parseIntValue(res[1]))
124124 }
125125
126126
127127 func joinStruct (params) = match params {
128128 case auction: (Address, Int, String, String) =>
129129 joinString([toString(auction._1), toString(auction._2), auction._3, auction._4])
130130 case sell: (Address, Int) =>
131131 joinString([toString(sell._1), toString(sell._2)])
132132 case _ =>
133133 throw("Wrong params tupple")
134134 }
135135
136136
137137 func setAuction (seller,nftId,startPrice,start,end) = StringEntry(getAuctionKey(nftId), joinStruct($Tuple4(seller, startPrice, start, end)))
138138
139139
140140 func setSell (nftId,celler,price) = StringEntry(getSellKey(nftId), joinStruct($Tuple2(celler, price)))
141141
142142
143143 func getAuction (nftId) = value(getString(this, getAuctionKey(nftId)))
144144
145145
146146 func getSell (nftId) = value(getString(this, getSellKey(nftId)))
147147
148148
149149 func calcPriceAtCurrentMoment (assetId,moment) = {
150150 let details = getAuction(assetId)
151151 let $t027552859 = parseAsAuction(details)
152152 let seller = $t027552859._1
153153 let startPriceValue = $t027552859._2
154154 let endPriceValue = $t027552859._3
155155 let startPeriodValue = $t027552859._4
156156 let endPeriodValue = $t027552859._5
157157 if ((moment >= endPeriodValue))
158158 then $Tuple2(seller, endPriceValue)
159159 else {
160160 let deltaPrice = (startPriceValue - endPriceValue)
161161 let period = (endPeriodValue - startPeriodValue)
162162 let spended = (moment - startPeriodValue)
163163 $Tuple2(seller, (startPriceValue - fraction(spended, deltaPrice, period)))
164164 }
165165 }
166166
167167
168168 func isNft (assetId) = match assetInfo(assetId) {
169169 case token: Asset =>
170170 if (if ((token.decimals == 0))
171171 then (token.quantity == 1)
172172 else false)
173173 then (token.reissuable == false)
174174 else false
175175 case _ =>
176176 false
177177 }
178178
179179
180180 func isTrustedNft (assetId) = {
181181 let issuer = value(assetInfo(assetId)).issuer
182182 valueOrElse(getBoolean(this, getTrustedKey(issuer)), false)
183183 }
184184
185185
186186 func isSellExist (assetId) = isDefined(getString(this, getSellKey(assetId)))
187187
188188
189189 func isAuctionExist (assetId) = isDefined(getString(this, getAuctionKey(assetId)))
190190
191191
192192 func isCorrectSellPrice (price) = (price > 0)
193193
194194
195195 func isCorrectAuctionPrices (startPrice,endPrice) = (startPrice > endPrice)
196196
197197
198198 func isAdmin (caller) = (caller == this)
199199
200200
201201 func isValidCaller (caller,seller) = if ((caller == this))
202202 then true
203203 else (caller == seller)
204204
205205
206206 func isAuctionEnded (now,end) = (now > end)
207207
208208
209209 func isEnoughFunds (payment,currentMomentPrice) = (payment >= currentMomentPrice)
210210
211211
212212 func isWawes (assetId) = (assetId == unit)
213213
214214
215215 func isCorrectNft (nftId) = if (!(isNft(nftId)))
216216 then throw("Token is not Nft")
217217 else if (isSellExist(nftId))
218218 then throw("Sell already exists")
219219 else if (isAuctionExist(nftId))
220220 then throw("Auction already exists")
221221 else unit
222222
223223
224224 func isCorrectPayments (paymentAsset,paymentAmount,price) = if (!(isWawes(paymentAsset)))
225225 then throw("Payment must be at WAVES")
226226 else if (!(isEnoughFunds(paymentAmount, price)))
227227 then throw("Not enough funds")
228228 else unit
229229
230230
231231 func calcFee () = 0
232232
233233
234234 func calcTrustedFee () = 0
235235
236236
237237 func resultFundsAmounts (isTrusted,paymentAmount,actualPrice) = if (isTrusted)
238238 then $Tuple2((actualPrice - calcTrustedFee()), (paymentAmount - actualPrice))
239239 else $Tuple2((actualPrice - calcFee()), (paymentAmount - actualPrice))
240240
241241
242242 func getSlot (nftId) = if (isSellExist(nftId))
243243 then $Tuple2(kSell, getSell(nftId))
244244 else if (isAuctionExist(nftId))
245245 then $Tuple2(kAuction, getAuction(nftId))
246246 else throw("Slot doesn`t exist")
247247
248248
249249 let kBuy = "buy"
250250
251251 let kBid = "bid"
252252
253253 let statusForNFT = $Tuple4("OPEN", "CLOSED", "REWARDED", "CANCELED")
254254
255255 let dAppAddress = base58'3MvjAaDYHpS4A5K4CV3kZMMEH9m9JdBSvbq'
256256
257257 @Callable(i)
258258 func createNft (nft_name,nft_owner,nft_dAppAddress,nft_type,nft_tags,nft_selling_price,nft_description,nft_onSell,nft_data) = {
259259 let newToken = Issue(nft_name, nft_description, 1, 0, false)
260260 let issueId = calculateAssetId(newToken)
261261 let txId = i.transactionId
262262 [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))]
263263 }
264264
265265
266266
267267 @Callable(i)
268268 func sellNFT (price) = {
269269 let txId = i.transactionId
270270 let seller = i.caller.bytes
271271 let $t065196604 = $Tuple2(value(i.payments[0].assetId), value(i.payments[0].amount))
272272 let token0 = $t065196604._1
273273 let amount0 = $t065196604._2
274274 if (!(isNft(token0)))
275275 then throw("Token is not NFT")
276276 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)))]
277277 }
278278
279279
280280
281281 @Callable(i)
282282 func buyNFT (nftID,current_nft_owner) = {
283283 let assetId = fromBase58String(nftID)
284284 let amount = value(i.payments[0].amount)
285285 let checkOwnerIsSame = match getString(this, (("nft_" + current_nft_owner) + "_owner")) {
286286 case a: String =>
287287 a
288288 case _ =>
289289 false
290290 }
291291 let price = getStringValue(((((kPrice + separator) + nftID) + "_") + current_nft_owner))
292292 let owner = valueOrErrorMessage(getStringValue(((nftID + separator) + "Owner")), "No owner")
293293 if ((i.payments[0].assetId != unit))
294294 then throw("Pay in waves")
295295 else if ((checkOwnerIsSame == toString(i.caller)))
296296 then throw("Owner of NFT not able to purchase")
297297 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"))]
298298 }
299299
300300
301301
302302 @Callable(i)
303303 func addAuction (start,end,startPrice,duration) = {
304304 let txId = toBase58String(i.transactionId)
305305 let nftId = value(i.payments[0].assetId)
306306 let price = value(startPrice)
307307 let auction = $Tuple4(i.caller, price, start, end)
308308 let caller = i.caller.bytes
309309 let checkNftAuctioned = match getString(this, (((toBase58String(nftId) + separator) + "nft_status_") + toBase58String(caller))) {
310310 case a: String =>
311311 true
312312 case _ =>
313313 false
314314 }
315315 if ((i.payments[0].assetId == unit))
316316 then throw("NFT not attached")
317317 else if ((checkNftAuctioned == true))
318318 then throw("Already in auction list")
319319 else [StringEntry(((txId + "_nft_start_auction_date_") + toBase58String(caller)), start), StringEntry(((txId + "_nft_end_auction_date_") + toBase58String(caller)), end), IntegerEntry((txId + "_nft_start_price"), startPrice), StringEntry((txId + "_nft_owner"), toString(i.caller)), StringEntry((txId + "_nft_on_auction"), toBase58String(nftId)), StringEntry((txId + "_previous_bidder"), "none"), StringEntry((txId + "_highest_bid"), toString(startPrice)), StringEntry((txId + "_winner_of_nft"), "0"), StringEntry((txId + "_bidder_count"), "0"), StringEntry(((txId + "_nft_status_") + toBase58String(caller)), statusForNFT._1)]
320320 }
321321
322322
323323
324324 @Callable(i)
325325 func placeBid (auctionId,nftId,nft_owner,bid_price) = {
326326 let txId = toBase58String(i.transactionId)
327327 let caller = i.caller.bytes
328328 let assetId = fromBase58String(nftId)
329329 let currentBidPrice = i.payments[0].amount
330330 let getLastWinnerBidPrice = getStringValue(this, (auctionId + "_highest_bid"))
331331 let getPreviousBidderAddress = getString(this, (auctionId + "_previous_bidder"))
332332 let currentBidCount = getStringValue(this, (auctionId + "_bidder_count"))
333333 let getLastWinnerAddress = getStringValue(this, (auctionId + "_winner_of_nft"))
334- let checkNftAuctioned = getStringValue(((auctionId + "_nft_status_") + toBase58String(caller)))
334+ let checkNftAuctioned = getStringValue(this, ((auctionId + "_nft_status_") + toBase58String(caller)))
335335 if ((i.payments[0].assetId != unit))
336336 then throw("Pay in waves")
337337 else if ((checkNftAuctioned != "OPEN"))
338338 then throw("Not open for auction")
339339 else if ((parseIntValue(getLastWinnerBidPrice) > currentBidPrice))
340340 then throw("Bid is less then starting/highest Bid")
341341 else [StringEntry((auctionId + "_highest_bid"), toString(currentBidPrice)), StringEntry((auctionId + "_winner"), toBase58String(i.caller.bytes)), StringEntry((auctionId + "_bidder_count"), toString((parseIntValue(currentBidCount) + 1))), StringEntry(((((auctionId + "_nft_id_") + toBase58String(assetId)) + "_") + toBase58String(caller)), toBase58String(assetId)), StringEntry(((((auctionId + "_nft_owner_") + toBase58String(assetId)) + "_") + toBase58String(caller)), 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)) + "_") + toBase58String(caller)), toBase58String(assetId)), StringEntry(((((((txId + "_") + auctionId) + "_nft_owner_") + toBase58String(assetId)) + "_") + toBase58String(caller)), nft_owner), StringEntry((txId + "_bid_for_nft_by"), toBase58String(caller)), StringEntry((txId + "_bid_price_place"), toString(bid_price)), StringEntry((txId + "_previous_bid_amount_refund_to"), getLastWinnerAddress), ScriptTransfer(Address(fromBase58String(getLastWinnerAddress)), parseIntValue(getLastWinnerBidPrice), unit)]
342342 }
343343
344344
345345
346346 @Callable(i)
347347 func acceptBidOffer (nftId,accepted_address,bid_amount_from_user) = {
348348 let caller = i.caller.bytes
349349 let assetId = fromBase58String(nftId)
350350 let acceptedAddressOfBidder = fromBase58String(accepted_address)
351351 [ScriptTransfer(Address(i.caller.bytes), bid_amount_from_user, unit), ScriptTransfer(Address(acceptedAddressOfBidder), 1, assetId), StringEntry(((toBase58String(assetId) + "_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((((toBase58String(assetId) + separator) + "nft_status_") + toBase58String(caller)))]
352352 }
353353
354354
355355
356356 @Callable(i)
357357 func testBid (data) = [StringEntry("bid", data)]
358358
359359

github/deemru/w8io/026f985 
59.90 ms