tx · 393FJkFUXJipFJhhBoDz5R1b8nGbkBieQkmmvpxdyaRe

3MrAr1PgXYYPi8hSBif9z4dHSDkUkaL8VHS:  -0.01400000 Waves

2021.08.17 18:21 [1662514] smart account 3MrAr1PgXYYPi8hSBif9z4dHSDkUkaL8VHS > SELF 0.00000000 Waves

{ "type": 13, "id": "393FJkFUXJipFJhhBoDz5R1b8nGbkBieQkmmvpxdyaRe", "fee": 1400000, "feeAssetId": null, "timestamp": 1629213756700, "version": 2, "chainId": 84, "sender": "3MrAr1PgXYYPi8hSBif9z4dHSDkUkaL8VHS", "senderPublicKey": "4Jye1zP9d4RPVyK435sPSyfLahkhcYHaP8GzMZcGTCuE", "proofs": [ "2zP1gV9Gmbn6XgaveZD7eznvotQUqHASisyL6iQiQRTAWjPM1xoSUDGZbVXbAJo3aNeCY7t8wAfv86QG2uTpeFTw" ], "script": "base64:AAIFAAAAAAAAAWsIAhIAEgMKAQIaEQoCYTESC0dsb2JhbFN0b3JlGhAKAmEyEgpFdmVudFN0b3JlGhoKAmEzEhRPd25lclNldEN1cnJlbnRJbmRleBoLCgJhNBIFc3RvcmUaFQoCYTUSD093bmVyU2V0QnlJbmRleBoLCgJhNhIFaW5kZXgaEQoCYTcSC0luaXRpYWxpemVkGhMKAmE4Eg1UcmFuc2FjdGlvbklkGg4KAmE5EghPbGRPd25lchoOCgJiMRIITmV3T3duZXIaCwoCYjISBU93bmVyGg4KAmIzEghvd25lclNldBoOCgJiNBIIb2xkT3duZXIaDgoCYjUSCG5ld093bmVyGg0KAmI2EgckbWF0Y2gwGgcKAmI3EgFpGhMKAmI4Eg1pc0luaXRpYWxpemVkGg0KAmI5Egdpc093bmVyGgwKAmMxEgZjYWxsZXIaBwoCYzISAXYaCAoCYzMSAnR4GgwKAmM0EgZ2ZXJpZnkAAAAMAAAAAAJhMQIAAAAGZ2xvYmFsAAAAAAJhMgIAAAAFZXZlbnQBAAAAAmEzAAAAAQAAAAJhNAkAASwAAAACBQAAAAJhMgIAAAAR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AAAJiOQAAAAEAAAACYzEEAAAAAmI2CQAEIQAAAAEJAQAAAAJiMgAAAAEFAAAAAmExAwkAAAEAAAACBQAAAAJiNgIAAAAKQnl0ZVZlY3RvcgQAAAACYzIFAAAAAmI2CQAAAAAAAAIFAAAAAmMyCAUAAAACYzEAAAAFYnl0ZXMHAAAAAgAAAAJiNwEAAAAEaW5pdAAAAAADCQEAAAACYjgAAAAACQAAAgAAAAECAAAAHENvbnRyYWN0IGFscmVhZHkgaW5pdGlhbGl6ZWQJAAROAAAAAgkBAAAAAmIzAAAAAgUAAAAEdW5pdAgFAAAAAmI3AAAABmNhbGxlcgkABEwAAAACCQEAAAAMQm9vbGVhbkVudHJ5AAAAAgkBAAAAAmE3AAAAAQUAAAACYTEGBQAAAANuaWwAAAACYjcBAAAAC2NoYW5nZU93bmVyAAAAAQAAAAJiNQQAAAACYjQIBQAAAAJiNwAAAAZjYWxsZXIDCQEAAAABIQAAAAEJAQAAAAJiOQAAAAEFAAAAAmI0CQAAAgAAAAECAAAAE0NhbGxlciBpcyBub3Qgb3duZXIJAQAAAAJiMwAAAAIFAAAAAmI0CQEAAAAHQWRkcmVzcwAAAAEFAAAAAmI1AAAAAQAAAAJjMwEAAAACYzQAAAAACQAB9AAAAAMIBQAAAAJjMwAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAAmMzAAAABnByb29mcwAAAAAAAAAAAAgFAAAAAmMzAAAAD3NlbmRlclB1YmxpY0tleRe0acE=", "height": 1662514, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 7AVsx83Usaz4EtCNwNrXbRN9DaBF6aEXJUtTTRkCagbX Next: 3VkiZvH8q94a729XDmtn8WU6KxURgPQhLj1wxepqannc Diff:
OldNewDifferences
99
1010
1111 func OwnerSetByIndex (store,index) = (((store + "ownerSet[") + toString(index)) + "]")
12+
13+
14+func Initialized (store) = (store + "_initialized")
1215
1316
1417 func TransactionId (store) = (store + "_tx")
3437 }
3538
3639
40+func isInitialized () = isDefined(getBoolean(Initialized(GlobalStore)))
41+
42+
3743 func isOwner (caller) = match getBinary(Owner(GlobalStore)) {
3844 case v: ByteVector =>
3945 (v == caller.bytes)
4349
4450
4551 @Callable(i)
46-func init () = {
47- let owner = i.caller
48- ownerSet(unit, i.caller)
49- }
52+func init () = if (isInitialized())
53+ then throw("Contract already initialized")
54+ else (ownerSet(unit, i.caller) ++ [BooleanEntry(Initialized(GlobalStore), true)])
5055
5156
5257
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let GlobalStore = "global"
55
66 let EventStore = "event"
77
88 func OwnerSetCurrentIndex (store) = (EventStore + "_ownerSet_current")
99
1010
1111 func OwnerSetByIndex (store,index) = (((store + "ownerSet[") + toString(index)) + "]")
12+
13+
14+func Initialized (store) = (store + "_initialized")
1215
1316
1417 func TransactionId (store) = (store + "_tx")
1518
1619
1720 func OldOwner (store) = (store + "_oldOwner")
1821
1922
2023 func NewOwner (store) = (store + "_newOwner")
2124
2225
2326 func Owner (store) = (store + "_owner")
2427
2528
2629 func ownerSet (oldOwner,newOwner) = {
2730 let index = match getInteger(OwnerSetCurrentIndex(EventStore)) {
2831 case i: Int =>
2932 (i + 1)
3033 case _ =>
3134 0
3235 }
3336 [BinaryEntry(Owner(GlobalStore), newOwner.bytes), IntegerEntry(OwnerSetCurrentIndex(EventStore), index), BinaryEntry(OldOwner(OwnerSetByIndex(EventStore, index)), newOwner.bytes), BinaryEntry(NewOwner(OwnerSetByIndex(EventStore, index)), newOwner.bytes)]
3437 }
3538
3639
40+func isInitialized () = isDefined(getBoolean(Initialized(GlobalStore)))
41+
42+
3743 func isOwner (caller) = match getBinary(Owner(GlobalStore)) {
3844 case v: ByteVector =>
3945 (v == caller.bytes)
4046 case _ =>
4147 false
4248 }
4349
4450
4551 @Callable(i)
46-func init () = {
47- let owner = i.caller
48- ownerSet(unit, i.caller)
49- }
52+func init () = if (isInitialized())
53+ then throw("Contract already initialized")
54+ else (ownerSet(unit, i.caller) ++ [BooleanEntry(Initialized(GlobalStore), true)])
5055
5156
5257
5358 @Callable(i)
5459 func changeOwner (newOwner) = {
5560 let oldOwner = i.caller
5661 if (!(isOwner(oldOwner)))
5762 then throw("Caller is not owner")
5863 else ownerSet(oldOwner, Address(newOwner))
5964 }
6065
6166
6267 @Verifier(tx)
6368 func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
6469

github/deemru/w8io/169f3d6 
53.10 ms