tx · 6G3ruV19NuViAcMBQfyzK7tw3jbbYMX1J8tGkHZnf6Jn 3MrF6QFGLaSKfoNPMd8L3u7KYNm7cE43Ydw: -0.00300000 Waves 2022.10.09 19:18 [2265021] smart account 3MrF6QFGLaSKfoNPMd8L3u7KYNm7cE43Ydw > SELF 0.00000000 Waves
{ "type": 13, "id": "6G3ruV19NuViAcMBQfyzK7tw3jbbYMX1J8tGkHZnf6Jn", "fee": 300000, "feeAssetId": null, "timestamp": 1665332331471, "version": 2, "chainId": 84, "sender": "3MrF6QFGLaSKfoNPMd8L3u7KYNm7cE43Ydw", "senderPublicKey": "6NSakbUsm1WyESQ8yj3qpc1kQUfHWNd5C6CHVpbs4X7c", "proofs": [ "4hcuzQJN9gxh5ZPyKyrbDuS8YmfwwefjRQjBpJuffNodpPrecUxN4LVyUaEcVupnNdv47CmJF9QsEhQmuBFny2jF" ], "script": "base64:AAIFAAAAAAAAABYIAhIDCgEIEgMKAQgSAwoBCBIDCgEIAAAACAEAAAAQZ2V0U3RyaW5nT3JUaHJvdwAAAAIAAAAHYWRkcmVzcwAAAANrZXkJAQAAABN2YWx1ZU9yRXJyb3JNZXNzYWdlAAAAAgkABB0AAAACBQAAAAdhZGRyZXNzBQAAAANrZXkJAAEsAAAAAgkAASwAAAACCQABLAAAAAICAAAADENhbid0IHJlYWQgJwUAAAADa2V5AgAAAA0nIGF0IGFkZHJlc3MgCQAEJQAAAAEFAAAAB2FkZHJlc3MBAAAAE3BhcnNlQWRkcmVzc09yVGhyb3cAAAABAAAADG1heWJlQWRkcmVzcwkBAAAAE3ZhbHVlT3JFcnJvck1lc3NhZ2UAAAACCQAEJgAAAAEFAAAADG1heWJlQWRkcmVzcwkAASwAAAACCQABLAAAAAICAAAAGkNhbid0IHBhcnNlIGFkZHJlc3MgZnJvbSAnBQAAAAxtYXliZUFkZHJlc3MCAAAAAScAAAAADGtleV9yZWdpc3RyeQIAAAAIcmVnaXN0cnkAAAAACHJlZ2lzdHJ5CQEAAAATcGF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AHJG1hdGNoMAkAA/wAAAAEBQAAAAhyZWdpc3RyeQIAAAALbmFtZUV4cGlyZXMJAARMAAAAAgUAAAAJbGFzdExhYmVsBQAAAANuaWwFAAAAA25pbAMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAADSW50BAAAAAlleHBpcmVzQXQFAAAAByRtYXRjaDAFAAAACWV4cGlyZXNBdAUAAAAEdW5pdAQAAAAKbmFtZVN0YXR1cwQAAAAHJG1hdGNoMAkAA/wAAAAEBQAAAAhyZWdpc3RyeQIAAAAKbmFtZVN0YXR1cwkABEwAAAACBQAAAAlsYXN0TGFiZWwFAAAAA25pbAUAAAADbmlsAwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAAZTdHJpbmcEAAAABnN0YXR1cwUAAAAHJG1hdGNoMAUAAAAGc3RhdHVzBQAAAAR1bml0CQAFFAAAAAIFAAAAA25pbAkABRcAAAAFBQAAAApyZWdpc3RyYW50BQAAAAhyZXNvbHZlcgUAAAALbmFtZUNyZWF0ZWQFAAAAC25hbWVFeHBpcmVzBQAAAApuYW1lU3RhdHVzAAAAAAVHQX8=", "height": 2265021, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 6qGd9rsiFMbfvdEnVgnWFtcfAcMerR5RzxsL6keQ2wJ8 Next: 5xLu7GNtupcgoiKdovcPZ4eXmvpS5MBkPdr3bWFb3oLM Diff:
Old | New | Differences | |
---|---|---|---|
57 | 57 | else throw("Name cannot be empty")]), { | |
58 | 58 | let labels = split(name, ".") | |
59 | 59 | let lastLabel = labels[(size(labels) - 1)] | |
60 | - | let isRegistered = match invoke(registry, "available", [lastLabel], nil) { | |
61 | - | case available: Boolean => | |
62 | - | !(available) | |
63 | - | case _ => | |
64 | - | false | |
65 | - | } | |
66 | 60 | let registrant = match invoke(registry, "owner", [lastLabel], nil) { | |
67 | 61 | case owner: String => | |
68 | 62 | owner | |
88 | 82 | case _ => | |
89 | 83 | unit | |
90 | 84 | } | |
91 | - | if (!(isRegistered)) | |
92 | - | then $Tuple2(nil, unit) | |
93 | - | else $Tuple2(nil, $Tuple5(registrant, resolver, nameCreated, nameExpires, nameStatus)) | |
85 | + | $Tuple2(nil, $Tuple5(registrant, resolver, nameCreated, nameExpires, nameStatus)) | |
94 | 86 | }) | |
95 | 87 | ||
96 | 88 |
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 | @Callable(inv) | |
34 | 34 | func init (registryAddress) = valueOrElse(modifiers([onlyAdmin(inv)]), [StringEntry(key_registry, registryAddress)]) | |
35 | 35 | ||
36 | 36 | ||
37 | 37 | ||
38 | 38 | @Callable(inv) | |
39 | 39 | func addr (label) = $Tuple2(nil, _addr(label)) | |
40 | 40 | ||
41 | 41 | ||
42 | 42 | ||
43 | 43 | @Callable(inv) | |
44 | 44 | func resolve (name) = { | |
45 | 45 | let labels = if ((size(name) == 0)) | |
46 | 46 | then throw("Name cannot be empty") | |
47 | 47 | else split(name, ".") | |
48 | 48 | let lastLabel = labels[(size(labels) - 1)] | |
49 | 49 | $Tuple2(nil, _addr(lastLabel)) | |
50 | 50 | } | |
51 | 51 | ||
52 | 52 | ||
53 | 53 | ||
54 | 54 | @Callable(inv) | |
55 | 55 | func whoIs (name) = valueOrElse(modifiers([if ((size(name) > 0)) | |
56 | 56 | then unit | |
57 | 57 | else throw("Name cannot be empty")]), { | |
58 | 58 | let labels = split(name, ".") | |
59 | 59 | let lastLabel = labels[(size(labels) - 1)] | |
60 | - | let isRegistered = match invoke(registry, "available", [lastLabel], nil) { | |
61 | - | case available: Boolean => | |
62 | - | !(available) | |
63 | - | case _ => | |
64 | - | false | |
65 | - | } | |
66 | 60 | let registrant = match invoke(registry, "owner", [lastLabel], nil) { | |
67 | 61 | case owner: String => | |
68 | 62 | owner | |
69 | 63 | case _ => | |
70 | 64 | unit | |
71 | 65 | } | |
72 | 66 | let resolver = unit | |
73 | 67 | let nameCreated = match invoke(registry, "nameCreated", [lastLabel], nil) { | |
74 | 68 | case createdAt: Int => | |
75 | 69 | createdAt | |
76 | 70 | case _ => | |
77 | 71 | unit | |
78 | 72 | } | |
79 | 73 | let nameExpires = match invoke(registry, "nameExpires", [lastLabel], nil) { | |
80 | 74 | case expiresAt: Int => | |
81 | 75 | expiresAt | |
82 | 76 | case _ => | |
83 | 77 | unit | |
84 | 78 | } | |
85 | 79 | let nameStatus = match invoke(registry, "nameStatus", [lastLabel], nil) { | |
86 | 80 | case status: String => | |
87 | 81 | status | |
88 | 82 | case _ => | |
89 | 83 | unit | |
90 | 84 | } | |
91 | - | if (!(isRegistered)) | |
92 | - | then $Tuple2(nil, unit) | |
93 | - | else $Tuple2(nil, $Tuple5(registrant, resolver, nameCreated, nameExpires, nameStatus)) | |
85 | + | $Tuple2(nil, $Tuple5(registrant, resolver, nameCreated, nameExpires, nameStatus)) | |
94 | 86 | }) | |
95 | 87 | ||
96 | 88 |
github/deemru/w8io/026f985 44.72 ms ◑