tx · ox7grfPtk7mdCdZBiBAqyHvc7A7SU57Y9kwMpnx1yUn 3MvCgypmBZFTRqL5HuRwCgS7maC7Fkv7pZY: -0.00600000 Waves 2022.11.25 20:56 [2332946] smart account 3MvCgypmBZFTRqL5HuRwCgS7maC7Fkv7pZY > SELF 0.00000000 Waves
{ "type": 13, "id": "ox7grfPtk7mdCdZBiBAqyHvc7A7SU57Y9kwMpnx1yUn", "fee": 600000, "feeAssetId": null, "timestamp": 1669399031263, "version": 2, "chainId": 84, "sender": "3MvCgypmBZFTRqL5HuRwCgS7maC7Fkv7pZY", "senderPublicKey": "BqGSAiYghM27RZ2Axx3bmTudq9koHT4575AeK31Wx2Pp", "proofs": [ "3xb85oXbogmz51PEeVzkQYYLJGEsvSyQ4z61BBDHyRDfmpandtBDKe53PkM635DpLQe35xN6QS8ndsrCGgdrYgJ9" ], "script": "base64:AAIFAAAAAAAAACEIAhIECgIICBIECgIICBIFCgMICAgSBQoDCAgfEgMKAQgAAAASAQAAAAprZXlfZW50aXR5AAAAAwAAAARuYW1lAAAAAnBrAAAACHByb3BlcnR5CQABLAAAAAIJAAEsAAAAAgkAASwAAAACCQABLAAAAAIFAAAABG5hbWUCAAAAAV8FAAAAAnBrAgAAAAFfBQAAAAhwcm9wZXJ0eQEAAAAOa2V5X05hbWVfb3duZXIAAAABAAAABG5vZGUJAQAAAAprZXlfZW50aXR5AAAAAwIAAAAETmFtZQUAAAAEbm9kZQIAAAAFb3duZXIBAAAAEWtleV9OYW1lX3Jlc29sdmVyAAAAAQAAAARub2RlCQEAAAAKa2V5X2VudGl0eQAAAAMCAAAABE5hbWUFAAAABG5vZGUCAAAACHJlc29sdmVyAQAAABJrZXlfTmFtZV9jcmVhdGVkQXQAAAABAAAABG5vZGUJAQAAAAprZXlfZW50aXR5AAAAAwIAAAAETmFtZQUAAAAEbm9kZQIAAAAJY3JlYXRlZEF0AQAAAAlfZ2V0T3duZXIAAAABAAAABG5vZGUJAAQdAAAAAgUAAAAEdGhpcw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AAR1bml0CQAAAgAAAAECAAAAHU93bmVyIG11c3QgYmUgYSB2YWxpZCBhZGRyZXNzCQAETAAAAAIDCQEAAAAOaXNWYWxpZEFkZHJlc3MAAAABBQAAAAhyZXNvbHZlcgUAAAAEdW5pdAkAAAIAAAABAgAAAClSZXNvbHZlciBtdXN0IGJlIGEgdmFsaWQgY29udHJhY3QgYWRkcmVzcwUAAAADbmlsCQAETgAAAAIJAAROAAAAAgkBAAAACV9zZXRPd25lcgAAAAIFAAAABG5vZGUFAAAABW93bmVyCQEAAAAMX3NldFJlc29sdmVyAAAAAgUAAAAEbm9kZQUAAAAIcmVzb2x2ZXIJAQAAAA1fc2V0Q3JlYXRlZEF0AAAAAgUAAAAEbm9kZQgFAAAACWxhc3RCbG9jawAAAAl0aW1lc3RhbXAAAAADaW52AQAAAAdyZXNvbHZlAAAAAwAAAARuYW1lAAAAC2ludGVyZmFjZUlkAAAABGFyZ3MJAAUUAAAAAgUAAAADbmlsCQEAAAAIX3Jlc29sdmUAAAADBQAAAARuYW1lBQAAAAtpbnRlcmZhY2VJZAUAAAAEYXJncwAAAANpbnYBAAAABXdob0lzAAAAAQAAAARuYW1lCQAFFAAAAAIFAAAAA25pbAkABRcAAAAFCQEAAAAIX3Jlc29sdmUAAAADBQAAAARuYW1lAgAAAAVvd25lcgUAAAADbmlsCQEAAAAIX3Jlc29sdmUAAAADBQAAAARuYW1lAgAAAAhyZXNvbHZlcgUAAAADbmlsCQEAAAAIX3Jlc29sdmUAAAADBQAAAARuYW1lAgAAAAljcmVhdGVkQXQFAAAAA25pbAkBAAAACF9yZXNvbHZlAAAAAwUAAAAEbmFtZQIAAAAJZXhwaXJlc0F0BQAAAANuaWwJAQAAAAhfcmVzb2x2ZQAAAAMFAAAABG5hbWUCAAAAB3Rva2VuSWQFAAAAA25pbAAAAADg/4/C", "height": 2332946, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 9KvWEzhLVMZZ5EzZdcz6cpoG6P1KyXzJh34posmuipBP Next: none Full:
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | func key_entity (name,pk,property) = ((((name + "_") + pk) + "_") + property) | |
5 | 5 | ||
6 | 6 | ||
7 | 7 | func key_Name_owner (node) = key_entity("Name", node, "owner") | |
8 | 8 | ||
9 | 9 | ||
10 | 10 | func key_Name_resolver (node) = key_entity("Name", node, "resolver") | |
11 | 11 | ||
12 | 12 | ||
13 | 13 | func key_Name_createdAt (node) = key_entity("Name", node, "createdAt") | |
14 | 14 | ||
15 | 15 | ||
16 | 16 | func _getOwner (node) = getString(this, key_Name_owner(node)) | |
17 | 17 | ||
18 | 18 | ||
19 | 19 | func _setOwner (node,owner) = [StringEntry(key_Name_owner(node), owner)] | |
20 | 20 | ||
21 | 21 | ||
22 | 22 | func _getResolver (node) = getString(this, key_Name_resolver(node)) | |
23 | 23 | ||
24 | 24 | ||
25 | 25 | func _setResolver (node,resolver) = [StringEntry(key_Name_resolver(node), resolver)] | |
26 | 26 | ||
27 | 27 | ||
28 | 28 | func _getCreatedAt (node) = getInteger(this, key_Name_createdAt(node)) | |
29 | 29 | ||
30 | 30 | ||
31 | 31 | func _setCreatedAt (node,createdAt) = [IntegerEntry(key_Name_createdAt(node), createdAt)] | |
32 | 32 | ||
33 | 33 | ||
34 | 34 | func isAdmin (inv) = (inv.caller == this) | |
35 | 35 | ||
36 | 36 | ||
37 | 37 | func isOwner (inv,node) = (toString(inv.caller) == valueOrElse(_getOwner(node), "")) | |
38 | 38 | ||
39 | 39 | ||
40 | 40 | func isValidAddress (maybeAddress) = isDefined(addressFromString(maybeAddress)) | |
41 | 41 | ||
42 | 42 | ||
43 | 43 | func modifiers (validations) = unit | |
44 | 44 | ||
45 | 45 | ||
46 | 46 | func onlyAdmin (inv) = if (isAdmin(inv)) | |
47 | 47 | then unit | |
48 | 48 | else throw("Permission denied") | |
49 | 49 | ||
50 | 50 | ||
51 | 51 | func onlyOwner (inv,node) = if (if (isAdmin(inv)) | |
52 | 52 | then true | |
53 | 53 | else isOwner(inv, node)) | |
54 | 54 | then unit | |
55 | 55 | else throw("Permission denied") | |
56 | 56 | ||
57 | 57 | ||
58 | 58 | func _splitLastLabel (name) = { | |
59 | 59 | let labels = split(name, ".") | |
60 | 60 | let lastIndex = (size(labels) - 1) | |
61 | 61 | let lastLabel = labels[lastIndex] | |
62 | 62 | let restLabels = makeString(removeByIndex(labels, lastIndex), ".") | |
63 | 63 | $Tuple2(lastLabel, restLabels) | |
64 | 64 | } | |
65 | 65 | ||
66 | 66 | ||
67 | 67 | func _resolve (name,interfaceId,args) = { | |
68 | 68 | let $t021482195 = _splitLastLabel(name) | |
69 | 69 | let label = $t021482195._1 | |
70 | 70 | let restLabels = $t021482195._2 | |
71 | 71 | let resolverRaw = addressFromString(valueOrElse(_getResolver(label), "")) | |
72 | 72 | let resolver = value(resolverRaw) | |
73 | 73 | let callbackData = invoke(resolver, "resolve", [restLabels, interfaceId, args], nil) | |
74 | 74 | if ((size(label) == 0)) | |
75 | 75 | then unit | |
76 | 76 | else if ((size(restLabels) == 0)) | |
77 | 77 | then match interfaceId { | |
78 | 78 | case _ => | |
79 | 79 | if (("owner" == $match0)) | |
80 | 80 | then _getOwner(label) | |
81 | 81 | else if (("resolver" == $match0)) | |
82 | 82 | then _getResolver(label) | |
83 | 83 | else if (("createdAt" == $match0)) | |
84 | 84 | then _getCreatedAt(label) | |
85 | 85 | else unit | |
86 | 86 | } | |
87 | 87 | else if (!(isDefined(resolverRaw))) | |
88 | 88 | then unit | |
89 | 89 | else match $Tuple2(interfaceId, callbackData) { | |
90 | 90 | case _ => | |
91 | 91 | if (if (if (("owner" == $match0._1)) | |
92 | 92 | then $isInstanceOf($match0._2, "String") | |
93 | 93 | else false) | |
94 | 94 | then $isInstanceOf($match0, "(String, String)") | |
95 | 95 | else false) | |
96 | 96 | then { | |
97 | 97 | let maybeOwner = $match0._2 | |
98 | 98 | if (isValidAddress(maybeOwner)) | |
99 | 99 | then maybeOwner | |
100 | 100 | else unit | |
101 | 101 | } | |
102 | 102 | else if (if (if (("resolver" == $match0._1)) | |
103 | 103 | then $isInstanceOf($match0._2, "String") | |
104 | 104 | else false) | |
105 | 105 | then $isInstanceOf($match0, "(String, String)") | |
106 | 106 | else false) | |
107 | 107 | then { | |
108 | 108 | let maybeResolver = $match0._2 | |
109 | 109 | if (isValidAddress(maybeResolver)) | |
110 | 110 | then maybeResolver | |
111 | 111 | else unit | |
112 | 112 | } | |
113 | 113 | else if (if (if (("createdAt" == $match0._1)) | |
114 | 114 | then $isInstanceOf($match0._2, "Int") | |
115 | 115 | else false) | |
116 | 116 | then $isInstanceOf($match0, "(String, Int)") | |
117 | 117 | else false) | |
118 | 118 | then { | |
119 | 119 | let nameCreated = $match0._2 | |
120 | 120 | if (if ((nameCreated > 0)) | |
121 | 121 | then (lastBlock.timestamp >= nameCreated) | |
122 | 122 | else false) | |
123 | 123 | then nameCreated | |
124 | 124 | else unit | |
125 | 125 | } | |
126 | 126 | else if (if (if (("expiresAt" == $match0._1)) | |
127 | 127 | then $isInstanceOf($match0._2, "Int") | |
128 | 128 | else false) | |
129 | 129 | then $isInstanceOf($match0, "(String, Int)") | |
130 | 130 | else false) | |
131 | 131 | then { | |
132 | 132 | let nameExpires = $match0._2 | |
133 | 133 | if ((nameExpires > 0)) | |
134 | 134 | then nameExpires | |
135 | 135 | else unit | |
136 | 136 | } | |
137 | 137 | else if (if (if (("tokenId" == $match0._1)) | |
138 | 138 | then $isInstanceOf($match0._2, "String") | |
139 | 139 | else false) | |
140 | 140 | then $isInstanceOf($match0, "(String, String)") | |
141 | 141 | else false) | |
142 | 142 | then { | |
143 | 143 | let tokenId = $match0._2 | |
144 | 144 | tokenId | |
145 | 145 | } | |
146 | 146 | else unit | |
147 | 147 | } | |
148 | 148 | } | |
149 | 149 | ||
150 | 150 | ||
151 | 151 | @Callable(inv) | |
152 | 152 | func setOwner (node,owner) = valueOrElse(modifiers([onlyOwner(inv, node), if (isValidAddress(owner)) | |
153 | 153 | then unit | |
154 | 154 | else throw("Owner must be a valid address")]), _setOwner(node, owner)) | |
155 | 155 | ||
156 | 156 | ||
157 | 157 | ||
158 | 158 | @Callable(inv) | |
159 | 159 | func setResolver (node,resolver) = valueOrElse(modifiers([onlyOwner(inv, node), if (isValidAddress(resolver)) | |
160 | 160 | then unit | |
161 | 161 | else throw("Resolver must be a valid address")]), _setResolver(node, resolver)) | |
162 | 162 | ||
163 | 163 | ||
164 | 164 | ||
165 | 165 | @Callable(inv) | |
166 | 166 | func setRecord (node,owner,resolver) = valueOrElse(modifiers([onlyAdmin(inv), if (isValidAddress(owner)) | |
167 | 167 | then unit | |
168 | 168 | else throw("Owner must be a valid address"), if (isValidAddress(resolver)) | |
169 | 169 | then unit | |
170 | 170 | else throw("Resolver must be a valid contract address")]), ((_setOwner(node, owner) ++ _setResolver(node, resolver)) ++ _setCreatedAt(node, lastBlock.timestamp))) | |
171 | 171 | ||
172 | 172 | ||
173 | 173 | ||
174 | 174 | @Callable(inv) | |
175 | 175 | func resolve (name,interfaceId,args) = $Tuple2(nil, _resolve(name, interfaceId, args)) | |
176 | 176 | ||
177 | 177 | ||
178 | 178 | ||
179 | 179 | @Callable(inv) | |
180 | 180 | func whoIs (name) = $Tuple2(nil, $Tuple5(_resolve(name, "owner", nil), _resolve(name, "resolver", nil), _resolve(name, "createdAt", nil), _resolve(name, "expiresAt", nil), _resolve(name, "tokenId", nil))) | |
181 | 181 | ||
182 | 182 |
github/deemru/w8io/169f3d6 27.22 ms ◑