tx · ECDRefMeK9T8XVnhUrxN6ca8E8mVNrFtpbBqrBre9Er1

3Myn55vLkduxbX3ZXfiDCZhaQsLxYp1kmCy:  -0.02300000 Waves

2023.02.27 12:40 [2467949] smart account 3Myn55vLkduxbX3ZXfiDCZhaQsLxYp1kmCy > SELF 0.00000000 Waves

{ "type": 13, "id": "ECDRefMeK9T8XVnhUrxN6ca8E8mVNrFtpbBqrBre9Er1", "fee": 2300000, "feeAssetId": null, "timestamp": 1677490951400, "version": 1, "sender": "3Myn55vLkduxbX3ZXfiDCZhaQsLxYp1kmCy", "senderPublicKey": "9W33iCCNfmFxUbiC6XZcH5x7f6xfwC7Jb3BoExT5q2PV", "proofs": [ "WgrEVQRmK6YBsTps8S51YaMPexKdBJYxo25PR96J35dq97wnzbToR3hYpgawkp47diubcYzT3KjAfFnnDkwtkAv" ], "script": "base64:BgLAJggCEggKBggIAQEBCBIFCgMBCAISAwoBARIDCgEBEgQKAggIEgQKAggIEgMKAQgSAwoBCBIDCgEIEgQKAggBEgASAwoBCBIAIgNTRVAiBlNDQUxFOCIFTVVMVDgiDlBPT0xXRUlHSFRNVUxUIgd3cmFwRXJyIgNtc2ciCHRocm93RXJyIgRzdHJmIgdhZGRyZXNzIgNrZXkiA2lveiIDaW9kIgpkZWZhdWx0VmFsIgNpb2YiA2FicyIDdmFsIgNhYWwiByRtYXRjaDAiCnZhbEFueUx5c3QiAmFpIgZ2YWxJbnQiG2tleVJlZmVycmFsc0NvbnRyYWN0QWRkcmVzcyIecmVmZXJyYWxzQ29udHJhY3RBZGRyZXNzT3JGYWlsIhZrZXlSZWZlcnJhbFByb2dyYW1OYW1lIhpyZWZlcnJhbFByb2dyYW1OYW1lRGVmYXVsdCITcmVmZXJyYWxQcm9ncmFtTmFtZSIRa2V5RmFjdG9yeUFkZHJlc3MiGElkeEZhY3RvcnlDZmdTdGFraW5nRGFwcCIZSWR4RmFjdG9yeUNmZ0Jvb3N0aW5nRGFwcCIUSWR4RmFjdG9yeUNmZ0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cyBub3QgZXF1YWwgdG8gaXRzZWxmLgkAAgECJFN0cmljdCB2YWx1ZSBpcyBub3QgZXF1YWwgdG8gaXRzZWxmLgECZXcBAmV4AAQCZXkEAXIJAQJhQwADCQABAgUBcgIKQnl0ZVZlY3RvcgQCYUkFAXIFAmFJAwkAAQIFAXICBFVuaXQIBQJldw9zZW5kZXJQdWJsaWNLZXkJAAIBAgtNYXRjaCBlcnJvcgkA9AMDCAUCZXcJYm9keUJ5dGVzCQCRAwIIBQJldwZwcm9vZnMAAAUCZXnprwNH", "chainId": 84, "height": 2467949, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 5tog8x7bSLC6iuCsZ5peaA914TR6cERf2aVHu9YZoL3C Next: Zjehtyc9ofKnWrZeWx6RCzQkQg21o8FgGedRNPEPuqq 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+
1117
1218 func strf (address,key) = valueOrErrorMessage(getString(address, key), (("mandatory this." + key) + " is not defined"))
1319
305311
306312 let gwxRewardContract = getGwxRewardAddressOrFail(factoryCfg)
307313
314+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"))
315+
308316 func getTotalCachedGwx (correct) = {
309317 let keyVotingEmissionContract = makeString(["%s", "votingEmissionContract"], SEP)
310318 let votingEmissionContract = addressFromStringValue(getStringValue(factoryContract, keyVotingEmissionContract))
403411 let userNumStr = userRecordArray[IdxLockUserNum]
404412 let gwxRewardEmissionStartHeight = valueOrElse(getInteger(gwxRewardContract, keyGwxRewardEmissionStartHeight()), 0)
405413 let EMPTYSTR = "empty"
406- let $t01496515533 = if ((lpAssetIdStr != EMPTYSTR))
414+ let $t01539715965 = if ((lpAssetIdStr != EMPTYSTR))
407415 then {
408416 let poolAddressStr = valueOrErrorMessage(getString(factoryContract, keyFactoryLp2AssetsMapping(lpAssetIdStr)), ("unsupported lp asset " + lpAssetIdStr))
409417 let pw1 = getIntegerValue(factoryContract, keyFactoryPoolWeight(poolAddressStr))
413421 else if (readOnly)
414422 then $Tuple2(0, 0)
415423 else throw(("not readonly mode: unsupported lp asset " + lpAssetIdStr))
416- let poolWeight0 = $t01496515533._1
417- let poolWeight1 = $t01496515533._2
424+ let poolWeight0 = $t01539715965._1
425+ let poolWeight1 = $t01539715965._2
418426 let wxEmissionPerBlock = iof(emissionContract, keyEmissionRatePerBlockCurrent())
419427 let emissionStart = iof(emissionContract, keyEmissionStartBlock())
420428 let emissionEnd = iof(emissionContract, keyEmissionEndBlock())
500508 let startBlockKEY = keyLockParamStartBlock(userNumStr)
501509 let durationKEY = keyLockParamDuration(userNumStr)
502510 let userAmountKEY = keyLockParamUserAmount(userNumStr)
503- if ((minLockAmount > pmtAmount))
511+ if (if ((minLockAmount > pmtAmount))
512+ then (i.caller != lpStakingPoolsContract)
513+ else false)
504514 then throw(("amount is less then minLockAmount=" + toString(minLockAmount)))
505515 else if ((minLockDuration > duration))
506516 then throw(("passed duration is less then minLockDuration=" + toString(minLockDuration)))
557567
558568 @Callable(i)
559569 func lockRef (duration,referrerAddress,signature) = {
560- let $t02389223957 = lockActions(i, duration)
561- let lockActionsResult = $t02389223957._1
562- let gWxAmountStart = $t02389223957._2
570+ let $t02436424429 = lockActions(i, duration)
571+ let lockActionsResult = $t02436424429._1
572+ let gWxAmountStart = $t02436424429._2
563573 let referralAddress = toString(i.caller)
564574 let refInv = if (if ((referrerAddress == ""))
565575 then true
580590
581591 @Callable(i)
582592 func lock (duration) = {
583- let $t02441524480 = lockActions(i, duration)
584- let lockActionsResult = $t02441524480._1
585- let gWxAmountStart = $t02441524480._2
593+ let $t02488724952 = lockActions(i, duration)
594+ let lockActionsResult = $t02488724952._1
595+ let gWxAmountStart = $t02488724952._2
586596 let updateRefActivity = invoke(mathContract, "updateReferralActivity", [toString(i.caller), gWxAmountStart], nil)
587597 if ((updateRefActivity == updateRefActivity))
588598 then $Tuple2(lockActionsResult, unit)
671681 func claimWxBoost (lpAssetIdStr,userAddressStr) = if ((stakingContract != i.caller))
672682 then throw("permissions denied")
673683 else {
674- let $t02946129563 = internalClaimWxBoost(lpAssetIdStr, userAddressStr, false)
675- let userBoostAvailable = $t02946129563._1
676- let dataState = $t02946129563._2
677- let debug = $t02946129563._3
684+ let $t02993330035 = internalClaimWxBoost(lpAssetIdStr, userAddressStr, false)
685+ let userBoostAvailable = $t02993330035._1
686+ let dataState = $t02993330035._2
687+ let debug = $t02993330035._3
678688 $Tuple2(dataState, [userBoostAvailable])
679689 }
680690
682692
683693 @Callable(i)
684694 func claimWxBoostREADONLY (lpAssetIdStr,userAddressStr) = {
685- let $t02969529796 = internalClaimWxBoost(lpAssetIdStr, userAddressStr, true)
686- let userBoostAvailable = $t02969529796._1
687- let dataState = $t02969529796._2
688- let debug = $t02969529796._3
695+ let $t03016730268 = internalClaimWxBoost(lpAssetIdStr, userAddressStr, true)
696+ let userBoostAvailable = $t03016730268._1
697+ let dataState = $t03016730268._2
698+ let debug = $t03016730268._3
689699 $Tuple2(nil, [userBoostAvailable, debug])
690700 }
691701
717727 func gwxUserInfoREADONLY (userAddress) = {
718728 let gwxAmount = calcCurrentGwxAmount(userAddress)
719729 $Tuple2(nil, [gwxAmount])
730+ }
731+
732+
733+
734+@Callable(i)
735+func userMaxDurationREADONLY (userAddressStr) = {
736+ let cfgArray = readConfigArrayOrFail()
737+ let maxLockDuration = parseIntValue(cfgArray[IdxCfgMaxLockDuration])
738+ let userRecordOption = getString(this, keyLockParamsRecord(userAddressStr))
739+ if ((userRecordOption == unit))
740+ then $Tuple2(nil, $Tuple2("lock", maxLockDuration))
741+ else {
742+ let userRecordArray = split(value(userRecordOption), SEP)
743+ let lockStart = parseIntValue(userRecordArray[IdxLockStart])
744+ let lockDuration = parseIntValue(userRecordArray[IdxLockDuration])
745+ let lockEnd = (lockStart + lockDuration)
746+ let remainingDuration = max([(lockEnd - height), 0])
747+ let maxDeltaDuration = (maxLockDuration - remainingDuration)
748+ $Tuple2(nil, $Tuple2("increaseLock", maxDeltaDuration))
749+ }
720750 }
721751
722752
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+
1117
1218 func strf (address,key) = valueOrErrorMessage(getString(address, key), (("mandatory this." + key) + " is not defined"))
1319
1420
1521 func ioz (address,key) = valueOrElse(getInteger(address, key), 0)
1622
1723
1824 func iod (address,key,defaultVal) = valueOrElse(getInteger(address, key), defaultVal)
1925
2026
2127 func iof (address,key) = valueOrErrorMessage(getInteger(address, key), (("mandatory this." + key) + " is not defined"))
2228
2329
2430 func abs (val) = if ((0 > val))
2531 then -(val)
2632 else val
2733
2834
2935 func aal (val) = match val {
3036 case valAnyLyst: List[Any] =>
3137 valAnyLyst
3238 case _ =>
3339 throw("fail to cast into List[Any]")
3440 }
3541
3642
3743 func ai (val) = match val {
3844 case valInt: Int =>
3945 valInt
4046 case _ =>
4147 throw("fail to cast into Int")
4248 }
4349
4450
4551 func keyReferralsContractAddress () = makeString(["%s%s", "config", "referralsContractAddress"], SEP)
4652
4753
4854 let referralsContractAddressOrFail = addressFromStringValue(strf(this, keyReferralsContractAddress()))
4955
5056 let keyReferralProgramName = makeString(["%s%s", "referral", "programName"], SEP)
5157
5258 let referralProgramNameDefault = "wxlock"
5359
5460 let referralProgramName = valueOrElse(getString(this, keyReferralProgramName), referralProgramNameDefault)
5561
5662 func keyFactoryAddress () = "%s%s__config__factoryAddress"
5763
5864
5965 let IdxFactoryCfgStakingDapp = 1
6066
6167 let IdxFactoryCfgBoostingDapp = 2
6268
6369 let IdxFactoryCfgIdoDapp = 3
6470
6571 let IdxFactoryCfgTeamDapp = 4
6672
6773 let IdxFactoryCfgEmissionDapp = 5
6874
6975 let IdxFactoryCfgRestDapp = 6
7076
7177 let IdxFactoryCfgSlippageDapp = 7
7278
7379 let IdxFactoryCfgDaoDapp = 8
7480
7581 let IdxFactoryCfgMarketingDapp = 9
7682
7783 let IdxFactoryCfgGwxRewardDapp = 10
7884
7985 let IdxFactoryCfgBirdsDapp = 11
8086
8187 func keyFactoryCfg () = "%s__factoryConfig"
8288
8389
8490 func keyFactoryLp2AssetsMapping (lpAssetStr) = makeString(["%s%s%s", lpAssetStr, "mappings__lpAsset2PoolContract"], SEP)
8591
8692
8793 func keyFactoryLpList () = "%s__lpTokensList"
8894
8995
9096 func keyFactoryLpAssetToPoolContractAddress (lpAssetStr) = makeString(["%s%s%s", lpAssetStr, "mappings__lpAsset2PoolContract"], SEP)
9197
9298
9399 func keyFactoryPoolWeight (contractAddress) = makeString(["%s%s", "poolWeight", contractAddress], SEP)
94100
95101
96102 func keyFactoryPoolWeightHistory (poolAddress,num) = ((("%s%s__poolWeight__" + poolAddress) + "__") + toString(num))
97103
98104
99105 func readFactoryAddressOrFail () = addressFromStringValue(strf(this, keyFactoryAddress()))
100106
101107
102108 func readLpList () = split(valueOrElse(getString(readFactoryAddressOrFail(), keyFactoryLpList()), ""), SEP)
103109
104110
105111 func readFactoryCfgOrFail (factory) = split(strf(factory, keyFactoryCfg()), SEP)
106112
107113
108114 func getBoostingAddressOrFail (factoryCfg) = addressFromStringValue(factoryCfg[IdxFactoryCfgBoostingDapp])
109115
110116
111117 func getEmissionAddressOrFail (factoryCfg) = addressFromStringValue(factoryCfg[IdxFactoryCfgEmissionDapp])
112118
113119
114120 func getStakingAddressOrFail (factoryCfg) = addressFromStringValue(factoryCfg[IdxFactoryCfgStakingDapp])
115121
116122
117123 func getGwxRewardAddressOrFail (factoryCfg) = addressFromStringValue(factoryCfg[IdxFactoryCfgGwxRewardDapp])
118124
119125
120126 func keyManagerPublicKey () = "%s__managerPublicKey"
121127
122128
123129 func keyPendingManagerPublicKey () = "%s__pendingManagerPublicKey"
124130
125131
126132 func keyEmissionRatePerBlockCurrent () = "%s%s__ratePerBlock__current"
127133
128134
129135 func keyEmissionRatePerBlockMaxCurrent () = "%s%s__ratePerBlockMax__current"
130136
131137
132138 func keyEmissionStartBlock () = "%s%s__emission__startBlock"
133139
134140
135141 func keyEmissionDurationInBlocks () = "%s%s__emission__duration"
136142
137143
138144 func keyEmissionEndBlock () = "%s%s__emission__endBlock"
139145
140146
141147 func keyNextPeriod () = "%s__nextPeriod"
142148
143149
144150 func keyGwxRewardEmissionStartHeight () = "%s%s__gwxRewardEmissionPart__startHeight"
145151
146152
147153 let IdxCfgAssetId = 1
148154
149155 let IdxCfgMinLockAmount = 2
150156
151157 let IdxCfgMinLockDuration = 3
152158
153159 let IdxCfgMaxLockDuration = 4
154160
155161 let IdxCfgMathContract = 5
156162
157163 func keyConfig () = "%s__config"
158164
159165
160166 func readConfigArrayOrFail () = split(strf(this, keyConfig()), SEP)
161167
162168
163169 let mathContract = addressFromStringValue(readConfigArrayOrFail()[IdxCfgMathContract])
164170
165171 func formatConfigS (assetId,minLockAmount,minLockDuration,maxLockDuration,mathContract) = makeString(["%s%d%d%d", assetId, minLockAmount, minLockDuration, maxLockDuration, mathContract], SEP)
166172
167173
168174 func formatConfig (assetId,minLockAmount,minLockDuration,maxLockDuration,mathContract) = formatConfigS(assetId, toString(minLockAmount), toString(minLockDuration), toString(maxLockDuration), mathContract)
169175
170176
171177 func managerPublicKeyOrUnit () = match getString(keyManagerPublicKey()) {
172178 case s: String =>
173179 fromBase58String(s)
174180 case _: Unit =>
175181 unit
176182 case _ =>
177183 throw("Match error")
178184 }
179185
180186
181187 func pendingManagerPublicKeyOrUnit () = match getString(keyPendingManagerPublicKey()) {
182188 case s: String =>
183189 fromBase58String(s)
184190 case _: Unit =>
185191 unit
186192 case _ =>
187193 throw("Match error")
188194 }
189195
190196
191197 func mustManager (i) = {
192198 let pd = throw("Permission denied")
193199 match managerPublicKeyOrUnit() {
194200 case pk: ByteVector =>
195201 if ((i.callerPublicKey == pk))
196202 then true
197203 else pd
198204 case _: Unit =>
199205 if ((i.caller == this))
200206 then true
201207 else pd
202208 case _ =>
203209 throw("Match error")
204210 }
205211 }
206212
207213
208214 let IdxLockUserNum = 1
209215
210216 let IdxLockAmount = 2
211217
212218 let IdxLockStart = 3
213219
214220 let IdxLockDuration = 4
215221
216222 let IdxLockParamK = 5
217223
218224 let IdxLockParamB = 6
219225
220226 func keyLockParamsRecord (userAddress) = makeString(["%s%s__lock", userAddress], SEP)
221227
222228
223229 func readLockParamsRecordOrFail (userAddress) = split(strf(this, keyLockParamsRecord(userAddress)), SEP)
224230
225231
226232 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)
227233
228234
229235 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))
230236
231237
232238 func keyNextUserNum () = "%s__nextUserNum"
233239
234240
235241 func keyUser2NumMapping (userAddress) = makeString(["%s%s%s__mapping__user2num", userAddress], SEP)
236242
237243
238244 func keyNum2UserMapping (num) = makeString(["%s%s%s__mapping__num2user", num], SEP)
239245
240246
241247 func keyLockParamUserAmount (userNum) = makeString(["%s%d%s__paramByUserNum", userNum, "amount"], SEP)
242248
243249
244250 func keyLockParamStartBlock (userNum) = makeString(["%s%d%s__paramByUserNum", userNum, "start"], SEP)
245251
246252
247253 func keyLockParamDuration (userNum) = makeString(["%s%d%s__paramByUserNum", userNum, "duration"], SEP)
248254
249255
250256 func keyLockParamK (userNum) = makeString(["%s%d%s__paramByUserNum", userNum, "k"], SEP)
251257
252258
253259 func keyLockParamB (userNum) = makeString(["%s%d%s__paramByUserNum", userNum, "b"], SEP)
254260
255261
256262 func keyLockParamByPeriodK (userNum,period) = makeString(["%s%d%s%d__paramByPeriod", userNum, "k", period], SEP)
257263
258264
259265 func keyLockParamByPeriodB (userNum,period) = makeString(["%s%d%s%d__paramByPeriod", userNum, "b", period], SEP)
260266
261267
262268 func keyLockParamTotalAmount () = "%s%s__stats__activeTotalLocked"
263269
264270
265271 func keyStatsLocksDurationSumInBlocks () = "%s%s__stats__locksDurationSumInBlocks"
266272
267273
268274 func keyStatsLocksCount () = "%s%s__stats__locksCount"
269275
270276
271277 func keyStatsUsersCount () = "%s%s__stats__activeUsersCount"
272278
273279
274280 func keyUserBoostEmissionLastINTEGRAL (userNum) = makeString(["%s%d__userBoostEmissionLastInt", userNum], SEP)
275281
276282
277283 func keyUserLpBoostEmissionLastINTEGRAL (userNum,lpAssetId) = makeString(["%s%d__userBoostEmissionLastInt", userNum, lpAssetId], SEP)
278284
279285
280286 func keyUserMaxBoostINTEGRAL (userNum) = makeString(["%s%d__maxBoostInt", userNum], SEP)
281287
282288
283289 func keyTotalMaxBoostINTEGRAL () = "%s%s__maxBoostInt__total"
284290
285291
286292 func keyUserBoostAvalaibleToClaimTotal (userNum) = makeString(["%s%d__userBoostAvaliableToClaimTotal", userNum], SEP)
287293
288294
289295 func keyUserBoostClaimed (userNum) = makeString(["%s%d__userBoostClaimed", userNum], SEP)
290296
291297
292298 func keyTotalCachedGwx () = "%s%s__gwxCached__total"
293299
294300
295301 func keyTotalCachedGwxCorrective () = "%s__gwxCachedTotalCorrective"
296302
297303
298304 let factoryContract = readFactoryAddressOrFail()
299305
300306 let factoryCfg = readFactoryCfgOrFail(factoryContract)
301307
302308 let emissionContract = getEmissionAddressOrFail(factoryCfg)
303309
304310 let stakingContract = getStakingAddressOrFail(factoryCfg)
305311
306312 let gwxRewardContract = getGwxRewardAddressOrFail(factoryCfg)
307313
314+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"))
315+
308316 func getTotalCachedGwx (correct) = {
309317 let keyVotingEmissionContract = makeString(["%s", "votingEmissionContract"], SEP)
310318 let votingEmissionContract = addressFromStringValue(getStringValue(factoryContract, keyVotingEmissionContract))
311319 let keyCurrentEpochUi = makeString(["%s", "currentEpochUi"], SEP)
312320 let currentEpochUi = getIntegerValue(votingEmissionContract, keyCurrentEpochUi)
313321 let keyTargetEpoch = makeString(["%s%s", "totalCachedGwxCorrection__activationEpoch"], SEP)
314322 let targetEpochOption = getInteger(this, keyTargetEpoch)
315323 let totalCachedGwxRaw = valueOrElse(getInteger(this, keyTotalCachedGwx()), 0)
316324 let isCorrectionActivated = if (isDefined(targetEpochOption))
317325 then (currentEpochUi >= value(targetEpochOption))
318326 else false
319327 let corrective = if (if (isCorrectionActivated)
320328 then correct
321329 else false)
322330 then valueOrElse(getInteger(this, keyTotalCachedGwxCorrective()), 0)
323331 else 0
324332 max([0, (totalCachedGwxRaw + corrective)])
325333 }
326334
327335
328336 func HistoryEntry (type,user,amount,lockStart,duration,k,b,i) = {
329337 let historyKEY = makeString(["%s%s%s%s__history", type, user, toBase58String(i.transactionId)], SEP)
330338 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)
331339 StringEntry(historyKEY, historyDATA)
332340 }
333341
334342
335343 func StatsEntry (totalLockedInc,durationInc,lockCountInc,usersCountInc) = {
336344 let locksDurationSumInBlocksKEY = keyStatsLocksDurationSumInBlocks()
337345 let locksCountKEY = keyStatsLocksCount()
338346 let usersCountKEY = keyStatsUsersCount()
339347 let totalAmountKEY = keyLockParamTotalAmount()
340348 let locksDurationSumInBlocks = ioz(this, locksDurationSumInBlocksKEY)
341349 let locksCount = ioz(this, locksCountKEY)
342350 let usersCount = ioz(this, usersCountKEY)
343351 let totalAmount = ioz(this, totalAmountKEY)
344352 [IntegerEntry(locksDurationSumInBlocksKEY, (locksDurationSumInBlocks + durationInc)), IntegerEntry(locksCountKEY, (locksCount + lockCountInc)), IntegerEntry(usersCountKEY, (usersCount + usersCountInc)), IntegerEntry(totalAmountKEY, (totalAmount + totalLockedInc))]
345353 }
346354
347355
348356 func calcGwxAmount (kRaw,bRaw,h) = {
349357 let SCALE = 1000
350358 (((kRaw * h) + bRaw) / SCALE)
351359 }
352360
353361
354362 func LockParamsEntry (userAddress,userNum,amount,start,duration,k,b,period) = {
355363 let userAmountKEY = keyLockParamUserAmount(userNum)
356364 let startBlockKEY = keyLockParamStartBlock(userNum)
357365 let durationKEY = keyLockParamDuration(userNum)
358366 let kKEY = keyLockParamK(userNum)
359367 let bKEY = keyLockParamB(userNum)
360368 let kByPeriodKEY = keyLockParamByPeriodK(userNum, period)
361369 let bByPeriodKEY = keyLockParamByPeriodB(userNum, period)
362370 let gwxAmount = calcGwxAmount(k, b, height)
363371 [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))]
364372 }
365373
366374
367375 func extractOptionalPaymentAmountOrFail (i,expectedAssetId) = if ((size(i.payments) > 1))
368376 then throw("only one payment is allowed")
369377 else if ((size(i.payments) == 0))
370378 then 0
371379 else {
372380 let pmt = i.payments[0]
373381 if ((value(pmt.assetId) != expectedAssetId))
374382 then throw("invalid asset id in payment")
375383 else pmt.amount
376384 }
377385
378386
379387 func calcUserGwxAmountAtHeight (userAddress,targetHeight) = {
380388 let EMPTY = "empty"
381389 let user2NumMappingKEY = keyUser2NumMapping(userAddress)
382390 let userNum = valueOrElse(getString(user2NumMappingKEY), EMPTY)
383391 let k = valueOrElse(getInteger(keyLockParamK(userNum)), 0)
384392 let b = valueOrElse(getInteger(keyLockParamB(userNum)), 0)
385393 let gwxAmountCalc = calcGwxAmount(k, b, targetHeight)
386394 let gwxAmount = if ((0 > gwxAmountCalc))
387395 then 0
388396 else gwxAmountCalc
389397 gwxAmount
390398 }
391399
392400
393401 func calcCurrentGwxAmount (userAddress) = calcUserGwxAmountAtHeight(userAddress, height)
394402
395403
396404 func internalClaimWxBoost (lpAssetIdStr,userAddressStr,readOnly) = {
397405 let EMPTY = "EMPTY"
398406 let userRecordOrEmpty = valueOrElse(getString(this, keyLockParamsRecord(userAddressStr)), EMPTY)
399407 if ((userRecordOrEmpty == EMPTY))
400408 then $Tuple3(0, nil, "userRecord::is::empty")
401409 else {
402410 let userRecordArray = split(userRecordOrEmpty, SEP)
403411 let userNumStr = userRecordArray[IdxLockUserNum]
404412 let gwxRewardEmissionStartHeight = valueOrElse(getInteger(gwxRewardContract, keyGwxRewardEmissionStartHeight()), 0)
405413 let EMPTYSTR = "empty"
406- let $t01496515533 = if ((lpAssetIdStr != EMPTYSTR))
414+ let $t01539715965 = if ((lpAssetIdStr != EMPTYSTR))
407415 then {
408416 let poolAddressStr = valueOrErrorMessage(getString(factoryContract, keyFactoryLp2AssetsMapping(lpAssetIdStr)), ("unsupported lp asset " + lpAssetIdStr))
409417 let pw1 = getIntegerValue(factoryContract, keyFactoryPoolWeight(poolAddressStr))
410418 let pw0 = valueOrElse(getInteger(factoryContract, keyFactoryPoolWeightHistory(poolAddressStr, 0)), pw1)
411419 $Tuple2(pw0, pw1)
412420 }
413421 else if (readOnly)
414422 then $Tuple2(0, 0)
415423 else throw(("not readonly mode: unsupported lp asset " + lpAssetIdStr))
416- let poolWeight0 = $t01496515533._1
417- let poolWeight1 = $t01496515533._2
424+ let poolWeight0 = $t01539715965._1
425+ let poolWeight1 = $t01539715965._2
418426 let wxEmissionPerBlock = iof(emissionContract, keyEmissionRatePerBlockCurrent())
419427 let emissionStart = iof(emissionContract, keyEmissionStartBlock())
420428 let emissionEnd = iof(emissionContract, keyEmissionEndBlock())
421429 let h = if ((height > emissionEnd))
422430 then emissionEnd
423431 else height
424432 let dh = max([(h - emissionStart), 0])
425433 let userLpBoostEmissionLastIntegralKEY = keyUserLpBoostEmissionLastINTEGRAL(userNumStr, lpAssetIdStr)
426434 let userBoostEmissionLastIntegralKEY = keyUserBoostEmissionLastINTEGRAL(userNumStr)
427435 let userBoostEmissionLastIntegral = valueOrElse(getInteger(this, userLpBoostEmissionLastIntegralKEY), ioz(this, userBoostEmissionLastIntegralKEY))
428436 let boostEmissionIntegral = (((wxEmissionPerBlock * dh) * 2) / 3)
429437 let userBoostEmissionIntegral = (boostEmissionIntegral - userBoostEmissionLastIntegral)
430438 let udh = fraction(userBoostEmissionIntegral, 3, (2 * wxEmissionPerBlock))
431439 let uLastH = (h - udh)
432440 let udh0 = max([(gwxRewardEmissionStartHeight - uLastH), 0])
433441 let udh1 = ((h - uLastH) - udh0)
434442 if (if (if ((0 > uLastH))
435443 then true
436444 else (0 > udh1))
437445 then true
438446 else (abs(((udh0 + udh1) - udh)) >= 1))
439447 then throw(((((((("invalid udh calc: udh=" + toString(udh)) + " uLastH=") + toString(uLastH)) + " udh0=") + toString(udh0)) + " udh1=") + toString(udh1)))
440448 else if ((0 > userBoostEmissionIntegral))
441449 then throw("wrong calculations")
442450 else {
443451 let userMaxBoostIntegralKEY = keyUserMaxBoostINTEGRAL(userNumStr)
444452 let totalMaxBoostIntegralKEY = keyTotalMaxBoostINTEGRAL()
445453 let userMaxBoostInt = ioz(this, userMaxBoostIntegralKEY)
446454 let totalMaxBoostInt = ioz(this, totalMaxBoostIntegralKEY)
447455 let totalCachedGwxCorrected = getTotalCachedGwx(true)
448456 let userCurrGwx = calcCurrentGwxAmount(userAddressStr)
449457 let userBoostAvalaibleToClaimTotalKEY = keyUserBoostAvalaibleToClaimTotal(userNumStr)
450458 let userBoostAvaliableToClaimTotal = ioz(this, userBoostAvalaibleToClaimTotalKEY)
451459 let userBoostEmissionIntegral0 = if ((udh == 0))
452460 then 0
453461 else fraction(userBoostEmissionIntegral, udh0, udh)
454462 let userBoostEmissionIntegral1 = if ((udh == 0))
455463 then 0
456464 else fraction(userBoostEmissionIntegral, udh1, udh)
457465 let poolUserBoostEmissionIntegral0 = fraction(userBoostEmissionIntegral0, poolWeight0, POOLWEIGHTMULT)
458466 let poolUserBoostEmissionIntegral1 = fraction(userBoostEmissionIntegral1, poolWeight1, POOLWEIGHTMULT)
459467 let userBoostAvaliableToClaimTotalNew0 = if ((totalCachedGwxCorrected == 0))
460468 then 0
461469 else fraction(poolUserBoostEmissionIntegral0, userCurrGwx, totalCachedGwxCorrected)
462470 let userBoostAvaliableToClaimTotalNew1 = if ((totalCachedGwxCorrected == 0))
463471 then 0
464472 else fraction(poolUserBoostEmissionIntegral1, userCurrGwx, totalCachedGwxCorrected)
465473 let userBoostAvaliableToClaimTotalNew = (userBoostAvaliableToClaimTotalNew0 + userBoostAvaliableToClaimTotalNew1)
466474 let userBoostClaimedKEY = keyUserBoostClaimed(userNumStr)
467475 let userBoostClaimed = ioz(this, userBoostClaimedKEY)
468476 let userBoostAvailable = (userBoostAvaliableToClaimTotalNew - userBoostClaimed)
469477 let dataState = [IntegerEntry(userLpBoostEmissionLastIntegralKEY, boostEmissionIntegral)]
470478 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)], ":")
471479 $Tuple3(userBoostAvaliableToClaimTotalNew, dataState, debug)
472480 }
473481 }
474482 }
475483
476484
477485 func lockActions (i,duration) = {
478486 let cfgArray = readConfigArrayOrFail()
479487 let assetIdStr = cfgArray[IdxCfgAssetId]
480488 let assetId = fromBase58String(assetIdStr)
481489 let minLockAmount = parseIntValue(cfgArray[IdxCfgMinLockAmount])
482490 let minLockDuration = parseIntValue(cfgArray[IdxCfgMinLockDuration])
483491 let maxLockDuration = parseIntValue(cfgArray[IdxCfgMaxLockDuration])
484492 if ((size(i.payments) != 1))
485493 then throw("invalid payment - exact one payment must be attached")
486494 else {
487495 let pmt = i.payments[0]
488496 let pmtAmount = pmt.amount
489497 if ((assetId != value(pmt.assetId)))
490498 then throw((("invalid asset is in payment - " + assetIdStr) + " is expected"))
491499 else {
492500 let nextUserNumKEY = keyNextUserNum()
493501 let userAddressStr = toString(i.caller)
494502 let userIsExisting = isDefined(getString(keyUser2NumMapping(userAddressStr)))
495503 let userNumStr = if (userIsExisting)
496504 then value(getString(keyUser2NumMapping(userAddressStr)))
497505 else toString(iof(this, nextUserNumKEY))
498506 let userNum = parseIntValue(userNumStr)
499507 let lockStart = height
500508 let startBlockKEY = keyLockParamStartBlock(userNumStr)
501509 let durationKEY = keyLockParamDuration(userNumStr)
502510 let userAmountKEY = keyLockParamUserAmount(userNumStr)
503- if ((minLockAmount > pmtAmount))
511+ if (if ((minLockAmount > pmtAmount))
512+ then (i.caller != lpStakingPoolsContract)
513+ else false)
504514 then throw(("amount is less then minLockAmount=" + toString(minLockAmount)))
505515 else if ((minLockDuration > duration))
506516 then throw(("passed duration is less then minLockDuration=" + toString(minLockDuration)))
507517 else if ((duration > maxLockDuration))
508518 then throw(("passed duration is greater then maxLockDuration=" + toString(maxLockDuration)))
509519 else if (if (userIsExisting)
510520 then ((iof(this, startBlockKEY) + iof(this, durationKEY)) >= lockStart)
511521 else false)
512522 then throw("there is an active lock - consider to use increaseLock")
513523 else if ((ioz(this, userAmountKEY) > 0))
514524 then throw(("there are locked WXs - consider to use increaseLock " + userAmountKEY))
515525 else {
516526 let coeffX8 = fraction(duration, MULT8, maxLockDuration)
517527 let gWxAmountStart = fraction(pmtAmount, coeffX8, MULT8)
518528 let gWxParamsResultList = aal(invoke(mathContract, "calcGwxParamsREADONLY", [gWxAmountStart, lockStart, duration], nil))
519529 let k = ai(gWxParamsResultList[0])
520530 let b = ai(gWxParamsResultList[1])
521531 let period = toString(ai(gWxParamsResultList[2]))
522532 let wxEmissionPerBlock = iof(emissionContract, keyEmissionRatePerBlockCurrent())
523533 let emissionStart = iof(emissionContract, keyEmissionStartBlock())
524534 let emissionEnd = iof(emissionContract, keyEmissionEndBlock())
525535 let h = if ((height > emissionEnd))
526536 then emissionEnd
527537 else height
528538 let dh = max([(h - emissionStart), 0])
529539 let userBoostEmissionLastIntegralKEY = keyUserBoostEmissionLastINTEGRAL(userNumStr)
530540 let boostEmissionIntegral = (((wxEmissionPerBlock * dh) * 2) / 3)
531541 let userMaxBoostIntegralKEY = keyUserMaxBoostINTEGRAL(userNumStr)
532542 let totalMaxBoostIntegralKEY = keyTotalMaxBoostINTEGRAL()
533543 let userMaxBoostInt = ((gWxAmountStart * duration) / 2)
534544 let totalMaxBoostInt = ioz(this, totalMaxBoostIntegralKEY)
535545 let totalCachedGwxRaw = getTotalCachedGwx(false)
536546 let arr = if (userIsExisting)
537547 then nil
538548 else [IntegerEntry(nextUserNumKEY, (userNum + 1)), StringEntry(keyUser2NumMapping(userAddressStr), userNumStr), StringEntry(keyNum2UserMapping(userNumStr), userAddressStr)]
539549 $Tuple2(((((arr ++ LockParamsEntry(userAddressStr, userNumStr, pmtAmount, lockStart, duration, k, b, period)) ++ StatsEntry(pmtAmount, duration, 1, if (userIsExisting)
540550 then 0
541551 else 1)) :+ HistoryEntry("lock", userAddressStr, pmtAmount, lockStart, duration, k, b, i)) ++ [IntegerEntry(userBoostEmissionLastIntegralKEY, boostEmissionIntegral), IntegerEntry(keyTotalCachedGwx(), (totalCachedGwxRaw + gWxAmountStart))]), gWxAmountStart)
542552 }
543553 }
544554 }
545555 }
546556
547557
548558 @Callable(i)
549559 func constructor (factoryAddressStr,lockAssetIdStr,minLockAmount,minDuration,maxDuration,mathContract) = {
550560 let checkCaller = mustManager(i)
551561 if ((checkCaller == checkCaller))
552562 then ([IntegerEntry(keyNextUserNum(), 0), StringEntry(keyConfig(), formatConfig(lockAssetIdStr, minLockAmount, minDuration, maxDuration, mathContract)), StringEntry(keyFactoryAddress(), factoryAddressStr)] ++ StatsEntry(0, 0, 0, 0))
553563 else throw("Strict value is not equal to itself.")
554564 }
555565
556566
557567
558568 @Callable(i)
559569 func lockRef (duration,referrerAddress,signature) = {
560- let $t02389223957 = lockActions(i, duration)
561- let lockActionsResult = $t02389223957._1
562- let gWxAmountStart = $t02389223957._2
570+ let $t02436424429 = lockActions(i, duration)
571+ let lockActionsResult = $t02436424429._1
572+ let gWxAmountStart = $t02436424429._2
563573 let referralAddress = toString(i.caller)
564574 let refInv = if (if ((referrerAddress == ""))
565575 then true
566576 else (signature == base58''))
567577 then unit
568578 else invoke(referralsContractAddressOrFail, "createPair", [referralProgramName, referrerAddress, referralAddress, signature], nil)
569579 if ((refInv == refInv))
570580 then {
571581 let updateRefActivity = invoke(mathContract, "updateReferralActivity", [toString(i.caller), gWxAmountStart], nil)
572582 if ((updateRefActivity == updateRefActivity))
573583 then $Tuple2(lockActionsResult, unit)
574584 else throw("Strict value is not equal to itself.")
575585 }
576586 else throw("Strict value is not equal to itself.")
577587 }
578588
579589
580590
581591 @Callable(i)
582592 func lock (duration) = {
583- let $t02441524480 = lockActions(i, duration)
584- let lockActionsResult = $t02441524480._1
585- let gWxAmountStart = $t02441524480._2
593+ let $t02488724952 = lockActions(i, duration)
594+ let lockActionsResult = $t02488724952._1
595+ let gWxAmountStart = $t02488724952._2
586596 let updateRefActivity = invoke(mathContract, "updateReferralActivity", [toString(i.caller), gWxAmountStart], nil)
587597 if ((updateRefActivity == updateRefActivity))
588598 then $Tuple2(lockActionsResult, unit)
589599 else throw("Strict value is not equal to itself.")
590600 }
591601
592602
593603
594604 @Callable(i)
595605 func increaseLock (deltaDuration) = {
596606 let cfgArray = readConfigArrayOrFail()
597607 let assetIdStr = cfgArray[IdxCfgAssetId]
598608 let assetId = fromBase58String(assetIdStr)
599609 let minLockDuration = parseIntValue(cfgArray[IdxCfgMinLockDuration])
600610 let maxLockDuration = parseIntValue(cfgArray[IdxCfgMaxLockDuration])
601611 let pmtAmount = extractOptionalPaymentAmountOrFail(i, assetId)
602612 let userAddressStr = toString(i.caller)
603613 let userRecordArray = readLockParamsRecordOrFail(userAddressStr)
604614 let userNumStr = userRecordArray[IdxLockUserNum]
605615 let userAmount = parseIntValue(userRecordArray[IdxLockAmount])
606616 let lockStart = parseIntValue(userRecordArray[IdxLockStart])
607617 let lockDuration = parseIntValue(userRecordArray[IdxLockDuration])
608618 let lockEnd = (lockStart + lockDuration)
609619 let remainingDuration = max([(lockEnd - height), 0])
610620 let userAmountNew = (userAmount + pmtAmount)
611621 let lockDurationNew = (remainingDuration + deltaDuration)
612622 if ((0 > deltaDuration))
613623 then throw("duration is less then zero")
614624 else if ((minLockDuration > lockDurationNew))
615625 then throw(("lockDurationNew is less then minLockDuration=" + toString(minLockDuration)))
616626 else if ((lockDurationNew > maxLockDuration))
617627 then throw(("deltaDuration + existedLockDuration is greater then maxLockDuration=" + toString(maxLockDuration)))
618628 else {
619629 let coeffX8 = fraction(lockDurationNew, MULT8, maxLockDuration)
620630 let gWxAmountStart = fraction(userAmountNew, coeffX8, MULT8)
621631 let updateRefActivity = invoke(mathContract, "updateReferralActivity", [toString(i.caller), gWxAmountStart], nil)
622632 if ((updateRefActivity == updateRefActivity))
623633 then {
624634 let lockStartNew = height
625635 let gWxParamsResultList = aal(invoke(mathContract, "calcGwxParamsREADONLY", [gWxAmountStart, lockStartNew, lockDurationNew], nil))
626636 let k = ai(gWxParamsResultList[0])
627637 let b = ai(gWxParamsResultList[1])
628638 let period = toString(ai(gWxParamsResultList[2]))
629639 let wxEmissionPerBlock = iof(emissionContract, keyEmissionRatePerBlockCurrent())
630640 let emissionStart = iof(emissionContract, keyEmissionStartBlock())
631641 let emissionEnd = iof(emissionContract, keyEmissionEndBlock())
632642 let h = if ((height > emissionEnd))
633643 then emissionEnd
634644 else height
635645 let dh = max([(h - emissionStart), 0])
636646 let userBoostEmissionLastIntegralKEY = keyUserBoostEmissionLastINTEGRAL(userNumStr)
637647 let userBoostEmissionLastIntegral = ioz(this, userBoostEmissionLastIntegralKEY)
638648 let boostEmissionIntegral = (((wxEmissionPerBlock * dh) * 2) / 3)
639649 let userBoostEmissionIntegral = (boostEmissionIntegral - userBoostEmissionLastIntegral)
640650 if ((0 > userBoostEmissionIntegral))
641651 then throw("wrong calculations")
642652 else {
643653 let userMaxBoostIntegralKEY = keyUserMaxBoostINTEGRAL(userNumStr)
644654 let totalMaxBoostIntegralKEY = keyTotalMaxBoostINTEGRAL()
645655 let userMaxBoostInt = ioz(this, userMaxBoostIntegralKEY)
646656 let totalMaxBoostInt = ioz(this, totalMaxBoostIntegralKEY)
647657 let currUserGwx = calcCurrentGwxAmount(userAddressStr)
648658 let gwxDiff = (gWxAmountStart - currUserGwx)
649659 if ((0 > gwxDiff))
650660 then throw(("gwxDiff is less then 0: " + toString(gwxDiff)))
651661 else {
652662 let totalCachedGwxRaw = getTotalCachedGwx(false)
653663 let totalCachedGwxCorrected = getTotalCachedGwx(true)
654664 let userBoostAvalaibleToClaimTotalKEY = keyUserBoostAvalaibleToClaimTotal(userNumStr)
655665 let userBoostAvaliableToClaimTotal = ioz(this, userBoostAvalaibleToClaimTotalKEY)
656666 let userBoostAvaliableToClaimTotalNew = fraction(userBoostEmissionIntegral, currUserGwx, totalCachedGwxCorrected)
657667 let userMaxBoostIntNew = ((gWxAmountStart * lockDurationNew) / 2)
658668 let remainingUserMaxBoostInt = ((currUserGwx * remainingDuration) / 2)
659669 let userMaxBoostIntDiff = (userMaxBoostIntNew - remainingUserMaxBoostInt)
660670 (((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))])
661671 }
662672 }
663673 }
664674 else throw("Strict value is not equal to itself.")
665675 }
666676 }
667677
668678
669679
670680 @Callable(i)
671681 func claimWxBoost (lpAssetIdStr,userAddressStr) = if ((stakingContract != i.caller))
672682 then throw("permissions denied")
673683 else {
674- let $t02946129563 = internalClaimWxBoost(lpAssetIdStr, userAddressStr, false)
675- let userBoostAvailable = $t02946129563._1
676- let dataState = $t02946129563._2
677- let debug = $t02946129563._3
684+ let $t02993330035 = internalClaimWxBoost(lpAssetIdStr, userAddressStr, false)
685+ let userBoostAvailable = $t02993330035._1
686+ let dataState = $t02993330035._2
687+ let debug = $t02993330035._3
678688 $Tuple2(dataState, [userBoostAvailable])
679689 }
680690
681691
682692
683693 @Callable(i)
684694 func claimWxBoostREADONLY (lpAssetIdStr,userAddressStr) = {
685- let $t02969529796 = internalClaimWxBoost(lpAssetIdStr, userAddressStr, true)
686- let userBoostAvailable = $t02969529796._1
687- let dataState = $t02969529796._2
688- let debug = $t02969529796._3
695+ let $t03016730268 = internalClaimWxBoost(lpAssetIdStr, userAddressStr, true)
696+ let userBoostAvailable = $t03016730268._1
697+ let dataState = $t03016730268._2
698+ let debug = $t03016730268._3
689699 $Tuple2(nil, [userBoostAvailable, debug])
690700 }
691701
692702
693703
694704 @Callable(i)
695705 func unlock (userAddress) = {
696706 let userRecordArray = readLockParamsRecordOrFail(userAddress)
697707 let userNumStr = userRecordArray[IdxLockUserNum]
698708 let userAmount = parseIntValue(userRecordArray[IdxLockAmount])
699709 let lockStart = parseIntValue(userRecordArray[IdxLockStart])
700710 let lockDuration = parseIntValue(userRecordArray[IdxLockDuration])
701711 let lockEnd = (lockStart + lockDuration)
702712 let cfgArray = readConfigArrayOrFail()
703713 let assetId = fromBase58String(cfgArray[IdxCfgAssetId])
704714 if ((lockEnd >= height))
705715 then throw((("wait " + toString(lockEnd)) + " to unlock"))
706716 else if ((0 >= userAmount))
707717 then throw("nothing to unlock")
708718 else {
709719 let period = valueOrElse(getInteger(mathContract, keyNextPeriod()), 0)
710720 (((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))
711721 }
712722 }
713723
714724
715725
716726 @Callable(i)
717727 func gwxUserInfoREADONLY (userAddress) = {
718728 let gwxAmount = calcCurrentGwxAmount(userAddress)
719729 $Tuple2(nil, [gwxAmount])
730+ }
731+
732+
733+
734+@Callable(i)
735+func userMaxDurationREADONLY (userAddressStr) = {
736+ let cfgArray = readConfigArrayOrFail()
737+ let maxLockDuration = parseIntValue(cfgArray[IdxCfgMaxLockDuration])
738+ let userRecordOption = getString(this, keyLockParamsRecord(userAddressStr))
739+ if ((userRecordOption == unit))
740+ then $Tuple2(nil, $Tuple2("lock", maxLockDuration))
741+ else {
742+ let userRecordArray = split(value(userRecordOption), SEP)
743+ let lockStart = parseIntValue(userRecordArray[IdxLockStart])
744+ let lockDuration = parseIntValue(userRecordArray[IdxLockDuration])
745+ let lockEnd = (lockStart + lockDuration)
746+ let remainingDuration = max([(lockEnd - height), 0])
747+ let maxDeltaDuration = (maxLockDuration - remainingDuration)
748+ $Tuple2(nil, $Tuple2("increaseLock", maxDeltaDuration))
749+ }
720750 }
721751
722752
723753
724754 @Callable(i)
725755 func getUserGwxAmountAtHeightREADONLY (userAddress,targetHeight) = {
726756 let gwxAmount = calcUserGwxAmountAtHeight(userAddress, targetHeight)
727757 $Tuple2(nil, gwxAmount)
728758 }
729759
730760
731761
732762 @Callable(i)
733763 func getTotalCachedGwxREADONLY () = $Tuple2(nil, getTotalCachedGwx(true))
734764
735765
736766
737767 @Callable(i)
738768 func setManager (pendingManagerPublicKey) = {
739769 let checkCaller = mustManager(i)
740770 if ((checkCaller == checkCaller))
741771 then {
742772 let checkManagerPublicKey = fromBase58String(pendingManagerPublicKey)
743773 if ((checkManagerPublicKey == checkManagerPublicKey))
744774 then [StringEntry(keyPendingManagerPublicKey(), pendingManagerPublicKey)]
745775 else throw("Strict value is not equal to itself.")
746776 }
747777 else throw("Strict value is not equal to itself.")
748778 }
749779
750780
751781
752782 @Callable(i)
753783 func confirmManager () = {
754784 let pm = pendingManagerPublicKeyOrUnit()
755785 let hasPM = if (isDefined(pm))
756786 then true
757787 else throw("No pending manager")
758788 if ((hasPM == hasPM))
759789 then {
760790 let checkPM = if ((i.callerPublicKey == value(pm)))
761791 then true
762792 else throw("You are not pending manager")
763793 if ((checkPM == checkPM))
764794 then [StringEntry(keyManagerPublicKey(), toBase58String(value(pm))), DeleteEntry(keyPendingManagerPublicKey())]
765795 else throw("Strict value is not equal to itself.")
766796 }
767797 else throw("Strict value is not equal to itself.")
768798 }
769799
770800
771801 @Verifier(tx)
772802 func verify () = {
773803 let targetPublicKey = match managerPublicKeyOrUnit() {
774804 case pk: ByteVector =>
775805 pk
776806 case _: Unit =>
777807 tx.senderPublicKey
778808 case _ =>
779809 throw("Match error")
780810 }
781811 sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey)
782812 }
783813

github/deemru/w8io/026f985 
102.15 ms