tx · 62LYy7rbm1ZkKskwrQuumbd3MSCJ7aL43Luty6KcioAL
3N58AEeUCDbB93RaTVPfS3hmXS4RameBJAh: -0.01000000 Waves
2022.04.10 15:41 [2002497] smart account 3N58AEeUCDbB93RaTVPfS3hmXS4RameBJAh > SELF 0.00000000 Waves
{
"type": 13,
"id": "62LYy7rbm1ZkKskwrQuumbd3MSCJ7aL43Luty6KcioAL",
"fee": 1000000,
"feeAssetId": null,
"timestamp": 1649594522172,
"version": 2,
"chainId": 84,
"sender": "3N58AEeUCDbB93RaTVPfS3hmXS4RameBJAh",
"senderPublicKey": "AUmzFrGot6sb7JrGGwmQA7RZLFhA7T9x8auj4KByeoUf",
"proofs": [
"DFqhX27kRETLLyvayqBv3gtEcMQGxs9RDqSaN7R861iExQ8TwBuxYLyMspW4XkhJNj4aoG3pHgKup1EG16Hn68J"
],
"script": "base64:AAIDAAAAAAAAABYIARIDCgEBEgMKAQESAwoBCBIDCgEIAAAAAQAAAAANY29udHJhY3RPd25lcgIAAAADMTIzAAAABAAAAAFpAQAAAAdzYXZlQWdlAAAAAQAAAANhZ2UEAAAACmN1cnJlbnRLZXkJAAJYAAAAAQgIBQAAAAFpAAAABmNhbGxlcgAAAAVieXRlcwkBAAAADFNjcmlwdFJlc3VsdAAAAAIJAQAAAAhXcml0ZVNldAAAAAEJAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAIFAAAACmN1cnJlbnRLZXkFAAAAA2FnZQUAAAADbmlsCQEAAAALVHJhbnNmZXJTZXQAAAABCQAETAAAAAIJAQAAAA5TY3JpcHRUcmFuc2ZlcgAAAAMIBQAAAAFpAAAABmNhbGxlcgUAAAADYWdlBQAAAAR1bml0BQAAAANuaWwAAAABaQEAAAAIYWRkUG9pbnQAAAABAAAABXBvaW50BAAAAApjdXJyZW50S2V5CQACWAAAAAEICAUAAAABaQAAAAZjYWxsZXIAAAAFYnl0ZXMEAAAADWN1cnJlbnRBbW91bnQEAAAAByRtYXRjaDAJAAQaAAAAAgUAAAAEdGhpcwUAAAAKY3VycmVudEtleQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAADSW50BAAAAAFhBQAAAAckbWF0Y2gwBQAAAAFhAAAAAAAAAAAABAAAAAluZXdBbW91bnQJAABkAAAAAgUAAAANY3VycmVudEFtb3VudAUAAAAFcG9pbnQJAQAAAAhXcml0ZVNldAAAAAEJAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAIFAAAACmN1cnJlbnRLZXkFAAAACW5ld0Ftb3VudAUAAAADbmlsAAAAAWkBAAAAC2FkZENvbnRyYWN0AAAAAQAAAA1kZXZpY2VBZGRyZXNzBAAAAApjdXJyZW50S2V5CQACWAAAAAEICAUAAAABaQAAAAZjYWxsZXIAAAAFYnl0ZXMDCQAAAAAAAAIFAAAACmN1cnJlbnRLZXkFAAAADWNvbnRyYWN0T3duZXIJAQAAAAhXcml0ZVNldAAAAAEJAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAIFAAAADWRldmljZUFkZHJlc3MGBQAAAANuaWwJAAACAAAAAQIAAAAZWW91IGFyZSBub3QgY29udHJhY3RPd25lcgAAAAFpAQAAAA5yZW1vdmVDb250cmFjdAAAAAEAAAANZGV2aWNlQWRkcmVzcwkBAAAACFdyaXRlU2V0AAAAAQkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgUAAAANZGV2aWNlQWRkcmVzcwcFAAAAA25pbAAAAAA1t/FO",
"height": 2002497,
"applicationStatus": "succeeded",
"spentComplexity": 0
}
View: original | compacted
Prev: 2ZA9eAK9NNqALXw4cQeQ5efZBJhSb1fWR77jbofVcWMo
Next: 9YpvHqEUQPVEerXNyuuYz66iECPVbG5jmwGjgahG6rc1
Diff:
Old | New | | Differences |
---|
1 | 1 | | {-# STDLIB_VERSION 3 #-} |
---|
2 | 2 | | {-# SCRIPT_TYPE ACCOUNT #-} |
---|
3 | 3 | | {-# CONTENT_TYPE DAPP #-} |
---|
4 | | - | let isOwner = "123" |
---|
| 4 | + | let contractOwner = "123" |
---|
5 | 5 | | |
---|
6 | 6 | | @Callable(i) |
---|
7 | 7 | | func saveAge (age) = { |
---|
|
27 | 27 | | |
---|
28 | 28 | | |
---|
29 | 29 | | @Callable(i) |
---|
30 | | - | func addContract (deviceAddress) = WriteSet([DataEntry(deviceAddress, true)]) |
---|
| 30 | + | func addContract (deviceAddress) = { |
---|
| 31 | + | let currentKey = toBase58String(i.caller.bytes) |
---|
| 32 | + | if ((currentKey == contractOwner)) |
---|
| 33 | + | then WriteSet([DataEntry(deviceAddress, true)]) |
---|
| 34 | + | else throw("You are not contractOwner") |
---|
| 35 | + | } |
---|
31 | 36 | | |
---|
32 | 37 | | |
---|
33 | 38 | | |
---|
Full:
Old | New | | Differences |
---|
1 | 1 | | {-# STDLIB_VERSION 3 #-} |
---|
2 | 2 | | {-# SCRIPT_TYPE ACCOUNT #-} |
---|
3 | 3 | | {-# CONTENT_TYPE DAPP #-} |
---|
4 | | - | let isOwner = "123" |
---|
| 4 | + | let contractOwner = "123" |
---|
5 | 5 | | |
---|
6 | 6 | | @Callable(i) |
---|
7 | 7 | | func saveAge (age) = { |
---|
8 | 8 | | let currentKey = toBase58String(i.caller.bytes) |
---|
9 | 9 | | ScriptResult(WriteSet([DataEntry(currentKey, age)]), TransferSet([ScriptTransfer(i.caller, age, unit)])) |
---|
10 | 10 | | } |
---|
11 | 11 | | |
---|
12 | 12 | | |
---|
13 | 13 | | |
---|
14 | 14 | | @Callable(i) |
---|
15 | 15 | | func addPoint (point) = { |
---|
16 | 16 | | let currentKey = toBase58String(i.caller.bytes) |
---|
17 | 17 | | let currentAmount = match getInteger(this, currentKey) { |
---|
18 | 18 | | case a: Int => |
---|
19 | 19 | | a |
---|
20 | 20 | | case _ => |
---|
21 | 21 | | 0 |
---|
22 | 22 | | } |
---|
23 | 23 | | let newAmount = (currentAmount + point) |
---|
24 | 24 | | WriteSet([DataEntry(currentKey, newAmount)]) |
---|
25 | 25 | | } |
---|
26 | 26 | | |
---|
27 | 27 | | |
---|
28 | 28 | | |
---|
29 | 29 | | @Callable(i) |
---|
30 | | - | func addContract (deviceAddress) = WriteSet([DataEntry(deviceAddress, true)]) |
---|
| 30 | + | func addContract (deviceAddress) = { |
---|
| 31 | + | let currentKey = toBase58String(i.caller.bytes) |
---|
| 32 | + | if ((currentKey == contractOwner)) |
---|
| 33 | + | then WriteSet([DataEntry(deviceAddress, true)]) |
---|
| 34 | + | else throw("You are not contractOwner") |
---|
| 35 | + | } |
---|
31 | 36 | | |
---|
32 | 37 | | |
---|
33 | 38 | | |
---|
34 | 39 | | @Callable(i) |
---|
35 | 40 | | func removeContract (deviceAddress) = WriteSet([DataEntry(deviceAddress, false)]) |
---|
36 | 41 | | |
---|
37 | 42 | | |
---|