tx · FAVcedwrpXYYeadgbKVdHyX1B7xuvHoxCwK5qetrFuML 3NBYw8rxLmTvyEdsvaYor8nHG6GJ4NjB2Aw: -0.01000000 Waves 2023.01.24 11:59 [2418832] smart account 3NBYw8rxLmTvyEdsvaYor8nHG6GJ4NjB2Aw > SELF 0.00000000 Waves
{ "type": 13, "id": "FAVcedwrpXYYeadgbKVdHyX1B7xuvHoxCwK5qetrFuML", "fee": 1000000, "feeAssetId": null, "timestamp": 1674550940803, "version": 2, "chainId": 84, "sender": "3NBYw8rxLmTvyEdsvaYor8nHG6GJ4NjB2Aw", "senderPublicKey": "4NDsd3dGKXuKLCoSbYvcWCX276K9ShP75cs9HTBMLJEN", "proofs": [ "3crXgExyUB7shLJpdgdZdQv9yxcAssTAuh6jeZgRABGTNpXS8LUNFy42QtQgWpgJZsBWnmTah9V7Bxx4yTKkLA4s" ], "script": "base64:BgIaCAISCwoJCAgICAgBCAgIEgMKAQgSBAoCCAgLAAlzZXBhcmF0b3ICAV8ABGtCdXkCA2J1eQAGa1ByaWNlAgVwcmljZQAFa1NlbGwCBHNlbGwABXRlYW1zASCFY5Wj84iOsN4MF44ITr+aP5K7Jts66HaOFtwUIipIfgAFd2F2ZXMBAAASbWF4QXVjdGlvbkR1cmF0aW9uAAcABGtCaWQCA2JpZAAMc3RhdHVzRm9yTkZUCQCWCgQCBE9QRU4CBkNMT1NFRAIIUkVXQVJERUQCCENBTkNFTEVEAAtkQXBwQWRkcmVzcwEaAVRKuE9s3sLak+30julKNvjVT3+V1VVbXaABBWlzTmZ0AQdhc3NldElkBAckbWF0Y2gwCQDsBwEFB2Fzc2V0SWQDCQABAgUHJG1hdGNoMAIFQXNzZXQEBXRva2VuBQckbWF0Y2gwAwMDAwkAAAIIBQV0b2tlbghkZWNpbWFscwAACQAAAggFBXRva2VuCHF1YW50aXR5AAEHCQAAAggFBXRva2VuCnJlaXNzdWFibGUHBwkAAAIFB2Fzc2V0SWQFBXdhdmVzBwkAAAIFB2Fzc2V0S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wIAgkBC1N0cmluZ0VudHJ5AgkArAICCQCsAgIFBW5mdElEBQlzZXBhcmF0b3ICBl9vd25lcgkApQgBCAUBaQZjYWxsZXIFA25pbAkAzAgCCQEOU2NyaXB0VHJhbnNmZXIDCAUBaQZjYWxsZXIAAQUHYXNzZXRJZAkAzAgCCQEOU2NyaXB0VHJhbnNmZXIDCQEHQWRkcmVzcwEJANkEAQURY3VycmVudF9uZnRfb3duZXIFBmFtb3VudAUEdW5pdAkAzAgCCQELU3RyaW5nRW50cnkCCQCsAgIJAKwCAgkApQgBCAUBaQZjYWxsZXIFCXNlcGFyYXRvcgUEa0J1eQkArAICCQCsAgIFBW5mdElEBQlzZXBhcmF0b3IJAKQDAQUGYW1vdW50CQDMCAIJAQtEZWxldGVFbnRyeQEJAKwCAgkArAICAgRuZnRfBRFjdXJyZW50X25mdF9vd25lcgIGX293bmVyCQDMCAIJAQtTdHJpbmdFbnRyeQIJAKwCAgkArAICAgRuZnRfBRFjdXJyZW50X25mdF9vd25lcgIGX293bmVyCQClCAEIBQFpBmNhbGxlcgkAzAgCCQELU3RyaW5nRW50cnkCCQCsAgIJAKwCAgUFbmZ0SUQFCXNlcGFyYXRvcgIGX293bmVyCQClCAEIBQFpBmNhbGxlcgUDbmlsAPOaS1c=", "height": 2418832, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 6mnRgonEJA2maD1RGoHNhmaDfjKq64eA3qMy2KQN16LF Next: HqL1nHJnT7RBvXirJARB2VVKR13ebnF8eLHSa51yuhZE 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 | - | [StringEntry(((c + a) + toBase58String(value(o.payments[0].assetId))), B), StringEntry(((toString(o.caller) + a) + d), ((toBase58String(E) + a) + toString(F)))] | |
60 | + | if (!(k(E))) | |
61 | + | then throw("Token is not NFT") | |
62 | + | else [StringEntry(((c + a) + toBase58String(value(o.payments[0].assetId))), B), StringEntry(((toString(o.caller) + a) + d), ((toBase58String(E) + a) + toString(F)))] | |
61 | 63 | } | |
62 | 64 | ||
63 | 65 | ||
79 | 81 | let E = L._1 | |
80 | 82 | let F = L._2 | |
81 | 83 | let B = getStringValue(((((c + a) + G) + "_") + H)) | |
82 | - | if ((o.payments[0].assetId != e)) | |
83 | - | then throw("Pay in teams") | |
84 | - | else if ((H == toString(o.caller))) | |
85 | - | then throw("current Owner of NFT not able to purchase") | |
86 | - | else [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))] | |
84 | + | if ((H == toString(o.caller))) | |
85 | + | then throw("current Owner of NFT not able to purchase") | |
86 | + | else if (!(k(E))) | |
87 | + | then throw("Token is not NFT") | |
88 | + | else if ((o.payments[0].assetId == e)) | |
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 | + | 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))] | |
87 | 91 | } | |
88 | 92 | ||
89 | 93 |
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 | - | [StringEntry(((c + a) + toBase58String(value(o.payments[0].assetId))), B), StringEntry(((toString(o.caller) + a) + d), ((toBase58String(E) + a) + toString(F)))] | |
60 | + | if (!(k(E))) | |
61 | + | then throw("Token is not NFT") | |
62 | + | else [StringEntry(((c + a) + toBase58String(value(o.payments[0].assetId))), B), StringEntry(((toString(o.caller) + a) + d), ((toBase58String(E) + a) + toString(F)))] | |
61 | 63 | } | |
62 | 64 | ||
63 | 65 | ||
64 | 66 | ||
65 | 67 | @Callable(o) | |
66 | 68 | func buyNFT (G,H) = { | |
67 | 69 | let l = fromBase58String(G) | |
68 | 70 | let I = value(o.payments[0].amount) | |
69 | 71 | let J = { | |
70 | 72 | let m = getString(this, (("nft_" + H) + "_owner")) | |
71 | 73 | if ($isInstanceOf(m, "String")) | |
72 | 74 | then { | |
73 | 75 | let K = m | |
74 | 76 | K | |
75 | 77 | } | |
76 | 78 | else false | |
77 | 79 | } | |
78 | 80 | let L = $Tuple2(value(o.payments[0].assetId), value(o.payments[0].amount)) | |
79 | 81 | let E = L._1 | |
80 | 82 | let F = L._2 | |
81 | 83 | let B = getStringValue(((((c + a) + G) + "_") + H)) | |
82 | - | if ((o.payments[0].assetId != e)) | |
83 | - | then throw("Pay in teams") | |
84 | - | else if ((H == toString(o.caller))) | |
85 | - | then throw("current Owner of NFT not able to purchase") | |
86 | - | else [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))] | |
84 | + | if ((H == toString(o.caller))) | |
85 | + | then throw("current Owner of NFT not able to purchase") | |
86 | + | else if (!(k(E))) | |
87 | + | then throw("Token is not NFT") | |
88 | + | else if ((o.payments[0].assetId == e)) | |
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 | + | 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))] | |
87 | 91 | } | |
88 | 92 | ||
89 | 93 |
github/deemru/w8io/169f3d6 27.33 ms ◑