tx · 5g4Y256RrdeFguyvE9Xbsky6tDk74ynjrJZCBWEwx36h 3MxquWQhzpqXgbqunnFqHFJXTjasEznd1tN: -0.01000000 Waves 2022.10.17 13:17 [2276239] smart account 3MxquWQhzpqXgbqunnFqHFJXTjasEznd1tN > SELF 0.00000000 Waves
{ "type": 13, "id": "5g4Y256RrdeFguyvE9Xbsky6tDk74ynjrJZCBWEwx36h", "fee": 1000000, "feeAssetId": null, "timestamp": 1666001820306, "version": 2, "chainId": 84, "sender": "3MxquWQhzpqXgbqunnFqHFJXTjasEznd1tN", "senderPublicKey": "GDjexdefwEhShjRTvHgazn3gTrDo74eHpJCAz14cAEeh", "proofs": [ "ThYvaZrTn8fGk4HHiDN53jV2XGrHbCBWgZ3RuMtddu7zj55BdkQwhYVf5VYktbkE61Y9u51bmErvKXcKpbFMP7P" ], "script": "base64:AAIFAAAAAAAAACkIAhIECgIICBIDCgEIEgMKAQgSBAoCCAgSAwoBCBIFCgMICAgSAwoBCAAAABYBAAAAEGdldFN0cmluZ09yVGhyb3cAAAACAAAAB2FkZHJlc3MAAAADa2V5CQEAAAATdmFsdWVPckVycm9yTWVzc2FnZQAAAAIJAAQdAAAAAgUAAAAHYWRkcmVzcwUAAAADa2V5CQABLAAAAAIJAAEsAAAAAgkAASwAAAACAgAAAAxDYW4ndCByZWFkICcFAAAAA2tleQIAAAANJyBhdCBhZGRyZXNzIAkABCUAAAABBQAAAAdhZGRyZXNzAQAAABFnZXRJbnRlZ2VyT3JUaHJvdwAAAAIAAAAHYWRkcmVzcwAAAANrZXkJAQAAABN2YWx1ZU9yRXJyb3JNZXNzYWdlAAAAAgkABBoAAAACBQAAAAdhZGRyZXNzBQAAAANrZXkJAAEsAAAAAgkAASwAAAACCQABLAAAAAICAAAADENhbid0IHJlYWQgJwUAAAADa2V5AgAAAA0nIGF0IGFkZHJlc3MgCQAEJQAAAAEFAAAAB2FkZHJlc3MBAAAAE3BhcnNlQWRkcmVzc09yVGhyb3cAAAABAAAADG1heWJ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XJmYWNlQXNJbnQAAAADCQEAAAAFdmFsdWUAAAABBQAAAApyZWdpc3RyYW50AgAAAAtuYW1lRXhwaXJlcwUAAAAKcmVzdExhYmVscwQAAAAKaXNSb290TmFtZQMJAABmAAAAAgkAATEAAAABBQAAAAlsYXN0TGFiZWwAAAAAAAAAAAAJAAAAAAAAAgkAATEAAAABBQAAAApyZXN0TGFiZWxzAAAAAAAAAAAABwMDBQAAAAppc1Jvb3ROYW1lBgkBAAAAASEAAAABCQEAAAAJaXNEZWZpbmVkAAAAAQUAAAAKcmVnaXN0cmFudAkABRQAAAACBQAAAANuaWwJAAUWAAAABAUAAAARcmVnaXN0cmFudEFkZHJlc3MFAAAADnBhcmVudFJlc29sdmVyBQAAAA1wYXJlbnRDcmVhdGVkBQAAAAR1bml0CQAFFAAAAAIFAAAAA25pbAkABRYAAAAEBAAAAAckbWF0Y2gwBQAAAAVvd25lcgMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAGU3RyaW5nBAAAAAVvd25lcgUAAAAHJG1hdGNoMAUAAAAFb3duZXIFAAAAEXJlZ2lzdHJhbnRBZGRyZXNzBAAAAAckbWF0Y2gwBQAAAAhyZXNvbHZlcgMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAGU3RyaW5nBAAAAAhyZXNvbHZlcgUAAAAHJG1hdGNoMAUAAAAIcmVzb2x2ZXIFAAAADnBhcmVudFJlc29sdmVyBAAAAAckbWF0Y2gwBQAAAAtuYW1lQ3JlYXRlZAMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAADSW50BAAAAAtuYW1lQ3JlYXRlZAUAAAAHJG1hdGNoMAUAAAALbmFtZUNyZWF0ZWQFAAAADXBhcmVudENyZWF0ZWQFAAAAC25hbWVFeHBpcmVzAAAAAGA2LbM=", "height": 2276239, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: EitHAjXo7pUWJ4gjmKaXtdtffV1XYpBSvLxfciywJvcD Next: CbobkH99ae7vcVdNwXg2Rmp12nsUv8akiZH9w8zDcd9b Diff:
Old | New | Differences | |
---|---|---|---|
46 | 46 | func z (y,l) = (toString(y.caller) == valueOrElse(o(l), "")) | |
47 | 47 | ||
48 | 48 | ||
49 | - | func A (h) = { | |
50 | - | let B = split(h, ".") | |
51 | - | let C = (size(B) - 1) | |
52 | - | let D = B[C] | |
53 | - | let E = makeString(removeByIndex(B, C), ".") | |
54 | - | $Tuple2(D, E) | |
49 | + | func A (f) = isDefined(addressFromString(f)) | |
50 | + | ||
51 | + | ||
52 | + | func B (h) = { | |
53 | + | let C = split(h, ".") | |
54 | + | let D = (size(C) - 1) | |
55 | + | let E = C[D] | |
56 | + | let F = makeString(removeByIndex(C, D), ".") | |
57 | + | $Tuple2(E, F) | |
55 | 58 | } | |
56 | 59 | ||
57 | 60 | ||
58 | - | func | |
59 | - | let | |
60 | - | if ($isInstanceOf( | |
61 | + | func G (H,I,F) = { | |
62 | + | let J = invoke(H, "supportsInterface", [I], nil) | |
63 | + | if ($isInstanceOf(J, "Boolean")) | |
61 | 64 | then { | |
62 | - | let | |
63 | - | if (!( | |
65 | + | let K = J | |
66 | + | if (!(K)) | |
64 | 67 | then unit | |
65 | 68 | else { | |
66 | - | let | |
67 | - | if ($isInstanceOf( | |
69 | + | let L = invoke(value(H), I, [F], nil) | |
70 | + | if ($isInstanceOf(L, "String")) | |
68 | 71 | then { | |
69 | - | let | |
70 | - | | |
72 | + | let M = L | |
73 | + | M | |
71 | 74 | } | |
72 | 75 | else unit | |
73 | 76 | } | |
76 | 79 | } | |
77 | 80 | ||
78 | 81 | ||
79 | - | func | |
80 | - | let | |
81 | - | if ($isInstanceOf( | |
82 | + | func N (H,I,F) = { | |
83 | + | let J = invoke(H, "supportsInterface", [I], nil) | |
84 | + | if ($isInstanceOf(J, "Boolean")) | |
82 | 85 | then { | |
83 | - | let | |
84 | - | if (!( | |
86 | + | let K = J | |
87 | + | if (!(K)) | |
85 | 88 | then unit | |
86 | 89 | else { | |
87 | - | let | |
88 | - | if ($isInstanceOf( | |
90 | + | let L = invoke(value(H), I, [F], nil) | |
91 | + | if ($isInstanceOf(L, "Int")) | |
89 | 92 | then { | |
90 | - | let | |
91 | - | | |
93 | + | let O = L | |
94 | + | O | |
92 | 95 | } | |
93 | 96 | else unit | |
94 | 97 | } | |
97 | 100 | } | |
98 | 101 | ||
99 | 102 | ||
100 | - | func | |
103 | + | func P (Q) = unit | |
101 | 104 | ||
102 | 105 | ||
103 | - | func | |
106 | + | func R (y) = if (x(y)) | |
104 | 107 | then unit | |
105 | 108 | else throw("Permission denied") | |
106 | 109 | ||
107 | 110 | ||
108 | - | func | |
111 | + | func S (y,l) = if (if (x(y)) | |
109 | 112 | then true | |
110 | 113 | else z(y, l)) | |
111 | 114 | then unit | |
112 | 115 | else throw("Permission denied") | |
113 | 116 | ||
114 | 117 | ||
115 | - | func S (b) = if (isDefined(addressFromString(b))) | |
118 | + | @Callable(y) | |
119 | + | func setOwner (l,q) = valueOrElse(P([S(y, l), if (A(q)) | |
116 | 120 | then unit | |
117 | - | else throw("The address must be valid") | |
118 | - | ||
119 | - | ||
120 | - | @Callable(y) | |
121 | - | func setOwner (l,q) = valueOrElse(O([R(y, l), S(q)]), p(l, q)) | |
121 | + | else throw("Owner must be a valid address")]), p(l, q)) | |
122 | 122 | ||
123 | 123 | ||
124 | 124 | ||
128 | 128 | ||
129 | 129 | ||
130 | 130 | @Callable(y) | |
131 | - | func | |
131 | + | func resolver (l) = $Tuple2(nil, r(l)) | |
132 | 132 | ||
133 | 133 | ||
134 | 134 | ||
135 | 135 | @Callable(y) | |
136 | - | func resolver (l) = $Tuple2(nil, r(l)) | |
136 | + | func setResolver (l,t) = valueOrElse(P([S(y, l), if (A(t)) | |
137 | + | then unit | |
138 | + | else throw("Resolver must be a valid contract address")]), s(l, t)) | |
137 | 139 | ||
138 | 140 | ||
139 | 141 | ||
143 | 145 | ||
144 | 146 | ||
145 | 147 | @Callable(y) | |
146 | - | func setRecord (l,q,t) = valueOrElse( | |
148 | + | func setRecord (l,q,t) = valueOrElse(P([R(y)]), ((p(l, q) ++ s(l, t)) ++ v(l, lastBlock.timestamp))) | |
147 | 149 | ||
148 | 150 | ||
149 | 151 | ||
150 | 152 | @Callable(y) | |
151 | - | func whoIs (h) = valueOrElse( | |
153 | + | func whoIs (h) = valueOrElse(P([if ((size(h) > 0)) | |
152 | 154 | then unit | |
153 | 155 | else throw("Name cannot be empty")]), { | |
154 | - | let T = | |
155 | - | let | |
156 | - | let | |
157 | - | let U = o( | |
158 | - | let | |
159 | - | let | |
160 | - | if ($isInstanceOf( | |
156 | + | let T = B(h) | |
157 | + | let E = T._1 | |
158 | + | let F = T._2 | |
159 | + | let U = o(E) | |
160 | + | let H = { | |
161 | + | let J = U | |
162 | + | if ($isInstanceOf(J, "String")) | |
161 | 163 | then { | |
162 | - | let q = | |
164 | + | let q = J | |
163 | 165 | addressFromString(q) | |
164 | 166 | } | |
165 | 167 | else unit | |
166 | 168 | } | |
167 | - | let V = r( | |
168 | - | let W = u( | |
169 | - | let q = | |
170 | - | let t = | |
171 | - | let X = | |
172 | - | let Y = | |
173 | - | let Z = if ((size( | |
174 | - | then (size( | |
169 | + | let V = r(E) | |
170 | + | let W = u(E) | |
171 | + | let q = G(value(H), "owner", F) | |
172 | + | let t = G(value(H), "resolver", F) | |
173 | + | let X = N(value(H), "nameCreated", F) | |
174 | + | let Y = N(value(H), "nameExpires", F) | |
175 | + | let Z = if ((size(E) > 0)) | |
176 | + | then (size(F) == 0) | |
175 | 177 | else false | |
176 | 178 | if (if (Z) | |
177 | 179 | then true | |
178 | - | else !(isDefined( | |
180 | + | else !(isDefined(H))) | |
179 | 181 | then $Tuple2(nil, $Tuple4(U, V, W, unit)) | |
180 | 182 | else $Tuple2(nil, $Tuple4({ | |
181 | - | let | |
182 | - | if ($isInstanceOf( | |
183 | + | let J = q | |
184 | + | if ($isInstanceOf(J, "String")) | |
183 | 185 | then { | |
184 | - | let q = | |
186 | + | let q = J | |
185 | 187 | q | |
186 | 188 | } | |
187 | 189 | else U | |
188 | 190 | }, { | |
189 | - | let | |
190 | - | if ($isInstanceOf( | |
191 | + | let J = t | |
192 | + | if ($isInstanceOf(J, "String")) | |
191 | 193 | then { | |
192 | - | let t = | |
194 | + | let t = J | |
193 | 195 | t | |
194 | 196 | } | |
195 | 197 | else V | |
196 | 198 | }, { | |
197 | - | let | |
198 | - | if ($isInstanceOf( | |
199 | + | let J = X | |
200 | + | if ($isInstanceOf(J, "Int")) | |
199 | 201 | then { | |
200 | - | let X = | |
202 | + | let X = J | |
201 | 203 | X | |
202 | 204 | } | |
203 | 205 | else W |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | func a (b,c) = valueOrErrorMessage(getString(b, c), ((("Can't read '" + c) + "' at address ") + toString(b))) | |
5 | 5 | ||
6 | 6 | ||
7 | 7 | func d (b,c) = valueOrErrorMessage(getInteger(b, c), ((("Can't read '" + c) + "' at address ") + toString(b))) | |
8 | 8 | ||
9 | 9 | ||
10 | 10 | func e (f) = valueOrErrorMessage(addressFromString(f), (("Can't parse address from '" + f) + "'")) | |
11 | 11 | ||
12 | 12 | ||
13 | 13 | func g (h,i,j) = ((((h + "_") + i) + "_") + j) | |
14 | 14 | ||
15 | 15 | ||
16 | 16 | func k (l) = g("Name", l, "owner") | |
17 | 17 | ||
18 | 18 | ||
19 | 19 | func m (l) = g("Name", l, "resolver") | |
20 | 20 | ||
21 | 21 | ||
22 | 22 | func n (l) = g("Name", l, "createdAt") | |
23 | 23 | ||
24 | 24 | ||
25 | 25 | func o (l) = getString(this, k(l)) | |
26 | 26 | ||
27 | 27 | ||
28 | 28 | func p (l,q) = [StringEntry(k(l), q)] | |
29 | 29 | ||
30 | 30 | ||
31 | 31 | func r (l) = getString(this, m(l)) | |
32 | 32 | ||
33 | 33 | ||
34 | 34 | func s (l,t) = [StringEntry(m(l), t)] | |
35 | 35 | ||
36 | 36 | ||
37 | 37 | func u (l) = getInteger(this, n(l)) | |
38 | 38 | ||
39 | 39 | ||
40 | 40 | func v (l,w) = [IntegerEntry(n(l), w)] | |
41 | 41 | ||
42 | 42 | ||
43 | 43 | func x (y) = (y.caller == this) | |
44 | 44 | ||
45 | 45 | ||
46 | 46 | func z (y,l) = (toString(y.caller) == valueOrElse(o(l), "")) | |
47 | 47 | ||
48 | 48 | ||
49 | - | func A (h) = { | |
50 | - | let B = split(h, ".") | |
51 | - | let C = (size(B) - 1) | |
52 | - | let D = B[C] | |
53 | - | let E = makeString(removeByIndex(B, C), ".") | |
54 | - | $Tuple2(D, E) | |
49 | + | func A (f) = isDefined(addressFromString(f)) | |
50 | + | ||
51 | + | ||
52 | + | func B (h) = { | |
53 | + | let C = split(h, ".") | |
54 | + | let D = (size(C) - 1) | |
55 | + | let E = C[D] | |
56 | + | let F = makeString(removeByIndex(C, D), ".") | |
57 | + | $Tuple2(E, F) | |
55 | 58 | } | |
56 | 59 | ||
57 | 60 | ||
58 | - | func | |
59 | - | let | |
60 | - | if ($isInstanceOf( | |
61 | + | func G (H,I,F) = { | |
62 | + | let J = invoke(H, "supportsInterface", [I], nil) | |
63 | + | if ($isInstanceOf(J, "Boolean")) | |
61 | 64 | then { | |
62 | - | let | |
63 | - | if (!( | |
65 | + | let K = J | |
66 | + | if (!(K)) | |
64 | 67 | then unit | |
65 | 68 | else { | |
66 | - | let | |
67 | - | if ($isInstanceOf( | |
69 | + | let L = invoke(value(H), I, [F], nil) | |
70 | + | if ($isInstanceOf(L, "String")) | |
68 | 71 | then { | |
69 | - | let | |
70 | - | | |
72 | + | let M = L | |
73 | + | M | |
71 | 74 | } | |
72 | 75 | else unit | |
73 | 76 | } | |
74 | 77 | } | |
75 | 78 | else unit | |
76 | 79 | } | |
77 | 80 | ||
78 | 81 | ||
79 | - | func | |
80 | - | let | |
81 | - | if ($isInstanceOf( | |
82 | + | func N (H,I,F) = { | |
83 | + | let J = invoke(H, "supportsInterface", [I], nil) | |
84 | + | if ($isInstanceOf(J, "Boolean")) | |
82 | 85 | then { | |
83 | - | let | |
84 | - | if (!( | |
86 | + | let K = J | |
87 | + | if (!(K)) | |
85 | 88 | then unit | |
86 | 89 | else { | |
87 | - | let | |
88 | - | if ($isInstanceOf( | |
90 | + | let L = invoke(value(H), I, [F], nil) | |
91 | + | if ($isInstanceOf(L, "Int")) | |
89 | 92 | then { | |
90 | - | let | |
91 | - | | |
93 | + | let O = L | |
94 | + | O | |
92 | 95 | } | |
93 | 96 | else unit | |
94 | 97 | } | |
95 | 98 | } | |
96 | 99 | else unit | |
97 | 100 | } | |
98 | 101 | ||
99 | 102 | ||
100 | - | func | |
103 | + | func P (Q) = unit | |
101 | 104 | ||
102 | 105 | ||
103 | - | func | |
106 | + | func R (y) = if (x(y)) | |
104 | 107 | then unit | |
105 | 108 | else throw("Permission denied") | |
106 | 109 | ||
107 | 110 | ||
108 | - | func | |
111 | + | func S (y,l) = if (if (x(y)) | |
109 | 112 | then true | |
110 | 113 | else z(y, l)) | |
111 | 114 | then unit | |
112 | 115 | else throw("Permission denied") | |
113 | 116 | ||
114 | 117 | ||
115 | - | func S (b) = if (isDefined(addressFromString(b))) | |
118 | + | @Callable(y) | |
119 | + | func setOwner (l,q) = valueOrElse(P([S(y, l), if (A(q)) | |
116 | 120 | then unit | |
117 | - | else throw("The address must be valid") | |
118 | - | ||
119 | - | ||
120 | - | @Callable(y) | |
121 | - | func setOwner (l,q) = valueOrElse(O([R(y, l), S(q)]), p(l, q)) | |
121 | + | else throw("Owner must be a valid address")]), p(l, q)) | |
122 | 122 | ||
123 | 123 | ||
124 | 124 | ||
125 | 125 | @Callable(y) | |
126 | 126 | func owner (l) = $Tuple2(nil, o(l)) | |
127 | 127 | ||
128 | 128 | ||
129 | 129 | ||
130 | 130 | @Callable(y) | |
131 | - | func | |
131 | + | func resolver (l) = $Tuple2(nil, r(l)) | |
132 | 132 | ||
133 | 133 | ||
134 | 134 | ||
135 | 135 | @Callable(y) | |
136 | - | func resolver (l) = $Tuple2(nil, r(l)) | |
136 | + | func setResolver (l,t) = valueOrElse(P([S(y, l), if (A(t)) | |
137 | + | then unit | |
138 | + | else throw("Resolver must be a valid contract address")]), s(l, t)) | |
137 | 139 | ||
138 | 140 | ||
139 | 141 | ||
140 | 142 | @Callable(y) | |
141 | 143 | func nameCreated (l) = $Tuple2(nil, u(l)) | |
142 | 144 | ||
143 | 145 | ||
144 | 146 | ||
145 | 147 | @Callable(y) | |
146 | - | func setRecord (l,q,t) = valueOrElse( | |
148 | + | func setRecord (l,q,t) = valueOrElse(P([R(y)]), ((p(l, q) ++ s(l, t)) ++ v(l, lastBlock.timestamp))) | |
147 | 149 | ||
148 | 150 | ||
149 | 151 | ||
150 | 152 | @Callable(y) | |
151 | - | func whoIs (h) = valueOrElse( | |
153 | + | func whoIs (h) = valueOrElse(P([if ((size(h) > 0)) | |
152 | 154 | then unit | |
153 | 155 | else throw("Name cannot be empty")]), { | |
154 | - | let T = | |
155 | - | let | |
156 | - | let | |
157 | - | let U = o( | |
158 | - | let | |
159 | - | let | |
160 | - | if ($isInstanceOf( | |
156 | + | let T = B(h) | |
157 | + | let E = T._1 | |
158 | + | let F = T._2 | |
159 | + | let U = o(E) | |
160 | + | let H = { | |
161 | + | let J = U | |
162 | + | if ($isInstanceOf(J, "String")) | |
161 | 163 | then { | |
162 | - | let q = | |
164 | + | let q = J | |
163 | 165 | addressFromString(q) | |
164 | 166 | } | |
165 | 167 | else unit | |
166 | 168 | } | |
167 | - | let V = r( | |
168 | - | let W = u( | |
169 | - | let q = | |
170 | - | let t = | |
171 | - | let X = | |
172 | - | let Y = | |
173 | - | let Z = if ((size( | |
174 | - | then (size( | |
169 | + | let V = r(E) | |
170 | + | let W = u(E) | |
171 | + | let q = G(value(H), "owner", F) | |
172 | + | let t = G(value(H), "resolver", F) | |
173 | + | let X = N(value(H), "nameCreated", F) | |
174 | + | let Y = N(value(H), "nameExpires", F) | |
175 | + | let Z = if ((size(E) > 0)) | |
176 | + | then (size(F) == 0) | |
175 | 177 | else false | |
176 | 178 | if (if (Z) | |
177 | 179 | then true | |
178 | - | else !(isDefined( | |
180 | + | else !(isDefined(H))) | |
179 | 181 | then $Tuple2(nil, $Tuple4(U, V, W, unit)) | |
180 | 182 | else $Tuple2(nil, $Tuple4({ | |
181 | - | let | |
182 | - | if ($isInstanceOf( | |
183 | + | let J = q | |
184 | + | if ($isInstanceOf(J, "String")) | |
183 | 185 | then { | |
184 | - | let q = | |
186 | + | let q = J | |
185 | 187 | q | |
186 | 188 | } | |
187 | 189 | else U | |
188 | 190 | }, { | |
189 | - | let | |
190 | - | if ($isInstanceOf( | |
191 | + | let J = t | |
192 | + | if ($isInstanceOf(J, "String")) | |
191 | 193 | then { | |
192 | - | let t = | |
194 | + | let t = J | |
193 | 195 | t | |
194 | 196 | } | |
195 | 197 | else V | |
196 | 198 | }, { | |
197 | - | let | |
198 | - | if ($isInstanceOf( | |
199 | + | let J = X | |
200 | + | if ($isInstanceOf(J, "Int")) | |
199 | 201 | then { | |
200 | - | let X = | |
202 | + | let X = J | |
201 | 203 | X | |
202 | 204 | } | |
203 | 205 | else W | |
204 | 206 | }, Y)) | |
205 | 207 | }) | |
206 | 208 | ||
207 | 209 |
github/deemru/w8io/026f985 70.49 ms ◑