tx · HGVsn258rfxA8seVSbvpQdmcbTrcvhDYBedQvU21WKB3 3MvpDsY9CjerWo5Kgqv1rGKiEKGqbNFx4tN: -0.60000000 Waves 2022.11.15 18:46 [2318433] smart account 3MvpDsY9CjerWo5Kgqv1rGKiEKGqbNFx4tN > SELF 0.00000000 Waves
{ "type": 13, "id": "HGVsn258rfxA8seVSbvpQdmcbTrcvhDYBedQvU21WKB3", "fee": 60000000, "feeAssetId": null, "timestamp": 1668527202895, "version": 2, "chainId": 84, "sender": "3MvpDsY9CjerWo5Kgqv1rGKiEKGqbNFx4tN", "senderPublicKey": "GnmxfAKepnP5zxDDgiYa3CfGbzwgVoKQ1zjTygZ8f6FS", "proofs": [ "4u1WK2E3AFMkZrU3CD2AFBp3QczP8PrthqADVDsgvuV9x9UoT19R2NsxdXzfWz9Vp8vSorGyNpeBG3cwpAd6C58Y" ], "script": "base64:AAIFAAAAAAAAAAkIAhIDCgEIEgAAAAAEAQAAABNrZXlNYW5hZ2VyUHVibGljS2V5AAAAAAkABCIAAAABAgAAABBtYW5hZ2VyUHVibGljS2V5AQAAABZtYW5hZ2VyUHVibGljS2V5T3JVbml0AAAAAAQAAAAHJG1hdGNoMAkBAAAAE2tleU1hbmFnZXJQdWJsaWNLZXkAAAAAAwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAAZTdHJpbmcEAAAAAXMFAAAAByRtYXRjaDAJAAJZAAAAAQUAAAABcwMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAEVW5pdAUAAAAEdW5pdAkAAAIAAAABAgAAAAtNYXRjaCBlcnJvcgEAAAALbXVzdE1hbmFnZXIAAAABAAAAAWkEAAAAAnBkCQAAAgAAAAECAAAAEXBlcm1pc3Npb24gZGVuaWVkBAAAAAckbWF0Y2gwCQEAAAAWbWFuYWdlclB1YmxpY0tleU9yVW5pdAAAAAADCQAAAQAAAAIFAAAAByRtYXRjaDACAAAACkJ5dGVWZWN0b3IEAAAAAnBrBQAAAAckbWF0Y2gwAwkA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AAR0aGlzAAAAB3JlZ3VsYXIDCQEAAAACIT0AAAACCAUAAAABaQAAAAZjYWxsZXIFAAAAC21haW5BZGRyZXNzCQAAAgAAAAECAAAAKU9ubHkgbWFpbiBjb250cmFjdCBjYW4gaW52b2tlIHRoaXMgbWV0aG9kCQAETAAAAAIJAQAAAA5TY3JpcHRUcmFuc2ZlcgAAAAMFAAAAC21haW5BZGRyZXNzBQAAAA5yZWd1bGFyQmFsYW5jZQUAAAAEdW5pdAUAAAADbmlsAAAAAQAAAAJ0eAEAAAAGdmVyaWZ5AAAAAAkAAfQAAAADCAUAAAACdHgAAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAAJ0eAAAAAZwcm9vZnMAAAAAAAAAAAAIBQAAAAJ0eAAAAA9zZW5kZXJQdWJsaWNLZXlZx2US", "height": 2318433, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: none Next: none Full:
Old | New | Differences | |
---|---|---|---|
1 | - | # no script | |
1 | + | {-# STDLIB_VERSION 5 #-} | |
2 | + | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | + | {-# CONTENT_TYPE DAPP #-} | |
4 | + | func keyManagerPublicKey () = getString("managerPublicKey") | |
5 | + | ||
6 | + | ||
7 | + | func managerPublicKeyOrUnit () = match keyManagerPublicKey() { | |
8 | + | case s: String => | |
9 | + | fromBase58String(s) | |
10 | + | case _: Unit => | |
11 | + | unit | |
12 | + | case _ => | |
13 | + | throw("Match error") | |
14 | + | } | |
15 | + | ||
16 | + | ||
17 | + | func mustManager (i) = { | |
18 | + | let pd = throw("permission denied") | |
19 | + | match managerPublicKeyOrUnit() { | |
20 | + | case pk: ByteVector => | |
21 | + | if ((i.callerPublicKey == pk)) | |
22 | + | then true | |
23 | + | else pd | |
24 | + | case _: Unit => | |
25 | + | if ((i.caller == this)) | |
26 | + | then true | |
27 | + | else pd | |
28 | + | case _ => | |
29 | + | throw("Match error") | |
30 | + | } | |
31 | + | } | |
32 | + | ||
33 | + | ||
34 | + | func mustNotInited () = match getBoolean("inited") { | |
35 | + | case inited: Boolean => | |
36 | + | if ((inited == false)) | |
37 | + | then true | |
38 | + | else throw("Already inited") | |
39 | + | case _: Unit => | |
40 | + | false | |
41 | + | case _ => | |
42 | + | throw("Match error") | |
43 | + | } | |
44 | + | ||
45 | + | ||
46 | + | @Callable(i) | |
47 | + | func init (mainAddress) = { | |
48 | + | let checks = [mustManager(i), mustNotInited()] | |
49 | + | if ((checks == checks)) | |
50 | + | then [BooleanEntry("inited", true), StringEntry("mainAddress", mainAddress)] | |
51 | + | else throw("Strict value is not equal to itself.") | |
52 | + | } | |
53 | + | ||
54 | + | ||
55 | + | ||
56 | + | @Callable(i) | |
57 | + | func withdraw () = { | |
58 | + | let mainAddress = Address(fromBase58String(getStringValue("mainAddress"))) | |
59 | + | let regularBalance = wavesBalance(this).regular | |
60 | + | if ((i.caller != mainAddress)) | |
61 | + | then throw("Only main contract can invoke this method") | |
62 | + | else [ScriptTransfer(mainAddress, regularBalance, unit)] | |
63 | + | } | |
64 | + | ||
65 | + | ||
66 | + | @Verifier(tx) | |
67 | + | func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
68 | + |
github/deemru/w8io/169f3d6 18.48 ms ◑