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