tx · E6ymV3TCGHeDYTWv8To4AEEWe4vvHWWiwxmfeeztwd3Y

3Mx3zmXrMcLFCafMuPtXAzR4ZPVeZYb6qLz:  -0.02300000 Waves

2023.03.14 17:27 [2489836] smart account 3Mx3zmXrMcLFCafMuPtXAzR4ZPVeZYb6qLz > SELF 0.00000000 Waves

{ "type": 13, "id": "E6ymV3TCGHeDYTWv8To4AEEWe4vvHWWiwxmfeeztwd3Y", "fee": 2300000, "feeAssetId": null, "timestamp": 1678804117826, "version": 2, "chainId": 84, "sender": "3Mx3zmXrMcLFCafMuPtXAzR4ZPVeZYb6qLz", "senderPublicKey": "D28XoueZWsMfm8Y5pa6C5ZFuYoWgre2Wm8tzJANJgMnq", "proofs": [ "4kKarC7P1e5Lc4mNGi6498fpyEEdLnuetRbA1bAUEzTr1m2rC88MSsBcCjwgPqRmwUYFEF4u8y17JN9yy9hWzqok" ], "script": "base64:BgKMIAgCEgMKAQgSAwoBCBIDCgEIEgASABIECgIIARIGCgQCAQICEgMKAQgSAwoBCBIFCgMICAQSBgoEARgIGBIECgIYCBIECgIICBIECgIICBIDCgEIEgQKAggIIgZTQ0FMRTgiBU1VTFQ4IgdTQ0FMRTE4IgZNVUxUMTgiA1NFUCIOUE9PTFdFSUdIVE1VTFQiCnplcm9CaWdJbnQiCW9uZUJpZ0ludCIHd3JhcEVyciIDbXNnIgh0aHJvd0VyciIJYXNBbnlMaXN0IgN2YWwiByRtYXRjaDAiCnZhbEFueUx5c3QiBWFzSW50IgZ2YWxJbnQiCGFzU3RyaW5nIgZ2YWxTdHIiDGFzQnl0ZVZlY3RvciIGdmFsQmluIg9nZXRTdHJpbmdPckZhaWwiB2FkZHJlc3MiA2tleSIYZ2V0U3RyaW5nQnlBZGRyZXNzT3JGYWlsIgxnZXRJbnRPclplcm8iD2dldEludE9yRGVmYXVsdCIKZGVmYXVsdFZhbCIMZ2V0SW50T3JGYWlsIhlnZXRCaWdJbnRGcm9tU3RyaW5nT3JaZXJvIhxnZXRCaWdJ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BAJjdwYEAmN4AwkAvwICBQJjdgUBZwkA/AcEBQR0aGlzAg9jbGFpbVd4SU5URVJOQUwJAMwIAgUCYUIJAMwIAgUCYUQJAMwIAgUCY3cFA25pbAUDbmlsBQR1bml0AwkAAAIFAmN4BQJjeAQCZHgJAKIIAQkBAmJpAgUCYmUFAmFEBAJkdgUCZHgDCQABAgUCZHYCBFVuaXQJAJQKAgkAzAgCCQELRGVsZXRlRW50cnkBCQECYmIBBQJhQgUDbmlsBwMJAAECBQJkdgIGU3RyaW5nBAJkeQUCZHYJAJQKAgkAzAgCCQELU3RyaW5nRW50cnkCCQECYmIBBQJhQgUCZHkFA25pbAYJAAIBAgtNYXRjaCBlcnJvcgkAAgECJFN0cmljdCB2YWx1ZSBpcyBub3QgZXF1YWwgdG8gaXRzZWxmLgkAAgECC01hdGNoIGVycm9yCQACAQIkU3RyaWN0IHZhbHVlIGlzIG5vdCBlcXVhbCB0byBpdHNlbGYuAmNsAQ5vbk1vZGlmeVdlaWdodAICYXQCYngDCQECIT0CCAUCY2wGY2FsbGVyBQJhWAkAAgECEnBlcm1pc3Npb25zIGRlbmllZAQCZHoJAQJidwMFAmF0BQJieAAABAJidQgFAmR6Al8xBAJiVwgFAmR6Al8yBAJiWAgFAmR6Al8zBQJiVwECZEEBAmRCAAQCZEMEAW4JAQJjaAADCQABAgUBbgIKQnl0ZVZlY3RvcgQCY24FAW4FAmNuAwkAAQIFAW4CBFVuaXQIBQJkQQ9zZW5kZXJQdWJsaWNLZXkJAAIBAgtNYXRjaCBlcnJvcgkA9AMDCAUCZEEJYm9keUJ5dGVzCQCRAwIIBQJkQQZwcm9vZnMAAAUCZEMBNGCg", "height": 2489836, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 7Y1wP5ciJW8VBgJh1GZXXdZ6tprzYgk2NzNLmWfkS6K1 Next: 2927fdxeRkwHc8UuDZ7L7eycjotnwaJbTBtKKB35PQaM Diff:
OldNewDifferences
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let SCALE8 = 8
5-
6-let MULT3 = 1000
75
86 let MULT8 = 100000000
97
247245
248246 let boostingContract = getBoostingAddressOrFail(factoryCfg)
249247
250-let boostCoeff = {
251- let @ = invoke(emissionContract, "getBoostCoeffREADONLY", nil, nil)
252- if ($isInstanceOf(@, "Int"))
253- then @
254- else throw(($getType(@) + " couldn't be cast to Int"))
255- }
256-
257248 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"))
258249
259250 func keyNextUser (lpAssetId) = makeString(["%s%s", lpAssetId, "nextUser"], SEP)
340331 else stakedTotal
341332 let poolWeight = getIntegerValue(factoryContract, keyFactoryPoolWeight(poolAddressStr))
342333 let emissionStartBlock = getIntOrFail(emissionContract, keyEmissionStartBlock())
334+ let MULT3 = 1000
343335 let wxEmissionPerBlockX3 = (getIntOrFail(emissionContract, keyEmissionRatePerBlockCurrent()) * MULT3)
344- let poolWxEmissionPerBlockX3 = fraction(wxEmissionPerBlockX3, poolWeight, (POOLWEIGHTMULT * boostCoeff))
336+ let poolWxEmissionPerBlockX3 = fraction(wxEmissionPerBlockX3, poolWeight, (POOLWEIGHTMULT * 3))
345337 let wxPerLpIntegralKEY = keyWxPerLpIntegral(lpAssetIdStr)
346338 let wxPerLpIntegralLastUpdHeightKEY = keyWxPerLpIntegralLastUpdHeight(lpAssetIdStr)
347339 let wxPerLpKEY = keyWxPerLp(lpAssetIdStr)
365357
366358
367359 func refreshINTEGRALS (lpAssetIdStr,userAddressStr,poolAddressStr,lpDeltaAmount) = {
368- let $t01476214884 = refreshPoolINTEGRALS(lpAssetIdStr, poolAddressStr, lpDeltaAmount)
369- let wxPerLpIntegralNew = $t01476214884._1
370- let poolIntegralSTATE = $t01476214884._2
371- let poolDEBUG = $t01476214884._3
360+ let $t01475014872 = refreshPoolINTEGRALS(lpAssetIdStr, poolAddressStr, lpDeltaAmount)
361+ let wxPerLpIntegralNew = $t01475014872._1
362+ let poolIntegralSTATE = $t01475014872._2
363+ let poolDEBUG = $t01475014872._3
364+ let MULT3 = 1000
372365 let stakedByUserKEY = keyStakedByUser(userAddressStr, lpAssetIdStr)
373366 let stakedByUser = readStaked(stakedByUserKEY)
374367 let wxToClaimUserKEY = keyWxToClaimUser(lpAssetIdStr, userAddressStr)
543536 if ((refreshStakedVote == refreshStakedVote))
544537 then {
545538 let stakedTotal = readStaked(stakedTotalKEY)
546- let $t02160621723 = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, amount)
547- let wxToClaimUserNew = $t02160621723._1
548- let integralSTATE = $t02160621723._2
549- let debug = $t02160621723._3
539+ let $t02161321730 = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, amount)
540+ let wxToClaimUserNew = $t02161321730._1
541+ let integralSTATE = $t02161321730._2
542+ let debug = $t02161321730._3
550543 let listName = getUsersListName(lpAssetIdStr)
551544 let listActions = if (containsNode(listName, userAddressStr))
552545 then nil
625618 let claimedByUserMinReward = getBigIntFromStringOrZero(this, claimedByUserMinRewardKEY)
626619 let claimedByUserBoostReward = getBigIntFromStringOrZero(this, claimedByUserBoostRewardKEY)
627620 let claimedTotal = getBigIntFromStringOrZero(this, claimedTotalKEY)
628- let $t02510925221 = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, 0)
629- let wxToClaimUserNew = $t02510925221._1
630- let integralSTATE = $t02510925221._2
631- let debug = $t02510925221._3
621+ let $t02511625228 = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, 0)
622+ let wxToClaimUserNew = $t02511625228._1
623+ let integralSTATE = $t02511625228._2
624+ let debug = $t02511625228._3
632625 let availableToClaim = max([(wxToClaimUserNew - claimedByUserMinReward), zeroBigInt])
633626 if ((zeroBigInt >= availableToClaim))
634627 then if (throwIfNothingToClaim)
637630 else {
638631 let wxAmountBoostTotal = max([asInt(asAnyList(invoke(boostingContract, "claimWxBoost", [lpAssetIdStr, userAddressStr], nil))[0]), 0])
639632 let minRewardPart = availableToClaim
640- let boostRewardPart = min([(minRewardPart * toBigInt((boostCoeff - 1))), toBigInt(wxAmountBoostTotal)])
633+ let boostRewardPart = min([(minRewardPart * toBigInt(2)), toBigInt(wxAmountBoostTotal)])
641634 let totalReward = (minRewardPart + boostRewardPart)
642635 let wxAssetId = asByteVector(asAnyList(invoke(emissionContract, "emit", [toInt(minRewardPart)], nil))[0])
643636 let emitBoost = asAnyList(invoke(emissionContract, "emit", [toInt(boostRewardPart)], nil))
670663 }, SEP)
671664 let unclaimed = info[3]
672665 let claimed = info[4]
673- let userVoteFinalized = {
674- let @ = invoke(boostingContract, "getUserVoteFinalizedREADONLY", [lpAssetId, userAddressStr], nil)
675- if ($isInstanceOf(@, "Int"))
676- then @
677- else throw(($getType(@) + " couldn't be cast to Int"))
678- }
679- let res = (resAcc :+ makeString(["%d%d%d", unclaimed, claimed, toString(userVoteFinalized)], SEP))
666+ let res = (resAcc :+ makeString(["%d%d", unclaimed, claimed], SEP))
680667 let inv = {
681668 let @ = invoke(this, "claimWxBulkInternalREADONLY", [(currentIter + 1), lpAssetIds, userAddressStr, res], nil)
682669 if ($isInstanceOf(@, "List[Any]"))
717704 else (height - emissionStartBlock)
718705 let poolWxEmission = fraction((wxEmissionPerBlock * passedBlocks), poolWeight, POOLWEIGHTMULT)
719706 let userWxReward = fraction(poolWxEmission, stakedByUser, stakedTotal)
720- let $t02926929381 = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, 0)
721- let wxToClaimUserNew = $t02926929381._1
722- let integralSTATE = $t02926929381._2
723- let debug = $t02926929381._3
707+ let $t02903729149 = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, 0)
708+ let wxToClaimUserNew = $t02903729149._1
709+ let integralSTATE = $t02903729149._2
710+ let debug = $t02903729149._3
724711 let availableToClaim = max([(wxToClaimUserNew - claimedByUserMinReward), zeroBigInt])
725712 let boostInvResult = asAnyList(invoke(boostingContract, "claimWxBoostREADONLY", [lpAssetIdStr, userAddressStr], nil))
726713 let wxAmountBoostTotal = max([asInt(boostInvResult[0]), 0])
727714 let boostDebug = asString(boostInvResult[1])
728715 let minRewardPart = availableToClaim
729- let boostRewardPart = min([(minRewardPart * toBigInt((boostCoeff - 1))), toBigInt(wxAmountBoostTotal)])
716+ let boostRewardPart = min([(minRewardPart * toBigInt(2)), toBigInt(wxAmountBoostTotal)])
730717 let totalReward = (minRewardPart + boostRewardPart)
731718 $Tuple2(nil, makeString(["%s%s%d%d%d%d%s", lpAssetIdStr, userAddressStr, toString(totalReward), toString(claimedByUser), toString(minRewardPart), toString(boostRewardPart), "soon"], SEP))
732719 }
796783 func onModifyWeight (lpAssetIdStr,poolAddressStr) = if ((i.caller != factoryContract))
797784 then throw("permissions denied")
798785 else {
799- let $t03200232112 = refreshPoolINTEGRALS(lpAssetIdStr, poolAddressStr, 0)
800- let wxPerLpIntegralNew = $t03200232112._1
801- let poolIntegralSTATE = $t03200232112._2
802- let poolDEBUG = $t03200232112._3
786+ let $t03175531865 = refreshPoolINTEGRALS(lpAssetIdStr, poolAddressStr, 0)
787+ let wxPerLpIntegralNew = $t03175531865._1
788+ let poolIntegralSTATE = $t03175531865._2
789+ let poolDEBUG = $t03175531865._3
803790 poolIntegralSTATE
804791 }
805792
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let SCALE8 = 8
5-
6-let MULT3 = 1000
75
86 let MULT8 = 100000000
97
108 let SCALE18 = 18
119
1210 let MULT18 = toBigInt(1000000000000000000)
1311
1412 let SEP = "__"
1513
1614 let POOLWEIGHTMULT = MULT8
1715
1816 let zeroBigInt = toBigInt(0)
1917
2018 let oneBigInt = toBigInt(1)
2119
2220 func wrapErr (msg) = makeString(["staking.ride:", toString(this), msg], " ")
2321
2422
2523 func throwErr (msg) = throw(wrapErr(msg))
2624
2725
2826 func asAnyList (val) = match val {
2927 case valAnyLyst: List[Any] =>
3028 valAnyLyst
3129 case _ =>
3230 throw("fail to cast into List[Any]")
3331 }
3432
3533
3634 func asInt (val) = match val {
3735 case valInt: Int =>
3836 valInt
3937 case _ =>
4038 throw("fail to cast into Int")
4139 }
4240
4341
4442 func asString (val) = match val {
4543 case valStr: String =>
4644 valStr
4745 case _ =>
4846 throw("fail to cast into Int")
4947 }
5048
5149
5250 func asByteVector (val) = match val {
5351 case valBin: ByteVector =>
5452 valBin
5553 case _ =>
5654 throw("fail to cast into Int")
5755 }
5856
5957
6058 func getStringOrFail (address,key) = valueOrErrorMessage(getString(address, key), (("mandatory this." + key) + " is not defined"))
6159
6260
6361 func getStringByAddressOrFail (address,key) = valueOrErrorMessage(getString(address, key), (((("mandatory " + toString(address)) + ".") + key) + " is not defined"))
6462
6563
6664 func getIntOrZero (address,key) = valueOrElse(getInteger(address, key), 0)
6765
6866
6967 func getIntOrDefault (address,key,defaultVal) = valueOrElse(getInteger(address, key), defaultVal)
7068
7169
7270 func getIntOrFail (address,key) = valueOrErrorMessage(getInteger(address, key), (("mandatory this." + key) + " is not defined"))
7371
7472
7573 func getBigIntFromStringOrZero (address,key) = value(parseBigInt(valueOrElse(getString(address, key), "0")))
7674
7775
7876 func getBigIntFromStringOrDefault (address,key,defaultVal) = match getString(address, key) {
7977 case s: String =>
8078 value(parseBigInt(s))
8179 case _: Unit =>
8280 defaultVal
8381 case _ =>
8482 throw("Match error")
8583 }
8684
8785
8886 func toX18 (origVal,origScaleMult) = fraction(toBigInt(origVal), MULT18, toBigInt(origScaleMult))
8987
9088
9189 func fromX18 (val,resultScaleMult) = toInt(fraction(val, toBigInt(resultScaleMult), MULT18))
9290
9391
9492 func keyFactoryAddress () = "%s%s__config__factoryAddress"
9593
9694
9795 func keyVotingEmissionContract () = "%s__votingEmissionContract"
9896
9997
10098 let IdxFactoryCfgStakingDapp = 1
10199
102100 let IdxFactoryCfgBoostingDapp = 2
103101
104102 let IdxFactoryCfgIdoDapp = 3
105103
106104 let IdxFactoryCfgTeamDapp = 4
107105
108106 let IdxFactoryCfgEmissionDapp = 5
109107
110108 let IdxFactoryCfgRestDapp = 6
111109
112110 let IdxFactoryCfgSlippageDapp = 7
113111
114112 func keyFactoryCfg () = "%s__factoryConfig"
115113
116114
117115 func keyManagerPublicKey () = "%s__managerPublicKey"
118116
119117
120118 func keyPendingManagerPublicKey () = "%s__pendingManagerPublicKey"
121119
122120
123121 func keyStablePoolAddonAddr () = "%s__stablePoolAddonAddr"
124122
125123
126124 func keyAddonAddr () = "%s__addonAddr"
127125
128126
129127 func keyFactoryLp2AssetsMapping (lpAssetStr) = makeString(["%s%s%s", lpAssetStr, "mappings__lpAsset2PoolContract"], SEP)
130128
131129
132130 func keyFactoryLpList () = "%s__lpTokensList"
133131
134132
135133 func keyFactoryLpAssetToPoolContractAddress (lpAssetStr) = makeString(["%s%s%s", lpAssetStr, "mappings__lpAsset2PoolContract"], SEP)
136134
137135
138136 func keyFactoryPoolWeight (contractAddress) = makeString(["%s%s", "poolWeight", contractAddress], SEP)
139137
140138
141139 func readLpList (factory) = split(valueOrElse(getString(factory, keyFactoryLpList()), ""), SEP)
142140
143141
144142 func readFactoryCfgOrFail (factory) = split(getStringByAddressOrFail(factory, keyFactoryCfg()), SEP)
145143
146144
147145 func getBoostingAddressOrFail (factoryCfg) = addressFromStringValue(factoryCfg[IdxFactoryCfgBoostingDapp])
148146
149147
150148 func getEmissionAddressOrFail (factoryCfg) = addressFromStringValue(factoryCfg[IdxFactoryCfgEmissionDapp])
151149
152150
153151 func getStakingAddressOrFail (factoryCfg) = addressFromStringValue(factoryCfg[IdxFactoryCfgStakingDapp])
154152
155153
156154 func keyEmissionRatePerBlockCurrent () = "%s%s__ratePerBlock__current"
157155
158156
159157 func keyEmissionRatePerBlockMaxCurrent () = "%s%s__ratePerBlockMax__current"
160158
161159
162160 func keyEmissionStartBlock () = "%s%s__emission__startBlock"
163161
164162
165163 func keyEmissionDurationInBlocks () = "%s%s__emission__duration"
166164
167165
168166 func keyEmissionEndBlock () = "%s%s__emission__endBlock"
169167
170168
171169 func keyStakedByUser (userAddressStr,lpAssetIdStr) = makeString(["%s%s%s__staked", userAddressStr, lpAssetIdStr], SEP)
172170
173171
174172 func keyStakedTotal (lpAssetIdStr) = ("%s%s%s__staked__total__" + lpAssetIdStr)
175173
176174
177175 func keyClaimedByUser (lpAssetIdStr,userAddressStr) = makeString(["%s%s%s__claimed", userAddressStr, lpAssetIdStr], SEP)
178176
179177
180178 func keyClaimedByUserMinReward (lpAssetIdStr,userAddressStr) = makeString(["%s%s%s__claimedMinReward", userAddressStr, lpAssetIdStr], SEP)
181179
182180
183181 func keyClaimedByUserBoostReward (lpAssetIdStr,userAddressStr) = makeString(["%s%s%s__claimedBoostReward", userAddressStr, lpAssetIdStr], SEP)
184182
185183
186184 func keyClaimedTotal (lpAssetIdStr) = makeString(["%s%s%s__claimed__total", lpAssetIdStr], SEP)
187185
188186
189187 func readStaked (key) = valueOrElse(getInteger(this, key), 0)
190188
191189
192190 func keyLastTotalLpBalance (lpAssetId) = makeString(["%s%s%s", lpAssetId, "total", "bal"], SEP)
193191
194192
195193 func keyLastUserLpBalance (lpAssetId,userAddress) = makeString(["%s%s%s", lpAssetId, userAddress, "bal"], SEP)
196194
197195
198196 func keyTotalLpBalanceIntegral (lpAssetId) = makeString(["%s%s%s", lpAssetId, "total", "balINT"], SEP)
199197
200198
201199 func keyUserLpBalanceIntegral (lpAssetId,userAddress) = makeString(["%s%s%s", lpAssetId, userAddress, "balINT"], SEP)
202200
203201
204202 func keyTotalLpBalanceIntegralLastUpdHeight (lpAssetId) = makeString(["%s%s%s", lpAssetId, "total", "lastUpd"], SEP)
205203
206204
207205 func keyUserLpBalanceIntegralLastUpdHeight (lpAssetId,userAddress) = makeString(["%s%s%s", lpAssetId, userAddress, "lastUpd"], SEP)
208206
209207
210208 func keyWxPerLpIntegral (lpAssetId) = makeString(["%s%s%s%s", lpAssetId, "common", "lpInt"], SEP)
211209
212210
213211 func keyWxPerLpIntegralLastUpdHeight (lpAssetId) = makeString(["%s%s%s%s", lpAssetId, "common", "lpIntH"], SEP)
214212
215213
216214 func keyWxToClaimUser (lpAssetId,userAddress) = makeString(["%s%s%s%s", lpAssetId, userAddress, "lpInt"], SEP)
217215
218216
219217 func keyWxPerLpIntegralUserLastUpdHeight (lpAssetId,userAddress) = makeString(["%s%s%s%s", lpAssetId, userAddress, "lpIntH"], SEP)
220218
221219
222220 func keyWxPerLp (lpAssetId) = makeString(["%s", lpAssetId, "wxPerLp"], SEP)
223221
224222
225223 func keyWxPerLpX18 (lpAssetId) = makeString(["%s", lpAssetId, "wxPerLpX18"], SEP)
226224
227225
228226 func keyWxPerLpIntegralUserLast (lpAssetId,userAddress) = makeString(["%s%s%s%s", lpAssetId, userAddress, "uIntL"], SEP)
229227
230228
231229 func keyOperationHistoryRecord (type,userAddress,txId58) = makeString(["%s%s%s%s__history", type, userAddress, txId58], SEP)
232230
233231
234232 func formatHistoryRecord (userAddress,lpAssetId,type,amount) = makeString(["%s%s%s%d%d%d", userAddress, lpAssetId, type, toString(height), toString(lastBlock.timestamp), toString(amount)], SEP)
235233
236234
237235 func OperationHistoryEntry (type,userAddress,lpAssetId,amount,txId) = StringEntry(keyOperationHistoryRecord(type, userAddress, toBase58String(txId)), formatHistoryRecord(userAddress, lpAssetId, type, amount))
238236
239237
240238 let factoryAddress = getStringOrFail(this, keyFactoryAddress())
241239
242240 let factoryContract = addressFromStringValue(factoryAddress)
243241
244242 let factoryCfg = readFactoryCfgOrFail(factoryContract)
245243
246244 let emissionContract = getEmissionAddressOrFail(factoryCfg)
247245
248246 let boostingContract = getBoostingAddressOrFail(factoryCfg)
249247
250-let boostCoeff = {
251- let @ = invoke(emissionContract, "getBoostCoeffREADONLY", nil, nil)
252- if ($isInstanceOf(@, "Int"))
253- then @
254- else throw(($getType(@) + " couldn't be cast to Int"))
255- }
256-
257248 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"))
258249
259250 func keyNextUser (lpAssetId) = makeString(["%s%s", lpAssetId, "nextUser"], SEP)
260251
261252
262253 func getUsersListName (lpAssetId) = makeString(["users", lpAssetId], SEP)
263254
264255
265256 func keyListHead (listName) = makeString(["%s%s%s", listName, "head"], SEP)
266257
267258
268259 func keyListSize (listName) = makeString(["%s%s%s", listName, "size"], SEP)
269260
270261
271262 func keyListPrev (listName,id) = makeString(["%s%s%s%s", listName, id, "prev"], SEP)
272263
273264
274265 func keyListNext (listName,id) = makeString(["%s%s%s%s", listName, id, "next"], SEP)
275266
276267
277268 func containsNode (listName,id) = {
278269 let headOrUnit = getString(this, keyListHead(listName))
279270 let prevOrUnit = getString(this, keyListPrev(listName, id))
280271 let nextOrUnit = getString(this, keyListNext(listName, id))
281272 if (if ((id == valueOrElse(headOrUnit, "")))
282273 then true
283274 else (prevOrUnit != unit))
284275 then true
285276 else (nextOrUnit != unit)
286277 }
287278
288279
289280 func insertNodeActions (listName,id) = {
290281 let headOrUnit = getString(this, keyListHead(listName))
291282 let listSize = valueOrElse(getInteger(this, keyListSize(listName)), 0)
292283 let checkNode = if (!(containsNode(listName, id)))
293284 then true
294285 else throw("Node exists")
295286 if ((checkNode == checkNode))
296287 then (([IntegerEntry(keyListSize(listName), (listSize + 1))] ++ (if ((headOrUnit != unit))
297288 then [StringEntry(keyListNext(listName, id), value(headOrUnit)), StringEntry(keyListPrev(listName, value(headOrUnit)), id)]
298289 else nil)) ++ [StringEntry(keyListHead(listName), id)])
299290 else throw("Strict value is not equal to itself.")
300291 }
301292
302293
303294 func deleteNodeActions (listName,id) = {
304295 let headOrUnit = getString(this, keyListHead(listName))
305296 let listSize = valueOrElse(getInteger(this, keyListSize(listName)), 0)
306297 let prevOrUnit = getString(this, keyListPrev(listName, id))
307298 let nextOrUnit = getString(this, keyListNext(listName, id))
308299 ([IntegerEntry(keyListSize(listName), (listSize - 1))] ++ (if (if ((prevOrUnit != unit))
309300 then (nextOrUnit != unit)
310301 else false)
311302 then [StringEntry(keyListNext(listName, value(prevOrUnit)), value(nextOrUnit)), StringEntry(keyListPrev(listName, value(nextOrUnit)), value(prevOrUnit)), DeleteEntry(keyListPrev(listName, id)), DeleteEntry(keyListNext(listName, id))]
312303 else if ((nextOrUnit != unit))
313304 then [StringEntry(keyListHead(listName), value(nextOrUnit)), DeleteEntry(keyListNext(listName, id)), DeleteEntry(keyListPrev(listName, value(nextOrUnit)))]
314305 else if ((prevOrUnit != unit))
315306 then [DeleteEntry(keyListPrev(listName, id)), DeleteEntry(keyListNext(listName, value(prevOrUnit)))]
316307 else if ((id == valueOrElse(headOrUnit, "")))
317308 then [DeleteEntry(keyListHead(listName))]
318309 else throw(((("invalid node: " + listName) + ".") + id))))
319310 }
320311
321312
322313 func calcWxPerLpIntegralUserLast (stakedByUser,wxPerLpIntegralUserLastUpdHeightOrZero,wxPerLpIntegralNew,wxPerLpIntegralUserLastKEY) = if (if ((wxPerLpIntegralUserLastUpdHeightOrZero == zeroBigInt))
323314 then (stakedByUser > zeroBigInt)
324315 else false)
325316 then zeroBigInt
326317 else if ((stakedByUser == zeroBigInt))
327318 then wxPerLpIntegralNew
328319 else if (if ((wxPerLpIntegralUserLastUpdHeightOrZero > zeroBigInt))
329320 then (stakedByUser > zeroBigInt)
330321 else false)
331322 then value(parseBigInt(getStringOrFail(this, wxPerLpIntegralUserLastKEY)))
332323 else throw("calcWxPerLpIntegralUserLast: unexpected state")
333324
334325
335326 func refreshPoolINTEGRALS (lpAssetIdStr,poolAddressStr,lpDeltaAmount) = {
336327 let stakedTotalKEY = keyStakedTotal(lpAssetIdStr)
337328 let stakedTotal = toBigInt(readStaked(stakedTotalKEY))
338329 let nonZeroStakedTotal = if ((stakedTotal == zeroBigInt))
339330 then oneBigInt
340331 else stakedTotal
341332 let poolWeight = getIntegerValue(factoryContract, keyFactoryPoolWeight(poolAddressStr))
342333 let emissionStartBlock = getIntOrFail(emissionContract, keyEmissionStartBlock())
334+ let MULT3 = 1000
343335 let wxEmissionPerBlockX3 = (getIntOrFail(emissionContract, keyEmissionRatePerBlockCurrent()) * MULT3)
344- let poolWxEmissionPerBlockX3 = fraction(wxEmissionPerBlockX3, poolWeight, (POOLWEIGHTMULT * boostCoeff))
336+ let poolWxEmissionPerBlockX3 = fraction(wxEmissionPerBlockX3, poolWeight, (POOLWEIGHTMULT * 3))
345337 let wxPerLpIntegralKEY = keyWxPerLpIntegral(lpAssetIdStr)
346338 let wxPerLpIntegralLastUpdHeightKEY = keyWxPerLpIntegralLastUpdHeight(lpAssetIdStr)
347339 let wxPerLpKEY = keyWxPerLp(lpAssetIdStr)
348340 let wxPerLpIntegralLastUpdHeight = getIntOrDefault(this, wxPerLpIntegralLastUpdHeightKEY, emissionStartBlock)
349341 let wxPerLpIntegral = getBigIntFromStringOrZero(this, wxPerLpIntegralKEY)
350342 let wxPerLpOrZeroX3 = 0
351343 let dh = max([(height - wxPerLpIntegralLastUpdHeight), 0])
352344 let wxPerLpX3 = if ((wxPerLpOrZeroX3 != 0))
353345 then toBigInt(wxPerLpOrZeroX3)
354346 else fraction(toBigInt(poolWxEmissionPerBlockX3), toBigInt(MULT8), nonZeroStakedTotal)
355347 let stakedTotalNew = (stakedTotal + toBigInt(lpDeltaAmount))
356348 let nonZeroStakedTotalNew = if ((stakedTotalNew == zeroBigInt))
357349 then oneBigInt
358350 else stakedTotalNew
359351 let wxPerLpIntegralNew = (wxPerLpIntegral + (wxPerLpX3 * toBigInt(dh)))
360352 let wxPerLpX3New = (toBigInt(poolWxEmissionPerBlockX3) / nonZeroStakedTotalNew)
361353 let wxPerLpIntegralLastUpdHeightNew = height
362354 let debug = makeString([toString(wxPerLpIntegralNew), toString(dh), toString(wxPerLpX3), toString(stakedTotal), toString(poolWxEmissionPerBlockX3), toString(wxEmissionPerBlockX3), toString(poolWeight)], "::")
363355 $Tuple3(wxPerLpIntegralNew, [StringEntry(wxPerLpIntegralKEY, toString(wxPerLpIntegralNew)), IntegerEntry(wxPerLpIntegralLastUpdHeightKEY, wxPerLpIntegralLastUpdHeightNew), StringEntry(wxPerLpKEY, toString(wxPerLpX3New))], debug)
364356 }
365357
366358
367359 func refreshINTEGRALS (lpAssetIdStr,userAddressStr,poolAddressStr,lpDeltaAmount) = {
368- let $t01476214884 = refreshPoolINTEGRALS(lpAssetIdStr, poolAddressStr, lpDeltaAmount)
369- let wxPerLpIntegralNew = $t01476214884._1
370- let poolIntegralSTATE = $t01476214884._2
371- let poolDEBUG = $t01476214884._3
360+ let $t01475014872 = refreshPoolINTEGRALS(lpAssetIdStr, poolAddressStr, lpDeltaAmount)
361+ let wxPerLpIntegralNew = $t01475014872._1
362+ let poolIntegralSTATE = $t01475014872._2
363+ let poolDEBUG = $t01475014872._3
364+ let MULT3 = 1000
372365 let stakedByUserKEY = keyStakedByUser(userAddressStr, lpAssetIdStr)
373366 let stakedByUser = readStaked(stakedByUserKEY)
374367 let wxToClaimUserKEY = keyWxToClaimUser(lpAssetIdStr, userAddressStr)
375368 let wxPerLpIntegralUserLastUpdHeightKEY = keyWxPerLpIntegralUserLastUpdHeight(lpAssetIdStr, userAddressStr)
376369 let wxPerLpIntegralUserLastKEY = keyWxPerLpIntegralUserLast(lpAssetIdStr, userAddressStr)
377370 let wxToClaimUser = getBigIntFromStringOrZero(this, wxToClaimUserKEY)
378371 let wxPerLpIntegralUserLastUpdHeightOrZero = getIntOrZero(this, wxPerLpIntegralUserLastUpdHeightKEY)
379372 let wxPerLpIntegralUserLast = calcWxPerLpIntegralUserLast(toBigInt(stakedByUser), toBigInt(wxPerLpIntegralUserLastUpdHeightOrZero), wxPerLpIntegralNew, wxPerLpIntegralUserLastKEY)
380373 let MULT11 = (MULT8 * MULT3)
381374 let wxToClaimUserNew = max([(wxToClaimUser + fraction((wxPerLpIntegralNew - wxPerLpIntegralUserLast), toBigInt(stakedByUser), toBigInt(MULT11))), zeroBigInt])
382375 let wxPerLpIntegralUserLastNew = wxPerLpIntegralNew
383376 let wxPerLpIntegralUserLastUpdHeightNew = height
384377 let debug = makeString([toString(wxToClaimUser), toString(wxPerLpIntegralUserLast), toString(stakedByUser), poolDEBUG, toString(height)], "::")
385378 $Tuple3(wxToClaimUserNew, (poolIntegralSTATE ++ [StringEntry(wxToClaimUserKEY, toString(wxToClaimUserNew)), IntegerEntry(wxPerLpIntegralUserLastUpdHeightKEY, wxPerLpIntegralUserLastUpdHeightNew), StringEntry(wxPerLpIntegralUserLastKEY, toString(wxPerLpIntegralUserLastNew))]), debug)
386379 }
387380
388381
389382 func managerPublicKeyOrUnit () = match getString(keyManagerPublicKey()) {
390383 case s: String =>
391384 fromBase58String(s)
392385 case _: Unit =>
393386 unit
394387 case _ =>
395388 throw("Match error")
396389 }
397390
398391
399392 func pendingManagerPublicKeyOrUnit () = match getString(keyPendingManagerPublicKey()) {
400393 case s: String =>
401394 fromBase58String(s)
402395 case _: Unit =>
403396 unit
404397 case _ =>
405398 throw("Match error")
406399 }
407400
408401
409402 let permissionDeniedError = throw("Permission denied")
410403
411404 func mustThis (i) = if ((i.caller == this))
412405 then true
413406 else permissionDeniedError
414407
415408
416409 func mustManager (i) = match managerPublicKeyOrUnit() {
417410 case pk: ByteVector =>
418411 if ((i.callerPublicKey == pk))
419412 then true
420413 else permissionDeniedError
421414 case _: Unit =>
422415 if ((i.caller == this))
423416 then true
424417 else permissionDeniedError
425418 case _ =>
426419 throw("Match error")
427420 }
428421
429422
430423 func unstakeActions (i,lpAssetId,poolAddress,userAddress,lpAssetRecipientAddress,amount) = {
431424 let userAddressStr = toString(userAddress)
432425 let lpAssetIdStr = toBase58String(lpAssetId)
433426 let poolAddressStr = toString(poolAddress)
434427 let stakedByUserKEY = keyStakedByUser(userAddressStr, lpAssetIdStr)
435428 let stakedTotalKEY = keyStakedTotal(lpAssetIdStr)
436429 let stakedByUser = readStaked(stakedByUserKEY)
437430 let stakedTotal = readStaked(stakedTotalKEY)
438431 let integralSTATE = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, -(amount))._2
439432 let listName = getUsersListName(lpAssetIdStr)
440433 let listActions = if (if (containsNode(listName, userAddressStr))
441434 then (amount == stakedByUser)
442435 else false)
443436 then deleteNodeActions(listName, userAddressStr)
444437 else nil
445438 let refreshStakedVote = if ((amount == stakedByUser))
446439 then invoke(boostingContract, "onStakedVoteUpdate", [lpAssetIdStr, userAddressStr, false], nil)
447440 else unit
448441 if ((refreshStakedVote == refreshStakedVote))
449442 then {
450443 let claimedByUserMinReward = getBigIntFromStringOrZero(this, keyClaimedByUserMinReward(lpAssetIdStr, userAddressStr))
451444 let wxToClaimUserNew = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, 0)._1
452445 let availableToClaim = (wxToClaimUserNew - claimedByUserMinReward)
453446 let throwIfNothingToClaim = true
454447 let r = if ((availableToClaim > zeroBigInt))
455448 then invoke(this, "claimWxINTERNAL", [lpAssetIdStr, userAddressStr, throwIfNothingToClaim], nil)
456449 else unit
457450 if ((r == r))
458451 then if ((amount > stakedByUser))
459452 then throw(((((((("passed amount=" + toString(amount)) + " is greater than available=") + toString(stakedByUser)) + ". lpAssetId=") + lpAssetIdStr) + ". stakedByUserKEY=") + stakedByUserKEY))
460453 else (([IntegerEntry(stakedByUserKEY, (stakedByUser - amount)), IntegerEntry(stakedTotalKEY, (stakedTotal - amount)), ScriptTransfer(lpAssetRecipientAddress, amount, lpAssetId), OperationHistoryEntry("unstake", userAddressStr, lpAssetIdStr, amount, i.transactionId)] ++ integralSTATE) ++ listActions)
461454 else throw("Strict value is not equal to itself.")
462455 }
463456 else throw("Strict value is not equal to itself.")
464457 }
465458
466459
467460 @Callable(i)
468461 func constructor (factoryAddressStr) = {
469462 let checkCaller = mustManager(i)
470463 if ((checkCaller == checkCaller))
471464 then [StringEntry(keyFactoryAddress(), factoryAddressStr)]
472465 else throw("Strict value is not equal to itself.")
473466 }
474467
475468
476469
477470 @Callable(i)
478471 func constructorV2 (votingEmissionContract) = {
479472 let cheks = [mustManager(i), if ((addressFromString(votingEmissionContract) != unit))
480473 then true
481474 else "invalid voting emission contract address"]
482475 if ((cheks == cheks))
483476 then [StringEntry(keyVotingEmissionContract(), votingEmissionContract)]
484477 else throw("Strict value is not equal to itself.")
485478 }
486479
487480
488481
489482 @Callable(i)
490483 func setManager (pendingManagerPublicKey) = {
491484 let checkCaller = mustManager(i)
492485 if ((checkCaller == checkCaller))
493486 then {
494487 let checkManagerPublicKey = fromBase58String(pendingManagerPublicKey)
495488 if ((checkManagerPublicKey == checkManagerPublicKey))
496489 then [StringEntry(keyPendingManagerPublicKey(), pendingManagerPublicKey)]
497490 else throw("Strict value is not equal to itself.")
498491 }
499492 else throw("Strict value is not equal to itself.")
500493 }
501494
502495
503496
504497 @Callable(i)
505498 func confirmManager () = {
506499 let pm = pendingManagerPublicKeyOrUnit()
507500 let hasPM = if (isDefined(pm))
508501 then true
509502 else throw("No pending manager")
510503 if ((hasPM == hasPM))
511504 then {
512505 let checkPM = if ((i.callerPublicKey == value(pm)))
513506 then true
514507 else throw("You are not pending manager")
515508 if ((checkPM == checkPM))
516509 then [StringEntry(keyManagerPublicKey(), toBase58String(value(pm))), DeleteEntry(keyPendingManagerPublicKey())]
517510 else throw("Strict value is not equal to itself.")
518511 }
519512 else throw("Strict value is not equal to itself.")
520513 }
521514
522515
523516
524517 @Callable(i)
525518 func stake () = if ((size(i.payments) != 1))
526519 then throw("invalid payment - exact one payment must be attached")
527520 else {
528521 let pmt = i.payments[0]
529522 let lpAssetId = value(pmt.assetId)
530523 let lpAssetIdStr = toBase58String(lpAssetId)
531524 let amount = pmt.amount
532525 let poolAddressStr = valueOrErrorMessage(getString(factoryContract, keyFactoryLp2AssetsMapping(lpAssetIdStr)), ("unsupported lp asset " + lpAssetIdStr))
533526 let callerStr = toString(i.caller)
534527 let userAddressStr = if ((callerStr == poolAddressStr))
535528 then toString(i.originCaller)
536529 else callerStr
537530 let stakedByUserKEY = keyStakedByUser(userAddressStr, lpAssetIdStr)
538531 let stakedTotalKEY = keyStakedTotal(lpAssetIdStr)
539532 let stakedByUser = readStaked(stakedByUserKEY)
540533 let refreshStakedVote = if ((stakedByUser == 0))
541534 then invoke(boostingContract, "onStakedVoteUpdate", [lpAssetIdStr, userAddressStr, true], nil)
542535 else unit
543536 if ((refreshStakedVote == refreshStakedVote))
544537 then {
545538 let stakedTotal = readStaked(stakedTotalKEY)
546- let $t02160621723 = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, amount)
547- let wxToClaimUserNew = $t02160621723._1
548- let integralSTATE = $t02160621723._2
549- let debug = $t02160621723._3
539+ let $t02161321730 = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, amount)
540+ let wxToClaimUserNew = $t02161321730._1
541+ let integralSTATE = $t02161321730._2
542+ let debug = $t02161321730._3
550543 let listName = getUsersListName(lpAssetIdStr)
551544 let listActions = if (containsNode(listName, userAddressStr))
552545 then nil
553546 else insertNodeActions(listName, userAddressStr)
554547 (([IntegerEntry(stakedByUserKEY, (stakedByUser + amount)), IntegerEntry(stakedTotalKEY, (stakedTotal + amount)), OperationHistoryEntry("stake", userAddressStr, lpAssetIdStr, amount, i.transactionId)] ++ integralSTATE) ++ listActions)
555548 }
556549 else throw("Strict value is not equal to itself.")
557550 }
558551
559552
560553
561554 @Callable(i)
562555 func unstake (lpAssetIdStr,amount) = {
563556 let lpAssetId = fromBase58String(lpAssetIdStr)
564557 let poolAddressStr = valueOrErrorMessage(getString(factoryContract, keyFactoryLp2AssetsMapping(lpAssetIdStr)), ("unsupported lp asset " + lpAssetIdStr))
565558 let poolAddress = addressFromStringValue(poolAddressStr)
566559 let poolAddon = valueOrElse(getString(poolAddress, keyAddonAddr()), poolAddressStr)
567560 let callerStr = toString(i.caller)
568561 let userAddress = if (if ((callerStr == poolAddressStr))
569562 then true
570563 else (callerStr == poolAddon))
571564 then i.originCaller
572565 else i.caller
573566 let lpAssetRecipientAddress = i.caller
574567 unstakeActions(i, lpAssetId, poolAddress, userAddress, lpAssetRecipientAddress, amount)
575568 }
576569
577570
578571
579572 @Callable(i)
580573 func unstakeINTERNAL (lpAssetId,amount,userAddress,lpAssetRecipientAddress) = {
581574 let lpAssetIdStr = toBase58String(lpAssetId)
582575 let poolAddress = addressFromStringValue(valueOrErrorMessage(getString(factoryContract, keyFactoryLp2AssetsMapping(lpAssetIdStr)), ("unsupported lp asset " + lpAssetIdStr)))
583576 let checkCaller = if ((i.caller == poolAddress))
584577 then true
585578 else permissionDeniedError
586579 if ((checkCaller == checkCaller))
587580 then unstakeActions(i, lpAssetId, poolAddress, Address(userAddress), Address(lpAssetRecipientAddress), amount)
588581 else throw("Strict value is not equal to itself.")
589582 }
590583
591584
592585
593586 @Callable(i)
594587 func claimWx (lpAssetIdStr) = {
595588 let userAddressStr = toString(i.caller)
596589 let throwIfNothingToClaim = true
597590 let result = invoke(this, "claimWxINTERNAL", [lpAssetIdStr, userAddressStr, throwIfNothingToClaim], nil)
598591 $Tuple2(nil, result)
599592 }
600593
601594
602595
603596 @Callable(i)
604597 func claimWxDoNotThrow (lpAssetIdStr) = {
605598 let userAddressStr = toString(i.caller)
606599 let throwIfNothingToClaim = false
607600 let result = invoke(this, "claimWxINTERNAL", [lpAssetIdStr, userAddressStr, throwIfNothingToClaim], nil)
608601 $Tuple2(nil, result)
609602 }
610603
611604
612605
613606 @Callable(i)
614607 func claimWxINTERNAL (lpAssetIdStr,userAddressStr,throwIfNothingToClaim) = {
615608 let checkCaller = mustThis(i)
616609 if ((checkCaller == checkCaller))
617610 then {
618611 let userAddress = valueOrErrorMessage(addressFromString(userAddressStr), "claimWxINTERNAL: invalid user address")
619612 let poolAddressStr = getStringByAddressOrFail(factoryContract, keyFactoryLpAssetToPoolContractAddress(lpAssetIdStr))
620613 let claimedByUserKEY = keyClaimedByUser(lpAssetIdStr, userAddressStr)
621614 let claimedTotalKEY = keyClaimedTotal(lpAssetIdStr)
622615 let claimedByUserMinRewardKEY = keyClaimedByUserMinReward(lpAssetIdStr, userAddressStr)
623616 let claimedByUserBoostRewardKEY = keyClaimedByUserBoostReward(lpAssetIdStr, userAddressStr)
624617 let claimedByUser = getBigIntFromStringOrZero(this, claimedByUserKEY)
625618 let claimedByUserMinReward = getBigIntFromStringOrZero(this, claimedByUserMinRewardKEY)
626619 let claimedByUserBoostReward = getBigIntFromStringOrZero(this, claimedByUserBoostRewardKEY)
627620 let claimedTotal = getBigIntFromStringOrZero(this, claimedTotalKEY)
628- let $t02510925221 = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, 0)
629- let wxToClaimUserNew = $t02510925221._1
630- let integralSTATE = $t02510925221._2
631- let debug = $t02510925221._3
621+ let $t02511625228 = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, 0)
622+ let wxToClaimUserNew = $t02511625228._1
623+ let integralSTATE = $t02511625228._2
624+ let debug = $t02511625228._3
632625 let availableToClaim = max([(wxToClaimUserNew - claimedByUserMinReward), zeroBigInt])
633626 if ((zeroBigInt >= availableToClaim))
634627 then if (throwIfNothingToClaim)
635628 then throw("nothing to claim")
636629 else $Tuple2(nil, 0)
637630 else {
638631 let wxAmountBoostTotal = max([asInt(asAnyList(invoke(boostingContract, "claimWxBoost", [lpAssetIdStr, userAddressStr], nil))[0]), 0])
639632 let minRewardPart = availableToClaim
640- let boostRewardPart = min([(minRewardPart * toBigInt((boostCoeff - 1))), toBigInt(wxAmountBoostTotal)])
633+ let boostRewardPart = min([(minRewardPart * toBigInt(2)), toBigInt(wxAmountBoostTotal)])
641634 let totalReward = (minRewardPart + boostRewardPart)
642635 let wxAssetId = asByteVector(asAnyList(invoke(emissionContract, "emit", [toInt(minRewardPart)], nil))[0])
643636 let emitBoost = asAnyList(invoke(emissionContract, "emit", [toInt(boostRewardPart)], nil))
644637 if ((emitBoost == emitBoost))
645638 then {
646639 let claimedByUserValue = ((claimedByUser + minRewardPart) + boostRewardPart)
647640 let claimedByUserMinRewardPlusPart = (claimedByUserMinReward + minRewardPart)
648641 let claimedByUserBoostRewardPlusBoostRewardPart = (claimedByUserBoostReward + boostRewardPart)
649642 let claimedTotalPlusAvailableToClaim = (claimedTotal + availableToClaim)
650643 $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))
651644 }
652645 else throw("Strict value is not equal to itself.")
653646 }
654647 }
655648 else throw("Strict value is not equal to itself.")
656649 }
657650
658651
659652
660653 @Callable(i)
661654 func claimWxBulkInternalREADONLY (currentIter,lpAssetIds,userAddressStr,resAcc) = if ((currentIter == size(lpAssetIds)))
662655 then $Tuple2(nil, resAcc)
663656 else {
664657 let lpAssetId = lpAssetIds[currentIter]
665658 let info = split({
666659 let @ = invoke(this, "claimWxREADONLY", [lpAssetId, userAddressStr], nil)
667660 if ($isInstanceOf(@, "String"))
668661 then @
669662 else throw(($getType(@) + " couldn't be cast to String"))
670663 }, SEP)
671664 let unclaimed = info[3]
672665 let claimed = info[4]
673- let userVoteFinalized = {
674- let @ = invoke(boostingContract, "getUserVoteFinalizedREADONLY", [lpAssetId, userAddressStr], nil)
675- if ($isInstanceOf(@, "Int"))
676- then @
677- else throw(($getType(@) + " couldn't be cast to Int"))
678- }
679- let res = (resAcc :+ makeString(["%d%d%d", unclaimed, claimed, toString(userVoteFinalized)], SEP))
666+ let res = (resAcc :+ makeString(["%d%d", unclaimed, claimed], SEP))
680667 let inv = {
681668 let @ = invoke(this, "claimWxBulkInternalREADONLY", [(currentIter + 1), lpAssetIds, userAddressStr, res], nil)
682669 if ($isInstanceOf(@, "List[Any]"))
683670 then @
684671 else throw(($getType(@) + " couldn't be cast to List[Any]"))
685672 }
686673 if ((inv == inv))
687674 then $Tuple2(nil, inv)
688675 else throw("Strict value is not equal to itself.")
689676 }
690677
691678
692679
693680 @Callable(i)
694681 func claimWxBulkREADONLY (lpAssetIds,userAddressStr) = {
695682 let res = invoke(this, "claimWxBulkInternalREADONLY", [0, lpAssetIds, userAddressStr, nil], nil)
696683 $Tuple2(nil, res)
697684 }
698685
699686
700687
701688 @Callable(i)
702689 func claimWxREADONLY (lpAssetIdStr,userAddressStr) = {
703690 let stakedByUserKEY = keyStakedByUser(userAddressStr, lpAssetIdStr)
704691 let stakedTotalKEY = keyStakedTotal(lpAssetIdStr)
705692 let claimedByUserKEY = keyClaimedByUser(lpAssetIdStr, userAddressStr)
706693 let claimedByUserMinRewardKEY = keyClaimedByUserMinReward(lpAssetIdStr, userAddressStr)
707694 let stakedByUser = readStaked(stakedByUserKEY)
708695 let stakedTotal = readStaked(stakedTotalKEY)
709696 let claimedByUser = getBigIntFromStringOrZero(this, claimedByUserKEY)
710697 let claimedByUserMinReward = getBigIntFromStringOrZero(this, claimedByUserMinRewardKEY)
711698 let poolAddressStr = getStringByAddressOrFail(factoryContract, keyFactoryLpAssetToPoolContractAddress(lpAssetIdStr))
712699 let poolWeight = getIntegerValue(factoryContract, keyFactoryPoolWeight(poolAddressStr))
713700 let wxEmissionPerBlock = getIntOrFail(emissionContract, keyEmissionRatePerBlockCurrent())
714701 let emissionStartBlock = getIntOrFail(emissionContract, keyEmissionStartBlock())
715702 let passedBlocks = if ((emissionStartBlock > height))
716703 then 0
717704 else (height - emissionStartBlock)
718705 let poolWxEmission = fraction((wxEmissionPerBlock * passedBlocks), poolWeight, POOLWEIGHTMULT)
719706 let userWxReward = fraction(poolWxEmission, stakedByUser, stakedTotal)
720- let $t02926929381 = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, 0)
721- let wxToClaimUserNew = $t02926929381._1
722- let integralSTATE = $t02926929381._2
723- let debug = $t02926929381._3
707+ let $t02903729149 = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, 0)
708+ let wxToClaimUserNew = $t02903729149._1
709+ let integralSTATE = $t02903729149._2
710+ let debug = $t02903729149._3
724711 let availableToClaim = max([(wxToClaimUserNew - claimedByUserMinReward), zeroBigInt])
725712 let boostInvResult = asAnyList(invoke(boostingContract, "claimWxBoostREADONLY", [lpAssetIdStr, userAddressStr], nil))
726713 let wxAmountBoostTotal = max([asInt(boostInvResult[0]), 0])
727714 let boostDebug = asString(boostInvResult[1])
728715 let minRewardPart = availableToClaim
729- let boostRewardPart = min([(minRewardPart * toBigInt((boostCoeff - 1))), toBigInt(wxAmountBoostTotal)])
716+ let boostRewardPart = min([(minRewardPart * toBigInt(2)), toBigInt(wxAmountBoostTotal)])
730717 let totalReward = (minRewardPart + boostRewardPart)
731718 $Tuple2(nil, makeString(["%s%s%d%d%d%d%s", lpAssetIdStr, userAddressStr, toString(totalReward), toString(claimedByUser), toString(minRewardPart), toString(boostRewardPart), "soon"], SEP))
732719 }
733720
734721
735722
736723 @Callable(i)
737724 func stakedByUserREADONLY (lpAssetIdStr,userAddressStr) = {
738725 let stakedByUser = valueOrElse(getInteger(keyStakedByUser(userAddressStr, lpAssetIdStr)), 0)
739726 $Tuple2(nil, stakedByUser)
740727 }
741728
742729
743730
744731 @Callable(i)
745732 func usersListTraversal (lpAssetId) = {
746733 let checkCaller = if ((toBase58String(i.caller.bytes) == valueOrElse(getString(this, keyVotingEmissionContract()), "")))
747734 then true
748735 else mustManager(i)
749736 if ((checkCaller == checkCaller))
750737 then {
751738 let listName = getUsersListName(lpAssetId)
752739 let userOrUnit = getString(keyNextUser(lpAssetId))
753740 let headOrUnit = getString(keyListHead(listName))
754741 match userOrUnit {
755742 case _: Unit =>
756743 match headOrUnit {
757744 case _: Unit =>
758745 $Tuple2(nil, false)
759746 case head: String =>
760747 $Tuple2([StringEntry(keyNextUser(lpAssetId), head)], true)
761748 case _ =>
762749 throw("Match error")
763750 }
764751 case userAddress: String =>
765752 let claimedByUserMinReward = getBigIntFromStringOrZero(this, keyClaimedByUserMinReward(lpAssetId, userAddress))
766753 let poolAddress = getStringByAddressOrFail(factoryContract, keyFactoryLpAssetToPoolContractAddress(lpAssetId))
767754 let wxToClaimUserNew = refreshINTEGRALS(lpAssetId, userAddress, poolAddress, 0)._1
768755 let availableToClaim = (wxToClaimUserNew - claimedByUserMinReward)
769756 let throwIfNothingToClaim = true
770757 let r = if ((availableToClaim > zeroBigInt))
771758 then invoke(this, "claimWxINTERNAL", [lpAssetId, userAddress, throwIfNothingToClaim], nil)
772759 else unit
773760 if ((r == r))
774761 then {
775762 let nextUserOrUnit = getString(keyListNext(listName, userAddress))
776763 match nextUserOrUnit {
777764 case _: Unit =>
778765 $Tuple2([DeleteEntry(keyNextUser(lpAssetId))], false)
779766 case nextUser: String =>
780767 $Tuple2([StringEntry(keyNextUser(lpAssetId), nextUser)], true)
781768 case _ =>
782769 throw("Match error")
783770 }
784771 }
785772 else throw("Strict value is not equal to itself.")
786773 case _ =>
787774 throw("Match error")
788775 }
789776 }
790777 else throw("Strict value is not equal to itself.")
791778 }
792779
793780
794781
795782 @Callable(i)
796783 func onModifyWeight (lpAssetIdStr,poolAddressStr) = if ((i.caller != factoryContract))
797784 then throw("permissions denied")
798785 else {
799- let $t03200232112 = refreshPoolINTEGRALS(lpAssetIdStr, poolAddressStr, 0)
800- let wxPerLpIntegralNew = $t03200232112._1
801- let poolIntegralSTATE = $t03200232112._2
802- let poolDEBUG = $t03200232112._3
786+ let $t03175531865 = refreshPoolINTEGRALS(lpAssetIdStr, poolAddressStr, 0)
787+ let wxPerLpIntegralNew = $t03175531865._1
788+ let poolIntegralSTATE = $t03175531865._2
789+ let poolDEBUG = $t03175531865._3
803790 poolIntegralSTATE
804791 }
805792
806793
807794 @Verifier(tx)
808795 func verify () = {
809796 let targetPublicKey = match managerPublicKeyOrUnit() {
810797 case pk: ByteVector =>
811798 pk
812799 case _: Unit =>
813800 tx.senderPublicKey
814801 case _ =>
815802 throw("Match error")
816803 }
817804 sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey)
818805 }
819806

github/deemru/w8io/fabc49c 
91.07 ms