tx · EnE51fMhdxW59yv3ircf8436S9rkarSPR77v7tELCKaq

3MrF6QFGLaSKfoNPMd8L3u7KYNm7cE43Ydw:  -0.01000000 Waves

2022.10.17 13:40 [2276263] smart account 3MrF6QFGLaSKfoNPMd8L3u7KYNm7cE43Ydw > SELF 0.00000000 Waves

{ "type": 13, "id": "EnE51fMhdxW59yv3ircf8436S9rkarSPR77v7tELCKaq", "fee": 1000000, "feeAssetId": null, "timestamp": 1666003237429, "version": 2, "chainId": 84, "sender": "3MrF6QFGLaSKfoNPMd8L3u7KYNm7cE43Ydw", "senderPublicKey": "6NSakbUsm1WyESQ8yj3qpc1kQUfHWNd5C6CHVpbs4X7c", "proofs": [ "5BDQTU7eHotKkRvb5VpnVzex6GhD3DcXpXM6nuMo9CQMzSTsQk939FtH2p1megrZfBQiBtiYqesyW5PuHRjbTyUQ" ], "script": "base64:AAIFAAAAAAAAABcIAhIDCgEIEgMKAQgSAwoBCBIECgIICAAAABEBAAAAEGdldFN0cmluZ09yVGhyb3cAAAACAAAAB2FkZHJlc3MAAAADa2V5CQEAAAATdmFsdWVPckVycm9yTWVzc2FnZQAAAAIJAAQdAAAAAgUAAAAHYWRkcmVzcwUAAAADa2V5CQABLAAAAAIJAAEsAAAAAgkAASwAAAACAgAAAAxDYW4ndCByZWFkICcFAAAAA2tleQIAAAANJyBhdCBhZGRyZXNzIAkABCUAAAABBQAAAAdhZGRyZXNzAQAAABNwYXJzZUFkZHJlc3NPclRocm93AAAAAQAAAAxtYXliZUFkZHJlc3MJAQAAABN2YWx1ZU9yRXJyb3JNZXNzYWdlAAAAAgkABCYAAAABBQAAAAxtYXliZUFkZHJlc3MJAAEsAAAAAgkAASwAAAACAgAAABpDYW4ndCBwYXJzZSBhZGRyZXNzIGZyb20gJwUAAAAMbWF5YmVBZGRyZXNzAgAAAAEnAQAAAA1rZXlfTmFtZV9hZGRyAAAAAQAAAARuYW1lCQABLAAAAAIJAAEsAAAAAgIAAAAFTmFtZV8FAAAABG5hbWUC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ZXJzAAAAAQkABEwAAAACAwkAAGYAAAACCQABMQAAAAEFAAAABG5hbWUAAAAAAAAAAAAFAAAABHVuaXQJAAACAAAAAQIAAAAUTmFtZSBjYW5ub3QgYmUgZW1wdHkFAAAAA25pbAkABRQAAAACBQAAAANuaWwJAQAAAAhfcmVzb2x2ZQAAAAIFAAAABG5hbWUCAAAABGFkZHIAAAADaW52AQAAAAdzZXRBZGRyAAAAAgAAAARuYW1lAAAAB2FkZHJlc3MJAQAAAAt2YWx1ZU9yRWxzZQAAAAIJAQAAAAltb2RpZmllcnMAAAABCQAETAAAAAIDCQAAZgAAAAIJAAExAAAAAQUAAAAEbmFtZQAAAAAAAAAAAAUAAAAEdW5pdAkAAAIAAAABAgAAABROYW1lIGNhbm5vdCBiZSBlbXB0eQkABEwAAAACCQEAAAAJb25seU93bmVyAAAAAgUAAAADaW52BQAAAARuYW1lCQAETAAAAAIDCQEAAAAJaXNEZWZpbmVkAAAAAQkABCYAAAABBQAAAAdhZGRyZXNzBQAAAAR1bml0CQAAAgAAAAECAAAAFUFkZHJlc3MgbXVzdCBiZSB2YWxpZAUAAAADbmlsCQEAAAAIX3NldEFkZHIAAAACBQAAAARuYW1lBQAAAAdhZGRyZXNzAAAAAMTEdcQ=", "height": 2276263, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 3LH4SLnQUAKworpJdUDTjG7iLUpeZFrdD5q1vpDw5q8p Next: CyYLz38JrK3Q6PzpxbkjXqST3fqc6tyYkzVp52qe5tun Diff:
OldNewDifferences
9595 case _ =>
9696 false
9797 }
98- if (!(isDefined(resolver)))
98+ if (if (!(isDefined(resolver)))
99+ then true
100+ else (size(restLabels) == 0))
99101 then returnsDefault
100102 else if (!(supportsInterface))
101103 then unit
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 _getOwner (name) = match invoke(registry, "owner", [name], nil) {
1818 case owner: String =>
1919 owner
2020 case _ =>
2121 unit
2222 }
2323
2424
2525 func _getAddr (name) = valueOrElse(getString(this, key_Name_addr(name)), _getOwner(name))
2626
2727
2828 func _setAddr (name,address) = [StringEntry(key_Name_addr(name), address)]
2929
3030
3131 func isAdmin (inv) = (inv.caller == this)
3232
3333
3434 func isOwner (inv,name) = (toString(inv.caller) == valueOrElse(_getOwner(name), ""))
3535
3636
3737 func isValidAddress (maybeAddress) = isDefined(addressFromString(maybeAddress))
3838
3939
4040 func modifiers (validations) = unit
4141
4242
4343 func onlyAdmin (inv) = if (isAdmin(inv))
4444 then unit
4545 else throw("Permission denied")
4646
4747
4848 func onlyOwner (inv,name) = if (if (isAdmin(inv))
4949 then true
5050 else isOwner(inv, name))
5151 then unit
5252 else throw("Permission denied")
5353
5454
5555 func _splitLastLabel (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 _findResolver (name) = {
6565 let $t019341985 = _splitLastLabel(name)
6666 let lastLabel = $t019341985._1
6767 let restLabels = $t019341985._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 $t023632411 = _findResolver(name)
8181 let resolver = $t023632411._1
8282 let restLabels = $t023632411._2
8383 let $t024172593 = match callData {
8484 case _ =>
8585 if (("addr" == $match0))
8686 then $Tuple3("addr", [value(restLabels)], _getAddr(name))
8787 else $Tuple3(unit, unit, unit)
8888 }
8989 let callFunction = $t024172593._1
9090 let callArgs = $t024172593._2
9191 let returnsDefault = $t024172593._3
9292 let supportsInterface = match invoke(value(resolver), "supportsInterface", [callData], nil) {
9393 case supportsInterface: Boolean =>
9494 supportsInterface
9595 case _ =>
9696 false
9797 }
98- if (!(isDefined(resolver)))
98+ if (if (!(isDefined(resolver)))
99+ then true
100+ else (size(restLabels) == 0))
99101 then returnsDefault
100102 else if (!(supportsInterface))
101103 then unit
102104 else match invoke(value(resolver), value(callFunction), value(callArgs), nil) {
103105 case maybeAddr: String =>
104106 if (isValidAddress(maybeAddr))
105107 then maybeAddr
106108 else unit
107109 case _ =>
108110 unit
109111 }
110112 }
111113
112114
113115 @Callable(inv)
114116 func init (registryAddress) = valueOrElse(modifiers([onlyAdmin(inv)]), [StringEntry(key_registry, registryAddress)])
115117
116118
117119
118120 @Callable(inv)
119121 func supportsInterface (interfaceId) = $Tuple2(nil, (interfaceId == "addr"))
120122
121123
122124
123125 @Callable(inv)
124126 func addr (name) = valueOrElse(modifiers([if ((size(name) > 0))
125127 then unit
126128 else throw("Name cannot be empty")]), $Tuple2(nil, _resolve(name, "addr")))
127129
128130
129131
130132 @Callable(inv)
131133 func setAddr (name,address) = valueOrElse(modifiers([if ((size(name) > 0))
132134 then unit
133135 else throw("Name cannot be empty"), onlyOwner(inv, name), if (isDefined(addressFromString(address)))
134136 then unit
135137 else throw("Address must be valid")]), _setAddr(name, address))
136138
137139

github/deemru/w8io/169f3d6 
40.93 ms