tx · Hpcr5pGGPGaDEXvaTNRu3vsLepcC3MjTk1FhPFz7cEV2
3N5NY2v5wdKQJbCvQA5o5hSihn7t7wYZ496: -0.01000000 Waves
2024.12.16 21:56 [3417497] smart account 3N5NY2v5wdKQJbCvQA5o5hSihn7t7wYZ496 > SELF 0.00000000 Waves
{
"type": 13,
"id": "Hpcr5pGGPGaDEXvaTNRu3vsLepcC3MjTk1FhPFz7cEV2",
"fee": 1000000,
"feeAssetId": null,
"timestamp": 1734375371446,
"version": 2,
"chainId": 84,
"sender": "3N5NY2v5wdKQJbCvQA5o5hSihn7t7wYZ496",
"senderPublicKey": "8Ti3dhEToApephiZ47QJeuQX3UYifveNLPQjNstsLho9",
"proofs": [
"5XGie7JD7sx99gdAscjYGUCpVKxcWhNX83xvso9SiSmNWbz92tMzR9GmMnrrR7HPstpcp4rPNCXY3qzzQG5bpUxD"
],
"script": "base64:AAIFAAAAAAAAABMIAhIFCgMICAgSAwoBCBIDCgEIAAAAAwAAAAAMYWRtaW5BZGRyZXNzCQEAAAAHQWRkcmVzcwAAAAEBAAAAGgFUCqHeMHrxZR0XUx5cVy0kBbMbRdCBEe7XAAAAAAtkQXBwQWRkcmVzcwkBAAAAB0FkZHJlc3MAAAABAQAAABoBVI0VU3jZ1UKUxwxbUFugfo26NZ5ZKhlX8AEAAAANc2VhcmNoRm9yVXNlcgAAAAEAAAAHYWRkcmVzcwQAAAAEdXNlcgQAAAAHJG1hdGNoMAkABCIAAAABBQAAAAdhZGRyZXNzAwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAAZTdHJpbmcEAAAAAXMFAAAAByRtYXRjaDAFAAAAAXMCAAAAB05vIFVzZXIFAAAABHVzZXIAAAADAAAAAWkBAAAAD3JlZ2lzdGVyQWNjb3VudAAAAAMAAAAHYWRkcmVzcwAAAARyb2xlAAAABG5hbWUDCQEAAAACIT0AAAACCAUAAAABaQAAAAZjYWxsZXIFAAAADGFkbWluQWRkcmVzcwkAAAIAAAABAgAAACRPbmx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i3CLLA==",
"height": 3417497,
"applicationStatus": "succeeded",
"spentComplexity": 0
}
View: original | compacted
Prev: HCVaCRP2XbP9t2JFuvmW5wJx2KZgUxLTFmPdwx442sz
Next: none
Diff:
Old | New | | Differences |
---|
26 | 26 | | @Callable(i) |
---|
27 | 27 | | func deleteAccount (address) = if ((i.caller != adminAddress)) |
---|
28 | 28 | | then throw("Only the admin can delete accounts") |
---|
29 | | - | else [DeleteEntry(address)] |
---|
| 29 | + | else [DeleteEntry(address), DeleteEntry((address + "_name"))] |
---|
30 | 30 | | |
---|
31 | 31 | | |
---|
32 | 32 | | |
---|
Full:
Old | New | | Differences |
---|
1 | 1 | | {-# STDLIB_VERSION 5 #-} |
---|
2 | 2 | | {-# SCRIPT_TYPE ACCOUNT #-} |
---|
3 | 3 | | {-# CONTENT_TYPE DAPP #-} |
---|
4 | 4 | | let adminAddress = Address(base58'3MptJSctbAkp5fddvpQmWYjjKrSoim6dL38') |
---|
5 | 5 | | |
---|
6 | 6 | | let dAppAddress = Address(base58'3N2n4bjG8CjdKiwLPyp3hBM4MDJ3XwMZR5h') |
---|
7 | 7 | | |
---|
8 | 8 | | func searchForUser (address) = { |
---|
9 | 9 | | let user = match getString(address) { |
---|
10 | 10 | | case s: String => |
---|
11 | 11 | | s |
---|
12 | 12 | | case _ => |
---|
13 | 13 | | "No User" |
---|
14 | 14 | | } |
---|
15 | 15 | | user |
---|
16 | 16 | | } |
---|
17 | 17 | | |
---|
18 | 18 | | |
---|
19 | 19 | | @Callable(i) |
---|
20 | 20 | | func registerAccount (address,role,name) = if ((i.caller != adminAddress)) |
---|
21 | 21 | | then throw("Only the admin can register accounts") |
---|
22 | 22 | | else [StringEntry(address, role), StringEntry((address + "_name"), name)] |
---|
23 | 23 | | |
---|
24 | 24 | | |
---|
25 | 25 | | |
---|
26 | 26 | | @Callable(i) |
---|
27 | 27 | | func deleteAccount (address) = if ((i.caller != adminAddress)) |
---|
28 | 28 | | then throw("Only the admin can delete accounts") |
---|
29 | | - | else [DeleteEntry(address)] |
---|
| 29 | + | else [DeleteEntry(address), DeleteEntry((address + "_name"))] |
---|
30 | 30 | | |
---|
31 | 31 | | |
---|
32 | 32 | | |
---|
33 | 33 | | @Callable(i) |
---|
34 | 34 | | func saveData (temperature) = { |
---|
35 | 35 | | let caller = i.caller |
---|
36 | 36 | | let user = searchForUser(toBase58String(caller.bytes)) |
---|
37 | 37 | | if ((user == "No User")) |
---|
38 | 38 | | then throw("User not eligible") |
---|
39 | 39 | | else { |
---|
40 | 40 | | let parameters = [temperature] |
---|
41 | 41 | | let invokeTask = invoke(dAppAddress, "SaveData", parameters, nil) |
---|
42 | 42 | | if ((invokeTask != invokeTask)) |
---|
43 | 43 | | then throw("Strict value is not equal to itself.") |
---|
44 | 44 | | else nil |
---|
45 | 45 | | } |
---|
46 | 46 | | } |
---|
47 | 47 | | |
---|
48 | 48 | | |
---|