tx · 3XtQb5iVGAgH6CCTKnebu3M95kiD8t3sS8mkbYEvDs7u

3Myn55vLkduxbX3ZXfiDCZhaQsLxYp1kmCy:  -0.02500000 Waves

2023.08.30 13:35 [2733314] smart account 3Myn55vLkduxbX3ZXfiDCZhaQsLxYp1kmCy > SELF 0.00000000 Waves

{ "type": 13, "id": "3XtQb5iVGAgH6CCTKnebu3M95kiD8t3sS8mkbYEvDs7u", "fee": 2500000, "feeAssetId": null, "timestamp": 1693391778121, "version": 2, "chainId": 84, "sender": "3Myn55vLkduxbX3ZXfiDCZhaQsLxYp1kmCy", "senderPublicKey": "9W33iCCNfmFxUbiC6XZcH5x7f6xfwC7Jb3BoExT5q2PV", "proofs": [ "2e6C7YB4mMWAuAETviUJF9PSTNvcNkPyB2hMDHSERHbxtWacxDjwRDwmGw9uhH2w2idcvqor4h21cpi9gaVLFkQc" ], "script": "base64:BgLyLAgCEgUKAwEIAhIDCgEBEgQKAggIEgQKAggIEgMKAQgSAwoBCBIDCgEIEgQKAggBEgMKAQgSABIAEgUKAwgIBBIDCgEIEgMKAQgSBAoCCAgSBAoCCAgiA1NFUCIGU0NBTEU4IgVNVUxUOCIOUE9PTFdFSUdIVE1VTFQiEGNvbnRyYWN0RmlsZW5hbWUiB1NDQUxFMTgiBk1VTFQxOCIITVVMVDE4QkkiDkRFQ0FZX0NPTlNUQU5UIgd3cmFwRXJyIgNtc2ciCHRocm93RXJyIg9nZXRTdHJpbmdPckZhaWwiB2FkZHJlc3MiA2tleSIMZ2V0SW50T3JaZXJvIg9nZXRJbnRPckRlZmF1bHQiCmRlZmF1bHRWYWwiDGdldEludE9yRmFpbCIDYWJzIgN2YWwiDmVuc3VyZVBvc2l0aXZlIgF2IgFtIhtrZXlSZWZlcnJhbHNDb250cmFjdEFkZHJlc3MiHnJlZmVycmFsc0NvbnRyYWN0QWRkcmVzc09yRmFpbCIWa2V5UmVmZXJyYWxQcm9ncmFtTmFtZSIacmVmZXJyYWxQcm9ncmFtTmFtZURlZ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JAQJjVwEFAmJEAmFMARxnZXRVc2VyVm90ZUZpbmFsaXplZFJFQURPTkxZAgJiRAJiTAkAlAoCBQNuaWwJAQJjTAIFAmJEBQJiTAJhTAEhZ2V0VXNlclZvdGVTdGFrZWRJbnRlZ3JhbFJFQURPTkxZAgJiRAJiTAkAlAoCBQNuaWwJAQJkZwIFAmJEBQJiTAECZVIBAmVTAAQCZVQEAmFHCQECYUkAAwkAAQIFAmFHAgpCeXRlVmVjdG9yBAJhTgUCYUcFAmFOAwkAAQIFAmFHAgRVbml0CAUCZVIPc2VuZGVyUHVibGljS2V5CQACAQILTWF0Y2ggZXJyb3IJAPQDAwgFAmVSCWJvZHlCeXRlcwkAkQMCCAUCZVIGcHJvb2ZzAAAFAmVUitlkWA==", "height": 2733314, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: GewRLnZ119PVbVbseprJXCa52sqFbhT9maERQSVhkuAC Next: AJfoLY7Sbk8L34gs3UYKCYV3n36smMVUkSitSTmtmLfC Diff:
OldNewDifferences
695695 let wxClaimed = parseIntValue(userRecordArray[IdxLockWxClaimed])
696696 let t = ((height - lockStart) / blocksInPeriod)
697697 let exponent = fraction(toBigInt(t), (toBigInt((DECAY_CONSTANT * blocksInPeriod)) * MULT18BI), toBigInt(lockDuration))
698- let wxWithdrawable = if ((height > lockEnd))
698+ let wxWithdrawableTotal = if ((height > lockEnd))
699699 then userAmount
700- else (toInt(fraction(toBigInt(userAmount), (MULT18BI - pow(toBigInt(5), 1, exponent, SCALE18, SCALE18, DOWN)), MULT18BI)) - wxClaimed)
700+ else toInt(fraction(toBigInt(userAmount), (MULT18BI - pow(toBigInt(5), 1, exponent, SCALE18, SCALE18, DOWN)), MULT18BI))
701+ let wxWithdrawable = (wxWithdrawableTotal - wxClaimed)
701702 wxWithdrawable
702703 }
703704
704705
705706 @Callable(i)
706707 func lockRef (duration,referrerAddress,signature) = {
707- let $t02813628201 = lockActions(i, duration)
708- let lockActionsResult = $t02813628201._1
709- let gWxAmountStart = $t02813628201._2
708+ let $t02818428249 = lockActions(i, duration)
709+ let lockActionsResult = $t02818428249._1
710+ let gWxAmountStart = $t02818428249._2
710711 let referralAddress = toString(i.caller)
711712 let refInv = if (if ((referrerAddress == ""))
712713 then true
727728
728729 @Callable(i)
729730 func lock (duration) = {
730- let $t02865928724 = lockActions(i, duration)
731- let lockActionsResult = $t02865928724._1
732- let gWxAmountStart = $t02865928724._2
731+ let $t02870728772 = lockActions(i, duration)
732+ let lockActionsResult = $t02870728772._1
733+ let gWxAmountStart = $t02870728772._2
733734 let updateRefActivity = invoke(mathContract, "updateReferralActivity", [toString(i.caller), gWxAmountStart], nil)
734735 if ((updateRefActivity == updateRefActivity))
735736 then $Tuple2(lockActionsResult, unit)
742743 func claimWxBoost (lpAssetIdStr,userAddressStr) = if ((stakingContract != i.caller))
743744 then throwErr("permissions denied")
744745 else {
745- let $t02903429136 = internalClaimWxBoost(lpAssetIdStr, userAddressStr, false)
746- let userBoostAvailable = $t02903429136._1
747- let dataState = $t02903429136._2
748- let debug = $t02903429136._3
746+ let $t02908229184 = internalClaimWxBoost(lpAssetIdStr, userAddressStr, false)
747+ let userBoostAvailable = $t02908229184._1
748+ let dataState = $t02908229184._2
749+ let debug = $t02908229184._3
749750 $Tuple2(dataState, [userBoostAvailable])
750751 }
751752
753754
754755 @Callable(i)
755756 func claimWxBoostREADONLY (lpAssetIdStr,userAddressStr) = {
756- let $t02926829369 = internalClaimWxBoost(lpAssetIdStr, userAddressStr, true)
757- let userBoostAvailable = $t02926829369._1
758- let dataState = $t02926829369._2
759- let debug = $t02926829369._3
757+ let $t02931629417 = internalClaimWxBoost(lpAssetIdStr, userAddressStr, true)
758+ let userBoostAvailable = $t02931629417._1
759+ let dataState = $t02931629417._2
760+ let debug = $t02931629417._3
760761 $Tuple2(nil, [userBoostAvailable, debug])
761762 }
762763
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 DECAY_CONSTANT = 8
2121
2222 func wrapErr (msg) = makeString([contractFilename, ": ", msg], "")
2323
2424
2525 func throwErr (msg) = throw(wrapErr(msg))
2626
2727
2828 func getStringOrFail (address,key) = valueOrErrorMessage(getString(address, key), wrapErr((("mandatory this." + key) + " is not defined")))
2929
3030
3131 func getIntOrZero (address,key) = valueOrElse(getInteger(address, key), 0)
3232
3333
3434 func getIntOrDefault (address,key,defaultVal) = valueOrElse(getInteger(address, key), defaultVal)
3535
3636
3737 func getIntOrFail (address,key) = valueOrErrorMessage(getInteger(address, key), wrapErr((("mandatory this." + key) + " is not defined")))
3838
3939
4040 func abs (val) = if ((0 > val))
4141 then -(val)
4242 else val
4343
4444
4545 func ensurePositive (v,m) = if ((v >= 0))
4646 then v
4747 else throwErr((valueOrElse(m, "value") + " should be positive"))
4848
4949
5050 func keyReferralsContractAddress () = makeString(["%s%s", "config", "referralsContractAddress"], SEP)
5151
5252
5353 let referralsContractAddressOrFail = addressFromStringValue(getStringOrFail(this, keyReferralsContractAddress()))
5454
5555 let keyReferralProgramName = makeString(["%s%s", "referral", "programName"], SEP)
5656
5757 let referralProgramNameDefault = "wxlock"
5858
5959 let referralProgramName = valueOrElse(getString(this, keyReferralProgramName), referralProgramNameDefault)
6060
6161 func keyFactoryAddress () = "%s%s__config__factoryAddress"
6262
6363
6464 let IdxFactoryCfgStakingDapp = 1
6565
6666 let IdxFactoryCfgBoostingDapp = 2
6767
6868 let IdxFactoryCfgIdoDapp = 3
6969
7070 let IdxFactoryCfgTeamDapp = 4
7171
7272 let IdxFactoryCfgEmissionDapp = 5
7373
7474 let IdxFactoryCfgRestDapp = 6
7575
7676 let IdxFactoryCfgSlippageDapp = 7
7777
7878 let IdxFactoryCfgDaoDapp = 8
7979
8080 let IdxFactoryCfgMarketingDapp = 9
8181
8282 let IdxFactoryCfgGwxRewardDapp = 10
8383
8484 let IdxFactoryCfgBirdsDapp = 11
8585
8686 func keyFactoryCfg () = "%s__factoryConfig"
8787
8888
8989 func keyFactoryLpAssetToPoolContractAddress (lpAssetStr) = makeString(["%s%s%s", lpAssetStr, "mappings__lpAsset2PoolContract"], SEP)
9090
9191
9292 func keyFactoryPoolWeight (contractAddress) = makeString(["%s%s", "poolWeight", contractAddress], SEP)
9393
9494
9595 func keyFactoryPoolWeightHistory (poolAddress,num) = ((("%s%s__poolWeight__" + poolAddress) + "__") + toString(num))
9696
9797
9898 func readFactoryAddressOrFail () = addressFromStringValue(getStringOrFail(this, keyFactoryAddress()))
9999
100100
101101 func readFactoryCfgOrFail (factory) = split(getStringOrFail(factory, keyFactoryCfg()), SEP)
102102
103103
104104 func getBoostingAddressOrFail (factoryCfg) = addressFromStringValue(factoryCfg[IdxFactoryCfgBoostingDapp])
105105
106106
107107 func getEmissionAddressOrFail (factoryCfg) = addressFromStringValue(factoryCfg[IdxFactoryCfgEmissionDapp])
108108
109109
110110 func getStakingAddressOrFail (factoryCfg) = addressFromStringValue(factoryCfg[IdxFactoryCfgStakingDapp])
111111
112112
113113 func getGwxRewardAddressOrFail (factoryCfg) = addressFromStringValue(factoryCfg[IdxFactoryCfgGwxRewardDapp])
114114
115115
116116 func keyManagerPublicKey () = "%s__managerPublicKey"
117117
118118
119119 func keyManagerVaultAddress () = "%s__managerVaultAddress"
120120
121121
122122 func keyEmissionRatePerBlockCurrent () = "%s%s__ratePerBlock__current"
123123
124124
125125 func keyEmissionRatePerBlockMaxCurrent () = "%s%s__ratePerBlockMax__current"
126126
127127
128128 func keyEmissionStartBlock () = "%s%s__emission__startBlock"
129129
130130
131131 func keyBoostingV2LastUpdateHeight () = "%s%s__boostingV2__startBlock"
132132
133133
134134 func keyBoostingV2Integral () = "%s%s__boostingV2__integral"
135135
136136
137137 func keyEmissionDurationInBlocks () = "%s%s__emission__duration"
138138
139139
140140 func keyEmissionEndBlock () = "%s%s__emission__endBlock"
141141
142142
143143 let IdxCfgAssetId = 1
144144
145145 let IdxCfgMinLockAmount = 2
146146
147147 let IdxCfgMinLockDuration = 3
148148
149149 let IdxCfgMaxLockDuration = 4
150150
151151 let IdxCfgMathContract = 5
152152
153153 let IdxCfgBlocksInPeriod = 6
154154
155155 let IdxCfgLockStepBlocks = 7
156156
157157 func keyConfig () = "%s__config"
158158
159159
160160 func readConfigArrayOrFail () = split(getStringOrFail(this, keyConfig()), SEP)
161161
162162
163163 let cfgArray = readConfigArrayOrFail()
164164
165165 let assetId = fromBase58String(cfgArray[IdxCfgAssetId])
166166
167167 let minLockAmount = valueOrErrorMessage(parseInt(cfgArray[IdxCfgMinLockAmount]), wrapErr("invalid min lock amount"))
168168
169169 let minLockDuration = valueOrErrorMessage(parseInt(cfgArray[IdxCfgMinLockDuration]), wrapErr("invalid min lock duration"))
170170
171171 let maxLockDuration = valueOrErrorMessage(parseInt(cfgArray[IdxCfgMaxLockDuration]), wrapErr("invalid max lock duration"))
172172
173173 let mathContract = valueOrErrorMessage(addressFromString(cfgArray[IdxCfgMathContract]), wrapErr("invalid math contract address"))
174174
175175 let blocksInPeriod = valueOrErrorMessage(parseInt(cfgArray[IdxCfgBlocksInPeriod]), wrapErr("invalid blocks in period"))
176176
177177 let lockStepBlocks = valueOrErrorMessage(parseInt(cfgArray[IdxCfgLockStepBlocks]), wrapErr("invalid lock step blocks"))
178178
179179 func getManagerVaultAddressOrThis () = match getString(keyManagerVaultAddress()) {
180180 case s: String =>
181181 addressFromStringValue(s)
182182 case _ =>
183183 this
184184 }
185185
186186
187187 func managerPublicKeyOrUnit () = {
188188 let managerVaultAddress = getManagerVaultAddressOrThis()
189189 match getString(managerVaultAddress, keyManagerPublicKey()) {
190190 case s: String =>
191191 fromBase58String(s)
192192 case _: Unit =>
193193 unit
194194 case _ =>
195195 throw("Match error")
196196 }
197197 }
198198
199199
200200 func mustManager (i) = {
201201 let pd = throwErr("Permission denied")
202202 match managerPublicKeyOrUnit() {
203203 case pk: ByteVector =>
204204 if ((i.callerPublicKey == pk))
205205 then true
206206 else pd
207207 case _: Unit =>
208208 if ((i.caller == this))
209209 then true
210210 else pd
211211 case _ =>
212212 throw("Match error")
213213 }
214214 }
215215
216216
217217 let IdxLockAmount = 1
218218
219219 let IdxLockStart = 2
220220
221221 let IdxLockDuration = 3
222222
223223 let IdxLockLastUpdateTimestamp = 4
224224
225225 let IdxLockGwxAmount = 5
226226
227227 let IdxLockWxClaimed = 6
228228
229229 func keyLockParamsRecord (userAddress,txId) = makeString(["%s%s%s__lock", toString(userAddress), match txId {
230230 case b: ByteVector =>
231231 toBase58String(b)
232232 case _: Unit =>
233233 "legacy"
234234 case _ =>
235235 throw("Match error")
236236 }], SEP)
237237
238238
239239 func readLockParamsRecordOrFail (userAddress,txId) = split(getStringOrFail(this, keyLockParamsRecord(userAddress, txId)), SEP)
240240
241241
242242 func keyUserGwxAmountTotal (userAddress) = makeString(["%s%s__gwxAmountTotal", toString(userAddress)], SEP)
243243
244244
245245 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)
246246
247247
248248 func keyNextUserNum () = "%s__nextUserNum"
249249
250250
251251 func keyUser2NumMapping (userAddress) = makeString(["%s%s%s__mapping__user2num", userAddress], SEP)
252252
253253
254254 func keyNum2UserMapping (num) = makeString(["%s%s%s__mapping__num2user", num], SEP)
255255
256256
257257 func keyLockParamTotalAmount () = "%s%s__stats__activeTotalLocked"
258258
259259
260260 func keyStatsLocksDurationSumInBlocks () = "%s%s__stats__locksDurationSumInBlocks"
261261
262262
263263 func keyStatsLocksCount () = "%s%s__stats__locksCount"
264264
265265
266266 func keyStatsUsersCount () = "%s%s__stats__activeUsersCount"
267267
268268
269269 func keyUserBoostEmissionLastINTEGRAL (userNum) = makeString(["%s%d__userBoostEmissionLastIntV2", toString(userNum)], SEP)
270270
271271
272272 func keyUserLpBoostEmissionLastINTEGRAL (userNum,lpAssetId) = makeString(["%s%d__userBoostEmissionLastIntV2", toString(userNum), lpAssetId], SEP)
273273
274274
275275 func keyUserMaxBoostINTEGRAL (userNum) = makeString(["%s%d__maxBoostInt", toString(userNum)], SEP)
276276
277277
278278 func keyTotalMaxBoostINTEGRAL () = "%s%s__maxBoostInt__total"
279279
280280
281281 func keyUserBoostAvalaibleToClaimTotal (userNum) = makeString(["%s%d__userBoostAvaliableToClaimTotal", toString(userNum)], SEP)
282282
283283
284284 func keyUserBoostClaimed (userNum) = makeString(["%s%d__userBoostClaimed", toString(userNum)], SEP)
285285
286286
287287 func keyGwxTotal () = "%s%s__gwx__total"
288288
289289
290290 func keyVote (amountAssetId,priceAssetId,address,epoch) = makeString(["%s%s%s%s%d", "vote", amountAssetId, priceAssetId, toString(address), toString(epoch)], SEP)
291291
292292
293293 func keyStartHeightByEpoch (epoch) = makeString(["%s%d", "startHeight", toString(epoch)], SEP)
294294
295295
296296 func keyCurrentEpochUi () = makeString(["%s", "currentEpochUi"], SEP)
297297
298298
299299 func keyVotingResultStaked (lpAssetIdStr,epoch) = makeString(["%s%s%d", "votingResultStaked", lpAssetIdStr, toString(epoch)], SEP)
300300
301301
302302 func keyVotingResultStakedIntegral (lpAssetIdStr,epoch) = makeString(["%s%s%d", "votingResultStakedIntegral", lpAssetIdStr, toString(epoch)], SEP)
303303
304304
305305 func keyVotingResultStakedLastUpdateHeight (lpAssetIdStr,epoch) = makeString(["%s%s%d", "votingResultStakedIntegralLastUpdateHeight", lpAssetIdStr, toString(epoch)], SEP)
306306
307307
308308 func keyVotingResultStakedIntegralLast (lpAssetIdStr,address,epoch) = makeString(["%s%s%s%d", "votingResultStakedIntegralLast", lpAssetIdStr, toString(address), toString(epoch)], SEP)
309309
310310
311311 func keyVoteStakedIntegral (lpAssetIdStr,address,epoch) = makeString(["%s%s%s%d", "voteStakedIntegral", lpAssetIdStr, toString(address), toString(epoch)], SEP)
312312
313313
314314 func keyVoteStakedLastUpdateHeight (lpAssetIdStr,address,epoch) = makeString(["%s%s%s%d", "voteStakedIntegralLastUpdateHeight", lpAssetIdStr, toString(address), toString(epoch)], SEP)
315315
316316
317317 func keyVoteStakedIntegralLast (lpAssetIdStr,address,epoch) = makeString(["%s%s%s%d", "voteStakedIntegralLast", lpAssetIdStr, toString(address), toString(epoch)], SEP)
318318
319319
320320 func keyStakedByUser (userAddressStr,lpAssetIdStr) = makeString(["%s%s%s", "staked", userAddressStr, lpAssetIdStr], SEP)
321321
322322
323323 let factoryContract = readFactoryAddressOrFail()
324324
325325 let factoryCfg = readFactoryCfgOrFail(factoryContract)
326326
327327 let emissionContract = getEmissionAddressOrFail(factoryCfg)
328328
329329 let stakingContract = getStakingAddressOrFail(factoryCfg)
330330
331331 let gwxRewardContract = getGwxRewardAddressOrFail(factoryCfg)
332332
333333 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"))
334334
335335 let keyVotingEmissionContract = makeString(["%s", "votingEmissionContract"], SEP)
336336
337337 let votingEmissionContract = addressFromStringValue(getStringValue(factoryContract, keyVotingEmissionContract))
338338
339339 let keyVotingEmissionRateContract = makeString(["%s", "votingEmissionRateContract"], SEP)
340340
341341 let boostCoeff = {
342342 let @ = invoke(emissionContract, "getBoostCoeffREADONLY", nil, nil)
343343 if ($isInstanceOf(@, "Int"))
344344 then @
345345 else throw(($getType(@) + " couldn't be cast to Int"))
346346 }
347347
348348 func userNumberByAddressOrFail (userAddress) = match getString(this, keyUser2NumMapping(toString(userAddress))) {
349349 case s: String =>
350350 valueOrErrorMessage(parseInt(s), wrapErr("invalid user number"))
351351 case _: Unit =>
352352 throwErr("invalid user")
353353 case _ =>
354354 throw("Match error")
355355 }
356356
357357
358358 func getGwxAmountTotal () = valueOrElse(getInteger(this, keyGwxTotal()), 0)
359359
360360
361361 func getLockedGwxAmount (userAddress) = {
362362 let functionName = "getLockedGwxAmount"
363363 let votingEmissionRateContract = valueOrErrorMessage( match getString(votingEmissionContract, keyVotingEmissionRateContract) {
364364 case _: Unit =>
365365 unit
366366 case s: String =>
367367 addressFromString(s)
368368 case _ =>
369369 throw("Match error")
370370 }, wrapErr("invalid voting emission rate address"))
371371 let lockedVotingEmissionRate = {
372372 let @ = invoke(votingEmissionContract, functionName, [toString(userAddress)], nil)
373373 if ($isInstanceOf(@, "Int"))
374374 then @
375375 else throw(($getType(@) + " couldn't be cast to Int"))
376376 }
377377 let lockedVotingEmission = {
378378 let @ = invoke(votingEmissionRateContract, functionName, [toString(userAddress)], nil)
379379 if ($isInstanceOf(@, "Int"))
380380 then @
381381 else throw(($getType(@) + " couldn't be cast to Int"))
382382 }
383383 let locked = max([lockedVotingEmissionRate, lockedVotingEmission])
384384 locked
385385 }
386386
387387
388388 func HistoryEntry (type,user,amount,lockStart,duration,gwxAmount,i) = {
389389 let historyKEY = makeString(["%s%s%s%s__history", type, user, toBase58String(i.transactionId)], SEP)
390390 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)
391391 StringEntry(historyKEY, historyDATA)
392392 }
393393
394394
395395 func StatsEntry (totalLockedInc,durationInc,lockCountInc,usersCountInc) = {
396396 let locksDurationSumInBlocksKEY = keyStatsLocksDurationSumInBlocks()
397397 let locksCountKEY = keyStatsLocksCount()
398398 let usersCountKEY = keyStatsUsersCount()
399399 let totalAmountKEY = keyLockParamTotalAmount()
400400 let locksDurationSumInBlocks = getIntOrZero(this, locksDurationSumInBlocksKEY)
401401 let locksCount = getIntOrZero(this, locksCountKEY)
402402 let usersCount = getIntOrZero(this, usersCountKEY)
403403 let totalAmount = getIntOrZero(this, totalAmountKEY)
404404 [IntegerEntry(locksDurationSumInBlocksKEY, (locksDurationSumInBlocks + durationInc)), IntegerEntry(locksCountKEY, (locksCount + lockCountInc)), IntegerEntry(usersCountKEY, (usersCount + usersCountInc)), IntegerEntry(totalAmountKEY, (totalAmount + totalLockedInc))]
405405 }
406406
407407
408408 func LockParamsEntry (userAddress,txId,amount,start,duration,gwxAmount,wxClaimed) = [StringEntry(keyLockParamsRecord(userAddress, txId), formatLockParamsRecord(amount, start, duration, gwxAmount, wxClaimed))]
409409
410410
411411 func extractOptionalPaymentAmountOrFail (i,expectedAssetId) = if ((size(i.payments) > 1))
412412 then throwErr("only one payment is allowed")
413413 else if ((size(i.payments) == 0))
414414 then 0
415415 else {
416416 let pmt = i.payments[0]
417417 if ((value(pmt.assetId) != expectedAssetId))
418418 then throwErr("invalid asset id in payment")
419419 else pmt.amount
420420 }
421421
422422
423423 func getUserGwxAmountTotal (userAddress) = valueOrElse(getInteger(this, keyUserGwxAmountTotal(userAddress)), 0)
424424
425425
426426 func getVotingEmissionEpochInfo () = {
427427 let $t01451614806 = {
428428 let currentEpochUi = value(getInteger(votingEmissionContract, keyCurrentEpochUi()))
429429 let lastFinalizedEpoch = (currentEpochUi - 1)
430430 if ((0 > lastFinalizedEpoch))
431431 then throwErr("invalid epoch")
432432 else $Tuple2(currentEpochUi, lastFinalizedEpoch)
433433 }
434434 let currentEpochUi = $t01451614806._1
435435 let lastFinalizedEpoch = $t01451614806._2
436436 let currentEpochStartHeight = value(getInteger(votingEmissionContract, keyStartHeightByEpoch(currentEpochUi)))
437437 $Tuple2(lastFinalizedEpoch, currentEpochStartHeight)
438438 }
439439
440440
441441 func getPoolAssetsByLpAssetId (lpAssetIdStr) = {
442442 let idxAmountAssetId = 4
443443 let idxPriceAssetId = 5
444444 let poolCfg = {
445445 let @ = invoke(factoryContract, "getPoolConfigByLpAssetIdREADONLY", [lpAssetIdStr], nil)
446446 if ($isInstanceOf(@, "List[Any]"))
447447 then @
448448 else throw(($getType(@) + " couldn't be cast to List[Any]"))
449449 }
450450 let amountAssetId = {
451451 let @ = poolCfg[idxAmountAssetId]
452452 if ($isInstanceOf(@, "String"))
453453 then @
454454 else throw(($getType(@) + " couldn't be cast to String"))
455455 }
456456 let priceAssetId = {
457457 let @ = poolCfg[idxPriceAssetId]
458458 if ($isInstanceOf(@, "String"))
459459 then @
460460 else throw(($getType(@) + " couldn't be cast to String"))
461461 }
462462 $Tuple2(amountAssetId, priceAssetId)
463463 }
464464
465465
466466 func getUserVoteFinalized (lpAssetIdStr,userAddressStr) = {
467467 let userAddress = addressFromStringValue(userAddressStr)
468468 let $t01549715577 = getVotingEmissionEpochInfo()
469469 let lastFinalizedEpoch = $t01549715577._1
470470 let currentEpochStartHeight = $t01549715577._2
471471 let $t01558015655 = getPoolAssetsByLpAssetId(lpAssetIdStr)
472472 let amountAssetId = $t01558015655._1
473473 let priceAssetId = $t01558015655._2
474474 let userVoteKey = keyVote(amountAssetId, priceAssetId, userAddress, lastFinalizedEpoch)
475475 let userVote = valueOrElse(getInteger(votingEmissionContract, userVoteKey), 0)
476476 userVote
477477 }
478478
479479
480480 func getUserVoteStaked (lpAssetIdStr,userAddressStr) = {
481481 let stakedByUser = valueOrElse(getInteger(stakingContract, keyStakedByUser(userAddressStr, lpAssetIdStr)), 0)
482482 let userVote = getUserVoteFinalized(lpAssetIdStr, userAddressStr)
483483 if ((stakedByUser == 0))
484484 then 0
485485 else userVote
486486 }
487487
488488
489489 func getVotingResultStaked (lpAssetIdStr) = {
490490 let $t01619916279 = getVotingEmissionEpochInfo()
491491 let lastFinalizedEpoch = $t01619916279._1
492492 let currentEpochStartHeight = $t01619916279._2
493493 let votingResultStakedStart = valueOrElse(getInteger(votingEmissionContract, keyVotingResultStaked(lpAssetIdStr, lastFinalizedEpoch)), 0)
494494 let votingResultStaked = valueOrElse(getInteger(this, keyVotingResultStaked(lpAssetIdStr, lastFinalizedEpoch)), votingResultStakedStart)
495495 votingResultStaked
496496 }
497497
498498
499499 func getVotingResultStakedIntegral (lpAssetIdStr) = {
500500 let $t01664116721 = getVotingEmissionEpochInfo()
501501 let lastFinalizedEpoch = $t01664116721._1
502502 let currentEpochStartHeight = $t01664116721._2
503503 let votingResultStaked = getVotingResultStaked(lpAssetIdStr)
504504 let votingResultStakedIntegralPrev = valueOrElse(getInteger(this, keyVotingResultStakedIntegral(lpAssetIdStr, lastFinalizedEpoch)), 0)
505505 let votingResultStakedLastUpdateHeight = valueOrElse(getInteger(this, keyVotingResultStakedLastUpdateHeight(lpAssetIdStr, lastFinalizedEpoch)), currentEpochStartHeight)
506506 let votingResultStakedIntegralDh = (height - votingResultStakedLastUpdateHeight)
507507 let votingResultStakedIntegral = ((votingResultStakedIntegralDh * votingResultStaked) + votingResultStakedIntegralPrev)
508508 votingResultStakedIntegral
509509 }
510510
511511
512512 func refreshVotingResultStakedIntegral (lpAssetIdStr,stakedVoteDelta) = {
513513 let $t01755817638 = getVotingEmissionEpochInfo()
514514 let lastFinalizedEpoch = $t01755817638._1
515515 let currentEpochStartHeight = $t01755817638._2
516516 let votingResultStaked = getVotingResultStaked(lpAssetIdStr)
517517 let votingResultStakedNew = (votingResultStaked + stakedVoteDelta)
518518 let votingResultStakedIntegral = getVotingResultStakedIntegral(lpAssetIdStr)
519519 [IntegerEntry(keyVotingResultStaked(lpAssetIdStr, lastFinalizedEpoch), votingResultStakedNew), IntegerEntry(keyVotingResultStakedLastUpdateHeight(lpAssetIdStr, lastFinalizedEpoch), height), IntegerEntry(keyVotingResultStakedIntegral(lpAssetIdStr, lastFinalizedEpoch), votingResultStakedIntegral)]
520520 }
521521
522522
523523 func getUserVoteStakedIntegral (lpAssetIdStr,userAddressStr) = {
524524 let $t01824918329 = getVotingEmissionEpochInfo()
525525 let lastFinalizedEpoch = $t01824918329._1
526526 let currentEpochStartHeight = $t01824918329._2
527527 let userAddress = addressFromStringValue(userAddressStr)
528528 let userVoteStaked = getUserVoteStaked(lpAssetIdStr, userAddressStr)
529529 let userVoteStakedIntegralPrev = valueOrElse(getInteger(this, keyVoteStakedIntegral(lpAssetIdStr, userAddress, lastFinalizedEpoch)), 0)
530530 let userVoteStakedLastUpdateHeight = valueOrElse(getInteger(this, keyVoteStakedLastUpdateHeight(lpAssetIdStr, userAddress, lastFinalizedEpoch)), currentEpochStartHeight)
531531 let userVoteStakedIntegralDh = (height - userVoteStakedLastUpdateHeight)
532532 let userVoteStakedIntegral = ((userVoteStakedIntegralDh * userVoteStaked) + userVoteStakedIntegralPrev)
533533 userVoteStakedIntegral
534534 }
535535
536536
537537 func refreshVoteStakedIntegral (lpAssetIdStr,userAddressStr,edge) = {
538538 let $t01911719197 = getVotingEmissionEpochInfo()
539539 let lastFinalizedEpoch = $t01911719197._1
540540 let currentEpochStartHeight = $t01911719197._2
541541 let userAddress = addressFromStringValue(userAddressStr)
542542 let userVoteFinalized = getUserVoteFinalized(lpAssetIdStr, userAddressStr)
543543 let actions = if ((userVoteFinalized == 0))
544544 then nil
545545 else {
546546 let stakedVoteDelta = if (edge)
547547 then userVoteFinalized
548548 else -(userVoteFinalized)
549549 let votingResultActions = refreshVotingResultStakedIntegral(lpAssetIdStr, stakedVoteDelta)
550550 let userVoteStakedIntegral = getUserVoteStakedIntegral(lpAssetIdStr, userAddressStr)
551551 let voteActions = [IntegerEntry(keyVoteStakedLastUpdateHeight(lpAssetIdStr, userAddress, lastFinalizedEpoch), height), IntegerEntry(keyVoteStakedIntegral(lpAssetIdStr, userAddress, lastFinalizedEpoch), userVoteStakedIntegral)]
552552 (votingResultActions ++ voteActions)
553553 }
554554 actions
555555 }
556556
557557
558558 func getStakedVotesIntegralsDiff (lpAssetIdStr,userAddressStr) = {
559559 let $t02005120131 = getVotingEmissionEpochInfo()
560560 let lastFinalizedEpoch = $t02005120131._1
561561 let currentEpochStartHeight = $t02005120131._2
562562 let userAddress = addressFromStringValue(userAddressStr)
563563 let userVoteStakedIntegralLastKey = keyVoteStakedIntegralLast(lpAssetIdStr, userAddress, lastFinalizedEpoch)
564564 let userVoteStakedIntegralLast = valueOrElse(getInteger(this, userVoteStakedIntegralLastKey), 0)
565565 let votingResultStakedIntegralLastKey = keyVotingResultStakedIntegralLast(lpAssetIdStr, userAddress, lastFinalizedEpoch)
566566 let votingResultStakedIntegralLast = valueOrElse(getInteger(this, votingResultStakedIntegralLastKey), 0)
567567 let userVoteStakedIntegral = getUserVoteStakedIntegral(lpAssetIdStr, userAddressStr)
568568 let votingResultStakedIntegral = getVotingResultStakedIntegral(lpAssetIdStr)
569569 let userVoteStakedIntegralDiff = (userVoteStakedIntegral - userVoteStakedIntegralLast)
570570 let votingResultStakedIntegralDiff = (votingResultStakedIntegral - votingResultStakedIntegralLast)
571571 $Tuple3([IntegerEntry(userVoteStakedIntegralLastKey, userVoteStakedIntegral), IntegerEntry(votingResultStakedIntegralLastKey, votingResultStakedIntegral)], userVoteStakedIntegralDiff, votingResultStakedIntegralDiff)
572572 }
573573
574574
575575 func refreshBoostEmissionIntegral () = {
576576 let wxEmissionPerBlock = getIntOrFail(emissionContract, keyEmissionRatePerBlockCurrent())
577577 let boostingV2LastUpdateHeightOption = getInteger(this, keyBoostingV2LastUpdateHeight())
578578 let boostingV2IngergalOption = getInteger(this, keyBoostingV2Integral())
579579 let emissionEnd = getIntOrFail(emissionContract, keyEmissionEndBlock())
580580 let h = if ((height > emissionEnd))
581581 then emissionEnd
582582 else height
583583 let dh = match boostingV2LastUpdateHeightOption {
584584 case lastUpdateHeight: Int =>
585585 max([(h - lastUpdateHeight), 0])
586586 case _: Unit =>
587587 0
588588 case _ =>
589589 throw("Match error")
590590 }
591591 let boostEmissionPerBlock = ((wxEmissionPerBlock * (boostCoeff - 1)) / boostCoeff)
592592 let boostEmissionIntegralPrev = valueOrElse(boostingV2IngergalOption, 0)
593593 let boostEmissionIntegral = ((boostEmissionPerBlock * dh) + boostEmissionIntegralPrev)
594594 $Tuple2([IntegerEntry(keyBoostingV2Integral(), boostEmissionIntegral), IntegerEntry(keyBoostingV2LastUpdateHeight(), height)], boostEmissionIntegral)
595595 }
596596
597597
598598 func internalClaimWxBoost (lpAssetIdStr,userAddressStr,readOnly) = {
599599 let userAddress = valueOrErrorMessage(addressFromString(userAddressStr), wrapErr("invalid user address"))
600600 let userNum = userNumberByAddressOrFail(userAddress)
601601 if ((userNum == userNum))
602602 then {
603603 let EMPTYSTR = "empty"
604604 let poolWeight = if ((lpAssetIdStr != EMPTYSTR))
605605 then {
606606 let poolAddressStr = valueOrErrorMessage(getString(factoryContract, keyFactoryLpAssetToPoolContractAddress(lpAssetIdStr)), wrapErr(("unsupported lp asset " + lpAssetIdStr)))
607607 getIntegerValue(factoryContract, keyFactoryPoolWeight(poolAddressStr))
608608 }
609609 else if (readOnly)
610610 then 0
611611 else throwErr(("not readonly mode: unsupported lp asset " + lpAssetIdStr))
612612 let userLpBoostEmissionLastIntegralKEY = keyUserLpBoostEmissionLastINTEGRAL(userNum, lpAssetIdStr)
613613 let userBoostEmissionLastIntegralKEY = keyUserBoostEmissionLastINTEGRAL(userNum)
614614 let userBoostEmissionLastIntegral = valueOrElse(getInteger(this, userLpBoostEmissionLastIntegralKEY), getIntOrZero(this, userBoostEmissionLastIntegralKEY))
615615 let boostEmissionIntegral = refreshBoostEmissionIntegral()._2
616616 let userBoostEmissionIntegral = (boostEmissionIntegral - userBoostEmissionLastIntegral)
617617 if ((0 > userBoostEmissionIntegral))
618618 then throwErr("wrong calculations")
619619 else {
620620 let $t02367323812 = getStakedVotesIntegralsDiff(lpAssetIdStr, userAddressStr)
621621 let stakedVotesIntegralsActions = $t02367323812._1
622622 let userVoteIntegralDiff = $t02367323812._2
623623 let totalVotesIntegralDiff = $t02367323812._3
624624 let poolUserBoostEmissionIntegral = fraction(userBoostEmissionIntegral, poolWeight, POOLWEIGHTMULT)
625625 let userBoostAvaliableToClaimTotalNew = if ((totalVotesIntegralDiff == 0))
626626 then 0
627627 else fraction(poolUserBoostEmissionIntegral, userVoteIntegralDiff, totalVotesIntegralDiff)
628628 let dataState = ([IntegerEntry(userLpBoostEmissionLastIntegralKEY, boostEmissionIntegral)] ++ stakedVotesIntegralsActions)
629629 let debug = makeString([toString(userBoostEmissionLastIntegral), toString(userBoostEmissionIntegral), toString(poolWeight), toString(userVoteIntegralDiff), toString(totalVotesIntegralDiff)], ":")
630630 $Tuple3(userBoostAvaliableToClaimTotalNew, dataState, debug)
631631 }
632632 }
633633 else throw("Strict value is not equal to itself.")
634634 }
635635
636636
637637 func lockActions (i,duration) = {
638638 let assetIdStr = toBase58String(assetId)
639639 if ((size(i.payments) != 1))
640640 then throwErr("invalid payment - exact one payment must be attached")
641641 else {
642642 let pmt = i.payments[0]
643643 let pmtAmount = pmt.amount
644644 if ((assetId != value(pmt.assetId)))
645645 then throwErr((("invalid asset is in payment - " + assetIdStr) + " is expected"))
646646 else {
647647 let nextUserNumKEY = keyNextUserNum()
648648 let userAddress = i.caller
649649 let userAddressStr = toString(userAddress)
650650 let userIsExisting = isDefined(getString(keyUser2NumMapping(userAddressStr)))
651651 let userNumStr = if (userIsExisting)
652652 then value(getString(keyUser2NumMapping(userAddressStr)))
653653 else toString(getIntOrFail(this, nextUserNumKEY))
654654 let userNum = parseIntValue(userNumStr)
655655 let lockStart = height
656656 if (if ((minLockAmount > pmtAmount))
657657 then (userAddress != lpStakingPoolsContract)
658658 else false)
659659 then throwErr(("amount is less then minLockAmount=" + toString(minLockAmount)))
660660 else if ((minLockDuration > duration))
661661 then throwErr(("passed duration is less than minLockDuration=" + toString(minLockDuration)))
662662 else if ((duration > maxLockDuration))
663663 then throwErr(("passed duration is greater than maxLockDuration=" + toString(maxLockDuration)))
664664 else if (((duration % lockStepBlocks) != 0))
665665 then throwErr(("duration must be multiple of lockStepBlocks=" + toString(lockStepBlocks)))
666666 else {
667667 let gWxAmountStart = fraction(pmtAmount, duration, maxLockDuration)
668668 let gwxAmountTotal = getGwxAmountTotal()
669669 let userBoostEmissionLastIntegralKEY = keyUserBoostEmissionLastINTEGRAL(userNum)
670670 let boostEmissionIntegral = refreshBoostEmissionIntegral()._2
671671 let userGwxAmountTotal = getUserGwxAmountTotal(userAddress)
672672 let gwxRewardInv = invoke(gwxRewardContract, "refreshUserReward", [userAddress.bytes, userNum], nil)
673673 if ((gwxRewardInv == gwxRewardInv))
674674 then {
675675 let arr = if (userIsExisting)
676676 then nil
677677 else [IntegerEntry(nextUserNumKEY, (userNum + 1)), StringEntry(keyUser2NumMapping(userAddressStr), userNumStr), StringEntry(keyNum2UserMapping(userNumStr), userAddressStr)]
678678 $Tuple2(((((arr ++ LockParamsEntry(userAddress, i.transactionId, pmtAmount, lockStart, duration, gWxAmountStart, 0)) ++ StatsEntry(pmtAmount, duration, 1, if (userIsExisting)
679679 then 0
680680 else 1)) :+ HistoryEntry("lock", userAddressStr, pmtAmount, lockStart, duration, gWxAmountStart, i)) ++ [IntegerEntry(userBoostEmissionLastIntegralKEY, boostEmissionIntegral), IntegerEntry(keyGwxTotal(), (gwxAmountTotal + gWxAmountStart)), IntegerEntry(keyUserGwxAmountTotal(userAddress), (userGwxAmountTotal + gWxAmountStart))]), gWxAmountStart)
681681 }
682682 else throw("Strict value is not equal to itself.")
683683 }
684684 }
685685 }
686686 }
687687
688688
689689 func getWxWithdrawable (userAddress,txIdOption) = {
690690 let userRecordArray = readLockParamsRecordOrFail(userAddress, txIdOption)
691691 let userAmount = parseIntValue(userRecordArray[IdxLockAmount])
692692 let lockStart = parseIntValue(userRecordArray[IdxLockStart])
693693 let lockDuration = parseIntValue(userRecordArray[IdxLockDuration])
694694 let lockEnd = (lockStart + lockDuration)
695695 let wxClaimed = parseIntValue(userRecordArray[IdxLockWxClaimed])
696696 let t = ((height - lockStart) / blocksInPeriod)
697697 let exponent = fraction(toBigInt(t), (toBigInt((DECAY_CONSTANT * blocksInPeriod)) * MULT18BI), toBigInt(lockDuration))
698- let wxWithdrawable = if ((height > lockEnd))
698+ let wxWithdrawableTotal = if ((height > lockEnd))
699699 then userAmount
700- else (toInt(fraction(toBigInt(userAmount), (MULT18BI - pow(toBigInt(5), 1, exponent, SCALE18, SCALE18, DOWN)), MULT18BI)) - wxClaimed)
700+ else toInt(fraction(toBigInt(userAmount), (MULT18BI - pow(toBigInt(5), 1, exponent, SCALE18, SCALE18, DOWN)), MULT18BI))
701+ let wxWithdrawable = (wxWithdrawableTotal - wxClaimed)
701702 wxWithdrawable
702703 }
703704
704705
705706 @Callable(i)
706707 func lockRef (duration,referrerAddress,signature) = {
707- let $t02813628201 = lockActions(i, duration)
708- let lockActionsResult = $t02813628201._1
709- let gWxAmountStart = $t02813628201._2
708+ let $t02818428249 = lockActions(i, duration)
709+ let lockActionsResult = $t02818428249._1
710+ let gWxAmountStart = $t02818428249._2
710711 let referralAddress = toString(i.caller)
711712 let refInv = if (if ((referrerAddress == ""))
712713 then true
713714 else (signature == base58''))
714715 then unit
715716 else invoke(referralsContractAddressOrFail, "createPair", [referralProgramName, referrerAddress, referralAddress, signature], nil)
716717 if ((refInv == refInv))
717718 then {
718719 let updateRefActivity = invoke(mathContract, "updateReferralActivity", [toString(i.caller), gWxAmountStart], nil)
719720 if ((updateRefActivity == updateRefActivity))
720721 then $Tuple2(lockActionsResult, unit)
721722 else throw("Strict value is not equal to itself.")
722723 }
723724 else throw("Strict value is not equal to itself.")
724725 }
725726
726727
727728
728729 @Callable(i)
729730 func lock (duration) = {
730- let $t02865928724 = lockActions(i, duration)
731- let lockActionsResult = $t02865928724._1
732- let gWxAmountStart = $t02865928724._2
731+ let $t02870728772 = lockActions(i, duration)
732+ let lockActionsResult = $t02870728772._1
733+ let gWxAmountStart = $t02870728772._2
733734 let updateRefActivity = invoke(mathContract, "updateReferralActivity", [toString(i.caller), gWxAmountStart], nil)
734735 if ((updateRefActivity == updateRefActivity))
735736 then $Tuple2(lockActionsResult, unit)
736737 else throw("Strict value is not equal to itself.")
737738 }
738739
739740
740741
741742 @Callable(i)
742743 func claimWxBoost (lpAssetIdStr,userAddressStr) = if ((stakingContract != i.caller))
743744 then throwErr("permissions denied")
744745 else {
745- let $t02903429136 = internalClaimWxBoost(lpAssetIdStr, userAddressStr, false)
746- let userBoostAvailable = $t02903429136._1
747- let dataState = $t02903429136._2
748- let debug = $t02903429136._3
746+ let $t02908229184 = internalClaimWxBoost(lpAssetIdStr, userAddressStr, false)
747+ let userBoostAvailable = $t02908229184._1
748+ let dataState = $t02908229184._2
749+ let debug = $t02908229184._3
749750 $Tuple2(dataState, [userBoostAvailable])
750751 }
751752
752753
753754
754755 @Callable(i)
755756 func claimWxBoostREADONLY (lpAssetIdStr,userAddressStr) = {
756- let $t02926829369 = internalClaimWxBoost(lpAssetIdStr, userAddressStr, true)
757- let userBoostAvailable = $t02926829369._1
758- let dataState = $t02926829369._2
759- let debug = $t02926829369._3
757+ let $t02931629417 = internalClaimWxBoost(lpAssetIdStr, userAddressStr, true)
758+ let userBoostAvailable = $t02931629417._1
759+ let dataState = $t02931629417._2
760+ let debug = $t02931629417._3
760761 $Tuple2(nil, [userBoostAvailable, debug])
761762 }
762763
763764
764765
765766 @Callable(i)
766767 func unlock (txIdStr) = {
767768 let userAddress = i.caller
768769 let userAddressStr = toString(userAddress)
769770 let txIdOption = if ((txIdStr == ""))
770771 then unit
771772 else fromBase58String(txIdStr)
772773 let userRecordArray = readLockParamsRecordOrFail(userAddress, txIdOption)
773774 let userAmount = parseIntValue(userRecordArray[IdxLockAmount])
774775 let lockStart = parseIntValue(userRecordArray[IdxLockStart])
775776 let lockDuration = parseIntValue(userRecordArray[IdxLockDuration])
776777 let wxClaimed = parseIntValue(userRecordArray[IdxLockWxClaimed])
777778 let gwxAmount = parseIntValue(userRecordArray[IdxLockGwxAmount])
778779 let t = ((height - lockStart) / blocksInPeriod)
779780 let wxWithdrawable = getWxWithdrawable(userAddress, txIdOption)
780781 let gWxAmountStart = fraction(userAmount, lockDuration, maxLockDuration)
781782 let gwxBurned = min([fraction((t * blocksInPeriod), gWxAmountStart, maxLockDuration), gwxAmount])
782783 let gwxRemaining = ensurePositive((gwxAmount - gwxBurned), "gwxRemaining")
783784 let lockedGwxAmount = getLockedGwxAmount(userAddress)
784785 if ((0 >= wxWithdrawable))
785786 then throwErr("nothing to unlock")
786787 else {
787788 let gwxAmountTotal = getGwxAmountTotal()
788789 let userGwxAmountTotal = getUserGwxAmountTotal(userAddress)
789790 let userGwxAmountTotalNew = ensurePositive((userGwxAmountTotal - gwxBurned), "userGwxAmountTotalNew")
790791 if ((lockedGwxAmount > userGwxAmountTotalNew))
791792 then throwErr(("locked gwx amount: " + toString(lockedGwxAmount)))
792793 else {
793794 let userNum = parseIntValue(valueOrErrorMessage(getString(keyUser2NumMapping(userAddressStr)), wrapErr("invalid user number")))
794795 let gwxRewardInv = invoke(gwxRewardContract, "refreshUserReward", [userAddress.bytes, userNum], nil)
795796 if ((gwxRewardInv == gwxRewardInv))
796797 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)])
797798 else throw("Strict value is not equal to itself.")
798799 }
799800 }
800801 }
801802
802803
803804
804805 @Callable(i)
805806 func gwxUserInfoREADONLY (userAddressStr) = {
806807 let userAddress = valueOrErrorMessage(addressFromString(userAddressStr), wrapErr("invalid user address"))
807808 let gwxAmount = getUserGwxAmountTotal(userAddress)
808809 $Tuple2(nil, [gwxAmount])
809810 }
810811
811812
812813
813814 @Callable(i)
814815 func userMaxDurationREADONLY (userAddressStr) = $Tuple2(nil, $Tuple2("lock", maxLockDuration))
815816
816817
817818
818819 @Callable(i)
819820 func getUserGwxAmountAtHeightREADONLY (userAddressStr,targetHeight) = {
820821 let userAddress = valueOrErrorMessage(addressFromString(userAddressStr), wrapErr("invalid user address"))
821822 let gwxAmount = getUserGwxAmountTotal(userAddress)
822823 $Tuple2(nil, gwxAmount)
823824 }
824825
825826
826827
827828 @Callable(i)
828829 func getUserGwxAmount (userAddressStr) = {
829830 let userAddress = valueOrErrorMessage(addressFromString(userAddressStr), wrapErr("invalid user address"))
830831 let gwxAmount = getUserGwxAmountTotal(userAddress)
831832 $Tuple2(nil, gwxAmount)
832833 }
833834
834835
835836
836837 @Callable(i)
837838 func getGwxTotalREADONLY () = $Tuple2(nil, getGwxAmountTotal())
838839
839840
840841
841842 @Callable(i)
842843 func onBoostEmissionUpdate () = {
843844 let checkCaller = if ((i.caller == emissionContract))
844845 then true
845846 else mustManager(i)
846847 if ((checkCaller == checkCaller))
847848 then refreshBoostEmissionIntegral()
848849 else throw("Strict value is not equal to itself.")
849850 }
850851
851852
852853
853854 @Callable(i)
854855 func onStakedVoteUpdate (lpAssetIdStr,userAddressStr,edge) = {
855856 let checkCaller = if ((i.caller == stakingContract))
856857 then true
857858 else mustManager(i)
858859 if ((checkCaller == checkCaller))
859860 then {
860861 let actions = refreshVoteStakedIntegral(lpAssetIdStr, userAddressStr, edge)
861862 $Tuple2(actions, unit)
862863 }
863864 else throw("Strict value is not equal to itself.")
864865 }
865866
866867
867868
868869 @Callable(i)
869870 func getVotingResultStakedREADONLY (lpAssetIdStr) = $Tuple2(nil, getVotingResultStaked(lpAssetIdStr))
870871
871872
872873
873874 @Callable(i)
874875 func getVotingResultStakedIntegralREADONLY (lpAssetIdStr) = $Tuple2(nil, getVotingResultStakedIntegral(lpAssetIdStr))
875876
876877
877878
878879 @Callable(i)
879880 func getUserVoteFinalizedREADONLY (lpAssetIdStr,userAddressStr) = $Tuple2(nil, getUserVoteFinalized(lpAssetIdStr, userAddressStr))
880881
881882
882883
883884 @Callable(i)
884885 func getUserVoteStakedIntegralREADONLY (lpAssetIdStr,userAddressStr) = $Tuple2(nil, getUserVoteStakedIntegral(lpAssetIdStr, userAddressStr))
885886
886887
887888 @Verifier(tx)
888889 func verify () = {
889890 let targetPublicKey = match managerPublicKeyOrUnit() {
890891 case pk: ByteVector =>
891892 pk
892893 case _: Unit =>
893894 tx.senderPublicKey
894895 case _ =>
895896 throw("Match error")
896897 }
897898 sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey)
898899 }
899900

github/deemru/w8io/026f985 
89.38 ms