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