tx · 5tog8x7bSLC6iuCsZ5peaA914TR6cERf2aVHu9YZoL3C

3Myn55vLkduxbX3ZXfiDCZhaQsLxYp1kmCy:  -0.02300000 Waves

2023.02.20 16:51 [2458058] smart account 3Myn55vLkduxbX3ZXfiDCZhaQsLxYp1kmCy > SELF 0.00000000 Waves

{ "type": 13, "id": "5tog8x7bSLC6iuCsZ5peaA914TR6cERf2aVHu9YZoL3C", "fee": 2300000, "feeAssetId": null, "timestamp": 1676901129057, "version": 2, "chainId": 84, "sender": "3Myn55vLkduxbX3ZXfiDCZhaQsLxYp1kmCy", "senderPublicKey": "9W33iCCNfmFxUbiC6XZcH5x7f6xfwC7Jb3BoExT5q2PV", "proofs": [ "5ecE5wggZYvD9oD8trrHV5rFx9dxW7nQUAasFNAMqmkukYrRchQtjeegfgeQhrg9NCb6fqYjnTfMP1YoBxVm2fLw" ], "script": "base64:BgLnJQgCEggKBggIAQEBCBIFCgMBCAISAwoBARIDCgEBEgQKAggIEgQKAggIEgMKAQgSAwoBCBIECgIIARIAEgMKAQgSACIDU0VQIgZTQ0FMRTgiBU1VTFQ4Ig5QT09MV0VJR0hUTVVMVCIEc3RyZiIHYWRkcmVzcyIDa2V5IgNpb3oiA2lvZCIKZGVmYXVsdFZhbCIDaW9mIgNhYnMiA3ZhbCIDYWFsIgckbWF0Y2gwIgp2YWxBbnlMeXN0IgJhaSIGdmFsSW50IhtrZXlSZWZlcnJhbHNDb250cmFjdEFkZHJlc3MiHnJlZmVycmFsc0NvbnRyYWN0QWRkcmVzc09yRmFpbCIWa2V5UmVmZXJyYWxQcm9ncmFtTmFtZSIacmVmZXJyYWxQcm9ncmFtTmFtZURlZmF1bHQiE3JlZmVycmFsUHJvZ3JhbU5hbWUiEWtleUZhY3RvcnlBZGRyZXNzIhhJZHhGYWN0b3J5Q2ZnU3Rha2luZ0RhcHAiGUlkeEZhY3RvcnlDZmdCb29zdGluZ0RhcHAiFElkeEZhY3RvcnlDZmdJZG9EYXBwIhVJZHhGYWN0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CCQELU3RyaW5nRW50cnkCCQECYWMACQDYBAEJAQV2YWx1ZQEFAmVuCQDMCAIJAQtEZWxldGVFbnRyeQEJAQJhZAAFA25pbAkAAgECJFN0cmljdCB2YWx1ZSBpcyBub3QgZXF1YWwgdG8gaXRzZWxmLgkAAgECJFN0cmljdCB2YWx1ZSBpcyBub3QgZXF1YWwgdG8gaXRzZWxmLgECZXEBAmVyAAQCZXMEAW8JAQJhegADCQABAgUBbwIKQnl0ZVZlY3RvcgQCYUYFAW8FAmFGAwkAAQIFAW8CBFVuaXQIBQJlcQ9zZW5kZXJQdWJsaWNLZXkJAAIBAgtNYXRjaCBlcnJvcgkA9AMDCAUCZXEJYm9keUJ5dGVzCQCRAwIIBQJlcQZwcm9vZnMAAAUCZXPDR9vj", "height": 2458058, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: BskLMfXpLaR9V9pDsWzAWTWriKeW8XPeQk4d2whGb51u Next: ECDRefMeK9T8XVnhUrxN6ca8E8mVNrFtpbBqrBre9Er1 Diff:
OldNewDifferences
88 let MULT8 = 100000000
99
1010 let POOLWEIGHTMULT = MULT8
11-
12-func wrapErr (msg) = makeString(["boosting.ride:", msg], " ")
13-
14-
15-func throwErr (msg) = throw(wrapErr(msg))
16-
1711
1812 func strf (address,key) = valueOrErrorMessage(getString(address, key), (("mandatory this." + key) + " is not defined"))
1913
136130
137131
138132 func keyEmissionStartBlock () = "%s%s__emission__startBlock"
139-
140-
141-func keyBoostingV2StartHeight () = "%s%s__boostingV2__startBlock"
142133
143134
144135 func keyEmissionDurationInBlocks () = "%s%s__emission__duration"
280271 func keyStatsUsersCount () = "%s%s__stats__activeUsersCount"
281272
282273
283-func keyUserBoostEmissionLastINTEGRAL (userNum) = makeString(["%s%d__userBoostEmissionLastIntV2", userNum], SEP)
274+func keyUserBoostEmissionLastINTEGRAL (userNum) = makeString(["%s%d__userBoostEmissionLastInt", userNum], SEP)
284275
285276
286-func keyUserLpBoostEmissionLastINTEGRAL (userNum,lpAssetId) = makeString(["%s%d__userBoostEmissionLastIntV2", userNum, lpAssetId], SEP)
277+func keyUserLpBoostEmissionLastINTEGRAL (userNum,lpAssetId) = makeString(["%s%d__userBoostEmissionLastInt", userNum, lpAssetId], SEP)
287278
288279
289280 func keyUserMaxBoostINTEGRAL (userNum) = makeString(["%s%d__maxBoostInt", userNum], SEP)
314305
315306 let gwxRewardContract = getGwxRewardAddressOrFail(factoryCfg)
316307
317-let keyVotingEmissionContract = makeString(["%s", "votingEmissionContract"], SEP)
318-
319-let votingEmissionContract = addressFromStringValue(getStringValue(factoryContract, keyVotingEmissionContract))
320-
321-let boostCoeff = {
322- let @ = invoke(emissionContract, "getBoostCoeffREADONLY", nil, nil)
323- if ($isInstanceOf(@, "Int"))
324- then @
325- else throw(($getType(@) + " couldn't be cast to Int"))
326- }
327-
328308 func getTotalCachedGwx (correct) = {
309+ let keyVotingEmissionContract = makeString(["%s", "votingEmissionContract"], SEP)
310+ let votingEmissionContract = addressFromStringValue(getStringValue(factoryContract, keyVotingEmissionContract))
329311 let keyCurrentEpochUi = makeString(["%s", "currentEpochUi"], SEP)
330312 let currentEpochUi = getIntegerValue(votingEmissionContract, keyCurrentEpochUi)
331313 let keyTargetEpoch = makeString(["%s%s", "totalCachedGwxCorrection__activationEpoch"], SEP)
411393 func calcCurrentGwxAmount (userAddress) = calcUserGwxAmountAtHeight(userAddress, height)
412394
413395
414-func getVoteInfoREADONLY (lpAssetIdStr,userAddressStr) = {
415- let userAddress = addressFromStringValue(userAddressStr)
416- let idxAmountAssetId = 4
417- let idxPriceAssetId = 5
418- let poolCfg = {
419- let @ = invoke(factoryContract, "getPoolConfigByLpAssetId", [lpAssetIdStr], nil)
420- if ($isInstanceOf(@, "List[Any]"))
421- then @
422- else throw(($getType(@) + " couldn't be cast to List[Any]"))
423- }
424- let amountAssetId = {
425- let @ = poolCfg[idxAmountAssetId]
426- if ($isInstanceOf(@, "String"))
427- then @
428- else throw(($getType(@) + " couldn't be cast to String"))
429- }
430- let priceAssetId = {
431- let @ = poolCfg[idxPriceAssetId]
432- if ($isInstanceOf(@, "String"))
433- then @
434- else throw(($getType(@) + " couldn't be cast to String"))
435- }
436- let keyCurrentEpoch = makeString(["%s", "currentEpoch"], SEP)
437- let lastFinalizedEpoch = {
438- let epoch = (value(getInteger(votingEmissionContract, keyCurrentEpoch)) - 1)
439- if ((0 > epoch))
440- then throwErr("invalid epoch")
441- else epoch
442- }
443- func keyVote (pool,address,epoch) = makeString(["%s%s%s%s%d", "vote", amountAssetId, priceAssetId, toString(address), toString(epoch)], SEP)
444-
445- func keyVotingResult (pool,epoch) = makeString(["%s%s%s%d", "votingResult", amountAssetId, priceAssetId, toString(epoch)], SEP)
446-
447- let pool = $Tuple2(amountAssetId, priceAssetId)
448- let userVote = valueOrElse(getInteger(votingEmissionContract, keyVote(pool, userAddress, lastFinalizedEpoch)), 0)
449- let poolResult = valueOrElse(getInteger(votingEmissionContract, keyVotingResult(pool, lastFinalizedEpoch)), 0)
450- $Tuple2(userVote, poolResult)
451- }
452-
453-
454396 func internalClaimWxBoost (lpAssetIdStr,userAddressStr,readOnly) = {
455397 let EMPTY = "EMPTY"
456398 let userRecordOrEmpty = valueOrElse(getString(this, keyLockParamsRecord(userAddressStr)), EMPTY)
459401 else {
460402 let userRecordArray = split(userRecordOrEmpty, SEP)
461403 let userNumStr = userRecordArray[IdxLockUserNum]
404+ let gwxRewardEmissionStartHeight = valueOrElse(getInteger(gwxRewardContract, keyGwxRewardEmissionStartHeight()), 0)
462405 let EMPTYSTR = "empty"
463- let poolWeight = if ((lpAssetIdStr != EMPTYSTR))
406+ let $t01496515533 = if ((lpAssetIdStr != EMPTYSTR))
464407 then {
465408 let poolAddressStr = valueOrErrorMessage(getString(factoryContract, keyFactoryLp2AssetsMapping(lpAssetIdStr)), ("unsupported lp asset " + lpAssetIdStr))
466- getIntegerValue(factoryContract, keyFactoryPoolWeight(poolAddressStr))
409+ let pw1 = getIntegerValue(factoryContract, keyFactoryPoolWeight(poolAddressStr))
410+ let pw0 = valueOrElse(getInteger(factoryContract, keyFactoryPoolWeightHistory(poolAddressStr, 0)), pw1)
411+ $Tuple2(pw0, pw1)
467412 }
468413 else if (readOnly)
469- then 0
414+ then $Tuple2(0, 0)
470415 else throw(("not readonly mode: unsupported lp asset " + lpAssetIdStr))
416+ let poolWeight0 = $t01496515533._1
417+ let poolWeight1 = $t01496515533._2
471418 let wxEmissionPerBlock = iof(emissionContract, keyEmissionRatePerBlockCurrent())
472- let boostingV2StartHeight = iof(emissionContract, keyBoostingV2StartHeight())
419+ let emissionStart = iof(emissionContract, keyEmissionStartBlock())
473420 let emissionEnd = iof(emissionContract, keyEmissionEndBlock())
474421 let h = if ((height > emissionEnd))
475422 then emissionEnd
476423 else height
477- let dh = max([(h - boostingV2StartHeight), 0])
424+ let dh = max([(h - emissionStart), 0])
478425 let userLpBoostEmissionLastIntegralKEY = keyUserLpBoostEmissionLastINTEGRAL(userNumStr, lpAssetIdStr)
479426 let userBoostEmissionLastIntegralKEY = keyUserBoostEmissionLastINTEGRAL(userNumStr)
480427 let userBoostEmissionLastIntegral = valueOrElse(getInteger(this, userLpBoostEmissionLastIntegralKEY), ioz(this, userBoostEmissionLastIntegralKEY))
481- let boostEmissionIntegral = (((wxEmissionPerBlock * dh) * (boostCoeff - 1)) / boostCoeff)
428+ let boostEmissionIntegral = (((wxEmissionPerBlock * dh) * 2) / 3)
482429 let userBoostEmissionIntegral = (boostEmissionIntegral - userBoostEmissionLastIntegral)
483- let udh = fraction(userBoostEmissionIntegral, boostCoeff, ((boostCoeff - 1) * wxEmissionPerBlock))
430+ let udh = fraction(userBoostEmissionIntegral, 3, (2 * wxEmissionPerBlock))
484431 let uLastH = (h - udh)
485- if ((0 > userBoostEmissionIntegral))
486- then throw("wrong calculations")
487- else {
488- let userMaxBoostIntegralKEY = keyUserMaxBoostINTEGRAL(userNumStr)
489- let totalMaxBoostIntegralKEY = keyTotalMaxBoostINTEGRAL()
490- let userMaxBoostInt = ioz(this, userMaxBoostIntegralKEY)
491- let totalMaxBoostInt = ioz(this, totalMaxBoostIntegralKEY)
492- let $t01817818256 = getVoteInfoREADONLY(lpAssetIdStr, userAddressStr)
493- let userVote = $t01817818256._1
494- let totalVotes = $t01817818256._2
495- let userBoostAvalaibleToClaimTotalKEY = keyUserBoostAvalaibleToClaimTotal(userNumStr)
496- let userBoostAvaliableToClaimTotal = ioz(this, userBoostAvalaibleToClaimTotalKEY)
497- let poolUserBoostEmissionIntegral = fraction(userBoostEmissionIntegral, poolWeight, POOLWEIGHTMULT)
498- let userBoostAvaliableToClaimTotalNew = if ((totalVotes == 0))
499- then 0
500- else fraction(poolUserBoostEmissionIntegral, userVote, totalVotes)
501- let userBoostClaimedKEY = keyUserBoostClaimed(userNumStr)
502- let userBoostClaimed = ioz(this, userBoostClaimedKEY)
503- let userBoostAvailable = (userBoostAvaliableToClaimTotalNew - userBoostClaimed)
504- let dataState = [IntegerEntry(userLpBoostEmissionLastIntegralKEY, boostEmissionIntegral)]
505- let debug = makeString([toString(userBoostEmissionLastIntegral), toString(userBoostEmissionIntegral), toString(userBoostClaimed), toString(userBoostAvailable), toString(poolWeight), toString(h), toString(udh), toString(uLastH), toString(userVote), toString(totalVotes)], ":")
506- $Tuple3(userBoostAvaliableToClaimTotalNew, dataState, debug)
507- }
432+ let udh0 = max([(gwxRewardEmissionStartHeight - uLastH), 0])
433+ let udh1 = ((h - uLastH) - udh0)
434+ if (if (if ((0 > uLastH))
435+ then true
436+ else (0 > udh1))
437+ then true
438+ else (abs(((udh0 + udh1) - udh)) >= 1))
439+ then throw(((((((("invalid udh calc: udh=" + toString(udh)) + " uLastH=") + toString(uLastH)) + " udh0=") + toString(udh0)) + " udh1=") + toString(udh1)))
440+ else if ((0 > userBoostEmissionIntegral))
441+ then throw("wrong calculations")
442+ else {
443+ let userMaxBoostIntegralKEY = keyUserMaxBoostINTEGRAL(userNumStr)
444+ let totalMaxBoostIntegralKEY = keyTotalMaxBoostINTEGRAL()
445+ let userMaxBoostInt = ioz(this, userMaxBoostIntegralKEY)
446+ let totalMaxBoostInt = ioz(this, totalMaxBoostIntegralKEY)
447+ let totalCachedGwxCorrected = getTotalCachedGwx(true)
448+ let userCurrGwx = calcCurrentGwxAmount(userAddressStr)
449+ let userBoostAvalaibleToClaimTotalKEY = keyUserBoostAvalaibleToClaimTotal(userNumStr)
450+ let userBoostAvaliableToClaimTotal = ioz(this, userBoostAvalaibleToClaimTotalKEY)
451+ let userBoostEmissionIntegral0 = if ((udh == 0))
452+ then 0
453+ else fraction(userBoostEmissionIntegral, udh0, udh)
454+ let userBoostEmissionIntegral1 = if ((udh == 0))
455+ then 0
456+ else fraction(userBoostEmissionIntegral, udh1, udh)
457+ let poolUserBoostEmissionIntegral0 = fraction(userBoostEmissionIntegral0, poolWeight0, POOLWEIGHTMULT)
458+ let poolUserBoostEmissionIntegral1 = fraction(userBoostEmissionIntegral1, poolWeight1, POOLWEIGHTMULT)
459+ let userBoostAvaliableToClaimTotalNew0 = if ((totalCachedGwxCorrected == 0))
460+ then 0
461+ else fraction(poolUserBoostEmissionIntegral0, userCurrGwx, totalCachedGwxCorrected)
462+ let userBoostAvaliableToClaimTotalNew1 = if ((totalCachedGwxCorrected == 0))
463+ then 0
464+ else fraction(poolUserBoostEmissionIntegral1, userCurrGwx, totalCachedGwxCorrected)
465+ let userBoostAvaliableToClaimTotalNew = (userBoostAvaliableToClaimTotalNew0 + userBoostAvaliableToClaimTotalNew1)
466+ let userBoostClaimedKEY = keyUserBoostClaimed(userNumStr)
467+ let userBoostClaimed = ioz(this, userBoostClaimedKEY)
468+ let userBoostAvailable = (userBoostAvaliableToClaimTotalNew - userBoostClaimed)
469+ let dataState = [IntegerEntry(userLpBoostEmissionLastIntegralKEY, boostEmissionIntegral)]
470+ 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)], ":")
471+ $Tuple3(userBoostAvaliableToClaimTotalNew, dataState, debug)
472+ }
508473 }
509474 }
510475
592557
593558 @Callable(i)
594559 func lockRef (duration,referrerAddress,signature) = {
595- let $t02420824273 = lockActions(i, duration)
596- let lockActionsResult = $t02420824273._1
597- let gWxAmountStart = $t02420824273._2
560+ let $t02389223957 = lockActions(i, duration)
561+ let lockActionsResult = $t02389223957._1
562+ let gWxAmountStart = $t02389223957._2
598563 let referralAddress = toString(i.caller)
599564 let refInv = if (if ((referrerAddress == ""))
600565 then true
615580
616581 @Callable(i)
617582 func lock (duration) = {
618- let $t02473124796 = lockActions(i, duration)
619- let lockActionsResult = $t02473124796._1
620- let gWxAmountStart = $t02473124796._2
583+ let $t02441524480 = lockActions(i, duration)
584+ let lockActionsResult = $t02441524480._1
585+ let gWxAmountStart = $t02441524480._2
621586 let updateRefActivity = invoke(mathContract, "updateReferralActivity", [toString(i.caller), gWxAmountStart], nil)
622587 if ((updateRefActivity == updateRefActivity))
623588 then $Tuple2(lockActionsResult, unit)
706671 func claimWxBoost (lpAssetIdStr,userAddressStr) = if ((stakingContract != i.caller))
707672 then throw("permissions denied")
708673 else {
709- let $t02977729879 = internalClaimWxBoost(lpAssetIdStr, userAddressStr, false)
710- let userBoostAvailable = $t02977729879._1
711- let dataState = $t02977729879._2
712- let debug = $t02977729879._3
674+ let $t02946129563 = internalClaimWxBoost(lpAssetIdStr, userAddressStr, false)
675+ let userBoostAvailable = $t02946129563._1
676+ let dataState = $t02946129563._2
677+ let debug = $t02946129563._3
713678 $Tuple2(dataState, [userBoostAvailable])
714679 }
715680
717682
718683 @Callable(i)
719684 func claimWxBoostREADONLY (lpAssetIdStr,userAddressStr) = {
720- let $t03001130112 = internalClaimWxBoost(lpAssetIdStr, userAddressStr, true)
721- let userBoostAvailable = $t03001130112._1
722- let dataState = $t03001130112._2
723- let debug = $t03001130112._3
685+ let $t02969529796 = internalClaimWxBoost(lpAssetIdStr, userAddressStr, true)
686+ let userBoostAvailable = $t02969529796._1
687+ let dataState = $t02969529796._2
688+ let debug = $t02969529796._3
724689 $Tuple2(nil, [userBoostAvailable, debug])
725690 }
726691
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
11-
12-func wrapErr (msg) = makeString(["boosting.ride:", msg], " ")
13-
14-
15-func throwErr (msg) = throw(wrapErr(msg))
16-
1711
1812 func strf (address,key) = valueOrErrorMessage(getString(address, key), (("mandatory this." + key) + " is not defined"))
1913
2014
2115 func ioz (address,key) = valueOrElse(getInteger(address, key), 0)
2216
2317
2418 func iod (address,key,defaultVal) = valueOrElse(getInteger(address, key), defaultVal)
2519
2620
2721 func iof (address,key) = valueOrErrorMessage(getInteger(address, key), (("mandatory this." + key) + " is not defined"))
2822
2923
3024 func abs (val) = if ((0 > val))
3125 then -(val)
3226 else val
3327
3428
3529 func aal (val) = match val {
3630 case valAnyLyst: List[Any] =>
3731 valAnyLyst
3832 case _ =>
3933 throw("fail to cast into List[Any]")
4034 }
4135
4236
4337 func ai (val) = match val {
4438 case valInt: Int =>
4539 valInt
4640 case _ =>
4741 throw("fail to cast into Int")
4842 }
4943
5044
5145 func keyReferralsContractAddress () = makeString(["%s%s", "config", "referralsContractAddress"], SEP)
5246
5347
5448 let referralsContractAddressOrFail = addressFromStringValue(strf(this, keyReferralsContractAddress()))
5549
5650 let keyReferralProgramName = makeString(["%s%s", "referral", "programName"], SEP)
5751
5852 let referralProgramNameDefault = "wxlock"
5953
6054 let referralProgramName = valueOrElse(getString(this, keyReferralProgramName), referralProgramNameDefault)
6155
6256 func keyFactoryAddress () = "%s%s__config__factoryAddress"
6357
6458
6559 let IdxFactoryCfgStakingDapp = 1
6660
6761 let IdxFactoryCfgBoostingDapp = 2
6862
6963 let IdxFactoryCfgIdoDapp = 3
7064
7165 let IdxFactoryCfgTeamDapp = 4
7266
7367 let IdxFactoryCfgEmissionDapp = 5
7468
7569 let IdxFactoryCfgRestDapp = 6
7670
7771 let IdxFactoryCfgSlippageDapp = 7
7872
7973 let IdxFactoryCfgDaoDapp = 8
8074
8175 let IdxFactoryCfgMarketingDapp = 9
8276
8377 let IdxFactoryCfgGwxRewardDapp = 10
8478
8579 let IdxFactoryCfgBirdsDapp = 11
8680
8781 func keyFactoryCfg () = "%s__factoryConfig"
8882
8983
9084 func keyFactoryLp2AssetsMapping (lpAssetStr) = makeString(["%s%s%s", lpAssetStr, "mappings__lpAsset2PoolContract"], SEP)
9185
9286
9387 func keyFactoryLpList () = "%s__lpTokensList"
9488
9589
9690 func keyFactoryLpAssetToPoolContractAddress (lpAssetStr) = makeString(["%s%s%s", lpAssetStr, "mappings__lpAsset2PoolContract"], SEP)
9791
9892
9993 func keyFactoryPoolWeight (contractAddress) = makeString(["%s%s", "poolWeight", contractAddress], SEP)
10094
10195
10296 func keyFactoryPoolWeightHistory (poolAddress,num) = ((("%s%s__poolWeight__" + poolAddress) + "__") + toString(num))
10397
10498
10599 func readFactoryAddressOrFail () = addressFromStringValue(strf(this, keyFactoryAddress()))
106100
107101
108102 func readLpList () = split(valueOrElse(getString(readFactoryAddressOrFail(), keyFactoryLpList()), ""), SEP)
109103
110104
111105 func readFactoryCfgOrFail (factory) = split(strf(factory, keyFactoryCfg()), SEP)
112106
113107
114108 func getBoostingAddressOrFail (factoryCfg) = addressFromStringValue(factoryCfg[IdxFactoryCfgBoostingDapp])
115109
116110
117111 func getEmissionAddressOrFail (factoryCfg) = addressFromStringValue(factoryCfg[IdxFactoryCfgEmissionDapp])
118112
119113
120114 func getStakingAddressOrFail (factoryCfg) = addressFromStringValue(factoryCfg[IdxFactoryCfgStakingDapp])
121115
122116
123117 func getGwxRewardAddressOrFail (factoryCfg) = addressFromStringValue(factoryCfg[IdxFactoryCfgGwxRewardDapp])
124118
125119
126120 func keyManagerPublicKey () = "%s__managerPublicKey"
127121
128122
129123 func keyPendingManagerPublicKey () = "%s__pendingManagerPublicKey"
130124
131125
132126 func keyEmissionRatePerBlockCurrent () = "%s%s__ratePerBlock__current"
133127
134128
135129 func keyEmissionRatePerBlockMaxCurrent () = "%s%s__ratePerBlockMax__current"
136130
137131
138132 func keyEmissionStartBlock () = "%s%s__emission__startBlock"
139-
140-
141-func keyBoostingV2StartHeight () = "%s%s__boostingV2__startBlock"
142133
143134
144135 func keyEmissionDurationInBlocks () = "%s%s__emission__duration"
145136
146137
147138 func keyEmissionEndBlock () = "%s%s__emission__endBlock"
148139
149140
150141 func keyNextPeriod () = "%s__nextPeriod"
151142
152143
153144 func keyGwxRewardEmissionStartHeight () = "%s%s__gwxRewardEmissionPart__startHeight"
154145
155146
156147 let IdxCfgAssetId = 1
157148
158149 let IdxCfgMinLockAmount = 2
159150
160151 let IdxCfgMinLockDuration = 3
161152
162153 let IdxCfgMaxLockDuration = 4
163154
164155 let IdxCfgMathContract = 5
165156
166157 func keyConfig () = "%s__config"
167158
168159
169160 func readConfigArrayOrFail () = split(strf(this, keyConfig()), SEP)
170161
171162
172163 let mathContract = addressFromStringValue(readConfigArrayOrFail()[IdxCfgMathContract])
173164
174165 func formatConfigS (assetId,minLockAmount,minLockDuration,maxLockDuration,mathContract) = makeString(["%s%d%d%d", assetId, minLockAmount, minLockDuration, maxLockDuration, mathContract], SEP)
175166
176167
177168 func formatConfig (assetId,minLockAmount,minLockDuration,maxLockDuration,mathContract) = formatConfigS(assetId, toString(minLockAmount), toString(minLockDuration), toString(maxLockDuration), mathContract)
178169
179170
180171 func managerPublicKeyOrUnit () = match getString(keyManagerPublicKey()) {
181172 case s: String =>
182173 fromBase58String(s)
183174 case _: Unit =>
184175 unit
185176 case _ =>
186177 throw("Match error")
187178 }
188179
189180
190181 func pendingManagerPublicKeyOrUnit () = match getString(keyPendingManagerPublicKey()) {
191182 case s: String =>
192183 fromBase58String(s)
193184 case _: Unit =>
194185 unit
195186 case _ =>
196187 throw("Match error")
197188 }
198189
199190
200191 func mustManager (i) = {
201192 let pd = throw("Permission denied")
202193 match managerPublicKeyOrUnit() {
203194 case pk: ByteVector =>
204195 if ((i.callerPublicKey == pk))
205196 then true
206197 else pd
207198 case _: Unit =>
208199 if ((i.caller == this))
209200 then true
210201 else pd
211202 case _ =>
212203 throw("Match error")
213204 }
214205 }
215206
216207
217208 let IdxLockUserNum = 1
218209
219210 let IdxLockAmount = 2
220211
221212 let IdxLockStart = 3
222213
223214 let IdxLockDuration = 4
224215
225216 let IdxLockParamK = 5
226217
227218 let IdxLockParamB = 6
228219
229220 func keyLockParamsRecord (userAddress) = makeString(["%s%s__lock", userAddress], SEP)
230221
231222
232223 func readLockParamsRecordOrFail (userAddress) = split(strf(this, keyLockParamsRecord(userAddress)), SEP)
233224
234225
235226 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)
236227
237228
238229 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))
239230
240231
241232 func keyNextUserNum () = "%s__nextUserNum"
242233
243234
244235 func keyUser2NumMapping (userAddress) = makeString(["%s%s%s__mapping__user2num", userAddress], SEP)
245236
246237
247238 func keyNum2UserMapping (num) = makeString(["%s%s%s__mapping__num2user", num], SEP)
248239
249240
250241 func keyLockParamUserAmount (userNum) = makeString(["%s%d%s__paramByUserNum", userNum, "amount"], SEP)
251242
252243
253244 func keyLockParamStartBlock (userNum) = makeString(["%s%d%s__paramByUserNum", userNum, "start"], SEP)
254245
255246
256247 func keyLockParamDuration (userNum) = makeString(["%s%d%s__paramByUserNum", userNum, "duration"], SEP)
257248
258249
259250 func keyLockParamK (userNum) = makeString(["%s%d%s__paramByUserNum", userNum, "k"], SEP)
260251
261252
262253 func keyLockParamB (userNum) = makeString(["%s%d%s__paramByUserNum", userNum, "b"], SEP)
263254
264255
265256 func keyLockParamByPeriodK (userNum,period) = makeString(["%s%d%s%d__paramByPeriod", userNum, "k", period], SEP)
266257
267258
268259 func keyLockParamByPeriodB (userNum,period) = makeString(["%s%d%s%d__paramByPeriod", userNum, "b", period], SEP)
269260
270261
271262 func keyLockParamTotalAmount () = "%s%s__stats__activeTotalLocked"
272263
273264
274265 func keyStatsLocksDurationSumInBlocks () = "%s%s__stats__locksDurationSumInBlocks"
275266
276267
277268 func keyStatsLocksCount () = "%s%s__stats__locksCount"
278269
279270
280271 func keyStatsUsersCount () = "%s%s__stats__activeUsersCount"
281272
282273
283-func keyUserBoostEmissionLastINTEGRAL (userNum) = makeString(["%s%d__userBoostEmissionLastIntV2", userNum], SEP)
274+func keyUserBoostEmissionLastINTEGRAL (userNum) = makeString(["%s%d__userBoostEmissionLastInt", userNum], SEP)
284275
285276
286-func keyUserLpBoostEmissionLastINTEGRAL (userNum,lpAssetId) = makeString(["%s%d__userBoostEmissionLastIntV2", userNum, lpAssetId], SEP)
277+func keyUserLpBoostEmissionLastINTEGRAL (userNum,lpAssetId) = makeString(["%s%d__userBoostEmissionLastInt", userNum, lpAssetId], SEP)
287278
288279
289280 func keyUserMaxBoostINTEGRAL (userNum) = makeString(["%s%d__maxBoostInt", userNum], SEP)
290281
291282
292283 func keyTotalMaxBoostINTEGRAL () = "%s%s__maxBoostInt__total"
293284
294285
295286 func keyUserBoostAvalaibleToClaimTotal (userNum) = makeString(["%s%d__userBoostAvaliableToClaimTotal", userNum], SEP)
296287
297288
298289 func keyUserBoostClaimed (userNum) = makeString(["%s%d__userBoostClaimed", userNum], SEP)
299290
300291
301292 func keyTotalCachedGwx () = "%s%s__gwxCached__total"
302293
303294
304295 func keyTotalCachedGwxCorrective () = "%s__gwxCachedTotalCorrective"
305296
306297
307298 let factoryContract = readFactoryAddressOrFail()
308299
309300 let factoryCfg = readFactoryCfgOrFail(factoryContract)
310301
311302 let emissionContract = getEmissionAddressOrFail(factoryCfg)
312303
313304 let stakingContract = getStakingAddressOrFail(factoryCfg)
314305
315306 let gwxRewardContract = getGwxRewardAddressOrFail(factoryCfg)
316307
317-let keyVotingEmissionContract = makeString(["%s", "votingEmissionContract"], SEP)
318-
319-let votingEmissionContract = addressFromStringValue(getStringValue(factoryContract, keyVotingEmissionContract))
320-
321-let boostCoeff = {
322- let @ = invoke(emissionContract, "getBoostCoeffREADONLY", nil, nil)
323- if ($isInstanceOf(@, "Int"))
324- then @
325- else throw(($getType(@) + " couldn't be cast to Int"))
326- }
327-
328308 func getTotalCachedGwx (correct) = {
309+ let keyVotingEmissionContract = makeString(["%s", "votingEmissionContract"], SEP)
310+ let votingEmissionContract = addressFromStringValue(getStringValue(factoryContract, keyVotingEmissionContract))
329311 let keyCurrentEpochUi = makeString(["%s", "currentEpochUi"], SEP)
330312 let currentEpochUi = getIntegerValue(votingEmissionContract, keyCurrentEpochUi)
331313 let keyTargetEpoch = makeString(["%s%s", "totalCachedGwxCorrection__activationEpoch"], SEP)
332314 let targetEpochOption = getInteger(this, keyTargetEpoch)
333315 let totalCachedGwxRaw = valueOrElse(getInteger(this, keyTotalCachedGwx()), 0)
334316 let isCorrectionActivated = if (isDefined(targetEpochOption))
335317 then (currentEpochUi >= value(targetEpochOption))
336318 else false
337319 let corrective = if (if (isCorrectionActivated)
338320 then correct
339321 else false)
340322 then valueOrElse(getInteger(this, keyTotalCachedGwxCorrective()), 0)
341323 else 0
342324 max([0, (totalCachedGwxRaw + corrective)])
343325 }
344326
345327
346328 func HistoryEntry (type,user,amount,lockStart,duration,k,b,i) = {
347329 let historyKEY = makeString(["%s%s%s%s__history", type, user, toBase58String(i.transactionId)], SEP)
348330 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)
349331 StringEntry(historyKEY, historyDATA)
350332 }
351333
352334
353335 func StatsEntry (totalLockedInc,durationInc,lockCountInc,usersCountInc) = {
354336 let locksDurationSumInBlocksKEY = keyStatsLocksDurationSumInBlocks()
355337 let locksCountKEY = keyStatsLocksCount()
356338 let usersCountKEY = keyStatsUsersCount()
357339 let totalAmountKEY = keyLockParamTotalAmount()
358340 let locksDurationSumInBlocks = ioz(this, locksDurationSumInBlocksKEY)
359341 let locksCount = ioz(this, locksCountKEY)
360342 let usersCount = ioz(this, usersCountKEY)
361343 let totalAmount = ioz(this, totalAmountKEY)
362344 [IntegerEntry(locksDurationSumInBlocksKEY, (locksDurationSumInBlocks + durationInc)), IntegerEntry(locksCountKEY, (locksCount + lockCountInc)), IntegerEntry(usersCountKEY, (usersCount + usersCountInc)), IntegerEntry(totalAmountKEY, (totalAmount + totalLockedInc))]
363345 }
364346
365347
366348 func calcGwxAmount (kRaw,bRaw,h) = {
367349 let SCALE = 1000
368350 (((kRaw * h) + bRaw) / SCALE)
369351 }
370352
371353
372354 func LockParamsEntry (userAddress,userNum,amount,start,duration,k,b,period) = {
373355 let userAmountKEY = keyLockParamUserAmount(userNum)
374356 let startBlockKEY = keyLockParamStartBlock(userNum)
375357 let durationKEY = keyLockParamDuration(userNum)
376358 let kKEY = keyLockParamK(userNum)
377359 let bKEY = keyLockParamB(userNum)
378360 let kByPeriodKEY = keyLockParamByPeriodK(userNum, period)
379361 let bByPeriodKEY = keyLockParamByPeriodB(userNum, period)
380362 let gwxAmount = calcGwxAmount(k, b, height)
381363 [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))]
382364 }
383365
384366
385367 func extractOptionalPaymentAmountOrFail (i,expectedAssetId) = if ((size(i.payments) > 1))
386368 then throw("only one payment is allowed")
387369 else if ((size(i.payments) == 0))
388370 then 0
389371 else {
390372 let pmt = i.payments[0]
391373 if ((value(pmt.assetId) != expectedAssetId))
392374 then throw("invalid asset id in payment")
393375 else pmt.amount
394376 }
395377
396378
397379 func calcUserGwxAmountAtHeight (userAddress,targetHeight) = {
398380 let EMPTY = "empty"
399381 let user2NumMappingKEY = keyUser2NumMapping(userAddress)
400382 let userNum = valueOrElse(getString(user2NumMappingKEY), EMPTY)
401383 let k = valueOrElse(getInteger(keyLockParamK(userNum)), 0)
402384 let b = valueOrElse(getInteger(keyLockParamB(userNum)), 0)
403385 let gwxAmountCalc = calcGwxAmount(k, b, targetHeight)
404386 let gwxAmount = if ((0 > gwxAmountCalc))
405387 then 0
406388 else gwxAmountCalc
407389 gwxAmount
408390 }
409391
410392
411393 func calcCurrentGwxAmount (userAddress) = calcUserGwxAmountAtHeight(userAddress, height)
412394
413395
414-func getVoteInfoREADONLY (lpAssetIdStr,userAddressStr) = {
415- let userAddress = addressFromStringValue(userAddressStr)
416- let idxAmountAssetId = 4
417- let idxPriceAssetId = 5
418- let poolCfg = {
419- let @ = invoke(factoryContract, "getPoolConfigByLpAssetId", [lpAssetIdStr], nil)
420- if ($isInstanceOf(@, "List[Any]"))
421- then @
422- else throw(($getType(@) + " couldn't be cast to List[Any]"))
423- }
424- let amountAssetId = {
425- let @ = poolCfg[idxAmountAssetId]
426- if ($isInstanceOf(@, "String"))
427- then @
428- else throw(($getType(@) + " couldn't be cast to String"))
429- }
430- let priceAssetId = {
431- let @ = poolCfg[idxPriceAssetId]
432- if ($isInstanceOf(@, "String"))
433- then @
434- else throw(($getType(@) + " couldn't be cast to String"))
435- }
436- let keyCurrentEpoch = makeString(["%s", "currentEpoch"], SEP)
437- let lastFinalizedEpoch = {
438- let epoch = (value(getInteger(votingEmissionContract, keyCurrentEpoch)) - 1)
439- if ((0 > epoch))
440- then throwErr("invalid epoch")
441- else epoch
442- }
443- func keyVote (pool,address,epoch) = makeString(["%s%s%s%s%d", "vote", amountAssetId, priceAssetId, toString(address), toString(epoch)], SEP)
444-
445- func keyVotingResult (pool,epoch) = makeString(["%s%s%s%d", "votingResult", amountAssetId, priceAssetId, toString(epoch)], SEP)
446-
447- let pool = $Tuple2(amountAssetId, priceAssetId)
448- let userVote = valueOrElse(getInteger(votingEmissionContract, keyVote(pool, userAddress, lastFinalizedEpoch)), 0)
449- let poolResult = valueOrElse(getInteger(votingEmissionContract, keyVotingResult(pool, lastFinalizedEpoch)), 0)
450- $Tuple2(userVote, poolResult)
451- }
452-
453-
454396 func internalClaimWxBoost (lpAssetIdStr,userAddressStr,readOnly) = {
455397 let EMPTY = "EMPTY"
456398 let userRecordOrEmpty = valueOrElse(getString(this, keyLockParamsRecord(userAddressStr)), EMPTY)
457399 if ((userRecordOrEmpty == EMPTY))
458400 then $Tuple3(0, nil, "userRecord::is::empty")
459401 else {
460402 let userRecordArray = split(userRecordOrEmpty, SEP)
461403 let userNumStr = userRecordArray[IdxLockUserNum]
404+ let gwxRewardEmissionStartHeight = valueOrElse(getInteger(gwxRewardContract, keyGwxRewardEmissionStartHeight()), 0)
462405 let EMPTYSTR = "empty"
463- let poolWeight = if ((lpAssetIdStr != EMPTYSTR))
406+ let $t01496515533 = if ((lpAssetIdStr != EMPTYSTR))
464407 then {
465408 let poolAddressStr = valueOrErrorMessage(getString(factoryContract, keyFactoryLp2AssetsMapping(lpAssetIdStr)), ("unsupported lp asset " + lpAssetIdStr))
466- getIntegerValue(factoryContract, keyFactoryPoolWeight(poolAddressStr))
409+ let pw1 = getIntegerValue(factoryContract, keyFactoryPoolWeight(poolAddressStr))
410+ let pw0 = valueOrElse(getInteger(factoryContract, keyFactoryPoolWeightHistory(poolAddressStr, 0)), pw1)
411+ $Tuple2(pw0, pw1)
467412 }
468413 else if (readOnly)
469- then 0
414+ then $Tuple2(0, 0)
470415 else throw(("not readonly mode: unsupported lp asset " + lpAssetIdStr))
416+ let poolWeight0 = $t01496515533._1
417+ let poolWeight1 = $t01496515533._2
471418 let wxEmissionPerBlock = iof(emissionContract, keyEmissionRatePerBlockCurrent())
472- let boostingV2StartHeight = iof(emissionContract, keyBoostingV2StartHeight())
419+ let emissionStart = iof(emissionContract, keyEmissionStartBlock())
473420 let emissionEnd = iof(emissionContract, keyEmissionEndBlock())
474421 let h = if ((height > emissionEnd))
475422 then emissionEnd
476423 else height
477- let dh = max([(h - boostingV2StartHeight), 0])
424+ let dh = max([(h - emissionStart), 0])
478425 let userLpBoostEmissionLastIntegralKEY = keyUserLpBoostEmissionLastINTEGRAL(userNumStr, lpAssetIdStr)
479426 let userBoostEmissionLastIntegralKEY = keyUserBoostEmissionLastINTEGRAL(userNumStr)
480427 let userBoostEmissionLastIntegral = valueOrElse(getInteger(this, userLpBoostEmissionLastIntegralKEY), ioz(this, userBoostEmissionLastIntegralKEY))
481- let boostEmissionIntegral = (((wxEmissionPerBlock * dh) * (boostCoeff - 1)) / boostCoeff)
428+ let boostEmissionIntegral = (((wxEmissionPerBlock * dh) * 2) / 3)
482429 let userBoostEmissionIntegral = (boostEmissionIntegral - userBoostEmissionLastIntegral)
483- let udh = fraction(userBoostEmissionIntegral, boostCoeff, ((boostCoeff - 1) * wxEmissionPerBlock))
430+ let udh = fraction(userBoostEmissionIntegral, 3, (2 * wxEmissionPerBlock))
484431 let uLastH = (h - udh)
485- if ((0 > userBoostEmissionIntegral))
486- then throw("wrong calculations")
487- else {
488- let userMaxBoostIntegralKEY = keyUserMaxBoostINTEGRAL(userNumStr)
489- let totalMaxBoostIntegralKEY = keyTotalMaxBoostINTEGRAL()
490- let userMaxBoostInt = ioz(this, userMaxBoostIntegralKEY)
491- let totalMaxBoostInt = ioz(this, totalMaxBoostIntegralKEY)
492- let $t01817818256 = getVoteInfoREADONLY(lpAssetIdStr, userAddressStr)
493- let userVote = $t01817818256._1
494- let totalVotes = $t01817818256._2
495- let userBoostAvalaibleToClaimTotalKEY = keyUserBoostAvalaibleToClaimTotal(userNumStr)
496- let userBoostAvaliableToClaimTotal = ioz(this, userBoostAvalaibleToClaimTotalKEY)
497- let poolUserBoostEmissionIntegral = fraction(userBoostEmissionIntegral, poolWeight, POOLWEIGHTMULT)
498- let userBoostAvaliableToClaimTotalNew = if ((totalVotes == 0))
499- then 0
500- else fraction(poolUserBoostEmissionIntegral, userVote, totalVotes)
501- let userBoostClaimedKEY = keyUserBoostClaimed(userNumStr)
502- let userBoostClaimed = ioz(this, userBoostClaimedKEY)
503- let userBoostAvailable = (userBoostAvaliableToClaimTotalNew - userBoostClaimed)
504- let dataState = [IntegerEntry(userLpBoostEmissionLastIntegralKEY, boostEmissionIntegral)]
505- let debug = makeString([toString(userBoostEmissionLastIntegral), toString(userBoostEmissionIntegral), toString(userBoostClaimed), toString(userBoostAvailable), toString(poolWeight), toString(h), toString(udh), toString(uLastH), toString(userVote), toString(totalVotes)], ":")
506- $Tuple3(userBoostAvaliableToClaimTotalNew, dataState, debug)
507- }
432+ let udh0 = max([(gwxRewardEmissionStartHeight - uLastH), 0])
433+ let udh1 = ((h - uLastH) - udh0)
434+ if (if (if ((0 > uLastH))
435+ then true
436+ else (0 > udh1))
437+ then true
438+ else (abs(((udh0 + udh1) - udh)) >= 1))
439+ then throw(((((((("invalid udh calc: udh=" + toString(udh)) + " uLastH=") + toString(uLastH)) + " udh0=") + toString(udh0)) + " udh1=") + toString(udh1)))
440+ else if ((0 > userBoostEmissionIntegral))
441+ then throw("wrong calculations")
442+ else {
443+ let userMaxBoostIntegralKEY = keyUserMaxBoostINTEGRAL(userNumStr)
444+ let totalMaxBoostIntegralKEY = keyTotalMaxBoostINTEGRAL()
445+ let userMaxBoostInt = ioz(this, userMaxBoostIntegralKEY)
446+ let totalMaxBoostInt = ioz(this, totalMaxBoostIntegralKEY)
447+ let totalCachedGwxCorrected = getTotalCachedGwx(true)
448+ let userCurrGwx = calcCurrentGwxAmount(userAddressStr)
449+ let userBoostAvalaibleToClaimTotalKEY = keyUserBoostAvalaibleToClaimTotal(userNumStr)
450+ let userBoostAvaliableToClaimTotal = ioz(this, userBoostAvalaibleToClaimTotalKEY)
451+ let userBoostEmissionIntegral0 = if ((udh == 0))
452+ then 0
453+ else fraction(userBoostEmissionIntegral, udh0, udh)
454+ let userBoostEmissionIntegral1 = if ((udh == 0))
455+ then 0
456+ else fraction(userBoostEmissionIntegral, udh1, udh)
457+ let poolUserBoostEmissionIntegral0 = fraction(userBoostEmissionIntegral0, poolWeight0, POOLWEIGHTMULT)
458+ let poolUserBoostEmissionIntegral1 = fraction(userBoostEmissionIntegral1, poolWeight1, POOLWEIGHTMULT)
459+ let userBoostAvaliableToClaimTotalNew0 = if ((totalCachedGwxCorrected == 0))
460+ then 0
461+ else fraction(poolUserBoostEmissionIntegral0, userCurrGwx, totalCachedGwxCorrected)
462+ let userBoostAvaliableToClaimTotalNew1 = if ((totalCachedGwxCorrected == 0))
463+ then 0
464+ else fraction(poolUserBoostEmissionIntegral1, userCurrGwx, totalCachedGwxCorrected)
465+ let userBoostAvaliableToClaimTotalNew = (userBoostAvaliableToClaimTotalNew0 + userBoostAvaliableToClaimTotalNew1)
466+ let userBoostClaimedKEY = keyUserBoostClaimed(userNumStr)
467+ let userBoostClaimed = ioz(this, userBoostClaimedKEY)
468+ let userBoostAvailable = (userBoostAvaliableToClaimTotalNew - userBoostClaimed)
469+ let dataState = [IntegerEntry(userLpBoostEmissionLastIntegralKEY, boostEmissionIntegral)]
470+ 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)], ":")
471+ $Tuple3(userBoostAvaliableToClaimTotalNew, dataState, debug)
472+ }
508473 }
509474 }
510475
511476
512477 func lockActions (i,duration) = {
513478 let cfgArray = readConfigArrayOrFail()
514479 let assetIdStr = cfgArray[IdxCfgAssetId]
515480 let assetId = fromBase58String(assetIdStr)
516481 let minLockAmount = parseIntValue(cfgArray[IdxCfgMinLockAmount])
517482 let minLockDuration = parseIntValue(cfgArray[IdxCfgMinLockDuration])
518483 let maxLockDuration = parseIntValue(cfgArray[IdxCfgMaxLockDuration])
519484 if ((size(i.payments) != 1))
520485 then throw("invalid payment - exact one payment must be attached")
521486 else {
522487 let pmt = i.payments[0]
523488 let pmtAmount = pmt.amount
524489 if ((assetId != value(pmt.assetId)))
525490 then throw((("invalid asset is in payment - " + assetIdStr) + " is expected"))
526491 else {
527492 let nextUserNumKEY = keyNextUserNum()
528493 let userAddressStr = toString(i.caller)
529494 let userIsExisting = isDefined(getString(keyUser2NumMapping(userAddressStr)))
530495 let userNumStr = if (userIsExisting)
531496 then value(getString(keyUser2NumMapping(userAddressStr)))
532497 else toString(iof(this, nextUserNumKEY))
533498 let userNum = parseIntValue(userNumStr)
534499 let lockStart = height
535500 let startBlockKEY = keyLockParamStartBlock(userNumStr)
536501 let durationKEY = keyLockParamDuration(userNumStr)
537502 let userAmountKEY = keyLockParamUserAmount(userNumStr)
538503 if ((minLockAmount > pmtAmount))
539504 then throw(("amount is less then minLockAmount=" + toString(minLockAmount)))
540505 else if ((minLockDuration > duration))
541506 then throw(("passed duration is less then minLockDuration=" + toString(minLockDuration)))
542507 else if ((duration > maxLockDuration))
543508 then throw(("passed duration is greater then maxLockDuration=" + toString(maxLockDuration)))
544509 else if (if (userIsExisting)
545510 then ((iof(this, startBlockKEY) + iof(this, durationKEY)) >= lockStart)
546511 else false)
547512 then throw("there is an active lock - consider to use increaseLock")
548513 else if ((ioz(this, userAmountKEY) > 0))
549514 then throw(("there are locked WXs - consider to use increaseLock " + userAmountKEY))
550515 else {
551516 let coeffX8 = fraction(duration, MULT8, maxLockDuration)
552517 let gWxAmountStart = fraction(pmtAmount, coeffX8, MULT8)
553518 let gWxParamsResultList = aal(invoke(mathContract, "calcGwxParamsREADONLY", [gWxAmountStart, lockStart, duration], nil))
554519 let k = ai(gWxParamsResultList[0])
555520 let b = ai(gWxParamsResultList[1])
556521 let period = toString(ai(gWxParamsResultList[2]))
557522 let wxEmissionPerBlock = iof(emissionContract, keyEmissionRatePerBlockCurrent())
558523 let emissionStart = iof(emissionContract, keyEmissionStartBlock())
559524 let emissionEnd = iof(emissionContract, keyEmissionEndBlock())
560525 let h = if ((height > emissionEnd))
561526 then emissionEnd
562527 else height
563528 let dh = max([(h - emissionStart), 0])
564529 let userBoostEmissionLastIntegralKEY = keyUserBoostEmissionLastINTEGRAL(userNumStr)
565530 let boostEmissionIntegral = (((wxEmissionPerBlock * dh) * 2) / 3)
566531 let userMaxBoostIntegralKEY = keyUserMaxBoostINTEGRAL(userNumStr)
567532 let totalMaxBoostIntegralKEY = keyTotalMaxBoostINTEGRAL()
568533 let userMaxBoostInt = ((gWxAmountStart * duration) / 2)
569534 let totalMaxBoostInt = ioz(this, totalMaxBoostIntegralKEY)
570535 let totalCachedGwxRaw = getTotalCachedGwx(false)
571536 let arr = if (userIsExisting)
572537 then nil
573538 else [IntegerEntry(nextUserNumKEY, (userNum + 1)), StringEntry(keyUser2NumMapping(userAddressStr), userNumStr), StringEntry(keyNum2UserMapping(userNumStr), userAddressStr)]
574539 $Tuple2(((((arr ++ LockParamsEntry(userAddressStr, userNumStr, pmtAmount, lockStart, duration, k, b, period)) ++ StatsEntry(pmtAmount, duration, 1, if (userIsExisting)
575540 then 0
576541 else 1)) :+ HistoryEntry("lock", userAddressStr, pmtAmount, lockStart, duration, k, b, i)) ++ [IntegerEntry(userBoostEmissionLastIntegralKEY, boostEmissionIntegral), IntegerEntry(keyTotalCachedGwx(), (totalCachedGwxRaw + gWxAmountStart))]), gWxAmountStart)
577542 }
578543 }
579544 }
580545 }
581546
582547
583548 @Callable(i)
584549 func constructor (factoryAddressStr,lockAssetIdStr,minLockAmount,minDuration,maxDuration,mathContract) = {
585550 let checkCaller = mustManager(i)
586551 if ((checkCaller == checkCaller))
587552 then ([IntegerEntry(keyNextUserNum(), 0), StringEntry(keyConfig(), formatConfig(lockAssetIdStr, minLockAmount, minDuration, maxDuration, mathContract)), StringEntry(keyFactoryAddress(), factoryAddressStr)] ++ StatsEntry(0, 0, 0, 0))
588553 else throw("Strict value is not equal to itself.")
589554 }
590555
591556
592557
593558 @Callable(i)
594559 func lockRef (duration,referrerAddress,signature) = {
595- let $t02420824273 = lockActions(i, duration)
596- let lockActionsResult = $t02420824273._1
597- let gWxAmountStart = $t02420824273._2
560+ let $t02389223957 = lockActions(i, duration)
561+ let lockActionsResult = $t02389223957._1
562+ let gWxAmountStart = $t02389223957._2
598563 let referralAddress = toString(i.caller)
599564 let refInv = if (if ((referrerAddress == ""))
600565 then true
601566 else (signature == base58''))
602567 then unit
603568 else invoke(referralsContractAddressOrFail, "createPair", [referralProgramName, referrerAddress, referralAddress, signature], nil)
604569 if ((refInv == refInv))
605570 then {
606571 let updateRefActivity = invoke(mathContract, "updateReferralActivity", [toString(i.caller), gWxAmountStart], nil)
607572 if ((updateRefActivity == updateRefActivity))
608573 then $Tuple2(lockActionsResult, unit)
609574 else throw("Strict value is not equal to itself.")
610575 }
611576 else throw("Strict value is not equal to itself.")
612577 }
613578
614579
615580
616581 @Callable(i)
617582 func lock (duration) = {
618- let $t02473124796 = lockActions(i, duration)
619- let lockActionsResult = $t02473124796._1
620- let gWxAmountStart = $t02473124796._2
583+ let $t02441524480 = lockActions(i, duration)
584+ let lockActionsResult = $t02441524480._1
585+ let gWxAmountStart = $t02441524480._2
621586 let updateRefActivity = invoke(mathContract, "updateReferralActivity", [toString(i.caller), gWxAmountStart], nil)
622587 if ((updateRefActivity == updateRefActivity))
623588 then $Tuple2(lockActionsResult, unit)
624589 else throw("Strict value is not equal to itself.")
625590 }
626591
627592
628593
629594 @Callable(i)
630595 func increaseLock (deltaDuration) = {
631596 let cfgArray = readConfigArrayOrFail()
632597 let assetIdStr = cfgArray[IdxCfgAssetId]
633598 let assetId = fromBase58String(assetIdStr)
634599 let minLockDuration = parseIntValue(cfgArray[IdxCfgMinLockDuration])
635600 let maxLockDuration = parseIntValue(cfgArray[IdxCfgMaxLockDuration])
636601 let pmtAmount = extractOptionalPaymentAmountOrFail(i, assetId)
637602 let userAddressStr = toString(i.caller)
638603 let userRecordArray = readLockParamsRecordOrFail(userAddressStr)
639604 let userNumStr = userRecordArray[IdxLockUserNum]
640605 let userAmount = parseIntValue(userRecordArray[IdxLockAmount])
641606 let lockStart = parseIntValue(userRecordArray[IdxLockStart])
642607 let lockDuration = parseIntValue(userRecordArray[IdxLockDuration])
643608 let lockEnd = (lockStart + lockDuration)
644609 let remainingDuration = max([(lockEnd - height), 0])
645610 let userAmountNew = (userAmount + pmtAmount)
646611 let lockDurationNew = (remainingDuration + deltaDuration)
647612 if ((0 > deltaDuration))
648613 then throw("duration is less then zero")
649614 else if ((minLockDuration > lockDurationNew))
650615 then throw(("lockDurationNew is less then minLockDuration=" + toString(minLockDuration)))
651616 else if ((lockDurationNew > maxLockDuration))
652617 then throw(("deltaDuration + existedLockDuration is greater then maxLockDuration=" + toString(maxLockDuration)))
653618 else {
654619 let coeffX8 = fraction(lockDurationNew, MULT8, maxLockDuration)
655620 let gWxAmountStart = fraction(userAmountNew, coeffX8, MULT8)
656621 let updateRefActivity = invoke(mathContract, "updateReferralActivity", [toString(i.caller), gWxAmountStart], nil)
657622 if ((updateRefActivity == updateRefActivity))
658623 then {
659624 let lockStartNew = height
660625 let gWxParamsResultList = aal(invoke(mathContract, "calcGwxParamsREADONLY", [gWxAmountStart, lockStartNew, lockDurationNew], nil))
661626 let k = ai(gWxParamsResultList[0])
662627 let b = ai(gWxParamsResultList[1])
663628 let period = toString(ai(gWxParamsResultList[2]))
664629 let wxEmissionPerBlock = iof(emissionContract, keyEmissionRatePerBlockCurrent())
665630 let emissionStart = iof(emissionContract, keyEmissionStartBlock())
666631 let emissionEnd = iof(emissionContract, keyEmissionEndBlock())
667632 let h = if ((height > emissionEnd))
668633 then emissionEnd
669634 else height
670635 let dh = max([(h - emissionStart), 0])
671636 let userBoostEmissionLastIntegralKEY = keyUserBoostEmissionLastINTEGRAL(userNumStr)
672637 let userBoostEmissionLastIntegral = ioz(this, userBoostEmissionLastIntegralKEY)
673638 let boostEmissionIntegral = (((wxEmissionPerBlock * dh) * 2) / 3)
674639 let userBoostEmissionIntegral = (boostEmissionIntegral - userBoostEmissionLastIntegral)
675640 if ((0 > userBoostEmissionIntegral))
676641 then throw("wrong calculations")
677642 else {
678643 let userMaxBoostIntegralKEY = keyUserMaxBoostINTEGRAL(userNumStr)
679644 let totalMaxBoostIntegralKEY = keyTotalMaxBoostINTEGRAL()
680645 let userMaxBoostInt = ioz(this, userMaxBoostIntegralKEY)
681646 let totalMaxBoostInt = ioz(this, totalMaxBoostIntegralKEY)
682647 let currUserGwx = calcCurrentGwxAmount(userAddressStr)
683648 let gwxDiff = (gWxAmountStart - currUserGwx)
684649 if ((0 > gwxDiff))
685650 then throw(("gwxDiff is less then 0: " + toString(gwxDiff)))
686651 else {
687652 let totalCachedGwxRaw = getTotalCachedGwx(false)
688653 let totalCachedGwxCorrected = getTotalCachedGwx(true)
689654 let userBoostAvalaibleToClaimTotalKEY = keyUserBoostAvalaibleToClaimTotal(userNumStr)
690655 let userBoostAvaliableToClaimTotal = ioz(this, userBoostAvalaibleToClaimTotalKEY)
691656 let userBoostAvaliableToClaimTotalNew = fraction(userBoostEmissionIntegral, currUserGwx, totalCachedGwxCorrected)
692657 let userMaxBoostIntNew = ((gWxAmountStart * lockDurationNew) / 2)
693658 let remainingUserMaxBoostInt = ((currUserGwx * remainingDuration) / 2)
694659 let userMaxBoostIntDiff = (userMaxBoostIntNew - remainingUserMaxBoostInt)
695660 (((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))])
696661 }
697662 }
698663 }
699664 else throw("Strict value is not equal to itself.")
700665 }
701666 }
702667
703668
704669
705670 @Callable(i)
706671 func claimWxBoost (lpAssetIdStr,userAddressStr) = if ((stakingContract != i.caller))
707672 then throw("permissions denied")
708673 else {
709- let $t02977729879 = internalClaimWxBoost(lpAssetIdStr, userAddressStr, false)
710- let userBoostAvailable = $t02977729879._1
711- let dataState = $t02977729879._2
712- let debug = $t02977729879._3
674+ let $t02946129563 = internalClaimWxBoost(lpAssetIdStr, userAddressStr, false)
675+ let userBoostAvailable = $t02946129563._1
676+ let dataState = $t02946129563._2
677+ let debug = $t02946129563._3
713678 $Tuple2(dataState, [userBoostAvailable])
714679 }
715680
716681
717682
718683 @Callable(i)
719684 func claimWxBoostREADONLY (lpAssetIdStr,userAddressStr) = {
720- let $t03001130112 = internalClaimWxBoost(lpAssetIdStr, userAddressStr, true)
721- let userBoostAvailable = $t03001130112._1
722- let dataState = $t03001130112._2
723- let debug = $t03001130112._3
685+ let $t02969529796 = internalClaimWxBoost(lpAssetIdStr, userAddressStr, true)
686+ let userBoostAvailable = $t02969529796._1
687+ let dataState = $t02969529796._2
688+ let debug = $t02969529796._3
724689 $Tuple2(nil, [userBoostAvailable, debug])
725690 }
726691
727692
728693
729694 @Callable(i)
730695 func unlock (userAddress) = {
731696 let userRecordArray = readLockParamsRecordOrFail(userAddress)
732697 let userNumStr = userRecordArray[IdxLockUserNum]
733698 let userAmount = parseIntValue(userRecordArray[IdxLockAmount])
734699 let lockStart = parseIntValue(userRecordArray[IdxLockStart])
735700 let lockDuration = parseIntValue(userRecordArray[IdxLockDuration])
736701 let lockEnd = (lockStart + lockDuration)
737702 let cfgArray = readConfigArrayOrFail()
738703 let assetId = fromBase58String(cfgArray[IdxCfgAssetId])
739704 if ((lockEnd >= height))
740705 then throw((("wait " + toString(lockEnd)) + " to unlock"))
741706 else if ((0 >= userAmount))
742707 then throw("nothing to unlock")
743708 else {
744709 let period = valueOrElse(getInteger(mathContract, keyNextPeriod()), 0)
745710 (((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))
746711 }
747712 }
748713
749714
750715
751716 @Callable(i)
752717 func gwxUserInfoREADONLY (userAddress) = {
753718 let gwxAmount = calcCurrentGwxAmount(userAddress)
754719 $Tuple2(nil, [gwxAmount])
755720 }
756721
757722
758723
759724 @Callable(i)
760725 func getUserGwxAmountAtHeightREADONLY (userAddress,targetHeight) = {
761726 let gwxAmount = calcUserGwxAmountAtHeight(userAddress, targetHeight)
762727 $Tuple2(nil, gwxAmount)
763728 }
764729
765730
766731
767732 @Callable(i)
768733 func getTotalCachedGwxREADONLY () = $Tuple2(nil, getTotalCachedGwx(true))
769734
770735
771736
772737 @Callable(i)
773738 func setManager (pendingManagerPublicKey) = {
774739 let checkCaller = mustManager(i)
775740 if ((checkCaller == checkCaller))
776741 then {
777742 let checkManagerPublicKey = fromBase58String(pendingManagerPublicKey)
778743 if ((checkManagerPublicKey == checkManagerPublicKey))
779744 then [StringEntry(keyPendingManagerPublicKey(), pendingManagerPublicKey)]
780745 else throw("Strict value is not equal to itself.")
781746 }
782747 else throw("Strict value is not equal to itself.")
783748 }
784749
785750
786751
787752 @Callable(i)
788753 func confirmManager () = {
789754 let pm = pendingManagerPublicKeyOrUnit()
790755 let hasPM = if (isDefined(pm))
791756 then true
792757 else throw("No pending manager")
793758 if ((hasPM == hasPM))
794759 then {
795760 let checkPM = if ((i.callerPublicKey == value(pm)))
796761 then true
797762 else throw("You are not pending manager")
798763 if ((checkPM == checkPM))
799764 then [StringEntry(keyManagerPublicKey(), toBase58String(value(pm))), DeleteEntry(keyPendingManagerPublicKey())]
800765 else throw("Strict value is not equal to itself.")
801766 }
802767 else throw("Strict value is not equal to itself.")
803768 }
804769
805770
806771 @Verifier(tx)
807772 func verify () = {
808773 let targetPublicKey = match managerPublicKeyOrUnit() {
809774 case pk: ByteVector =>
810775 pk
811776 case _: Unit =>
812777 tx.senderPublicKey
813778 case _ =>
814779 throw("Match error")
815780 }
816781 sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey)
817782 }
818783

github/deemru/w8io/026f985 
108.36 ms