tx · Exks2UkriPFqjRP5E8F3QS8vd8gYfCLqdJdYVVTQQwU1

3Myn55vLkduxbX3ZXfiDCZhaQsLxYp1kmCy:  -0.02300000 Waves

2023.02.15 15:58 [2450754] smart account 3Myn55vLkduxbX3ZXfiDCZhaQsLxYp1kmCy > SELF 0.00000000 Waves

{ "type": 13, "id": "Exks2UkriPFqjRP5E8F3QS8vd8gYfCLqdJdYVVTQQwU1", "fee": 2300000, "feeAssetId": null, "timestamp": 1676465943347, "version": 2, "chainId": 84, "sender": "3Myn55vLkduxbX3ZXfiDCZhaQsLxYp1kmCy", "senderPublicKey": "9W33iCCNfmFxUbiC6XZcH5x7f6xfwC7Jb3BoExT5q2PV", "proofs": [ "5ooLQnVwA4TFt8Ea9Sftt92mwwFx63oTgM5un41rmrnUAYh41wAuBN7cxjzVDvrhJcC1XD9VJn6fW1pDCgcAGDL5" ], "script": "base64:BgKbJggCEggKBggIAQEBCBIFCgMBCAISAwoBARIDCgEBEgQKAggIEgQKAggIEgMKAQgSAwoBCBIECgIIARIAEgMKAQgSACIDU0VQIgZTQ0FMRTgiBU1VTFQ4Ig5QT09MV0VJR0hUTVVMVCIHd3JhcEVyciIDbXNnIgh0aHJvd0VyciIEc3RyZiIHYWRkcmVzcyIDa2V5IgNpb3oiA2lvZCIKZGVmYXVsdFZhbCIDaW9mIgNhYnMiA3ZhbCIDYWFsIgckbWF0Y2gwIgp2YWxBbnlMeXN0IgJhaSIGdmFsSW50IhtrZXlSZWZlcnJhbHNDb250cmFjdEFkZHJlc3MiHnJlZmVycmFsc0NvbnRyYWN0QWRkcmVzc09yRmFpbCIWa2V5UmVmZXJyYWxQcm9ncmFtTmFtZSIacmVmZXJyYWxQcm9ncmFtTmFtZURlZmF1bHQiE3JlZmVycmFsUHJvZ3JhbU5hbWUiEWtleUZhY3RvcnlBZGRyZXNzIhhJZHhGYWN0b3J5Q2ZnU3Rha2luZ0RhcHAiGUlkeEZhY3RvcnlDZmdCb29zdGluZ0RhcHAiFElkeE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VzCQCRAwIIBQJlQQZwcm9vZnMAAAUCZUMmWFT+", "height": 2450754, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 2aqxbZWuHHMFndQpkSuvdwNXtU2oUhxgPx9M3XKQYnbL Next: BskLMfXpLaR9V9pDsWzAWTWriKeW8XPeQk4d2whGb51u 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
405411 func calcCurrentGwxAmount (userAddress) = calcUserGwxAmountAtHeight(userAddress, height)
406412
407413
414+func getVoteInfoREADONLY (lpAssetIdStr,userAddressStr) = {
415+ let userAddress = addressFromStringValue(userAddressStr)
416+ let idxAmountAssetId = 4
417+ let idxPriceAssetId = 5
418+ let poolCfg = {
419+ let @ = invoke(factoryContract, "getPoolConfigByLpAssetId", [lpAssetIdStr], nil)
420+ if ($isInstanceOf(@, "List[Any]"))
421+ then @
422+ else throw(($getType(@) + " couldn't be cast to List[Any]"))
423+ }
424+ let amountAssetId = {
425+ let @ = poolCfg[idxAmountAssetId]
426+ if ($isInstanceOf(@, "String"))
427+ then @
428+ else throw(($getType(@) + " couldn't be cast to String"))
429+ }
430+ let priceAssetId = {
431+ let @ = poolCfg[idxPriceAssetId]
432+ if ($isInstanceOf(@, "String"))
433+ then @
434+ else throw(($getType(@) + " couldn't be cast to String"))
435+ }
436+ let keyCurrentEpoch = makeString(["%s", "currentEpoch"], SEP)
437+ let lastFinalizedEpoch = {
438+ let epoch = (value(getInteger(this, keyCurrentEpoch)) - 1)
439+ if ((0 > epoch))
440+ then throwErr("invalid epoch")
441+ else epoch
442+ }
443+ func keyVote (pool,address,epoch) = makeString(["%s%s%s%s%d", "vote", amountAssetId, priceAssetId, toString(address), toString(epoch)], SEP)
444+
445+ func keyVotingResult (pool,epoch) = makeString(["%s%s%s%d", "votingResult", amountAssetId, priceAssetId, toString(epoch)], SEP)
446+
447+ let pool = $Tuple2(amountAssetId, priceAssetId)
448+ let userVote = valueOrElse(getInteger(this, keyVote(pool, userAddress, lastFinalizedEpoch)), 0)
449+ let poolResult = valueOrElse(getInteger(this, keyVotingResult(pool, lastFinalizedEpoch)), 0)
450+ $Tuple2(userVote, poolResult)
451+ }
452+
453+
408454 func internalClaimWxBoost (lpAssetIdStr,userAddressStr,readOnly) = {
409455 let EMPTY = "EMPTY"
410456 let userRecordOrEmpty = valueOrElse(getString(this, keyLockParamsRecord(userAddressStr)), EMPTY)
443489 let totalMaxBoostIntegralKEY = keyTotalMaxBoostINTEGRAL()
444490 let userMaxBoostInt = ioz(this, userMaxBoostIntegralKEY)
445491 let totalMaxBoostInt = ioz(this, totalMaxBoostIntegralKEY)
446- let $t01675316890 = {
447- let @ = invoke(votingEmissionContract, "getVoteInfoREADONLY", [lpAssetIdStr, userAddressStr], nil)
448- if ($isInstanceOf(@, "(Int, Int)"))
449- then @
450- else throw(($getType(@) + " couldn't be cast to (Int, Int)"))
451- }
452- let userVote = $t01675316890._1
453- let totalVotes = $t01675316890._2
492+ let $t01812418202 = getVoteInfoREADONLY(lpAssetIdStr, userAddressStr)
493+ let userVote = $t01812418202._1
494+ let totalVotes = $t01812418202._2
454495 let userBoostAvalaibleToClaimTotalKEY = keyUserBoostAvalaibleToClaimTotal(userNumStr)
455496 let userBoostAvaliableToClaimTotal = ioz(this, userBoostAvalaibleToClaimTotalKEY)
456497 let poolUserBoostEmissionIntegral = fraction(userBoostEmissionIntegral, poolWeight, POOLWEIGHTMULT)
551592
552593 @Callable(i)
553594 func lockRef (duration,referrerAddress,signature) = {
554- let $t02284222907 = lockActions(i, duration)
555- let lockActionsResult = $t02284222907._1
556- let gWxAmountStart = $t02284222907._2
595+ let $t02415424219 = lockActions(i, duration)
596+ let lockActionsResult = $t02415424219._1
597+ let gWxAmountStart = $t02415424219._2
557598 let referralAddress = toString(i.caller)
558599 let refInv = if (if ((referrerAddress == ""))
559600 then true
574615
575616 @Callable(i)
576617 func lock (duration) = {
577- let $t02336523430 = lockActions(i, duration)
578- let lockActionsResult = $t02336523430._1
579- let gWxAmountStart = $t02336523430._2
618+ let $t02467724742 = lockActions(i, duration)
619+ let lockActionsResult = $t02467724742._1
620+ let gWxAmountStart = $t02467724742._2
580621 let updateRefActivity = invoke(mathContract, "updateReferralActivity", [toString(i.caller), gWxAmountStart], nil)
581622 if ((updateRefActivity == updateRefActivity))
582623 then $Tuple2(lockActionsResult, unit)
665706 func claimWxBoost (lpAssetIdStr,userAddressStr) = if ((stakingContract != i.caller))
666707 then throw("permissions denied")
667708 else {
668- let $t02841128513 = internalClaimWxBoost(lpAssetIdStr, userAddressStr, false)
669- let userBoostAvailable = $t02841128513._1
670- let dataState = $t02841128513._2
671- let debug = $t02841128513._3
709+ let $t02972329825 = internalClaimWxBoost(lpAssetIdStr, userAddressStr, false)
710+ let userBoostAvailable = $t02972329825._1
711+ let dataState = $t02972329825._2
712+ let debug = $t02972329825._3
672713 $Tuple2(dataState, [userBoostAvailable])
673714 }
674715
676717
677718 @Callable(i)
678719 func claimWxBoostREADONLY (lpAssetIdStr,userAddressStr) = {
679- let $t02864528746 = internalClaimWxBoost(lpAssetIdStr, userAddressStr, true)
680- let userBoostAvailable = $t02864528746._1
681- let dataState = $t02864528746._2
682- let debug = $t02864528746._3
720+ let $t02995730058 = internalClaimWxBoost(lpAssetIdStr, userAddressStr, true)
721+ let userBoostAvailable = $t02995730058._1
722+ let dataState = $t02995730058._2
723+ let debug = $t02995730058._3
683724 $Tuple2(nil, [userBoostAvailable, debug])
684725 }
685726
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 keyBoostingV2StartHeight () = "%s%s__boostingV2__startBlock"
136142
137143
138144 func keyEmissionDurationInBlocks () = "%s%s__emission__duration"
139145
140146
141147 func keyEmissionEndBlock () = "%s%s__emission__endBlock"
142148
143149
144150 func keyNextPeriod () = "%s__nextPeriod"
145151
146152
147153 func keyGwxRewardEmissionStartHeight () = "%s%s__gwxRewardEmissionPart__startHeight"
148154
149155
150156 let IdxCfgAssetId = 1
151157
152158 let IdxCfgMinLockAmount = 2
153159
154160 let IdxCfgMinLockDuration = 3
155161
156162 let IdxCfgMaxLockDuration = 4
157163
158164 let IdxCfgMathContract = 5
159165
160166 func keyConfig () = "%s__config"
161167
162168
163169 func readConfigArrayOrFail () = split(strf(this, keyConfig()), SEP)
164170
165171
166172 let mathContract = addressFromStringValue(readConfigArrayOrFail()[IdxCfgMathContract])
167173
168174 func formatConfigS (assetId,minLockAmount,minLockDuration,maxLockDuration,mathContract) = makeString(["%s%d%d%d", assetId, minLockAmount, minLockDuration, maxLockDuration, mathContract], SEP)
169175
170176
171177 func formatConfig (assetId,minLockAmount,minLockDuration,maxLockDuration,mathContract) = formatConfigS(assetId, toString(minLockAmount), toString(minLockDuration), toString(maxLockDuration), mathContract)
172178
173179
174180 func managerPublicKeyOrUnit () = match getString(keyManagerPublicKey()) {
175181 case s: String =>
176182 fromBase58String(s)
177183 case _: Unit =>
178184 unit
179185 case _ =>
180186 throw("Match error")
181187 }
182188
183189
184190 func pendingManagerPublicKeyOrUnit () = match getString(keyPendingManagerPublicKey()) {
185191 case s: String =>
186192 fromBase58String(s)
187193 case _: Unit =>
188194 unit
189195 case _ =>
190196 throw("Match error")
191197 }
192198
193199
194200 func mustManager (i) = {
195201 let pd = throw("Permission denied")
196202 match managerPublicKeyOrUnit() {
197203 case pk: ByteVector =>
198204 if ((i.callerPublicKey == pk))
199205 then true
200206 else pd
201207 case _: Unit =>
202208 if ((i.caller == this))
203209 then true
204210 else pd
205211 case _ =>
206212 throw("Match error")
207213 }
208214 }
209215
210216
211217 let IdxLockUserNum = 1
212218
213219 let IdxLockAmount = 2
214220
215221 let IdxLockStart = 3
216222
217223 let IdxLockDuration = 4
218224
219225 let IdxLockParamK = 5
220226
221227 let IdxLockParamB = 6
222228
223229 func keyLockParamsRecord (userAddress) = makeString(["%s%s__lock", userAddress], SEP)
224230
225231
226232 func readLockParamsRecordOrFail (userAddress) = split(strf(this, keyLockParamsRecord(userAddress)), SEP)
227233
228234
229235 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)
230236
231237
232238 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))
233239
234240
235241 func keyNextUserNum () = "%s__nextUserNum"
236242
237243
238244 func keyUser2NumMapping (userAddress) = makeString(["%s%s%s__mapping__user2num", userAddress], SEP)
239245
240246
241247 func keyNum2UserMapping (num) = makeString(["%s%s%s__mapping__num2user", num], SEP)
242248
243249
244250 func keyLockParamUserAmount (userNum) = makeString(["%s%d%s__paramByUserNum", userNum, "amount"], SEP)
245251
246252
247253 func keyLockParamStartBlock (userNum) = makeString(["%s%d%s__paramByUserNum", userNum, "start"], SEP)
248254
249255
250256 func keyLockParamDuration (userNum) = makeString(["%s%d%s__paramByUserNum", userNum, "duration"], SEP)
251257
252258
253259 func keyLockParamK (userNum) = makeString(["%s%d%s__paramByUserNum", userNum, "k"], SEP)
254260
255261
256262 func keyLockParamB (userNum) = makeString(["%s%d%s__paramByUserNum", userNum, "b"], SEP)
257263
258264
259265 func keyLockParamByPeriodK (userNum,period) = makeString(["%s%d%s%d__paramByPeriod", userNum, "k", period], SEP)
260266
261267
262268 func keyLockParamByPeriodB (userNum,period) = makeString(["%s%d%s%d__paramByPeriod", userNum, "b", period], SEP)
263269
264270
265271 func keyLockParamTotalAmount () = "%s%s__stats__activeTotalLocked"
266272
267273
268274 func keyStatsLocksDurationSumInBlocks () = "%s%s__stats__locksDurationSumInBlocks"
269275
270276
271277 func keyStatsLocksCount () = "%s%s__stats__locksCount"
272278
273279
274280 func keyStatsUsersCount () = "%s%s__stats__activeUsersCount"
275281
276282
277283 func keyUserBoostEmissionLastINTEGRAL (userNum) = makeString(["%s%d__userBoostEmissionLastIntV2", userNum], SEP)
278284
279285
280286 func keyUserLpBoostEmissionLastINTEGRAL (userNum,lpAssetId) = makeString(["%s%d__userBoostEmissionLastIntV2", userNum, lpAssetId], SEP)
281287
282288
283289 func keyUserMaxBoostINTEGRAL (userNum) = makeString(["%s%d__maxBoostInt", userNum], SEP)
284290
285291
286292 func keyTotalMaxBoostINTEGRAL () = "%s%s__maxBoostInt__total"
287293
288294
289295 func keyUserBoostAvalaibleToClaimTotal (userNum) = makeString(["%s%d__userBoostAvaliableToClaimTotal", userNum], SEP)
290296
291297
292298 func keyUserBoostClaimed (userNum) = makeString(["%s%d__userBoostClaimed", userNum], SEP)
293299
294300
295301 func keyTotalCachedGwx () = "%s%s__gwxCached__total"
296302
297303
298304 func keyTotalCachedGwxCorrective () = "%s__gwxCachedTotalCorrective"
299305
300306
301307 let factoryContract = readFactoryAddressOrFail()
302308
303309 let factoryCfg = readFactoryCfgOrFail(factoryContract)
304310
305311 let emissionContract = getEmissionAddressOrFail(factoryCfg)
306312
307313 let stakingContract = getStakingAddressOrFail(factoryCfg)
308314
309315 let gwxRewardContract = getGwxRewardAddressOrFail(factoryCfg)
310316
311317 let keyVotingEmissionContract = makeString(["%s", "votingEmissionContract"], SEP)
312318
313319 let votingEmissionContract = addressFromStringValue(getStringValue(factoryContract, keyVotingEmissionContract))
314320
315321 let boostCoeff = {
316322 let @ = invoke(emissionContract, "getBoostCoeffREADONLY", nil, nil)
317323 if ($isInstanceOf(@, "Int"))
318324 then @
319325 else throw(($getType(@) + " couldn't be cast to Int"))
320326 }
321327
322328 func getTotalCachedGwx (correct) = {
323329 let keyCurrentEpochUi = makeString(["%s", "currentEpochUi"], SEP)
324330 let currentEpochUi = getIntegerValue(votingEmissionContract, keyCurrentEpochUi)
325331 let keyTargetEpoch = makeString(["%s%s", "totalCachedGwxCorrection__activationEpoch"], SEP)
326332 let targetEpochOption = getInteger(this, keyTargetEpoch)
327333 let totalCachedGwxRaw = valueOrElse(getInteger(this, keyTotalCachedGwx()), 0)
328334 let isCorrectionActivated = if (isDefined(targetEpochOption))
329335 then (currentEpochUi >= value(targetEpochOption))
330336 else false
331337 let corrective = if (if (isCorrectionActivated)
332338 then correct
333339 else false)
334340 then valueOrElse(getInteger(this, keyTotalCachedGwxCorrective()), 0)
335341 else 0
336342 max([0, (totalCachedGwxRaw + corrective)])
337343 }
338344
339345
340346 func HistoryEntry (type,user,amount,lockStart,duration,k,b,i) = {
341347 let historyKEY = makeString(["%s%s%s%s__history", type, user, toBase58String(i.transactionId)], SEP)
342348 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)
343349 StringEntry(historyKEY, historyDATA)
344350 }
345351
346352
347353 func StatsEntry (totalLockedInc,durationInc,lockCountInc,usersCountInc) = {
348354 let locksDurationSumInBlocksKEY = keyStatsLocksDurationSumInBlocks()
349355 let locksCountKEY = keyStatsLocksCount()
350356 let usersCountKEY = keyStatsUsersCount()
351357 let totalAmountKEY = keyLockParamTotalAmount()
352358 let locksDurationSumInBlocks = ioz(this, locksDurationSumInBlocksKEY)
353359 let locksCount = ioz(this, locksCountKEY)
354360 let usersCount = ioz(this, usersCountKEY)
355361 let totalAmount = ioz(this, totalAmountKEY)
356362 [IntegerEntry(locksDurationSumInBlocksKEY, (locksDurationSumInBlocks + durationInc)), IntegerEntry(locksCountKEY, (locksCount + lockCountInc)), IntegerEntry(usersCountKEY, (usersCount + usersCountInc)), IntegerEntry(totalAmountKEY, (totalAmount + totalLockedInc))]
357363 }
358364
359365
360366 func calcGwxAmount (kRaw,bRaw,h) = {
361367 let SCALE = 1000
362368 (((kRaw * h) + bRaw) / SCALE)
363369 }
364370
365371
366372 func LockParamsEntry (userAddress,userNum,amount,start,duration,k,b,period) = {
367373 let userAmountKEY = keyLockParamUserAmount(userNum)
368374 let startBlockKEY = keyLockParamStartBlock(userNum)
369375 let durationKEY = keyLockParamDuration(userNum)
370376 let kKEY = keyLockParamK(userNum)
371377 let bKEY = keyLockParamB(userNum)
372378 let kByPeriodKEY = keyLockParamByPeriodK(userNum, period)
373379 let bByPeriodKEY = keyLockParamByPeriodB(userNum, period)
374380 let gwxAmount = calcGwxAmount(k, b, height)
375381 [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))]
376382 }
377383
378384
379385 func extractOptionalPaymentAmountOrFail (i,expectedAssetId) = if ((size(i.payments) > 1))
380386 then throw("only one payment is allowed")
381387 else if ((size(i.payments) == 0))
382388 then 0
383389 else {
384390 let pmt = i.payments[0]
385391 if ((value(pmt.assetId) != expectedAssetId))
386392 then throw("invalid asset id in payment")
387393 else pmt.amount
388394 }
389395
390396
391397 func calcUserGwxAmountAtHeight (userAddress,targetHeight) = {
392398 let EMPTY = "empty"
393399 let user2NumMappingKEY = keyUser2NumMapping(userAddress)
394400 let userNum = valueOrElse(getString(user2NumMappingKEY), EMPTY)
395401 let k = valueOrElse(getInteger(keyLockParamK(userNum)), 0)
396402 let b = valueOrElse(getInteger(keyLockParamB(userNum)), 0)
397403 let gwxAmountCalc = calcGwxAmount(k, b, targetHeight)
398404 let gwxAmount = if ((0 > gwxAmountCalc))
399405 then 0
400406 else gwxAmountCalc
401407 gwxAmount
402408 }
403409
404410
405411 func calcCurrentGwxAmount (userAddress) = calcUserGwxAmountAtHeight(userAddress, height)
406412
407413
414+func getVoteInfoREADONLY (lpAssetIdStr,userAddressStr) = {
415+ let userAddress = addressFromStringValue(userAddressStr)
416+ let idxAmountAssetId = 4
417+ let idxPriceAssetId = 5
418+ let poolCfg = {
419+ let @ = invoke(factoryContract, "getPoolConfigByLpAssetId", [lpAssetIdStr], nil)
420+ if ($isInstanceOf(@, "List[Any]"))
421+ then @
422+ else throw(($getType(@) + " couldn't be cast to List[Any]"))
423+ }
424+ let amountAssetId = {
425+ let @ = poolCfg[idxAmountAssetId]
426+ if ($isInstanceOf(@, "String"))
427+ then @
428+ else throw(($getType(@) + " couldn't be cast to String"))
429+ }
430+ let priceAssetId = {
431+ let @ = poolCfg[idxPriceAssetId]
432+ if ($isInstanceOf(@, "String"))
433+ then @
434+ else throw(($getType(@) + " couldn't be cast to String"))
435+ }
436+ let keyCurrentEpoch = makeString(["%s", "currentEpoch"], SEP)
437+ let lastFinalizedEpoch = {
438+ let epoch = (value(getInteger(this, keyCurrentEpoch)) - 1)
439+ if ((0 > epoch))
440+ then throwErr("invalid epoch")
441+ else epoch
442+ }
443+ func keyVote (pool,address,epoch) = makeString(["%s%s%s%s%d", "vote", amountAssetId, priceAssetId, toString(address), toString(epoch)], SEP)
444+
445+ func keyVotingResult (pool,epoch) = makeString(["%s%s%s%d", "votingResult", amountAssetId, priceAssetId, toString(epoch)], SEP)
446+
447+ let pool = $Tuple2(amountAssetId, priceAssetId)
448+ let userVote = valueOrElse(getInteger(this, keyVote(pool, userAddress, lastFinalizedEpoch)), 0)
449+ let poolResult = valueOrElse(getInteger(this, keyVotingResult(pool, lastFinalizedEpoch)), 0)
450+ $Tuple2(userVote, poolResult)
451+ }
452+
453+
408454 func internalClaimWxBoost (lpAssetIdStr,userAddressStr,readOnly) = {
409455 let EMPTY = "EMPTY"
410456 let userRecordOrEmpty = valueOrElse(getString(this, keyLockParamsRecord(userAddressStr)), EMPTY)
411457 if ((userRecordOrEmpty == EMPTY))
412458 then $Tuple3(0, nil, "userRecord::is::empty")
413459 else {
414460 let userRecordArray = split(userRecordOrEmpty, SEP)
415461 let userNumStr = userRecordArray[IdxLockUserNum]
416462 let EMPTYSTR = "empty"
417463 let poolWeight = if ((lpAssetIdStr != EMPTYSTR))
418464 then {
419465 let poolAddressStr = valueOrErrorMessage(getString(factoryContract, keyFactoryLp2AssetsMapping(lpAssetIdStr)), ("unsupported lp asset " + lpAssetIdStr))
420466 getIntegerValue(factoryContract, keyFactoryPoolWeight(poolAddressStr))
421467 }
422468 else if (readOnly)
423469 then 0
424470 else throw(("not readonly mode: unsupported lp asset " + lpAssetIdStr))
425471 let wxEmissionPerBlock = iof(emissionContract, keyEmissionRatePerBlockCurrent())
426472 let boostingV2StartHeight = iof(emissionContract, keyBoostingV2StartHeight())
427473 let emissionEnd = iof(emissionContract, keyEmissionEndBlock())
428474 let h = if ((height > emissionEnd))
429475 then emissionEnd
430476 else height
431477 let dh = max([(h - boostingV2StartHeight), 0])
432478 let userLpBoostEmissionLastIntegralKEY = keyUserLpBoostEmissionLastINTEGRAL(userNumStr, lpAssetIdStr)
433479 let userBoostEmissionLastIntegralKEY = keyUserBoostEmissionLastINTEGRAL(userNumStr)
434480 let userBoostEmissionLastIntegral = valueOrElse(getInteger(this, userLpBoostEmissionLastIntegralKEY), ioz(this, userBoostEmissionLastIntegralKEY))
435481 let boostEmissionIntegral = (((wxEmissionPerBlock * dh) * (boostCoeff - 1)) / boostCoeff)
436482 let userBoostEmissionIntegral = (boostEmissionIntegral - userBoostEmissionLastIntegral)
437483 let udh = fraction(userBoostEmissionIntegral, boostCoeff, ((boostCoeff - 1) * wxEmissionPerBlock))
438484 let uLastH = (h - udh)
439485 if ((0 > userBoostEmissionIntegral))
440486 then throw("wrong calculations")
441487 else {
442488 let userMaxBoostIntegralKEY = keyUserMaxBoostINTEGRAL(userNumStr)
443489 let totalMaxBoostIntegralKEY = keyTotalMaxBoostINTEGRAL()
444490 let userMaxBoostInt = ioz(this, userMaxBoostIntegralKEY)
445491 let totalMaxBoostInt = ioz(this, totalMaxBoostIntegralKEY)
446- let $t01675316890 = {
447- let @ = invoke(votingEmissionContract, "getVoteInfoREADONLY", [lpAssetIdStr, userAddressStr], nil)
448- if ($isInstanceOf(@, "(Int, Int)"))
449- then @
450- else throw(($getType(@) + " couldn't be cast to (Int, Int)"))
451- }
452- let userVote = $t01675316890._1
453- let totalVotes = $t01675316890._2
492+ let $t01812418202 = getVoteInfoREADONLY(lpAssetIdStr, userAddressStr)
493+ let userVote = $t01812418202._1
494+ let totalVotes = $t01812418202._2
454495 let userBoostAvalaibleToClaimTotalKEY = keyUserBoostAvalaibleToClaimTotal(userNumStr)
455496 let userBoostAvaliableToClaimTotal = ioz(this, userBoostAvalaibleToClaimTotalKEY)
456497 let poolUserBoostEmissionIntegral = fraction(userBoostEmissionIntegral, poolWeight, POOLWEIGHTMULT)
457498 let userBoostAvaliableToClaimTotalNew = if ((totalVotes == 0))
458499 then 0
459500 else fraction(poolUserBoostEmissionIntegral, userVote, totalVotes)
460501 let userBoostClaimedKEY = keyUserBoostClaimed(userNumStr)
461502 let userBoostClaimed = ioz(this, userBoostClaimedKEY)
462503 let userBoostAvailable = (userBoostAvaliableToClaimTotalNew - userBoostClaimed)
463504 let dataState = [IntegerEntry(userLpBoostEmissionLastIntegralKEY, boostEmissionIntegral)]
464505 let debug = makeString([toString(userBoostEmissionLastIntegral), toString(userBoostEmissionIntegral), toString(userBoostClaimed), toString(userBoostAvailable), toString(poolWeight), toString(h), toString(udh), toString(uLastH), toString(userVote), toString(totalVotes)], ":")
465506 $Tuple3(userBoostAvaliableToClaimTotalNew, dataState, debug)
466507 }
467508 }
468509 }
469510
470511
471512 func lockActions (i,duration) = {
472513 let cfgArray = readConfigArrayOrFail()
473514 let assetIdStr = cfgArray[IdxCfgAssetId]
474515 let assetId = fromBase58String(assetIdStr)
475516 let minLockAmount = parseIntValue(cfgArray[IdxCfgMinLockAmount])
476517 let minLockDuration = parseIntValue(cfgArray[IdxCfgMinLockDuration])
477518 let maxLockDuration = parseIntValue(cfgArray[IdxCfgMaxLockDuration])
478519 if ((size(i.payments) != 1))
479520 then throw("invalid payment - exact one payment must be attached")
480521 else {
481522 let pmt = i.payments[0]
482523 let pmtAmount = pmt.amount
483524 if ((assetId != value(pmt.assetId)))
484525 then throw((("invalid asset is in payment - " + assetIdStr) + " is expected"))
485526 else {
486527 let nextUserNumKEY = keyNextUserNum()
487528 let userAddressStr = toString(i.caller)
488529 let userIsExisting = isDefined(getString(keyUser2NumMapping(userAddressStr)))
489530 let userNumStr = if (userIsExisting)
490531 then value(getString(keyUser2NumMapping(userAddressStr)))
491532 else toString(iof(this, nextUserNumKEY))
492533 let userNum = parseIntValue(userNumStr)
493534 let lockStart = height
494535 let startBlockKEY = keyLockParamStartBlock(userNumStr)
495536 let durationKEY = keyLockParamDuration(userNumStr)
496537 let userAmountKEY = keyLockParamUserAmount(userNumStr)
497538 if ((minLockAmount > pmtAmount))
498539 then throw(("amount is less then minLockAmount=" + toString(minLockAmount)))
499540 else if ((minLockDuration > duration))
500541 then throw(("passed duration is less then minLockDuration=" + toString(minLockDuration)))
501542 else if ((duration > maxLockDuration))
502543 then throw(("passed duration is greater then maxLockDuration=" + toString(maxLockDuration)))
503544 else if (if (userIsExisting)
504545 then ((iof(this, startBlockKEY) + iof(this, durationKEY)) >= lockStart)
505546 else false)
506547 then throw("there is an active lock - consider to use increaseLock")
507548 else if ((ioz(this, userAmountKEY) > 0))
508549 then throw(("there are locked WXs - consider to use increaseLock " + userAmountKEY))
509550 else {
510551 let coeffX8 = fraction(duration, MULT8, maxLockDuration)
511552 let gWxAmountStart = fraction(pmtAmount, coeffX8, MULT8)
512553 let gWxParamsResultList = aal(invoke(mathContract, "calcGwxParamsREADONLY", [gWxAmountStart, lockStart, duration], nil))
513554 let k = ai(gWxParamsResultList[0])
514555 let b = ai(gWxParamsResultList[1])
515556 let period = toString(ai(gWxParamsResultList[2]))
516557 let wxEmissionPerBlock = iof(emissionContract, keyEmissionRatePerBlockCurrent())
517558 let emissionStart = iof(emissionContract, keyEmissionStartBlock())
518559 let emissionEnd = iof(emissionContract, keyEmissionEndBlock())
519560 let h = if ((height > emissionEnd))
520561 then emissionEnd
521562 else height
522563 let dh = max([(h - emissionStart), 0])
523564 let userBoostEmissionLastIntegralKEY = keyUserBoostEmissionLastINTEGRAL(userNumStr)
524565 let boostEmissionIntegral = (((wxEmissionPerBlock * dh) * 2) / 3)
525566 let userMaxBoostIntegralKEY = keyUserMaxBoostINTEGRAL(userNumStr)
526567 let totalMaxBoostIntegralKEY = keyTotalMaxBoostINTEGRAL()
527568 let userMaxBoostInt = ((gWxAmountStart * duration) / 2)
528569 let totalMaxBoostInt = ioz(this, totalMaxBoostIntegralKEY)
529570 let totalCachedGwxRaw = getTotalCachedGwx(false)
530571 let arr = if (userIsExisting)
531572 then nil
532573 else [IntegerEntry(nextUserNumKEY, (userNum + 1)), StringEntry(keyUser2NumMapping(userAddressStr), userNumStr), StringEntry(keyNum2UserMapping(userNumStr), userAddressStr)]
533574 $Tuple2(((((arr ++ LockParamsEntry(userAddressStr, userNumStr, pmtAmount, lockStart, duration, k, b, period)) ++ StatsEntry(pmtAmount, duration, 1, if (userIsExisting)
534575 then 0
535576 else 1)) :+ HistoryEntry("lock", userAddressStr, pmtAmount, lockStart, duration, k, b, i)) ++ [IntegerEntry(userBoostEmissionLastIntegralKEY, boostEmissionIntegral), IntegerEntry(keyTotalCachedGwx(), (totalCachedGwxRaw + gWxAmountStart))]), gWxAmountStart)
536577 }
537578 }
538579 }
539580 }
540581
541582
542583 @Callable(i)
543584 func constructor (factoryAddressStr,lockAssetIdStr,minLockAmount,minDuration,maxDuration,mathContract) = {
544585 let checkCaller = mustManager(i)
545586 if ((checkCaller == checkCaller))
546587 then ([IntegerEntry(keyNextUserNum(), 0), StringEntry(keyConfig(), formatConfig(lockAssetIdStr, minLockAmount, minDuration, maxDuration, mathContract)), StringEntry(keyFactoryAddress(), factoryAddressStr)] ++ StatsEntry(0, 0, 0, 0))
547588 else throw("Strict value is not equal to itself.")
548589 }
549590
550591
551592
552593 @Callable(i)
553594 func lockRef (duration,referrerAddress,signature) = {
554- let $t02284222907 = lockActions(i, duration)
555- let lockActionsResult = $t02284222907._1
556- let gWxAmountStart = $t02284222907._2
595+ let $t02415424219 = lockActions(i, duration)
596+ let lockActionsResult = $t02415424219._1
597+ let gWxAmountStart = $t02415424219._2
557598 let referralAddress = toString(i.caller)
558599 let refInv = if (if ((referrerAddress == ""))
559600 then true
560601 else (signature == base58''))
561602 then unit
562603 else invoke(referralsContractAddressOrFail, "createPair", [referralProgramName, referrerAddress, referralAddress, signature], nil)
563604 if ((refInv == refInv))
564605 then {
565606 let updateRefActivity = invoke(mathContract, "updateReferralActivity", [toString(i.caller), gWxAmountStart], nil)
566607 if ((updateRefActivity == updateRefActivity))
567608 then $Tuple2(lockActionsResult, unit)
568609 else throw("Strict value is not equal to itself.")
569610 }
570611 else throw("Strict value is not equal to itself.")
571612 }
572613
573614
574615
575616 @Callable(i)
576617 func lock (duration) = {
577- let $t02336523430 = lockActions(i, duration)
578- let lockActionsResult = $t02336523430._1
579- let gWxAmountStart = $t02336523430._2
618+ let $t02467724742 = lockActions(i, duration)
619+ let lockActionsResult = $t02467724742._1
620+ let gWxAmountStart = $t02467724742._2
580621 let updateRefActivity = invoke(mathContract, "updateReferralActivity", [toString(i.caller), gWxAmountStart], nil)
581622 if ((updateRefActivity == updateRefActivity))
582623 then $Tuple2(lockActionsResult, unit)
583624 else throw("Strict value is not equal to itself.")
584625 }
585626
586627
587628
588629 @Callable(i)
589630 func increaseLock (deltaDuration) = {
590631 let cfgArray = readConfigArrayOrFail()
591632 let assetIdStr = cfgArray[IdxCfgAssetId]
592633 let assetId = fromBase58String(assetIdStr)
593634 let minLockDuration = parseIntValue(cfgArray[IdxCfgMinLockDuration])
594635 let maxLockDuration = parseIntValue(cfgArray[IdxCfgMaxLockDuration])
595636 let pmtAmount = extractOptionalPaymentAmountOrFail(i, assetId)
596637 let userAddressStr = toString(i.caller)
597638 let userRecordArray = readLockParamsRecordOrFail(userAddressStr)
598639 let userNumStr = userRecordArray[IdxLockUserNum]
599640 let userAmount = parseIntValue(userRecordArray[IdxLockAmount])
600641 let lockStart = parseIntValue(userRecordArray[IdxLockStart])
601642 let lockDuration = parseIntValue(userRecordArray[IdxLockDuration])
602643 let lockEnd = (lockStart + lockDuration)
603644 let remainingDuration = max([(lockEnd - height), 0])
604645 let userAmountNew = (userAmount + pmtAmount)
605646 let lockDurationNew = (remainingDuration + deltaDuration)
606647 if ((0 > deltaDuration))
607648 then throw("duration is less then zero")
608649 else if ((minLockDuration > lockDurationNew))
609650 then throw(("lockDurationNew is less then minLockDuration=" + toString(minLockDuration)))
610651 else if ((lockDurationNew > maxLockDuration))
611652 then throw(("deltaDuration + existedLockDuration is greater then maxLockDuration=" + toString(maxLockDuration)))
612653 else {
613654 let coeffX8 = fraction(lockDurationNew, MULT8, maxLockDuration)
614655 let gWxAmountStart = fraction(userAmountNew, coeffX8, MULT8)
615656 let updateRefActivity = invoke(mathContract, "updateReferralActivity", [toString(i.caller), gWxAmountStart], nil)
616657 if ((updateRefActivity == updateRefActivity))
617658 then {
618659 let lockStartNew = height
619660 let gWxParamsResultList = aal(invoke(mathContract, "calcGwxParamsREADONLY", [gWxAmountStart, lockStartNew, lockDurationNew], nil))
620661 let k = ai(gWxParamsResultList[0])
621662 let b = ai(gWxParamsResultList[1])
622663 let period = toString(ai(gWxParamsResultList[2]))
623664 let wxEmissionPerBlock = iof(emissionContract, keyEmissionRatePerBlockCurrent())
624665 let emissionStart = iof(emissionContract, keyEmissionStartBlock())
625666 let emissionEnd = iof(emissionContract, keyEmissionEndBlock())
626667 let h = if ((height > emissionEnd))
627668 then emissionEnd
628669 else height
629670 let dh = max([(h - emissionStart), 0])
630671 let userBoostEmissionLastIntegralKEY = keyUserBoostEmissionLastINTEGRAL(userNumStr)
631672 let userBoostEmissionLastIntegral = ioz(this, userBoostEmissionLastIntegralKEY)
632673 let boostEmissionIntegral = (((wxEmissionPerBlock * dh) * 2) / 3)
633674 let userBoostEmissionIntegral = (boostEmissionIntegral - userBoostEmissionLastIntegral)
634675 if ((0 > userBoostEmissionIntegral))
635676 then throw("wrong calculations")
636677 else {
637678 let userMaxBoostIntegralKEY = keyUserMaxBoostINTEGRAL(userNumStr)
638679 let totalMaxBoostIntegralKEY = keyTotalMaxBoostINTEGRAL()
639680 let userMaxBoostInt = ioz(this, userMaxBoostIntegralKEY)
640681 let totalMaxBoostInt = ioz(this, totalMaxBoostIntegralKEY)
641682 let currUserGwx = calcCurrentGwxAmount(userAddressStr)
642683 let gwxDiff = (gWxAmountStart - currUserGwx)
643684 if ((0 > gwxDiff))
644685 then throw(("gwxDiff is less then 0: " + toString(gwxDiff)))
645686 else {
646687 let totalCachedGwxRaw = getTotalCachedGwx(false)
647688 let totalCachedGwxCorrected = getTotalCachedGwx(true)
648689 let userBoostAvalaibleToClaimTotalKEY = keyUserBoostAvalaibleToClaimTotal(userNumStr)
649690 let userBoostAvaliableToClaimTotal = ioz(this, userBoostAvalaibleToClaimTotalKEY)
650691 let userBoostAvaliableToClaimTotalNew = fraction(userBoostEmissionIntegral, currUserGwx, totalCachedGwxCorrected)
651692 let userMaxBoostIntNew = ((gWxAmountStart * lockDurationNew) / 2)
652693 let remainingUserMaxBoostInt = ((currUserGwx * remainingDuration) / 2)
653694 let userMaxBoostIntDiff = (userMaxBoostIntNew - remainingUserMaxBoostInt)
654695 (((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))])
655696 }
656697 }
657698 }
658699 else throw("Strict value is not equal to itself.")
659700 }
660701 }
661702
662703
663704
664705 @Callable(i)
665706 func claimWxBoost (lpAssetIdStr,userAddressStr) = if ((stakingContract != i.caller))
666707 then throw("permissions denied")
667708 else {
668- let $t02841128513 = internalClaimWxBoost(lpAssetIdStr, userAddressStr, false)
669- let userBoostAvailable = $t02841128513._1
670- let dataState = $t02841128513._2
671- let debug = $t02841128513._3
709+ let $t02972329825 = internalClaimWxBoost(lpAssetIdStr, userAddressStr, false)
710+ let userBoostAvailable = $t02972329825._1
711+ let dataState = $t02972329825._2
712+ let debug = $t02972329825._3
672713 $Tuple2(dataState, [userBoostAvailable])
673714 }
674715
675716
676717
677718 @Callable(i)
678719 func claimWxBoostREADONLY (lpAssetIdStr,userAddressStr) = {
679- let $t02864528746 = internalClaimWxBoost(lpAssetIdStr, userAddressStr, true)
680- let userBoostAvailable = $t02864528746._1
681- let dataState = $t02864528746._2
682- let debug = $t02864528746._3
720+ let $t02995730058 = internalClaimWxBoost(lpAssetIdStr, userAddressStr, true)
721+ let userBoostAvailable = $t02995730058._1
722+ let dataState = $t02995730058._2
723+ let debug = $t02995730058._3
683724 $Tuple2(nil, [userBoostAvailable, debug])
684725 }
685726
686727
687728
688729 @Callable(i)
689730 func unlock (userAddress) = {
690731 let userRecordArray = readLockParamsRecordOrFail(userAddress)
691732 let userNumStr = userRecordArray[IdxLockUserNum]
692733 let userAmount = parseIntValue(userRecordArray[IdxLockAmount])
693734 let lockStart = parseIntValue(userRecordArray[IdxLockStart])
694735 let lockDuration = parseIntValue(userRecordArray[IdxLockDuration])
695736 let lockEnd = (lockStart + lockDuration)
696737 let cfgArray = readConfigArrayOrFail()
697738 let assetId = fromBase58String(cfgArray[IdxCfgAssetId])
698739 if ((lockEnd >= height))
699740 then throw((("wait " + toString(lockEnd)) + " to unlock"))
700741 else if ((0 >= userAmount))
701742 then throw("nothing to unlock")
702743 else {
703744 let period = valueOrElse(getInteger(mathContract, keyNextPeriod()), 0)
704745 (((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))
705746 }
706747 }
707748
708749
709750
710751 @Callable(i)
711752 func gwxUserInfoREADONLY (userAddress) = {
712753 let gwxAmount = calcCurrentGwxAmount(userAddress)
713754 $Tuple2(nil, [gwxAmount])
714755 }
715756
716757
717758
718759 @Callable(i)
719760 func getUserGwxAmountAtHeightREADONLY (userAddress,targetHeight) = {
720761 let gwxAmount = calcUserGwxAmountAtHeight(userAddress, targetHeight)
721762 $Tuple2(nil, gwxAmount)
722763 }
723764
724765
725766
726767 @Callable(i)
727768 func getTotalCachedGwxREADONLY () = $Tuple2(nil, getTotalCachedGwx(true))
728769
729770
730771
731772 @Callable(i)
732773 func setManager (pendingManagerPublicKey) = {
733774 let checkCaller = mustManager(i)
734775 if ((checkCaller == checkCaller))
735776 then {
736777 let checkManagerPublicKey = fromBase58String(pendingManagerPublicKey)
737778 if ((checkManagerPublicKey == checkManagerPublicKey))
738779 then [StringEntry(keyPendingManagerPublicKey(), pendingManagerPublicKey)]
739780 else throw("Strict value is not equal to itself.")
740781 }
741782 else throw("Strict value is not equal to itself.")
742783 }
743784
744785
745786
746787 @Callable(i)
747788 func confirmManager () = {
748789 let pm = pendingManagerPublicKeyOrUnit()
749790 let hasPM = if (isDefined(pm))
750791 then true
751792 else throw("No pending manager")
752793 if ((hasPM == hasPM))
753794 then {
754795 let checkPM = if ((i.callerPublicKey == value(pm)))
755796 then true
756797 else throw("You are not pending manager")
757798 if ((checkPM == checkPM))
758799 then [StringEntry(keyManagerPublicKey(), toBase58String(value(pm))), DeleteEntry(keyPendingManagerPublicKey())]
759800 else throw("Strict value is not equal to itself.")
760801 }
761802 else throw("Strict value is not equal to itself.")
762803 }
763804
764805
765806 @Verifier(tx)
766807 func verify () = {
767808 let targetPublicKey = match managerPublicKeyOrUnit() {
768809 case pk: ByteVector =>
769810 pk
770811 case _: Unit =>
771812 tx.senderPublicKey
772813 case _ =>
773814 throw("Match error")
774815 }
775816 sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey)
776817 }
777818

github/deemru/w8io/026f985 
95.24 ms