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:AAIDAAAAAAAAAA4IARIDCgEIEgUKAwgICAAAAAYAAAAABE5PTkUCAAAABG5vbmUAAAAABU9XTkVSAgAAAAhCSVROT0RFUwAAAAAKTVVMVElPV05FUgcBAAAADmdldE51bWJlckJ5S2V5AAAAAQAAAANrZXkEAAAAA251bQQAAAAHJG1hdGNoMAkABBoAAAACBQAAAAR0aGlzBQAAAANrZXkDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAA0ludAQAAAABYQUAAAAHJG1hdGNoMAUAAAABYQAAAAAAAAAAAAUAAAADbnVtAQAAAAtnZXRTdHJCeUtleQAAAAEAAAADa2V5BAAAAANzdHIEAAAAByRtYXRjaDAJAAQdAAAAAgUAAAAEdGhpcwUAAAADa2V5AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAAZTdHJpbmcEAAAAAWEFAAAAByRtYXRjaDAFAAAAAWEFAAAABE5PTkUFAAAAA3N0cgEAAAAOYWRkTm9kZURldGFpbHMAAAACAAAABGFkZHIAAAADa2V5BAAAAANzdHIEAAAAByRtYXRjaDAJAAQdAAAAAgUAAAAEYWRkcgUAAAADa2V5AwkA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ROT05FCQAAAgAAAAECAAAAH0luY29uc2lzdGVuY2lhIGRlIGRhZG9zIGRvIG5vZGUDAwMJAQAAAAIhPQAAAAIFAAAABnN0YXR1cwIAAAACT04JAQAAAAIhPQAAAAIFAAAABnN0YXR1cwIAAAADT0ZGBwkBAAAAAiE9AAAAAgUAAAAGc3RhdHVzAgAAAAZMQVVOQ0gHCQAAAgAAAAECAAAAHlN0YXR1cyBvcGVyYWNpb25hbCBpbmV4aXN0ZW50ZQMDAwMDCQEAAAACIT0AAAACBQAAAAR0aWVyAgAAAAZWT1RJTkcJAQAAAAIhPQAAAAIFAAAABHRpZXICAAAACkNPTExFQ1RJTkcHCQEAAAACIT0AAAACBQAAAAR0aWVyAgAAAAZOT1JNQUwHCQEAAAACIT0AAAACBQAAAAR0aWVyAgAAAAhGRUFUVVJFRAcJAQAAAAIhPQAAAAIFAAAABHRpZXICAAAADEVYUEVSSU1FTlRBTAcJAAACAAAAAQIAAAAVQ2F0ZWdvcmlhIGluZXhpc3RlbnRlBAAAAAtub2RlRGV0YWlscwkBAAAADmFkZE5vZGVEZXRhaWxzAAAAAgUAAAAGbm9kZVNDAgAAAAdkZXRhaWxzCQEAAAAIV3JpdGVTZXQAAAABCQAETAAAAAIJAQAAAAlEYXRhRW50cnkAAAACBQAAAAlub2RlQXNzZXQFAAAABG5vZGUJAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAIJAAEsAAAAAgUAAAAEbm9kZQIAAAAHX25vZGVTQwkABCUAAAABBQAAAAZub2RlU0MJAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAIJAAEsAAAAAgUAAAAEbm9kZQIAAAAMX25vZGVEZXRhaWxzBQAAAAtub2RlRGV0YWlscwkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgkAASwAAAACBQAAAARub2RlAgAAAAtfbm9kZVN0YXR1cwUAAAAGc3RhdHVzBQAAAANuaWwAAAAAID6uRw==", "chainId": 84, "height": 934459, "spentComplexity": 0 } View: original | compacted Prev: DmhfhC16ZVVghDLgjVPgf4TLK8uHzV7xsFQkoxs292Dw Next: DkByukNa5t5iF43AyBfsT8wZmeynRpCbcNb41SgowdTF Diff:
OldNewDifferences
5151
5252
5353 @Callable(i)
54-func addNode (node,status) = {
54+func addNode (node,status,tier) = {
5555 let senderAddr = toBase58String(i.caller.bytes)
5656 let nodeSC = addressFromPublicKey(fromBase58String(node))
5757 let ownerID = addNodeDetails(nodeSC, "owner")
7272 then (status != "LAUNCH")
7373 else false)
7474 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+ }
7989 }
8090
8191
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 3 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let NONE = "none"
55
66 let OWNER = "BITNODES"
77
88 let MULTIOWNER = false
99
1010 func getNumberByKey (key) = {
1111 let num = match getInteger(this, key) {
1212 case a: Int =>
1313 a
1414 case _ =>
1515 0
1616 }
1717 num
1818 }
1919
2020
2121 func getStrByKey (key) = {
2222 let str = match getString(this, key) {
2323 case a: String =>
2424 a
2525 case _ =>
2626 NONE
2727 }
2828 str
2929 }
3030
3131
3232 func addNodeDetails (addr,key) = {
3333 let str = match getString(addr, key) {
3434 case a: String =>
3535 a
3636 case _ =>
3737 NONE
3838 }
3939 str
4040 }
4141
4242
4343 @Callable(i)
4444 func updateNode (arg) = {
4545 let senderAddr = toBase58String(i.caller.bytes)
4646 if ((senderAddr != toString(this)))
4747 then throw("Operação não autorizada")
4848 else WriteSet(nil)
4949 }
5050
5151
5252
5353 @Callable(i)
54-func addNode (node,status) = {
54+func addNode (node,status,tier) = {
5555 let senderAddr = toBase58String(i.caller.bytes)
5656 let nodeSC = addressFromPublicKey(fromBase58String(node))
5757 let ownerID = addNodeDetails(nodeSC, "owner")
5858 let nodeAsset = addNodeDetails(nodeSC, "asset")
5959 if ((senderAddr != toString(this)))
6060 then throw("Operação não autorizada")
6161 else if ((ownerID == NONE))
6262 then throw("Propriedade não identificada")
6363 else if (if ((ownerID != OWNER))
6464 then (MULTIOWNER == false)
6565 else false)
6666 then throw("Propriedade incorreta")
6767 else if ((nodeAsset == NONE))
6868 then throw("Inconsistencia de dados do node")
6969 else if (if (if ((status != "ON"))
7070 then (status != "OFF")
7171 else false)
7272 then (status != "LAUNCH")
7373 else false)
7474 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+ }
7989 }
8090
8191

github/deemru/w8io/026f985 
23.88 ms