tx · 9oRGuJi88MkzqNMxLV9oy3CbgicXBbjDheeuKsG8CLiM

3NBPqqjDH2eYmoHeXNPnHhLvA7D4UDQXQcx:  -0.01400000 Waves

2021.01.07 15:19 [1342983] smart account 3NBPqqjDH2eYmoHeXNPnHhLvA7D4UDQXQcx > SELF 0.00000000 Waves

{ "type": 13, "id": "9oRGuJi88MkzqNMxLV9oy3CbgicXBbjDheeuKsG8CLiM", "fee": 1400000, "feeAssetId": null, "timestamp": 1610021835099, "version": 2, "chainId": 84, "sender": "3NBPqqjDH2eYmoHeXNPnHhLvA7D4UDQXQcx", "senderPublicKey": "2VJESL5o2hqRwaKdJGDXpzJ7jNDcZz5y4C6qWEaUn4yY", "proofs": [ "3FQoS5UBdAPW6qbe2G8WTu2NfdYg8JN9ob5akdnwfJbEGDrdAW3LLe2EG5T9zKinUxaa82LBeyjx56t3EtYDJwgK" ], "script": "base64:AAIEAAAAAAAAAA0IAhIECgIICBIDCgEIAAAAAwEAAAAKY291bnRlcktleQAAAAEAAAAGZGV2aWNlCQABLAAAAAIFAAAABmRldmljZQIAAAAIX2NvdW50ZXIBAAAACXN0YXR1c0tleQAAAAEAAAAGZGV2aWNlCQABLAAAAAIFAAAABmRldmljZQIAAAAHX3N0YXR1cwEAAAAMZGV2aWNlRXhpc3RzAAAAAQAAAAZkZXZpY2UEAAAABmV4aXN0cwkABBoAAAACBQAAAAR0aGlzCQEAAAAKY291bnRlcktleQAAAAEFAAAABmRldmljZQQAAAAHJG1hdGNoMAUAAAAGZXhpc3RzAwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAANJbnQEAAAAAXYFAAAAByRtYXRjaDAGBwAAAAIAAAABaQEAAAAIaW50ZXJhY3QAAAACAAAABmRldmljZQAAAAZhY3Rpb24DAwkBAAAAAiE9AAAAAgUAAAAGYWN0aW9uAgAAAARvcGVuCQEAAAACIT0AAAACBQAAAAZhY3Rpb24CAAAABWNsb3NlBwkAAAIAAAABAgAAAA5JbnZhbGlkIGFjdGlvbgMJAQAAAAEhAAAAAQkBAAAADGRldmljZUV4aXN0cwAAAAEFAAAABmRldmljZQkAAAIAAAABAgAAABVEZXZpY2UgZG9lcyBub3QgZXhpc3QEAAAAB2NvdW50ZXIJAQAAABFAZXh0ck5hdGl2ZSgxMDUwKQAAAAIFAAAABHRoaXMJAQAAAApjb3VudGVyS2V5AAAAAQUAAAAGZGV2aWNlCQAETAAAAAIJAQAAAAtTdHJpbmdFbnRyeQAAAAIJAQAAAAlzdGF0dXNLZXkAAAABBQAAAAZkZXZpY2UFAAAABmFjdGlvbgkABEwAAAACCQEAAAAMSW50ZWdlckVudHJ5AAAAAgkBAAAACmNvdW50ZXJLZXkAAAABBQAAAAZkZXZpY2UJAABkAAAAAgUAAAAHY291bnRlcgAAAAAAAAAAAQUAAAADbmlsAAAAAWkBAAAACWFkZERldmljZQAAAAEAAAAGZGV2aWNlCQAETAAAAAIJAQAAAAtTdHJpbmdFbnRyeQAAAAIJAAEsAAAAAgUAAAAGZGV2aWNlAgAAAAdfc3RhdHVzAgAAAAVjbG9zZQkABEwAAAACCQEAAAAMSW50ZWdlckVudHJ5AAAAAgkAASwAAAACBQAAAAZkZXZpY2UCAAAACF9jb3VudGVyAAAAAAAAAAAABQAAAANuaWwAAAABAAAAAnR4AQAAAAZ2ZXJpZnkAAAAACQAB9AAAAAMIBQAAAAJ0eAAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAAnR4AAAABnByb29mcwAAAAAAAAAAAAgFAAAAAnR4AAAAD3NlbmRlclB1YmxpY0tleb0XZe4=", "height": 1342983, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: none Next: D47n1nueihuoq3SXpjJJnsDW8YTcFLtjpt2RNccbrj9u Full:
OldNewDifferences
1-# no script
1+{-# STDLIB_VERSION 4 #-}
2+{-# SCRIPT_TYPE ACCOUNT #-}
3+{-# CONTENT_TYPE DAPP #-}
4+func counterKey (device) = (device + "_counter")
5+
6+
7+func statusKey (device) = (device + "_status")
8+
9+
10+func deviceExists (device) = {
11+ let exists = getInteger(this, counterKey(device))
12+ match exists {
13+ case v: Int =>
14+ true
15+ case _ =>
16+ false
17+ }
18+ }
19+
20+
21+@Callable(i)
22+func interact (device,action) = if (if ((action != "open"))
23+ then (action != "close")
24+ else false)
25+ then throw("Invalid action")
26+ else if (!(deviceExists(device)))
27+ then throw("Device does not exist")
28+ else {
29+ let counter = getIntegerValue(this, counterKey(device))
30+[StringEntry(statusKey(device), action), IntegerEntry(counterKey(device), (counter + 1))]
31+ }
32+
33+
34+
35+@Callable(i)
36+func addDevice (device) = [StringEntry((device + "_status"), "close"), IntegerEntry((device + "_counter"), 0)]
37+
38+
39+@Verifier(tx)
40+func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
41+

github/deemru/w8io/169f3d6 
24.53 ms