tx · D69Z5DoJ8y2c7My6s56dB7LJoKKvSwqd1SW8kvjhttMP

3Myn55vLkduxbX3ZXfiDCZhaQsLxYp1kmCy:  -0.02600000 Waves

2023.08.17 15:36 [2714599] smart account 3Myn55vLkduxbX3ZXfiDCZhaQsLxYp1kmCy > SELF 0.00000000 Waves

{ "type": 13, "id": "D69Z5DoJ8y2c7My6s56dB7LJoKKvSwqd1SW8kvjhttMP", "fee": 2600000, "feeAssetId": null, "timestamp": 1692275794797, "version": 2, "chainId": 84, "sender": "3Myn55vLkduxbX3ZXfiDCZhaQsLxYp1kmCy", "senderPublicKey": "9W33iCCNfmFxUbiC6XZcH5x7f6xfwC7Jb3BoExT5q2PV", "proofs": [ "nsSVJkhSjHoWeN4xLGqRU9fmT871jtdwYbTHj3L6PGfzjyz2xvacpYV3nxqRd3dAEmJAbhrXVUyw3TrLRFrrZ3c" ], "script": "base64:BgLOLQgCEggKBggIAQEBCBIFCgMBCAISAwoBARIECgIICBIECgIICBIDCgEIEgMKAQgSAwoBCBIECgIIARIDCgEIEgASABIFCgMICAQSAwoBCBIDCgEIEgQKAggIEgQKAggIIgNTRVAiBlNDQUxFOCIFTVVMVDgiDlBPT0xXRUlHSFRNVUxUIhBjb250cmFjdEZpbGVuYW1lIgdTQ0FMRTE4IgZNVUxUMTgiCE1VTFQxOEJJIhVkdXJhdGlvbk1vbnRoc0FsbG93ZWQiC2Jsb2Nrc0luRGF5Ig1ibG9ja3NJbk1vbnRoIgd3cmFwRXJyIgNtc2ciCHRocm93RXJyIg9nZXRTdHJpbmdPckZhaWwiB2FkZHJlc3MiA2tleSIMZ2V0SW50T3JaZXJvIg9nZXRJbnRPckRlZmF1bHQiCmRlZmF1bHRWYWwiDGdldEludE9yRmFpbCIDYWJzIgN2YWwiDmVuc3VyZVBvc2l0aXZlIgF2IgFtIhtrZXlSZWZlcnJhbHNDb250cmFjdEFkZHJlc3MiHnJlZmVycmFsc0NvbnRyYWN0QWRkcmVzc09yRmFpbCIWa2V5Um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m75DfPFJ Next: 8V5e94f3BXehXoSGxsoV19bexL11apYUvkq9KWNTzFSQ Diff:
OldNewDifferences
430430
431431
432432 func getVotingEmissionEpochInfo () = {
433- let $t01505115341 = {
433+ let $t01505615346 = {
434434 let currentEpochUi = value(getInteger(votingEmissionContract, keyCurrentEpochUi()))
435435 let lastFinalizedEpoch = (currentEpochUi - 1)
436436 if ((0 > lastFinalizedEpoch))
437437 then throwErr("invalid epoch")
438438 else $Tuple2(currentEpochUi, lastFinalizedEpoch)
439439 }
440- let currentEpochUi = $t01505115341._1
441- let lastFinalizedEpoch = $t01505115341._2
440+ let currentEpochUi = $t01505615346._1
441+ let lastFinalizedEpoch = $t01505615346._2
442442 let currentEpochStartHeight = value(getInteger(votingEmissionContract, keyStartHeightByEpoch(currentEpochUi)))
443443 $Tuple2(lastFinalizedEpoch, currentEpochStartHeight)
444444 }
471471
472472 func getUserVoteFinalized (lpAssetIdStr,userAddressStr) = {
473473 let userAddress = addressFromStringValue(userAddressStr)
474- let $t01603216112 = getVotingEmissionEpochInfo()
475- let lastFinalizedEpoch = $t01603216112._1
476- let currentEpochStartHeight = $t01603216112._2
477- let $t01611516190 = getPoolAssetsByLpAssetId(lpAssetIdStr)
478- let amountAssetId = $t01611516190._1
479- let priceAssetId = $t01611516190._2
474+ let $t01603716117 = getVotingEmissionEpochInfo()
475+ let lastFinalizedEpoch = $t01603716117._1
476+ let currentEpochStartHeight = $t01603716117._2
477+ let $t01612016195 = getPoolAssetsByLpAssetId(lpAssetIdStr)
478+ let amountAssetId = $t01612016195._1
479+ let priceAssetId = $t01612016195._2
480480 let userVoteKey = keyVote(amountAssetId, priceAssetId, userAddress, lastFinalizedEpoch)
481481 let userVote = valueOrElse(getInteger(votingEmissionContract, userVoteKey), 0)
482482 userVote
493493
494494
495495 func getVotingResultStaked (lpAssetIdStr) = {
496- let $t01673416814 = getVotingEmissionEpochInfo()
497- let lastFinalizedEpoch = $t01673416814._1
498- let currentEpochStartHeight = $t01673416814._2
496+ let $t01673916819 = getVotingEmissionEpochInfo()
497+ let lastFinalizedEpoch = $t01673916819._1
498+ let currentEpochStartHeight = $t01673916819._2
499499 let votingResultStakedStart = valueOrElse(getInteger(votingEmissionContract, keyVotingResultStaked(lpAssetIdStr, lastFinalizedEpoch)), 0)
500500 let votingResultStaked = valueOrElse(getInteger(this, keyVotingResultStaked(lpAssetIdStr, lastFinalizedEpoch)), votingResultStakedStart)
501501 votingResultStaked
503503
504504
505505 func getVotingResultStakedIntegral (lpAssetIdStr) = {
506- let $t01717617256 = getVotingEmissionEpochInfo()
507- let lastFinalizedEpoch = $t01717617256._1
508- let currentEpochStartHeight = $t01717617256._2
506+ let $t01718117261 = getVotingEmissionEpochInfo()
507+ let lastFinalizedEpoch = $t01718117261._1
508+ let currentEpochStartHeight = $t01718117261._2
509509 let votingResultStaked = getVotingResultStaked(lpAssetIdStr)
510510 let votingResultStakedIntegralPrev = valueOrElse(getInteger(this, keyVotingResultStakedIntegral(lpAssetIdStr, lastFinalizedEpoch)), 0)
511511 let votingResultStakedLastUpdateHeight = valueOrElse(getInteger(this, keyVotingResultStakedLastUpdateHeight(lpAssetIdStr, lastFinalizedEpoch)), currentEpochStartHeight)
516516
517517
518518 func refreshVotingResultStakedIntegral (lpAssetIdStr,stakedVoteDelta) = {
519- let $t01809318173 = getVotingEmissionEpochInfo()
520- let lastFinalizedEpoch = $t01809318173._1
521- let currentEpochStartHeight = $t01809318173._2
519+ let $t01809818178 = getVotingEmissionEpochInfo()
520+ let lastFinalizedEpoch = $t01809818178._1
521+ let currentEpochStartHeight = $t01809818178._2
522522 let votingResultStaked = getVotingResultStaked(lpAssetIdStr)
523523 let votingResultStakedNew = (votingResultStaked + stakedVoteDelta)
524524 let votingResultStakedIntegral = getVotingResultStakedIntegral(lpAssetIdStr)
527527
528528
529529 func getUserVoteStakedIntegral (lpAssetIdStr,userAddressStr) = {
530- let $t01878418864 = getVotingEmissionEpochInfo()
531- let lastFinalizedEpoch = $t01878418864._1
532- let currentEpochStartHeight = $t01878418864._2
530+ let $t01878918869 = getVotingEmissionEpochInfo()
531+ let lastFinalizedEpoch = $t01878918869._1
532+ let currentEpochStartHeight = $t01878918869._2
533533 let userAddress = addressFromStringValue(userAddressStr)
534534 let userVoteStaked = getUserVoteStaked(lpAssetIdStr, userAddressStr)
535535 let userVoteStakedIntegralPrev = valueOrElse(getInteger(this, keyVoteStakedIntegral(lpAssetIdStr, userAddress, lastFinalizedEpoch)), 0)
541541
542542
543543 func refreshVoteStakedIntegral (lpAssetIdStr,userAddressStr,edge) = {
544- let $t01965219732 = getVotingEmissionEpochInfo()
545- let lastFinalizedEpoch = $t01965219732._1
546- let currentEpochStartHeight = $t01965219732._2
544+ let $t01965719737 = getVotingEmissionEpochInfo()
545+ let lastFinalizedEpoch = $t01965719737._1
546+ let currentEpochStartHeight = $t01965719737._2
547547 let userAddress = addressFromStringValue(userAddressStr)
548548 let userVoteFinalized = getUserVoteFinalized(lpAssetIdStr, userAddressStr)
549549 let actions = if ((userVoteFinalized == 0))
562562
563563
564564 func getStakedVotesIntegralsDiff (lpAssetIdStr,userAddressStr) = {
565- let $t02058620666 = getVotingEmissionEpochInfo()
566- let lastFinalizedEpoch = $t02058620666._1
567- let currentEpochStartHeight = $t02058620666._2
565+ let $t02059120671 = getVotingEmissionEpochInfo()
566+ let lastFinalizedEpoch = $t02059120671._1
567+ let currentEpochStartHeight = $t02059120671._2
568568 let userAddress = addressFromStringValue(userAddressStr)
569569 let userVoteStakedIntegralLastKey = keyVoteStakedIntegralLast(lpAssetIdStr, userAddress, lastFinalizedEpoch)
570570 let userVoteStakedIntegralLast = valueOrElse(getInteger(this, userVoteStakedIntegralLastKey), 0)
623623 if ((0 > userBoostEmissionIntegral))
624624 then throwErr("wrong calculations")
625625 else {
626- let $t02420824347 = getStakedVotesIntegralsDiff(lpAssetIdStr, userAddressStr)
627- let stakedVotesIntegralsActions = $t02420824347._1
628- let userVoteIntegralDiff = $t02420824347._2
629- let totalVotesIntegralDiff = $t02420824347._3
626+ let $t02421324352 = getStakedVotesIntegralsDiff(lpAssetIdStr, userAddressStr)
627+ let stakedVotesIntegralsActions = $t02421324352._1
628+ let userVoteIntegralDiff = $t02421324352._2
629+ let totalVotesIntegralDiff = $t02421324352._3
630630 let poolUserBoostEmissionIntegral = fraction(userBoostEmissionIntegral, poolWeight, POOLWEIGHTMULT)
631631 let userBoostAvaliableToClaimTotalNew = if ((totalVotesIntegralDiff == 0))
632632 then 0
721721
722722 @Callable(i)
723723 func lockRef (duration,referrerAddress,signature) = {
724- let $t02915529220 = lockActions(i, duration)
725- let lockActionsResult = $t02915529220._1
726- let gWxAmountStart = $t02915529220._2
724+ let $t02916029225 = lockActions(i, duration)
725+ let lockActionsResult = $t02916029225._1
726+ let gWxAmountStart = $t02916029225._2
727727 let referralAddress = toString(i.caller)
728728 let refInv = if (if ((referrerAddress == ""))
729729 then true
744744
745745 @Callable(i)
746746 func lock (duration) = {
747- let $t02967829743 = lockActions(i, duration)
748- let lockActionsResult = $t02967829743._1
749- let gWxAmountStart = $t02967829743._2
747+ let $t02968329748 = lockActions(i, duration)
748+ let lockActionsResult = $t02968329748._1
749+ let gWxAmountStart = $t02968329748._2
750750 let updateRefActivity = invoke(mathContract, "updateReferralActivity", [toString(i.caller), gWxAmountStart], nil)
751751 if ((updateRefActivity == updateRefActivity))
752752 then $Tuple2(lockActionsResult, unit)
759759 func claimWxBoost (lpAssetIdStr,userAddressStr) = if ((stakingContract != i.caller))
760760 then throwErr("permissions denied")
761761 else {
762- let $t03005330155 = internalClaimWxBoost(lpAssetIdStr, userAddressStr, false)
763- let userBoostAvailable = $t03005330155._1
764- let dataState = $t03005330155._2
765- let debug = $t03005330155._3
762+ let $t03005830160 = internalClaimWxBoost(lpAssetIdStr, userAddressStr, false)
763+ let userBoostAvailable = $t03005830160._1
764+ let dataState = $t03005830160._2
765+ let debug = $t03005830160._3
766766 $Tuple2(dataState, [userBoostAvailable])
767767 }
768768
770770
771771 @Callable(i)
772772 func claimWxBoostREADONLY (lpAssetIdStr,userAddressStr) = {
773- let $t03028730388 = internalClaimWxBoost(lpAssetIdStr, userAddressStr, true)
774- let userBoostAvailable = $t03028730388._1
775- let dataState = $t03028730388._2
776- let debug = $t03028730388._3
773+ let $t03029230393 = internalClaimWxBoost(lpAssetIdStr, userAddressStr, true)
774+ let userBoostAvailable = $t03029230393._1
775+ let dataState = $t03029230393._2
776+ let debug = $t03029230393._3
777777 $Tuple2(nil, [userBoostAvailable, debug])
778778 }
779779
783783 func unlock (txIdStr) = {
784784 let userAddress = i.caller
785785 let userAddressStr = toString(userAddress)
786- let txId = fromBase58String(txIdStr)
787- let userRecordArray = readLockParamsRecordOrFail(userAddress, if ((txIdStr == ""))
786+ let txIdOption = if ((txIdStr == ""))
788787 then unit
789- else txId)
788+ else fromBase58String(txIdStr)
789+ let userRecordArray = readLockParamsRecordOrFail(userAddress, txIdOption)
790790 let userAmount = parseIntValue(userRecordArray[IdxLockAmount])
791791 let lockStart = parseIntValue(userRecordArray[IdxLockStart])
792792 let lockDuration = parseIntValue(userRecordArray[IdxLockDuration])
793793 let wxClaimed = parseIntValue(userRecordArray[IdxLockWxClaimed])
794794 let gwxAmount = parseIntValue(userRecordArray[IdxLockGwxAmount])
795795 let t = ((height - lockStart) / blocksInPeriod)
796- let wxWithdrawable = getWxWithdrawable(userAddress, if ((txIdStr == ""))
797- then unit
798- else txId)
796+ let wxWithdrawable = getWxWithdrawable(userAddress, txIdOption)
799797 let gWxAmountStart = fraction(userAmount, lockDuration, maxLockDuration)
800798 let gwxBurned = min([fraction((t * blocksInPeriod), gWxAmountStart, maxLockDuration), gwxAmount])
801799 let gwxRemaining = ensurePositive((gwxAmount - gwxBurned), "gwxRemaining")
812810 let userNum = parseIntValue(valueOrErrorMessage(getString(keyUser2NumMapping(userAddressStr)), wrapErr("invalid user number")))
813811 let gwxRewardInv = reentrantInvoke(gwxRewardContract, "refreshUserReward", [userAddress.bytes, userNum], nil)
814812 if ((gwxRewardInv == gwxRewardInv))
815- then ((((LockParamsEntry(userAddress, txId, userAmount, lockStart, lockDuration, gwxRemaining, (wxClaimed + wxWithdrawable)) ++ StatsEntry(-(wxWithdrawable), 0, 0, 0)) :+ HistoryEntry("unlock", userAddressStr, wxWithdrawable, lockStart, lockDuration, gwxBurned, i)) :+ ScriptTransfer(userAddress, wxWithdrawable, assetId)) ++ [IntegerEntry(keyGwxTotal(), ensurePositive((gwxAmountTotal - gwxBurned), "gwxTotal")), IntegerEntry(keyUserGwxAmountTotal(userAddress), userGwxAmountTotalNew)])
813+ then ((((LockParamsEntry(userAddress, txIdOption, userAmount, lockStart, lockDuration, gwxRemaining, (wxClaimed + wxWithdrawable)) ++ StatsEntry(-(wxWithdrawable), 0, 0, 0)) :+ HistoryEntry("unlock", userAddressStr, wxWithdrawable, lockStart, lockDuration, gwxBurned, i)) :+ ScriptTransfer(userAddress, wxWithdrawable, assetId)) ++ [IntegerEntry(keyGwxTotal(), ensurePositive((gwxAmountTotal - gwxBurned), "gwxTotal")), IntegerEntry(keyUserGwxAmountTotal(userAddress), userGwxAmountTotalNew)])
816814 else throw("Strict value is not equal to itself.")
817815 }
818816 }
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 let contractFilename = "boosting.ride"
1313
1414 let SCALE18 = 18
1515
1616 let MULT18 = 1000000000000000000
1717
1818 let MULT18BI = toBigInt(MULT18)
1919
2020 let durationMonthsAllowed = [1, 3, 6, 12, 24, 48]
2121
2222 let blocksInDay = 1440
2323
2424 let blocksInMonth = 43800
2525
2626 func wrapErr (msg) = makeString([contractFilename, ": ", msg], "")
2727
2828
2929 func throwErr (msg) = throw(wrapErr(msg))
3030
3131
3232 func getStringOrFail (address,key) = valueOrErrorMessage(getString(address, key), wrapErr((("mandatory this." + key) + " is not defined")))
3333
3434
3535 func getIntOrZero (address,key) = valueOrElse(getInteger(address, key), 0)
3636
3737
3838 func getIntOrDefault (address,key,defaultVal) = valueOrElse(getInteger(address, key), defaultVal)
3939
4040
4141 func getIntOrFail (address,key) = valueOrErrorMessage(getInteger(address, key), wrapErr((("mandatory this." + key) + " is not defined")))
4242
4343
4444 func abs (val) = if ((0 > val))
4545 then -(val)
4646 else val
4747
4848
4949 func ensurePositive (v,m) = if ((v >= 0))
5050 then v
5151 else throwErr((valueOrElse(m, "value") + " should be positive"))
5252
5353
5454 func keyReferralsContractAddress () = makeString(["%s%s", "config", "referralsContractAddress"], SEP)
5555
5656
5757 let referralsContractAddressOrFail = addressFromStringValue(getStringOrFail(this, keyReferralsContractAddress()))
5858
5959 let keyReferralProgramName = makeString(["%s%s", "referral", "programName"], SEP)
6060
6161 let referralProgramNameDefault = "wxlock"
6262
6363 let referralProgramName = valueOrElse(getString(this, keyReferralProgramName), referralProgramNameDefault)
6464
6565 func keyFactoryAddress () = "%s%s__config__factoryAddress"
6666
6767
6868 let IdxFactoryCfgStakingDapp = 1
6969
7070 let IdxFactoryCfgBoostingDapp = 2
7171
7272 let IdxFactoryCfgIdoDapp = 3
7373
7474 let IdxFactoryCfgTeamDapp = 4
7575
7676 let IdxFactoryCfgEmissionDapp = 5
7777
7878 let IdxFactoryCfgRestDapp = 6
7979
8080 let IdxFactoryCfgSlippageDapp = 7
8181
8282 let IdxFactoryCfgDaoDapp = 8
8383
8484 let IdxFactoryCfgMarketingDapp = 9
8585
8686 let IdxFactoryCfgGwxRewardDapp = 10
8787
8888 let IdxFactoryCfgBirdsDapp = 11
8989
9090 func keyFactoryCfg () = "%s__factoryConfig"
9191
9292
9393 func keyFactoryLpAssetToPoolContractAddress (lpAssetStr) = makeString(["%s%s%s", lpAssetStr, "mappings__lpAsset2PoolContract"], SEP)
9494
9595
9696 func keyFactoryPoolWeight (contractAddress) = makeString(["%s%s", "poolWeight", contractAddress], SEP)
9797
9898
9999 func keyFactoryPoolWeightHistory (poolAddress,num) = ((("%s%s__poolWeight__" + poolAddress) + "__") + toString(num))
100100
101101
102102 func readFactoryAddressOrFail () = addressFromStringValue(getStringOrFail(this, keyFactoryAddress()))
103103
104104
105105 func readFactoryCfgOrFail (factory) = split(getStringOrFail(factory, keyFactoryCfg()), SEP)
106106
107107
108108 func getBoostingAddressOrFail (factoryCfg) = addressFromStringValue(factoryCfg[IdxFactoryCfgBoostingDapp])
109109
110110
111111 func getEmissionAddressOrFail (factoryCfg) = addressFromStringValue(factoryCfg[IdxFactoryCfgEmissionDapp])
112112
113113
114114 func getStakingAddressOrFail (factoryCfg) = addressFromStringValue(factoryCfg[IdxFactoryCfgStakingDapp])
115115
116116
117117 func getGwxRewardAddressOrFail (factoryCfg) = addressFromStringValue(factoryCfg[IdxFactoryCfgGwxRewardDapp])
118118
119119
120120 func keyManagerPublicKey () = "%s__managerPublicKey"
121121
122122
123123 func keyManagerVaultAddress () = "%s__managerVaultAddress"
124124
125125
126126 func keyEmissionRatePerBlockCurrent () = "%s%s__ratePerBlock__current"
127127
128128
129129 func keyEmissionRatePerBlockMaxCurrent () = "%s%s__ratePerBlockMax__current"
130130
131131
132132 func keyEmissionStartBlock () = "%s%s__emission__startBlock"
133133
134134
135135 func keyBoostingV2LastUpdateHeight () = "%s%s__boostingV2__startBlock"
136136
137137
138138 func keyBoostingV2Integral () = "%s%s__boostingV2__integral"
139139
140140
141141 func keyEmissionDurationInBlocks () = "%s%s__emission__duration"
142142
143143
144144 func keyEmissionEndBlock () = "%s%s__emission__endBlock"
145145
146146
147147 let IdxCfgAssetId = 1
148148
149149 let IdxCfgMinLockAmount = 2
150150
151151 let IdxCfgMinLockDuration = 3
152152
153153 let IdxCfgMaxLockDuration = 4
154154
155155 let IdxCfgMathContract = 5
156156
157157 let IdxCfgBlocksInPeriod = 6
158158
159159 func keyConfig () = "%s__config"
160160
161161
162162 func readConfigArrayOrFail () = split(getStringOrFail(this, keyConfig()), SEP)
163163
164164
165165 let cfgArray = readConfigArrayOrFail()
166166
167167 let assetId = fromBase58String(cfgArray[IdxCfgAssetId])
168168
169169 let minLockAmount = valueOrErrorMessage(parseInt(cfgArray[IdxCfgMinLockAmount]), wrapErr("invalid min lock amount"))
170170
171171 let minLockDuration = valueOrErrorMessage(parseInt(cfgArray[IdxCfgMinLockDuration]), wrapErr("invalid min lock duration"))
172172
173173 let maxLockDuration = valueOrErrorMessage(parseInt(cfgArray[IdxCfgMaxLockDuration]), wrapErr("invalid max lock duration"))
174174
175175 let mathContract = valueOrErrorMessage(addressFromString(cfgArray[IdxCfgMathContract]), wrapErr("invalid math contract address"))
176176
177177 let blocksInPeriod = valueOrErrorMessage(parseInt(cfgArray[IdxCfgBlocksInPeriod]), wrapErr("invalid blocks in period"))
178178
179179 func formatConfigS (assetId,minLockAmount,minLockDuration,maxLockDuration,mathContract) = makeString(["%s%d%d%d%s", assetId, minLockAmount, minLockDuration, maxLockDuration, mathContract], SEP)
180180
181181
182182 func formatConfig (assetId,minLockAmount,minLockDuration,maxLockDuration,mathContract) = formatConfigS(assetId, toString(minLockAmount), toString(minLockDuration), toString(maxLockDuration), mathContract)
183183
184184
185185 func getManagerVaultAddressOrThis () = match getString(keyManagerVaultAddress()) {
186186 case s: String =>
187187 addressFromStringValue(s)
188188 case _ =>
189189 this
190190 }
191191
192192
193193 func managerPublicKeyOrUnit () = {
194194 let managerVaultAddress = getManagerVaultAddressOrThis()
195195 match getString(managerVaultAddress, keyManagerPublicKey()) {
196196 case s: String =>
197197 fromBase58String(s)
198198 case _: Unit =>
199199 unit
200200 case _ =>
201201 throw("Match error")
202202 }
203203 }
204204
205205
206206 func mustManager (i) = {
207207 let pd = throwErr("Permission denied")
208208 match managerPublicKeyOrUnit() {
209209 case pk: ByteVector =>
210210 if ((i.callerPublicKey == pk))
211211 then true
212212 else pd
213213 case _: Unit =>
214214 if ((i.caller == this))
215215 then true
216216 else pd
217217 case _ =>
218218 throw("Match error")
219219 }
220220 }
221221
222222
223223 let IdxLockAmount = 1
224224
225225 let IdxLockStart = 2
226226
227227 let IdxLockDuration = 3
228228
229229 let IdxLockLastUpdateTimestamp = 4
230230
231231 let IdxLockGwxAmount = 5
232232
233233 let IdxLockWxClaimed = 6
234234
235235 func keyLockParamsRecord (userAddress,txId) = makeString(["%s%s%s__lock", toString(userAddress), match txId {
236236 case b: ByteVector =>
237237 toBase58String(b)
238238 case _: Unit =>
239239 "legacy"
240240 case _ =>
241241 throw("Match error")
242242 }], SEP)
243243
244244
245245 func readLockParamsRecordOrFail (userAddress,txId) = split(getStringOrFail(this, keyLockParamsRecord(userAddress, txId)), SEP)
246246
247247
248248 func keyUserGwxAmountTotal (userAddress) = makeString(["%s%s__gwxAmountTotal", toString(userAddress)], SEP)
249249
250250
251251 func formatLockParamsRecord (amount,start,duration,gwxAmount,wxClaimed) = makeString(["%d%d%d%d%d%d", toString(amount), toString(start), toString(duration), toString(lastBlock.timestamp), toString(gwxAmount), toString(wxClaimed)], SEP)
252252
253253
254254 func keyNextUserNum () = "%s__nextUserNum"
255255
256256
257257 func keyUser2NumMapping (userAddress) = makeString(["%s%s%s__mapping__user2num", userAddress], SEP)
258258
259259
260260 func keyNum2UserMapping (num) = makeString(["%s%s%s__mapping__num2user", num], SEP)
261261
262262
263263 func keyLockParamTotalAmount () = "%s%s__stats__activeTotalLocked"
264264
265265
266266 func keyStatsLocksDurationSumInBlocks () = "%s%s__stats__locksDurationSumInBlocks"
267267
268268
269269 func keyStatsLocksCount () = "%s%s__stats__locksCount"
270270
271271
272272 func keyStatsUsersCount () = "%s%s__stats__activeUsersCount"
273273
274274
275275 func keyUserBoostEmissionLastINTEGRAL (userNum) = makeString(["%s%d__userBoostEmissionLastIntV2", toString(userNum)], SEP)
276276
277277
278278 func keyUserLpBoostEmissionLastINTEGRAL (userNum,lpAssetId) = makeString(["%s%d__userBoostEmissionLastIntV2", toString(userNum), lpAssetId], SEP)
279279
280280
281281 func keyUserMaxBoostINTEGRAL (userNum) = makeString(["%s%d__maxBoostInt", toString(userNum)], SEP)
282282
283283
284284 func keyTotalMaxBoostINTEGRAL () = "%s%s__maxBoostInt__total"
285285
286286
287287 func keyUserBoostAvalaibleToClaimTotal (userNum) = makeString(["%s%d__userBoostAvaliableToClaimTotal", toString(userNum)], SEP)
288288
289289
290290 func keyUserBoostClaimed (userNum) = makeString(["%s%d__userBoostClaimed", toString(userNum)], SEP)
291291
292292
293293 func keyGwxTotal () = "%s%s__gwx__total"
294294
295295
296296 func keyVote (amountAssetId,priceAssetId,address,epoch) = makeString(["%s%s%s%s%d", "vote", amountAssetId, priceAssetId, toString(address), toString(epoch)], SEP)
297297
298298
299299 func keyStartHeightByEpoch (epoch) = makeString(["%s%d", "startHeight", toString(epoch)], SEP)
300300
301301
302302 func keyCurrentEpochUi () = makeString(["%s", "currentEpochUi"], SEP)
303303
304304
305305 func keyVotingResultStaked (lpAssetIdStr,epoch) = makeString(["%s%s%d", "votingResultStaked", lpAssetIdStr, toString(epoch)], SEP)
306306
307307
308308 func keyVotingResultStakedIntegral (lpAssetIdStr,epoch) = makeString(["%s%s%d", "votingResultStakedIntegral", lpAssetIdStr, toString(epoch)], SEP)
309309
310310
311311 func keyVotingResultStakedLastUpdateHeight (lpAssetIdStr,epoch) = makeString(["%s%s%d", "votingResultStakedIntegralLastUpdateHeight", lpAssetIdStr, toString(epoch)], SEP)
312312
313313
314314 func keyVotingResultStakedIntegralLast (lpAssetIdStr,address,epoch) = makeString(["%s%s%s%d", "votingResultStakedIntegralLast", lpAssetIdStr, toString(address), toString(epoch)], SEP)
315315
316316
317317 func keyVoteStakedIntegral (lpAssetIdStr,address,epoch) = makeString(["%s%s%s%d", "voteStakedIntegral", lpAssetIdStr, toString(address), toString(epoch)], SEP)
318318
319319
320320 func keyVoteStakedLastUpdateHeight (lpAssetIdStr,address,epoch) = makeString(["%s%s%s%d", "voteStakedIntegralLastUpdateHeight", lpAssetIdStr, toString(address), toString(epoch)], SEP)
321321
322322
323323 func keyVoteStakedIntegralLast (lpAssetIdStr,address,epoch) = makeString(["%s%s%s%d", "voteStakedIntegralLast", lpAssetIdStr, toString(address), toString(epoch)], SEP)
324324
325325
326326 func keyStakedByUser (userAddressStr,lpAssetIdStr) = makeString(["%s%s%s", "staked", userAddressStr, lpAssetIdStr], SEP)
327327
328328
329329 let factoryContract = readFactoryAddressOrFail()
330330
331331 let factoryCfg = readFactoryCfgOrFail(factoryContract)
332332
333333 let emissionContract = getEmissionAddressOrFail(factoryCfg)
334334
335335 let stakingContract = getStakingAddressOrFail(factoryCfg)
336336
337337 let gwxRewardContract = getGwxRewardAddressOrFail(factoryCfg)
338338
339339 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"))
340340
341341 let keyVotingEmissionContract = makeString(["%s", "votingEmissionContract"], SEP)
342342
343343 let votingEmissionContract = addressFromStringValue(getStringValue(factoryContract, keyVotingEmissionContract))
344344
345345 let keyVotingEmissionRateContract = makeString(["%s", "votingEmissionRateContract"], SEP)
346346
347347 let boostCoeff = {
348348 let @ = invoke(emissionContract, "getBoostCoeffREADONLY", nil, nil)
349349 if ($isInstanceOf(@, "Int"))
350350 then @
351351 else throw(($getType(@) + " couldn't be cast to Int"))
352352 }
353353
354354 func userNumberByAddressOrFail (userAddress) = match getString(this, keyUser2NumMapping(toString(userAddress))) {
355355 case s: String =>
356356 valueOrErrorMessage(parseInt(s), wrapErr("invalid user number"))
357357 case _: Unit =>
358358 throwErr("invalid user")
359359 case _ =>
360360 throw("Match error")
361361 }
362362
363363
364364 func getGwxAmountTotal () = valueOrElse(getInteger(this, keyGwxTotal()), 0)
365365
366366
367367 func getLockedGwxAmount (userAddress) = {
368368 let functionName = "getLockedGwxAmount"
369369 let votingEmissionRateContract = valueOrErrorMessage( match getString(votingEmissionContract, keyVotingEmissionRateContract) {
370370 case _: Unit =>
371371 unit
372372 case s: String =>
373373 addressFromString(s)
374374 case _ =>
375375 throw("Match error")
376376 }, wrapErr("invalid voting emission rate address"))
377377 let lockedVotingEmissionRate = {
378378 let @ = invoke(votingEmissionContract, functionName, [toString(userAddress)], nil)
379379 if ($isInstanceOf(@, "Int"))
380380 then @
381381 else throw(($getType(@) + " couldn't be cast to Int"))
382382 }
383383 let lockedVotingEmission = {
384384 let @ = invoke(votingEmissionRateContract, functionName, [toString(userAddress)], nil)
385385 if ($isInstanceOf(@, "Int"))
386386 then @
387387 else throw(($getType(@) + " couldn't be cast to Int"))
388388 }
389389 let locked = max([lockedVotingEmissionRate, lockedVotingEmission])
390390 locked
391391 }
392392
393393
394394 func HistoryEntry (type,user,amount,lockStart,duration,gwxAmount,i) = {
395395 let historyKEY = makeString(["%s%s%s%s__history", type, user, toBase58String(i.transactionId)], SEP)
396396 let historyDATA = makeString(["%d%d%d%d%d%d%d", toString(lastBlock.height), toString(lastBlock.timestamp), toString(amount), toString(lockStart), toString(duration), toString(gwxAmount)], SEP)
397397 StringEntry(historyKEY, historyDATA)
398398 }
399399
400400
401401 func StatsEntry (totalLockedInc,durationInc,lockCountInc,usersCountInc) = {
402402 let locksDurationSumInBlocksKEY = keyStatsLocksDurationSumInBlocks()
403403 let locksCountKEY = keyStatsLocksCount()
404404 let usersCountKEY = keyStatsUsersCount()
405405 let totalAmountKEY = keyLockParamTotalAmount()
406406 let locksDurationSumInBlocks = getIntOrZero(this, locksDurationSumInBlocksKEY)
407407 let locksCount = getIntOrZero(this, locksCountKEY)
408408 let usersCount = getIntOrZero(this, usersCountKEY)
409409 let totalAmount = getIntOrZero(this, totalAmountKEY)
410410 [IntegerEntry(locksDurationSumInBlocksKEY, (locksDurationSumInBlocks + durationInc)), IntegerEntry(locksCountKEY, (locksCount + lockCountInc)), IntegerEntry(usersCountKEY, (usersCount + usersCountInc)), IntegerEntry(totalAmountKEY, (totalAmount + totalLockedInc))]
411411 }
412412
413413
414414 func LockParamsEntry (userAddress,txId,amount,start,duration,gwxAmount,wxClaimed) = [StringEntry(keyLockParamsRecord(userAddress, txId), formatLockParamsRecord(amount, start, duration, gwxAmount, wxClaimed))]
415415
416416
417417 func extractOptionalPaymentAmountOrFail (i,expectedAssetId) = if ((size(i.payments) > 1))
418418 then throwErr("only one payment is allowed")
419419 else if ((size(i.payments) == 0))
420420 then 0
421421 else {
422422 let pmt = i.payments[0]
423423 if ((value(pmt.assetId) != expectedAssetId))
424424 then throwErr("invalid asset id in payment")
425425 else pmt.amount
426426 }
427427
428428
429429 func getUserGwxAmountTotal (userAddress) = valueOrElse(getInteger(this, keyUserGwxAmountTotal(userAddress)), 0)
430430
431431
432432 func getVotingEmissionEpochInfo () = {
433- let $t01505115341 = {
433+ let $t01505615346 = {
434434 let currentEpochUi = value(getInteger(votingEmissionContract, keyCurrentEpochUi()))
435435 let lastFinalizedEpoch = (currentEpochUi - 1)
436436 if ((0 > lastFinalizedEpoch))
437437 then throwErr("invalid epoch")
438438 else $Tuple2(currentEpochUi, lastFinalizedEpoch)
439439 }
440- let currentEpochUi = $t01505115341._1
441- let lastFinalizedEpoch = $t01505115341._2
440+ let currentEpochUi = $t01505615346._1
441+ let lastFinalizedEpoch = $t01505615346._2
442442 let currentEpochStartHeight = value(getInteger(votingEmissionContract, keyStartHeightByEpoch(currentEpochUi)))
443443 $Tuple2(lastFinalizedEpoch, currentEpochStartHeight)
444444 }
445445
446446
447447 func getPoolAssetsByLpAssetId (lpAssetIdStr) = {
448448 let idxAmountAssetId = 4
449449 let idxPriceAssetId = 5
450450 let poolCfg = {
451451 let @ = invoke(factoryContract, "getPoolConfigByLpAssetIdREADONLY", [lpAssetIdStr], nil)
452452 if ($isInstanceOf(@, "List[Any]"))
453453 then @
454454 else throw(($getType(@) + " couldn't be cast to List[Any]"))
455455 }
456456 let amountAssetId = {
457457 let @ = poolCfg[idxAmountAssetId]
458458 if ($isInstanceOf(@, "String"))
459459 then @
460460 else throw(($getType(@) + " couldn't be cast to String"))
461461 }
462462 let priceAssetId = {
463463 let @ = poolCfg[idxPriceAssetId]
464464 if ($isInstanceOf(@, "String"))
465465 then @
466466 else throw(($getType(@) + " couldn't be cast to String"))
467467 }
468468 $Tuple2(amountAssetId, priceAssetId)
469469 }
470470
471471
472472 func getUserVoteFinalized (lpAssetIdStr,userAddressStr) = {
473473 let userAddress = addressFromStringValue(userAddressStr)
474- let $t01603216112 = getVotingEmissionEpochInfo()
475- let lastFinalizedEpoch = $t01603216112._1
476- let currentEpochStartHeight = $t01603216112._2
477- let $t01611516190 = getPoolAssetsByLpAssetId(lpAssetIdStr)
478- let amountAssetId = $t01611516190._1
479- let priceAssetId = $t01611516190._2
474+ let $t01603716117 = getVotingEmissionEpochInfo()
475+ let lastFinalizedEpoch = $t01603716117._1
476+ let currentEpochStartHeight = $t01603716117._2
477+ let $t01612016195 = getPoolAssetsByLpAssetId(lpAssetIdStr)
478+ let amountAssetId = $t01612016195._1
479+ let priceAssetId = $t01612016195._2
480480 let userVoteKey = keyVote(amountAssetId, priceAssetId, userAddress, lastFinalizedEpoch)
481481 let userVote = valueOrElse(getInteger(votingEmissionContract, userVoteKey), 0)
482482 userVote
483483 }
484484
485485
486486 func getUserVoteStaked (lpAssetIdStr,userAddressStr) = {
487487 let stakedByUser = valueOrElse(getInteger(stakingContract, keyStakedByUser(userAddressStr, lpAssetIdStr)), 0)
488488 let userVote = getUserVoteFinalized(lpAssetIdStr, userAddressStr)
489489 if ((stakedByUser == 0))
490490 then 0
491491 else userVote
492492 }
493493
494494
495495 func getVotingResultStaked (lpAssetIdStr) = {
496- let $t01673416814 = getVotingEmissionEpochInfo()
497- let lastFinalizedEpoch = $t01673416814._1
498- let currentEpochStartHeight = $t01673416814._2
496+ let $t01673916819 = getVotingEmissionEpochInfo()
497+ let lastFinalizedEpoch = $t01673916819._1
498+ let currentEpochStartHeight = $t01673916819._2
499499 let votingResultStakedStart = valueOrElse(getInteger(votingEmissionContract, keyVotingResultStaked(lpAssetIdStr, lastFinalizedEpoch)), 0)
500500 let votingResultStaked = valueOrElse(getInteger(this, keyVotingResultStaked(lpAssetIdStr, lastFinalizedEpoch)), votingResultStakedStart)
501501 votingResultStaked
502502 }
503503
504504
505505 func getVotingResultStakedIntegral (lpAssetIdStr) = {
506- let $t01717617256 = getVotingEmissionEpochInfo()
507- let lastFinalizedEpoch = $t01717617256._1
508- let currentEpochStartHeight = $t01717617256._2
506+ let $t01718117261 = getVotingEmissionEpochInfo()
507+ let lastFinalizedEpoch = $t01718117261._1
508+ let currentEpochStartHeight = $t01718117261._2
509509 let votingResultStaked = getVotingResultStaked(lpAssetIdStr)
510510 let votingResultStakedIntegralPrev = valueOrElse(getInteger(this, keyVotingResultStakedIntegral(lpAssetIdStr, lastFinalizedEpoch)), 0)
511511 let votingResultStakedLastUpdateHeight = valueOrElse(getInteger(this, keyVotingResultStakedLastUpdateHeight(lpAssetIdStr, lastFinalizedEpoch)), currentEpochStartHeight)
512512 let votingResultStakedIntegralDh = (height - votingResultStakedLastUpdateHeight)
513513 let votingResultStakedIntegral = ((votingResultStakedIntegralDh * votingResultStaked) + votingResultStakedIntegralPrev)
514514 votingResultStakedIntegral
515515 }
516516
517517
518518 func refreshVotingResultStakedIntegral (lpAssetIdStr,stakedVoteDelta) = {
519- let $t01809318173 = getVotingEmissionEpochInfo()
520- let lastFinalizedEpoch = $t01809318173._1
521- let currentEpochStartHeight = $t01809318173._2
519+ let $t01809818178 = getVotingEmissionEpochInfo()
520+ let lastFinalizedEpoch = $t01809818178._1
521+ let currentEpochStartHeight = $t01809818178._2
522522 let votingResultStaked = getVotingResultStaked(lpAssetIdStr)
523523 let votingResultStakedNew = (votingResultStaked + stakedVoteDelta)
524524 let votingResultStakedIntegral = getVotingResultStakedIntegral(lpAssetIdStr)
525525 [IntegerEntry(keyVotingResultStaked(lpAssetIdStr, lastFinalizedEpoch), votingResultStakedNew), IntegerEntry(keyVotingResultStakedLastUpdateHeight(lpAssetIdStr, lastFinalizedEpoch), height), IntegerEntry(keyVotingResultStakedIntegral(lpAssetIdStr, lastFinalizedEpoch), votingResultStakedIntegral)]
526526 }
527527
528528
529529 func getUserVoteStakedIntegral (lpAssetIdStr,userAddressStr) = {
530- let $t01878418864 = getVotingEmissionEpochInfo()
531- let lastFinalizedEpoch = $t01878418864._1
532- let currentEpochStartHeight = $t01878418864._2
530+ let $t01878918869 = getVotingEmissionEpochInfo()
531+ let lastFinalizedEpoch = $t01878918869._1
532+ let currentEpochStartHeight = $t01878918869._2
533533 let userAddress = addressFromStringValue(userAddressStr)
534534 let userVoteStaked = getUserVoteStaked(lpAssetIdStr, userAddressStr)
535535 let userVoteStakedIntegralPrev = valueOrElse(getInteger(this, keyVoteStakedIntegral(lpAssetIdStr, userAddress, lastFinalizedEpoch)), 0)
536536 let userVoteStakedLastUpdateHeight = valueOrElse(getInteger(this, keyVoteStakedLastUpdateHeight(lpAssetIdStr, userAddress, lastFinalizedEpoch)), currentEpochStartHeight)
537537 let userVoteStakedIntegralDh = (height - userVoteStakedLastUpdateHeight)
538538 let userVoteStakedIntegral = ((userVoteStakedIntegralDh * userVoteStaked) + userVoteStakedIntegralPrev)
539539 userVoteStakedIntegral
540540 }
541541
542542
543543 func refreshVoteStakedIntegral (lpAssetIdStr,userAddressStr,edge) = {
544- let $t01965219732 = getVotingEmissionEpochInfo()
545- let lastFinalizedEpoch = $t01965219732._1
546- let currentEpochStartHeight = $t01965219732._2
544+ let $t01965719737 = getVotingEmissionEpochInfo()
545+ let lastFinalizedEpoch = $t01965719737._1
546+ let currentEpochStartHeight = $t01965719737._2
547547 let userAddress = addressFromStringValue(userAddressStr)
548548 let userVoteFinalized = getUserVoteFinalized(lpAssetIdStr, userAddressStr)
549549 let actions = if ((userVoteFinalized == 0))
550550 then nil
551551 else {
552552 let stakedVoteDelta = if (edge)
553553 then userVoteFinalized
554554 else -(userVoteFinalized)
555555 let votingResultActions = refreshVotingResultStakedIntegral(lpAssetIdStr, stakedVoteDelta)
556556 let userVoteStakedIntegral = getUserVoteStakedIntegral(lpAssetIdStr, userAddressStr)
557557 let voteActions = [IntegerEntry(keyVoteStakedLastUpdateHeight(lpAssetIdStr, userAddress, lastFinalizedEpoch), height), IntegerEntry(keyVoteStakedIntegral(lpAssetIdStr, userAddress, lastFinalizedEpoch), userVoteStakedIntegral)]
558558 (votingResultActions ++ voteActions)
559559 }
560560 actions
561561 }
562562
563563
564564 func getStakedVotesIntegralsDiff (lpAssetIdStr,userAddressStr) = {
565- let $t02058620666 = getVotingEmissionEpochInfo()
566- let lastFinalizedEpoch = $t02058620666._1
567- let currentEpochStartHeight = $t02058620666._2
565+ let $t02059120671 = getVotingEmissionEpochInfo()
566+ let lastFinalizedEpoch = $t02059120671._1
567+ let currentEpochStartHeight = $t02059120671._2
568568 let userAddress = addressFromStringValue(userAddressStr)
569569 let userVoteStakedIntegralLastKey = keyVoteStakedIntegralLast(lpAssetIdStr, userAddress, lastFinalizedEpoch)
570570 let userVoteStakedIntegralLast = valueOrElse(getInteger(this, userVoteStakedIntegralLastKey), 0)
571571 let votingResultStakedIntegralLastKey = keyVotingResultStakedIntegralLast(lpAssetIdStr, userAddress, lastFinalizedEpoch)
572572 let votingResultStakedIntegralLast = valueOrElse(getInteger(this, votingResultStakedIntegralLastKey), 0)
573573 let userVoteStakedIntegral = getUserVoteStakedIntegral(lpAssetIdStr, userAddressStr)
574574 let votingResultStakedIntegral = getVotingResultStakedIntegral(lpAssetIdStr)
575575 let userVoteStakedIntegralDiff = (userVoteStakedIntegral - userVoteStakedIntegralLast)
576576 let votingResultStakedIntegralDiff = (votingResultStakedIntegral - votingResultStakedIntegralLast)
577577 $Tuple3([IntegerEntry(userVoteStakedIntegralLastKey, userVoteStakedIntegral), IntegerEntry(votingResultStakedIntegralLastKey, votingResultStakedIntegral)], userVoteStakedIntegralDiff, votingResultStakedIntegralDiff)
578578 }
579579
580580
581581 func refreshBoostEmissionIntegral () = {
582582 let wxEmissionPerBlock = getIntOrFail(emissionContract, keyEmissionRatePerBlockCurrent())
583583 let boostingV2LastUpdateHeightOption = getInteger(this, keyBoostingV2LastUpdateHeight())
584584 let boostingV2IngergalOption = getInteger(this, keyBoostingV2Integral())
585585 let emissionEnd = getIntOrFail(emissionContract, keyEmissionEndBlock())
586586 let h = if ((height > emissionEnd))
587587 then emissionEnd
588588 else height
589589 let dh = match boostingV2LastUpdateHeightOption {
590590 case lastUpdateHeight: Int =>
591591 max([(h - lastUpdateHeight), 0])
592592 case _: Unit =>
593593 0
594594 case _ =>
595595 throw("Match error")
596596 }
597597 let boostEmissionPerBlock = ((wxEmissionPerBlock * (boostCoeff - 1)) / boostCoeff)
598598 let boostEmissionIntegralPrev = valueOrElse(boostingV2IngergalOption, 0)
599599 let boostEmissionIntegral = ((boostEmissionPerBlock * dh) + boostEmissionIntegralPrev)
600600 $Tuple2([IntegerEntry(keyBoostingV2Integral(), boostEmissionIntegral), IntegerEntry(keyBoostingV2LastUpdateHeight(), height)], boostEmissionIntegral)
601601 }
602602
603603
604604 func internalClaimWxBoost (lpAssetIdStr,userAddressStr,readOnly) = {
605605 let userAddress = valueOrErrorMessage(addressFromString(userAddressStr), wrapErr("invalid user address"))
606606 let userNum = userNumberByAddressOrFail(userAddress)
607607 if ((userNum == userNum))
608608 then {
609609 let EMPTYSTR = "empty"
610610 let poolWeight = if ((lpAssetIdStr != EMPTYSTR))
611611 then {
612612 let poolAddressStr = valueOrErrorMessage(getString(factoryContract, keyFactoryLpAssetToPoolContractAddress(lpAssetIdStr)), wrapErr(("unsupported lp asset " + lpAssetIdStr)))
613613 getIntegerValue(factoryContract, keyFactoryPoolWeight(poolAddressStr))
614614 }
615615 else if (readOnly)
616616 then 0
617617 else throwErr(("not readonly mode: unsupported lp asset " + lpAssetIdStr))
618618 let userLpBoostEmissionLastIntegralKEY = keyUserLpBoostEmissionLastINTEGRAL(userNum, lpAssetIdStr)
619619 let userBoostEmissionLastIntegralKEY = keyUserBoostEmissionLastINTEGRAL(userNum)
620620 let userBoostEmissionLastIntegral = valueOrElse(getInteger(this, userLpBoostEmissionLastIntegralKEY), getIntOrZero(this, userBoostEmissionLastIntegralKEY))
621621 let boostEmissionIntegral = refreshBoostEmissionIntegral()._2
622622 let userBoostEmissionIntegral = (boostEmissionIntegral - userBoostEmissionLastIntegral)
623623 if ((0 > userBoostEmissionIntegral))
624624 then throwErr("wrong calculations")
625625 else {
626- let $t02420824347 = getStakedVotesIntegralsDiff(lpAssetIdStr, userAddressStr)
627- let stakedVotesIntegralsActions = $t02420824347._1
628- let userVoteIntegralDiff = $t02420824347._2
629- let totalVotesIntegralDiff = $t02420824347._3
626+ let $t02421324352 = getStakedVotesIntegralsDiff(lpAssetIdStr, userAddressStr)
627+ let stakedVotesIntegralsActions = $t02421324352._1
628+ let userVoteIntegralDiff = $t02421324352._2
629+ let totalVotesIntegralDiff = $t02421324352._3
630630 let poolUserBoostEmissionIntegral = fraction(userBoostEmissionIntegral, poolWeight, POOLWEIGHTMULT)
631631 let userBoostAvaliableToClaimTotalNew = if ((totalVotesIntegralDiff == 0))
632632 then 0
633633 else fraction(poolUserBoostEmissionIntegral, userVoteIntegralDiff, totalVotesIntegralDiff)
634634 let dataState = ([IntegerEntry(userLpBoostEmissionLastIntegralKEY, boostEmissionIntegral)] ++ stakedVotesIntegralsActions)
635635 let debug = makeString([toString(userBoostEmissionLastIntegral), toString(userBoostEmissionIntegral), toString(poolWeight), toString(userVoteIntegralDiff), toString(totalVotesIntegralDiff)], ":")
636636 $Tuple3(userBoostAvaliableToClaimTotalNew, dataState, debug)
637637 }
638638 }
639639 else throw("Strict value is not equal to itself.")
640640 }
641641
642642
643643 func lockActions (i,durationMonths) = {
644644 let duration = (durationMonths * blocksInMonth)
645645 let assetIdStr = toBase58String(assetId)
646646 if ((size(i.payments) != 1))
647647 then throwErr("invalid payment - exact one payment must be attached")
648648 else {
649649 let pmt = i.payments[0]
650650 let pmtAmount = pmt.amount
651651 if ((assetId != value(pmt.assetId)))
652652 then throwErr((("invalid asset is in payment - " + assetIdStr) + " is expected"))
653653 else if (!(containsElement(durationMonthsAllowed, durationMonths)))
654654 then throwErr("invalid duration")
655655 else {
656656 let nextUserNumKEY = keyNextUserNum()
657657 let userAddress = i.caller
658658 let userAddressStr = toString(userAddress)
659659 let userIsExisting = isDefined(getString(keyUser2NumMapping(userAddressStr)))
660660 let userNumStr = if (userIsExisting)
661661 then value(getString(keyUser2NumMapping(userAddressStr)))
662662 else toString(getIntOrFail(this, nextUserNumKEY))
663663 let userNum = parseIntValue(userNumStr)
664664 let lockStart = height
665665 if (if ((minLockAmount > pmtAmount))
666666 then (userAddress != lpStakingPoolsContract)
667667 else false)
668668 then throwErr(("amount is less then minLockAmount=" + toString(minLockAmount)))
669669 else if ((minLockDuration > duration))
670670 then throwErr(("passed duration is less then minLockDuration=" + toString(minLockDuration)))
671671 else if ((duration > maxLockDuration))
672672 then throwErr(("passed duration is greater then maxLockDuration=" + toString(maxLockDuration)))
673673 else {
674674 let gWxAmountStart = fraction(pmtAmount, duration, maxLockDuration)
675675 let gwxAmountTotal = getGwxAmountTotal()
676676 let userBoostEmissionLastIntegralKEY = keyUserBoostEmissionLastINTEGRAL(userNum)
677677 let boostEmissionIntegral = refreshBoostEmissionIntegral()._2
678678 let userGwxAmountTotal = getUserGwxAmountTotal(userAddress)
679679 let gwxRewardInv = reentrantInvoke(gwxRewardContract, "refreshUserReward", [userAddress.bytes, userNum], nil)
680680 if ((gwxRewardInv == gwxRewardInv))
681681 then {
682682 let arr = if (userIsExisting)
683683 then nil
684684 else [IntegerEntry(nextUserNumKEY, (userNum + 1)), StringEntry(keyUser2NumMapping(userAddressStr), userNumStr), StringEntry(keyNum2UserMapping(userNumStr), userAddressStr)]
685685 $Tuple2(((((arr ++ LockParamsEntry(userAddress, i.transactionId, pmtAmount, lockStart, duration, gWxAmountStart, 0)) ++ StatsEntry(pmtAmount, duration, 1, if (userIsExisting)
686686 then 0
687687 else 1)) :+ HistoryEntry("lock", userAddressStr, pmtAmount, lockStart, duration, gWxAmountStart, i)) ++ [IntegerEntry(userBoostEmissionLastIntegralKEY, boostEmissionIntegral), IntegerEntry(keyGwxTotal(), (gwxAmountTotal + gWxAmountStart)), IntegerEntry(keyUserGwxAmountTotal(userAddress), (userGwxAmountTotal + gWxAmountStart))]), gWxAmountStart)
688688 }
689689 else throw("Strict value is not equal to itself.")
690690 }
691691 }
692692 }
693693 }
694694
695695
696696 func getWxWithdrawable (userAddress,txIdOption) = {
697697 let userRecordArray = readLockParamsRecordOrFail(userAddress, txIdOption)
698698 let userAmount = parseIntValue(userRecordArray[IdxLockAmount])
699699 let lockStart = parseIntValue(userRecordArray[IdxLockStart])
700700 let lockDuration = parseIntValue(userRecordArray[IdxLockDuration])
701701 let lockEnd = (lockStart + lockDuration)
702702 let wxClaimed = parseIntValue(userRecordArray[IdxLockWxClaimed])
703703 let t = ((height - lockStart) / blocksInPeriod)
704704 let exponent = fraction(toBigInt(t), (toBigInt((8 * blocksInPeriod)) * MULT18BI), toBigInt(lockDuration))
705705 let wxWithdrawable = if ((height > lockEnd))
706706 then userAmount
707707 else (toInt(fraction(toBigInt(userAmount), (MULT18BI - pow(toBigInt(5), 1, exponent, SCALE18, SCALE18, DOWN)), MULT18BI)) - wxClaimed)
708708 wxWithdrawable
709709 }
710710
711711
712712 @Callable(i)
713713 func constructor (factoryAddressStr,lockAssetIdStr,minLockAmount,minDuration,maxDuration,mathContract) = {
714714 let checkCaller = mustManager(i)
715715 if ((checkCaller == checkCaller))
716716 then ([IntegerEntry(keyNextUserNum(), 0), StringEntry(keyConfig(), formatConfig(lockAssetIdStr, minLockAmount, minDuration, maxDuration, mathContract)), StringEntry(keyFactoryAddress(), factoryAddressStr)] ++ StatsEntry(0, 0, 0, 0))
717717 else throw("Strict value is not equal to itself.")
718718 }
719719
720720
721721
722722 @Callable(i)
723723 func lockRef (duration,referrerAddress,signature) = {
724- let $t02915529220 = lockActions(i, duration)
725- let lockActionsResult = $t02915529220._1
726- let gWxAmountStart = $t02915529220._2
724+ let $t02916029225 = lockActions(i, duration)
725+ let lockActionsResult = $t02916029225._1
726+ let gWxAmountStart = $t02916029225._2
727727 let referralAddress = toString(i.caller)
728728 let refInv = if (if ((referrerAddress == ""))
729729 then true
730730 else (signature == base58''))
731731 then unit
732732 else invoke(referralsContractAddressOrFail, "createPair", [referralProgramName, referrerAddress, referralAddress, signature], nil)
733733 if ((refInv == refInv))
734734 then {
735735 let updateRefActivity = invoke(mathContract, "updateReferralActivity", [toString(i.caller), gWxAmountStart], nil)
736736 if ((updateRefActivity == updateRefActivity))
737737 then $Tuple2(lockActionsResult, unit)
738738 else throw("Strict value is not equal to itself.")
739739 }
740740 else throw("Strict value is not equal to itself.")
741741 }
742742
743743
744744
745745 @Callable(i)
746746 func lock (duration) = {
747- let $t02967829743 = lockActions(i, duration)
748- let lockActionsResult = $t02967829743._1
749- let gWxAmountStart = $t02967829743._2
747+ let $t02968329748 = lockActions(i, duration)
748+ let lockActionsResult = $t02968329748._1
749+ let gWxAmountStart = $t02968329748._2
750750 let updateRefActivity = invoke(mathContract, "updateReferralActivity", [toString(i.caller), gWxAmountStart], nil)
751751 if ((updateRefActivity == updateRefActivity))
752752 then $Tuple2(lockActionsResult, unit)
753753 else throw("Strict value is not equal to itself.")
754754 }
755755
756756
757757
758758 @Callable(i)
759759 func claimWxBoost (lpAssetIdStr,userAddressStr) = if ((stakingContract != i.caller))
760760 then throwErr("permissions denied")
761761 else {
762- let $t03005330155 = internalClaimWxBoost(lpAssetIdStr, userAddressStr, false)
763- let userBoostAvailable = $t03005330155._1
764- let dataState = $t03005330155._2
765- let debug = $t03005330155._3
762+ let $t03005830160 = internalClaimWxBoost(lpAssetIdStr, userAddressStr, false)
763+ let userBoostAvailable = $t03005830160._1
764+ let dataState = $t03005830160._2
765+ let debug = $t03005830160._3
766766 $Tuple2(dataState, [userBoostAvailable])
767767 }
768768
769769
770770
771771 @Callable(i)
772772 func claimWxBoostREADONLY (lpAssetIdStr,userAddressStr) = {
773- let $t03028730388 = internalClaimWxBoost(lpAssetIdStr, userAddressStr, true)
774- let userBoostAvailable = $t03028730388._1
775- let dataState = $t03028730388._2
776- let debug = $t03028730388._3
773+ let $t03029230393 = internalClaimWxBoost(lpAssetIdStr, userAddressStr, true)
774+ let userBoostAvailable = $t03029230393._1
775+ let dataState = $t03029230393._2
776+ let debug = $t03029230393._3
777777 $Tuple2(nil, [userBoostAvailable, debug])
778778 }
779779
780780
781781
782782 @Callable(i)
783783 func unlock (txIdStr) = {
784784 let userAddress = i.caller
785785 let userAddressStr = toString(userAddress)
786- let txId = fromBase58String(txIdStr)
787- let userRecordArray = readLockParamsRecordOrFail(userAddress, if ((txIdStr == ""))
786+ let txIdOption = if ((txIdStr == ""))
788787 then unit
789- else txId)
788+ else fromBase58String(txIdStr)
789+ let userRecordArray = readLockParamsRecordOrFail(userAddress, txIdOption)
790790 let userAmount = parseIntValue(userRecordArray[IdxLockAmount])
791791 let lockStart = parseIntValue(userRecordArray[IdxLockStart])
792792 let lockDuration = parseIntValue(userRecordArray[IdxLockDuration])
793793 let wxClaimed = parseIntValue(userRecordArray[IdxLockWxClaimed])
794794 let gwxAmount = parseIntValue(userRecordArray[IdxLockGwxAmount])
795795 let t = ((height - lockStart) / blocksInPeriod)
796- let wxWithdrawable = getWxWithdrawable(userAddress, if ((txIdStr == ""))
797- then unit
798- else txId)
796+ let wxWithdrawable = getWxWithdrawable(userAddress, txIdOption)
799797 let gWxAmountStart = fraction(userAmount, lockDuration, maxLockDuration)
800798 let gwxBurned = min([fraction((t * blocksInPeriod), gWxAmountStart, maxLockDuration), gwxAmount])
801799 let gwxRemaining = ensurePositive((gwxAmount - gwxBurned), "gwxRemaining")
802800 let lockedGwxAmount = getLockedGwxAmount(userAddress)
803801 if ((0 >= userAmount))
804802 then throwErr("nothing to unlock")
805803 else {
806804 let gwxAmountTotal = getGwxAmountTotal()
807805 let userGwxAmountTotal = getUserGwxAmountTotal(userAddress)
808806 let userGwxAmountTotalNew = ensurePositive((userGwxAmountTotal - gwxBurned), "userGwxAmountTotalNew")
809807 if ((lockedGwxAmount > userGwxAmountTotalNew))
810808 then throwErr(("locked gwx amount: " + toString(lockedGwxAmount)))
811809 else {
812810 let userNum = parseIntValue(valueOrErrorMessage(getString(keyUser2NumMapping(userAddressStr)), wrapErr("invalid user number")))
813811 let gwxRewardInv = reentrantInvoke(gwxRewardContract, "refreshUserReward", [userAddress.bytes, userNum], nil)
814812 if ((gwxRewardInv == gwxRewardInv))
815- then ((((LockParamsEntry(userAddress, txId, userAmount, lockStart, lockDuration, gwxRemaining, (wxClaimed + wxWithdrawable)) ++ StatsEntry(-(wxWithdrawable), 0, 0, 0)) :+ HistoryEntry("unlock", userAddressStr, wxWithdrawable, lockStart, lockDuration, gwxBurned, i)) :+ ScriptTransfer(userAddress, wxWithdrawable, assetId)) ++ [IntegerEntry(keyGwxTotal(), ensurePositive((gwxAmountTotal - gwxBurned), "gwxTotal")), IntegerEntry(keyUserGwxAmountTotal(userAddress), userGwxAmountTotalNew)])
813+ then ((((LockParamsEntry(userAddress, txIdOption, userAmount, lockStart, lockDuration, gwxRemaining, (wxClaimed + wxWithdrawable)) ++ StatsEntry(-(wxWithdrawable), 0, 0, 0)) :+ HistoryEntry("unlock", userAddressStr, wxWithdrawable, lockStart, lockDuration, gwxBurned, i)) :+ ScriptTransfer(userAddress, wxWithdrawable, assetId)) ++ [IntegerEntry(keyGwxTotal(), ensurePositive((gwxAmountTotal - gwxBurned), "gwxTotal")), IntegerEntry(keyUserGwxAmountTotal(userAddress), userGwxAmountTotalNew)])
816814 else throw("Strict value is not equal to itself.")
817815 }
818816 }
819817 }
820818
821819
822820
823821 @Callable(i)
824822 func gwxUserInfoREADONLY (userAddressStr) = {
825823 let userAddress = valueOrErrorMessage(addressFromString(userAddressStr), wrapErr("invalid user address"))
826824 let gwxAmount = getUserGwxAmountTotal(userAddress)
827825 $Tuple2(nil, [gwxAmount])
828826 }
829827
830828
831829
832830 @Callable(i)
833831 func userMaxDurationREADONLY (userAddressStr) = $Tuple2(nil, $Tuple2("lock", maxLockDuration))
834832
835833
836834
837835 @Callable(i)
838836 func getUserGwxAmountAtHeightREADONLY (userAddressStr,targetHeight) = {
839837 let userAddress = valueOrErrorMessage(addressFromString(userAddressStr), wrapErr("invalid user address"))
840838 let gwxAmount = getUserGwxAmountTotal(userAddress)
841839 $Tuple2(nil, gwxAmount)
842840 }
843841
844842
845843
846844 @Callable(i)
847845 func getUserGwxAmount (userAddressStr) = {
848846 let userAddress = valueOrErrorMessage(addressFromString(userAddressStr), wrapErr("invalid user address"))
849847 let gwxAmount = getUserGwxAmountTotal(userAddress)
850848 $Tuple2(nil, gwxAmount)
851849 }
852850
853851
854852
855853 @Callable(i)
856854 func getGwxTotalREADONLY () = $Tuple2(nil, getGwxAmountTotal())
857855
858856
859857
860858 @Callable(i)
861859 func onBoostEmissionUpdate () = {
862860 let checkCaller = if ((i.caller == emissionContract))
863861 then true
864862 else mustManager(i)
865863 if ((checkCaller == checkCaller))
866864 then refreshBoostEmissionIntegral()
867865 else throw("Strict value is not equal to itself.")
868866 }
869867
870868
871869
872870 @Callable(i)
873871 func onStakedVoteUpdate (lpAssetIdStr,userAddressStr,edge) = {
874872 let checkCaller = if ((i.caller == stakingContract))
875873 then true
876874 else mustManager(i)
877875 if ((checkCaller == checkCaller))
878876 then {
879877 let actions = refreshVoteStakedIntegral(lpAssetIdStr, userAddressStr, edge)
880878 $Tuple2(actions, unit)
881879 }
882880 else throw("Strict value is not equal to itself.")
883881 }
884882
885883
886884
887885 @Callable(i)
888886 func getVotingResultStakedREADONLY (lpAssetIdStr) = $Tuple2(nil, getVotingResultStaked(lpAssetIdStr))
889887
890888
891889
892890 @Callable(i)
893891 func getVotingResultStakedIntegralREADONLY (lpAssetIdStr) = $Tuple2(nil, getVotingResultStakedIntegral(lpAssetIdStr))
894892
895893
896894
897895 @Callable(i)
898896 func getUserVoteFinalizedREADONLY (lpAssetIdStr,userAddressStr) = $Tuple2(nil, getUserVoteFinalized(lpAssetIdStr, userAddressStr))
899897
900898
901899
902900 @Callable(i)
903901 func getUserVoteStakedIntegralREADONLY (lpAssetIdStr,userAddressStr) = $Tuple2(nil, getUserVoteStakedIntegral(lpAssetIdStr, userAddressStr))
904902
905903
906904 @Verifier(tx)
907905 func verify () = {
908906 let targetPublicKey = match managerPublicKeyOrUnit() {
909907 case pk: ByteVector =>
910908 pk
911909 case _: Unit =>
912910 tx.senderPublicKey
913911 case _ =>
914912 throw("Match error")
915913 }
916914 sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey)
917915 }
918916

github/deemru/w8io/026f985 
165.12 ms