tx · FvUiXeu4R36wBiUWerVothmY9PBWMpXxBDie2ZJAk4rG

3Mx3zmXrMcLFCafMuPtXAzR4ZPVeZYb6qLz:  -0.03500000 Waves

2022.06.29 14:37 [2117677] smart account 3Mx3zmXrMcLFCafMuPtXAzR4ZPVeZYb6qLz > SELF 0.00000000 Waves

{ "type": 13, "id": "FvUiXeu4R36wBiUWerVothmY9PBWMpXxBDie2ZJAk4rG", "fee": 3500000, "feeAssetId": null, "timestamp": 1656502654021, "version": 2, "chainId": 84, "sender": "3Mx3zmXrMcLFCafMuPtXAzR4ZPVeZYb6qLz", "senderPublicKey": "D28XoueZWsMfm8Y5pa6C5ZFuYoWgre2Wm8tzJANJgMnq", "proofs": [ "S4kNjRexWN4Mu81aWrNgFAAmygHmAmSiUcaBqF5P1LLSbx7FMwTn4uVAsAp7v7jT29JN6FSMicJ7FN51AYiNcxr" ], "script": "base64:AAIFAAAAAAAAACcIAhIDCgEIEgMKAQgSABIAEgQKAggBEgMKAQgSBAoCCAgSBAoCCAgAAABTAAAAAAZTQ0FMRTgAAAAAAAAAAAgAAAAABU1VTFQ4AAAAAAAF9eEAAAAAAAdTQ0FMRTE4AAAAAAAAAAASAAAAAAZNVUxUMTgJAAE2AAAAAQAN4Lazp2QAAAAAAAADU0VQAgAAAAJfXwAAAAAOUE9PTFdFSUdIVE1VTFQFAAAABU1VTFQ4AAAAAAp6ZXJvQmlnSW50CQABNgAAAAEAAAAAAAAAAAAAAAAACW9uZUJpZ0ludAkAATYAAAABAAAAAAAAAAABAQAAAAlhc0FueUxpc3QAAAABAAAAA3ZhbAQAAAAHJG1hdGNoMAUAAAADdmFsAwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAAlMaXN0W0FueV0EAAAACnZhbEFueUx5c3QFAAAAByRtYXRjaDAFAAAACnZhbEFueUx5c3QJAAACAAAAAQIAAAAbZmFpbCB0byBjYXN0IGludG8gTGlzdFtBbnldAQAAAAVhc0ludAAAAAEAAAADdmFsBAAAAAckbWF0Y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tYXRjaDACAAAACkJ5dGVWZWN0b3IEAAAAAnBrBQAAAAckbWF0Y2gwBQAAAAJwawMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAEVW5pdAgFAAAAAnR4AAAAD3NlbmRlclB1YmxpY0tleQkAAAIAAAABAgAAAAtNYXRjaCBlcnJvcgQAAAARbWlncmF0b3JQdWJsaWNLZXkEAAAAByRtYXRjaDAJAQAAABdtaWdyYXRvclB1YmxpY0tleU9yVW5pdAAAAAADCQAAAQAAAAIFAAAAByRtYXRjaDACAAAACkJ5dGVWZWN0b3IEAAAAAnBrBQAAAAckbWF0Y2gwBQAAAAJwawMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAEVW5pdAgFAAAAAnR4AAAAD3NlbmRlclB1YmxpY0tleQkAAAIAAAABAgAAAAtNYXRjaCBlcnJvcgMJAAH0AAAAAwgFAAAAAnR4AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACdHgAAAAGcHJvb2ZzAAAAAAAAAAAABQAAAA90YXJnZXRQdWJsaWNLZXkGCQAB9AAAAAMIBQAAAAJ0eAAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAAnR4AAAABnByb29mcwAAAAAAAAAAAAUAAAARbWlncmF0b3JQdWJsaWNLZXnX1uLj", "height": 2117677, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: HTtb3AVFg57jWBJV2kbAbbFj2DStxb7vC3wXeNvnwqTc Next: 4ja9B4yvtWjQSx7fWucT3m5KYMRU4g5Mj9ffigvmEpAc Diff:
OldNewDifferences
1212 let SEP = "__"
1313
1414 let POOLWEIGHTMULT = MULT8
15+
16+let zeroBigInt = toBigInt(0)
17+
18+let oneBigInt = toBigInt(1)
1519
1620 func asAnyList (val) = match val {
1721 case valAnyLyst: List[Any] =>
4549 }
4650
4751
48-func getStringOrFail (key) = valueOrErrorMessage(getString(key), (("mandatory this." + key) + " is not defined"))
52+func getStringOrFail (address,key) = valueOrErrorMessage(getString(address, key), (("mandatory this." + key) + " is not defined"))
4953
5054
5155 func getStringByAddressOrFail (address,key) = valueOrErrorMessage(getString(address, key), (((("mandatory " + toString(address)) + ".") + key) + " is not defined"))
5862
5963
6064 func getIntOrFail (address,key) = valueOrErrorMessage(getInteger(address, key), (("mandatory this." + key) + " is not defined"))
65+
66+
67+func getBigIntFromStringOrZero (address,key) = value(parseBigInt(valueOrElse(getString(address, key), "0")))
68+
69+
70+func getBigIntFromStringOrDefault (address,key,defaultVal) = match getString(address, key) {
71+ case s: String =>
72+ value(parseBigInt(s))
73+ case _: Unit =>
74+ defaultVal
75+ case _ =>
76+ throw("Match error")
77+}
6178
6279
6380 func toX18 (origVal,origScaleMult) = fraction(toBigInt(origVal), MULT18, toBigInt(origScaleMult))
155172 func keyClaimedByUserBoostReward (lpAssetIdStr,userAddressStr) = makeString(["%s%s%s__claimedBoostReward", userAddressStr, lpAssetIdStr], SEP)
156173
157174
158-func keyClaimedTotal (lpAssetIdStr) = makeString(["%s%s%s__claimed", "total", lpAssetIdStr], SEP)
175+func keyClaimedTotal (lpAssetIdStr) = makeString(["%s%s%s__claimed__total", lpAssetIdStr], SEP)
159176
160177
161178 func readStaked (key) = valueOrElse(getInteger(this, key), 0)
209226 func OperationHistoryEntry (type,userAddress,lpAssetId,amount,txId) = StringEntry(keyOperationHistoryRecord(type, userAddress, toBase58String(txId)), formatHistoryRecord(userAddress, lpAssetId, type, amount))
210227
211228
212-let factoryAddress = getStringOrFail(keyFactoryAddress())
229+let factoryAddress = getStringOrFail(this, keyFactoryAddress())
213230
214231 let factoryContract = addressFromStringValue(factoryAddress)
215232
219236
220237 let boostingContract = getBoostingAddressOrFail(factoryCfg)
221238
222-func calcWxPerLpIntegralUserLast (stakedByUser,wxPerLpIntegralUserLastUpdHeightOrZero,wxPerLpIntegralNew,wxPerLpIntegralUserLastKEY) = if (if ((wxPerLpIntegralUserLastUpdHeightOrZero == 0))
223- then (stakedByUser > 0)
239+func calcWxPerLpIntegralUserLast (stakedByUser,wxPerLpIntegralUserLastUpdHeightOrZero,wxPerLpIntegralNew,wxPerLpIntegralUserLastKEY) = if (if ((wxPerLpIntegralUserLastUpdHeightOrZero == zeroBigInt))
240+ then (stakedByUser > zeroBigInt)
224241 else false)
225- then 0
226- else if ((stakedByUser == 0))
242+ then zeroBigInt
243+ else if ((stakedByUser == zeroBigInt))
227244 then wxPerLpIntegralNew
228- else if (if ((wxPerLpIntegralUserLastUpdHeightOrZero > 0))
229- then (stakedByUser > 0)
245+ else if (if ((wxPerLpIntegralUserLastUpdHeightOrZero > zeroBigInt))
246+ then (stakedByUser > zeroBigInt)
230247 else false)
231- then getIntOrFail(this, wxPerLpIntegralUserLastKEY)
248+ then value(parseBigInt(getStringOrFail(this, wxPerLpIntegralUserLastKEY)))
232249 else throw("calcWxPerLpIntegralUserLast: unexpected state")
233250
234251
235252 func refreshPoolINTEGRALS (lpAssetIdStr,poolAddressStr,lpDeltaAmount) = {
236253 let stakedTotalKEY = keyStakedTotal(lpAssetIdStr)
237- let stakedTotal = readStaked(stakedTotalKEY)
254+ let stakedTotal = toBigInt(readStaked(stakedTotalKEY))
255+ let nonZeroStakedTotal = if ((stakedTotal == zeroBigInt))
256+ then oneBigInt
257+ else stakedTotal
238258 let poolWeight = getIntegerValue(factoryContract, keyFactoryPoolWeight(poolAddressStr))
239259 let emissionStartBlock = getIntOrFail(emissionContract, keyEmissionStartBlock())
240260 let MULT3 = 1000
244264 let wxPerLpIntegralLastUpdHeightKEY = keyWxPerLpIntegralLastUpdHeight(lpAssetIdStr)
245265 let wxPerLpKEY = keyWxPerLp(lpAssetIdStr)
246266 let wxPerLpIntegralLastUpdHeight = getIntOrDefault(this, wxPerLpIntegralLastUpdHeightKEY, emissionStartBlock)
247- let wxPerLpIntegral = getIntOrZero(this, wxPerLpIntegralKEY)
267+ let wxPerLpIntegral = getBigIntFromStringOrZero(this, wxPerLpIntegralKEY)
248268 let wxPerLpOrZeroX3 = 0
249269 let dh = max([(height - wxPerLpIntegralLastUpdHeight), 0])
250270 let wxPerLpX3 = if ((wxPerLpOrZeroX3 != 0))
251- then wxPerLpOrZeroX3
252- else fraction(poolWxEmissionPerBlockX3, MULT8, stakedTotal)
253- let stakedTotalNew = (stakedTotal + lpDeltaAmount)
254- let wxPerLpIntegralNew = (wxPerLpIntegral + (wxPerLpX3 * dh))
255- let wxPerLpX3New = (poolWxEmissionPerBlockX3 / stakedTotalNew)
271+ then toBigInt(wxPerLpOrZeroX3)
272+ else fraction(toBigInt(poolWxEmissionPerBlockX3), toBigInt(MULT8), nonZeroStakedTotal)
273+ let stakedTotalNew = (stakedTotal + toBigInt(lpDeltaAmount))
274+ let nonZeroStakedTotalNew = if ((stakedTotalNew == zeroBigInt))
275+ then oneBigInt
276+ else stakedTotalNew
277+ let wxPerLpIntegralNew = (wxPerLpIntegral + (wxPerLpX3 * toBigInt(dh)))
278+ let wxPerLpX3New = (toBigInt(poolWxEmissionPerBlockX3) / nonZeroStakedTotalNew)
256279 let wxPerLpIntegralLastUpdHeightNew = height
257280 let debug = makeString([toString(wxPerLpIntegralNew), "dh=", toString(dh), "wxPerLpX3=", toString(wxPerLpX3), "stakedTotal=", toString(stakedTotal), toString(poolWxEmissionPerBlockX3), toString(wxEmissionPerBlockX3), "poolWeight=", toString(poolWeight)], "::")
258- $Tuple3(wxPerLpIntegralNew, [IntegerEntry(wxPerLpIntegralKEY, wxPerLpIntegralNew), IntegerEntry(wxPerLpIntegralLastUpdHeightKEY, wxPerLpIntegralLastUpdHeightNew), IntegerEntry(wxPerLpKEY, wxPerLpX3New)], debug)
281+ $Tuple3(wxPerLpIntegralNew, [StringEntry(wxPerLpIntegralKEY, toString(wxPerLpIntegralNew)), IntegerEntry(wxPerLpIntegralLastUpdHeightKEY, wxPerLpIntegralLastUpdHeightNew), StringEntry(wxPerLpKEY, toString(wxPerLpX3New))], debug)
259282 }
260283
261284
262285 func refreshINTEGRALS (lpAssetIdStr,userAddressStr,poolAddressStr,lpDeltaAmount) = {
263- let $t01091111033 = refreshPoolINTEGRALS(lpAssetIdStr, poolAddressStr, lpDeltaAmount)
264- let wxPerLpIntegralNew = $t01091111033._1
265- let poolIntegralSTATE = $t01091111033._2
266- let poolDEBUG = $t01091111033._3
286+ let $t01150611628 = refreshPoolINTEGRALS(lpAssetIdStr, poolAddressStr, lpDeltaAmount)
287+ let wxPerLpIntegralNew = $t01150611628._1
288+ let poolIntegralSTATE = $t01150611628._2
289+ let poolDEBUG = $t01150611628._3
267290 let MULT3 = 1000
268291 let stakedByUserKEY = keyStakedByUser(userAddressStr, lpAssetIdStr)
269292 let stakedByUser = readStaked(stakedByUserKEY)
270293 let wxToClaimUserKEY = keyWxToClaimUser(lpAssetIdStr, userAddressStr)
271294 let wxPerLpIntegralUserLastUpdHeightKEY = keyWxPerLpIntegralUserLastUpdHeight(lpAssetIdStr, userAddressStr)
272295 let wxPerLpIntegralUserLastKEY = keyWxPerLpIntegralUserLast(lpAssetIdStr, userAddressStr)
273- let wxToClaimUser = getIntOrZero(this, wxToClaimUserKEY)
296+ let wxToClaimUser = getBigIntFromStringOrZero(this, wxToClaimUserKEY)
274297 let wxPerLpIntegralUserLastUpdHeightOrZero = getIntOrZero(this, wxPerLpIntegralUserLastUpdHeightKEY)
275- let wxPerLpIntegralUserLast = calcWxPerLpIntegralUserLast(stakedByUser, wxPerLpIntegralUserLastUpdHeightOrZero, wxPerLpIntegralNew, wxPerLpIntegralUserLastKEY)
276- let wxToClaimUserNew = (wxToClaimUser + fraction((wxPerLpIntegralNew - wxPerLpIntegralUserLast), stakedByUser, (MULT8 * MULT3)))
298+ let wxPerLpIntegralUserLast = calcWxPerLpIntegralUserLast(toBigInt(stakedByUser), toBigInt(wxPerLpIntegralUserLastUpdHeightOrZero), wxPerLpIntegralNew, wxPerLpIntegralUserLastKEY)
299+ let MULT11 = (MULT8 * MULT3)
300+ let wxToClaimUserNew = max([(wxToClaimUser + fraction((wxPerLpIntegralNew - wxPerLpIntegralUserLast), toBigInt(stakedByUser), toBigInt(MULT11))), zeroBigInt])
277301 let wxPerLpIntegralUserLastNew = wxPerLpIntegralNew
278302 let wxPerLpIntegralUserLastUpdHeightNew = height
279- let debug = makeString(["wxToClaimUser", toString(wxToClaimUser), "wxPerLpInteg", toString(wxPerLpIntegralUserLastUpdHeightOrZero), "wxPerLpIntegralNew", toString(wxPerLpIntegralNew), "wxToClaimUserNew", toString(wxToClaimUserNew), "wxPerLpIntegralUserLast", toString(wxPerLpIntegralUserLast), toString(stakedByUser), "poolDEBUG=", poolDEBUG, "height=", toString(height)], "::")
280- $Tuple3(wxToClaimUserNew, (poolIntegralSTATE ++ [IntegerEntry(wxToClaimUserKEY, wxToClaimUserNew), IntegerEntry(wxPerLpIntegralUserLastUpdHeightKEY, wxPerLpIntegralUserLastUpdHeightNew), IntegerEntry(wxPerLpIntegralUserLastKEY, wxPerLpIntegralUserLastNew)]), debug)
303+ let debug = makeString(["wxToClaimUser", toString(wxToClaimUser), "wxPerLpInteg", toString(wxPerLpIntegralUserLastUpdHeightOrZero), "this.getString", toString(value(parseBigInt(getStringOrFail(this, wxPerLpIntegralUserLastKEY)))), "wxPerLpIntegralNew", toString(wxPerLpIntegralNew), "wxToClaimUserNew", toString(wxToClaimUserNew), "wxPerLpIntegralUserLast", toString(wxPerLpIntegralUserLast), toString(stakedByUser), "poolDEBUG=", poolDEBUG, "height=", toString(height)], "::")
304+ $Tuple3(wxToClaimUserNew, (poolIntegralSTATE ++ [StringEntry(wxToClaimUserKEY, toString(wxToClaimUserNew)), IntegerEntry(wxPerLpIntegralUserLastUpdHeightKEY, wxPerLpIntegralUserLastUpdHeightNew), StringEntry(wxPerLpIntegralUserLastKEY, toString(wxPerLpIntegralUserLastNew))]), debug)
281305 }
282306
283307
390414 let stakedTotalKEY = keyStakedTotal(lpAssetIdStr)
391415 let stakedByUser = readStaked(stakedByUserKEY)
392416 let stakedTotal = readStaked(stakedTotalKEY)
393- let $t01532415441 = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, amount)
394- let wxToClaimUserNew = $t01532415441._1
395- let integralSTATE = $t01532415441._2
396- let debug = $t01532415441._3
417+ let $t01619616313 = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, amount)
418+ let wxToClaimUserNew = $t01619616313._1
419+ let integralSTATE = $t01619616313._2
420+ let debug = $t01619616313._3
397421 ([IntegerEntry(stakedByUserKEY, (stakedByUser + amount)), IntegerEntry(stakedTotalKEY, (stakedTotal + amount)), OperationHistoryEntry("stake", userAddressStr, lpAssetIdStr, amount, i.transactionId)] ++ integralSTATE)
398422 }
399423
414438 let stakedTotalKEY = keyStakedTotal(lpAssetIdStr)
415439 let stakedByUser = readStaked(stakedByUserKEY)
416440 let stakedTotal = readStaked(stakedTotalKEY)
417- let $t01657816696 = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, -(amount))
418- let wxToClaimUserNew = $t01657816696._1
419- let integralSTATE = $t01657816696._2
420- let debug = $t01657816696._3
441+ let $t01745017568 = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, -(amount))
442+ let wxToClaimUserNew = $t01745017568._1
443+ let integralSTATE = $t01745017568._2
444+ let debug = $t01745017568._3
421445 if ((amount > stakedByUser))
422446 then throw("passed amount is less then available")
423447 else ([IntegerEntry(stakedByUserKEY, (stakedByUser - amount)), IntegerEntry(stakedTotalKEY, (stakedTotal - amount)), ScriptTransfer(i.caller, amount, lpAssetId), OperationHistoryEntry("unstake", userAddressStr, lpAssetIdStr, amount, i.transactionId)] ++ integralSTATE)
434458 let claimedTotalKEY = keyClaimedTotal(lpAssetIdStr)
435459 let claimedByUserMinRewardKEY = keyClaimedByUserMinReward(lpAssetIdStr, userAddressStr)
436460 let claimedByUserBoostRewardKEY = keyClaimedByUserBoostReward(lpAssetIdStr, userAddressStr)
437- let claimedByUser = getIntOrZero(this, claimedByUserKEY)
438- let claimedByUserMinReward = getIntOrZero(this, claimedByUserMinRewardKEY)
439- let claimedByUserBoostReward = getIntOrZero(this, claimedByUserBoostRewardKEY)
440- let claimedTotal = getIntOrZero(this, claimedTotalKEY)
441- let $t01788818000 = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, 0)
442- let wxToClaimUserNew = $t01788818000._1
443- let integralSTATE = $t01788818000._2
444- let debug = $t01788818000._3
445- let availableToClaim = (wxToClaimUserNew - claimedByUser)
446- if ((0 >= availableToClaim))
461+ let claimedByUser = getBigIntFromStringOrZero(this, claimedByUserKEY)
462+ let claimedByUserMinReward = getBigIntFromStringOrZero(this, claimedByUserMinRewardKEY)
463+ let claimedByUserBoostReward = getBigIntFromStringOrZero(this, claimedByUserBoostRewardKEY)
464+ let claimedTotal = getBigIntFromStringOrZero(this, claimedTotalKEY)
465+ let $t01881218924 = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, 0)
466+ let wxToClaimUserNew = $t01881218924._1
467+ let integralSTATE = $t01881218924._2
468+ let debug = $t01881218924._3
469+ let availableToClaim = max([(wxToClaimUserNew - claimedByUser), zeroBigInt])
470+ if ((zeroBigInt >= availableToClaim))
447471 then throw("nothing to claim")
448472 else {
449- let wxAmountBoostTotal = asInt(asAnyList(invoke(boostingContract, "claimWxBoost", [lpAssetIdStr, userAddressStr], nil))[0])
473+ let wxAmountBoostTotal = max([asInt(asAnyList(invoke(boostingContract, "claimWxBoost", [lpAssetIdStr, userAddressStr], nil))[0]), 0])
450474 let minRewardPart = availableToClaim
451- let boostRewardPart = min([(minRewardPart * 2), wxAmountBoostTotal])
452- let wxAssetId = asByteVector(asAnyList(invoke(emissionContract, "emit", [minRewardPart], nil))[0])
453- let emitBoost = asAnyList(invoke(emissionContract, "emit", [boostRewardPart], nil))
475+ let boostRewardPart = min([(minRewardPart * toBigInt(2)), toBigInt(wxAmountBoostTotal)])
476+ let wxAssetId = asByteVector(asAnyList(invoke(emissionContract, "emit", [toInt(minRewardPart)], nil))[0])
477+ let emitBoost = asAnyList(invoke(emissionContract, "emit", [toInt(boostRewardPart)], nil))
454478 if ((emitBoost == emitBoost))
455- then [IntegerEntry(claimedByUserKEY, (claimedByUser + availableToClaim)), IntegerEntry(claimedByUserMinRewardKEY, (claimedByUserMinReward + minRewardPart)), IntegerEntry(claimedByUserBoostRewardKEY, (claimedByUserBoostReward + boostRewardPart)), IntegerEntry(claimedTotalKEY, (claimedTotal + availableToClaim)), ScriptTransfer(userAddress, minRewardPart, wxAssetId), ScriptTransfer(userAddress, boostRewardPart, wxAssetId), OperationHistoryEntry("claim", userAddressStr, lpAssetIdStr, availableToClaim, i.transactionId)]
479+ then {
480+ let claimedByUserValue = (claimedByUser + availableToClaim)
481+ let claimedByUserMinRewardPlusPart = (claimedByUserMinReward + minRewardPart)
482+ let claimedByUserBoostRewardPlusBoostRewardPart = (claimedByUserMinReward + minRewardPart)
483+ let claimedTotalPlusAvailableToClaim = (claimedByUserMinReward + minRewardPart)
484+[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)]
485+ }
456486 else throw("Strict value is not equal to itself.")
457487 }
458488 }
466496 let claimedByUserKEY = keyClaimedByUser(lpAssetIdStr, userAddressStr)
467497 let stakedByUser = readStaked(stakedByUserKEY)
468498 let stakedTotal = readStaked(stakedTotalKEY)
469- let claimedByUser = getIntOrZero(this, claimedByUserKEY)
499+ let claimedByUser = getBigIntFromStringOrZero(this, claimedByUserKEY)
470500 let poolAddressStr = getStringByAddressOrFail(factoryContract, keyFactoryLpAssetToPoolContractAddress(lpAssetIdStr))
471501 let poolWeight = getIntegerValue(factoryContract, keyFactoryPoolWeight(poolAddressStr))
472502 let wxEmissionPerBlock = getIntOrFail(emissionContract, keyEmissionRatePerBlockCurrent())
476506 else (height - emissionStartBlock)
477507 let poolWxEmission = fraction((wxEmissionPerBlock * passedBlocks), poolWeight, POOLWEIGHTMULT)
478508 let userWxReward = fraction(poolWxEmission, stakedByUser, stakedTotal)
479- let $t02020120313 = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, 0)
480- let wxToClaimUserNew = $t02020120313._1
481- let integralSTATE = $t02020120313._2
482- let debug = $t02020120313._3
483- let availableToClaim = (wxToClaimUserNew - claimedByUser)
509+ let $t02156621678 = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, 0)
510+ let wxToClaimUserNew = $t02156621678._1
511+ let integralSTATE = $t02156621678._2
512+ let debug = $t02156621678._3
513+ let availableToClaim = max([(wxToClaimUserNew - claimedByUser), zeroBigInt])
484514 let boostInvResult = asAnyList(invoke(boostingContract, "claimWxBoostREADONLY", [lpAssetIdStr, userAddressStr], nil))
485- let wxAmountBoostTotal = asInt(boostInvResult[0])
515+ let wxAmountBoostTotal = max([asInt(boostInvResult[0]), 0])
486516 let boostDebug = asString(boostInvResult[1])
487517 let minRewardPart = availableToClaim
488- let boostRewardPart = min([(minRewardPart * 2), wxAmountBoostTotal])
518+ let boostRewardPart = min([(minRewardPart * toBigInt(2)), toBigInt(wxAmountBoostTotal)])
489519 let totalReward = (minRewardPart + boostRewardPart)
490520 $Tuple2(nil, makeString(["%s%s%d%d%d%d%s", lpAssetIdStr, userAddressStr, toString(totalReward), toString(claimedByUser), toString(minRewardPart), toString(boostRewardPart), ((((debug + "::") + toString(userWxReward)) + "::BOOSTDEBUG::") + boostDebug)], SEP))
491521 }
496526 func onModifyWeight (lpAssetIdStr,poolAddressStr) = if ((i.caller != factoryContract))
497527 then throw("permissions denied")
498528 else {
499- let $t02119321303 = refreshPoolINTEGRALS(lpAssetIdStr, poolAddressStr, 0)
500- let wxPerLpIntegralNew = $t02119321303._1
501- let poolIntegralSTATE = $t02119321303._2
502- let poolDEBUG = $t02119321303._3
529+ let $t02260922719 = refreshPoolINTEGRALS(lpAssetIdStr, poolAddressStr, 0)
530+ let wxPerLpIntegralNew = $t02260922719._1
531+ let poolIntegralSTATE = $t02260922719._2
532+ let poolDEBUG = $t02260922719._3
503533 poolIntegralSTATE
504534 }
505535
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let SCALE8 = 8
55
66 let MULT8 = 100000000
77
88 let SCALE18 = 18
99
1010 let MULT18 = toBigInt(1000000000000000000)
1111
1212 let SEP = "__"
1313
1414 let POOLWEIGHTMULT = MULT8
15+
16+let zeroBigInt = toBigInt(0)
17+
18+let oneBigInt = toBigInt(1)
1519
1620 func asAnyList (val) = match val {
1721 case valAnyLyst: List[Any] =>
1822 valAnyLyst
1923 case _ =>
2024 throw("fail to cast into List[Any]")
2125 }
2226
2327
2428 func asInt (val) = match val {
2529 case valInt: Int =>
2630 valInt
2731 case _ =>
2832 throw("fail to cast into Int")
2933 }
3034
3135
3236 func asString (val) = match val {
3337 case valStr: String =>
3438 valStr
3539 case _ =>
3640 throw("fail to cast into Int")
3741 }
3842
3943
4044 func asByteVector (val) = match val {
4145 case valBin: ByteVector =>
4246 valBin
4347 case _ =>
4448 throw("fail to cast into Int")
4549 }
4650
4751
48-func getStringOrFail (key) = valueOrErrorMessage(getString(key), (("mandatory this." + key) + " is not defined"))
52+func getStringOrFail (address,key) = valueOrErrorMessage(getString(address, key), (("mandatory this." + key) + " is not defined"))
4953
5054
5155 func getStringByAddressOrFail (address,key) = valueOrErrorMessage(getString(address, key), (((("mandatory " + toString(address)) + ".") + key) + " is not defined"))
5256
5357
5458 func getIntOrZero (address,key) = valueOrElse(getInteger(address, key), 0)
5559
5660
5761 func getIntOrDefault (address,key,defaultVal) = valueOrElse(getInteger(address, key), defaultVal)
5862
5963
6064 func getIntOrFail (address,key) = valueOrErrorMessage(getInteger(address, key), (("mandatory this." + key) + " is not defined"))
65+
66+
67+func getBigIntFromStringOrZero (address,key) = value(parseBigInt(valueOrElse(getString(address, key), "0")))
68+
69+
70+func getBigIntFromStringOrDefault (address,key,defaultVal) = match getString(address, key) {
71+ case s: String =>
72+ value(parseBigInt(s))
73+ case _: Unit =>
74+ defaultVal
75+ case _ =>
76+ throw("Match error")
77+}
6178
6279
6380 func toX18 (origVal,origScaleMult) = fraction(toBigInt(origVal), MULT18, toBigInt(origScaleMult))
6481
6582
6683 func fromX18 (val,resultScaleMult) = toInt(fraction(val, toBigInt(resultScaleMult), MULT18))
6784
6885
6986 func keyFactoryAddress () = "%s%s__config__factoryAddress"
7087
7188
7289 let IdxFactoryCfgStakingDapp = 1
7390
7491 let IdxFactoryCfgBoostingDapp = 2
7592
7693 let IdxFactoryCfgIdoDapp = 3
7794
7895 let IdxFactoryCfgTeamDapp = 4
7996
8097 let IdxFactoryCfgEmissionDapp = 5
8198
8299 let IdxFactoryCfgRestDapp = 6
83100
84101 let IdxFactoryCfgSlippageDapp = 7
85102
86103 func keyFactoryCfg () = "%s__factoryConfig"
87104
88105
89106 func keyManagerPublicKey () = "%s__managerPublicKey"
90107
91108
92109 func keyMigratorPublicKey () = "%s__migratorPublicKey"
93110
94111
95112 func keyPendingManagerPublicKey () = "%s__pendingManagerPublicKey"
96113
97114
98115 func keyStablePoolAddonAddr () = "%s__stablePoolAddonAddr"
99116
100117
101118 func keyFactoryLp2AssetsMapping (lpAssetStr) = makeString(["%s%s%s", lpAssetStr, "mappings__lpAsset2PoolContract"], SEP)
102119
103120
104121 func keyFactoryLpList () = "%s__lpTokensList"
105122
106123
107124 func keyFactoryLpAssetToPoolContractAddress (lpAssetStr) = makeString(["%s%s%s", lpAssetStr, "mappings__lpAsset2PoolContract"], SEP)
108125
109126
110127 func keyFactoryPoolWeight (contractAddress) = makeString(["%s%s", "poolWeight", contractAddress], SEP)
111128
112129
113130 func readLpList (factory) = split(valueOrElse(getString(factory, keyFactoryLpList()), ""), SEP)
114131
115132
116133 func readFactoryCfgOrFail (factory) = split(getStringByAddressOrFail(factory, keyFactoryCfg()), SEP)
117134
118135
119136 func getBoostingAddressOrFail (factoryCfg) = addressFromStringValue(factoryCfg[IdxFactoryCfgBoostingDapp])
120137
121138
122139 func getEmissionAddressOrFail (factoryCfg) = addressFromStringValue(factoryCfg[IdxFactoryCfgEmissionDapp])
123140
124141
125142 func getStakingAddressOrFail (factoryCfg) = addressFromStringValue(factoryCfg[IdxFactoryCfgStakingDapp])
126143
127144
128145 func keyEmissionRatePerBlockCurrent () = "%s%s__ratePerBlock__current"
129146
130147
131148 func keyEmissionRatePerBlockMaxCurrent () = "%s%s__ratePerBlockMax__current"
132149
133150
134151 func keyEmissionStartBlock () = "%s%s__emission__startBlock"
135152
136153
137154 func keyEmissionDurationInBlocks () = "%s%s__emission__duration"
138155
139156
140157 func keyEmissionEndBlock () = "%s%s__emission__endBlock"
141158
142159
143160 func keyStakedByUser (userAddressStr,lpAssetIdStr) = makeString(["%s%s%s__staked", userAddressStr, lpAssetIdStr], SEP)
144161
145162
146163 func keyStakedTotal (lpAssetIdStr) = ("%s%s%s__staked__total__" + lpAssetIdStr)
147164
148165
149166 func keyClaimedByUser (lpAssetIdStr,userAddressStr) = makeString(["%s%s%s__claimed", userAddressStr, lpAssetIdStr], SEP)
150167
151168
152169 func keyClaimedByUserMinReward (lpAssetIdStr,userAddressStr) = makeString(["%s%s%s__claimedMinReward", userAddressStr, lpAssetIdStr], SEP)
153170
154171
155172 func keyClaimedByUserBoostReward (lpAssetIdStr,userAddressStr) = makeString(["%s%s%s__claimedBoostReward", userAddressStr, lpAssetIdStr], SEP)
156173
157174
158-func keyClaimedTotal (lpAssetIdStr) = makeString(["%s%s%s__claimed", "total", lpAssetIdStr], SEP)
175+func keyClaimedTotal (lpAssetIdStr) = makeString(["%s%s%s__claimed__total", lpAssetIdStr], SEP)
159176
160177
161178 func readStaked (key) = valueOrElse(getInteger(this, key), 0)
162179
163180
164181 func keyLastTotalLpBalance (lpAssetId) = makeString(["%s%s%s", lpAssetId, "total", "bal"], SEP)
165182
166183
167184 func keyLastUserLpBalance (lpAssetId,userAddress) = makeString(["%s%s%s", lpAssetId, userAddress, "bal"], SEP)
168185
169186
170187 func keyTotalLpBalanceIntegral (lpAssetId) = makeString(["%s%s%s", lpAssetId, "total", "balINT"], SEP)
171188
172189
173190 func keyUserLpBalanceIntegral (lpAssetId,userAddress) = makeString(["%s%s%s", lpAssetId, userAddress, "balINT"], SEP)
174191
175192
176193 func keyTotalLpBalanceIntegralLastUpdHeight (lpAssetId) = makeString(["%s%s%s", lpAssetId, "total", "lastUpd"], SEP)
177194
178195
179196 func keyUserLpBalanceIntegralLastUpdHeight (lpAssetId,userAddress) = makeString(["%s%s%s", lpAssetId, userAddress, "lastUpd"], SEP)
180197
181198
182199 func keyWxPerLpIntegral (lpAssetId) = makeString(["%s%s%s%s", lpAssetId, "common", "lpInt"], SEP)
183200
184201
185202 func keyWxPerLpIntegralLastUpdHeight (lpAssetId) = makeString(["%s%s%s%s", lpAssetId, "common", "lpIntH"], SEP)
186203
187204
188205 func keyWxToClaimUser (lpAssetId,userAddress) = makeString(["%s%s%s%s", lpAssetId, userAddress, "lpInt"], SEP)
189206
190207
191208 func keyWxPerLpIntegralUserLastUpdHeight (lpAssetId,userAddress) = makeString(["%s%s%s%s", lpAssetId, userAddress, "lpIntH"], SEP)
192209
193210
194211 func keyWxPerLp (lpAssetId) = makeString(["%s", lpAssetId, "wxPerLp"], SEP)
195212
196213
197214 func keyWxPerLpX18 (lpAssetId) = makeString(["%s", lpAssetId, "wxPerLpX18"], SEP)
198215
199216
200217 func keyWxPerLpIntegralUserLast (lpAssetId,userAddress) = makeString(["%s%s%s%s", lpAssetId, userAddress, "uIntL"], SEP)
201218
202219
203220 func keyOperationHistoryRecord (type,userAddress,txId58) = makeString(["%s%s%s%s__history", type, userAddress, txId58], SEP)
204221
205222
206223 func formatHistoryRecord (userAddress,lpAssetId,type,amount) = makeString(["%s%s%s%d%d%d", userAddress, lpAssetId, type, toString(height), toString(lastBlock.timestamp), toString(amount)], SEP)
207224
208225
209226 func OperationHistoryEntry (type,userAddress,lpAssetId,amount,txId) = StringEntry(keyOperationHistoryRecord(type, userAddress, toBase58String(txId)), formatHistoryRecord(userAddress, lpAssetId, type, amount))
210227
211228
212-let factoryAddress = getStringOrFail(keyFactoryAddress())
229+let factoryAddress = getStringOrFail(this, keyFactoryAddress())
213230
214231 let factoryContract = addressFromStringValue(factoryAddress)
215232
216233 let factoryCfg = readFactoryCfgOrFail(factoryContract)
217234
218235 let emissionContract = getEmissionAddressOrFail(factoryCfg)
219236
220237 let boostingContract = getBoostingAddressOrFail(factoryCfg)
221238
222-func calcWxPerLpIntegralUserLast (stakedByUser,wxPerLpIntegralUserLastUpdHeightOrZero,wxPerLpIntegralNew,wxPerLpIntegralUserLastKEY) = if (if ((wxPerLpIntegralUserLastUpdHeightOrZero == 0))
223- then (stakedByUser > 0)
239+func calcWxPerLpIntegralUserLast (stakedByUser,wxPerLpIntegralUserLastUpdHeightOrZero,wxPerLpIntegralNew,wxPerLpIntegralUserLastKEY) = if (if ((wxPerLpIntegralUserLastUpdHeightOrZero == zeroBigInt))
240+ then (stakedByUser > zeroBigInt)
224241 else false)
225- then 0
226- else if ((stakedByUser == 0))
242+ then zeroBigInt
243+ else if ((stakedByUser == zeroBigInt))
227244 then wxPerLpIntegralNew
228- else if (if ((wxPerLpIntegralUserLastUpdHeightOrZero > 0))
229- then (stakedByUser > 0)
245+ else if (if ((wxPerLpIntegralUserLastUpdHeightOrZero > zeroBigInt))
246+ then (stakedByUser > zeroBigInt)
230247 else false)
231- then getIntOrFail(this, wxPerLpIntegralUserLastKEY)
248+ then value(parseBigInt(getStringOrFail(this, wxPerLpIntegralUserLastKEY)))
232249 else throw("calcWxPerLpIntegralUserLast: unexpected state")
233250
234251
235252 func refreshPoolINTEGRALS (lpAssetIdStr,poolAddressStr,lpDeltaAmount) = {
236253 let stakedTotalKEY = keyStakedTotal(lpAssetIdStr)
237- let stakedTotal = readStaked(stakedTotalKEY)
254+ let stakedTotal = toBigInt(readStaked(stakedTotalKEY))
255+ let nonZeroStakedTotal = if ((stakedTotal == zeroBigInt))
256+ then oneBigInt
257+ else stakedTotal
238258 let poolWeight = getIntegerValue(factoryContract, keyFactoryPoolWeight(poolAddressStr))
239259 let emissionStartBlock = getIntOrFail(emissionContract, keyEmissionStartBlock())
240260 let MULT3 = 1000
241261 let wxEmissionPerBlockX3 = (getIntOrFail(emissionContract, keyEmissionRatePerBlockCurrent()) * MULT3)
242262 let poolWxEmissionPerBlockX3 = fraction(wxEmissionPerBlockX3, poolWeight, (POOLWEIGHTMULT * 3))
243263 let wxPerLpIntegralKEY = keyWxPerLpIntegral(lpAssetIdStr)
244264 let wxPerLpIntegralLastUpdHeightKEY = keyWxPerLpIntegralLastUpdHeight(lpAssetIdStr)
245265 let wxPerLpKEY = keyWxPerLp(lpAssetIdStr)
246266 let wxPerLpIntegralLastUpdHeight = getIntOrDefault(this, wxPerLpIntegralLastUpdHeightKEY, emissionStartBlock)
247- let wxPerLpIntegral = getIntOrZero(this, wxPerLpIntegralKEY)
267+ let wxPerLpIntegral = getBigIntFromStringOrZero(this, wxPerLpIntegralKEY)
248268 let wxPerLpOrZeroX3 = 0
249269 let dh = max([(height - wxPerLpIntegralLastUpdHeight), 0])
250270 let wxPerLpX3 = if ((wxPerLpOrZeroX3 != 0))
251- then wxPerLpOrZeroX3
252- else fraction(poolWxEmissionPerBlockX3, MULT8, stakedTotal)
253- let stakedTotalNew = (stakedTotal + lpDeltaAmount)
254- let wxPerLpIntegralNew = (wxPerLpIntegral + (wxPerLpX3 * dh))
255- let wxPerLpX3New = (poolWxEmissionPerBlockX3 / stakedTotalNew)
271+ then toBigInt(wxPerLpOrZeroX3)
272+ else fraction(toBigInt(poolWxEmissionPerBlockX3), toBigInt(MULT8), nonZeroStakedTotal)
273+ let stakedTotalNew = (stakedTotal + toBigInt(lpDeltaAmount))
274+ let nonZeroStakedTotalNew = if ((stakedTotalNew == zeroBigInt))
275+ then oneBigInt
276+ else stakedTotalNew
277+ let wxPerLpIntegralNew = (wxPerLpIntegral + (wxPerLpX3 * toBigInt(dh)))
278+ let wxPerLpX3New = (toBigInt(poolWxEmissionPerBlockX3) / nonZeroStakedTotalNew)
256279 let wxPerLpIntegralLastUpdHeightNew = height
257280 let debug = makeString([toString(wxPerLpIntegralNew), "dh=", toString(dh), "wxPerLpX3=", toString(wxPerLpX3), "stakedTotal=", toString(stakedTotal), toString(poolWxEmissionPerBlockX3), toString(wxEmissionPerBlockX3), "poolWeight=", toString(poolWeight)], "::")
258- $Tuple3(wxPerLpIntegralNew, [IntegerEntry(wxPerLpIntegralKEY, wxPerLpIntegralNew), IntegerEntry(wxPerLpIntegralLastUpdHeightKEY, wxPerLpIntegralLastUpdHeightNew), IntegerEntry(wxPerLpKEY, wxPerLpX3New)], debug)
281+ $Tuple3(wxPerLpIntegralNew, [StringEntry(wxPerLpIntegralKEY, toString(wxPerLpIntegralNew)), IntegerEntry(wxPerLpIntegralLastUpdHeightKEY, wxPerLpIntegralLastUpdHeightNew), StringEntry(wxPerLpKEY, toString(wxPerLpX3New))], debug)
259282 }
260283
261284
262285 func refreshINTEGRALS (lpAssetIdStr,userAddressStr,poolAddressStr,lpDeltaAmount) = {
263- let $t01091111033 = refreshPoolINTEGRALS(lpAssetIdStr, poolAddressStr, lpDeltaAmount)
264- let wxPerLpIntegralNew = $t01091111033._1
265- let poolIntegralSTATE = $t01091111033._2
266- let poolDEBUG = $t01091111033._3
286+ let $t01150611628 = refreshPoolINTEGRALS(lpAssetIdStr, poolAddressStr, lpDeltaAmount)
287+ let wxPerLpIntegralNew = $t01150611628._1
288+ let poolIntegralSTATE = $t01150611628._2
289+ let poolDEBUG = $t01150611628._3
267290 let MULT3 = 1000
268291 let stakedByUserKEY = keyStakedByUser(userAddressStr, lpAssetIdStr)
269292 let stakedByUser = readStaked(stakedByUserKEY)
270293 let wxToClaimUserKEY = keyWxToClaimUser(lpAssetIdStr, userAddressStr)
271294 let wxPerLpIntegralUserLastUpdHeightKEY = keyWxPerLpIntegralUserLastUpdHeight(lpAssetIdStr, userAddressStr)
272295 let wxPerLpIntegralUserLastKEY = keyWxPerLpIntegralUserLast(lpAssetIdStr, userAddressStr)
273- let wxToClaimUser = getIntOrZero(this, wxToClaimUserKEY)
296+ let wxToClaimUser = getBigIntFromStringOrZero(this, wxToClaimUserKEY)
274297 let wxPerLpIntegralUserLastUpdHeightOrZero = getIntOrZero(this, wxPerLpIntegralUserLastUpdHeightKEY)
275- let wxPerLpIntegralUserLast = calcWxPerLpIntegralUserLast(stakedByUser, wxPerLpIntegralUserLastUpdHeightOrZero, wxPerLpIntegralNew, wxPerLpIntegralUserLastKEY)
276- let wxToClaimUserNew = (wxToClaimUser + fraction((wxPerLpIntegralNew - wxPerLpIntegralUserLast), stakedByUser, (MULT8 * MULT3)))
298+ let wxPerLpIntegralUserLast = calcWxPerLpIntegralUserLast(toBigInt(stakedByUser), toBigInt(wxPerLpIntegralUserLastUpdHeightOrZero), wxPerLpIntegralNew, wxPerLpIntegralUserLastKEY)
299+ let MULT11 = (MULT8 * MULT3)
300+ let wxToClaimUserNew = max([(wxToClaimUser + fraction((wxPerLpIntegralNew - wxPerLpIntegralUserLast), toBigInt(stakedByUser), toBigInt(MULT11))), zeroBigInt])
277301 let wxPerLpIntegralUserLastNew = wxPerLpIntegralNew
278302 let wxPerLpIntegralUserLastUpdHeightNew = height
279- let debug = makeString(["wxToClaimUser", toString(wxToClaimUser), "wxPerLpInteg", toString(wxPerLpIntegralUserLastUpdHeightOrZero), "wxPerLpIntegralNew", toString(wxPerLpIntegralNew), "wxToClaimUserNew", toString(wxToClaimUserNew), "wxPerLpIntegralUserLast", toString(wxPerLpIntegralUserLast), toString(stakedByUser), "poolDEBUG=", poolDEBUG, "height=", toString(height)], "::")
280- $Tuple3(wxToClaimUserNew, (poolIntegralSTATE ++ [IntegerEntry(wxToClaimUserKEY, wxToClaimUserNew), IntegerEntry(wxPerLpIntegralUserLastUpdHeightKEY, wxPerLpIntegralUserLastUpdHeightNew), IntegerEntry(wxPerLpIntegralUserLastKEY, wxPerLpIntegralUserLastNew)]), debug)
303+ let debug = makeString(["wxToClaimUser", toString(wxToClaimUser), "wxPerLpInteg", toString(wxPerLpIntegralUserLastUpdHeightOrZero), "this.getString", toString(value(parseBigInt(getStringOrFail(this, wxPerLpIntegralUserLastKEY)))), "wxPerLpIntegralNew", toString(wxPerLpIntegralNew), "wxToClaimUserNew", toString(wxToClaimUserNew), "wxPerLpIntegralUserLast", toString(wxPerLpIntegralUserLast), toString(stakedByUser), "poolDEBUG=", poolDEBUG, "height=", toString(height)], "::")
304+ $Tuple3(wxToClaimUserNew, (poolIntegralSTATE ++ [StringEntry(wxToClaimUserKEY, toString(wxToClaimUserNew)), IntegerEntry(wxPerLpIntegralUserLastUpdHeightKEY, wxPerLpIntegralUserLastUpdHeightNew), StringEntry(wxPerLpIntegralUserLastKEY, toString(wxPerLpIntegralUserLastNew))]), debug)
281305 }
282306
283307
284308 func managerPublicKeyOrUnit () = match getString(keyManagerPublicKey()) {
285309 case s: String =>
286310 fromBase58String(s)
287311 case _: Unit =>
288312 unit
289313 case _ =>
290314 throw("Match error")
291315 }
292316
293317
294318 func migratorPublicKeyOrUnit () = match getString(keyMigratorPublicKey()) {
295319 case s: String =>
296320 fromBase58String(s)
297321 case _: Unit =>
298322 unit
299323 case _ =>
300324 throw("Match error")
301325 }
302326
303327
304328 func pendingManagerPublicKeyOrUnit () = match getString(keyPendingManagerPublicKey()) {
305329 case s: String =>
306330 fromBase58String(s)
307331 case _: Unit =>
308332 unit
309333 case _ =>
310334 throw("Match error")
311335 }
312336
313337
314338 func mustManager (i) = {
315339 let pd = throw("Permission denied")
316340 match managerPublicKeyOrUnit() {
317341 case pk: ByteVector =>
318342 if ((i.callerPublicKey == pk))
319343 then true
320344 else pd
321345 case _: Unit =>
322346 if ((i.caller == this))
323347 then true
324348 else pd
325349 case _ =>
326350 throw("Match error")
327351 }
328352 }
329353
330354
331355 @Callable(i)
332356 func constructor (factoryAddressStr) = {
333357 let checkCaller = mustManager(i)
334358 if ((checkCaller == checkCaller))
335359 then [StringEntry(keyFactoryAddress(), factoryAddressStr)]
336360 else throw("Strict value is not equal to itself.")
337361 }
338362
339363
340364
341365 @Callable(i)
342366 func setManager (pendingManagerPublicKey) = {
343367 let checkCaller = mustManager(i)
344368 if ((checkCaller == checkCaller))
345369 then {
346370 let checkManagerPublicKey = fromBase58String(pendingManagerPublicKey)
347371 if ((checkManagerPublicKey == checkManagerPublicKey))
348372 then [StringEntry(keyPendingManagerPublicKey(), pendingManagerPublicKey)]
349373 else throw("Strict value is not equal to itself.")
350374 }
351375 else throw("Strict value is not equal to itself.")
352376 }
353377
354378
355379
356380 @Callable(i)
357381 func confirmManager () = {
358382 let pm = pendingManagerPublicKeyOrUnit()
359383 let hasPM = if (isDefined(pm))
360384 then true
361385 else throw("No pending manager")
362386 if ((hasPM == hasPM))
363387 then {
364388 let checkPM = if ((i.callerPublicKey == value(pm)))
365389 then true
366390 else throw("You are not pending manager")
367391 if ((checkPM == checkPM))
368392 then [StringEntry(keyManagerPublicKey(), toBase58String(value(pm))), DeleteEntry(keyPendingManagerPublicKey())]
369393 else throw("Strict value is not equal to itself.")
370394 }
371395 else throw("Strict value is not equal to itself.")
372396 }
373397
374398
375399
376400 @Callable(i)
377401 func stake () = if ((size(i.payments) != 1))
378402 then throw("invalid payment - exact one payment must be attached")
379403 else {
380404 let pmt = i.payments[0]
381405 let lpAssetId = value(pmt.assetId)
382406 let lpAssetIdStr = toBase58String(lpAssetId)
383407 let amount = pmt.amount
384408 let poolAddressStr = valueOrErrorMessage(getString(factoryContract, keyFactoryLp2AssetsMapping(lpAssetIdStr)), ("unsupported lp asset " + lpAssetIdStr))
385409 let callerStr = toString(i.caller)
386410 let userAddressStr = if ((callerStr == poolAddressStr))
387411 then toString(i.originCaller)
388412 else callerStr
389413 let stakedByUserKEY = keyStakedByUser(userAddressStr, lpAssetIdStr)
390414 let stakedTotalKEY = keyStakedTotal(lpAssetIdStr)
391415 let stakedByUser = readStaked(stakedByUserKEY)
392416 let stakedTotal = readStaked(stakedTotalKEY)
393- let $t01532415441 = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, amount)
394- let wxToClaimUserNew = $t01532415441._1
395- let integralSTATE = $t01532415441._2
396- let debug = $t01532415441._3
417+ let $t01619616313 = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, amount)
418+ let wxToClaimUserNew = $t01619616313._1
419+ let integralSTATE = $t01619616313._2
420+ let debug = $t01619616313._3
397421 ([IntegerEntry(stakedByUserKEY, (stakedByUser + amount)), IntegerEntry(stakedTotalKEY, (stakedTotal + amount)), OperationHistoryEntry("stake", userAddressStr, lpAssetIdStr, amount, i.transactionId)] ++ integralSTATE)
398422 }
399423
400424
401425
402426 @Callable(i)
403427 func unstake (lpAssetIdStr,amount) = {
404428 let lpAssetId = fromBase58String(lpAssetIdStr)
405429 let poolAddressStr = valueOrErrorMessage(getString(factoryContract, keyFactoryLp2AssetsMapping(lpAssetIdStr)), ("unsupported lp asset " + lpAssetIdStr))
406430 let poolAddon = valueOrElse(getString(this, keyStablePoolAddonAddr()), poolAddressStr)
407431 let callerStr = toString(i.caller)
408432 let userAddressStr = if (if ((callerStr == poolAddressStr))
409433 then true
410434 else (callerStr == poolAddon))
411435 then toString(i.originCaller)
412436 else callerStr
413437 let stakedByUserKEY = keyStakedByUser(userAddressStr, lpAssetIdStr)
414438 let stakedTotalKEY = keyStakedTotal(lpAssetIdStr)
415439 let stakedByUser = readStaked(stakedByUserKEY)
416440 let stakedTotal = readStaked(stakedTotalKEY)
417- let $t01657816696 = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, -(amount))
418- let wxToClaimUserNew = $t01657816696._1
419- let integralSTATE = $t01657816696._2
420- let debug = $t01657816696._3
441+ let $t01745017568 = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, -(amount))
442+ let wxToClaimUserNew = $t01745017568._1
443+ let integralSTATE = $t01745017568._2
444+ let debug = $t01745017568._3
421445 if ((amount > stakedByUser))
422446 then throw("passed amount is less then available")
423447 else ([IntegerEntry(stakedByUserKEY, (stakedByUser - amount)), IntegerEntry(stakedTotalKEY, (stakedTotal - amount)), ScriptTransfer(i.caller, amount, lpAssetId), OperationHistoryEntry("unstake", userAddressStr, lpAssetIdStr, amount, i.transactionId)] ++ integralSTATE)
424448 }
425449
426450
427451
428452 @Callable(i)
429453 func claimWx (lpAssetIdStr) = {
430454 let userAddress = i.caller
431455 let userAddressStr = toString(i.caller)
432456 let poolAddressStr = getStringByAddressOrFail(factoryContract, keyFactoryLpAssetToPoolContractAddress(lpAssetIdStr))
433457 let claimedByUserKEY = keyClaimedByUser(lpAssetIdStr, userAddressStr)
434458 let claimedTotalKEY = keyClaimedTotal(lpAssetIdStr)
435459 let claimedByUserMinRewardKEY = keyClaimedByUserMinReward(lpAssetIdStr, userAddressStr)
436460 let claimedByUserBoostRewardKEY = keyClaimedByUserBoostReward(lpAssetIdStr, userAddressStr)
437- let claimedByUser = getIntOrZero(this, claimedByUserKEY)
438- let claimedByUserMinReward = getIntOrZero(this, claimedByUserMinRewardKEY)
439- let claimedByUserBoostReward = getIntOrZero(this, claimedByUserBoostRewardKEY)
440- let claimedTotal = getIntOrZero(this, claimedTotalKEY)
441- let $t01788818000 = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, 0)
442- let wxToClaimUserNew = $t01788818000._1
443- let integralSTATE = $t01788818000._2
444- let debug = $t01788818000._3
445- let availableToClaim = (wxToClaimUserNew - claimedByUser)
446- if ((0 >= availableToClaim))
461+ let claimedByUser = getBigIntFromStringOrZero(this, claimedByUserKEY)
462+ let claimedByUserMinReward = getBigIntFromStringOrZero(this, claimedByUserMinRewardKEY)
463+ let claimedByUserBoostReward = getBigIntFromStringOrZero(this, claimedByUserBoostRewardKEY)
464+ let claimedTotal = getBigIntFromStringOrZero(this, claimedTotalKEY)
465+ let $t01881218924 = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, 0)
466+ let wxToClaimUserNew = $t01881218924._1
467+ let integralSTATE = $t01881218924._2
468+ let debug = $t01881218924._3
469+ let availableToClaim = max([(wxToClaimUserNew - claimedByUser), zeroBigInt])
470+ if ((zeroBigInt >= availableToClaim))
447471 then throw("nothing to claim")
448472 else {
449- let wxAmountBoostTotal = asInt(asAnyList(invoke(boostingContract, "claimWxBoost", [lpAssetIdStr, userAddressStr], nil))[0])
473+ let wxAmountBoostTotal = max([asInt(asAnyList(invoke(boostingContract, "claimWxBoost", [lpAssetIdStr, userAddressStr], nil))[0]), 0])
450474 let minRewardPart = availableToClaim
451- let boostRewardPart = min([(minRewardPart * 2), wxAmountBoostTotal])
452- let wxAssetId = asByteVector(asAnyList(invoke(emissionContract, "emit", [minRewardPart], nil))[0])
453- let emitBoost = asAnyList(invoke(emissionContract, "emit", [boostRewardPart], nil))
475+ let boostRewardPart = min([(minRewardPart * toBigInt(2)), toBigInt(wxAmountBoostTotal)])
476+ let wxAssetId = asByteVector(asAnyList(invoke(emissionContract, "emit", [toInt(minRewardPart)], nil))[0])
477+ let emitBoost = asAnyList(invoke(emissionContract, "emit", [toInt(boostRewardPart)], nil))
454478 if ((emitBoost == emitBoost))
455- then [IntegerEntry(claimedByUserKEY, (claimedByUser + availableToClaim)), IntegerEntry(claimedByUserMinRewardKEY, (claimedByUserMinReward + minRewardPart)), IntegerEntry(claimedByUserBoostRewardKEY, (claimedByUserBoostReward + boostRewardPart)), IntegerEntry(claimedTotalKEY, (claimedTotal + availableToClaim)), ScriptTransfer(userAddress, minRewardPart, wxAssetId), ScriptTransfer(userAddress, boostRewardPart, wxAssetId), OperationHistoryEntry("claim", userAddressStr, lpAssetIdStr, availableToClaim, i.transactionId)]
479+ then {
480+ let claimedByUserValue = (claimedByUser + availableToClaim)
481+ let claimedByUserMinRewardPlusPart = (claimedByUserMinReward + minRewardPart)
482+ let claimedByUserBoostRewardPlusBoostRewardPart = (claimedByUserMinReward + minRewardPart)
483+ let claimedTotalPlusAvailableToClaim = (claimedByUserMinReward + minRewardPart)
484+[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)]
485+ }
456486 else throw("Strict value is not equal to itself.")
457487 }
458488 }
459489
460490
461491
462492 @Callable(i)
463493 func claimWxREADONLY (lpAssetIdStr,userAddressStr) = {
464494 let stakedByUserKEY = keyStakedByUser(userAddressStr, lpAssetIdStr)
465495 let stakedTotalKEY = keyStakedTotal(lpAssetIdStr)
466496 let claimedByUserKEY = keyClaimedByUser(lpAssetIdStr, userAddressStr)
467497 let stakedByUser = readStaked(stakedByUserKEY)
468498 let stakedTotal = readStaked(stakedTotalKEY)
469- let claimedByUser = getIntOrZero(this, claimedByUserKEY)
499+ let claimedByUser = getBigIntFromStringOrZero(this, claimedByUserKEY)
470500 let poolAddressStr = getStringByAddressOrFail(factoryContract, keyFactoryLpAssetToPoolContractAddress(lpAssetIdStr))
471501 let poolWeight = getIntegerValue(factoryContract, keyFactoryPoolWeight(poolAddressStr))
472502 let wxEmissionPerBlock = getIntOrFail(emissionContract, keyEmissionRatePerBlockCurrent())
473503 let emissionStartBlock = getIntOrFail(emissionContract, keyEmissionStartBlock())
474504 let passedBlocks = if ((emissionStartBlock > height))
475505 then 0
476506 else (height - emissionStartBlock)
477507 let poolWxEmission = fraction((wxEmissionPerBlock * passedBlocks), poolWeight, POOLWEIGHTMULT)
478508 let userWxReward = fraction(poolWxEmission, stakedByUser, stakedTotal)
479- let $t02020120313 = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, 0)
480- let wxToClaimUserNew = $t02020120313._1
481- let integralSTATE = $t02020120313._2
482- let debug = $t02020120313._3
483- let availableToClaim = (wxToClaimUserNew - claimedByUser)
509+ let $t02156621678 = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, 0)
510+ let wxToClaimUserNew = $t02156621678._1
511+ let integralSTATE = $t02156621678._2
512+ let debug = $t02156621678._3
513+ let availableToClaim = max([(wxToClaimUserNew - claimedByUser), zeroBigInt])
484514 let boostInvResult = asAnyList(invoke(boostingContract, "claimWxBoostREADONLY", [lpAssetIdStr, userAddressStr], nil))
485- let wxAmountBoostTotal = asInt(boostInvResult[0])
515+ let wxAmountBoostTotal = max([asInt(boostInvResult[0]), 0])
486516 let boostDebug = asString(boostInvResult[1])
487517 let minRewardPart = availableToClaim
488- let boostRewardPart = min([(minRewardPart * 2), wxAmountBoostTotal])
518+ let boostRewardPart = min([(minRewardPart * toBigInt(2)), toBigInt(wxAmountBoostTotal)])
489519 let totalReward = (minRewardPart + boostRewardPart)
490520 $Tuple2(nil, makeString(["%s%s%d%d%d%d%s", lpAssetIdStr, userAddressStr, toString(totalReward), toString(claimedByUser), toString(minRewardPart), toString(boostRewardPart), ((((debug + "::") + toString(userWxReward)) + "::BOOSTDEBUG::") + boostDebug)], SEP))
491521 }
492522
493523
494524
495525 @Callable(i)
496526 func onModifyWeight (lpAssetIdStr,poolAddressStr) = if ((i.caller != factoryContract))
497527 then throw("permissions denied")
498528 else {
499- let $t02119321303 = refreshPoolINTEGRALS(lpAssetIdStr, poolAddressStr, 0)
500- let wxPerLpIntegralNew = $t02119321303._1
501- let poolIntegralSTATE = $t02119321303._2
502- let poolDEBUG = $t02119321303._3
529+ let $t02260922719 = refreshPoolINTEGRALS(lpAssetIdStr, poolAddressStr, 0)
530+ let wxPerLpIntegralNew = $t02260922719._1
531+ let poolIntegralSTATE = $t02260922719._2
532+ let poolDEBUG = $t02260922719._3
503533 poolIntegralSTATE
504534 }
505535
506536
507537 @Verifier(tx)
508538 func verify () = {
509539 let targetPublicKey = match managerPublicKeyOrUnit() {
510540 case pk: ByteVector =>
511541 pk
512542 case _: Unit =>
513543 tx.senderPublicKey
514544 case _ =>
515545 throw("Match error")
516546 }
517547 let migratorPublicKey = match migratorPublicKeyOrUnit() {
518548 case pk: ByteVector =>
519549 pk
520550 case _: Unit =>
521551 tx.senderPublicKey
522552 case _ =>
523553 throw("Match error")
524554 }
525555 if (sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey))
526556 then true
527557 else sigVerify(tx.bodyBytes, tx.proofs[0], migratorPublicKey)
528558 }
529559

github/deemru/w8io/026f985 
97.22 ms