tx · 2QG8r1ieF2eKvUXT467wyJyZHis3y9AZC5VE9VXJjQva

3MxquWQhzpqXgbqunnFqHFJXTjasEznd1tN:  -0.01000000 Waves

2022.10.20 08:23 [2280287] smart account 3MxquWQhzpqXgbqunnFqHFJXTjasEznd1tN > SELF 0.00000000 Waves

{ "type": 13, "id": "2QG8r1ieF2eKvUXT467wyJyZHis3y9AZC5VE9VXJjQva", "fee": 1000000, "feeAssetId": null, "timestamp": 1666243412716, "version": 2, "chainId": 84, "sender": "3MxquWQhzpqXgbqunnFqHFJXTjasEznd1tN", "senderPublicKey": "GDjexdefwEhShjRTvHgazn3gTrDo74eHpJCAz14cAEeh", "proofs": [ "V4j58KnXEXEN9V6Svw7PJv8qVVGckEbpjxgFaYhoNa6JATFNZTbdmqhpLBXpkodupW1UW8vD1qRMdfHQERTjNMW" ], "script": "base64:AAIFAAAAAAAAAC4IAhIDCgEIEgQKAggIEgMKAQgSAwoBCBIECgIICBIDCgEIEgUKAwgICBIDCgEIAAAAFgEAAAAQZ2V0U3RyaW5nT3JUaHJvdwAAAAIAAAAHYWRkcmVzcwAAAANrZXkJAQAAABN2YWx1ZU9yRXJyb3JNZXNzYWdlAAAAAgkABB0AAAACBQAAAAdhZGRyZXNzBQAAAANrZXkJAAEsAAAAAgkAASwAAAACCQABLAAAAAICAAAADENhbid0IHJlYWQgJwUAAAADa2V5AgAAAA0nIGF0IGFkZHJlc3MgCQAEJQAAAAEFAAAAB2FkZHJlc3MBAAAAEWdldEludGVnZXJPclRocm93AAAAAgAAAAdhZGRyZXNzAAAAA2tleQkBAAAAE3ZhbHVlT3JFcnJvck1lc3NhZ2UAAAACCQAEGgAAAAIFAAAAB2FkZHJlc3MFAAAAA2tleQkAASwAAAACCQABLAAAAAIJAAEsAAAAAgIAAAAMQ2FuJ3QgcmVhZCAnBQAAAANrZXkCAAAADScgYXQgYWRkcmVzcyAJAAQlAAAAAQUAAAAHYWRkcmVzcwEAAAATcGFyc2VBZGRyZXNzT3JUaHJvd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AAQAAAAIFAAAAByRtYXRjaDACAAAAA0ludAQAAAALbmFtZUNyZWF0ZWQFAAAAByRtYXRjaDAFAAAAC25hbWVDcmVhdGVkBQAAAA1wYXJlbnRDcmVhdGVkBQAAAAtuYW1lRXhwaXJlcwAAAADiskDl", "height": 2280287, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: CbobkH99ae7vcVdNwXg2Rmp12nsUv8akiZH9w8zDcd9b Next: 9qMS9ASYKcTdxtrPwHbxMfgxZyQeDZKMr8oLfTPKmxZb Diff:
OldNewDifferences
212212 owner
213213 case _ =>
214214 parentOwnerAddress
215- }, registrar, resolver, nameCreated, nameExpires))
215+ }, match registrar {
216+ case registrar: String =>
217+ registrar
218+ case _ =>
219+ parentRegistrarAddress
220+ }, match resolver {
221+ case resolver: String =>
222+ resolver
223+ case _ =>
224+ parentResolver
225+ }, match nameCreated {
226+ case nameCreated: Int =>
227+ nameCreated
228+ case _ =>
229+ parentCreated
230+ }, nameExpires))
216231 })
217232
218233
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 _getRegistrar (node) = getString(this, key_Name_owner(node))
3232
3333
3434 func _getResolver (node) = getString(this, key_Name_resolver(node))
3535
3636
3737 func _setResolver (node,resolver) = [StringEntry(key_Name_resolver(node), resolver)]
3838
3939
4040 func _getCreatedAt (node) = getInteger(this, key_Name_createdAt(node))
4141
4242
4343 func _setCreatedAt (node,createdAt) = [IntegerEntry(key_Name_createdAt(node), createdAt)]
4444
4545
4646 func isAdmin (inv) = (inv.caller == this)
4747
4848
4949 func isOwner (inv,node) = (toString(inv.caller) == valueOrElse(_getOwner(node), ""))
5050
5151
5252 func isValidAddress (maybeAddress) = isDefined(addressFromString(maybeAddress))
5353
5454
5555 func _splitTLD (name) = {
5656 let labels = split(name, ".")
5757 let lastIndex = (size(labels) - 1)
5858 let lastLabel = labels[lastIndex]
5959 let restLabels = makeString(removeByIndex(labels, lastIndex), ".")
6060 $Tuple2(lastLabel, restLabels)
6161 }
6262
6363
6464 func _callSupportedInterface (registrant,interfaceId,restLabels) = match invoke(registrant, "supportsInterface", [interfaceId], nil) {
6565 case supportsInterface: Boolean =>
6666 if (!(supportsInterface))
6767 then unit
6868 else match invoke(value(registrant), interfaceId, [restLabels], nil) {
6969 case maybeString: String =>
7070 maybeString
7171 case maybeInt: Int =>
7272 maybeInt
7373 case _ =>
7474 unit
7575 }
7676 case _ =>
7777 unit
7878 }
7979
8080
8181 func modifiers (validations) = unit
8282
8383
8484 func onlyAdmin (inv) = if (isAdmin(inv))
8585 then unit
8686 else throw("Permission denied")
8787
8888
8989 func onlyOwner (inv,node) = if (if (isAdmin(inv))
9090 then true
9191 else isOwner(inv, node))
9292 then unit
9393 else throw("Permission denied")
9494
9595
9696 @Callable(inv)
9797 func owner (node) = $Tuple2(nil, _getOwner(node))
9898
9999
100100
101101 @Callable(inv)
102102 func setOwner (node,owner) = valueOrElse(modifiers([onlyOwner(inv, node), if (isValidAddress(owner))
103103 then unit
104104 else throw("Owner must be a valid address")]), _setOwner(node, owner))
105105
106106
107107
108108 @Callable(inv)
109109 func registrar (node) = $Tuple2(nil, _getRegistrar(node))
110110
111111
112112
113113 @Callable(inv)
114114 func resolver (node) = $Tuple2(nil, _getResolver(node))
115115
116116
117117
118118 @Callable(inv)
119119 func setResolver (node,resolver) = valueOrElse(modifiers([onlyOwner(inv, node), if (isValidAddress(resolver))
120120 then unit
121121 else throw("Resolver must be a valid contract address")]), _setResolver(node, resolver))
122122
123123
124124
125125 @Callable(inv)
126126 func nameCreated (node) = $Tuple2(nil, _getCreatedAt(node))
127127
128128
129129
130130 @Callable(inv)
131131 func setRecord (node,owner,resolver) = valueOrElse(modifiers([onlyAdmin(inv)]), ((_setOwner(node, owner) ++ _setResolver(node, resolver)) ++ _setCreatedAt(node, lastBlock.timestamp)))
132132
133133
134134
135135 @Callable(inv)
136136 func whoIs (name) = valueOrElse(modifiers([if ((size(name) > 0))
137137 then unit
138138 else throw("Name cannot be empty")]), {
139139 let $t044844525 = _splitTLD(name)
140140 let label = $t044844525._1
141141 let restLabels = $t044844525._2
142142 let parentOwnerAddress = match _getOwner(label) {
143143 case owner: String =>
144144 if (isValidAddress(owner))
145145 then owner
146146 else unit
147147 case _ =>
148148 unit
149149 }
150150 let parentRegistrarAddress = match _getRegistrar(label) {
151151 case registrar: String =>
152152 if (isValidAddress(registrar))
153153 then registrar
154154 else unit
155155 case _ =>
156156 unit
157157 }
158158 let parentRegistrar = value(addressFromString(value(parentRegistrarAddress)))
159159 let parentResolver = _getResolver(label)
160160 let parentCreated = _getCreatedAt(label)
161161 let owner = match _callSupportedInterface(parentRegistrar, "owner", restLabels) {
162162 case owner: String =>
163163 if (isValidAddress(owner))
164164 then owner
165165 else unit
166166 case _ =>
167167 unit
168168 }
169169 let registrar = match _callSupportedInterface(parentRegistrar, "registrar", restLabels) {
170170 case registrar: String =>
171171 if (isValidAddress(registrar))
172172 then registrar
173173 else unit
174174 case _ =>
175175 unit
176176 }
177177 let resolver = match _callSupportedInterface(parentRegistrar, "resolver", restLabels) {
178178 case resolver: String =>
179179 if (isValidAddress(resolver))
180180 then resolver
181181 else unit
182182 case _ =>
183183 unit
184184 }
185185 let nameCreated = match _callSupportedInterface(parentRegistrar, "nameCreated", restLabels) {
186186 case nameCreated: Int =>
187187 if (if ((nameCreated > 0))
188188 then (lastBlock.timestamp > nameCreated)
189189 else false)
190190 then nameCreated
191191 else unit
192192 case _ =>
193193 unit
194194 }
195195 let nameExpires = match _callSupportedInterface(parentRegistrar, "nameExpires", restLabels) {
196196 case nameExpires: Int =>
197197 if ((nameExpires > 0))
198198 then nameExpires
199199 else unit
200200 case _ =>
201201 unit
202202 }
203203 let isRootName = if ((size(label) > 0))
204204 then (size(restLabels) == 0)
205205 else false
206206 if (if (isRootName)
207207 then true
208208 else !(isDefined(parentRegistrarAddress)))
209209 then $Tuple2(nil, $Tuple5(parentRegistrarAddress, parentOwnerAddress, parentResolver, parentCreated, unit))
210210 else $Tuple2(nil, $Tuple5( match owner {
211211 case owner: String =>
212212 owner
213213 case _ =>
214214 parentOwnerAddress
215- }, registrar, resolver, nameCreated, nameExpires))
215+ }, match registrar {
216+ case registrar: String =>
217+ registrar
218+ case _ =>
219+ parentRegistrarAddress
220+ }, match resolver {
221+ case resolver: String =>
222+ resolver
223+ case _ =>
224+ parentResolver
225+ }, match nameCreated {
226+ case nameCreated: Int =>
227+ nameCreated
228+ case _ =>
229+ parentCreated
230+ }, nameExpires))
216231 })
217232
218233

github/deemru/w8io/026f985 
33.57 ms