tx · 6muJ1CE6S5TxZYjHmqg5jCkxbYoMn6msh2fCaDQu7suT 3Mzj8MyE3E3G55SLVE6Dgd6ew2uERLxiE4U: -0.01300000 Waves 2023.05.02 09:53 [2559809] smart account 3Mzj8MyE3E3G55SLVE6Dgd6ew2uERLxiE4U > SELF 0.00000000 Waves
{ "type": 13, "id": "6muJ1CE6S5TxZYjHmqg5jCkxbYoMn6msh2fCaDQu7suT", "fee": 1300000, "feeAssetId": null, "timestamp": 1683010433099, "version": 2, "chainId": 84, "sender": "3Mzj8MyE3E3G55SLVE6Dgd6ew2uERLxiE4U", "senderPublicKey": "8E1ZoUTJyyA7ybXtP2NxUZKdAwvR1ruiQUxZD2bYJJMF", "proofs": [ "c2QnaR9abF6ZiQHrs42JSJgbareXrwYBdgCLLLa7iaJMgHk4e7QPdVywSjCsKNv9cCMZH7kSp13P4mDXiDAkvxG" ], "script": "base64:AAIFAAAAAAAAALYIAiITa2V5TWFuYWdlclB1YmxpY0tleSIWa2V5TWFuYWdlclZhdWx0QWRkcmVzcyIXZ2V0TWFuYWdlckFkZHJlc3NPckZhaWwiFm1hbmFnZXJQdWJsaWNLZXlPclVuaXQiE21hbmFnZXJWYXVsdEFkZHJlc3MiByRtYXRjaDAiAXMiC211c3RNYW5hZ2VyIgFpIgJwZCICcGsiAnR4IgZ2ZXJpZnkiD3RhcmdldFB1YmxpY0tleQAAAAUBAAAAAWEAAAAAAgAAABQlc19fbWFuYWdlclB1YmxpY0tleQEAAAABYgAAAAACAAAAFyVzX19tYW5hZ2VyVmF1bHRBZGRyZXNzAQAAAAFjAAAAAAkBAAAAEUBleHRyTmF0aXZlKDEwNjIpAAAAAQkBAAAAEUBleHRyTmF0aXZlKDEwNTgpAAAAAQkBAAAAAWIAAAAAAQAAAAFkAAAAAAQAAAABZQkBAAAAAWMAAAAABAAAAAFmCQAEHQAAAAIFAAAAAWUJAQAAAAFhAAAAAAMJAAABAAAAAgUAAAABZgIAAAAGU3RyaW5nBAAAAAFnBQAAAAFmCQACWQAAAAEFAAAAAWcDCQAAAQAAAAIFAAAAAWYCAAAABFVuaXQFAAAABHVuaXQJAAACAAAAAQIAAAALTWF0Y2ggZXJyb3IBAAAAAWgAAAABAAAAAWkEAAAAAWoJAAACAAAAAQIAAAARUGVybWlzc2lvbiBkZW5pZWQEAAAAAWYJAQAAAAFkAAAAAAMJAAABAAAAAgUAAAABZgIAAAAKQnl0ZVZlY3RvcgQAAAABawUAAAABZgMJAAAAAAAAAggFAAAAAWkAAAAPY2FsbGVyUHVibGljS2V5BQAAAAFrBgUAAAABagMJAAABAAAAAgUAAAABZgIAAAAEVW5pdAMJAAAAAAAAAggFAAAAAWkAAAAGY2FsbGVyBQAAAAR0aGlzBgUAAAABagkAAAIAAAABAgAAAAtNYXRjaCBlcnJvcgAAAAAAAAABAAAAAWwBAAAAAW0AAAAABAAAAAFuBAAAAAFmCQEAAAABZAAAAAADCQAAAQAAAAIFAAAAAWYCAAAACkJ5dGVWZWN0b3IEAAAAAWsFAAAAAWYFAAAAAWsDCQAAAQAAAAIFAAAAAWYCAAAABFVuaXQIBQAAAAFsAAAAD3NlbmRlclB1YmxpY0tleQkAAAIAAAABAgAAAAtNYXRjaCBlcnJvcgkAAfQAAAADCAUAAAABbAAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAAWwAAAAGcHJvb2ZzAAAAAAAAAAAABQAAAAFubojHSQ==", "height": 2559809, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 9pMYz7CQRLwS2gJzuWaDjREjmhPkzEZBdY14jSGWnA9M Next: none Diff:
Old | New | Differences | |
---|---|---|---|
4 | 4 | func keyManagerPublicKey () = "%s__managerPublicKey" | |
5 | 5 | ||
6 | 6 | ||
7 | - | func | |
7 | + | func keyManagerVaultAddress () = "%s__managerVaultAddress" | |
8 | 8 | ||
9 | 9 | ||
10 | - | func managerPublicKeyOrUnit () = match getString(keyManagerPublicKey()) { | |
11 | - | case s: String => | |
12 | - | fromBase58String(s) | |
13 | - | case _: Unit => | |
14 | - | unit | |
15 | - | case _ => | |
16 | - | throw("Match error") | |
17 | - | } | |
10 | + | func getManagerAddressOrFail () = addressFromStringValue(getStringValue(keyManagerVaultAddress())) | |
18 | 11 | ||
19 | 12 | ||
20 | - | func pendingManagerPublicKeyOrUnit () = match getString(keyPendingManagerPublicKey()) { | |
21 | - | case s: String => | |
22 | - | fromBase58String(s) | |
23 | - | case _: Unit => | |
24 | - | unit | |
25 | - | case _ => | |
26 | - | throw("Match error") | |
27 | - | } | |
13 | + | func managerPublicKeyOrUnit () = { | |
14 | + | let managerVaultAddress = getManagerAddressOrFail() | |
15 | + | match getString(managerVaultAddress, keyManagerPublicKey()) { | |
16 | + | case s: String => | |
17 | + | fromBase58String(s) | |
18 | + | case _: Unit => | |
19 | + | unit | |
20 | + | case _ => | |
21 | + | throw("Match error") | |
22 | + | } | |
23 | + | } | |
28 | 24 | ||
29 | 25 | ||
30 | 26 | func mustManager (i) = { | |
44 | 40 | } | |
45 | 41 | ||
46 | 42 | ||
47 | - | @Callable(i) | |
48 | - | func setManager (pendingManagerPublicKey) = { | |
49 | - | let checkCaller = mustManager(i) | |
50 | - | if ((checkCaller == checkCaller)) | |
51 | - | then { | |
52 | - | let checkManagerPublicKey = fromBase58String(pendingManagerPublicKey) | |
53 | - | if ((checkManagerPublicKey == checkManagerPublicKey)) | |
54 | - | then [StringEntry(keyPendingManagerPublicKey(), pendingManagerPublicKey)] | |
55 | - | else throw("Strict value is not equal to itself.") | |
56 | - | } | |
57 | - | else throw("Strict value is not equal to itself.") | |
58 | - | } | |
59 | - | ||
60 | - | ||
61 | - | ||
62 | - | @Callable(i) | |
63 | - | func confirmManager () = { | |
64 | - | let pm = pendingManagerPublicKeyOrUnit() | |
65 | - | let hasPM = if (isDefined(pm)) | |
66 | - | then true | |
67 | - | else throw("No pending manager") | |
68 | - | if ((hasPM == hasPM)) | |
69 | - | then { | |
70 | - | let checkPM = if ((i.callerPublicKey == value(pm))) | |
71 | - | then true | |
72 | - | else throw("You are not pending manager") | |
73 | - | if ((checkPM == checkPM)) | |
74 | - | then [StringEntry(keyManagerPublicKey(), toBase58String(value(pm))), DeleteEntry(keyPendingManagerPublicKey())] | |
75 | - | else throw("Strict value is not equal to itself.") | |
76 | - | } | |
77 | - | else throw("Strict value is not equal to itself.") | |
78 | - | } | |
79 | - | ||
80 | 43 | ||
81 | 44 | @Verifier(tx) | |
82 | 45 | func verify () = { |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | func keyManagerPublicKey () = "%s__managerPublicKey" | |
5 | 5 | ||
6 | 6 | ||
7 | - | func | |
7 | + | func keyManagerVaultAddress () = "%s__managerVaultAddress" | |
8 | 8 | ||
9 | 9 | ||
10 | - | func managerPublicKeyOrUnit () = match getString(keyManagerPublicKey()) { | |
11 | - | case s: String => | |
12 | - | fromBase58String(s) | |
13 | - | case _: Unit => | |
14 | - | unit | |
15 | - | case _ => | |
16 | - | throw("Match error") | |
17 | - | } | |
10 | + | func getManagerAddressOrFail () = addressFromStringValue(getStringValue(keyManagerVaultAddress())) | |
18 | 11 | ||
19 | 12 | ||
20 | - | func pendingManagerPublicKeyOrUnit () = match getString(keyPendingManagerPublicKey()) { | |
21 | - | case s: String => | |
22 | - | fromBase58String(s) | |
23 | - | case _: Unit => | |
24 | - | unit | |
25 | - | case _ => | |
26 | - | throw("Match error") | |
27 | - | } | |
13 | + | func managerPublicKeyOrUnit () = { | |
14 | + | let managerVaultAddress = getManagerAddressOrFail() | |
15 | + | match getString(managerVaultAddress, keyManagerPublicKey()) { | |
16 | + | case s: String => | |
17 | + | fromBase58String(s) | |
18 | + | case _: Unit => | |
19 | + | unit | |
20 | + | case _ => | |
21 | + | throw("Match error") | |
22 | + | } | |
23 | + | } | |
28 | 24 | ||
29 | 25 | ||
30 | 26 | func mustManager (i) = { | |
31 | 27 | let pd = throw("Permission denied") | |
32 | 28 | match managerPublicKeyOrUnit() { | |
33 | 29 | case pk: ByteVector => | |
34 | 30 | if ((i.callerPublicKey == pk)) | |
35 | 31 | then true | |
36 | 32 | else pd | |
37 | 33 | case _: Unit => | |
38 | 34 | if ((i.caller == this)) | |
39 | 35 | then true | |
40 | 36 | else pd | |
41 | 37 | case _ => | |
42 | 38 | throw("Match error") | |
43 | 39 | } | |
44 | 40 | } | |
45 | 41 | ||
46 | 42 | ||
47 | - | @Callable(i) | |
48 | - | func setManager (pendingManagerPublicKey) = { | |
49 | - | let checkCaller = mustManager(i) | |
50 | - | if ((checkCaller == checkCaller)) | |
51 | - | then { | |
52 | - | let checkManagerPublicKey = fromBase58String(pendingManagerPublicKey) | |
53 | - | if ((checkManagerPublicKey == checkManagerPublicKey)) | |
54 | - | then [StringEntry(keyPendingManagerPublicKey(), pendingManagerPublicKey)] | |
55 | - | else throw("Strict value is not equal to itself.") | |
56 | - | } | |
57 | - | else throw("Strict value is not equal to itself.") | |
58 | - | } | |
59 | - | ||
60 | - | ||
61 | - | ||
62 | - | @Callable(i) | |
63 | - | func confirmManager () = { | |
64 | - | let pm = pendingManagerPublicKeyOrUnit() | |
65 | - | let hasPM = if (isDefined(pm)) | |
66 | - | then true | |
67 | - | else throw("No pending manager") | |
68 | - | if ((hasPM == hasPM)) | |
69 | - | then { | |
70 | - | let checkPM = if ((i.callerPublicKey == value(pm))) | |
71 | - | then true | |
72 | - | else throw("You are not pending manager") | |
73 | - | if ((checkPM == checkPM)) | |
74 | - | then [StringEntry(keyManagerPublicKey(), toBase58String(value(pm))), DeleteEntry(keyPendingManagerPublicKey())] | |
75 | - | else throw("Strict value is not equal to itself.") | |
76 | - | } | |
77 | - | else throw("Strict value is not equal to itself.") | |
78 | - | } | |
79 | - | ||
80 | 43 | ||
81 | 44 | @Verifier(tx) | |
82 | 45 | func verify () = { | |
83 | 46 | let targetPublicKey = match managerPublicKeyOrUnit() { | |
84 | 47 | case pk: ByteVector => | |
85 | 48 | pk | |
86 | 49 | case _: Unit => | |
87 | 50 | tx.senderPublicKey | |
88 | 51 | case _ => | |
89 | 52 | throw("Match error") | |
90 | 53 | } | |
91 | 54 | sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey) | |
92 | 55 | } | |
93 | 56 |
github/deemru/w8io/169f3d6 53.29 ms ◑