tx · 45u5akEV3WvtY4bGcwct68v4AA7PT5yh3v1RhiR5Qfrg

3N9cKCHp6ZLMgz7rRgF8Q8DEt8zbtd1Ht7F:  -0.01000000 Waves

2022.12.20 08:26 [2368192] smart account 3N9cKCHp6ZLMgz7rRgF8Q8DEt8zbtd1Ht7F > SELF 0.00000000 Waves

{ "type": 13, "id": "45u5akEV3WvtY4bGcwct68v4AA7PT5yh3v1RhiR5Qfrg", "fee": 1000000, "feeAssetId": null, "timestamp": 1671514143233, "version": 2, "chainId": 84, "sender": "3N9cKCHp6ZLMgz7rRgF8Q8DEt8zbtd1Ht7F", "senderPublicKey": "3V22YUj3GF4AeBxdWx8rgGdG4groE4W6P2s4sAkshe7R", "proofs": [ "3mMEsUjwgTdJhL9SwBtBVQwunSMFLiWCUyEGewzE5EPBnEVqQ1tuh2vYhxJjeh63gTcD6eBpCKGPFQmgau5v7wAg" ], "script": "base64:BgIECAISAAABAWkBBXRva2VuAAQFYXNzZXQJAMIIBQIEc2h1YgIZVGhpcyBpcyBhbiBvcmRpbmFyeSB0b2tlbgDAhD0AAgYEB2Fzc2V0SWQJALgIAQUFYXNzZXQJAMwIAgUFYXNzZXQFA25pbAECdHgBBnZlcmlmeQAJAPQDAwgFAnR4CWJvZHlCeXRlcwkAkQMCCAUCdHgGcHJvb2ZzAAAIBQJ0eA9zZW5kZXJQdWJsaWNLZXlfTgMu", "height": 2368192, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 61LDLW2AvDNAxnGkAHnA7X2Viq9VFhbecnbeoRduCLbx Next: 7BNDUAVheRTEfxyLzxyNbqUHwpNGjnwAi7DsbXZfqGSd Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
4-let separator = "_"
5-
6-let kBuy = "buy"
7-
8-let kPrice = "price"
9-
10-let kSell = "sell"
11-
12-let maxAuctionDuration = 7
13-
14-let kBid = "bid"
15-
16-let statusForNFT = $Tuple4("OPEN", "CLOSED", "REWARDED", "CANCELED")
17-
18-let dAppAddress = base58'3MvjAaDYHpS4A5K4CV3kZMMEH9m9JdBSvbq'
19-
20-func isNft (assetId) = match assetInfo(assetId) {
21- case token: Asset =>
22- if (if ((token.decimals == 0))
23- then (token.quantity == 1)
24- else false)
25- then (token.reissuable == false)
26- else false
27- case _ =>
28- false
29-}
304
315
326 @Callable(i)
33-func createNft (nft_name,nft_owner,nft_dAppAddress,nft_type,nft_tags,nft_selling_price,nft_description,nft_onSell,nft_data) = {
34- let newToken = Issue(nft_name, nft_description, 1, 0, false)
35- let issueId = calculateAssetId(newToken)
36- let txId = i.transactionId
37-[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 token () = {
8+ let asset = Issue("shub", "This is an ordinary token", 1000000, 2, true)
9+ let assetId = calculateAssetId(asset)
10+[asset]
3811 }
3912
4013
41-
42-@Callable(i)
43-func sellNFT (price) = {
44- let txId = i.transactionId
45- let seller = i.caller.bytes
46- let $t017891874 = $Tuple2(value(i.payments[0].assetId), value(i.payments[0].amount))
47- let token0 = $t017891874._1
48- let amount0 = $t017891874._2
49- if (!(isNft(token0)))
50- then throw("Token is not NFT")
51- else [StringEntry(((kPrice + separator) + toBase58String(value(i.payments[0].assetId))), toString(price)), StringEntry(((toString(i.caller) + separator) + kSell), ((toBase58String(token0) + separator) + toString(amount0)))]
52- }
53-
54-
55-
56-@Callable(i)
57-func buyNFT (nftID,current_nft_owner) = {
58- let assetId = fromBase58String(nftID)
59- let amount = value(i.payments[0].amount)
60- let checkOwnerIsSame = match getString(this, (("nft_" + current_nft_owner) + "_owner")) {
61- case a: String =>
62- a
63- case _ =>
64- false
65- }
66- let price = getStringValue(((((kPrice + separator) + nftID) + "_") + current_nft_owner))
67- if ((i.payments[0].assetId != unit))
68- then throw("Pay in waves")
69- else if ((current_nft_owner == toString(i.caller)))
70- then throw("current Owner of NFT not able to purchase")
71- else [ScriptTransfer(i.caller, 1, assetId), ScriptTransfer(Address(fromBase58String(current_nft_owner)), amount, unit), StringEntry(((toString(i.caller) + separator) + kBuy), ((nftID + separator) + toString(amount))), DeleteEntry((("nft_" + current_nft_owner) + "_owner")), StringEntry((("nft_" + current_nft_owner) + "_owner"), toString(i.caller)), StringEntry(((nftID + separator) + "_owner"), toString(i.caller))]
72- }
73-
14+@Verifier(tx)
15+func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
7416

github/deemru/w8io/026f985 
24.81 ms