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