tx · CyYLz38JrK3Q6PzpxbkjXqST3fqc6tyYkzVp52qe5tun 3MrF6QFGLaSKfoNPMd8L3u7KYNm7cE43Ydw: -0.01000000 Waves 2022.10.17 13:47 [2276269] smart account 3MrF6QFGLaSKfoNPMd8L3u7KYNm7cE43Ydw > SELF 0.00000000 Waves
{ "type": 13, "id": "CyYLz38JrK3Q6PzpxbkjXqST3fqc6tyYkzVp52qe5tun", "fee": 1000000, "feeAssetId": null, "timestamp": 1666003657050, "version": 2, "chainId": 84, "sender": "3MrF6QFGLaSKfoNPMd8L3u7KYNm7cE43Ydw", "senderPublicKey": "6NSakbUsm1WyESQ8yj3qpc1kQUfHWNd5C6CHVpbs4X7c", "proofs": [ "3rzPaQ7jdvWjsoautJqCM4SaDQCr9exuNof8M2MmoYUmqujix6zTuLHawoCDMv6fQGgoXHQrxMKudUPnxRBJkNw" ], "script": "base64:AAIFAAAAAAAAABcIAhIDCgEIEgMKAQgSAwoBCBIECgIICAAAABEBAAAAEGdldFN0cmluZ09yVGhyb3cAAAACAAAAB2FkZHJlc3MAAAADa2V5CQEAAAATdmFsdWVPckVycm9yTWVzc2FnZQAAAAIJAAQdAAAAAgUAAAAHYWRkcmVzcwUAAAADa2V5CQABLAAAAAIJAAEsAAAAAgkAASwAAAACAgAAAAxDYW4ndCByZWFkICcFAAAAA2tleQIAAAANJyBhdCBhZGRyZXNzIAkABCUAAAABBQAAAAdhZGRyZXNzAQAAABNwYXJzZUFkZHJlc3NPclRocm93AAAAAQAAAAxtYXliZUFkZHJlc3MJAQAAABN2YWx1ZU9yRXJyb3JNZXNzYWdlAAAAAgkABCYAAAABBQAAAAxtYXliZUFkZHJlc3MJAAEsAAAAAgkAASwAAAACAgAAABpDYW4ndCBwYXJzZSBhZGRyZXNzIGZyb20gJwUAAAAMbWF5YmVBZGRyZXNzAgAAAAEnAQAAAA1rZXlfTmFtZV9hZGRyAAAAAQAAAARuYW1lCQABLAAAAAIJAAEsAAAAAgIAAAAFTmFtZV8FAAAAB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bWUJAQAAAAt2YWx1ZU9yRWxzZQAAAAIJAQAAAAltb2RpZmllcnMAAAABCQAETAAAAAIDCQAAZgAAAAIJAAExAAAAAQUAAAAEbmFtZQAAAAAAAAAAAAUAAAAEdW5pdAkAAAIAAAABAgAAABROYW1lIGNhbm5vdCBiZSBlbXB0eQUAAAADbmlsCQAFFAAAAAIFAAAAA25pbAkBAAAACF9yZXNvbHZlAAAAAgUAAAAEbmFtZQIAAAAEYWRkcgAAAANpbnYBAAAAB3NldEFkZHIAAAACAAAABG5hbWUAAAAHYWRkcmVzcwkBAAAAC3ZhbHVlT3JFbHNlAAAAAgkBAAAACW1vZGlmaWVycwAAAAEJAARMAAAAAgMJAABmAAAAAgkAATEAAAABBQAAAARuYW1lAAAAAAAAAAAABQAAAAR1bml0CQAAAgAAAAECAAAAFE5hbWUgY2Fubm90IGJlIGVtcHR5CQAETAAAAAIJAQAAAAlvbmx5T3duZXIAAAACBQAAAANpbnYFAAAABG5hbWUJAARMAAAAAgMJAQAAAAlpc0RlZmluZWQAAAABCQAEJgAAAAEFAAAAB2FkZHJlc3MFAAAABHVuaXQJAAACAAAAAQIAAAAVQWRkcmVzcyBtdXN0IGJlIHZhbGlkBQAAAANuaWwJAQAAAAhfc2V0QWRkcgAAAAIFAAAABG5hbWUFAAAAB2FkZHJlc3MAAAAARChubw==", "height": 2276269, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: EnE51fMhdxW59yv3ircf8436S9rkarSPR77v7tELCKaq Next: FqLWGMt8tdDw1xzW4MzwEmtaqyt1VJMpmDsHNy8yUr8C Diff:
Old | New | Differences | |
---|---|---|---|
14 | 14 | ||
15 | 15 | let registry = parseAddressOrThrow(getStringOrThrow(this, key_registry)) | |
16 | 16 | ||
17 | + | func _splitLastLabel (name) = { | |
18 | + | let labels = split(name, ".") | |
19 | + | let lastIndex = (size(labels) - 1) | |
20 | + | let lastLabel = labels[lastIndex] | |
21 | + | let restLabels = makeString(removeByIndex(labels, lastIndex), ".") | |
22 | + | $Tuple2(lastLabel, restLabels) | |
23 | + | } | |
24 | + | ||
25 | + | ||
17 | 26 | func _getOwner (name) = match invoke(registry, "owner", [name], nil) { | |
18 | 27 | case owner: String => | |
19 | 28 | owner | |
22 | 31 | } | |
23 | 32 | ||
24 | 33 | ||
25 | - | func _getAddr (name) = valueOrElse(getString(this, key_Name_addr(name)), _getOwner(name)) | |
34 | + | func _getAddr (name) = valueOrElse(getString(this, key_Name_addr(name)), _getOwner(_splitLastLabel(name)._1)) | |
26 | 35 | ||
27 | 36 | ||
28 | 37 | func _setAddr (name,address) = [StringEntry(key_Name_addr(name), address)] | |
52 | 61 | else throw("Permission denied") | |
53 | 62 | ||
54 | 63 | ||
55 | - | func _splitLastLabel (name) = { | |
56 | - | let labels = split(name, ".") | |
57 | - | let lastIndex = (size(labels) - 1) | |
58 | - | let lastLabel = labels[lastIndex] | |
59 | - | let restLabels = makeString(removeByIndex(labels, lastIndex), ".") | |
60 | - | $Tuple2(lastLabel, restLabels) | |
61 | - | } | |
62 | - | ||
63 | - | ||
64 | 64 | func _findResolver (name) = { | |
65 | - | let $ | |
66 | - | let lastLabel = $ | |
67 | - | let restLabels = $ | |
65 | + | let $t019602011 = _splitLastLabel(name) | |
66 | + | let lastLabel = $t019602011._1 | |
67 | + | let restLabels = $t019602011._2 | |
68 | 68 | if ((size(restLabels) == 0)) | |
69 | 69 | then $Tuple2(unit, name) | |
70 | 70 | else match invoke(registry, "resolver", [lastLabel], nil) { | |
77 | 77 | ||
78 | 78 | ||
79 | 79 | func _resolve (name,callData) = { | |
80 | - | let $ | |
81 | - | let resolver = $ | |
82 | - | let restLabels = $ | |
83 | - | let $ | |
80 | + | let $t023892437 = _findResolver(name) | |
81 | + | let resolver = $t023892437._1 | |
82 | + | let restLabels = $t023892437._2 | |
83 | + | let $t024432619 = match callData { | |
84 | 84 | case _ => | |
85 | 85 | if (("addr" == $match0)) | |
86 | 86 | then $Tuple3("addr", [value(restLabels)], _getAddr(name)) | |
87 | 87 | else $Tuple3(unit, unit, unit) | |
88 | 88 | } | |
89 | - | let callFunction = $ | |
90 | - | let callArgs = $ | |
91 | - | let returnsDefault = $ | |
89 | + | let callFunction = $t024432619._1 | |
90 | + | let callArgs = $t024432619._2 | |
91 | + | let returnsDefault = $t024432619._3 | |
92 | 92 | let supportsInterface = match invoke(value(resolver), "supportsInterface", [callData], nil) { | |
93 | 93 | case supportsInterface: Boolean => | |
94 | 94 | supportsInterface |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | func getStringOrThrow (address,key) = valueOrErrorMessage(getString(address, key), ((("Can't read '" + key) + "' at address ") + toString(address))) | |
5 | 5 | ||
6 | 6 | ||
7 | 7 | func parseAddressOrThrow (maybeAddress) = valueOrErrorMessage(addressFromString(maybeAddress), (("Can't parse address from '" + maybeAddress) + "'")) | |
8 | 8 | ||
9 | 9 | ||
10 | 10 | func key_Name_addr (name) = (("Name_" + name) + "_addr") | |
11 | 11 | ||
12 | 12 | ||
13 | 13 | let key_registry = "registry" | |
14 | 14 | ||
15 | 15 | let registry = parseAddressOrThrow(getStringOrThrow(this, key_registry)) | |
16 | 16 | ||
17 | + | func _splitLastLabel (name) = { | |
18 | + | let labels = split(name, ".") | |
19 | + | let lastIndex = (size(labels) - 1) | |
20 | + | let lastLabel = labels[lastIndex] | |
21 | + | let restLabels = makeString(removeByIndex(labels, lastIndex), ".") | |
22 | + | $Tuple2(lastLabel, restLabels) | |
23 | + | } | |
24 | + | ||
25 | + | ||
17 | 26 | func _getOwner (name) = match invoke(registry, "owner", [name], nil) { | |
18 | 27 | case owner: String => | |
19 | 28 | owner | |
20 | 29 | case _ => | |
21 | 30 | unit | |
22 | 31 | } | |
23 | 32 | ||
24 | 33 | ||
25 | - | func _getAddr (name) = valueOrElse(getString(this, key_Name_addr(name)), _getOwner(name)) | |
34 | + | func _getAddr (name) = valueOrElse(getString(this, key_Name_addr(name)), _getOwner(_splitLastLabel(name)._1)) | |
26 | 35 | ||
27 | 36 | ||
28 | 37 | func _setAddr (name,address) = [StringEntry(key_Name_addr(name), address)] | |
29 | 38 | ||
30 | 39 | ||
31 | 40 | func isAdmin (inv) = (inv.caller == this) | |
32 | 41 | ||
33 | 42 | ||
34 | 43 | func isOwner (inv,name) = (toString(inv.caller) == valueOrElse(_getOwner(name), "")) | |
35 | 44 | ||
36 | 45 | ||
37 | 46 | func isValidAddress (maybeAddress) = isDefined(addressFromString(maybeAddress)) | |
38 | 47 | ||
39 | 48 | ||
40 | 49 | func modifiers (validations) = unit | |
41 | 50 | ||
42 | 51 | ||
43 | 52 | func onlyAdmin (inv) = if (isAdmin(inv)) | |
44 | 53 | then unit | |
45 | 54 | else throw("Permission denied") | |
46 | 55 | ||
47 | 56 | ||
48 | 57 | func onlyOwner (inv,name) = if (if (isAdmin(inv)) | |
49 | 58 | then true | |
50 | 59 | else isOwner(inv, name)) | |
51 | 60 | then unit | |
52 | 61 | else throw("Permission denied") | |
53 | 62 | ||
54 | 63 | ||
55 | - | func _splitLastLabel (name) = { | |
56 | - | let labels = split(name, ".") | |
57 | - | let lastIndex = (size(labels) - 1) | |
58 | - | let lastLabel = labels[lastIndex] | |
59 | - | let restLabels = makeString(removeByIndex(labels, lastIndex), ".") | |
60 | - | $Tuple2(lastLabel, restLabels) | |
61 | - | } | |
62 | - | ||
63 | - | ||
64 | 64 | func _findResolver (name) = { | |
65 | - | let $ | |
66 | - | let lastLabel = $ | |
67 | - | let restLabels = $ | |
65 | + | let $t019602011 = _splitLastLabel(name) | |
66 | + | let lastLabel = $t019602011._1 | |
67 | + | let restLabels = $t019602011._2 | |
68 | 68 | if ((size(restLabels) == 0)) | |
69 | 69 | then $Tuple2(unit, name) | |
70 | 70 | else match invoke(registry, "resolver", [lastLabel], nil) { | |
71 | 71 | case resolverAddress: String => | |
72 | 72 | $Tuple2(addressFromString(resolverAddress), restLabels) | |
73 | 73 | case _ => | |
74 | 74 | $Tuple2(unit, name) | |
75 | 75 | } | |
76 | 76 | } | |
77 | 77 | ||
78 | 78 | ||
79 | 79 | func _resolve (name,callData) = { | |
80 | - | let $ | |
81 | - | let resolver = $ | |
82 | - | let restLabels = $ | |
83 | - | let $ | |
80 | + | let $t023892437 = _findResolver(name) | |
81 | + | let resolver = $t023892437._1 | |
82 | + | let restLabels = $t023892437._2 | |
83 | + | let $t024432619 = match callData { | |
84 | 84 | case _ => | |
85 | 85 | if (("addr" == $match0)) | |
86 | 86 | then $Tuple3("addr", [value(restLabels)], _getAddr(name)) | |
87 | 87 | else $Tuple3(unit, unit, unit) | |
88 | 88 | } | |
89 | - | let callFunction = $ | |
90 | - | let callArgs = $ | |
91 | - | let returnsDefault = $ | |
89 | + | let callFunction = $t024432619._1 | |
90 | + | let callArgs = $t024432619._2 | |
91 | + | let returnsDefault = $t024432619._3 | |
92 | 92 | let supportsInterface = match invoke(value(resolver), "supportsInterface", [callData], nil) { | |
93 | 93 | case supportsInterface: Boolean => | |
94 | 94 | supportsInterface | |
95 | 95 | case _ => | |
96 | 96 | false | |
97 | 97 | } | |
98 | 98 | if (if (!(isDefined(resolver))) | |
99 | 99 | then true | |
100 | 100 | else (size(restLabels) == 0)) | |
101 | 101 | then returnsDefault | |
102 | 102 | else if (!(supportsInterface)) | |
103 | 103 | then unit | |
104 | 104 | else match invoke(value(resolver), value(callFunction), value(callArgs), nil) { | |
105 | 105 | case maybeAddr: String => | |
106 | 106 | if (isValidAddress(maybeAddr)) | |
107 | 107 | then maybeAddr | |
108 | 108 | else unit | |
109 | 109 | case _ => | |
110 | 110 | unit | |
111 | 111 | } | |
112 | 112 | } | |
113 | 113 | ||
114 | 114 | ||
115 | 115 | @Callable(inv) | |
116 | 116 | func init (registryAddress) = valueOrElse(modifiers([onlyAdmin(inv)]), [StringEntry(key_registry, registryAddress)]) | |
117 | 117 | ||
118 | 118 | ||
119 | 119 | ||
120 | 120 | @Callable(inv) | |
121 | 121 | func supportsInterface (interfaceId) = $Tuple2(nil, (interfaceId == "addr")) | |
122 | 122 | ||
123 | 123 | ||
124 | 124 | ||
125 | 125 | @Callable(inv) | |
126 | 126 | func addr (name) = valueOrElse(modifiers([if ((size(name) > 0)) | |
127 | 127 | then unit | |
128 | 128 | else throw("Name cannot be empty")]), $Tuple2(nil, _resolve(name, "addr"))) | |
129 | 129 | ||
130 | 130 | ||
131 | 131 | ||
132 | 132 | @Callable(inv) | |
133 | 133 | func setAddr (name,address) = valueOrElse(modifiers([if ((size(name) > 0)) | |
134 | 134 | then unit | |
135 | 135 | else throw("Name cannot be empty"), onlyOwner(inv, name), if (isDefined(addressFromString(address))) | |
136 | 136 | then unit | |
137 | 137 | else throw("Address must be valid")]), _setAddr(name, address)) | |
138 | 138 | ||
139 | 139 |
github/deemru/w8io/169f3d6 50.74 ms ◑