tx · BCgjAX1cXff2ep4f9E1YwtMHZaLerpCf831HCJy58phs

3Mx3zmXrMcLFCafMuPtXAzR4ZPVeZYb6qLz:  -0.02300000 Waves

2023.03.14 10:10 [2489388] smart account 3Mx3zmXrMcLFCafMuPtXAzR4ZPVeZYb6qLz > SELF 0.00000000 Waves

{ "type": 13, "id": "BCgjAX1cXff2ep4f9E1YwtMHZaLerpCf831HCJy58phs", "fee": 2300000, "feeAssetId": null, "timestamp": 1678777838660, "version": 2, "chainId": 84, "sender": "3Mx3zmXrMcLFCafMuPtXAzR4ZPVeZYb6qLz", "senderPublicKey": "D28XoueZWsMfm8Y5pa6C5ZFuYoWgre2Wm8tzJANJgMnq", "proofs": [ "22tVHv2zSGtcbP5W3ehF6NqwYYJ6FJqsNawwNcfwJKqNHYjJ4FrSSjbQiK6RSqCTtQq77zAc9pi6MHiUca2eaCHA" ], "script": "base64:BgL5HwgCEgMKAQgSAwoBCBIDCgEIEgASABIECgIIARIGCgQCAQICEgMKAQgSAwoBCBIFCgMICAQSBgoEARgIGBIECgIYCBIECgIICBIECgIICBIDCgEIEgQKAggIIgZTQ0FMRTgiBU1VTFQ4IgdTQ0FMRTE4IgZNVUxUMTgiA1NFUCIOUE9PTFdFSUdIVE1VTFQiCnplcm9CaWdJbnQiCW9uZUJpZ0ludCIHd3JhcEVyciIDbXNnIgh0aHJvd0VyciIJYXNBbnlMaXN0IgN2YWwiByRtYXRjaDAiCnZhbEFueUx5c3QiBWFzSW50IgZ2YWxJbnQiCGFzU3RyaW5nIgZ2YWxTdHIiDGFzQnl0ZVZlY3RvciIGdmFsQmluIg9nZXRTdHJpbmdPckZhaWwiB2FkZHJlc3MiA2tleSIYZ2V0U3RyaW5nQnlBZGRyZXNzT3JGYWlsIgxnZXRJbnRPclplcm8iD2dldEludE9yRGVmYXVsdCIKZGVmYXVsdFZhbCIMZ2V0SW50T3JGYWlsIhlnZXRCaWdJbnRGcm9tU3RyaW5nT3JaZXJvIhxnZXRCaWdJbnRGcm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BAgtNYXRjaCBlcnJvcgkAAgECJFN0cmljdCB2YWx1ZSBpcyBub3QgZXF1YWwgdG8gaXRzZWxmLgJjbAEOb25Nb2RpZnlXZWlnaHQCAmF0AmJ4AwkBAiE9AggFAmNsBmNhbGxlcgUCYVgJAAIBAhJwZXJtaXNzaW9ucyBkZW5pZWQEAmR5CQECYncDBQJhdAUCYngAAAQCYnUIBQJkeQJfMQQCYlcIBQJkeQJfMgQCYlgIBQJkeQJfMwUCYlcBAmR6AQJkQQAEAmRCBAFuCQECY2gAAwkAAQIFAW4CCkJ5dGVWZWN0b3IEAmNuBQFuBQJjbgMJAAECBQFuAgRVbml0CAUCZHoPc2VuZGVyUHVibGljS2V5CQACAQILTWF0Y2ggZXJyb3IJAPQDAwgFAmR6CWJvZHlCeXRlcwkAkQMCCAUCZHoGcHJvb2ZzAAAFAmRCMU9Meg==", "height": 2489388, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 2BxzSun9bdECvdFx65B5UjpGouhuFGnnfqE3JdhFLXd6 Next: 3XUhGSMVyjARkke1Xx8yGnfY6VnjUwSSyNGQeYTXVC8Z 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)
442435 else false)
443436 then deleteNodeActions(listName, userAddressStr)
444437 else nil
445- let refreshStakedVote = if ((amount == stakedByUser))
446- then invoke(boostingContract, "onStakedVoteUpdate", [lpAssetIdStr, userAddressStr, false], nil)
438+ let claimedByUserMinReward = getBigIntFromStringOrZero(this, keyClaimedByUserMinReward(lpAssetIdStr, userAddressStr))
439+ let wxToClaimUserNew = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, 0)._1
440+ let availableToClaim = (wxToClaimUserNew - claimedByUserMinReward)
441+ let throwIfNothingToClaim = true
442+ let r = if ((availableToClaim > zeroBigInt))
443+ then invoke(this, "claimWxINTERNAL", [lpAssetIdStr, userAddressStr, throwIfNothingToClaim], nil)
447444 else unit
448- if ((refreshStakedVote == refreshStakedVote))
449- then {
450- let claimedByUserMinReward = getBigIntFromStringOrZero(this, keyClaimedByUserMinReward(lpAssetIdStr, userAddressStr))
451- let wxToClaimUserNew = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, 0)._1
452- let availableToClaim = (wxToClaimUserNew - claimedByUserMinReward)
453- let throwIfNothingToClaim = true
454- let r = if ((availableToClaim > zeroBigInt))
455- then invoke(this, "claimWxINTERNAL", [lpAssetIdStr, userAddressStr, throwIfNothingToClaim], nil)
456- else unit
457- if ((r == r))
458- then if ((amount > stakedByUser))
459- then throw(((((((("passed amount=" + toString(amount)) + " is greater than available=") + toString(stakedByUser)) + ". lpAssetId=") + lpAssetIdStr) + ". stakedByUserKEY=") + stakedByUserKEY))
460- else (([IntegerEntry(stakedByUserKEY, (stakedByUser - amount)), IntegerEntry(stakedTotalKEY, (stakedTotal - amount)), ScriptTransfer(lpAssetRecipientAddress, amount, lpAssetId), OperationHistoryEntry("unstake", userAddressStr, lpAssetIdStr, amount, i.transactionId)] ++ integralSTATE) ++ listActions)
461- else throw("Strict value is not equal to itself.")
462- }
445+ if ((r == r))
446+ then if ((amount > stakedByUser))
447+ then throw(((((((("passed amount=" + toString(amount)) + " is greater than available=") + toString(stakedByUser)) + ". lpAssetId=") + lpAssetIdStr) + ". stakedByUserKEY=") + stakedByUserKEY))
448+ else (([IntegerEntry(stakedByUserKEY, (stakedByUser - amount)), IntegerEntry(stakedTotalKEY, (stakedTotal - amount)), ScriptTransfer(lpAssetRecipientAddress, amount, lpAssetId), OperationHistoryEntry("unstake", userAddressStr, lpAssetIdStr, amount, i.transactionId)] ++ integralSTATE) ++ listActions)
463449 else throw("Strict value is not equal to itself.")
464450 }
465451
537523 let stakedByUserKEY = keyStakedByUser(userAddressStr, lpAssetIdStr)
538524 let stakedTotalKEY = keyStakedTotal(lpAssetIdStr)
539525 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.")
526+ let stakedTotal = readStaked(stakedTotalKEY)
527+ let $t02127621393 = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, amount)
528+ let wxToClaimUserNew = $t02127621393._1
529+ let integralSTATE = $t02127621393._2
530+ let debug = $t02127621393._3
531+ let listName = getUsersListName(lpAssetIdStr)
532+ let listActions = if (containsNode(listName, userAddressStr))
533+ then nil
534+ else insertNodeActions(listName, userAddressStr)
535+ (([IntegerEntry(stakedByUserKEY, (stakedByUser + amount)), IntegerEntry(stakedTotalKEY, (stakedTotal + amount)), OperationHistoryEntry("stake", userAddressStr, lpAssetIdStr, amount, i.transactionId)] ++ integralSTATE) ++ listActions)
557536 }
558537
559538
625604 let claimedByUserMinReward = getBigIntFromStringOrZero(this, claimedByUserMinRewardKEY)
626605 let claimedByUserBoostReward = getBigIntFromStringOrZero(this, claimedByUserBoostRewardKEY)
627606 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
607+ let $t02477924891 = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, 0)
608+ let wxToClaimUserNew = $t02477924891._1
609+ let integralSTATE = $t02477924891._2
610+ let debug = $t02477924891._3
632611 let availableToClaim = max([(wxToClaimUserNew - claimedByUserMinReward), zeroBigInt])
633612 if ((zeroBigInt >= availableToClaim))
634613 then if (throwIfNothingToClaim)
637616 else {
638617 let wxAmountBoostTotal = max([asInt(asAnyList(invoke(boostingContract, "claimWxBoost", [lpAssetIdStr, userAddressStr], nil))[0]), 0])
639618 let minRewardPart = availableToClaim
640- let boostRewardPart = min([(minRewardPart * toBigInt((boostCoeff - 1))), toBigInt(wxAmountBoostTotal)])
619+ let boostRewardPart = min([(minRewardPart * toBigInt(2)), toBigInt(wxAmountBoostTotal)])
641620 let totalReward = (minRewardPart + boostRewardPart)
642621 let wxAssetId = asByteVector(asAnyList(invoke(emissionContract, "emit", [toInt(minRewardPart)], nil))[0])
643622 let emitBoost = asAnyList(invoke(emissionContract, "emit", [toInt(boostRewardPart)], nil))
670649 }, SEP)
671650 let unclaimed = info[3]
672651 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))
652+ let res = (resAcc :+ makeString(["%d%d", unclaimed, claimed], SEP))
680653 let inv = {
681654 let @ = invoke(this, "claimWxBulkInternalREADONLY", [(currentIter + 1), lpAssetIds, userAddressStr, res], nil)
682655 if ($isInstanceOf(@, "List[Any]"))
717690 else (height - emissionStartBlock)
718691 let poolWxEmission = fraction((wxEmissionPerBlock * passedBlocks), poolWeight, POOLWEIGHTMULT)
719692 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
693+ let $t02870028812 = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, 0)
694+ let wxToClaimUserNew = $t02870028812._1
695+ let integralSTATE = $t02870028812._2
696+ let debug = $t02870028812._3
724697 let availableToClaim = max([(wxToClaimUserNew - claimedByUserMinReward), zeroBigInt])
725698 let boostInvResult = asAnyList(invoke(boostingContract, "claimWxBoostREADONLY", [lpAssetIdStr, userAddressStr], nil))
726699 let wxAmountBoostTotal = max([asInt(boostInvResult[0]), 0])
727700 let boostDebug = asString(boostInvResult[1])
728701 let minRewardPart = availableToClaim
729- let boostRewardPart = min([(minRewardPart * toBigInt((boostCoeff - 1))), toBigInt(wxAmountBoostTotal)])
702+ let boostRewardPart = min([(minRewardPart * toBigInt(2)), toBigInt(wxAmountBoostTotal)])
730703 let totalReward = (minRewardPart + boostRewardPart)
731704 $Tuple2(nil, makeString(["%s%s%d%d%d%d%s", lpAssetIdStr, userAddressStr, toString(totalReward), toString(claimedByUser), toString(minRewardPart), toString(boostRewardPart), "soon"], SEP))
732705 }
796769 func onModifyWeight (lpAssetIdStr,poolAddressStr) = if ((i.caller != factoryContract))
797770 then throw("permissions denied")
798771 else {
799- let $t03200232112 = refreshPoolINTEGRALS(lpAssetIdStr, poolAddressStr, 0)
800- let wxPerLpIntegralNew = $t03200232112._1
801- let poolIntegralSTATE = $t03200232112._2
802- let poolDEBUG = $t03200232112._3
772+ let $t03141831528 = refreshPoolINTEGRALS(lpAssetIdStr, poolAddressStr, 0)
773+ let wxPerLpIntegralNew = $t03141831528._1
774+ let poolIntegralSTATE = $t03141831528._2
775+ let poolDEBUG = $t03141831528._3
803776 poolIntegralSTATE
804777 }
805778
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let SCALE8 = 8
5-
6-let MULT3 = 1000
75
86 let MULT8 = 100000000
97
108 let SCALE18 = 18
119
1210 let MULT18 = toBigInt(1000000000000000000)
1311
1412 let SEP = "__"
1513
1614 let POOLWEIGHTMULT = MULT8
1715
1816 let zeroBigInt = toBigInt(0)
1917
2018 let oneBigInt = toBigInt(1)
2119
2220 func wrapErr (msg) = makeString(["staking.ride:", toString(this), msg], " ")
2321
2422
2523 func throwErr (msg) = throw(wrapErr(msg))
2624
2725
2826 func asAnyList (val) = match val {
2927 case valAnyLyst: List[Any] =>
3028 valAnyLyst
3129 case _ =>
3230 throw("fail to cast into List[Any]")
3331 }
3432
3533
3634 func asInt (val) = match val {
3735 case valInt: Int =>
3836 valInt
3937 case _ =>
4038 throw("fail to cast into Int")
4139 }
4240
4341
4442 func asString (val) = match val {
4543 case valStr: String =>
4644 valStr
4745 case _ =>
4846 throw("fail to cast into Int")
4947 }
5048
5149
5250 func asByteVector (val) = match val {
5351 case valBin: ByteVector =>
5452 valBin
5553 case _ =>
5654 throw("fail to cast into Int")
5755 }
5856
5957
6058 func getStringOrFail (address,key) = valueOrErrorMessage(getString(address, key), (("mandatory this." + key) + " is not defined"))
6159
6260
6361 func getStringByAddressOrFail (address,key) = valueOrErrorMessage(getString(address, key), (((("mandatory " + toString(address)) + ".") + key) + " is not defined"))
6462
6563
6664 func getIntOrZero (address,key) = valueOrElse(getInteger(address, key), 0)
6765
6866
6967 func getIntOrDefault (address,key,defaultVal) = valueOrElse(getInteger(address, key), defaultVal)
7068
7169
7270 func getIntOrFail (address,key) = valueOrErrorMessage(getInteger(address, key), (("mandatory this." + key) + " is not defined"))
7371
7472
7573 func getBigIntFromStringOrZero (address,key) = value(parseBigInt(valueOrElse(getString(address, key), "0")))
7674
7775
7876 func getBigIntFromStringOrDefault (address,key,defaultVal) = match getString(address, key) {
7977 case s: String =>
8078 value(parseBigInt(s))
8179 case _: Unit =>
8280 defaultVal
8381 case _ =>
8482 throw("Match error")
8583 }
8684
8785
8886 func toX18 (origVal,origScaleMult) = fraction(toBigInt(origVal), MULT18, toBigInt(origScaleMult))
8987
9088
9189 func fromX18 (val,resultScaleMult) = toInt(fraction(val, toBigInt(resultScaleMult), MULT18))
9290
9391
9492 func keyFactoryAddress () = "%s%s__config__factoryAddress"
9593
9694
9795 func keyVotingEmissionContract () = "%s__votingEmissionContract"
9896
9997
10098 let IdxFactoryCfgStakingDapp = 1
10199
102100 let IdxFactoryCfgBoostingDapp = 2
103101
104102 let IdxFactoryCfgIdoDapp = 3
105103
106104 let IdxFactoryCfgTeamDapp = 4
107105
108106 let IdxFactoryCfgEmissionDapp = 5
109107
110108 let IdxFactoryCfgRestDapp = 6
111109
112110 let IdxFactoryCfgSlippageDapp = 7
113111
114112 func keyFactoryCfg () = "%s__factoryConfig"
115113
116114
117115 func keyManagerPublicKey () = "%s__managerPublicKey"
118116
119117
120118 func keyPendingManagerPublicKey () = "%s__pendingManagerPublicKey"
121119
122120
123121 func keyStablePoolAddonAddr () = "%s__stablePoolAddonAddr"
124122
125123
126124 func keyAddonAddr () = "%s__addonAddr"
127125
128126
129127 func keyFactoryLp2AssetsMapping (lpAssetStr) = makeString(["%s%s%s", lpAssetStr, "mappings__lpAsset2PoolContract"], SEP)
130128
131129
132130 func keyFactoryLpList () = "%s__lpTokensList"
133131
134132
135133 func keyFactoryLpAssetToPoolContractAddress (lpAssetStr) = makeString(["%s%s%s", lpAssetStr, "mappings__lpAsset2PoolContract"], SEP)
136134
137135
138136 func keyFactoryPoolWeight (contractAddress) = makeString(["%s%s", "poolWeight", contractAddress], SEP)
139137
140138
141139 func readLpList (factory) = split(valueOrElse(getString(factory, keyFactoryLpList()), ""), SEP)
142140
143141
144142 func readFactoryCfgOrFail (factory) = split(getStringByAddressOrFail(factory, keyFactoryCfg()), SEP)
145143
146144
147145 func getBoostingAddressOrFail (factoryCfg) = addressFromStringValue(factoryCfg[IdxFactoryCfgBoostingDapp])
148146
149147
150148 func getEmissionAddressOrFail (factoryCfg) = addressFromStringValue(factoryCfg[IdxFactoryCfgEmissionDapp])
151149
152150
153151 func getStakingAddressOrFail (factoryCfg) = addressFromStringValue(factoryCfg[IdxFactoryCfgStakingDapp])
154152
155153
156154 func keyEmissionRatePerBlockCurrent () = "%s%s__ratePerBlock__current"
157155
158156
159157 func keyEmissionRatePerBlockMaxCurrent () = "%s%s__ratePerBlockMax__current"
160158
161159
162160 func keyEmissionStartBlock () = "%s%s__emission__startBlock"
163161
164162
165163 func keyEmissionDurationInBlocks () = "%s%s__emission__duration"
166164
167165
168166 func keyEmissionEndBlock () = "%s%s__emission__endBlock"
169167
170168
171169 func keyStakedByUser (userAddressStr,lpAssetIdStr) = makeString(["%s%s%s__staked", userAddressStr, lpAssetIdStr], SEP)
172170
173171
174172 func keyStakedTotal (lpAssetIdStr) = ("%s%s%s__staked__total__" + lpAssetIdStr)
175173
176174
177175 func keyClaimedByUser (lpAssetIdStr,userAddressStr) = makeString(["%s%s%s__claimed", userAddressStr, lpAssetIdStr], SEP)
178176
179177
180178 func keyClaimedByUserMinReward (lpAssetIdStr,userAddressStr) = makeString(["%s%s%s__claimedMinReward", userAddressStr, lpAssetIdStr], SEP)
181179
182180
183181 func keyClaimedByUserBoostReward (lpAssetIdStr,userAddressStr) = makeString(["%s%s%s__claimedBoostReward", userAddressStr, lpAssetIdStr], SEP)
184182
185183
186184 func keyClaimedTotal (lpAssetIdStr) = makeString(["%s%s%s__claimed__total", lpAssetIdStr], SEP)
187185
188186
189187 func readStaked (key) = valueOrElse(getInteger(this, key), 0)
190188
191189
192190 func keyLastTotalLpBalance (lpAssetId) = makeString(["%s%s%s", lpAssetId, "total", "bal"], SEP)
193191
194192
195193 func keyLastUserLpBalance (lpAssetId,userAddress) = makeString(["%s%s%s", lpAssetId, userAddress, "bal"], SEP)
196194
197195
198196 func keyTotalLpBalanceIntegral (lpAssetId) = makeString(["%s%s%s", lpAssetId, "total", "balINT"], SEP)
199197
200198
201199 func keyUserLpBalanceIntegral (lpAssetId,userAddress) = makeString(["%s%s%s", lpAssetId, userAddress, "balINT"], SEP)
202200
203201
204202 func keyTotalLpBalanceIntegralLastUpdHeight (lpAssetId) = makeString(["%s%s%s", lpAssetId, "total", "lastUpd"], SEP)
205203
206204
207205 func keyUserLpBalanceIntegralLastUpdHeight (lpAssetId,userAddress) = makeString(["%s%s%s", lpAssetId, userAddress, "lastUpd"], SEP)
208206
209207
210208 func keyWxPerLpIntegral (lpAssetId) = makeString(["%s%s%s%s", lpAssetId, "common", "lpInt"], SEP)
211209
212210
213211 func keyWxPerLpIntegralLastUpdHeight (lpAssetId) = makeString(["%s%s%s%s", lpAssetId, "common", "lpIntH"], SEP)
214212
215213
216214 func keyWxToClaimUser (lpAssetId,userAddress) = makeString(["%s%s%s%s", lpAssetId, userAddress, "lpInt"], SEP)
217215
218216
219217 func keyWxPerLpIntegralUserLastUpdHeight (lpAssetId,userAddress) = makeString(["%s%s%s%s", lpAssetId, userAddress, "lpIntH"], SEP)
220218
221219
222220 func keyWxPerLp (lpAssetId) = makeString(["%s", lpAssetId, "wxPerLp"], SEP)
223221
224222
225223 func keyWxPerLpX18 (lpAssetId) = makeString(["%s", lpAssetId, "wxPerLpX18"], SEP)
226224
227225
228226 func keyWxPerLpIntegralUserLast (lpAssetId,userAddress) = makeString(["%s%s%s%s", lpAssetId, userAddress, "uIntL"], SEP)
229227
230228
231229 func keyOperationHistoryRecord (type,userAddress,txId58) = makeString(["%s%s%s%s__history", type, userAddress, txId58], SEP)
232230
233231
234232 func formatHistoryRecord (userAddress,lpAssetId,type,amount) = makeString(["%s%s%s%d%d%d", userAddress, lpAssetId, type, toString(height), toString(lastBlock.timestamp), toString(amount)], SEP)
235233
236234
237235 func OperationHistoryEntry (type,userAddress,lpAssetId,amount,txId) = StringEntry(keyOperationHistoryRecord(type, userAddress, toBase58String(txId)), formatHistoryRecord(userAddress, lpAssetId, type, amount))
238236
239237
240238 let factoryAddress = getStringOrFail(this, keyFactoryAddress())
241239
242240 let factoryContract = addressFromStringValue(factoryAddress)
243241
244242 let factoryCfg = readFactoryCfgOrFail(factoryContract)
245243
246244 let emissionContract = getEmissionAddressOrFail(factoryCfg)
247245
248246 let boostingContract = getBoostingAddressOrFail(factoryCfg)
249247
250-let boostCoeff = {
251- let @ = invoke(emissionContract, "getBoostCoeffREADONLY", nil, nil)
252- if ($isInstanceOf(@, "Int"))
253- then @
254- else throw(($getType(@) + " couldn't be cast to Int"))
255- }
256-
257248 let lpStakingPoolsContract = valueOrErrorMessage(addressFromString(valueOrErrorMessage(getString(makeString(["%s", "lpStakingPoolsContract"], SEP)), wrapErr("lp_staking_pools contract address is undefined"))), wrapErr("invalid lp_staking_pools contract address"))
258249
259250 func keyNextUser (lpAssetId) = makeString(["%s%s", lpAssetId, "nextUser"], SEP)
260251
261252
262253 func getUsersListName (lpAssetId) = makeString(["users", lpAssetId], SEP)
263254
264255
265256 func keyListHead (listName) = makeString(["%s%s%s", listName, "head"], SEP)
266257
267258
268259 func keyListSize (listName) = makeString(["%s%s%s", listName, "size"], SEP)
269260
270261
271262 func keyListPrev (listName,id) = makeString(["%s%s%s%s", listName, id, "prev"], SEP)
272263
273264
274265 func keyListNext (listName,id) = makeString(["%s%s%s%s", listName, id, "next"], SEP)
275266
276267
277268 func containsNode (listName,id) = {
278269 let headOrUnit = getString(this, keyListHead(listName))
279270 let prevOrUnit = getString(this, keyListPrev(listName, id))
280271 let nextOrUnit = getString(this, keyListNext(listName, id))
281272 if (if ((id == valueOrElse(headOrUnit, "")))
282273 then true
283274 else (prevOrUnit != unit))
284275 then true
285276 else (nextOrUnit != unit)
286277 }
287278
288279
289280 func insertNodeActions (listName,id) = {
290281 let headOrUnit = getString(this, keyListHead(listName))
291282 let listSize = valueOrElse(getInteger(this, keyListSize(listName)), 0)
292283 let checkNode = if (!(containsNode(listName, id)))
293284 then true
294285 else throw("Node exists")
295286 if ((checkNode == checkNode))
296287 then (([IntegerEntry(keyListSize(listName), (listSize + 1))] ++ (if ((headOrUnit != unit))
297288 then [StringEntry(keyListNext(listName, id), value(headOrUnit)), StringEntry(keyListPrev(listName, value(headOrUnit)), id)]
298289 else nil)) ++ [StringEntry(keyListHead(listName), id)])
299290 else throw("Strict value is not equal to itself.")
300291 }
301292
302293
303294 func deleteNodeActions (listName,id) = {
304295 let headOrUnit = getString(this, keyListHead(listName))
305296 let listSize = valueOrElse(getInteger(this, keyListSize(listName)), 0)
306297 let prevOrUnit = getString(this, keyListPrev(listName, id))
307298 let nextOrUnit = getString(this, keyListNext(listName, id))
308299 ([IntegerEntry(keyListSize(listName), (listSize - 1))] ++ (if (if ((prevOrUnit != unit))
309300 then (nextOrUnit != unit)
310301 else false)
311302 then [StringEntry(keyListNext(listName, value(prevOrUnit)), value(nextOrUnit)), StringEntry(keyListPrev(listName, value(nextOrUnit)), value(prevOrUnit)), DeleteEntry(keyListPrev(listName, id)), DeleteEntry(keyListNext(listName, id))]
312303 else if ((nextOrUnit != unit))
313304 then [StringEntry(keyListHead(listName), value(nextOrUnit)), DeleteEntry(keyListNext(listName, id)), DeleteEntry(keyListPrev(listName, value(nextOrUnit)))]
314305 else if ((prevOrUnit != unit))
315306 then [DeleteEntry(keyListPrev(listName, id)), DeleteEntry(keyListNext(listName, value(prevOrUnit)))]
316307 else if ((id == valueOrElse(headOrUnit, "")))
317308 then [DeleteEntry(keyListHead(listName))]
318309 else throw(((("invalid node: " + listName) + ".") + id))))
319310 }
320311
321312
322313 func calcWxPerLpIntegralUserLast (stakedByUser,wxPerLpIntegralUserLastUpdHeightOrZero,wxPerLpIntegralNew,wxPerLpIntegralUserLastKEY) = if (if ((wxPerLpIntegralUserLastUpdHeightOrZero == zeroBigInt))
323314 then (stakedByUser > zeroBigInt)
324315 else false)
325316 then zeroBigInt
326317 else if ((stakedByUser == zeroBigInt))
327318 then wxPerLpIntegralNew
328319 else if (if ((wxPerLpIntegralUserLastUpdHeightOrZero > zeroBigInt))
329320 then (stakedByUser > zeroBigInt)
330321 else false)
331322 then value(parseBigInt(getStringOrFail(this, wxPerLpIntegralUserLastKEY)))
332323 else throw("calcWxPerLpIntegralUserLast: unexpected state")
333324
334325
335326 func refreshPoolINTEGRALS (lpAssetIdStr,poolAddressStr,lpDeltaAmount) = {
336327 let stakedTotalKEY = keyStakedTotal(lpAssetIdStr)
337328 let stakedTotal = toBigInt(readStaked(stakedTotalKEY))
338329 let nonZeroStakedTotal = if ((stakedTotal == zeroBigInt))
339330 then oneBigInt
340331 else stakedTotal
341332 let poolWeight = getIntegerValue(factoryContract, keyFactoryPoolWeight(poolAddressStr))
342333 let emissionStartBlock = getIntOrFail(emissionContract, keyEmissionStartBlock())
334+ let MULT3 = 1000
343335 let wxEmissionPerBlockX3 = (getIntOrFail(emissionContract, keyEmissionRatePerBlockCurrent()) * MULT3)
344- let poolWxEmissionPerBlockX3 = fraction(wxEmissionPerBlockX3, poolWeight, (POOLWEIGHTMULT * boostCoeff))
336+ let poolWxEmissionPerBlockX3 = fraction(wxEmissionPerBlockX3, poolWeight, (POOLWEIGHTMULT * 3))
345337 let wxPerLpIntegralKEY = keyWxPerLpIntegral(lpAssetIdStr)
346338 let wxPerLpIntegralLastUpdHeightKEY = keyWxPerLpIntegralLastUpdHeight(lpAssetIdStr)
347339 let wxPerLpKEY = keyWxPerLp(lpAssetIdStr)
348340 let wxPerLpIntegralLastUpdHeight = getIntOrDefault(this, wxPerLpIntegralLastUpdHeightKEY, emissionStartBlock)
349341 let wxPerLpIntegral = getBigIntFromStringOrZero(this, wxPerLpIntegralKEY)
350342 let wxPerLpOrZeroX3 = 0
351343 let dh = max([(height - wxPerLpIntegralLastUpdHeight), 0])
352344 let wxPerLpX3 = if ((wxPerLpOrZeroX3 != 0))
353345 then toBigInt(wxPerLpOrZeroX3)
354346 else fraction(toBigInt(poolWxEmissionPerBlockX3), toBigInt(MULT8), nonZeroStakedTotal)
355347 let stakedTotalNew = (stakedTotal + toBigInt(lpDeltaAmount))
356348 let nonZeroStakedTotalNew = if ((stakedTotalNew == zeroBigInt))
357349 then oneBigInt
358350 else stakedTotalNew
359351 let wxPerLpIntegralNew = (wxPerLpIntegral + (wxPerLpX3 * toBigInt(dh)))
360352 let wxPerLpX3New = (toBigInt(poolWxEmissionPerBlockX3) / nonZeroStakedTotalNew)
361353 let wxPerLpIntegralLastUpdHeightNew = height
362354 let debug = makeString([toString(wxPerLpIntegralNew), toString(dh), toString(wxPerLpX3), toString(stakedTotal), toString(poolWxEmissionPerBlockX3), toString(wxEmissionPerBlockX3), toString(poolWeight)], "::")
363355 $Tuple3(wxPerLpIntegralNew, [StringEntry(wxPerLpIntegralKEY, toString(wxPerLpIntegralNew)), IntegerEntry(wxPerLpIntegralLastUpdHeightKEY, wxPerLpIntegralLastUpdHeightNew), StringEntry(wxPerLpKEY, toString(wxPerLpX3New))], debug)
364356 }
365357
366358
367359 func refreshINTEGRALS (lpAssetIdStr,userAddressStr,poolAddressStr,lpDeltaAmount) = {
368- let $t01476214884 = refreshPoolINTEGRALS(lpAssetIdStr, poolAddressStr, lpDeltaAmount)
369- let wxPerLpIntegralNew = $t01476214884._1
370- let poolIntegralSTATE = $t01476214884._2
371- let poolDEBUG = $t01476214884._3
360+ let $t01475014872 = refreshPoolINTEGRALS(lpAssetIdStr, poolAddressStr, lpDeltaAmount)
361+ let wxPerLpIntegralNew = $t01475014872._1
362+ let poolIntegralSTATE = $t01475014872._2
363+ let poolDEBUG = $t01475014872._3
364+ let MULT3 = 1000
372365 let stakedByUserKEY = keyStakedByUser(userAddressStr, lpAssetIdStr)
373366 let stakedByUser = readStaked(stakedByUserKEY)
374367 let wxToClaimUserKEY = keyWxToClaimUser(lpAssetIdStr, userAddressStr)
375368 let wxPerLpIntegralUserLastUpdHeightKEY = keyWxPerLpIntegralUserLastUpdHeight(lpAssetIdStr, userAddressStr)
376369 let wxPerLpIntegralUserLastKEY = keyWxPerLpIntegralUserLast(lpAssetIdStr, userAddressStr)
377370 let wxToClaimUser = getBigIntFromStringOrZero(this, wxToClaimUserKEY)
378371 let wxPerLpIntegralUserLastUpdHeightOrZero = getIntOrZero(this, wxPerLpIntegralUserLastUpdHeightKEY)
379372 let wxPerLpIntegralUserLast = calcWxPerLpIntegralUserLast(toBigInt(stakedByUser), toBigInt(wxPerLpIntegralUserLastUpdHeightOrZero), wxPerLpIntegralNew, wxPerLpIntegralUserLastKEY)
380373 let MULT11 = (MULT8 * MULT3)
381374 let wxToClaimUserNew = max([(wxToClaimUser + fraction((wxPerLpIntegralNew - wxPerLpIntegralUserLast), toBigInt(stakedByUser), toBigInt(MULT11))), zeroBigInt])
382375 let wxPerLpIntegralUserLastNew = wxPerLpIntegralNew
383376 let wxPerLpIntegralUserLastUpdHeightNew = height
384377 let debug = makeString([toString(wxToClaimUser), toString(wxPerLpIntegralUserLast), toString(stakedByUser), poolDEBUG, toString(height)], "::")
385378 $Tuple3(wxToClaimUserNew, (poolIntegralSTATE ++ [StringEntry(wxToClaimUserKEY, toString(wxToClaimUserNew)), IntegerEntry(wxPerLpIntegralUserLastUpdHeightKEY, wxPerLpIntegralUserLastUpdHeightNew), StringEntry(wxPerLpIntegralUserLastKEY, toString(wxPerLpIntegralUserLastNew))]), debug)
386379 }
387380
388381
389382 func managerPublicKeyOrUnit () = match getString(keyManagerPublicKey()) {
390383 case s: String =>
391384 fromBase58String(s)
392385 case _: Unit =>
393386 unit
394387 case _ =>
395388 throw("Match error")
396389 }
397390
398391
399392 func pendingManagerPublicKeyOrUnit () = match getString(keyPendingManagerPublicKey()) {
400393 case s: String =>
401394 fromBase58String(s)
402395 case _: Unit =>
403396 unit
404397 case _ =>
405398 throw("Match error")
406399 }
407400
408401
409402 let permissionDeniedError = throw("Permission denied")
410403
411404 func mustThis (i) = if ((i.caller == this))
412405 then true
413406 else permissionDeniedError
414407
415408
416409 func mustManager (i) = match managerPublicKeyOrUnit() {
417410 case pk: ByteVector =>
418411 if ((i.callerPublicKey == pk))
419412 then true
420413 else permissionDeniedError
421414 case _: Unit =>
422415 if ((i.caller == this))
423416 then true
424417 else permissionDeniedError
425418 case _ =>
426419 throw("Match error")
427420 }
428421
429422
430423 func unstakeActions (i,lpAssetId,poolAddress,userAddress,lpAssetRecipientAddress,amount) = {
431424 let userAddressStr = toString(userAddress)
432425 let lpAssetIdStr = toBase58String(lpAssetId)
433426 let poolAddressStr = toString(poolAddress)
434427 let stakedByUserKEY = keyStakedByUser(userAddressStr, lpAssetIdStr)
435428 let stakedTotalKEY = keyStakedTotal(lpAssetIdStr)
436429 let stakedByUser = readStaked(stakedByUserKEY)
437430 let stakedTotal = readStaked(stakedTotalKEY)
438431 let integralSTATE = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, -(amount))._2
439432 let listName = getUsersListName(lpAssetIdStr)
440433 let listActions = if (if (containsNode(listName, userAddressStr))
441434 then (amount == stakedByUser)
442435 else false)
443436 then deleteNodeActions(listName, userAddressStr)
444437 else nil
445- let refreshStakedVote = if ((amount == stakedByUser))
446- then invoke(boostingContract, "onStakedVoteUpdate", [lpAssetIdStr, userAddressStr, false], nil)
438+ let claimedByUserMinReward = getBigIntFromStringOrZero(this, keyClaimedByUserMinReward(lpAssetIdStr, userAddressStr))
439+ let wxToClaimUserNew = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, 0)._1
440+ let availableToClaim = (wxToClaimUserNew - claimedByUserMinReward)
441+ let throwIfNothingToClaim = true
442+ let r = if ((availableToClaim > zeroBigInt))
443+ then invoke(this, "claimWxINTERNAL", [lpAssetIdStr, userAddressStr, throwIfNothingToClaim], nil)
447444 else unit
448- if ((refreshStakedVote == refreshStakedVote))
449- then {
450- let claimedByUserMinReward = getBigIntFromStringOrZero(this, keyClaimedByUserMinReward(lpAssetIdStr, userAddressStr))
451- let wxToClaimUserNew = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, 0)._1
452- let availableToClaim = (wxToClaimUserNew - claimedByUserMinReward)
453- let throwIfNothingToClaim = true
454- let r = if ((availableToClaim > zeroBigInt))
455- then invoke(this, "claimWxINTERNAL", [lpAssetIdStr, userAddressStr, throwIfNothingToClaim], nil)
456- else unit
457- if ((r == r))
458- then if ((amount > stakedByUser))
459- then throw(((((((("passed amount=" + toString(amount)) + " is greater than available=") + toString(stakedByUser)) + ". lpAssetId=") + lpAssetIdStr) + ". stakedByUserKEY=") + stakedByUserKEY))
460- else (([IntegerEntry(stakedByUserKEY, (stakedByUser - amount)), IntegerEntry(stakedTotalKEY, (stakedTotal - amount)), ScriptTransfer(lpAssetRecipientAddress, amount, lpAssetId), OperationHistoryEntry("unstake", userAddressStr, lpAssetIdStr, amount, i.transactionId)] ++ integralSTATE) ++ listActions)
461- else throw("Strict value is not equal to itself.")
462- }
445+ if ((r == r))
446+ then if ((amount > stakedByUser))
447+ then throw(((((((("passed amount=" + toString(amount)) + " is greater than available=") + toString(stakedByUser)) + ". lpAssetId=") + lpAssetIdStr) + ". stakedByUserKEY=") + stakedByUserKEY))
448+ else (([IntegerEntry(stakedByUserKEY, (stakedByUser - amount)), IntegerEntry(stakedTotalKEY, (stakedTotal - amount)), ScriptTransfer(lpAssetRecipientAddress, amount, lpAssetId), OperationHistoryEntry("unstake", userAddressStr, lpAssetIdStr, amount, i.transactionId)] ++ integralSTATE) ++ listActions)
463449 else throw("Strict value is not equal to itself.")
464450 }
465451
466452
467453 @Callable(i)
468454 func constructor (factoryAddressStr) = {
469455 let checkCaller = mustManager(i)
470456 if ((checkCaller == checkCaller))
471457 then [StringEntry(keyFactoryAddress(), factoryAddressStr)]
472458 else throw("Strict value is not equal to itself.")
473459 }
474460
475461
476462
477463 @Callable(i)
478464 func constructorV2 (votingEmissionContract) = {
479465 let cheks = [mustManager(i), if ((addressFromString(votingEmissionContract) != unit))
480466 then true
481467 else "invalid voting emission contract address"]
482468 if ((cheks == cheks))
483469 then [StringEntry(keyVotingEmissionContract(), votingEmissionContract)]
484470 else throw("Strict value is not equal to itself.")
485471 }
486472
487473
488474
489475 @Callable(i)
490476 func setManager (pendingManagerPublicKey) = {
491477 let checkCaller = mustManager(i)
492478 if ((checkCaller == checkCaller))
493479 then {
494480 let checkManagerPublicKey = fromBase58String(pendingManagerPublicKey)
495481 if ((checkManagerPublicKey == checkManagerPublicKey))
496482 then [StringEntry(keyPendingManagerPublicKey(), pendingManagerPublicKey)]
497483 else throw("Strict value is not equal to itself.")
498484 }
499485 else throw("Strict value is not equal to itself.")
500486 }
501487
502488
503489
504490 @Callable(i)
505491 func confirmManager () = {
506492 let pm = pendingManagerPublicKeyOrUnit()
507493 let hasPM = if (isDefined(pm))
508494 then true
509495 else throw("No pending manager")
510496 if ((hasPM == hasPM))
511497 then {
512498 let checkPM = if ((i.callerPublicKey == value(pm)))
513499 then true
514500 else throw("You are not pending manager")
515501 if ((checkPM == checkPM))
516502 then [StringEntry(keyManagerPublicKey(), toBase58String(value(pm))), DeleteEntry(keyPendingManagerPublicKey())]
517503 else throw("Strict value is not equal to itself.")
518504 }
519505 else throw("Strict value is not equal to itself.")
520506 }
521507
522508
523509
524510 @Callable(i)
525511 func stake () = if ((size(i.payments) != 1))
526512 then throw("invalid payment - exact one payment must be attached")
527513 else {
528514 let pmt = i.payments[0]
529515 let lpAssetId = value(pmt.assetId)
530516 let lpAssetIdStr = toBase58String(lpAssetId)
531517 let amount = pmt.amount
532518 let poolAddressStr = valueOrErrorMessage(getString(factoryContract, keyFactoryLp2AssetsMapping(lpAssetIdStr)), ("unsupported lp asset " + lpAssetIdStr))
533519 let callerStr = toString(i.caller)
534520 let userAddressStr = if ((callerStr == poolAddressStr))
535521 then toString(i.originCaller)
536522 else callerStr
537523 let stakedByUserKEY = keyStakedByUser(userAddressStr, lpAssetIdStr)
538524 let stakedTotalKEY = keyStakedTotal(lpAssetIdStr)
539525 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.")
526+ let stakedTotal = readStaked(stakedTotalKEY)
527+ let $t02127621393 = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, amount)
528+ let wxToClaimUserNew = $t02127621393._1
529+ let integralSTATE = $t02127621393._2
530+ let debug = $t02127621393._3
531+ let listName = getUsersListName(lpAssetIdStr)
532+ let listActions = if (containsNode(listName, userAddressStr))
533+ then nil
534+ else insertNodeActions(listName, userAddressStr)
535+ (([IntegerEntry(stakedByUserKEY, (stakedByUser + amount)), IntegerEntry(stakedTotalKEY, (stakedTotal + amount)), OperationHistoryEntry("stake", userAddressStr, lpAssetIdStr, amount, i.transactionId)] ++ integralSTATE) ++ listActions)
557536 }
558537
559538
560539
561540 @Callable(i)
562541 func unstake (lpAssetIdStr,amount) = {
563542 let lpAssetId = fromBase58String(lpAssetIdStr)
564543 let poolAddressStr = valueOrErrorMessage(getString(factoryContract, keyFactoryLp2AssetsMapping(lpAssetIdStr)), ("unsupported lp asset " + lpAssetIdStr))
565544 let poolAddress = addressFromStringValue(poolAddressStr)
566545 let poolAddon = valueOrElse(getString(poolAddress, keyAddonAddr()), poolAddressStr)
567546 let callerStr = toString(i.caller)
568547 let userAddress = if (if ((callerStr == poolAddressStr))
569548 then true
570549 else (callerStr == poolAddon))
571550 then i.originCaller
572551 else i.caller
573552 let lpAssetRecipientAddress = i.caller
574553 unstakeActions(i, lpAssetId, poolAddress, userAddress, lpAssetRecipientAddress, amount)
575554 }
576555
577556
578557
579558 @Callable(i)
580559 func unstakeINTERNAL (lpAssetId,amount,userAddress,lpAssetRecipientAddress) = {
581560 let lpAssetIdStr = toBase58String(lpAssetId)
582561 let poolAddress = addressFromStringValue(valueOrErrorMessage(getString(factoryContract, keyFactoryLp2AssetsMapping(lpAssetIdStr)), ("unsupported lp asset " + lpAssetIdStr)))
583562 let checkCaller = if ((i.caller == poolAddress))
584563 then true
585564 else permissionDeniedError
586565 if ((checkCaller == checkCaller))
587566 then unstakeActions(i, lpAssetId, poolAddress, Address(userAddress), Address(lpAssetRecipientAddress), amount)
588567 else throw("Strict value is not equal to itself.")
589568 }
590569
591570
592571
593572 @Callable(i)
594573 func claimWx (lpAssetIdStr) = {
595574 let userAddressStr = toString(i.caller)
596575 let throwIfNothingToClaim = true
597576 let result = invoke(this, "claimWxINTERNAL", [lpAssetIdStr, userAddressStr, throwIfNothingToClaim], nil)
598577 $Tuple2(nil, result)
599578 }
600579
601580
602581
603582 @Callable(i)
604583 func claimWxDoNotThrow (lpAssetIdStr) = {
605584 let userAddressStr = toString(i.caller)
606585 let throwIfNothingToClaim = false
607586 let result = invoke(this, "claimWxINTERNAL", [lpAssetIdStr, userAddressStr, throwIfNothingToClaim], nil)
608587 $Tuple2(nil, result)
609588 }
610589
611590
612591
613592 @Callable(i)
614593 func claimWxINTERNAL (lpAssetIdStr,userAddressStr,throwIfNothingToClaim) = {
615594 let checkCaller = mustThis(i)
616595 if ((checkCaller == checkCaller))
617596 then {
618597 let userAddress = valueOrErrorMessage(addressFromString(userAddressStr), "claimWxINTERNAL: invalid user address")
619598 let poolAddressStr = getStringByAddressOrFail(factoryContract, keyFactoryLpAssetToPoolContractAddress(lpAssetIdStr))
620599 let claimedByUserKEY = keyClaimedByUser(lpAssetIdStr, userAddressStr)
621600 let claimedTotalKEY = keyClaimedTotal(lpAssetIdStr)
622601 let claimedByUserMinRewardKEY = keyClaimedByUserMinReward(lpAssetIdStr, userAddressStr)
623602 let claimedByUserBoostRewardKEY = keyClaimedByUserBoostReward(lpAssetIdStr, userAddressStr)
624603 let claimedByUser = getBigIntFromStringOrZero(this, claimedByUserKEY)
625604 let claimedByUserMinReward = getBigIntFromStringOrZero(this, claimedByUserMinRewardKEY)
626605 let claimedByUserBoostReward = getBigIntFromStringOrZero(this, claimedByUserBoostRewardKEY)
627606 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
607+ let $t02477924891 = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, 0)
608+ let wxToClaimUserNew = $t02477924891._1
609+ let integralSTATE = $t02477924891._2
610+ let debug = $t02477924891._3
632611 let availableToClaim = max([(wxToClaimUserNew - claimedByUserMinReward), zeroBigInt])
633612 if ((zeroBigInt >= availableToClaim))
634613 then if (throwIfNothingToClaim)
635614 then throw("nothing to claim")
636615 else $Tuple2(nil, 0)
637616 else {
638617 let wxAmountBoostTotal = max([asInt(asAnyList(invoke(boostingContract, "claimWxBoost", [lpAssetIdStr, userAddressStr], nil))[0]), 0])
639618 let minRewardPart = availableToClaim
640- let boostRewardPart = min([(minRewardPart * toBigInt((boostCoeff - 1))), toBigInt(wxAmountBoostTotal)])
619+ let boostRewardPart = min([(minRewardPart * toBigInt(2)), toBigInt(wxAmountBoostTotal)])
641620 let totalReward = (minRewardPart + boostRewardPart)
642621 let wxAssetId = asByteVector(asAnyList(invoke(emissionContract, "emit", [toInt(minRewardPart)], nil))[0])
643622 let emitBoost = asAnyList(invoke(emissionContract, "emit", [toInt(boostRewardPart)], nil))
644623 if ((emitBoost == emitBoost))
645624 then {
646625 let claimedByUserValue = ((claimedByUser + minRewardPart) + boostRewardPart)
647626 let claimedByUserMinRewardPlusPart = (claimedByUserMinReward + minRewardPart)
648627 let claimedByUserBoostRewardPlusBoostRewardPart = (claimedByUserBoostReward + boostRewardPart)
649628 let claimedTotalPlusAvailableToClaim = (claimedTotal + availableToClaim)
650629 $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))
651630 }
652631 else throw("Strict value is not equal to itself.")
653632 }
654633 }
655634 else throw("Strict value is not equal to itself.")
656635 }
657636
658637
659638
660639 @Callable(i)
661640 func claimWxBulkInternalREADONLY (currentIter,lpAssetIds,userAddressStr,resAcc) = if ((currentIter == size(lpAssetIds)))
662641 then $Tuple2(nil, resAcc)
663642 else {
664643 let lpAssetId = lpAssetIds[currentIter]
665644 let info = split({
666645 let @ = invoke(this, "claimWxREADONLY", [lpAssetId, userAddressStr], nil)
667646 if ($isInstanceOf(@, "String"))
668647 then @
669648 else throw(($getType(@) + " couldn't be cast to String"))
670649 }, SEP)
671650 let unclaimed = info[3]
672651 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))
652+ let res = (resAcc :+ makeString(["%d%d", unclaimed, claimed], SEP))
680653 let inv = {
681654 let @ = invoke(this, "claimWxBulkInternalREADONLY", [(currentIter + 1), lpAssetIds, userAddressStr, res], nil)
682655 if ($isInstanceOf(@, "List[Any]"))
683656 then @
684657 else throw(($getType(@) + " couldn't be cast to List[Any]"))
685658 }
686659 if ((inv == inv))
687660 then $Tuple2(nil, inv)
688661 else throw("Strict value is not equal to itself.")
689662 }
690663
691664
692665
693666 @Callable(i)
694667 func claimWxBulkREADONLY (lpAssetIds,userAddressStr) = {
695668 let res = invoke(this, "claimWxBulkInternalREADONLY", [0, lpAssetIds, userAddressStr, nil], nil)
696669 $Tuple2(nil, res)
697670 }
698671
699672
700673
701674 @Callable(i)
702675 func claimWxREADONLY (lpAssetIdStr,userAddressStr) = {
703676 let stakedByUserKEY = keyStakedByUser(userAddressStr, lpAssetIdStr)
704677 let stakedTotalKEY = keyStakedTotal(lpAssetIdStr)
705678 let claimedByUserKEY = keyClaimedByUser(lpAssetIdStr, userAddressStr)
706679 let claimedByUserMinRewardKEY = keyClaimedByUserMinReward(lpAssetIdStr, userAddressStr)
707680 let stakedByUser = readStaked(stakedByUserKEY)
708681 let stakedTotal = readStaked(stakedTotalKEY)
709682 let claimedByUser = getBigIntFromStringOrZero(this, claimedByUserKEY)
710683 let claimedByUserMinReward = getBigIntFromStringOrZero(this, claimedByUserMinRewardKEY)
711684 let poolAddressStr = getStringByAddressOrFail(factoryContract, keyFactoryLpAssetToPoolContractAddress(lpAssetIdStr))
712685 let poolWeight = getIntegerValue(factoryContract, keyFactoryPoolWeight(poolAddressStr))
713686 let wxEmissionPerBlock = getIntOrFail(emissionContract, keyEmissionRatePerBlockCurrent())
714687 let emissionStartBlock = getIntOrFail(emissionContract, keyEmissionStartBlock())
715688 let passedBlocks = if ((emissionStartBlock > height))
716689 then 0
717690 else (height - emissionStartBlock)
718691 let poolWxEmission = fraction((wxEmissionPerBlock * passedBlocks), poolWeight, POOLWEIGHTMULT)
719692 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
693+ let $t02870028812 = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, 0)
694+ let wxToClaimUserNew = $t02870028812._1
695+ let integralSTATE = $t02870028812._2
696+ let debug = $t02870028812._3
724697 let availableToClaim = max([(wxToClaimUserNew - claimedByUserMinReward), zeroBigInt])
725698 let boostInvResult = asAnyList(invoke(boostingContract, "claimWxBoostREADONLY", [lpAssetIdStr, userAddressStr], nil))
726699 let wxAmountBoostTotal = max([asInt(boostInvResult[0]), 0])
727700 let boostDebug = asString(boostInvResult[1])
728701 let minRewardPart = availableToClaim
729- let boostRewardPart = min([(minRewardPart * toBigInt((boostCoeff - 1))), toBigInt(wxAmountBoostTotal)])
702+ let boostRewardPart = min([(minRewardPart * toBigInt(2)), toBigInt(wxAmountBoostTotal)])
730703 let totalReward = (minRewardPart + boostRewardPart)
731704 $Tuple2(nil, makeString(["%s%s%d%d%d%d%s", lpAssetIdStr, userAddressStr, toString(totalReward), toString(claimedByUser), toString(minRewardPart), toString(boostRewardPart), "soon"], SEP))
732705 }
733706
734707
735708
736709 @Callable(i)
737710 func stakedByUserREADONLY (lpAssetIdStr,userAddressStr) = {
738711 let stakedByUser = valueOrElse(getInteger(keyStakedByUser(userAddressStr, lpAssetIdStr)), 0)
739712 $Tuple2(nil, stakedByUser)
740713 }
741714
742715
743716
744717 @Callable(i)
745718 func usersListTraversal (lpAssetId) = {
746719 let checkCaller = if ((toBase58String(i.caller.bytes) == valueOrElse(getString(this, keyVotingEmissionContract()), "")))
747720 then true
748721 else mustManager(i)
749722 if ((checkCaller == checkCaller))
750723 then {
751724 let listName = getUsersListName(lpAssetId)
752725 let userOrUnit = getString(keyNextUser(lpAssetId))
753726 let headOrUnit = getString(keyListHead(listName))
754727 match userOrUnit {
755728 case _: Unit =>
756729 match headOrUnit {
757730 case _: Unit =>
758731 $Tuple2(nil, false)
759732 case head: String =>
760733 $Tuple2([StringEntry(keyNextUser(lpAssetId), head)], true)
761734 case _ =>
762735 throw("Match error")
763736 }
764737 case userAddress: String =>
765738 let claimedByUserMinReward = getBigIntFromStringOrZero(this, keyClaimedByUserMinReward(lpAssetId, userAddress))
766739 let poolAddress = getStringByAddressOrFail(factoryContract, keyFactoryLpAssetToPoolContractAddress(lpAssetId))
767740 let wxToClaimUserNew = refreshINTEGRALS(lpAssetId, userAddress, poolAddress, 0)._1
768741 let availableToClaim = (wxToClaimUserNew - claimedByUserMinReward)
769742 let throwIfNothingToClaim = true
770743 let r = if ((availableToClaim > zeroBigInt))
771744 then invoke(this, "claimWxINTERNAL", [lpAssetId, userAddress, throwIfNothingToClaim], nil)
772745 else unit
773746 if ((r == r))
774747 then {
775748 let nextUserOrUnit = getString(keyListNext(listName, userAddress))
776749 match nextUserOrUnit {
777750 case _: Unit =>
778751 $Tuple2([DeleteEntry(keyNextUser(lpAssetId))], false)
779752 case nextUser: String =>
780753 $Tuple2([StringEntry(keyNextUser(lpAssetId), nextUser)], true)
781754 case _ =>
782755 throw("Match error")
783756 }
784757 }
785758 else throw("Strict value is not equal to itself.")
786759 case _ =>
787760 throw("Match error")
788761 }
789762 }
790763 else throw("Strict value is not equal to itself.")
791764 }
792765
793766
794767
795768 @Callable(i)
796769 func onModifyWeight (lpAssetIdStr,poolAddressStr) = if ((i.caller != factoryContract))
797770 then throw("permissions denied")
798771 else {
799- let $t03200232112 = refreshPoolINTEGRALS(lpAssetIdStr, poolAddressStr, 0)
800- let wxPerLpIntegralNew = $t03200232112._1
801- let poolIntegralSTATE = $t03200232112._2
802- let poolDEBUG = $t03200232112._3
772+ let $t03141831528 = refreshPoolINTEGRALS(lpAssetIdStr, poolAddressStr, 0)
773+ let wxPerLpIntegralNew = $t03141831528._1
774+ let poolIntegralSTATE = $t03141831528._2
775+ let poolDEBUG = $t03141831528._3
803776 poolIntegralSTATE
804777 }
805778
806779
807780 @Verifier(tx)
808781 func verify () = {
809782 let targetPublicKey = match managerPublicKeyOrUnit() {
810783 case pk: ByteVector =>
811784 pk
812785 case _: Unit =>
813786 tx.senderPublicKey
814787 case _ =>
815788 throw("Match error")
816789 }
817790 sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey)
818791 }
819792

github/deemru/w8io/fabc49c 
87.14 ms