tx · FoCc5JC7vFGakoaqxWpwKNm28Pc5QqUbjVoJkZS7rLMa 3N7oHnMaDFKYTEgumQs9mjRESDco6KhQiXW: -0.14000000 Waves 2023.05.10 10:13 [2571472] smart account 3N7oHnMaDFKYTEgumQs9mjRESDco6KhQiXW > SELF 0.00000000 Waves
{ "type": 13, "id": "FoCc5JC7vFGakoaqxWpwKNm28Pc5QqUbjVoJkZS7rLMa", "fee": 14000000, "feeAssetId": null, "timestamp": 1683702869290, "version": 2, "chainId": 84, "sender": "3N7oHnMaDFKYTEgumQs9mjRESDco6KhQiXW", "senderPublicKey": "2M6xzJiyT4ZPQhyMEQoo9GUqBsKBtgTD1BaZ8L4PfPVj", "proofs": [ "2mQ97FTVcnzefvEQXubapiR9iXwv3krb8SJjijjPczbqupBzKdVXskGn6736Vo6E1MrZM9ntL6wxHxtjT1L6VpJ1", "2XvWpggi7hSRBrvhUjBXZJZTRgUKJdpNuapr5JUJpkXhEQTXJ1sKTYaRCddua4VKWmS7cGHkgePA4akzNhx23hct" ], "script": "base64:AAIFAAAAAAAAABsIAhIHCgUBAQEICBIDCgEEEgcKBQgICAgIEgAAAAAYAAAAAAxhZG1pblB1YktleTEBAAAAIBQCDFCxss6zrB0AAB1lFGH++bkS6T79aRXaqXigSMwKAAAAAAxhZG1pblB1YktleTIBAAAAIBQCDFCxss6zrB0AAB1lFGH++bkS6T79aRXaqXigSMwKAAAAAAxhZG1pblB1YktleTMBAAAAIBQCDFCxss6zrB0AAB1lFGH++bkS6T79aRXaqXigSMwKAAAAABRhZG1pblB1YktleVN0YXJ0U3RvcAEAAAAgFAIMULGyzrOsHQAAHWUUYf75uRLpPv1pFdqpeKBIzAoAAAAACWtleUFjdGl2ZQIAAAAGYWN0aXZlAAAAAAhrZXlDYXVzZQIAAAAOc2h1dGRvd25fY2F1c2UAAAAAEWtleVVzZXJWT1RFQW1vdW50AgAAAAxfVk9URV9hbW91bnQAAAAAC2tleVVzZXJWT1RFAgAAAAVfVk9URQAAAAAMa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GcHJvb2ZzAAAAAAAAAAACBQAAAAxhZG1pblB1YktleTMAAAAAAAAAAAEAAAAAAAAAAAAJAABnAAAAAgkAAGQAAAACCQAAZAAAAAIFAAAAEmFkbWluUHViS2V5MVNpZ25lZAUAAAASYWRtaW5QdWJLZXkyU2lnbmVkBQAAABJhZG1pblB1YktleTNTaWduZWQAAAAAAAAAAALYZDak", "height": 2571472, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 5ANYqSbiEeMVP56XrTcciXzmVTnvy69D1HbLSL4R6cyC Next: 5yXTmMWxp6VEbRcseuTpBrLZQrVedWciWVuZgHnXECZF Diff:
Old | New | Differences | |
---|---|---|---|
90 | 90 | else false) | |
91 | 91 | then throw("You have already voted. Stake more enno to update voting") | |
92 | 92 | else { | |
93 | - | let O = (I + (if ((H == L)) | |
94 | - | then if (H) | |
95 | - | then M | |
96 | - | else 0 | |
97 | - | else (-1 * K))) | |
98 | - | let P = (J + (if ((L == H)) | |
99 | - | then if (!(H)) | |
100 | - | then M | |
101 | - | else 0 | |
102 | - | else (-1 * K))) | |
93 | + | let O = (I + (if (H) | |
94 | + | then M | |
95 | + | else -(K))) | |
96 | + | let P = (J + (if (!(H)) | |
97 | + | then M | |
98 | + | else -(K))) | |
103 | 99 | [IntegerEntry((((toString(C.caller) + g) + "_") + w), M), BooleanEntry((((toString(C.caller) + h) + "_") + w), H), IntegerEntry((w + m), O), IntegerEntry((w + n), P), IntegerEntry((w + i), (P + O))] | |
104 | 100 | } | |
105 | 101 | } |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let a = base58'2M6xzJiyT4ZPQhyMEQoo9GUqBsKBtgTD1BaZ8L4PfPVj' | |
5 | 5 | ||
6 | 6 | let b = base58'2M6xzJiyT4ZPQhyMEQoo9GUqBsKBtgTD1BaZ8L4PfPVj' | |
7 | 7 | ||
8 | 8 | let c = base58'2M6xzJiyT4ZPQhyMEQoo9GUqBsKBtgTD1BaZ8L4PfPVj' | |
9 | 9 | ||
10 | 10 | let d = base58'2M6xzJiyT4ZPQhyMEQoo9GUqBsKBtgTD1BaZ8L4PfPVj' | |
11 | 11 | ||
12 | 12 | let e = "active" | |
13 | 13 | ||
14 | 14 | let f = "shutdown_cause" | |
15 | 15 | ||
16 | 16 | let g = "_VOTE_amount" | |
17 | 17 | ||
18 | 18 | let h = "_VOTE" | |
19 | 19 | ||
20 | 20 | let i = "_total_VOTE_amount" | |
21 | 21 | ||
22 | 22 | let j = "vote_session" | |
23 | 23 | ||
24 | 24 | let k = "vote_start_height" | |
25 | 25 | ||
26 | 26 | let l = "vote_end_height" | |
27 | 27 | ||
28 | 28 | let m = "_yes_amount" | |
29 | 29 | ||
30 | 30 | let n = "_no_amount" | |
31 | 31 | ||
32 | 32 | let o = "_ENNO_amount" | |
33 | 33 | ||
34 | 34 | let p = "vote_name" | |
35 | 35 | ||
36 | 36 | let q = "vote_description" | |
37 | 37 | ||
38 | 38 | let r = valueOrElse(getBoolean(this, e), true) | |
39 | 39 | ||
40 | 40 | let s = addressFromPublicKey(base58'Ese6jz6mtrhgwJWdXbAxHNHg2qzae5D2xXWuVF7tLfs8') | |
41 | 41 | ||
42 | 42 | func t (u) = valueOrElse(getInteger(s, (toString(u) + o)), 0) | |
43 | 43 | ||
44 | 44 | ||
45 | 45 | func v (u,w) = valueOrElse(getInteger(this, (((toString(u) + g) + "_") + w)), 0) | |
46 | 46 | ||
47 | 47 | ||
48 | 48 | func x (u) = valueOrElse(getBoolean(this, (toString(u) + h)), false) | |
49 | 49 | ||
50 | 50 | ||
51 | 51 | func y (z) = valueOrElse(getInteger(this, z), 0) | |
52 | 52 | ||
53 | 53 | ||
54 | 54 | func A (B) = [BooleanEntry(e, false), StringEntry(f, B)] | |
55 | 55 | ||
56 | 56 | ||
57 | 57 | @Callable(C) | |
58 | 58 | func initVote (w,D,E,F,G) = if (!(r)) | |
59 | 59 | then throw("DApp is inactive at this moment") | |
60 | 60 | else if (!(containsElement([a, b, c, d], C.callerPublicKey))) | |
61 | 61 | then throw("Only admin can call this function") | |
62 | 62 | else [IntegerEntry(j, w), IntegerEntry(((k + "_") + toString(w)), D), IntegerEntry(((l + "_") + toString(w)), E), IntegerEntry((toString(w) + m), 0), IntegerEntry((toString(w) + n), 0), IntegerEntry((toString(w) + i), 0), StringEntry(((p + "_") + toString(w)), F), StringEntry(((q + "_") + toString(w)), G)] | |
63 | 63 | ||
64 | 64 | ||
65 | 65 | ||
66 | 66 | @Callable(C) | |
67 | 67 | func vote (H) = if (!(r)) | |
68 | 68 | then throw("DApp is inactive at this moment") | |
69 | 69 | else { | |
70 | 70 | let w = toString(y(j)) | |
71 | 71 | let D = y(((k + "_") + w)) | |
72 | 72 | let E = y(((l + "_") + w)) | |
73 | 73 | if ((D > height)) | |
74 | 74 | then throw(((("Voting has not started yet. Start: " + toString(D)) + "Height: ") + toString(height))) | |
75 | 75 | else if ((height > E)) | |
76 | 76 | then throw(((("Voting has already ended. End: " + toString(E)) + "Height: ") + toString(height))) | |
77 | 77 | else { | |
78 | 78 | let I = y((w + m)) | |
79 | 79 | let J = y((w + n)) | |
80 | 80 | let K = v(C.caller, w) | |
81 | 81 | let L = if ((K == 0)) | |
82 | 82 | then H | |
83 | 83 | else x(C.caller) | |
84 | 84 | let M = t(C.caller) | |
85 | 85 | let N = M | |
86 | 86 | if ((0 > N)) | |
87 | 87 | then throw("Vote must be more than 0") | |
88 | 88 | else if (if ((H == L)) | |
89 | 89 | then (K == M) | |
90 | 90 | else false) | |
91 | 91 | then throw("You have already voted. Stake more enno to update voting") | |
92 | 92 | else { | |
93 | - | let O = (I + (if ((H == L)) | |
94 | - | then if (H) | |
95 | - | then M | |
96 | - | else 0 | |
97 | - | else (-1 * K))) | |
98 | - | let P = (J + (if ((L == H)) | |
99 | - | then if (!(H)) | |
100 | - | then M | |
101 | - | else 0 | |
102 | - | else (-1 * K))) | |
93 | + | let O = (I + (if (H) | |
94 | + | then M | |
95 | + | else -(K))) | |
96 | + | let P = (J + (if (!(H)) | |
97 | + | then M | |
98 | + | else -(K))) | |
103 | 99 | [IntegerEntry((((toString(C.caller) + g) + "_") + w), M), BooleanEntry((((toString(C.caller) + h) + "_") + w), H), IntegerEntry((w + m), O), IntegerEntry((w + n), P), IntegerEntry((w + i), (P + O))] | |
104 | 100 | } | |
105 | 101 | } | |
106 | 102 | } | |
107 | 103 | ||
108 | 104 | ||
109 | 105 | ||
110 | 106 | @Callable(C) | |
111 | 107 | func deleteData (Q,R,S,T,U) = if (!(containsElement([a, b, c, d], C.callerPublicKey))) | |
112 | 108 | then throw("Only admin can call this function") | |
113 | 109 | else [DeleteEntry(Q), DeleteEntry(R), DeleteEntry(S), DeleteEntry(T), DeleteEntry(U)] | |
114 | 110 | ||
115 | 111 | ||
116 | 112 | ||
117 | 113 | @Callable(C) | |
118 | 114 | func shutdown () = if (!(r)) | |
119 | 115 | then throw(("DApp is already suspended. Cause: " + valueOrElse(getString(this, f), "the cause wasn't specified"))) | |
120 | 116 | else if (!(containsElement([a, b, c, d], C.callerPublicKey))) | |
121 | 117 | then throw("Only admin can call this function") | |
122 | 118 | else A("Paused by admin") | |
123 | 119 | ||
124 | 120 | ||
125 | 121 | @Verifier(V) | |
126 | 122 | func W () = { | |
127 | 123 | let X = V | |
128 | 124 | if ($isInstanceOf(X, "DataTransaction")) | |
129 | 125 | then { | |
130 | 126 | let Y = X | |
131 | 127 | sigVerify(V.bodyBytes, V.proofs[0], V.senderPublicKey) | |
132 | 128 | } | |
133 | 129 | else { | |
134 | 130 | let Z = if (sigVerify(V.bodyBytes, V.proofs[0], a)) | |
135 | 131 | then 1 | |
136 | 132 | else 0 | |
137 | 133 | let aa = if (sigVerify(V.bodyBytes, V.proofs[1], b)) | |
138 | 134 | then 1 | |
139 | 135 | else 0 | |
140 | 136 | let ab = if (sigVerify(V.bodyBytes, V.proofs[2], c)) | |
141 | 137 | then 1 | |
142 | 138 | else 0 | |
143 | 139 | (((Z + aa) + ab) >= 2) | |
144 | 140 | } | |
145 | 141 | } | |
146 | 142 |
github/deemru/w8io/169f3d6 81.49 ms ◑