tx · 81u6qPoJ8XVSpirSgLxZA66xiRiv5Q74QcSGGZWej4YY

3Mx3zmXrMcLFCafMuPtXAzR4ZPVeZYb6qLz:  -0.02300000 Waves

2023.03.22 13:34 [2501115] smart account 3Mx3zmXrMcLFCafMuPtXAzR4ZPVeZYb6qLz > SELF 0.00000000 Waves

{ "type": 13, "id": "81u6qPoJ8XVSpirSgLxZA66xiRiv5Q74QcSGGZWej4YY", "fee": 2300000, "feeAssetId": null, "timestamp": 1679481260570, "version": 2, "chainId": 84, "sender": "3Mx3zmXrMcLFCafMuPtXAzR4ZPVeZYb6qLz", "senderPublicKey": "D28XoueZWsMfm8Y5pa6C5ZFuYoWgre2Wm8tzJANJgMnq", "proofs": [ "4saU6TEe4ujXnwucCtXyNzKePHJMdfWaLAYF3HuPkpAUAUSsQRQwtueSKa5VKeJUAwGX7k2DLkJyEv6redMrBTD9" ], "script": "base64:BgKrIAgCEgMKAQgSAwoBCBIDCgEIEgASABIECgIIARIGCgQCAQICEgMKAQgSAwoBCBIFCgMICAQSBgoEARgIGBIECgIYCBIECgIICBIECgIICBIDCgEIEgQKAggIIgZTQ0FMRTgiBU1VTFQzIgVNVUxUOCIHU0NBTEUxOCIGTVVMVDE4IgNTRVAiDlBPT0xXRUlHSFRNVUxUIgp6ZXJvQmlnSW50IglvbmVCaWdJbnQiB3dyYXBFcnIiA21zZyIIdGhyb3dFcnIiCWFzQW55TGlzdCIDdmFsIgckbWF0Y2gwIgp2YWxBbnlMeXN0IgVhc0ludCIGdmFsSW50Ighhc1N0cmluZyIGdmFsU3RyIgxhc0J5dGVWZWN0b3IiBnZhbEJpbiIPZ2V0U3RyaW5nT3JGYWlsIgdhZGRyZXNzIgNrZXkiGGdldFN0cmluZ0J5QWRkcmVzc09yRmFpbCIMZ2V0SW50T3JaZXJvIg9nZXRJbnRPckRlZmF1bHQiCmRlZmF1bHRWYWwiDGdldEludE9yRmFpbCIZZ2V0QmlnSW50RnJvbVN0cmluZ09yWmVybyIcZ2V0Qm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AAMJAAECBQFvAgpCeXRlVmVjdG9yBAJjcAUBbwUCY3ADCQABAgUBbwIEVW5pdAgFAmRDD3NlbmRlclB1YmxpY0tleQkAAgECC01hdGNoIGVycm9yCQD0AwMIBQJkQwlib2R5Qnl0ZXMJAJEDAggFAmRDBnByb29mcwAABQJkRQFUL/M=", "height": 2501115, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: HKPBNP3EevoYn6Aq6yDXHvL7HRWV69AAN62HwtSX4wgD Next: 9Za78K3bfkzVWXaQKQrYtXcW7px1VidJ6D4uqWUues9t Diff:
OldNewDifferences
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let SCALE8 = 8
5+
6+let MULT3 = 1000
57
68 let MULT8 = 100000000
79
245247
246248 let boostingContract = getBoostingAddressOrFail(factoryCfg)
247249
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+
248257 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"))
249258
250259 func keyNextUser (lpAssetId) = makeString(["%s%s", lpAssetId, "nextUser"], SEP)
331340 else stakedTotal
332341 let poolWeight = getIntegerValue(factoryContract, keyFactoryPoolWeight(poolAddressStr))
333342 let emissionStartBlock = getIntOrFail(emissionContract, keyEmissionStartBlock())
334- let MULT3 = 1000
335343 let wxEmissionPerBlockX3 = (getIntOrFail(emissionContract, keyEmissionRatePerBlockCurrent()) * MULT3)
336- let poolWxEmissionPerBlockX3 = fraction(wxEmissionPerBlockX3, poolWeight, (POOLWEIGHTMULT * 3))
344+ let poolWxEmissionPerBlockX3 = fraction(wxEmissionPerBlockX3, poolWeight, (POOLWEIGHTMULT * boostCoeff))
337345 let wxPerLpIntegralKEY = keyWxPerLpIntegral(lpAssetIdStr)
338346 let wxPerLpIntegralLastUpdHeightKEY = keyWxPerLpIntegralLastUpdHeight(lpAssetIdStr)
339347 let wxPerLpKEY = keyWxPerLp(lpAssetIdStr)
357365
358366
359367 func refreshINTEGRALS (lpAssetIdStr,userAddressStr,poolAddressStr,lpDeltaAmount) = {
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
368+ let $t01476214884 = refreshPoolINTEGRALS(lpAssetIdStr, poolAddressStr, lpDeltaAmount)
369+ let wxPerLpIntegralNew = $t01476214884._1
370+ let poolIntegralSTATE = $t01476214884._2
371+ let poolDEBUG = $t01476214884._3
365372 let stakedByUserKEY = keyStakedByUser(userAddressStr, lpAssetIdStr)
366373 let stakedByUser = readStaked(stakedByUserKEY)
367374 let wxToClaimUserKEY = keyWxToClaimUser(lpAssetIdStr, userAddressStr)
418425 case _ =>
419426 throw("Match error")
420427 }
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- }
448428
449429
450430 func unstakeActions (i,lpAssetId,poolAddress,userAddress,lpAssetRecipientAddress,amount) = {
550530 let lpAssetIdStr = toBase58String(lpAssetId)
551531 let amount = pmt.amount
552532 let poolAddressStr = valueOrErrorMessage(getString(factoryContract, keyFactoryLp2AssetsMapping(lpAssetIdStr)), ("unsupported lp asset " + lpAssetIdStr))
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)
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.")
574557 }
575558
576559
642625 let claimedByUserMinReward = getBigIntFromStringOrZero(this, claimedByUserMinRewardKEY)
643626 let claimedByUserBoostReward = getBigIntFromStringOrZero(this, claimedByUserBoostRewardKEY)
644627 let claimedTotal = getBigIntFromStringOrZero(this, claimedTotalKEY)
645- let $t02618626298 = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, 0)
646- let wxToClaimUserNew = $t02618626298._1
647- let integralSTATE = $t02618626298._2
648- let debug = $t02618626298._3
628+ let $t02510925221 = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, 0)
629+ let wxToClaimUserNew = $t02510925221._1
630+ let integralSTATE = $t02510925221._2
631+ let debug = $t02510925221._3
649632 let availableToClaim = max([(wxToClaimUserNew - claimedByUserMinReward), zeroBigInt])
650633 if ((zeroBigInt >= availableToClaim))
651634 then if (throwIfNothingToClaim)
654637 else {
655638 let wxAmountBoostTotal = max([asInt(asAnyList(invoke(boostingContract, "claimWxBoost", [lpAssetIdStr, userAddressStr], nil))[0]), 0])
656639 let minRewardPart = availableToClaim
657- let boostRewardPart = min([(minRewardPart * toBigInt(2)), toBigInt(wxAmountBoostTotal)])
640+ let boostRewardPart = min([(minRewardPart * toBigInt((boostCoeff - 1))), toBigInt(wxAmountBoostTotal)])
658641 let totalReward = (minRewardPart + boostRewardPart)
659642 let wxAssetId = asByteVector(asAnyList(invoke(emissionContract, "emit", [toInt(minRewardPart)], nil))[0])
660643 let emitBoost = asAnyList(invoke(emissionContract, "emit", [toInt(boostRewardPart)], nil))
687670 }, SEP)
688671 let unclaimed = info[3]
689672 let claimed = info[4]
690- let res = (resAcc :+ makeString(["%d%d", unclaimed, claimed], SEP))
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))
691680 let inv = {
692681 let @ = invoke(this, "claimWxBulkInternalREADONLY", [(currentIter + 1), lpAssetIds, userAddressStr, res], nil)
693682 if ($isInstanceOf(@, "List[Any]"))
728717 else (height - emissionStartBlock)
729718 let poolWxEmission = fraction((wxEmissionPerBlock * passedBlocks), poolWeight, POOLWEIGHTMULT)
730719 let userWxReward = fraction(poolWxEmission, stakedByUser, stakedTotal)
731- let $t03010730219 = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, 0)
732- let wxToClaimUserNew = $t03010730219._1
733- let integralSTATE = $t03010730219._2
734- let debug = $t03010730219._3
720+ let $t02926929381 = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, 0)
721+ let wxToClaimUserNew = $t02926929381._1
722+ let integralSTATE = $t02926929381._2
723+ let debug = $t02926929381._3
735724 let availableToClaim = max([(wxToClaimUserNew - claimedByUserMinReward), zeroBigInt])
736725 let boostInvResult = asAnyList(invoke(boostingContract, "claimWxBoostREADONLY", [lpAssetIdStr, userAddressStr], nil))
737726 let wxAmountBoostTotal = max([asInt(boostInvResult[0]), 0])
738727 let boostDebug = asString(boostInvResult[1])
739728 let minRewardPart = availableToClaim
740- let boostRewardPart = min([(minRewardPart * toBigInt(2)), toBigInt(wxAmountBoostTotal)])
729+ let boostRewardPart = min([(minRewardPart * toBigInt((boostCoeff - 1))), toBigInt(wxAmountBoostTotal)])
741730 let totalReward = (minRewardPart + boostRewardPart)
742731 $Tuple2(nil, makeString(["%s%s%d%d%d%d%s", lpAssetIdStr, userAddressStr, toString(totalReward), toString(claimedByUser), toString(minRewardPart), toString(boostRewardPart), "soon"], SEP))
743732 }
807796 func onModifyWeight (lpAssetIdStr,poolAddressStr) = if ((i.caller != factoryContract))
808797 then throw("permissions denied")
809798 else {
810- let $t03282532935 = refreshPoolINTEGRALS(lpAssetIdStr, poolAddressStr, 0)
811- let wxPerLpIntegralNew = $t03282532935._1
812- let poolIntegralSTATE = $t03282532935._2
813- let poolDEBUG = $t03282532935._3
799+ let $t03200232112 = refreshPoolINTEGRALS(lpAssetIdStr, poolAddressStr, 0)
800+ let wxPerLpIntegralNew = $t03200232112._1
801+ let poolIntegralSTATE = $t03200232112._2
802+ let poolDEBUG = $t03200232112._3
814803 poolIntegralSTATE
815804 }
816805
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let SCALE8 = 8
5+
6+let MULT3 = 1000
57
68 let MULT8 = 100000000
79
810 let SCALE18 = 18
911
1012 let MULT18 = toBigInt(1000000000000000000)
1113
1214 let SEP = "__"
1315
1416 let POOLWEIGHTMULT = MULT8
1517
1618 let zeroBigInt = toBigInt(0)
1719
1820 let oneBigInt = toBigInt(1)
1921
2022 func wrapErr (msg) = makeString(["staking.ride:", toString(this), msg], " ")
2123
2224
2325 func throwErr (msg) = throw(wrapErr(msg))
2426
2527
2628 func asAnyList (val) = match val {
2729 case valAnyLyst: List[Any] =>
2830 valAnyLyst
2931 case _ =>
3032 throw("fail to cast into List[Any]")
3133 }
3234
3335
3436 func asInt (val) = match val {
3537 case valInt: Int =>
3638 valInt
3739 case _ =>
3840 throw("fail to cast into Int")
3941 }
4042
4143
4244 func asString (val) = match val {
4345 case valStr: String =>
4446 valStr
4547 case _ =>
4648 throw("fail to cast into Int")
4749 }
4850
4951
5052 func asByteVector (val) = match val {
5153 case valBin: ByteVector =>
5254 valBin
5355 case _ =>
5456 throw("fail to cast into Int")
5557 }
5658
5759
5860 func getStringOrFail (address,key) = valueOrErrorMessage(getString(address, key), (("mandatory this." + key) + " is not defined"))
5961
6062
6163 func getStringByAddressOrFail (address,key) = valueOrErrorMessage(getString(address, key), (((("mandatory " + toString(address)) + ".") + key) + " is not defined"))
6264
6365
6466 func getIntOrZero (address,key) = valueOrElse(getInteger(address, key), 0)
6567
6668
6769 func getIntOrDefault (address,key,defaultVal) = valueOrElse(getInteger(address, key), defaultVal)
6870
6971
7072 func getIntOrFail (address,key) = valueOrErrorMessage(getInteger(address, key), (("mandatory this." + key) + " is not defined"))
7173
7274
7375 func getBigIntFromStringOrZero (address,key) = value(parseBigInt(valueOrElse(getString(address, key), "0")))
7476
7577
7678 func getBigIntFromStringOrDefault (address,key,defaultVal) = match getString(address, key) {
7779 case s: String =>
7880 value(parseBigInt(s))
7981 case _: Unit =>
8082 defaultVal
8183 case _ =>
8284 throw("Match error")
8385 }
8486
8587
8688 func toX18 (origVal,origScaleMult) = fraction(toBigInt(origVal), MULT18, toBigInt(origScaleMult))
8789
8890
8991 func fromX18 (val,resultScaleMult) = toInt(fraction(val, toBigInt(resultScaleMult), MULT18))
9092
9193
9294 func keyFactoryAddress () = "%s%s__config__factoryAddress"
9395
9496
9597 func keyVotingEmissionContract () = "%s__votingEmissionContract"
9698
9799
98100 let IdxFactoryCfgStakingDapp = 1
99101
100102 let IdxFactoryCfgBoostingDapp = 2
101103
102104 let IdxFactoryCfgIdoDapp = 3
103105
104106 let IdxFactoryCfgTeamDapp = 4
105107
106108 let IdxFactoryCfgEmissionDapp = 5
107109
108110 let IdxFactoryCfgRestDapp = 6
109111
110112 let IdxFactoryCfgSlippageDapp = 7
111113
112114 func keyFactoryCfg () = "%s__factoryConfig"
113115
114116
115117 func keyManagerPublicKey () = "%s__managerPublicKey"
116118
117119
118120 func keyPendingManagerPublicKey () = "%s__pendingManagerPublicKey"
119121
120122
121123 func keyStablePoolAddonAddr () = "%s__stablePoolAddonAddr"
122124
123125
124126 func keyAddonAddr () = "%s__addonAddr"
125127
126128
127129 func keyFactoryLp2AssetsMapping (lpAssetStr) = makeString(["%s%s%s", lpAssetStr, "mappings__lpAsset2PoolContract"], SEP)
128130
129131
130132 func keyFactoryLpList () = "%s__lpTokensList"
131133
132134
133135 func keyFactoryLpAssetToPoolContractAddress (lpAssetStr) = makeString(["%s%s%s", lpAssetStr, "mappings__lpAsset2PoolContract"], SEP)
134136
135137
136138 func keyFactoryPoolWeight (contractAddress) = makeString(["%s%s", "poolWeight", contractAddress], SEP)
137139
138140
139141 func readLpList (factory) = split(valueOrElse(getString(factory, keyFactoryLpList()), ""), SEP)
140142
141143
142144 func readFactoryCfgOrFail (factory) = split(getStringByAddressOrFail(factory, keyFactoryCfg()), SEP)
143145
144146
145147 func getBoostingAddressOrFail (factoryCfg) = addressFromStringValue(factoryCfg[IdxFactoryCfgBoostingDapp])
146148
147149
148150 func getEmissionAddressOrFail (factoryCfg) = addressFromStringValue(factoryCfg[IdxFactoryCfgEmissionDapp])
149151
150152
151153 func getStakingAddressOrFail (factoryCfg) = addressFromStringValue(factoryCfg[IdxFactoryCfgStakingDapp])
152154
153155
154156 func keyEmissionRatePerBlockCurrent () = "%s%s__ratePerBlock__current"
155157
156158
157159 func keyEmissionRatePerBlockMaxCurrent () = "%s%s__ratePerBlockMax__current"
158160
159161
160162 func keyEmissionStartBlock () = "%s%s__emission__startBlock"
161163
162164
163165 func keyEmissionDurationInBlocks () = "%s%s__emission__duration"
164166
165167
166168 func keyEmissionEndBlock () = "%s%s__emission__endBlock"
167169
168170
169171 func keyStakedByUser (userAddressStr,lpAssetIdStr) = makeString(["%s%s%s__staked", userAddressStr, lpAssetIdStr], SEP)
170172
171173
172174 func keyStakedTotal (lpAssetIdStr) = ("%s%s%s__staked__total__" + lpAssetIdStr)
173175
174176
175177 func keyClaimedByUser (lpAssetIdStr,userAddressStr) = makeString(["%s%s%s__claimed", userAddressStr, lpAssetIdStr], SEP)
176178
177179
178180 func keyClaimedByUserMinReward (lpAssetIdStr,userAddressStr) = makeString(["%s%s%s__claimedMinReward", userAddressStr, lpAssetIdStr], SEP)
179181
180182
181183 func keyClaimedByUserBoostReward (lpAssetIdStr,userAddressStr) = makeString(["%s%s%s__claimedBoostReward", userAddressStr, lpAssetIdStr], SEP)
182184
183185
184186 func keyClaimedTotal (lpAssetIdStr) = makeString(["%s%s%s__claimed__total", lpAssetIdStr], SEP)
185187
186188
187189 func readStaked (key) = valueOrElse(getInteger(this, key), 0)
188190
189191
190192 func keyLastTotalLpBalance (lpAssetId) = makeString(["%s%s%s", lpAssetId, "total", "bal"], SEP)
191193
192194
193195 func keyLastUserLpBalance (lpAssetId,userAddress) = makeString(["%s%s%s", lpAssetId, userAddress, "bal"], SEP)
194196
195197
196198 func keyTotalLpBalanceIntegral (lpAssetId) = makeString(["%s%s%s", lpAssetId, "total", "balINT"], SEP)
197199
198200
199201 func keyUserLpBalanceIntegral (lpAssetId,userAddress) = makeString(["%s%s%s", lpAssetId, userAddress, "balINT"], SEP)
200202
201203
202204 func keyTotalLpBalanceIntegralLastUpdHeight (lpAssetId) = makeString(["%s%s%s", lpAssetId, "total", "lastUpd"], SEP)
203205
204206
205207 func keyUserLpBalanceIntegralLastUpdHeight (lpAssetId,userAddress) = makeString(["%s%s%s", lpAssetId, userAddress, "lastUpd"], SEP)
206208
207209
208210 func keyWxPerLpIntegral (lpAssetId) = makeString(["%s%s%s%s", lpAssetId, "common", "lpInt"], SEP)
209211
210212
211213 func keyWxPerLpIntegralLastUpdHeight (lpAssetId) = makeString(["%s%s%s%s", lpAssetId, "common", "lpIntH"], SEP)
212214
213215
214216 func keyWxToClaimUser (lpAssetId,userAddress) = makeString(["%s%s%s%s", lpAssetId, userAddress, "lpInt"], SEP)
215217
216218
217219 func keyWxPerLpIntegralUserLastUpdHeight (lpAssetId,userAddress) = makeString(["%s%s%s%s", lpAssetId, userAddress, "lpIntH"], SEP)
218220
219221
220222 func keyWxPerLp (lpAssetId) = makeString(["%s", lpAssetId, "wxPerLp"], SEP)
221223
222224
223225 func keyWxPerLpX18 (lpAssetId) = makeString(["%s", lpAssetId, "wxPerLpX18"], SEP)
224226
225227
226228 func keyWxPerLpIntegralUserLast (lpAssetId,userAddress) = makeString(["%s%s%s%s", lpAssetId, userAddress, "uIntL"], SEP)
227229
228230
229231 func keyOperationHistoryRecord (type,userAddress,txId58) = makeString(["%s%s%s%s__history", type, userAddress, txId58], SEP)
230232
231233
232234 func formatHistoryRecord (userAddress,lpAssetId,type,amount) = makeString(["%s%s%s%d%d%d", userAddress, lpAssetId, type, toString(height), toString(lastBlock.timestamp), toString(amount)], SEP)
233235
234236
235237 func OperationHistoryEntry (type,userAddress,lpAssetId,amount,txId) = StringEntry(keyOperationHistoryRecord(type, userAddress, toBase58String(txId)), formatHistoryRecord(userAddress, lpAssetId, type, amount))
236238
237239
238240 let factoryAddress = getStringOrFail(this, keyFactoryAddress())
239241
240242 let factoryContract = addressFromStringValue(factoryAddress)
241243
242244 let factoryCfg = readFactoryCfgOrFail(factoryContract)
243245
244246 let emissionContract = getEmissionAddressOrFail(factoryCfg)
245247
246248 let boostingContract = getBoostingAddressOrFail(factoryCfg)
247249
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+
248257 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"))
249258
250259 func keyNextUser (lpAssetId) = makeString(["%s%s", lpAssetId, "nextUser"], SEP)
251260
252261
253262 func getUsersListName (lpAssetId) = makeString(["users", lpAssetId], SEP)
254263
255264
256265 func keyListHead (listName) = makeString(["%s%s%s", listName, "head"], SEP)
257266
258267
259268 func keyListSize (listName) = makeString(["%s%s%s", listName, "size"], SEP)
260269
261270
262271 func keyListPrev (listName,id) = makeString(["%s%s%s%s", listName, id, "prev"], SEP)
263272
264273
265274 func keyListNext (listName,id) = makeString(["%s%s%s%s", listName, id, "next"], SEP)
266275
267276
268277 func containsNode (listName,id) = {
269278 let headOrUnit = getString(this, keyListHead(listName))
270279 let prevOrUnit = getString(this, keyListPrev(listName, id))
271280 let nextOrUnit = getString(this, keyListNext(listName, id))
272281 if (if ((id == valueOrElse(headOrUnit, "")))
273282 then true
274283 else (prevOrUnit != unit))
275284 then true
276285 else (nextOrUnit != unit)
277286 }
278287
279288
280289 func insertNodeActions (listName,id) = {
281290 let headOrUnit = getString(this, keyListHead(listName))
282291 let listSize = valueOrElse(getInteger(this, keyListSize(listName)), 0)
283292 let checkNode = if (!(containsNode(listName, id)))
284293 then true
285294 else throw("Node exists")
286295 if ((checkNode == checkNode))
287296 then (([IntegerEntry(keyListSize(listName), (listSize + 1))] ++ (if ((headOrUnit != unit))
288297 then [StringEntry(keyListNext(listName, id), value(headOrUnit)), StringEntry(keyListPrev(listName, value(headOrUnit)), id)]
289298 else nil)) ++ [StringEntry(keyListHead(listName), id)])
290299 else throw("Strict value is not equal to itself.")
291300 }
292301
293302
294303 func deleteNodeActions (listName,id) = {
295304 let headOrUnit = getString(this, keyListHead(listName))
296305 let listSize = valueOrElse(getInteger(this, keyListSize(listName)), 0)
297306 let prevOrUnit = getString(this, keyListPrev(listName, id))
298307 let nextOrUnit = getString(this, keyListNext(listName, id))
299308 ([IntegerEntry(keyListSize(listName), (listSize - 1))] ++ (if (if ((prevOrUnit != unit))
300309 then (nextOrUnit != unit)
301310 else false)
302311 then [StringEntry(keyListNext(listName, value(prevOrUnit)), value(nextOrUnit)), StringEntry(keyListPrev(listName, value(nextOrUnit)), value(prevOrUnit)), DeleteEntry(keyListPrev(listName, id)), DeleteEntry(keyListNext(listName, id))]
303312 else if ((nextOrUnit != unit))
304313 then [StringEntry(keyListHead(listName), value(nextOrUnit)), DeleteEntry(keyListNext(listName, id)), DeleteEntry(keyListPrev(listName, value(nextOrUnit)))]
305314 else if ((prevOrUnit != unit))
306315 then [DeleteEntry(keyListPrev(listName, id)), DeleteEntry(keyListNext(listName, value(prevOrUnit)))]
307316 else if ((id == valueOrElse(headOrUnit, "")))
308317 then [DeleteEntry(keyListHead(listName))]
309318 else throw(((("invalid node: " + listName) + ".") + id))))
310319 }
311320
312321
313322 func calcWxPerLpIntegralUserLast (stakedByUser,wxPerLpIntegralUserLastUpdHeightOrZero,wxPerLpIntegralNew,wxPerLpIntegralUserLastKEY) = if (if ((wxPerLpIntegralUserLastUpdHeightOrZero == zeroBigInt))
314323 then (stakedByUser > zeroBigInt)
315324 else false)
316325 then zeroBigInt
317326 else if ((stakedByUser == zeroBigInt))
318327 then wxPerLpIntegralNew
319328 else if (if ((wxPerLpIntegralUserLastUpdHeightOrZero > zeroBigInt))
320329 then (stakedByUser > zeroBigInt)
321330 else false)
322331 then value(parseBigInt(getStringOrFail(this, wxPerLpIntegralUserLastKEY)))
323332 else throw("calcWxPerLpIntegralUserLast: unexpected state")
324333
325334
326335 func refreshPoolINTEGRALS (lpAssetIdStr,poolAddressStr,lpDeltaAmount) = {
327336 let stakedTotalKEY = keyStakedTotal(lpAssetIdStr)
328337 let stakedTotal = toBigInt(readStaked(stakedTotalKEY))
329338 let nonZeroStakedTotal = if ((stakedTotal == zeroBigInt))
330339 then oneBigInt
331340 else stakedTotal
332341 let poolWeight = getIntegerValue(factoryContract, keyFactoryPoolWeight(poolAddressStr))
333342 let emissionStartBlock = getIntOrFail(emissionContract, keyEmissionStartBlock())
334- let MULT3 = 1000
335343 let wxEmissionPerBlockX3 = (getIntOrFail(emissionContract, keyEmissionRatePerBlockCurrent()) * MULT3)
336- let poolWxEmissionPerBlockX3 = fraction(wxEmissionPerBlockX3, poolWeight, (POOLWEIGHTMULT * 3))
344+ let poolWxEmissionPerBlockX3 = fraction(wxEmissionPerBlockX3, poolWeight, (POOLWEIGHTMULT * boostCoeff))
337345 let wxPerLpIntegralKEY = keyWxPerLpIntegral(lpAssetIdStr)
338346 let wxPerLpIntegralLastUpdHeightKEY = keyWxPerLpIntegralLastUpdHeight(lpAssetIdStr)
339347 let wxPerLpKEY = keyWxPerLp(lpAssetIdStr)
340348 let wxPerLpIntegralLastUpdHeight = getIntOrDefault(this, wxPerLpIntegralLastUpdHeightKEY, emissionStartBlock)
341349 let wxPerLpIntegral = getBigIntFromStringOrZero(this, wxPerLpIntegralKEY)
342350 let wxPerLpOrZeroX3 = 0
343351 let dh = max([(height - wxPerLpIntegralLastUpdHeight), 0])
344352 let wxPerLpX3 = if ((wxPerLpOrZeroX3 != 0))
345353 then toBigInt(wxPerLpOrZeroX3)
346354 else fraction(toBigInt(poolWxEmissionPerBlockX3), toBigInt(MULT8), nonZeroStakedTotal)
347355 let stakedTotalNew = (stakedTotal + toBigInt(lpDeltaAmount))
348356 let nonZeroStakedTotalNew = if ((stakedTotalNew == zeroBigInt))
349357 then oneBigInt
350358 else stakedTotalNew
351359 let wxPerLpIntegralNew = (wxPerLpIntegral + (wxPerLpX3 * toBigInt(dh)))
352360 let wxPerLpX3New = (toBigInt(poolWxEmissionPerBlockX3) / nonZeroStakedTotalNew)
353361 let wxPerLpIntegralLastUpdHeightNew = height
354362 let debug = makeString([toString(wxPerLpIntegralNew), toString(dh), toString(wxPerLpX3), toString(stakedTotal), toString(poolWxEmissionPerBlockX3), toString(wxEmissionPerBlockX3), toString(poolWeight)], "::")
355363 $Tuple3(wxPerLpIntegralNew, [StringEntry(wxPerLpIntegralKEY, toString(wxPerLpIntegralNew)), IntegerEntry(wxPerLpIntegralLastUpdHeightKEY, wxPerLpIntegralLastUpdHeightNew), StringEntry(wxPerLpKEY, toString(wxPerLpX3New))], debug)
356364 }
357365
358366
359367 func refreshINTEGRALS (lpAssetIdStr,userAddressStr,poolAddressStr,lpDeltaAmount) = {
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
368+ let $t01476214884 = refreshPoolINTEGRALS(lpAssetIdStr, poolAddressStr, lpDeltaAmount)
369+ let wxPerLpIntegralNew = $t01476214884._1
370+ let poolIntegralSTATE = $t01476214884._2
371+ let poolDEBUG = $t01476214884._3
365372 let stakedByUserKEY = keyStakedByUser(userAddressStr, lpAssetIdStr)
366373 let stakedByUser = readStaked(stakedByUserKEY)
367374 let wxToClaimUserKEY = keyWxToClaimUser(lpAssetIdStr, userAddressStr)
368375 let wxPerLpIntegralUserLastUpdHeightKEY = keyWxPerLpIntegralUserLastUpdHeight(lpAssetIdStr, userAddressStr)
369376 let wxPerLpIntegralUserLastKEY = keyWxPerLpIntegralUserLast(lpAssetIdStr, userAddressStr)
370377 let wxToClaimUser = getBigIntFromStringOrZero(this, wxToClaimUserKEY)
371378 let wxPerLpIntegralUserLastUpdHeightOrZero = getIntOrZero(this, wxPerLpIntegralUserLastUpdHeightKEY)
372379 let wxPerLpIntegralUserLast = calcWxPerLpIntegralUserLast(toBigInt(stakedByUser), toBigInt(wxPerLpIntegralUserLastUpdHeightOrZero), wxPerLpIntegralNew, wxPerLpIntegralUserLastKEY)
373380 let MULT11 = (MULT8 * MULT3)
374381 let wxToClaimUserNew = max([(wxToClaimUser + fraction((wxPerLpIntegralNew - wxPerLpIntegralUserLast), toBigInt(stakedByUser), toBigInt(MULT11))), zeroBigInt])
375382 let wxPerLpIntegralUserLastNew = wxPerLpIntegralNew
376383 let wxPerLpIntegralUserLastUpdHeightNew = height
377384 let debug = makeString([toString(wxToClaimUser), toString(wxPerLpIntegralUserLast), toString(stakedByUser), poolDEBUG, toString(height)], "::")
378385 $Tuple3(wxToClaimUserNew, (poolIntegralSTATE ++ [StringEntry(wxToClaimUserKEY, toString(wxToClaimUserNew)), IntegerEntry(wxPerLpIntegralUserLastUpdHeightKEY, wxPerLpIntegralUserLastUpdHeightNew), StringEntry(wxPerLpIntegralUserLastKEY, toString(wxPerLpIntegralUserLastNew))]), debug)
379386 }
380387
381388
382389 func managerPublicKeyOrUnit () = match getString(keyManagerPublicKey()) {
383390 case s: String =>
384391 fromBase58String(s)
385392 case _: Unit =>
386393 unit
387394 case _ =>
388395 throw("Match error")
389396 }
390397
391398
392399 func pendingManagerPublicKeyOrUnit () = match getString(keyPendingManagerPublicKey()) {
393400 case s: String =>
394401 fromBase58String(s)
395402 case _: Unit =>
396403 unit
397404 case _ =>
398405 throw("Match error")
399406 }
400407
401408
402409 let permissionDeniedError = throw("Permission denied")
403410
404411 func mustThis (i) = if ((i.caller == this))
405412 then true
406413 else permissionDeniedError
407414
408415
409416 func mustManager (i) = match managerPublicKeyOrUnit() {
410417 case pk: ByteVector =>
411418 if ((i.callerPublicKey == pk))
412419 then true
413420 else permissionDeniedError
414421 case _: Unit =>
415422 if ((i.caller == this))
416423 then true
417424 else permissionDeniedError
418425 case _ =>
419426 throw("Match error")
420427 }
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- }
448428
449429
450430 func unstakeActions (i,lpAssetId,poolAddress,userAddress,lpAssetRecipientAddress,amount) = {
451431 let userAddressStr = toString(userAddress)
452432 let lpAssetIdStr = toBase58String(lpAssetId)
453433 let poolAddressStr = toString(poolAddress)
454434 let stakedByUserKEY = keyStakedByUser(userAddressStr, lpAssetIdStr)
455435 let stakedTotalKEY = keyStakedTotal(lpAssetIdStr)
456436 let stakedByUser = readStaked(stakedByUserKEY)
457437 let stakedTotal = readStaked(stakedTotalKEY)
458438 let integralSTATE = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, -(amount))._2
459439 let listName = getUsersListName(lpAssetIdStr)
460440 let listActions = if (if (containsNode(listName, userAddressStr))
461441 then (amount == stakedByUser)
462442 else false)
463443 then deleteNodeActions(listName, userAddressStr)
464444 else nil
465445 let refreshStakedVote = if ((amount == stakedByUser))
466446 then invoke(boostingContract, "onStakedVoteUpdate", [lpAssetIdStr, userAddressStr, false], nil)
467447 else unit
468448 if ((refreshStakedVote == refreshStakedVote))
469449 then {
470450 let claimedByUserMinReward = getBigIntFromStringOrZero(this, keyClaimedByUserMinReward(lpAssetIdStr, userAddressStr))
471451 let wxToClaimUserNew = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, 0)._1
472452 let availableToClaim = (wxToClaimUserNew - claimedByUserMinReward)
473453 let throwIfNothingToClaim = true
474454 let r = if ((availableToClaim > zeroBigInt))
475455 then invoke(this, "claimWxINTERNAL", [lpAssetIdStr, userAddressStr, throwIfNothingToClaim], nil)
476456 else unit
477457 if ((r == r))
478458 then if ((amount > stakedByUser))
479459 then throw(((((((("passed amount=" + toString(amount)) + " is greater than available=") + toString(stakedByUser)) + ". lpAssetId=") + lpAssetIdStr) + ". stakedByUserKEY=") + stakedByUserKEY))
480460 else (([IntegerEntry(stakedByUserKEY, (stakedByUser - amount)), IntegerEntry(stakedTotalKEY, (stakedTotal - amount)), ScriptTransfer(lpAssetRecipientAddress, amount, lpAssetId), OperationHistoryEntry("unstake", userAddressStr, lpAssetIdStr, amount, i.transactionId)] ++ integralSTATE) ++ listActions)
481461 else throw("Strict value is not equal to itself.")
482462 }
483463 else throw("Strict value is not equal to itself.")
484464 }
485465
486466
487467 @Callable(i)
488468 func constructor (factoryAddressStr) = {
489469 let checkCaller = mustManager(i)
490470 if ((checkCaller == checkCaller))
491471 then [StringEntry(keyFactoryAddress(), factoryAddressStr)]
492472 else throw("Strict value is not equal to itself.")
493473 }
494474
495475
496476
497477 @Callable(i)
498478 func constructorV2 (votingEmissionContract) = {
499479 let cheks = [mustManager(i), if ((addressFromString(votingEmissionContract) != unit))
500480 then true
501481 else "invalid voting emission contract address"]
502482 if ((cheks == cheks))
503483 then [StringEntry(keyVotingEmissionContract(), votingEmissionContract)]
504484 else throw("Strict value is not equal to itself.")
505485 }
506486
507487
508488
509489 @Callable(i)
510490 func setManager (pendingManagerPublicKey) = {
511491 let checkCaller = mustManager(i)
512492 if ((checkCaller == checkCaller))
513493 then {
514494 let checkManagerPublicKey = fromBase58String(pendingManagerPublicKey)
515495 if ((checkManagerPublicKey == checkManagerPublicKey))
516496 then [StringEntry(keyPendingManagerPublicKey(), pendingManagerPublicKey)]
517497 else throw("Strict value is not equal to itself.")
518498 }
519499 else throw("Strict value is not equal to itself.")
520500 }
521501
522502
523503
524504 @Callable(i)
525505 func confirmManager () = {
526506 let pm = pendingManagerPublicKeyOrUnit()
527507 let hasPM = if (isDefined(pm))
528508 then true
529509 else throw("No pending manager")
530510 if ((hasPM == hasPM))
531511 then {
532512 let checkPM = if ((i.callerPublicKey == value(pm)))
533513 then true
534514 else throw("You are not pending manager")
535515 if ((checkPM == checkPM))
536516 then [StringEntry(keyManagerPublicKey(), toBase58String(value(pm))), DeleteEntry(keyPendingManagerPublicKey())]
537517 else throw("Strict value is not equal to itself.")
538518 }
539519 else throw("Strict value is not equal to itself.")
540520 }
541521
542522
543523
544524 @Callable(i)
545525 func stake () = if ((size(i.payments) != 1))
546526 then throw("invalid payment - exact one payment must be attached")
547527 else {
548528 let pmt = i.payments[0]
549529 let lpAssetId = value(pmt.assetId)
550530 let lpAssetIdStr = toBase58String(lpAssetId)
551531 let amount = pmt.amount
552532 let poolAddressStr = valueOrErrorMessage(getString(factoryContract, keyFactoryLp2AssetsMapping(lpAssetIdStr)), ("unsupported lp asset " + lpAssetIdStr))
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)
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.")
574557 }
575558
576559
577560
578561 @Callable(i)
579562 func unstake (lpAssetIdStr,amount) = {
580563 let lpAssetId = fromBase58String(lpAssetIdStr)
581564 let poolAddressStr = valueOrErrorMessage(getString(factoryContract, keyFactoryLp2AssetsMapping(lpAssetIdStr)), ("unsupported lp asset " + lpAssetIdStr))
582565 let poolAddress = addressFromStringValue(poolAddressStr)
583566 let poolAddon = valueOrElse(getString(poolAddress, keyAddonAddr()), poolAddressStr)
584567 let callerStr = toString(i.caller)
585568 let userAddress = if (if ((callerStr == poolAddressStr))
586569 then true
587570 else (callerStr == poolAddon))
588571 then i.originCaller
589572 else i.caller
590573 let lpAssetRecipientAddress = i.caller
591574 unstakeActions(i, lpAssetId, poolAddress, userAddress, lpAssetRecipientAddress, amount)
592575 }
593576
594577
595578
596579 @Callable(i)
597580 func unstakeINTERNAL (lpAssetId,amount,userAddress,lpAssetRecipientAddress) = {
598581 let lpAssetIdStr = toBase58String(lpAssetId)
599582 let poolAddress = addressFromStringValue(valueOrErrorMessage(getString(factoryContract, keyFactoryLp2AssetsMapping(lpAssetIdStr)), ("unsupported lp asset " + lpAssetIdStr)))
600583 let checkCaller = if ((i.caller == poolAddress))
601584 then true
602585 else permissionDeniedError
603586 if ((checkCaller == checkCaller))
604587 then unstakeActions(i, lpAssetId, poolAddress, Address(userAddress), Address(lpAssetRecipientAddress), amount)
605588 else throw("Strict value is not equal to itself.")
606589 }
607590
608591
609592
610593 @Callable(i)
611594 func claimWx (lpAssetIdStr) = {
612595 let userAddressStr = toString(i.caller)
613596 let throwIfNothingToClaim = true
614597 let result = invoke(this, "claimWxINTERNAL", [lpAssetIdStr, userAddressStr, throwIfNothingToClaim], nil)
615598 $Tuple2(nil, result)
616599 }
617600
618601
619602
620603 @Callable(i)
621604 func claimWxDoNotThrow (lpAssetIdStr) = {
622605 let userAddressStr = toString(i.caller)
623606 let throwIfNothingToClaim = false
624607 let result = invoke(this, "claimWxINTERNAL", [lpAssetIdStr, userAddressStr, throwIfNothingToClaim], nil)
625608 $Tuple2(nil, result)
626609 }
627610
628611
629612
630613 @Callable(i)
631614 func claimWxINTERNAL (lpAssetIdStr,userAddressStr,throwIfNothingToClaim) = {
632615 let checkCaller = mustThis(i)
633616 if ((checkCaller == checkCaller))
634617 then {
635618 let userAddress = valueOrErrorMessage(addressFromString(userAddressStr), "claimWxINTERNAL: invalid user address")
636619 let poolAddressStr = getStringByAddressOrFail(factoryContract, keyFactoryLpAssetToPoolContractAddress(lpAssetIdStr))
637620 let claimedByUserKEY = keyClaimedByUser(lpAssetIdStr, userAddressStr)
638621 let claimedTotalKEY = keyClaimedTotal(lpAssetIdStr)
639622 let claimedByUserMinRewardKEY = keyClaimedByUserMinReward(lpAssetIdStr, userAddressStr)
640623 let claimedByUserBoostRewardKEY = keyClaimedByUserBoostReward(lpAssetIdStr, userAddressStr)
641624 let claimedByUser = getBigIntFromStringOrZero(this, claimedByUserKEY)
642625 let claimedByUserMinReward = getBigIntFromStringOrZero(this, claimedByUserMinRewardKEY)
643626 let claimedByUserBoostReward = getBigIntFromStringOrZero(this, claimedByUserBoostRewardKEY)
644627 let claimedTotal = getBigIntFromStringOrZero(this, claimedTotalKEY)
645- let $t02618626298 = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, 0)
646- let wxToClaimUserNew = $t02618626298._1
647- let integralSTATE = $t02618626298._2
648- let debug = $t02618626298._3
628+ let $t02510925221 = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, 0)
629+ let wxToClaimUserNew = $t02510925221._1
630+ let integralSTATE = $t02510925221._2
631+ let debug = $t02510925221._3
649632 let availableToClaim = max([(wxToClaimUserNew - claimedByUserMinReward), zeroBigInt])
650633 if ((zeroBigInt >= availableToClaim))
651634 then if (throwIfNothingToClaim)
652635 then throw("nothing to claim")
653636 else $Tuple2(nil, 0)
654637 else {
655638 let wxAmountBoostTotal = max([asInt(asAnyList(invoke(boostingContract, "claimWxBoost", [lpAssetIdStr, userAddressStr], nil))[0]), 0])
656639 let minRewardPart = availableToClaim
657- let boostRewardPart = min([(minRewardPart * toBigInt(2)), toBigInt(wxAmountBoostTotal)])
640+ let boostRewardPart = min([(minRewardPart * toBigInt((boostCoeff - 1))), toBigInt(wxAmountBoostTotal)])
658641 let totalReward = (minRewardPart + boostRewardPart)
659642 let wxAssetId = asByteVector(asAnyList(invoke(emissionContract, "emit", [toInt(minRewardPart)], nil))[0])
660643 let emitBoost = asAnyList(invoke(emissionContract, "emit", [toInt(boostRewardPart)], nil))
661644 if ((emitBoost == emitBoost))
662645 then {
663646 let claimedByUserValue = ((claimedByUser + minRewardPart) + boostRewardPart)
664647 let claimedByUserMinRewardPlusPart = (claimedByUserMinReward + minRewardPart)
665648 let claimedByUserBoostRewardPlusBoostRewardPart = (claimedByUserBoostReward + boostRewardPart)
666649 let claimedTotalPlusAvailableToClaim = (claimedTotal + availableToClaim)
667650 $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))
668651 }
669652 else throw("Strict value is not equal to itself.")
670653 }
671654 }
672655 else throw("Strict value is not equal to itself.")
673656 }
674657
675658
676659
677660 @Callable(i)
678661 func claimWxBulkInternalREADONLY (currentIter,lpAssetIds,userAddressStr,resAcc) = if ((currentIter == size(lpAssetIds)))
679662 then $Tuple2(nil, resAcc)
680663 else {
681664 let lpAssetId = lpAssetIds[currentIter]
682665 let info = split({
683666 let @ = invoke(this, "claimWxREADONLY", [lpAssetId, userAddressStr], nil)
684667 if ($isInstanceOf(@, "String"))
685668 then @
686669 else throw(($getType(@) + " couldn't be cast to String"))
687670 }, SEP)
688671 let unclaimed = info[3]
689672 let claimed = info[4]
690- let res = (resAcc :+ makeString(["%d%d", unclaimed, claimed], SEP))
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))
691680 let inv = {
692681 let @ = invoke(this, "claimWxBulkInternalREADONLY", [(currentIter + 1), lpAssetIds, userAddressStr, res], nil)
693682 if ($isInstanceOf(@, "List[Any]"))
694683 then @
695684 else throw(($getType(@) + " couldn't be cast to List[Any]"))
696685 }
697686 if ((inv == inv))
698687 then $Tuple2(nil, inv)
699688 else throw("Strict value is not equal to itself.")
700689 }
701690
702691
703692
704693 @Callable(i)
705694 func claimWxBulkREADONLY (lpAssetIds,userAddressStr) = {
706695 let res = invoke(this, "claimWxBulkInternalREADONLY", [0, lpAssetIds, userAddressStr, nil], nil)
707696 $Tuple2(nil, res)
708697 }
709698
710699
711700
712701 @Callable(i)
713702 func claimWxREADONLY (lpAssetIdStr,userAddressStr) = {
714703 let stakedByUserKEY = keyStakedByUser(userAddressStr, lpAssetIdStr)
715704 let stakedTotalKEY = keyStakedTotal(lpAssetIdStr)
716705 let claimedByUserKEY = keyClaimedByUser(lpAssetIdStr, userAddressStr)
717706 let claimedByUserMinRewardKEY = keyClaimedByUserMinReward(lpAssetIdStr, userAddressStr)
718707 let stakedByUser = readStaked(stakedByUserKEY)
719708 let stakedTotal = readStaked(stakedTotalKEY)
720709 let claimedByUser = getBigIntFromStringOrZero(this, claimedByUserKEY)
721710 let claimedByUserMinReward = getBigIntFromStringOrZero(this, claimedByUserMinRewardKEY)
722711 let poolAddressStr = getStringByAddressOrFail(factoryContract, keyFactoryLpAssetToPoolContractAddress(lpAssetIdStr))
723712 let poolWeight = getIntegerValue(factoryContract, keyFactoryPoolWeight(poolAddressStr))
724713 let wxEmissionPerBlock = getIntOrFail(emissionContract, keyEmissionRatePerBlockCurrent())
725714 let emissionStartBlock = getIntOrFail(emissionContract, keyEmissionStartBlock())
726715 let passedBlocks = if ((emissionStartBlock > height))
727716 then 0
728717 else (height - emissionStartBlock)
729718 let poolWxEmission = fraction((wxEmissionPerBlock * passedBlocks), poolWeight, POOLWEIGHTMULT)
730719 let userWxReward = fraction(poolWxEmission, stakedByUser, stakedTotal)
731- let $t03010730219 = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, 0)
732- let wxToClaimUserNew = $t03010730219._1
733- let integralSTATE = $t03010730219._2
734- let debug = $t03010730219._3
720+ let $t02926929381 = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, 0)
721+ let wxToClaimUserNew = $t02926929381._1
722+ let integralSTATE = $t02926929381._2
723+ let debug = $t02926929381._3
735724 let availableToClaim = max([(wxToClaimUserNew - claimedByUserMinReward), zeroBigInt])
736725 let boostInvResult = asAnyList(invoke(boostingContract, "claimWxBoostREADONLY", [lpAssetIdStr, userAddressStr], nil))
737726 let wxAmountBoostTotal = max([asInt(boostInvResult[0]), 0])
738727 let boostDebug = asString(boostInvResult[1])
739728 let minRewardPart = availableToClaim
740- let boostRewardPart = min([(minRewardPart * toBigInt(2)), toBigInt(wxAmountBoostTotal)])
729+ let boostRewardPart = min([(minRewardPart * toBigInt((boostCoeff - 1))), toBigInt(wxAmountBoostTotal)])
741730 let totalReward = (minRewardPart + boostRewardPart)
742731 $Tuple2(nil, makeString(["%s%s%d%d%d%d%s", lpAssetIdStr, userAddressStr, toString(totalReward), toString(claimedByUser), toString(minRewardPart), toString(boostRewardPart), "soon"], SEP))
743732 }
744733
745734
746735
747736 @Callable(i)
748737 func stakedByUserREADONLY (lpAssetIdStr,userAddressStr) = {
749738 let stakedByUser = valueOrElse(getInteger(keyStakedByUser(userAddressStr, lpAssetIdStr)), 0)
750739 $Tuple2(nil, stakedByUser)
751740 }
752741
753742
754743
755744 @Callable(i)
756745 func usersListTraversal (lpAssetId) = {
757746 let checkCaller = if ((toBase58String(i.caller.bytes) == valueOrElse(getString(this, keyVotingEmissionContract()), "")))
758747 then true
759748 else mustManager(i)
760749 if ((checkCaller == checkCaller))
761750 then {
762751 let listName = getUsersListName(lpAssetId)
763752 let userOrUnit = getString(keyNextUser(lpAssetId))
764753 let headOrUnit = getString(keyListHead(listName))
765754 match userOrUnit {
766755 case _: Unit =>
767756 match headOrUnit {
768757 case _: Unit =>
769758 $Tuple2(nil, false)
770759 case head: String =>
771760 $Tuple2([StringEntry(keyNextUser(lpAssetId), head)], true)
772761 case _ =>
773762 throw("Match error")
774763 }
775764 case userAddress: String =>
776765 let claimedByUserMinReward = getBigIntFromStringOrZero(this, keyClaimedByUserMinReward(lpAssetId, userAddress))
777766 let poolAddress = getStringByAddressOrFail(factoryContract, keyFactoryLpAssetToPoolContractAddress(lpAssetId))
778767 let wxToClaimUserNew = refreshINTEGRALS(lpAssetId, userAddress, poolAddress, 0)._1
779768 let availableToClaim = (wxToClaimUserNew - claimedByUserMinReward)
780769 let throwIfNothingToClaim = true
781770 let r = if ((availableToClaim > zeroBigInt))
782771 then invoke(this, "claimWxINTERNAL", [lpAssetId, userAddress, throwIfNothingToClaim], nil)
783772 else unit
784773 if ((r == r))
785774 then {
786775 let nextUserOrUnit = getString(keyListNext(listName, userAddress))
787776 match nextUserOrUnit {
788777 case _: Unit =>
789778 $Tuple2([DeleteEntry(keyNextUser(lpAssetId))], false)
790779 case nextUser: String =>
791780 $Tuple2([StringEntry(keyNextUser(lpAssetId), nextUser)], true)
792781 case _ =>
793782 throw("Match error")
794783 }
795784 }
796785 else throw("Strict value is not equal to itself.")
797786 case _ =>
798787 throw("Match error")
799788 }
800789 }
801790 else throw("Strict value is not equal to itself.")
802791 }
803792
804793
805794
806795 @Callable(i)
807796 func onModifyWeight (lpAssetIdStr,poolAddressStr) = if ((i.caller != factoryContract))
808797 then throw("permissions denied")
809798 else {
810- let $t03282532935 = refreshPoolINTEGRALS(lpAssetIdStr, poolAddressStr, 0)
811- let wxPerLpIntegralNew = $t03282532935._1
812- let poolIntegralSTATE = $t03282532935._2
813- let poolDEBUG = $t03282532935._3
799+ let $t03200232112 = refreshPoolINTEGRALS(lpAssetIdStr, poolAddressStr, 0)
800+ let wxPerLpIntegralNew = $t03200232112._1
801+ let poolIntegralSTATE = $t03200232112._2
802+ let poolDEBUG = $t03200232112._3
814803 poolIntegralSTATE
815804 }
816805
817806
818807 @Verifier(tx)
819808 func verify () = {
820809 let targetPublicKey = match managerPublicKeyOrUnit() {
821810 case pk: ByteVector =>
822811 pk
823812 case _: Unit =>
824813 tx.senderPublicKey
825814 case _ =>
826815 throw("Match error")
827816 }
828817 sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey)
829818 }
830819

github/deemru/w8io/026f985 
149.66 ms