tx · 7qLMYXMXjpehaResukaezEZutB2qqVVBeWV2aVbShZjZ

3MrF6QFGLaSKfoNPMd8L3u7KYNm7cE43Ydw:  -0.01000000 Waves

2022.10.17 13:55 [2276277] smart account 3MrF6QFGLaSKfoNPMd8L3u7KYNm7cE43Ydw > SELF 0.00000000 Waves

{ "type": 13, "id": "7qLMYXMXjpehaResukaezEZutB2qqVVBeWV2aVbShZjZ", "fee": 1000000, "feeAssetId": null, "timestamp": 1666004174834, "version": 2, "chainId": 84, "sender": "3MrF6QFGLaSKfoNPMd8L3u7KYNm7cE43Ydw", "senderPublicKey": "6NSakbUsm1WyESQ8yj3qpc1kQUfHWNd5C6CHVpbs4X7c", "proofs": [ "5iLCbg7J7byvCZD5ArAuivckKaLGrZMp3GRdqvqCSfXYkEcLTD3MjHkZgZBPsyjP2n9JDmScdm4pGkW7ZAjxYwKF" ], "script": "base64:AAIFAAAAAAAAABcIAhIDCgEIEgMKAQgSAwoBCBIECgIICAAAABEBAAAAEGdldFN0cmluZ09yVGhyb3cAAAACAAAAB2FkZHJlc3MAAAADa2V5CQEAAAATdmFsdWVPckVycm9yTWVzc2FnZQAAAAIJAAQdAAAAAgUAAAAHYWRkcmVzcwUAAAADa2V5CQABLAAAAAIJAAEsAAAAAgkAASwAAAACAgAAAAxDYW4ndCByZWFkICcFAAAAA2tleQIAAAANJyBhdCBhZGRyZXNzIAkABCUAAAABBQAAAAdhZGRyZXNzAQAAABNwYXJzZUFkZHJlc3NPclRocm93AAAAAQAAAAxtYXliZUFkZHJlc3MJAQAAABN2YWx1ZU9yRXJyb3JNZXNzYWdlAAAAAgkABCYAAAABBQAAAAxtYXliZUFkZHJlc3MJAAEsAAAAAgkAASwAAAACAgAAABpDYW4ndCBwYXJzZSBhZGRyZXNzIGZyb20gJwUAAAAMbWF5YmVBZGRyZXNzAgAAAAEnAQAAAA1rZXlfTmFtZV9hZGRyAAAAAQAAAARuYW1lCQABLAAAAAIJAAEsAAAAAgIAAAAFTmFtZV8FAAA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kAgAAAARhZGRyAAAAA2ludgEAAAAEYWRkcgAAAAEAAAAEbmFtZQkBAAAAC3ZhbHVlT3JFbHNlAAAAAgkBAAAACW1vZGlmaWVycwAAAAEJAARMAAAAAgMJAABmAAAAAgkAATEAAAABBQAAAARuYW1lAAAAAAAAAAAABQAAAAR1bml0CQAAAgAAAAECAAAAFE5hbWUgY2Fubm90IGJlIGVtcHR5BQAAAANuaWwJAAUUAAAAAgUAAAADbmlsCQEAAAAIX3Jlc29sdmUAAAACBQAAAARuYW1lAgAAAARhZGRyAAAAA2ludgEAAAAHc2V0QWRkcgAAAAIAAAAEbmFtZQAAAAdhZGRyZXNzCQEAAAALdmFsdWVPckVsc2UAAAACCQEAAAAJbW9kaWZpZXJzAAAAAQkABEwAAAACAwkAAGYAAAACCQABMQAAAAEFAAAABG5hbWUAAAAAAAAAAAAFAAAABHVuaXQJAAACAAAAAQIAAAAUTmFtZSBjYW5ub3QgYmUgZW1wdHkJAARMAAAAAgkBAAAACW9ubHlPd25lcgAAAAIFAAAAA2ludgUAAAAEbmFtZQkABEwAAAACAwkBAAAACWlzRGVmaW5lZAAAAAEJAAQmAAAAAQUAAAAHYWRkcmVzcwUAAAAEdW5pdAkAAAIAAAABAgAAABVBZGRyZXNzIG11c3QgYmUgdmFsaWQFAAAAA25pbAkBAAAACF9zZXRBZGRyAAAAAgUAAAAEbmFtZQUAAAAHYWRkcmVzcwAAAAD3kIoY", "height": 2276277, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: Gdsc7XwZzoKPRENzieaFGcczf27XDvtadgU4W9XM9vm Next: none Diff:
OldNewDifferences
3131 }
3232
3333
34-func _getAddr (name) = valueOrElse(getString(this, key_Name_addr(name)), _getOwner(_splitLastLabel(name)._1))
34+func _getAddr (name) = valueOrElse(getString(this, key_Name_addr(name)), _getOwner(name))
3535
3636
3737 func _setAddr (name,address) = [StringEntry(key_Name_addr(name), address)]
6262
6363
6464 func _findResolver (name) = {
65- let $t019602011 = _splitLastLabel(name)
66- let lastLabel = $t019602011._1
67- let restLabels = $t019602011._2
65+ let $t019331984 = _splitLastLabel(name)
66+ let lastLabel = $t019331984._1
67+ let restLabels = $t019331984._2
6868 if ((size(restLabels) == 0))
6969 then $Tuple3(unit, lastLabel, restLabels)
7070 else match invoke(registry, "resolver", [lastLabel], nil) {
7777
7878
7979 func _resolve (name,callData) = {
80- let $t024342489 = _findResolver(name)
81- let resolver = $t024342489._1
82- let label = $t024342489._2
83- let restLabels = $t024342489._3
84- let $t024952672 = match callData {
80+ let $t024072462 = _findResolver(name)
81+ let resolver = $t024072462._1
82+ let label = $t024072462._2
83+ let restLabels = $t024072462._3
84+ let $t024682645 = match callData {
8585 case _ =>
8686 if (("addr" == $match0))
8787 then $Tuple3("addr", [value(restLabels)], _getAddr(label))
8888 else $Tuple3(unit, unit, unit)
8989 }
90- let callFunction = $t024952672._1
91- let callArgs = $t024952672._2
92- let returnsDefault = $t024952672._3
90+ let callFunction = $t024682645._1
91+ let callArgs = $t024682645._2
92+ let returnsDefault = $t024682645._3
9393 let supportsInterface = match invoke(value(resolver), "supportsInterface", [callData], nil) {
9494 case supportsInterface: Boolean =>
9595 supportsInterface
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 parseAddressOrThrow (maybeAddress) = valueOrErrorMessage(addressFromString(maybeAddress), (("Can't parse address from '" + maybeAddress) + "'"))
88
99
1010 func key_Name_addr (name) = (("Name_" + name) + "_addr")
1111
1212
1313 let key_registry = "registry"
1414
1515 let registry = parseAddressOrThrow(getStringOrThrow(this, key_registry))
1616
1717 func _splitLastLabel (name) = {
1818 let labels = split(name, ".")
1919 let lastIndex = (size(labels) - 1)
2020 let lastLabel = labels[lastIndex]
2121 let restLabels = makeString(removeByIndex(labels, lastIndex), ".")
2222 $Tuple2(lastLabel, restLabels)
2323 }
2424
2525
2626 func _getOwner (name) = match invoke(registry, "owner", [name], nil) {
2727 case owner: String =>
2828 owner
2929 case _ =>
3030 unit
3131 }
3232
3333
34-func _getAddr (name) = valueOrElse(getString(this, key_Name_addr(name)), _getOwner(_splitLastLabel(name)._1))
34+func _getAddr (name) = valueOrElse(getString(this, key_Name_addr(name)), _getOwner(name))
3535
3636
3737 func _setAddr (name,address) = [StringEntry(key_Name_addr(name), address)]
3838
3939
4040 func isAdmin (inv) = (inv.caller == this)
4141
4242
4343 func isOwner (inv,name) = (toString(inv.caller) == valueOrElse(_getOwner(name), ""))
4444
4545
4646 func isValidAddress (maybeAddress) = isDefined(addressFromString(maybeAddress))
4747
4848
4949 func modifiers (validations) = unit
5050
5151
5252 func onlyAdmin (inv) = if (isAdmin(inv))
5353 then unit
5454 else throw("Permission denied")
5555
5656
5757 func onlyOwner (inv,name) = if (if (isAdmin(inv))
5858 then true
5959 else isOwner(inv, name))
6060 then unit
6161 else throw("Permission denied")
6262
6363
6464 func _findResolver (name) = {
65- let $t019602011 = _splitLastLabel(name)
66- let lastLabel = $t019602011._1
67- let restLabels = $t019602011._2
65+ let $t019331984 = _splitLastLabel(name)
66+ let lastLabel = $t019331984._1
67+ let restLabels = $t019331984._2
6868 if ((size(restLabels) == 0))
6969 then $Tuple3(unit, lastLabel, restLabels)
7070 else match invoke(registry, "resolver", [lastLabel], nil) {
7171 case resolverAddress: String =>
7272 $Tuple3(addressFromString(resolverAddress), lastLabel, restLabels)
7373 case _ =>
7474 $Tuple3(unit, lastLabel, restLabels)
7575 }
7676 }
7777
7878
7979 func _resolve (name,callData) = {
80- let $t024342489 = _findResolver(name)
81- let resolver = $t024342489._1
82- let label = $t024342489._2
83- let restLabels = $t024342489._3
84- let $t024952672 = match callData {
80+ let $t024072462 = _findResolver(name)
81+ let resolver = $t024072462._1
82+ let label = $t024072462._2
83+ let restLabels = $t024072462._3
84+ let $t024682645 = match callData {
8585 case _ =>
8686 if (("addr" == $match0))
8787 then $Tuple3("addr", [value(restLabels)], _getAddr(label))
8888 else $Tuple3(unit, unit, unit)
8989 }
90- let callFunction = $t024952672._1
91- let callArgs = $t024952672._2
92- let returnsDefault = $t024952672._3
90+ let callFunction = $t024682645._1
91+ let callArgs = $t024682645._2
92+ let returnsDefault = $t024682645._3
9393 let supportsInterface = match invoke(value(resolver), "supportsInterface", [callData], nil) {
9494 case supportsInterface: Boolean =>
9595 supportsInterface
9696 case _ =>
9797 false
9898 }
9999 if (!(isDefined(resolver)))
100100 then returnsDefault
101101 else if (!(supportsInterface))
102102 then unit
103103 else match invoke(value(resolver), value(callFunction), value(callArgs), nil) {
104104 case maybeAddr: String =>
105105 if (isValidAddress(maybeAddr))
106106 then maybeAddr
107107 else unit
108108 case _ =>
109109 unit
110110 }
111111 }
112112
113113
114114 @Callable(inv)
115115 func init (registryAddress) = valueOrElse(modifiers([onlyAdmin(inv)]), [StringEntry(key_registry, registryAddress)])
116116
117117
118118
119119 @Callable(inv)
120120 func supportsInterface (interfaceId) = $Tuple2(nil, (interfaceId == "addr"))
121121
122122
123123
124124 @Callable(inv)
125125 func addr (name) = valueOrElse(modifiers([if ((size(name) > 0))
126126 then unit
127127 else throw("Name cannot be empty")]), $Tuple2(nil, _resolve(name, "addr")))
128128
129129
130130
131131 @Callable(inv)
132132 func setAddr (name,address) = valueOrElse(modifiers([if ((size(name) > 0))
133133 then unit
134134 else throw("Name cannot be empty"), onlyOwner(inv, name), if (isDefined(addressFromString(address)))
135135 then unit
136136 else throw("Address must be valid")]), _setAddr(name, address))
137137
138138

github/deemru/w8io/169f3d6 
39.71 ms