tx · 742AasWuoQbZynL9MmuiXB6avLG8goNgzvxJSUAefqGa

3Mx3zmXrMcLFCafMuPtXAzR4ZPVeZYb6qLz:  -0.02400000 Waves

2023.09.07 12:07 [2744761] smart account 3Mx3zmXrMcLFCafMuPtXAzR4ZPVeZYb6qLz > SELF 0.00000000 Waves

{ "type": 13, "id": "742AasWuoQbZynL9MmuiXB6avLG8goNgzvxJSUAefqGa", "fee": 2400000, "feeAssetId": null, "timestamp": 1694077721213, "version": 2, "chainId": 84, "sender": "3Mx3zmXrMcLFCafMuPtXAzR4ZPVeZYb6qLz", "senderPublicKey": "D28XoueZWsMfm8Y5pa6C5ZFuYoWgre2Wm8tzJANJgMnq", "proofs": [ "4c6v49eMXEzx3PutZuLRHksm3idFqR3BPNWh9DLEM4BZaLaNg3UTsJTAeKmgxpXK4TxHfMZ5sk2HQkSbH7CvMkYe" ], "script": "base64:BgK/IAgCEgMKAQgSAwoBCBIAEgMKAQgSBAoCCAESBgoEAgECAhIDCgEIEgMKAQgSBQoDCAgEEgYKBAEYCBgSBAoCGAgSBAoCCAgSBAoCCAgSAwoBCBIDCgEIEgQKAggIIgZTQ0FMRTgiBU1VTFQzIgVNVUxUOCIHU0NBTEUxOCIGTVVMVDE4IgNTRVAiDlBPT0xXRUlHSFRNVUxUIgp6ZXJvQmlnSW50IglvbmVCaWdJbnQiB3dyYXBFcnIiA21zZyIIdGhyb3dFcnIiCWFzQW55TGlzdCIDdmFsIgckbWF0Y2gwIgp2YWxBbnlMeXN0IgVhc0ludCIGdmFsSW50Ighhc1N0cmluZyIGdmFsU3RyIgxhc0J5dGVWZWN0b3IiBnZhbEJpbiIPZ2V0U3RyaW5nT3JGYWlsIgdhZGRyZXNzIgNrZXkiGGdldFN0cmluZ0J5QWRkcmVzc09yRmFpbCIMZ2V0SW50T3JaZXJvIg9nZXRJbnRPckRlZmF1bHQiCmRlZmF1bHRWYWwiDGdldEludE9yRmFpbCIZZ2V0QmlnSW50RnJvbVN0cmluZ09yWmVyby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UCZHUCBFVuaXQJAJQKAgkAzAgCCQELRGVsZXRlRW50cnkBCQECYmQBBQJhQgUDbmlsBwMJAAECBQJkdQIGU3RyaW5nBAJkeAUCZHUJAJQKAgkAzAgCCQELU3RyaW5nRW50cnkCCQECYmQBBQJhQgUCZHgFA25pbAYJAAIBAgtNYXRjaCBlcnJvcgkAAgECJFN0cmljdCB2YWx1ZSBpcyBub3QgZXF1YWwgdG8gaXRzZWxmLgkAAgECC01hdGNoIGVycm9yCQACAQIkU3RyaWN0IHZhbHVlIGlzIG5vdCBlcXVhbCB0byBpdHNlbGYuAmNtAQ5vbk1vZGlmeVdlaWdodAICYXQCYnoDCQECIT0CCAUCY20GY2FsbGVyBQJhWAkBAWwBAhJwZXJtaXNzaW9ucyBkZW5pZWQEAmR5CQECYnkDBQJhdAUCYnoAAAQCYncIBQJkeQJfMQQCYlgIBQJkeQJfMgQCYlkIBQJkeQJfMwUCYlgBAmR6AQJkQQAEAmRCBAFvCQECY2kAAwkAAQIFAW8CCkJ5dGVWZWN0b3IEAmNvBQFvBQJjbwMJAAECBQFvAgRVbml0CAUCZHoPc2VuZGVyUHVibGljS2V5CQACAQILTWF0Y2ggZXJyb3IJAPQDAwgFAmR6CWJvZHlCeXRlcwkAkQMCCAUCZHoGcHJvb2ZzAAAFAmRCWccqog==", "height": 2744761, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 2LgwGvRURsqmjm5kgNuRR45eoPf8utfzcU8fpZbkkJyM Next: 5y9NJFbEGiPLWTc9EsrB8D7YAXViAXUXaQTbMd6qBeqx Diff:
OldNewDifferences
755755
756756
757757 @Callable(i)
758+func usersListTraversal (lpAssetId) = {
759+ let checkCaller = if ((toBase58String(i.caller.bytes) == valueOrElse(getString(this, keyVotingEmissionContract()), "")))
760+ then true
761+ else mustManager(i)
762+ if ((checkCaller == checkCaller))
763+ then {
764+ let listName = getUsersListName(lpAssetId)
765+ let userOrUnit = getString(keyNextUser(lpAssetId))
766+ let headOrUnit = getString(keyListHead(listName))
767+ match userOrUnit {
768+ case _: Unit =>
769+ match headOrUnit {
770+ case _: Unit =>
771+ $Tuple2(nil, false)
772+ case head: String =>
773+ $Tuple2([StringEntry(keyNextUser(lpAssetId), head)], true)
774+ case _ =>
775+ throw("Match error")
776+ }
777+ case userAddress: String =>
778+ let claimedByUserMinReward = getBigIntFromStringOrZero(this, keyClaimedByUserMinReward(lpAssetId, userAddress))
779+ let poolAddress = getStringByAddressOrFail(factoryContract, keyFactoryLpAssetToPoolContractAddress(lpAssetId))
780+ let wxToClaimUserNew = refreshINTEGRALS(lpAssetId, userAddress, poolAddress, 0)._1
781+ let availableToClaim = (wxToClaimUserNew - claimedByUserMinReward)
782+ let throwIfNothingToClaim = true
783+ let r = if ((availableToClaim > zeroBigInt))
784+ then invoke(this, "claimWxINTERNAL", [lpAssetId, userAddress, throwIfNothingToClaim], nil)
785+ else unit
786+ if ((r == r))
787+ then {
788+ let nextUserOrUnit = getString(keyListNext(listName, userAddress))
789+ match nextUserOrUnit {
790+ case _: Unit =>
791+ $Tuple2([DeleteEntry(keyNextUser(lpAssetId))], false)
792+ case nextUser: String =>
793+ $Tuple2([StringEntry(keyNextUser(lpAssetId), nextUser)], true)
794+ case _ =>
795+ throw("Match error")
796+ }
797+ }
798+ else throw("Strict value is not equal to itself.")
799+ case _ =>
800+ throw("Match error")
801+ }
802+ }
803+ else throw("Strict value is not equal to itself.")
804+ }
805+
806+
807+
808+@Callable(i)
758809 func onModifyWeight (lpAssetIdStr,poolAddressStr) = if ((i.caller != factoryContract))
759810 then throwErr("permissions denied")
760811 else {
761- let $t03153531645 = refreshPoolINTEGRALS(lpAssetIdStr, poolAddressStr, 0)
762- let wxPerLpIntegralNew = $t03153531645._1
763- let poolIntegralSTATE = $t03153531645._2
764- let poolDEBUG = $t03153531645._3
812+ let $t03304933159 = refreshPoolINTEGRALS(lpAssetIdStr, poolAddressStr, 0)
813+ let wxPerLpIntegralNew = $t03304933159._1
814+ let poolIntegralSTATE = $t03304933159._2
815+ let poolDEBUG = $t03304933159._3
765816 poolIntegralSTATE
766817 }
767818
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let SCALE8 = 8
55
66 let MULT3 = 1000
77
88 let MULT8 = 100000000
99
1010 let SCALE18 = 18
1111
1212 let MULT18 = toBigInt(1000000000000000000)
1313
1414 let SEP = "__"
1515
1616 let POOLWEIGHTMULT = MULT8
1717
1818 let zeroBigInt = toBigInt(0)
1919
2020 let oneBigInt = toBigInt(1)
2121
2222 func wrapErr (msg) = makeString(["staking.ride:", toString(this), msg], " ")
2323
2424
2525 func throwErr (msg) = throw(wrapErr(msg))
2626
2727
2828 func asAnyList (val) = match val {
2929 case valAnyLyst: List[Any] =>
3030 valAnyLyst
3131 case _ =>
3232 throwErr("fail to cast into List[Any]")
3333 }
3434
3535
3636 func asInt (val) = match val {
3737 case valInt: Int =>
3838 valInt
3939 case _ =>
4040 throwErr("fail to cast into Int")
4141 }
4242
4343
4444 func asString (val) = match val {
4545 case valStr: String =>
4646 valStr
4747 case _ =>
4848 throwErr("fail to cast into Int")
4949 }
5050
5151
5252 func asByteVector (val) = match val {
5353 case valBin: ByteVector =>
5454 valBin
5555 case _ =>
5656 throwErr("fail to cast into Int")
5757 }
5858
5959
6060 func getStringOrFail (address,key) = valueOrErrorMessage(getString(address, key), wrapErr((("mandatory this." + key) + " is not defined")))
6161
6262
6363 func getStringByAddressOrFail (address,key) = valueOrErrorMessage(getString(address, key), wrapErr((((("mandatory " + toString(address)) + ".") + key) + " is not defined")))
6464
6565
6666 func getIntOrZero (address,key) = valueOrElse(getInteger(address, key), 0)
6767
6868
6969 func getIntOrDefault (address,key,defaultVal) = valueOrElse(getInteger(address, key), defaultVal)
7070
7171
7272 func getIntOrFail (address,key) = valueOrErrorMessage(getInteger(address, key), wrapErr((("mandatory this." + key) + " is not defined")))
7373
7474
7575 func getBigIntFromStringOrZero (address,key) = value(parseBigInt(valueOrElse(getString(address, key), "0")))
7676
7777
7878 func getBigIntFromStringOrDefault (address,key,defaultVal) = match getString(address, key) {
7979 case s: String =>
8080 value(parseBigInt(s))
8181 case _: Unit =>
8282 defaultVal
8383 case _ =>
8484 throw("Match error")
8585 }
8686
8787
8888 func toX18 (origVal,origScaleMult) = fraction(toBigInt(origVal), MULT18, toBigInt(origScaleMult))
8989
9090
9191 func fromX18 (val,resultScaleMult) = toInt(fraction(val, toBigInt(resultScaleMult), MULT18))
9292
9393
9494 func keyFactoryAddress () = "%s%s__config__factoryAddress"
9595
9696
9797 func keyVotingEmissionContract () = "%s__votingEmissionContract"
9898
9999
100100 let IdxFactoryCfgStakingDapp = 1
101101
102102 let IdxFactoryCfgBoostingDapp = 2
103103
104104 let IdxFactoryCfgIdoDapp = 3
105105
106106 let IdxFactoryCfgTeamDapp = 4
107107
108108 let IdxFactoryCfgEmissionDapp = 5
109109
110110 let IdxFactoryCfgRestDapp = 6
111111
112112 let IdxFactoryCfgSlippageDapp = 7
113113
114114 func keyFactoryCfg () = "%s__factoryConfig"
115115
116116
117117 func keyManagerPublicKey () = "%s__managerPublicKey"
118118
119119
120120 func keyManagerVaultAddress () = "%s__managerVaultAddress"
121121
122122
123123 func keyFactoryLp2AssetsMapping (lpAssetStr) = makeString(["%s%s%s", lpAssetStr, "mappings__lpAsset2PoolContract"], SEP)
124124
125125
126126 func keyFactoryLpList () = "%s__lpTokensList"
127127
128128
129129 func keyFactoryLpAssetToPoolContractAddress (lpAssetStr) = makeString(["%s%s%s", lpAssetStr, "mappings__lpAsset2PoolContract"], SEP)
130130
131131
132132 func keyFactoryPoolWeight (contractAddress) = makeString(["%s%s", "poolWeight", contractAddress], SEP)
133133
134134
135135 func readLpList (factory) = split(valueOrElse(getString(factory, keyFactoryLpList()), ""), SEP)
136136
137137
138138 func readFactoryCfgOrFail (factory) = split(getStringByAddressOrFail(factory, keyFactoryCfg()), SEP)
139139
140140
141141 func getBoostingAddressOrFail (factoryCfg) = addressFromStringValue(factoryCfg[IdxFactoryCfgBoostingDapp])
142142
143143
144144 func getEmissionAddressOrFail (factoryCfg) = addressFromStringValue(factoryCfg[IdxFactoryCfgEmissionDapp])
145145
146146
147147 func getStakingAddressOrFail (factoryCfg) = addressFromStringValue(factoryCfg[IdxFactoryCfgStakingDapp])
148148
149149
150150 func getManagerVaultAddressOrThis () = match getString(keyManagerVaultAddress()) {
151151 case s: String =>
152152 addressFromStringValue(s)
153153 case _ =>
154154 this
155155 }
156156
157157
158158 func keyEmissionRatePerBlockCurrent () = "%s%s__ratePerBlock__current"
159159
160160
161161 func keyEmissionRatePerBlockMaxCurrent () = "%s%s__ratePerBlockMax__current"
162162
163163
164164 func keyEmissionStartBlock () = "%s%s__emission__startBlock"
165165
166166
167167 func keyEmissionDurationInBlocks () = "%s%s__emission__duration"
168168
169169
170170 func keyEmissionEndBlock () = "%s%s__emission__endBlock"
171171
172172
173173 func keyStakedByUser (userAddressStr,lpAssetIdStr) = makeString(["%s%s%s__staked", userAddressStr, lpAssetIdStr], SEP)
174174
175175
176176 func keyStakedTotal (lpAssetIdStr) = ("%s%s%s__staked__total__" + lpAssetIdStr)
177177
178178
179179 func keyClaimedByUser (lpAssetIdStr,userAddressStr) = makeString(["%s%s%s__claimed", userAddressStr, lpAssetIdStr], SEP)
180180
181181
182182 func keyClaimedByUserMinReward (lpAssetIdStr,userAddressStr) = makeString(["%s%s%s__claimedMinReward", userAddressStr, lpAssetIdStr], SEP)
183183
184184
185185 func keyClaimedByUserBoostReward (lpAssetIdStr,userAddressStr) = makeString(["%s%s%s__claimedBoostReward", userAddressStr, lpAssetIdStr], SEP)
186186
187187
188188 func keyClaimedTotal (lpAssetIdStr) = makeString(["%s%s%s__claimed__total", lpAssetIdStr], SEP)
189189
190190
191191 func readStaked (key) = valueOrElse(getInteger(this, key), 0)
192192
193193
194194 func keyLastTotalLpBalance (lpAssetId) = makeString(["%s%s%s", lpAssetId, "total", "bal"], SEP)
195195
196196
197197 func keyLastUserLpBalance (lpAssetId,userAddress) = makeString(["%s%s%s", lpAssetId, userAddress, "bal"], SEP)
198198
199199
200200 func keyTotalLpBalanceIntegral (lpAssetId) = makeString(["%s%s%s", lpAssetId, "total", "balINT"], SEP)
201201
202202
203203 func keyUserLpBalanceIntegral (lpAssetId,userAddress) = makeString(["%s%s%s", lpAssetId, userAddress, "balINT"], SEP)
204204
205205
206206 func keyTotalLpBalanceIntegralLastUpdHeight (lpAssetId) = makeString(["%s%s%s", lpAssetId, "total", "lastUpd"], SEP)
207207
208208
209209 func keyUserLpBalanceIntegralLastUpdHeight (lpAssetId,userAddress) = makeString(["%s%s%s", lpAssetId, userAddress, "lastUpd"], SEP)
210210
211211
212212 func keyWxPerLpIntegral (lpAssetId) = makeString(["%s%s%s%s", lpAssetId, "common", "lpInt"], SEP)
213213
214214
215215 func keyWxPerLpIntegralLastUpdHeight (lpAssetId) = makeString(["%s%s%s%s", lpAssetId, "common", "lpIntH"], SEP)
216216
217217
218218 func keyWxToClaimUser (lpAssetId,userAddress) = makeString(["%s%s%s%s", lpAssetId, userAddress, "lpInt"], SEP)
219219
220220
221221 func keyWxPerLpIntegralUserLastUpdHeight (lpAssetId,userAddress) = makeString(["%s%s%s%s", lpAssetId, userAddress, "lpIntH"], SEP)
222222
223223
224224 func keyWxPerLp (lpAssetId) = makeString(["%s", lpAssetId, "wxPerLp"], SEP)
225225
226226
227227 func keyWxPerLpX18 (lpAssetId) = makeString(["%s", lpAssetId, "wxPerLpX18"], SEP)
228228
229229
230230 func keyWxPerLpIntegralUserLast (lpAssetId,userAddress) = makeString(["%s%s%s%s", lpAssetId, userAddress, "uIntL"], SEP)
231231
232232
233233 func keyOperationHistoryRecord (type,userAddress,txId58) = makeString(["%s%s%s%s__history", type, userAddress, txId58], SEP)
234234
235235
236236 func formatHistoryRecord (userAddress,lpAssetId,type,amount) = makeString(["%s%s%s%d%d%d", userAddress, lpAssetId, type, toString(height), toString(lastBlock.timestamp), toString(amount)], SEP)
237237
238238
239239 func OperationHistoryEntry (type,userAddress,lpAssetId,amount,txId) = StringEntry(keyOperationHistoryRecord(type, userAddress, toBase58String(txId)), formatHistoryRecord(userAddress, lpAssetId, type, amount))
240240
241241
242242 let factoryAddress = getStringOrFail(this, keyFactoryAddress())
243243
244244 let factoryContract = addressFromStringValue(factoryAddress)
245245
246246 let factoryCfg = readFactoryCfgOrFail(factoryContract)
247247
248248 let emissionContract = getEmissionAddressOrFail(factoryCfg)
249249
250250 let boostingContract = getBoostingAddressOrFail(factoryCfg)
251251
252252 let boostCoeff = {
253253 let @ = invoke(emissionContract, "getBoostCoeffREADONLY", nil, nil)
254254 if ($isInstanceOf(@, "Int"))
255255 then @
256256 else throw(($getType(@) + " couldn't be cast to Int"))
257257 }
258258
259259 let lpStakingPoolsContract = valueOrErrorMessage(addressFromString(valueOrErrorMessage(getString(makeString(["%s", "lpStakingPoolsContract"], SEP)), wrapErr("lp_staking_pools contract address is undefined"))), wrapErr("invalid lp_staking_pools contract address"))
260260
261261 func keyNextUser (lpAssetId) = makeString(["%s%s", lpAssetId, "nextUser"], SEP)
262262
263263
264264 func getUsersListName (lpAssetId) = makeString(["users", lpAssetId], SEP)
265265
266266
267267 func keyListHead (listName) = makeString(["%s%s%s", listName, "head"], SEP)
268268
269269
270270 func keyListSize (listName) = makeString(["%s%s%s", listName, "size"], SEP)
271271
272272
273273 func keyListPrev (listName,id) = makeString(["%s%s%s%s", listName, id, "prev"], SEP)
274274
275275
276276 func keyListNext (listName,id) = makeString(["%s%s%s%s", listName, id, "next"], SEP)
277277
278278
279279 func containsNode (listName,id) = {
280280 let headOrUnit = getString(this, keyListHead(listName))
281281 let prevOrUnit = getString(this, keyListPrev(listName, id))
282282 let nextOrUnit = getString(this, keyListNext(listName, id))
283283 if (if ((id == valueOrElse(headOrUnit, "")))
284284 then true
285285 else (prevOrUnit != unit))
286286 then true
287287 else (nextOrUnit != unit)
288288 }
289289
290290
291291 func insertNodeActions (listName,id) = {
292292 let headOrUnit = getString(this, keyListHead(listName))
293293 let listSize = valueOrElse(getInteger(this, keyListSize(listName)), 0)
294294 let checkNode = if (!(containsNode(listName, id)))
295295 then true
296296 else throwErr("Node exists")
297297 if ((checkNode == checkNode))
298298 then (([IntegerEntry(keyListSize(listName), (listSize + 1))] ++ (if ((headOrUnit != unit))
299299 then [StringEntry(keyListNext(listName, id), value(headOrUnit)), StringEntry(keyListPrev(listName, value(headOrUnit)), id)]
300300 else nil)) ++ [StringEntry(keyListHead(listName), id)])
301301 else throw("Strict value is not equal to itself.")
302302 }
303303
304304
305305 func deleteNodeActions (listName,id) = {
306306 let headOrUnit = getString(this, keyListHead(listName))
307307 let listSize = valueOrElse(getInteger(this, keyListSize(listName)), 0)
308308 let prevOrUnit = getString(this, keyListPrev(listName, id))
309309 let nextOrUnit = getString(this, keyListNext(listName, id))
310310 ([IntegerEntry(keyListSize(listName), (listSize - 1))] ++ (if (if ((prevOrUnit != unit))
311311 then (nextOrUnit != unit)
312312 else false)
313313 then [StringEntry(keyListNext(listName, value(prevOrUnit)), value(nextOrUnit)), StringEntry(keyListPrev(listName, value(nextOrUnit)), value(prevOrUnit)), DeleteEntry(keyListPrev(listName, id)), DeleteEntry(keyListNext(listName, id))]
314314 else if ((nextOrUnit != unit))
315315 then [StringEntry(keyListHead(listName), value(nextOrUnit)), DeleteEntry(keyListNext(listName, id)), DeleteEntry(keyListPrev(listName, value(nextOrUnit)))]
316316 else if ((prevOrUnit != unit))
317317 then [DeleteEntry(keyListPrev(listName, id)), DeleteEntry(keyListNext(listName, value(prevOrUnit)))]
318318 else if ((id == valueOrElse(headOrUnit, "")))
319319 then [DeleteEntry(keyListHead(listName))]
320320 else throwErr(((("invalid node: " + listName) + ".") + id))))
321321 }
322322
323323
324324 func calcWxPerLpIntegralUserLast (stakedByUser,wxPerLpIntegralUserLastUpdHeightOrZero,wxPerLpIntegralNew,wxPerLpIntegralUserLastKEY) = if (if ((wxPerLpIntegralUserLastUpdHeightOrZero == zeroBigInt))
325325 then (stakedByUser > zeroBigInt)
326326 else false)
327327 then zeroBigInt
328328 else if ((stakedByUser == zeroBigInt))
329329 then wxPerLpIntegralNew
330330 else if (if ((wxPerLpIntegralUserLastUpdHeightOrZero > zeroBigInt))
331331 then (stakedByUser > zeroBigInt)
332332 else false)
333333 then value(parseBigInt(getStringOrFail(this, wxPerLpIntegralUserLastKEY)))
334334 else throwErr("calcWxPerLpIntegralUserLast: unexpected state")
335335
336336
337337 func refreshPoolINTEGRALS (lpAssetIdStr,poolAddressStr,lpDeltaAmount) = {
338338 let stakedTotalKEY = keyStakedTotal(lpAssetIdStr)
339339 let stakedTotal = toBigInt(readStaked(stakedTotalKEY))
340340 let nonZeroStakedTotal = if ((stakedTotal == zeroBigInt))
341341 then oneBigInt
342342 else stakedTotal
343343 let poolWeight = getIntegerValue(factoryContract, keyFactoryPoolWeight(poolAddressStr))
344344 let emissionStartBlock = getIntOrFail(emissionContract, keyEmissionStartBlock())
345345 let wxEmissionPerBlockX3 = (getIntOrFail(emissionContract, keyEmissionRatePerBlockCurrent()) * MULT3)
346346 let poolWxEmissionPerBlockX3 = fraction(wxEmissionPerBlockX3, poolWeight, (POOLWEIGHTMULT * boostCoeff))
347347 let wxPerLpIntegralKEY = keyWxPerLpIntegral(lpAssetIdStr)
348348 let wxPerLpIntegralLastUpdHeightKEY = keyWxPerLpIntegralLastUpdHeight(lpAssetIdStr)
349349 let wxPerLpKEY = keyWxPerLp(lpAssetIdStr)
350350 let wxPerLpIntegralLastUpdHeight = getIntOrDefault(this, wxPerLpIntegralLastUpdHeightKEY, emissionStartBlock)
351351 let wxPerLpIntegral = getBigIntFromStringOrZero(this, wxPerLpIntegralKEY)
352352 let wxPerLpOrZeroX3 = 0
353353 let dh = max([(height - wxPerLpIntegralLastUpdHeight), 0])
354354 let wxPerLpX3 = if ((wxPerLpOrZeroX3 != 0))
355355 then toBigInt(wxPerLpOrZeroX3)
356356 else fraction(toBigInt(poolWxEmissionPerBlockX3), toBigInt(MULT8), nonZeroStakedTotal)
357357 let stakedTotalNew = (stakedTotal + toBigInt(lpDeltaAmount))
358358 let nonZeroStakedTotalNew = if ((stakedTotalNew == zeroBigInt))
359359 then oneBigInt
360360 else stakedTotalNew
361361 let wxPerLpIntegralNew = (wxPerLpIntegral + (wxPerLpX3 * toBigInt(dh)))
362362 let wxPerLpX3New = (toBigInt(poolWxEmissionPerBlockX3) / nonZeroStakedTotalNew)
363363 let wxPerLpIntegralLastUpdHeightNew = height
364364 let debug = makeString([toString(wxPerLpIntegralNew), toString(dh), toString(wxPerLpX3), toString(stakedTotal), toString(poolWxEmissionPerBlockX3), toString(wxEmissionPerBlockX3), toString(poolWeight)], "::")
365365 $Tuple3(wxPerLpIntegralNew, [StringEntry(wxPerLpIntegralKEY, toString(wxPerLpIntegralNew)), IntegerEntry(wxPerLpIntegralLastUpdHeightKEY, wxPerLpIntegralLastUpdHeightNew), StringEntry(wxPerLpKEY, toString(wxPerLpX3New))], debug)
366366 }
367367
368368
369369 func refreshINTEGRALS (lpAssetIdStr,userAddressStr,poolAddressStr,lpDeltaAmount) = {
370370 let $t01487514997 = refreshPoolINTEGRALS(lpAssetIdStr, poolAddressStr, lpDeltaAmount)
371371 let wxPerLpIntegralNew = $t01487514997._1
372372 let poolIntegralSTATE = $t01487514997._2
373373 let poolDEBUG = $t01487514997._3
374374 let stakedByUserKEY = keyStakedByUser(userAddressStr, lpAssetIdStr)
375375 let stakedByUser = readStaked(stakedByUserKEY)
376376 let wxToClaimUserKEY = keyWxToClaimUser(lpAssetIdStr, userAddressStr)
377377 let wxPerLpIntegralUserLastUpdHeightKEY = keyWxPerLpIntegralUserLastUpdHeight(lpAssetIdStr, userAddressStr)
378378 let wxPerLpIntegralUserLastKEY = keyWxPerLpIntegralUserLast(lpAssetIdStr, userAddressStr)
379379 let wxToClaimUser = getBigIntFromStringOrZero(this, wxToClaimUserKEY)
380380 let wxPerLpIntegralUserLastUpdHeightOrZero = getIntOrZero(this, wxPerLpIntegralUserLastUpdHeightKEY)
381381 let wxPerLpIntegralUserLast = calcWxPerLpIntegralUserLast(toBigInt(stakedByUser), toBigInt(wxPerLpIntegralUserLastUpdHeightOrZero), wxPerLpIntegralNew, wxPerLpIntegralUserLastKEY)
382382 let MULT11 = (MULT8 * MULT3)
383383 let wxToClaimUserNew = max([(wxToClaimUser + fraction((wxPerLpIntegralNew - wxPerLpIntegralUserLast), toBigInt(stakedByUser), toBigInt(MULT11))), zeroBigInt])
384384 let wxPerLpIntegralUserLastNew = wxPerLpIntegralNew
385385 let wxPerLpIntegralUserLastUpdHeightNew = height
386386 let debug = makeString([toString(wxToClaimUser), toString(wxPerLpIntegralUserLast), toString(stakedByUser), poolDEBUG, toString(height)], "::")
387387 $Tuple3(wxToClaimUserNew, (poolIntegralSTATE ++ [StringEntry(wxToClaimUserKEY, toString(wxToClaimUserNew)), IntegerEntry(wxPerLpIntegralUserLastUpdHeightKEY, wxPerLpIntegralUserLastUpdHeightNew), StringEntry(wxPerLpIntegralUserLastKEY, toString(wxPerLpIntegralUserLastNew))]), debug)
388388 }
389389
390390
391391 func managerPublicKeyOrUnit () = {
392392 let managerVaultAddress = getManagerVaultAddressOrThis()
393393 match getString(managerVaultAddress, keyManagerPublicKey()) {
394394 case s: String =>
395395 fromBase58String(s)
396396 case _: Unit =>
397397 unit
398398 case _ =>
399399 throw("Match error")
400400 }
401401 }
402402
403403
404404 let permissionDeniedError = throwErr("Permission denied")
405405
406406 func mustThis (i) = if ((i.caller == this))
407407 then true
408408 else permissionDeniedError
409409
410410
411411 func mustManager (i) = match managerPublicKeyOrUnit() {
412412 case pk: ByteVector =>
413413 if ((i.callerPublicKey == pk))
414414 then true
415415 else permissionDeniedError
416416 case _: Unit =>
417417 if ((i.caller == this))
418418 then true
419419 else permissionDeniedError
420420 case _ =>
421421 throw("Match error")
422422 }
423423
424424
425425 func ensureVotingEmissionIsFinalized () = {
426426 let votingEmissionContract = addressFromStringValue(getStringValue(this, keyVotingEmissionContract()))
427427 let votingEmissionFinalizationInProgress = {
428428 let @ = invoke(votingEmissionContract, "isFinalizationInProgress", nil, nil)
429429 if ($isInstanceOf(@, "Boolean"))
430430 then @
431431 else throw(($getType(@) + " couldn't be cast to Boolean"))
432432 }
433433 if (!(votingEmissionFinalizationInProgress))
434434 then true
435435 else throwErr("voting emission should be finalized")
436436 }
437437
438438
439439 func stakeActions (i,lpAssetId,poolAddress,userAddress,amount) = {
440440 let checkVotingEmissionFinalization = ensureVotingEmissionIsFinalized()
441441 if ((checkVotingEmissionFinalization == checkVotingEmissionFinalization))
442442 then {
443443 let userAddressStr = toString(userAddress)
444444 let lpAssetIdStr = toBase58String(lpAssetId)
445445 let poolAddressStr = toString(poolAddress)
446446 let stakedByUserKEY = keyStakedByUser(userAddressStr, lpAssetIdStr)
447447 let stakedTotalKEY = keyStakedTotal(lpAssetIdStr)
448448 let stakedByUser = readStaked(stakedByUserKEY)
449449 let refreshStakedVote = if ((stakedByUser == 0))
450450 then invoke(boostingContract, "onStakedVoteUpdate", [lpAssetIdStr, userAddressStr, true], nil)
451451 else unit
452452 if ((refreshStakedVote == refreshStakedVote))
453453 then {
454454 let stakedTotal = readStaked(stakedTotalKEY)
455455 let $t01859918716 = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, amount)
456456 let wxToClaimUserNew = $t01859918716._1
457457 let integralSTATE = $t01859918716._2
458458 let debug = $t01859918716._3
459459 let listName = getUsersListName(lpAssetIdStr)
460460 let listActions = if (containsNode(listName, userAddressStr))
461461 then nil
462462 else insertNodeActions(listName, userAddressStr)
463463 (([IntegerEntry(stakedByUserKEY, (stakedByUser + amount)), IntegerEntry(stakedTotalKEY, (stakedTotal + amount)), OperationHistoryEntry("stake", userAddressStr, lpAssetIdStr, amount, i.transactionId)] ++ integralSTATE) ++ listActions)
464464 }
465465 else throw("Strict value is not equal to itself.")
466466 }
467467 else throw("Strict value is not equal to itself.")
468468 }
469469
470470
471471 func unstakeActions (i,lpAssetId,poolAddress,userAddress,lpAssetRecipientAddress,amount) = {
472472 let checkVotingEmissionFinalization = ensureVotingEmissionIsFinalized()
473473 if ((checkVotingEmissionFinalization == checkVotingEmissionFinalization))
474474 then {
475475 let userAddressStr = toString(userAddress)
476476 let lpAssetIdStr = toBase58String(lpAssetId)
477477 let poolAddressStr = toString(poolAddress)
478478 let stakedByUserKEY = keyStakedByUser(userAddressStr, lpAssetIdStr)
479479 let stakedTotalKEY = keyStakedTotal(lpAssetIdStr)
480480 let stakedByUser = readStaked(stakedByUserKEY)
481481 let stakedTotal = readStaked(stakedTotalKEY)
482482 let integralSTATE = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, -(amount))._2
483483 let listName = getUsersListName(lpAssetIdStr)
484484 let listActions = if (if (containsNode(listName, userAddressStr))
485485 then (amount == stakedByUser)
486486 else false)
487487 then deleteNodeActions(listName, userAddressStr)
488488 else nil
489489 let refreshStakedVote = if ((amount == stakedByUser))
490490 then invoke(boostingContract, "onStakedVoteUpdate", [lpAssetIdStr, userAddressStr, false], nil)
491491 else unit
492492 if ((refreshStakedVote == refreshStakedVote))
493493 then {
494494 let claimedByUserMinReward = getBigIntFromStringOrZero(this, keyClaimedByUserMinReward(lpAssetIdStr, userAddressStr))
495495 let wxToClaimUserNew = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, 0)._1
496496 let availableToClaim = (wxToClaimUserNew - claimedByUserMinReward)
497497 let throwIfNothingToClaim = true
498498 let r = if ((availableToClaim > zeroBigInt))
499499 then invoke(this, "claimWxINTERNAL", [lpAssetIdStr, userAddressStr, throwIfNothingToClaim], nil)
500500 else unit
501501 if ((r == r))
502502 then if ((amount > stakedByUser))
503503 then throwErr(((((((("passed amount=" + toString(amount)) + " is greater than available=") + toString(stakedByUser)) + ". lpAssetId=") + lpAssetIdStr) + ". stakedByUserKEY=") + stakedByUserKEY))
504504 else (([IntegerEntry(stakedByUserKEY, (stakedByUser - amount)), IntegerEntry(stakedTotalKEY, (stakedTotal - amount)), ScriptTransfer(lpAssetRecipientAddress, amount, lpAssetId), OperationHistoryEntry("unstake", userAddressStr, lpAssetIdStr, amount, i.transactionId)] ++ integralSTATE) ++ listActions)
505505 else throw("Strict value is not equal to itself.")
506506 }
507507 else throw("Strict value is not equal to itself.")
508508 }
509509 else throw("Strict value is not equal to itself.")
510510 }
511511
512512
513513 @Callable(i)
514514 func constructor (factoryAddressStr) = {
515515 let checkCaller = mustManager(i)
516516 if ((checkCaller == checkCaller))
517517 then [StringEntry(keyFactoryAddress(), factoryAddressStr)]
518518 else throw("Strict value is not equal to itself.")
519519 }
520520
521521
522522
523523 @Callable(i)
524524 func constructorV2 (votingEmissionContract) = {
525525 let cheks = [mustManager(i), if ((addressFromString(votingEmissionContract) != unit))
526526 then true
527527 else "invalid voting emission contract address"]
528528 if ((cheks == cheks))
529529 then [StringEntry(keyVotingEmissionContract(), votingEmissionContract)]
530530 else throw("Strict value is not equal to itself.")
531531 }
532532
533533
534534
535535 @Callable(i)
536536 func stake () = if ((size(i.payments) != 1))
537537 then throwErr("invalid payment - exact one payment must be attached")
538538 else {
539539 let pmt = i.payments[0]
540540 let lpAssetId = value(pmt.assetId)
541541 let lpAssetIdStr = toBase58String(lpAssetId)
542542 let amount = pmt.amount
543543 let poolAddressStr = valueOrErrorMessage(getString(factoryContract, keyFactoryLp2AssetsMapping(lpAssetIdStr)), wrapErr(("unsupported lp asset " + lpAssetIdStr)))
544544 let poolAddress = addressFromStringValue(poolAddressStr)
545545 let userAddress = if ((i.caller == poolAddress))
546546 then i.originCaller
547547 else i.caller
548548 stakeActions(i, lpAssetId, poolAddress, userAddress, amount)
549549 }
550550
551551
552552
553553 @Callable(i)
554554 func stakeFor (userAddressStr) = if ((size(i.payments) != 1))
555555 then throwErr("invalid payment - exact one payment must be attached")
556556 else {
557557 let pmt = i.payments[0]
558558 let lpAssetId = value(pmt.assetId)
559559 let lpAssetIdStr = toBase58String(lpAssetId)
560560 let amount = pmt.amount
561561 let poolAddressStr = valueOrErrorMessage(getString(factoryContract, keyFactoryLp2AssetsMapping(lpAssetIdStr)), wrapErr(("unsupported lp asset " + lpAssetIdStr)))
562562 let poolAddress = addressFromStringValue(poolAddressStr)
563563 let userAddress = valueOrErrorMessage(addressFromString(userAddressStr), wrapErr("invalid user address"))
564564 stakeActions(i, lpAssetId, poolAddress, userAddress, amount)
565565 }
566566
567567
568568
569569 @Callable(i)
570570 func unstake (lpAssetIdStr,amount) = {
571571 let lpAssetId = fromBase58String(lpAssetIdStr)
572572 let poolAddressStr = valueOrErrorMessage(getString(factoryContract, keyFactoryLp2AssetsMapping(lpAssetIdStr)), wrapErr(("unsupported lp asset " + lpAssetIdStr)))
573573 let poolAddress = addressFromStringValue(poolAddressStr)
574574 let callerStr = toString(i.caller)
575575 let userAddress = if ((callerStr == poolAddressStr))
576576 then i.originCaller
577577 else i.caller
578578 let lpAssetRecipientAddress = i.caller
579579 unstakeActions(i, lpAssetId, poolAddress, userAddress, lpAssetRecipientAddress, amount)
580580 }
581581
582582
583583
584584 @Callable(i)
585585 func unstakeINTERNAL (lpAssetId,amount,userAddress,lpAssetRecipientAddress) = {
586586 let lpAssetIdStr = toBase58String(lpAssetId)
587587 let poolAddress = addressFromStringValue(valueOrErrorMessage(getString(factoryContract, keyFactoryLp2AssetsMapping(lpAssetIdStr)), wrapErr(("unsupported lp asset " + lpAssetIdStr))))
588588 let checkCaller = if ((i.caller == poolAddress))
589589 then true
590590 else permissionDeniedError
591591 if ((checkCaller == checkCaller))
592592 then unstakeActions(i, lpAssetId, poolAddress, Address(userAddress), Address(lpAssetRecipientAddress), amount)
593593 else throw("Strict value is not equal to itself.")
594594 }
595595
596596
597597
598598 @Callable(i)
599599 func claimWx (lpAssetIdStr) = {
600600 let userAddressStr = toString(i.caller)
601601 let throwIfNothingToClaim = true
602602 let result = invoke(this, "claimWxINTERNAL", [lpAssetIdStr, userAddressStr, throwIfNothingToClaim], nil)
603603 $Tuple2(nil, result)
604604 }
605605
606606
607607
608608 @Callable(i)
609609 func claimWxDoNotThrow (lpAssetIdStr) = {
610610 let userAddressStr = toString(i.caller)
611611 let throwIfNothingToClaim = false
612612 let result = invoke(this, "claimWxINTERNAL", [lpAssetIdStr, userAddressStr, throwIfNothingToClaim], nil)
613613 $Tuple2(nil, result)
614614 }
615615
616616
617617
618618 @Callable(i)
619619 func claimWxINTERNAL (lpAssetIdStr,userAddressStr,throwIfNothingToClaim) = {
620620 let checkCaller = mustThis(i)
621621 if ((checkCaller == checkCaller))
622622 then {
623623 let userAddress = valueOrErrorMessage(addressFromString(userAddressStr), wrapErr("claimWxINTERNAL: invalid user address"))
624624 let poolAddressStr = getStringByAddressOrFail(factoryContract, keyFactoryLpAssetToPoolContractAddress(lpAssetIdStr))
625625 let claimedByUserKEY = keyClaimedByUser(lpAssetIdStr, userAddressStr)
626626 let claimedTotalKEY = keyClaimedTotal(lpAssetIdStr)
627627 let claimedByUserMinRewardKEY = keyClaimedByUserMinReward(lpAssetIdStr, userAddressStr)
628628 let claimedByUserBoostRewardKEY = keyClaimedByUserBoostReward(lpAssetIdStr, userAddressStr)
629629 let claimedByUser = getBigIntFromStringOrZero(this, claimedByUserKEY)
630630 let claimedByUserMinReward = getBigIntFromStringOrZero(this, claimedByUserMinRewardKEY)
631631 let claimedByUserBoostReward = getBigIntFromStringOrZero(this, claimedByUserBoostRewardKEY)
632632 let claimedTotal = getBigIntFromStringOrZero(this, claimedTotalKEY)
633633 let $t02598426096 = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, 0)
634634 let wxToClaimUserNew = $t02598426096._1
635635 let integralSTATE = $t02598426096._2
636636 let debug = $t02598426096._3
637637 let availableToClaim = max([(wxToClaimUserNew - claimedByUserMinReward), zeroBigInt])
638638 if ((zeroBigInt >= availableToClaim))
639639 then if (throwIfNothingToClaim)
640640 then throwErr("nothing to claim")
641641 else $Tuple2(nil, 0)
642642 else {
643643 let wxAmountBoostTotal = max([asInt(asAnyList(invoke(boostingContract, "claimWxBoost", [lpAssetIdStr, userAddressStr], nil))[0]), 0])
644644 let minRewardPart = availableToClaim
645645 let boostRewardPart = min([(minRewardPart * toBigInt((boostCoeff - 1))), toBigInt(wxAmountBoostTotal)])
646646 let totalReward = (minRewardPart + boostRewardPart)
647647 let wxAssetId = asByteVector(asAnyList(invoke(emissionContract, "emit", [toInt(minRewardPart)], nil))[0])
648648 let emitBoost = asAnyList(invoke(emissionContract, "emit", [toInt(boostRewardPart)], nil))
649649 if ((emitBoost == emitBoost))
650650 then {
651651 let claimedByUserValue = ((claimedByUser + minRewardPart) + boostRewardPart)
652652 let claimedByUserMinRewardPlusPart = (claimedByUserMinReward + minRewardPart)
653653 let claimedByUserBoostRewardPlusBoostRewardPart = (claimedByUserBoostReward + boostRewardPart)
654654 let claimedTotalPlusAvailableToClaim = (claimedTotal + availableToClaim)
655655 $Tuple2([StringEntry(claimedByUserKEY, toString(claimedByUserValue)), StringEntry(claimedByUserMinRewardKEY, toString(claimedByUserMinRewardPlusPart)), StringEntry(claimedByUserBoostRewardKEY, toString(claimedByUserBoostRewardPlusBoostRewardPart)), StringEntry(claimedTotalKEY, toString(claimedTotalPlusAvailableToClaim)), ScriptTransfer(userAddress, toInt(minRewardPart), wxAssetId), ScriptTransfer(userAddress, toInt(boostRewardPart), wxAssetId), OperationHistoryEntry("claim", userAddressStr, lpAssetIdStr, toInt(availableToClaim), i.transactionId)], toInt(totalReward))
656656 }
657657 else throw("Strict value is not equal to itself.")
658658 }
659659 }
660660 else throw("Strict value is not equal to itself.")
661661 }
662662
663663
664664
665665 @Callable(i)
666666 func claimWxBulkInternalREADONLY (currentIter,lpAssetIds,userAddressStr,resAcc) = if ((currentIter == size(lpAssetIds)))
667667 then $Tuple2(nil, resAcc)
668668 else {
669669 let lpAssetId = lpAssetIds[currentIter]
670670 let info = split({
671671 let @ = invoke(this, "claimWxREADONLY", [lpAssetId, userAddressStr], nil)
672672 if ($isInstanceOf(@, "String"))
673673 then @
674674 else throw(($getType(@) + " couldn't be cast to String"))
675675 }, SEP)
676676 let unclaimed = info[3]
677677 let claimed = info[4]
678678 let userVoteFinalized = {
679679 let @ = invoke(boostingContract, "getUserVoteFinalizedREADONLY", [lpAssetId, userAddressStr], nil)
680680 if ($isInstanceOf(@, "Int"))
681681 then @
682682 else throw(($getType(@) + " couldn't be cast to Int"))
683683 }
684684 let res = (resAcc :+ makeString(["%d%d%d", unclaimed, claimed, toString(userVoteFinalized)], SEP))
685685 let inv = {
686686 let @ = invoke(this, "claimWxBulkInternalREADONLY", [(currentIter + 1), lpAssetIds, userAddressStr, res], nil)
687687 if ($isInstanceOf(@, "List[Any]"))
688688 then @
689689 else throw(($getType(@) + " couldn't be cast to List[Any]"))
690690 }
691691 if ((inv == inv))
692692 then $Tuple2(nil, inv)
693693 else throw("Strict value is not equal to itself.")
694694 }
695695
696696
697697
698698 @Callable(i)
699699 func claimWxBulkREADONLY (lpAssetIds,userAddressStr) = {
700700 let res = invoke(this, "claimWxBulkInternalREADONLY", [0, lpAssetIds, userAddressStr, nil], nil)
701701 $Tuple2(nil, res)
702702 }
703703
704704
705705
706706 @Callable(i)
707707 func claimWxREADONLY (lpAssetIdStr,userAddressStr) = {
708708 let stakedByUserKEY = keyStakedByUser(userAddressStr, lpAssetIdStr)
709709 let stakedTotalKEY = keyStakedTotal(lpAssetIdStr)
710710 let claimedByUserKEY = keyClaimedByUser(lpAssetIdStr, userAddressStr)
711711 let claimedByUserMinRewardKEY = keyClaimedByUserMinReward(lpAssetIdStr, userAddressStr)
712712 let stakedByUser = readStaked(stakedByUserKEY)
713713 let stakedTotal = readStaked(stakedTotalKEY)
714714 let claimedByUser = getBigIntFromStringOrZero(this, claimedByUserKEY)
715715 let claimedByUserMinReward = getBigIntFromStringOrZero(this, claimedByUserMinRewardKEY)
716716 let poolAddressStr = getStringByAddressOrFail(factoryContract, keyFactoryLpAssetToPoolContractAddress(lpAssetIdStr))
717717 let poolWeight = getIntegerValue(factoryContract, keyFactoryPoolWeight(poolAddressStr))
718718 let wxEmissionPerBlock = getIntOrFail(emissionContract, keyEmissionRatePerBlockCurrent())
719719 let emissionStartBlock = getIntOrFail(emissionContract, keyEmissionStartBlock())
720720 let passedBlocks = if ((emissionStartBlock > height))
721721 then 0
722722 else (height - emissionStartBlock)
723723 let poolWxEmission = fraction((wxEmissionPerBlock * passedBlocks), poolWeight, POOLWEIGHTMULT)
724724 let userWxReward = fraction(poolWxEmission, stakedByUser, stakedTotal)
725725 let $t03014730259 = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, 0)
726726 let wxToClaimUserNew = $t03014730259._1
727727 let integralSTATE = $t03014730259._2
728728 let debug = $t03014730259._3
729729 let availableToClaim = max([(wxToClaimUserNew - claimedByUserMinReward), zeroBigInt])
730730 let boostInvResult = asAnyList(invoke(boostingContract, "claimWxBoostREADONLY", [lpAssetIdStr, userAddressStr], nil))
731731 let wxAmountBoostTotal = max([asInt(boostInvResult[0]), 0])
732732 let boostDebug = asString(boostInvResult[1])
733733 let minRewardPart = availableToClaim
734734 let boostRewardPart = min([(minRewardPart * toBigInt((boostCoeff - 1))), toBigInt(wxAmountBoostTotal)])
735735 let totalReward = (minRewardPart + boostRewardPart)
736736 $Tuple2(nil, makeString(["%s%s%d%d%d%d%s", lpAssetIdStr, userAddressStr, toString(totalReward), toString(claimedByUser), toString(minRewardPart), toString(boostRewardPart), "soon"], SEP))
737737 }
738738
739739
740740
741741 @Callable(i)
742742 func stakedByUserREADONLY (lpAssetIdStr,userAddressStr) = {
743743 let stakedByUser = valueOrElse(getInteger(keyStakedByUser(userAddressStr, lpAssetIdStr)), 0)
744744 $Tuple2(nil, stakedByUser)
745745 }
746746
747747
748748
749749 @Callable(i)
750750 func stakedTotalREADONLY (lpAssetIdStr) = {
751751 let stakedTotal = valueOrElse(getInteger(keyStakedTotal(lpAssetIdStr)), 0)
752752 $Tuple2(nil, stakedTotal)
753753 }
754754
755755
756756
757757 @Callable(i)
758+func usersListTraversal (lpAssetId) = {
759+ let checkCaller = if ((toBase58String(i.caller.bytes) == valueOrElse(getString(this, keyVotingEmissionContract()), "")))
760+ then true
761+ else mustManager(i)
762+ if ((checkCaller == checkCaller))
763+ then {
764+ let listName = getUsersListName(lpAssetId)
765+ let userOrUnit = getString(keyNextUser(lpAssetId))
766+ let headOrUnit = getString(keyListHead(listName))
767+ match userOrUnit {
768+ case _: Unit =>
769+ match headOrUnit {
770+ case _: Unit =>
771+ $Tuple2(nil, false)
772+ case head: String =>
773+ $Tuple2([StringEntry(keyNextUser(lpAssetId), head)], true)
774+ case _ =>
775+ throw("Match error")
776+ }
777+ case userAddress: String =>
778+ let claimedByUserMinReward = getBigIntFromStringOrZero(this, keyClaimedByUserMinReward(lpAssetId, userAddress))
779+ let poolAddress = getStringByAddressOrFail(factoryContract, keyFactoryLpAssetToPoolContractAddress(lpAssetId))
780+ let wxToClaimUserNew = refreshINTEGRALS(lpAssetId, userAddress, poolAddress, 0)._1
781+ let availableToClaim = (wxToClaimUserNew - claimedByUserMinReward)
782+ let throwIfNothingToClaim = true
783+ let r = if ((availableToClaim > zeroBigInt))
784+ then invoke(this, "claimWxINTERNAL", [lpAssetId, userAddress, throwIfNothingToClaim], nil)
785+ else unit
786+ if ((r == r))
787+ then {
788+ let nextUserOrUnit = getString(keyListNext(listName, userAddress))
789+ match nextUserOrUnit {
790+ case _: Unit =>
791+ $Tuple2([DeleteEntry(keyNextUser(lpAssetId))], false)
792+ case nextUser: String =>
793+ $Tuple2([StringEntry(keyNextUser(lpAssetId), nextUser)], true)
794+ case _ =>
795+ throw("Match error")
796+ }
797+ }
798+ else throw("Strict value is not equal to itself.")
799+ case _ =>
800+ throw("Match error")
801+ }
802+ }
803+ else throw("Strict value is not equal to itself.")
804+ }
805+
806+
807+
808+@Callable(i)
758809 func onModifyWeight (lpAssetIdStr,poolAddressStr) = if ((i.caller != factoryContract))
759810 then throwErr("permissions denied")
760811 else {
761- let $t03153531645 = refreshPoolINTEGRALS(lpAssetIdStr, poolAddressStr, 0)
762- let wxPerLpIntegralNew = $t03153531645._1
763- let poolIntegralSTATE = $t03153531645._2
764- let poolDEBUG = $t03153531645._3
812+ let $t03304933159 = refreshPoolINTEGRALS(lpAssetIdStr, poolAddressStr, 0)
813+ let wxPerLpIntegralNew = $t03304933159._1
814+ let poolIntegralSTATE = $t03304933159._2
815+ let poolDEBUG = $t03304933159._3
765816 poolIntegralSTATE
766817 }
767818
768819
769820 @Verifier(tx)
770821 func verify () = {
771822 let targetPublicKey = match managerPublicKeyOrUnit() {
772823 case pk: ByteVector =>
773824 pk
774825 case _: Unit =>
775826 tx.senderPublicKey
776827 case _ =>
777828 throw("Match error")
778829 }
779830 sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey)
780831 }
781832

github/deemru/w8io/fabc49c 
88.77 ms