tx · Gz5FcdMRpD9CDYA2CmSHfwcKrbgrygyoAd5ggajE6rGX 3NBYw8rxLmTvyEdsvaYor8nHG6GJ4NjB2Aw: -0.01000000 Waves 2023.01.24 12:25 [2418856] smart account 3NBYw8rxLmTvyEdsvaYor8nHG6GJ4NjB2Aw > SELF 0.00000000 Waves
{ "type": 13, "id": "Gz5FcdMRpD9CDYA2CmSHfwcKrbgrygyoAd5ggajE6rGX", "fee": 1000000, "feeAssetId": null, "timestamp": 1674552447483, "version": 2, "chainId": 84, "sender": "3NBYw8rxLmTvyEdsvaYor8nHG6GJ4NjB2Aw", "senderPublicKey": "4NDsd3dGKXuKLCoSbYvcWCX276K9ShP75cs9HTBMLJEN", "proofs": [ "5MMwmUUbCcUWPgovhp5ErZ89j4fg3ZMvSnECKqnXKgCRNFJekWRDs8511BkNXpQkVjvhN79km2jxTTn1onJC64N5" ], "script": "base64:BgIaCAISCwoJCAgICAgBCAgIEgMKAQgSBAoCCAgLAAlzZXBhcmF0b3ICAV8ABGtCdXkCA2J1eQAGa1ByaWNlAgVwcmljZQAFa1NlbGwCBHNlbGwABXRlYW1zASCFY5Wj84iOsN4MF44ITr+aP5K7Jts66HaOFtwUIipIfgAFd2F2ZXMBAAASbWF4QXVjdGlvbkR1cmF0aW9uAAcABGtCaWQCA2JpZAAMc3RhdHVzRm9yTkZUCQCWCgQCBE9QRU4CBkNMT1NFRAIIUkVXQVJERUQCCENBTkNFTEVEAAtkQXBwQWRkcmVzcwEaAVRKuE9s3sLak+30julKNvjVT3+V1VVbXaABBWlzTmZ0AQdhc3NldElkBAckbWF0Y2gwCQDsBwEFB2Fzc2V0SWQDCQABAgUHJG1hdGNoMAIFQXNzZXQEBXRva2VuBQckbWF0Y2gwAwMDAwkAAAIIBQV0b2tlbghkZWNpbWFscwAACQAAAggFBXRva2VuCHF1YW50aXR5AAEHCQAAAggFBXRva2VuCnJlaXNzdWFibGUHBwkAAAIFB2Fzc2V0SWQFBXdhdmVzBwkAAAIFB2Fzc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bmVyAgZfb3duZXIJAKUIAQgFAWkGY2FsbGVyCQDMCAIJAQtTdHJpbmdFbnRyeQIJAKwCAgkArAICBQVuZnRJRAUJc2VwYXJhdG9yAgZfb3duZXIJAKUIAQgFAWkGY2FsbGVyBQNuaWwJAMwIAgkBDlNjcmlwdFRyYW5zZmVyAwgFAWkGY2FsbGVyAAEFB2Fzc2V0SWQJAMwIAgkBDlNjcmlwdFRyYW5zZmVyAwkBB0FkZHJlc3MBCQDZBAEFEWN1cnJlbnRfbmZ0X293bmVyBQZhbW91bnQFBHVuaXQJAMwIAgkBC1N0cmluZ0VudHJ5AgkArAICCQCsAgIJAKUIAQgFAWkGY2FsbGVyBQlzZXBhcmF0b3IFBGtCdXkJAKwCAgkArAICBQVuZnRJRAUJc2VwYXJhdG9yCQCkAwEFBmFtb3VudAkAzAgCCQELRGVsZXRlRW50cnkBCQCsAgIJAKwCAgIEbmZ0XwURY3VycmVudF9uZnRfb3duZXICBl9vd25lcgkAzAgCCQELU3RyaW5nRW50cnkCCQCsAgIJAKwCAgIEbmZ0XwURY3VycmVudF9uZnRfb3duZXICBl9vd25lcgkApQgBCAUBaQZjYWxsZXIJAMwIAgkBC1N0cmluZ0VudHJ5AgkArAICCQCsAgIFBW5mdElEBQlzZXBhcmF0b3ICBl9vd25lcgkApQgBCAUBaQZjYWxsZXIFA25pbAD+gCsY", "height": 2418856, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: HqL1nHJnT7RBvXirJARB2VVKR13ebnF8eLHSa51yuhZE Next: AJpmrTsqofbYiaHZYE7XZSi3gwjpNdkJERer5q4kaKd3 Diff:
Old | New | Differences | |
---|---|---|---|
57 | 57 | let D = $Tuple2(value(o.payments[0].assetId), value(o.payments[0].amount)) | |
58 | 58 | let E = D._1 | |
59 | 59 | let F = D._2 | |
60 | - | if ( | |
60 | + | if (k(E)) | |
61 | 61 | then throw("Token is not NFT") | |
62 | 62 | else [StringEntry(((c + a) + toBase58String(value(o.payments[0].assetId))), B), StringEntry(((toString(o.caller) + a) + d), ((toBase58String(E) + a) + toString(F)))] | |
63 | 63 | } |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let a = "_" | |
5 | 5 | ||
6 | 6 | let b = "buy" | |
7 | 7 | ||
8 | 8 | let c = "price" | |
9 | 9 | ||
10 | 10 | let d = "sell" | |
11 | 11 | ||
12 | 12 | let e = base58'9yhJDfWjPpv6tFjWRD1AJyBQwausJf2ZdxzLn86Uknnq' | |
13 | 13 | ||
14 | 14 | let f = base58'' | |
15 | 15 | ||
16 | 16 | let g = 7 | |
17 | 17 | ||
18 | 18 | let h = "bid" | |
19 | 19 | ||
20 | 20 | let i = $Tuple4("OPEN", "CLOSED", "REWARDED", "CANCELED") | |
21 | 21 | ||
22 | 22 | let j = base58'3MvjAaDYHpS4A5K4CV3kZMMEH9m9JdBSvbq' | |
23 | 23 | ||
24 | 24 | func k (l) = { | |
25 | 25 | let m = assetInfo(l) | |
26 | 26 | if ($isInstanceOf(m, "Asset")) | |
27 | 27 | then { | |
28 | 28 | let n = m | |
29 | 29 | if (if (if (if ((n.decimals == 0)) | |
30 | 30 | then (n.quantity == 1) | |
31 | 31 | else false) | |
32 | 32 | then (n.reissuable == false) | |
33 | 33 | else false) | |
34 | 34 | then (l == f) | |
35 | 35 | else false) | |
36 | 36 | then (l == e) | |
37 | 37 | else false | |
38 | 38 | } | |
39 | 39 | else false | |
40 | 40 | } | |
41 | 41 | ||
42 | 42 | ||
43 | 43 | @Callable(o) | |
44 | 44 | func createNft (p,q,r,s,t,u,v,w,x) = { | |
45 | 45 | let y = Issue(p, v, 1, 0, false) | |
46 | 46 | let z = calculateAssetId(y) | |
47 | 47 | let A = o.transactionId | |
48 | 48 | [y, ScriptTransfer(o.caller, 1, z), StringEntry(((toBase58String(z) + a) + "Owner"), toString(o.caller)), StringEntry(((toBase58String(z) + a) + "nft_type"), s), StringEntry(((toBase58String(z) + a) + "nft_tags"), t), StringEntry(((toBase58String(z) + a) + "nft_dAppAddress"), r), IntegerEntry(((toBase58String(z) + a) + "nft_selling_price"), u), StringEntry(((toBase58String(z) + a) + "nft_onSell"), w), StringEntry(((toBase58String(z) + a) + "nft_data"), x), StringEntry(((toBase58String(A) + a) + "issue_nft"), toBase58String(z))] | |
49 | 49 | } | |
50 | 50 | ||
51 | 51 | ||
52 | 52 | ||
53 | 53 | @Callable(o) | |
54 | 54 | func sellNFT (B) = { | |
55 | 55 | let A = o.transactionId | |
56 | 56 | let C = o.caller.bytes | |
57 | 57 | let D = $Tuple2(value(o.payments[0].assetId), value(o.payments[0].amount)) | |
58 | 58 | let E = D._1 | |
59 | 59 | let F = D._2 | |
60 | - | if ( | |
60 | + | if (k(E)) | |
61 | 61 | then throw("Token is not NFT") | |
62 | 62 | else [StringEntry(((c + a) + toBase58String(value(o.payments[0].assetId))), B), StringEntry(((toString(o.caller) + a) + d), ((toBase58String(E) + a) + toString(F)))] | |
63 | 63 | } | |
64 | 64 | ||
65 | 65 | ||
66 | 66 | ||
67 | 67 | @Callable(o) | |
68 | 68 | func buyNFT (G,H) = { | |
69 | 69 | let l = fromBase58String(G) | |
70 | 70 | let I = value(o.payments[0].amount) | |
71 | 71 | let J = { | |
72 | 72 | let m = getString(this, (("nft_" + H) + "_owner")) | |
73 | 73 | if ($isInstanceOf(m, "String")) | |
74 | 74 | then { | |
75 | 75 | let K = m | |
76 | 76 | K | |
77 | 77 | } | |
78 | 78 | else false | |
79 | 79 | } | |
80 | 80 | let L = $Tuple2(value(o.payments[0].assetId), value(o.payments[0].amount)) | |
81 | 81 | let E = L._1 | |
82 | 82 | let F = L._2 | |
83 | 83 | let B = getStringValue(((((c + a) + G) + "_") + H)) | |
84 | 84 | if ((H == toString(o.caller))) | |
85 | 85 | then throw("current Owner of NFT not able to purchase") | |
86 | 86 | else if (!(k(E))) | |
87 | 87 | then throw("Token is not NFT") | |
88 | 88 | else if ((o.payments[0].assetId == e)) | |
89 | 89 | then [ScriptTransfer(o.caller, 1, l), ScriptTransfer(Address(fromBase58String(H)), I, e), StringEntry(((toString(o.caller) + a) + b), ((G + a) + toString(I))), DeleteEntry((("nft_" + H) + "_owner")), StringEntry((("nft_" + H) + "_owner"), toString(o.caller)), StringEntry(((G + a) + "_owner"), toString(o.caller))] | |
90 | 90 | else [ScriptTransfer(o.caller, 1, l), ScriptTransfer(Address(fromBase58String(H)), I, unit), StringEntry(((toString(o.caller) + a) + b), ((G + a) + toString(I))), DeleteEntry((("nft_" + H) + "_owner")), StringEntry((("nft_" + H) + "_owner"), toString(o.caller)), StringEntry(((G + a) + "_owner"), toString(o.caller))] | |
91 | 91 | } | |
92 | 92 | ||
93 | 93 |
github/deemru/w8io/026f985 48.85 ms ◑