tx · FqLWGMt8tdDw1xzW4MzwEmtaqyt1VJMpmDsHNy8yUr8C

3MrF6QFGLaSKfoNPMd8L3u7KYNm7cE43Ydw:  -0.01000000 Waves

2022.10.17 13:49 [2276271] smart account 3MrF6QFGLaSKfoNPMd8L3u7KYNm7cE43Ydw > SELF 0.00000000 Waves

{ "type": 13, "id": "FqLWGMt8tdDw1xzW4MzwEmtaqyt1VJMpmDsHNy8yUr8C", "fee": 1000000, "feeAssetId": null, "timestamp": 1666003800545, "version": 2, "chainId": 84, "sender": "3MrF6QFGLaSKfoNPMd8L3u7KYNm7cE43Ydw", "senderPublicKey": "6NSakbUsm1WyESQ8yj3qpc1kQUfHWNd5C6CHVpbs4X7c", "proofs": [ "47t4BMUGo7Qw7FDEe45zhPhFxNJKNY8skRoXSAUvhuTRCHFoRytRAhmGF57tzUiPV7tmXZrRvMe6DTwrpvTQtnuB" ], "script": "base64:AAIFAAAAAAAAABcIAhIDCgEIEgMKAQgSAwoBCBIECgIICAAAABEBAAAAEGdldFN0cmluZ09yVGhyb3cAAAACAAAAB2FkZHJlc3MAAAADa2V5CQEAAAATdmFsdWVPckVycm9yTWVzc2FnZQAAAAIJAAQdAAAAAgUAAAAHYWRkcmVzcwUAAAADa2V5CQABLAAAAAIJAAEsAAAAAgkAASwAAAACAgAAAAxDYW4ndCByZWFkICcFAAAAA2tleQIAAAANJyBhdCBhZGRyZXNzIAkABCUAAAABBQAAAAdhZGRyZXNzAQAAABNwYXJzZUFkZHJlc3NPclRocm93AAAAAQAAAAxtYXliZUFkZHJlc3MJAQAAABN2YWx1ZU9yRXJyb3JNZXNzYWdlAAAAAgkABCYAAAABBQAAAAxtYXliZUFkZHJlc3MJAAEsAAAAAgkAASwAAAACAgAAABpDYW4ndCBwYXJzZSBhZGRyZXNzIGZyb20gJwUAAAAMbWF5YmVBZGRyZXNzAgAAAAEnAQAAAA1rZXlfTmFtZV9hZGRyAAAAAQAAAARuYW1lCQABLAAAAAIJAAEsAAAAAgIAAAAFT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AAAAAABQAAAAR1bml0CQAAAgAAAAECAAAAFE5hbWUgY2Fubm90IGJlIGVtcHR5BQAAAANuaWwJAAUUAAAAAgUAAAADbmlsCQEAAAAIX3Jlc29sdmUAAAACBQAAAARuYW1lAgAAAARhZGRyAAAAA2ludgEAAAAHc2V0QWRkcgAAAAIAAAAEbmFtZQAAAAdhZGRyZXNzCQEAAAALdmFsdWVPckVsc2UAAAACCQEAAAAJbW9kaWZpZXJzAAAAAQkABEwAAAACAwkAAGYAAAACCQABMQAAAAEFAAAABG5hbWUAAAAAAAAAAAAFAAAABHVuaXQJAAACAAAAAQIAAAAUTmFtZSBjYW5ub3QgYmUgZW1wdHkJAARMAAAAAgkBAAAACW9ubHlPd25lcgAAAAIFAAAAA2ludgUAAAAEbmFtZQkABEwAAAACAwkBAAAACWlzRGVmaW5lZAAAAAEJAAQmAAAAAQUAAAAHYWRkcmVzcwUAAAAEdW5pdAkAAAIAAAABAgAAABVBZGRyZXNzIG11c3QgYmUgdmFsaWQFAAAAA25pbAkBAAAACF9zZXRBZGRyAAAAAgUAAAAEbmFtZQUAAAAHYWRkcmVzcwAAAADsCN+Y", "height": 2276271, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: CyYLz38JrK3Q6PzpxbkjXqST3fqc6tyYkzVp52qe5tun Next: Gdsc7XwZzoKPRENzieaFGcczf27XDvtadgU4W9XM9vm Diff:
OldNewDifferences
8080 let $t023892437 = _findResolver(name)
8181 let resolver = $t023892437._1
8282 let restLabels = $t023892437._2
83- let $t024432619 = match callData {
83+ let $t024432581 = match callData {
8484 case _ =>
8585 if (("addr" == $match0))
86- then $Tuple3("addr", [value(restLabels)], _getAddr(name))
87- else $Tuple3(unit, unit, unit)
86+ then $Tuple2("addr", [value(restLabels)])
87+ else $Tuple2(unit, unit)
8888 }
89- let callFunction = $t024432619._1
90- let callArgs = $t024432619._2
91- let returnsDefault = $t024432619._3
89+ let callFunction = $t024432581._1
90+ let callArgs = $t024432581._2
9291 let supportsInterface = match invoke(value(resolver), "supportsInterface", [callData], nil) {
9392 case supportsInterface: Boolean =>
9493 supportsInterface
9897 if (if (!(isDefined(resolver)))
9998 then true
10099 else (size(restLabels) == 0))
101- then returnsDefault
100+ then unit
102101 else if (!(supportsInterface))
103102 then unit
104103 else match invoke(value(resolver), value(callFunction), value(callArgs), nil) {
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
3434 func _getAddr (name) = valueOrElse(getString(this, key_Name_addr(name)), _getOwner(_splitLastLabel(name)._1))
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) = {
6565 let $t019602011 = _splitLastLabel(name)
6666 let lastLabel = $t019602011._1
6767 let restLabels = $t019602011._2
6868 if ((size(restLabels) == 0))
6969 then $Tuple2(unit, name)
7070 else match invoke(registry, "resolver", [lastLabel], nil) {
7171 case resolverAddress: String =>
7272 $Tuple2(addressFromString(resolverAddress), restLabels)
7373 case _ =>
7474 $Tuple2(unit, name)
7575 }
7676 }
7777
7878
7979 func _resolve (name,callData) = {
8080 let $t023892437 = _findResolver(name)
8181 let resolver = $t023892437._1
8282 let restLabels = $t023892437._2
83- let $t024432619 = match callData {
83+ let $t024432581 = match callData {
8484 case _ =>
8585 if (("addr" == $match0))
86- then $Tuple3("addr", [value(restLabels)], _getAddr(name))
87- else $Tuple3(unit, unit, unit)
86+ then $Tuple2("addr", [value(restLabels)])
87+ else $Tuple2(unit, unit)
8888 }
89- let callFunction = $t024432619._1
90- let callArgs = $t024432619._2
91- let returnsDefault = $t024432619._3
89+ let callFunction = $t024432581._1
90+ let callArgs = $t024432581._2
9291 let supportsInterface = match invoke(value(resolver), "supportsInterface", [callData], nil) {
9392 case supportsInterface: Boolean =>
9493 supportsInterface
9594 case _ =>
9695 false
9796 }
9897 if (if (!(isDefined(resolver)))
9998 then true
10099 else (size(restLabels) == 0))
101- then returnsDefault
100+ then unit
102101 else if (!(supportsInterface))
103102 then unit
104103 else match invoke(value(resolver), value(callFunction), value(callArgs), nil) {
105104 case maybeAddr: String =>
106105 if (isValidAddress(maybeAddr))
107106 then maybeAddr
108107 else unit
109108 case _ =>
110109 unit
111110 }
112111 }
113112
114113
115114 @Callable(inv)
116115 func init (registryAddress) = valueOrElse(modifiers([onlyAdmin(inv)]), [StringEntry(key_registry, registryAddress)])
117116
118117
119118
120119 @Callable(inv)
121120 func supportsInterface (interfaceId) = $Tuple2(nil, (interfaceId == "addr"))
122121
123122
124123
125124 @Callable(inv)
126125 func addr (name) = valueOrElse(modifiers([if ((size(name) > 0))
127126 then unit
128127 else throw("Name cannot be empty")]), $Tuple2(nil, _resolve(name, "addr")))
129128
130129
131130
132131 @Callable(inv)
133132 func setAddr (name,address) = valueOrElse(modifiers([if ((size(name) > 0))
134133 then unit
135134 else throw("Name cannot be empty"), onlyOwner(inv, name), if (isDefined(addressFromString(address)))
136135 then unit
137136 else throw("Address must be valid")]), _setAddr(name, address))
138137
139138

github/deemru/w8io/169f3d6 
32.56 ms