tx · FaNMkWeVzAskzZKACwB6iXYqvharbCJay8kvNsqVbnkg 3MwCoAS5bvfAqbHYxLYWEw3brqeo6SeoB7B: -0.01400000 Waves 2022.04.11 16:00 [2003964] smart account 3MwCoAS5bvfAqbHYxLYWEw3brqeo6SeoB7B > SELF 0.00000000 Waves
{ "type": 13, "id": "FaNMkWeVzAskzZKACwB6iXYqvharbCJay8kvNsqVbnkg", "fee": 1400000, "feeAssetId": null, "timestamp": 1649682059259, "version": 1, "sender": "3MwCoAS5bvfAqbHYxLYWEw3brqeo6SeoB7B", "senderPublicKey": "5WJHJ8krgJY8GZvHds2k2fCTXmaYgW3NCnj2ifYZEhVV", "proofs": [ "27V9M73mNfiG3399Cn1Kyq5UaWtUMJBsUoHVZmJWhj7bhovBo2th7UngEXx4Vc4mj66nRqWsX9yeQxq7pei5gc2g" ], "script": "base64:AAIFAAAAAAAAAAkIAhIDCgEIEgAAAAAFAQAAABNrZXlNYW5hZ2VyUHVibGljS2V5AAAAAAIAAAAUJXNfX21hbmFnZXJQdWJsaWNLZXkBAAAAGmtleVBlbmRpbmdNYW5hZ2VyUHVibGljS2V5AAAAAAIAAAAbJXNfX3BlbmRpbmdNYW5hZ2VyUHVibGljS2V5AQAAABZtYW5hZ2VyUHVibGljS2V5T3JVbml0AAAAAAQAAAAHJG1hdGNoMAkABCIAAAABCQEAAAATa2V5TWFuYWdlclB1YmxpY0tleQAAAAADCQAAAQAAAAIFAAAAByRtYXRjaDACAAAABlN0cmluZwQAAAABcwUAAAAHJG1hdGNoMAkAAlkAAAABBQAAAAFzAwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAARVbml0BQAAAAR1bml0CQAAAgAAAAECAAAAC01hdGNoIGVycm9yAQAAAB1wZW5kaW5nTWFuYWdlclB1YmxpY0tleU9yVW5pdAAAAAAEAAAAByRtYXRjaDAJAAQiAAAAAQkBAAAAGmtleVBlbmRpbmdNYW5hZ2VyUHVibGljS2V5AAAAAAMJAAABAAAAAgUAAAAHJG1h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AQAAAAIFAAAAByRtYXRjaDACAAAABFVuaXQIBQAAAAJ0eAAAAA9zZW5kZXJQdWJsaWNLZXkJAAACAAAAAQIAAAALTWF0Y2ggZXJyb3IJAAH0AAAAAwgFAAAAAnR4AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACdHgAAAAGcHJvb2ZzAAAAAAAAAAAABQAAAA90YXJnZXRQdWJsaWNLZXmq8YBh", "chainId": 84, "height": 2003964, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: FByajLwuZZed7QksQzHzogJvrqGg3SzHDTkKwdaMb5yW Next: none Full:
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 | 7 | func keyPendingManagerPublicKey () = "%s__pendingManagerPublicKey" | |
8 | 8 | ||
9 | 9 | ||
10 | 10 | func managerPublicKeyOrUnit () = match getString(keyManagerPublicKey()) { | |
11 | 11 | case s: String => | |
12 | 12 | fromBase58String(s) | |
13 | 13 | case _: Unit => | |
14 | 14 | unit | |
15 | 15 | case _ => | |
16 | 16 | throw("Match error") | |
17 | 17 | } | |
18 | 18 | ||
19 | 19 | ||
20 | 20 | func pendingManagerPublicKeyOrUnit () = match getString(keyPendingManagerPublicKey()) { | |
21 | 21 | case s: String => | |
22 | 22 | fromBase58String(s) | |
23 | 23 | case _: Unit => | |
24 | 24 | unit | |
25 | 25 | case _ => | |
26 | 26 | throw("Match error") | |
27 | 27 | } | |
28 | 28 | ||
29 | 29 | ||
30 | 30 | func mustManager (i) = { | |
31 | 31 | let pd = throw("Permission denied") | |
32 | 32 | match managerPublicKeyOrUnit() { | |
33 | 33 | case pk: ByteVector => | |
34 | 34 | if ((i.callerPublicKey == pk)) | |
35 | 35 | then true | |
36 | 36 | else pd | |
37 | 37 | case _: Unit => | |
38 | 38 | if ((i.caller == this)) | |
39 | 39 | then true | |
40 | 40 | else pd | |
41 | 41 | case _ => | |
42 | 42 | throw("Match error") | |
43 | 43 | } | |
44 | 44 | } | |
45 | 45 | ||
46 | 46 | ||
47 | 47 | @Callable(i) | |
48 | 48 | func setManager (pendingManagerPublicKey) = { | |
49 | 49 | let checkCaller = mustManager(i) | |
50 | 50 | if ((checkCaller == checkCaller)) | |
51 | 51 | then { | |
52 | 52 | let checkManagerPublicKey = fromBase58String(pendingManagerPublicKey) | |
53 | 53 | if ((checkManagerPublicKey == checkManagerPublicKey)) | |
54 | 54 | then [StringEntry(keyPendingManagerPublicKey(), pendingManagerPublicKey)] | |
55 | 55 | else throw("Strict value is not equal to itself.") | |
56 | 56 | } | |
57 | 57 | else throw("Strict value is not equal to itself.") | |
58 | 58 | } | |
59 | 59 | ||
60 | 60 | ||
61 | 61 | ||
62 | 62 | @Callable(i) | |
63 | 63 | func confirmManager () = { | |
64 | 64 | let pm = pendingManagerPublicKeyOrUnit() | |
65 | 65 | let hasPM = if (isDefined(pm)) | |
66 | 66 | then true | |
67 | 67 | else throw("No pending manager") | |
68 | 68 | if ((hasPM == hasPM)) | |
69 | 69 | then { | |
70 | 70 | let checkPM = if ((i.callerPublicKey == value(pm))) | |
71 | 71 | then true | |
72 | 72 | else throw("You are not pending manager") | |
73 | 73 | if ((checkPM == checkPM)) | |
74 | 74 | then [StringEntry(keyManagerPublicKey(), toBase58String(value(pm))), DeleteEntry(keyPendingManagerPublicKey())] | |
75 | 75 | else throw("Strict value is not equal to itself.") | |
76 | 76 | } | |
77 | 77 | else throw("Strict value is not equal to itself.") | |
78 | 78 | } | |
79 | 79 | ||
80 | 80 | ||
81 | 81 | @Verifier(tx) | |
82 | 82 | func verify () = { | |
83 | 83 | let targetPublicKey = match managerPublicKeyOrUnit() { | |
84 | 84 | case pk: ByteVector => | |
85 | 85 | pk | |
86 | 86 | case _: Unit => | |
87 | 87 | tx.senderPublicKey | |
88 | 88 | case _ => | |
89 | 89 | throw("Match error") | |
90 | 90 | } | |
91 | 91 | sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey) | |
92 | 92 | } | |
93 | 93 |
github/deemru/w8io/026f985 25.80 ms ◑