tx · 9V5FEWthAjCphmbTpDv41DZXbbycHi4XUooSBUtBDLVJ

3MxquWQhzpqXgbqunnFqHFJXTjasEznd1tN:  -0.01000000 Waves

2022.10.15 11:11 [2273202] smart account 3MxquWQhzpqXgbqunnFqHFJXTjasEznd1tN > SELF 0.00000000 Waves

{ "type": 13, "id": "9V5FEWthAjCphmbTpDv41DZXbbycHi4XUooSBUtBDLVJ", "fee": 1000000, "feeAssetId": null, "timestamp": 1665821484561, "version": 2, "chainId": 84, "sender": "3MxquWQhzpqXgbqunnFqHFJXTjasEznd1tN", "senderPublicKey": "GDjexdefwEhShjRTvHgazn3gTrDo74eHpJCAz14cAEeh", "proofs": [ "M3idXQizJ1xw9Kw6KyD1cM6wFC87fY6YN5895m8QFSCGckyvafQvRyibuiNUxs3DYeyJ5pXaJHFU77dQhj1u8ta" ], "script": "base64:AAIFAAAAAAAAACkIAhIECgIICBIDCgEIEgQKAggIEgMKAQgSAwoBCBIFCgMICAgSAwoBCAAAABYBAAAAEGdldFN0cmluZ09yVGhyb3cAAAACAAAAB2FkZHJlc3MAAAADa2V5CQEAAAATdmFsdWVPckVycm9yTWVzc2FnZQAAAAIJAAQdAAAAAgUAAAAHYWRkcmVzcwUAAAADa2V5CQABLAAAAAIJAAEsAAAAAgkAASwAAAACAgAAAAxDYW4ndCByZWFkICcFAAAAA2tleQIAAAANJyBhdCBhZGRyZXNzIAkABCUAAAABBQAAAAdhZGRyZXNzAQAAABFnZXRJbnRlZ2VyT3JUaHJvdwAAAAIAAAAHYWRkcmVzcwAAAANrZXkJAQAAABN2YWx1ZU9yRXJyb3JNZXNzYWdlAAAAAgkABBoAAAACBQAAAAdhZGRyZXNzBQAAAANrZXkJAAEsAAAAAgkAASwAAAACCQABLAAAAAICAAAADENhbid0IHJlYWQgJwUAAAADa2V5AgAAAA0nIGF0IGFkZHJlc3MgCQAEJQAAAAEFAAAAB2FkZHJlc3MBAAAAE3BhcnNlQWRkcmVzc09yVGhyb3cAAAABAAAADG1heWJl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QAAAAKaXNSb290TmFtZQMJAABmAAAAAgkAATEAAAABBQAAAAlsYXN0TGFiZWwAAAAAAAAAAAAJAAAAAAAAAgkAATEAAAABBQAAAApyZXN0TGFiZWxzAAAAAAAAAAAABwMDBQAAAAppc1Jvb3ROYW1lBgkBAAAAASEAAAABCQEAAAAJaXNEZWZpbmVkAAAAAQUAAAAKcmVnaXN0cmFudAkABRQAAAACBQAAAANuaWwJAAUWAAAABAUAAAARcmVnaXN0cmFudEFkZHJlc3MFAAAADnBhcmVudFJlc29sdmVyBQAAAA1wYXJlbnRDcmVhdGVkBQAAAAR1bml0CQAFFAAAAAIFAAAAA25pbAkABRYAAAAEBAAAAAckbWF0Y2gwBQAAAAVvd25lcgMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAGU3RyaW5nBAAAAAVvd25lcgUAAAAHJG1hdGNoMAUAAAAFb3duZXIFAAAAEXJlZ2lzdHJhbnRBZGRyZXNzBAAAAAckbWF0Y2gwBQAAAAhyZXNvbHZlcgMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAGU3RyaW5nBAAAAAhyZXNvbHZlcgUAAAAHJG1hdGNoMAUAAAAIcmVzb2x2ZXIFAAAADnBhcmVudFJlc29sdmVyBAAAAAckbWF0Y2gwBQAAAAtuYW1lQ3JlYXRlZAMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAADSW50BAAAAAtuYW1lQ3JlYXRlZAUAAAAHJG1hdGNoMAUAAAALbmFtZUNyZWF0ZWQFAAAADXBhcmVudENyZWF0ZWQFAAAAC25hbWVFeHBpcmVzAAAAAJ6vnUI=", "height": 2273202, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: CdzFFy7Pjmgb7jj5GCzknGoAqecURz7aT797X5uWZCFy Next: CJs8mboFZ1HQHrG5981o9wLSwiUMzz9oAua3zALbzTQK Diff:
OldNewDifferences
5555 }
5656
5757
58-func _findResolver (name) = {
59- let $t021972248 = _splitLastLabel(name)
60- let lastLabel = $t021972248._1
61- let restLabels = $t021972248._2
62- match invoke(this, "resolver", [lastLabel], nil) {
63- case resolverAddress: String =>
64- $Tuple2(addressFromString(resolverAddress), restLabels)
65- case _ =>
66- $Tuple2(unit, name)
67- }
68- }
58+func _supportedInterfaceAsString (registrant,interfaceId,restLabels) = match invoke(registrant, "supportsInterface", [interfaceId], nil) {
59+ case supportsInterface: Boolean =>
60+ if (!(supportsInterface))
61+ then unit
62+ else match invoke(value(registrant), interfaceId, [restLabels], nil) {
63+ case mayBeString: String =>
64+ mayBeString
65+ case _ =>
66+ unit
67+ }
68+ case _ =>
69+ unit
70+}
71+
72+
73+func _supportedInterfaceAsInt (registrant,interfaceId,restLabels) = match invoke(registrant, "supportsInterface", [interfaceId], nil) {
74+ case supportsInterface: Boolean =>
75+ if (!(supportsInterface))
76+ then unit
77+ else match invoke(value(registrant), interfaceId, [restLabels], nil) {
78+ case mayBeInt: Int =>
79+ mayBeInt
80+ case _ =>
81+ unit
82+ }
83+ case _ =>
84+ unit
85+}
6986
7087
7188 func modifiers (validations) = unit
122139 func whoIs (name) = valueOrElse(modifiers([if ((size(name) > 0))
123140 then unit
124141 else throw("Name cannot be empty")]), {
125- let $t040804131 = _splitLastLabel(name)
126- let lastLabel = $t040804131._1
127- let restLabels = $t040804131._2
142+ let $t046304681 = _splitLastLabel(name)
143+ let lastLabel = $t046304681._1
144+ let restLabels = $t046304681._2
128145 let registrantAddress = _getOwner(lastLabel)
129146 let registrant = match registrantAddress {
130147 case owner: String =>
132149 case _ =>
133150 unit
134151 }
135- let resolver = _getResolver(lastLabel)
136- let nameCreated = _getCreatedAt(lastLabel)
137- let parentInfo = $Tuple4(registrantAddress, resolver, nameCreated, unit)
152+ let parentResolver = _getResolver(lastLabel)
153+ let parentCreated = _getCreatedAt(lastLabel)
154+ let owner = _supportedInterfaceAsString(value(registrant), "owner", restLabels)
155+ let resolver = _supportedInterfaceAsString(value(registrant), "resolver", restLabels)
156+ let nameCreated = _supportedInterfaceAsInt(value(registrant), "nameCreated", restLabels)
157+ let nameExpires = _supportedInterfaceAsInt(value(registrant), "nameExpires", restLabels)
138158 let isRootName = if ((size(lastLabel) > 0))
139159 then (size(restLabels) == 0)
140160 else false
141- let supportsInterface = match invoke(value(registrant), "supportsInterface", ["whoIs"], nil) {
142- case supportsInterface: Boolean =>
143- supportsInterface
144- case _ =>
145- false
146- }
147- if (if (if (isRootName)
161+ if (if (isRootName)
148162 then true
149163 else !(isDefined(registrant)))
150- then true
151- else !(supportsInterface))
152- then $Tuple2(nil, parentInfo)
153- else match invoke(value(registrant), "whoIs", [value(restLabels)], nil) {
164+ then $Tuple2(nil, $Tuple4(registrantAddress, parentResolver, parentCreated, unit))
165+ else $Tuple2(nil, $Tuple4( match owner {
166+ case owner: String =>
167+ owner
154168 case _ =>
155- if (if (if (if ($isInstanceOf($match0._1, "String"))
156- then true
157- else $isInstanceOf($match0._1, "Unit"))
158- then if (if ($isInstanceOf($match0._2, "String"))
159- then true
160- else $isInstanceOf($match0._2, "Unit"))
161- then if (if ($isInstanceOf($match0._3, "Int"))
162- then true
163- else $isInstanceOf($match0._3, "Unit"))
164- then if ($isInstanceOf($match0._4, "Int"))
165- then true
166- else $isInstanceOf($match0._4, "Unit")
167- else false
168- else false
169- else false)
170- then if (if (if (if (if (if (if (if (if (if (if (if (if (if (if ($isInstanceOf($match0, "(Unit, Unit, Unit, Unit)"))
171- then true
172- else $isInstanceOf($match0, "(Unit, Unit, Unit, Int)"))
173- then true
174- else $isInstanceOf($match0, "(Unit, Unit, Int, Unit)"))
175- then true
176- else $isInstanceOf($match0, "(Unit, Unit, Int, Int)"))
177- then true
178- else $isInstanceOf($match0, "(Unit, String, Unit, Unit)"))
179- then true
180- else $isInstanceOf($match0, "(Unit, String, Unit, Int)"))
181- then true
182- else $isInstanceOf($match0, "(Unit, String, Int, Unit)"))
183- then true
184- else $isInstanceOf($match0, "(Unit, String, Int, Int)"))
185- then true
186- else $isInstanceOf($match0, "(String, Unit, Unit, Unit)"))
187- then true
188- else $isInstanceOf($match0, "(String, Unit, Unit, Int)"))
189- then true
190- else $isInstanceOf($match0, "(String, Unit, Int, Unit)"))
191- then true
192- else $isInstanceOf($match0, "(String, Unit, Int, Int)"))
193- then true
194- else $isInstanceOf($match0, "(String, String, Unit, Unit)"))
195- then true
196- else $isInstanceOf($match0, "(String, String, Unit, Int)"))
197- then true
198- else $isInstanceOf($match0, "(String, String, Int, Unit)"))
199- then true
200- else $isInstanceOf($match0, "(String, String, Int, Int)")
201- else false)
202- then {
203- let registrant_ = $match0._1
204- let resolver_ = $match0._2
205- let nameCreated_ = $match0._3
206- let nameExpires_ = $match0._4
207- $Tuple2(nil, $Tuple4(registrant_, resolver_, nameCreated_, nameExpires_))
208- }
209- else $Tuple2(nil, parentInfo)
210- }
169+ registrantAddress
170+ }, match resolver {
171+ case resolver: String =>
172+ resolver
173+ case _ =>
174+ parentResolver
175+ }, match nameCreated {
176+ case nameCreated: Int =>
177+ nameCreated
178+ case _ =>
179+ parentCreated
180+ }, nameExpires))
211181 })
212182
213183
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 func getStringOrThrow (address,key) = valueOrErrorMessage(getString(address, key), ((("Can't read '" + key) + "' at address ") + toString(address)))
55
66
77 func getIntegerOrThrow (address,key) = valueOrErrorMessage(getInteger(address, key), ((("Can't read '" + key) + "' at address ") + toString(address)))
88
99
1010 func parseAddressOrThrow (maybeAddress) = valueOrErrorMessage(addressFromString(maybeAddress), (("Can't parse address from '" + maybeAddress) + "'"))
1111
1212
1313 func key_entity (name,pk,property) = ((((name + "_") + pk) + "_") + property)
1414
1515
1616 func key_Name_owner (node) = key_entity("Name", node, "owner")
1717
1818
1919 func key_Name_resolver (node) = key_entity("Name", node, "resolver")
2020
2121
2222 func key_Name_createdAt (node) = key_entity("Name", node, "createdAt")
2323
2424
2525 func _getOwner (node) = getString(this, key_Name_owner(node))
2626
2727
2828 func _setOwner (node,owner) = [StringEntry(key_Name_owner(node), owner)]
2929
3030
3131 func _getResolver (node) = getString(this, key_Name_resolver(node))
3232
3333
3434 func _setResolver (node,resolver) = [StringEntry(key_Name_resolver(node), resolver)]
3535
3636
3737 func _getCreatedAt (node) = getInteger(this, key_Name_createdAt(node))
3838
3939
4040 func _setCreatedAt (node,createdAt) = [IntegerEntry(key_Name_createdAt(node), createdAt)]
4141
4242
4343 func isAdmin (inv) = (inv.caller == this)
4444
4545
4646 func isOwner (inv,node) = (toString(inv.caller) == valueOrElse(_getOwner(node), ""))
4747
4848
4949 func _splitLastLabel (name) = {
5050 let labels = split(name, ".")
5151 let lastIndex = (size(labels) - 1)
5252 let lastLabel = labels[lastIndex]
5353 let restLabels = makeString(removeByIndex(labels, lastIndex), ".")
5454 $Tuple2(lastLabel, restLabels)
5555 }
5656
5757
58-func _findResolver (name) = {
59- let $t021972248 = _splitLastLabel(name)
60- let lastLabel = $t021972248._1
61- let restLabels = $t021972248._2
62- match invoke(this, "resolver", [lastLabel], nil) {
63- case resolverAddress: String =>
64- $Tuple2(addressFromString(resolverAddress), restLabels)
65- case _ =>
66- $Tuple2(unit, name)
67- }
68- }
58+func _supportedInterfaceAsString (registrant,interfaceId,restLabels) = match invoke(registrant, "supportsInterface", [interfaceId], nil) {
59+ case supportsInterface: Boolean =>
60+ if (!(supportsInterface))
61+ then unit
62+ else match invoke(value(registrant), interfaceId, [restLabels], nil) {
63+ case mayBeString: String =>
64+ mayBeString
65+ case _ =>
66+ unit
67+ }
68+ case _ =>
69+ unit
70+}
71+
72+
73+func _supportedInterfaceAsInt (registrant,interfaceId,restLabels) = match invoke(registrant, "supportsInterface", [interfaceId], nil) {
74+ case supportsInterface: Boolean =>
75+ if (!(supportsInterface))
76+ then unit
77+ else match invoke(value(registrant), interfaceId, [restLabels], nil) {
78+ case mayBeInt: Int =>
79+ mayBeInt
80+ case _ =>
81+ unit
82+ }
83+ case _ =>
84+ unit
85+}
6986
7087
7188 func modifiers (validations) = unit
7289
7390
7491 func onlyAdmin (inv) = if (isAdmin(inv))
7592 then unit
7693 else throw("Permission denied")
7794
7895
7996 func onlyOwner (inv,node) = if (if (isAdmin(inv))
8097 then true
8198 else isOwner(inv, node))
8299 then unit
83100 else throw("Permission denied")
84101
85102
86103 func validAddress (address) = if (isDefined(addressFromString(address)))
87104 then unit
88105 else throw("The address must be valid")
89106
90107
91108 @Callable(inv)
92109 func setOwner (node,owner) = valueOrElse(modifiers([onlyOwner(inv, node), validAddress(owner)]), _setOwner(node, owner))
93110
94111
95112
96113 @Callable(inv)
97114 func owner (node) = $Tuple2(nil, _getOwner(node))
98115
99116
100117
101118 @Callable(inv)
102119 func setResolver (node,resolver) = valueOrElse(modifiers([onlyOwner(inv, node), validAddress(resolver)]), _setResolver(node, resolver))
103120
104121
105122
106123 @Callable(inv)
107124 func resolver (node) = $Tuple2(nil, _getResolver(node))
108125
109126
110127
111128 @Callable(inv)
112129 func nameCreated (node) = $Tuple2(nil, _getCreatedAt(node))
113130
114131
115132
116133 @Callable(inv)
117134 func setRecord (node,owner,resolver) = valueOrElse(modifiers([onlyAdmin(inv)]), ((_setOwner(node, owner) ++ _setResolver(node, resolver)) ++ _setCreatedAt(node, lastBlock.timestamp)))
118135
119136
120137
121138 @Callable(inv)
122139 func whoIs (name) = valueOrElse(modifiers([if ((size(name) > 0))
123140 then unit
124141 else throw("Name cannot be empty")]), {
125- let $t040804131 = _splitLastLabel(name)
126- let lastLabel = $t040804131._1
127- let restLabels = $t040804131._2
142+ let $t046304681 = _splitLastLabel(name)
143+ let lastLabel = $t046304681._1
144+ let restLabels = $t046304681._2
128145 let registrantAddress = _getOwner(lastLabel)
129146 let registrant = match registrantAddress {
130147 case owner: String =>
131148 addressFromString(owner)
132149 case _ =>
133150 unit
134151 }
135- let resolver = _getResolver(lastLabel)
136- let nameCreated = _getCreatedAt(lastLabel)
137- let parentInfo = $Tuple4(registrantAddress, resolver, nameCreated, unit)
152+ let parentResolver = _getResolver(lastLabel)
153+ let parentCreated = _getCreatedAt(lastLabel)
154+ let owner = _supportedInterfaceAsString(value(registrant), "owner", restLabels)
155+ let resolver = _supportedInterfaceAsString(value(registrant), "resolver", restLabels)
156+ let nameCreated = _supportedInterfaceAsInt(value(registrant), "nameCreated", restLabels)
157+ let nameExpires = _supportedInterfaceAsInt(value(registrant), "nameExpires", restLabels)
138158 let isRootName = if ((size(lastLabel) > 0))
139159 then (size(restLabels) == 0)
140160 else false
141- let supportsInterface = match invoke(value(registrant), "supportsInterface", ["whoIs"], nil) {
142- case supportsInterface: Boolean =>
143- supportsInterface
144- case _ =>
145- false
146- }
147- if (if (if (isRootName)
161+ if (if (isRootName)
148162 then true
149163 else !(isDefined(registrant)))
150- then true
151- else !(supportsInterface))
152- then $Tuple2(nil, parentInfo)
153- else match invoke(value(registrant), "whoIs", [value(restLabels)], nil) {
164+ then $Tuple2(nil, $Tuple4(registrantAddress, parentResolver, parentCreated, unit))
165+ else $Tuple2(nil, $Tuple4( match owner {
166+ case owner: String =>
167+ owner
154168 case _ =>
155- if (if (if (if ($isInstanceOf($match0._1, "String"))
156- then true
157- else $isInstanceOf($match0._1, "Unit"))
158- then if (if ($isInstanceOf($match0._2, "String"))
159- then true
160- else $isInstanceOf($match0._2, "Unit"))
161- then if (if ($isInstanceOf($match0._3, "Int"))
162- then true
163- else $isInstanceOf($match0._3, "Unit"))
164- then if ($isInstanceOf($match0._4, "Int"))
165- then true
166- else $isInstanceOf($match0._4, "Unit")
167- else false
168- else false
169- else false)
170- then if (if (if (if (if (if (if (if (if (if (if (if (if (if (if ($isInstanceOf($match0, "(Unit, Unit, Unit, Unit)"))
171- then true
172- else $isInstanceOf($match0, "(Unit, Unit, Unit, Int)"))
173- then true
174- else $isInstanceOf($match0, "(Unit, Unit, Int, Unit)"))
175- then true
176- else $isInstanceOf($match0, "(Unit, Unit, Int, Int)"))
177- then true
178- else $isInstanceOf($match0, "(Unit, String, Unit, Unit)"))
179- then true
180- else $isInstanceOf($match0, "(Unit, String, Unit, Int)"))
181- then true
182- else $isInstanceOf($match0, "(Unit, String, Int, Unit)"))
183- then true
184- else $isInstanceOf($match0, "(Unit, String, Int, Int)"))
185- then true
186- else $isInstanceOf($match0, "(String, Unit, Unit, Unit)"))
187- then true
188- else $isInstanceOf($match0, "(String, Unit, Unit, Int)"))
189- then true
190- else $isInstanceOf($match0, "(String, Unit, Int, Unit)"))
191- then true
192- else $isInstanceOf($match0, "(String, Unit, Int, Int)"))
193- then true
194- else $isInstanceOf($match0, "(String, String, Unit, Unit)"))
195- then true
196- else $isInstanceOf($match0, "(String, String, Unit, Int)"))
197- then true
198- else $isInstanceOf($match0, "(String, String, Int, Unit)"))
199- then true
200- else $isInstanceOf($match0, "(String, String, Int, Int)")
201- else false)
202- then {
203- let registrant_ = $match0._1
204- let resolver_ = $match0._2
205- let nameCreated_ = $match0._3
206- let nameExpires_ = $match0._4
207- $Tuple2(nil, $Tuple4(registrant_, resolver_, nameCreated_, nameExpires_))
208- }
209- else $Tuple2(nil, parentInfo)
210- }
169+ registrantAddress
170+ }, match resolver {
171+ case resolver: String =>
172+ resolver
173+ case _ =>
174+ parentResolver
175+ }, match nameCreated {
176+ case nameCreated: Int =>
177+ nameCreated
178+ case _ =>
179+ parentCreated
180+ }, nameExpires))
211181 })
212182
213183

github/deemru/w8io/026f985 
52.18 ms