tx · bzbbyoajbAW3JfpuQNMqj6LQv9A3J8jQkd5uM94N1cA 3N2n4bjG8CjdKiwLPyp3hBM4MDJ3XwMZR5h: -0.01000000 Waves 2025.01.08 16:33 [3450261] smart account 3N2n4bjG8CjdKiwLPyp3hBM4MDJ3XwMZR5h > SELF 0.00000000 Waves
{ "type": 13, "id": "bzbbyoajbAW3JfpuQNMqj6LQv9A3J8jQkd5uM94N1cA", "fee": 1000000, "feeAssetId": null, "timestamp": 1736343241194, "version": 2, "chainId": 84, "sender": "3N2n4bjG8CjdKiwLPyp3hBM4MDJ3XwMZR5h", "senderPublicKey": "EYW6638DJ9USqhUuqXFhnaZhDkqZRC9QniTZwzS2VLoP", "proofs": [ "4mrLyyxNqPMwpnqYTmHYZxcFrUaMqaBrvAZQVFKqJJn1BEGRKFSdeWXnYBEFuRhG4x2CRk4YgSoUA5WRH1D2qyaV" ], "script": "base64:AAIFAAAAAAAAAAgIAhIECgIICAAAAAAAAAABAAAAAWkBAAAACFNhdmVEYXRhAAAAAgAAAAt0ZW1wZXJhdHVyZQAAAAhodW1pZGl0eQQAAAAGY2FsbGVyCQACWAAAAAEIBQAAAAFpAAAAD2NhbGxlclB1YmxpY0tleQQAAAAJdGltZXN0YW1wCQABpAAAAAEIBQAAAAlsYXN0QmxvY2sAAAAJdGltZXN0YW1wCQAETAAAAAIJAQAAAAtTdHJpbmdFbnRyeQAAAAIJAAEsAAAAAgkAASwAAAACCQABLAAAAAIFAAAABmNhbGxlcgIAAAABXwUAAAAJdGltZXN0YW1wAgAAAAxfdGVtcGVyYXR1cmUFAAAAC3RlbXBlcmF0dXJlCQAETAAAAAIJAQAAAAtTdHJpbmdFbnRyeQAAAAIJAAEsAAAAAgkAASwAAAACCQABLAAAAAIFAAAABmNhbGxlcgIAAAABXwUAAAAJdGltZXN0YW1wAgAAAAlfaHVtaWRpdHkFAAAACGh1bWlkaXR5BQAAAANuaWwAAAAAGlKy0A==", "height": 3450261, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 37pho3PQs3cdus2DRPpTEBjLszwkPCaq79Bfe32exsWm Next: none Full:
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | - | let adminAddress = Address(base58'3MptJSctbAkp5fddvpQmWYjjKrSoim6dL38') | |
5 | - | ||
6 | - | let dAppAddress = Address(base58'3N2n4bjG8CjdKiwLPyp3hBM4MDJ3XwMZR5h') | |
7 | - | ||
8 | - | func searchForUser (address) = { | |
9 | - | let user = match getString(address) { | |
10 | - | case s: String => | |
11 | - | s | |
12 | - | case _ => | |
13 | - | "No User" | |
14 | - | } | |
15 | - | user | |
16 | - | } | |
17 | 4 | ||
18 | 5 | ||
19 | 6 | @Callable(i) | |
20 | - | func registerAccount (address,role,name) = { | |
21 | - | let caller = i.callerPublicKey | |
22 | - | let user = searchForUser(toBase58String(caller)) | |
23 | - | if ((user != "Admin")) | |
24 | - | then throw("Only the admin can delete accounts") | |
25 | - | else [StringEntry(address, role), StringEntry((address + "_name"), name)] | |
26 | - | } | |
27 | - | ||
28 | - | ||
29 | - | ||
30 | - | @Callable(i) | |
31 | - | func deleteAccount (address) = { | |
32 | - | let caller = i.callerPublicKey | |
33 | - | let user = searchForUser(toBase58String(caller)) | |
34 | - | if ((user != "Admin")) | |
35 | - | then throw("Only the admin can delete accounts") | |
36 | - | else [DeleteEntry(address), DeleteEntry((address + "_name"))] | |
37 | - | } | |
38 | - | ||
39 | - | ||
40 | - | ||
41 | - | @Callable(i) | |
42 | - | func saveData (temperature,humidity) = { | |
43 | - | let caller = i.callerPublicKey | |
44 | - | let user = searchForUser(toBase58String(caller)) | |
45 | - | if ((user == "No User")) | |
46 | - | then throw("User not eligible") | |
47 | - | else { | |
48 | - | let parameters = [temperature, humidity] | |
49 | - | let invokeTask = invoke(dAppAddress, "SaveData", parameters, nil) | |
50 | - | if ((invokeTask != invokeTask)) | |
51 | - | then throw("Strict value is not equal to itself.") | |
52 | - | else nil | |
53 | - | } | |
7 | + | func SaveData (temperature,humidity) = { | |
8 | + | let caller = toBase58String(i.callerPublicKey) | |
9 | + | let timestamp = toString(lastBlock.timestamp) | |
10 | + | [StringEntry((((caller + "_") + timestamp) + "_temperature"), temperature), StringEntry((((caller + "_") + timestamp) + "_humidity"), humidity)] | |
54 | 11 | } | |
55 | 12 | ||
56 | 13 |
github/deemru/w8io/169f3d6 17.83 ms ◑