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:AAIFAAAAAAAAAFEIAhIDCgEBEgMKAQgSAwoBCBIDCgEIEgMKAQgSAwoBCBIDCgEIEgMKAQgSBAoCCAgSAwoBCBIECgIICBIDCgEIEgMKAQgSBQoDCAgBEgMKAQgAAAAtAQAAABBnZXRTdHJpbmdPclRocm93AAAAAgAAAAdhZGRyZXNzAAAAA2tleQkBAAAAE3ZhbHVlT3JFcnJvck1lc3NhZ2UAAAACCQAEHQAAAAIFAAAAB2FkZHJlc3MFAAAAA2tleQkAASwAAAACCQABLAAAAAIJAAEsAAAAAgIAAAAMQ2FuJ3QgcmVhZCAnBQAAAANrZXkCAAAADScgYXQgYWRkcmVzcyAJAAQlAAAAAQUAAAAHYWRkcmVzcwEAAAARZ2V0SW50ZWdlck9yVGhyb3cAAAACAAAAB2FkZHJlc3MAAAADa2V5CQEAAAATdmFsdWVPckVycm9yTWVzc2FnZQAAAAIJAAQaAAAAAgUAAAAHYWRkcmVzcwUAAAADa2V5CQABLAAAAAIJAAEsAAAAAgkAASwAAAACAgAAAAxDYW4ndCByZWFkICcFAAAAA2tleQIAAAANJyBhdCBhZGRyZ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Ub2tlblN0cgUAAAAPbmV3T3duZXJBZGRyZXNzCQAETgAAAAIJAAROAAAAAgUAAAANaXNzdWVOZXdUb2tlbgUAAAAXcmVzdG9yZU5hbWVXaXRoTmV3VG9rZW4FAAAAF3RyYW5zZmVyTmV3VG9rZW5Ub093bmVyAwMFAAAADGlzVG9rZW5Pd25lcgUAAAAIaGFzVG9rZW4HCQAAAgAAAAECAAAAHFlvdSBhbHJlYWR5IG93biBhIG5hbWUgdG9rZW4DCQEAAAABIQAAAAEFAAAACGhhc1Rva2VuCQAAAgAAAAECAAAAG1lvdSBkb24ndCBoYXZlIGEgbmFtZSB0b2tlbgkBAAAACV9zZXRPd25lcgAAAAIFAAAABG5hbWUFAAAAD25ld093bmVyQWRkcmVzcwAAAAC6P0yM", "height": 2280440, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 71nLY3vj8gjdwqm1pBqnEZksbSGAhqT3mKRvsKaS6DU9 Next: DwdasS4cNGLG5PEjH8Z1qdWBtSeCDkNDr5DrTkLEt3gB Diff:
OldNewDifferences
195195 else throw("Permission denied")
196196
197197
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+
198215 @Callable(inv)
199216 func init (nameTTL) = valueOrElse(modifiers([onlyAdmin(inv), if ((nameTTL > 0))
200217 then unit
237254
238255
239256 @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+ }
241277
242278
243279
244280 @Callable(inv)
245281 func registrar (name) = {
246- let $t075597606 = _splitLastLabel(name)
247- let label = $t075597606._1
248- let restLabels = $t075597606._2
282+ let $t085918638 = _splitLastLabel(name)
283+ let label = $t085918638._1
284+ let restLabels = $t085918638._2
249285 let registrarAddress = match _getRegistrar(label) {
250286 case maybeRegistrar: String =>
251287 if (isValidAddress(maybeRegistrar))
255291 unit
256292 }
257293 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))
265295 then true
266296 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+ })
278306 }
279307
280308
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 getIntegerOrThrow (address,key) = valueOrErrorMessage(getInteger(address, key), ((("Can't read '" + key) + "' at address ") + toString(address)))
88
99
1010 func parseAddressOrThrow (maybeAddress) = valueOrErrorMessage(addressFromString(maybeAddress), (("Can't parse address from '" + maybeAddress) + "'"))
1111
1212
1313 func key_entity (name,pk,property) = ((((name + "_") + pk) + "_") + property)
1414
1515
1616 func key_Token_name (tokenId) = key_entity("Token", tokenId, "name")
1717
1818
1919 func key_Name_token (name) = key_entity("Name", name, "token")
2020
2121
2222 func key_Name_owner (name) = key_entity("Name", name, "owner")
2323
2424
2525 func key_Name_registrar (name) = key_entity("Name", name, "registrar")
2626
2727
2828 func key_Name_resolver (name) = key_entity("Name", name, "resolver")
2929
3030
3131 func key_Name_expiresAt (name) = key_entity("Name", name, "expiresAt")
3232
3333
3434 func key_Name_createdAt (name) = key_entity("Name", name, "createdAt")
3535
3636
3737 let key_nameTTL = "nameTTL"
3838
3939 let key_controllers = "controllers"
4040
4141 func _setOwner (name,owner) = [StringEntry(key_Name_owner(name), owner)]
4242
4343
4444 func _getOwner (name) = getString(this, key_Name_owner(name))
4545
4646
4747 func _setRegistrar (name,registrar) = [StringEntry(key_Name_registrar(name), registrar)]
4848
4949
5050 func _getRegistrar (name) = getString(this, key_Name_registrar(name))
5151
5252
5353 func _setResolver (name,resolver) = [StringEntry(key_Name_resolver(name), resolver)]
5454
5555
5656 func _getResolver (name) = getString(this, key_Name_resolver(name))
5757
5858
5959 func _getToken (name) = getString(this, key_Name_token(name))
6060
6161
6262 func _getCreatedAt (name) = getInteger(this, key_Name_createdAt(name))
6363
6464
6565 func _getExpiresAt (name) = getInteger(this, key_Name_expiresAt(name))
6666
6767
6868 func _getControllers () = getString(this, key_controllers)
6969
7070
7171 let controllers = match _getControllers() {
7272 case repr: String =>
7373 split(repr, ",")
7474 case _ =>
7575 nil
7676 }
7777
7878 let nameTTL = getIntegerOrThrow(this, key_nameTTL)
7979
8080 func isRegisteredName (name) = isDefined(getString(this, key_Name_token(name)))
8181
8282
8383 func isCreatedName (name) = isDefined(_getCreatedAt(name))
8484
8585
8686 func isExpiredName (name) = match _getExpiresAt(name) {
8787 case expiresAt: Int =>
8888 (lastBlock.timestamp > expiresAt)
8989 case _ =>
9090 false
9191 }
9292
9393
9494 func isActiveName (name) = if (if (isRegisteredName(name))
9595 then isCreatedName(name)
9696 else false)
9797 then !(isExpiredName(name))
9898 else false
9999
100100
101101 func isValidName (name) = {
102102 let symbols = "abcdefghijklmnopqrstuvwxyz1234567890-"
103103 func validateChars (isValid,char) = if (isValid)
104104 then contains(symbols, char)
105105 else false
106106
107107 if (if (if (if (if ((size(name) > 0))
108108 then (63 >= size(name))
109109 else false)
110110 then (indexOf(name, "--") != 2)
111111 else false)
112112 then (indexOf(name, "-") != 0)
113113 else false)
114114 then (lastIndexOf(name, "-") != (size(name) - 1))
115115 else false)
116116 then {
117117 let $l = split(name, "")
118118 let $s = size($l)
119119 let $acc0 = true
120120 func $f0_1 ($a,$i) = if (($i >= $s))
121121 then $a
122122 else validateChars($a, $l[$i])
123123
124124 func $f0_2 ($a,$i) = if (($i >= $s))
125125 then $a
126126 else throw("List size exceeds 63")
127127
128128 $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)
129129 }
130130 else false
131131 }
132132
133133
134134 func isAvailableName (name) = if (isValidName(name))
135135 then if (!(isRegisteredName(name)))
136136 then true
137137 else isExpiredName(name)
138138 else false
139139
140140
141141 func isValidAddress (maybeAddress) = isDefined(addressFromString(maybeAddress))
142142
143143
144144 func isAdmin (inv) = (inv.caller == this)
145145
146146
147147 func isOwner (inv,name) = (toString(inv.caller) == valueOrElse(_getOwner(name), ""))
148148
149149
150150 func isController (address) = containsElement(controllers, address)
151151
152152
153153 func _splitLastLabel (name) = {
154154 let labels = split(name, ".")
155155 let lastIndex = (size(labels) - 1)
156156 let lastLabel = labels[lastIndex]
157157 let restLabels = makeString(removeByIndex(labels, lastIndex), ".")
158158 $Tuple2(lastLabel, restLabels)
159159 }
160160
161161
162162 func _issueNameToken (name) = [Issue(if ((size(name) > 16))
163163 then (take(name, 15) + "~")
164164 else take(name, 16), (name + ".waves"), 1, 0, false)]
165165
166166
167167 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))]
168168
169169
170170 func _restoreNameWithToken (name,tokenId) = [StringEntry(key_Name_token(name), tokenId), StringEntry(key_Token_name(tokenId), name)]
171171
172172
173173 func _transferTokenToOwner (tokenId,owner) = [ScriptTransfer(parseAddressOrThrow(owner), 1, fromBase58String(tokenId))]
174174
175175
176176 func modifiers (validations) = unit
177177
178178
179179 func onlyAdmin (inv) = if (isAdmin(inv))
180180 then unit
181181 else throw("Permission denied")
182182
183183
184184 func onlyController (inv) = if (if (isAdmin(inv))
185185 then true
186186 else isController(toString(inv.caller)))
187187 then unit
188188 else throw("Permission denied")
189189
190190
191191 func onlyOwner (inv,name) = if (if (isAdmin(inv))
192192 then true
193193 else isOwner(inv, name))
194194 then unit
195195 else throw("Permission denied")
196196
197197
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+
198215 @Callable(inv)
199216 func init (nameTTL) = valueOrElse(modifiers([onlyAdmin(inv), if ((nameTTL > 0))
200217 then unit
201218 else throw("TTL cannot be negative")]), [IntegerEntry(key_nameTTL, nameTTL)])
202219
203220
204221
205222 @Callable(inv)
206223 func supportsInterface (interfaceId) = $Tuple2(nil, containsElement(["owner", "registrar", "resolver", "nameCreated", "nameExpires"], interfaceId))
207224
208225
209226
210227 @Callable(inv)
211228 func addController (address) = valueOrElse(modifiers([onlyAdmin(inv), if (isValidAddress(address))
212229 then unit
213230 else throw("Controller must be a valid address"), if (!(isController(address)))
214231 then unit
215232 else throw((("Controller `" + address) + "` is already registered"))]), [StringEntry(key_controllers, makeString((controllers :+ address), ","))])
216233
217234
218235
219236 @Callable(inv)
220237 func removeController (address) = valueOrElse(modifiers([onlyAdmin(inv), if (isController(address))
221238 then unit
222239 else throw((("Controller `" + address) + "` is not registered"))]), {
223240 let controllerIndex = value(indexOf(controllers, address))
224241 [StringEntry(key_controllers, makeString(removeByIndex(controllers, controllerIndex), ","))]
225242 })
226243
227244
228245
229246 @Callable(inv)
230247 func validate (name) = $Tuple2(nil, isValidName(name))
231248
232249
233250
234251 @Callable(inv)
235252 func available (name) = $Tuple2(nil, isAvailableName(name))
236253
237254
238255
239256 @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+ }
241277
242278
243279
244280 @Callable(inv)
245281 func registrar (name) = {
246- let $t075597606 = _splitLastLabel(name)
247- let label = $t075597606._1
248- let restLabels = $t075597606._2
282+ let $t085918638 = _splitLastLabel(name)
283+ let label = $t085918638._1
284+ let restLabels = $t085918638._2
249285 let registrarAddress = match _getRegistrar(label) {
250286 case maybeRegistrar: String =>
251287 if (isValidAddress(maybeRegistrar))
252288 then maybeRegistrar
253289 else unit
254290 case _ =>
255291 unit
256292 }
257293 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))
265295 then true
266296 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+ })
278306 }
279307
280308
281309
282310 @Callable(inv)
283311 func setRegistrar (name,registrar) = valueOrElse(modifiers([if (isActiveName(name))
284312 then unit
285313 else throw("Name expired or not registered"), onlyOwner(inv, name), if (isValidAddress(registrar))
286314 then unit
287315 else throw("Registrar must be a valid contract address")]), _setRegistrar(name, registrar))
288316
289317
290318
291319 @Callable(inv)
292320 func resolver (name) = $Tuple2(nil, _getResolver(_splitLastLabel(name)._1))
293321
294322
295323
296324 @Callable(inv)
297325 func setResolver (name,resolver) = valueOrElse(modifiers([if (isActiveName(name))
298326 then unit
299327 else throw("Name expired or not registered"), onlyOwner(inv, name), if (isValidAddress(resolver))
300328 then unit
301329 else throw("Resolver must be a valid contract address")]), _setResolver(name, resolver))
302330
303331
304332
305333 @Callable(inv)
306334 func nameCreated (name) = $Tuple2(nil, _getCreatedAt(_splitLastLabel(name)._1))
307335
308336
309337
310338 @Callable(inv)
311339 func nameExpires (name) = $Tuple2(nil, _getExpiresAt(_splitLastLabel(name)._1))
312340
313341
314342
315343 @Callable(inv)
316344 func register (name,owner,createdAt) = valueOrElse(modifiers([onlyController(inv), if (isAvailableName(name))
317345 then unit
318346 else throw((("`" + name) + "` cannot be registered")), if (isValidAddress(owner))
319347 then unit
320348 else throw("Owner must be a valid address"), if ((createdAt > 0))
321349 then unit
322350 else throw("CreatedAt cannot be negative"), if ((lastBlock.timestamp >= createdAt))
323351 then unit
324352 else throw("CreatedAt cannot be in the future")]), {
325353 let issueNameToken = _issueNameToken(name)
326354 let tokenId = calculateAssetId(issueNameToken[0])
327355 let tokenStr = toBase58String(tokenId)
328356 let registerNameWithToken = _registerNameWithToken(name, tokenStr, createdAt)
329357 let transferTokenToOwner = _transferTokenToOwner(tokenStr, owner)
330358 let setOwnership = _setOwner(name, owner)
331359 (((issueNameToken ++ registerNameWithToken) ++ transferTokenToOwner) ++ setOwnership)
332360 })
333361
334362
335363
336364 @Callable(inv)
337365 func reclaim (name) = valueOrElse(modifiers([if (isActiveName(name))
338366 then unit
339367 else throw((("`" + name) + "` is not active"))]), {
340368 let newOwner = inv.caller
341369 let newOwnerAddress = toString(newOwner)
342370 let tokenStr = valueOrErrorMessage(_getToken(name), (("No token is issued for `" + name) + "`"))
343371 let tokenId = fromBase58String(tokenStr)
344372 let hasToken = (assetBalance(newOwner, tokenId) == 1)
345373 let isTokenOwner = isOwner(inv, name)
346374 let isTokenExists = match assetInfo(tokenId) {
347375 case token: Asset =>
348376 (token.quantity == 1)
349377 case _ =>
350378 false
351379 }
352380 if (if (isTokenOwner)
353381 then !(isTokenExists)
354382 else false)
355383 then {
356384 let issueNewToken = _issueNameToken(name)
357385 let newTokenId = calculateAssetId(issueNewToken[0])
358386 let newTokenStr = toBase58String(newTokenId)
359387 let restoreNameWithNewToken = _restoreNameWithToken(name, newTokenStr)
360388 let transferNewTokenToOwner = _transferTokenToOwner(newTokenStr, newOwnerAddress)
361389 ((issueNewToken ++ restoreNameWithNewToken) ++ transferNewTokenToOwner)
362390 }
363391 else if (if (isTokenOwner)
364392 then hasToken
365393 else false)
366394 then throw("You already own a name token")
367395 else if (!(hasToken))
368396 then throw("You don't have a name token")
369397 else _setOwner(name, newOwnerAddress)
370398 })
371399
372400

github/deemru/w8io/026f985 
58.22 ms