tx · 2DKr2Yn8WA1WGyyLRdQiHUfaEbSP3uBy5s6tXkPrBKMZ 3MxquWQhzpqXgbqunnFqHFJXTjasEznd1tN: -0.00300000 Waves 2022.10.10 08:02 [2265789] smart account 3MxquWQhzpqXgbqunnFqHFJXTjasEznd1tN > SELF 0.00000000 Waves
{ "type": 13, "id": "2DKr2Yn8WA1WGyyLRdQiHUfaEbSP3uBy5s6tXkPrBKMZ", "fee": 300000, "feeAssetId": null, "timestamp": 1665378234421, "version": 2, "chainId": 84, "sender": "3MxquWQhzpqXgbqunnFqHFJXTjasEznd1tN", "senderPublicKey": "GDjexdefwEhShjRTvHgazn3gTrDo74eHpJCAz14cAEeh", "proofs": [ "43evbkFN1TKavFNqaaD1rJJ4T3YKZdU43zkZNSpVWk8iWMXMTqvQKQxemA56UuhgNapZSAJp6H31rG6VzR3YdjwM" ], "script": "base64:AAIFAAAAAAAAACQIAhIECgIICBIDCgEIEgQKAggIEgMKAQgSAwoBCBIFCgMICAgAAAASAQAAABBnZXRTdHJpbmdPclRocm93AAAAAgAAAAdhZGRyZXNzAAAAA2tleQkBAAAAE3ZhbHVlT3JFcnJvck1lc3NhZ2UAAAACCQAEHQAAAAIFAAAAB2FkZHJlc3MFAAAAA2tleQkAASwAAAACCQABLAAAAAIJAAEsAAAAAgIAAAAMQ2FuJ3QgcmVhZCAnBQAAAANrZXkCAAAADScgYXQgYWRkcmVzcyAJAAQlAAAAAQUAAAAHYWRkcmVzcwEAAAARZ2V0SW50ZWdlck9yVGhyb3cAAAACAAAAB2FkZHJlc3MAAAADa2V5CQEAAAATdmFsdWVPckVycm9yTWVzc2FnZQAAAAIJAAQaAAAAAgUAAAAHYWRkcmVzcwUAAAADa2V5CQABLAAAAAIJAAEsAAAAAgkAASwAAAACAgAAAAxDYW4ndCByZWFkICcFAAAAA2tleQIAAAANJyBhdCBhZGRyZXNzIAkABCUAAAABBQAAAAdhZGRyZXNzAQAAABNwYXJzZUFkZHJlc3NPclRocm93AAAAAQAAAAx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HZlcgkBAAAADV9zZXRDcmVhdGVkQXQAAAACBQAAAARub2RlCAUAAAAJbGFzdEJsb2NrAAAACXRpbWVzdGFtcAAAAAA+BpmU", "height": 2265789, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: BRmubh4Q92AmW1tpUFNqioS1MbM8pPkpKjCyJme88h88 Next: CdzFFy7Pjmgb7jj5GCzknGoAqecURz7aT797X5uWZCFy Diff:
Old | New | Differences | |
---|---|---|---|
13 | 13 | func key_entity (name,pk,property) = ((((name + "_") + pk) + "_") + property) | |
14 | 14 | ||
15 | 15 | ||
16 | - | func key_ | |
16 | + | func key_Name_owner (node) = key_entity("Name", node, "owner") | |
17 | 17 | ||
18 | 18 | ||
19 | - | func key_ | |
19 | + | func key_Name_resolver (node) = key_entity("Name", node, "resolver") | |
20 | 20 | ||
21 | 21 | ||
22 | - | func key_ | |
22 | + | func key_Name_createdAt (node) = key_entity("Name", node, "createdAt") | |
23 | 23 | ||
24 | 24 | ||
25 | - | func _getOwner (node) = getString(this, key_ | |
25 | + | func _getOwner (node) = getString(this, key_Name_owner(node)) | |
26 | 26 | ||
27 | 27 | ||
28 | - | func _setOwner (node,owner) = [StringEntry(key_ | |
28 | + | func _setOwner (node,owner) = [StringEntry(key_Name_owner(node), owner)] | |
29 | 29 | ||
30 | 30 | ||
31 | - | func _getResolver (node) = getString(this, key_ | |
31 | + | func _getResolver (node) = getString(this, key_Name_resolver(node)) | |
32 | 32 | ||
33 | 33 | ||
34 | - | func _setResolver (node,resolver) = [StringEntry(key_Records_resolver(node), resolver)] | |
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)] | |
35 | 41 | ||
36 | 42 | ||
37 | 43 | func isAdmin (inv) = (inv.caller == this) | |
76 | 82 | ||
77 | 83 | ||
78 | 84 | @Callable(inv) | |
79 | - | func setRecord (node,owner,resolver) = valueOrElse(modifiers([onlyAdmin(inv)]), (_setOwner(node, owner) ++ _setResolver(node, resolver))) | |
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))) | |
80 | 91 | ||
81 | 92 |
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 getIntegerOrThrow (address,key) = valueOrErrorMessage(getInteger(address, key), ((("Can't read '" + key) + "' at address ") + toString(address))) | |
8 | 8 | ||
9 | 9 | ||
10 | 10 | func parseAddressOrThrow (maybeAddress) = valueOrErrorMessage(addressFromString(maybeAddress), (("Can't parse address from '" + maybeAddress) + "'")) | |
11 | 11 | ||
12 | 12 | ||
13 | 13 | func key_entity (name,pk,property) = ((((name + "_") + pk) + "_") + property) | |
14 | 14 | ||
15 | 15 | ||
16 | - | func key_ | |
16 | + | func key_Name_owner (node) = key_entity("Name", node, "owner") | |
17 | 17 | ||
18 | 18 | ||
19 | - | func key_ | |
19 | + | func key_Name_resolver (node) = key_entity("Name", node, "resolver") | |
20 | 20 | ||
21 | 21 | ||
22 | - | func key_ | |
22 | + | func key_Name_createdAt (node) = key_entity("Name", node, "createdAt") | |
23 | 23 | ||
24 | 24 | ||
25 | - | func _getOwner (node) = getString(this, key_ | |
25 | + | func _getOwner (node) = getString(this, key_Name_owner(node)) | |
26 | 26 | ||
27 | 27 | ||
28 | - | func _setOwner (node,owner) = [StringEntry(key_ | |
28 | + | func _setOwner (node,owner) = [StringEntry(key_Name_owner(node), owner)] | |
29 | 29 | ||
30 | 30 | ||
31 | - | func _getResolver (node) = getString(this, key_ | |
31 | + | func _getResolver (node) = getString(this, key_Name_resolver(node)) | |
32 | 32 | ||
33 | 33 | ||
34 | - | func _setResolver (node,resolver) = [StringEntry(key_Records_resolver(node), resolver)] | |
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)] | |
35 | 41 | ||
36 | 42 | ||
37 | 43 | func isAdmin (inv) = (inv.caller == this) | |
38 | 44 | ||
39 | 45 | ||
40 | 46 | func isOwner (inv,node) = (toString(inv.caller) == valueOrErrorMessage(_getOwner(node), (("Owner for the `" + node) + "` was not found"))) | |
41 | 47 | ||
42 | 48 | ||
43 | 49 | func modifiers (validations) = unit | |
44 | 50 | ||
45 | 51 | ||
46 | 52 | func onlyAdmin (inv) = if (isAdmin(inv)) | |
47 | 53 | then unit | |
48 | 54 | else throw("Permission denied") | |
49 | 55 | ||
50 | 56 | ||
51 | 57 | func onlyOwner (inv,node) = if (if (isAdmin(inv)) | |
52 | 58 | then true | |
53 | 59 | else isOwner(inv, node)) | |
54 | 60 | then unit | |
55 | 61 | else throw("Permission denied") | |
56 | 62 | ||
57 | 63 | ||
58 | 64 | @Callable(inv) | |
59 | 65 | func setOwner (node,owner) = valueOrElse(modifiers([onlyOwner(inv, node)]), _setOwner(node, owner)) | |
60 | 66 | ||
61 | 67 | ||
62 | 68 | ||
63 | 69 | @Callable(inv) | |
64 | 70 | func owner (node) = $Tuple2(nil, _getOwner(node)) | |
65 | 71 | ||
66 | 72 | ||
67 | 73 | ||
68 | 74 | @Callable(inv) | |
69 | 75 | func setResolver (node,resolver) = valueOrElse(modifiers([onlyOwner(inv, node)]), _setResolver(node, resolver)) | |
70 | 76 | ||
71 | 77 | ||
72 | 78 | ||
73 | 79 | @Callable(inv) | |
74 | 80 | func resolver (node) = $Tuple2(nil, _getResolver(node)) | |
75 | 81 | ||
76 | 82 | ||
77 | 83 | ||
78 | 84 | @Callable(inv) | |
79 | - | func setRecord (node,owner,resolver) = valueOrElse(modifiers([onlyAdmin(inv)]), (_setOwner(node, owner) ++ _setResolver(node, resolver))) | |
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))) | |
80 | 91 | ||
81 | 92 |
github/deemru/w8io/026f985 34.08 ms ◑