tx · HDyUfaRxWPV3FKrdF6et8zv8SLf3T75DAJ9jedtmEdk5

3MvCgypmBZFTRqL5HuRwCgS7maC7Fkv7pZY:  -0.01000000 Waves

2022.10.17 10:46 [2276085] smart account 3MvCgypmBZFTRqL5HuRwCgS7maC7Fkv7pZY > SELF 0.00000000 Waves

{ "type": 13, "id": "HDyUfaRxWPV3FKrdF6et8zv8SLf3T75DAJ9jedtmEdk5", "fee": 1000000, "feeAssetId": null, "timestamp": 1665992854248, "version": 2, "chainId": 84, "sender": "3MvCgypmBZFTRqL5HuRwCgS7maC7Fkv7pZY", "senderPublicKey": "BqGSAiYghM27RZ2Axx3bmTudq9koHT4575AeK31Wx2Pp", "proofs": [ "5XN8VymjZsYHCf2z1ck77JZKj8YoQjfyfMZkWmpEsF98xN4Ngh4rzHyJdfjjZV2cCDuNo6ZdK1HoPriQ39pK3NUn" ], "script": "base64:AAIFAAAAAAAAACkIAhIECgIICBIDCgEIEgMKAQgSBAoCCAgSAwoBCBIFCgMICAgSAwoBCAAAABYBAAAAEGdldFN0cmluZ09yVGhyb3cAAAACAAAAB2FkZHJlc3MAAAADa2V5CQEAAAATdmFsdWVPckVycm9yTWVzc2FnZQAAAAIJAAQdAAAAAgUAAAAHYWRkcmVzcwUAAAADa2V5CQABLAAAAAIJAAEsAAAAAgkAASwAAAACAgAAAAxDYW4ndCByZWFkICcFAAAAA2tleQIAAAANJyBhdCBhZGRyZXNzIAkABCUAAAABBQAAAAdhZGRyZXNzAQAAABFnZXRJbnRlZ2VyT3JUaHJvdwAAAAIAAAAHYWRkcmVzcwAAAANrZXkJAQAAABN2YWx1ZU9yRXJyb3JNZXNzYWdlAAAAAgkABBoAAAACBQAAAAdhZGRyZXNzBQAAAANrZXkJAAEsAAAAAgkAASwAAAACCQABLAAAAAICAAAADENhbid0IHJlYWQgJwUAAAADa2V5AgAAAA0nIGF0IGFkZHJlc3MgCQAEJQAAAAEFAAAAB2FkZHJlc3MBAAAAE3BhcnNlQWRkcmVzc09yV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hfc3VwcG9ydGVkSW50ZXJmYWNlQXNJbnQAAAADCQEAAAAFdmFsdWUAAAABBQAAAApyZWdpc3RyYW50AgAAAAtuYW1lRXhwaXJlcwUAAAAKcmVzdExhYmVscwQAAAAKaXNSb290TmFtZQMJAABmAAAAAgkAATEAAAABBQAAAAlsYXN0TGFiZWwAAAAAAAAAAAAJAAAAAAAAAgkAATEAAAABBQAAAApyZXN0TGFiZWxzAAAAAAAAAAAABwMDBQAAAAppc1Jvb3ROYW1lBgkBAAAAASEAAAABCQEAAAAJaXNEZWZpbmVkAAAAAQUAAAAKcmVnaXN0cmFudAkABRQAAAACBQAAAANuaWwJAAUWAAAABAUAAAARcmVnaXN0cmFudEFkZHJlc3MFAAAADnBhcmVudFJlc29sdmVyBQAAAA1wYXJlbnRDcmVhdGVkBQAAAAR1bml0CQAFFAAAAAIFAAAAA25pbAkABRYAAAAEBAAAAAckbWF0Y2gwBQAAAAVvd25lcgMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAGU3RyaW5nBAAAAAVvd25lcgUAAAAHJG1hdGNoMAUAAAAFb3duZXIFAAAAEXJlZ2lzdHJhbnRBZGRyZXNzBAAAAAckbWF0Y2gwBQAAAAhyZXNvbHZlcgMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAGU3RyaW5nBAAAAAhyZXNvbHZlcgUAAAAHJG1hdGNoMAUAAAAIcmVzb2x2ZXIFAAAADnBhcmVudFJlc29sdmVyBAAAAAckbWF0Y2gwBQAAAAtuYW1lQ3JlYXRlZAMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAADSW50BAAAAAtuYW1lQ3JlYXRlZAUAAAAHJG1hdGNoMAUAAAALbmFtZUNyZWF0ZWQFAAAADXBhcmVudENyZWF0ZWQFAAAAC25hbWVFeHBpcmVzAAAAAGA2LbM=", "height": 2276085, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: DUyev2FfWN56XqEQErT2evC3nhwhE5SD6HpcpBTADopn Next: 8CfJRrbiFPx4hyb9GUP2pQy9asF8vnZ8SPUwgPVP3gD9 Diff:
OldNewDifferences
4343 func x (y) = (y.caller == this)
4444
4545
46-func z (y,l) = (toString(y.caller) == valueOrErrorMessage(o(l), (("Owner for the `" + l) + "` was not found")))
46+func z (y,l) = (toString(y.caller) == valueOrElse(o(l), ""))
4747
4848
49-func A (B) = unit
49+func A (f) = isDefined(addressFromString(f))
5050
5151
52-func C (y) = if (x(y))
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)
58+ }
59+
60+
61+func G (H,I,F) = {
62+ let J = invoke(H, "supportsInterface", [I], nil)
63+ if ($isInstanceOf(J, "Boolean"))
64+ then {
65+ let K = J
66+ if (!(K))
67+ then unit
68+ else {
69+ let L = invoke(value(H), I, [F], nil)
70+ if ($isInstanceOf(L, "String"))
71+ then {
72+ let M = L
73+ M
74+ }
75+ else unit
76+ }
77+ }
78+ else unit
79+ }
80+
81+
82+func N (H,I,F) = {
83+ let J = invoke(H, "supportsInterface", [I], nil)
84+ if ($isInstanceOf(J, "Boolean"))
85+ then {
86+ let K = J
87+ if (!(K))
88+ then unit
89+ else {
90+ let L = invoke(value(H), I, [F], nil)
91+ if ($isInstanceOf(L, "Int"))
92+ then {
93+ let O = L
94+ O
95+ }
96+ else unit
97+ }
98+ }
99+ else unit
100+ }
101+
102+
103+func P (Q) = unit
104+
105+
106+func R (y) = if (x(y))
53107 then unit
54108 else throw("Permission denied")
55109
56110
57-func D (y,l) = if (if (x(y))
111+func S (y,l) = if (if (x(y))
58112 then true
59113 else z(y, l))
60114 then unit
62116
63117
64118 @Callable(y)
65-func setOwner (l,q) = valueOrElse(A([D(y, l)]), p(l, q))
119+func setOwner (l,q) = valueOrElse(P([S(y, l), if (A(q))
120+ then unit
121+ else throw("Owner must be a valid address")]), p(l, q))
66122
67123
68124
72128
73129
74130 @Callable(y)
75-func setResolver (l,t) = valueOrElse(A([D(y, l)]), s(l, t))
131+func resolver (l) = $Tuple2(nil, r(l))
76132
77133
78134
79135 @Callable(y)
80-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))
81139
82140
83141
87145
88146
89147 @Callable(y)
90-func setRecord (l,q,t) = valueOrElse(A([C(y)]), ((p(l, q) ++ s(l, t)) ++ v(l, lastBlock.timestamp)))
148+func setRecord (l,q,t) = valueOrElse(P([R(y)]), ((p(l, q) ++ s(l, t)) ++ v(l, lastBlock.timestamp)))
149+
150+
151+
152+@Callable(y)
153+func whoIs (h) = valueOrElse(P([if ((size(h) > 0))
154+ then unit
155+ else throw("Name cannot be empty")]), {
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"))
163+ then {
164+ let q = J
165+ addressFromString(q)
166+ }
167+ else unit
168+ }
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)
177+ else false
178+ if (if (Z)
179+ then true
180+ else !(isDefined(H)))
181+ then $Tuple2(nil, $Tuple4(U, V, W, unit))
182+ else $Tuple2(nil, $Tuple4({
183+ let J = q
184+ if ($isInstanceOf(J, "String"))
185+ then {
186+ let q = J
187+ q
188+ }
189+ else U
190+ }, {
191+ let J = t
192+ if ($isInstanceOf(J, "String"))
193+ then {
194+ let t = J
195+ t
196+ }
197+ else V
198+ }, {
199+ let J = X
200+ if ($isInstanceOf(J, "Int"))
201+ then {
202+ let X = J
203+ X
204+ }
205+ else W
206+ }, Y))
207+ })
91208
92209
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 func a (b,c) = valueOrErrorMessage(getString(b, c), ((("Can't read '" + c) + "' at address ") + toString(b)))
55
66
77 func d (b,c) = valueOrErrorMessage(getInteger(b, c), ((("Can't read '" + c) + "' at address ") + toString(b)))
88
99
1010 func e (f) = valueOrErrorMessage(addressFromString(f), (("Can't parse address from '" + f) + "'"))
1111
1212
1313 func g (h,i,j) = ((((h + "_") + i) + "_") + j)
1414
1515
1616 func k (l) = g("Name", l, "owner")
1717
1818
1919 func m (l) = g("Name", l, "resolver")
2020
2121
2222 func n (l) = g("Name", l, "createdAt")
2323
2424
2525 func o (l) = getString(this, k(l))
2626
2727
2828 func p (l,q) = [StringEntry(k(l), q)]
2929
3030
3131 func r (l) = getString(this, m(l))
3232
3333
3434 func s (l,t) = [StringEntry(m(l), t)]
3535
3636
3737 func u (l) = getInteger(this, n(l))
3838
3939
4040 func v (l,w) = [IntegerEntry(n(l), w)]
4141
4242
4343 func x (y) = (y.caller == this)
4444
4545
46-func z (y,l) = (toString(y.caller) == valueOrErrorMessage(o(l), (("Owner for the `" + l) + "` was not found")))
46+func z (y,l) = (toString(y.caller) == valueOrElse(o(l), ""))
4747
4848
49-func A (B) = unit
49+func A (f) = isDefined(addressFromString(f))
5050
5151
52-func C (y) = if (x(y))
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)
58+ }
59+
60+
61+func G (H,I,F) = {
62+ let J = invoke(H, "supportsInterface", [I], nil)
63+ if ($isInstanceOf(J, "Boolean"))
64+ then {
65+ let K = J
66+ if (!(K))
67+ then unit
68+ else {
69+ let L = invoke(value(H), I, [F], nil)
70+ if ($isInstanceOf(L, "String"))
71+ then {
72+ let M = L
73+ M
74+ }
75+ else unit
76+ }
77+ }
78+ else unit
79+ }
80+
81+
82+func N (H,I,F) = {
83+ let J = invoke(H, "supportsInterface", [I], nil)
84+ if ($isInstanceOf(J, "Boolean"))
85+ then {
86+ let K = J
87+ if (!(K))
88+ then unit
89+ else {
90+ let L = invoke(value(H), I, [F], nil)
91+ if ($isInstanceOf(L, "Int"))
92+ then {
93+ let O = L
94+ O
95+ }
96+ else unit
97+ }
98+ }
99+ else unit
100+ }
101+
102+
103+func P (Q) = unit
104+
105+
106+func R (y) = if (x(y))
53107 then unit
54108 else throw("Permission denied")
55109
56110
57-func D (y,l) = if (if (x(y))
111+func S (y,l) = if (if (x(y))
58112 then true
59113 else z(y, l))
60114 then unit
61115 else throw("Permission denied")
62116
63117
64118 @Callable(y)
65-func setOwner (l,q) = valueOrElse(A([D(y, l)]), p(l, q))
119+func setOwner (l,q) = valueOrElse(P([S(y, l), if (A(q))
120+ then unit
121+ else throw("Owner must be a valid address")]), p(l, q))
66122
67123
68124
69125 @Callable(y)
70126 func owner (l) = $Tuple2(nil, o(l))
71127
72128
73129
74130 @Callable(y)
75-func setResolver (l,t) = valueOrElse(A([D(y, l)]), s(l, t))
131+func resolver (l) = $Tuple2(nil, r(l))
76132
77133
78134
79135 @Callable(y)
80-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))
81139
82140
83141
84142 @Callable(y)
85143 func nameCreated (l) = $Tuple2(nil, u(l))
86144
87145
88146
89147 @Callable(y)
90-func setRecord (l,q,t) = valueOrElse(A([C(y)]), ((p(l, q) ++ s(l, t)) ++ v(l, lastBlock.timestamp)))
148+func setRecord (l,q,t) = valueOrElse(P([R(y)]), ((p(l, q) ++ s(l, t)) ++ v(l, lastBlock.timestamp)))
149+
150+
151+
152+@Callable(y)
153+func whoIs (h) = valueOrElse(P([if ((size(h) > 0))
154+ then unit
155+ else throw("Name cannot be empty")]), {
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"))
163+ then {
164+ let q = J
165+ addressFromString(q)
166+ }
167+ else unit
168+ }
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)
177+ else false
178+ if (if (Z)
179+ then true
180+ else !(isDefined(H)))
181+ then $Tuple2(nil, $Tuple4(U, V, W, unit))
182+ else $Tuple2(nil, $Tuple4({
183+ let J = q
184+ if ($isInstanceOf(J, "String"))
185+ then {
186+ let q = J
187+ q
188+ }
189+ else U
190+ }, {
191+ let J = t
192+ if ($isInstanceOf(J, "String"))
193+ then {
194+ let t = J
195+ t
196+ }
197+ else V
198+ }, {
199+ let J = X
200+ if ($isInstanceOf(J, "Int"))
201+ then {
202+ let X = J
203+ X
204+ }
205+ else W
206+ }, Y))
207+ })
91208
92209

github/deemru/w8io/169f3d6 
44.32 ms