tx · CKFaq8MYYZEh9dntNJW931hQFBQhaGomjhZQhxuADrLU 3MsmgWBZKrHwbVbSQiqmStRiFyg5hkfxxa2: -0.00400000 Waves 2022.09.20 12:12 [2237269] smart account 3MsmgWBZKrHwbVbSQiqmStRiFyg5hkfxxa2 > SELF 0.00000000 Waves
{ "type": 13, "id": "CKFaq8MYYZEh9dntNJW931hQFBQhaGomjhZQhxuADrLU", "fee": 400000, "feeAssetId": null, "timestamp": 1663665213960, "version": 2, "chainId": 84, "sender": "3MsmgWBZKrHwbVbSQiqmStRiFyg5hkfxxa2", "senderPublicKey": "9TejtrnvgE7MvzMR4DcLbf3dqUzovyt4BKEmCsqha2z", "proofs": [ "2Pa4hDGa5haM826F14ZdwqJSL5connDGKjWoHH8PgkZ5uazxMzp6HQhsQtrL3zYjiJSikgMAmqEpysVdbMZH5ZeA" ], "script": "base64:AAIFAAAAAAAAAAcIAhIDCgEIAAAACQAAAAAJaGVpZ2h0RW5kCQEAAAATdmFsdWVPckVycm9yTWVzc2FnZQAAAAIJAAQaAAAAAgUAAAAEdGhpcwIAAAAKaGVpZ2h0X2VuZAIAAAAkaGVpZ2h0X2VuZCBpcyBub3Qgc3BlY2lmaWVkIGluIHN0YXRlAAAAAAxhc3NldHNTdHJpbmcJAQAAABN2YWx1ZU9yRXJyb3JNZXNzYWdlAAAAAgkABB0AAAACBQAAAAR0aGlzAgAAABBhdmFpbGFibGVfYXNzZXRzAgAAACVBc3NldHMgbGlzdCBpcyBub3Qgc3BlY2lmaWVkIGluIHN0YXRlAQAAAAlhc0FueUxpc3QAAAABAAAAA3ZhbAQAAAAHJG1hdGNoMAUAAAADdmFsAwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAAlMaXN0W0FueV0EAAAACnZhbEFueUx5c3QFAAAAByRtYXRjaDAFAAAACnZhbEFueUx5c3QJAAACAAAAAQIAAAAbZmFpbCB0byBjYXN0IGludG8gTGlzdFtBbnldAQAAAAVhc0ludAAAAAEAAAADdmFsBAAAAAck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q2hvaWNlS0VZCQAAZQAAAAIJAABkAAAAAgUAAAAWbmV3VG90YWxCeUNob2ljZUFtb3VudAUAAAASbmV3VXNlclZvdGluZ1Bvd2VyBQAAABNwcmV2VXNlclZvdGluZ1Bvd2VyBQAAAANuaWwJAAROAAAAAgUAAAAEZGF0YQUAAAANcmVmcmVzaFRvdGFscwQAAAAFaWR4ZXMJAARMAAAAAgAAAAAAAAAAAAkABEwAAAACAAAAAAAAAAABBQAAAANuaWwJAAROAAAAAgoAAAAAAiRsBQAAAAVpZHhlcwoAAAAAAiRzCQABkAAAAAEFAAAAAiRsCgAAAAAFJGFjYzAFAAAAA25pbAoBAAAABSRmMF8xAAAAAgAAAAIkYQAAAAIkaQMJAABnAAAAAgUAAAACJGkFAAAAAiRzBQAAAAIkYQkBAAAADHJlZnJlc2hWb3RlcwAAAAIFAAAAAiRhCQABkQAAAAIFAAAAAiRsBQAAAAIkaQoBAAAABSRmMF8yAAAAAgAAAAIkYQAAAAIkaQMJAABnAAAAAgUAAAACJGkFAAAAAiRzBQAAAAIkYQkAAAIAAAABAgAAABNMaXN0IHNpemUgZXhjZWVkcyAyCQEAAAAFJGYwXzIAAAACCQEAAAAFJGYwXzEAAAACCQEAAAAFJGYwXzEAAAACBQAAAAUkYWNjMAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAgkABEwAAAACCQEAAAAMSW50ZWdlckVudHJ5AAAAAgUAAAAWcHJldlVzZXJWb3RpbmdQb3dlcktFWQUAAAASbmV3VXNlclZvdGluZ1Bvd2VyCQAETAAAAAIJAQAAAAtTdHJpbmdFbnRyeQAAAAIFAAAAEXByZXZVc2VyQ2hvaWNlS0VZBQAAABZuZXdVc2VyU2VsZWN0ZWRPcHRpb25zBQAAAANuaWwAAAAAJ2HzXg==", "height": 2237269, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 6senFtP8RRHEmvH8sC2hgR5bQV8y9EENEWihz3dTXnYa Next: none Full:
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let a = valueOrErrorMessage(getInteger(this, "height_end"), "height_end is not specified in state") | |
5 | 5 | ||
6 | 6 | let b = valueOrErrorMessage(getString(this, "available_assets"), "Assets list is not specified in state") | |
7 | 7 | ||
8 | 8 | func c (d) = { | |
9 | 9 | let e = d | |
10 | 10 | if ($isInstanceOf(e, "List[Any]")) | |
11 | 11 | then { | |
12 | 12 | let f = e | |
13 | 13 | f | |
14 | 14 | } | |
15 | 15 | else throw("fail to cast into List[Any]") | |
16 | 16 | } | |
17 | 17 | ||
18 | 18 | ||
19 | 19 | func g (d) = { | |
20 | 20 | let e = d | |
21 | 21 | if ($isInstanceOf(e, "Int")) | |
22 | 22 | then { | |
23 | 23 | let h = e | |
24 | 24 | h | |
25 | 25 | } | |
26 | 26 | else throw("fail to cast into Int") | |
27 | 27 | } | |
28 | 28 | ||
29 | 29 | ||
30 | 30 | let i = Address(base58'3MuGfNhF98CNBCfthhoJEo6SYUv7zTgkK4J') | |
31 | 31 | ||
32 | 32 | let j = split(b, ",") | |
33 | 33 | ||
34 | 34 | func k (l) = makeString(["balance", toString(l)], "_") | |
35 | 35 | ||
36 | 36 | ||
37 | 37 | func m (l) = makeString(["votingPower", l], "_") | |
38 | 38 | ||
39 | 39 | ||
40 | 40 | func n (l) = makeString(["last_vote", l], "_") | |
41 | 41 | ||
42 | 42 | ||
43 | 43 | @Callable(o) | |
44 | 44 | func castVote (p) = { | |
45 | 45 | let q = toString(o.caller) | |
46 | 46 | if ((containsElement(j, p) == false)) | |
47 | 47 | then throw("Incorrect vote!") | |
48 | 48 | else if ((height >= a)) | |
49 | 49 | then throw("vote finished") | |
50 | 50 | else { | |
51 | 51 | let r = c(invoke(i, "nsbtStakingSYSREADONLY", [q, 0], nil)) | |
52 | 52 | let s = g(r[0]) | |
53 | 53 | let t = split(p, ":") | |
54 | 54 | let u = n(q) | |
55 | 55 | let v = valueOrElse(getString(this, u), p) | |
56 | 56 | let w = split(v, ":") | |
57 | 57 | let x = m(q) | |
58 | 58 | let y = valueOrElse(getInteger(this, x), 0) | |
59 | 59 | func z (A,B) = { | |
60 | 60 | let C = t[B] | |
61 | 61 | let D = w[B] | |
62 | 62 | let E = makeString(["vote", C], "_") | |
63 | 63 | let F = valueOrElse(getInteger(this, E), 0) | |
64 | 64 | let G = makeString(["vote", D], "_") | |
65 | 65 | let H = valueOrElse(getInteger(this, G), 0) | |
66 | 66 | let I = if ((C != D)) | |
67 | 67 | then [IntegerEntry(G, (H - y)), IntegerEntry(E, (F + s))] | |
68 | 68 | else [IntegerEntry(E, ((F + s) - y))] | |
69 | 69 | (A ++ I) | |
70 | 70 | } | |
71 | 71 | ||
72 | 72 | let J = [0, 1] | |
73 | 73 | ({ | |
74 | 74 | let K = J | |
75 | 75 | let L = size(K) | |
76 | 76 | let M = nil | |
77 | 77 | func N (O,P) = if ((P >= L)) | |
78 | 78 | then O | |
79 | 79 | else z(O, K[P]) | |
80 | 80 | ||
81 | 81 | func Q (O,P) = if ((P >= L)) | |
82 | 82 | then O | |
83 | 83 | else throw("List size exceeds 2") | |
84 | 84 | ||
85 | 85 | Q(N(N(M, 0), 1), 2) | |
86 | 86 | } ++ [IntegerEntry(x, s), StringEntry(u, p)]) | |
87 | 87 | } | |
88 | 88 | } | |
89 | 89 | ||
90 | 90 |
github/deemru/w8io/169f3d6 43.60 ms ◑