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