tx · 2VJzFgHogPw7zKhEX9MPGZxoc47AriXfqNixh92oVFQb

3Myn55vLkduxbX3ZXfiDCZhaQsLxYp1kmCy:  -0.02800000 Waves

2023.03.14 18:53 [2489924] smart account 3Myn55vLkduxbX3ZXfiDCZhaQsLxYp1kmCy > SELF 0.00000000 Waves

{ "type": 13, "id": "2VJzFgHogPw7zKhEX9MPGZxoc47AriXfqNixh92oVFQb", "fee": 2800000, "feeAssetId": null, "timestamp": 1678809210840, "version": 2, "chainId": 84, "sender": "3Myn55vLkduxbX3ZXfiDCZhaQsLxYp1kmCy", "senderPublicKey": "9W33iCCNfmFxUbiC6XZcH5x7f6xfwC7Jb3BoExT5q2PV", "proofs": [ "3WYGuE3G5hBRnSSvyQoBHUBRwcovZHEgRj8N87b1AsmSnUMHhAwakjtfh69ebNMAcidR6WETMny512aejssKp2Mc" ], "script": "base64:BgLFLwgCEggKBggIAQEBCBIFCgMBCAISAwoBARIDCgEBEgQKAggIEgQKAggIEgMKAQgSAwoBCBIDCgEIEgQKAggBEgASABIFCgMICAQSAwoBCBIECgIICBIDCgEIEgAiA1NFUCIGU0NBTEU4IgVNVUxUOCIOUE9PTFdFSUdIVE1VTFQiB3dyYXBFcnIiA21zZyIIdGhyb3dFcnIiBHN0cmYiB2FkZHJlc3MiA2tleSIDaW96IgNpb2QiCmRlZmF1bHRWYWwiA2lvZiIDYWJzIgN2YWwiA2FhbCIHJG1hdGNoMCIKdmFsQW55THlzdCICYWkiBnZhbEludCIba2V5UmVmZXJyYWxzQ29udHJhY3RBZGRyZXNzIh5yZWZlcnJhbHNDb250cmFjdEFkZHJlc3NPckZhaWwiFmtleVJlZmVycmFsUHJvZ3JhbU5hbWUiGnJlZmVycmFsUHJvZ3JhbU5hbWVEZWZhdWx0IhNyZWZlcnJhbFByb2dyYW1OYW1lIhFrZXlGYWN0b3J5QWRkcmVzcyIYSWR4RmFjdG9yeUNmZ1N0YWtpbmdEYXBwIhlJZHhGYWN0b3J5Q2ZnQm9vc3Rp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bmZpcm1NYW5hZ2VyAAQCZnAJAQJhRwAEAmZxAwkBCWlzRGVmaW5lZAEFAmZwBgkAAgECEk5vIHBlbmRpbmcgbWFuYWdlcgMJAAACBQJmcQUCZnEEAmZyAwkAAAIIBQJhSQ9jYWxsZXJQdWJsaWNLZXkJAQV2YWx1ZQEFAmZwBgkAAgECG1lvdSBhcmUgbm90IHBlbmRpbmcgbWFuYWdlcgMJAAACBQJmcgUCZnIJAMwIAgkBC1N0cmluZ0VudHJ5AgkBAmFmAAkA2AQBCQEFdmFsdWUBBQJmcAkAzAgCCQELRGVsZXRlRW50cnkBCQECYWcABQNuaWwJAAIBAiRTdHJpY3QgdmFsdWUgaXMgbm90IGVxdWFsIHRvIGl0c2VsZi4JAAIBAiRTdHJpY3QgdmFsdWUgaXMgbm90IGVxdWFsIHRvIGl0c2VsZi4BAmZzAQJmdAAEAmZ1BAFyCQECYUUAAwkAAQIFAXICCkJ5dGVWZWN0b3IEAmFLBQFyBQJhSwMJAAECBQFyAgRVbml0CAUCZnMPc2VuZGVyUHVibGljS2V5CQACAQILTWF0Y2ggZXJyb3IJAPQDAwgFAmZzCWJvZHlCeXRlcwkAkQMCCAUCZnMGcHJvb2ZzAAAFAmZ1Oyp1Cg==", "height": 2489924, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: J7jJee35tVeur9nqrQCMHWfxhuFC6kWU51aZo4XYMNG6 Next: 12yZeEmQxn2mM5zoUaNVe8BfiAjibCYzyHGrNZ8FWXyb Diff:
OldNewDifferences
136136
137137
138138 func keyEmissionStartBlock () = "%s%s__emission__startBlock"
139+
140+
141+func keyBoostingV2LastUpdateHeight () = "%s%s__boostingV2__startBlock"
142+
143+
144+func keyBoostingV2Integral () = "%s%s__boostingV2__integral"
139145
140146
141147 func keyEmissionDurationInBlocks () = "%s%s__emission__duration"
277283 func keyStatsUsersCount () = "%s%s__stats__activeUsersCount"
278284
279285
280-func keyUserBoostEmissionLastINTEGRAL (userNum) = makeString(["%s%d__userBoostEmissionLastInt", userNum], SEP)
286+func keyUserBoostEmissionLastINTEGRAL (userNum) = makeString(["%s%d__userBoostEmissionLastIntV2", userNum], SEP)
281287
282288
283-func keyUserLpBoostEmissionLastINTEGRAL (userNum,lpAssetId) = makeString(["%s%d__userBoostEmissionLastInt", userNum, lpAssetId], SEP)
289+func keyUserLpBoostEmissionLastINTEGRAL (userNum,lpAssetId) = makeString(["%s%d__userBoostEmissionLastIntV2", userNum, lpAssetId], SEP)
284290
285291
286292 func keyUserMaxBoostINTEGRAL (userNum) = makeString(["%s%d__maxBoostInt", userNum], SEP)
316322 let keyVotingEmissionContract = makeString(["%s", "votingEmissionContract"], SEP)
317323
318324 let votingEmissionContract = addressFromStringValue(getStringValue(factoryContract, keyVotingEmissionContract))
325+
326+let boostCoeff = {
327+ let @ = invoke(emissionContract, "getBoostCoeffREADONLY", nil, nil)
328+ if ($isInstanceOf(@, "Int"))
329+ then @
330+ else throw(($getType(@) + " couldn't be cast to Int"))
331+ }
319332
320333 func getTotalCachedGwx (correct) = {
321334 let keyCurrentEpochUi = makeString(["%s", "currentEpochUi"], SEP)
405418
406419 func getVotingEmissionEpochInfo () = {
407420 let keyCurrentEpochUi = makeString(["%s", "currentEpochUi"], SEP)
408- let $t01492815216 = {
421+ let $t01515015438 = {
409422 let currentEpochUi = value(getInteger(votingEmissionContract, keyCurrentEpochUi))
410423 let lastFinalizedEpoch = (currentEpochUi - 1)
411424 if ((0 > lastFinalizedEpoch))
412425 then throwErr("invalid epoch")
413426 else $Tuple2(currentEpochUi, lastFinalizedEpoch)
414427 }
415- let currentEpochUi = $t01492815216._1
416- let lastFinalizedEpoch = $t01492815216._2
428+ let currentEpochUi = $t01515015438._1
429+ let lastFinalizedEpoch = $t01515015438._2
417430 func keyStartHeightByEpoch (epoch) = makeString(["%s%d", "startHeight", toString(epoch)], SEP)
418431
419432 let currentEpochStartHeight = value(getInteger(votingEmissionContract, keyStartHeightByEpoch(currentEpochUi)))
420433 $Tuple2(lastFinalizedEpoch, currentEpochStartHeight)
434+ }
435+
436+
437+func getPoolAssetsByLpAssetId (lpAssetIdStr) = {
438+ let idxAmountAssetId = 4
439+ let idxPriceAssetId = 5
440+ let poolCfg = {
441+ let @ = invoke(factoryContract, "getPoolConfigByLpAssetId", [lpAssetIdStr], nil)
442+ if ($isInstanceOf(@, "List[Any]"))
443+ then @
444+ else throw(($getType(@) + " couldn't be cast to List[Any]"))
445+ }
446+ let amountAssetId = {
447+ let @ = poolCfg[idxAmountAssetId]
448+ if ($isInstanceOf(@, "String"))
449+ then @
450+ else throw(($getType(@) + " couldn't be cast to String"))
451+ }
452+ let priceAssetId = {
453+ let @ = poolCfg[idxPriceAssetId]
454+ if ($isInstanceOf(@, "String"))
455+ then @
456+ else throw(($getType(@) + " couldn't be cast to String"))
457+ }
458+ $Tuple2(amountAssetId, priceAssetId)
421459 }
422460
423461
433471 func keyVotingResultStakedLastUpdateHeight (lpAssetIdStr,epoch) = makeString(["%s%s%d", "votingResultStakedIntegralLastUpdateHeight", lpAssetIdStr, toString(epoch)], SEP)
434472
435473
474+func keyVotingResultStakedIntegralLast (lpAssetIdStr,address,epoch) = makeString(["%s%s%s%d", "votingResultStakedIntegralLast", lpAssetIdStr, toString(address), toString(epoch)], SEP)
475+
476+
436477 func keyVoteStakedIntegral (lpAssetIdStr,address,epoch) = makeString(["%s%s%s%d", "voteStakedIntegral", lpAssetIdStr, toString(address), toString(epoch)], SEP)
437478
438479
439480 func keyVoteStakedLastUpdateHeight (lpAssetIdStr,address,epoch) = makeString(["%s%s%s%d", "voteStakedIntegralLastUpdateHeight", lpAssetIdStr, toString(address), toString(epoch)], SEP)
440481
441482
483+func keyVoteStakedIntegralLast (lpAssetIdStr,address,epoch) = makeString(["%s%s%s%d", "voteStakedIntegralLast", lpAssetIdStr, toString(address), toString(epoch)], SEP)
484+
485+
486+func keyStakedByUser (userAddressStr,lpAssetIdStr) = makeString(["%s%s%s", "staked", userAddressStr, lpAssetIdStr], SEP)
487+
488+
489+func getUserVoteFinalized (lpAssetIdStr,userAddressStr) = {
490+ let userAddress = addressFromStringValue(userAddressStr)
491+ let $t01822818308 = getVotingEmissionEpochInfo()
492+ let lastFinalizedEpoch = $t01822818308._1
493+ let currentEpochStartHeight = $t01822818308._2
494+ let $t01831118386 = getPoolAssetsByLpAssetId(lpAssetIdStr)
495+ let amountAssetId = $t01831118386._1
496+ let priceAssetId = $t01831118386._2
497+ let userVoteKey = keyVote(amountAssetId, priceAssetId, userAddress, lastFinalizedEpoch)
498+ let userVote = valueOrElse(getInteger(votingEmissionContract, userVoteKey), 0)
499+ userVote
500+ }
501+
502+
503+func getUserVoteStaked (lpAssetIdStr,userAddressStr) = {
504+ let stakedByUser = valueOrElse(getInteger(stakingContract, keyStakedByUser(userAddressStr, lpAssetIdStr)), 0)
505+ let userVote = getUserVoteFinalized(lpAssetIdStr, userAddressStr)
506+ if ((stakedByUser == 0))
507+ then 0
508+ else userVote
509+ }
510+
511+
442512 func getVotingResultStaked (lpAssetIdStr) = {
443- let $t01690116981 = getVotingEmissionEpochInfo()
444- let lastFinalizedEpoch = $t01690116981._1
445- let currentEpochStartHeight = $t01690116981._2
513+ let $t01893019010 = getVotingEmissionEpochInfo()
514+ let lastFinalizedEpoch = $t01893019010._1
515+ let currentEpochStartHeight = $t01893019010._2
446516 let votingResultStakedStart = valueOrElse(getInteger(votingEmissionContract, keyVotingResultStaked(lpAssetIdStr, lastFinalizedEpoch)), 0)
447517 let votingResultStaked = valueOrElse(getInteger(this, keyVotingResultStaked(lpAssetIdStr, lastFinalizedEpoch)), votingResultStakedStart)
448518 votingResultStaked
450520
451521
452522 func refreshVotingResultStakedIntegral (lpAssetIdStr,stakedVoteDelta) = {
453- let $t01750217582 = getVotingEmissionEpochInfo()
454- let lastFinalizedEpoch = $t01750217582._1
455- let currentEpochStartHeight = $t01750217582._2
523+ let $t01953119611 = getVotingEmissionEpochInfo()
524+ let lastFinalizedEpoch = $t01953119611._1
525+ let currentEpochStartHeight = $t01953119611._2
456526 let votingResultStaked = getVotingResultStaked(lpAssetIdStr)
457527 let votingResultStakedNew = (votingResultStaked + stakedVoteDelta)
458528 let votingResultStakedIntegralKey = keyVotingResultStakedIntegral(lpAssetIdStr, lastFinalizedEpoch)
466536
467537
468538 func refreshVoteStakedIntegral (lpAssetIdStr,userAddressStr,edge) = {
469- let $t01878218862 = getVotingEmissionEpochInfo()
470- let lastFinalizedEpoch = $t01878218862._1
471- let currentEpochStartHeight = $t01878218862._2
539+ let $t02081120891 = getVotingEmissionEpochInfo()
540+ let lastFinalizedEpoch = $t02081120891._1
541+ let currentEpochStartHeight = $t02081120891._2
472542 let userAddress = addressFromStringValue(userAddressStr)
473543 let idxAmountAssetId = 4
474544 let idxPriceAssetId = 5
497567 let stakedVoteDelta = if (edge)
498568 then userVote
499569 else -(userVote)
500- let $t01946719586 = refreshVotingResultStakedIntegral(lpAssetIdStr, stakedVoteDelta)
501- let votingResultActions = $t01946719586._1
502- let votingResultStakedIntegral = $t01946719586._2
570+ let $t02149621615 = refreshVotingResultStakedIntegral(lpAssetIdStr, stakedVoteDelta)
571+ let votingResultActions = $t02149621615._1
572+ let votingResultStakedIntegral = $t02149621615._2
503573 let userVoteStaked = if (edge)
504574 then 0
505575 else userVote
516586 }
517587
518588
589+func getStakedVotesIntegralsDiff (lpAssetIdStr,userAddressStr) = {
590+ let $t02260722687 = getVotingEmissionEpochInfo()
591+ let lastFinalizedEpoch = $t02260722687._1
592+ let currentEpochStartHeight = $t02260722687._2
593+ let userAddress = addressFromStringValue(userAddressStr)
594+ let userVoteStaked = getUserVoteStaked(lpAssetIdStr, userAddressStr)
595+ let votingResultStaked = getVotingResultStaked(lpAssetIdStr)
596+ let userVoteStakedIntegralPrev = valueOrElse(getInteger(this, keyVoteStakedIntegral(lpAssetIdStr, userAddress, lastFinalizedEpoch)), 0)
597+ let votingResultStakedIntegralPrev = valueOrElse(getInteger(this, keyVotingResultStakedIntegral(lpAssetIdStr, lastFinalizedEpoch)), 0)
598+ let userVoteStakedLastUpdateHeight = valueOrElse(getInteger(this, keyVoteStakedLastUpdateHeight(lpAssetIdStr, userAddress, lastFinalizedEpoch)), currentEpochStartHeight)
599+ let votingResultStakedLastUpdateHeight = valueOrElse(getInteger(this, keyVotingResultStakedLastUpdateHeight(lpAssetIdStr, lastFinalizedEpoch)), currentEpochStartHeight)
600+ let userVoteStakedIntegralKey = keyVoteStakedIntegralLast(lpAssetIdStr, userAddress, lastFinalizedEpoch)
601+ let userVoteStakedIntegralLast = valueOrElse(getInteger(this, userVoteStakedIntegralKey), 0)
602+ let votingResultStakedIntegralKey = keyVotingResultStakedIntegralLast(lpAssetIdStr, userAddress, lastFinalizedEpoch)
603+ let votingResultStakedIntegralLast = valueOrElse(getInteger(this, votingResultStakedIntegralKey), 0)
604+ let userVoteStakedIntegralDh = (height - userVoteStakedLastUpdateHeight)
605+ let votingResultStakedIntegralDh = (height - votingResultStakedLastUpdateHeight)
606+ let userVoteStakedIntegral = ((userVoteStakedIntegralDh * userVoteStaked) + userVoteStakedIntegralPrev)
607+ let votingResultStakedIntegral = ((votingResultStakedIntegralDh * votingResultStaked) + votingResultStakedIntegralPrev)
608+ let userVoteStakedIntegralDiff = (userVoteStakedIntegral - userVoteStakedIntegralLast)
609+ let votingResultStakedIntegralDiff = (votingResultStakedIntegral - votingResultStakedIntegralLast)
610+ $Tuple3([IntegerEntry(userVoteStakedIntegralKey, userVoteStakedIntegral), IntegerEntry(votingResultStakedIntegralKey, votingResultStakedIntegral)], userVoteStakedIntegralDiff, votingResultStakedIntegralDiff)
611+ }
612+
613+
614+func refreshBoostEmissionIntegral () = {
615+ let wxEmissionPerBlock = iof(emissionContract, keyEmissionRatePerBlockCurrent())
616+ let boostingV2LastUpdateHeightOption = getInteger(emissionContract, keyBoostingV2LastUpdateHeight())
617+ let boostingV2IngergalOption = getInteger(this, keyBoostingV2Integral())
618+ let emissionEnd = iof(emissionContract, keyEmissionEndBlock())
619+ let h = if ((height > emissionEnd))
620+ then emissionEnd
621+ else height
622+ let dh = match boostingV2LastUpdateHeightOption {
623+ case lastUpdateHeight: Int =>
624+ max([(h - lastUpdateHeight), 0])
625+ case _: Unit =>
626+ 0
627+ case _ =>
628+ throw("Match error")
629+ }
630+ let boostEmissionPerBlock = ((wxEmissionPerBlock * (boostCoeff - 1)) / boostCoeff)
631+ let boostEmissionIntegralPrev = valueOrElse(boostingV2IngergalOption, 0)
632+ let boostEmissionIntegral = ((boostEmissionPerBlock * dh) + boostEmissionIntegralPrev)
633+ $Tuple2([IntegerEntry(keyBoostingV2Integral(), boostEmissionIntegral), IntegerEntry(keyBoostingV2LastUpdateHeight(), height)], boostEmissionIntegral)
634+ }
635+
636+
519637 func internalClaimWxBoost (lpAssetIdStr,userAddressStr,readOnly) = {
520- let EMPTY = "EMPTY"
521- let userRecordOrEmpty = valueOrElse(getString(this, keyLockParamsRecord(userAddressStr)), EMPTY)
522- if ((userRecordOrEmpty == EMPTY))
638+ let userRecordOption = getString(this, keyLockParamsRecord(userAddressStr))
639+ if ((userRecordOption == unit))
523640 then $Tuple3(0, nil, "userRecord::is::empty")
524641 else {
525- let userRecordArray = split(userRecordOrEmpty, SEP)
642+ let userRecordArray = split(value(userRecordOption), SEP)
526643 let userNumStr = userRecordArray[IdxLockUserNum]
527- let gwxRewardEmissionStartHeight = valueOrElse(getInteger(gwxRewardContract, keyGwxRewardEmissionStartHeight()), 0)
528644 let EMPTYSTR = "empty"
529- let $t02106521633 = if ((lpAssetIdStr != EMPTYSTR))
645+ let poolWeight = if ((lpAssetIdStr != EMPTYSTR))
530646 then {
531647 let poolAddressStr = valueOrErrorMessage(getString(factoryContract, keyFactoryLp2AssetsMapping(lpAssetIdStr)), ("unsupported lp asset " + lpAssetIdStr))
532- let pw1 = getIntegerValue(factoryContract, keyFactoryPoolWeight(poolAddressStr))
533- let pw0 = valueOrElse(getInteger(factoryContract, keyFactoryPoolWeightHistory(poolAddressStr, 0)), pw1)
534- $Tuple2(pw0, pw1)
648+ getIntegerValue(factoryContract, keyFactoryPoolWeight(poolAddressStr))
535649 }
536650 else if (readOnly)
537- then $Tuple2(0, 0)
651+ then 0
538652 else throw(("not readonly mode: unsupported lp asset " + lpAssetIdStr))
539- let poolWeight0 = $t02106521633._1
540- let poolWeight1 = $t02106521633._2
541- let wxEmissionPerBlock = iof(emissionContract, keyEmissionRatePerBlockCurrent())
542- let emissionStart = iof(emissionContract, keyEmissionStartBlock())
543- let emissionEnd = iof(emissionContract, keyEmissionEndBlock())
544- let h = if ((height > emissionEnd))
545- then emissionEnd
546- else height
547- let dh = max([(h - emissionStart), 0])
548653 let userLpBoostEmissionLastIntegralKEY = keyUserLpBoostEmissionLastINTEGRAL(userNumStr, lpAssetIdStr)
549654 let userBoostEmissionLastIntegralKEY = keyUserBoostEmissionLastINTEGRAL(userNumStr)
550655 let userBoostEmissionLastIntegral = valueOrElse(getInteger(this, userLpBoostEmissionLastIntegralKEY), ioz(this, userBoostEmissionLastIntegralKEY))
551- let boostEmissionIntegral = (((wxEmissionPerBlock * dh) * 2) / 3)
656+ let boostEmissionIntegral = refreshBoostEmissionIntegral()._2
552657 let userBoostEmissionIntegral = (boostEmissionIntegral - userBoostEmissionLastIntegral)
553- let udh = fraction(userBoostEmissionIntegral, 3, (2 * wxEmissionPerBlock))
554- let uLastH = (h - udh)
555- let udh0 = max([(gwxRewardEmissionStartHeight - uLastH), 0])
556- let udh1 = ((h - uLastH) - udh0)
557- if (if (if ((0 > uLastH))
558- then true
559- else (0 > udh1))
560- then true
561- else (abs(((udh0 + udh1) - udh)) >= 1))
562- then throw(((((((((((("invalid udh calc: udh=" + toString(udh)) + " uLastH=") + toString(uLastH)) + " udh0=") + toString(udh0)) + " udh1=") + toString(udh1)) + " lpAssetId=") + lpAssetIdStr) + " userAddress=") + userAddressStr))
563- else if ((0 > userBoostEmissionIntegral))
564- then throw("wrong calculations")
565- else {
566- let userMaxBoostIntegralKEY = keyUserMaxBoostINTEGRAL(userNumStr)
567- let totalMaxBoostIntegralKEY = keyTotalMaxBoostINTEGRAL()
568- let userMaxBoostInt = ioz(this, userMaxBoostIntegralKEY)
569- let totalMaxBoostInt = ioz(this, totalMaxBoostIntegralKEY)
570- let totalCachedGwxCorrected = getTotalCachedGwx(true)
571- let userCurrGwx = calcCurrentGwxAmount(userAddressStr)
572- let userBoostAvalaibleToClaimTotalKEY = keyUserBoostAvalaibleToClaimTotal(userNumStr)
573- let userBoostAvaliableToClaimTotal = ioz(this, userBoostAvalaibleToClaimTotalKEY)
574- let userBoostEmissionIntegral0 = if ((udh == 0))
575- then 0
576- else fraction(userBoostEmissionIntegral, udh0, udh)
577- let userBoostEmissionIntegral1 = if ((udh == 0))
578- then 0
579- else fraction(userBoostEmissionIntegral, udh1, udh)
580- let poolUserBoostEmissionIntegral0 = fraction(userBoostEmissionIntegral0, poolWeight0, POOLWEIGHTMULT)
581- let poolUserBoostEmissionIntegral1 = fraction(userBoostEmissionIntegral1, poolWeight1, POOLWEIGHTMULT)
582- let userBoostAvaliableToClaimTotalNew0 = if ((totalCachedGwxCorrected == 0))
583- then 0
584- else fraction(poolUserBoostEmissionIntegral0, userCurrGwx, totalCachedGwxCorrected)
585- let userBoostAvaliableToClaimTotalNew1 = if ((totalCachedGwxCorrected == 0))
586- then 0
587- else fraction(poolUserBoostEmissionIntegral1, userCurrGwx, totalCachedGwxCorrected)
588- let userBoostAvaliableToClaimTotalNew = (userBoostAvaliableToClaimTotalNew0 + userBoostAvaliableToClaimTotalNew1)
589- let userBoostClaimedKEY = keyUserBoostClaimed(userNumStr)
590- let userBoostClaimed = ioz(this, userBoostClaimedKEY)
591- let userBoostAvailable = (userBoostAvaliableToClaimTotalNew - userBoostClaimed)
592- let dataState = [IntegerEntry(userLpBoostEmissionLastIntegralKEY, boostEmissionIntegral)]
593- let debug = makeString([toString(userBoostEmissionLastIntegral), toString(userBoostEmissionIntegral), toString(userBoostClaimed), toString(userBoostAvailable), toString(poolWeight0), toString(poolWeight1), toString(h), toString(udh), toString(uLastH), toString(udh0), toString(udh1), toString(userCurrGwx), toString(totalCachedGwxCorrected)], ":")
594- $Tuple3(userBoostAvaliableToClaimTotalNew, dataState, debug)
595- }
658+ if ((0 > userBoostEmissionIntegral))
659+ then throw("wrong calculations")
660+ else {
661+ let $t02721227351 = getStakedVotesIntegralsDiff(lpAssetIdStr, userAddressStr)
662+ let stakedVotesIntegralsActions = $t02721227351._1
663+ let userVoteIntegralDiff = $t02721227351._2
664+ let totalVotesIntegralDiff = $t02721227351._3
665+ let poolUserBoostEmissionIntegral = fraction(userBoostEmissionIntegral, poolWeight, POOLWEIGHTMULT)
666+ let userBoostAvaliableToClaimTotalNew = if ((totalVotesIntegralDiff == 0))
667+ then 0
668+ else fraction(poolUserBoostEmissionIntegral, userVoteIntegralDiff, totalVotesIntegralDiff)
669+ let dataState = ([IntegerEntry(userLpBoostEmissionLastIntegralKEY, boostEmissionIntegral)] ++ stakedVotesIntegralsActions)
670+ let debug = makeString([toString(userBoostEmissionLastIntegral), toString(userBoostEmissionIntegral), toString(poolWeight), toString(userVoteIntegralDiff), toString(totalVotesIntegralDiff)], ":")
671+ $Tuple3(userBoostAvaliableToClaimTotalNew, dataState, debug)
672+ }
596673 }
597674 }
598675
644721 let k = ai(gWxParamsResultList[0])
645722 let b = ai(gWxParamsResultList[1])
646723 let period = toString(ai(gWxParamsResultList[2]))
647- let wxEmissionPerBlock = iof(emissionContract, keyEmissionRatePerBlockCurrent())
648- let emissionStart = iof(emissionContract, keyEmissionStartBlock())
649- let emissionEnd = iof(emissionContract, keyEmissionEndBlock())
650- let h = if ((height > emissionEnd))
651- then emissionEnd
652- else height
653- let dh = max([(h - emissionStart), 0])
724+ let totalCachedGwxRaw = getTotalCachedGwx(false)
654725 let userBoostEmissionLastIntegralKEY = keyUserBoostEmissionLastINTEGRAL(userNumStr)
655- let boostEmissionIntegral = (((wxEmissionPerBlock * dh) * 2) / 3)
656- let userMaxBoostIntegralKEY = keyUserMaxBoostINTEGRAL(userNumStr)
657- let totalMaxBoostIntegralKEY = keyTotalMaxBoostINTEGRAL()
658- let userMaxBoostInt = ((gWxAmountStart * duration) / 2)
659- let totalMaxBoostInt = ioz(this, totalMaxBoostIntegralKEY)
660- let totalCachedGwxRaw = getTotalCachedGwx(false)
726+ let boostEmissionIntegral = refreshBoostEmissionIntegral()._2
661727 let arr = if (userIsExisting)
662728 then nil
663729 else [IntegerEntry(nextUserNumKEY, (userNum + 1)), StringEntry(keyUser2NumMapping(userAddressStr), userNumStr), StringEntry(keyNum2UserMapping(userNumStr), userAddressStr)]
682748
683749 @Callable(i)
684750 func lockRef (duration,referrerAddress,signature) = {
685- let $t03009830163 = lockActions(i, duration)
686- let lockActionsResult = $t03009830163._1
687- let gWxAmountStart = $t03009830163._2
751+ let $t03194132006 = lockActions(i, duration)
752+ let lockActionsResult = $t03194132006._1
753+ let gWxAmountStart = $t03194132006._2
688754 let referralAddress = toString(i.caller)
689755 let refInv = if (if ((referrerAddress == ""))
690756 then true
705771
706772 @Callable(i)
707773 func lock (duration) = {
708- let $t03062130686 = lockActions(i, duration)
709- let lockActionsResult = $t03062130686._1
710- let gWxAmountStart = $t03062130686._2
774+ let $t03246432529 = lockActions(i, duration)
775+ let lockActionsResult = $t03246432529._1
776+ let gWxAmountStart = $t03246432529._2
711777 let updateRefActivity = invoke(mathContract, "updateReferralActivity", [toString(i.caller), gWxAmountStart], nil)
712778 if ((updateRefActivity == updateRefActivity))
713779 then $Tuple2(lockActionsResult, unit)
751817 let k = ai(gWxParamsResultList[0])
752818 let b = ai(gWxParamsResultList[1])
753819 let period = toString(ai(gWxParamsResultList[2]))
754- let wxEmissionPerBlock = iof(emissionContract, keyEmissionRatePerBlockCurrent())
755- let emissionStart = iof(emissionContract, keyEmissionStartBlock())
756- let emissionEnd = iof(emissionContract, keyEmissionEndBlock())
757- let h = if ((height > emissionEnd))
758- then emissionEnd
759- else height
760- let dh = max([(h - emissionStart), 0])
761- let userBoostEmissionLastIntegralKEY = keyUserBoostEmissionLastINTEGRAL(userNumStr)
762- let userBoostEmissionLastIntegral = ioz(this, userBoostEmissionLastIntegralKEY)
763- let boostEmissionIntegral = (((wxEmissionPerBlock * dh) * 2) / 3)
764- let userBoostEmissionIntegral = (boostEmissionIntegral - userBoostEmissionLastIntegral)
765- if ((0 > userBoostEmissionIntegral))
766- then throw("wrong calculations")
820+ let currUserGwx = calcCurrentGwxAmount(userAddressStr)
821+ let gwxDiff = (gWxAmountStart - currUserGwx)
822+ if ((0 > gwxDiff))
823+ then throw(("gwxDiff is less then 0: " + toString(gwxDiff)))
767824 else {
768- let userMaxBoostIntegralKEY = keyUserMaxBoostINTEGRAL(userNumStr)
769- let totalMaxBoostIntegralKEY = keyTotalMaxBoostINTEGRAL()
770- let userMaxBoostInt = ioz(this, userMaxBoostIntegralKEY)
771- let totalMaxBoostInt = ioz(this, totalMaxBoostIntegralKEY)
772- let currUserGwx = calcCurrentGwxAmount(userAddressStr)
773- let gwxDiff = (gWxAmountStart - currUserGwx)
774- if ((0 > gwxDiff))
775- then throw(("gwxDiff is less then 0: " + toString(gwxDiff)))
776- else {
777- let totalCachedGwxRaw = getTotalCachedGwx(false)
778- let totalCachedGwxCorrected = getTotalCachedGwx(true)
779- let userBoostAvalaibleToClaimTotalKEY = keyUserBoostAvalaibleToClaimTotal(userNumStr)
780- let userBoostAvaliableToClaimTotal = ioz(this, userBoostAvalaibleToClaimTotalKEY)
781- let userBoostAvaliableToClaimTotalNew = fraction(userBoostEmissionIntegral, currUserGwx, totalCachedGwxCorrected)
782- let userMaxBoostIntNew = ((gWxAmountStart * lockDurationNew) / 2)
783- let remainingUserMaxBoostInt = ((currUserGwx * remainingDuration) / 2)
784- let userMaxBoostIntDiff = (userMaxBoostIntNew - remainingUserMaxBoostInt)
785- (((LockParamsEntry(userAddressStr, userNumStr, userAmountNew, lockStartNew, lockDurationNew, k, b, period) ++ StatsEntry(pmtAmount, deltaDuration, 0, 0)) :+ HistoryEntry("lock", userAddressStr, pmtAmount, lockStart, lockDurationNew, k, b, i)) ++ [IntegerEntry(keyTotalCachedGwx(), (totalCachedGwxRaw + gwxDiff))])
786- }
825+ let totalCachedGwxRaw = getTotalCachedGwx(false)
826+ let totalCachedGwxCorrected = getTotalCachedGwx(true)
827+ (((LockParamsEntry(userAddressStr, userNumStr, userAmountNew, lockStartNew, lockDurationNew, k, b, period) ++ StatsEntry(pmtAmount, deltaDuration, 0, 0)) :+ HistoryEntry("lock", userAddressStr, pmtAmount, lockStart, lockDurationNew, k, b, i)) ++ [IntegerEntry(keyTotalCachedGwx(), (totalCachedGwxRaw + gwxDiff))])
787828 }
788829 }
789830 else throw("Strict value is not equal to itself.")
796837 func claimWxBoost (lpAssetIdStr,userAddressStr) = if ((stakingContract != i.caller))
797838 then throw("permissions denied")
798839 else {
799- let $t03566735769 = internalClaimWxBoost(lpAssetIdStr, userAddressStr, false)
800- let userBoostAvailable = $t03566735769._1
801- let dataState = $t03566735769._2
802- let debug = $t03566735769._3
840+ let $t03561635718 = internalClaimWxBoost(lpAssetIdStr, userAddressStr, false)
841+ let userBoostAvailable = $t03561635718._1
842+ let dataState = $t03561635718._2
843+ let debug = $t03561635718._3
803844 $Tuple2(dataState, [userBoostAvailable])
804845 }
805846
807848
808849 @Callable(i)
809850 func claimWxBoostREADONLY (lpAssetIdStr,userAddressStr) = {
810- let $t03590136002 = internalClaimWxBoost(lpAssetIdStr, userAddressStr, true)
811- let userBoostAvailable = $t03590136002._1
812- let dataState = $t03590136002._2
813- let debug = $t03590136002._3
851+ let $t03585035951 = internalClaimWxBoost(lpAssetIdStr, userAddressStr, true)
852+ let userBoostAvailable = $t03585035951._1
853+ let dataState = $t03585035951._2
854+ let debug = $t03585035951._3
814855 $Tuple2(nil, [userBoostAvailable, debug])
815856 }
816857
880921
881922
882923 @Callable(i)
924+func onBoostEmissionUpdate () = {
925+ let checkCaller = if ((i.caller == emissionContract))
926+ then true
927+ else mustManager(i)
928+ if ((checkCaller == checkCaller))
929+ then refreshBoostEmissionIntegral()
930+ else throw("Strict value is not equal to itself.")
931+ }
932+
933+
934+
935+@Callable(i)
883936 func onStakedVoteUpdate (lpAssetIdStr,userAddressStr,edge) = {
884937 let checkCaller = if ((i.caller == stakingContract))
885938 then true
896949
897950 @Callable(i)
898951 func getVotingResultStakedREADONLY (lpAssetIdStr) = $Tuple2(nil, getVotingResultStaked(lpAssetIdStr))
952+
953+
954+
955+@Callable(i)
956+func getUserVoteFinalizedREADONLY (lpAssetIdStr,userAddressStr) = $Tuple2(nil, getUserVoteFinalized(lpAssetIdStr, userAddressStr))
899957
900958
901959
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let SEP = "__"
55
66 let SCALE8 = 8
77
88 let MULT8 = 100000000
99
1010 let POOLWEIGHTMULT = MULT8
1111
1212 func wrapErr (msg) = makeString(["boosting.ride:", msg], " ")
1313
1414
1515 func throwErr (msg) = throw(wrapErr(msg))
1616
1717
1818 func strf (address,key) = valueOrErrorMessage(getString(address, key), (("mandatory this." + key) + " is not defined"))
1919
2020
2121 func ioz (address,key) = valueOrElse(getInteger(address, key), 0)
2222
2323
2424 func iod (address,key,defaultVal) = valueOrElse(getInteger(address, key), defaultVal)
2525
2626
2727 func iof (address,key) = valueOrErrorMessage(getInteger(address, key), (("mandatory this." + key) + " is not defined"))
2828
2929
3030 func abs (val) = if ((0 > val))
3131 then -(val)
3232 else val
3333
3434
3535 func aal (val) = match val {
3636 case valAnyLyst: List[Any] =>
3737 valAnyLyst
3838 case _ =>
3939 throw("fail to cast into List[Any]")
4040 }
4141
4242
4343 func ai (val) = match val {
4444 case valInt: Int =>
4545 valInt
4646 case _ =>
4747 throw("fail to cast into Int")
4848 }
4949
5050
5151 func keyReferralsContractAddress () = makeString(["%s%s", "config", "referralsContractAddress"], SEP)
5252
5353
5454 let referralsContractAddressOrFail = addressFromStringValue(strf(this, keyReferralsContractAddress()))
5555
5656 let keyReferralProgramName = makeString(["%s%s", "referral", "programName"], SEP)
5757
5858 let referralProgramNameDefault = "wxlock"
5959
6060 let referralProgramName = valueOrElse(getString(this, keyReferralProgramName), referralProgramNameDefault)
6161
6262 func keyFactoryAddress () = "%s%s__config__factoryAddress"
6363
6464
6565 let IdxFactoryCfgStakingDapp = 1
6666
6767 let IdxFactoryCfgBoostingDapp = 2
6868
6969 let IdxFactoryCfgIdoDapp = 3
7070
7171 let IdxFactoryCfgTeamDapp = 4
7272
7373 let IdxFactoryCfgEmissionDapp = 5
7474
7575 let IdxFactoryCfgRestDapp = 6
7676
7777 let IdxFactoryCfgSlippageDapp = 7
7878
7979 let IdxFactoryCfgDaoDapp = 8
8080
8181 let IdxFactoryCfgMarketingDapp = 9
8282
8383 let IdxFactoryCfgGwxRewardDapp = 10
8484
8585 let IdxFactoryCfgBirdsDapp = 11
8686
8787 func keyFactoryCfg () = "%s__factoryConfig"
8888
8989
9090 func keyFactoryLp2AssetsMapping (lpAssetStr) = makeString(["%s%s%s", lpAssetStr, "mappings__lpAsset2PoolContract"], SEP)
9191
9292
9393 func keyFactoryLpList () = "%s__lpTokensList"
9494
9595
9696 func keyFactoryLpAssetToPoolContractAddress (lpAssetStr) = makeString(["%s%s%s", lpAssetStr, "mappings__lpAsset2PoolContract"], SEP)
9797
9898
9999 func keyFactoryPoolWeight (contractAddress) = makeString(["%s%s", "poolWeight", contractAddress], SEP)
100100
101101
102102 func keyFactoryPoolWeightHistory (poolAddress,num) = ((("%s%s__poolWeight__" + poolAddress) + "__") + toString(num))
103103
104104
105105 func readFactoryAddressOrFail () = addressFromStringValue(strf(this, keyFactoryAddress()))
106106
107107
108108 func readLpList () = split(valueOrElse(getString(readFactoryAddressOrFail(), keyFactoryLpList()), ""), SEP)
109109
110110
111111 func readFactoryCfgOrFail (factory) = split(strf(factory, keyFactoryCfg()), SEP)
112112
113113
114114 func getBoostingAddressOrFail (factoryCfg) = addressFromStringValue(factoryCfg[IdxFactoryCfgBoostingDapp])
115115
116116
117117 func getEmissionAddressOrFail (factoryCfg) = addressFromStringValue(factoryCfg[IdxFactoryCfgEmissionDapp])
118118
119119
120120 func getStakingAddressOrFail (factoryCfg) = addressFromStringValue(factoryCfg[IdxFactoryCfgStakingDapp])
121121
122122
123123 func getGwxRewardAddressOrFail (factoryCfg) = addressFromStringValue(factoryCfg[IdxFactoryCfgGwxRewardDapp])
124124
125125
126126 func keyManagerPublicKey () = "%s__managerPublicKey"
127127
128128
129129 func keyPendingManagerPublicKey () = "%s__pendingManagerPublicKey"
130130
131131
132132 func keyEmissionRatePerBlockCurrent () = "%s%s__ratePerBlock__current"
133133
134134
135135 func keyEmissionRatePerBlockMaxCurrent () = "%s%s__ratePerBlockMax__current"
136136
137137
138138 func keyEmissionStartBlock () = "%s%s__emission__startBlock"
139+
140+
141+func keyBoostingV2LastUpdateHeight () = "%s%s__boostingV2__startBlock"
142+
143+
144+func keyBoostingV2Integral () = "%s%s__boostingV2__integral"
139145
140146
141147 func keyEmissionDurationInBlocks () = "%s%s__emission__duration"
142148
143149
144150 func keyEmissionEndBlock () = "%s%s__emission__endBlock"
145151
146152
147153 func keyNextPeriod () = "%s__nextPeriod"
148154
149155
150156 func keyGwxRewardEmissionStartHeight () = "%s%s__gwxRewardEmissionPart__startHeight"
151157
152158
153159 let IdxCfgAssetId = 1
154160
155161 let IdxCfgMinLockAmount = 2
156162
157163 let IdxCfgMinLockDuration = 3
158164
159165 let IdxCfgMaxLockDuration = 4
160166
161167 let IdxCfgMathContract = 5
162168
163169 func keyConfig () = "%s__config"
164170
165171
166172 func readConfigArrayOrFail () = split(strf(this, keyConfig()), SEP)
167173
168174
169175 let mathContract = addressFromStringValue(readConfigArrayOrFail()[IdxCfgMathContract])
170176
171177 func formatConfigS (assetId,minLockAmount,minLockDuration,maxLockDuration,mathContract) = makeString(["%s%d%d%d", assetId, minLockAmount, minLockDuration, maxLockDuration, mathContract], SEP)
172178
173179
174180 func formatConfig (assetId,minLockAmount,minLockDuration,maxLockDuration,mathContract) = formatConfigS(assetId, toString(minLockAmount), toString(minLockDuration), toString(maxLockDuration), mathContract)
175181
176182
177183 func managerPublicKeyOrUnit () = match getString(keyManagerPublicKey()) {
178184 case s: String =>
179185 fromBase58String(s)
180186 case _: Unit =>
181187 unit
182188 case _ =>
183189 throw("Match error")
184190 }
185191
186192
187193 func pendingManagerPublicKeyOrUnit () = match getString(keyPendingManagerPublicKey()) {
188194 case s: String =>
189195 fromBase58String(s)
190196 case _: Unit =>
191197 unit
192198 case _ =>
193199 throw("Match error")
194200 }
195201
196202
197203 func mustManager (i) = {
198204 let pd = throw("Permission denied")
199205 match managerPublicKeyOrUnit() {
200206 case pk: ByteVector =>
201207 if ((i.callerPublicKey == pk))
202208 then true
203209 else pd
204210 case _: Unit =>
205211 if ((i.caller == this))
206212 then true
207213 else pd
208214 case _ =>
209215 throw("Match error")
210216 }
211217 }
212218
213219
214220 let IdxLockUserNum = 1
215221
216222 let IdxLockAmount = 2
217223
218224 let IdxLockStart = 3
219225
220226 let IdxLockDuration = 4
221227
222228 let IdxLockParamK = 5
223229
224230 let IdxLockParamB = 6
225231
226232 func keyLockParamsRecord (userAddress) = makeString(["%s%s__lock", userAddress], SEP)
227233
228234
229235 func readLockParamsRecordOrFail (userAddress) = split(strf(this, keyLockParamsRecord(userAddress)), SEP)
230236
231237
232238 func formatLockParamsRecordS (userNum,amount,start,duration,paramK,paramB,lastUpdTimestamp,gwxAmount) = makeString(["%d%d%d%d%d%d%d%d", userNum, amount, start, duration, paramK, paramB, lastUpdTimestamp, gwxAmount], SEP)
233239
234240
235241 func formatLockParamsRecord (userNum,amount,start,duration,paramK,paramB,gwxAmount) = formatLockParamsRecordS(userNum, toString(amount), toString(start), toString(duration), toString(paramK), toString(paramB), toString(lastBlock.timestamp), toString(gwxAmount))
236242
237243
238244 func keyNextUserNum () = "%s__nextUserNum"
239245
240246
241247 func keyUser2NumMapping (userAddress) = makeString(["%s%s%s__mapping__user2num", userAddress], SEP)
242248
243249
244250 func keyNum2UserMapping (num) = makeString(["%s%s%s__mapping__num2user", num], SEP)
245251
246252
247253 func keyLockParamUserAmount (userNum) = makeString(["%s%d%s__paramByUserNum", userNum, "amount"], SEP)
248254
249255
250256 func keyLockParamStartBlock (userNum) = makeString(["%s%d%s__paramByUserNum", userNum, "start"], SEP)
251257
252258
253259 func keyLockParamDuration (userNum) = makeString(["%s%d%s__paramByUserNum", userNum, "duration"], SEP)
254260
255261
256262 func keyLockParamK (userNum) = makeString(["%s%d%s__paramByUserNum", userNum, "k"], SEP)
257263
258264
259265 func keyLockParamB (userNum) = makeString(["%s%d%s__paramByUserNum", userNum, "b"], SEP)
260266
261267
262268 func keyLockParamByPeriodK (userNum,period) = makeString(["%s%d%s%d__paramByPeriod", userNum, "k", period], SEP)
263269
264270
265271 func keyLockParamByPeriodB (userNum,period) = makeString(["%s%d%s%d__paramByPeriod", userNum, "b", period], SEP)
266272
267273
268274 func keyLockParamTotalAmount () = "%s%s__stats__activeTotalLocked"
269275
270276
271277 func keyStatsLocksDurationSumInBlocks () = "%s%s__stats__locksDurationSumInBlocks"
272278
273279
274280 func keyStatsLocksCount () = "%s%s__stats__locksCount"
275281
276282
277283 func keyStatsUsersCount () = "%s%s__stats__activeUsersCount"
278284
279285
280-func keyUserBoostEmissionLastINTEGRAL (userNum) = makeString(["%s%d__userBoostEmissionLastInt", userNum], SEP)
286+func keyUserBoostEmissionLastINTEGRAL (userNum) = makeString(["%s%d__userBoostEmissionLastIntV2", userNum], SEP)
281287
282288
283-func keyUserLpBoostEmissionLastINTEGRAL (userNum,lpAssetId) = makeString(["%s%d__userBoostEmissionLastInt", userNum, lpAssetId], SEP)
289+func keyUserLpBoostEmissionLastINTEGRAL (userNum,lpAssetId) = makeString(["%s%d__userBoostEmissionLastIntV2", userNum, lpAssetId], SEP)
284290
285291
286292 func keyUserMaxBoostINTEGRAL (userNum) = makeString(["%s%d__maxBoostInt", userNum], SEP)
287293
288294
289295 func keyTotalMaxBoostINTEGRAL () = "%s%s__maxBoostInt__total"
290296
291297
292298 func keyUserBoostAvalaibleToClaimTotal (userNum) = makeString(["%s%d__userBoostAvaliableToClaimTotal", userNum], SEP)
293299
294300
295301 func keyUserBoostClaimed (userNum) = makeString(["%s%d__userBoostClaimed", userNum], SEP)
296302
297303
298304 func keyTotalCachedGwx () = "%s%s__gwxCached__total"
299305
300306
301307 func keyTotalCachedGwxCorrective () = "%s__gwxCachedTotalCorrective"
302308
303309
304310 let factoryContract = readFactoryAddressOrFail()
305311
306312 let factoryCfg = readFactoryCfgOrFail(factoryContract)
307313
308314 let emissionContract = getEmissionAddressOrFail(factoryCfg)
309315
310316 let stakingContract = getStakingAddressOrFail(factoryCfg)
311317
312318 let gwxRewardContract = getGwxRewardAddressOrFail(factoryCfg)
313319
314320 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"))
315321
316322 let keyVotingEmissionContract = makeString(["%s", "votingEmissionContract"], SEP)
317323
318324 let votingEmissionContract = addressFromStringValue(getStringValue(factoryContract, keyVotingEmissionContract))
325+
326+let boostCoeff = {
327+ let @ = invoke(emissionContract, "getBoostCoeffREADONLY", nil, nil)
328+ if ($isInstanceOf(@, "Int"))
329+ then @
330+ else throw(($getType(@) + " couldn't be cast to Int"))
331+ }
319332
320333 func getTotalCachedGwx (correct) = {
321334 let keyCurrentEpochUi = makeString(["%s", "currentEpochUi"], SEP)
322335 let currentEpochUi = getIntegerValue(votingEmissionContract, keyCurrentEpochUi)
323336 let keyTargetEpoch = makeString(["%s%s", "totalCachedGwxCorrection__activationEpoch"], SEP)
324337 let targetEpochOption = getInteger(this, keyTargetEpoch)
325338 let totalCachedGwxRaw = valueOrElse(getInteger(this, keyTotalCachedGwx()), 0)
326339 let isCorrectionActivated = if (isDefined(targetEpochOption))
327340 then (currentEpochUi >= value(targetEpochOption))
328341 else false
329342 let corrective = if (if (isCorrectionActivated)
330343 then correct
331344 else false)
332345 then valueOrElse(getInteger(this, keyTotalCachedGwxCorrective()), 0)
333346 else 0
334347 max([0, (totalCachedGwxRaw + corrective)])
335348 }
336349
337350
338351 func HistoryEntry (type,user,amount,lockStart,duration,k,b,i) = {
339352 let historyKEY = makeString(["%s%s%s%s__history", type, user, toBase58String(i.transactionId)], SEP)
340353 let historyDATA = makeString(["%d%d%d%d%d%d%d", toString(lastBlock.height), toString(lastBlock.timestamp), toString(amount), toString(lockStart), toString(duration), toString(k), toString(b)], SEP)
341354 StringEntry(historyKEY, historyDATA)
342355 }
343356
344357
345358 func StatsEntry (totalLockedInc,durationInc,lockCountInc,usersCountInc) = {
346359 let locksDurationSumInBlocksKEY = keyStatsLocksDurationSumInBlocks()
347360 let locksCountKEY = keyStatsLocksCount()
348361 let usersCountKEY = keyStatsUsersCount()
349362 let totalAmountKEY = keyLockParamTotalAmount()
350363 let locksDurationSumInBlocks = ioz(this, locksDurationSumInBlocksKEY)
351364 let locksCount = ioz(this, locksCountKEY)
352365 let usersCount = ioz(this, usersCountKEY)
353366 let totalAmount = ioz(this, totalAmountKEY)
354367 [IntegerEntry(locksDurationSumInBlocksKEY, (locksDurationSumInBlocks + durationInc)), IntegerEntry(locksCountKEY, (locksCount + lockCountInc)), IntegerEntry(usersCountKEY, (usersCount + usersCountInc)), IntegerEntry(totalAmountKEY, (totalAmount + totalLockedInc))]
355368 }
356369
357370
358371 func calcGwxAmount (kRaw,bRaw,h) = {
359372 let SCALE = 1000
360373 (((kRaw * h) + bRaw) / SCALE)
361374 }
362375
363376
364377 func LockParamsEntry (userAddress,userNum,amount,start,duration,k,b,period) = {
365378 let userAmountKEY = keyLockParamUserAmount(userNum)
366379 let startBlockKEY = keyLockParamStartBlock(userNum)
367380 let durationKEY = keyLockParamDuration(userNum)
368381 let kKEY = keyLockParamK(userNum)
369382 let bKEY = keyLockParamB(userNum)
370383 let kByPeriodKEY = keyLockParamByPeriodK(userNum, period)
371384 let bByPeriodKEY = keyLockParamByPeriodB(userNum, period)
372385 let gwxAmount = calcGwxAmount(k, b, height)
373386 [IntegerEntry(userAmountKEY, amount), IntegerEntry(startBlockKEY, start), IntegerEntry(durationKEY, duration), IntegerEntry(kKEY, k), IntegerEntry(bKEY, b), IntegerEntry(kByPeriodKEY, k), IntegerEntry(bByPeriodKEY, b), StringEntry(keyLockParamsRecord(userAddress), formatLockParamsRecord(userNum, amount, start, duration, k, b, gwxAmount))]
374387 }
375388
376389
377390 func extractOptionalPaymentAmountOrFail (i,expectedAssetId) = if ((size(i.payments) > 1))
378391 then throw("only one payment is allowed")
379392 else if ((size(i.payments) == 0))
380393 then 0
381394 else {
382395 let pmt = i.payments[0]
383396 if ((value(pmt.assetId) != expectedAssetId))
384397 then throw("invalid asset id in payment")
385398 else pmt.amount
386399 }
387400
388401
389402 func calcUserGwxAmountAtHeight (userAddress,targetHeight) = {
390403 let EMPTY = "empty"
391404 let user2NumMappingKEY = keyUser2NumMapping(userAddress)
392405 let userNum = valueOrElse(getString(user2NumMappingKEY), EMPTY)
393406 let k = valueOrElse(getInteger(keyLockParamK(userNum)), 0)
394407 let b = valueOrElse(getInteger(keyLockParamB(userNum)), 0)
395408 let gwxAmountCalc = calcGwxAmount(k, b, targetHeight)
396409 let gwxAmount = if ((0 > gwxAmountCalc))
397410 then 0
398411 else gwxAmountCalc
399412 gwxAmount
400413 }
401414
402415
403416 func calcCurrentGwxAmount (userAddress) = calcUserGwxAmountAtHeight(userAddress, height)
404417
405418
406419 func getVotingEmissionEpochInfo () = {
407420 let keyCurrentEpochUi = makeString(["%s", "currentEpochUi"], SEP)
408- let $t01492815216 = {
421+ let $t01515015438 = {
409422 let currentEpochUi = value(getInteger(votingEmissionContract, keyCurrentEpochUi))
410423 let lastFinalizedEpoch = (currentEpochUi - 1)
411424 if ((0 > lastFinalizedEpoch))
412425 then throwErr("invalid epoch")
413426 else $Tuple2(currentEpochUi, lastFinalizedEpoch)
414427 }
415- let currentEpochUi = $t01492815216._1
416- let lastFinalizedEpoch = $t01492815216._2
428+ let currentEpochUi = $t01515015438._1
429+ let lastFinalizedEpoch = $t01515015438._2
417430 func keyStartHeightByEpoch (epoch) = makeString(["%s%d", "startHeight", toString(epoch)], SEP)
418431
419432 let currentEpochStartHeight = value(getInteger(votingEmissionContract, keyStartHeightByEpoch(currentEpochUi)))
420433 $Tuple2(lastFinalizedEpoch, currentEpochStartHeight)
434+ }
435+
436+
437+func getPoolAssetsByLpAssetId (lpAssetIdStr) = {
438+ let idxAmountAssetId = 4
439+ let idxPriceAssetId = 5
440+ let poolCfg = {
441+ let @ = invoke(factoryContract, "getPoolConfigByLpAssetId", [lpAssetIdStr], nil)
442+ if ($isInstanceOf(@, "List[Any]"))
443+ then @
444+ else throw(($getType(@) + " couldn't be cast to List[Any]"))
445+ }
446+ let amountAssetId = {
447+ let @ = poolCfg[idxAmountAssetId]
448+ if ($isInstanceOf(@, "String"))
449+ then @
450+ else throw(($getType(@) + " couldn't be cast to String"))
451+ }
452+ let priceAssetId = {
453+ let @ = poolCfg[idxPriceAssetId]
454+ if ($isInstanceOf(@, "String"))
455+ then @
456+ else throw(($getType(@) + " couldn't be cast to String"))
457+ }
458+ $Tuple2(amountAssetId, priceAssetId)
421459 }
422460
423461
424462 func keyVote (amountAssetId,priceAssetId,address,epoch) = makeString(["%s%s%s%s%d", "vote", amountAssetId, priceAssetId, toString(address), toString(epoch)], SEP)
425463
426464
427465 func keyVotingResultStaked (lpAssetIdStr,epoch) = makeString(["%s%s%d", "votingResultStaked", lpAssetIdStr, toString(epoch)], SEP)
428466
429467
430468 func keyVotingResultStakedIntegral (lpAssetIdStr,epoch) = makeString(["%s%s%d", "votingResultStakedIntegral", lpAssetIdStr, toString(epoch)], SEP)
431469
432470
433471 func keyVotingResultStakedLastUpdateHeight (lpAssetIdStr,epoch) = makeString(["%s%s%d", "votingResultStakedIntegralLastUpdateHeight", lpAssetIdStr, toString(epoch)], SEP)
434472
435473
474+func keyVotingResultStakedIntegralLast (lpAssetIdStr,address,epoch) = makeString(["%s%s%s%d", "votingResultStakedIntegralLast", lpAssetIdStr, toString(address), toString(epoch)], SEP)
475+
476+
436477 func keyVoteStakedIntegral (lpAssetIdStr,address,epoch) = makeString(["%s%s%s%d", "voteStakedIntegral", lpAssetIdStr, toString(address), toString(epoch)], SEP)
437478
438479
439480 func keyVoteStakedLastUpdateHeight (lpAssetIdStr,address,epoch) = makeString(["%s%s%s%d", "voteStakedIntegralLastUpdateHeight", lpAssetIdStr, toString(address), toString(epoch)], SEP)
440481
441482
483+func keyVoteStakedIntegralLast (lpAssetIdStr,address,epoch) = makeString(["%s%s%s%d", "voteStakedIntegralLast", lpAssetIdStr, toString(address), toString(epoch)], SEP)
484+
485+
486+func keyStakedByUser (userAddressStr,lpAssetIdStr) = makeString(["%s%s%s", "staked", userAddressStr, lpAssetIdStr], SEP)
487+
488+
489+func getUserVoteFinalized (lpAssetIdStr,userAddressStr) = {
490+ let userAddress = addressFromStringValue(userAddressStr)
491+ let $t01822818308 = getVotingEmissionEpochInfo()
492+ let lastFinalizedEpoch = $t01822818308._1
493+ let currentEpochStartHeight = $t01822818308._2
494+ let $t01831118386 = getPoolAssetsByLpAssetId(lpAssetIdStr)
495+ let amountAssetId = $t01831118386._1
496+ let priceAssetId = $t01831118386._2
497+ let userVoteKey = keyVote(amountAssetId, priceAssetId, userAddress, lastFinalizedEpoch)
498+ let userVote = valueOrElse(getInteger(votingEmissionContract, userVoteKey), 0)
499+ userVote
500+ }
501+
502+
503+func getUserVoteStaked (lpAssetIdStr,userAddressStr) = {
504+ let stakedByUser = valueOrElse(getInteger(stakingContract, keyStakedByUser(userAddressStr, lpAssetIdStr)), 0)
505+ let userVote = getUserVoteFinalized(lpAssetIdStr, userAddressStr)
506+ if ((stakedByUser == 0))
507+ then 0
508+ else userVote
509+ }
510+
511+
442512 func getVotingResultStaked (lpAssetIdStr) = {
443- let $t01690116981 = getVotingEmissionEpochInfo()
444- let lastFinalizedEpoch = $t01690116981._1
445- let currentEpochStartHeight = $t01690116981._2
513+ let $t01893019010 = getVotingEmissionEpochInfo()
514+ let lastFinalizedEpoch = $t01893019010._1
515+ let currentEpochStartHeight = $t01893019010._2
446516 let votingResultStakedStart = valueOrElse(getInteger(votingEmissionContract, keyVotingResultStaked(lpAssetIdStr, lastFinalizedEpoch)), 0)
447517 let votingResultStaked = valueOrElse(getInteger(this, keyVotingResultStaked(lpAssetIdStr, lastFinalizedEpoch)), votingResultStakedStart)
448518 votingResultStaked
449519 }
450520
451521
452522 func refreshVotingResultStakedIntegral (lpAssetIdStr,stakedVoteDelta) = {
453- let $t01750217582 = getVotingEmissionEpochInfo()
454- let lastFinalizedEpoch = $t01750217582._1
455- let currentEpochStartHeight = $t01750217582._2
523+ let $t01953119611 = getVotingEmissionEpochInfo()
524+ let lastFinalizedEpoch = $t01953119611._1
525+ let currentEpochStartHeight = $t01953119611._2
456526 let votingResultStaked = getVotingResultStaked(lpAssetIdStr)
457527 let votingResultStakedNew = (votingResultStaked + stakedVoteDelta)
458528 let votingResultStakedIntegralKey = keyVotingResultStakedIntegral(lpAssetIdStr, lastFinalizedEpoch)
459529 let votingResultStakedIntegralPrev = valueOrElse(getInteger(this, votingResultStakedIntegralKey), 0)
460530 let votingResultLastUpdateHeightKey = keyVotingResultStakedLastUpdateHeight(lpAssetIdStr, lastFinalizedEpoch)
461531 let votingResultStakedLastUpdateHeight = valueOrElse(getInteger(this, votingResultLastUpdateHeightKey), currentEpochStartHeight)
462532 let votingResultStakedIntegralDh = (height - votingResultStakedLastUpdateHeight)
463533 let votingResultStakedIntegral = ((votingResultStakedIntegralDh * votingResultStaked) + votingResultStakedIntegralPrev)
464534 $Tuple2([IntegerEntry(keyVotingResultStaked(lpAssetIdStr, lastFinalizedEpoch), votingResultStakedNew), IntegerEntry(votingResultLastUpdateHeightKey, height), IntegerEntry(votingResultStakedIntegralKey, votingResultStakedIntegral)], votingResultStakedIntegral)
465535 }
466536
467537
468538 func refreshVoteStakedIntegral (lpAssetIdStr,userAddressStr,edge) = {
469- let $t01878218862 = getVotingEmissionEpochInfo()
470- let lastFinalizedEpoch = $t01878218862._1
471- let currentEpochStartHeight = $t01878218862._2
539+ let $t02081120891 = getVotingEmissionEpochInfo()
540+ let lastFinalizedEpoch = $t02081120891._1
541+ let currentEpochStartHeight = $t02081120891._2
472542 let userAddress = addressFromStringValue(userAddressStr)
473543 let idxAmountAssetId = 4
474544 let idxPriceAssetId = 5
475545 let poolCfg = {
476546 let @ = invoke(factoryContract, "getPoolConfigByLpAssetId", [lpAssetIdStr], nil)
477547 if ($isInstanceOf(@, "List[Any]"))
478548 then @
479549 else throw(($getType(@) + " couldn't be cast to List[Any]"))
480550 }
481551 let amountAssetId = {
482552 let @ = poolCfg[idxAmountAssetId]
483553 if ($isInstanceOf(@, "String"))
484554 then @
485555 else throw(($getType(@) + " couldn't be cast to String"))
486556 }
487557 let priceAssetId = {
488558 let @ = poolCfg[idxPriceAssetId]
489559 if ($isInstanceOf(@, "String"))
490560 then @
491561 else throw(($getType(@) + " couldn't be cast to String"))
492562 }
493563 let userVote = valueOrElse(getInteger(votingEmissionContract, keyVote(amountAssetId, priceAssetId, userAddress, lastFinalizedEpoch)), 0)
494564 let actions = if ((userVote == 0))
495565 then nil
496566 else {
497567 let stakedVoteDelta = if (edge)
498568 then userVote
499569 else -(userVote)
500- let $t01946719586 = refreshVotingResultStakedIntegral(lpAssetIdStr, stakedVoteDelta)
501- let votingResultActions = $t01946719586._1
502- let votingResultStakedIntegral = $t01946719586._2
570+ let $t02149621615 = refreshVotingResultStakedIntegral(lpAssetIdStr, stakedVoteDelta)
571+ let votingResultActions = $t02149621615._1
572+ let votingResultStakedIntegral = $t02149621615._2
503573 let userVoteStaked = if (edge)
504574 then 0
505575 else userVote
506576 let userVoteStakedIntegralKey = keyVoteStakedIntegral(lpAssetIdStr, userAddress, lastFinalizedEpoch)
507577 let userVoteStakedIntegralPrev = valueOrElse(getInteger(this, userVoteStakedIntegralKey), 0)
508578 let userVoteStakedLastUpdateHeightKey = keyVoteStakedLastUpdateHeight(lpAssetIdStr, userAddress, lastFinalizedEpoch)
509579 let userVoteStakedLastUpdateHeight = valueOrElse(getInteger(this, userVoteStakedLastUpdateHeightKey), currentEpochStartHeight)
510580 let userVoteStakedIntegralDh = (height - userVoteStakedLastUpdateHeight)
511581 let userVoteStakedIntegral = ((userVoteStakedIntegralDh * userVoteStaked) + userVoteStakedIntegralPrev)
512582 let voteActions = [IntegerEntry(userVoteStakedLastUpdateHeightKey, height), IntegerEntry(userVoteStakedIntegralKey, userVoteStakedIntegral)]
513583 (votingResultActions ++ voteActions)
514584 }
515585 actions
516586 }
517587
518588
589+func getStakedVotesIntegralsDiff (lpAssetIdStr,userAddressStr) = {
590+ let $t02260722687 = getVotingEmissionEpochInfo()
591+ let lastFinalizedEpoch = $t02260722687._1
592+ let currentEpochStartHeight = $t02260722687._2
593+ let userAddress = addressFromStringValue(userAddressStr)
594+ let userVoteStaked = getUserVoteStaked(lpAssetIdStr, userAddressStr)
595+ let votingResultStaked = getVotingResultStaked(lpAssetIdStr)
596+ let userVoteStakedIntegralPrev = valueOrElse(getInteger(this, keyVoteStakedIntegral(lpAssetIdStr, userAddress, lastFinalizedEpoch)), 0)
597+ let votingResultStakedIntegralPrev = valueOrElse(getInteger(this, keyVotingResultStakedIntegral(lpAssetIdStr, lastFinalizedEpoch)), 0)
598+ let userVoteStakedLastUpdateHeight = valueOrElse(getInteger(this, keyVoteStakedLastUpdateHeight(lpAssetIdStr, userAddress, lastFinalizedEpoch)), currentEpochStartHeight)
599+ let votingResultStakedLastUpdateHeight = valueOrElse(getInteger(this, keyVotingResultStakedLastUpdateHeight(lpAssetIdStr, lastFinalizedEpoch)), currentEpochStartHeight)
600+ let userVoteStakedIntegralKey = keyVoteStakedIntegralLast(lpAssetIdStr, userAddress, lastFinalizedEpoch)
601+ let userVoteStakedIntegralLast = valueOrElse(getInteger(this, userVoteStakedIntegralKey), 0)
602+ let votingResultStakedIntegralKey = keyVotingResultStakedIntegralLast(lpAssetIdStr, userAddress, lastFinalizedEpoch)
603+ let votingResultStakedIntegralLast = valueOrElse(getInteger(this, votingResultStakedIntegralKey), 0)
604+ let userVoteStakedIntegralDh = (height - userVoteStakedLastUpdateHeight)
605+ let votingResultStakedIntegralDh = (height - votingResultStakedLastUpdateHeight)
606+ let userVoteStakedIntegral = ((userVoteStakedIntegralDh * userVoteStaked) + userVoteStakedIntegralPrev)
607+ let votingResultStakedIntegral = ((votingResultStakedIntegralDh * votingResultStaked) + votingResultStakedIntegralPrev)
608+ let userVoteStakedIntegralDiff = (userVoteStakedIntegral - userVoteStakedIntegralLast)
609+ let votingResultStakedIntegralDiff = (votingResultStakedIntegral - votingResultStakedIntegralLast)
610+ $Tuple3([IntegerEntry(userVoteStakedIntegralKey, userVoteStakedIntegral), IntegerEntry(votingResultStakedIntegralKey, votingResultStakedIntegral)], userVoteStakedIntegralDiff, votingResultStakedIntegralDiff)
611+ }
612+
613+
614+func refreshBoostEmissionIntegral () = {
615+ let wxEmissionPerBlock = iof(emissionContract, keyEmissionRatePerBlockCurrent())
616+ let boostingV2LastUpdateHeightOption = getInteger(emissionContract, keyBoostingV2LastUpdateHeight())
617+ let boostingV2IngergalOption = getInteger(this, keyBoostingV2Integral())
618+ let emissionEnd = iof(emissionContract, keyEmissionEndBlock())
619+ let h = if ((height > emissionEnd))
620+ then emissionEnd
621+ else height
622+ let dh = match boostingV2LastUpdateHeightOption {
623+ case lastUpdateHeight: Int =>
624+ max([(h - lastUpdateHeight), 0])
625+ case _: Unit =>
626+ 0
627+ case _ =>
628+ throw("Match error")
629+ }
630+ let boostEmissionPerBlock = ((wxEmissionPerBlock * (boostCoeff - 1)) / boostCoeff)
631+ let boostEmissionIntegralPrev = valueOrElse(boostingV2IngergalOption, 0)
632+ let boostEmissionIntegral = ((boostEmissionPerBlock * dh) + boostEmissionIntegralPrev)
633+ $Tuple2([IntegerEntry(keyBoostingV2Integral(), boostEmissionIntegral), IntegerEntry(keyBoostingV2LastUpdateHeight(), height)], boostEmissionIntegral)
634+ }
635+
636+
519637 func internalClaimWxBoost (lpAssetIdStr,userAddressStr,readOnly) = {
520- let EMPTY = "EMPTY"
521- let userRecordOrEmpty = valueOrElse(getString(this, keyLockParamsRecord(userAddressStr)), EMPTY)
522- if ((userRecordOrEmpty == EMPTY))
638+ let userRecordOption = getString(this, keyLockParamsRecord(userAddressStr))
639+ if ((userRecordOption == unit))
523640 then $Tuple3(0, nil, "userRecord::is::empty")
524641 else {
525- let userRecordArray = split(userRecordOrEmpty, SEP)
642+ let userRecordArray = split(value(userRecordOption), SEP)
526643 let userNumStr = userRecordArray[IdxLockUserNum]
527- let gwxRewardEmissionStartHeight = valueOrElse(getInteger(gwxRewardContract, keyGwxRewardEmissionStartHeight()), 0)
528644 let EMPTYSTR = "empty"
529- let $t02106521633 = if ((lpAssetIdStr != EMPTYSTR))
645+ let poolWeight = if ((lpAssetIdStr != EMPTYSTR))
530646 then {
531647 let poolAddressStr = valueOrErrorMessage(getString(factoryContract, keyFactoryLp2AssetsMapping(lpAssetIdStr)), ("unsupported lp asset " + lpAssetIdStr))
532- let pw1 = getIntegerValue(factoryContract, keyFactoryPoolWeight(poolAddressStr))
533- let pw0 = valueOrElse(getInteger(factoryContract, keyFactoryPoolWeightHistory(poolAddressStr, 0)), pw1)
534- $Tuple2(pw0, pw1)
648+ getIntegerValue(factoryContract, keyFactoryPoolWeight(poolAddressStr))
535649 }
536650 else if (readOnly)
537- then $Tuple2(0, 0)
651+ then 0
538652 else throw(("not readonly mode: unsupported lp asset " + lpAssetIdStr))
539- let poolWeight0 = $t02106521633._1
540- let poolWeight1 = $t02106521633._2
541- let wxEmissionPerBlock = iof(emissionContract, keyEmissionRatePerBlockCurrent())
542- let emissionStart = iof(emissionContract, keyEmissionStartBlock())
543- let emissionEnd = iof(emissionContract, keyEmissionEndBlock())
544- let h = if ((height > emissionEnd))
545- then emissionEnd
546- else height
547- let dh = max([(h - emissionStart), 0])
548653 let userLpBoostEmissionLastIntegralKEY = keyUserLpBoostEmissionLastINTEGRAL(userNumStr, lpAssetIdStr)
549654 let userBoostEmissionLastIntegralKEY = keyUserBoostEmissionLastINTEGRAL(userNumStr)
550655 let userBoostEmissionLastIntegral = valueOrElse(getInteger(this, userLpBoostEmissionLastIntegralKEY), ioz(this, userBoostEmissionLastIntegralKEY))
551- let boostEmissionIntegral = (((wxEmissionPerBlock * dh) * 2) / 3)
656+ let boostEmissionIntegral = refreshBoostEmissionIntegral()._2
552657 let userBoostEmissionIntegral = (boostEmissionIntegral - userBoostEmissionLastIntegral)
553- let udh = fraction(userBoostEmissionIntegral, 3, (2 * wxEmissionPerBlock))
554- let uLastH = (h - udh)
555- let udh0 = max([(gwxRewardEmissionStartHeight - uLastH), 0])
556- let udh1 = ((h - uLastH) - udh0)
557- if (if (if ((0 > uLastH))
558- then true
559- else (0 > udh1))
560- then true
561- else (abs(((udh0 + udh1) - udh)) >= 1))
562- then throw(((((((((((("invalid udh calc: udh=" + toString(udh)) + " uLastH=") + toString(uLastH)) + " udh0=") + toString(udh0)) + " udh1=") + toString(udh1)) + " lpAssetId=") + lpAssetIdStr) + " userAddress=") + userAddressStr))
563- else if ((0 > userBoostEmissionIntegral))
564- then throw("wrong calculations")
565- else {
566- let userMaxBoostIntegralKEY = keyUserMaxBoostINTEGRAL(userNumStr)
567- let totalMaxBoostIntegralKEY = keyTotalMaxBoostINTEGRAL()
568- let userMaxBoostInt = ioz(this, userMaxBoostIntegralKEY)
569- let totalMaxBoostInt = ioz(this, totalMaxBoostIntegralKEY)
570- let totalCachedGwxCorrected = getTotalCachedGwx(true)
571- let userCurrGwx = calcCurrentGwxAmount(userAddressStr)
572- let userBoostAvalaibleToClaimTotalKEY = keyUserBoostAvalaibleToClaimTotal(userNumStr)
573- let userBoostAvaliableToClaimTotal = ioz(this, userBoostAvalaibleToClaimTotalKEY)
574- let userBoostEmissionIntegral0 = if ((udh == 0))
575- then 0
576- else fraction(userBoostEmissionIntegral, udh0, udh)
577- let userBoostEmissionIntegral1 = if ((udh == 0))
578- then 0
579- else fraction(userBoostEmissionIntegral, udh1, udh)
580- let poolUserBoostEmissionIntegral0 = fraction(userBoostEmissionIntegral0, poolWeight0, POOLWEIGHTMULT)
581- let poolUserBoostEmissionIntegral1 = fraction(userBoostEmissionIntegral1, poolWeight1, POOLWEIGHTMULT)
582- let userBoostAvaliableToClaimTotalNew0 = if ((totalCachedGwxCorrected == 0))
583- then 0
584- else fraction(poolUserBoostEmissionIntegral0, userCurrGwx, totalCachedGwxCorrected)
585- let userBoostAvaliableToClaimTotalNew1 = if ((totalCachedGwxCorrected == 0))
586- then 0
587- else fraction(poolUserBoostEmissionIntegral1, userCurrGwx, totalCachedGwxCorrected)
588- let userBoostAvaliableToClaimTotalNew = (userBoostAvaliableToClaimTotalNew0 + userBoostAvaliableToClaimTotalNew1)
589- let userBoostClaimedKEY = keyUserBoostClaimed(userNumStr)
590- let userBoostClaimed = ioz(this, userBoostClaimedKEY)
591- let userBoostAvailable = (userBoostAvaliableToClaimTotalNew - userBoostClaimed)
592- let dataState = [IntegerEntry(userLpBoostEmissionLastIntegralKEY, boostEmissionIntegral)]
593- let debug = makeString([toString(userBoostEmissionLastIntegral), toString(userBoostEmissionIntegral), toString(userBoostClaimed), toString(userBoostAvailable), toString(poolWeight0), toString(poolWeight1), toString(h), toString(udh), toString(uLastH), toString(udh0), toString(udh1), toString(userCurrGwx), toString(totalCachedGwxCorrected)], ":")
594- $Tuple3(userBoostAvaliableToClaimTotalNew, dataState, debug)
595- }
658+ if ((0 > userBoostEmissionIntegral))
659+ then throw("wrong calculations")
660+ else {
661+ let $t02721227351 = getStakedVotesIntegralsDiff(lpAssetIdStr, userAddressStr)
662+ let stakedVotesIntegralsActions = $t02721227351._1
663+ let userVoteIntegralDiff = $t02721227351._2
664+ let totalVotesIntegralDiff = $t02721227351._3
665+ let poolUserBoostEmissionIntegral = fraction(userBoostEmissionIntegral, poolWeight, POOLWEIGHTMULT)
666+ let userBoostAvaliableToClaimTotalNew = if ((totalVotesIntegralDiff == 0))
667+ then 0
668+ else fraction(poolUserBoostEmissionIntegral, userVoteIntegralDiff, totalVotesIntegralDiff)
669+ let dataState = ([IntegerEntry(userLpBoostEmissionLastIntegralKEY, boostEmissionIntegral)] ++ stakedVotesIntegralsActions)
670+ let debug = makeString([toString(userBoostEmissionLastIntegral), toString(userBoostEmissionIntegral), toString(poolWeight), toString(userVoteIntegralDiff), toString(totalVotesIntegralDiff)], ":")
671+ $Tuple3(userBoostAvaliableToClaimTotalNew, dataState, debug)
672+ }
596673 }
597674 }
598675
599676
600677 func lockActions (i,duration) = {
601678 let cfgArray = readConfigArrayOrFail()
602679 let assetIdStr = cfgArray[IdxCfgAssetId]
603680 let assetId = fromBase58String(assetIdStr)
604681 let minLockAmount = parseIntValue(cfgArray[IdxCfgMinLockAmount])
605682 let minLockDuration = parseIntValue(cfgArray[IdxCfgMinLockDuration])
606683 let maxLockDuration = parseIntValue(cfgArray[IdxCfgMaxLockDuration])
607684 if ((size(i.payments) != 1))
608685 then throw("invalid payment - exact one payment must be attached")
609686 else {
610687 let pmt = i.payments[0]
611688 let pmtAmount = pmt.amount
612689 if ((assetId != value(pmt.assetId)))
613690 then throw((("invalid asset is in payment - " + assetIdStr) + " is expected"))
614691 else {
615692 let nextUserNumKEY = keyNextUserNum()
616693 let userAddressStr = toString(i.caller)
617694 let userIsExisting = isDefined(getString(keyUser2NumMapping(userAddressStr)))
618695 let userNumStr = if (userIsExisting)
619696 then value(getString(keyUser2NumMapping(userAddressStr)))
620697 else toString(iof(this, nextUserNumKEY))
621698 let userNum = parseIntValue(userNumStr)
622699 let lockStart = height
623700 let startBlockKEY = keyLockParamStartBlock(userNumStr)
624701 let durationKEY = keyLockParamDuration(userNumStr)
625702 let userAmountKEY = keyLockParamUserAmount(userNumStr)
626703 if (if ((minLockAmount > pmtAmount))
627704 then (i.caller != lpStakingPoolsContract)
628705 else false)
629706 then throw(("amount is less then minLockAmount=" + toString(minLockAmount)))
630707 else if ((minLockDuration > duration))
631708 then throw(("passed duration is less then minLockDuration=" + toString(minLockDuration)))
632709 else if ((duration > maxLockDuration))
633710 then throw(("passed duration is greater then maxLockDuration=" + toString(maxLockDuration)))
634711 else if (if (userIsExisting)
635712 then ((iof(this, startBlockKEY) + iof(this, durationKEY)) >= lockStart)
636713 else false)
637714 then throw("there is an active lock - consider to use increaseLock")
638715 else if ((ioz(this, userAmountKEY) > 0))
639716 then throw(("there are locked WXs - consider to use increaseLock " + userAmountKEY))
640717 else {
641718 let coeffX8 = fraction(duration, MULT8, maxLockDuration)
642719 let gWxAmountStart = fraction(pmtAmount, coeffX8, MULT8)
643720 let gWxParamsResultList = aal(invoke(mathContract, "calcGwxParamsREADONLY", [gWxAmountStart, lockStart, duration], nil))
644721 let k = ai(gWxParamsResultList[0])
645722 let b = ai(gWxParamsResultList[1])
646723 let period = toString(ai(gWxParamsResultList[2]))
647- let wxEmissionPerBlock = iof(emissionContract, keyEmissionRatePerBlockCurrent())
648- let emissionStart = iof(emissionContract, keyEmissionStartBlock())
649- let emissionEnd = iof(emissionContract, keyEmissionEndBlock())
650- let h = if ((height > emissionEnd))
651- then emissionEnd
652- else height
653- let dh = max([(h - emissionStart), 0])
724+ let totalCachedGwxRaw = getTotalCachedGwx(false)
654725 let userBoostEmissionLastIntegralKEY = keyUserBoostEmissionLastINTEGRAL(userNumStr)
655- let boostEmissionIntegral = (((wxEmissionPerBlock * dh) * 2) / 3)
656- let userMaxBoostIntegralKEY = keyUserMaxBoostINTEGRAL(userNumStr)
657- let totalMaxBoostIntegralKEY = keyTotalMaxBoostINTEGRAL()
658- let userMaxBoostInt = ((gWxAmountStart * duration) / 2)
659- let totalMaxBoostInt = ioz(this, totalMaxBoostIntegralKEY)
660- let totalCachedGwxRaw = getTotalCachedGwx(false)
726+ let boostEmissionIntegral = refreshBoostEmissionIntegral()._2
661727 let arr = if (userIsExisting)
662728 then nil
663729 else [IntegerEntry(nextUserNumKEY, (userNum + 1)), StringEntry(keyUser2NumMapping(userAddressStr), userNumStr), StringEntry(keyNum2UserMapping(userNumStr), userAddressStr)]
664730 $Tuple2(((((arr ++ LockParamsEntry(userAddressStr, userNumStr, pmtAmount, lockStart, duration, k, b, period)) ++ StatsEntry(pmtAmount, duration, 1, if (userIsExisting)
665731 then 0
666732 else 1)) :+ HistoryEntry("lock", userAddressStr, pmtAmount, lockStart, duration, k, b, i)) ++ [IntegerEntry(userBoostEmissionLastIntegralKEY, boostEmissionIntegral), IntegerEntry(keyTotalCachedGwx(), (totalCachedGwxRaw + gWxAmountStart))]), gWxAmountStart)
667733 }
668734 }
669735 }
670736 }
671737
672738
673739 @Callable(i)
674740 func constructor (factoryAddressStr,lockAssetIdStr,minLockAmount,minDuration,maxDuration,mathContract) = {
675741 let checkCaller = mustManager(i)
676742 if ((checkCaller == checkCaller))
677743 then ([IntegerEntry(keyNextUserNum(), 0), StringEntry(keyConfig(), formatConfig(lockAssetIdStr, minLockAmount, minDuration, maxDuration, mathContract)), StringEntry(keyFactoryAddress(), factoryAddressStr)] ++ StatsEntry(0, 0, 0, 0))
678744 else throw("Strict value is not equal to itself.")
679745 }
680746
681747
682748
683749 @Callable(i)
684750 func lockRef (duration,referrerAddress,signature) = {
685- let $t03009830163 = lockActions(i, duration)
686- let lockActionsResult = $t03009830163._1
687- let gWxAmountStart = $t03009830163._2
751+ let $t03194132006 = lockActions(i, duration)
752+ let lockActionsResult = $t03194132006._1
753+ let gWxAmountStart = $t03194132006._2
688754 let referralAddress = toString(i.caller)
689755 let refInv = if (if ((referrerAddress == ""))
690756 then true
691757 else (signature == base58''))
692758 then unit
693759 else invoke(referralsContractAddressOrFail, "createPair", [referralProgramName, referrerAddress, referralAddress, signature], nil)
694760 if ((refInv == refInv))
695761 then {
696762 let updateRefActivity = invoke(mathContract, "updateReferralActivity", [toString(i.caller), gWxAmountStart], nil)
697763 if ((updateRefActivity == updateRefActivity))
698764 then $Tuple2(lockActionsResult, unit)
699765 else throw("Strict value is not equal to itself.")
700766 }
701767 else throw("Strict value is not equal to itself.")
702768 }
703769
704770
705771
706772 @Callable(i)
707773 func lock (duration) = {
708- let $t03062130686 = lockActions(i, duration)
709- let lockActionsResult = $t03062130686._1
710- let gWxAmountStart = $t03062130686._2
774+ let $t03246432529 = lockActions(i, duration)
775+ let lockActionsResult = $t03246432529._1
776+ let gWxAmountStart = $t03246432529._2
711777 let updateRefActivity = invoke(mathContract, "updateReferralActivity", [toString(i.caller), gWxAmountStart], nil)
712778 if ((updateRefActivity == updateRefActivity))
713779 then $Tuple2(lockActionsResult, unit)
714780 else throw("Strict value is not equal to itself.")
715781 }
716782
717783
718784
719785 @Callable(i)
720786 func increaseLock (deltaDuration) = {
721787 let cfgArray = readConfigArrayOrFail()
722788 let assetIdStr = cfgArray[IdxCfgAssetId]
723789 let assetId = fromBase58String(assetIdStr)
724790 let minLockDuration = parseIntValue(cfgArray[IdxCfgMinLockDuration])
725791 let maxLockDuration = parseIntValue(cfgArray[IdxCfgMaxLockDuration])
726792 let pmtAmount = extractOptionalPaymentAmountOrFail(i, assetId)
727793 let userAddressStr = toString(i.caller)
728794 let userRecordArray = readLockParamsRecordOrFail(userAddressStr)
729795 let userNumStr = userRecordArray[IdxLockUserNum]
730796 let userAmount = parseIntValue(userRecordArray[IdxLockAmount])
731797 let lockStart = parseIntValue(userRecordArray[IdxLockStart])
732798 let lockDuration = parseIntValue(userRecordArray[IdxLockDuration])
733799 let lockEnd = (lockStart + lockDuration)
734800 let remainingDuration = max([(lockEnd - height), 0])
735801 let userAmountNew = (userAmount + pmtAmount)
736802 let lockDurationNew = (remainingDuration + deltaDuration)
737803 if ((0 > deltaDuration))
738804 then throw("duration is less then zero")
739805 else if ((minLockDuration > lockDurationNew))
740806 then throw(("lockDurationNew is less then minLockDuration=" + toString(minLockDuration)))
741807 else if ((lockDurationNew > maxLockDuration))
742808 then throw(("deltaDuration + existedLockDuration is greater then maxLockDuration=" + toString(maxLockDuration)))
743809 else {
744810 let coeffX8 = fraction(lockDurationNew, MULT8, maxLockDuration)
745811 let gWxAmountStart = fraction(userAmountNew, coeffX8, MULT8)
746812 let updateRefActivity = invoke(mathContract, "updateReferralActivity", [toString(i.caller), gWxAmountStart], nil)
747813 if ((updateRefActivity == updateRefActivity))
748814 then {
749815 let lockStartNew = height
750816 let gWxParamsResultList = aal(invoke(mathContract, "calcGwxParamsREADONLY", [gWxAmountStart, lockStartNew, lockDurationNew], nil))
751817 let k = ai(gWxParamsResultList[0])
752818 let b = ai(gWxParamsResultList[1])
753819 let period = toString(ai(gWxParamsResultList[2]))
754- let wxEmissionPerBlock = iof(emissionContract, keyEmissionRatePerBlockCurrent())
755- let emissionStart = iof(emissionContract, keyEmissionStartBlock())
756- let emissionEnd = iof(emissionContract, keyEmissionEndBlock())
757- let h = if ((height > emissionEnd))
758- then emissionEnd
759- else height
760- let dh = max([(h - emissionStart), 0])
761- let userBoostEmissionLastIntegralKEY = keyUserBoostEmissionLastINTEGRAL(userNumStr)
762- let userBoostEmissionLastIntegral = ioz(this, userBoostEmissionLastIntegralKEY)
763- let boostEmissionIntegral = (((wxEmissionPerBlock * dh) * 2) / 3)
764- let userBoostEmissionIntegral = (boostEmissionIntegral - userBoostEmissionLastIntegral)
765- if ((0 > userBoostEmissionIntegral))
766- then throw("wrong calculations")
820+ let currUserGwx = calcCurrentGwxAmount(userAddressStr)
821+ let gwxDiff = (gWxAmountStart - currUserGwx)
822+ if ((0 > gwxDiff))
823+ then throw(("gwxDiff is less then 0: " + toString(gwxDiff)))
767824 else {
768- let userMaxBoostIntegralKEY = keyUserMaxBoostINTEGRAL(userNumStr)
769- let totalMaxBoostIntegralKEY = keyTotalMaxBoostINTEGRAL()
770- let userMaxBoostInt = ioz(this, userMaxBoostIntegralKEY)
771- let totalMaxBoostInt = ioz(this, totalMaxBoostIntegralKEY)
772- let currUserGwx = calcCurrentGwxAmount(userAddressStr)
773- let gwxDiff = (gWxAmountStart - currUserGwx)
774- if ((0 > gwxDiff))
775- then throw(("gwxDiff is less then 0: " + toString(gwxDiff)))
776- else {
777- let totalCachedGwxRaw = getTotalCachedGwx(false)
778- let totalCachedGwxCorrected = getTotalCachedGwx(true)
779- let userBoostAvalaibleToClaimTotalKEY = keyUserBoostAvalaibleToClaimTotal(userNumStr)
780- let userBoostAvaliableToClaimTotal = ioz(this, userBoostAvalaibleToClaimTotalKEY)
781- let userBoostAvaliableToClaimTotalNew = fraction(userBoostEmissionIntegral, currUserGwx, totalCachedGwxCorrected)
782- let userMaxBoostIntNew = ((gWxAmountStart * lockDurationNew) / 2)
783- let remainingUserMaxBoostInt = ((currUserGwx * remainingDuration) / 2)
784- let userMaxBoostIntDiff = (userMaxBoostIntNew - remainingUserMaxBoostInt)
785- (((LockParamsEntry(userAddressStr, userNumStr, userAmountNew, lockStartNew, lockDurationNew, k, b, period) ++ StatsEntry(pmtAmount, deltaDuration, 0, 0)) :+ HistoryEntry("lock", userAddressStr, pmtAmount, lockStart, lockDurationNew, k, b, i)) ++ [IntegerEntry(keyTotalCachedGwx(), (totalCachedGwxRaw + gwxDiff))])
786- }
825+ let totalCachedGwxRaw = getTotalCachedGwx(false)
826+ let totalCachedGwxCorrected = getTotalCachedGwx(true)
827+ (((LockParamsEntry(userAddressStr, userNumStr, userAmountNew, lockStartNew, lockDurationNew, k, b, period) ++ StatsEntry(pmtAmount, deltaDuration, 0, 0)) :+ HistoryEntry("lock", userAddressStr, pmtAmount, lockStart, lockDurationNew, k, b, i)) ++ [IntegerEntry(keyTotalCachedGwx(), (totalCachedGwxRaw + gwxDiff))])
787828 }
788829 }
789830 else throw("Strict value is not equal to itself.")
790831 }
791832 }
792833
793834
794835
795836 @Callable(i)
796837 func claimWxBoost (lpAssetIdStr,userAddressStr) = if ((stakingContract != i.caller))
797838 then throw("permissions denied")
798839 else {
799- let $t03566735769 = internalClaimWxBoost(lpAssetIdStr, userAddressStr, false)
800- let userBoostAvailable = $t03566735769._1
801- let dataState = $t03566735769._2
802- let debug = $t03566735769._3
840+ let $t03561635718 = internalClaimWxBoost(lpAssetIdStr, userAddressStr, false)
841+ let userBoostAvailable = $t03561635718._1
842+ let dataState = $t03561635718._2
843+ let debug = $t03561635718._3
803844 $Tuple2(dataState, [userBoostAvailable])
804845 }
805846
806847
807848
808849 @Callable(i)
809850 func claimWxBoostREADONLY (lpAssetIdStr,userAddressStr) = {
810- let $t03590136002 = internalClaimWxBoost(lpAssetIdStr, userAddressStr, true)
811- let userBoostAvailable = $t03590136002._1
812- let dataState = $t03590136002._2
813- let debug = $t03590136002._3
851+ let $t03585035951 = internalClaimWxBoost(lpAssetIdStr, userAddressStr, true)
852+ let userBoostAvailable = $t03585035951._1
853+ let dataState = $t03585035951._2
854+ let debug = $t03585035951._3
814855 $Tuple2(nil, [userBoostAvailable, debug])
815856 }
816857
817858
818859
819860 @Callable(i)
820861 func unlock (userAddress) = {
821862 let userRecordArray = readLockParamsRecordOrFail(userAddress)
822863 let userNumStr = userRecordArray[IdxLockUserNum]
823864 let userAmount = parseIntValue(userRecordArray[IdxLockAmount])
824865 let lockStart = parseIntValue(userRecordArray[IdxLockStart])
825866 let lockDuration = parseIntValue(userRecordArray[IdxLockDuration])
826867 let lockEnd = (lockStart + lockDuration)
827868 let cfgArray = readConfigArrayOrFail()
828869 let assetId = fromBase58String(cfgArray[IdxCfgAssetId])
829870 if ((lockEnd >= height))
830871 then throw((("wait " + toString(lockEnd)) + " to unlock"))
831872 else if ((0 >= userAmount))
832873 then throw("nothing to unlock")
833874 else {
834875 let period = valueOrElse(getInteger(mathContract, keyNextPeriod()), 0)
835876 (((LockParamsEntry(userAddress, userNumStr, 0, lockStart, lockDuration, 0, 0, toString(period)) ++ StatsEntry(-(userAmount), 0, 0, -1)) :+ HistoryEntry("unlock", userAddress, userAmount, lockStart, lockDuration, 0, 0, i)) :+ ScriptTransfer(addressFromStringValue(userAddress), userAmount, assetId))
836877 }
837878 }
838879
839880
840881
841882 @Callable(i)
842883 func gwxUserInfoREADONLY (userAddress) = {
843884 let gwxAmount = calcCurrentGwxAmount(userAddress)
844885 $Tuple2(nil, [gwxAmount])
845886 }
846887
847888
848889
849890 @Callable(i)
850891 func userMaxDurationREADONLY (userAddressStr) = {
851892 let cfgArray = readConfigArrayOrFail()
852893 let maxLockDuration = parseIntValue(cfgArray[IdxCfgMaxLockDuration])
853894 let userRecordOption = getString(this, keyLockParamsRecord(userAddressStr))
854895 if ((userRecordOption == unit))
855896 then $Tuple2(nil, $Tuple2("lock", maxLockDuration))
856897 else {
857898 let userRecordArray = split(value(userRecordOption), SEP)
858899 let lockStart = parseIntValue(userRecordArray[IdxLockStart])
859900 let lockDuration = parseIntValue(userRecordArray[IdxLockDuration])
860901 let lockEnd = (lockStart + lockDuration)
861902 let remainingDuration = max([(lockEnd - height), 0])
862903 let maxDeltaDuration = (maxLockDuration - remainingDuration)
863904 $Tuple2(nil, $Tuple2("increaseLock", maxDeltaDuration))
864905 }
865906 }
866907
867908
868909
869910 @Callable(i)
870911 func getUserGwxAmountAtHeightREADONLY (userAddress,targetHeight) = {
871912 let gwxAmount = calcUserGwxAmountAtHeight(userAddress, targetHeight)
872913 $Tuple2(nil, gwxAmount)
873914 }
874915
875916
876917
877918 @Callable(i)
878919 func getTotalCachedGwxREADONLY () = $Tuple2(nil, getTotalCachedGwx(true))
879920
880921
881922
882923 @Callable(i)
924+func onBoostEmissionUpdate () = {
925+ let checkCaller = if ((i.caller == emissionContract))
926+ then true
927+ else mustManager(i)
928+ if ((checkCaller == checkCaller))
929+ then refreshBoostEmissionIntegral()
930+ else throw("Strict value is not equal to itself.")
931+ }
932+
933+
934+
935+@Callable(i)
883936 func onStakedVoteUpdate (lpAssetIdStr,userAddressStr,edge) = {
884937 let checkCaller = if ((i.caller == stakingContract))
885938 then true
886939 else mustManager(i)
887940 if ((checkCaller == checkCaller))
888941 then {
889942 let actions = refreshVoteStakedIntegral(lpAssetIdStr, userAddressStr, edge)
890943 $Tuple2(actions, unit)
891944 }
892945 else throw("Strict value is not equal to itself.")
893946 }
894947
895948
896949
897950 @Callable(i)
898951 func getVotingResultStakedREADONLY (lpAssetIdStr) = $Tuple2(nil, getVotingResultStaked(lpAssetIdStr))
952+
953+
954+
955+@Callable(i)
956+func getUserVoteFinalizedREADONLY (lpAssetIdStr,userAddressStr) = $Tuple2(nil, getUserVoteFinalized(lpAssetIdStr, userAddressStr))
899957
900958
901959
902960 @Callable(i)
903961 func setManager (pendingManagerPublicKey) = {
904962 let checkCaller = mustManager(i)
905963 if ((checkCaller == checkCaller))
906964 then {
907965 let checkManagerPublicKey = fromBase58String(pendingManagerPublicKey)
908966 if ((checkManagerPublicKey == checkManagerPublicKey))
909967 then [StringEntry(keyPendingManagerPublicKey(), pendingManagerPublicKey)]
910968 else throw("Strict value is not equal to itself.")
911969 }
912970 else throw("Strict value is not equal to itself.")
913971 }
914972
915973
916974
917975 @Callable(i)
918976 func confirmManager () = {
919977 let pm = pendingManagerPublicKeyOrUnit()
920978 let hasPM = if (isDefined(pm))
921979 then true
922980 else throw("No pending manager")
923981 if ((hasPM == hasPM))
924982 then {
925983 let checkPM = if ((i.callerPublicKey == value(pm)))
926984 then true
927985 else throw("You are not pending manager")
928986 if ((checkPM == checkPM))
929987 then [StringEntry(keyManagerPublicKey(), toBase58String(value(pm))), DeleteEntry(keyPendingManagerPublicKey())]
930988 else throw("Strict value is not equal to itself.")
931989 }
932990 else throw("Strict value is not equal to itself.")
933991 }
934992
935993
936994 @Verifier(tx)
937995 func verify () = {
938996 let targetPublicKey = match managerPublicKeyOrUnit() {
939997 case pk: ByteVector =>
940998 pk
941999 case _: Unit =>
9421000 tx.senderPublicKey
9431001 case _ =>
9441002 throw("Match error")
9451003 }
9461004 sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey)
9471005 }
9481006

github/deemru/w8io/026f985 
118.72 ms