tx · DmhfhC16ZVVghDLgjVPgf4TLK8uHzV7xsFQkoxs292Dw 3N7L7f19WTTyBdjuAEo9zUk41KhJwHfWDL4: -0.01000000 Waves 2020.03.31 06:50 [933097] smart account 3N7L7f19WTTyBdjuAEo9zUk41KhJwHfWDL4 > SELF 0.00000000 Waves
{ "type": 13, "id": "DmhfhC16ZVVghDLgjVPgf4TLK8uHzV7xsFQkoxs292Dw", "fee": 1000000, "feeAssetId": null, "timestamp": 1585626620013, "version": 1, "sender": "3N7L7f19WTTyBdjuAEo9zUk41KhJwHfWDL4", "senderPublicKey": "59CTY5y8NhiUeszz262yuvhjCJujTUAJ7TETzN6ASuGs", "proofs": [ "34Dvs3hk6AvaKUbK3BWGCX1NjRr1WHVeKjTmVJAbWMtD2pqjgRD1CqR6JEj9z6wv8Y5DYc8qkozF4DikRPRWCg9y" ], "script": "base64:AAIDAAAAAAAAAA0IARIDCgEIEgQKAggIAAAABgAAAAAETk9ORQIAAAAEbm9uZQAAAAAFT1dORVICAAAACEJJVE5PREVTAAAAAApNVUxUSU9XTkVSBwEAAAAOZ2V0TnVtYmVyQnlLZXkAAAABAAAAA2tleQQAAAADbnVtBAAAAAckbWF0Y2gwCQAEGgAAAAIFAAAABHRoaXMFAAAAA2tleQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAADSW50BAAAAAFhBQAAAAckbWF0Y2gwBQAAAAFhAAAAAAAAAAAABQAAAANudW0BAAAAC2dldFN0ckJ5S2V5AAAAAQAAAANrZXkEAAAAA3N0cgQAAAAHJG1hdGNoMAkABB0AAAACBQAAAAR0aGlzBQAAAANrZXkDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAABlN0cmluZwQAAAABYQUAAAAHJG1hdGNoMAUAAAABYQUAAAAETk9ORQUAAAADc3RyAQAAAA5hZGROb2RlRGV0YWlscwAAAAIAAAAEYWRkcgAAAANrZXkEAAAAA3N0cgQAAAAHJG1hdGNoMAkABB0AAAACBQAAAARhZGRyBQAAAANrZXkDCQAA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AAAAH0luY29uc2lzdGVuY2lhIGRlIGRhZG9zIGRvIG5vZGUDAwMJAQAAAAIhPQAAAAIFAAAABnN0YXR1cwIAAAACT04JAQAAAAIhPQAAAAIFAAAABnN0YXR1cwIAAAADT0ZGBwkBAAAAAiE9AAAAAgUAAAAGc3RhdHVzAgAAAAZMQVVOQ0gHCQAAAgAAAAECAAAAHlN0YXR1cyBvcGVyYWNpb25hbCBpbmV4aXN0ZW50ZQQAAAALbm9kZURldGFpbHMJAQAAAA5hZGROb2RlRGV0YWlscwAAAAIFAAAABm5vZGVTQwIAAAAHZGV0YWlscwkBAAAACFdyaXRlU2V0AAAAAQkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgUAAAAJbm9kZUFzc2V0BQAAAARub2RlCQAETAAAAAIJAQAAAAlEYXRhRW50cnkAAAACCQABLAAAAAIFAAAABG5vZGUCAAAAB19ub2RlU0MJAAQlAAAAAQUAAAAGbm9kZVNDCQAETAAAAAIJAQAAAAlEYXRhRW50cnkAAAACCQABLAAAAAIFAAAABG5vZGUCAAAADF9ub2RlRGV0YWlscwUAAAALbm9kZURldGFpbHMJAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAIJAAEsAAAAAgUAAAAEbm9kZQIAAAALX25vZGVTdGF0dXMFAAAABnN0YXR1cwUAAAADbmlsAAAAAIA98VY=", "chainId": 84, "height": 933097, "spentComplexity": 0 } View: original | compacted Prev: none Next: 5Ry3XwvdgHLCiuR7cXDwhRiTazygZFvp2X1FYQzdNpdw Full:
Old | New | Differences | |
---|---|---|---|
1 | - | # no script | |
1 | + | {-# STDLIB_VERSION 3 #-} | |
2 | + | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | + | {-# CONTENT_TYPE DAPP #-} | |
4 | + | let NONE = "none" | |
5 | + | ||
6 | + | let OWNER = "BITNODES" | |
7 | + | ||
8 | + | let MULTIOWNER = false | |
9 | + | ||
10 | + | func getNumberByKey (key) = { | |
11 | + | let num = match getInteger(this, key) { | |
12 | + | case a: Int => | |
13 | + | a | |
14 | + | case _ => | |
15 | + | 0 | |
16 | + | } | |
17 | + | num | |
18 | + | } | |
19 | + | ||
20 | + | ||
21 | + | func getStrByKey (key) = { | |
22 | + | let str = match getString(this, key) { | |
23 | + | case a: String => | |
24 | + | a | |
25 | + | case _ => | |
26 | + | NONE | |
27 | + | } | |
28 | + | str | |
29 | + | } | |
30 | + | ||
31 | + | ||
32 | + | func addNodeDetails (addr,key) = { | |
33 | + | let str = match getString(addr, key) { | |
34 | + | case a: String => | |
35 | + | a | |
36 | + | case _ => | |
37 | + | NONE | |
38 | + | } | |
39 | + | str | |
40 | + | } | |
41 | + | ||
42 | + | ||
43 | + | @Callable(i) | |
44 | + | func updateNode (arg) = { | |
45 | + | let senderAddr = toBase58String(i.caller.bytes) | |
46 | + | if ((senderAddr != toString(this))) | |
47 | + | then throw("Operação não autorizada") | |
48 | + | else WriteSet(nil) | |
49 | + | } | |
50 | + | ||
51 | + | ||
52 | + | ||
53 | + | @Callable(i) | |
54 | + | func addNode (node,status) = { | |
55 | + | let senderAddr = toBase58String(i.caller.bytes) | |
56 | + | let nodeSC = addressFromPublicKey(fromBase58String(node)) | |
57 | + | let ownerID = addNodeDetails(nodeSC, "owner") | |
58 | + | let nodeAsset = addNodeDetails(nodeSC, "asset") | |
59 | + | if ((senderAddr != toString(this))) | |
60 | + | then throw("Operação não autorizada") | |
61 | + | else if ((ownerID == NONE)) | |
62 | + | then throw("Propriedade não identificada") | |
63 | + | else if (if ((ownerID != OWNER)) | |
64 | + | then (MULTIOWNER == false) | |
65 | + | else false) | |
66 | + | then throw("Propriedade incorreta") | |
67 | + | else if ((nodeAsset == NONE)) | |
68 | + | then throw("Inconsistencia de dados do node") | |
69 | + | else if (if (if ((status != "ON")) | |
70 | + | then (status != "OFF") | |
71 | + | else false) | |
72 | + | then (status != "LAUNCH") | |
73 | + | else false) | |
74 | + | then throw("Status operacional inexistente") | |
75 | + | else { | |
76 | + | let nodeDetails = addNodeDetails(nodeSC, "details") | |
77 | + | WriteSet([DataEntry(nodeAsset, node), DataEntry((node + "_nodeSC"), toString(nodeSC)), DataEntry((node + "_nodeDetails"), nodeDetails), DataEntry((node + "_nodeStatus"), status)]) | |
78 | + | } | |
79 | + | } | |
80 | + | ||
81 | + |
github/deemru/w8io/026f985 15.11 ms ◑