tx · C5HPYQdwFQJbac7XUjyLPixt44YM9dbJmxnmdGvFENGy

3N58AEeUCDbB93RaTVPfS3hmXS4RameBJAh:  -0.01000000 Waves

2022.04.10 15:52 [2002508] smart account 3N58AEeUCDbB93RaTVPfS3hmXS4RameBJAh > SELF 0.00000000 Waves

{ "type": 13, "id": "C5HPYQdwFQJbac7XUjyLPixt44YM9dbJmxnmdGvFENGy", "fee": 1000000, "feeAssetId": null, "timestamp": 1649595195213, "version": 2, "chainId": 84, "sender": "3N58AEeUCDbB93RaTVPfS3hmXS4RameBJAh", "senderPublicKey": "AUmzFrGot6sb7JrGGwmQA7RZLFhA7T9x8auj4KByeoUf", "proofs": [ "4Ts4N26aeojwe9Tjh92KLBt9Ctyat3U22wiPvDH5nvMDQJWiAqfi9a7LqXw8vWUNt5aeJm7x9dbKKhaZyNQGpvxr" ], "script": "base64:AAIDAAAAAAAAAAwIARIDCgEIEgMKAQgAAAABAAAAAA1jb250cmFjdE93bmVyAgAAACMzTjU4QUVlVUNEYkI5M1JhVFZQZlMzaG1YUzRSYW1lQkpBaAAAAAIAAAABaQEAAAAPYXV0aG9yaXplRGV2aWNlAAAAAQAAAA1kZXZpY2VBZGRyZXNzBAAAAApjdXJyZW50S2V5CQACWAAAAAEICAUAAAABaQAAAAZjYWxsZXIAAAAFYnl0ZXMDCQAAAAAAAAIFAAAACmN1cnJlbnRLZXkFAAAADWNvbnRyYWN0T3duZXIJAQAAAAhXcml0ZVNldAAAAAEJAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAIFAAAADWRldmljZUFkZHJlc3MGBQAAAANuaWwJAAACAAAAAQIAAAAuWW91IGFyZSBub3QgYXV0aG9yaXplZCB0byBtYW5hZ2UgdGhpcyBjb250cmFjdAAAAAFpAQAAABFkZWF1dGhvcml6ZURldmljZQAAAAEAAAANZGV2aWNlQWRkcmVzcwQAAAAKY3VycmVudEtleQkAAlgAAAABCAgFAAAAAWkAAAAGY2FsbGVyAAAABWJ5dGVzAwkAAAAAAAACBQAAAApjdXJyZW50S2V5BQAAAA1jb250cmFjdE93bmVyCQEAAAAIV3JpdGVTZXQAAAABCQAETAAAAAIJAQAAAAlEYXRhRW50cnkAAAACBQAAAA1kZXZpY2VBZGRyZXNzBwUAAAADbmlsCQAAAgAAAAECAAAALllvdSBhcmUgbm90IGF1dGhvcml6ZWQgdG8gbWFuYWdlIHRoaXMgY29udHJhY3QAAAAA87cZBA==", "height": 2002508, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 7s8NWkyeBgZ1Dut9rfMCy55NSFuQ7fFduBuydxWxVhcp Next: none Diff:
OldNewDifferences
44 let contractOwner = "3N58AEeUCDbB93RaTVPfS3hmXS4RameBJAh"
55
66 @Callable(i)
7-func saveAge (age) = {
7+func authorizeDevice (deviceAddress) = {
88 let currentKey = toBase58String(i.caller.bytes)
9- ScriptResult(WriteSet([DataEntry(currentKey, age)]), TransferSet([ScriptTransfer(i.caller, age, unit)]))
9+ if ((currentKey == contractOwner))
10+ then WriteSet([DataEntry(deviceAddress, true)])
11+ else throw("You are not authorized to manage this contract")
1012 }
1113
1214
1315
1416 @Callable(i)
15-func addPoint (point) = {
16- let currentKey = toBase58String(i.caller.bytes)
17- let currentAmount = match getInteger(this, currentKey) {
18- case a: Int =>
19- a
20- case _ =>
21- 0
22- }
23- let newAmount = (currentAmount + point)
24- WriteSet([DataEntry(currentKey, newAmount)])
25- }
26-
27-
28-
29-@Callable(i)
30-func addContract (deviceAddress) = {
17+func deauthorizeDevice (deviceAddress) = {
3118 let currentKey = toBase58String(i.caller.bytes)
3219 if ((currentKey == contractOwner))
33- then WriteSet([DataEntry(deviceAddress, true)])
34- else throw("You are not contractOwner")
20+ then WriteSet([DataEntry(deviceAddress, false)])
21+ else throw("You are not authorized to manage this contract")
3522 }
36-
37-
38-
39-@Callable(i)
40-func removeContract (deviceAddress) = WriteSet([DataEntry(deviceAddress, false)])
4123
4224
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 3 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let contractOwner = "3N58AEeUCDbB93RaTVPfS3hmXS4RameBJAh"
55
66 @Callable(i)
7-func saveAge (age) = {
7+func authorizeDevice (deviceAddress) = {
88 let currentKey = toBase58String(i.caller.bytes)
9- ScriptResult(WriteSet([DataEntry(currentKey, age)]), TransferSet([ScriptTransfer(i.caller, age, unit)]))
9+ if ((currentKey == contractOwner))
10+ then WriteSet([DataEntry(deviceAddress, true)])
11+ else throw("You are not authorized to manage this contract")
1012 }
1113
1214
1315
1416 @Callable(i)
15-func addPoint (point) = {
16- let currentKey = toBase58String(i.caller.bytes)
17- let currentAmount = match getInteger(this, currentKey) {
18- case a: Int =>
19- a
20- case _ =>
21- 0
22- }
23- let newAmount = (currentAmount + point)
24- WriteSet([DataEntry(currentKey, newAmount)])
25- }
26-
27-
28-
29-@Callable(i)
30-func addContract (deviceAddress) = {
17+func deauthorizeDevice (deviceAddress) = {
3118 let currentKey = toBase58String(i.caller.bytes)
3219 if ((currentKey == contractOwner))
33- then WriteSet([DataEntry(deviceAddress, true)])
34- else throw("You are not contractOwner")
20+ then WriteSet([DataEntry(deviceAddress, false)])
21+ else throw("You are not authorized to manage this contract")
3522 }
36-
37-
38-
39-@Callable(i)
40-func removeContract (deviceAddress) = WriteSet([DataEntry(deviceAddress, false)])
4123
4224

github/deemru/w8io/169f3d6 
38.16 ms