tx · 3bT7fgxpTWUHzmU7GnjDgfzLMzBgD7yQ6VH66sZxvamE 3NBwZbvD45CscLGF78qTaDRBZ7mDBHt3Yib: -0.01400000 Waves 2022.06.02 11:43 [2078497] smart account 3NBwZbvD45CscLGF78qTaDRBZ7mDBHt3Yib > SELF 0.00000000 Waves
{ "type": 13, "id": "3bT7fgxpTWUHzmU7GnjDgfzLMzBgD7yQ6VH66sZxvamE", "fee": 1400000, "feeAssetId": null, "timestamp": 1654159422234, "version": 2, "chainId": 84, "sender": "3NBwZbvD45CscLGF78qTaDRBZ7mDBHt3Yib", "senderPublicKey": "3q3N8Kv49DbzNHyTB4A87UYz2DdquXCgP3GNCcD9Zj66", "proofs": [ "3m1JxCZpmGjYffzanT7BC1UAYX6paV9au5jNGaF49s1Cwu4X3CKHxNXP3pvXKbFoSertMVD7U9hXbKharaUigWHC" ], "script": "base64:AAIFAAAAAAAAACEIAhIFCgMICAgSBAoCCAgSBAoCCAgSBAoCCAgSBAoCBAgAAAAcAAAAAAtDT05GX0lOSVRfSwIAAAALY29uZmlnX2luaXQAAAAAC0NPTkZfQU1JTl9LAgAAAAxjb25maWdfYWRtaW4AAAAADUNPTkZfT1JBQ0xFX0sCAAAADWNvbmZpZ19vcmFjbGUAAAAAE0NPTkZfQVJUV09SS19EQVBQX0sCAAAAE2NvbmZpZ19hcnR3b3JrX2RhcHAAAAAADmRhcHBSdW5uaW5nS2V5AgAAABRjb25mX2RhcHBfaXNfcnVubmluZwAAAAARbWFpbnRlbmFuY2VNU0dLZXkCAAAAFGNvbmZfbWFpbnRlbmFuY2VfbXNnAAAAAAtkYXBwUnVubmluZwkBAAAAC3ZhbHVlT3JFbHNlAAAAAgkABBsAAAACBQAAAAR0aGlzBQAAAA5kYXBwUnVubmluZ0tleQYAAAAADm1haW50ZW5hbmNlTVNHCQEAAAALdmFsdWVPckVsc2UAAAACCQAEHQAAAAIFAAAABHRoaXMFAAAAEW1haW50ZW5hbmNlTVNHS2V5AgAAAAAAAAAADX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AAAAVuZnRJZAMJAQAAAAIhPQAAAAIFAAAACW5mdFN0YXR1cwUAAAANc3RhdHVzX0xPQ0tFRAkAAAIAAAABAgAAAA5ORlQgbm90IGxvY2tlZAkABEwAAAACCQEAAAALU3RyaW5nRW50cnkAAAACCQEAAAAMa2V5TkZUc3RhdHVzAAAAAQUAAAAFbmZ0SWQFAAAAD3N0YXR1c19VTkxPQ0tFRAkABEwAAAACCQEAAAAOU2NyaXB0VHJhbnNmZXIAAAADCQEAAAAHQWRkcmVzcwAAAAEJAAJZAAAAAQUAAAAJcmVjaXBpZW50AAAAAAAAAAABCQACWQAAAAEFAAAABW5mdElkBQAAAANuaWwJAAACAAAAAQIAAAALTm90IGFsbG93ZWQAAAABaQEAAAAKYXBwUnVubmluZwAAAAIAAAAGaXNMaXZlAAAAB21lc3NhZ2UDCQEAAAABIQAAAAEFAAAABmlzSW5pdAkAAAIAAAABAgAAAA5kQXBwIG5vdCByZWFkeQMJAQAAAAlvd25lck9ubHkAAAABBQAAAAFpCQAETAAAAAIJAQAAAAxCb29sZWFuRW50cnkAAAACBQAAAA5kYXBwUnVubmluZ0tleQUAAAAGaXNMaXZlCQAETAAAAAIJAQAAAAtTdHJpbmdFbnRyeQAAAAIFAAAAEW1haW50ZW5hbmNlTVNHS2V5BQAAAAdtZXNzYWdlBQAAAANuaWwJAAACAAAAAQIAAAAiWW91IGFyZSBub3QgYWxsb3dlZCB0byBjaGFuZ2UgdGhpcwAAAABKB06M", "height": 2078497, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 6AxGwZiYtYUPJHGrnr4ipykByvmedSvHP1uYc1bvh9Sx Next: 4vGT4SQzjoFjntjjMx4SFbSpTAV6C1RqXH8ePtJ1BYG6 Diff:
Old | New | Differences | |
---|---|---|---|
42 | 42 | func u (s) = valueOrElse(getBoolean(this, s), false) | |
43 | 43 | ||
44 | 44 | ||
45 | - | let v = valueOrElse(r(b), "") | |
45 | + | let v = value(addressFromString(valueOrElse(r(b), ""))) | |
46 | 46 | ||
47 | 47 | let w = value(addressFromString(r(d))) | |
48 | 48 | ||
82 | 82 | func K (E) = { | |
83 | 83 | let L = toString(addressFromPublicKey(E.callerPublicKey)) | |
84 | 84 | let C = toBase58String(E.transactionId) | |
85 | - | if (containsElement([v, toString(this)], L)) | |
85 | + | let M = if (J) | |
86 | + | then [v, toString(this)] | |
87 | + | else [toString(this)] | |
88 | + | if (containsElement(M, L)) | |
86 | 89 | then true | |
87 | 90 | else false | |
88 | 91 | } | |
89 | 92 | ||
90 | 93 | ||
91 | - | func | |
94 | + | func N (E) = if (!(g)) | |
92 | 95 | then throw(h) | |
93 | 96 | else $Tuple3(toBase58String(E.transactionId), toBase58String(E.caller.bytes), lastBlock.timestamp) | |
94 | 97 | ||
95 | 98 | ||
96 | 99 | @Callable(E) | |
97 | - | func init ( | |
98 | - | then [StringEntry(b, | |
100 | + | func init (O,x,w) = if (K(E)) | |
101 | + | then [StringEntry(b, O), StringEntry(c, x), StringEntry(d, w), BooleanEntry(a, true)] | |
99 | 102 | else throw("Not allowed") | |
100 | 103 | ||
101 | 104 | ||
102 | 105 | ||
103 | 106 | @Callable(E) | |
104 | - | func lock ( | |
107 | + | func lock (P,Q) = if (!(J)) | |
105 | 108 | then throw("dApp not ready") | |
106 | - | else if (!(containsElement(m, | |
109 | + | else if (!(containsElement(m, Q))) | |
107 | 110 | then throw("Network not supported") | |
108 | 111 | else { | |
109 | - | let | |
110 | - | let C = | |
111 | - | let L = | |
112 | - | let | |
113 | - | let | |
114 | - | let F = | |
115 | - | let G = | |
116 | - | let H = | |
117 | - | let I = | |
112 | + | let R = N(E) | |
113 | + | let C = R._1 | |
114 | + | let L = R._2 | |
115 | + | let S = R._3 | |
116 | + | let T = D(E) | |
117 | + | let F = T._1 | |
118 | + | let G = T._2 | |
119 | + | let H = T._3 | |
120 | + | let I = T._4 | |
118 | 121 | if ((G != 1)) | |
119 | 122 | then throw("No NFT attached") | |
120 | 123 | else { | |
123 | 126 | else false) | |
124 | 127 | then toBase58String(value(F.assetId)) | |
125 | 128 | else throw("Only SIGN Art NFT accepted.") | |
126 | - | let | |
127 | - | if (( | |
129 | + | let U = r(n(o)) | |
130 | + | if ((U == i)) | |
128 | 131 | then throw("NFT already locked") | |
129 | - | else [StringEntry(n(o), i), StringEntry(((p(o, C) + "_") + k), (((((((( | |
132 | + | else [StringEntry(n(o), i), StringEntry(((p(o, C) + "_") + k), ((((((((P + "_") + Q) + "_") + L) + "_") + C) + "_") + toString(S)))] | |
130 | 133 | } | |
131 | 134 | } | |
132 | 135 | ||
133 | 136 | ||
134 | 137 | ||
135 | 138 | @Callable(E) | |
136 | - | func processedLock (o, | |
139 | + | func processedLock (o,V) = if (!(J)) | |
137 | 140 | then throw("dApp not ready") | |
138 | 141 | else if (K(E)) | |
139 | 142 | then { | |
140 | - | let | |
141 | - | if (( | |
143 | + | let U = r(n(o)) | |
144 | + | if ((U != i)) | |
142 | 145 | then throw("NFT not locked") | |
143 | 146 | else { | |
144 | - | let | |
145 | - | let | |
146 | - | [DeleteEntry(((p(o, | |
147 | + | let W = r(p(o, V)) | |
148 | + | let X = ((p(o, V) + "_") + l) | |
149 | + | [DeleteEntry(((p(o, V) + "_") + k)), StringEntry(X, W)] | |
147 | 150 | } | |
148 | 151 | } | |
149 | 152 | else throw("Not allowed") | |
151 | 154 | ||
152 | 155 | ||
153 | 156 | @Callable(E) | |
154 | - | func unlock ( | |
157 | + | func unlock (P,o) = if (!(J)) | |
155 | 158 | then throw("dApp not ready") | |
156 | 159 | else if (K(E)) | |
157 | 160 | then { | |
158 | - | let | |
159 | - | if (( | |
161 | + | let U = r(n(o)) | |
162 | + | if ((U != i)) | |
160 | 163 | then throw("NFT not locked") | |
161 | - | else [StringEntry(n(o), j), ScriptTransfer(Address(fromBase58String( | |
164 | + | else [StringEntry(n(o), j), ScriptTransfer(Address(fromBase58String(P)), 1, fromBase58String(o))] | |
162 | 165 | } | |
163 | 166 | else throw("Not allowed") | |
164 | 167 | ||
165 | 168 | ||
166 | 169 | ||
167 | 170 | @Callable(E) | |
168 | - | func appRunning ( | |
171 | + | func appRunning (Y,Z) = if (!(J)) | |
169 | 172 | then throw("dApp not ready") | |
170 | 173 | else if (K(E)) | |
171 | - | then [BooleanEntry(e, | |
174 | + | then [BooleanEntry(e, Y), StringEntry(f, Z)] | |
172 | 175 | else throw("You are not allowed to change this") | |
173 | 176 | ||
174 | 177 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let a = "config_init" | |
5 | 5 | ||
6 | 6 | let b = "config_admin" | |
7 | 7 | ||
8 | 8 | let c = "config_oracle" | |
9 | 9 | ||
10 | 10 | let d = "config_artwork_dapp" | |
11 | 11 | ||
12 | 12 | let e = "conf_dapp_is_running" | |
13 | 13 | ||
14 | 14 | let f = "conf_maintenance_msg" | |
15 | 15 | ||
16 | 16 | let g = valueOrElse(getBoolean(this, e), true) | |
17 | 17 | ||
18 | 18 | let h = valueOrElse(getString(this, f), "") | |
19 | 19 | ||
20 | 20 | let i = "LOCKED" | |
21 | 21 | ||
22 | 22 | let j = "UNLOCKED" | |
23 | 23 | ||
24 | 24 | let k = "PENDING" | |
25 | 25 | ||
26 | 26 | let l = "CLOSED" | |
27 | 27 | ||
28 | 28 | let m = ["ETH", "POLYGON"] | |
29 | 29 | ||
30 | 30 | func n (o) = (("nft_" + o) + "_status") | |
31 | 31 | ||
32 | 32 | ||
33 | 33 | func p (o,q) = ((((("transfer_" + o) + "_") + q) + "_") + k) | |
34 | 34 | ||
35 | 35 | ||
36 | 36 | func r (s) = valueOrElse(getString(this, s), "") | |
37 | 37 | ||
38 | 38 | ||
39 | 39 | func t (s) = valueOrElse(getInteger(this, s), 0) | |
40 | 40 | ||
41 | 41 | ||
42 | 42 | func u (s) = valueOrElse(getBoolean(this, s), false) | |
43 | 43 | ||
44 | 44 | ||
45 | - | let v = valueOrElse(r(b), "") | |
45 | + | let v = value(addressFromString(valueOrElse(r(b), ""))) | |
46 | 46 | ||
47 | 47 | let w = value(addressFromString(r(d))) | |
48 | 48 | ||
49 | 49 | let x = value(addressFromString(r(c))) | |
50 | 50 | ||
51 | 51 | func y (s) = valueOrErrorMessage(getInteger(x, s), "Integer undefine or 0 in oracle") | |
52 | 52 | ||
53 | 53 | ||
54 | 54 | func z (A) = if (if (if ((A.quantity == 1)) | |
55 | 55 | then (A.decimals == 0) | |
56 | 56 | else false) | |
57 | 57 | then (A.reissuable == false) | |
58 | 58 | else false) | |
59 | 59 | then (A.issuer == w) | |
60 | 60 | else false | |
61 | 61 | ||
62 | 62 | ||
63 | 63 | func B (C) = { | |
64 | 64 | let A = value(assetInfo(C)) | |
65 | 65 | z(A) | |
66 | 66 | } | |
67 | 67 | ||
68 | 68 | ||
69 | 69 | func D (E) = if ((size(E.payments) == 0)) | |
70 | 70 | then throw("No payment attached") | |
71 | 71 | else { | |
72 | 72 | let F = value(E.payments[0]) | |
73 | 73 | let G = value(F.amount) | |
74 | 74 | let H = value(E.payments[1]) | |
75 | 75 | let I = value(H.amount) | |
76 | 76 | $Tuple4(F, G, H, I) | |
77 | 77 | } | |
78 | 78 | ||
79 | 79 | ||
80 | 80 | let J = valueOrElse(u(a), false) | |
81 | 81 | ||
82 | 82 | func K (E) = { | |
83 | 83 | let L = toString(addressFromPublicKey(E.callerPublicKey)) | |
84 | 84 | let C = toBase58String(E.transactionId) | |
85 | - | if (containsElement([v, toString(this)], L)) | |
85 | + | let M = if (J) | |
86 | + | then [v, toString(this)] | |
87 | + | else [toString(this)] | |
88 | + | if (containsElement(M, L)) | |
86 | 89 | then true | |
87 | 90 | else false | |
88 | 91 | } | |
89 | 92 | ||
90 | 93 | ||
91 | - | func | |
94 | + | func N (E) = if (!(g)) | |
92 | 95 | then throw(h) | |
93 | 96 | else $Tuple3(toBase58String(E.transactionId), toBase58String(E.caller.bytes), lastBlock.timestamp) | |
94 | 97 | ||
95 | 98 | ||
96 | 99 | @Callable(E) | |
97 | - | func init ( | |
98 | - | then [StringEntry(b, | |
100 | + | func init (O,x,w) = if (K(E)) | |
101 | + | then [StringEntry(b, O), StringEntry(c, x), StringEntry(d, w), BooleanEntry(a, true)] | |
99 | 102 | else throw("Not allowed") | |
100 | 103 | ||
101 | 104 | ||
102 | 105 | ||
103 | 106 | @Callable(E) | |
104 | - | func lock ( | |
107 | + | func lock (P,Q) = if (!(J)) | |
105 | 108 | then throw("dApp not ready") | |
106 | - | else if (!(containsElement(m, | |
109 | + | else if (!(containsElement(m, Q))) | |
107 | 110 | then throw("Network not supported") | |
108 | 111 | else { | |
109 | - | let | |
110 | - | let C = | |
111 | - | let L = | |
112 | - | let | |
113 | - | let | |
114 | - | let F = | |
115 | - | let G = | |
116 | - | let H = | |
117 | - | let I = | |
112 | + | let R = N(E) | |
113 | + | let C = R._1 | |
114 | + | let L = R._2 | |
115 | + | let S = R._3 | |
116 | + | let T = D(E) | |
117 | + | let F = T._1 | |
118 | + | let G = T._2 | |
119 | + | let H = T._3 | |
120 | + | let I = T._4 | |
118 | 121 | if ((G != 1)) | |
119 | 122 | then throw("No NFT attached") | |
120 | 123 | else { | |
121 | 124 | let o = if (if (isDefined(F.assetId)) | |
122 | 125 | then B(value(F.assetId)) | |
123 | 126 | else false) | |
124 | 127 | then toBase58String(value(F.assetId)) | |
125 | 128 | else throw("Only SIGN Art NFT accepted.") | |
126 | - | let | |
127 | - | if (( | |
129 | + | let U = r(n(o)) | |
130 | + | if ((U == i)) | |
128 | 131 | then throw("NFT already locked") | |
129 | - | else [StringEntry(n(o), i), StringEntry(((p(o, C) + "_") + k), (((((((( | |
132 | + | else [StringEntry(n(o), i), StringEntry(((p(o, C) + "_") + k), ((((((((P + "_") + Q) + "_") + L) + "_") + C) + "_") + toString(S)))] | |
130 | 133 | } | |
131 | 134 | } | |
132 | 135 | ||
133 | 136 | ||
134 | 137 | ||
135 | 138 | @Callable(E) | |
136 | - | func processedLock (o, | |
139 | + | func processedLock (o,V) = if (!(J)) | |
137 | 140 | then throw("dApp not ready") | |
138 | 141 | else if (K(E)) | |
139 | 142 | then { | |
140 | - | let | |
141 | - | if (( | |
143 | + | let U = r(n(o)) | |
144 | + | if ((U != i)) | |
142 | 145 | then throw("NFT not locked") | |
143 | 146 | else { | |
144 | - | let | |
145 | - | let | |
146 | - | [DeleteEntry(((p(o, | |
147 | + | let W = r(p(o, V)) | |
148 | + | let X = ((p(o, V) + "_") + l) | |
149 | + | [DeleteEntry(((p(o, V) + "_") + k)), StringEntry(X, W)] | |
147 | 150 | } | |
148 | 151 | } | |
149 | 152 | else throw("Not allowed") | |
150 | 153 | ||
151 | 154 | ||
152 | 155 | ||
153 | 156 | @Callable(E) | |
154 | - | func unlock ( | |
157 | + | func unlock (P,o) = if (!(J)) | |
155 | 158 | then throw("dApp not ready") | |
156 | 159 | else if (K(E)) | |
157 | 160 | then { | |
158 | - | let | |
159 | - | if (( | |
161 | + | let U = r(n(o)) | |
162 | + | if ((U != i)) | |
160 | 163 | then throw("NFT not locked") | |
161 | - | else [StringEntry(n(o), j), ScriptTransfer(Address(fromBase58String( | |
164 | + | else [StringEntry(n(o), j), ScriptTransfer(Address(fromBase58String(P)), 1, fromBase58String(o))] | |
162 | 165 | } | |
163 | 166 | else throw("Not allowed") | |
164 | 167 | ||
165 | 168 | ||
166 | 169 | ||
167 | 170 | @Callable(E) | |
168 | - | func appRunning ( | |
171 | + | func appRunning (Y,Z) = if (!(J)) | |
169 | 172 | then throw("dApp not ready") | |
170 | 173 | else if (K(E)) | |
171 | - | then [BooleanEntry(e, | |
174 | + | then [BooleanEntry(e, Y), StringEntry(f, Z)] | |
172 | 175 | else throw("You are not allowed to change this") | |
173 | 176 | ||
174 | 177 |
github/deemru/w8io/169f3d6 48.82 ms ◑