tx · 3XUhGSMVyjARkke1Xx8yGnfY6VnjUwSSyNGQeYTXVC8Z

3Mx3zmXrMcLFCafMuPtXAzR4ZPVeZYb6qLz:  -0.02300000 Waves

2023.03.14 11:15 [2489456] smart account 3Mx3zmXrMcLFCafMuPtXAzR4ZPVeZYb6qLz > SELF 0.00000000 Waves

{ "type": 13, "id": "3XUhGSMVyjARkke1Xx8yGnfY6VnjUwSSyNGQeYTXVC8Z", "fee": 2300000, "feeAssetId": null, "timestamp": 1678781718833, "version": 2, "chainId": 84, "sender": "3Mx3zmXrMcLFCafMuPtXAzR4ZPVeZYb6qLz", "senderPublicKey": "D28XoueZWsMfm8Y5pa6C5ZFuYoWgre2Wm8tzJANJgMnq", "proofs": [ "3Mrt7M9vD8mhx1w4cfbkzLHtUqJA56Gw2GbJE7dfDphUbiWxXAs5VbpVN3f2yxGabKQCtBiGHQTsWjcbELj8yVG6" ], "script": "base64:BgKMIAgCEgMKAQgSAwoBCBIDCgEIEgASABIECgIIARIGCgQCAQICEgMKAQgSAwoBCBIFCgMICAQSBgoEARgIGBIECgIYCBIECgIICBIECgIICBIDCgEIEgQKAggIIgZTQ0FMRTgiBU1VTFQ4IgdTQ0FMRTE4IgZNVUxUMTgiA1NFUCIOUE9PTFdFSUdIVE1VTFQiCnplcm9CaWdJbnQiCW9uZUJpZ0ludCIHd3JhcEVyciIDbXNnIgh0aHJvd0VyciIJYXNBbnlMaXN0IgN2YWwiByRtYXRjaDAiCnZhbEFueUx5c3QiBWFzSW50IgZ2YWxJbnQiCGFzU3RyaW5nIgZ2YWxTdHIiDGFzQnl0ZVZlY3RvciIGdmFsQmluIg9nZXRTdHJpbmdPckZhaWwiB2FkZHJlc3MiA2tleSIYZ2V0U3RyaW5nQnlBZGRyZXNzT3JGYWlsIgxnZXRJbnRPclplcm8iD2dldEludE9yRGVmYXVsdCIKZGVmYXVsdFZhbCIMZ2V0SW50T3JGYWlsIhlnZXRCaWdJbnRGcm9tU3RyaW5nT3JaZXJvIhxnZ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2UFAmN1BAJjdwYEAmN4AwkAvwICBQJjdgUBZwkA/AcEBQR0aGlzAg9jbGFpbVd4SU5URVJOQUwJAMwIAgUCYUIJAMwIAgUCYUQJAMwIAgUCY3cFA25pbAUDbmlsBQR1bml0AwkAAAIFAmN4BQJjeAQCZHgJAKIIAQkBAmJpAgUCYmUFAmFEBAJkdgUCZHgDCQABAgUCZHYCBFVuaXQJAJQKAgkAzAgCCQELRGVsZXRlRW50cnkBCQECYmIBBQJhQgUDbmlsBwMJAAECBQJkdgIGU3RyaW5nBAJkeQUCZHYJAJQKAgkAzAgCCQELU3RyaW5nRW50cnkCCQECYmIBBQJhQgUCZHkFA25pbAYJAAIBAgtNYXRjaCBlcnJvcgkAAgECJFN0cmljdCB2YWx1ZSBpcyBub3QgZXF1YWwgdG8gaXRzZWxmLgkAAgECC01hdGNoIGVycm9yCQACAQIkU3RyaWN0IHZhbHVlIGlzIG5vdCBlcXVhbCB0byBpdHNlbGYuAmNsAQ5vbk1vZGlmeVdlaWdodAICYXQCYngDCQECIT0CCAUCY2wGY2FsbGVyBQJhWAkAAgECEnBlcm1pc3Npb25zIGRlbmllZAQCZHoJAQJidwMFAmF0BQJieAAABAJidQgFAmR6Al8xBAJiVwgFAmR6Al8yBAJiWAgFAmR6Al8zBQJiVwECZEEBAmRCAAQCZEMEAW4JAQJjaAADCQABAgUBbgIKQnl0ZVZlY3RvcgQCY24FAW4FAmNuAwkAAQIFAW4CBFVuaXQIBQJkQQ9zZW5kZXJQdWJsaWNLZXkJAAIBAgtNYXRjaCBlcnJvcgkA9AMDCAUCZEEJYm9keUJ5dGVzCQCRAwIIBQJkQQZwcm9vZnMAAAUCZEMBNGCg", "height": 2489456, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: BCgjAX1cXff2ep4f9E1YwtMHZaLerpCf831HCJy58phs Next: 7Y1wP5ciJW8VBgJh1GZXXdZ6tprzYgk2NzNLmWfkS6K1 Diff:
OldNewDifferences
435435 else false)
436436 then deleteNodeActions(listName, userAddressStr)
437437 else nil
438- let claimedByUserMinReward = getBigIntFromStringOrZero(this, keyClaimedByUserMinReward(lpAssetIdStr, userAddressStr))
439- let wxToClaimUserNew = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, 0)._1
440- let availableToClaim = (wxToClaimUserNew - claimedByUserMinReward)
441- let throwIfNothingToClaim = true
442- let r = if ((availableToClaim > zeroBigInt))
443- then invoke(this, "claimWxINTERNAL", [lpAssetIdStr, userAddressStr, throwIfNothingToClaim], nil)
438+ let refreshStakedVote = if ((amount == stakedByUser))
439+ then invoke(boostingContract, "onStakedVoteUpdate", [lpAssetIdStr, userAddressStr, false], nil)
444440 else unit
445- if ((r == r))
446- then if ((amount > stakedByUser))
447- then throw(((((((("passed amount=" + toString(amount)) + " is greater than available=") + toString(stakedByUser)) + ". lpAssetId=") + lpAssetIdStr) + ". stakedByUserKEY=") + stakedByUserKEY))
448- else (([IntegerEntry(stakedByUserKEY, (stakedByUser - amount)), IntegerEntry(stakedTotalKEY, (stakedTotal - amount)), ScriptTransfer(lpAssetRecipientAddress, amount, lpAssetId), OperationHistoryEntry("unstake", userAddressStr, lpAssetIdStr, amount, i.transactionId)] ++ integralSTATE) ++ listActions)
441+ if ((refreshStakedVote == refreshStakedVote))
442+ then {
443+ let claimedByUserMinReward = getBigIntFromStringOrZero(this, keyClaimedByUserMinReward(lpAssetIdStr, userAddressStr))
444+ let wxToClaimUserNew = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, 0)._1
445+ let availableToClaim = (wxToClaimUserNew - claimedByUserMinReward)
446+ let throwIfNothingToClaim = true
447+ let r = if ((availableToClaim > zeroBigInt))
448+ then invoke(this, "claimWxINTERNAL", [lpAssetIdStr, userAddressStr, throwIfNothingToClaim], nil)
449+ else unit
450+ if ((r == r))
451+ then if ((amount > stakedByUser))
452+ then throw(((((((("passed amount=" + toString(amount)) + " is greater than available=") + toString(stakedByUser)) + ". lpAssetId=") + lpAssetIdStr) + ". stakedByUserKEY=") + stakedByUserKEY))
453+ else (([IntegerEntry(stakedByUserKEY, (stakedByUser - amount)), IntegerEntry(stakedTotalKEY, (stakedTotal - amount)), ScriptTransfer(lpAssetRecipientAddress, amount, lpAssetId), OperationHistoryEntry("unstake", userAddressStr, lpAssetIdStr, amount, i.transactionId)] ++ integralSTATE) ++ listActions)
454+ else throw("Strict value is not equal to itself.")
455+ }
449456 else throw("Strict value is not equal to itself.")
450457 }
451458
523530 let stakedByUserKEY = keyStakedByUser(userAddressStr, lpAssetIdStr)
524531 let stakedTotalKEY = keyStakedTotal(lpAssetIdStr)
525532 let stakedByUser = readStaked(stakedByUserKEY)
526- let stakedTotal = readStaked(stakedTotalKEY)
527- let $t02127621393 = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, amount)
528- let wxToClaimUserNew = $t02127621393._1
529- let integralSTATE = $t02127621393._2
530- let debug = $t02127621393._3
531- let listName = getUsersListName(lpAssetIdStr)
532- let listActions = if (containsNode(listName, userAddressStr))
533- then nil
534- else insertNodeActions(listName, userAddressStr)
535- (([IntegerEntry(stakedByUserKEY, (stakedByUser + amount)), IntegerEntry(stakedTotalKEY, (stakedTotal + amount)), OperationHistoryEntry("stake", userAddressStr, lpAssetIdStr, amount, i.transactionId)] ++ integralSTATE) ++ listActions)
533+ let refreshStakedVote = if ((stakedByUser == 0))
534+ then invoke(boostingContract, "onStakedVoteUpdate", [lpAssetIdStr, userAddressStr, true], nil)
535+ else unit
536+ if ((refreshStakedVote == refreshStakedVote))
537+ then {
538+ let stakedTotal = readStaked(stakedTotalKEY)
539+ let $t02161321730 = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, amount)
540+ let wxToClaimUserNew = $t02161321730._1
541+ let integralSTATE = $t02161321730._2
542+ let debug = $t02161321730._3
543+ let listName = getUsersListName(lpAssetIdStr)
544+ let listActions = if (containsNode(listName, userAddressStr))
545+ then nil
546+ else insertNodeActions(listName, userAddressStr)
547+ (([IntegerEntry(stakedByUserKEY, (stakedByUser + amount)), IntegerEntry(stakedTotalKEY, (stakedTotal + amount)), OperationHistoryEntry("stake", userAddressStr, lpAssetIdStr, amount, i.transactionId)] ++ integralSTATE) ++ listActions)
548+ }
549+ else throw("Strict value is not equal to itself.")
536550 }
537551
538552
604618 let claimedByUserMinReward = getBigIntFromStringOrZero(this, claimedByUserMinRewardKEY)
605619 let claimedByUserBoostReward = getBigIntFromStringOrZero(this, claimedByUserBoostRewardKEY)
606620 let claimedTotal = getBigIntFromStringOrZero(this, claimedTotalKEY)
607- let $t02477924891 = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, 0)
608- let wxToClaimUserNew = $t02477924891._1
609- let integralSTATE = $t02477924891._2
610- let debug = $t02477924891._3
621+ let $t02511625228 = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, 0)
622+ let wxToClaimUserNew = $t02511625228._1
623+ let integralSTATE = $t02511625228._2
624+ let debug = $t02511625228._3
611625 let availableToClaim = max([(wxToClaimUserNew - claimedByUserMinReward), zeroBigInt])
612626 if ((zeroBigInt >= availableToClaim))
613627 then if (throwIfNothingToClaim)
690704 else (height - emissionStartBlock)
691705 let poolWxEmission = fraction((wxEmissionPerBlock * passedBlocks), poolWeight, POOLWEIGHTMULT)
692706 let userWxReward = fraction(poolWxEmission, stakedByUser, stakedTotal)
693- let $t02870028812 = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, 0)
694- let wxToClaimUserNew = $t02870028812._1
695- let integralSTATE = $t02870028812._2
696- let debug = $t02870028812._3
707+ let $t02903729149 = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, 0)
708+ let wxToClaimUserNew = $t02903729149._1
709+ let integralSTATE = $t02903729149._2
710+ let debug = $t02903729149._3
697711 let availableToClaim = max([(wxToClaimUserNew - claimedByUserMinReward), zeroBigInt])
698712 let boostInvResult = asAnyList(invoke(boostingContract, "claimWxBoostREADONLY", [lpAssetIdStr, userAddressStr], nil))
699713 let wxAmountBoostTotal = max([asInt(boostInvResult[0]), 0])
769783 func onModifyWeight (lpAssetIdStr,poolAddressStr) = if ((i.caller != factoryContract))
770784 then throw("permissions denied")
771785 else {
772- let $t03141831528 = refreshPoolINTEGRALS(lpAssetIdStr, poolAddressStr, 0)
773- let wxPerLpIntegralNew = $t03141831528._1
774- let poolIntegralSTATE = $t03141831528._2
775- let poolDEBUG = $t03141831528._3
786+ let $t03175531865 = refreshPoolINTEGRALS(lpAssetIdStr, poolAddressStr, 0)
787+ let wxPerLpIntegralNew = $t03175531865._1
788+ let poolIntegralSTATE = $t03175531865._2
789+ let poolDEBUG = $t03175531865._3
776790 poolIntegralSTATE
777791 }
778792
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let SCALE8 = 8
55
66 let MULT8 = 100000000
77
88 let SCALE18 = 18
99
1010 let MULT18 = toBigInt(1000000000000000000)
1111
1212 let SEP = "__"
1313
1414 let POOLWEIGHTMULT = MULT8
1515
1616 let zeroBigInt = toBigInt(0)
1717
1818 let oneBigInt = toBigInt(1)
1919
2020 func wrapErr (msg) = makeString(["staking.ride:", toString(this), msg], " ")
2121
2222
2323 func throwErr (msg) = throw(wrapErr(msg))
2424
2525
2626 func asAnyList (val) = match val {
2727 case valAnyLyst: List[Any] =>
2828 valAnyLyst
2929 case _ =>
3030 throw("fail to cast into List[Any]")
3131 }
3232
3333
3434 func asInt (val) = match val {
3535 case valInt: Int =>
3636 valInt
3737 case _ =>
3838 throw("fail to cast into Int")
3939 }
4040
4141
4242 func asString (val) = match val {
4343 case valStr: String =>
4444 valStr
4545 case _ =>
4646 throw("fail to cast into Int")
4747 }
4848
4949
5050 func asByteVector (val) = match val {
5151 case valBin: ByteVector =>
5252 valBin
5353 case _ =>
5454 throw("fail to cast into Int")
5555 }
5656
5757
5858 func getStringOrFail (address,key) = valueOrErrorMessage(getString(address, key), (("mandatory this." + key) + " is not defined"))
5959
6060
6161 func getStringByAddressOrFail (address,key) = valueOrErrorMessage(getString(address, key), (((("mandatory " + toString(address)) + ".") + key) + " is not defined"))
6262
6363
6464 func getIntOrZero (address,key) = valueOrElse(getInteger(address, key), 0)
6565
6666
6767 func getIntOrDefault (address,key,defaultVal) = valueOrElse(getInteger(address, key), defaultVal)
6868
6969
7070 func getIntOrFail (address,key) = valueOrErrorMessage(getInteger(address, key), (("mandatory this." + key) + " is not defined"))
7171
7272
7373 func getBigIntFromStringOrZero (address,key) = value(parseBigInt(valueOrElse(getString(address, key), "0")))
7474
7575
7676 func getBigIntFromStringOrDefault (address,key,defaultVal) = match getString(address, key) {
7777 case s: String =>
7878 value(parseBigInt(s))
7979 case _: Unit =>
8080 defaultVal
8181 case _ =>
8282 throw("Match error")
8383 }
8484
8585
8686 func toX18 (origVal,origScaleMult) = fraction(toBigInt(origVal), MULT18, toBigInt(origScaleMult))
8787
8888
8989 func fromX18 (val,resultScaleMult) = toInt(fraction(val, toBigInt(resultScaleMult), MULT18))
9090
9191
9292 func keyFactoryAddress () = "%s%s__config__factoryAddress"
9393
9494
9595 func keyVotingEmissionContract () = "%s__votingEmissionContract"
9696
9797
9898 let IdxFactoryCfgStakingDapp = 1
9999
100100 let IdxFactoryCfgBoostingDapp = 2
101101
102102 let IdxFactoryCfgIdoDapp = 3
103103
104104 let IdxFactoryCfgTeamDapp = 4
105105
106106 let IdxFactoryCfgEmissionDapp = 5
107107
108108 let IdxFactoryCfgRestDapp = 6
109109
110110 let IdxFactoryCfgSlippageDapp = 7
111111
112112 func keyFactoryCfg () = "%s__factoryConfig"
113113
114114
115115 func keyManagerPublicKey () = "%s__managerPublicKey"
116116
117117
118118 func keyPendingManagerPublicKey () = "%s__pendingManagerPublicKey"
119119
120120
121121 func keyStablePoolAddonAddr () = "%s__stablePoolAddonAddr"
122122
123123
124124 func keyAddonAddr () = "%s__addonAddr"
125125
126126
127127 func keyFactoryLp2AssetsMapping (lpAssetStr) = makeString(["%s%s%s", lpAssetStr, "mappings__lpAsset2PoolContract"], SEP)
128128
129129
130130 func keyFactoryLpList () = "%s__lpTokensList"
131131
132132
133133 func keyFactoryLpAssetToPoolContractAddress (lpAssetStr) = makeString(["%s%s%s", lpAssetStr, "mappings__lpAsset2PoolContract"], SEP)
134134
135135
136136 func keyFactoryPoolWeight (contractAddress) = makeString(["%s%s", "poolWeight", contractAddress], SEP)
137137
138138
139139 func readLpList (factory) = split(valueOrElse(getString(factory, keyFactoryLpList()), ""), SEP)
140140
141141
142142 func readFactoryCfgOrFail (factory) = split(getStringByAddressOrFail(factory, keyFactoryCfg()), SEP)
143143
144144
145145 func getBoostingAddressOrFail (factoryCfg) = addressFromStringValue(factoryCfg[IdxFactoryCfgBoostingDapp])
146146
147147
148148 func getEmissionAddressOrFail (factoryCfg) = addressFromStringValue(factoryCfg[IdxFactoryCfgEmissionDapp])
149149
150150
151151 func getStakingAddressOrFail (factoryCfg) = addressFromStringValue(factoryCfg[IdxFactoryCfgStakingDapp])
152152
153153
154154 func keyEmissionRatePerBlockCurrent () = "%s%s__ratePerBlock__current"
155155
156156
157157 func keyEmissionRatePerBlockMaxCurrent () = "%s%s__ratePerBlockMax__current"
158158
159159
160160 func keyEmissionStartBlock () = "%s%s__emission__startBlock"
161161
162162
163163 func keyEmissionDurationInBlocks () = "%s%s__emission__duration"
164164
165165
166166 func keyEmissionEndBlock () = "%s%s__emission__endBlock"
167167
168168
169169 func keyStakedByUser (userAddressStr,lpAssetIdStr) = makeString(["%s%s%s__staked", userAddressStr, lpAssetIdStr], SEP)
170170
171171
172172 func keyStakedTotal (lpAssetIdStr) = ("%s%s%s__staked__total__" + lpAssetIdStr)
173173
174174
175175 func keyClaimedByUser (lpAssetIdStr,userAddressStr) = makeString(["%s%s%s__claimed", userAddressStr, lpAssetIdStr], SEP)
176176
177177
178178 func keyClaimedByUserMinReward (lpAssetIdStr,userAddressStr) = makeString(["%s%s%s__claimedMinReward", userAddressStr, lpAssetIdStr], SEP)
179179
180180
181181 func keyClaimedByUserBoostReward (lpAssetIdStr,userAddressStr) = makeString(["%s%s%s__claimedBoostReward", userAddressStr, lpAssetIdStr], SEP)
182182
183183
184184 func keyClaimedTotal (lpAssetIdStr) = makeString(["%s%s%s__claimed__total", lpAssetIdStr], SEP)
185185
186186
187187 func readStaked (key) = valueOrElse(getInteger(this, key), 0)
188188
189189
190190 func keyLastTotalLpBalance (lpAssetId) = makeString(["%s%s%s", lpAssetId, "total", "bal"], SEP)
191191
192192
193193 func keyLastUserLpBalance (lpAssetId,userAddress) = makeString(["%s%s%s", lpAssetId, userAddress, "bal"], SEP)
194194
195195
196196 func keyTotalLpBalanceIntegral (lpAssetId) = makeString(["%s%s%s", lpAssetId, "total", "balINT"], SEP)
197197
198198
199199 func keyUserLpBalanceIntegral (lpAssetId,userAddress) = makeString(["%s%s%s", lpAssetId, userAddress, "balINT"], SEP)
200200
201201
202202 func keyTotalLpBalanceIntegralLastUpdHeight (lpAssetId) = makeString(["%s%s%s", lpAssetId, "total", "lastUpd"], SEP)
203203
204204
205205 func keyUserLpBalanceIntegralLastUpdHeight (lpAssetId,userAddress) = makeString(["%s%s%s", lpAssetId, userAddress, "lastUpd"], SEP)
206206
207207
208208 func keyWxPerLpIntegral (lpAssetId) = makeString(["%s%s%s%s", lpAssetId, "common", "lpInt"], SEP)
209209
210210
211211 func keyWxPerLpIntegralLastUpdHeight (lpAssetId) = makeString(["%s%s%s%s", lpAssetId, "common", "lpIntH"], SEP)
212212
213213
214214 func keyWxToClaimUser (lpAssetId,userAddress) = makeString(["%s%s%s%s", lpAssetId, userAddress, "lpInt"], SEP)
215215
216216
217217 func keyWxPerLpIntegralUserLastUpdHeight (lpAssetId,userAddress) = makeString(["%s%s%s%s", lpAssetId, userAddress, "lpIntH"], SEP)
218218
219219
220220 func keyWxPerLp (lpAssetId) = makeString(["%s", lpAssetId, "wxPerLp"], SEP)
221221
222222
223223 func keyWxPerLpX18 (lpAssetId) = makeString(["%s", lpAssetId, "wxPerLpX18"], SEP)
224224
225225
226226 func keyWxPerLpIntegralUserLast (lpAssetId,userAddress) = makeString(["%s%s%s%s", lpAssetId, userAddress, "uIntL"], SEP)
227227
228228
229229 func keyOperationHistoryRecord (type,userAddress,txId58) = makeString(["%s%s%s%s__history", type, userAddress, txId58], SEP)
230230
231231
232232 func formatHistoryRecord (userAddress,lpAssetId,type,amount) = makeString(["%s%s%s%d%d%d", userAddress, lpAssetId, type, toString(height), toString(lastBlock.timestamp), toString(amount)], SEP)
233233
234234
235235 func OperationHistoryEntry (type,userAddress,lpAssetId,amount,txId) = StringEntry(keyOperationHistoryRecord(type, userAddress, toBase58String(txId)), formatHistoryRecord(userAddress, lpAssetId, type, amount))
236236
237237
238238 let factoryAddress = getStringOrFail(this, keyFactoryAddress())
239239
240240 let factoryContract = addressFromStringValue(factoryAddress)
241241
242242 let factoryCfg = readFactoryCfgOrFail(factoryContract)
243243
244244 let emissionContract = getEmissionAddressOrFail(factoryCfg)
245245
246246 let boostingContract = getBoostingAddressOrFail(factoryCfg)
247247
248248 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"))
249249
250250 func keyNextUser (lpAssetId) = makeString(["%s%s", lpAssetId, "nextUser"], SEP)
251251
252252
253253 func getUsersListName (lpAssetId) = makeString(["users", lpAssetId], SEP)
254254
255255
256256 func keyListHead (listName) = makeString(["%s%s%s", listName, "head"], SEP)
257257
258258
259259 func keyListSize (listName) = makeString(["%s%s%s", listName, "size"], SEP)
260260
261261
262262 func keyListPrev (listName,id) = makeString(["%s%s%s%s", listName, id, "prev"], SEP)
263263
264264
265265 func keyListNext (listName,id) = makeString(["%s%s%s%s", listName, id, "next"], SEP)
266266
267267
268268 func containsNode (listName,id) = {
269269 let headOrUnit = getString(this, keyListHead(listName))
270270 let prevOrUnit = getString(this, keyListPrev(listName, id))
271271 let nextOrUnit = getString(this, keyListNext(listName, id))
272272 if (if ((id == valueOrElse(headOrUnit, "")))
273273 then true
274274 else (prevOrUnit != unit))
275275 then true
276276 else (nextOrUnit != unit)
277277 }
278278
279279
280280 func insertNodeActions (listName,id) = {
281281 let headOrUnit = getString(this, keyListHead(listName))
282282 let listSize = valueOrElse(getInteger(this, keyListSize(listName)), 0)
283283 let checkNode = if (!(containsNode(listName, id)))
284284 then true
285285 else throw("Node exists")
286286 if ((checkNode == checkNode))
287287 then (([IntegerEntry(keyListSize(listName), (listSize + 1))] ++ (if ((headOrUnit != unit))
288288 then [StringEntry(keyListNext(listName, id), value(headOrUnit)), StringEntry(keyListPrev(listName, value(headOrUnit)), id)]
289289 else nil)) ++ [StringEntry(keyListHead(listName), id)])
290290 else throw("Strict value is not equal to itself.")
291291 }
292292
293293
294294 func deleteNodeActions (listName,id) = {
295295 let headOrUnit = getString(this, keyListHead(listName))
296296 let listSize = valueOrElse(getInteger(this, keyListSize(listName)), 0)
297297 let prevOrUnit = getString(this, keyListPrev(listName, id))
298298 let nextOrUnit = getString(this, keyListNext(listName, id))
299299 ([IntegerEntry(keyListSize(listName), (listSize - 1))] ++ (if (if ((prevOrUnit != unit))
300300 then (nextOrUnit != unit)
301301 else false)
302302 then [StringEntry(keyListNext(listName, value(prevOrUnit)), value(nextOrUnit)), StringEntry(keyListPrev(listName, value(nextOrUnit)), value(prevOrUnit)), DeleteEntry(keyListPrev(listName, id)), DeleteEntry(keyListNext(listName, id))]
303303 else if ((nextOrUnit != unit))
304304 then [StringEntry(keyListHead(listName), value(nextOrUnit)), DeleteEntry(keyListNext(listName, id)), DeleteEntry(keyListPrev(listName, value(nextOrUnit)))]
305305 else if ((prevOrUnit != unit))
306306 then [DeleteEntry(keyListPrev(listName, id)), DeleteEntry(keyListNext(listName, value(prevOrUnit)))]
307307 else if ((id == valueOrElse(headOrUnit, "")))
308308 then [DeleteEntry(keyListHead(listName))]
309309 else throw(((("invalid node: " + listName) + ".") + id))))
310310 }
311311
312312
313313 func calcWxPerLpIntegralUserLast (stakedByUser,wxPerLpIntegralUserLastUpdHeightOrZero,wxPerLpIntegralNew,wxPerLpIntegralUserLastKEY) = if (if ((wxPerLpIntegralUserLastUpdHeightOrZero == zeroBigInt))
314314 then (stakedByUser > zeroBigInt)
315315 else false)
316316 then zeroBigInt
317317 else if ((stakedByUser == zeroBigInt))
318318 then wxPerLpIntegralNew
319319 else if (if ((wxPerLpIntegralUserLastUpdHeightOrZero > zeroBigInt))
320320 then (stakedByUser > zeroBigInt)
321321 else false)
322322 then value(parseBigInt(getStringOrFail(this, wxPerLpIntegralUserLastKEY)))
323323 else throw("calcWxPerLpIntegralUserLast: unexpected state")
324324
325325
326326 func refreshPoolINTEGRALS (lpAssetIdStr,poolAddressStr,lpDeltaAmount) = {
327327 let stakedTotalKEY = keyStakedTotal(lpAssetIdStr)
328328 let stakedTotal = toBigInt(readStaked(stakedTotalKEY))
329329 let nonZeroStakedTotal = if ((stakedTotal == zeroBigInt))
330330 then oneBigInt
331331 else stakedTotal
332332 let poolWeight = getIntegerValue(factoryContract, keyFactoryPoolWeight(poolAddressStr))
333333 let emissionStartBlock = getIntOrFail(emissionContract, keyEmissionStartBlock())
334334 let MULT3 = 1000
335335 let wxEmissionPerBlockX3 = (getIntOrFail(emissionContract, keyEmissionRatePerBlockCurrent()) * MULT3)
336336 let poolWxEmissionPerBlockX3 = fraction(wxEmissionPerBlockX3, poolWeight, (POOLWEIGHTMULT * 3))
337337 let wxPerLpIntegralKEY = keyWxPerLpIntegral(lpAssetIdStr)
338338 let wxPerLpIntegralLastUpdHeightKEY = keyWxPerLpIntegralLastUpdHeight(lpAssetIdStr)
339339 let wxPerLpKEY = keyWxPerLp(lpAssetIdStr)
340340 let wxPerLpIntegralLastUpdHeight = getIntOrDefault(this, wxPerLpIntegralLastUpdHeightKEY, emissionStartBlock)
341341 let wxPerLpIntegral = getBigIntFromStringOrZero(this, wxPerLpIntegralKEY)
342342 let wxPerLpOrZeroX3 = 0
343343 let dh = max([(height - wxPerLpIntegralLastUpdHeight), 0])
344344 let wxPerLpX3 = if ((wxPerLpOrZeroX3 != 0))
345345 then toBigInt(wxPerLpOrZeroX3)
346346 else fraction(toBigInt(poolWxEmissionPerBlockX3), toBigInt(MULT8), nonZeroStakedTotal)
347347 let stakedTotalNew = (stakedTotal + toBigInt(lpDeltaAmount))
348348 let nonZeroStakedTotalNew = if ((stakedTotalNew == zeroBigInt))
349349 then oneBigInt
350350 else stakedTotalNew
351351 let wxPerLpIntegralNew = (wxPerLpIntegral + (wxPerLpX3 * toBigInt(dh)))
352352 let wxPerLpX3New = (toBigInt(poolWxEmissionPerBlockX3) / nonZeroStakedTotalNew)
353353 let wxPerLpIntegralLastUpdHeightNew = height
354354 let debug = makeString([toString(wxPerLpIntegralNew), toString(dh), toString(wxPerLpX3), toString(stakedTotal), toString(poolWxEmissionPerBlockX3), toString(wxEmissionPerBlockX3), toString(poolWeight)], "::")
355355 $Tuple3(wxPerLpIntegralNew, [StringEntry(wxPerLpIntegralKEY, toString(wxPerLpIntegralNew)), IntegerEntry(wxPerLpIntegralLastUpdHeightKEY, wxPerLpIntegralLastUpdHeightNew), StringEntry(wxPerLpKEY, toString(wxPerLpX3New))], debug)
356356 }
357357
358358
359359 func refreshINTEGRALS (lpAssetIdStr,userAddressStr,poolAddressStr,lpDeltaAmount) = {
360360 let $t01475014872 = refreshPoolINTEGRALS(lpAssetIdStr, poolAddressStr, lpDeltaAmount)
361361 let wxPerLpIntegralNew = $t01475014872._1
362362 let poolIntegralSTATE = $t01475014872._2
363363 let poolDEBUG = $t01475014872._3
364364 let MULT3 = 1000
365365 let stakedByUserKEY = keyStakedByUser(userAddressStr, lpAssetIdStr)
366366 let stakedByUser = readStaked(stakedByUserKEY)
367367 let wxToClaimUserKEY = keyWxToClaimUser(lpAssetIdStr, userAddressStr)
368368 let wxPerLpIntegralUserLastUpdHeightKEY = keyWxPerLpIntegralUserLastUpdHeight(lpAssetIdStr, userAddressStr)
369369 let wxPerLpIntegralUserLastKEY = keyWxPerLpIntegralUserLast(lpAssetIdStr, userAddressStr)
370370 let wxToClaimUser = getBigIntFromStringOrZero(this, wxToClaimUserKEY)
371371 let wxPerLpIntegralUserLastUpdHeightOrZero = getIntOrZero(this, wxPerLpIntegralUserLastUpdHeightKEY)
372372 let wxPerLpIntegralUserLast = calcWxPerLpIntegralUserLast(toBigInt(stakedByUser), toBigInt(wxPerLpIntegralUserLastUpdHeightOrZero), wxPerLpIntegralNew, wxPerLpIntegralUserLastKEY)
373373 let MULT11 = (MULT8 * MULT3)
374374 let wxToClaimUserNew = max([(wxToClaimUser + fraction((wxPerLpIntegralNew - wxPerLpIntegralUserLast), toBigInt(stakedByUser), toBigInt(MULT11))), zeroBigInt])
375375 let wxPerLpIntegralUserLastNew = wxPerLpIntegralNew
376376 let wxPerLpIntegralUserLastUpdHeightNew = height
377377 let debug = makeString([toString(wxToClaimUser), toString(wxPerLpIntegralUserLast), toString(stakedByUser), poolDEBUG, toString(height)], "::")
378378 $Tuple3(wxToClaimUserNew, (poolIntegralSTATE ++ [StringEntry(wxToClaimUserKEY, toString(wxToClaimUserNew)), IntegerEntry(wxPerLpIntegralUserLastUpdHeightKEY, wxPerLpIntegralUserLastUpdHeightNew), StringEntry(wxPerLpIntegralUserLastKEY, toString(wxPerLpIntegralUserLastNew))]), debug)
379379 }
380380
381381
382382 func managerPublicKeyOrUnit () = match getString(keyManagerPublicKey()) {
383383 case s: String =>
384384 fromBase58String(s)
385385 case _: Unit =>
386386 unit
387387 case _ =>
388388 throw("Match error")
389389 }
390390
391391
392392 func pendingManagerPublicKeyOrUnit () = match getString(keyPendingManagerPublicKey()) {
393393 case s: String =>
394394 fromBase58String(s)
395395 case _: Unit =>
396396 unit
397397 case _ =>
398398 throw("Match error")
399399 }
400400
401401
402402 let permissionDeniedError = throw("Permission denied")
403403
404404 func mustThis (i) = if ((i.caller == this))
405405 then true
406406 else permissionDeniedError
407407
408408
409409 func mustManager (i) = match managerPublicKeyOrUnit() {
410410 case pk: ByteVector =>
411411 if ((i.callerPublicKey == pk))
412412 then true
413413 else permissionDeniedError
414414 case _: Unit =>
415415 if ((i.caller == this))
416416 then true
417417 else permissionDeniedError
418418 case _ =>
419419 throw("Match error")
420420 }
421421
422422
423423 func unstakeActions (i,lpAssetId,poolAddress,userAddress,lpAssetRecipientAddress,amount) = {
424424 let userAddressStr = toString(userAddress)
425425 let lpAssetIdStr = toBase58String(lpAssetId)
426426 let poolAddressStr = toString(poolAddress)
427427 let stakedByUserKEY = keyStakedByUser(userAddressStr, lpAssetIdStr)
428428 let stakedTotalKEY = keyStakedTotal(lpAssetIdStr)
429429 let stakedByUser = readStaked(stakedByUserKEY)
430430 let stakedTotal = readStaked(stakedTotalKEY)
431431 let integralSTATE = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, -(amount))._2
432432 let listName = getUsersListName(lpAssetIdStr)
433433 let listActions = if (if (containsNode(listName, userAddressStr))
434434 then (amount == stakedByUser)
435435 else false)
436436 then deleteNodeActions(listName, userAddressStr)
437437 else nil
438- let claimedByUserMinReward = getBigIntFromStringOrZero(this, keyClaimedByUserMinReward(lpAssetIdStr, userAddressStr))
439- let wxToClaimUserNew = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, 0)._1
440- let availableToClaim = (wxToClaimUserNew - claimedByUserMinReward)
441- let throwIfNothingToClaim = true
442- let r = if ((availableToClaim > zeroBigInt))
443- then invoke(this, "claimWxINTERNAL", [lpAssetIdStr, userAddressStr, throwIfNothingToClaim], nil)
438+ let refreshStakedVote = if ((amount == stakedByUser))
439+ then invoke(boostingContract, "onStakedVoteUpdate", [lpAssetIdStr, userAddressStr, false], nil)
444440 else unit
445- if ((r == r))
446- then if ((amount > stakedByUser))
447- then throw(((((((("passed amount=" + toString(amount)) + " is greater than available=") + toString(stakedByUser)) + ". lpAssetId=") + lpAssetIdStr) + ". stakedByUserKEY=") + stakedByUserKEY))
448- else (([IntegerEntry(stakedByUserKEY, (stakedByUser - amount)), IntegerEntry(stakedTotalKEY, (stakedTotal - amount)), ScriptTransfer(lpAssetRecipientAddress, amount, lpAssetId), OperationHistoryEntry("unstake", userAddressStr, lpAssetIdStr, amount, i.transactionId)] ++ integralSTATE) ++ listActions)
441+ if ((refreshStakedVote == refreshStakedVote))
442+ then {
443+ let claimedByUserMinReward = getBigIntFromStringOrZero(this, keyClaimedByUserMinReward(lpAssetIdStr, userAddressStr))
444+ let wxToClaimUserNew = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, 0)._1
445+ let availableToClaim = (wxToClaimUserNew - claimedByUserMinReward)
446+ let throwIfNothingToClaim = true
447+ let r = if ((availableToClaim > zeroBigInt))
448+ then invoke(this, "claimWxINTERNAL", [lpAssetIdStr, userAddressStr, throwIfNothingToClaim], nil)
449+ else unit
450+ if ((r == r))
451+ then if ((amount > stakedByUser))
452+ then throw(((((((("passed amount=" + toString(amount)) + " is greater than available=") + toString(stakedByUser)) + ". lpAssetId=") + lpAssetIdStr) + ". stakedByUserKEY=") + stakedByUserKEY))
453+ else (([IntegerEntry(stakedByUserKEY, (stakedByUser - amount)), IntegerEntry(stakedTotalKEY, (stakedTotal - amount)), ScriptTransfer(lpAssetRecipientAddress, amount, lpAssetId), OperationHistoryEntry("unstake", userAddressStr, lpAssetIdStr, amount, i.transactionId)] ++ integralSTATE) ++ listActions)
454+ else throw("Strict value is not equal to itself.")
455+ }
449456 else throw("Strict value is not equal to itself.")
450457 }
451458
452459
453460 @Callable(i)
454461 func constructor (factoryAddressStr) = {
455462 let checkCaller = mustManager(i)
456463 if ((checkCaller == checkCaller))
457464 then [StringEntry(keyFactoryAddress(), factoryAddressStr)]
458465 else throw("Strict value is not equal to itself.")
459466 }
460467
461468
462469
463470 @Callable(i)
464471 func constructorV2 (votingEmissionContract) = {
465472 let cheks = [mustManager(i), if ((addressFromString(votingEmissionContract) != unit))
466473 then true
467474 else "invalid voting emission contract address"]
468475 if ((cheks == cheks))
469476 then [StringEntry(keyVotingEmissionContract(), votingEmissionContract)]
470477 else throw("Strict value is not equal to itself.")
471478 }
472479
473480
474481
475482 @Callable(i)
476483 func setManager (pendingManagerPublicKey) = {
477484 let checkCaller = mustManager(i)
478485 if ((checkCaller == checkCaller))
479486 then {
480487 let checkManagerPublicKey = fromBase58String(pendingManagerPublicKey)
481488 if ((checkManagerPublicKey == checkManagerPublicKey))
482489 then [StringEntry(keyPendingManagerPublicKey(), pendingManagerPublicKey)]
483490 else throw("Strict value is not equal to itself.")
484491 }
485492 else throw("Strict value is not equal to itself.")
486493 }
487494
488495
489496
490497 @Callable(i)
491498 func confirmManager () = {
492499 let pm = pendingManagerPublicKeyOrUnit()
493500 let hasPM = if (isDefined(pm))
494501 then true
495502 else throw("No pending manager")
496503 if ((hasPM == hasPM))
497504 then {
498505 let checkPM = if ((i.callerPublicKey == value(pm)))
499506 then true
500507 else throw("You are not pending manager")
501508 if ((checkPM == checkPM))
502509 then [StringEntry(keyManagerPublicKey(), toBase58String(value(pm))), DeleteEntry(keyPendingManagerPublicKey())]
503510 else throw("Strict value is not equal to itself.")
504511 }
505512 else throw("Strict value is not equal to itself.")
506513 }
507514
508515
509516
510517 @Callable(i)
511518 func stake () = if ((size(i.payments) != 1))
512519 then throw("invalid payment - exact one payment must be attached")
513520 else {
514521 let pmt = i.payments[0]
515522 let lpAssetId = value(pmt.assetId)
516523 let lpAssetIdStr = toBase58String(lpAssetId)
517524 let amount = pmt.amount
518525 let poolAddressStr = valueOrErrorMessage(getString(factoryContract, keyFactoryLp2AssetsMapping(lpAssetIdStr)), ("unsupported lp asset " + lpAssetIdStr))
519526 let callerStr = toString(i.caller)
520527 let userAddressStr = if ((callerStr == poolAddressStr))
521528 then toString(i.originCaller)
522529 else callerStr
523530 let stakedByUserKEY = keyStakedByUser(userAddressStr, lpAssetIdStr)
524531 let stakedTotalKEY = keyStakedTotal(lpAssetIdStr)
525532 let stakedByUser = readStaked(stakedByUserKEY)
526- let stakedTotal = readStaked(stakedTotalKEY)
527- let $t02127621393 = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, amount)
528- let wxToClaimUserNew = $t02127621393._1
529- let integralSTATE = $t02127621393._2
530- let debug = $t02127621393._3
531- let listName = getUsersListName(lpAssetIdStr)
532- let listActions = if (containsNode(listName, userAddressStr))
533- then nil
534- else insertNodeActions(listName, userAddressStr)
535- (([IntegerEntry(stakedByUserKEY, (stakedByUser + amount)), IntegerEntry(stakedTotalKEY, (stakedTotal + amount)), OperationHistoryEntry("stake", userAddressStr, lpAssetIdStr, amount, i.transactionId)] ++ integralSTATE) ++ listActions)
533+ let refreshStakedVote = if ((stakedByUser == 0))
534+ then invoke(boostingContract, "onStakedVoteUpdate", [lpAssetIdStr, userAddressStr, true], nil)
535+ else unit
536+ if ((refreshStakedVote == refreshStakedVote))
537+ then {
538+ let stakedTotal = readStaked(stakedTotalKEY)
539+ let $t02161321730 = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, amount)
540+ let wxToClaimUserNew = $t02161321730._1
541+ let integralSTATE = $t02161321730._2
542+ let debug = $t02161321730._3
543+ let listName = getUsersListName(lpAssetIdStr)
544+ let listActions = if (containsNode(listName, userAddressStr))
545+ then nil
546+ else insertNodeActions(listName, userAddressStr)
547+ (([IntegerEntry(stakedByUserKEY, (stakedByUser + amount)), IntegerEntry(stakedTotalKEY, (stakedTotal + amount)), OperationHistoryEntry("stake", userAddressStr, lpAssetIdStr, amount, i.transactionId)] ++ integralSTATE) ++ listActions)
548+ }
549+ else throw("Strict value is not equal to itself.")
536550 }
537551
538552
539553
540554 @Callable(i)
541555 func unstake (lpAssetIdStr,amount) = {
542556 let lpAssetId = fromBase58String(lpAssetIdStr)
543557 let poolAddressStr = valueOrErrorMessage(getString(factoryContract, keyFactoryLp2AssetsMapping(lpAssetIdStr)), ("unsupported lp asset " + lpAssetIdStr))
544558 let poolAddress = addressFromStringValue(poolAddressStr)
545559 let poolAddon = valueOrElse(getString(poolAddress, keyAddonAddr()), poolAddressStr)
546560 let callerStr = toString(i.caller)
547561 let userAddress = if (if ((callerStr == poolAddressStr))
548562 then true
549563 else (callerStr == poolAddon))
550564 then i.originCaller
551565 else i.caller
552566 let lpAssetRecipientAddress = i.caller
553567 unstakeActions(i, lpAssetId, poolAddress, userAddress, lpAssetRecipientAddress, amount)
554568 }
555569
556570
557571
558572 @Callable(i)
559573 func unstakeINTERNAL (lpAssetId,amount,userAddress,lpAssetRecipientAddress) = {
560574 let lpAssetIdStr = toBase58String(lpAssetId)
561575 let poolAddress = addressFromStringValue(valueOrErrorMessage(getString(factoryContract, keyFactoryLp2AssetsMapping(lpAssetIdStr)), ("unsupported lp asset " + lpAssetIdStr)))
562576 let checkCaller = if ((i.caller == poolAddress))
563577 then true
564578 else permissionDeniedError
565579 if ((checkCaller == checkCaller))
566580 then unstakeActions(i, lpAssetId, poolAddress, Address(userAddress), Address(lpAssetRecipientAddress), amount)
567581 else throw("Strict value is not equal to itself.")
568582 }
569583
570584
571585
572586 @Callable(i)
573587 func claimWx (lpAssetIdStr) = {
574588 let userAddressStr = toString(i.caller)
575589 let throwIfNothingToClaim = true
576590 let result = invoke(this, "claimWxINTERNAL", [lpAssetIdStr, userAddressStr, throwIfNothingToClaim], nil)
577591 $Tuple2(nil, result)
578592 }
579593
580594
581595
582596 @Callable(i)
583597 func claimWxDoNotThrow (lpAssetIdStr) = {
584598 let userAddressStr = toString(i.caller)
585599 let throwIfNothingToClaim = false
586600 let result = invoke(this, "claimWxINTERNAL", [lpAssetIdStr, userAddressStr, throwIfNothingToClaim], nil)
587601 $Tuple2(nil, result)
588602 }
589603
590604
591605
592606 @Callable(i)
593607 func claimWxINTERNAL (lpAssetIdStr,userAddressStr,throwIfNothingToClaim) = {
594608 let checkCaller = mustThis(i)
595609 if ((checkCaller == checkCaller))
596610 then {
597611 let userAddress = valueOrErrorMessage(addressFromString(userAddressStr), "claimWxINTERNAL: invalid user address")
598612 let poolAddressStr = getStringByAddressOrFail(factoryContract, keyFactoryLpAssetToPoolContractAddress(lpAssetIdStr))
599613 let claimedByUserKEY = keyClaimedByUser(lpAssetIdStr, userAddressStr)
600614 let claimedTotalKEY = keyClaimedTotal(lpAssetIdStr)
601615 let claimedByUserMinRewardKEY = keyClaimedByUserMinReward(lpAssetIdStr, userAddressStr)
602616 let claimedByUserBoostRewardKEY = keyClaimedByUserBoostReward(lpAssetIdStr, userAddressStr)
603617 let claimedByUser = getBigIntFromStringOrZero(this, claimedByUserKEY)
604618 let claimedByUserMinReward = getBigIntFromStringOrZero(this, claimedByUserMinRewardKEY)
605619 let claimedByUserBoostReward = getBigIntFromStringOrZero(this, claimedByUserBoostRewardKEY)
606620 let claimedTotal = getBigIntFromStringOrZero(this, claimedTotalKEY)
607- let $t02477924891 = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, 0)
608- let wxToClaimUserNew = $t02477924891._1
609- let integralSTATE = $t02477924891._2
610- let debug = $t02477924891._3
621+ let $t02511625228 = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, 0)
622+ let wxToClaimUserNew = $t02511625228._1
623+ let integralSTATE = $t02511625228._2
624+ let debug = $t02511625228._3
611625 let availableToClaim = max([(wxToClaimUserNew - claimedByUserMinReward), zeroBigInt])
612626 if ((zeroBigInt >= availableToClaim))
613627 then if (throwIfNothingToClaim)
614628 then throw("nothing to claim")
615629 else $Tuple2(nil, 0)
616630 else {
617631 let wxAmountBoostTotal = max([asInt(asAnyList(invoke(boostingContract, "claimWxBoost", [lpAssetIdStr, userAddressStr], nil))[0]), 0])
618632 let minRewardPart = availableToClaim
619633 let boostRewardPart = min([(minRewardPart * toBigInt(2)), toBigInt(wxAmountBoostTotal)])
620634 let totalReward = (minRewardPart + boostRewardPart)
621635 let wxAssetId = asByteVector(asAnyList(invoke(emissionContract, "emit", [toInt(minRewardPart)], nil))[0])
622636 let emitBoost = asAnyList(invoke(emissionContract, "emit", [toInt(boostRewardPart)], nil))
623637 if ((emitBoost == emitBoost))
624638 then {
625639 let claimedByUserValue = ((claimedByUser + minRewardPart) + boostRewardPart)
626640 let claimedByUserMinRewardPlusPart = (claimedByUserMinReward + minRewardPart)
627641 let claimedByUserBoostRewardPlusBoostRewardPart = (claimedByUserBoostReward + boostRewardPart)
628642 let claimedTotalPlusAvailableToClaim = (claimedTotal + availableToClaim)
629643 $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))
630644 }
631645 else throw("Strict value is not equal to itself.")
632646 }
633647 }
634648 else throw("Strict value is not equal to itself.")
635649 }
636650
637651
638652
639653 @Callable(i)
640654 func claimWxBulkInternalREADONLY (currentIter,lpAssetIds,userAddressStr,resAcc) = if ((currentIter == size(lpAssetIds)))
641655 then $Tuple2(nil, resAcc)
642656 else {
643657 let lpAssetId = lpAssetIds[currentIter]
644658 let info = split({
645659 let @ = invoke(this, "claimWxREADONLY", [lpAssetId, userAddressStr], nil)
646660 if ($isInstanceOf(@, "String"))
647661 then @
648662 else throw(($getType(@) + " couldn't be cast to String"))
649663 }, SEP)
650664 let unclaimed = info[3]
651665 let claimed = info[4]
652666 let res = (resAcc :+ makeString(["%d%d", unclaimed, claimed], SEP))
653667 let inv = {
654668 let @ = invoke(this, "claimWxBulkInternalREADONLY", [(currentIter + 1), lpAssetIds, userAddressStr, res], nil)
655669 if ($isInstanceOf(@, "List[Any]"))
656670 then @
657671 else throw(($getType(@) + " couldn't be cast to List[Any]"))
658672 }
659673 if ((inv == inv))
660674 then $Tuple2(nil, inv)
661675 else throw("Strict value is not equal to itself.")
662676 }
663677
664678
665679
666680 @Callable(i)
667681 func claimWxBulkREADONLY (lpAssetIds,userAddressStr) = {
668682 let res = invoke(this, "claimWxBulkInternalREADONLY", [0, lpAssetIds, userAddressStr, nil], nil)
669683 $Tuple2(nil, res)
670684 }
671685
672686
673687
674688 @Callable(i)
675689 func claimWxREADONLY (lpAssetIdStr,userAddressStr) = {
676690 let stakedByUserKEY = keyStakedByUser(userAddressStr, lpAssetIdStr)
677691 let stakedTotalKEY = keyStakedTotal(lpAssetIdStr)
678692 let claimedByUserKEY = keyClaimedByUser(lpAssetIdStr, userAddressStr)
679693 let claimedByUserMinRewardKEY = keyClaimedByUserMinReward(lpAssetIdStr, userAddressStr)
680694 let stakedByUser = readStaked(stakedByUserKEY)
681695 let stakedTotal = readStaked(stakedTotalKEY)
682696 let claimedByUser = getBigIntFromStringOrZero(this, claimedByUserKEY)
683697 let claimedByUserMinReward = getBigIntFromStringOrZero(this, claimedByUserMinRewardKEY)
684698 let poolAddressStr = getStringByAddressOrFail(factoryContract, keyFactoryLpAssetToPoolContractAddress(lpAssetIdStr))
685699 let poolWeight = getIntegerValue(factoryContract, keyFactoryPoolWeight(poolAddressStr))
686700 let wxEmissionPerBlock = getIntOrFail(emissionContract, keyEmissionRatePerBlockCurrent())
687701 let emissionStartBlock = getIntOrFail(emissionContract, keyEmissionStartBlock())
688702 let passedBlocks = if ((emissionStartBlock > height))
689703 then 0
690704 else (height - emissionStartBlock)
691705 let poolWxEmission = fraction((wxEmissionPerBlock * passedBlocks), poolWeight, POOLWEIGHTMULT)
692706 let userWxReward = fraction(poolWxEmission, stakedByUser, stakedTotal)
693- let $t02870028812 = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, 0)
694- let wxToClaimUserNew = $t02870028812._1
695- let integralSTATE = $t02870028812._2
696- let debug = $t02870028812._3
707+ let $t02903729149 = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, 0)
708+ let wxToClaimUserNew = $t02903729149._1
709+ let integralSTATE = $t02903729149._2
710+ let debug = $t02903729149._3
697711 let availableToClaim = max([(wxToClaimUserNew - claimedByUserMinReward), zeroBigInt])
698712 let boostInvResult = asAnyList(invoke(boostingContract, "claimWxBoostREADONLY", [lpAssetIdStr, userAddressStr], nil))
699713 let wxAmountBoostTotal = max([asInt(boostInvResult[0]), 0])
700714 let boostDebug = asString(boostInvResult[1])
701715 let minRewardPart = availableToClaim
702716 let boostRewardPart = min([(minRewardPart * toBigInt(2)), toBigInt(wxAmountBoostTotal)])
703717 let totalReward = (minRewardPart + boostRewardPart)
704718 $Tuple2(nil, makeString(["%s%s%d%d%d%d%s", lpAssetIdStr, userAddressStr, toString(totalReward), toString(claimedByUser), toString(minRewardPart), toString(boostRewardPart), "soon"], SEP))
705719 }
706720
707721
708722
709723 @Callable(i)
710724 func stakedByUserREADONLY (lpAssetIdStr,userAddressStr) = {
711725 let stakedByUser = valueOrElse(getInteger(keyStakedByUser(userAddressStr, lpAssetIdStr)), 0)
712726 $Tuple2(nil, stakedByUser)
713727 }
714728
715729
716730
717731 @Callable(i)
718732 func usersListTraversal (lpAssetId) = {
719733 let checkCaller = if ((toBase58String(i.caller.bytes) == valueOrElse(getString(this, keyVotingEmissionContract()), "")))
720734 then true
721735 else mustManager(i)
722736 if ((checkCaller == checkCaller))
723737 then {
724738 let listName = getUsersListName(lpAssetId)
725739 let userOrUnit = getString(keyNextUser(lpAssetId))
726740 let headOrUnit = getString(keyListHead(listName))
727741 match userOrUnit {
728742 case _: Unit =>
729743 match headOrUnit {
730744 case _: Unit =>
731745 $Tuple2(nil, false)
732746 case head: String =>
733747 $Tuple2([StringEntry(keyNextUser(lpAssetId), head)], true)
734748 case _ =>
735749 throw("Match error")
736750 }
737751 case userAddress: String =>
738752 let claimedByUserMinReward = getBigIntFromStringOrZero(this, keyClaimedByUserMinReward(lpAssetId, userAddress))
739753 let poolAddress = getStringByAddressOrFail(factoryContract, keyFactoryLpAssetToPoolContractAddress(lpAssetId))
740754 let wxToClaimUserNew = refreshINTEGRALS(lpAssetId, userAddress, poolAddress, 0)._1
741755 let availableToClaim = (wxToClaimUserNew - claimedByUserMinReward)
742756 let throwIfNothingToClaim = true
743757 let r = if ((availableToClaim > zeroBigInt))
744758 then invoke(this, "claimWxINTERNAL", [lpAssetId, userAddress, throwIfNothingToClaim], nil)
745759 else unit
746760 if ((r == r))
747761 then {
748762 let nextUserOrUnit = getString(keyListNext(listName, userAddress))
749763 match nextUserOrUnit {
750764 case _: Unit =>
751765 $Tuple2([DeleteEntry(keyNextUser(lpAssetId))], false)
752766 case nextUser: String =>
753767 $Tuple2([StringEntry(keyNextUser(lpAssetId), nextUser)], true)
754768 case _ =>
755769 throw("Match error")
756770 }
757771 }
758772 else throw("Strict value is not equal to itself.")
759773 case _ =>
760774 throw("Match error")
761775 }
762776 }
763777 else throw("Strict value is not equal to itself.")
764778 }
765779
766780
767781
768782 @Callable(i)
769783 func onModifyWeight (lpAssetIdStr,poolAddressStr) = if ((i.caller != factoryContract))
770784 then throw("permissions denied")
771785 else {
772- let $t03141831528 = refreshPoolINTEGRALS(lpAssetIdStr, poolAddressStr, 0)
773- let wxPerLpIntegralNew = $t03141831528._1
774- let poolIntegralSTATE = $t03141831528._2
775- let poolDEBUG = $t03141831528._3
786+ let $t03175531865 = refreshPoolINTEGRALS(lpAssetIdStr, poolAddressStr, 0)
787+ let wxPerLpIntegralNew = $t03175531865._1
788+ let poolIntegralSTATE = $t03175531865._2
789+ let poolDEBUG = $t03175531865._3
776790 poolIntegralSTATE
777791 }
778792
779793
780794 @Verifier(tx)
781795 func verify () = {
782796 let targetPublicKey = match managerPublicKeyOrUnit() {
783797 case pk: ByteVector =>
784798 pk
785799 case _: Unit =>
786800 tx.senderPublicKey
787801 case _ =>
788802 throw("Match error")
789803 }
790804 sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey)
791805 }
792806

github/deemru/w8io/fabc49c 
125.20 ms