tx · HuZ4vRc76Bv8M4bMbHkC66a5KS8pWaB7a1fYYzD7w8XS 3MvrXJVzDMDcshazxn88FybxHV2JvWQBxTc: -0.01500000 Waves 2022.10.20 10:45 [2280440] smart account 3MvrXJVzDMDcshazxn88FybxHV2JvWQBxTc > SELF 0.00000000 Waves
{ "type": 13, "id": "HuZ4vRc76Bv8M4bMbHkC66a5KS8pWaB7a1fYYzD7w8XS", "fee": 1500000, "feeAssetId": null, "timestamp": 1666251955618, "version": 2, "chainId": 84, "sender": "3MvrXJVzDMDcshazxn88FybxHV2JvWQBxTc", "senderPublicKey": "Fq8P5ctrS7PNTX37bWWxvnwoB7C2FaNySZWnRmgPUaDH", "proofs": [ "HM6THxns7hsTYWm8RZDPkg5ieZMn3C3PSy2hjSz2umTZEx7oB63zyid5WwGNgFPSvqzBZb4Xgvp3gfH9qRMSwkB" ], "script": "base64:AAIFAAAAAAAAAFEIAhIDCgEBEgMKAQgSAwoBCBIDCgEIEgMKAQgSAwoBCBIDCgEIEgMKAQgSBAoCCAgSAwoBCBIECgIICBIDCgEIEgMKAQgSBQoDCAgBEgMKAQgAAAAtAQAAABBnZXRTdHJpbmdPclRocm93AAAAAgAAAAdhZGRyZXNzAAAAA2tleQkBAAAAE3ZhbHVlT3JFcnJvck1lc3NhZ2UAAAACCQAEHQAAAAIFAAAAB2FkZHJlc3MFAAAAA2tleQkAASwAAAACCQABLAAAAAIJAAEsAAAAAgIAAAAMQ2FuJ3QgcmVhZCAnBQAAAANrZXkCAAAADScgYXQgYWRkcmVzcyAJAAQlAAAAAQUAAAAHYWRkcmVzcwEAAAARZ2V0SW50ZWdlck9yVGhyb3cAAAACAAAAB2FkZHJlc3MAAAADa2V5CQEAAAATdmFsdWVPckVycm9yTWVzc2FnZQAAAAIJAAQaAAAAAgUAAAAHYWRkcmVzcwUAAAADa2V5CQABLAAAAAIJAAEsAAAAAgkAASwAAAACAgAAAAxDYW4ndCByZWFkICcFAAAAA2tleQIAAAANJyBhdCBhZGRyZX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b2tlblN0cgUAAAAPbmV3T3duZXJBZGRyZXNzCQAETgAAAAIJAAROAAAAAgUAAAANaXNzdWVOZXdUb2tlbgUAAAAXcmVzdG9yZU5hbWVXaXRoTmV3VG9rZW4FAAAAF3RyYW5zZmVyTmV3VG9rZW5Ub093bmVyAwMFAAAADGlzVG9rZW5Pd25lcgUAAAAIaGFzVG9rZW4HCQAAAgAAAAECAAAAHFlvdSBhbHJlYWR5IG93biBhIG5hbWUgdG9rZW4DCQEAAAABIQAAAAEFAAAACGhhc1Rva2VuCQAAAgAAAAECAAAAG1lvdSBkb24ndCBoYXZlIGEgbmFtZSB0b2tlbgkBAAAACV9zZXRPd25lcgAAAAIFAAAABG5hbWUFAAAAD25ld093bmVyQWRkcmVzcwAAAAC6P0yM", "height": 2280440, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 71nLY3vj8gjdwqm1pBqnEZksbSGAhqT3mKRvsKaS6DU9 Next: DwdasS4cNGLG5PEjH8Z1qdWBtSeCDkNDr5DrTkLEt3gB Diff:
Old | New | Differences | |
---|---|---|---|
195 | 195 | else throw("Permission denied") | |
196 | 196 | ||
197 | 197 | ||
198 | + | func _callSupportedInterface (registrant,interfaceId,restLabels) = match invoke(registrant, "supportsInterface", [interfaceId], nil) { | |
199 | + | case supportsInterface: Boolean => | |
200 | + | if (!(supportsInterface)) | |
201 | + | then unit | |
202 | + | else match invoke(registrant, interfaceId, [restLabels], nil) { | |
203 | + | case maybeString: String => | |
204 | + | maybeString | |
205 | + | case maybeInt: Int => | |
206 | + | maybeInt | |
207 | + | case _ => | |
208 | + | unit | |
209 | + | } | |
210 | + | case _ => | |
211 | + | unit | |
212 | + | } | |
213 | + | ||
214 | + | ||
198 | 215 | @Callable(inv) | |
199 | 216 | func init (nameTTL) = valueOrElse(modifiers([onlyAdmin(inv), if ((nameTTL > 0)) | |
200 | 217 | then unit | |
237 | 254 | ||
238 | 255 | ||
239 | 256 | @Callable(inv) | |
240 | - | func owner (name) = $Tuple2(nil, _getOwner(_splitLastLabel(name)._1)) | |
257 | + | func owner (name) = { | |
258 | + | let $t079157962 = _splitLastLabel(name) | |
259 | + | let label = $t079157962._1 | |
260 | + | let restLabels = $t079157962._2 | |
261 | + | let ownerAddress = _getOwner(label) | |
262 | + | let registrarAddress = _getRegistrar(label) | |
263 | + | let registrar = value(addressFromString(value(registrarAddress))) | |
264 | + | $Tuple2(nil, if (if ((size(restLabels) == 0)) | |
265 | + | then true | |
266 | + | else !(isDefined(registrarAddress))) | |
267 | + | then ownerAddress | |
268 | + | else match _callSupportedInterface(registrar, "owner", restLabels) { | |
269 | + | case maybeOwner: String => | |
270 | + | if (isValidAddress(maybeOwner)) | |
271 | + | then maybeOwner | |
272 | + | else unit | |
273 | + | case _ => | |
274 | + | unit | |
275 | + | }) | |
276 | + | } | |
241 | 277 | ||
242 | 278 | ||
243 | 279 | ||
244 | 280 | @Callable(inv) | |
245 | 281 | func registrar (name) = { | |
246 | - | let $ | |
247 | - | let label = $ | |
248 | - | let restLabels = $ | |
282 | + | let $t085918638 = _splitLastLabel(name) | |
283 | + | let label = $t085918638._1 | |
284 | + | let restLabels = $t085918638._2 | |
249 | 285 | let registrarAddress = match _getRegistrar(label) { | |
250 | 286 | case maybeRegistrar: String => | |
251 | 287 | if (isValidAddress(maybeRegistrar)) | |
255 | 291 | unit | |
256 | 292 | } | |
257 | 293 | let registrar = value(addressFromString(value(registrarAddress))) | |
258 | - | let supportsInterface = match invoke(registrar, "supportsInterface", ["registrar"], nil) { | |
259 | - | case supportsInterface: Boolean => | |
260 | - | supportsInterface | |
261 | - | case _ => | |
262 | - | false | |
263 | - | } | |
264 | - | if (if ((size(restLabels) == 0)) | |
294 | + | $Tuple2(nil, if (if ((size(restLabels) == 0)) | |
265 | 295 | then true | |
266 | 296 | else !(isDefined(registrarAddress))) | |
267 | - | then $Tuple2(nil, registrarAddress) | |
268 | - | else if (!(supportsInterface)) | |
269 | - | then $Tuple2(nil, unit) | |
270 | - | else match invoke(registrar, "registrar", [restLabels], nil) { | |
271 | - | case maybeRegistrar: String => | |
272 | - | $Tuple2(nil, if (isValidAddress(maybeRegistrar)) | |
273 | - | then maybeRegistrar | |
274 | - | else unit) | |
275 | - | case _ => | |
276 | - | $Tuple2(nil, unit) | |
277 | - | } | |
297 | + | then registrarAddress | |
298 | + | else match _callSupportedInterface(registrar, "registrar", restLabels) { | |
299 | + | case maybeRegistrar: String => | |
300 | + | if (isValidAddress(maybeRegistrar)) | |
301 | + | then maybeRegistrar | |
302 | + | else unit | |
303 | + | case _ => | |
304 | + | unit | |
305 | + | }) | |
278 | 306 | } | |
279 | 307 | ||
280 | 308 |
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 getIntegerOrThrow (address,key) = valueOrErrorMessage(getInteger(address, key), ((("Can't read '" + key) + "' at address ") + toString(address))) | |
8 | 8 | ||
9 | 9 | ||
10 | 10 | func parseAddressOrThrow (maybeAddress) = valueOrErrorMessage(addressFromString(maybeAddress), (("Can't parse address from '" + maybeAddress) + "'")) | |
11 | 11 | ||
12 | 12 | ||
13 | 13 | func key_entity (name,pk,property) = ((((name + "_") + pk) + "_") + property) | |
14 | 14 | ||
15 | 15 | ||
16 | 16 | func key_Token_name (tokenId) = key_entity("Token", tokenId, "name") | |
17 | 17 | ||
18 | 18 | ||
19 | 19 | func key_Name_token (name) = key_entity("Name", name, "token") | |
20 | 20 | ||
21 | 21 | ||
22 | 22 | func key_Name_owner (name) = key_entity("Name", name, "owner") | |
23 | 23 | ||
24 | 24 | ||
25 | 25 | func key_Name_registrar (name) = key_entity("Name", name, "registrar") | |
26 | 26 | ||
27 | 27 | ||
28 | 28 | func key_Name_resolver (name) = key_entity("Name", name, "resolver") | |
29 | 29 | ||
30 | 30 | ||
31 | 31 | func key_Name_expiresAt (name) = key_entity("Name", name, "expiresAt") | |
32 | 32 | ||
33 | 33 | ||
34 | 34 | func key_Name_createdAt (name) = key_entity("Name", name, "createdAt") | |
35 | 35 | ||
36 | 36 | ||
37 | 37 | let key_nameTTL = "nameTTL" | |
38 | 38 | ||
39 | 39 | let key_controllers = "controllers" | |
40 | 40 | ||
41 | 41 | func _setOwner (name,owner) = [StringEntry(key_Name_owner(name), owner)] | |
42 | 42 | ||
43 | 43 | ||
44 | 44 | func _getOwner (name) = getString(this, key_Name_owner(name)) | |
45 | 45 | ||
46 | 46 | ||
47 | 47 | func _setRegistrar (name,registrar) = [StringEntry(key_Name_registrar(name), registrar)] | |
48 | 48 | ||
49 | 49 | ||
50 | 50 | func _getRegistrar (name) = getString(this, key_Name_registrar(name)) | |
51 | 51 | ||
52 | 52 | ||
53 | 53 | func _setResolver (name,resolver) = [StringEntry(key_Name_resolver(name), resolver)] | |
54 | 54 | ||
55 | 55 | ||
56 | 56 | func _getResolver (name) = getString(this, key_Name_resolver(name)) | |
57 | 57 | ||
58 | 58 | ||
59 | 59 | func _getToken (name) = getString(this, key_Name_token(name)) | |
60 | 60 | ||
61 | 61 | ||
62 | 62 | func _getCreatedAt (name) = getInteger(this, key_Name_createdAt(name)) | |
63 | 63 | ||
64 | 64 | ||
65 | 65 | func _getExpiresAt (name) = getInteger(this, key_Name_expiresAt(name)) | |
66 | 66 | ||
67 | 67 | ||
68 | 68 | func _getControllers () = getString(this, key_controllers) | |
69 | 69 | ||
70 | 70 | ||
71 | 71 | let controllers = match _getControllers() { | |
72 | 72 | case repr: String => | |
73 | 73 | split(repr, ",") | |
74 | 74 | case _ => | |
75 | 75 | nil | |
76 | 76 | } | |
77 | 77 | ||
78 | 78 | let nameTTL = getIntegerOrThrow(this, key_nameTTL) | |
79 | 79 | ||
80 | 80 | func isRegisteredName (name) = isDefined(getString(this, key_Name_token(name))) | |
81 | 81 | ||
82 | 82 | ||
83 | 83 | func isCreatedName (name) = isDefined(_getCreatedAt(name)) | |
84 | 84 | ||
85 | 85 | ||
86 | 86 | func isExpiredName (name) = match _getExpiresAt(name) { | |
87 | 87 | case expiresAt: Int => | |
88 | 88 | (lastBlock.timestamp > expiresAt) | |
89 | 89 | case _ => | |
90 | 90 | false | |
91 | 91 | } | |
92 | 92 | ||
93 | 93 | ||
94 | 94 | func isActiveName (name) = if (if (isRegisteredName(name)) | |
95 | 95 | then isCreatedName(name) | |
96 | 96 | else false) | |
97 | 97 | then !(isExpiredName(name)) | |
98 | 98 | else false | |
99 | 99 | ||
100 | 100 | ||
101 | 101 | func isValidName (name) = { | |
102 | 102 | let symbols = "abcdefghijklmnopqrstuvwxyz1234567890-" | |
103 | 103 | func validateChars (isValid,char) = if (isValid) | |
104 | 104 | then contains(symbols, char) | |
105 | 105 | else false | |
106 | 106 | ||
107 | 107 | if (if (if (if (if ((size(name) > 0)) | |
108 | 108 | then (63 >= size(name)) | |
109 | 109 | else false) | |
110 | 110 | then (indexOf(name, "--") != 2) | |
111 | 111 | else false) | |
112 | 112 | then (indexOf(name, "-") != 0) | |
113 | 113 | else false) | |
114 | 114 | then (lastIndexOf(name, "-") != (size(name) - 1)) | |
115 | 115 | else false) | |
116 | 116 | then { | |
117 | 117 | let $l = split(name, "") | |
118 | 118 | let $s = size($l) | |
119 | 119 | let $acc0 = true | |
120 | 120 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
121 | 121 | then $a | |
122 | 122 | else validateChars($a, $l[$i]) | |
123 | 123 | ||
124 | 124 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
125 | 125 | then $a | |
126 | 126 | else throw("List size exceeds 63") | |
127 | 127 | ||
128 | 128 | $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) | |
129 | 129 | } | |
130 | 130 | else false | |
131 | 131 | } | |
132 | 132 | ||
133 | 133 | ||
134 | 134 | func isAvailableName (name) = if (isValidName(name)) | |
135 | 135 | then if (!(isRegisteredName(name))) | |
136 | 136 | then true | |
137 | 137 | else isExpiredName(name) | |
138 | 138 | else false | |
139 | 139 | ||
140 | 140 | ||
141 | 141 | func isValidAddress (maybeAddress) = isDefined(addressFromString(maybeAddress)) | |
142 | 142 | ||
143 | 143 | ||
144 | 144 | func isAdmin (inv) = (inv.caller == this) | |
145 | 145 | ||
146 | 146 | ||
147 | 147 | func isOwner (inv,name) = (toString(inv.caller) == valueOrElse(_getOwner(name), "")) | |
148 | 148 | ||
149 | 149 | ||
150 | 150 | func isController (address) = containsElement(controllers, address) | |
151 | 151 | ||
152 | 152 | ||
153 | 153 | func _splitLastLabel (name) = { | |
154 | 154 | let labels = split(name, ".") | |
155 | 155 | let lastIndex = (size(labels) - 1) | |
156 | 156 | let lastLabel = labels[lastIndex] | |
157 | 157 | let restLabels = makeString(removeByIndex(labels, lastIndex), ".") | |
158 | 158 | $Tuple2(lastLabel, restLabels) | |
159 | 159 | } | |
160 | 160 | ||
161 | 161 | ||
162 | 162 | func _issueNameToken (name) = [Issue(if ((size(name) > 16)) | |
163 | 163 | then (take(name, 15) + "~") | |
164 | 164 | else take(name, 16), (name + ".waves"), 1, 0, false)] | |
165 | 165 | ||
166 | 166 | ||
167 | 167 | 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))] | |
168 | 168 | ||
169 | 169 | ||
170 | 170 | func _restoreNameWithToken (name,tokenId) = [StringEntry(key_Name_token(name), tokenId), StringEntry(key_Token_name(tokenId), name)] | |
171 | 171 | ||
172 | 172 | ||
173 | 173 | func _transferTokenToOwner (tokenId,owner) = [ScriptTransfer(parseAddressOrThrow(owner), 1, fromBase58String(tokenId))] | |
174 | 174 | ||
175 | 175 | ||
176 | 176 | func modifiers (validations) = unit | |
177 | 177 | ||
178 | 178 | ||
179 | 179 | func onlyAdmin (inv) = if (isAdmin(inv)) | |
180 | 180 | then unit | |
181 | 181 | else throw("Permission denied") | |
182 | 182 | ||
183 | 183 | ||
184 | 184 | func onlyController (inv) = if (if (isAdmin(inv)) | |
185 | 185 | then true | |
186 | 186 | else isController(toString(inv.caller))) | |
187 | 187 | then unit | |
188 | 188 | else throw("Permission denied") | |
189 | 189 | ||
190 | 190 | ||
191 | 191 | func onlyOwner (inv,name) = if (if (isAdmin(inv)) | |
192 | 192 | then true | |
193 | 193 | else isOwner(inv, name)) | |
194 | 194 | then unit | |
195 | 195 | else throw("Permission denied") | |
196 | 196 | ||
197 | 197 | ||
198 | + | func _callSupportedInterface (registrant,interfaceId,restLabels) = match invoke(registrant, "supportsInterface", [interfaceId], nil) { | |
199 | + | case supportsInterface: Boolean => | |
200 | + | if (!(supportsInterface)) | |
201 | + | then unit | |
202 | + | else match invoke(registrant, interfaceId, [restLabels], nil) { | |
203 | + | case maybeString: String => | |
204 | + | maybeString | |
205 | + | case maybeInt: Int => | |
206 | + | maybeInt | |
207 | + | case _ => | |
208 | + | unit | |
209 | + | } | |
210 | + | case _ => | |
211 | + | unit | |
212 | + | } | |
213 | + | ||
214 | + | ||
198 | 215 | @Callable(inv) | |
199 | 216 | func init (nameTTL) = valueOrElse(modifiers([onlyAdmin(inv), if ((nameTTL > 0)) | |
200 | 217 | then unit | |
201 | 218 | else throw("TTL cannot be negative")]), [IntegerEntry(key_nameTTL, nameTTL)]) | |
202 | 219 | ||
203 | 220 | ||
204 | 221 | ||
205 | 222 | @Callable(inv) | |
206 | 223 | func supportsInterface (interfaceId) = $Tuple2(nil, containsElement(["owner", "registrar", "resolver", "nameCreated", "nameExpires"], interfaceId)) | |
207 | 224 | ||
208 | 225 | ||
209 | 226 | ||
210 | 227 | @Callable(inv) | |
211 | 228 | func addController (address) = valueOrElse(modifiers([onlyAdmin(inv), if (isValidAddress(address)) | |
212 | 229 | then unit | |
213 | 230 | else throw("Controller must be a valid address"), if (!(isController(address))) | |
214 | 231 | then unit | |
215 | 232 | else throw((("Controller `" + address) + "` is already registered"))]), [StringEntry(key_controllers, makeString((controllers :+ address), ","))]) | |
216 | 233 | ||
217 | 234 | ||
218 | 235 | ||
219 | 236 | @Callable(inv) | |
220 | 237 | func removeController (address) = valueOrElse(modifiers([onlyAdmin(inv), if (isController(address)) | |
221 | 238 | then unit | |
222 | 239 | else throw((("Controller `" + address) + "` is not registered"))]), { | |
223 | 240 | let controllerIndex = value(indexOf(controllers, address)) | |
224 | 241 | [StringEntry(key_controllers, makeString(removeByIndex(controllers, controllerIndex), ","))] | |
225 | 242 | }) | |
226 | 243 | ||
227 | 244 | ||
228 | 245 | ||
229 | 246 | @Callable(inv) | |
230 | 247 | func validate (name) = $Tuple2(nil, isValidName(name)) | |
231 | 248 | ||
232 | 249 | ||
233 | 250 | ||
234 | 251 | @Callable(inv) | |
235 | 252 | func available (name) = $Tuple2(nil, isAvailableName(name)) | |
236 | 253 | ||
237 | 254 | ||
238 | 255 | ||
239 | 256 | @Callable(inv) | |
240 | - | func owner (name) = $Tuple2(nil, _getOwner(_splitLastLabel(name)._1)) | |
257 | + | func owner (name) = { | |
258 | + | let $t079157962 = _splitLastLabel(name) | |
259 | + | let label = $t079157962._1 | |
260 | + | let restLabels = $t079157962._2 | |
261 | + | let ownerAddress = _getOwner(label) | |
262 | + | let registrarAddress = _getRegistrar(label) | |
263 | + | let registrar = value(addressFromString(value(registrarAddress))) | |
264 | + | $Tuple2(nil, if (if ((size(restLabels) == 0)) | |
265 | + | then true | |
266 | + | else !(isDefined(registrarAddress))) | |
267 | + | then ownerAddress | |
268 | + | else match _callSupportedInterface(registrar, "owner", restLabels) { | |
269 | + | case maybeOwner: String => | |
270 | + | if (isValidAddress(maybeOwner)) | |
271 | + | then maybeOwner | |
272 | + | else unit | |
273 | + | case _ => | |
274 | + | unit | |
275 | + | }) | |
276 | + | } | |
241 | 277 | ||
242 | 278 | ||
243 | 279 | ||
244 | 280 | @Callable(inv) | |
245 | 281 | func registrar (name) = { | |
246 | - | let $ | |
247 | - | let label = $ | |
248 | - | let restLabels = $ | |
282 | + | let $t085918638 = _splitLastLabel(name) | |
283 | + | let label = $t085918638._1 | |
284 | + | let restLabels = $t085918638._2 | |
249 | 285 | let registrarAddress = match _getRegistrar(label) { | |
250 | 286 | case maybeRegistrar: String => | |
251 | 287 | if (isValidAddress(maybeRegistrar)) | |
252 | 288 | then maybeRegistrar | |
253 | 289 | else unit | |
254 | 290 | case _ => | |
255 | 291 | unit | |
256 | 292 | } | |
257 | 293 | let registrar = value(addressFromString(value(registrarAddress))) | |
258 | - | let supportsInterface = match invoke(registrar, "supportsInterface", ["registrar"], nil) { | |
259 | - | case supportsInterface: Boolean => | |
260 | - | supportsInterface | |
261 | - | case _ => | |
262 | - | false | |
263 | - | } | |
264 | - | if (if ((size(restLabels) == 0)) | |
294 | + | $Tuple2(nil, if (if ((size(restLabels) == 0)) | |
265 | 295 | then true | |
266 | 296 | else !(isDefined(registrarAddress))) | |
267 | - | then $Tuple2(nil, registrarAddress) | |
268 | - | else if (!(supportsInterface)) | |
269 | - | then $Tuple2(nil, unit) | |
270 | - | else match invoke(registrar, "registrar", [restLabels], nil) { | |
271 | - | case maybeRegistrar: String => | |
272 | - | $Tuple2(nil, if (isValidAddress(maybeRegistrar)) | |
273 | - | then maybeRegistrar | |
274 | - | else unit) | |
275 | - | case _ => | |
276 | - | $Tuple2(nil, unit) | |
277 | - | } | |
297 | + | then registrarAddress | |
298 | + | else match _callSupportedInterface(registrar, "registrar", restLabels) { | |
299 | + | case maybeRegistrar: String => | |
300 | + | if (isValidAddress(maybeRegistrar)) | |
301 | + | then maybeRegistrar | |
302 | + | else unit | |
303 | + | case _ => | |
304 | + | unit | |
305 | + | }) | |
278 | 306 | } | |
279 | 307 | ||
280 | 308 | ||
281 | 309 | ||
282 | 310 | @Callable(inv) | |
283 | 311 | func setRegistrar (name,registrar) = valueOrElse(modifiers([if (isActiveName(name)) | |
284 | 312 | then unit | |
285 | 313 | else throw("Name expired or not registered"), onlyOwner(inv, name), if (isValidAddress(registrar)) | |
286 | 314 | then unit | |
287 | 315 | else throw("Registrar must be a valid contract address")]), _setRegistrar(name, registrar)) | |
288 | 316 | ||
289 | 317 | ||
290 | 318 | ||
291 | 319 | @Callable(inv) | |
292 | 320 | func resolver (name) = $Tuple2(nil, _getResolver(_splitLastLabel(name)._1)) | |
293 | 321 | ||
294 | 322 | ||
295 | 323 | ||
296 | 324 | @Callable(inv) | |
297 | 325 | func setResolver (name,resolver) = valueOrElse(modifiers([if (isActiveName(name)) | |
298 | 326 | then unit | |
299 | 327 | else throw("Name expired or not registered"), onlyOwner(inv, name), if (isValidAddress(resolver)) | |
300 | 328 | then unit | |
301 | 329 | else throw("Resolver must be a valid contract address")]), _setResolver(name, resolver)) | |
302 | 330 | ||
303 | 331 | ||
304 | 332 | ||
305 | 333 | @Callable(inv) | |
306 | 334 | func nameCreated (name) = $Tuple2(nil, _getCreatedAt(_splitLastLabel(name)._1)) | |
307 | 335 | ||
308 | 336 | ||
309 | 337 | ||
310 | 338 | @Callable(inv) | |
311 | 339 | func nameExpires (name) = $Tuple2(nil, _getExpiresAt(_splitLastLabel(name)._1)) | |
312 | 340 | ||
313 | 341 | ||
314 | 342 | ||
315 | 343 | @Callable(inv) | |
316 | 344 | func register (name,owner,createdAt) = valueOrElse(modifiers([onlyController(inv), if (isAvailableName(name)) | |
317 | 345 | then unit | |
318 | 346 | else throw((("`" + name) + "` cannot be registered")), if (isValidAddress(owner)) | |
319 | 347 | then unit | |
320 | 348 | else throw("Owner must be a valid address"), if ((createdAt > 0)) | |
321 | 349 | then unit | |
322 | 350 | else throw("CreatedAt cannot be negative"), if ((lastBlock.timestamp >= createdAt)) | |
323 | 351 | then unit | |
324 | 352 | else throw("CreatedAt cannot be in the future")]), { | |
325 | 353 | let issueNameToken = _issueNameToken(name) | |
326 | 354 | let tokenId = calculateAssetId(issueNameToken[0]) | |
327 | 355 | let tokenStr = toBase58String(tokenId) | |
328 | 356 | let registerNameWithToken = _registerNameWithToken(name, tokenStr, createdAt) | |
329 | 357 | let transferTokenToOwner = _transferTokenToOwner(tokenStr, owner) | |
330 | 358 | let setOwnership = _setOwner(name, owner) | |
331 | 359 | (((issueNameToken ++ registerNameWithToken) ++ transferTokenToOwner) ++ setOwnership) | |
332 | 360 | }) | |
333 | 361 | ||
334 | 362 | ||
335 | 363 | ||
336 | 364 | @Callable(inv) | |
337 | 365 | func reclaim (name) = valueOrElse(modifiers([if (isActiveName(name)) | |
338 | 366 | then unit | |
339 | 367 | else throw((("`" + name) + "` is not active"))]), { | |
340 | 368 | let newOwner = inv.caller | |
341 | 369 | let newOwnerAddress = toString(newOwner) | |
342 | 370 | let tokenStr = valueOrErrorMessage(_getToken(name), (("No token is issued for `" + name) + "`")) | |
343 | 371 | let tokenId = fromBase58String(tokenStr) | |
344 | 372 | let hasToken = (assetBalance(newOwner, tokenId) == 1) | |
345 | 373 | let isTokenOwner = isOwner(inv, name) | |
346 | 374 | let isTokenExists = match assetInfo(tokenId) { | |
347 | 375 | case token: Asset => | |
348 | 376 | (token.quantity == 1) | |
349 | 377 | case _ => | |
350 | 378 | false | |
351 | 379 | } | |
352 | 380 | if (if (isTokenOwner) | |
353 | 381 | then !(isTokenExists) | |
354 | 382 | else false) | |
355 | 383 | then { | |
356 | 384 | let issueNewToken = _issueNameToken(name) | |
357 | 385 | let newTokenId = calculateAssetId(issueNewToken[0]) | |
358 | 386 | let newTokenStr = toBase58String(newTokenId) | |
359 | 387 | let restoreNameWithNewToken = _restoreNameWithToken(name, newTokenStr) | |
360 | 388 | let transferNewTokenToOwner = _transferTokenToOwner(newTokenStr, newOwnerAddress) | |
361 | 389 | ((issueNewToken ++ restoreNameWithNewToken) ++ transferNewTokenToOwner) | |
362 | 390 | } | |
363 | 391 | else if (if (isTokenOwner) | |
364 | 392 | then hasToken | |
365 | 393 | else false) | |
366 | 394 | then throw("You already own a name token") | |
367 | 395 | else if (!(hasToken)) | |
368 | 396 | then throw("You don't have a name token") | |
369 | 397 | else _setOwner(name, newOwnerAddress) | |
370 | 398 | }) | |
371 | 399 | ||
372 | 400 |
github/deemru/w8io/026f985 58.22 ms ◑