tx · 6FY627hQpwQbpuxPkTSiSRNDTg45vxDnJ46axyrwscfb

3N9Zi6AcWcGbM23jQJ4fnzFsoHoTsxYDznr:  -0.02300000 Waves

2023.12.29 12:35 [2907878] smart account 3N9Zi6AcWcGbM23jQJ4fnzFsoHoTsxYDznr > SELF 0.00000000 Waves

{ "type": 13, "id": "6FY627hQpwQbpuxPkTSiSRNDTg45vxDnJ46axyrwscfb", "fee": 2300000, "feeAssetId": null, "timestamp": 1703842557494, "version": 2, "chainId": 84, "sender": "3N9Zi6AcWcGbM23jQJ4fnzFsoHoTsxYDznr", "senderPublicKey": "GFbasS3jufhZkK4xR7tdTjjnP8K33KvJFEDHRtxXDkaJ", "proofs": [ "FQRvBfrBKMUoEvxVz3jpDNPUJWK3JZYSSCnwHTdhc92TGiGdduvEsCumdHY6kmyfDMZTFQ56xsaiVbTnxJN3S5b" ], "script": "base64:BgKRFwgCEgQKAggBEgcKBQgICAgBEgQKAggIEgUKAwgIARIECgIICBIDCgEBEgMKAQESBAoCCAgSBAoCCAQSABIDCgEBEgASBAoCCAgSBAoCCAgSBAoCCAgSABIECgIICCIJc2VwYXJhdG9yIg5wb29sV2VpZ2h0TXVsdCIPbWF4RGVwdGhEZWZhdWx0IhZmaW5hbGl6YXRpb25TdGFnZVRvdGFsIhdmaW5hbGl6YXRpb25TdGFnZVNoYXJlcyIOa2V5RXBvY2hMZW5ndGgiEWtleUVwb2NoTGVuZ3RoTmV3IhVrZXlFcG9jaExlbmd0aEJ5RXBvY2giBWVwb2NoIg9rZXlDdXJyZW50RXBvY2giC2tleU1heERlcHRoIiJrZXlWb3RpbmdFbWlzc2lvbkNhbmRpZGF0ZUNvbnRyYWN0Ih1rZXlWb3RpbmdFbWlzc2lvblJhdGVDb250cmFjdCISa2V5RmFjdG9yeUNvbnRyYWN0IhNrZXlCb29zdGluZ0NvbnRyYWN0IhJrZXlTdGFraW5nQ29udHJhY3QiFGtleUZpbmFsaXphdGlvblN0YWdlIgtrZXlOZXh0UG9v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0byBpdHNlbGYuAQJjQwECY0QABAJjRQQBWQkBAmFaAAMJAAECBQFZAgpCeXRlVmVjdG9yBAJiZAUBWQUCYmQDCQABAgUBWQIEVW5pdAgFAmNDD3NlbmRlclB1YmxpY0tleQkAAgECC01hdGNoIGVycm9yCQD0AwMIBQJjQwlib2R5Qnl0ZXMJAJEDAggFAmNDBnByb29mcwAABQJjRdXyxME=", "height": 2907878, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: AV9cwwPTu77YCvGsy8F1tpDhsgUJqzGJ7YTdqUT21x2M Next: Gf6pwhR3UYk3PnoMQGNGJTH1ioev6wyS3FTEY5qj9AC3 Diff:
OldNewDifferences
589589 then if (r)
590590 then $Tuple2(nil, true)
591591 else {
592+ let wxEmission = checkWxEmissionPoolLabel(pool)
592593 let balanceIsOk = {
593594 let @ = invoke(factoryContract, "checkBalance", [lpAssetId], nil)
594595 if ($isInstanceOf(@, "Boolean"))
595596 then @
596597 else throw(($getType(@) + " couldn't be cast to Boolean"))
597598 }
598- let deleteWxEmissionLabelInv = if (balanceIsOk)
599- then unit
600- else invoke(factoryContract, "deleteWxEmissionPoolLabel", [amountAssetId, priceAssetId], nil)
601- if ((deleteWxEmissionLabelInv == deleteWxEmissionLabelInv))
599+ let totalVotes = valueOrElse(getInteger(this, keyTotalVotes(targetEpoch)), 0)
600+ let votingResult = valueOrElse(getInteger(this, keyVotingResult(pool, targetEpoch)), 0)
601+ let share = if (if (if ((totalVotes == 0))
602+ then true
603+ else !(wxEmission))
604+ then true
605+ else !(balanceIsOk))
606+ then 0
607+ else fraction(votingResult, poolWeightMult, totalVotes)
608+ let modifyWeightInv = invoke(factoryContract, "modifyWeight", [lpAssetId, share], nil)
609+ if ((modifyWeightInv == modifyWeightInv))
602610 then {
603- let wxEmission = checkWxEmissionPoolLabel(pool)
604- let totalVotes = valueOrElse(getInteger(this, keyTotalVotes(targetEpoch)), 0)
605- let votingResult = valueOrElse(getInteger(this, keyVotingResult(pool, targetEpoch)), 0)
606- let share = if (if ((totalVotes == 0))
611+ let poolsListActions = if (if (wxEmission)
607612 then true
608- else !(wxEmission))
609- then 0
610- else fraction(votingResult, poolWeightMult, totalVotes)
611- let modifyWeightInv = invoke(factoryContract, "modifyWeight", [lpAssetId, share], nil)
612- if ((modifyWeightInv == modifyWeightInv))
613- then {
614- let poolsListActions = if (if (wxEmission)
615- then true
616- else force)
617- then nil
618- else ([DeleteEntry(keyInList(pool))] ++ deleteNodeActions(poolsListName, poolStr))
619- $Tuple2(([IntegerEntry(keyPoolShare(pool, targetEpoch), share)] ++ poolsListActions), false)
620- }
621- else throw("Strict value is not equal to itself.")
613+ else force)
614+ then nil
615+ else ([DeleteEntry(keyInList(pool))] ++ deleteNodeActions(poolsListName, poolStr))
616+ $Tuple2(([IntegerEntry(keyPoolShare(pool, targetEpoch), share)] ++ poolsListActions), false)
622617 }
623618 else throw("Strict value is not equal to itself.")
624619 }
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let separator = "__"
55
66 let poolWeightMult = 100000000
77
88 let maxDepthDefault = 10
99
1010 let finalizationStageTotal = 0
1111
1212 let finalizationStageShares = 1
1313
1414 let keyEpochLength = makeString(["%s", "epochLength"], separator)
1515
1616 let keyEpochLengthNew = makeString(["%s%s", "epochLength__new"], separator)
1717
1818 func keyEpochLengthByEpoch (epoch) = makeString(["%s%d", "epochLength", toString(epoch)], separator)
1919
2020
2121 let keyCurrentEpoch = makeString(["%s", "currentEpoch"], separator)
2222
2323 let keyMaxDepth = makeString(["%s", "maxDepth"], separator)
2424
2525 let keyVotingEmissionCandidateContract = makeString(["%s", "votingEmissionCandidateContract"], separator)
2626
2727 let keyVotingEmissionRateContract = makeString(["%s", "votingEmissionRateContract"], separator)
2828
2929 let keyFactoryContract = makeString(["%s", "factoryContract"], separator)
3030
3131 let keyBoostingContract = makeString(["%s", "boostingContract"], separator)
3232
3333 let keyStakingContract = makeString(["%s", "stakingContract"], separator)
3434
3535 let keyFinalizationStage = makeString(["%s", "finalizationStage"], separator)
3636
3737 let keyNextPool = makeString(["%s", "nextPool"], separator)
3838
3939 let keyNextUser = makeString(["%s", "nextUser"], separator)
4040
4141 let keyStartHeight = makeString(["%s", "startHeight"], separator)
4242
4343 let keyCurrentEpochUi = makeString(["%s", "currentEpochUi"], separator)
4444
4545 let keyStartHeightUi = makeString(["%s", "startHeightUi"], separator)
4646
4747 let keyFinalizationShouldBeForced = makeString(["%s", "force"], separator)
4848
4949 func keyStartHeightByEpoch (epoch) = makeString(["%s%d", "startHeight", toString(epoch)], separator)
5050
5151
5252 func keyFinalized (epoch) = makeString(["%s%d", "finalized", toString(epoch)], separator)
5353
5454
5555 func keyInList (pool) = {
5656 let $t017881828 = pool
5757 let amountAssetId = $t017881828._1
5858 let priceAssetId = $t017881828._2
5959 makeString(["%s%s%s", "inList", amountAssetId, priceAssetId], separator)
6060 }
6161
6262
6363 func keyUsed (address,epoch) = makeString(["%s%s%d", "used", toString(address), toString(epoch)], separator)
6464
6565
6666 func keyVote (pool,address,epoch) = {
6767 let $t021022142 = pool
6868 let amountAssetId = $t021022142._1
6969 let priceAssetId = $t021022142._2
7070 makeString(["%s%s%s%s%d", "vote", amountAssetId, priceAssetId, toString(address), toString(epoch)], separator)
7171 }
7272
7373
7474 func keyVotingResult (pool,epoch) = {
7575 let $t023242364 = pool
7676 let amountAssetId = $t023242364._1
7777 let priceAssetId = $t023242364._2
7878 makeString(["%s%s%s%d", "votingResult", amountAssetId, priceAssetId, toString(epoch)], separator)
7979 }
8080
8181
8282 func keyVotingResultStaked (lpAssetIdStr,epoch) = makeString(["%s%s%d", "votingResultStaked", lpAssetIdStr, toString(epoch)], separator)
8383
8484
8585 func keyPoolShare (pool,epoch) = {
8686 let $t026852725 = pool
8787 let amountAssetId = $t026852725._1
8888 let priceAssetId = $t026852725._2
8989 makeString(["%s%s%s%d", "poolShare", amountAssetId, priceAssetId, toString(epoch)], separator)
9090 }
9191
9292
9393 func keyTotalVotes (epoch) = makeString(["%s%d", "totalVotes", toString(epoch)], separator)
9494
9595
9696 func keyStakedByUser (lpAssetIdStr,userAddressStr) = makeString(["%s%s%s", "staked", userAddressStr, lpAssetIdStr], separator)
9797
9898
9999 func wrapErr (msg) = makeString(["voting_emission.ride:", msg], " ")
100100
101101
102102 func throwErr (msg) = throw(wrapErr(msg))
103103
104104
105105 func getValueOrFail (address,key,type) = {
106106 let error = wrapErr(makeString(["mandatory ", toString(address), ".", key, " is not defined"], ""))
107107 valueOrErrorMessage( match type {
108108 case str: String =>
109109 getString(address, key)
110110 case int: Int =>
111111 getInteger(address, key)
112112 case _ =>
113113 throwErr("invalid entry type")
114114 }, error)
115115 }
116116
117117
118118 func getStrOrFail (address,key) = {
119119 let @ = getValueOrFail(address, key, "")
120120 if ($isInstanceOf(@, "String"))
121121 then @
122122 else throw(($getType(@) + " couldn't be cast to String"))
123123 }
124124
125125
126126 func getIntOrFail (address,key) = {
127127 let @ = getValueOrFail(address, key, 0)
128128 if ($isInstanceOf(@, "Int"))
129129 then @
130130 else throw(($getType(@) + " couldn't be cast to Int"))
131131 }
132132
133133
134134 func poolToString (pool) = ((pool._1 + separator) + pool._2)
135135
136136
137137 func stringToPool (str) = {
138138 let parts = split(str, separator)
139139 if ((size(parts) == 2))
140140 then $Tuple2(parts[0], parts[1])
141141 else throwErr("invalid pool string")
142142 }
143143
144144
145145 let factoryContract = addressFromStringValue(getStrOrFail(this, keyFactoryContract))
146146
147147 let IdxFactoryCfgGwxRewardDapp = 10
148148
149149 func keyFactoryCfg () = "%s__factoryConfig"
150150
151151
152152 func readFactoryCfgOrFail (factory) = split(getStrOrFail(factory, keyFactoryCfg()), separator)
153153
154154
155155 func getGwxRewardAddressOrFail (factoryCfg) = addressFromStringValue(factoryCfg[IdxFactoryCfgGwxRewardDapp])
156156
157157
158158 func getLpAssetByPoolAssets (amountAssetId,priceAssetId) = {
159159 func keyMappingsBaseAsset2internalId (baseAssetStr) = ("%s%s%s__mappings__baseAsset2internalId__" + baseAssetStr)
160160
161161 func keyMappingPoolAssetsToPoolContractAddress (internalAmountAssetIdStr,internalPriceAssetIdStr) = (((("%d%d%s%s__" + toString(internalAmountAssetIdStr)) + "__") + toString(internalPriceAssetIdStr)) + "__mappings__poolAssets2PoolContract")
162162
163163 func keyMappingPoolContractToLPAsset (poolContractAddress) = (("%s%s%s__" + poolContractAddress) + "__mappings__poolContract2LpAsset")
164164
165165 let amountAssetInternalId = getIntOrFail(factoryContract, keyMappingsBaseAsset2internalId(amountAssetId))
166166 let priceAssetInternalId = getIntOrFail(factoryContract, keyMappingsBaseAsset2internalId(priceAssetId))
167167 let poolContractAddress = getStrOrFail(factoryContract, keyMappingPoolAssetsToPoolContractAddress(amountAssetInternalId, priceAssetInternalId))
168168 let lpAssetId = getStrOrFail(factoryContract, keyMappingPoolContractToLPAsset(poolContractAddress))
169169 lpAssetId
170170 }
171171
172172
173173 func checkWxEmissionPoolLabel (pool) = {
174174 let $t055655605 = pool
175175 let amountAssetId = $t055655605._1
176176 let priceAssetId = $t055655605._2
177177 let @ = invoke(factoryContract, "checkWxEmissionPoolLabel", [amountAssetId, priceAssetId], nil)
178178 if ($isInstanceOf(@, "Boolean"))
179179 then @
180180 else throw(($getType(@) + " couldn't be cast to Boolean"))
181181 }
182182
183183
184184 func gwxRewardDeposit () = {
185185 let factoryCfg = readFactoryCfgOrFail(factoryContract)
186186 let gwxRewardsContract = getGwxRewardAddressOrFail(factoryCfg)
187187 invoke(gwxRewardsContract, "deposit", nil, nil)
188188 }
189189
190190
191191 let poolsListName = "pools"
192192
193193 func getVotesListName (pool) = {
194194 let $t060226062 = pool
195195 let amountAssetId = $t060226062._1
196196 let priceAssetId = $t060226062._2
197197 makeString(["votes", amountAssetId, priceAssetId], separator)
198198 }
199199
200200
201201 func keyListHead (listName) = {
202202 let meta = if ((listName == poolsListName))
203203 then "%s%s"
204204 else "%s%s%s%s"
205205 makeString([meta, listName, "head"], separator)
206206 }
207207
208208
209209 func keyListSize (listName) = {
210210 let meta = if ((listName == poolsListName))
211211 then "%s%s"
212212 else "%s%s%s%s"
213213 makeString([meta, listName, "size"], separator)
214214 }
215215
216216
217217 func keyListPrev (listName,id) = {
218218 let meta = if ((listName == poolsListName))
219219 then "%s%s%s%s"
220220 else "%s%s%s%s%s"
221221 makeString([meta, listName, id, "prev"], separator)
222222 }
223223
224224
225225 func keyListNext (listName,id) = {
226226 let meta = if ((listName == poolsListName))
227227 then "%s%s%s%s"
228228 else "%s%s%s%s%s"
229229 makeString([meta, listName, id, "next"], separator)
230230 }
231231
232232
233233 func containsNode (listName,id) = {
234234 let headOrUnit = getString(this, keyListHead(listName))
235235 let prevOrUnit = getString(this, keyListPrev(listName, id))
236236 let nextOrUnit = getString(this, keyListNext(listName, id))
237237 if (if ((id == valueOrElse(headOrUnit, "")))
238238 then true
239239 else (prevOrUnit != unit))
240240 then true
241241 else (nextOrUnit != unit)
242242 }
243243
244244
245245 func insertNodeActions (listName,id) = {
246246 let headOrUnit = getString(this, keyListHead(listName))
247247 let listSize = valueOrElse(getInteger(this, keyListSize(listName)), 0)
248248 let checkNode = if (!(containsNode(listName, id)))
249249 then true
250250 else throwErr("Node exists")
251251 if ((checkNode == checkNode))
252252 then (([IntegerEntry(keyListSize(listName), (listSize + 1))] ++ (if ((headOrUnit != unit))
253253 then [StringEntry(keyListNext(listName, id), value(headOrUnit)), StringEntry(keyListPrev(listName, value(headOrUnit)), id)]
254254 else nil)) ++ [StringEntry(keyListHead(listName), id)])
255255 else throw("Strict value is not equal to itself.")
256256 }
257257
258258
259259 func deleteNodeActions (listName,id) = {
260260 let headOrUnit = getString(this, keyListHead(listName))
261261 let listSize = valueOrElse(getInteger(this, keyListSize(listName)), 0)
262262 let prevOrUnit = getString(this, keyListPrev(listName, id))
263263 let nextOrUnit = getString(this, keyListNext(listName, id))
264264 ([IntegerEntry(keyListSize(listName), (listSize - 1))] ++ (if (if ((prevOrUnit != unit))
265265 then (nextOrUnit != unit)
266266 else false)
267267 then [StringEntry(keyListNext(listName, value(prevOrUnit)), value(nextOrUnit)), StringEntry(keyListPrev(listName, value(nextOrUnit)), value(prevOrUnit)), DeleteEntry(keyListPrev(listName, id)), DeleteEntry(keyListNext(listName, id))]
268268 else if ((nextOrUnit != unit))
269269 then [StringEntry(keyListHead(listName), value(nextOrUnit)), DeleteEntry(keyListNext(listName, id)), DeleteEntry(keyListPrev(listName, value(nextOrUnit)))]
270270 else if ((prevOrUnit != unit))
271271 then [DeleteEntry(keyListPrev(listName, id)), DeleteEntry(keyListNext(listName, value(prevOrUnit)))]
272272 else if ((id == valueOrElse(headOrUnit, "")))
273273 then [DeleteEntry(keyListHead(listName))]
274274 else throwErr(((("invalid node: " + listName) + ".") + id))))
275275 }
276276
277277
278278 func keyManagerVaultAddress () = "%s__managerVaultAddress"
279279
280280
281281 func keyManagerPublicKey () = "%s__managerPublicKey"
282282
283283
284284 func getManagerVaultAddressOrThis () = match getString(keyManagerVaultAddress()) {
285285 case s: String =>
286286 addressFromStringValue(s)
287287 case _ =>
288288 this
289289 }
290290
291291
292292 func managerPublicKeyOrUnit () = {
293293 let managerVaultAddress = getManagerVaultAddressOrThis()
294294 match getString(managerVaultAddress, keyManagerPublicKey()) {
295295 case s: String =>
296296 fromBase58String(s)
297297 case _: Unit =>
298298 unit
299299 case _ =>
300300 throw("Match error")
301301 }
302302 }
303303
304304
305305 func isManager (i) = match managerPublicKeyOrUnit() {
306306 case pk: ByteVector =>
307307 (i.callerPublicKey == pk)
308308 case _: Unit =>
309309 (i.caller == this)
310310 case _ =>
311311 throw("Match error")
312312 }
313313
314314
315315 func mustManager (i) = if (isManager(i))
316316 then true
317317 else throw("permission denied")
318318
319319
320320 func mustThis (i) = if ((i.caller == this))
321321 then true
322322 else throw("permission denied")
323323
324324
325325 @Callable(i)
326326 func getUserGwxAmountAtHeight (userAddress,targetHeight) = {
327327 let boostingContractAddress = valueOrErrorMessage(addressFromString(getStrOrFail(this, keyBoostingContract)), wrapErr("invalid boosting contract address"))
328328 $Tuple2(nil, {
329329 let @ = invoke(boostingContractAddress, "getUserGwxAmountAtHeightREADONLY", [userAddress, targetHeight], nil)
330330 if ($isInstanceOf(@, "Int"))
331331 then @
332332 else throw(($getType(@) + " couldn't be cast to Int"))
333333 })
334334 }
335335
336336
337337
338338 @Callable(i)
339339 func constructor (factoryContract,votingEmissionCandidateContract,boostingContract,stakingContract,epochLength) = {
340340 let checks = [mustManager(i), if ((addressFromString(factoryContract) != unit))
341341 then true
342342 else "invalid factory contract address", if ((addressFromString(votingEmissionCandidateContract) != unit))
343343 then true
344344 else "invalid voting emission candidate contract address", if ((addressFromString(boostingContract) != unit))
345345 then true
346346 else "invalid boosting contract address", if ((addressFromString(stakingContract) != unit))
347347 then true
348348 else "invalid staking contract address", if ((epochLength > 0))
349349 then true
350350 else throwErr("invalid epoch length")]
351351 if ((checks == checks))
352352 then $Tuple2([StringEntry(keyFactoryContract, factoryContract), StringEntry(keyVotingEmissionCandidateContract, votingEmissionCandidateContract), StringEntry(keyBoostingContract, boostingContract), StringEntry(keyStakingContract, stakingContract), IntegerEntry(keyEpochLength, epochLength)], unit)
353353 else throw("Strict value is not equal to itself.")
354354 }
355355
356356
357357
358358 @Callable(i)
359359 func create (amountAssetId,priceAssetId) = {
360360 let checks = [if ((toBase58String(i.caller.bytes) == valueOrElse(getString(this, keyVotingEmissionCandidateContract), "")))
361361 then true
362362 else mustManager(i)]
363363 if ((checks == checks))
364364 then {
365365 let pool = $Tuple2(amountAssetId, priceAssetId)
366366 let inListActions = ([BooleanEntry(keyInList(pool), true)] ++ insertNodeActions(poolsListName, poolToString(pool)))
367367 let currentEpochIsNotDefined = (getInteger(this, keyCurrentEpoch) == unit)
368368 let startHeightActions = if (currentEpochIsNotDefined)
369369 then {
370370 let epoch = 0
371371 [IntegerEntry(keyCurrentEpoch, epoch), IntegerEntry(keyStartHeightByEpoch(epoch), height), IntegerEntry(keyStartHeight, height), IntegerEntry(keyCurrentEpochUi, epoch), IntegerEntry(keyStartHeightUi, height)]
372372 }
373373 else nil
374374 $Tuple2((inListActions ++ startHeightActions), unit)
375375 }
376376 else throw("Strict value is not equal to itself.")
377377 }
378378
379379
380380
381381 @Callable(i)
382382 func vote (amountAssetId,priceAssetId,amount) = {
383383 let pool = $Tuple2(amountAssetId, priceAssetId)
384384 let epoch = valueOrElse(getInteger(this, keyCurrentEpoch), 0)
385385 let startHeight = getIntOrFail(this, keyStartHeightByEpoch(epoch))
386386 let epochLength = getIntOrFail(this, keyEpochLength)
387387 let endHeight = (startHeight + epochLength)
388388 let finalizationStageOrUnit = getInteger(this, keyFinalizationStage)
389389 let used = valueOrElse(getInteger(this, keyUsed(i.caller, epoch)), 0)
390390 let vote = valueOrElse(getInteger(this, keyVote(pool, i.caller, epoch)), 0)
391391 let poolResult = valueOrElse(getInteger(this, keyVotingResult(pool, epoch)), 0)
392392 let totalVotes = valueOrElse(getInteger(this, keyTotalVotes(epoch)), 0)
393393 let gwxAmountAtEndTotal = {
394394 let @ = invoke(this, "getUserGwxAmountAtHeight", [toBase58String(i.caller.bytes), endHeight], nil)
395395 if ($isInstanceOf(@, "Int"))
396396 then @
397397 else throw(($getType(@) + " couldn't be cast to Int"))
398398 }
399399 let available = (gwxAmountAtEndTotal - used)
400400 let newVote = (vote + amount)
401401 let wxEmission = checkWxEmissionPoolLabel(pool)
402402 let checks = [if ((getBoolean(keyInList(pool)) != unit))
403403 then true
404404 else throwErr("invalid assets"), if ((endHeight > height))
405405 then true
406406 else throwErr("invalid height"), if ((finalizationStageOrUnit == unit))
407407 then true
408408 else throwErr("finalization in progress"), if ((gwxAmountAtEndTotal > 0))
409409 then true
410410 else throwErr("you do not have gWX"), if (if ((amount > 0))
411411 then (available >= amount)
412412 else false)
413413 then true
414414 else throwErr("invalid amount"), if (wxEmission)
415415 then true
416416 else throwErr("pool hasn't WX_EMISSION label")]
417417 if ((checks == checks))
418418 then {
419419 let votesListName = getVotesListName(pool)
420420 let userAddressStr = toString(i.caller)
421421 let votesListActions = if (containsNode(votesListName, userAddressStr))
422422 then nil
423423 else insertNodeActions(votesListName, userAddressStr)
424424 $Tuple2(([IntegerEntry(keyUsed(i.caller, epoch), (used + amount)), IntegerEntry(keyVote(pool, i.caller, epoch), newVote), IntegerEntry(keyVotingResult(pool, epoch), (poolResult + amount)), IntegerEntry(keyTotalVotes(epoch), (totalVotes + amount))] ++ votesListActions), unit)
425425 }
426426 else throw("Strict value is not equal to itself.")
427427 }
428428
429429
430430
431431 @Callable(i)
432432 func cancelVote (amountAssetId,priceAssetId) = {
433433 let pool = $Tuple2(amountAssetId, priceAssetId)
434434 let epoch = valueOrElse(getInteger(this, keyCurrentEpoch), 0)
435435 let startHeight = getIntOrFail(this, keyStartHeightByEpoch(epoch))
436436 let epochLength = getIntOrFail(this, keyEpochLength)
437437 let endHeight = (startHeight + epochLength)
438438 let finalizationStageOrUnit = getInteger(this, keyFinalizationStage)
439439 let used = valueOrElse(getInteger(this, keyUsed(i.caller, epoch)), 0)
440440 let vote = valueOrElse(getInteger(this, keyVote(pool, i.caller, epoch)), 0)
441441 let poolResult = valueOrElse(getInteger(this, keyVotingResult(pool, epoch)), 0)
442442 let totalVotes = valueOrElse(getInteger(this, keyTotalVotes(epoch)), 0)
443443 let checks = [if ((getBoolean(keyInList(pool)) != unit))
444444 then true
445445 else throwErr("invalid assets"), if ((endHeight > height))
446446 then true
447447 else throwErr("invalid height"), if ((finalizationStageOrUnit == unit))
448448 then true
449449 else throwErr("finalization in progress"), if ((vote > 0))
450450 then true
451451 else throwErr("no vote")]
452452 if ((checks == checks))
453453 then {
454454 let votesListName = getVotesListName(pool)
455455 let userAddressStr = toString(i.caller)
456456 $Tuple2(([IntegerEntry(keyUsed(i.caller, epoch), max([(used - vote), 0])), DeleteEntry(keyVote(pool, i.caller, epoch)), IntegerEntry(keyVotingResult(pool, epoch), (poolResult - vote)), IntegerEntry(keyTotalVotes(epoch), (totalVotes - vote))] ++ deleteNodeActions(votesListName, userAddressStr)), unit)
457457 }
458458 else throw("Strict value is not equal to itself.")
459459 }
460460
461461
462462
463463 @Callable(i)
464464 func setEpochLength (newEpochLength) = {
465465 let checks = [mustManager(i), if ((newEpochLength > 0))
466466 then true
467467 else throwErr("invalid epoch length")]
468468 if ((checks == checks))
469469 then $Tuple2([IntegerEntry(keyEpochLengthNew, newEpochLength)], unit)
470470 else throw("Strict value is not equal to itself.")
471471 }
472472
473473
474474
475475 @Callable(i)
476476 func setMaxDepth (newMaxDepth) = {
477477 let checks = [mustManager(i), if ((newMaxDepth > 0))
478478 then true
479479 else throwErr("invalid max depth")]
480480 if ((checks == checks))
481481 then $Tuple2([IntegerEntry(keyMaxDepth, newMaxDepth)], unit)
482482 else throw("Strict value is not equal to itself.")
483483 }
484484
485485
486486
487487 @Callable(i)
488488 func processVoteINTERNAL (poolStr,userAddressStr) = {
489489 let checkCaller = mustThis(i)
490490 if ((checkCaller == checkCaller))
491491 then {
492492 let userAddress = valueOrErrorMessage(addressFromString(userAddressStr), wrapErr(("processVoteINTERNAL: invalid user address " + userAddressStr)))
493493 let epoch = getIntOrFail(this, keyCurrentEpoch)
494494 let epochPrevious = (epoch - 1)
495495 let epochLength = getIntOrFail(this, keyEpochLength)
496496 let startHeight = getIntOrFail(this, keyStartHeightByEpoch(epoch))
497497 let endHeight = (startHeight + epochLength)
498498 let startHeightPrevious = getIntOrFail(this, keyStartHeightByEpoch(epochPrevious))
499499 let epochLengthPrevious = getIntOrFail(this, keyEpochLengthByEpoch(epochPrevious))
500500 let endHeightPrevious = (startHeightPrevious + epochLengthPrevious)
501501 let checkTargetEpoch = if ((epochPrevious >= 0))
502502 then true
503503 else throwErr("processVoteINTERNAL: invalid previous epoch")
504504 if ((checkTargetEpoch == checkTargetEpoch))
505505 then {
506506 let pool = stringToPool(poolStr)
507507 let $t01806518105 = pool
508508 let amountAssetId = $t01806518105._1
509509 let priceAssetId = $t01806518105._2
510510 let wxEmission = checkWxEmissionPoolLabel(pool)
511511 let gwxAmountAtEndTotal = {
512512 let @ = invoke(this, "getUserGwxAmountAtHeight", [userAddressStr, endHeight], nil)
513513 if ($isInstanceOf(@, "Int"))
514514 then @
515515 else throw(($getType(@) + " couldn't be cast to Int"))
516516 }
517517 let gwxAmountAtEndTotalPrevious = {
518518 let @ = invoke(this, "getUserGwxAmountAtHeight", [userAddressStr, endHeightPrevious], nil)
519519 if ($isInstanceOf(@, "Int"))
520520 then @
521521 else throw(($getType(@) + " couldn't be cast to Int"))
522522 }
523523 let totalVotes = valueOrElse(getInteger(keyTotalVotes(epoch)), 0)
524524 let votingResult = valueOrElse(getInteger(keyVotingResult(pool, epoch)), 0)
525525 let votePrevious = valueOrErrorMessage(getInteger(keyVote(pool, userAddress, epochPrevious)), wrapErr((((("processVoteINTERNAL " + poolStr) + " ") + userAddressStr) + ": no previous vote")))
526526 let used = valueOrElse(getInteger(this, keyUsed(userAddress, epoch)), 0)
527527 let lpAssetIdStr = getLpAssetByPoolAssets(amountAssetId, priceAssetId)
528528 let votingResultStakedPrevious = valueOrElse(getInteger(keyVotingResultStaked(lpAssetIdStr, epochPrevious)), 0)
529529 let stakingContract = addressFromStringValue(getStrOrFail(this, keyStakingContract))
530530 let stakedByUser = valueOrElse(getInteger(stakingContract, keyStakedByUser(lpAssetIdStr, userAddressStr)), 0)
531531 let votingResultStakedActions = if ((stakedByUser == 0))
532532 then nil
533533 else [IntegerEntry(keyVotingResultStaked(lpAssetIdStr, epochPrevious), (votingResultStakedPrevious + votePrevious))]
534534 let lpAssetId = getLpAssetByPoolAssets(amountAssetId, priceAssetId)
535535 let balanceIsOk = {
536536 let @ = invoke(factoryContract, "checkBalance", [lpAssetId], nil)
537537 if ($isInstanceOf(@, "Boolean"))
538538 then @
539539 else throw(($getType(@) + " couldn't be cast to Boolean"))
540540 }
541541 let newVote = if ((gwxAmountAtEndTotalPrevious > 0))
542542 then fraction(votePrevious, gwxAmountAtEndTotal, gwxAmountAtEndTotalPrevious)
543543 else 0
544544 let actions = if (if (if ((newVote > 0))
545545 then wxEmission
546546 else false)
547547 then balanceIsOk
548548 else false)
549549 then [IntegerEntry(keyVote(pool, userAddress, epoch), newVote), IntegerEntry(keyTotalVotes(epoch), (totalVotes + newVote)), IntegerEntry(keyVotingResult(pool, epoch), (votingResult + newVote)), IntegerEntry(keyUsed(userAddress, epoch), (used + newVote))]
550550 else deleteNodeActions(getVotesListName(pool), userAddressStr)
551551 $Tuple2((actions ++ votingResultStakedActions), unit)
552552 }
553553 else throw("Strict value is not equal to itself.")
554554 }
555555 else throw("Strict value is not equal to itself.")
556556 }
557557
558558
559559
560560 @Callable(i)
561561 func processPoolINTERNAL (poolStr,force) = {
562562 let checkCaller = mustThis(i)
563563 if ((checkCaller == checkCaller))
564564 then {
565565 let targetEpoch = {
566566 let currentEpoch = getIntOrFail(this, keyCurrentEpoch)
567567 if (force)
568568 then currentEpoch
569569 else (currentEpoch - 1)
570570 }
571571 let checkTargetEpoch = if ((targetEpoch >= 0))
572572 then true
573573 else throwErr("processPoolINTERNAL: invalid target epoch")
574574 if ((checkTargetEpoch == checkTargetEpoch))
575575 then {
576576 let pool = stringToPool(poolStr)
577577 let $t02064120681 = pool
578578 let amountAssetId = $t02064120681._1
579579 let priceAssetId = $t02064120681._2
580580 let stakingContract = addressFromStringValue(getStrOrFail(this, keyStakingContract))
581581 let lpAssetId = getLpAssetByPoolAssets(amountAssetId, priceAssetId)
582582 let r = {
583583 let @ = invoke(stakingContract, "usersListTraversal", [lpAssetId], nil)
584584 if ($isInstanceOf(@, "Boolean"))
585585 then @
586586 else throw(($getType(@) + " couldn't be cast to Boolean"))
587587 }
588588 if ((r == r))
589589 then if (r)
590590 then $Tuple2(nil, true)
591591 else {
592+ let wxEmission = checkWxEmissionPoolLabel(pool)
592593 let balanceIsOk = {
593594 let @ = invoke(factoryContract, "checkBalance", [lpAssetId], nil)
594595 if ($isInstanceOf(@, "Boolean"))
595596 then @
596597 else throw(($getType(@) + " couldn't be cast to Boolean"))
597598 }
598- let deleteWxEmissionLabelInv = if (balanceIsOk)
599- then unit
600- else invoke(factoryContract, "deleteWxEmissionPoolLabel", [amountAssetId, priceAssetId], nil)
601- if ((deleteWxEmissionLabelInv == deleteWxEmissionLabelInv))
599+ let totalVotes = valueOrElse(getInteger(this, keyTotalVotes(targetEpoch)), 0)
600+ let votingResult = valueOrElse(getInteger(this, keyVotingResult(pool, targetEpoch)), 0)
601+ let share = if (if (if ((totalVotes == 0))
602+ then true
603+ else !(wxEmission))
604+ then true
605+ else !(balanceIsOk))
606+ then 0
607+ else fraction(votingResult, poolWeightMult, totalVotes)
608+ let modifyWeightInv = invoke(factoryContract, "modifyWeight", [lpAssetId, share], nil)
609+ if ((modifyWeightInv == modifyWeightInv))
602610 then {
603- let wxEmission = checkWxEmissionPoolLabel(pool)
604- let totalVotes = valueOrElse(getInteger(this, keyTotalVotes(targetEpoch)), 0)
605- let votingResult = valueOrElse(getInteger(this, keyVotingResult(pool, targetEpoch)), 0)
606- let share = if (if ((totalVotes == 0))
611+ let poolsListActions = if (if (wxEmission)
607612 then true
608- else !(wxEmission))
609- then 0
610- else fraction(votingResult, poolWeightMult, totalVotes)
611- let modifyWeightInv = invoke(factoryContract, "modifyWeight", [lpAssetId, share], nil)
612- if ((modifyWeightInv == modifyWeightInv))
613- then {
614- let poolsListActions = if (if (wxEmission)
615- then true
616- else force)
617- then nil
618- else ([DeleteEntry(keyInList(pool))] ++ deleteNodeActions(poolsListName, poolStr))
619- $Tuple2(([IntegerEntry(keyPoolShare(pool, targetEpoch), share)] ++ poolsListActions), false)
620- }
621- else throw("Strict value is not equal to itself.")
613+ else force)
614+ then nil
615+ else ([DeleteEntry(keyInList(pool))] ++ deleteNodeActions(poolsListName, poolStr))
616+ $Tuple2(([IntegerEntry(keyPoolShare(pool, targetEpoch), share)] ++ poolsListActions), false)
622617 }
623618 else throw("Strict value is not equal to itself.")
624619 }
625620 else throw("Strict value is not equal to itself.")
626621 }
627622 else throw("Strict value is not equal to itself.")
628623 }
629624 else throw("Strict value is not equal to itself.")
630625 }
631626
632627
633628
634629 @Callable(i)
635630 func finalizeHelper () = {
636631 let force = valueOrElse(getBoolean(keyFinalizationShouldBeForced), false)
637632 let epoch = valueOrElse(getInteger(this, keyCurrentEpoch), 0)
638633 let previousEpoch = (epoch - 1)
639634 let startHeight = getIntOrFail(this, keyStartHeightByEpoch(epoch))
640635 let epochLength = getIntOrFail(this, keyEpochLength)
641636 let endHeight = (startHeight + epochLength)
642637 let finalizationStageOrUnit = getInteger(this, keyFinalizationStage)
643638 if (if (if ((height >= endHeight))
644639 then (finalizationStageOrUnit == unit)
645640 else false)
646641 then !(force)
647642 else false)
648643 then {
649644 let newEpoch = (epoch + 1)
650645 let newEpochLengthOption = getInteger(this, keyEpochLengthNew)
651646 let newEpochLengthActions = match newEpochLengthOption {
652647 case newEpochLength: Int =>
653648 [IntegerEntry(keyEpochLength, newEpochLength), DeleteEntry(keyEpochLengthNew)]
654649 case _: Unit =>
655650 nil
656651 case _ =>
657652 throw("Match error")
658653 }
659654 $Tuple2(([IntegerEntry(keyStartHeightByEpoch(newEpoch), height), IntegerEntry(keyStartHeight, height), IntegerEntry(keyCurrentEpoch, newEpoch), IntegerEntry(keyFinalizationStage, finalizationStageTotal), IntegerEntry(keyEpochLengthByEpoch(epoch), epochLength)] ++ newEpochLengthActions), true)
660655 }
661656 else if (if (force)
662657 then (finalizationStageOrUnit == unit)
663658 else false)
664659 then $Tuple2([IntegerEntry(keyFinalizationStage, finalizationStageShares)], true)
665660 else if ((finalizationStageOrUnit == unit))
666661 then $Tuple2(nil, false)
667662 else if ((finalizationStageOrUnit == finalizationStageTotal))
668663 then {
669664 let poolOrUnit = getString(keyNextPool)
670665 let userOrUnit = getString(keyNextUser)
671666 match poolOrUnit {
672667 case _: Unit =>
673668 match getString(keyListHead(poolsListName)) {
674669 case _: Unit =>
675670 $Tuple2([IntegerEntry(keyFinalizationStage, finalizationStageShares), DeleteEntry(keyNextPool), DeleteEntry(keyNextUser)], true)
676671 case poolsHeadStr: String =>
677672 $Tuple2([StringEntry(keyNextPool, poolsHeadStr)], true)
678673 case _ =>
679674 throw("Match error")
680675 }
681676 case poolStr: String =>
682677 let pool = stringToPool(poolStr)
683678 let nextUserOrUnit = match userOrUnit {
684679 case _: Unit =>
685680 getString(keyListHead(getVotesListName(pool)))
686681 case user: String =>
687682 let next = getString(keyListNext(getVotesListName(pool), user))
688683 if ((next == next))
689684 then {
690685 let processVoteInv = invoke(this, "processVoteINTERNAL", [poolStr, user], nil)
691686 if ((processVoteInv == processVoteInv))
692687 then next
693688 else throw("Strict value is not equal to itself.")
694689 }
695690 else throw("Strict value is not equal to itself.")
696691 case _ =>
697692 throw("Match error")
698693 }
699694 match nextUserOrUnit {
700695 case _: Unit =>
701696 let nextPoolOrUnit = getString(keyListNext(poolsListName, poolStr))
702697 match nextPoolOrUnit {
703698 case _: Unit =>
704699 $Tuple2([IntegerEntry(keyFinalizationStage, finalizationStageShares), DeleteEntry(keyNextPool), DeleteEntry(keyNextUser)], true)
705700 case s: String =>
706701 $Tuple2([StringEntry(keyNextPool, s), DeleteEntry(keyNextUser)], true)
707702 case _ =>
708703 throw("Match error")
709704 }
710705 case nextUser: String =>
711706 $Tuple2([StringEntry(keyNextUser, nextUser)], true)
712707 case _ =>
713708 throw("Match error")
714709 }
715710 case _ =>
716711 throw("Match error")
717712 }
718713 }
719714 else if ((finalizationStageOrUnit == finalizationStageShares))
720715 then {
721716 let poolOrUnit = getString(keyNextPool)
722717 match poolOrUnit {
723718 case _: Unit =>
724719 match getString(keyListHead(poolsListName)) {
725720 case _: Unit =>
726721 let actions = if (force)
727722 then [DeleteEntry(keyFinalizationStage), DeleteEntry(keyFinalizationShouldBeForced)]
728723 else [DeleteEntry(keyFinalizationStage), BooleanEntry(keyFinalized(previousEpoch), true), IntegerEntry(keyCurrentEpochUi, epoch), IntegerEntry(keyStartHeightUi, startHeight)]
729724 let gwxRewardDepositInv = gwxRewardDeposit()
730725 if ((gwxRewardDepositInv == gwxRewardDepositInv))
731726 then $Tuple2(actions, true)
732727 else throw("Strict value is not equal to itself.")
733728 case nextPoolStr: String =>
734729 $Tuple2([StringEntry(keyNextPool, nextPoolStr)], true)
735730 case _ =>
736731 throw("Match error")
737732 }
738733 case poolStr: String =>
739734 let nextPoolOrUnit = getString(keyListNext(poolsListName, poolStr))
740735 if ((nextPoolOrUnit == nextPoolOrUnit))
741736 then {
742737 let r = {
743738 let @ = invoke(this, "processPoolINTERNAL", [poolStr, force], nil)
744739 if ($isInstanceOf(@, "Boolean"))
745740 then @
746741 else throw(($getType(@) + " couldn't be cast to Boolean"))
747742 }
748743 if ((r == r))
749744 then if (r)
750745 then $Tuple2(nil, true)
751746 else match nextPoolOrUnit {
752747 case _: Unit =>
753748 let actions = if (force)
754749 then [DeleteEntry(keyFinalizationStage), DeleteEntry(keyFinalizationShouldBeForced), DeleteEntry(keyNextPool)]
755750 else [DeleteEntry(keyFinalizationStage), BooleanEntry(keyFinalized(previousEpoch), true), IntegerEntry(keyCurrentEpochUi, epoch), IntegerEntry(keyStartHeightUi, startHeight), DeleteEntry(keyNextPool)]
756751 let gwxRewardDepositInv = gwxRewardDeposit()
757752 if ((gwxRewardDepositInv == gwxRewardDepositInv))
758753 then $Tuple2(actions, true)
759754 else throw("Strict value is not equal to itself.")
760755 case nextPoolStr: String =>
761756 $Tuple2([StringEntry(keyNextPool, nextPoolStr)], true)
762757 case _ =>
763758 throw("Match error")
764759 }
765760 else throw("Strict value is not equal to itself.")
766761 }
767762 else throw("Strict value is not equal to itself.")
768763 case _ =>
769764 throw("Match error")
770765 }
771766 }
772767 else throwErr("finalization is broken")
773768 }
774769
775770
776771
777772 @Callable(i)
778773 func finalizeWrapper (counter) = {
779774 let votingEmissionRateContract = addressFromStringValue(getStringValue(this, keyVotingEmissionRateContract))
780775 let result = {
781776 let @ = invoke(this, "finalizeHelper", nil, nil)
782777 if ($isInstanceOf(@, "Boolean"))
783778 then @
784779 else throw(($getType(@) + " couldn't be cast to Boolean"))
785780 }
786781 if ((result == result))
787782 then if (!(result))
788783 then if ((counter == 0))
789784 then throwErr("Current voting is not over yet")
790785 else {
791786 let inv = invoke(votingEmissionRateContract, "finalize", nil, nil)
792787 if ((inv == inv))
793788 then $Tuple2(nil, unit)
794789 else throw("Strict value is not equal to itself.")
795790 }
796791 else {
797792 let maxDepth = valueOrElse(getInteger(this, keyMaxDepth), maxDepthDefault)
798793 if ((maxDepth > counter))
799794 then {
800795 let inv = invoke(this, "finalizeWrapper", [(counter + 1)], nil)
801796 if ((inv == inv))
802797 then $Tuple2(nil, unit)
803798 else throw("Strict value is not equal to itself.")
804799 }
805800 else $Tuple2(nil, unit)
806801 }
807802 else throw("Strict value is not equal to itself.")
808803 }
809804
810805
811806
812807 @Callable(i)
813808 func finalize () = {
814809 let inv = invoke(this, "finalizeWrapper", [0], nil)
815810 if ((inv == inv))
816811 then $Tuple2(nil, unit)
817812 else throw("Strict value is not equal to itself.")
818813 }
819814
820815
821816
822817 @Callable(i)
823818 func containsNodeREADONLY (listName,id) = $Tuple2(nil, containsNode(listName, id))
824819
825820
826821
827822 @Callable(i)
828823 func insertNode (listName,id) = {
829824 let checkCaller = mustManager(i)
830825 if ((checkCaller == checkCaller))
831826 then $Tuple2(insertNodeActions(listName, id), unit)
832827 else throw("Strict value is not equal to itself.")
833828 }
834829
835830
836831
837832 @Callable(i)
838833 func deleteNode (listName,id) = {
839834 let checkCaller = mustManager(i)
840835 if ((checkCaller == checkCaller))
841836 then $Tuple2(deleteNodeActions(listName, id), unit)
842837 else throw("Strict value is not equal to itself.")
843838 }
844839
845840
846841
847842 @Callable(i)
848843 func isFinalizationInProgress () = {
849844 let finalizationStageOrUnit = getInteger(this, keyFinalizationStage)
850845 let finalizationInProgress = (finalizationStageOrUnit != unit)
851846 $Tuple2(nil, finalizationInProgress)
852847 }
853848
854849
855850
856851 @Callable(i)
857852 func deletePool (amountAssetId,priceAssetId) = {
858853 let checkCaller = if (if ((i.caller == factoryContract))
859854 then true
860855 else mustManager(i))
861856 then true
862857 else throwErr("Permission denied")
863858 if ((checkCaller == checkCaller))
864859 then {
865860 let listName = "pools"
866861 let pool = $Tuple2(amountAssetId, priceAssetId)
867862 let id = makeString([amountAssetId, priceAssetId], separator)
868863 let actions = if (containsNode(listName, id))
869864 then deleteNodeActions(listName, id)
870865 else nil
871866 ([DeleteEntry(keyInList(pool))] ++ actions)
872867 }
873868 else throw("Strict value is not equal to itself.")
874869 }
875870
876871
877872 @Verifier(tx)
878873 func verify () = {
879874 let targetPublicKey = match managerPublicKeyOrUnit() {
880875 case pk: ByteVector =>
881876 pk
882877 case _: Unit =>
883878 tx.senderPublicKey
884879 case _ =>
885880 throw("Match error")
886881 }
887882 sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey)
888883 }
889884

github/deemru/w8io/169f3d6 
109.77 ms