tx · 4YnrcPnzv6f9Cwxr6fYsn5oUa7PjqQrJoRbDZFYz3F4t 3MwCoAS5bvfAqbHYxLYWEw3brqeo6SeoB7B: -0.01400000 Waves 2022.04.11 15:46 [2003950] smart account 3MwCoAS5bvfAqbHYxLYWEw3brqeo6SeoB7B > SELF 0.00000000 Waves
{ "type": 13, "id": "4YnrcPnzv6f9Cwxr6fYsn5oUa7PjqQrJoRbDZFYz3F4t", "fee": 1400000, "feeAssetId": null, "timestamp": 1649681248229, "version": 1, "sender": "3MwCoAS5bvfAqbHYxLYWEw3brqeo6SeoB7B", "senderPublicKey": "5WJHJ8krgJY8GZvHds2k2fCTXmaYgW3NCnj2ifYZEhVV", "proofs": [ "365HKa6nAunUV1YxyQkkADVvwJMg3SU1rJ42tKdvkPw3gqjJUNXJpXFKmuxsy45dB2SJPMabojqjAs4PNxE69RD8" ], "script": "base64:AAIFAAAAAAAAAAkIAhIDCgEIEgAAAAAFAQAAABNrZXlNYW5hZ2VyUHVibGljS2V5AAAAAAIAAAAUJXNfX21hbmFnZXJQdWJsaWNLZXkBAAAAGmtleVBlbmRpbmdNYW5hZ2VyUHVibGljS2V5AAAAAAIAAAAbJXNfX3BlbmRpbmdNYW5hZ2VyUHVibGljS2V5AQAAABZtYW5hZ2VyUHVibGljS2V5T3JVbml0AAAAAAQAAAAHJG1hdGNoMAkABCIAAAABCQEAAAATa2V5TWFuYWdlclB1YmxpY0tleQAAAAADCQAAAQAAAAIFAAAAByRtYXRjaDACAAAABlN0cmluZwQAAAABcwUAAAAHJG1hdGNoMAkAAlkAAAABBQAAAAFzAwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAARVbml0BQAAAAR1bml0CQAAAgAAAAECAAAAC01hdGNoIGVycm9yAQAAAB1wZW5kaW5nTWFuYWdlclB1YmxpY0tleU9yVW5pdAAAAAAEAAAAByRtYXRjaDAJAAQiAAAAAQkBAAAAGmtleVBlbmRpbmdNYW5hZ2VyUHVibGljS2V5AAAAAAMJAAABAAAAA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AAACcGsDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAABFVuaXQIBQAAAAJ0eAAAAA9zZW5kZXJQdWJsaWNLZXkJAAACAAAAAQIAAAALTWF0Y2ggZXJyb3IJAAH0AAAAAwgFAAAAAnR4AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACdHgAAAAGcHJvb2ZzAAAAAAAAAAAABQAAAA90YXJnZXRQdWJsaWNLZXmq8YBh", "chainId": 84, "height": 2003950, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: none Next: A9zziW6CT9DBA2A94fgjUETGwzxHFd57u2FZu4GEBiEf Full:
Old | New | Differences | |
---|---|---|---|
1 | - | # no script | |
1 | + | {-# STDLIB_VERSION 5 #-} | |
2 | + | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | + | {-# CONTENT_TYPE DAPP #-} | |
4 | + | func keyManagerPublicKey () = "%s__managerPublicKey" | |
5 | + | ||
6 | + | ||
7 | + | func keyPendingManagerPublicKey () = "%s__pendingManagerPublicKey" | |
8 | + | ||
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 | + | } | |
18 | + | ||
19 | + | ||
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 | + | } | |
28 | + | ||
29 | + | ||
30 | + | func mustManager (i) = { | |
31 | + | let pd = throw("Permission denied") | |
32 | + | match managerPublicKeyOrUnit() { | |
33 | + | case pk: ByteVector => | |
34 | + | if ((i.callerPublicKey == pk)) | |
35 | + | then true | |
36 | + | else pd | |
37 | + | case _: Unit => | |
38 | + | if ((i.caller == this)) | |
39 | + | then true | |
40 | + | else pd | |
41 | + | case _ => | |
42 | + | throw("Match error") | |
43 | + | } | |
44 | + | } | |
45 | + | ||
46 | + | ||
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 | + | ||
81 | + | @Verifier(tx) | |
82 | + | func verify () = { | |
83 | + | let targetPublicKey = match managerPublicKeyOrUnit() { | |
84 | + | case pk: ByteVector => | |
85 | + | pk | |
86 | + | case _: Unit => | |
87 | + | tx.senderPublicKey | |
88 | + | case _ => | |
89 | + | throw("Match error") | |
90 | + | } | |
91 | + | sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey) | |
92 | + | } | |
93 | + |
github/deemru/w8io/169f3d6 15.34 ms ◑