tx · HJs69bGWLZoxDjkYVFWb8CtmkRXR3TQnB3348YFQSrXm

3MvCgypmBZFTRqL5HuRwCgS7maC7Fkv7pZY:  -0.01000000 Waves

2022.10.25 12:39 [2287750] smart account 3MvCgypmBZFTRqL5HuRwCgS7maC7Fkv7pZY > SELF 0.00000000 Waves

{ "type": 13, "id": "HJs69bGWLZoxDjkYVFWb8CtmkRXR3TQnB3348YFQSrXm", "fee": 1000000, "feeAssetId": null, "timestamp": 1666690815608, "version": 2, "chainId": 84, "sender": "3MvCgypmBZFTRqL5HuRwCgS7maC7Fkv7pZY", "senderPublicKey": "BqGSAiYghM27RZ2Axx3bmTudq9koHT4575AeK31Wx2Pp", "proofs": [ "564tJsxG5iAYDEoKevyAjpBmipKPXTyQMcazqzmmTLyziaruZ2pqZsyEZk15z1ZhwjWiguNo3R97qgm1ddN9Ambb" ], "script": "base64:AAIFAAAAAAAAACkIAhIDCgEIEgQKAggIEgMKAQgSBAoCCAgSAwoBCBIFCgMICAgSAwoBCAAAABUBAAAAEGdldFN0cmluZ09yVGhyb3cAAAACAAAAB2FkZHJlc3MAAAADa2V5CQEAAAATdmFsdWVPckVycm9yTWVzc2FnZQAAAAIJAAQdAAAAAgUAAAAHYWRkcmVzcwUAAAADa2V5CQABLAAAAAIJAAEsAAAAAgkAASwAAAACAgAAAAxDYW4ndCByZWFkICcFAAAAA2tleQIAAAANJyBhdCBhZGRyZXNzIAkABCUAAAABBQAAAAdhZGRyZXNzAQAAABFnZXRJbnRlZ2VyT3JUaHJvdwAAAAIAAAAHYWRkcmVzcwAAAANrZXkJAQAAABN2YWx1ZU9yRXJyb3JNZXNzYWdlAAAAAgkABBoAAAACBQAAAAdhZGRyZXNzBQAAAANrZXkJAAEsAAAAAgkAASwAAAACCQABLAAAAAICAAAADENhbid0IHJlYWQgJwUAAAADa2V5AgAAAA0nIGF0IGFkZHJlc3MgCQAEJQAAAAEFAAAAB2FkZHJlc3MBAAAAE3BhcnNlQWRkcmVzc09yVGhyb3cA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l0aW1lc3RhbXAFAAAAC25hbWVDcmVhdGVkBwUAAAALbmFtZUNyZWF0ZWQFAAAABHVuaXQFAAAABHVuaXQEAAAAC25hbWVFeHBpcmVzBAAAAAckbWF0Y2gwCQEAAAAXX2NhbGxTdXBwb3J0ZWRJbnRlcmZhY2UAAAADBQAAAApyZWdpc3RyYW50AgAAAA5nZXROYW1lRXhwaXJlcwUAAAAKcmVzdExhYmVscwMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAADSW50BAAAAAtuYW1lRXhwaXJlcwUAAAAHJG1hdGNoMAMJAABmAAAAAgUAAAALbmFtZUV4cGlyZXMAAAAAAAAAAAAFAAAAC25hbWVFeHBpcmVzBQAAAAR1bml0BQAAAAR1bml0BAAAAAppc1Jvb3ROYW1lAwkAAGYAAAACCQABMQAAAAEFAAAACWxhc3RMYWJlbAAAAAAAAAAAAAkAAAAAAAACCQABMQAAAAEFAAAACnJlc3RMYWJlbHMAAAAAAAAAAAAHAwMFAAAACmlzUm9vdE5hbWUGCQEAAAABIQAAAAEJAQAAAAlpc0RlZmluZWQAAAABBQAAAA9tYXliZVJlZ2lzdHJhbnQJAAUUAAAAAgUAAAADbmlsCQAFFgAAAAQFAAAAEXJlZ2lzdHJhbnRBZGRyZXNzBQAAAA5wYXJlbnRSZXNvbHZlcgUAAAANcGFyZW50Q3JlYXRlZAUAAAAEdW5pdAkABRQAAAACBQAAAANuaWwJAAUWAAAABAUAAAAFb3duZXIFAAAACHJlc29sdmVyBQAAAAtuYW1lQ3JlYXRlZAUAAAALbmFtZUV4cGlyZXMAAAAAck3qBw==", "height": 2287750, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: HQKJNcgRN3YhsZ2sAG5HFQ6LGi9FbojNaB2yCrm51qis Next: 9KvWEzhLVMZZ5EzZdcz6cpoG6P1KyXzJh34posmuipBP Diff:
OldNewDifferences
9191
9292
9393 @Callable(inv)
94+func getOwner (node) = $Tuple2(nil, _getOwner(node))
95+
96+
97+
98+@Callable(inv)
9499 func setOwner (node,owner) = valueOrElse(modifiers([onlyOwner(inv, node), if (isValidAddress(owner))
95100 then unit
96101 else throw("Owner must be a valid address")]), _setOwner(node, owner))
98103
99104
100105 @Callable(inv)
101-func owner (node) = $Tuple2(nil, _getOwner(node))
102-
103-
104-
105-@Callable(inv)
106-func resolver (node) = $Tuple2(nil, _getResolver(node))
106+func getResolver (node) = $Tuple2(nil, _getResolver(node))
107107
108108
109109
115115
116116
117117 @Callable(inv)
118-func nameCreated (node) = $Tuple2(nil, _getCreatedAt(node))
118+func getNameCreated (node) = $Tuple2(nil, _getCreatedAt(node))
119119
120120
121121
128128 func whoIs (name) = valueOrElse(modifiers([if ((size(name) > 0))
129129 then unit
130130 else throw("Name cannot be empty")]), {
131- let $t043014352 = _splitLastLabel(name)
132- let lastLabel = $t043014352._1
133- let restLabels = $t043014352._2
131+ let $t045214572 = _splitLastLabel(name)
132+ let lastLabel = $t045214572._1
133+ let restLabels = $t045214572._2
134134 let registrantAddress = _getOwner(lastLabel)
135135 let maybeRegistrant = match registrantAddress {
136136 case owner: String =>
141141 let registrant = value(maybeRegistrant)
142142 let parentResolver = _getResolver(lastLabel)
143143 let parentCreated = _getCreatedAt(lastLabel)
144- let owner = match _callSupportedInterface(registrant, "owner", restLabels) {
144+ let owner = match _callSupportedInterface(registrant, "getOwner", restLabels) {
145145 case owner: String =>
146146 if (isValidAddress(owner))
147147 then owner
149149 case _ =>
150150 unit
151151 }
152- let resolver = match _callSupportedInterface(registrant, "resolver", restLabels) {
152+ let resolver = match _callSupportedInterface(registrant, "getResolver", restLabels) {
153153 case resolver: String =>
154154 if (isValidAddress(resolver))
155155 then resolver
157157 case _ =>
158158 unit
159159 }
160- let nameCreated = match _callSupportedInterface(registrant, "nameCreated", restLabels) {
160+ let nameCreated = match _callSupportedInterface(registrant, "getNameCreated", restLabels) {
161161 case nameCreated: Int =>
162162 if (if ((nameCreated > 0))
163163 then (lastBlock.timestamp > nameCreated)
167167 case _ =>
168168 unit
169169 }
170- let nameExpires = match _callSupportedInterface(registrant, "nameExpires", restLabels) {
170+ let nameExpires = match _callSupportedInterface(registrant, "getNameExpires", restLabels) {
171171 case nameExpires: Int =>
172172 if ((nameExpires > 0))
173173 then nameExpires
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 isValidAddress (maybeAddress) = isDefined(addressFromString(maybeAddress))
5050
5151
5252 func _splitLastLabel (name) = {
5353 let labels = split(name, ".")
5454 let lastIndex = (size(labels) - 1)
5555 let lastLabel = labels[lastIndex]
5656 let restLabels = makeString(removeByIndex(labels, lastIndex), ".")
5757 $Tuple2(lastLabel, restLabels)
5858 }
5959
6060
6161 func _callSupportedInterface (registrant,interfaceId,restLabels) = match invoke(registrant, "supportsInterface", [interfaceId], nil) {
6262 case supportsInterface: Boolean =>
6363 if (!(supportsInterface))
6464 then unit
6565 else match invoke(value(registrant), interfaceId, [restLabels], nil) {
6666 case maybeString: String =>
6767 maybeString
6868 case maybeInt: Int =>
6969 maybeInt
7070 case _ =>
7171 unit
7272 }
7373 case _ =>
7474 unit
7575 }
7676
7777
7878 func modifiers (validations) = unit
7979
8080
8181 func onlyAdmin (inv) = if (isAdmin(inv))
8282 then unit
8383 else throw("Permission denied")
8484
8585
8686 func onlyOwner (inv,node) = if (if (isAdmin(inv))
8787 then true
8888 else isOwner(inv, node))
8989 then unit
9090 else throw("Permission denied")
9191
9292
9393 @Callable(inv)
94+func getOwner (node) = $Tuple2(nil, _getOwner(node))
95+
96+
97+
98+@Callable(inv)
9499 func setOwner (node,owner) = valueOrElse(modifiers([onlyOwner(inv, node), if (isValidAddress(owner))
95100 then unit
96101 else throw("Owner must be a valid address")]), _setOwner(node, owner))
97102
98103
99104
100105 @Callable(inv)
101-func owner (node) = $Tuple2(nil, _getOwner(node))
102-
103-
104-
105-@Callable(inv)
106-func resolver (node) = $Tuple2(nil, _getResolver(node))
106+func getResolver (node) = $Tuple2(nil, _getResolver(node))
107107
108108
109109
110110 @Callable(inv)
111111 func setResolver (node,resolver) = valueOrElse(modifiers([onlyOwner(inv, node), if (isValidAddress(resolver))
112112 then unit
113113 else throw("Resolver must be a valid contract address")]), _setResolver(node, resolver))
114114
115115
116116
117117 @Callable(inv)
118-func nameCreated (node) = $Tuple2(nil, _getCreatedAt(node))
118+func getNameCreated (node) = $Tuple2(nil, _getCreatedAt(node))
119119
120120
121121
122122 @Callable(inv)
123123 func setRecord (node,owner,resolver) = valueOrElse(modifiers([onlyAdmin(inv)]), ((_setOwner(node, owner) ++ _setResolver(node, resolver)) ++ _setCreatedAt(node, lastBlock.timestamp)))
124124
125125
126126
127127 @Callable(inv)
128128 func whoIs (name) = valueOrElse(modifiers([if ((size(name) > 0))
129129 then unit
130130 else throw("Name cannot be empty")]), {
131- let $t043014352 = _splitLastLabel(name)
132- let lastLabel = $t043014352._1
133- let restLabels = $t043014352._2
131+ let $t045214572 = _splitLastLabel(name)
132+ let lastLabel = $t045214572._1
133+ let restLabels = $t045214572._2
134134 let registrantAddress = _getOwner(lastLabel)
135135 let maybeRegistrant = match registrantAddress {
136136 case owner: String =>
137137 addressFromString(owner)
138138 case _ =>
139139 unit
140140 }
141141 let registrant = value(maybeRegistrant)
142142 let parentResolver = _getResolver(lastLabel)
143143 let parentCreated = _getCreatedAt(lastLabel)
144- let owner = match _callSupportedInterface(registrant, "owner", restLabels) {
144+ let owner = match _callSupportedInterface(registrant, "getOwner", restLabels) {
145145 case owner: String =>
146146 if (isValidAddress(owner))
147147 then owner
148148 else unit
149149 case _ =>
150150 unit
151151 }
152- let resolver = match _callSupportedInterface(registrant, "resolver", restLabels) {
152+ let resolver = match _callSupportedInterface(registrant, "getResolver", restLabels) {
153153 case resolver: String =>
154154 if (isValidAddress(resolver))
155155 then resolver
156156 else unit
157157 case _ =>
158158 unit
159159 }
160- let nameCreated = match _callSupportedInterface(registrant, "nameCreated", restLabels) {
160+ let nameCreated = match _callSupportedInterface(registrant, "getNameCreated", restLabels) {
161161 case nameCreated: Int =>
162162 if (if ((nameCreated > 0))
163163 then (lastBlock.timestamp > nameCreated)
164164 else false)
165165 then nameCreated
166166 else unit
167167 case _ =>
168168 unit
169169 }
170- let nameExpires = match _callSupportedInterface(registrant, "nameExpires", restLabels) {
170+ let nameExpires = match _callSupportedInterface(registrant, "getNameExpires", restLabels) {
171171 case nameExpires: Int =>
172172 if ((nameExpires > 0))
173173 then nameExpires
174174 else unit
175175 case _ =>
176176 unit
177177 }
178178 let isRootName = if ((size(lastLabel) > 0))
179179 then (size(restLabels) == 0)
180180 else false
181181 if (if (isRootName)
182182 then true
183183 else !(isDefined(maybeRegistrant)))
184184 then $Tuple2(nil, $Tuple4(registrantAddress, parentResolver, parentCreated, unit))
185185 else $Tuple2(nil, $Tuple4(owner, resolver, nameCreated, nameExpires))
186186 })
187187
188188

github/deemru/w8io/169f3d6 
41.91 ms