tx · 6mnRgonEJA2maD1RGoHNhmaDfjKq64eA3qMy2KQN16LF 3NBYw8rxLmTvyEdsvaYor8nHG6GJ4NjB2Aw: -0.01000000 Waves 2023.01.24 10:07 [2418722] smart account 3NBYw8rxLmTvyEdsvaYor8nHG6GJ4NjB2Aw > SELF 0.00000000 Waves
{ "type": 13, "id": "6mnRgonEJA2maD1RGoHNhmaDfjKq64eA3qMy2KQN16LF", "fee": 1000000, "feeAssetId": null, "timestamp": 1674544193693, "version": 2, "chainId": 84, "sender": "3NBYw8rxLmTvyEdsvaYor8nHG6GJ4NjB2Aw", "senderPublicKey": "4NDsd3dGKXuKLCoSbYvcWCX276K9ShP75cs9HTBMLJEN", "proofs": [ "2WNhErYDTH9JTUBcQzB9mbNz6Ci9F9KAXvDNTm66EXUpvgSv3E3v5A5iCdQSAtYVyy5duowbKd1JXL5REFPQ1QvW" ], "script": "base64:BgIaCAISCwoJCAgICAgBCAgIEgMKAQgSBAoCCAgLAAlzZXBhcmF0b3ICAV8ABGtCdXkCA2J1eQAGa1ByaWNlAgVwcmljZQAFa1NlbGwCBHNlbGwABXRlYW1zASCFY5Wj84iOsN4MF44ITr+aP5K7Jts66HaOFtwUIipIfgAFd2F2ZXMBAAASbWF4QXVjdGlvbkR1cmF0aW9uAAcABGtCaWQCA2JpZAAMc3RhdHVzRm9yTkZUCQCWCgQCBE9QRU4CBkNMT1NFRAIIUkVXQVJERUQCCENBTkNFTEVEAAtkQXBwQWRkcmVzcwEaAVRKuE9s3sLak+30julKNvjVT3+V1VVbXaABBWlzTmZ0AQdhc3NldElkBAckbWF0Y2gwCQDsBwEFB2Fzc2V0SWQDCQABAgUHJG1hdGNoMAIFQXNzZXQEBXRva2VuBQckbWF0Y2gwAwMDAwkAAAIIBQV0b2tlbghkZWNpbWFscwAACQAAAggFBXRva2VuCHF1YW50aXR5AAEHCQAAAggFBXRva2VuCnJlaXNzdWFibGUHBwkAAAIFB2Fzc2V0SWQFBXdhdmVzBwkAAAIFB2Fzc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BQFpBmNhbGxlcgUDbmlsAPO1t/A=", "height": 2418722, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 41V93bY1KKwQ81XEb1wDAhorkMNVi6uMSUuWgP6FWfVQ Next: FAVcedwrpXYYeadgbKVdHyX1B7xuvHoxCwK5qetrFuML Diff:
Old | New | Differences | |
---|---|---|---|
73 | 73 | let token0 = $t026372722._1 | |
74 | 74 | let amount0 = $t026372722._2 | |
75 | 75 | let price = getStringValue(((((kPrice + separator) + nftID) + "_") + current_nft_owner)) | |
76 | - | if ((i.payments[0].assetId != | |
76 | + | if ((i.payments[0].assetId != teams)) | |
77 | 77 | then throw("Pay in teams") | |
78 | 78 | else if ((current_nft_owner == toString(i.caller))) | |
79 | 79 | then throw("current Owner of NFT not able to purchase") |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let separator = "_" | |
5 | 5 | ||
6 | 6 | let kBuy = "buy" | |
7 | 7 | ||
8 | 8 | let kPrice = "price" | |
9 | 9 | ||
10 | 10 | let kSell = "sell" | |
11 | 11 | ||
12 | 12 | let teams = base58'9yhJDfWjPpv6tFjWRD1AJyBQwausJf2ZdxzLn86Uknnq' | |
13 | 13 | ||
14 | 14 | let waves = base58'' | |
15 | 15 | ||
16 | 16 | let maxAuctionDuration = 7 | |
17 | 17 | ||
18 | 18 | let kBid = "bid" | |
19 | 19 | ||
20 | 20 | let statusForNFT = $Tuple4("OPEN", "CLOSED", "REWARDED", "CANCELED") | |
21 | 21 | ||
22 | 22 | let dAppAddress = base58'3MvjAaDYHpS4A5K4CV3kZMMEH9m9JdBSvbq' | |
23 | 23 | ||
24 | 24 | func isNft (assetId) = match assetInfo(assetId) { | |
25 | 25 | case token: Asset => | |
26 | 26 | if (if (if (if ((token.decimals == 0)) | |
27 | 27 | then (token.quantity == 1) | |
28 | 28 | else false) | |
29 | 29 | then (token.reissuable == false) | |
30 | 30 | else false) | |
31 | 31 | then (assetId == waves) | |
32 | 32 | else false) | |
33 | 33 | then (assetId == teams) | |
34 | 34 | else false | |
35 | 35 | case _ => | |
36 | 36 | false | |
37 | 37 | } | |
38 | 38 | ||
39 | 39 | ||
40 | 40 | @Callable(i) | |
41 | 41 | func createNft (nft_name,nft_owner,nft_dAppAddress,nft_type,nft_tags,nft_selling_price,nft_description,nft_onSell,nft_data) = { | |
42 | 42 | let newToken = Issue(nft_name, nft_description, 1, 0, false) | |
43 | 43 | let issueId = calculateAssetId(newToken) | |
44 | 44 | let txId = i.transactionId | |
45 | 45 | [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))] | |
46 | 46 | } | |
47 | 47 | ||
48 | 48 | ||
49 | 49 | ||
50 | 50 | @Callable(i) | |
51 | 51 | func sellNFT (price) = { | |
52 | 52 | let txId = i.transactionId | |
53 | 53 | let seller = i.caller.bytes | |
54 | 54 | let $t019172072 = $Tuple2(value(i.payments[0].assetId), value(i.payments[0].amount)) | |
55 | 55 | let token0 = $t019172072._1 | |
56 | 56 | let amount0 = $t019172072._2 | |
57 | 57 | [StringEntry(((kPrice + separator) + toBase58String(value(i.payments[0].assetId))), price), StringEntry(((toString(i.caller) + separator) + kSell), ((toBase58String(token0) + separator) + toString(amount0)))] | |
58 | 58 | } | |
59 | 59 | ||
60 | 60 | ||
61 | 61 | ||
62 | 62 | @Callable(i) | |
63 | 63 | func buyNFT (nftID,current_nft_owner) = { | |
64 | 64 | let assetId = fromBase58String(nftID) | |
65 | 65 | let amount = value(i.payments[0].amount) | |
66 | 66 | let checkOwnerIsSame = match getString(this, (("nft_" + current_nft_owner) + "_owner")) { | |
67 | 67 | case a: String => | |
68 | 68 | a | |
69 | 69 | case _ => | |
70 | 70 | false | |
71 | 71 | } | |
72 | 72 | let $t026372722 = $Tuple2(value(i.payments[0].assetId), value(i.payments[0].amount)) | |
73 | 73 | let token0 = $t026372722._1 | |
74 | 74 | let amount0 = $t026372722._2 | |
75 | 75 | let price = getStringValue(((((kPrice + separator) + nftID) + "_") + current_nft_owner)) | |
76 | - | if ((i.payments[0].assetId != | |
76 | + | if ((i.payments[0].assetId != teams)) | |
77 | 77 | then throw("Pay in teams") | |
78 | 78 | else if ((current_nft_owner == toString(i.caller))) | |
79 | 79 | then throw("current Owner of NFT not able to purchase") | |
80 | 80 | else [ScriptTransfer(i.caller, 1, assetId), ScriptTransfer(Address(fromBase58String(current_nft_owner)), amount, teams), 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))] | |
81 | 81 | } | |
82 | 82 | ||
83 | 83 |
github/deemru/w8io/026f985 39.62 ms ◑