tx · F4oAcLBWoAZZQbi34R7R99kog8qC8JARp3afVFSfNXyW

3N4ziXSMRverXyxHDUKKMR9MHXnB3TyU3Yh:  -0.01000000 Waves

2023.05.19 09:26 [2584471] smart account 3N4ziXSMRverXyxHDUKKMR9MHXnB3TyU3Yh > SELF 0.00000000 Waves

{ "type": 13, "id": "F4oAcLBWoAZZQbi34R7R99kog8qC8JARp3afVFSfNXyW", "fee": 1000000, "feeAssetId": null, "timestamp": 1684477599649, "version": 2, "chainId": 84, "sender": "3N4ziXSMRverXyxHDUKKMR9MHXnB3TyU3Yh", "senderPublicKey": "EU9obW1yVhR8qug3EmXPeew3DMagvJFQzY5Ku8bmcsU7", "proofs": [ "4xjEkZoNFfQjCGpDZ9HgyvAmrZeYcTManCKq2okutztgnPdDZBHFXo6KRTjTmEmm7nUbWv9jKnevdahhKtynxfM4" ], "script": "base64:BgIbCAISBwoFCAgBAQESABIDCgEBEgASAwoBARIAHAAJc2VwYXJhdG9yAgJfXwAQY29udHJhY3RGaWxlbmFtZQIZdm90aW5nX2VtaXNzaW9uX3JhdGUucmlkZQAOa2V5RXBvY2hMZW5ndGgJALkJAgkAzAgCAgIlcwkAzAgCAgtlcG9jaExlbmd0aAUDbmlsBQlzZXBhcmF0b3IAE2tleUVtaXNzaW9uQ29udHJhY3QJALkJAgkAzAgCAgIlcwkAzAgCAhBlbWlzc2lvbkNvbnRyYWN0BQNuaWwFCXNlcGFyYXRvcgATa2V5Qm9vc3RpbmdDb250cmFjdAkAuQkCCQDMCAICAiVzCQDMCAICEGJvb3N0aW5nQ29udHJhY3QFA25pbAUJc2VwYXJhdG9yAAxrZXlUaHJlc2hvbGQJALkJAgkAzAgCAgIlcwkAzAgCAg92b3RpbmdUaHJlc2hvbGQFA25pbAUJc2VwYXJhdG9yAA9rZXlSYXRlUGVyQmxvY2sJALkJAgkAzAgCAgQlcyVzCQDMCAICDHJhdGVQZXJCbG9jawkAzAgCAgdjdXJyZW50BQNuaWwFCXNlcGFyYXRvcgAS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jaDACA0ludAQEcmF0ZQUHJG1hdGNoMAkA/AcEBRBlbWlzc2lvbkNvbnRyYWN0AhJjaGFuZ2VSYXRlUGVyQmxvY2sJAMwIAgUEcmF0ZQUDbmlsBQNuaWwFBHVuaXQDCQAAAgUQY2hhbmdlUmF0ZUludm9rZQUQY2hhbmdlUmF0ZUludm9rZQkAzAgCCQEMSW50ZWdlckVudHJ5AgUOa2V5U3RhcnRIZWlnaHQFBmhlaWdodAkAzAgCCQELU3RyaW5nRW50cnkCBQ9rZXlWb3RpbmdSZXN1bHQJAQp0b3RhbFZvdGVzAwIBMAIBMAIBMAUDbmlsCQACAQIkU3RyaWN0IHZhbHVlIGlzIG5vdCBlcXVhbCB0byBpdHNlbGYuCQACAQIkU3RyaWN0IHZhbHVlIGlzIG5vdCBlcXVhbCB0byBpdHNlbGYuAOI8E1I=", "height": 2584471, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 5xyV5DreQwUrG6MptNFBGysfgzpq4U1WF4Bc4AhsAsjn Next: Ben3kgAXbXqQe9uc7Qq16u8tebBuwJw561LRWV6SB6oa Diff:
OldNewDifferences
1919
2020 let keyRateChangeStep = makeString(["%s", "rateChangeStep"], separator)
2121
22+let keyStartHeight = makeString(["%s", "startHeight"], separator)
23+
24+let keyVotingResult = makeString(["%s", "votingResult"], separator)
25+
2226 func throwErr (s) = throw(((contractFilename + ": ") + s))
2327
2428
2832 func getIntOrFail (key) = valueOrErrorMessage(getInteger(this, key), (key + " is not defined"))
2933
3034
31-func keyStartHeight () = makeString(["%s", "startHeight"], separator)
32-
33-
34-func keyVotingResult () = makeString(["%s", "votingResult"], separator)
35-
36-
37-func totalVotes (totalIncrease,totalNone,totalDecrease) = makeString(["%d%d%d", totalIncrease, totalNone, totalDecrease], separator)
35+func totalVotes (totalIncrease,totalCurrent,totalDecrease) = makeString(["%d%d%d", totalIncrease, totalCurrent, totalDecrease], separator)
3836
3937
4038 func keyVote (voterAddress,startHeight) = makeString(["%s%s%d", "vote", voterAddress, toString(startHeight)], separator)
134132 then true
135133 else throwErr("invalid rateChangeStep")]
136134 if ((checks == checks))
137- 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)
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)
138136 else throw("Strict value is not equal to itself.")
139137 }
140138
147145
148146 @Callable(i)
149147 func vote (inFavor) = {
150- let startHeight = getIntegerValue(keyStartHeight())
148+ let startHeight = getIntegerValue(keyStartHeight)
151149 let votingFinishHeight = (startHeight + value(getInteger(keyEpochLength)))
152150 let checks = [if ((votingFinishHeight > height))
153151 then true
194192 }
195193 if ((vote == vote))
196194 then {
197- let votingResult = split(value(getString(keyVotingResult())), separator)
195+ let votingResult = split(getStringValue(keyVotingResult), separator)
198196 let votesForIncrease = votingResult[1]
199197 let votesForCurrent = votingResult[2]
200198 let votesForDecrease = votingResult[3]
209207 [votesForIncrease, votesForCurrent, toString(newNegativeVotes)]
210208 }
211209 else {
212- let newNoneVotes = (parseIntValue(votesForCurrent) + asInt(gwxAmount))
213-[votesForIncrease, toString(newNoneVotes), votesForDecrease]
210+ let newCurrentVotes = (parseIntValue(votesForCurrent) + asInt(gwxAmount))
211+[votesForIncrease, toString(newCurrentVotes), votesForDecrease]
214212 }
215213 let voteKey = keyVote(toString(i.caller), startHeight)
216214 let voteValue = keyVoteValue(toString(asInt(gwxAmount)), inFavor)
217- $Tuple2([StringEntry(keyVotingResult(), totalVotes(newPositiveAndNegativeVotes[0], newPositiveAndNegativeVotes[1], newPositiveAndNegativeVotes[2])), StringEntry(voteKey, voteValue)], unit)
215+ $Tuple2([StringEntry(keyVotingResult, totalVotes(newPositiveAndNegativeVotes[0], newPositiveAndNegativeVotes[1], newPositiveAndNegativeVotes[2])), StringEntry(voteKey, voteValue)], unit)
218216 }
219217 else throw("Strict value is not equal to itself.")
220218 }
227225
228226 @Callable(i)
229227 func cancelVote () = {
230- let startHeight = getIntegerValue(keyStartHeight())
228+ let startHeight = getIntegerValue(keyStartHeight)
231229 let userAddress = if ((i.caller == this))
232230 then toString(i.originCaller)
233231 else toString(i.caller)
234- let checks = [if (isDefined(getString(keyVotingResult())))
232+ let checks = [if (isDefined(getString(keyVotingResult)))
235233 then true
236- else throwErr("no vote")]
234+ else throwErr("no vote"), if (isDefined(getString(keyVote(userAddress, startHeight))))
235+ then true
236+ else throwErr("no user vote")]
237237 if ((checks == checks))
238238 then {
239- let vote = split(value(getString(keyVote(userAddress, startHeight))), separator)
239+ let vote = split(getStringValue(keyVote(userAddress, startHeight)), separator)
240240 let voteValue = vote[1]
241241 let voteType = vote[2]
242- let votingResult = split(value(getString(keyVotingResult())), separator)
242+ let votingResult = split(getStringValue(keyVotingResult), separator)
243243 let votesForIncrease = votingResult[1]
244244 let votesForCurrent = votingResult[2]
245245 let votesForDecrease = votingResult[3]
246246 let actions = if ((voteType == "increase"))
247247 then {
248248 let newIncreaseVotes = (parseIntValue(votesForIncrease) - parseIntValue(voteValue))
249-[StringEntry(keyVotingResult(), totalVotes(toString(newIncreaseVotes), votesForCurrent, votesForDecrease))]
249+[StringEntry(keyVotingResult, totalVotes(toString(newIncreaseVotes), votesForCurrent, votesForDecrease))]
250250 }
251251 else if ((voteType == "decrease"))
252252 then {
253253 let newDecreaseVotes = (parseIntValue(votesForDecrease) - parseIntValue(voteValue))
254-[StringEntry(keyVotingResult(), totalVotes(votesForIncrease, votesForCurrent, toString(newDecreaseVotes)))]
254+[StringEntry(keyVotingResult, totalVotes(votesForIncrease, votesForCurrent, toString(newDecreaseVotes)))]
255255 }
256256 else {
257257 let newCurrentVotes = (parseIntValue(votesForCurrent) - parseIntValue(voteValue))
258-[StringEntry(keyVotingResult(), totalVotes(votesForIncrease, toString(newCurrentVotes), votesForDecrease))]
258+[StringEntry(keyVotingResult, totalVotes(votesForIncrease, toString(newCurrentVotes), votesForDecrease))]
259259 }
260260 let defaultActions = [DeleteEntry(keyVote(userAddress, startHeight))]
261261 (actions ++ defaultActions)
279279
280280 @Callable(i)
281281 func finalize () = {
282- let votingFinishHeight = (value(getInteger(keyStartHeight())) + value(getInteger(keyEpochLength)))
282+ let votingFinishHeight = (getIntegerValue(keyStartHeight) + value(getInteger(keyEpochLength)))
283283 let checks = [if ((height >= votingFinishHeight))
284284 then true
285285 else throwErr("insufficient height for completion")]
286286 if ((checks == checks))
287287 then {
288- let votingResult = split(value(getString(keyVotingResult())), separator)
288+ let votingResult = split(value(getString(keyVotingResult)), separator)
289289 let votesForIncrease = parseIntValue(votingResult[1])
290290 let votesForCurrent = parseIntValue(votingResult[2])
291291 let votesForDecrease = parseIntValue(votingResult[3])
292292 let allVotes = ((votesForIncrease + votesForCurrent) + votesForDecrease)
293293 let threshold = getIntOrFail(keyThreshold)
294- let $t092319311 = getRateChangeAmountsINTERNAL()
295- let increasedRate = $t092319311._1
296- let currentRate = $t092319311._2
297- let decreasedRate = $t092319311._3
294+ let $t093189398 = getRateChangeAmountsINTERNAL()
295+ let increasedRate = $t093189398._1
296+ let currentRate = $t093189398._2
297+ let decreasedRate = $t093189398._3
298298 let votesList = [votesForIncrease, votesForCurrent, votesForDecrease]
299299 let newRate = if (if ((threshold > allVotes))
300300 then true
303303 else if ((votesForIncrease == max(votesList)))
304304 then increasedRate
305305 else decreasedRate
306-[IntegerEntry(keyStartHeight(), height), StringEntry(keyVotingResult(), totalVotes("0", "0", "0"))]
306+ let changeRateInvoke = match newRate {
307+ case rate: Int =>
308+ invoke(emissionContract, "changeRatePerBlock", [rate], nil)
309+ case _ =>
310+ unit
311+ }
312+ if ((changeRateInvoke == changeRateInvoke))
313+ then [IntegerEntry(keyStartHeight, height), StringEntry(keyVotingResult, totalVotes("0", "0", "0"))]
314+ else throw("Strict value is not equal to itself.")
307315 }
308316 else throw("Strict value is not equal to itself.")
309317 }
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let separator = "__"
55
66 let contractFilename = "voting_emission_rate.ride"
77
88 let keyEpochLength = makeString(["%s", "epochLength"], separator)
99
1010 let keyEmissionContract = makeString(["%s", "emissionContract"], separator)
1111
1212 let keyBoostingContract = makeString(["%s", "boostingContract"], separator)
1313
1414 let keyThreshold = makeString(["%s", "votingThreshold"], separator)
1515
1616 let keyRatePerBlock = makeString(["%s%s", "ratePerBlock", "current"], separator)
1717
1818 let keyRatePerBlockMax = makeString(["%s%s", "ratePerBlockMax", "current"], separator)
1919
2020 let keyRateChangeStep = makeString(["%s", "rateChangeStep"], separator)
2121
22+let keyStartHeight = makeString(["%s", "startHeight"], separator)
23+
24+let keyVotingResult = makeString(["%s", "votingResult"], separator)
25+
2226 func throwErr (s) = throw(((contractFilename + ": ") + s))
2327
2428
2529 func getStringOrFail (key) = valueOrErrorMessage(getString(this, key), (key + " is not defined"))
2630
2731
2832 func getIntOrFail (key) = valueOrErrorMessage(getInteger(this, key), (key + " is not defined"))
2933
3034
31-func keyStartHeight () = makeString(["%s", "startHeight"], separator)
32-
33-
34-func keyVotingResult () = makeString(["%s", "votingResult"], separator)
35-
36-
37-func totalVotes (totalIncrease,totalNone,totalDecrease) = makeString(["%d%d%d", totalIncrease, totalNone, totalDecrease], separator)
35+func totalVotes (totalIncrease,totalCurrent,totalDecrease) = makeString(["%d%d%d", totalIncrease, totalCurrent, totalDecrease], separator)
3836
3937
4038 func keyVote (voterAddress,startHeight) = makeString(["%s%s%d", "vote", voterAddress, toString(startHeight)], separator)
4139
4240
4341 func keyVoteValue (gwxAmount,vote) = {
4442 let key = if ((vote == 1))
4543 then makeString(["%d%s", gwxAmount, "increase"], separator)
4644 else if ((vote == -1))
4745 then makeString(["%d%s", gwxAmount, "decrease"], separator)
4846 else makeString(["%d%s", gwxAmount, "current"], separator)
4947 key
5048 }
5149
5250
5351 let boostingContract = addressFromStringValue(getStringOrFail(keyBoostingContract))
5452
5553 let emissionContract = addressFromStringValue(getStringOrFail(keyEmissionContract))
5654
5755 func keyManagerPublicKey () = "%s__managerPublicKey"
5856
5957
6058 func keyManagerVaultAddress () = "%s__managerVaultAddress"
6159
6260
6361 func getManagerVaultAddressOrThis () = match getString(keyManagerVaultAddress()) {
6462 case s: String =>
6563 addressFromStringValue(s)
6664 case _ =>
6765 this
6866 }
6967
7068
7169 func managerPublicKeyOrUnit () = {
7270 let managerVaultAddress = getManagerVaultAddressOrThis()
7371 match getString(managerVaultAddress, keyManagerPublicKey()) {
7472 case s: String =>
7573 fromBase58String(s)
7674 case _: Unit =>
7775 unit
7876 case _ =>
7977 throw("Match error")
8078 }
8179 }
8280
8381
8482 func isManager (i) = match managerPublicKeyOrUnit() {
8583 case pk: ByteVector =>
8684 (i.callerPublicKey == pk)
8785 case _: Unit =>
8886 (i.caller == this)
8987 case _ =>
9088 throw("Match error")
9189 }
9290
9391
9492 func mustManager (i) = if (isManager(i))
9593 then true
9694 else throwErr("permission denied")
9795
9896
9997 func asInt (val) = match val {
10098 case valInt: Int =>
10199 valInt
102100 case _ =>
103101 throwErr("failed to cast into Integer")
104102 }
105103
106104
107105 func calcNewRate (ratePerBlockMax,ratePerBlock,changeStep) = {
108106 let maxAllowed = fraction(100, ratePerBlockMax, 120)
109107 let increasedRate = min([fraction((100 + changeStep), ratePerBlock, 100), maxAllowed])
110108 let decreasedRate = max([fraction((100 - changeStep), ratePerBlock, 100), 0])
111109 $Tuple3(increasedRate, ratePerBlock, decreasedRate)
112110 }
113111
114112
115113 func getRateChangeAmountsINTERNAL () = {
116114 let ratePerBlockMax = getIntegerValue(emissionContract, keyRatePerBlockMax)
117115 let ratePerBlock = getIntegerValue(emissionContract, keyRatePerBlock)
118116 let rateChangeStep = getIntegerValue(this, keyRateChangeStep)
119117 calcNewRate(ratePerBlockMax, ratePerBlock, rateChangeStep)
120118 }
121119
122120
123121 @Callable(i)
124122 func constructor (boostingContractPrm,emissionContractPrm,votingDurationPrm,threshold,rateChangeStep) = {
125123 let checks = [if (isDefined(addressFromString(boostingContractPrm)))
126124 then true
127125 else throwErr("Invalid boosting contract address"), if (isDefined(addressFromString(emissionContractPrm)))
128126 then true
129127 else throwErr("Invalid emission contract address"), if ((votingDurationPrm > 0))
130128 then true
131129 else throwErr("Invalid voting duration"), if ((threshold > 0))
132130 then true
133131 else throwErr("invalid threshold"), if ((rateChangeStep > 0))
134132 then true
135133 else throwErr("invalid rateChangeStep")]
136134 if ((checks == checks))
137- 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)
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)
138136 else throw("Strict value is not equal to itself.")
139137 }
140138
141139
142140
143141 @Callable(i)
144142 func getRateChangeAmountsREADONLY () = $Tuple2(nil, getRateChangeAmountsINTERNAL())
145143
146144
147145
148146 @Callable(i)
149147 func vote (inFavor) = {
150- let startHeight = getIntegerValue(keyStartHeight())
148+ let startHeight = getIntegerValue(keyStartHeight)
151149 let votingFinishHeight = (startHeight + value(getInteger(keyEpochLength)))
152150 let checks = [if ((votingFinishHeight > height))
153151 then true
154152 else throwErr("too late to vote"), if (containsElement([1, 0, -1], inFavor))
155153 then true
156154 else throwErr("not valid argument")]
157155 if ((checks == checks))
158156 then {
159157 let gwxAmount = invoke(boostingContract, "getUserGwxAmountAtHeightREADONLY", [toString(i.caller), votingFinishHeight], nil)
160158 let notZero = if ((asInt(gwxAmount) > 0))
161159 then true
162160 else throwErr("you don't have gwx")
163161 if ((notZero == notZero))
164162 then {
165163 let vote = match getString(keyVote(toString(i.caller), startHeight)) {
166164 case s: String =>
167165 let vote = split(s, separator)
168166 let voteValue = vote[1]
169167 let voteType = vote[2]
170168 let isVoteTypeSimilar = if (if (if ((voteType == "increase"))
171169 then (inFavor == 1)
172170 else false)
173171 then true
174172 else if ((voteType == "decrease"))
175173 then (inFavor == -1)
176174 else false)
177175 then true
178176 else if ((voteType == "current"))
179177 then (inFavor == 0)
180178 else false
181179 let isVoteValueSimilar = if (isVoteTypeSimilar)
182180 then (asInt(gwxAmount) == parseIntValue(voteValue))
183181 else false
184182 let isNewVoteSimilar = if (if (isVoteTypeSimilar)
185183 then isVoteValueSimilar
186184 else false)
187185 then throwErr("you already voted")
188186 else invoke(this, "cancelVote", nil, nil)
189187 isNewVoteSimilar
190188 case u: Unit =>
191189 u
192190 case _ =>
193191 throw("Match error")
194192 }
195193 if ((vote == vote))
196194 then {
197- let votingResult = split(value(getString(keyVotingResult())), separator)
195+ let votingResult = split(getStringValue(keyVotingResult), separator)
198196 let votesForIncrease = votingResult[1]
199197 let votesForCurrent = votingResult[2]
200198 let votesForDecrease = votingResult[3]
201199 let newPositiveAndNegativeVotes = if ((inFavor == 1))
202200 then {
203201 let newPositiveVotes = (parseIntValue(votesForIncrease) + asInt(gwxAmount))
204202 [toString(newPositiveVotes), votesForCurrent, votesForDecrease]
205203 }
206204 else if ((inFavor == -1))
207205 then {
208206 let newNegativeVotes = (parseIntValue(votesForCurrent) + asInt(gwxAmount))
209207 [votesForIncrease, votesForCurrent, toString(newNegativeVotes)]
210208 }
211209 else {
212- let newNoneVotes = (parseIntValue(votesForCurrent) + asInt(gwxAmount))
213-[votesForIncrease, toString(newNoneVotes), votesForDecrease]
210+ let newCurrentVotes = (parseIntValue(votesForCurrent) + asInt(gwxAmount))
211+[votesForIncrease, toString(newCurrentVotes), votesForDecrease]
214212 }
215213 let voteKey = keyVote(toString(i.caller), startHeight)
216214 let voteValue = keyVoteValue(toString(asInt(gwxAmount)), inFavor)
217- $Tuple2([StringEntry(keyVotingResult(), totalVotes(newPositiveAndNegativeVotes[0], newPositiveAndNegativeVotes[1], newPositiveAndNegativeVotes[2])), StringEntry(voteKey, voteValue)], unit)
215+ $Tuple2([StringEntry(keyVotingResult, totalVotes(newPositiveAndNegativeVotes[0], newPositiveAndNegativeVotes[1], newPositiveAndNegativeVotes[2])), StringEntry(voteKey, voteValue)], unit)
218216 }
219217 else throw("Strict value is not equal to itself.")
220218 }
221219 else throw("Strict value is not equal to itself.")
222220 }
223221 else throw("Strict value is not equal to itself.")
224222 }
225223
226224
227225
228226 @Callable(i)
229227 func cancelVote () = {
230- let startHeight = getIntegerValue(keyStartHeight())
228+ let startHeight = getIntegerValue(keyStartHeight)
231229 let userAddress = if ((i.caller == this))
232230 then toString(i.originCaller)
233231 else toString(i.caller)
234- let checks = [if (isDefined(getString(keyVotingResult())))
232+ let checks = [if (isDefined(getString(keyVotingResult)))
235233 then true
236- else throwErr("no vote")]
234+ else throwErr("no vote"), if (isDefined(getString(keyVote(userAddress, startHeight))))
235+ then true
236+ else throwErr("no user vote")]
237237 if ((checks == checks))
238238 then {
239- let vote = split(value(getString(keyVote(userAddress, startHeight))), separator)
239+ let vote = split(getStringValue(keyVote(userAddress, startHeight)), separator)
240240 let voteValue = vote[1]
241241 let voteType = vote[2]
242- let votingResult = split(value(getString(keyVotingResult())), separator)
242+ let votingResult = split(getStringValue(keyVotingResult), separator)
243243 let votesForIncrease = votingResult[1]
244244 let votesForCurrent = votingResult[2]
245245 let votesForDecrease = votingResult[3]
246246 let actions = if ((voteType == "increase"))
247247 then {
248248 let newIncreaseVotes = (parseIntValue(votesForIncrease) - parseIntValue(voteValue))
249-[StringEntry(keyVotingResult(), totalVotes(toString(newIncreaseVotes), votesForCurrent, votesForDecrease))]
249+[StringEntry(keyVotingResult, totalVotes(toString(newIncreaseVotes), votesForCurrent, votesForDecrease))]
250250 }
251251 else if ((voteType == "decrease"))
252252 then {
253253 let newDecreaseVotes = (parseIntValue(votesForDecrease) - parseIntValue(voteValue))
254-[StringEntry(keyVotingResult(), totalVotes(votesForIncrease, votesForCurrent, toString(newDecreaseVotes)))]
254+[StringEntry(keyVotingResult, totalVotes(votesForIncrease, votesForCurrent, toString(newDecreaseVotes)))]
255255 }
256256 else {
257257 let newCurrentVotes = (parseIntValue(votesForCurrent) - parseIntValue(voteValue))
258-[StringEntry(keyVotingResult(), totalVotes(votesForIncrease, toString(newCurrentVotes), votesForDecrease))]
258+[StringEntry(keyVotingResult, totalVotes(votesForIncrease, toString(newCurrentVotes), votesForDecrease))]
259259 }
260260 let defaultActions = [DeleteEntry(keyVote(userAddress, startHeight))]
261261 (actions ++ defaultActions)
262262 }
263263 else throw("Strict value is not equal to itself.")
264264 }
265265
266266
267267
268268 @Callable(i)
269269 func setThreshold (newThreshold) = {
270270 let checks = [mustManager(i), if ((newThreshold > 0))
271271 then true
272272 else throwErr("invalid threshold")]
273273 if ((checks == checks))
274274 then $Tuple2([IntegerEntry(keyThreshold, newThreshold)], unit)
275275 else throw("Strict value is not equal to itself.")
276276 }
277277
278278
279279
280280 @Callable(i)
281281 func finalize () = {
282- let votingFinishHeight = (value(getInteger(keyStartHeight())) + value(getInteger(keyEpochLength)))
282+ let votingFinishHeight = (getIntegerValue(keyStartHeight) + value(getInteger(keyEpochLength)))
283283 let checks = [if ((height >= votingFinishHeight))
284284 then true
285285 else throwErr("insufficient height for completion")]
286286 if ((checks == checks))
287287 then {
288- let votingResult = split(value(getString(keyVotingResult())), separator)
288+ let votingResult = split(value(getString(keyVotingResult)), separator)
289289 let votesForIncrease = parseIntValue(votingResult[1])
290290 let votesForCurrent = parseIntValue(votingResult[2])
291291 let votesForDecrease = parseIntValue(votingResult[3])
292292 let allVotes = ((votesForIncrease + votesForCurrent) + votesForDecrease)
293293 let threshold = getIntOrFail(keyThreshold)
294- let $t092319311 = getRateChangeAmountsINTERNAL()
295- let increasedRate = $t092319311._1
296- let currentRate = $t092319311._2
297- let decreasedRate = $t092319311._3
294+ let $t093189398 = getRateChangeAmountsINTERNAL()
295+ let increasedRate = $t093189398._1
296+ let currentRate = $t093189398._2
297+ let decreasedRate = $t093189398._3
298298 let votesList = [votesForIncrease, votesForCurrent, votesForDecrease]
299299 let newRate = if (if ((threshold > allVotes))
300300 then true
301301 else (votesForCurrent == max(votesList)))
302302 then unit
303303 else if ((votesForIncrease == max(votesList)))
304304 then increasedRate
305305 else decreasedRate
306-[IntegerEntry(keyStartHeight(), height), StringEntry(keyVotingResult(), totalVotes("0", "0", "0"))]
306+ let changeRateInvoke = match newRate {
307+ case rate: Int =>
308+ invoke(emissionContract, "changeRatePerBlock", [rate], nil)
309+ case _ =>
310+ unit
311+ }
312+ if ((changeRateInvoke == changeRateInvoke))
313+ then [IntegerEntry(keyStartHeight, height), StringEntry(keyVotingResult, totalVotes("0", "0", "0"))]
314+ else throw("Strict value is not equal to itself.")
307315 }
308316 else throw("Strict value is not equal to itself.")
309317 }
310318
311319

github/deemru/w8io/026f985 
47.55 ms