tx · 9TejtdUJfnXxXhVTKDcnrwYF7oDr1qY17M8BYhgKXsV4 3NA73oUXjqp7SpudXWV1yMFuKm9awPbqsVz: -0.01100000 Waves 2022.11.25 20:56 [2332946] smart account 3NA73oUXjqp7SpudXWV1yMFuKm9awPbqsVz > SELF 0.00000000 Waves
{ "type": 13, "id": "9TejtdUJfnXxXhVTKDcnrwYF7oDr1qY17M8BYhgKXsV4", "fee": 1100000, "feeAssetId": null, "timestamp": 1669399031646, "version": 2, "chainId": 84, "sender": "3NA73oUXjqp7SpudXWV1yMFuKm9awPbqsVz", "senderPublicKey": "2mHW72YTfnxJ1M8WsdUQjgpp3a2SUbt9mbAiePGiuJok", "proofs": [ "2a3rrCAt5X6Pbqy1hKyia1wJaSCQFiBFeHDP5z1BU8u24JwwRQHzy67rWSPRtPUm3BZ5B7AqiLcUAu9A5cVxxKYs" ], "script": "base64:AAIFAAAAAAAAAC4IAhIDCgEBEgMKAQgSAwoBCBIDCgEIEgMKAQgSBQoDCAgfEgUKAwgIARIDCgEIAAAAJwEAAAAKa2V5X2VudGl0eQAAAAMAAAAEbmFtZQAAAAJwawAAAAhwcm9wZXJ0eQkAASwAAAACCQABLAAAAAIJAAEsAAAAAgkAASwAAAACBQAAAARuYW1lAgAAAAFfBQAAAAJwawIAAAABXwUAAAAIcHJvcGVydHkBAAAADmtleV9Ub2tlbl9uYW1lAAAAAQAAAAd0b2tlbklkCQEAAAAKa2V5X2VudGl0eQAAAAMCAAAABVRva2VuBQAAAAd0b2tlbklkAgAAAARuYW1lAQAAAA5rZXlfTmFtZV90b2tlbgAAAAEAAAAEbmFtZQkBAAAACmtleV9lbnRpdHkAAAADAgAAAAROYW1lBQAAAARuYW1lAgAAAAV0b2tlbgEAAAAOa2V5X05hbWVfb3duZXIAAAABAAAABG5hbWUJAQAAAAprZXlfZW50aXR5AAAAAwIAAAAETmFtZQUAAAAEbmFtZQIAAAAFb3duZXIBAAAAEWtleV9OYW1lX3Jlc29sdmVyAAAAAQAAAAR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AAPbmV3T3duZXJBZGRyZXNzAAAAACyrO2g=", "height": 2332946, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: H1N1y8DoCe3tXvB7qR2nBbVTWMq2PYdP2kyR6f1c2kdZ Next: HaNuhCLsVpGyxffPK24GHWWx71JYw7gMddTDhDuL1LCi Diff:
Old | New | Differences | |
---|---|---|---|
189 | 189 | ||
190 | 190 | ||
191 | 191 | @Callable(inv) | |
192 | - | func supportsInterface (interfaceId) = $Tuple2(nil, containsElement(["owner", "resolver", "createdAt", "expiresAt", "tokenId"], interfaceId)) | |
193 | - | ||
194 | - | ||
195 | - | ||
196 | - | @Callable(inv) | |
197 | 192 | func addController (address) = valueOrElse(modifiers([onlyAdmin(inv), if (isValidAddress(address)) | |
198 | 193 | then unit | |
199 | 194 | else throw("Controller must be a valid address"), if (!(isController(address))) | |
224 | 219 | ||
225 | 220 | @Callable(inv) | |
226 | 221 | func resolve (name,interfaceId,args) = { | |
227 | - | let $ | |
228 | - | let label = $ | |
229 | - | let restLabels = $ | |
222 | + | let $t065996646 = _splitLastLabel(name) | |
223 | + | let label = $t065996646._1 | |
224 | + | let restLabels = $t065996646._2 | |
230 | 225 | $Tuple2(nil, match interfaceId { | |
231 | 226 | case _ => | |
232 | 227 | if (("owner" == $match0)) |
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_Token_name (tokenId) = key_entity("Token", tokenId, "name") | |
8 | 8 | ||
9 | 9 | ||
10 | 10 | func key_Name_token (name) = key_entity("Name", name, "token") | |
11 | 11 | ||
12 | 12 | ||
13 | 13 | func key_Name_owner (name) = key_entity("Name", name, "owner") | |
14 | 14 | ||
15 | 15 | ||
16 | 16 | func key_Name_resolver (name) = key_entity("Name", name, "resolver") | |
17 | 17 | ||
18 | 18 | ||
19 | 19 | func key_Name_expiresAt (name) = key_entity("Name", name, "expiresAt") | |
20 | 20 | ||
21 | 21 | ||
22 | 22 | func key_Name_createdAt (name) = key_entity("Name", name, "createdAt") | |
23 | 23 | ||
24 | 24 | ||
25 | 25 | let key_nameTTL = "nameTTL" | |
26 | 26 | ||
27 | 27 | let key_controllers = "controllers" | |
28 | 28 | ||
29 | 29 | func _setOwner (name,owner) = [StringEntry(key_Name_owner(name), owner)] | |
30 | 30 | ||
31 | 31 | ||
32 | 32 | func _getOwner (name) = getString(this, key_Name_owner(name)) | |
33 | 33 | ||
34 | 34 | ||
35 | 35 | func _getResolver (name) = getString(this, key_Name_resolver(name)) | |
36 | 36 | ||
37 | 37 | ||
38 | 38 | func _getToken (name) = getString(this, key_Name_token(name)) | |
39 | 39 | ||
40 | 40 | ||
41 | 41 | func _getCreatedAt (name) = getInteger(this, key_Name_createdAt(name)) | |
42 | 42 | ||
43 | 43 | ||
44 | 44 | func _getExpiresAt (name) = getInteger(this, key_Name_expiresAt(name)) | |
45 | 45 | ||
46 | 46 | ||
47 | 47 | func _getControllers () = getString(this, key_controllers) | |
48 | 48 | ||
49 | 49 | ||
50 | 50 | let controllers = match _getControllers() { | |
51 | 51 | case repr: String => | |
52 | 52 | split(repr, ",") | |
53 | 53 | case _ => | |
54 | 54 | nil | |
55 | 55 | } | |
56 | 56 | ||
57 | 57 | let nameTTL = value(getInteger(this, key_nameTTL)) | |
58 | 58 | ||
59 | 59 | let isInitialized = isDefined(getInteger(this, key_nameTTL)) | |
60 | 60 | ||
61 | 61 | func isRegisteredName (name) = isDefined(getString(this, key_Name_token(name))) | |
62 | 62 | ||
63 | 63 | ||
64 | 64 | func isCreatedName (name) = isDefined(_getCreatedAt(name)) | |
65 | 65 | ||
66 | 66 | ||
67 | 67 | func isExpiredName (name) = match _getExpiresAt(name) { | |
68 | 68 | case expiresAt: Int => | |
69 | 69 | (lastBlock.timestamp > expiresAt) | |
70 | 70 | case _ => | |
71 | 71 | false | |
72 | 72 | } | |
73 | 73 | ||
74 | 74 | ||
75 | 75 | func isActiveName (name) = if (if (isRegisteredName(name)) | |
76 | 76 | then isCreatedName(name) | |
77 | 77 | else false) | |
78 | 78 | then !(isExpiredName(name)) | |
79 | 79 | else false | |
80 | 80 | ||
81 | 81 | ||
82 | 82 | func isValidName (name) = { | |
83 | 83 | let symbols = "abcdefghijklmnopqrstuvwxyz1234567890-" | |
84 | 84 | func validateChars (isValid,char) = if (isValid) | |
85 | 85 | then contains(symbols, char) | |
86 | 86 | else false | |
87 | 87 | ||
88 | 88 | if (if (if (if (if ((size(name) > 3)) | |
89 | 89 | then (63 >= size(name)) | |
90 | 90 | else false) | |
91 | 91 | then (indexOf(name, "--") != 2) | |
92 | 92 | else false) | |
93 | 93 | then (indexOf(name, "-") != 0) | |
94 | 94 | else false) | |
95 | 95 | then (lastIndexOf(name, "-") != (size(name) - 1)) | |
96 | 96 | else false) | |
97 | 97 | then { | |
98 | 98 | let $l = split(name, "") | |
99 | 99 | let $s = size($l) | |
100 | 100 | let $acc0 = true | |
101 | 101 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
102 | 102 | then $a | |
103 | 103 | else validateChars($a, $l[$i]) | |
104 | 104 | ||
105 | 105 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
106 | 106 | then $a | |
107 | 107 | else throw("List size exceeds 63") | |
108 | 108 | ||
109 | 109 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15), 16), 17), 18), 19), 20), 21), 22), 23), 24), 25), 26), 27), 28), 29), 30), 31), 32), 33), 34), 35), 36), 37), 38), 39), 40), 41), 42), 43), 44), 45), 46), 47), 48), 49), 50), 51), 52), 53), 54), 55), 56), 57), 58), 59), 60), 61), 62), 63) | |
110 | 110 | } | |
111 | 111 | else false | |
112 | 112 | } | |
113 | 113 | ||
114 | 114 | ||
115 | 115 | func isAvailableName (name) = if (isValidName(name)) | |
116 | 116 | then !(isActiveName(name)) | |
117 | 117 | else false | |
118 | 118 | ||
119 | 119 | ||
120 | 120 | func isValidAddress (maybeAddress) = isDefined(addressFromString(maybeAddress)) | |
121 | 121 | ||
122 | 122 | ||
123 | 123 | func isAdmin (inv) = (inv.caller == this) | |
124 | 124 | ||
125 | 125 | ||
126 | 126 | func isOwner (inv,name) = (toString(inv.originCaller) == valueOrElse(_getOwner(name), "")) | |
127 | 127 | ||
128 | 128 | ||
129 | 129 | func isController (address) = containsElement(controllers, address) | |
130 | 130 | ||
131 | 131 | ||
132 | 132 | func _splitLastLabel (name) = { | |
133 | 133 | let labels = split(name, ".") | |
134 | 134 | let lastIndex = (size(labels) - 1) | |
135 | 135 | let lastLabel = labels[lastIndex] | |
136 | 136 | let restLabels = makeString(removeByIndex(labels, lastIndex), ".") | |
137 | 137 | $Tuple2(lastLabel, restLabels) | |
138 | 138 | } | |
139 | 139 | ||
140 | 140 | ||
141 | 141 | func _issueNameToken (name) = [Issue(if ((size(name) > 16)) | |
142 | 142 | then (take(name, 15) + "~") | |
143 | 143 | else take(name, 16), (name + ".waves"), 1, 0, false)] | |
144 | 144 | ||
145 | 145 | ||
146 | 146 | func _registerNameWithToken (name,tokenId,createdAt) = [StringEntry(key_Name_token(name), tokenId), StringEntry(key_Token_name(tokenId), name), IntegerEntry(key_Name_createdAt(name), createdAt), IntegerEntry(key_Name_expiresAt(name), (createdAt + nameTTL))] | |
147 | 147 | ||
148 | 148 | ||
149 | 149 | func _restoreNameWithToken (name,tokenId) = [StringEntry(key_Name_token(name), tokenId), StringEntry(key_Token_name(tokenId), name)] | |
150 | 150 | ||
151 | 151 | ||
152 | 152 | func _transferTokenToOwner (tokenId,owner) = [ScriptTransfer(addressFromStringValue(owner), 1, fromBase58String(tokenId))] | |
153 | 153 | ||
154 | 154 | ||
155 | 155 | func modifiers (validations) = unit | |
156 | 156 | ||
157 | 157 | ||
158 | 158 | func onlyAdmin (inv) = if (isAdmin(inv)) | |
159 | 159 | then unit | |
160 | 160 | else throw("Permission denied") | |
161 | 161 | ||
162 | 162 | ||
163 | 163 | func onlyController (inv) = if (if (isAdmin(inv)) | |
164 | 164 | then true | |
165 | 165 | else isController(toString(inv.caller))) | |
166 | 166 | then unit | |
167 | 167 | else throw("Permission denied") | |
168 | 168 | ||
169 | 169 | ||
170 | 170 | func onlyOwner (inv,name) = if (if (isAdmin(inv)) | |
171 | 171 | then true | |
172 | 172 | else isOwner(inv, name)) | |
173 | 173 | then unit | |
174 | 174 | else throw("Permission denied") | |
175 | 175 | ||
176 | 176 | ||
177 | 177 | func onlyInitialized () = if (isInitialized) | |
178 | 178 | then unit | |
179 | 179 | else throw("Contract is not initialized") | |
180 | 180 | ||
181 | 181 | ||
182 | 182 | @Callable(inv) | |
183 | 183 | func init (nameTTL) = valueOrElse(modifiers([onlyAdmin(inv), if ((nameTTL > 0)) | |
184 | 184 | then unit | |
185 | 185 | else throw("TTL cannot be negative"), if (!(isInitialized)) | |
186 | 186 | then unit | |
187 | 187 | else throw("Contract has already been initialized")]), [IntegerEntry(key_nameTTL, nameTTL)]) | |
188 | 188 | ||
189 | 189 | ||
190 | 190 | ||
191 | 191 | @Callable(inv) | |
192 | - | func supportsInterface (interfaceId) = $Tuple2(nil, containsElement(["owner", "resolver", "createdAt", "expiresAt", "tokenId"], interfaceId)) | |
193 | - | ||
194 | - | ||
195 | - | ||
196 | - | @Callable(inv) | |
197 | 192 | func addController (address) = valueOrElse(modifiers([onlyAdmin(inv), if (isValidAddress(address)) | |
198 | 193 | then unit | |
199 | 194 | else throw("Controller must be a valid address"), if (!(isController(address))) | |
200 | 195 | then unit | |
201 | 196 | else throw((("Controller `" + address) + "` is already registered"))]), [StringEntry(key_controllers, makeString((controllers :+ address), ","))]) | |
202 | 197 | ||
203 | 198 | ||
204 | 199 | ||
205 | 200 | @Callable(inv) | |
206 | 201 | func removeController (address) = valueOrElse(modifiers([onlyAdmin(inv), if (isController(address)) | |
207 | 202 | then unit | |
208 | 203 | else throw((("Controller `" + address) + "` is not registered"))]), { | |
209 | 204 | let controllerIndex = value(indexOf(controllers, address)) | |
210 | 205 | [StringEntry(key_controllers, makeString(removeByIndex(controllers, controllerIndex), ","))] | |
211 | 206 | }) | |
212 | 207 | ||
213 | 208 | ||
214 | 209 | ||
215 | 210 | @Callable(inv) | |
216 | 211 | func isValid (name) = $Tuple2(nil, isValidName(name)) | |
217 | 212 | ||
218 | 213 | ||
219 | 214 | ||
220 | 215 | @Callable(inv) | |
221 | 216 | func isAvailable (name) = $Tuple2(nil, isAvailableName(name)) | |
222 | 217 | ||
223 | 218 | ||
224 | 219 | ||
225 | 220 | @Callable(inv) | |
226 | 221 | func resolve (name,interfaceId,args) = { | |
227 | - | let $ | |
228 | - | let label = $ | |
229 | - | let restLabels = $ | |
222 | + | let $t065996646 = _splitLastLabel(name) | |
223 | + | let label = $t065996646._1 | |
224 | + | let restLabels = $t065996646._2 | |
230 | 225 | $Tuple2(nil, match interfaceId { | |
231 | 226 | case _ => | |
232 | 227 | if (("owner" == $match0)) | |
233 | 228 | then _getOwner(label) | |
234 | 229 | else if (("resolver" == $match0)) | |
235 | 230 | then _getResolver(label) | |
236 | 231 | else if (("createdAt" == $match0)) | |
237 | 232 | then _getCreatedAt(label) | |
238 | 233 | else if (("expiresAt" == $match0)) | |
239 | 234 | then _getExpiresAt(label) | |
240 | 235 | else if (("tokenId" == $match0)) | |
241 | 236 | then _getToken(label) | |
242 | 237 | else unit | |
243 | 238 | }) | |
244 | 239 | } | |
245 | 240 | ||
246 | 241 | ||
247 | 242 | ||
248 | 243 | @Callable(inv) | |
249 | 244 | func register (name,owner,createdAt) = valueOrElse(modifiers([onlyInitialized(), onlyController(inv), if (isAvailableName(name)) | |
250 | 245 | then unit | |
251 | 246 | else throw((("`" + name) + "` cannot be registered")), if (isValidAddress(owner)) | |
252 | 247 | then unit | |
253 | 248 | else throw("Owner must be a valid address"), if ((createdAt > 0)) | |
254 | 249 | then unit | |
255 | 250 | else throw("CreatedAt must be positive"), if ((lastBlock.timestamp >= createdAt)) | |
256 | 251 | then unit | |
257 | 252 | else throw("CreatedAt cannot be in the future")]), { | |
258 | 253 | let issueNameToken = _issueNameToken(name) | |
259 | 254 | let tokenId = calculateAssetId(issueNameToken[0]) | |
260 | 255 | let tokenStr = toBase58String(tokenId) | |
261 | 256 | let registerNameWithToken = _registerNameWithToken(name, tokenStr, createdAt) | |
262 | 257 | let transferTokenToOwner = _transferTokenToOwner(tokenStr, owner) | |
263 | 258 | let setOwnership = _setOwner(name, owner) | |
264 | 259 | (((issueNameToken ++ registerNameWithToken) ++ transferTokenToOwner) ++ setOwnership) | |
265 | 260 | }) | |
266 | 261 | ||
267 | 262 | ||
268 | 263 | ||
269 | 264 | @Callable(inv) | |
270 | 265 | func reclaim (name) = valueOrElse(modifiers([onlyInitialized(), if (isActiveName(name)) | |
271 | 266 | then unit | |
272 | 267 | else throw((("`" + name) + "` is not active"))]), { | |
273 | 268 | let newOwner = inv.originCaller | |
274 | 269 | let newOwnerAddress = toString(newOwner) | |
275 | 270 | let tokenStr = valueOrErrorMessage(_getToken(name), (("No token is issued for `" + name) + "`")) | |
276 | 271 | let tokenId = fromBase58String(tokenStr) | |
277 | 272 | let hasToken = (assetBalance(newOwner, tokenId) == 1) | |
278 | 273 | let isTokenOwner = isOwner(inv, name) | |
279 | 274 | let isTokenExists = match assetInfo(tokenId) { | |
280 | 275 | case token: Asset => | |
281 | 276 | (token.quantity == 1) | |
282 | 277 | case _ => | |
283 | 278 | false | |
284 | 279 | } | |
285 | 280 | if (if (isTokenOwner) | |
286 | 281 | then !(isTokenExists) | |
287 | 282 | else false) | |
288 | 283 | then { | |
289 | 284 | let issueNewToken = _issueNameToken(name) | |
290 | 285 | let newTokenId = calculateAssetId(issueNewToken[0]) | |
291 | 286 | let newTokenStr = toBase58String(newTokenId) | |
292 | 287 | let restoreNameWithNewToken = _restoreNameWithToken(name, newTokenStr) | |
293 | 288 | let transferNewTokenToOwner = _transferTokenToOwner(newTokenStr, newOwnerAddress) | |
294 | 289 | ((issueNewToken ++ restoreNameWithNewToken) ++ transferNewTokenToOwner) | |
295 | 290 | } | |
296 | 291 | else if (if (isTokenOwner) | |
297 | 292 | then hasToken | |
298 | 293 | else false) | |
299 | 294 | then throw("You already own a name token") | |
300 | 295 | else if (!(hasToken)) | |
301 | 296 | then throw("You don't have a name token") | |
302 | 297 | else _setOwner(name, newOwnerAddress) | |
303 | 298 | }) | |
304 | 299 | ||
305 | 300 |
github/deemru/w8io/169f3d6 56.63 ms ◑