tx · DmnC7ytyrRujzWAdxg6HrohsvQcew2RCbe5SHshg95oa

3NBYw8rxLmTvyEdsvaYor8nHG6GJ4NjB2Aw:  -0.01000000 Waves

2023.01.24 09:25 [2418681] smart account 3NBYw8rxLmTvyEdsvaYor8nHG6GJ4NjB2Aw > SELF 0.00000000 Waves

{ "type": 13, "id": "DmnC7ytyrRujzWAdxg6HrohsvQcew2RCbe5SHshg95oa", "fee": 1000000, "feeAssetId": null, "timestamp": 1674541627693, "version": 2, "chainId": 84, "sender": "3NBYw8rxLmTvyEdsvaYor8nHG6GJ4NjB2Aw", "senderPublicKey": "4NDsd3dGKXuKLCoSbYvcWCX276K9ShP75cs9HTBMLJEN", "proofs": [ "3bGAsgxnuCDRmHNrBE3yJscyLcb2ZUiqaxmJ2HhR4qFR8vi8SaAcQdhAfXhtuyBmoLA5pzoJRPyREK6FHtFhbtm" ], "script": "base64:BgIaCAISCwoJCAgICAgBCAgIEgMKAQgSBAoCCAgLAAlzZXBhcmF0b3ICAV8ABGtCdXkCA2J1eQAGa1ByaWNlAgVwcmljZQAFa1NlbGwCBHNlbGwABXRlYW1zASCFY5Wj84iOsN4MF44ITr+aP5K7Jts66HaOFtwUIipIfgAFd2F2ZXMBAAASbWF4QXVjdGlvbkR1cmF0aW9uAAcABGtCaWQCA2JpZAAMc3RhdHVzRm9yTkZUCQCWCgQCBE9QRU4CBkNMT1NFRAIIUkVXQVJERUQCCENBTkNFTEVEAAtkQXBwQWRkcmVzcwEaAVRKuE9s3sLak+30julKNvjVT3+V1VVbXaABBWlzTmZ0AQdhc3NldElkBAckbWF0Y2gwCQDsBwEFB2Fzc2V0SWQDCQABAgUHJG1hdGNoMAIFQXNzZXQEBXRva2VuBQckbWF0Y2gwAwMDAwkAAAIIBQV0b2tlbghkZWNpbWFscwAACQAAAggFBXRva2VuCHF1YW50aXR5AAEHCQAAAggFBXRva2VuCnJlaXNzdWFibGUHBwkAAAIFB2Fzc2V0SWQFBXdhdmVzBwkAAAIFB2Fzc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mVyCQDMCAIJAQtTdHJpbmdFbnRyeQIJAKwCAgkArAICAgRuZnRfBRFjdXJyZW50X25mdF9vd25lcgIGX293bmVyCQClCAEIBQFpBmNhbGxlcgkAzAgCCQELU3RyaW5nRW50cnkCCQCsAgIJAKwCAgUFbmZ0SUQFCXNlcGFyYXRvcgIGX293bmVyCQClCAEIBQFpBmNhbGxlcgUDbmlsAOEmsQw=", "height": 2418681, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: EMPJnMZG1wwmZLG289eNz5iE74Gjb56gbALBG4LeVs9s Next: EGWuSgKsFZpDKNgBf7B2U7k8QE7P1vU3qBtDt2yfD3Hs Diff:
OldNewDifferences
99
1010 let kSell = "sell"
1111
12+let teams = base58'9yhJDfWjPpv6tFjWRD1AJyBQwausJf2ZdxzLn86Uknnq'
13+
14+let waves = base58''
15+
1216 let maxAuctionDuration = 7
1317
1418 let kBid = "bid"
1923
2024 func isNft (assetId) = match assetInfo(assetId) {
2125 case token: Asset =>
22- if (if ((token.decimals == 0))
26+ if (if (if (if ((token.decimals == 0))
2327 then (token.quantity == 1)
2428 else false)
2529 then (token.reissuable == false)
30+ else false)
31+ then (assetId == waves)
32+ else false)
33+ then (assetId == teams)
2634 else false
2735 case _ =>
2836 false
4351 func sellNFT (price) = {
4452 let txId = i.transactionId
4553 let seller = i.caller.bytes
46- let $t017921877 = $Tuple2(value(i.payments[0].assetId), value(i.payments[0].amount))
47- let token0 = $t017921877._1
48- let amount0 = $t017921877._2
54+ let $t019172002 = $Tuple2(value(i.payments[0].assetId), value(i.payments[0].amount))
55+ let token0 = $t019172002._1
56+ let amount0 = $t019172002._2
4957 if (!(isNft(token0)))
5058 then throw("Token is not NFT")
5159 else [StringEntry(((kPrice + separator) + toBase58String(value(i.payments[0].assetId))), price), StringEntry(((toString(i.caller) + separator) + kSell), ((toBase58String(token0) + separator) + toString(amount0)))]
6371 case _ =>
6472 false
6573 }
66- let $t025012586 = $Tuple2(value(i.payments[0].assetId), value(i.payments[0].amount))
67- let token0 = $t025012586._1
68- let amount0 = $t025012586._2
74+ let $t026262711 = $Tuple2(value(i.payments[0].assetId), value(i.payments[0].amount))
75+ let token0 = $t026262711._1
76+ let amount0 = $t026262711._2
6977 let price = getStringValue(((((kPrice + separator) + nftID) + "_") + current_nft_owner))
70- if ((i.payments[0].assetId != unit))
71- then throw("Pay in waves")
72- else if (!(isNft(token0)))
73- then throw("Token is not NFT")
74- else if ((current_nft_owner == toString(i.caller)))
75- then throw("current Owner of NFT not able to purchase")
76- 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))]
78+ if ((i.payments[0].assetId != teams))
79+ then throw("Pay in teams")
80+ else if ((i.payments[0].assetId != waves))
81+ then throw("Pay in waves")
82+ else if (!(isNft(token0)))
83+ then throw("Token is not NFT")
84+ else if ((current_nft_owner == toString(i.caller)))
85+ then throw("current Owner of NFT not able to purchase")
86+ 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))]
7787 }
7888
7989
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let separator = "_"
55
66 let kBuy = "buy"
77
88 let kPrice = "price"
99
1010 let kSell = "sell"
1111
12+let teams = base58'9yhJDfWjPpv6tFjWRD1AJyBQwausJf2ZdxzLn86Uknnq'
13+
14+let waves = base58''
15+
1216 let maxAuctionDuration = 7
1317
1418 let kBid = "bid"
1519
1620 let statusForNFT = $Tuple4("OPEN", "CLOSED", "REWARDED", "CANCELED")
1721
1822 let dAppAddress = base58'3MvjAaDYHpS4A5K4CV3kZMMEH9m9JdBSvbq'
1923
2024 func isNft (assetId) = match assetInfo(assetId) {
2125 case token: Asset =>
22- if (if ((token.decimals == 0))
26+ if (if (if (if ((token.decimals == 0))
2327 then (token.quantity == 1)
2428 else false)
2529 then (token.reissuable == false)
30+ else false)
31+ then (assetId == waves)
32+ else false)
33+ then (assetId == teams)
2634 else false
2735 case _ =>
2836 false
2937 }
3038
3139
3240 @Callable(i)
3341 func createNft (nft_name,nft_owner,nft_dAppAddress,nft_type,nft_tags,nft_selling_price,nft_description,nft_onSell,nft_data) = {
3442 let newToken = Issue(nft_name, nft_description, 1, 0, false)
3543 let issueId = calculateAssetId(newToken)
3644 let txId = i.transactionId
3745 [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))]
3846 }
3947
4048
4149
4250 @Callable(i)
4351 func sellNFT (price) = {
4452 let txId = i.transactionId
4553 let seller = i.caller.bytes
46- let $t017921877 = $Tuple2(value(i.payments[0].assetId), value(i.payments[0].amount))
47- let token0 = $t017921877._1
48- let amount0 = $t017921877._2
54+ let $t019172002 = $Tuple2(value(i.payments[0].assetId), value(i.payments[0].amount))
55+ let token0 = $t019172002._1
56+ let amount0 = $t019172002._2
4957 if (!(isNft(token0)))
5058 then throw("Token is not NFT")
5159 else [StringEntry(((kPrice + separator) + toBase58String(value(i.payments[0].assetId))), price), StringEntry(((toString(i.caller) + separator) + kSell), ((toBase58String(token0) + separator) + toString(amount0)))]
5260 }
5361
5462
5563
5664 @Callable(i)
5765 func buyNFT (nftID,current_nft_owner) = {
5866 let assetId = fromBase58String(nftID)
5967 let amount = value(i.payments[0].amount)
6068 let checkOwnerIsSame = match getString(this, (("nft_" + current_nft_owner) + "_owner")) {
6169 case a: String =>
6270 a
6371 case _ =>
6472 false
6573 }
66- let $t025012586 = $Tuple2(value(i.payments[0].assetId), value(i.payments[0].amount))
67- let token0 = $t025012586._1
68- let amount0 = $t025012586._2
74+ let $t026262711 = $Tuple2(value(i.payments[0].assetId), value(i.payments[0].amount))
75+ let token0 = $t026262711._1
76+ let amount0 = $t026262711._2
6977 let price = getStringValue(((((kPrice + separator) + nftID) + "_") + current_nft_owner))
70- if ((i.payments[0].assetId != unit))
71- then throw("Pay in waves")
72- else if (!(isNft(token0)))
73- then throw("Token is not NFT")
74- else if ((current_nft_owner == toString(i.caller)))
75- then throw("current Owner of NFT not able to purchase")
76- 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))]
78+ if ((i.payments[0].assetId != teams))
79+ then throw("Pay in teams")
80+ else if ((i.payments[0].assetId != waves))
81+ then throw("Pay in waves")
82+ else if (!(isNft(token0)))
83+ then throw("Token is not NFT")
84+ else if ((current_nft_owner == toString(i.caller)))
85+ then throw("current Owner of NFT not able to purchase")
86+ 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))]
7787 }
7888
7989

github/deemru/w8io/169f3d6 
47.82 ms