tx · DUyev2FfWN56XqEQErT2evC3nhwhE5SD6HpcpBTADopn 3MvCgypmBZFTRqL5HuRwCgS7maC7Fkv7pZY: -0.00300000 Waves 2022.10.11 08:23 [2267254] smart account 3MvCgypmBZFTRqL5HuRwCgS7maC7Fkv7pZY > SELF 0.00000000 Waves
{ "type": 13, "id": "DUyev2FfWN56XqEQErT2evC3nhwhE5SD6HpcpBTADopn", "fee": 300000, "feeAssetId": null, "timestamp": 1665465778197, "version": 2, "chainId": 84, "sender": "3MvCgypmBZFTRqL5HuRwCgS7maC7Fkv7pZY", "senderPublicKey": "BqGSAiYghM27RZ2Axx3bmTudq9koHT4575AeK31Wx2Pp", "proofs": [ "5dQkyG18EbkbueXhh58HKmpgizvZHaDwJeoPmR39KFbc6sNy9u3ArHWYhRzJbS3gmQKrdN3gsJSvDoAbYcPkWHW1" ], "script": "base64:AAIFAAAAAAAAACQIAhIECgIICBIDCgEIEgQKAggIEgMKAQgSAwoBCBIFCgMICAgAAAASAQAAABBnZXRTdHJpbmdPclRocm93AAAAAgAAAAdhZGRyZXNzAAAAA2tleQkBAAAAE3ZhbHVlT3JFcnJvck1lc3NhZ2UAAAACCQAEHQAAAAIFAAAAB2FkZHJlc3MFAAAAA2tleQkAASwAAAACCQABLAAAAAIJAAEsAAAAAgIAAAAMQ2FuJ3QgcmVhZCAnBQAAAANrZXkCAAAADScgYXQgYWRkcmVzcyAJAAQlAAAAAQUAAAAHYWRkcmVzcwEAAAARZ2V0SW50ZWdlck9yVGhyb3cAAAACAAAAB2FkZHJlc3MAAAADa2V5CQEAAAATdmFsdWVPckVycm9yTWVzc2FnZQAAAAIJAAQaAAAAAgUAAAAHYWRkcmVzcwUAAAADa2V5CQABLAAAAAIJAAEsAAAAAgkAASwAAAACAgAAAAxDYW4ndCByZWFkICcFAAAAA2tleQIAAAANJyBhdCBhZGRyZXNzIAkABCUAAAABBQAAAAdhZGRyZXNzAQAAABNwYXJzZUFkZHJlc3NPclRocm93AAAAAQAAAAxtYXli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gkBAAAADV9zZXRDcmVhdGVkQXQAAAACBQAAAARub2RlCAUAAAAJbGFzdEJsb2NrAAAACXRpbWVzdGFtcAAAAAA+BpmU", "height": 2267254, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: none Next: HDyUfaRxWPV3FKrdF6et8zv8SLf3T75DAJ9jedtmEdk5 Full:
Old | New | Differences | |
---|---|---|---|
1 | - | # no script | |
1 | + | {-# STDLIB_VERSION 5 #-} | |
2 | + | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | + | {-# CONTENT_TYPE DAPP #-} | |
4 | + | func getStringOrThrow (address,key) = valueOrErrorMessage(getString(address, key), ((("Can't read '" + key) + "' at address ") + toString(address))) | |
5 | + | ||
6 | + | ||
7 | + | func getIntegerOrThrow (address,key) = valueOrErrorMessage(getInteger(address, key), ((("Can't read '" + key) + "' at address ") + toString(address))) | |
8 | + | ||
9 | + | ||
10 | + | func parseAddressOrThrow (maybeAddress) = valueOrErrorMessage(addressFromString(maybeAddress), (("Can't parse address from '" + maybeAddress) + "'")) | |
11 | + | ||
12 | + | ||
13 | + | func key_entity (name,pk,property) = ((((name + "_") + pk) + "_") + property) | |
14 | + | ||
15 | + | ||
16 | + | func key_Name_owner (node) = key_entity("Name", node, "owner") | |
17 | + | ||
18 | + | ||
19 | + | func key_Name_resolver (node) = key_entity("Name", node, "resolver") | |
20 | + | ||
21 | + | ||
22 | + | func key_Name_createdAt (node) = key_entity("Name", node, "createdAt") | |
23 | + | ||
24 | + | ||
25 | + | func _getOwner (node) = getString(this, key_Name_owner(node)) | |
26 | + | ||
27 | + | ||
28 | + | func _setOwner (node,owner) = [StringEntry(key_Name_owner(node), owner)] | |
29 | + | ||
30 | + | ||
31 | + | func _getResolver (node) = getString(this, key_Name_resolver(node)) | |
32 | + | ||
33 | + | ||
34 | + | func _setResolver (node,resolver) = [StringEntry(key_Name_resolver(node), resolver)] | |
35 | + | ||
36 | + | ||
37 | + | func _getCreatedAt (node) = getInteger(this, key_Name_createdAt(node)) | |
38 | + | ||
39 | + | ||
40 | + | func _setCreatedAt (node,createdAt) = [IntegerEntry(key_Name_createdAt(node), createdAt)] | |
41 | + | ||
42 | + | ||
43 | + | func isAdmin (inv) = (inv.caller == this) | |
44 | + | ||
45 | + | ||
46 | + | func isOwner (inv,node) = (toString(inv.caller) == valueOrErrorMessage(_getOwner(node), (("Owner for the `" + node) + "` was not found"))) | |
47 | + | ||
48 | + | ||
49 | + | func modifiers (validations) = unit | |
50 | + | ||
51 | + | ||
52 | + | func onlyAdmin (inv) = if (isAdmin(inv)) | |
53 | + | then unit | |
54 | + | else throw("Permission denied") | |
55 | + | ||
56 | + | ||
57 | + | func onlyOwner (inv,node) = if (if (isAdmin(inv)) | |
58 | + | then true | |
59 | + | else isOwner(inv, node)) | |
60 | + | then unit | |
61 | + | else throw("Permission denied") | |
62 | + | ||
63 | + | ||
64 | + | @Callable(inv) | |
65 | + | func setOwner (node,owner) = valueOrElse(modifiers([onlyOwner(inv, node)]), _setOwner(node, owner)) | |
66 | + | ||
67 | + | ||
68 | + | ||
69 | + | @Callable(inv) | |
70 | + | func owner (node) = $Tuple2(nil, _getOwner(node)) | |
71 | + | ||
72 | + | ||
73 | + | ||
74 | + | @Callable(inv) | |
75 | + | func setResolver (node,resolver) = valueOrElse(modifiers([onlyOwner(inv, node)]), _setResolver(node, resolver)) | |
76 | + | ||
77 | + | ||
78 | + | ||
79 | + | @Callable(inv) | |
80 | + | func resolver (node) = $Tuple2(nil, _getResolver(node)) | |
81 | + | ||
82 | + | ||
83 | + | ||
84 | + | @Callable(inv) | |
85 | + | func nameCreated (node) = $Tuple2(nil, _getCreatedAt(node)) | |
86 | + | ||
87 | + | ||
88 | + | ||
89 | + | @Callable(inv) | |
90 | + | func setRecord (node,owner,resolver) = valueOrElse(modifiers([onlyAdmin(inv)]), ((_setOwner(node, owner) ++ _setResolver(node, resolver)) ++ _setCreatedAt(node, lastBlock.timestamp))) | |
91 | + | ||
92 | + |
github/deemru/w8io/169f3d6 35.74 ms ◑