tx · BkHd8EfLoabZ6orf7VCraMbdRkLcFyLVSAgE35Me34UD

3Myn55vLkduxbX3ZXfiDCZhaQsLxYp1kmCy:  -0.02600000 Waves

2023.08.31 14:12 [2734786] smart account 3Myn55vLkduxbX3ZXfiDCZhaQsLxYp1kmCy > SELF 0.00000000 Waves

{ "type": 13, "id": "BkHd8EfLoabZ6orf7VCraMbdRkLcFyLVSAgE35Me34UD", "fee": 2600000, "feeAssetId": null, "timestamp": 1693480348129, "version": 2, "chainId": 84, "sender": "3Myn55vLkduxbX3ZXfiDCZhaQsLxYp1kmCy", "senderPublicKey": "9W33iCCNfmFxUbiC6XZcH5x7f6xfwC7Jb3BoExT5q2PV", "proofs": [ "2VzdpSc2nPbDeKicngT6sjA2LUZW8obegTCLeZAHkxjsZBBW71C3HENiMJk65KvmRty8mVY75ewVHwgDRn5nhtze" ], "script": "base64:BgK2LQgCEgUKAwEIAhIDCgEBEgQKAggIEgQKAggIEgMKAQgSAwoBCBIDCgEIEgQKAggBEgMKAQgSABIAEgUKAwgIBBIDCgEIEgMKAQgSBAoCCAgSBAoCCAgSAwoBBCIDU0VQIgZTQ0FMRTgiBU1VTFQ4Ig5QT09MV0VJR0hUTVVMVCIQY29udHJhY3RGaWxlbmFtZSIHU0NBTEUxOCIGTVVMVDE4IghNVUxUMThCSSIOREVDQVlfQ09OU1RBTlQiB3dyYXBFcnIiA21zZyIIdGhyb3dFcnIiD2dldFN0cmluZ09yRmFpbCIHYWRkcmVzcyIDa2V5IgxnZXRJbnRPclplcm8iD2dldEludE9yRGVmYXVsdCIKZGVmYXVsdFZhbCIMZ2V0SW50T3JGYWlsIgNhYnMiA3ZhbCIOZW5zdXJlUG9zaXRpdmUiAXYiAW0iG2tleVJlZmVycmFsc0NvbnRyYWN0QWRkcmVzcyIecmVmZXJyYWxzQ29udHJhY3RBZGRyZXNzT3JGYWlsIhZrZXlSZWZlcnJhbFByb2dyYW1OYW1lIhpyZWZlcnJhbFByb2dyYW1OYW1lRGVmYXV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AmFRAwkAAQIFAmFKAgRVbml0CAUCZVYPc2VuZGVyUHVibGljS2V5CQACAQILTWF0Y2ggZXJyb3IJAPQDAwgFAmVWCWJvZHlCeXRlcwkAkQMCCAUCZVYGcHJvb2ZzAAAFAmVYVftOcw==", "height": 2734786, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: AJfoLY7Sbk8L34gs3UYKCYV3n36smMVUkSitSTmtmLfC Next: BE7P4d1VrWjaXjVwVjZhZvHBSuLE16cAiF9H8fsC8HEq Diff:
OldNewDifferences
805805 let gwxAmount = parseIntValue(userRecordArray[IdxLockGwxAmount])
806806 let t = ((height - lockStart) / blocksInPeriod)
807807 let wxWithdrawable = getWxWithdrawable(userAddress, txIdOption)
808- let gWxAmountStart = fraction(userAmount, lockDuration, maxLockDuration)
809- let gwxBurned = min([fraction((t * blocksInPeriod), gWxAmountStart, maxLockDuration), gwxAmount])
808+ let gwxBurned = min([fraction(wxWithdrawable, lockDuration, maxLockDuration), gwxAmount])
810809 let gwxRemaining = ensurePositive((gwxAmount - gwxBurned), "gwxRemaining")
811810 let lockedGwxAmount = getLockedGwxAmount(userAddress)
812811 if ((0 >= wxWithdrawable))
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 let keySuspension = "%s__suspension"
180180
181181 let isSuspended = valueOrElse(getBoolean(this, keySuspension), false)
182182
183183 func throwIfSuspended () = if (!(isSuspended))
184184 then true
185185 else throwErr("suspended")
186186
187187
188188 func getManagerVaultAddressOrThis () = match getString(keyManagerVaultAddress()) {
189189 case s: String =>
190190 addressFromStringValue(s)
191191 case _ =>
192192 this
193193 }
194194
195195
196196 func managerPublicKeyOrUnit () = {
197197 let managerVaultAddress = getManagerVaultAddressOrThis()
198198 match getString(managerVaultAddress, keyManagerPublicKey()) {
199199 case s: String =>
200200 fromBase58String(s)
201201 case _: Unit =>
202202 unit
203203 case _ =>
204204 throw("Match error")
205205 }
206206 }
207207
208208
209209 func mustManager (i) = {
210210 let pd = throwErr("Permission denied")
211211 match managerPublicKeyOrUnit() {
212212 case pk: ByteVector =>
213213 if ((i.callerPublicKey == pk))
214214 then true
215215 else pd
216216 case _: Unit =>
217217 if ((i.caller == this))
218218 then true
219219 else pd
220220 case _ =>
221221 throw("Match error")
222222 }
223223 }
224224
225225
226226 let IdxLockAmount = 1
227227
228228 let IdxLockStart = 2
229229
230230 let IdxLockDuration = 3
231231
232232 let IdxLockLastUpdateTimestamp = 4
233233
234234 let IdxLockGwxAmount = 5
235235
236236 let IdxLockWxClaimed = 6
237237
238238 func keyLockParamsRecord (userAddress,txId) = makeString(["%s%s%s__lock", toString(userAddress), match txId {
239239 case b: ByteVector =>
240240 toBase58String(b)
241241 case _: Unit =>
242242 "legacy"
243243 case _ =>
244244 throw("Match error")
245245 }], SEP)
246246
247247
248248 func readLockParamsRecordOrFail (userAddress,txId) = split(getStringOrFail(this, keyLockParamsRecord(userAddress, txId)), SEP)
249249
250250
251251 func keyUserGwxAmountTotal (userAddress) = makeString(["%s%s__gwxAmountTotal", toString(userAddress)], SEP)
252252
253253
254254 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)
255255
256256
257257 func keyNextUserNum () = "%s__nextUserNum"
258258
259259
260260 func keyUser2NumMapping (userAddress) = makeString(["%s%s%s__mapping__user2num", userAddress], SEP)
261261
262262
263263 func keyNum2UserMapping (num) = makeString(["%s%s%s__mapping__num2user", num], SEP)
264264
265265
266266 func keyLockParamTotalAmount () = "%s%s__stats__activeTotalLocked"
267267
268268
269269 func keyStatsLocksDurationSumInBlocks () = "%s%s__stats__locksDurationSumInBlocks"
270270
271271
272272 func keyStatsLocksCount () = "%s%s__stats__locksCount"
273273
274274
275275 func keyStatsUsersCount () = "%s%s__stats__activeUsersCount"
276276
277277
278278 func keyUserBoostEmissionLastINTEGRAL (userNum) = makeString(["%s%d__userBoostEmissionLastIntV2", toString(userNum)], SEP)
279279
280280
281281 func keyUserLpBoostEmissionLastINTEGRAL (userNum,lpAssetId) = makeString(["%s%d__userBoostEmissionLastIntV2", toString(userNum), lpAssetId], SEP)
282282
283283
284284 func keyUserMaxBoostINTEGRAL (userNum) = makeString(["%s%d__maxBoostInt", toString(userNum)], SEP)
285285
286286
287287 func keyTotalMaxBoostINTEGRAL () = "%s%s__maxBoostInt__total"
288288
289289
290290 func keyUserBoostAvalaibleToClaimTotal (userNum) = makeString(["%s%d__userBoostAvaliableToClaimTotal", toString(userNum)], SEP)
291291
292292
293293 func keyUserBoostClaimed (userNum) = makeString(["%s%d__userBoostClaimed", toString(userNum)], SEP)
294294
295295
296296 func keyGwxTotal () = "%s%s__gwx__total"
297297
298298
299299 func keyVote (amountAssetId,priceAssetId,address,epoch) = makeString(["%s%s%s%s%d", "vote", amountAssetId, priceAssetId, toString(address), toString(epoch)], SEP)
300300
301301
302302 func keyStartHeightByEpoch (epoch) = makeString(["%s%d", "startHeight", toString(epoch)], SEP)
303303
304304
305305 func keyCurrentEpochUi () = makeString(["%s", "currentEpochUi"], SEP)
306306
307307
308308 func keyVotingResultStaked (lpAssetIdStr,epoch) = makeString(["%s%s%d", "votingResultStaked", lpAssetIdStr, toString(epoch)], SEP)
309309
310310
311311 func keyVotingResultStakedIntegral (lpAssetIdStr,epoch) = makeString(["%s%s%d", "votingResultStakedIntegral", lpAssetIdStr, toString(epoch)], SEP)
312312
313313
314314 func keyVotingResultStakedLastUpdateHeight (lpAssetIdStr,epoch) = makeString(["%s%s%d", "votingResultStakedIntegralLastUpdateHeight", lpAssetIdStr, toString(epoch)], SEP)
315315
316316
317317 func keyVotingResultStakedIntegralLast (lpAssetIdStr,address,epoch) = makeString(["%s%s%s%d", "votingResultStakedIntegralLast", lpAssetIdStr, toString(address), toString(epoch)], SEP)
318318
319319
320320 func keyVoteStakedIntegral (lpAssetIdStr,address,epoch) = makeString(["%s%s%s%d", "voteStakedIntegral", lpAssetIdStr, toString(address), toString(epoch)], SEP)
321321
322322
323323 func keyVoteStakedLastUpdateHeight (lpAssetIdStr,address,epoch) = makeString(["%s%s%s%d", "voteStakedIntegralLastUpdateHeight", lpAssetIdStr, toString(address), toString(epoch)], SEP)
324324
325325
326326 func keyVoteStakedIntegralLast (lpAssetIdStr,address,epoch) = makeString(["%s%s%s%d", "voteStakedIntegralLast", lpAssetIdStr, toString(address), toString(epoch)], SEP)
327327
328328
329329 func keyStakedByUser (userAddressStr,lpAssetIdStr) = makeString(["%s%s%s", "staked", userAddressStr, lpAssetIdStr], SEP)
330330
331331
332332 let factoryContract = readFactoryAddressOrFail()
333333
334334 let factoryCfg = readFactoryCfgOrFail(factoryContract)
335335
336336 let emissionContract = getEmissionAddressOrFail(factoryCfg)
337337
338338 let stakingContract = getStakingAddressOrFail(factoryCfg)
339339
340340 let gwxRewardContract = getGwxRewardAddressOrFail(factoryCfg)
341341
342342 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"))
343343
344344 let keyVotingEmissionContract = makeString(["%s", "votingEmissionContract"], SEP)
345345
346346 let votingEmissionContract = addressFromStringValue(getStringValue(factoryContract, keyVotingEmissionContract))
347347
348348 let keyVotingEmissionRateContract = makeString(["%s", "votingEmissionRateContract"], SEP)
349349
350350 let boostCoeff = {
351351 let @ = invoke(emissionContract, "getBoostCoeffREADONLY", nil, nil)
352352 if ($isInstanceOf(@, "Int"))
353353 then @
354354 else throw(($getType(@) + " couldn't be cast to Int"))
355355 }
356356
357357 func userNumberByAddressOrFail (userAddress) = match getString(this, keyUser2NumMapping(toString(userAddress))) {
358358 case s: String =>
359359 valueOrErrorMessage(parseInt(s), wrapErr("invalid user number"))
360360 case _: Unit =>
361361 throwErr("invalid user")
362362 case _ =>
363363 throw("Match error")
364364 }
365365
366366
367367 func getGwxAmountTotal () = valueOrElse(getInteger(this, keyGwxTotal()), 0)
368368
369369
370370 func getLockedGwxAmount (userAddress) = {
371371 let functionName = "getLockedGwxAmount"
372372 let votingEmissionRateContract = valueOrErrorMessage( match getString(votingEmissionContract, keyVotingEmissionRateContract) {
373373 case _: Unit =>
374374 unit
375375 case s: String =>
376376 addressFromString(s)
377377 case _ =>
378378 throw("Match error")
379379 }, wrapErr("invalid voting emission rate address"))
380380 let lockedVotingEmissionRate = {
381381 let @ = invoke(votingEmissionContract, functionName, [toString(userAddress)], nil)
382382 if ($isInstanceOf(@, "Int"))
383383 then @
384384 else throw(($getType(@) + " couldn't be cast to Int"))
385385 }
386386 let lockedVotingEmission = {
387387 let @ = invoke(votingEmissionRateContract, functionName, [toString(userAddress)], nil)
388388 if ($isInstanceOf(@, "Int"))
389389 then @
390390 else throw(($getType(@) + " couldn't be cast to Int"))
391391 }
392392 let locked = max([lockedVotingEmissionRate, lockedVotingEmission])
393393 locked
394394 }
395395
396396
397397 func HistoryEntry (type,user,amount,lockStart,duration,gwxAmount,i) = {
398398 let historyKEY = makeString(["%s%s%s%s__history", type, user, toBase58String(i.transactionId)], SEP)
399399 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)
400400 StringEntry(historyKEY, historyDATA)
401401 }
402402
403403
404404 func StatsEntry (totalLockedInc,durationInc,lockCountInc,usersCountInc) = {
405405 let locksDurationSumInBlocksKEY = keyStatsLocksDurationSumInBlocks()
406406 let locksCountKEY = keyStatsLocksCount()
407407 let usersCountKEY = keyStatsUsersCount()
408408 let totalAmountKEY = keyLockParamTotalAmount()
409409 let locksDurationSumInBlocks = getIntOrZero(this, locksDurationSumInBlocksKEY)
410410 let locksCount = getIntOrZero(this, locksCountKEY)
411411 let usersCount = getIntOrZero(this, usersCountKEY)
412412 let totalAmount = getIntOrZero(this, totalAmountKEY)
413413 [IntegerEntry(locksDurationSumInBlocksKEY, (locksDurationSumInBlocks + durationInc)), IntegerEntry(locksCountKEY, (locksCount + lockCountInc)), IntegerEntry(usersCountKEY, (usersCount + usersCountInc)), IntegerEntry(totalAmountKEY, (totalAmount + totalLockedInc))]
414414 }
415415
416416
417417 func LockParamsEntry (userAddress,txId,amount,start,duration,gwxAmount,wxClaimed) = [StringEntry(keyLockParamsRecord(userAddress, txId), formatLockParamsRecord(amount, start, duration, gwxAmount, wxClaimed))]
418418
419419
420420 func extractOptionalPaymentAmountOrFail (i,expectedAssetId) = if ((size(i.payments) > 1))
421421 then throwErr("only one payment is allowed")
422422 else if ((size(i.payments) == 0))
423423 then 0
424424 else {
425425 let pmt = i.payments[0]
426426 if ((value(pmt.assetId) != expectedAssetId))
427427 then throwErr("invalid asset id in payment")
428428 else pmt.amount
429429 }
430430
431431
432432 func getUserGwxAmountTotal (userAddress) = valueOrElse(getInteger(this, keyUserGwxAmountTotal(userAddress)), 0)
433433
434434
435435 func getVotingEmissionEpochInfo () = {
436436 let $t01468614976 = {
437437 let currentEpochUi = value(getInteger(votingEmissionContract, keyCurrentEpochUi()))
438438 let lastFinalizedEpoch = (currentEpochUi - 1)
439439 if ((0 > lastFinalizedEpoch))
440440 then throwErr("invalid epoch")
441441 else $Tuple2(currentEpochUi, lastFinalizedEpoch)
442442 }
443443 let currentEpochUi = $t01468614976._1
444444 let lastFinalizedEpoch = $t01468614976._2
445445 let currentEpochStartHeight = value(getInteger(votingEmissionContract, keyStartHeightByEpoch(currentEpochUi)))
446446 $Tuple2(lastFinalizedEpoch, currentEpochStartHeight)
447447 }
448448
449449
450450 func getPoolAssetsByLpAssetId (lpAssetIdStr) = {
451451 let idxAmountAssetId = 4
452452 let idxPriceAssetId = 5
453453 let poolCfg = {
454454 let @ = invoke(factoryContract, "getPoolConfigByLpAssetIdREADONLY", [lpAssetIdStr], nil)
455455 if ($isInstanceOf(@, "List[Any]"))
456456 then @
457457 else throw(($getType(@) + " couldn't be cast to List[Any]"))
458458 }
459459 let amountAssetId = {
460460 let @ = poolCfg[idxAmountAssetId]
461461 if ($isInstanceOf(@, "String"))
462462 then @
463463 else throw(($getType(@) + " couldn't be cast to String"))
464464 }
465465 let priceAssetId = {
466466 let @ = poolCfg[idxPriceAssetId]
467467 if ($isInstanceOf(@, "String"))
468468 then @
469469 else throw(($getType(@) + " couldn't be cast to String"))
470470 }
471471 $Tuple2(amountAssetId, priceAssetId)
472472 }
473473
474474
475475 func getUserVoteFinalized (lpAssetIdStr,userAddressStr) = {
476476 let userAddress = addressFromStringValue(userAddressStr)
477477 let $t01566715747 = getVotingEmissionEpochInfo()
478478 let lastFinalizedEpoch = $t01566715747._1
479479 let currentEpochStartHeight = $t01566715747._2
480480 let $t01575015825 = getPoolAssetsByLpAssetId(lpAssetIdStr)
481481 let amountAssetId = $t01575015825._1
482482 let priceAssetId = $t01575015825._2
483483 let userVoteKey = keyVote(amountAssetId, priceAssetId, userAddress, lastFinalizedEpoch)
484484 let userVote = valueOrElse(getInteger(votingEmissionContract, userVoteKey), 0)
485485 userVote
486486 }
487487
488488
489489 func getUserVoteStaked (lpAssetIdStr,userAddressStr) = {
490490 let stakedByUser = valueOrElse(getInteger(stakingContract, keyStakedByUser(userAddressStr, lpAssetIdStr)), 0)
491491 let userVote = getUserVoteFinalized(lpAssetIdStr, userAddressStr)
492492 if ((stakedByUser == 0))
493493 then 0
494494 else userVote
495495 }
496496
497497
498498 func getVotingResultStaked (lpAssetIdStr) = {
499499 let $t01636916449 = getVotingEmissionEpochInfo()
500500 let lastFinalizedEpoch = $t01636916449._1
501501 let currentEpochStartHeight = $t01636916449._2
502502 let votingResultStakedStart = valueOrElse(getInteger(votingEmissionContract, keyVotingResultStaked(lpAssetIdStr, lastFinalizedEpoch)), 0)
503503 let votingResultStaked = valueOrElse(getInteger(this, keyVotingResultStaked(lpAssetIdStr, lastFinalizedEpoch)), votingResultStakedStart)
504504 votingResultStaked
505505 }
506506
507507
508508 func getVotingResultStakedIntegral (lpAssetIdStr) = {
509509 let $t01681116891 = getVotingEmissionEpochInfo()
510510 let lastFinalizedEpoch = $t01681116891._1
511511 let currentEpochStartHeight = $t01681116891._2
512512 let votingResultStaked = getVotingResultStaked(lpAssetIdStr)
513513 let votingResultStakedIntegralPrev = valueOrElse(getInteger(this, keyVotingResultStakedIntegral(lpAssetIdStr, lastFinalizedEpoch)), 0)
514514 let votingResultStakedLastUpdateHeight = valueOrElse(getInteger(this, keyVotingResultStakedLastUpdateHeight(lpAssetIdStr, lastFinalizedEpoch)), currentEpochStartHeight)
515515 let votingResultStakedIntegralDh = (height - votingResultStakedLastUpdateHeight)
516516 let votingResultStakedIntegral = ((votingResultStakedIntegralDh * votingResultStaked) + votingResultStakedIntegralPrev)
517517 votingResultStakedIntegral
518518 }
519519
520520
521521 func refreshVotingResultStakedIntegral (lpAssetIdStr,stakedVoteDelta) = {
522522 let $t01772817808 = getVotingEmissionEpochInfo()
523523 let lastFinalizedEpoch = $t01772817808._1
524524 let currentEpochStartHeight = $t01772817808._2
525525 let votingResultStaked = getVotingResultStaked(lpAssetIdStr)
526526 let votingResultStakedNew = (votingResultStaked + stakedVoteDelta)
527527 let votingResultStakedIntegral = getVotingResultStakedIntegral(lpAssetIdStr)
528528 [IntegerEntry(keyVotingResultStaked(lpAssetIdStr, lastFinalizedEpoch), votingResultStakedNew), IntegerEntry(keyVotingResultStakedLastUpdateHeight(lpAssetIdStr, lastFinalizedEpoch), height), IntegerEntry(keyVotingResultStakedIntegral(lpAssetIdStr, lastFinalizedEpoch), votingResultStakedIntegral)]
529529 }
530530
531531
532532 func getUserVoteStakedIntegral (lpAssetIdStr,userAddressStr) = {
533533 let $t01841918499 = getVotingEmissionEpochInfo()
534534 let lastFinalizedEpoch = $t01841918499._1
535535 let currentEpochStartHeight = $t01841918499._2
536536 let userAddress = addressFromStringValue(userAddressStr)
537537 let userVoteStaked = getUserVoteStaked(lpAssetIdStr, userAddressStr)
538538 let userVoteStakedIntegralPrev = valueOrElse(getInteger(this, keyVoteStakedIntegral(lpAssetIdStr, userAddress, lastFinalizedEpoch)), 0)
539539 let userVoteStakedLastUpdateHeight = valueOrElse(getInteger(this, keyVoteStakedLastUpdateHeight(lpAssetIdStr, userAddress, lastFinalizedEpoch)), currentEpochStartHeight)
540540 let userVoteStakedIntegralDh = (height - userVoteStakedLastUpdateHeight)
541541 let userVoteStakedIntegral = ((userVoteStakedIntegralDh * userVoteStaked) + userVoteStakedIntegralPrev)
542542 userVoteStakedIntegral
543543 }
544544
545545
546546 func refreshVoteStakedIntegral (lpAssetIdStr,userAddressStr,edge) = {
547547 let $t01928719367 = getVotingEmissionEpochInfo()
548548 let lastFinalizedEpoch = $t01928719367._1
549549 let currentEpochStartHeight = $t01928719367._2
550550 let userAddress = addressFromStringValue(userAddressStr)
551551 let userVoteFinalized = getUserVoteFinalized(lpAssetIdStr, userAddressStr)
552552 let actions = if ((userVoteFinalized == 0))
553553 then nil
554554 else {
555555 let stakedVoteDelta = if (edge)
556556 then userVoteFinalized
557557 else -(userVoteFinalized)
558558 let votingResultActions = refreshVotingResultStakedIntegral(lpAssetIdStr, stakedVoteDelta)
559559 let userVoteStakedIntegral = getUserVoteStakedIntegral(lpAssetIdStr, userAddressStr)
560560 let voteActions = [IntegerEntry(keyVoteStakedLastUpdateHeight(lpAssetIdStr, userAddress, lastFinalizedEpoch), height), IntegerEntry(keyVoteStakedIntegral(lpAssetIdStr, userAddress, lastFinalizedEpoch), userVoteStakedIntegral)]
561561 (votingResultActions ++ voteActions)
562562 }
563563 actions
564564 }
565565
566566
567567 func getStakedVotesIntegralsDiff (lpAssetIdStr,userAddressStr) = {
568568 let $t02022120301 = getVotingEmissionEpochInfo()
569569 let lastFinalizedEpoch = $t02022120301._1
570570 let currentEpochStartHeight = $t02022120301._2
571571 let userAddress = addressFromStringValue(userAddressStr)
572572 let userVoteStakedIntegralLastKey = keyVoteStakedIntegralLast(lpAssetIdStr, userAddress, lastFinalizedEpoch)
573573 let userVoteStakedIntegralLast = valueOrElse(getInteger(this, userVoteStakedIntegralLastKey), 0)
574574 let votingResultStakedIntegralLastKey = keyVotingResultStakedIntegralLast(lpAssetIdStr, userAddress, lastFinalizedEpoch)
575575 let votingResultStakedIntegralLast = valueOrElse(getInteger(this, votingResultStakedIntegralLastKey), 0)
576576 let userVoteStakedIntegral = getUserVoteStakedIntegral(lpAssetIdStr, userAddressStr)
577577 let votingResultStakedIntegral = getVotingResultStakedIntegral(lpAssetIdStr)
578578 let userVoteStakedIntegralDiff = (userVoteStakedIntegral - userVoteStakedIntegralLast)
579579 let votingResultStakedIntegralDiff = (votingResultStakedIntegral - votingResultStakedIntegralLast)
580580 $Tuple3([IntegerEntry(userVoteStakedIntegralLastKey, userVoteStakedIntegral), IntegerEntry(votingResultStakedIntegralLastKey, votingResultStakedIntegral)], userVoteStakedIntegralDiff, votingResultStakedIntegralDiff)
581581 }
582582
583583
584584 func refreshBoostEmissionIntegral () = {
585585 let wxEmissionPerBlock = getIntOrFail(emissionContract, keyEmissionRatePerBlockCurrent())
586586 let boostingV2LastUpdateHeightOption = getInteger(this, keyBoostingV2LastUpdateHeight())
587587 let boostingV2IngergalOption = getInteger(this, keyBoostingV2Integral())
588588 let emissionEnd = getIntOrFail(emissionContract, keyEmissionEndBlock())
589589 let h = if ((height > emissionEnd))
590590 then emissionEnd
591591 else height
592592 let dh = match boostingV2LastUpdateHeightOption {
593593 case lastUpdateHeight: Int =>
594594 max([(h - lastUpdateHeight), 0])
595595 case _: Unit =>
596596 0
597597 case _ =>
598598 throw("Match error")
599599 }
600600 let boostEmissionPerBlock = ((wxEmissionPerBlock * (boostCoeff - 1)) / boostCoeff)
601601 let boostEmissionIntegralPrev = valueOrElse(boostingV2IngergalOption, 0)
602602 let boostEmissionIntegral = ((boostEmissionPerBlock * dh) + boostEmissionIntegralPrev)
603603 $Tuple2([IntegerEntry(keyBoostingV2Integral(), boostEmissionIntegral), IntegerEntry(keyBoostingV2LastUpdateHeight(), height)], boostEmissionIntegral)
604604 }
605605
606606
607607 func internalClaimWxBoost (lpAssetIdStr,userAddressStr,readOnly) = {
608608 let userAddress = valueOrErrorMessage(addressFromString(userAddressStr), wrapErr("invalid user address"))
609609 let userNum = userNumberByAddressOrFail(userAddress)
610610 if ((userNum == userNum))
611611 then {
612612 let EMPTYSTR = "empty"
613613 let poolWeight = if ((lpAssetIdStr != EMPTYSTR))
614614 then {
615615 let poolAddressStr = valueOrErrorMessage(getString(factoryContract, keyFactoryLpAssetToPoolContractAddress(lpAssetIdStr)), wrapErr(("unsupported lp asset " + lpAssetIdStr)))
616616 getIntegerValue(factoryContract, keyFactoryPoolWeight(poolAddressStr))
617617 }
618618 else if (readOnly)
619619 then 0
620620 else throwErr(("not readonly mode: unsupported lp asset " + lpAssetIdStr))
621621 let userLpBoostEmissionLastIntegralKEY = keyUserLpBoostEmissionLastINTEGRAL(userNum, lpAssetIdStr)
622622 let userBoostEmissionLastIntegralKEY = keyUserBoostEmissionLastINTEGRAL(userNum)
623623 let userBoostEmissionLastIntegral = valueOrElse(getInteger(this, userLpBoostEmissionLastIntegralKEY), getIntOrZero(this, userBoostEmissionLastIntegralKEY))
624624 let boostEmissionIntegral = refreshBoostEmissionIntegral()._2
625625 let userBoostEmissionIntegral = (boostEmissionIntegral - userBoostEmissionLastIntegral)
626626 if ((0 > userBoostEmissionIntegral))
627627 then throwErr("wrong calculations")
628628 else {
629629 let $t02384323982 = getStakedVotesIntegralsDiff(lpAssetIdStr, userAddressStr)
630630 let stakedVotesIntegralsActions = $t02384323982._1
631631 let userVoteIntegralDiff = $t02384323982._2
632632 let totalVotesIntegralDiff = $t02384323982._3
633633 let poolUserBoostEmissionIntegral = fraction(userBoostEmissionIntegral, poolWeight, POOLWEIGHTMULT)
634634 let userBoostAvaliableToClaimTotalNew = if ((totalVotesIntegralDiff == 0))
635635 then 0
636636 else fraction(poolUserBoostEmissionIntegral, userVoteIntegralDiff, totalVotesIntegralDiff)
637637 let dataState = ([IntegerEntry(userLpBoostEmissionLastIntegralKEY, boostEmissionIntegral)] ++ stakedVotesIntegralsActions)
638638 let debug = makeString([toString(userBoostEmissionLastIntegral), toString(userBoostEmissionIntegral), toString(poolWeight), toString(userVoteIntegralDiff), toString(totalVotesIntegralDiff)], ":")
639639 $Tuple3(userBoostAvaliableToClaimTotalNew, dataState, debug)
640640 }
641641 }
642642 else throw("Strict value is not equal to itself.")
643643 }
644644
645645
646646 func lockActions (i,duration) = {
647647 let assetIdStr = toBase58String(assetId)
648648 if ((size(i.payments) != 1))
649649 then throwErr("invalid payment - exact one payment must be attached")
650650 else {
651651 let pmt = i.payments[0]
652652 let pmtAmount = pmt.amount
653653 if ((assetId != value(pmt.assetId)))
654654 then throwErr((("invalid asset is in payment - " + assetIdStr) + " is expected"))
655655 else {
656656 let nextUserNumKEY = keyNextUserNum()
657657 let userAddress = i.caller
658658 let userAddressStr = toString(userAddress)
659659 let userIsExisting = isDefined(getString(keyUser2NumMapping(userAddressStr)))
660660 let userNumStr = if (userIsExisting)
661661 then value(getString(keyUser2NumMapping(userAddressStr)))
662662 else toString(getIntOrFail(this, nextUserNumKEY))
663663 let userNum = parseIntValue(userNumStr)
664664 let lockStart = height
665665 if (if ((minLockAmount > pmtAmount))
666666 then (userAddress != lpStakingPoolsContract)
667667 else false)
668668 then throwErr(("amount is less then minLockAmount=" + toString(minLockAmount)))
669669 else if ((minLockDuration > duration))
670670 then throwErr(("passed duration is less than minLockDuration=" + toString(minLockDuration)))
671671 else if ((duration > maxLockDuration))
672672 then throwErr(("passed duration is greater than maxLockDuration=" + toString(maxLockDuration)))
673673 else if (((duration % lockStepBlocks) != 0))
674674 then throwErr(("duration must be multiple of lockStepBlocks=" + toString(lockStepBlocks)))
675675 else {
676676 let gWxAmountStart = fraction(pmtAmount, duration, maxLockDuration)
677677 let gwxAmountTotal = getGwxAmountTotal()
678678 let userBoostEmissionLastIntegralKEY = keyUserBoostEmissionLastINTEGRAL(userNum)
679679 let boostEmissionIntegral = refreshBoostEmissionIntegral()._2
680680 let userGwxAmountTotal = getUserGwxAmountTotal(userAddress)
681681 let gwxRewardInv = invoke(gwxRewardContract, "refreshUserReward", [userAddress.bytes, userNum], nil)
682682 if ((gwxRewardInv == gwxRewardInv))
683683 then {
684684 let arr = if (userIsExisting)
685685 then nil
686686 else [IntegerEntry(nextUserNumKEY, (userNum + 1)), StringEntry(keyUser2NumMapping(userAddressStr), userNumStr), StringEntry(keyNum2UserMapping(userNumStr), userAddressStr)]
687687 $Tuple2(((((arr ++ LockParamsEntry(userAddress, i.transactionId, pmtAmount, lockStart, duration, gWxAmountStart, 0)) ++ StatsEntry(pmtAmount, duration, 1, if (userIsExisting)
688688 then 0
689689 else 1)) :+ HistoryEntry("lock", userAddressStr, pmtAmount, lockStart, duration, gWxAmountStart, i)) ++ [IntegerEntry(userBoostEmissionLastIntegralKEY, boostEmissionIntegral), IntegerEntry(keyGwxTotal(), (gwxAmountTotal + gWxAmountStart)), IntegerEntry(keyUserGwxAmountTotal(userAddress), (userGwxAmountTotal + gWxAmountStart))]), gWxAmountStart)
690690 }
691691 else throw("Strict value is not equal to itself.")
692692 }
693693 }
694694 }
695695 }
696696
697697
698698 func getWxWithdrawable (userAddress,txIdOption) = {
699699 let userRecordArray = readLockParamsRecordOrFail(userAddress, txIdOption)
700700 let userAmount = parseIntValue(userRecordArray[IdxLockAmount])
701701 let lockStart = parseIntValue(userRecordArray[IdxLockStart])
702702 let lockDuration = parseIntValue(userRecordArray[IdxLockDuration])
703703 let lockEnd = (lockStart + lockDuration)
704704 let wxClaimed = parseIntValue(userRecordArray[IdxLockWxClaimed])
705705 let t = ((height - lockStart) / blocksInPeriod)
706706 let exponent = fraction(toBigInt(t), (toBigInt((DECAY_CONSTANT * blocksInPeriod)) * MULT18BI), toBigInt(lockDuration))
707707 let wxWithdrawableTotal = if ((height > lockEnd))
708708 then userAmount
709709 else toInt(fraction(toBigInt(userAmount), (MULT18BI - pow(toBigInt(5), 1, exponent, SCALE18, SCALE18, DOWN)), MULT18BI))
710710 let wxWithdrawable = (wxWithdrawableTotal - wxClaimed)
711711 wxWithdrawable
712712 }
713713
714714
715715 @Callable(i)
716716 func lockRef (duration,referrerAddress,signature) = {
717717 let suspensionCheck = throwIfSuspended()
718718 if ((suspensionCheck == suspensionCheck))
719719 then {
720720 let $t02840028465 = lockActions(i, duration)
721721 let lockActionsResult = $t02840028465._1
722722 let gWxAmountStart = $t02840028465._2
723723 let referralAddress = toString(i.caller)
724724 let refInv = if (if ((referrerAddress == ""))
725725 then true
726726 else (signature == base58''))
727727 then unit
728728 else invoke(referralsContractAddressOrFail, "createPair", [referralProgramName, referrerAddress, referralAddress, signature], nil)
729729 if ((refInv == refInv))
730730 then {
731731 let updateRefActivity = invoke(mathContract, "updateReferralActivity", [toString(i.caller), gWxAmountStart], nil)
732732 if ((updateRefActivity == updateRefActivity))
733733 then $Tuple2(lockActionsResult, unit)
734734 else throw("Strict value is not equal to itself.")
735735 }
736736 else throw("Strict value is not equal to itself.")
737737 }
738738 else throw("Strict value is not equal to itself.")
739739 }
740740
741741
742742
743743 @Callable(i)
744744 func lock (duration) = {
745745 let suspensionCheck = throwIfSuspended()
746746 if ((suspensionCheck == suspensionCheck))
747747 then {
748748 let $t02896929034 = lockActions(i, duration)
749749 let lockActionsResult = $t02896929034._1
750750 let gWxAmountStart = $t02896929034._2
751751 let updateRefActivity = invoke(mathContract, "updateReferralActivity", [toString(i.caller), gWxAmountStart], nil)
752752 if ((updateRefActivity == updateRefActivity))
753753 then $Tuple2(lockActionsResult, unit)
754754 else throw("Strict value is not equal to itself.")
755755 }
756756 else throw("Strict value is not equal to itself.")
757757 }
758758
759759
760760
761761 @Callable(i)
762762 func claimWxBoost (lpAssetIdStr,userAddressStr) = {
763763 let suspensionCheck = throwIfSuspended()
764764 if ((suspensionCheck == suspensionCheck))
765765 then if ((stakingContract != i.caller))
766766 then throwErr("permissions denied")
767767 else {
768768 let $t02939029492 = internalClaimWxBoost(lpAssetIdStr, userAddressStr, false)
769769 let userBoostAvailable = $t02939029492._1
770770 let dataState = $t02939029492._2
771771 let debug = $t02939029492._3
772772 $Tuple2(dataState, [userBoostAvailable])
773773 }
774774 else throw("Strict value is not equal to itself.")
775775 }
776776
777777
778778
779779 @Callable(i)
780780 func claimWxBoostREADONLY (lpAssetIdStr,userAddressStr) = {
781781 let $t02962429725 = internalClaimWxBoost(lpAssetIdStr, userAddressStr, true)
782782 let userBoostAvailable = $t02962429725._1
783783 let dataState = $t02962429725._2
784784 let debug = $t02962429725._3
785785 $Tuple2(nil, [userBoostAvailable, debug])
786786 }
787787
788788
789789
790790 @Callable(i)
791791 func unlock (txIdStr) = {
792792 let suspensionCheck = throwIfSuspended()
793793 if ((suspensionCheck == suspensionCheck))
794794 then {
795795 let userAddress = i.caller
796796 let userAddressStr = toString(userAddress)
797797 let txIdOption = if ((txIdStr == ""))
798798 then unit
799799 else fromBase58String(txIdStr)
800800 let userRecordArray = readLockParamsRecordOrFail(userAddress, txIdOption)
801801 let userAmount = parseIntValue(userRecordArray[IdxLockAmount])
802802 let lockStart = parseIntValue(userRecordArray[IdxLockStart])
803803 let lockDuration = parseIntValue(userRecordArray[IdxLockDuration])
804804 let wxClaimed = parseIntValue(userRecordArray[IdxLockWxClaimed])
805805 let gwxAmount = parseIntValue(userRecordArray[IdxLockGwxAmount])
806806 let t = ((height - lockStart) / blocksInPeriod)
807807 let wxWithdrawable = getWxWithdrawable(userAddress, txIdOption)
808- let gWxAmountStart = fraction(userAmount, lockDuration, maxLockDuration)
809- let gwxBurned = min([fraction((t * blocksInPeriod), gWxAmountStart, maxLockDuration), gwxAmount])
808+ let gwxBurned = min([fraction(wxWithdrawable, lockDuration, maxLockDuration), gwxAmount])
810809 let gwxRemaining = ensurePositive((gwxAmount - gwxBurned), "gwxRemaining")
811810 let lockedGwxAmount = getLockedGwxAmount(userAddress)
812811 if ((0 >= wxWithdrawable))
813812 then throwErr("nothing to unlock")
814813 else {
815814 let gwxAmountTotal = getGwxAmountTotal()
816815 let userGwxAmountTotal = getUserGwxAmountTotal(userAddress)
817816 let userGwxAmountTotalNew = ensurePositive((userGwxAmountTotal - gwxBurned), "userGwxAmountTotalNew")
818817 if ((lockedGwxAmount > userGwxAmountTotalNew))
819818 then throwErr(("locked gwx amount: " + toString(lockedGwxAmount)))
820819 else {
821820 let userNum = parseIntValue(valueOrErrorMessage(getString(keyUser2NumMapping(userAddressStr)), wrapErr("invalid user number")))
822821 let gwxRewardInv = invoke(gwxRewardContract, "refreshUserReward", [userAddress.bytes, userNum], nil)
823822 if ((gwxRewardInv == gwxRewardInv))
824823 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)])
825824 else throw("Strict value is not equal to itself.")
826825 }
827826 }
828827 }
829828 else throw("Strict value is not equal to itself.")
830829 }
831830
832831
833832
834833 @Callable(i)
835834 func gwxUserInfoREADONLY (userAddressStr) = {
836835 let userAddress = valueOrErrorMessage(addressFromString(userAddressStr), wrapErr("invalid user address"))
837836 let gwxAmount = getUserGwxAmountTotal(userAddress)
838837 $Tuple2(nil, [gwxAmount])
839838 }
840839
841840
842841
843842 @Callable(i)
844843 func userMaxDurationREADONLY (userAddressStr) = $Tuple2(nil, $Tuple2("lock", maxLockDuration))
845844
846845
847846
848847 @Callable(i)
849848 func getUserGwxAmountAtHeightREADONLY (userAddressStr,targetHeight) = {
850849 let userAddress = valueOrErrorMessage(addressFromString(userAddressStr), wrapErr("invalid user address"))
851850 let gwxAmount = getUserGwxAmountTotal(userAddress)
852851 $Tuple2(nil, gwxAmount)
853852 }
854853
855854
856855
857856 @Callable(i)
858857 func getUserGwxAmount (userAddressStr) = {
859858 let userAddress = valueOrErrorMessage(addressFromString(userAddressStr), wrapErr("invalid user address"))
860859 let gwxAmount = getUserGwxAmountTotal(userAddress)
861860 $Tuple2(nil, gwxAmount)
862861 }
863862
864863
865864
866865 @Callable(i)
867866 func getGwxTotalREADONLY () = $Tuple2(nil, getGwxAmountTotal())
868867
869868
870869
871870 @Callable(i)
872871 func onBoostEmissionUpdate () = {
873872 let suspensionCheck = throwIfSuspended()
874873 if ((suspensionCheck == suspensionCheck))
875874 then {
876875 let checkCaller = if ((i.caller == emissionContract))
877876 then true
878877 else mustManager(i)
879878 if ((checkCaller == checkCaller))
880879 then refreshBoostEmissionIntegral()
881880 else throw("Strict value is not equal to itself.")
882881 }
883882 else throw("Strict value is not equal to itself.")
884883 }
885884
886885
887886
888887 @Callable(i)
889888 func onStakedVoteUpdate (lpAssetIdStr,userAddressStr,edge) = {
890889 let suspensionCheck = throwIfSuspended()
891890 if ((suspensionCheck == suspensionCheck))
892891 then {
893892 let checkCaller = if ((i.caller == stakingContract))
894893 then true
895894 else mustManager(i)
896895 if ((checkCaller == checkCaller))
897896 then {
898897 let actions = refreshVoteStakedIntegral(lpAssetIdStr, userAddressStr, edge)
899898 $Tuple2(actions, unit)
900899 }
901900 else throw("Strict value is not equal to itself.")
902901 }
903902 else throw("Strict value is not equal to itself.")
904903 }
905904
906905
907906
908907 @Callable(i)
909908 func getVotingResultStakedREADONLY (lpAssetIdStr) = $Tuple2(nil, getVotingResultStaked(lpAssetIdStr))
910909
911910
912911
913912 @Callable(i)
914913 func getVotingResultStakedIntegralREADONLY (lpAssetIdStr) = $Tuple2(nil, getVotingResultStakedIntegral(lpAssetIdStr))
915914
916915
917916
918917 @Callable(i)
919918 func getUserVoteFinalizedREADONLY (lpAssetIdStr,userAddressStr) = $Tuple2(nil, getUserVoteFinalized(lpAssetIdStr, userAddressStr))
920919
921920
922921
923922 @Callable(i)
924923 func getUserVoteStakedIntegralREADONLY (lpAssetIdStr,userAddressStr) = $Tuple2(nil, getUserVoteStakedIntegral(lpAssetIdStr, userAddressStr))
925924
926925
927926
928927 @Callable(i)
929928 func suspend (v) = {
930929 let checkCaller = mustManager(i)
931930 if ((checkCaller == checkCaller))
932931 then $Tuple2([BooleanEntry(keySuspension, v)], v)
933932 else throw("Strict value is not equal to itself.")
934933 }
935934
936935
937936 @Verifier(tx)
938937 func verify () = {
939938 let targetPublicKey = match managerPublicKeyOrUnit() {
940939 case pk: ByteVector =>
941940 pk
942941 case _: Unit =>
943942 tx.senderPublicKey
944943 case _ =>
945944 throw("Match error")
946945 }
947946 sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey)
948947 }
949948

github/deemru/w8io/026f985 
88.61 ms