tx · 9Za78K3bfkzVWXaQKQrYtXcW7px1VidJ6D4uqWUues9t

3Mx3zmXrMcLFCafMuPtXAzR4ZPVeZYb6qLz:  -0.02400000 Waves

2023.03.22 14:28 [2501163] smart account 3Mx3zmXrMcLFCafMuPtXAzR4ZPVeZYb6qLz > SELF 0.00000000 Waves

{ "type": 13, "id": "9Za78K3bfkzVWXaQKQrYtXcW7px1VidJ6D4uqWUues9t", "fee": 2400000, "feeAssetId": null, "timestamp": 1679484568433, "version": 2, "chainId": 84, "sender": "3Mx3zmXrMcLFCafMuPtXAzR4ZPVeZYb6qLz", "senderPublicKey": "D28XoueZWsMfm8Y5pa6C5ZFuYoWgre2Wm8tzJANJgMnq", "proofs": [ "2KhFwYTrPsUdmAmSxLrRvUVeaWSPcDykpMgveDPo7CvBhmuRTVbwZYiSFEKDZtemVJvUL7KDDTn98ybEyeyrXUdK" ], "script": "base64:BgKfIAgCEgMKAQgSAwoBCBIDCgEIEgASABIDCgEIEgQKAggBEgYKBAIBAgISAwoBCBIDCgEIEgUKAwgIBBIGCgQBGAgYEgQKAhgIEgQKAggIEgQKAggIEgMKAQgSBAoCCAgiBlNDQUxFOCIFTVVMVDgiB1NDQUxFMTgiBk1VTFQxOCIDU0VQIg5QT09MV0VJR0hUTVVMVCIKemVyb0JpZ0ludCIJb25lQmlnSW50Igd3cmFwRXJyIgNtc2ciCHRocm93RXJyIglhc0FueUxpc3QiA3ZhbCIHJG1hdGNoMCIKdmFsQW55THlzdCIFYXNJbnQiBnZhbEludCIIYXNTdHJpbmciBnZhbFN0ciIMYXNCeXRlVmVjdG9yIgZ2YWxCaW4iD2dldFN0cmluZ09yRmFpbCIHYWRkcmVzcyIDa2V5IhhnZXRTdHJpbmdCeUFkZHJlc3NPckZhaWwiDGdldEludE9yWmVybyIPZ2V0SW50T3JEZWZhdWx0IgpkZWZhdWx0VmFsIgxnZXRJbnRPckZhaWwiGWdldEJpZ0ludEZyb21TdHJpbmdPclplcm8iHGdldEJpZ0ludEZy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lbGYuAmNsAQ5vbk1vZGlmeVdlaWdodAICYXQCYngDCQECIT0CCAUCY2wGY2FsbGVyBQJhWAkAAgECEnBlcm1pc3Npb25zIGRlbmllZAQCZEEJAQJidwMFAmF0BQJieAAABAJidQgFAmRBAl8xBAJiVwgFAmRBAl8yBAJiWAgFAmRBAl8zBQJiVwECZEIBAmRDAAQCZEQEAW4JAQJjaAADCQABAgUBbgIKQnl0ZVZlY3RvcgQCY24FAW4FAmNuAwkAAQIFAW4CBFVuaXQIBQJkQg9zZW5kZXJQdWJsaWNLZXkJAAIBAgtNYXRjaCBlcnJvcgkA9AMDCAUCZEIJYm9keUJ5dGVzCQCRAwIIBQJkQgZwcm9vZnMAAAUCZESGQCHD", "height": 2501163, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 81u6qPoJ8XVSpirSgLxZA66xiRiv5Q74QcSGGZWej4YY Next: 9JxSMqnTF4K1xVJVvHAD427YC3xQQwH68cGvbpzc5J7m 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)
425418 case _ =>
426419 throw("Match error")
427420 }
421+
422+
423+func stakeActions (i,lpAssetId,poolAddress,userAddress,amount) = {
424+ let userAddressStr = toString(userAddress)
425+ let lpAssetIdStr = toBase58String(lpAssetId)
426+ let poolAddressStr = toString(poolAddress)
427+ let stakedByUserKEY = keyStakedByUser(userAddressStr, lpAssetIdStr)
428+ let stakedTotalKEY = keyStakedTotal(lpAssetIdStr)
429+ let stakedByUser = readStaked(stakedByUserKEY)
430+ let refreshStakedVote = if ((stakedByUser == 0))
431+ then invoke(boostingContract, "onStakedVoteUpdate", [lpAssetIdStr, userAddressStr, true], nil)
432+ else unit
433+ if ((refreshStakedVote == refreshStakedVote))
434+ then {
435+ let stakedTotal = readStaked(stakedTotalKEY)
436+ let $t01810718224 = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, amount)
437+ let wxToClaimUserNew = $t01810718224._1
438+ let integralSTATE = $t01810718224._2
439+ let debug = $t01810718224._3
440+ let listName = getUsersListName(lpAssetIdStr)
441+ let listActions = if (containsNode(listName, userAddressStr))
442+ then nil
443+ else insertNodeActions(listName, userAddressStr)
444+ (([IntegerEntry(stakedByUserKEY, (stakedByUser + amount)), IntegerEntry(stakedTotalKEY, (stakedTotal + amount)), OperationHistoryEntry("stake", userAddressStr, lpAssetIdStr, amount, i.transactionId)] ++ integralSTATE) ++ listActions)
445+ }
446+ else throw("Strict value is not equal to itself.")
447+ }
428448
429449
430450 func unstakeActions (i,lpAssetId,poolAddress,userAddress,lpAssetRecipientAddress,amount) = {
530550 let lpAssetIdStr = toBase58String(lpAssetId)
531551 let amount = pmt.amount
532552 let poolAddressStr = valueOrErrorMessage(getString(factoryContract, keyFactoryLp2AssetsMapping(lpAssetIdStr)), ("unsupported lp asset " + lpAssetIdStr))
533- let callerStr = toString(i.caller)
534- let userAddressStr = if ((callerStr == poolAddressStr))
535- then toString(i.originCaller)
536- else callerStr
537- let stakedByUserKEY = keyStakedByUser(userAddressStr, lpAssetIdStr)
538- let stakedTotalKEY = keyStakedTotal(lpAssetIdStr)
539- let stakedByUser = readStaked(stakedByUserKEY)
540- let refreshStakedVote = if ((stakedByUser == 0))
541- then invoke(boostingContract, "onStakedVoteUpdate", [lpAssetIdStr, userAddressStr, true], nil)
542- else unit
543- if ((refreshStakedVote == refreshStakedVote))
544- then {
545- 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
550- let listName = getUsersListName(lpAssetIdStr)
551- let listActions = if (containsNode(listName, userAddressStr))
552- then nil
553- else insertNodeActions(listName, userAddressStr)
554- (([IntegerEntry(stakedByUserKEY, (stakedByUser + amount)), IntegerEntry(stakedTotalKEY, (stakedTotal + amount)), OperationHistoryEntry("stake", userAddressStr, lpAssetIdStr, amount, i.transactionId)] ++ integralSTATE) ++ listActions)
555- }
556- else throw("Strict value is not equal to itself.")
553+ let poolAddress = addressFromStringValue(poolAddressStr)
554+ let userAddress = if ((i.caller == poolAddress))
555+ then i.originCaller
556+ else i.caller
557+ stakeActions(i, lpAssetId, poolAddress, userAddress, amount)
558+ }
559+
560+
561+
562+@Callable(i)
563+func stakeFor (userAddressStr) = if ((size(i.payments) != 1))
564+ then throw("invalid payment - exact one payment must be attached")
565+ else {
566+ let pmt = i.payments[0]
567+ let lpAssetId = value(pmt.assetId)
568+ let lpAssetIdStr = toBase58String(lpAssetId)
569+ let amount = pmt.amount
570+ let poolAddressStr = valueOrErrorMessage(getString(factoryContract, keyFactoryLp2AssetsMapping(lpAssetIdStr)), ("unsupported lp asset " + lpAssetIdStr))
571+ let poolAddress = addressFromStringValue(poolAddressStr)
572+ let userAddress = valueOrErrorMessage(addressFromString(userAddressStr), wrapErr("invalid user address"))
573+ stakeActions(i, lpAssetId, poolAddress, userAddress, amount)
557574 }
558575
559576
625642 let claimedByUserMinReward = getBigIntFromStringOrZero(this, claimedByUserMinRewardKEY)
626643 let claimedByUserBoostReward = getBigIntFromStringOrZero(this, claimedByUserBoostRewardKEY)
627644 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
645+ let $t02618626298 = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, 0)
646+ let wxToClaimUserNew = $t02618626298._1
647+ let integralSTATE = $t02618626298._2
648+ let debug = $t02618626298._3
632649 let availableToClaim = max([(wxToClaimUserNew - claimedByUserMinReward), zeroBigInt])
633650 if ((zeroBigInt >= availableToClaim))
634651 then if (throwIfNothingToClaim)
637654 else {
638655 let wxAmountBoostTotal = max([asInt(asAnyList(invoke(boostingContract, "claimWxBoost", [lpAssetIdStr, userAddressStr], nil))[0]), 0])
639656 let minRewardPart = availableToClaim
640- let boostRewardPart = min([(minRewardPart * toBigInt((boostCoeff - 1))), toBigInt(wxAmountBoostTotal)])
657+ let boostRewardPart = min([(minRewardPart * toBigInt(2)), toBigInt(wxAmountBoostTotal)])
641658 let totalReward = (minRewardPart + boostRewardPart)
642659 let wxAssetId = asByteVector(asAnyList(invoke(emissionContract, "emit", [toInt(minRewardPart)], nil))[0])
643660 let emitBoost = asAnyList(invoke(emissionContract, "emit", [toInt(boostRewardPart)], nil))
670687 }, SEP)
671688 let unclaimed = info[3]
672689 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))
690+ let res = (resAcc :+ makeString(["%d%d", unclaimed, claimed], SEP))
680691 let inv = {
681692 let @ = invoke(this, "claimWxBulkInternalREADONLY", [(currentIter + 1), lpAssetIds, userAddressStr, res], nil)
682693 if ($isInstanceOf(@, "List[Any]"))
717728 else (height - emissionStartBlock)
718729 let poolWxEmission = fraction((wxEmissionPerBlock * passedBlocks), poolWeight, POOLWEIGHTMULT)
719730 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
731+ let $t03010730219 = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, 0)
732+ let wxToClaimUserNew = $t03010730219._1
733+ let integralSTATE = $t03010730219._2
734+ let debug = $t03010730219._3
724735 let availableToClaim = max([(wxToClaimUserNew - claimedByUserMinReward), zeroBigInt])
725736 let boostInvResult = asAnyList(invoke(boostingContract, "claimWxBoostREADONLY", [lpAssetIdStr, userAddressStr], nil))
726737 let wxAmountBoostTotal = max([asInt(boostInvResult[0]), 0])
727738 let boostDebug = asString(boostInvResult[1])
728739 let minRewardPart = availableToClaim
729- let boostRewardPart = min([(minRewardPart * toBigInt((boostCoeff - 1))), toBigInt(wxAmountBoostTotal)])
740+ let boostRewardPart = min([(minRewardPart * toBigInt(2)), toBigInt(wxAmountBoostTotal)])
730741 let totalReward = (minRewardPart + boostRewardPart)
731742 $Tuple2(nil, makeString(["%s%s%d%d%d%d%s", lpAssetIdStr, userAddressStr, toString(totalReward), toString(claimedByUser), toString(minRewardPart), toString(boostRewardPart), "soon"], SEP))
732743 }
796807 func onModifyWeight (lpAssetIdStr,poolAddressStr) = if ((i.caller != factoryContract))
797808 then throw("permissions denied")
798809 else {
799- let $t03200232112 = refreshPoolINTEGRALS(lpAssetIdStr, poolAddressStr, 0)
800- let wxPerLpIntegralNew = $t03200232112._1
801- let poolIntegralSTATE = $t03200232112._2
802- let poolDEBUG = $t03200232112._3
810+ let $t03282532935 = refreshPoolINTEGRALS(lpAssetIdStr, poolAddressStr, 0)
811+ let wxPerLpIntegralNew = $t03282532935._1
812+ let poolIntegralSTATE = $t03282532935._2
813+ let poolDEBUG = $t03282532935._3
803814 poolIntegralSTATE
804815 }
805816
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 }
421+
422+
423+func stakeActions (i,lpAssetId,poolAddress,userAddress,amount) = {
424+ let userAddressStr = toString(userAddress)
425+ let lpAssetIdStr = toBase58String(lpAssetId)
426+ let poolAddressStr = toString(poolAddress)
427+ let stakedByUserKEY = keyStakedByUser(userAddressStr, lpAssetIdStr)
428+ let stakedTotalKEY = keyStakedTotal(lpAssetIdStr)
429+ let stakedByUser = readStaked(stakedByUserKEY)
430+ let refreshStakedVote = if ((stakedByUser == 0))
431+ then invoke(boostingContract, "onStakedVoteUpdate", [lpAssetIdStr, userAddressStr, true], nil)
432+ else unit
433+ if ((refreshStakedVote == refreshStakedVote))
434+ then {
435+ let stakedTotal = readStaked(stakedTotalKEY)
436+ let $t01810718224 = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, amount)
437+ let wxToClaimUserNew = $t01810718224._1
438+ let integralSTATE = $t01810718224._2
439+ let debug = $t01810718224._3
440+ let listName = getUsersListName(lpAssetIdStr)
441+ let listActions = if (containsNode(listName, userAddressStr))
442+ then nil
443+ else insertNodeActions(listName, userAddressStr)
444+ (([IntegerEntry(stakedByUserKEY, (stakedByUser + amount)), IntegerEntry(stakedTotalKEY, (stakedTotal + amount)), OperationHistoryEntry("stake", userAddressStr, lpAssetIdStr, amount, i.transactionId)] ++ integralSTATE) ++ listActions)
445+ }
446+ else throw("Strict value is not equal to itself.")
447+ }
428448
429449
430450 func unstakeActions (i,lpAssetId,poolAddress,userAddress,lpAssetRecipientAddress,amount) = {
431451 let userAddressStr = toString(userAddress)
432452 let lpAssetIdStr = toBase58String(lpAssetId)
433453 let poolAddressStr = toString(poolAddress)
434454 let stakedByUserKEY = keyStakedByUser(userAddressStr, lpAssetIdStr)
435455 let stakedTotalKEY = keyStakedTotal(lpAssetIdStr)
436456 let stakedByUser = readStaked(stakedByUserKEY)
437457 let stakedTotal = readStaked(stakedTotalKEY)
438458 let integralSTATE = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, -(amount))._2
439459 let listName = getUsersListName(lpAssetIdStr)
440460 let listActions = if (if (containsNode(listName, userAddressStr))
441461 then (amount == stakedByUser)
442462 else false)
443463 then deleteNodeActions(listName, userAddressStr)
444464 else nil
445465 let refreshStakedVote = if ((amount == stakedByUser))
446466 then invoke(boostingContract, "onStakedVoteUpdate", [lpAssetIdStr, userAddressStr, false], nil)
447467 else unit
448468 if ((refreshStakedVote == refreshStakedVote))
449469 then {
450470 let claimedByUserMinReward = getBigIntFromStringOrZero(this, keyClaimedByUserMinReward(lpAssetIdStr, userAddressStr))
451471 let wxToClaimUserNew = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, 0)._1
452472 let availableToClaim = (wxToClaimUserNew - claimedByUserMinReward)
453473 let throwIfNothingToClaim = true
454474 let r = if ((availableToClaim > zeroBigInt))
455475 then invoke(this, "claimWxINTERNAL", [lpAssetIdStr, userAddressStr, throwIfNothingToClaim], nil)
456476 else unit
457477 if ((r == r))
458478 then if ((amount > stakedByUser))
459479 then throw(((((((("passed amount=" + toString(amount)) + " is greater than available=") + toString(stakedByUser)) + ". lpAssetId=") + lpAssetIdStr) + ". stakedByUserKEY=") + stakedByUserKEY))
460480 else (([IntegerEntry(stakedByUserKEY, (stakedByUser - amount)), IntegerEntry(stakedTotalKEY, (stakedTotal - amount)), ScriptTransfer(lpAssetRecipientAddress, amount, lpAssetId), OperationHistoryEntry("unstake", userAddressStr, lpAssetIdStr, amount, i.transactionId)] ++ integralSTATE) ++ listActions)
461481 else throw("Strict value is not equal to itself.")
462482 }
463483 else throw("Strict value is not equal to itself.")
464484 }
465485
466486
467487 @Callable(i)
468488 func constructor (factoryAddressStr) = {
469489 let checkCaller = mustManager(i)
470490 if ((checkCaller == checkCaller))
471491 then [StringEntry(keyFactoryAddress(), factoryAddressStr)]
472492 else throw("Strict value is not equal to itself.")
473493 }
474494
475495
476496
477497 @Callable(i)
478498 func constructorV2 (votingEmissionContract) = {
479499 let cheks = [mustManager(i), if ((addressFromString(votingEmissionContract) != unit))
480500 then true
481501 else "invalid voting emission contract address"]
482502 if ((cheks == cheks))
483503 then [StringEntry(keyVotingEmissionContract(), votingEmissionContract)]
484504 else throw("Strict value is not equal to itself.")
485505 }
486506
487507
488508
489509 @Callable(i)
490510 func setManager (pendingManagerPublicKey) = {
491511 let checkCaller = mustManager(i)
492512 if ((checkCaller == checkCaller))
493513 then {
494514 let checkManagerPublicKey = fromBase58String(pendingManagerPublicKey)
495515 if ((checkManagerPublicKey == checkManagerPublicKey))
496516 then [StringEntry(keyPendingManagerPublicKey(), pendingManagerPublicKey)]
497517 else throw("Strict value is not equal to itself.")
498518 }
499519 else throw("Strict value is not equal to itself.")
500520 }
501521
502522
503523
504524 @Callable(i)
505525 func confirmManager () = {
506526 let pm = pendingManagerPublicKeyOrUnit()
507527 let hasPM = if (isDefined(pm))
508528 then true
509529 else throw("No pending manager")
510530 if ((hasPM == hasPM))
511531 then {
512532 let checkPM = if ((i.callerPublicKey == value(pm)))
513533 then true
514534 else throw("You are not pending manager")
515535 if ((checkPM == checkPM))
516536 then [StringEntry(keyManagerPublicKey(), toBase58String(value(pm))), DeleteEntry(keyPendingManagerPublicKey())]
517537 else throw("Strict value is not equal to itself.")
518538 }
519539 else throw("Strict value is not equal to itself.")
520540 }
521541
522542
523543
524544 @Callable(i)
525545 func stake () = if ((size(i.payments) != 1))
526546 then throw("invalid payment - exact one payment must be attached")
527547 else {
528548 let pmt = i.payments[0]
529549 let lpAssetId = value(pmt.assetId)
530550 let lpAssetIdStr = toBase58String(lpAssetId)
531551 let amount = pmt.amount
532552 let poolAddressStr = valueOrErrorMessage(getString(factoryContract, keyFactoryLp2AssetsMapping(lpAssetIdStr)), ("unsupported lp asset " + lpAssetIdStr))
533- let callerStr = toString(i.caller)
534- let userAddressStr = if ((callerStr == poolAddressStr))
535- then toString(i.originCaller)
536- else callerStr
537- let stakedByUserKEY = keyStakedByUser(userAddressStr, lpAssetIdStr)
538- let stakedTotalKEY = keyStakedTotal(lpAssetIdStr)
539- let stakedByUser = readStaked(stakedByUserKEY)
540- let refreshStakedVote = if ((stakedByUser == 0))
541- then invoke(boostingContract, "onStakedVoteUpdate", [lpAssetIdStr, userAddressStr, true], nil)
542- else unit
543- if ((refreshStakedVote == refreshStakedVote))
544- then {
545- 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
550- let listName = getUsersListName(lpAssetIdStr)
551- let listActions = if (containsNode(listName, userAddressStr))
552- then nil
553- else insertNodeActions(listName, userAddressStr)
554- (([IntegerEntry(stakedByUserKEY, (stakedByUser + amount)), IntegerEntry(stakedTotalKEY, (stakedTotal + amount)), OperationHistoryEntry("stake", userAddressStr, lpAssetIdStr, amount, i.transactionId)] ++ integralSTATE) ++ listActions)
555- }
556- else throw("Strict value is not equal to itself.")
553+ let poolAddress = addressFromStringValue(poolAddressStr)
554+ let userAddress = if ((i.caller == poolAddress))
555+ then i.originCaller
556+ else i.caller
557+ stakeActions(i, lpAssetId, poolAddress, userAddress, amount)
558+ }
559+
560+
561+
562+@Callable(i)
563+func stakeFor (userAddressStr) = if ((size(i.payments) != 1))
564+ then throw("invalid payment - exact one payment must be attached")
565+ else {
566+ let pmt = i.payments[0]
567+ let lpAssetId = value(pmt.assetId)
568+ let lpAssetIdStr = toBase58String(lpAssetId)
569+ let amount = pmt.amount
570+ let poolAddressStr = valueOrErrorMessage(getString(factoryContract, keyFactoryLp2AssetsMapping(lpAssetIdStr)), ("unsupported lp asset " + lpAssetIdStr))
571+ let poolAddress = addressFromStringValue(poolAddressStr)
572+ let userAddress = valueOrErrorMessage(addressFromString(userAddressStr), wrapErr("invalid user address"))
573+ stakeActions(i, lpAssetId, poolAddress, userAddress, amount)
557574 }
558575
559576
560577
561578 @Callable(i)
562579 func unstake (lpAssetIdStr,amount) = {
563580 let lpAssetId = fromBase58String(lpAssetIdStr)
564581 let poolAddressStr = valueOrErrorMessage(getString(factoryContract, keyFactoryLp2AssetsMapping(lpAssetIdStr)), ("unsupported lp asset " + lpAssetIdStr))
565582 let poolAddress = addressFromStringValue(poolAddressStr)
566583 let poolAddon = valueOrElse(getString(poolAddress, keyAddonAddr()), poolAddressStr)
567584 let callerStr = toString(i.caller)
568585 let userAddress = if (if ((callerStr == poolAddressStr))
569586 then true
570587 else (callerStr == poolAddon))
571588 then i.originCaller
572589 else i.caller
573590 let lpAssetRecipientAddress = i.caller
574591 unstakeActions(i, lpAssetId, poolAddress, userAddress, lpAssetRecipientAddress, amount)
575592 }
576593
577594
578595
579596 @Callable(i)
580597 func unstakeINTERNAL (lpAssetId,amount,userAddress,lpAssetRecipientAddress) = {
581598 let lpAssetIdStr = toBase58String(lpAssetId)
582599 let poolAddress = addressFromStringValue(valueOrErrorMessage(getString(factoryContract, keyFactoryLp2AssetsMapping(lpAssetIdStr)), ("unsupported lp asset " + lpAssetIdStr)))
583600 let checkCaller = if ((i.caller == poolAddress))
584601 then true
585602 else permissionDeniedError
586603 if ((checkCaller == checkCaller))
587604 then unstakeActions(i, lpAssetId, poolAddress, Address(userAddress), Address(lpAssetRecipientAddress), amount)
588605 else throw("Strict value is not equal to itself.")
589606 }
590607
591608
592609
593610 @Callable(i)
594611 func claimWx (lpAssetIdStr) = {
595612 let userAddressStr = toString(i.caller)
596613 let throwIfNothingToClaim = true
597614 let result = invoke(this, "claimWxINTERNAL", [lpAssetIdStr, userAddressStr, throwIfNothingToClaim], nil)
598615 $Tuple2(nil, result)
599616 }
600617
601618
602619
603620 @Callable(i)
604621 func claimWxDoNotThrow (lpAssetIdStr) = {
605622 let userAddressStr = toString(i.caller)
606623 let throwIfNothingToClaim = false
607624 let result = invoke(this, "claimWxINTERNAL", [lpAssetIdStr, userAddressStr, throwIfNothingToClaim], nil)
608625 $Tuple2(nil, result)
609626 }
610627
611628
612629
613630 @Callable(i)
614631 func claimWxINTERNAL (lpAssetIdStr,userAddressStr,throwIfNothingToClaim) = {
615632 let checkCaller = mustThis(i)
616633 if ((checkCaller == checkCaller))
617634 then {
618635 let userAddress = valueOrErrorMessage(addressFromString(userAddressStr), "claimWxINTERNAL: invalid user address")
619636 let poolAddressStr = getStringByAddressOrFail(factoryContract, keyFactoryLpAssetToPoolContractAddress(lpAssetIdStr))
620637 let claimedByUserKEY = keyClaimedByUser(lpAssetIdStr, userAddressStr)
621638 let claimedTotalKEY = keyClaimedTotal(lpAssetIdStr)
622639 let claimedByUserMinRewardKEY = keyClaimedByUserMinReward(lpAssetIdStr, userAddressStr)
623640 let claimedByUserBoostRewardKEY = keyClaimedByUserBoostReward(lpAssetIdStr, userAddressStr)
624641 let claimedByUser = getBigIntFromStringOrZero(this, claimedByUserKEY)
625642 let claimedByUserMinReward = getBigIntFromStringOrZero(this, claimedByUserMinRewardKEY)
626643 let claimedByUserBoostReward = getBigIntFromStringOrZero(this, claimedByUserBoostRewardKEY)
627644 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
645+ let $t02618626298 = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, 0)
646+ let wxToClaimUserNew = $t02618626298._1
647+ let integralSTATE = $t02618626298._2
648+ let debug = $t02618626298._3
632649 let availableToClaim = max([(wxToClaimUserNew - claimedByUserMinReward), zeroBigInt])
633650 if ((zeroBigInt >= availableToClaim))
634651 then if (throwIfNothingToClaim)
635652 then throw("nothing to claim")
636653 else $Tuple2(nil, 0)
637654 else {
638655 let wxAmountBoostTotal = max([asInt(asAnyList(invoke(boostingContract, "claimWxBoost", [lpAssetIdStr, userAddressStr], nil))[0]), 0])
639656 let minRewardPart = availableToClaim
640- let boostRewardPart = min([(minRewardPart * toBigInt((boostCoeff - 1))), toBigInt(wxAmountBoostTotal)])
657+ let boostRewardPart = min([(minRewardPart * toBigInt(2)), toBigInt(wxAmountBoostTotal)])
641658 let totalReward = (minRewardPart + boostRewardPart)
642659 let wxAssetId = asByteVector(asAnyList(invoke(emissionContract, "emit", [toInt(minRewardPart)], nil))[0])
643660 let emitBoost = asAnyList(invoke(emissionContract, "emit", [toInt(boostRewardPart)], nil))
644661 if ((emitBoost == emitBoost))
645662 then {
646663 let claimedByUserValue = ((claimedByUser + minRewardPart) + boostRewardPart)
647664 let claimedByUserMinRewardPlusPart = (claimedByUserMinReward + minRewardPart)
648665 let claimedByUserBoostRewardPlusBoostRewardPart = (claimedByUserBoostReward + boostRewardPart)
649666 let claimedTotalPlusAvailableToClaim = (claimedTotal + availableToClaim)
650667 $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))
651668 }
652669 else throw("Strict value is not equal to itself.")
653670 }
654671 }
655672 else throw("Strict value is not equal to itself.")
656673 }
657674
658675
659676
660677 @Callable(i)
661678 func claimWxBulkInternalREADONLY (currentIter,lpAssetIds,userAddressStr,resAcc) = if ((currentIter == size(lpAssetIds)))
662679 then $Tuple2(nil, resAcc)
663680 else {
664681 let lpAssetId = lpAssetIds[currentIter]
665682 let info = split({
666683 let @ = invoke(this, "claimWxREADONLY", [lpAssetId, userAddressStr], nil)
667684 if ($isInstanceOf(@, "String"))
668685 then @
669686 else throw(($getType(@) + " couldn't be cast to String"))
670687 }, SEP)
671688 let unclaimed = info[3]
672689 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))
690+ let res = (resAcc :+ makeString(["%d%d", unclaimed, claimed], SEP))
680691 let inv = {
681692 let @ = invoke(this, "claimWxBulkInternalREADONLY", [(currentIter + 1), lpAssetIds, userAddressStr, res], nil)
682693 if ($isInstanceOf(@, "List[Any]"))
683694 then @
684695 else throw(($getType(@) + " couldn't be cast to List[Any]"))
685696 }
686697 if ((inv == inv))
687698 then $Tuple2(nil, inv)
688699 else throw("Strict value is not equal to itself.")
689700 }
690701
691702
692703
693704 @Callable(i)
694705 func claimWxBulkREADONLY (lpAssetIds,userAddressStr) = {
695706 let res = invoke(this, "claimWxBulkInternalREADONLY", [0, lpAssetIds, userAddressStr, nil], nil)
696707 $Tuple2(nil, res)
697708 }
698709
699710
700711
701712 @Callable(i)
702713 func claimWxREADONLY (lpAssetIdStr,userAddressStr) = {
703714 let stakedByUserKEY = keyStakedByUser(userAddressStr, lpAssetIdStr)
704715 let stakedTotalKEY = keyStakedTotal(lpAssetIdStr)
705716 let claimedByUserKEY = keyClaimedByUser(lpAssetIdStr, userAddressStr)
706717 let claimedByUserMinRewardKEY = keyClaimedByUserMinReward(lpAssetIdStr, userAddressStr)
707718 let stakedByUser = readStaked(stakedByUserKEY)
708719 let stakedTotal = readStaked(stakedTotalKEY)
709720 let claimedByUser = getBigIntFromStringOrZero(this, claimedByUserKEY)
710721 let claimedByUserMinReward = getBigIntFromStringOrZero(this, claimedByUserMinRewardKEY)
711722 let poolAddressStr = getStringByAddressOrFail(factoryContract, keyFactoryLpAssetToPoolContractAddress(lpAssetIdStr))
712723 let poolWeight = getIntegerValue(factoryContract, keyFactoryPoolWeight(poolAddressStr))
713724 let wxEmissionPerBlock = getIntOrFail(emissionContract, keyEmissionRatePerBlockCurrent())
714725 let emissionStartBlock = getIntOrFail(emissionContract, keyEmissionStartBlock())
715726 let passedBlocks = if ((emissionStartBlock > height))
716727 then 0
717728 else (height - emissionStartBlock)
718729 let poolWxEmission = fraction((wxEmissionPerBlock * passedBlocks), poolWeight, POOLWEIGHTMULT)
719730 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
731+ let $t03010730219 = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, 0)
732+ let wxToClaimUserNew = $t03010730219._1
733+ let integralSTATE = $t03010730219._2
734+ let debug = $t03010730219._3
724735 let availableToClaim = max([(wxToClaimUserNew - claimedByUserMinReward), zeroBigInt])
725736 let boostInvResult = asAnyList(invoke(boostingContract, "claimWxBoostREADONLY", [lpAssetIdStr, userAddressStr], nil))
726737 let wxAmountBoostTotal = max([asInt(boostInvResult[0]), 0])
727738 let boostDebug = asString(boostInvResult[1])
728739 let minRewardPart = availableToClaim
729- let boostRewardPart = min([(minRewardPart * toBigInt((boostCoeff - 1))), toBigInt(wxAmountBoostTotal)])
740+ let boostRewardPart = min([(minRewardPart * toBigInt(2)), toBigInt(wxAmountBoostTotal)])
730741 let totalReward = (minRewardPart + boostRewardPart)
731742 $Tuple2(nil, makeString(["%s%s%d%d%d%d%s", lpAssetIdStr, userAddressStr, toString(totalReward), toString(claimedByUser), toString(minRewardPart), toString(boostRewardPart), "soon"], SEP))
732743 }
733744
734745
735746
736747 @Callable(i)
737748 func stakedByUserREADONLY (lpAssetIdStr,userAddressStr) = {
738749 let stakedByUser = valueOrElse(getInteger(keyStakedByUser(userAddressStr, lpAssetIdStr)), 0)
739750 $Tuple2(nil, stakedByUser)
740751 }
741752
742753
743754
744755 @Callable(i)
745756 func usersListTraversal (lpAssetId) = {
746757 let checkCaller = if ((toBase58String(i.caller.bytes) == valueOrElse(getString(this, keyVotingEmissionContract()), "")))
747758 then true
748759 else mustManager(i)
749760 if ((checkCaller == checkCaller))
750761 then {
751762 let listName = getUsersListName(lpAssetId)
752763 let userOrUnit = getString(keyNextUser(lpAssetId))
753764 let headOrUnit = getString(keyListHead(listName))
754765 match userOrUnit {
755766 case _: Unit =>
756767 match headOrUnit {
757768 case _: Unit =>
758769 $Tuple2(nil, false)
759770 case head: String =>
760771 $Tuple2([StringEntry(keyNextUser(lpAssetId), head)], true)
761772 case _ =>
762773 throw("Match error")
763774 }
764775 case userAddress: String =>
765776 let claimedByUserMinReward = getBigIntFromStringOrZero(this, keyClaimedByUserMinReward(lpAssetId, userAddress))
766777 let poolAddress = getStringByAddressOrFail(factoryContract, keyFactoryLpAssetToPoolContractAddress(lpAssetId))
767778 let wxToClaimUserNew = refreshINTEGRALS(lpAssetId, userAddress, poolAddress, 0)._1
768779 let availableToClaim = (wxToClaimUserNew - claimedByUserMinReward)
769780 let throwIfNothingToClaim = true
770781 let r = if ((availableToClaim > zeroBigInt))
771782 then invoke(this, "claimWxINTERNAL", [lpAssetId, userAddress, throwIfNothingToClaim], nil)
772783 else unit
773784 if ((r == r))
774785 then {
775786 let nextUserOrUnit = getString(keyListNext(listName, userAddress))
776787 match nextUserOrUnit {
777788 case _: Unit =>
778789 $Tuple2([DeleteEntry(keyNextUser(lpAssetId))], false)
779790 case nextUser: String =>
780791 $Tuple2([StringEntry(keyNextUser(lpAssetId), nextUser)], true)
781792 case _ =>
782793 throw("Match error")
783794 }
784795 }
785796 else throw("Strict value is not equal to itself.")
786797 case _ =>
787798 throw("Match error")
788799 }
789800 }
790801 else throw("Strict value is not equal to itself.")
791802 }
792803
793804
794805
795806 @Callable(i)
796807 func onModifyWeight (lpAssetIdStr,poolAddressStr) = if ((i.caller != factoryContract))
797808 then throw("permissions denied")
798809 else {
799- let $t03200232112 = refreshPoolINTEGRALS(lpAssetIdStr, poolAddressStr, 0)
800- let wxPerLpIntegralNew = $t03200232112._1
801- let poolIntegralSTATE = $t03200232112._2
802- let poolDEBUG = $t03200232112._3
810+ let $t03282532935 = refreshPoolINTEGRALS(lpAssetIdStr, poolAddressStr, 0)
811+ let wxPerLpIntegralNew = $t03282532935._1
812+ let poolIntegralSTATE = $t03282532935._2
813+ let poolDEBUG = $t03282532935._3
803814 poolIntegralSTATE
804815 }
805816
806817
807818 @Verifier(tx)
808819 func verify () = {
809820 let targetPublicKey = match managerPublicKeyOrUnit() {
810821 case pk: ByteVector =>
811822 pk
812823 case _: Unit =>
813824 tx.senderPublicKey
814825 case _ =>
815826 throw("Match error")
816827 }
817828 sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey)
818829 }
819830

github/deemru/w8io/026f985 
89.99 ms