tx · 6vhLGh96MbmdqQWmujMthfGUM6XwRatwQJYQ9mMgmP58 3MuqubsQAq9mrsN65SePHeThcN3JVAbgZ9d: -0.01100000 Waves 2023.05.31 11:32 [2601903] smart account 3MuqubsQAq9mrsN65SePHeThcN3JVAbgZ9d > SELF 0.00000000 Waves
{ "type": 13, "id": "6vhLGh96MbmdqQWmujMthfGUM6XwRatwQJYQ9mMgmP58", "fee": 1100000, "feeAssetId": null, "timestamp": 1685521976879, "version": 2, "chainId": 84, "sender": "3MuqubsQAq9mrsN65SePHeThcN3JVAbgZ9d", "senderPublicKey": "GWTozVWP9MvUxrEuz1BPrNAbtLYAec9LrT4U82jWG6KX", "proofs": [ "UZW6EyJfjZvb6a46X9kXre9B35kVVauh6vg3z6jEqkFxYhJxzG7SHxMqEF5UFjEGkJMCX6PGhZqJGfFQGHuh91e" ], "script": "base64:BgLXCggCEgcKBQgICAEBEgASAwoBARIAEgMKAQESACIJc2VwYXJhdG9yIhBjb250cmFjdEZpbGVuYW1lIgtFUE9DSF9DT1VOVCIOa2V5RXBvY2hMZW5ndGgiE2tleUVtaXNzaW9uQ29udHJhY3QiGWtleVZvdGluZ0VtaXNzaW9uQ29udHJhY3QiE2tleUJvb3N0aW5nQ29udHJhY3QiDGtleVRocmVzaG9sZCIPa2V5UmF0ZVBlckJsb2NrIhJrZXlSYXRlUGVyQmxvY2tNYXgiEWtleVJhdGVDaGFuZ2VTdGVwIg5rZXlTdGFydEhlaWdodCIPa2V5Vm90aW5nUmVzdWx0Igh0aHJvd0VyciIBcyIPZ2V0U3RyaW5nT3JGYWlsIgNrZXkiDGdldEludE9yRmFpbCIKdG90YWxWb3RlcyINdG90YWxJbmNyZWFzZSIMdG90YWxDdXJyZW50Ig10b3RhbERlY3JlYXNlIgdrZXlWb3RlIgx2b3RlckFkZHJlc3MiC3N0YXJ0SGVpZ2h0IgxrZXlWb3RlVmFsdWUiCWd3eEFtb3VudCIEdm90ZSIQYm9vc3RpbmdDb250cmFjdCIQZW1p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WwJAAIBAiRTdHJpY3QgdmFsdWUgaXMgbm90IGVxdWFsIHRvIGl0c2VsZi4FA25pbAECYUsBAmFMAAQCYU0EAUkJAQFKAAMJAAECBQFJAgpCeXRlVmVjdG9yBAFOBQFJBQFOAwkAAQIFAUkCBFVuaXQIBQJhSw9zZW5kZXJQdWJsaWNLZXkJAAIBAgtNYXRjaCBlcnJvcgkA9AMDCAUCYUsJYm9keUJ5dGVzCQCRAwIIBQJhSwZwcm9vZnMAAAUCYU211i/S", "height": 2601903, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: Bw1XQnLWJhCfBzyZvcvJn1KYeMGu76eap1zCdAYY3nw4 Next: 3mEnHtDAiz3rdVtukSzPUohFFnqja5FjmDC7orgw374o Diff:
Old | New | Differences | |
---|---|---|---|
5 | 5 | ||
6 | 6 | let contractFilename = "voting_emission_rate.ride" | |
7 | 7 | ||
8 | + | let EPOCH_COUNT = 4 | |
9 | + | ||
8 | 10 | let keyEpochLength = makeString(["%s", "epochLength"], separator) | |
9 | 11 | ||
10 | 12 | let keyEmissionContract = makeString(["%s", "emissionContract"], separator) | |
13 | + | ||
14 | + | let keyVotingEmissionContract = makeString(["%s", "votingEmissionContract"], separator) | |
11 | 15 | ||
12 | 16 | let keyBoostingContract = makeString(["%s", "boostingContract"], separator) | |
13 | 17 | ||
51 | 55 | let boostingContract = addressFromStringValue(getStringOrFail(keyBoostingContract)) | |
52 | 56 | ||
53 | 57 | let emissionContract = addressFromStringValue(getStringOrFail(keyEmissionContract)) | |
58 | + | ||
59 | + | let votingEmissionContract = addressFromStringValue(getStringOrFail(keyVotingEmissionContract)) | |
54 | 60 | ||
55 | 61 | func keyManagerPublicKey () = "%s__managerPublicKey" | |
56 | 62 | ||
118 | 124 | } | |
119 | 125 | ||
120 | 126 | ||
127 | + | func getEpochLength (votingEmissionContract) = { | |
128 | + | let votingEpochLength = getIntegerValue(votingEmissionContract, keyEpochLength) | |
129 | + | let votingStartLength = getIntegerValue(votingEmissionContract, keyStartHeight) | |
130 | + | (((votingStartLength + (votingEpochLength * EPOCH_COUNT)) - height) - 1) | |
131 | + | } | |
132 | + | ||
133 | + | ||
121 | 134 | @Callable(i) | |
122 | - | func constructor (boostingContractPrm,emissionContractPrm, | |
135 | + | func constructor (boostingContractPrm,emissionContractPrm,votingEmissionContractPrm,threshold,rateChangeStep) = { | |
123 | 136 | let checks = [mustManager(i), if (isDefined(addressFromString(boostingContractPrm))) | |
124 | 137 | then true | |
125 | 138 | else throwErr("Invalid boosting contract address"), if (isDefined(addressFromString(emissionContractPrm))) | |
126 | 139 | then true | |
127 | - | else throwErr("Invalid emission contract address"), if (( | |
140 | + | else throwErr("Invalid emission contract address"), if (isDefined(addressFromString(votingEmissionContractPrm))) | |
128 | 141 | then true | |
129 | - | else throwErr("Invalid | |
142 | + | else throwErr("Invalid emission contract address"), if ((threshold > 0)) | |
130 | 143 | then true | |
131 | 144 | else throwErr("invalid threshold"), if ((rateChangeStep > 0)) | |
132 | 145 | then true | |
133 | 146 | else throwErr("invalid rateChangeStep")] | |
134 | 147 | if ((checks == checks)) | |
135 | - | then $Tuple2([StringEntry(keyBoostingContract, boostingContractPrm), StringEntry(keyEmissionContract, emissionContractPrm), IntegerEntry(keyEpochLength, votingDurationPrm), IntegerEntry(keyThreshold, threshold), IntegerEntry(keyRateChangeStep, rateChangeStep), IntegerEntry(keyStartHeight, height), StringEntry(keyVotingResult, totalVotes("0", "0", "0"))], unit) | |
148 | + | then { | |
149 | + | let votingEmission = addressFromStringValue(votingEmissionContractPrm) | |
150 | + | $Tuple2([StringEntry(keyBoostingContract, boostingContractPrm), StringEntry(keyEmissionContract, emissionContractPrm), StringEntry(keyVotingEmissionContract, votingEmissionContractPrm), IntegerEntry(keyEpochLength, getEpochLength(votingEmission)), IntegerEntry(keyThreshold, threshold), IntegerEntry(keyRateChangeStep, rateChangeStep), IntegerEntry(keyStartHeight, height), StringEntry(keyVotingResult, totalVotes("0", "0", "0"))], unit) | |
151 | + | } | |
136 | 152 | else throw("Strict value is not equal to itself.") | |
137 | 153 | } | |
138 | 154 | ||
252 | 268 | @Callable(i) | |
253 | 269 | func finalize () = { | |
254 | 270 | let votingFinishHeight = (getIntegerValue(keyStartHeight) + value(getInteger(keyEpochLength))) | |
255 | - | let checks = [if ((height >= votingFinishHeight)) | |
256 | - | then true | |
257 | - | else throwErr("insufficient height for completion")] | |
258 | - | if ((checks == checks)) | |
271 | + | if ((height >= votingFinishHeight)) | |
259 | 272 | then { | |
260 | 273 | let votingResult = split(value(getString(keyVotingResult)), separator) | |
261 | 274 | let votesForIncrease = parseIntValue(votingResult[1]) | |
263 | 276 | let votesForDecrease = parseIntValue(votingResult[3]) | |
264 | 277 | let allVotes = ((votesForIncrease + votesForCurrent) + votesForDecrease) | |
265 | 278 | let threshold = getIntOrFail(keyThreshold) | |
266 | - | let $ | |
267 | - | let increasedRate = $ | |
268 | - | let currentRate = $ | |
269 | - | let decreasedRate = $ | |
279 | + | let $t096309710 = getRateChangeAmountsINTERNAL() | |
280 | + | let increasedRate = $t096309710._1 | |
281 | + | let currentRate = $t096309710._2 | |
282 | + | let decreasedRate = $t096309710._3 | |
270 | 283 | let votesList = [votesForIncrease, votesForCurrent, votesForDecrease] | |
271 | 284 | let newRate = if (if ((threshold > allVotes)) | |
272 | 285 | then true | |
277 | 290 | else decreasedRate | |
278 | 291 | let changeRateInvokes = match newRate { | |
279 | 292 | case r: Int => | |
280 | - | unit | |
293 | + | let emissionChangeRate = invoke(emissionContract, "changeRatePerBlock", [r], nil) | |
294 | + | if ((emissionChangeRate == emissionChangeRate)) | |
295 | + | then emissionChangeRate | |
296 | + | else throw("Strict value is not equal to itself.") | |
281 | 297 | case _ => | |
282 | 298 | unit | |
283 | 299 | } | |
284 | 300 | if ((changeRateInvokes == changeRateInvokes)) | |
285 | - | then [IntegerEntry(keyStartHeight, height), StringEntry(keyVotingResult, totalVotes("0", "0", "0"))] | |
301 | + | then [IntegerEntry(keyStartHeight, height), IntegerEntry(keyEpochLength, getEpochLength(votingEmissionContract)), StringEntry(keyVotingResult, totalVotes("0", "0", "0"))] | |
286 | 302 | else throw("Strict value is not equal to itself.") | |
287 | 303 | } | |
288 | - | else | |
304 | + | else nil | |
289 | 305 | } | |
290 | 306 | ||
291 | 307 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let separator = "__" | |
5 | 5 | ||
6 | 6 | let contractFilename = "voting_emission_rate.ride" | |
7 | 7 | ||
8 | + | let EPOCH_COUNT = 4 | |
9 | + | ||
8 | 10 | let keyEpochLength = makeString(["%s", "epochLength"], separator) | |
9 | 11 | ||
10 | 12 | let keyEmissionContract = makeString(["%s", "emissionContract"], separator) | |
13 | + | ||
14 | + | let keyVotingEmissionContract = makeString(["%s", "votingEmissionContract"], separator) | |
11 | 15 | ||
12 | 16 | let keyBoostingContract = makeString(["%s", "boostingContract"], separator) | |
13 | 17 | ||
14 | 18 | let keyThreshold = makeString(["%s", "votingThreshold"], separator) | |
15 | 19 | ||
16 | 20 | let keyRatePerBlock = makeString(["%s%s", "ratePerBlock", "current"], separator) | |
17 | 21 | ||
18 | 22 | let keyRatePerBlockMax = makeString(["%s%s", "ratePerBlockMax", "current"], separator) | |
19 | 23 | ||
20 | 24 | let keyRateChangeStep = makeString(["%s", "rateChangeStep"], separator) | |
21 | 25 | ||
22 | 26 | let keyStartHeight = makeString(["%s", "startHeight"], separator) | |
23 | 27 | ||
24 | 28 | let keyVotingResult = makeString(["%s", "votingResult"], separator) | |
25 | 29 | ||
26 | 30 | func throwErr (s) = throw(((contractFilename + ": ") + s)) | |
27 | 31 | ||
28 | 32 | ||
29 | 33 | func getStringOrFail (key) = valueOrErrorMessage(getString(this, key), (key + " is not defined")) | |
30 | 34 | ||
31 | 35 | ||
32 | 36 | func getIntOrFail (key) = valueOrErrorMessage(getInteger(this, key), (key + " is not defined")) | |
33 | 37 | ||
34 | 38 | ||
35 | 39 | func totalVotes (totalIncrease,totalCurrent,totalDecrease) = makeString(["%d%d%d", totalIncrease, totalCurrent, totalDecrease], separator) | |
36 | 40 | ||
37 | 41 | ||
38 | 42 | func keyVote (voterAddress,startHeight) = makeString(["%s%s%d", "vote", voterAddress, toString(startHeight)], separator) | |
39 | 43 | ||
40 | 44 | ||
41 | 45 | func keyVoteValue (gwxAmount,vote) = { | |
42 | 46 | let key = if ((vote == 1)) | |
43 | 47 | then makeString(["%d%s", gwxAmount, "increase"], separator) | |
44 | 48 | else if ((vote == -1)) | |
45 | 49 | then makeString(["%d%s", gwxAmount, "decrease"], separator) | |
46 | 50 | else makeString(["%d%s", gwxAmount, "current"], separator) | |
47 | 51 | key | |
48 | 52 | } | |
49 | 53 | ||
50 | 54 | ||
51 | 55 | let boostingContract = addressFromStringValue(getStringOrFail(keyBoostingContract)) | |
52 | 56 | ||
53 | 57 | let emissionContract = addressFromStringValue(getStringOrFail(keyEmissionContract)) | |
58 | + | ||
59 | + | let votingEmissionContract = addressFromStringValue(getStringOrFail(keyVotingEmissionContract)) | |
54 | 60 | ||
55 | 61 | func keyManagerPublicKey () = "%s__managerPublicKey" | |
56 | 62 | ||
57 | 63 | ||
58 | 64 | func keyManagerVaultAddress () = "%s__managerVaultAddress" | |
59 | 65 | ||
60 | 66 | ||
61 | 67 | func getManagerVaultAddressOrThis () = match getString(keyManagerVaultAddress()) { | |
62 | 68 | case s: String => | |
63 | 69 | addressFromStringValue(s) | |
64 | 70 | case _ => | |
65 | 71 | this | |
66 | 72 | } | |
67 | 73 | ||
68 | 74 | ||
69 | 75 | func managerPublicKeyOrUnit () = { | |
70 | 76 | let managerVaultAddress = getManagerVaultAddressOrThis() | |
71 | 77 | match getString(managerVaultAddress, keyManagerPublicKey()) { | |
72 | 78 | case s: String => | |
73 | 79 | fromBase58String(s) | |
74 | 80 | case _: Unit => | |
75 | 81 | unit | |
76 | 82 | case _ => | |
77 | 83 | throw("Match error") | |
78 | 84 | } | |
79 | 85 | } | |
80 | 86 | ||
81 | 87 | ||
82 | 88 | func isManager (i) = match managerPublicKeyOrUnit() { | |
83 | 89 | case pk: ByteVector => | |
84 | 90 | (i.callerPublicKey == pk) | |
85 | 91 | case _: Unit => | |
86 | 92 | (i.caller == this) | |
87 | 93 | case _ => | |
88 | 94 | throw("Match error") | |
89 | 95 | } | |
90 | 96 | ||
91 | 97 | ||
92 | 98 | func mustManager (i) = if (isManager(i)) | |
93 | 99 | then true | |
94 | 100 | else throwErr("permission denied") | |
95 | 101 | ||
96 | 102 | ||
97 | 103 | func asInt (val) = match val { | |
98 | 104 | case valInt: Int => | |
99 | 105 | valInt | |
100 | 106 | case _ => | |
101 | 107 | throwErr("failed to cast into Integer") | |
102 | 108 | } | |
103 | 109 | ||
104 | 110 | ||
105 | 111 | func calcNewRate (ratePerBlockMax,ratePerBlock,changeStep) = { | |
106 | 112 | let maxAllowed = fraction(100, ratePerBlockMax, 120) | |
107 | 113 | let increasedRate = min([fraction((100 + changeStep), ratePerBlock, 100), maxAllowed]) | |
108 | 114 | let decreasedRate = max([fraction((100 - changeStep), ratePerBlock, 100), 0]) | |
109 | 115 | $Tuple3(increasedRate, ratePerBlock, decreasedRate) | |
110 | 116 | } | |
111 | 117 | ||
112 | 118 | ||
113 | 119 | func getRateChangeAmountsINTERNAL () = { | |
114 | 120 | let ratePerBlockMax = getIntegerValue(emissionContract, keyRatePerBlockMax) | |
115 | 121 | let ratePerBlock = getIntegerValue(emissionContract, keyRatePerBlock) | |
116 | 122 | let rateChangeStep = getIntegerValue(this, keyRateChangeStep) | |
117 | 123 | calcNewRate(ratePerBlockMax, ratePerBlock, rateChangeStep) | |
118 | 124 | } | |
119 | 125 | ||
120 | 126 | ||
127 | + | func getEpochLength (votingEmissionContract) = { | |
128 | + | let votingEpochLength = getIntegerValue(votingEmissionContract, keyEpochLength) | |
129 | + | let votingStartLength = getIntegerValue(votingEmissionContract, keyStartHeight) | |
130 | + | (((votingStartLength + (votingEpochLength * EPOCH_COUNT)) - height) - 1) | |
131 | + | } | |
132 | + | ||
133 | + | ||
121 | 134 | @Callable(i) | |
122 | - | func constructor (boostingContractPrm,emissionContractPrm, | |
135 | + | func constructor (boostingContractPrm,emissionContractPrm,votingEmissionContractPrm,threshold,rateChangeStep) = { | |
123 | 136 | let checks = [mustManager(i), if (isDefined(addressFromString(boostingContractPrm))) | |
124 | 137 | then true | |
125 | 138 | else throwErr("Invalid boosting contract address"), if (isDefined(addressFromString(emissionContractPrm))) | |
126 | 139 | then true | |
127 | - | else throwErr("Invalid emission contract address"), if (( | |
140 | + | else throwErr("Invalid emission contract address"), if (isDefined(addressFromString(votingEmissionContractPrm))) | |
128 | 141 | then true | |
129 | - | else throwErr("Invalid | |
142 | + | else throwErr("Invalid emission contract address"), if ((threshold > 0)) | |
130 | 143 | then true | |
131 | 144 | else throwErr("invalid threshold"), if ((rateChangeStep > 0)) | |
132 | 145 | then true | |
133 | 146 | else throwErr("invalid rateChangeStep")] | |
134 | 147 | if ((checks == checks)) | |
135 | - | then $Tuple2([StringEntry(keyBoostingContract, boostingContractPrm), StringEntry(keyEmissionContract, emissionContractPrm), IntegerEntry(keyEpochLength, votingDurationPrm), IntegerEntry(keyThreshold, threshold), IntegerEntry(keyRateChangeStep, rateChangeStep), IntegerEntry(keyStartHeight, height), StringEntry(keyVotingResult, totalVotes("0", "0", "0"))], unit) | |
148 | + | then { | |
149 | + | let votingEmission = addressFromStringValue(votingEmissionContractPrm) | |
150 | + | $Tuple2([StringEntry(keyBoostingContract, boostingContractPrm), StringEntry(keyEmissionContract, emissionContractPrm), StringEntry(keyVotingEmissionContract, votingEmissionContractPrm), IntegerEntry(keyEpochLength, getEpochLength(votingEmission)), IntegerEntry(keyThreshold, threshold), IntegerEntry(keyRateChangeStep, rateChangeStep), IntegerEntry(keyStartHeight, height), StringEntry(keyVotingResult, totalVotes("0", "0", "0"))], unit) | |
151 | + | } | |
136 | 152 | else throw("Strict value is not equal to itself.") | |
137 | 153 | } | |
138 | 154 | ||
139 | 155 | ||
140 | 156 | ||
141 | 157 | @Callable(i) | |
142 | 158 | func getRateChangeAmountsREADONLY () = $Tuple2(nil, getRateChangeAmountsINTERNAL()) | |
143 | 159 | ||
144 | 160 | ||
145 | 161 | ||
146 | 162 | @Callable(i) | |
147 | 163 | func vote (inFavor) = { | |
148 | 164 | let startHeight = getIntegerValue(keyStartHeight) | |
149 | 165 | let votingFinishHeight = (startHeight + getIntegerValue(keyEpochLength)) | |
150 | 166 | let userAddress = toString(i.caller) | |
151 | 167 | let checks = [if ((votingFinishHeight > height)) | |
152 | 168 | then true | |
153 | 169 | else throwErr("too late to vote"), if (containsElement([1, 0, -1], inFavor)) | |
154 | 170 | then true | |
155 | 171 | else throwErr("not valid argument"), if (!(isDefined(getString(keyVote(userAddress, startHeight))))) | |
156 | 172 | then true | |
157 | 173 | else throwErr("you already voted")] | |
158 | 174 | if ((checks == checks)) | |
159 | 175 | then { | |
160 | 176 | let gwxAmount = invoke(boostingContract, "getUserGwxAmountAtHeightREADONLY", [userAddress, votingFinishHeight], nil) | |
161 | 177 | let notZero = if ((asInt(gwxAmount) > 0)) | |
162 | 178 | then true | |
163 | 179 | else throwErr("you don't have gwx") | |
164 | 180 | if ((notZero == notZero)) | |
165 | 181 | then { | |
166 | 182 | let votingResult = split(getStringValue(keyVotingResult), separator) | |
167 | 183 | let votesForIncrease = votingResult[1] | |
168 | 184 | let votesForCurrent = votingResult[2] | |
169 | 185 | let votesForDecrease = votingResult[3] | |
170 | 186 | let newPositiveAndNegativeVotes = if ((inFavor == 1)) | |
171 | 187 | then { | |
172 | 188 | let newIncreaseVotes = (parseIntValue(votesForIncrease) + asInt(gwxAmount)) | |
173 | 189 | [toString(newIncreaseVotes), votesForCurrent, votesForDecrease] | |
174 | 190 | } | |
175 | 191 | else if ((inFavor == -1)) | |
176 | 192 | then { | |
177 | 193 | let newDecreaseVotes = (parseIntValue(votesForDecrease) + asInt(gwxAmount)) | |
178 | 194 | [votesForIncrease, votesForCurrent, toString(newDecreaseVotes)] | |
179 | 195 | } | |
180 | 196 | else { | |
181 | 197 | let newCurrentVotes = (parseIntValue(votesForCurrent) + asInt(gwxAmount)) | |
182 | 198 | [votesForIncrease, toString(newCurrentVotes), votesForDecrease] | |
183 | 199 | } | |
184 | 200 | let voteKey = keyVote(toString(i.caller), startHeight) | |
185 | 201 | let voteValue = keyVoteValue(toString(asInt(gwxAmount)), inFavor) | |
186 | 202 | $Tuple2([StringEntry(keyVotingResult, totalVotes(newPositiveAndNegativeVotes[0], newPositiveAndNegativeVotes[1], newPositiveAndNegativeVotes[2])), StringEntry(voteKey, voteValue)], unit) | |
187 | 203 | } | |
188 | 204 | else throw("Strict value is not equal to itself.") | |
189 | 205 | } | |
190 | 206 | else throw("Strict value is not equal to itself.") | |
191 | 207 | } | |
192 | 208 | ||
193 | 209 | ||
194 | 210 | ||
195 | 211 | @Callable(i) | |
196 | 212 | func cancelVote () = { | |
197 | 213 | let startHeight = getIntegerValue(keyStartHeight) | |
198 | 214 | let votingFinishHeight = (startHeight + getIntegerValue(keyEpochLength)) | |
199 | 215 | let userAddress = if ((i.caller == this)) | |
200 | 216 | then toString(i.originCaller) | |
201 | 217 | else toString(i.caller) | |
202 | 218 | let checks = [if ((votingFinishHeight > height)) | |
203 | 219 | then true | |
204 | 220 | else throwErr("too late to cancel vote"), if (isDefined(getString(keyVotingResult))) | |
205 | 221 | then true | |
206 | 222 | else throwErr("no vote"), if (isDefined(getString(keyVote(userAddress, startHeight)))) | |
207 | 223 | then true | |
208 | 224 | else throwErr("no user vote")] | |
209 | 225 | if ((checks == checks)) | |
210 | 226 | then { | |
211 | 227 | let vote = split(getStringValue(keyVote(userAddress, startHeight)), separator) | |
212 | 228 | let voteValue = vote[1] | |
213 | 229 | let voteType = vote[2] | |
214 | 230 | let votingResult = split(getStringValue(keyVotingResult), separator) | |
215 | 231 | let votesForIncrease = votingResult[1] | |
216 | 232 | let votesForCurrent = votingResult[2] | |
217 | 233 | let votesForDecrease = votingResult[3] | |
218 | 234 | let actions = if ((voteType == "increase")) | |
219 | 235 | then { | |
220 | 236 | let newIncreaseVotes = (parseIntValue(votesForIncrease) - parseIntValue(voteValue)) | |
221 | 237 | [StringEntry(keyVotingResult, totalVotes(toString(newIncreaseVotes), votesForCurrent, votesForDecrease))] | |
222 | 238 | } | |
223 | 239 | else if ((voteType == "decrease")) | |
224 | 240 | then { | |
225 | 241 | let newDecreaseVotes = (parseIntValue(votesForDecrease) - parseIntValue(voteValue)) | |
226 | 242 | [StringEntry(keyVotingResult, totalVotes(votesForIncrease, votesForCurrent, toString(newDecreaseVotes)))] | |
227 | 243 | } | |
228 | 244 | else { | |
229 | 245 | let newCurrentVotes = (parseIntValue(votesForCurrent) - parseIntValue(voteValue)) | |
230 | 246 | [StringEntry(keyVotingResult, totalVotes(votesForIncrease, toString(newCurrentVotes), votesForDecrease))] | |
231 | 247 | } | |
232 | 248 | let defaultActions = [DeleteEntry(keyVote(userAddress, startHeight))] | |
233 | 249 | (actions ++ defaultActions) | |
234 | 250 | } | |
235 | 251 | else throw("Strict value is not equal to itself.") | |
236 | 252 | } | |
237 | 253 | ||
238 | 254 | ||
239 | 255 | ||
240 | 256 | @Callable(i) | |
241 | 257 | func setThreshold (newThreshold) = { | |
242 | 258 | let checks = [mustManager(i), if ((newThreshold > 0)) | |
243 | 259 | then true | |
244 | 260 | else throwErr("invalid threshold")] | |
245 | 261 | if ((checks == checks)) | |
246 | 262 | then $Tuple2([IntegerEntry(keyThreshold, newThreshold)], unit) | |
247 | 263 | else throw("Strict value is not equal to itself.") | |
248 | 264 | } | |
249 | 265 | ||
250 | 266 | ||
251 | 267 | ||
252 | 268 | @Callable(i) | |
253 | 269 | func finalize () = { | |
254 | 270 | let votingFinishHeight = (getIntegerValue(keyStartHeight) + value(getInteger(keyEpochLength))) | |
255 | - | let checks = [if ((height >= votingFinishHeight)) | |
256 | - | then true | |
257 | - | else throwErr("insufficient height for completion")] | |
258 | - | if ((checks == checks)) | |
271 | + | if ((height >= votingFinishHeight)) | |
259 | 272 | then { | |
260 | 273 | let votingResult = split(value(getString(keyVotingResult)), separator) | |
261 | 274 | let votesForIncrease = parseIntValue(votingResult[1]) | |
262 | 275 | let votesForCurrent = parseIntValue(votingResult[2]) | |
263 | 276 | let votesForDecrease = parseIntValue(votingResult[3]) | |
264 | 277 | let allVotes = ((votesForIncrease + votesForCurrent) + votesForDecrease) | |
265 | 278 | let threshold = getIntOrFail(keyThreshold) | |
266 | - | let $ | |
267 | - | let increasedRate = $ | |
268 | - | let currentRate = $ | |
269 | - | let decreasedRate = $ | |
279 | + | let $t096309710 = getRateChangeAmountsINTERNAL() | |
280 | + | let increasedRate = $t096309710._1 | |
281 | + | let currentRate = $t096309710._2 | |
282 | + | let decreasedRate = $t096309710._3 | |
270 | 283 | let votesList = [votesForIncrease, votesForCurrent, votesForDecrease] | |
271 | 284 | let newRate = if (if ((threshold > allVotes)) | |
272 | 285 | then true | |
273 | 286 | else (votesForCurrent == max(votesList))) | |
274 | 287 | then unit | |
275 | 288 | else if ((votesForIncrease == max(votesList))) | |
276 | 289 | then increasedRate | |
277 | 290 | else decreasedRate | |
278 | 291 | let changeRateInvokes = match newRate { | |
279 | 292 | case r: Int => | |
280 | - | unit | |
293 | + | let emissionChangeRate = invoke(emissionContract, "changeRatePerBlock", [r], nil) | |
294 | + | if ((emissionChangeRate == emissionChangeRate)) | |
295 | + | then emissionChangeRate | |
296 | + | else throw("Strict value is not equal to itself.") | |
281 | 297 | case _ => | |
282 | 298 | unit | |
283 | 299 | } | |
284 | 300 | if ((changeRateInvokes == changeRateInvokes)) | |
285 | - | then [IntegerEntry(keyStartHeight, height), StringEntry(keyVotingResult, totalVotes("0", "0", "0"))] | |
301 | + | then [IntegerEntry(keyStartHeight, height), IntegerEntry(keyEpochLength, getEpochLength(votingEmissionContract)), StringEntry(keyVotingResult, totalVotes("0", "0", "0"))] | |
286 | 302 | else throw("Strict value is not equal to itself.") | |
287 | 303 | } | |
288 | - | else | |
304 | + | else nil | |
289 | 305 | } | |
290 | 306 | ||
291 | 307 | ||
292 | 308 | @Verifier(tx) | |
293 | 309 | func verify () = { | |
294 | 310 | let targetPublicKey = match managerPublicKeyOrUnit() { | |
295 | 311 | case pk: ByteVector => | |
296 | 312 | pk | |
297 | 313 | case _: Unit => | |
298 | 314 | tx.senderPublicKey | |
299 | 315 | case _ => | |
300 | 316 | throw("Match error") | |
301 | 317 | } | |
302 | 318 | sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey) | |
303 | 319 | } | |
304 | 320 |
github/deemru/w8io/169f3d6 40.93 ms ◑