tx · EXzUheFWnL8SopRFx29XiqEfy5YWeJ73AR8HJ6GjAqMV 3MsmgWBZKrHwbVbSQiqmStRiFyg5hkfxxa2: -0.00300000 Waves 2022.08.17 11:20 [2188222] smart account 3MsmgWBZKrHwbVbSQiqmStRiFyg5hkfxxa2 > SELF 0.00000000 Waves
{ "type": 13, "id": "EXzUheFWnL8SopRFx29XiqEfy5YWeJ73AR8HJ6GjAqMV", "fee": 300000, "feeAssetId": null, "timestamp": 1660724359821, "version": 2, "chainId": 84, "sender": "3MsmgWBZKrHwbVbSQiqmStRiFyg5hkfxxa2", "senderPublicKey": "9TejtrnvgE7MvzMR4DcLbf3dqUzovyt4BKEmCsqha2z", "proofs": [ "3BmDBNZxwLACGx7NKWHXgQac4s8uZmtH8wBPjkJDff8hHXRttFowKafZxGafC4D8KL8J9WyrHGCovMDmsfMGkJsm" ], "script": "base64:AAIFAAAAAAAAAAcIAhIDCgEIAAAACQAAAAAJaGVpZ2h0RW5kCQEAAAATdmFsdWVPckVycm9yTWVzc2FnZQAAAAIJAAQaAAAAAgUAAAAEdGhpcwIAAAAKaGVpZ2h0X2VuZAIAAAAkaGVpZ2h0X2VuZCBpcyBub3Qgc3BlY2lmaWVkIGluIHN0YXRlAAAAAAxhc3NldHNTdHJpbmcJAQAAABN2YWx1ZU9yRXJyb3JNZXNzYWdlAAAAAgkABB0AAAACBQAAAAR0aGlzAgAAABBhdmFpbGFibGVfYXNzZXRzAgAAACVBc3NldHMgbGlzdCBpcyBub3Qgc3BlY2lmaWVkIGluIHN0YXRlAQAAAAlhc0FueUxpc3QAAAABAAAAA3ZhbAQAAAAHJG1hdGNoMAUAAAADdmFsAwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAAlMaXN0W0FueV0EAAAACnZhbEFueUx5c3QFAAAAByRtYXRjaDAFAAAACnZhbEFueUx5c3QJAAACAAAAAQIAAAAbZmFpbCB0byBjYXN0IGludG8gTGlzdFtBbnldAQAAAAVhc0ludAAAAAEAAAADdmFsBAA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JLRVkFAAAAEm5ld1VzZXJWb3RpbmdQb3dlcgkABEwAAAACCQEAAAALU3RyaW5nRW50cnkAAAACBQAAABFwcmV2VXNlckNob2ljZUtFWQUAAAANbmV3VXNlckNob2ljZQUAAAADbmlsAAAAAGbnIx0=", "height": 2188222, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 8DhSBHjrM1Ce9718nfVUbWj3hWfGMS51SQ5VoBUpZVHT Next: 313i8e9KiMVPaArpQ9HjvgdzfDhzDqFi9zEKs52w8pJh 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,n) = makeString(["vote", l, n], "_") | |
38 | 38 | ||
39 | 39 | ||
40 | 40 | func o (l) = makeString(["last_vote", l], "_") | |
41 | 41 | ||
42 | 42 | ||
43 | 43 | @Callable(p) | |
44 | 44 | func castVote (q) = { | |
45 | 45 | let r = toString(p.caller) | |
46 | 46 | if ((containsElement(j, q) == 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 s = c(invoke(i, "nsbtStakingSYSREADONLY", [r, 0], nil)) | |
52 | 52 | let t = g(s[0]) | |
53 | 53 | let u = makeString(["vote", q], "_") | |
54 | 54 | let v = valueOrElse(getInteger(this, u), 0) | |
55 | 55 | let w = m(r, q) | |
56 | 56 | let x = o(r) | |
57 | 57 | let y = valueOrElse(getString(this, x), q) | |
58 | 58 | let z = m(r, y) | |
59 | 59 | let A = valueOrElse(getInteger(this, z), 0) | |
60 | 60 | let B = makeString(["vote", y], "_") | |
61 | 61 | let C = valueOrElse(getInteger(this, B), 0) | |
62 | 62 | let D = if ((y != q)) | |
63 | 63 | then [IntegerEntry(z, 0), IntegerEntry(B, (C - A)), IntegerEntry(u, (v + t))] | |
64 | 64 | else [IntegerEntry(u, ((v + t) - A))] | |
65 | 65 | (D ++ [IntegerEntry(w, t), StringEntry(x, q)]) | |
66 | 66 | } | |
67 | 67 | } | |
68 | 68 | ||
69 | 69 |
github/deemru/w8io/026f985 24.58 ms ◑