tx · 813k9FhNj8ofc8sa15eeheF5H5M2uZo6f9mofQwqYd39 3Mrvz9iRPwQG2asueNNCYMjJnko227TqQDw: -0.01400000 Waves 2023.04.06 12:52 [2522546] smart account 3Mrvz9iRPwQG2asueNNCYMjJnko227TqQDw > SELF 0.00000000 Waves
{ "type": 13, "id": "813k9FhNj8ofc8sa15eeheF5H5M2uZo6f9mofQwqYd39", "fee": 1400000, "feeAssetId": null, "timestamp": 1680774803643, "version": 2, "chainId": 84, "sender": "3Mrvz9iRPwQG2asueNNCYMjJnko227TqQDw", "senderPublicKey": "Cin1vNbYtepAcdipQipLcqKhT69yfrzdyCUwhQA4RW5n", "proofs": [ "21aKCcg8C47GmPbij93ji76fLnrBeeyazdc6Gn6muq8YLjzmSTb8tqjnsQZY6wqXTYRhn9Pp9kqrvhMwY9Hqp2eq" ], "script": "base64:AAIEAAAAAAAAABMIAhIFCgMIAQESAwoBARIDCgEIAAAACQAAAAAEVk9URQEAAAAgCGWEtw/wimoa8+Jo6C4IkCTD0ydYA80s9i5eC9/aFaQAAAAAInZvdGluZ190aW1lc3RhbXBfY29udHJvbGxlcl9wdWJrZXkBAAAAIBu9S76H7YCzeS6A6ExALdu+B5uJ7eQOaVtSWu8sVA9tAAAAABJjb250cm9sbGVyX2FkZHJlc3MJAQAAABRhZGRyZXNzRnJvbVB1YmxpY0tleQAAAAEFAAAAInZvdGluZ190aW1lc3RhbXBfY29udHJvbGxlcl9wdWJrZXkAAAAADGxhdW5jaF9lcnJvcgIAAAAkRGFwcCB3aWxsIHN0YXJ0IFZvdGluZyBhdCBUaW1lc3RhbXAgAAAAAANtc2cCAAAALjxoMT5Zb3VyIFZvdGUgU3VibWl0dGVkIFN1Y2Nlc3NmdWxseSE8L2gxPjxicj4AAAAACXB5bXRlcnJvcgIAAAA1REFwcCBOZWVkIDAuMDAwMDAwMDEgVk9URSBUb2tlbiBhcyBBdHRhY2ggcGF5bWVudFsxXS4AAAAAC21pbmJhbGVycm9yAgAAAHBNaW4u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ZnkAAAAACQAB9AAAAAMIBQAAAAJ0eAAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAAnR4AAAABnByb29mcwAAAAAAAAAAAAgFAAAAAnR4AAAAD3NlbmRlclB1YmxpY0tleTp3+Ew=", "height": 2522546, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: HKN61wgzZussm121xetFsG2rAx11AAknUUA3ZzNjR4ds Next: none Diff:
Old | New | Differences | |
---|---|---|---|
64 | 64 | } | |
65 | 65 | let z = (y + w.amount) | |
66 | 66 | let A = { | |
67 | - | let r = getInteger(this, (((" | |
67 | + | let r = getInteger(this, ((("Total_" + v) + "_") + toString(u))) | |
68 | 68 | if ($isInstanceOf(r, "Int")) | |
69 | 69 | then { | |
70 | 70 | let s = r | |
73 | 73 | else 0 | |
74 | 74 | } | |
75 | 75 | let B = (A + w.amount) | |
76 | - | let C = { | |
77 | - | let r = getInteger(this, ((((("User_Total_Votes_" + p) + "_") + toString(u)) + "-") + v)) | |
78 | - | if ($isInstanceOf(r, "Int")) | |
79 | - | then { | |
80 | - | let s = r | |
81 | - | s | |
82 | - | } | |
83 | - | else 0 | |
84 | - | } | |
85 | - | let D = (C + w.amount) | |
86 | - | let E = { | |
87 | - | let r = getInteger(this, ((((("User_Total_Asset_Votes_" + p) + "_") + toString(u)) + "_") + v)) | |
88 | - | if ($isInstanceOf(r, "Int")) | |
89 | - | then { | |
90 | - | let s = r | |
91 | - | s | |
92 | - | } | |
93 | - | else 0 | |
94 | - | } | |
95 | - | let F = (E + w.amount) | |
96 | - | let G = { | |
97 | - | let r = getInteger(this, ((("Total_Votes_" + toString(u)) + "_") + v)) | |
98 | - | if ($isInstanceOf(r, "Int")) | |
99 | - | then { | |
100 | - | let s = r | |
101 | - | s | |
102 | - | } | |
103 | - | else 0 | |
104 | - | } | |
105 | - | let H = (G + w.amount) | |
106 | 76 | if ((n > lastBlock.timestamp)) | |
107 | 77 | then throw((d + toString(n))) | |
108 | 78 | else if ((1 > x)) | |
111 | 81 | then throw(h) | |
112 | 82 | else if ((lastBlock.timestamp > o)) | |
113 | 83 | then throw(i) | |
114 | - | else [IntegerEntry(("Total_Votes_" + toString(u)), z), IntegerEntry(((("Total_Votes_" + | |
84 | + | else [IntegerEntry(("Total_Votes_" + toString(u)), z), IntegerEntry(((("Total_Votes_" + v) + "_") + toString(u)), B), StringEntry("message", e)] | |
115 | 85 | } | |
116 | 86 | ||
117 | 87 | ||
118 | 88 | ||
119 | 89 | @Callable(j) | |
120 | - | func No () = { | |
121 | - | let v = "No" | |
122 | - | let n = getIntegerValue(this, "Voting_Start_TimeStamp") | |
123 | - | let o = getIntegerValue(this, "Voting_End_TimeStamp") | |
124 | - | let p = toBase58String(j.caller.bytes) | |
125 | - | let w = if ((size(j.payments) == 1)) | |
126 | - | then j.payments[0] | |
127 | - | else throw(f) | |
128 | - | let x = assetBalance(addressFromPublicKey(j.callerPublicKey), a) | |
129 | - | let y = { | |
130 | - | let r = getInteger(this, "Total_Votes") | |
131 | - | if ($isInstanceOf(r, "Int")) | |
132 | - | then { | |
133 | - | let s = r | |
134 | - | s | |
135 | - | } | |
136 | - | else 0 | |
137 | - | } | |
138 | - | let z = (y + w.amount) | |
139 | - | let A = { | |
140 | - | let r = getInteger(this, ("User_Total_Votes_" + p)) | |
141 | - | if ($isInstanceOf(r, "Int")) | |
142 | - | then { | |
143 | - | let s = r | |
144 | - | s | |
145 | - | } | |
146 | - | else 0 | |
147 | - | } | |
148 | - | let B = (A + w.amount) | |
149 | - | let C = { | |
150 | - | let r = getInteger(this, ((("User_Total_Votes_" + p) + "-") + v)) | |
151 | - | if ($isInstanceOf(r, "Int")) | |
152 | - | then { | |
153 | - | let s = r | |
154 | - | s | |
155 | - | } | |
156 | - | else 0 | |
157 | - | } | |
158 | - | let D = (C + w.amount) | |
159 | - | let E = { | |
160 | - | let r = getInteger(this, ((("User_Total_Asset_Votes_" + p) + "_") + v)) | |
161 | - | if ($isInstanceOf(r, "Int")) | |
162 | - | then { | |
163 | - | let s = r | |
164 | - | s | |
165 | - | } | |
166 | - | else 0 | |
167 | - | } | |
168 | - | let F = (E + w.amount) | |
169 | - | let G = { | |
170 | - | let r = getInteger(this, ("Total_Votes_" + v)) | |
171 | - | if ($isInstanceOf(r, "Int")) | |
172 | - | then { | |
173 | - | let s = r | |
174 | - | s | |
175 | - | } | |
176 | - | else 0 | |
177 | - | } | |
178 | - | let H = (G + w.amount) | |
179 | - | if ((n > lastBlock.timestamp)) | |
180 | - | then throw((d + toString(n))) | |
181 | - | else if ((1 > x)) | |
182 | - | then throw(g) | |
183 | - | else if ((w.assetId != a)) | |
184 | - | then throw(h) | |
185 | - | else if ((lastBlock.timestamp > o)) | |
186 | - | then throw(i) | |
187 | - | else [IntegerEntry("Total_Votes", z), IntegerEntry(("Total_Votes_" + v), H), IntegerEntry(("User_Total_Votes_" + p), B), IntegerEntry(((("User_Total_Votes_" + p) + "-") + v), D), IntegerEntry(((("User_Total_Asset_Votes_" + p) + "_") + v), F), StringEntry("message", e)] | |
188 | - | } | |
90 | + | func DeleteKey (C) = [DeleteEntry("Proposal Data_1"), DeleteEntry("Proposal Data_2"), DeleteEntry("Proposal_Data_3"), DeleteEntry(C)] | |
189 | 91 | ||
190 | 92 | ||
191 | - | ||
192 | - | @Callable(j) | |
193 | - | func Abstain () = { | |
194 | - | let v = "Abstain" | |
195 | - | let n = getIntegerValue(this, "Voting_Start_TimeStamp") | |
196 | - | let o = getIntegerValue(this, "Voting_End_TimeStamp") | |
197 | - | let p = toBase58String(j.caller.bytes) | |
198 | - | let w = if ((size(j.payments) == 1)) | |
199 | - | then j.payments[0] | |
200 | - | else throw(f) | |
201 | - | let x = assetBalance(addressFromPublicKey(j.callerPublicKey), a) | |
202 | - | let y = { | |
203 | - | let r = getInteger(this, "Total_Votes") | |
204 | - | if ($isInstanceOf(r, "Int")) | |
205 | - | then { | |
206 | - | let s = r | |
207 | - | s | |
208 | - | } | |
209 | - | else 0 | |
210 | - | } | |
211 | - | let z = (y + w.amount) | |
212 | - | let A = { | |
213 | - | let r = getInteger(this, ("User_Total_Votes_" + p)) | |
214 | - | if ($isInstanceOf(r, "Int")) | |
215 | - | then { | |
216 | - | let s = r | |
217 | - | s | |
218 | - | } | |
219 | - | else 0 | |
220 | - | } | |
221 | - | let B = (A + w.amount) | |
222 | - | let C = { | |
223 | - | let r = getInteger(this, ((("User_Total_Votes_" + p) + "-") + v)) | |
224 | - | if ($isInstanceOf(r, "Int")) | |
225 | - | then { | |
226 | - | let s = r | |
227 | - | s | |
228 | - | } | |
229 | - | else 0 | |
230 | - | } | |
231 | - | let D = (C + w.amount) | |
232 | - | let E = { | |
233 | - | let r = getInteger(this, ((("User_Total_Asset_Votes_" + p) + "_") + v)) | |
234 | - | if ($isInstanceOf(r, "Int")) | |
235 | - | then { | |
236 | - | let s = r | |
237 | - | s | |
238 | - | } | |
239 | - | else 0 | |
240 | - | } | |
241 | - | let F = (E + w.amount) | |
242 | - | let G = { | |
243 | - | let r = getInteger(this, ("Total_Votes_" + v)) | |
244 | - | if ($isInstanceOf(r, "Int")) | |
245 | - | then { | |
246 | - | let s = r | |
247 | - | s | |
248 | - | } | |
249 | - | else 0 | |
250 | - | } | |
251 | - | let H = (G + w.amount) | |
252 | - | if ((n > lastBlock.timestamp)) | |
253 | - | then throw((d + toString(n))) | |
254 | - | else if ((1 > x)) | |
255 | - | then throw(g) | |
256 | - | else if ((w.assetId != a)) | |
257 | - | then throw(h) | |
258 | - | else if ((lastBlock.timestamp > o)) | |
259 | - | then throw(i) | |
260 | - | else [IntegerEntry("Total_Votes", z), IntegerEntry(("Total_Votes_" + v), H), IntegerEntry(("User_Total_Votes_" + p), B), IntegerEntry(((("User_Total_Votes_" + p) + "-") + v), D), IntegerEntry(((("User_Total_Asset_Votes_" + p) + "_") + v), F), StringEntry("message", e)] | |
261 | - | } | |
262 | - | ||
263 | - | ||
264 | - | @Verifier(I) | |
265 | - | func J () = sigVerify(I.bodyBytes, I.proofs[0], I.senderPublicKey) | |
93 | + | @Verifier(D) | |
94 | + | func E () = sigVerify(D.bodyBytes, D.proofs[0], D.senderPublicKey) | |
266 | 95 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 4 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let a = base58'Zn3cLHW7aAVPm5aACcTjvg7e7iEy2cKDtbowok5qa9H' | |
5 | 5 | ||
6 | 6 | let b = base58'2sHRUrJCMpDhAQEcN7Zhk3LqnD9zizebpxeQXpPoscQU' | |
7 | 7 | ||
8 | 8 | let c = addressFromPublicKey(b) | |
9 | 9 | ||
10 | 10 | let d = "Dapp will start Voting at Timestamp " | |
11 | 11 | ||
12 | 12 | let e = "<h1>Your Vote Submitted Successfully!</h1><br>" | |
13 | 13 | ||
14 | 14 | let f = "DApp Need 0.00000001 VOTE Token as Attach payment[1]." | |
15 | 15 | ||
16 | 16 | let g = "Min. 0.00000001 VOTE required on Your Address to Vote. Please Mint or hold min. 0.00000001 VOTE on this Address." | |
17 | 17 | ||
18 | 18 | let h = (("Incorrect asset attach, please attach " + toBase58String(a)) + " AssetID Only.") | |
19 | 19 | ||
20 | 20 | let i = "Voting is Over for this Dapp." | |
21 | 21 | ||
22 | 22 | @Callable(j) | |
23 | 23 | func SetVotingTimeStamps (k,l,m) = { | |
24 | 24 | let n = l | |
25 | 25 | let o = m | |
26 | 26 | let p = toBase58String(j.caller.bytes) | |
27 | 27 | let q = { | |
28 | 28 | let r = getInteger(this, "Total_Proposals") | |
29 | 29 | if ($isInstanceOf(r, "Int")) | |
30 | 30 | then { | |
31 | 31 | let s = r | |
32 | 32 | s | |
33 | 33 | } | |
34 | 34 | else 0 | |
35 | 35 | } | |
36 | 36 | let t = (q + 1) | |
37 | 37 | if ((size(k) > 5100)) | |
38 | 38 | then throw("Subject Char Limits are Over. Reduce length less than 5100 Char.") | |
39 | 39 | else if ((j.caller != c)) | |
40 | 40 | then throw((("This Address is not Authorized. Only " + toString(c)) + " is Authorized Address to Sign it.")) | |
41 | 41 | else [StringEntry(("Proposal_Data_" + toString(t)), k), IntegerEntry("Total_Proposals", t), StringEntry(("Proposer_" + toString(t)), p), IntegerEntry(("Voting_Start_TimeStamp_" + toString(t)), n), IntegerEntry(("Voting_End_TimeStamp_" + toString(t)), o)] | |
42 | 42 | } | |
43 | 43 | ||
44 | 44 | ||
45 | 45 | ||
46 | 46 | @Callable(j) | |
47 | 47 | func Yes (u) = { | |
48 | 48 | let v = "Yes" | |
49 | 49 | let n = getIntegerValue(this, ("Voting_Start_TimeStamp_" + toString(u))) | |
50 | 50 | let o = getIntegerValue(this, ("Voting_End_TimeStamp_" + toString(u))) | |
51 | 51 | let p = toBase58String(j.caller.bytes) | |
52 | 52 | let w = if ((size(j.payments) == 1)) | |
53 | 53 | then j.payments[0] | |
54 | 54 | else throw(f) | |
55 | 55 | let x = assetBalance(addressFromPublicKey(j.callerPublicKey), a) | |
56 | 56 | let y = { | |
57 | 57 | let r = getInteger(this, ("Total_Votes_" + toString(u))) | |
58 | 58 | if ($isInstanceOf(r, "Int")) | |
59 | 59 | then { | |
60 | 60 | let s = r | |
61 | 61 | s | |
62 | 62 | } | |
63 | 63 | else 0 | |
64 | 64 | } | |
65 | 65 | let z = (y + w.amount) | |
66 | 66 | let A = { | |
67 | - | let r = getInteger(this, (((" | |
67 | + | let r = getInteger(this, ((("Total_" + v) + "_") + toString(u))) | |
68 | 68 | if ($isInstanceOf(r, "Int")) | |
69 | 69 | then { | |
70 | 70 | let s = r | |
71 | 71 | s | |
72 | 72 | } | |
73 | 73 | else 0 | |
74 | 74 | } | |
75 | 75 | let B = (A + w.amount) | |
76 | - | let C = { | |
77 | - | let r = getInteger(this, ((((("User_Total_Votes_" + p) + "_") + toString(u)) + "-") + v)) | |
78 | - | if ($isInstanceOf(r, "Int")) | |
79 | - | then { | |
80 | - | let s = r | |
81 | - | s | |
82 | - | } | |
83 | - | else 0 | |
84 | - | } | |
85 | - | let D = (C + w.amount) | |
86 | - | let E = { | |
87 | - | let r = getInteger(this, ((((("User_Total_Asset_Votes_" + p) + "_") + toString(u)) + "_") + v)) | |
88 | - | if ($isInstanceOf(r, "Int")) | |
89 | - | then { | |
90 | - | let s = r | |
91 | - | s | |
92 | - | } | |
93 | - | else 0 | |
94 | - | } | |
95 | - | let F = (E + w.amount) | |
96 | - | let G = { | |
97 | - | let r = getInteger(this, ((("Total_Votes_" + toString(u)) + "_") + v)) | |
98 | - | if ($isInstanceOf(r, "Int")) | |
99 | - | then { | |
100 | - | let s = r | |
101 | - | s | |
102 | - | } | |
103 | - | else 0 | |
104 | - | } | |
105 | - | let H = (G + w.amount) | |
106 | 76 | if ((n > lastBlock.timestamp)) | |
107 | 77 | then throw((d + toString(n))) | |
108 | 78 | else if ((1 > x)) | |
109 | 79 | then throw(g) | |
110 | 80 | else if ((w.assetId != a)) | |
111 | 81 | then throw(h) | |
112 | 82 | else if ((lastBlock.timestamp > o)) | |
113 | 83 | then throw(i) | |
114 | - | else [IntegerEntry(("Total_Votes_" + toString(u)), z), IntegerEntry(((("Total_Votes_" + | |
84 | + | else [IntegerEntry(("Total_Votes_" + toString(u)), z), IntegerEntry(((("Total_Votes_" + v) + "_") + toString(u)), B), StringEntry("message", e)] | |
115 | 85 | } | |
116 | 86 | ||
117 | 87 | ||
118 | 88 | ||
119 | 89 | @Callable(j) | |
120 | - | func No () = { | |
121 | - | let v = "No" | |
122 | - | let n = getIntegerValue(this, "Voting_Start_TimeStamp") | |
123 | - | let o = getIntegerValue(this, "Voting_End_TimeStamp") | |
124 | - | let p = toBase58String(j.caller.bytes) | |
125 | - | let w = if ((size(j.payments) == 1)) | |
126 | - | then j.payments[0] | |
127 | - | else throw(f) | |
128 | - | let x = assetBalance(addressFromPublicKey(j.callerPublicKey), a) | |
129 | - | let y = { | |
130 | - | let r = getInteger(this, "Total_Votes") | |
131 | - | if ($isInstanceOf(r, "Int")) | |
132 | - | then { | |
133 | - | let s = r | |
134 | - | s | |
135 | - | } | |
136 | - | else 0 | |
137 | - | } | |
138 | - | let z = (y + w.amount) | |
139 | - | let A = { | |
140 | - | let r = getInteger(this, ("User_Total_Votes_" + p)) | |
141 | - | if ($isInstanceOf(r, "Int")) | |
142 | - | then { | |
143 | - | let s = r | |
144 | - | s | |
145 | - | } | |
146 | - | else 0 | |
147 | - | } | |
148 | - | let B = (A + w.amount) | |
149 | - | let C = { | |
150 | - | let r = getInteger(this, ((("User_Total_Votes_" + p) + "-") + v)) | |
151 | - | if ($isInstanceOf(r, "Int")) | |
152 | - | then { | |
153 | - | let s = r | |
154 | - | s | |
155 | - | } | |
156 | - | else 0 | |
157 | - | } | |
158 | - | let D = (C + w.amount) | |
159 | - | let E = { | |
160 | - | let r = getInteger(this, ((("User_Total_Asset_Votes_" + p) + "_") + v)) | |
161 | - | if ($isInstanceOf(r, "Int")) | |
162 | - | then { | |
163 | - | let s = r | |
164 | - | s | |
165 | - | } | |
166 | - | else 0 | |
167 | - | } | |
168 | - | let F = (E + w.amount) | |
169 | - | let G = { | |
170 | - | let r = getInteger(this, ("Total_Votes_" + v)) | |
171 | - | if ($isInstanceOf(r, "Int")) | |
172 | - | then { | |
173 | - | let s = r | |
174 | - | s | |
175 | - | } | |
176 | - | else 0 | |
177 | - | } | |
178 | - | let H = (G + w.amount) | |
179 | - | if ((n > lastBlock.timestamp)) | |
180 | - | then throw((d + toString(n))) | |
181 | - | else if ((1 > x)) | |
182 | - | then throw(g) | |
183 | - | else if ((w.assetId != a)) | |
184 | - | then throw(h) | |
185 | - | else if ((lastBlock.timestamp > o)) | |
186 | - | then throw(i) | |
187 | - | else [IntegerEntry("Total_Votes", z), IntegerEntry(("Total_Votes_" + v), H), IntegerEntry(("User_Total_Votes_" + p), B), IntegerEntry(((("User_Total_Votes_" + p) + "-") + v), D), IntegerEntry(((("User_Total_Asset_Votes_" + p) + "_") + v), F), StringEntry("message", e)] | |
188 | - | } | |
90 | + | func DeleteKey (C) = [DeleteEntry("Proposal Data_1"), DeleteEntry("Proposal Data_2"), DeleteEntry("Proposal_Data_3"), DeleteEntry(C)] | |
189 | 91 | ||
190 | 92 | ||
191 | - | ||
192 | - | @Callable(j) | |
193 | - | func Abstain () = { | |
194 | - | let v = "Abstain" | |
195 | - | let n = getIntegerValue(this, "Voting_Start_TimeStamp") | |
196 | - | let o = getIntegerValue(this, "Voting_End_TimeStamp") | |
197 | - | let p = toBase58String(j.caller.bytes) | |
198 | - | let w = if ((size(j.payments) == 1)) | |
199 | - | then j.payments[0] | |
200 | - | else throw(f) | |
201 | - | let x = assetBalance(addressFromPublicKey(j.callerPublicKey), a) | |
202 | - | let y = { | |
203 | - | let r = getInteger(this, "Total_Votes") | |
204 | - | if ($isInstanceOf(r, "Int")) | |
205 | - | then { | |
206 | - | let s = r | |
207 | - | s | |
208 | - | } | |
209 | - | else 0 | |
210 | - | } | |
211 | - | let z = (y + w.amount) | |
212 | - | let A = { | |
213 | - | let r = getInteger(this, ("User_Total_Votes_" + p)) | |
214 | - | if ($isInstanceOf(r, "Int")) | |
215 | - | then { | |
216 | - | let s = r | |
217 | - | s | |
218 | - | } | |
219 | - | else 0 | |
220 | - | } | |
221 | - | let B = (A + w.amount) | |
222 | - | let C = { | |
223 | - | let r = getInteger(this, ((("User_Total_Votes_" + p) + "-") + v)) | |
224 | - | if ($isInstanceOf(r, "Int")) | |
225 | - | then { | |
226 | - | let s = r | |
227 | - | s | |
228 | - | } | |
229 | - | else 0 | |
230 | - | } | |
231 | - | let D = (C + w.amount) | |
232 | - | let E = { | |
233 | - | let r = getInteger(this, ((("User_Total_Asset_Votes_" + p) + "_") + v)) | |
234 | - | if ($isInstanceOf(r, "Int")) | |
235 | - | then { | |
236 | - | let s = r | |
237 | - | s | |
238 | - | } | |
239 | - | else 0 | |
240 | - | } | |
241 | - | let F = (E + w.amount) | |
242 | - | let G = { | |
243 | - | let r = getInteger(this, ("Total_Votes_" + v)) | |
244 | - | if ($isInstanceOf(r, "Int")) | |
245 | - | then { | |
246 | - | let s = r | |
247 | - | s | |
248 | - | } | |
249 | - | else 0 | |
250 | - | } | |
251 | - | let H = (G + w.amount) | |
252 | - | if ((n > lastBlock.timestamp)) | |
253 | - | then throw((d + toString(n))) | |
254 | - | else if ((1 > x)) | |
255 | - | then throw(g) | |
256 | - | else if ((w.assetId != a)) | |
257 | - | then throw(h) | |
258 | - | else if ((lastBlock.timestamp > o)) | |
259 | - | then throw(i) | |
260 | - | else [IntegerEntry("Total_Votes", z), IntegerEntry(("Total_Votes_" + v), H), IntegerEntry(("User_Total_Votes_" + p), B), IntegerEntry(((("User_Total_Votes_" + p) + "-") + v), D), IntegerEntry(((("User_Total_Asset_Votes_" + p) + "_") + v), F), StringEntry("message", e)] | |
261 | - | } | |
262 | - | ||
263 | - | ||
264 | - | @Verifier(I) | |
265 | - | func J () = sigVerify(I.bodyBytes, I.proofs[0], I.senderPublicKey) | |
93 | + | @Verifier(D) | |
94 | + | func E () = sigVerify(D.bodyBytes, D.proofs[0], D.senderPublicKey) | |
266 | 95 |
github/deemru/w8io/026f985 54.71 ms ◑