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:
OldNewDifferences
11 {-# STDLIB_VERSION 3 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
4-let isOwner = "123"
4+let contractOwner = "123"
55
66 @Callable(i)
77 func saveAge (age) = {
2727
2828
2929 @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+ }
3136
3237
3338
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 3 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
4-let isOwner = "123"
4+let contractOwner = "123"
55
66 @Callable(i)
77 func saveAge (age) = {
88 let currentKey = toBase58String(i.caller.bytes)
99 ScriptResult(WriteSet([DataEntry(currentKey, age)]), TransferSet([ScriptTransfer(i.caller, age, unit)]))
1010 }
1111
1212
1313
1414 @Callable(i)
1515 func addPoint (point) = {
1616 let currentKey = toBase58String(i.caller.bytes)
1717 let currentAmount = match getInteger(this, currentKey) {
1818 case a: Int =>
1919 a
2020 case _ =>
2121 0
2222 }
2323 let newAmount = (currentAmount + point)
2424 WriteSet([DataEntry(currentKey, newAmount)])
2525 }
2626
2727
2828
2929 @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+ }
3136
3237
3338
3439 @Callable(i)
3540 func removeContract (deviceAddress) = WriteSet([DataEntry(deviceAddress, false)])
3641
3742

github/deemru/w8io/169f3d6 
38.25 ms