tx · 9mtoGRrmmz573QRFkui8M5Hs8GAQSQs1hWSR8esvfum

3MrF6QFGLaSKfoNPMd8L3u7KYNm7cE43Ydw:  -0.00300000 Waves

2022.10.09 18:44 [2264987] smart account 3MrF6QFGLaSKfoNPMd8L3u7KYNm7cE43Ydw > SELF 0.00000000 Waves

{ "type": 13, "id": "9mtoGRrmmz573QRFkui8M5Hs8GAQSQs1hWSR8esvfum", "fee": 300000, "feeAssetId": null, "timestamp": 1665330283243, "version": 2, "chainId": 84, "sender": "3MrF6QFGLaSKfoNPMd8L3u7KYNm7cE43Ydw", "senderPublicKey": "6NSakbUsm1WyESQ8yj3qpc1kQUfHWNd5C6CHVpbs4X7c", "proofs": [ "5mCphqrawgcfXnYczDYZc2EtQqQ2UsQXrYZeVU2yPg8qd4bAT9PDQZj9hTpYYGNL4LGXAVbwyoPS8pn3SmF4hcuY" ], "script": "base64:AAIFAAAAAAAAABYIAhIDCgEIEgMKAQgSAwoBCBIDCgEIAAAACAEAAAAQZ2V0U3RyaW5nT3JUaHJvdwAAAAIAAAAHYWRkcmVzcwAAAANrZXkJAQAAABN2YWx1ZU9yRXJyb3JNZXNzYWdlAAAAAgkABB0AAAACBQAAAAdhZGRyZXNzBQAAAANrZXkJAAEsAAAAAgkAASwAAAACCQABLAAAAAICAAAADENhbid0IHJlYWQgJwUAAAADa2V5AgAAAA0nIGF0IGFkZHJlc3MgCQAEJQAAAAEFAAAAB2FkZHJlc3MBAAAAE3BhcnNlQWRkcmVzc09yVGhyb3cAAAABAAAADG1heWJlQWRkcmVzcwkBAAAAE3ZhbHVlT3JFcnJvck1lc3NhZ2UAAAACCQAEJgAAAAEFAAAADG1heWJlQWRkcmVzcwkAASwAAAACCQABLAAAAAICAAAAGkNhbid0IHBhcnNlIGFkZHJlc3MgZnJvbSAnBQAAAAxtYXliZUFkZHJlc3MCAAAAAScAAAAADGtleV9yZWdpc3RyeQIAAAAIcmVnaXN0cnkAAAAACHJlZ2lzdHJ5CQEAAAATcGFyc2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G1hdGNoMAkAA/wAAAAEBQAAAAhyZWdpc3RyeQIAAAALbmFtZUV4cGlyZXMJAARMAAAAAgUAAAAJbGFzdExhYmVsBQAAAANuaWwFAAAAA25pbAMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAADSW50BAAAAAlleHBpcmVzQXQFAAAAByRtYXRjaDAFAAAACWV4cGlyZXNBdAUAAAAEdW5pdAQAAAAKbmFtZVN0YXR1cwQAAAAHJG1hdGNoMAkAA/wAAAAEBQAAAAhyZWdpc3RyeQIAAAAKbmFtZVN0YXR1cwkABEwAAAACBQAAAAlsYXN0TGFiZWwFAAAAA25pbAUAAAADbmlsAwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAANJbnQEAAAABnN0YXR1cwUAAAAHJG1hdGNoMAUAAAAGc3RhdHVzBQAAAAR1bml0AwkBAAAAASEAAAABCQEAAAAJaXNEZWZpbmVkAAAAAQUAAAAKcmVnaXN0cmFudAkABRQAAAACBQAAAANuaWwFAAAABHVuaXQJAAUUAAAAAgUAAAADbmlsCQAFFwAAAAUFAAAACnJlZ2lzdHJhbnQFAAAACHJlc29sdmVyBQAAAAtuYW1lQ3JlYXRlZAUAAAALbmFtZUV4cGlyZXMFAAAACm5hbWVTdGF0dXMAAAAAg7ibjg==", "height": 2264987, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: eRxGEJS7CwTN94owiyWe2ntedNWegeJxrf9DaU29xFE Next: B2VJNE7Vs1kbvCwCLkVhZoQHHauJKiUkCu13EKduzfkH Diff:
OldNewDifferences
4545 let labels = if ((size(name) == 0))
4646 then throw("Name cannot be empty")
4747 else split(name, ".")
48- let levels = size(labels)
49- let label = labels[(levels - 1)]
50- $Tuple2(nil, _addr(label))
48+ let lastLabel = labels[(size(labels) - 1)]
49+ $Tuple2(nil, _addr(lastLabel))
5150 }
51+
52+
53+
54+@Callable(inv)
55+func whoIs (name) = valueOrElse(modifiers([if ((size(name) > 0))
56+ then unit
57+ else throw("Name cannot be empty")]), {
58+ let labels = split(name, ".")
59+ let lastLabel = labels[(size(labels) - 1)]
60+ let registrant = match invoke(registry, "owner", [lastLabel], nil) {
61+ case owner: String =>
62+ owner
63+ case _ =>
64+ unit
65+ }
66+ let resolver = unit
67+ let nameCreated = match invoke(registry, "nameCreated", [lastLabel], nil) {
68+ case createdAt: Int =>
69+ createdAt
70+ case _ =>
71+ unit
72+ }
73+ let nameExpires = match invoke(registry, "nameExpires", [lastLabel], nil) {
74+ case expiresAt: Int =>
75+ expiresAt
76+ case _ =>
77+ unit
78+ }
79+ let nameStatus = match invoke(registry, "nameStatus", [lastLabel], nil) {
80+ case status: Int =>
81+ status
82+ case _ =>
83+ unit
84+ }
85+ if (!(isDefined(registrant)))
86+ then $Tuple2(nil, unit)
87+ else $Tuple2(nil, $Tuple5(registrant, resolver, nameCreated, nameExpires, nameStatus))
88+ })
5289
5390
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 parseAddressOrThrow (maybeAddress) = valueOrErrorMessage(addressFromString(maybeAddress), (("Can't parse address from '" + maybeAddress) + "'"))
88
99
1010 let key_registry = "registry"
1111
1212 let registry = parseAddressOrThrow(getStringOrThrow(this, key_registry))
1313
1414 func isAdmin (inv) = (inv.caller == this)
1515
1616
1717 func modifiers (validations) = unit
1818
1919
2020 func onlyAdmin (inv) = if (isAdmin(inv))
2121 then unit
2222 else throw("Permission denied")
2323
2424
2525 func _addr (label) = match invoke(registry, "owner", [label], nil) {
2626 case owner: String =>
2727 owner
2828 case _ =>
2929 unit
3030 }
3131
3232
3333 @Callable(inv)
3434 func init (registryAddress) = valueOrElse(modifiers([onlyAdmin(inv)]), [StringEntry(key_registry, registryAddress)])
3535
3636
3737
3838 @Callable(inv)
3939 func addr (label) = $Tuple2(nil, _addr(label))
4040
4141
4242
4343 @Callable(inv)
4444 func resolve (name) = {
4545 let labels = if ((size(name) == 0))
4646 then throw("Name cannot be empty")
4747 else split(name, ".")
48- let levels = size(labels)
49- let label = labels[(levels - 1)]
50- $Tuple2(nil, _addr(label))
48+ let lastLabel = labels[(size(labels) - 1)]
49+ $Tuple2(nil, _addr(lastLabel))
5150 }
51+
52+
53+
54+@Callable(inv)
55+func whoIs (name) = valueOrElse(modifiers([if ((size(name) > 0))
56+ then unit
57+ else throw("Name cannot be empty")]), {
58+ let labels = split(name, ".")
59+ let lastLabel = labels[(size(labels) - 1)]
60+ let registrant = match invoke(registry, "owner", [lastLabel], nil) {
61+ case owner: String =>
62+ owner
63+ case _ =>
64+ unit
65+ }
66+ let resolver = unit
67+ let nameCreated = match invoke(registry, "nameCreated", [lastLabel], nil) {
68+ case createdAt: Int =>
69+ createdAt
70+ case _ =>
71+ unit
72+ }
73+ let nameExpires = match invoke(registry, "nameExpires", [lastLabel], nil) {
74+ case expiresAt: Int =>
75+ expiresAt
76+ case _ =>
77+ unit
78+ }
79+ let nameStatus = match invoke(registry, "nameStatus", [lastLabel], nil) {
80+ case status: Int =>
81+ status
82+ case _ =>
83+ unit
84+ }
85+ if (!(isDefined(registrant)))
86+ then $Tuple2(nil, unit)
87+ else $Tuple2(nil, $Tuple5(registrant, resolver, nameCreated, nameExpires, nameStatus))
88+ })
5289
5390

github/deemru/w8io/169f3d6 
35.69 ms