tx · EwHC1EYU26NM6VxgFWpth1z8V8NeZNYVe6AsoeQKpk7P

3MuqubsQAq9mrsN65SePHeThcN3JVAbgZ9d:  -0.01500000 Waves

2023.08.17 16:34 [2714660] smart account 3MuqubsQAq9mrsN65SePHeThcN3JVAbgZ9d > SELF 0.00000000 Waves

{ "type": 13, "id": "EwHC1EYU26NM6VxgFWpth1z8V8NeZNYVe6AsoeQKpk7P", "fee": 1500000, "feeAssetId": null, "timestamp": 1692279290938, "version": 2, "chainId": 84, "sender": "3MuqubsQAq9mrsN65SePHeThcN3JVAbgZ9d", "senderPublicKey": "GWTozVWP9MvUxrEuz1BPrNAbtLYAec9LrT4U82jWG6KX", "proofs": [ "v2BUkuw76WyoSL8WwJuauvFnshoiCuSTy52EZVwE314ckmYnWgoVcZG9p4bWbbda7TNCZNLBedYsmE3sNH3Z3VF" ], "script": "base64:BgIhCAISCAoGCAgIAQEBEgASAwoBARIAEgMKAQESABIDCgEIIQAJc2VwYXJhdG9yAgJfXwAQY29udHJhY3RGaWxlbmFtZQIZdm90aW5nX2VtaXNzaW9uX3JhdGUucmlkZQATREVGQVVMVF9FUE9DSF9DT1VOVAAEAA5rZXlFcG9jaExlbmd0aAkAuQkCCQDMCAICAiVzCQDMCAICC2Vwb2NoTGVuZ3RoBQNuaWwFCXNlcGFyYXRvcgATa2V5RW1pc3Npb25Db250cmFjdAkAuQkCCQDMCAICAiVzCQDMCAICEGVtaXNzaW9uQ29udHJhY3QFA25pbAUJc2VwYXJhdG9yABlrZXlWb3RpbmdFbWlzc2lvbkNvbnRyYWN0CQC5CQIJAMwIAgICJXMJAMwIAgIWdm90aW5nRW1pc3Npb25Db250cmFjdAUDbmlsBQlzZXBhcmF0b3IAE2tleUJvb3N0aW5nQ29udHJhY3QJALkJAgkAzAgCAgIlcwkAzAgCAhBib29zdGluZ0NvbnRyYWN0BQNuaWwFCXNlcGFyYXRvcgAMa2V5VGhyZXNob2xkCQC5CQIJAMwIAgICJXMJAMwIAgIPdm90aW5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yVW5pdAADCQABAgUHJG1hdGNoMAIKQnl0ZVZlY3RvcgQCcGsFByRtYXRjaDAFAnBrAwkAAQIFByRtYXRjaDACBFVuaXQIBQJ0eA9zZW5kZXJQdWJsaWNLZXkJAAIBAgtNYXRjaCBlcnJvcgkA9AMDCAUCdHgJYm9keUJ5dGVzCQCRAwIIBQJ0eAZwcm9vZnMAAAUPdGFyZ2V0UHVibGljS2V59dAdIQ==", "height": 2714660, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: ExZC2eVXxqQFAGtvkHsd1w49UzxSP6osqz2P9gzcZDts Next: GKcAEz3Wz8vwFPapJeDaNXfXagbe15CydL3V3bBPqNvx Diff:
OldNewDifferences
319319 }
320320
321321
322+
323+@Callable(i)
324+func getLockedGwxAmount (userAddressStr) = {
325+ let startHeight = getIntegerValue(keyStartHeight)
326+ let gwxAmount = match getString(this, keyVote(userAddressStr, startHeight)) {
327+ case _: Unit =>
328+ 0
329+ case s: String =>
330+ valueOrElse(parseInt(split(s, separator)[1]), 0)
331+ case _ =>
332+ throw("Match error")
333+ }
334+ $Tuple2(nil, gwxAmount)
335+ }
336+
337+
322338 @Verifier(tx)
323339 func verify () = {
324340 let targetPublicKey = match managerPublicKeyOrUnit() {
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 DEFAULT_EPOCH_COUNT = 4
99
1010 let keyEpochLength = makeString(["%s", "epochLength"], separator)
1111
1212 let keyEmissionContract = makeString(["%s", "emissionContract"], separator)
1313
1414 let keyVotingEmissionContract = makeString(["%s", "votingEmissionContract"], separator)
1515
1616 let keyBoostingContract = makeString(["%s", "boostingContract"], separator)
1717
1818 let keyThreshold = makeString(["%s", "votingThreshold"], separator)
1919
2020 let keyRatePerBlock = makeString(["%s%s", "ratePerBlock", "current"], separator)
2121
2222 let keyRatePerBlockMax = makeString(["%s%s", "ratePerBlockMax", "current"], separator)
2323
2424 let keyRateChangeStep = makeString(["%s", "rateChangeStep"], separator)
2525
2626 let keyStartHeight = makeString(["%s", "startHeight"], separator)
2727
2828 let keyVotingResult = makeString(["%s", "votingResult"], separator)
2929
3030 let keyVotingEmissionEpochCount = makeString(["%s", "votingEmissionEpochCount"], separator)
3131
3232 func throwErr (s) = throw(((contractFilename + ": ") + s))
3333
3434
3535 func getStringOrFail (key) = valueOrErrorMessage(getString(this, key), (key + " is not defined"))
3636
3737
3838 func getIntOrFail (key) = valueOrErrorMessage(getInteger(this, key), (key + " is not defined"))
3939
4040
4141 func totalVotes (totalIncrease,totalCurrent,totalDecrease) = makeString(["%d%d%d", totalIncrease, totalCurrent, totalDecrease], separator)
4242
4343
4444 func keyVote (voterAddress,startHeight) = makeString(["%s%s%d", "vote", voterAddress, toString(startHeight)], separator)
4545
4646
4747 func keyVoteValue (gwxAmount,vote) = {
4848 let key = if ((vote == 1))
4949 then makeString(["%d%s", gwxAmount, "increase"], separator)
5050 else if ((vote == -1))
5151 then makeString(["%d%s", gwxAmount, "decrease"], separator)
5252 else makeString(["%d%s", gwxAmount, "current"], separator)
5353 key
5454 }
5555
5656
5757 let boostingContract = addressFromStringValue(getStringOrFail(keyBoostingContract))
5858
5959 let emissionContract = addressFromStringValue(getStringOrFail(keyEmissionContract))
6060
6161 let votingEmissionContract = addressFromStringValue(getStringOrFail(keyVotingEmissionContract))
6262
6363 func keyManagerPublicKey () = "%s__managerPublicKey"
6464
6565
6666 func keyManagerVaultAddress () = "%s__managerVaultAddress"
6767
6868
6969 func getManagerVaultAddressOrThis () = match getString(keyManagerVaultAddress()) {
7070 case s: String =>
7171 addressFromStringValue(s)
7272 case _ =>
7373 this
7474 }
7575
7676
7777 func managerPublicKeyOrUnit () = {
7878 let managerVaultAddress = getManagerVaultAddressOrThis()
7979 match getString(managerVaultAddress, keyManagerPublicKey()) {
8080 case s: String =>
8181 fromBase58String(s)
8282 case _: Unit =>
8383 unit
8484 case _ =>
8585 throw("Match error")
8686 }
8787 }
8888
8989
9090 func isManager (i) = match managerPublicKeyOrUnit() {
9191 case pk: ByteVector =>
9292 (i.callerPublicKey == pk)
9393 case _: Unit =>
9494 (i.caller == this)
9595 case _ =>
9696 throw("Match error")
9797 }
9898
9999
100100 func mustManager (i) = if (isManager(i))
101101 then true
102102 else throwErr("permission denied")
103103
104104
105105 func asInt (val) = match val {
106106 case valInt: Int =>
107107 valInt
108108 case _ =>
109109 throwErr("failed to cast into Integer")
110110 }
111111
112112
113113 func calcNewRate (ratePerBlockMax,ratePerBlock,changeStep) = {
114114 let maxAllowed = fraction(100, ratePerBlockMax, 120)
115115 let increasedRate = min([fraction((100 + changeStep), ratePerBlock, 100), maxAllowed])
116116 let decreasedRate = max([fraction((100 - changeStep), ratePerBlock, 100), 0])
117117 $Tuple3(increasedRate, ratePerBlock, decreasedRate)
118118 }
119119
120120
121121 func getRateChangeAmountsINTERNAL () = {
122122 let ratePerBlockMax = getIntegerValue(emissionContract, keyRatePerBlockMax)
123123 let ratePerBlock = getIntegerValue(emissionContract, keyRatePerBlock)
124124 let rateChangeStep = getIntegerValue(this, keyRateChangeStep)
125125 calcNewRate(ratePerBlockMax, ratePerBlock, rateChangeStep)
126126 }
127127
128128
129129 func getEpochLength (votingEmissionContract) = {
130130 let votingEpochLength = getIntegerValue(votingEmissionContract, keyEpochLength)
131131 let votingStartLength = getIntegerValue(votingEmissionContract, keyStartHeight)
132132 let votingEmissionEpochCount = valueOrElse(getInteger(this, keyVotingEmissionEpochCount), DEFAULT_EPOCH_COUNT)
133133 (((votingStartLength + (votingEpochLength * votingEmissionEpochCount)) - height) - 1)
134134 }
135135
136136
137137 @Callable(i)
138138 func constructor (boostingContractPrm,emissionContractPrm,votingEmissionContractPrm,threshold,rateChangeStep,votingEmissionEpochCount) = {
139139 let checks = [mustManager(i), if (isDefined(addressFromString(boostingContractPrm)))
140140 then true
141141 else throwErr("Invalid boosting contract address"), if (isDefined(addressFromString(emissionContractPrm)))
142142 then true
143143 else throwErr("Invalid emission contract address"), if (isDefined(addressFromString(votingEmissionContractPrm)))
144144 then true
145145 else throwErr("Invalid emission contract address"), if ((threshold > 0))
146146 then true
147147 else throwErr("invalid threshold"), if ((rateChangeStep > 0))
148148 then true
149149 else throwErr("invalid rateChangeStep"), if ((votingEmissionEpochCount > 0))
150150 then true
151151 else throwErr("invalid votingEmissionEpochCount")]
152152 if ((checks == checks))
153153 then {
154154 let votingEmission = addressFromStringValue(votingEmissionContractPrm)
155155 $Tuple2([StringEntry(keyBoostingContract, boostingContractPrm), StringEntry(keyEmissionContract, emissionContractPrm), StringEntry(keyVotingEmissionContract, votingEmissionContractPrm), IntegerEntry(keyEpochLength, getEpochLength(votingEmission)), IntegerEntry(keyThreshold, threshold), IntegerEntry(keyRateChangeStep, rateChangeStep), IntegerEntry(keyVotingEmissionEpochCount, votingEmissionEpochCount), IntegerEntry(keyStartHeight, height), StringEntry(keyVotingResult, totalVotes("0", "0", "0"))], unit)
156156 }
157157 else throw("Strict value is not equal to itself.")
158158 }
159159
160160
161161
162162 @Callable(i)
163163 func getRateChangeAmountsREADONLY () = $Tuple2(nil, getRateChangeAmountsINTERNAL())
164164
165165
166166
167167 @Callable(i)
168168 func vote (inFavor) = {
169169 let startHeight = getIntegerValue(keyStartHeight)
170170 let votingFinishHeight = (startHeight + getIntegerValue(keyEpochLength))
171171 let userAddress = toString(i.caller)
172172 let checks = [if ((votingFinishHeight > height))
173173 then true
174174 else throwErr("too late to vote"), if (containsElement([1, 0, -1], inFavor))
175175 then true
176176 else throwErr("not valid argument"), if (!(isDefined(getString(keyVote(userAddress, startHeight)))))
177177 then true
178178 else throwErr("you already voted")]
179179 if ((checks == checks))
180180 then {
181181 let gwxAmount = invoke(boostingContract, "getUserGwxAmountAtHeightREADONLY", [userAddress, votingFinishHeight], nil)
182182 let notZero = if ((asInt(gwxAmount) > 0))
183183 then true
184184 else throwErr("you don't have gwx")
185185 if ((notZero == notZero))
186186 then {
187187 let votingResult = split(getStringValue(keyVotingResult), separator)
188188 let votesForIncrease = votingResult[1]
189189 let votesForCurrent = votingResult[2]
190190 let votesForDecrease = votingResult[3]
191191 let newPositiveAndNegativeVotes = if ((inFavor == 1))
192192 then {
193193 let newIncreaseVotes = (parseIntValue(votesForIncrease) + asInt(gwxAmount))
194194 [toString(newIncreaseVotes), votesForCurrent, votesForDecrease]
195195 }
196196 else if ((inFavor == -1))
197197 then {
198198 let newDecreaseVotes = (parseIntValue(votesForDecrease) + asInt(gwxAmount))
199199 [votesForIncrease, votesForCurrent, toString(newDecreaseVotes)]
200200 }
201201 else {
202202 let newCurrentVotes = (parseIntValue(votesForCurrent) + asInt(gwxAmount))
203203 [votesForIncrease, toString(newCurrentVotes), votesForDecrease]
204204 }
205205 let voteKey = keyVote(toString(i.caller), startHeight)
206206 let voteValue = keyVoteValue(toString(asInt(gwxAmount)), inFavor)
207207 $Tuple2([StringEntry(keyVotingResult, totalVotes(newPositiveAndNegativeVotes[0], newPositiveAndNegativeVotes[1], newPositiveAndNegativeVotes[2])), StringEntry(voteKey, voteValue)], unit)
208208 }
209209 else throw("Strict value is not equal to itself.")
210210 }
211211 else throw("Strict value is not equal to itself.")
212212 }
213213
214214
215215
216216 @Callable(i)
217217 func cancelVote () = {
218218 let startHeight = getIntegerValue(keyStartHeight)
219219 let votingFinishHeight = (startHeight + getIntegerValue(keyEpochLength))
220220 let userAddress = if ((i.caller == this))
221221 then toString(i.originCaller)
222222 else toString(i.caller)
223223 let checks = [if ((votingFinishHeight > height))
224224 then true
225225 else throwErr("too late to cancel vote"), if (isDefined(getString(keyVotingResult)))
226226 then true
227227 else throwErr("no vote"), if (isDefined(getString(keyVote(userAddress, startHeight))))
228228 then true
229229 else throwErr("no user vote")]
230230 if ((checks == checks))
231231 then {
232232 let vote = split(getStringValue(keyVote(userAddress, startHeight)), separator)
233233 let voteValue = vote[1]
234234 let voteType = vote[2]
235235 let votingResult = split(getStringValue(keyVotingResult), separator)
236236 let votesForIncrease = votingResult[1]
237237 let votesForCurrent = votingResult[2]
238238 let votesForDecrease = votingResult[3]
239239 let actions = if ((voteType == "increase"))
240240 then {
241241 let newIncreaseVotes = (parseIntValue(votesForIncrease) - parseIntValue(voteValue))
242242 [StringEntry(keyVotingResult, totalVotes(toString(newIncreaseVotes), votesForCurrent, votesForDecrease))]
243243 }
244244 else if ((voteType == "decrease"))
245245 then {
246246 let newDecreaseVotes = (parseIntValue(votesForDecrease) - parseIntValue(voteValue))
247247 [StringEntry(keyVotingResult, totalVotes(votesForIncrease, votesForCurrent, toString(newDecreaseVotes)))]
248248 }
249249 else {
250250 let newCurrentVotes = (parseIntValue(votesForCurrent) - parseIntValue(voteValue))
251251 [StringEntry(keyVotingResult, totalVotes(votesForIncrease, toString(newCurrentVotes), votesForDecrease))]
252252 }
253253 let defaultActions = [DeleteEntry(keyVote(userAddress, startHeight))]
254254 (actions ++ defaultActions)
255255 }
256256 else throw("Strict value is not equal to itself.")
257257 }
258258
259259
260260
261261 @Callable(i)
262262 func setThreshold (newThreshold) = {
263263 let checks = [mustManager(i), if ((newThreshold > 0))
264264 then true
265265 else throwErr("invalid threshold")]
266266 if ((checks == checks))
267267 then $Tuple2([IntegerEntry(keyThreshold, newThreshold)], unit)
268268 else throw("Strict value is not equal to itself.")
269269 }
270270
271271
272272
273273 @Callable(i)
274274 func finalize () = {
275275 let check = if (if ((i.caller == votingEmissionContract))
276276 then true
277277 else mustManager(i))
278278 then true
279279 else throwErr("Permission denied")
280280 if ((check == check))
281281 then {
282282 let votingFinishHeight = (getIntegerValue(keyStartHeight) + value(getInteger(keyEpochLength)))
283283 if ((height >= votingFinishHeight))
284284 then {
285285 let votingResult = split(value(getString(keyVotingResult)), separator)
286286 let votesForIncrease = parseIntValue(votingResult[1])
287287 let votesForCurrent = parseIntValue(votingResult[2])
288288 let votesForDecrease = parseIntValue(votingResult[3])
289289 let allVotes = ((votesForIncrease + votesForCurrent) + votesForDecrease)
290290 let threshold = getIntOrFail(keyThreshold)
291291 let $t01019810278 = getRateChangeAmountsINTERNAL()
292292 let increasedRate = $t01019810278._1
293293 let currentRate = $t01019810278._2
294294 let decreasedRate = $t01019810278._3
295295 let votesList = [votesForIncrease, votesForCurrent, votesForDecrease]
296296 let newRate = if (if ((threshold > allVotes))
297297 then true
298298 else (votesForCurrent == max(votesList)))
299299 then unit
300300 else if ((votesForIncrease == max(votesList)))
301301 then increasedRate
302302 else decreasedRate
303303 let changeRateInvokes = match newRate {
304304 case r: Int =>
305305 let emissionChangeRate = invoke(emissionContract, "changeRatePerBlock", [r], nil)
306306 if ((emissionChangeRate == emissionChangeRate))
307307 then emissionChangeRate
308308 else throw("Strict value is not equal to itself.")
309309 case _ =>
310310 unit
311311 }
312312 if ((changeRateInvokes == changeRateInvokes))
313313 then [IntegerEntry(keyStartHeight, height), IntegerEntry(keyEpochLength, getEpochLength(votingEmissionContract)), StringEntry(keyVotingResult, totalVotes("0", "0", "0"))]
314314 else throw("Strict value is not equal to itself.")
315315 }
316316 else nil
317317 }
318318 else throw("Strict value is not equal to itself.")
319319 }
320320
321321
322+
323+@Callable(i)
324+func getLockedGwxAmount (userAddressStr) = {
325+ let startHeight = getIntegerValue(keyStartHeight)
326+ let gwxAmount = match getString(this, keyVote(userAddressStr, startHeight)) {
327+ case _: Unit =>
328+ 0
329+ case s: String =>
330+ valueOrElse(parseInt(split(s, separator)[1]), 0)
331+ case _ =>
332+ throw("Match error")
333+ }
334+ $Tuple2(nil, gwxAmount)
335+ }
336+
337+
322338 @Verifier(tx)
323339 func verify () = {
324340 let targetPublicKey = match managerPublicKeyOrUnit() {
325341 case pk: ByteVector =>
326342 pk
327343 case _: Unit =>
328344 tx.senderPublicKey
329345 case _ =>
330346 throw("Match error")
331347 }
332348 sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey)
333349 }
334350

github/deemru/w8io/fabc49c 
38.86 ms