tx · EKSF1CPRMXgvASwhygcKrR3guqfAtmEULJL9M6Wh8cYN 3MumW7BtRwX8w1dn9tWwB7TpHAUkqoSEXve: -0.01000000 Waves 2022.10.17 10:47 [2276086] smart account 3MumW7BtRwX8w1dn9tWwB7TpHAUkqoSEXve > SELF 0.00000000 Waves
{ "type": 13, "id": "EKSF1CPRMXgvASwhygcKrR3guqfAtmEULJL9M6Wh8cYN", "fee": 1000000, "feeAssetId": null, "timestamp": 1665992904046, "version": 2, "chainId": 84, "sender": "3MumW7BtRwX8w1dn9tWwB7TpHAUkqoSEXve", "senderPublicKey": "3H3TbYHdAJUPh9yFbybSbc1SGAgghXJ3kVJxDE8duuPJ", "proofs": [ "3LrvnwKeMVL6nGE4SAmG4Kyh6U79ijzWPVBeWYYstYZ4WU5RiN5Km5D1wqqCumMTuBaCBpLeWvSzpakr1d6m1RKy" ], "script": "base64:AAIFAAAAAAAAABEIAhIDCgEIEgMKAQgSAwoBCAAAAAkBAAAAEGdldFN0cmluZ09yVGhyb3cAAAACAAAAB2FkZHJlc3MAAAADa2V5CQEAAAATdmFsdWVPckVycm9yTWVzc2FnZQAAAAIJAAQdAAAAAgUAAAAHYWRkcmVzcwUAAAADa2V5CQABLAAAAAIJAAEsAAAAAgkAASwAAAACAgAAAAxDYW4ndCByZWFkICcFAAAAA2tleQIAAAANJyBhdCBhZGRyZXNzIAkABCUAAAABBQAAAAdhZGRyZXNzAQAAABNwYXJzZUFkZHJlc3NPclRocm93AAAAAQAAAAxtYXliZUFkZHJlc3MJAQAAABN2YWx1ZU9yRXJyb3JNZXNzYWdlAAAAAgkABCYAAAABBQAAAAxtYXliZUFkZHJlc3MJAAEsAAAAAgkAASwAAAACAgAAABpDYW4ndCBwYXJzZSBhZGRyZXNzIGZyb20gJwUAAAAMbWF5YmVBZGRyZXNzAgAAAAEnAAAAAAxrZXlfcmVnaXN0cnkCAAAACHJlZ2lzdHJ5AAAAAAhyZWdpc3RyeQkBAAAAE3BhcnNlQWRkcmVzc09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AADbmlsCQAETAAAAAIJAQAAAAtTdHJpbmdFbnRyeQAAAAIFAAAADGtleV9yZWdpc3RyeQUAAAAPcmVnaXN0cnlBZGRyZXNzBQAAAANuaWwAAAADaW52AQAAABFzdXBwb3J0c0ludGVyZmFjZQAAAAEAAAALaW50ZXJmYWNlSWQJAAUUAAAAAgUAAAADbmlsCQAAAAAAAAIFAAAAC2ludGVyZmFjZUlkAgAAAARhZGRyAAAAA2ludgEAAAAEYWRkcgAAAAEAAAAFbGFiZWwJAAUUAAAAAgUAAAADbmlsCQEAAAAFX2FkZHIAAAABBQAAAAVsYWJlbAAAAABp+orG", "height": 2276086, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 9WES6x6Cjiv7ud3ZbYEiHUdYX77SRs5YdJLy1UvCcSkY Next: FAHbfQ8K2HaAEMKjn9RJMJCdZEJyW6S1sGo8GMYQbbuV Diff:
Old | New | Differences | |
---|---|---|---|
45 | 45 | ||
46 | 46 | ||
47 | 47 | @Callable(inv) | |
48 | - | func | |
48 | + | func supportsInterface (interfaceId) = $Tuple2(nil, (interfaceId == "addr")) | |
49 | 49 | ||
50 | 50 | ||
51 | 51 | ||
52 | 52 | @Callable(inv) | |
53 | - | func resolve (name) = valueOrElse(modifiers([if ((size(name) > 0)) | |
54 | - | then unit | |
55 | - | else throw("Name cannot be empty")]), { | |
56 | - | let lastLabel = _splitLastLabel(name)._1 | |
57 | - | $Tuple2(nil, _addr(lastLabel)) | |
58 | - | }) | |
59 | - | ||
60 | - | ||
61 | - | ||
62 | - | @Callable(inv) | |
63 | - | func whoIs (name) = valueOrElse(modifiers([if ((size(name) > 0)) | |
64 | - | then unit | |
65 | - | else throw("Name cannot be empty")]), { | |
66 | - | let lastLabel = _splitLastLabel(name)._1 | |
67 | - | let registrant = match invoke(registry, "owner", [lastLabel], nil) { | |
68 | - | case owner: String => | |
69 | - | owner | |
70 | - | case _ => | |
71 | - | unit | |
72 | - | } | |
73 | - | let resolver = unit | |
74 | - | let nameCreated = match invoke(registry, "nameCreated", [lastLabel], nil) { | |
75 | - | case createdAt: Int => | |
76 | - | createdAt | |
77 | - | case _ => | |
78 | - | unit | |
79 | - | } | |
80 | - | let nameExpires = match invoke(registry, "nameExpires", [lastLabel], nil) { | |
81 | - | case expiresAt: Int => | |
82 | - | expiresAt | |
83 | - | case _ => | |
84 | - | unit | |
85 | - | } | |
86 | - | let nameStatus = match invoke(registry, "nameStatus", [lastLabel], nil) { | |
87 | - | case status: String => | |
88 | - | status | |
89 | - | case _ => | |
90 | - | unit | |
91 | - | } | |
92 | - | $Tuple2(nil, $Tuple5(registrant, resolver, nameCreated, nameExpires, nameStatus)) | |
93 | - | }) | |
53 | + | func addr (label) = $Tuple2(nil, _addr(label)) | |
94 | 54 | ||
95 | 55 |
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 | let key_registry = "registry" | |
11 | 11 | ||
12 | 12 | let registry = parseAddressOrThrow(getStringOrThrow(this, key_registry)) | |
13 | 13 | ||
14 | 14 | func isAdmin (inv) = (inv.caller == this) | |
15 | 15 | ||
16 | 16 | ||
17 | 17 | func modifiers (validations) = unit | |
18 | 18 | ||
19 | 19 | ||
20 | 20 | func onlyAdmin (inv) = if (isAdmin(inv)) | |
21 | 21 | then unit | |
22 | 22 | else throw("Permission denied") | |
23 | 23 | ||
24 | 24 | ||
25 | 25 | func _addr (label) = match invoke(registry, "owner", [label], nil) { | |
26 | 26 | case owner: String => | |
27 | 27 | owner | |
28 | 28 | case _ => | |
29 | 29 | unit | |
30 | 30 | } | |
31 | 31 | ||
32 | 32 | ||
33 | 33 | func _splitLastLabel (name) = { | |
34 | 34 | let labels = split(name, ".") | |
35 | 35 | let lastIndex = (size(labels) - 1) | |
36 | 36 | let lastLabel = labels[lastIndex] | |
37 | 37 | let restLabels = makeString(removeByIndex(labels, lastIndex), ".") | |
38 | 38 | $Tuple2(lastLabel, restLabels) | |
39 | 39 | } | |
40 | 40 | ||
41 | 41 | ||
42 | 42 | @Callable(inv) | |
43 | 43 | func init (registryAddress) = valueOrElse(modifiers([onlyAdmin(inv)]), [StringEntry(key_registry, registryAddress)]) | |
44 | 44 | ||
45 | 45 | ||
46 | 46 | ||
47 | 47 | @Callable(inv) | |
48 | - | func | |
48 | + | func supportsInterface (interfaceId) = $Tuple2(nil, (interfaceId == "addr")) | |
49 | 49 | ||
50 | 50 | ||
51 | 51 | ||
52 | 52 | @Callable(inv) | |
53 | - | func resolve (name) = valueOrElse(modifiers([if ((size(name) > 0)) | |
54 | - | then unit | |
55 | - | else throw("Name cannot be empty")]), { | |
56 | - | let lastLabel = _splitLastLabel(name)._1 | |
57 | - | $Tuple2(nil, _addr(lastLabel)) | |
58 | - | }) | |
59 | - | ||
60 | - | ||
61 | - | ||
62 | - | @Callable(inv) | |
63 | - | func whoIs (name) = valueOrElse(modifiers([if ((size(name) > 0)) | |
64 | - | then unit | |
65 | - | else throw("Name cannot be empty")]), { | |
66 | - | let lastLabel = _splitLastLabel(name)._1 | |
67 | - | let registrant = match invoke(registry, "owner", [lastLabel], nil) { | |
68 | - | case owner: String => | |
69 | - | owner | |
70 | - | case _ => | |
71 | - | unit | |
72 | - | } | |
73 | - | let resolver = unit | |
74 | - | let nameCreated = match invoke(registry, "nameCreated", [lastLabel], nil) { | |
75 | - | case createdAt: Int => | |
76 | - | createdAt | |
77 | - | case _ => | |
78 | - | unit | |
79 | - | } | |
80 | - | let nameExpires = match invoke(registry, "nameExpires", [lastLabel], nil) { | |
81 | - | case expiresAt: Int => | |
82 | - | expiresAt | |
83 | - | case _ => | |
84 | - | unit | |
85 | - | } | |
86 | - | let nameStatus = match invoke(registry, "nameStatus", [lastLabel], nil) { | |
87 | - | case status: String => | |
88 | - | status | |
89 | - | case _ => | |
90 | - | unit | |
91 | - | } | |
92 | - | $Tuple2(nil, $Tuple5(registrant, resolver, nameCreated, nameExpires, nameStatus)) | |
93 | - | }) | |
53 | + | func addr (label) = $Tuple2(nil, _addr(label)) | |
94 | 54 | ||
95 | 55 |
github/deemru/w8io/169f3d6 41.86 ms ◑