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