tx · 6D8AtAn7ftARmzprBR2BLPH5bCTE7X7eH3LNqgMwmQHm 3Mvae1hWVsf6jjP2Cpmkvtkb9fTK3dGRKvK: -0.01400000 Waves 2021.04.14 00:29 [1481219] smart account 3Mvae1hWVsf6jjP2Cpmkvtkb9fTK3dGRKvK > SELF 0.00000000 Waves
{ "type": 13, "id": "6D8AtAn7ftARmzprBR2BLPH5bCTE7X7eH3LNqgMwmQHm", "fee": 1400000, "feeAssetId": null, "timestamp": 1618349405462, "version": 1, "sender": "3Mvae1hWVsf6jjP2Cpmkvtkb9fTK3dGRKvK", "senderPublicKey": "9soWMfrkLUU5eL1z8mt31XLYsTgJ8aCXNd1ej1CsWFxk", "proofs": [ "5e4f7Q3YPyWDwbGebJzko3gZvkbXG9o4irWQFesQkmkqG2No8cqMv937DhaKv2tkMfVz8o2V8pgHWkAmYeqBw95n" ], "script": "base64:AAIEAAAAAAAAAAgIAhIECgIIAQAAABwAAAAADGFkbWluUHViS2V5MQEAAAAgugnXO4lZpNFdoP/xuzPQquE5aQ/L4r2R1jvuT16o4BMAAAAADGFkbWluUHViS2V5MgEAAAAgwpFEmbPSsLQNIqWRWL2IvKE3uwjL/92M5pTvWxYOfkAAAAAADGFkbWluUHViS2V5MwEAAAAgjh4XLnixBzv0SE56Myhgdih3/JnlkjCjIMLPqKvpDlUAAAAAEWtVc2VyUG9vbFZvdGVTV09QAgAAAAVfdm90ZQAAAAAOa1VzZXJQb29sU3RydWMCAAAAEF91c2VyX3Bvb2xfc3RydWMAAAAAEmtVc2VyVG90YWxWb3RlU1dPUAIAAAAVX3VzZXJfdG90YWxfU1dPUF92b3RlAAAAAA9rVXNlclRvdGFsU3RydWMCAAAAEV91c2VyX3RvdGFsX3N0cnVjAAAAAA1rUG9vbFZvdGVTV09QAgAAAApfdm90ZV9TV09QAAAAAAprUG9vbFN0cnVjAgAAAAtfcG9vbF9zdHJ1YwAAAAAOa1RvdGFsVm90ZVNXT1ACAAAAD3RvdGFsX3ZvdGVfU1d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RyeQkBAAAAD2NhbGNEZWxldGVFbnRyeQAAAAMJAAQlAAAAAQgFAAAAAWkAAAAGY2FsbGVyBQAAAAtwb29sQWRkcmVzcwUAAAATdXNlclBvb2xWb3RlU1dPUG5ldwAAAABeazgm", "chainId": 84, "height": 1481219, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: BUQ8o59aV2ahXGpzmNPYBqYwpEd9AatfFeWf1pm16ezP Next: CAPzjbYY4oNjvipSvaatzQqMojS6bUexvAs3jzp2V4ZY Diff:
Old | New | Differences | |
---|---|---|---|
150 | 150 | then throw("This address has 0 SWOP in Governance dApp") | |
151 | 151 | else if ((userTotalVoteSWOPnew > userSWOPinGovernance)) | |
152 | 152 | then throw(((((toString(this) + " has ") + toString(userSWOPinGovernance)) + " SWOP in governance. New SWOP in voting ") + toString(userTotalVoteSWOPnew))) | |
153 | - | else if ((userPoolVoteSWOPnew >= userPoolVoteSWOP)) | |
154 | - | then { | |
155 | - | let coef = votingCoef() | |
156 | - | let userPoolActiveVoteSWOPnew = if ((userPoolVotePeriod == currPeriod)) | |
157 | - | then (userPoolActiveVoteSWOP + ((poolVoteDiffSWOP * coef) / scale8)) | |
158 | - | else (userPoolVoteSWOP + ((poolVoteDiffSWOP * coef) / scale8)) | |
159 | - | let userPoolFreezeSWOPnew = if ((userPoolVotePeriod == currPeriod)) | |
160 | - | then userPoolFreezeSWOP | |
161 | - | else userPoolVoteSWOP | |
162 | - | let userUnvotedNew = if ((userUnvoted == currPeriod)) | |
163 | - | then userUnvoted | |
164 | - | else max([0, (userUnvoted - poolVoteDiffSWOP)]) | |
165 | - | let userPoolStrucNew = ((((((toString(userPoolVoteSWOPnew) + "_") + toString(userPoolActiveVoteSWOPnew)) + "_") + toString(currPeriod)) + "_") + toString(userPoolFreezeSWOPnew)) | |
166 | - | let userPoolEntry = [StringEntry((((toString(i.caller) + "_") + poolAddress) + kUserPoolStruc), userPoolStrucNew)] | |
167 | - | let userTotalStrucNew = ((((toString(userTotalVoteSWOPnew) + "_") + toString(userUnvotedNew)) + "_") + toString(currPeriod)) | |
168 | - | let userTotalEntry = [StringEntry((toString(i.caller) + kUserTotalStruc), userTotalStrucNew)] | |
169 | - | let poolVoteSWOPnew = (poolVoteSWOP + poolVoteDiffSWOP) | |
170 | - | let poolActiveSWOPnew = if ((poolPeriod == currPeriod)) | |
171 | - | then (poolActiveSWOP + ((poolVoteDiffSWOP * coef) / scale8)) | |
172 | - | else (poolVoteSWOP + ((poolVoteDiffSWOP * coef) / scale8)) | |
173 | - | let poolFreezeSWOPnew = if ((poolPeriod == currPeriod)) | |
174 | - | then poolFreezeSWOP | |
175 | - | else poolVoteSWOP | |
176 | - | let poolStrucNew = ((((((toString(poolVoteSWOPnew) + "_") + toString(poolActiveSWOPnew)) + "_") + toString(currPeriod)) + "_") + toString(poolFreezeSWOPnew)) | |
177 | - | let poolEntry = [StringEntry((poolAddress + kPoolStruc), poolStrucNew)] | |
178 | - | let totalVoteSWOPnew = (totalVoteSWOP + poolVoteDiffSWOP) | |
179 | - | let totalActiveSWOPnew = if ((totalPeriod == currPeriod)) | |
180 | - | then (totalActiveSWOP + ((poolVoteDiffSWOP * coef) / scale8)) | |
181 | - | else (totalVoteSWOP + ((poolVoteDiffSWOP * coef) / scale8)) | |
182 | - | let totalFreezeSWOPnew = if ((poolPeriod == currPeriod)) | |
183 | - | then totalFreezeSWOP | |
184 | - | else totalVoteSWOP | |
185 | - | let totalStrucNew = ((((((toString(totalVoteSWOPnew) + "_") + toString(totalActiveSWOPnew)) + "_") + toString(totalPeriod)) + "_") + toString(totalFreezeSWOPnew)) | |
186 | - | let totalEntry = [StringEntry(kTotalStruc, totalStrucNew)] | |
187 | - | ((((userPoolEntry ++ userTotalEntry) ++ poolEntry) ++ totalEntry) ++ calcDeleteEntry(toString(i.caller), poolAddress, userPoolVoteSWOPnew)) | |
188 | - | } | |
189 | - | else { | |
190 | - | let removePoolVote = -(poolVoteDiffSWOP) | |
191 | - | let userPoolFreezeSWOPnew = if ((userPoolVotePeriod == currPeriod)) | |
192 | - | then min([userPoolFreezeSWOP, userPoolVoteSWOPnew]) | |
193 | - | else userPoolVoteSWOPnew | |
194 | - | let userPoolActiveVoteSWOPnew = if (((userPoolVoteSWOP - userPoolFreezeSWOP) == 0)) | |
195 | - | then 0 | |
196 | - | else (userPoolFreezeSWOPnew + (((userPoolActiveVoteSWOP - userPoolFreezeSWOP) * (userPoolVoteSWOPnew - userPoolFreezeSWOPnew)) / (userPoolVoteSWOP - userPoolFreezeSWOP))) | |
197 | - | let newUnvoted = max([0, (removePoolVote - (if ((userUnvotedPeriod == currPeriod)) | |
198 | - | then (userPoolVoteSWOP - userPoolFreezeSWOP) | |
199 | - | else 0))]) | |
200 | - | let userUnvotedNew = if ((userUnvotedPeriod == currPeriod)) | |
201 | - | then userUnvoted | |
202 | - | else (0 + newUnvoted) | |
203 | - | let userUnvotedPeriodNew = if ((newUnvoted > 0)) | |
204 | - | then currPeriod | |
205 | - | else userUnvotedPeriod | |
206 | - | let userPoolStrucNew = ((((((toString(userPoolVoteSWOPnew) + "_") + toString(userPoolActiveVoteSWOPnew)) + "_") + toString(currPeriod)) + "_") + toString(userPoolFreezeSWOPnew)) | |
207 | - | let userPoolEntry = [StringEntry((((toString(i.caller) + "_") + poolAddress) + kUserPoolStruc), userPoolStrucNew)] | |
208 | - | let userTotalStrucNew = ((((toString(userTotalVoteSWOPnew) + "_") + toString(userUnvotedNew)) + "_") + toString(currPeriod)) | |
209 | - | let userTotalEntry = [StringEntry((toString(i.caller) + kUserTotalStruc), userTotalStrucNew)] | |
210 | - | let poolVoteSWOPnew = (poolVoteSWOP - removePoolVote) | |
211 | - | let poolFreezeSWOPnew = if ((poolPeriod == currPeriod)) | |
212 | - | then min([poolFreezeSWOP, poolVoteSWOPnew]) | |
213 | - | else poolVoteSWOPnew | |
214 | - | let poolActiveSWOPnew = if (((poolVoteSWOP - poolFreezeSWOP) == 0)) | |
215 | - | then 0 | |
216 | - | else (poolFreezeSWOPnew + (((poolActiveSWOP - poolFreezeSWOP) * (poolVoteSWOPnew - poolFreezeSWOPnew)) / (poolVoteSWOP - poolFreezeSWOP))) | |
217 | - | let poolStrucNew = ((((((toString(poolVoteSWOPnew) + "_") + toString(poolActiveSWOPnew)) + "_") + toString(currPeriod)) + "_") + toString(poolFreezeSWOPnew)) | |
218 | - | let poolEntry = [StringEntry((poolAddress + kPoolStruc), poolStrucNew)] | |
219 | - | let totalVoteSWOPnew = (totalVoteSWOP - removePoolVote) | |
220 | - | let totalFreezeSWOPnew = if ((totalPeriod == currPeriod)) | |
221 | - | then min([totalFreezeSWOP, totalVoteSWOPnew]) | |
222 | - | else totalVoteSWOPnew | |
223 | - | let totalActiveSWOPnew = if (((totalVoteSWOP - totalFreezeSWOP) == 0)) | |
224 | - | then 0 | |
225 | - | else (totalFreezeSWOPnew + (((totalActiveSWOP - totalFreezeSWOP) * (totalVoteSWOPnew - totalFreezeSWOPnew)) / (totalVoteSWOP - totalFreezeSWOP))) | |
226 | - | let totalStrucNew = ((((((toString(totalVoteSWOPnew) + "_") + toString(totalActiveSWOPnew)) + "_") + toString(totalPeriod)) + "_") + toString(totalFreezeSWOPnew)) | |
227 | - | let totalEntry = [StringEntry(kTotalStruc, totalStrucNew)] | |
228 | - | ((((userPoolEntry ++ userTotalEntry) ++ poolEntry) ++ totalEntry) ++ calcDeleteEntry(toString(i.caller), poolAddress, userPoolVoteSWOPnew)) | |
229 | - | } | |
153 | + | else if ((0 > userTotalVoteSWOPnew)) | |
154 | + | then throw("New userPoolVoteSWOPnew < 0") | |
155 | + | else if ((userPoolVoteSWOPnew >= userPoolVoteSWOP)) | |
156 | + | then { | |
157 | + | let coef = votingCoef() | |
158 | + | let userPoolActiveVoteSWOPnew = if ((userPoolVotePeriod == currPeriod)) | |
159 | + | then (userPoolActiveVoteSWOP + ((poolVoteDiffSWOP * coef) / scale8)) | |
160 | + | else (userPoolVoteSWOP + ((poolVoteDiffSWOP * coef) / scale8)) | |
161 | + | let userPoolFreezeSWOPnew = if ((userPoolVotePeriod == currPeriod)) | |
162 | + | then userPoolFreezeSWOP | |
163 | + | else userPoolVoteSWOP | |
164 | + | let userUnvotedNew = if ((userUnvoted == currPeriod)) | |
165 | + | then userUnvoted | |
166 | + | else max([0, (userUnvoted - poolVoteDiffSWOP)]) | |
167 | + | let userPoolStrucNew = ((((((toString(userPoolVoteSWOPnew) + "_") + toString(userPoolActiveVoteSWOPnew)) + "_") + toString(currPeriod)) + "_") + toString(userPoolFreezeSWOPnew)) | |
168 | + | let userPoolEntry = [StringEntry((((toString(i.caller) + "_") + poolAddress) + kUserPoolStruc), userPoolStrucNew)] | |
169 | + | let userTotalStrucNew = ((((toString(userTotalVoteSWOPnew) + "_") + toString(userUnvotedNew)) + "_") + toString(currPeriod)) | |
170 | + | let userTotalEntry = [StringEntry((toString(i.caller) + kUserTotalStruc), userTotalStrucNew)] | |
171 | + | let poolVoteSWOPnew = (poolVoteSWOP + poolVoteDiffSWOP) | |
172 | + | let poolActiveSWOPnew = if ((poolPeriod == currPeriod)) | |
173 | + | then (poolActiveSWOP + ((poolVoteDiffSWOP * coef) / scale8)) | |
174 | + | else (poolVoteSWOP + ((poolVoteDiffSWOP * coef) / scale8)) | |
175 | + | let poolFreezeSWOPnew = if ((poolPeriod == currPeriod)) | |
176 | + | then poolFreezeSWOP | |
177 | + | else poolVoteSWOP | |
178 | + | let poolStrucNew = ((((((toString(poolVoteSWOPnew) + "_") + toString(poolActiveSWOPnew)) + "_") + toString(currPeriod)) + "_") + toString(poolFreezeSWOPnew)) | |
179 | + | let poolEntry = [StringEntry((poolAddress + kPoolStruc), poolStrucNew)] | |
180 | + | let totalVoteSWOPnew = (totalVoteSWOP + poolVoteDiffSWOP) | |
181 | + | let totalActiveSWOPnew = if ((totalPeriod == currPeriod)) | |
182 | + | then (totalActiveSWOP + ((poolVoteDiffSWOP * coef) / scale8)) | |
183 | + | else (totalVoteSWOP + ((poolVoteDiffSWOP * coef) / scale8)) | |
184 | + | let totalFreezeSWOPnew = if ((poolPeriod == currPeriod)) | |
185 | + | then totalFreezeSWOP | |
186 | + | else totalVoteSWOP | |
187 | + | let totalStrucNew = ((((((toString(totalVoteSWOPnew) + "_") + toString(totalActiveSWOPnew)) + "_") + toString(totalPeriod)) + "_") + toString(totalFreezeSWOPnew)) | |
188 | + | let totalEntry = [StringEntry(kTotalStruc, totalStrucNew)] | |
189 | + | ((((userPoolEntry ++ userTotalEntry) ++ poolEntry) ++ totalEntry) ++ calcDeleteEntry(toString(i.caller), poolAddress, userPoolVoteSWOPnew)) | |
190 | + | } | |
191 | + | else { | |
192 | + | let removePoolVote = -(poolVoteDiffSWOP) | |
193 | + | let userPoolFreezeSWOPnew = if ((userPoolVotePeriod == currPeriod)) | |
194 | + | then min([userPoolFreezeSWOP, userPoolVoteSWOPnew]) | |
195 | + | else userPoolVoteSWOPnew | |
196 | + | let userPoolActiveVoteSWOPnew = if (((userPoolVoteSWOP - userPoolFreezeSWOP) == 0)) | |
197 | + | then 0 | |
198 | + | else (userPoolFreezeSWOPnew + (((userPoolActiveVoteSWOP - userPoolFreezeSWOP) * (userPoolVoteSWOPnew - userPoolFreezeSWOPnew)) / (userPoolVoteSWOP - userPoolFreezeSWOP))) | |
199 | + | let newUnvoted = max([0, (removePoolVote - (if ((userUnvotedPeriod == currPeriod)) | |
200 | + | then (userPoolVoteSWOP - userPoolFreezeSWOP) | |
201 | + | else 0))]) | |
202 | + | let userUnvotedNew = if ((userUnvotedPeriod == currPeriod)) | |
203 | + | then userUnvoted | |
204 | + | else (0 + newUnvoted) | |
205 | + | let userUnvotedPeriodNew = if ((newUnvoted > 0)) | |
206 | + | then currPeriod | |
207 | + | else userUnvotedPeriod | |
208 | + | let userPoolStrucNew = ((((((toString(userPoolVoteSWOPnew) + "_") + toString(userPoolActiveVoteSWOPnew)) + "_") + toString(currPeriod)) + "_") + toString(userPoolFreezeSWOPnew)) | |
209 | + | let userPoolEntry = [StringEntry((((toString(i.caller) + "_") + poolAddress) + kUserPoolStruc), userPoolStrucNew)] | |
210 | + | let userTotalStrucNew = ((((toString(userTotalVoteSWOPnew) + "_") + toString(userUnvotedNew)) + "_") + toString(currPeriod)) | |
211 | + | let userTotalEntry = [StringEntry((toString(i.caller) + kUserTotalStruc), userTotalStrucNew)] | |
212 | + | let poolVoteSWOPnew = (poolVoteSWOP - removePoolVote) | |
213 | + | let poolFreezeSWOPnew = if ((poolPeriod == currPeriod)) | |
214 | + | then min([poolFreezeSWOP, poolVoteSWOPnew]) | |
215 | + | else poolVoteSWOPnew | |
216 | + | let poolActiveSWOPnew = if (((poolVoteSWOP - poolFreezeSWOP) == 0)) | |
217 | + | then 0 | |
218 | + | else (poolFreezeSWOPnew + (((poolActiveSWOP - poolFreezeSWOP) * (poolVoteSWOPnew - poolFreezeSWOPnew)) / (poolVoteSWOP - poolFreezeSWOP))) | |
219 | + | let poolStrucNew = ((((((toString(poolVoteSWOPnew) + "_") + toString(poolActiveSWOPnew)) + "_") + toString(currPeriod)) + "_") + toString(poolFreezeSWOPnew)) | |
220 | + | let poolEntry = [StringEntry((poolAddress + kPoolStruc), poolStrucNew)] | |
221 | + | let totalVoteSWOPnew = (totalVoteSWOP - removePoolVote) | |
222 | + | let totalFreezeSWOPnew = if ((totalPeriod == currPeriod)) | |
223 | + | then min([totalFreezeSWOP, totalVoteSWOPnew]) | |
224 | + | else totalVoteSWOPnew | |
225 | + | let totalActiveSWOPnew = if (((totalVoteSWOP - totalFreezeSWOP) == 0)) | |
226 | + | then 0 | |
227 | + | else (totalFreezeSWOPnew + (((totalActiveSWOP - totalFreezeSWOP) * (totalVoteSWOPnew - totalFreezeSWOPnew)) / (totalVoteSWOP - totalFreezeSWOP))) | |
228 | + | let totalStrucNew = ((((((toString(totalVoteSWOPnew) + "_") + toString(totalActiveSWOPnew)) + "_") + toString(totalPeriod)) + "_") + toString(totalFreezeSWOPnew)) | |
229 | + | let totalEntry = [StringEntry(kTotalStruc, totalStrucNew)] | |
230 | + | ((((userPoolEntry ++ userTotalEntry) ++ poolEntry) ++ totalEntry) ++ calcDeleteEntry(toString(i.caller), poolAddress, userPoolVoteSWOPnew)) | |
231 | + | } | |
230 | 232 | } | |
231 | 233 | ||
232 | 234 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 4 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let adminPubKey1 = base58'DXDY2itiEcYBtGkVLnkpHtDFyWQUkoLJz79uJ7ECbMrA' | |
5 | 5 | ||
6 | 6 | let adminPubKey2 = base58'E6Wa1SGoktYcjHjsKrvjMiqJY3SWmGKcD8Q5L8kxSPS7' | |
7 | 7 | ||
8 | 8 | let adminPubKey3 = base58'AZmWJtuy4GeVrMmJH4hfFBRApe1StvhJSk4jcbT6bArQ' | |
9 | 9 | ||
10 | 10 | let kUserPoolVoteSWOP = "_vote" | |
11 | 11 | ||
12 | 12 | let kUserPoolStruc = "_user_pool_struc" | |
13 | 13 | ||
14 | 14 | let kUserTotalVoteSWOP = "_user_total_SWOP_vote" | |
15 | 15 | ||
16 | 16 | let kUserTotalStruc = "_user_total_struc" | |
17 | 17 | ||
18 | 18 | let kPoolVoteSWOP = "_vote_SWOP" | |
19 | 19 | ||
20 | 20 | let kPoolStruc = "_pool_struc" | |
21 | 21 | ||
22 | 22 | let kTotalVoteSWOP = "total_vote_SWOP" | |
23 | 23 | ||
24 | 24 | let kTotalStruc = "total_struc" | |
25 | 25 | ||
26 | 26 | let kStartHeight = "start_height" | |
27 | 27 | ||
28 | 28 | let kBasePeriod = "base_period" | |
29 | 29 | ||
30 | 30 | let kPeriodLength = "period_length" | |
31 | 31 | ||
32 | 32 | let kDurationFullVotePower = "duration_full_vote_power" | |
33 | 33 | ||
34 | 34 | let kMinVotePower = "min_vote_power" | |
35 | 35 | ||
36 | 36 | let scale8 = 100000000 | |
37 | 37 | ||
38 | 38 | let basePeriod = valueOrErrorMessage(getInteger(this, kBasePeriod), "Empty kBasePeriod") | |
39 | 39 | ||
40 | 40 | let startHeight = valueOrErrorMessage(getInteger(this, kStartHeight), "Empty kStartHeight") | |
41 | 41 | ||
42 | 42 | let periodLength = valueOrErrorMessage(getInteger(this, kPeriodLength), "Empty kPeriodLength") | |
43 | 43 | ||
44 | 44 | let durationFullVotePower = valueOrErrorMessage(getInteger(this, kDurationFullVotePower), "Empty kDurationFullVotePower") | |
45 | 45 | ||
46 | 46 | let minVotePower = valueOrErrorMessage(getInteger(this, kMinVotePower), "Empty kMinVotePower") | |
47 | 47 | ||
48 | 48 | let govAddr = Address(base58'3N8gfDJc5N53ePx2qBn3oQXbnhbz3Z7WFNj') | |
49 | 49 | ||
50 | 50 | let currPeriod = (basePeriod + ((height - startHeight) / periodLength)) | |
51 | 51 | ||
52 | 52 | func isCallerInGovernance (user) = if ((valueOrElse(getInteger(govAddr, (toString(user) + "_SWOP_amount")), 0) > 0)) | |
53 | 53 | then true | |
54 | 54 | else false | |
55 | 55 | ||
56 | 56 | ||
57 | 57 | func isPoolInGovernance (poolAddress) = isDefined(getInteger(govAddr, (poolAddress + "_current_pool_fraction_reward"))) | |
58 | 58 | ||
59 | 59 | ||
60 | 60 | func votingCoef () = { | |
61 | 61 | let votingDuration = (height - (startHeight + (currPeriod * periodLength))) | |
62 | 62 | if ((durationFullVotePower > votingDuration)) | |
63 | 63 | then scale8 | |
64 | 64 | else { | |
65 | 65 | let x1 = durationFullVotePower | |
66 | 66 | let y1 = scale8 | |
67 | 67 | let x2 = periodLength | |
68 | 68 | let y2 = minVotePower | |
69 | 69 | let k = (((y2 - y1) * scale8) / (x2 - x1)) | |
70 | 70 | let b = ((y1 * scale8) - (k * x1)) | |
71 | 71 | (((votingDuration * k) / scale8) + (b / scale8)) | |
72 | 72 | } | |
73 | 73 | } | |
74 | 74 | ||
75 | 75 | ||
76 | 76 | func calcDeleteEntry (caller,poolAddress,userPoolVoteSWOPnew) = { | |
77 | 77 | let deleteKeyUserPoolVoteSWOP = if (isDefined(getInteger(this, (((caller + "_") + poolAddress) + kUserPoolVoteSWOP)))) | |
78 | 78 | then DeleteEntry((((caller + "_") + poolAddress) + kUserPoolVoteSWOP)) | |
79 | 79 | else DeleteEntry(".") | |
80 | 80 | let deleteKeyUserTotalVoteSWOP = if (isDefined(getInteger(this, (caller + kUserTotalVoteSWOP)))) | |
81 | 81 | then DeleteEntry((caller + kUserTotalVoteSWOP)) | |
82 | 82 | else DeleteEntry(".") | |
83 | 83 | let deleteKeyPoolVoteSWOP = if (isDefined(getInteger(this, (poolAddress + kPoolVoteSWOP)))) | |
84 | 84 | then DeleteEntry((poolAddress + kPoolVoteSWOP)) | |
85 | 85 | else DeleteEntry(".") | |
86 | 86 | let deleteKeyTotalVoteSWOP = if (isDefined(getInteger(this, kTotalVoteSWOP))) | |
87 | 87 | then DeleteEntry(kTotalVoteSWOP) | |
88 | 88 | else DeleteEntry(".") | |
89 | 89 | [deleteKeyUserPoolVoteSWOP, deleteKeyUserTotalVoteSWOP, deleteKeyPoolVoteSWOP, deleteKeyTotalVoteSWOP] | |
90 | 90 | } | |
91 | 91 | ||
92 | 92 | ||
93 | 93 | @Callable(i) | |
94 | 94 | func votePoolWeight (poolAddress,userPoolVoteSWOPnew) = { | |
95 | 95 | let userSWOPinGovernance = valueOrErrorMessage(getInteger(govAddr, (toString(i.caller) + "_SWOP_amount")), "Empty _SWOP_amount at gov. address") | |
96 | 96 | let $t040924734 = if (isDefined(getString(this, (((toString(i.caller) + "_") + poolAddress) + kUserPoolStruc)))) | |
97 | 97 | then { | |
98 | 98 | let data = split(valueOrErrorMessage(getString(this, (((toString(i.caller) + "_") + poolAddress) + kUserPoolStruc)), "Empty kUserPoolStruc"), "_") | |
99 | 99 | $Tuple4(parseIntValue(data[0]), parseIntValue(data[1]), parseIntValue(data[2]), parseIntValue(data[3])) | |
100 | 100 | } | |
101 | 101 | else { | |
102 | 102 | let uPoolVoteSWOP = valueOrElse(getInteger(this, (((toString(i.caller) + "_") + poolAddress) + kUserPoolVoteSWOP)), 0) | |
103 | 103 | $Tuple4(uPoolVoteSWOP, uPoolVoteSWOP, currPeriod, 0) | |
104 | 104 | } | |
105 | 105 | let userPoolVoteSWOP = $t040924734._1 | |
106 | 106 | let userPoolActiveVoteSWOP = $t040924734._2 | |
107 | 107 | let userPoolVotePeriod = $t040924734._3 | |
108 | 108 | let userPoolFreezeSWOP = $t040924734._4 | |
109 | 109 | let $t047405257 = if (isDefined(getString(this, (toString(i.caller) + kUserTotalStruc)))) | |
110 | 110 | then { | |
111 | 111 | let data = split(valueOrErrorMessage(getString(this, (toString(i.caller) + kUserTotalStruc)), "Empty kUserTotalStruc"), "_") | |
112 | 112 | $Tuple3(parseIntValue(data[0]), parseIntValue(data[1]), parseIntValue(data[2])) | |
113 | 113 | } | |
114 | 114 | else { | |
115 | 115 | let uPoolTotalSWOP = valueOrElse(getInteger(this, (toString(i.caller) + kUserTotalVoteSWOP)), 0) | |
116 | 116 | $Tuple3(uPoolTotalSWOP, 0, currPeriod) | |
117 | 117 | } | |
118 | 118 | let userTotalVoteSWOP = $t047405257._1 | |
119 | 119 | let userUnvoted = $t047405257._2 | |
120 | 120 | let userUnvotedPeriod = $t047405257._3 | |
121 | 121 | let $t052625769 = if (isDefined(getString(this, (poolAddress + kPoolStruc)))) | |
122 | 122 | then { | |
123 | 123 | let data = split(valueOrErrorMessage(getString(this, (poolAddress + kPoolStruc)), "Empty kPoolStruc"), "_") | |
124 | 124 | $Tuple4(parseIntValue(data[0]), parseIntValue(data[1]), parseIntValue(data[2]), parseIntValue(data[3])) | |
125 | 125 | } | |
126 | 126 | else { | |
127 | 127 | let uPoolVoteSWOP = valueOrElse(getInteger(this, (poolAddress + kPoolVoteSWOP)), 0) | |
128 | 128 | $Tuple4(uPoolVoteSWOP, uPoolVoteSWOP, 0, 0) | |
129 | 129 | } | |
130 | 130 | let poolVoteSWOP = $t052625769._1 | |
131 | 131 | let poolActiveSWOP = $t052625769._2 | |
132 | 132 | let poolPeriod = $t052625769._3 | |
133 | 133 | let poolFreezeSWOP = $t052625769._4 | |
134 | 134 | let $t057756251 = if (isDefined(getString(this, kTotalStruc))) | |
135 | 135 | then { | |
136 | 136 | let data = split(valueOrErrorMessage(getString(this, kTotalStruc), "Empty kTotalStruc"), "_") | |
137 | 137 | $Tuple4(parseIntValue(data[0]), parseIntValue(data[1]), parseIntValue(data[2]), parseIntValue(data[3])) | |
138 | 138 | } | |
139 | 139 | else { | |
140 | 140 | let uTotalVoteSWOP = valueOrElse(getInteger(this, kTotalVoteSWOP), 0) | |
141 | 141 | $Tuple4(uTotalVoteSWOP, uTotalVoteSWOP, 0, 0) | |
142 | 142 | } | |
143 | 143 | let totalVoteSWOP = $t057756251._1 | |
144 | 144 | let totalActiveSWOP = $t057756251._2 | |
145 | 145 | let totalPeriod = $t057756251._3 | |
146 | 146 | let totalFreezeSWOP = $t057756251._4 | |
147 | 147 | let poolVoteDiffSWOP = (userPoolVoteSWOPnew - userPoolVoteSWOP) | |
148 | 148 | let userTotalVoteSWOPnew = (userTotalVoteSWOP + poolVoteDiffSWOP) | |
149 | 149 | if (!(isCallerInGovernance(i.caller))) | |
150 | 150 | then throw("This address has 0 SWOP in Governance dApp") | |
151 | 151 | else if ((userTotalVoteSWOPnew > userSWOPinGovernance)) | |
152 | 152 | then throw(((((toString(this) + " has ") + toString(userSWOPinGovernance)) + " SWOP in governance. New SWOP in voting ") + toString(userTotalVoteSWOPnew))) | |
153 | - | else if ((userPoolVoteSWOPnew >= userPoolVoteSWOP)) | |
154 | - | then { | |
155 | - | let coef = votingCoef() | |
156 | - | let userPoolActiveVoteSWOPnew = if ((userPoolVotePeriod == currPeriod)) | |
157 | - | then (userPoolActiveVoteSWOP + ((poolVoteDiffSWOP * coef) / scale8)) | |
158 | - | else (userPoolVoteSWOP + ((poolVoteDiffSWOP * coef) / scale8)) | |
159 | - | let userPoolFreezeSWOPnew = if ((userPoolVotePeriod == currPeriod)) | |
160 | - | then userPoolFreezeSWOP | |
161 | - | else userPoolVoteSWOP | |
162 | - | let userUnvotedNew = if ((userUnvoted == currPeriod)) | |
163 | - | then userUnvoted | |
164 | - | else max([0, (userUnvoted - poolVoteDiffSWOP)]) | |
165 | - | let userPoolStrucNew = ((((((toString(userPoolVoteSWOPnew) + "_") + toString(userPoolActiveVoteSWOPnew)) + "_") + toString(currPeriod)) + "_") + toString(userPoolFreezeSWOPnew)) | |
166 | - | let userPoolEntry = [StringEntry((((toString(i.caller) + "_") + poolAddress) + kUserPoolStruc), userPoolStrucNew)] | |
167 | - | let userTotalStrucNew = ((((toString(userTotalVoteSWOPnew) + "_") + toString(userUnvotedNew)) + "_") + toString(currPeriod)) | |
168 | - | let userTotalEntry = [StringEntry((toString(i.caller) + kUserTotalStruc), userTotalStrucNew)] | |
169 | - | let poolVoteSWOPnew = (poolVoteSWOP + poolVoteDiffSWOP) | |
170 | - | let poolActiveSWOPnew = if ((poolPeriod == currPeriod)) | |
171 | - | then (poolActiveSWOP + ((poolVoteDiffSWOP * coef) / scale8)) | |
172 | - | else (poolVoteSWOP + ((poolVoteDiffSWOP * coef) / scale8)) | |
173 | - | let poolFreezeSWOPnew = if ((poolPeriod == currPeriod)) | |
174 | - | then poolFreezeSWOP | |
175 | - | else poolVoteSWOP | |
176 | - | let poolStrucNew = ((((((toString(poolVoteSWOPnew) + "_") + toString(poolActiveSWOPnew)) + "_") + toString(currPeriod)) + "_") + toString(poolFreezeSWOPnew)) | |
177 | - | let poolEntry = [StringEntry((poolAddress + kPoolStruc), poolStrucNew)] | |
178 | - | let totalVoteSWOPnew = (totalVoteSWOP + poolVoteDiffSWOP) | |
179 | - | let totalActiveSWOPnew = if ((totalPeriod == currPeriod)) | |
180 | - | then (totalActiveSWOP + ((poolVoteDiffSWOP * coef) / scale8)) | |
181 | - | else (totalVoteSWOP + ((poolVoteDiffSWOP * coef) / scale8)) | |
182 | - | let totalFreezeSWOPnew = if ((poolPeriod == currPeriod)) | |
183 | - | then totalFreezeSWOP | |
184 | - | else totalVoteSWOP | |
185 | - | let totalStrucNew = ((((((toString(totalVoteSWOPnew) + "_") + toString(totalActiveSWOPnew)) + "_") + toString(totalPeriod)) + "_") + toString(totalFreezeSWOPnew)) | |
186 | - | let totalEntry = [StringEntry(kTotalStruc, totalStrucNew)] | |
187 | - | ((((userPoolEntry ++ userTotalEntry) ++ poolEntry) ++ totalEntry) ++ calcDeleteEntry(toString(i.caller), poolAddress, userPoolVoteSWOPnew)) | |
188 | - | } | |
189 | - | else { | |
190 | - | let removePoolVote = -(poolVoteDiffSWOP) | |
191 | - | let userPoolFreezeSWOPnew = if ((userPoolVotePeriod == currPeriod)) | |
192 | - | then min([userPoolFreezeSWOP, userPoolVoteSWOPnew]) | |
193 | - | else userPoolVoteSWOPnew | |
194 | - | let userPoolActiveVoteSWOPnew = if (((userPoolVoteSWOP - userPoolFreezeSWOP) == 0)) | |
195 | - | then 0 | |
196 | - | else (userPoolFreezeSWOPnew + (((userPoolActiveVoteSWOP - userPoolFreezeSWOP) * (userPoolVoteSWOPnew - userPoolFreezeSWOPnew)) / (userPoolVoteSWOP - userPoolFreezeSWOP))) | |
197 | - | let newUnvoted = max([0, (removePoolVote - (if ((userUnvotedPeriod == currPeriod)) | |
198 | - | then (userPoolVoteSWOP - userPoolFreezeSWOP) | |
199 | - | else 0))]) | |
200 | - | let userUnvotedNew = if ((userUnvotedPeriod == currPeriod)) | |
201 | - | then userUnvoted | |
202 | - | else (0 + newUnvoted) | |
203 | - | let userUnvotedPeriodNew = if ((newUnvoted > 0)) | |
204 | - | then currPeriod | |
205 | - | else userUnvotedPeriod | |
206 | - | let userPoolStrucNew = ((((((toString(userPoolVoteSWOPnew) + "_") + toString(userPoolActiveVoteSWOPnew)) + "_") + toString(currPeriod)) + "_") + toString(userPoolFreezeSWOPnew)) | |
207 | - | let userPoolEntry = [StringEntry((((toString(i.caller) + "_") + poolAddress) + kUserPoolStruc), userPoolStrucNew)] | |
208 | - | let userTotalStrucNew = ((((toString(userTotalVoteSWOPnew) + "_") + toString(userUnvotedNew)) + "_") + toString(currPeriod)) | |
209 | - | let userTotalEntry = [StringEntry((toString(i.caller) + kUserTotalStruc), userTotalStrucNew)] | |
210 | - | let poolVoteSWOPnew = (poolVoteSWOP - removePoolVote) | |
211 | - | let poolFreezeSWOPnew = if ((poolPeriod == currPeriod)) | |
212 | - | then min([poolFreezeSWOP, poolVoteSWOPnew]) | |
213 | - | else poolVoteSWOPnew | |
214 | - | let poolActiveSWOPnew = if (((poolVoteSWOP - poolFreezeSWOP) == 0)) | |
215 | - | then 0 | |
216 | - | else (poolFreezeSWOPnew + (((poolActiveSWOP - poolFreezeSWOP) * (poolVoteSWOPnew - poolFreezeSWOPnew)) / (poolVoteSWOP - poolFreezeSWOP))) | |
217 | - | let poolStrucNew = ((((((toString(poolVoteSWOPnew) + "_") + toString(poolActiveSWOPnew)) + "_") + toString(currPeriod)) + "_") + toString(poolFreezeSWOPnew)) | |
218 | - | let poolEntry = [StringEntry((poolAddress + kPoolStruc), poolStrucNew)] | |
219 | - | let totalVoteSWOPnew = (totalVoteSWOP - removePoolVote) | |
220 | - | let totalFreezeSWOPnew = if ((totalPeriod == currPeriod)) | |
221 | - | then min([totalFreezeSWOP, totalVoteSWOPnew]) | |
222 | - | else totalVoteSWOPnew | |
223 | - | let totalActiveSWOPnew = if (((totalVoteSWOP - totalFreezeSWOP) == 0)) | |
224 | - | then 0 | |
225 | - | else (totalFreezeSWOPnew + (((totalActiveSWOP - totalFreezeSWOP) * (totalVoteSWOPnew - totalFreezeSWOPnew)) / (totalVoteSWOP - totalFreezeSWOP))) | |
226 | - | let totalStrucNew = ((((((toString(totalVoteSWOPnew) + "_") + toString(totalActiveSWOPnew)) + "_") + toString(totalPeriod)) + "_") + toString(totalFreezeSWOPnew)) | |
227 | - | let totalEntry = [StringEntry(kTotalStruc, totalStrucNew)] | |
228 | - | ((((userPoolEntry ++ userTotalEntry) ++ poolEntry) ++ totalEntry) ++ calcDeleteEntry(toString(i.caller), poolAddress, userPoolVoteSWOPnew)) | |
229 | - | } | |
153 | + | else if ((0 > userTotalVoteSWOPnew)) | |
154 | + | then throw("New userPoolVoteSWOPnew < 0") | |
155 | + | else if ((userPoolVoteSWOPnew >= userPoolVoteSWOP)) | |
156 | + | then { | |
157 | + | let coef = votingCoef() | |
158 | + | let userPoolActiveVoteSWOPnew = if ((userPoolVotePeriod == currPeriod)) | |
159 | + | then (userPoolActiveVoteSWOP + ((poolVoteDiffSWOP * coef) / scale8)) | |
160 | + | else (userPoolVoteSWOP + ((poolVoteDiffSWOP * coef) / scale8)) | |
161 | + | let userPoolFreezeSWOPnew = if ((userPoolVotePeriod == currPeriod)) | |
162 | + | then userPoolFreezeSWOP | |
163 | + | else userPoolVoteSWOP | |
164 | + | let userUnvotedNew = if ((userUnvoted == currPeriod)) | |
165 | + | then userUnvoted | |
166 | + | else max([0, (userUnvoted - poolVoteDiffSWOP)]) | |
167 | + | let userPoolStrucNew = ((((((toString(userPoolVoteSWOPnew) + "_") + toString(userPoolActiveVoteSWOPnew)) + "_") + toString(currPeriod)) + "_") + toString(userPoolFreezeSWOPnew)) | |
168 | + | let userPoolEntry = [StringEntry((((toString(i.caller) + "_") + poolAddress) + kUserPoolStruc), userPoolStrucNew)] | |
169 | + | let userTotalStrucNew = ((((toString(userTotalVoteSWOPnew) + "_") + toString(userUnvotedNew)) + "_") + toString(currPeriod)) | |
170 | + | let userTotalEntry = [StringEntry((toString(i.caller) + kUserTotalStruc), userTotalStrucNew)] | |
171 | + | let poolVoteSWOPnew = (poolVoteSWOP + poolVoteDiffSWOP) | |
172 | + | let poolActiveSWOPnew = if ((poolPeriod == currPeriod)) | |
173 | + | then (poolActiveSWOP + ((poolVoteDiffSWOP * coef) / scale8)) | |
174 | + | else (poolVoteSWOP + ((poolVoteDiffSWOP * coef) / scale8)) | |
175 | + | let poolFreezeSWOPnew = if ((poolPeriod == currPeriod)) | |
176 | + | then poolFreezeSWOP | |
177 | + | else poolVoteSWOP | |
178 | + | let poolStrucNew = ((((((toString(poolVoteSWOPnew) + "_") + toString(poolActiveSWOPnew)) + "_") + toString(currPeriod)) + "_") + toString(poolFreezeSWOPnew)) | |
179 | + | let poolEntry = [StringEntry((poolAddress + kPoolStruc), poolStrucNew)] | |
180 | + | let totalVoteSWOPnew = (totalVoteSWOP + poolVoteDiffSWOP) | |
181 | + | let totalActiveSWOPnew = if ((totalPeriod == currPeriod)) | |
182 | + | then (totalActiveSWOP + ((poolVoteDiffSWOP * coef) / scale8)) | |
183 | + | else (totalVoteSWOP + ((poolVoteDiffSWOP * coef) / scale8)) | |
184 | + | let totalFreezeSWOPnew = if ((poolPeriod == currPeriod)) | |
185 | + | then totalFreezeSWOP | |
186 | + | else totalVoteSWOP | |
187 | + | let totalStrucNew = ((((((toString(totalVoteSWOPnew) + "_") + toString(totalActiveSWOPnew)) + "_") + toString(totalPeriod)) + "_") + toString(totalFreezeSWOPnew)) | |
188 | + | let totalEntry = [StringEntry(kTotalStruc, totalStrucNew)] | |
189 | + | ((((userPoolEntry ++ userTotalEntry) ++ poolEntry) ++ totalEntry) ++ calcDeleteEntry(toString(i.caller), poolAddress, userPoolVoteSWOPnew)) | |
190 | + | } | |
191 | + | else { | |
192 | + | let removePoolVote = -(poolVoteDiffSWOP) | |
193 | + | let userPoolFreezeSWOPnew = if ((userPoolVotePeriod == currPeriod)) | |
194 | + | then min([userPoolFreezeSWOP, userPoolVoteSWOPnew]) | |
195 | + | else userPoolVoteSWOPnew | |
196 | + | let userPoolActiveVoteSWOPnew = if (((userPoolVoteSWOP - userPoolFreezeSWOP) == 0)) | |
197 | + | then 0 | |
198 | + | else (userPoolFreezeSWOPnew + (((userPoolActiveVoteSWOP - userPoolFreezeSWOP) * (userPoolVoteSWOPnew - userPoolFreezeSWOPnew)) / (userPoolVoteSWOP - userPoolFreezeSWOP))) | |
199 | + | let newUnvoted = max([0, (removePoolVote - (if ((userUnvotedPeriod == currPeriod)) | |
200 | + | then (userPoolVoteSWOP - userPoolFreezeSWOP) | |
201 | + | else 0))]) | |
202 | + | let userUnvotedNew = if ((userUnvotedPeriod == currPeriod)) | |
203 | + | then userUnvoted | |
204 | + | else (0 + newUnvoted) | |
205 | + | let userUnvotedPeriodNew = if ((newUnvoted > 0)) | |
206 | + | then currPeriod | |
207 | + | else userUnvotedPeriod | |
208 | + | let userPoolStrucNew = ((((((toString(userPoolVoteSWOPnew) + "_") + toString(userPoolActiveVoteSWOPnew)) + "_") + toString(currPeriod)) + "_") + toString(userPoolFreezeSWOPnew)) | |
209 | + | let userPoolEntry = [StringEntry((((toString(i.caller) + "_") + poolAddress) + kUserPoolStruc), userPoolStrucNew)] | |
210 | + | let userTotalStrucNew = ((((toString(userTotalVoteSWOPnew) + "_") + toString(userUnvotedNew)) + "_") + toString(currPeriod)) | |
211 | + | let userTotalEntry = [StringEntry((toString(i.caller) + kUserTotalStruc), userTotalStrucNew)] | |
212 | + | let poolVoteSWOPnew = (poolVoteSWOP - removePoolVote) | |
213 | + | let poolFreezeSWOPnew = if ((poolPeriod == currPeriod)) | |
214 | + | then min([poolFreezeSWOP, poolVoteSWOPnew]) | |
215 | + | else poolVoteSWOPnew | |
216 | + | let poolActiveSWOPnew = if (((poolVoteSWOP - poolFreezeSWOP) == 0)) | |
217 | + | then 0 | |
218 | + | else (poolFreezeSWOPnew + (((poolActiveSWOP - poolFreezeSWOP) * (poolVoteSWOPnew - poolFreezeSWOPnew)) / (poolVoteSWOP - poolFreezeSWOP))) | |
219 | + | let poolStrucNew = ((((((toString(poolVoteSWOPnew) + "_") + toString(poolActiveSWOPnew)) + "_") + toString(currPeriod)) + "_") + toString(poolFreezeSWOPnew)) | |
220 | + | let poolEntry = [StringEntry((poolAddress + kPoolStruc), poolStrucNew)] | |
221 | + | let totalVoteSWOPnew = (totalVoteSWOP - removePoolVote) | |
222 | + | let totalFreezeSWOPnew = if ((totalPeriod == currPeriod)) | |
223 | + | then min([totalFreezeSWOP, totalVoteSWOPnew]) | |
224 | + | else totalVoteSWOPnew | |
225 | + | let totalActiveSWOPnew = if (((totalVoteSWOP - totalFreezeSWOP) == 0)) | |
226 | + | then 0 | |
227 | + | else (totalFreezeSWOPnew + (((totalActiveSWOP - totalFreezeSWOP) * (totalVoteSWOPnew - totalFreezeSWOPnew)) / (totalVoteSWOP - totalFreezeSWOP))) | |
228 | + | let totalStrucNew = ((((((toString(totalVoteSWOPnew) + "_") + toString(totalActiveSWOPnew)) + "_") + toString(totalPeriod)) + "_") + toString(totalFreezeSWOPnew)) | |
229 | + | let totalEntry = [StringEntry(kTotalStruc, totalStrucNew)] | |
230 | + | ((((userPoolEntry ++ userTotalEntry) ++ poolEntry) ++ totalEntry) ++ calcDeleteEntry(toString(i.caller), poolAddress, userPoolVoteSWOPnew)) | |
231 | + | } | |
230 | 232 | } | |
231 | 233 | ||
232 | 234 |
github/deemru/w8io/169f3d6 46.16 ms ◑