tx · 9kSVPccAqNy6i9voTV2RoB6ELgB2DmFQWXPrxzTjnspa

3Myn55vLkduxbX3ZXfiDCZhaQsLxYp1kmCy:  -0.02500000 Waves

2023.08.21 17:52 [2720518] smart account 3Myn55vLkduxbX3ZXfiDCZhaQsLxYp1kmCy > SELF 0.00000000 Waves

{ "type": 13, "id": "9kSVPccAqNy6i9voTV2RoB6ELgB2DmFQWXPrxzTjnspa", "fee": 2500000, "feeAssetId": null, "timestamp": 1692629525387, "version": 2, "chainId": 84, "sender": "3Myn55vLkduxbX3ZXfiDCZhaQsLxYp1kmCy", "senderPublicKey": "9W33iCCNfmFxUbiC6XZcH5x7f6xfwC7Jb3BoExT5q2PV", "proofs": [ "51ZkCKM3LWgSNYXcztQN3EA32j2fmcK7sasBLKNp2c1UiLxoXyy7iU2JZC5cxD7UuGKUdFdcRuEvYU1wYbtVE9dH" ], "script": "base64:BgLNLAgCEgUKAwEIAhIDCgEBEgQKAggIEgQKAggIEgMKAQgSAwoBCBIDCgEIEgQKAggBEgMKAQgSABIAEgUKAwgIBBIDCgEIEgMKAQgSBAoCCAgSBAoCCAgiA1NFUCIGU0NBTEU4IgVNVUxUOCIOUE9PTFdFSUdIVE1VTFQiEGNvbnRyYWN0RmlsZW5hbWUiB1NDQUxFMTgiBk1VTFQxOCIITVVMVDE4QkkiB3dyYXBFcnIiA21zZyIIdGhyb3dFcnIiD2dldFN0cmluZ09yRmFpbCIHYWRkcmVzcyIDa2V5IgxnZXRJbnRPclplcm8iD2dldEludE9yRGVmYXVsdCIKZGVmYXVsdFZhbCIMZ2V0SW50T3JGYWlsIgNhYnMiA3ZhbCIOZW5zdXJlUG9zaXRpdmUiAXYiAW0iG2tleVJlZmVycmFsc0NvbnRyYWN0QWRkcmVzcyIecmVmZXJyYWxzQ29udHJhY3RBZGRyZXNzT3JGYWlsIhZrZXlSZWZlcnJhbFByb2dyYW1OYW1lIhpyZWZlcnJhbFByb2dyYW1OYW1lRGVmYXVsdCITcmVmZXJyYWxQ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XJWb3RlRmluYWxpemVkUkVBRE9OTFkCAmJDAmJLCQCUCgIFA25pbAkBAmNLAgUCYkMFAmJLAmFLASFnZXRVc2VyVm90ZVN0YWtlZEludGVncmFsUkVBRE9OTFkCAmJDAmJLCQCUCgIFA25pbAkBAmRmAgUCYkMFAmJLAQJlUAECZVEABAJlUgQCYUYJAQJhSAADCQABAgUCYUYCCkJ5dGVWZWN0b3IEAmFNBQJhRgUCYU0DCQABAgUCYUYCBFVuaXQIBQJlUA9zZW5kZXJQdWJsaWNLZXkJAAIBAgtNYXRjaCBlcnJvcgkA9AMDCAUCZVAJYm9keUJ5dGVzCQCRAwIIBQJlUAZwcm9vZnMAAAUCZVKg8+6Q", "height": 2720518, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: EhrxZMR8DBwz6KJvD8G2Mg9bT8i5LCAWaoKFRNxycYn3 Next: FSh4apSqk4CHYgJ6cjQxEpJdHyyNGeUDJDKd7Q8tkqro Diff:
OldNewDifferences
779779 let gwxBurned = min([fraction((t * blocksInPeriod), gWxAmountStart, maxLockDuration), gwxAmount])
780780 let gwxRemaining = ensurePositive((gwxAmount - gwxBurned), "gwxRemaining")
781781 let lockedGwxAmount = getLockedGwxAmount(userAddress)
782- if ((0 >= userAmount))
782+ if ((0 >= wxWithdrawable))
783783 then throwErr("nothing to unlock")
784784 else {
785785 let gwxAmountTotal = getGwxAmountTotal()
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 func wrapErr (msg) = makeString([contractFilename, ": ", msg], "")
2121
2222
2323 func throwErr (msg) = throw(wrapErr(msg))
2424
2525
2626 func getStringOrFail (address,key) = valueOrErrorMessage(getString(address, key), wrapErr((("mandatory this." + key) + " is not defined")))
2727
2828
2929 func getIntOrZero (address,key) = valueOrElse(getInteger(address, key), 0)
3030
3131
3232 func getIntOrDefault (address,key,defaultVal) = valueOrElse(getInteger(address, key), defaultVal)
3333
3434
3535 func getIntOrFail (address,key) = valueOrErrorMessage(getInteger(address, key), wrapErr((("mandatory this." + key) + " is not defined")))
3636
3737
3838 func abs (val) = if ((0 > val))
3939 then -(val)
4040 else val
4141
4242
4343 func ensurePositive (v,m) = if ((v >= 0))
4444 then v
4545 else throwErr((valueOrElse(m, "value") + " should be positive"))
4646
4747
4848 func keyReferralsContractAddress () = makeString(["%s%s", "config", "referralsContractAddress"], SEP)
4949
5050
5151 let referralsContractAddressOrFail = addressFromStringValue(getStringOrFail(this, keyReferralsContractAddress()))
5252
5353 let keyReferralProgramName = makeString(["%s%s", "referral", "programName"], SEP)
5454
5555 let referralProgramNameDefault = "wxlock"
5656
5757 let referralProgramName = valueOrElse(getString(this, keyReferralProgramName), referralProgramNameDefault)
5858
5959 func keyFactoryAddress () = "%s%s__config__factoryAddress"
6060
6161
6262 let IdxFactoryCfgStakingDapp = 1
6363
6464 let IdxFactoryCfgBoostingDapp = 2
6565
6666 let IdxFactoryCfgIdoDapp = 3
6767
6868 let IdxFactoryCfgTeamDapp = 4
6969
7070 let IdxFactoryCfgEmissionDapp = 5
7171
7272 let IdxFactoryCfgRestDapp = 6
7373
7474 let IdxFactoryCfgSlippageDapp = 7
7575
7676 let IdxFactoryCfgDaoDapp = 8
7777
7878 let IdxFactoryCfgMarketingDapp = 9
7979
8080 let IdxFactoryCfgGwxRewardDapp = 10
8181
8282 let IdxFactoryCfgBirdsDapp = 11
8383
8484 func keyFactoryCfg () = "%s__factoryConfig"
8585
8686
8787 func keyFactoryLpAssetToPoolContractAddress (lpAssetStr) = makeString(["%s%s%s", lpAssetStr, "mappings__lpAsset2PoolContract"], SEP)
8888
8989
9090 func keyFactoryPoolWeight (contractAddress) = makeString(["%s%s", "poolWeight", contractAddress], SEP)
9191
9292
9393 func keyFactoryPoolWeightHistory (poolAddress,num) = ((("%s%s__poolWeight__" + poolAddress) + "__") + toString(num))
9494
9595
9696 func readFactoryAddressOrFail () = addressFromStringValue(getStringOrFail(this, keyFactoryAddress()))
9797
9898
9999 func readFactoryCfgOrFail (factory) = split(getStringOrFail(factory, keyFactoryCfg()), SEP)
100100
101101
102102 func getBoostingAddressOrFail (factoryCfg) = addressFromStringValue(factoryCfg[IdxFactoryCfgBoostingDapp])
103103
104104
105105 func getEmissionAddressOrFail (factoryCfg) = addressFromStringValue(factoryCfg[IdxFactoryCfgEmissionDapp])
106106
107107
108108 func getStakingAddressOrFail (factoryCfg) = addressFromStringValue(factoryCfg[IdxFactoryCfgStakingDapp])
109109
110110
111111 func getGwxRewardAddressOrFail (factoryCfg) = addressFromStringValue(factoryCfg[IdxFactoryCfgGwxRewardDapp])
112112
113113
114114 func keyManagerPublicKey () = "%s__managerPublicKey"
115115
116116
117117 func keyManagerVaultAddress () = "%s__managerVaultAddress"
118118
119119
120120 func keyEmissionRatePerBlockCurrent () = "%s%s__ratePerBlock__current"
121121
122122
123123 func keyEmissionRatePerBlockMaxCurrent () = "%s%s__ratePerBlockMax__current"
124124
125125
126126 func keyEmissionStartBlock () = "%s%s__emission__startBlock"
127127
128128
129129 func keyBoostingV2LastUpdateHeight () = "%s%s__boostingV2__startBlock"
130130
131131
132132 func keyBoostingV2Integral () = "%s%s__boostingV2__integral"
133133
134134
135135 func keyEmissionDurationInBlocks () = "%s%s__emission__duration"
136136
137137
138138 func keyEmissionEndBlock () = "%s%s__emission__endBlock"
139139
140140
141141 let IdxCfgAssetId = 1
142142
143143 let IdxCfgMinLockAmount = 2
144144
145145 let IdxCfgMinLockDuration = 3
146146
147147 let IdxCfgMaxLockDuration = 4
148148
149149 let IdxCfgMathContract = 5
150150
151151 let IdxCfgBlocksInPeriod = 6
152152
153153 let IdxCfgLockStepBlocks = 7
154154
155155 func keyConfig () = "%s__config"
156156
157157
158158 func readConfigArrayOrFail () = split(getStringOrFail(this, keyConfig()), SEP)
159159
160160
161161 let cfgArray = readConfigArrayOrFail()
162162
163163 let assetId = fromBase58String(cfgArray[IdxCfgAssetId])
164164
165165 let minLockAmount = valueOrErrorMessage(parseInt(cfgArray[IdxCfgMinLockAmount]), wrapErr("invalid min lock amount"))
166166
167167 let minLockDuration = valueOrErrorMessage(parseInt(cfgArray[IdxCfgMinLockDuration]), wrapErr("invalid min lock duration"))
168168
169169 let maxLockDuration = valueOrErrorMessage(parseInt(cfgArray[IdxCfgMaxLockDuration]), wrapErr("invalid max lock duration"))
170170
171171 let mathContract = valueOrErrorMessage(addressFromString(cfgArray[IdxCfgMathContract]), wrapErr("invalid math contract address"))
172172
173173 let blocksInPeriod = valueOrErrorMessage(parseInt(cfgArray[IdxCfgBlocksInPeriod]), wrapErr("invalid blocks in period"))
174174
175175 let lockStepBlocks = valueOrErrorMessage(parseInt(cfgArray[IdxCfgLockStepBlocks]), wrapErr("invalid lock step blocks"))
176176
177177 func getManagerVaultAddressOrThis () = match getString(keyManagerVaultAddress()) {
178178 case s: String =>
179179 addressFromStringValue(s)
180180 case _ =>
181181 this
182182 }
183183
184184
185185 func managerPublicKeyOrUnit () = {
186186 let managerVaultAddress = getManagerVaultAddressOrThis()
187187 match getString(managerVaultAddress, keyManagerPublicKey()) {
188188 case s: String =>
189189 fromBase58String(s)
190190 case _: Unit =>
191191 unit
192192 case _ =>
193193 throw("Match error")
194194 }
195195 }
196196
197197
198198 func mustManager (i) = {
199199 let pd = throwErr("Permission denied")
200200 match managerPublicKeyOrUnit() {
201201 case pk: ByteVector =>
202202 if ((i.callerPublicKey == pk))
203203 then true
204204 else pd
205205 case _: Unit =>
206206 if ((i.caller == this))
207207 then true
208208 else pd
209209 case _ =>
210210 throw("Match error")
211211 }
212212 }
213213
214214
215215 let IdxLockAmount = 1
216216
217217 let IdxLockStart = 2
218218
219219 let IdxLockDuration = 3
220220
221221 let IdxLockLastUpdateTimestamp = 4
222222
223223 let IdxLockGwxAmount = 5
224224
225225 let IdxLockWxClaimed = 6
226226
227227 func keyLockParamsRecord (userAddress,txId) = makeString(["%s%s%s__lock", toString(userAddress), match txId {
228228 case b: ByteVector =>
229229 toBase58String(b)
230230 case _: Unit =>
231231 "legacy"
232232 case _ =>
233233 throw("Match error")
234234 }], SEP)
235235
236236
237237 func readLockParamsRecordOrFail (userAddress,txId) = split(getStringOrFail(this, keyLockParamsRecord(userAddress, txId)), SEP)
238238
239239
240240 func keyUserGwxAmountTotal (userAddress) = makeString(["%s%s__gwxAmountTotal", toString(userAddress)], SEP)
241241
242242
243243 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)
244244
245245
246246 func keyNextUserNum () = "%s__nextUserNum"
247247
248248
249249 func keyUser2NumMapping (userAddress) = makeString(["%s%s%s__mapping__user2num", userAddress], SEP)
250250
251251
252252 func keyNum2UserMapping (num) = makeString(["%s%s%s__mapping__num2user", num], SEP)
253253
254254
255255 func keyLockParamTotalAmount () = "%s%s__stats__activeTotalLocked"
256256
257257
258258 func keyStatsLocksDurationSumInBlocks () = "%s%s__stats__locksDurationSumInBlocks"
259259
260260
261261 func keyStatsLocksCount () = "%s%s__stats__locksCount"
262262
263263
264264 func keyStatsUsersCount () = "%s%s__stats__activeUsersCount"
265265
266266
267267 func keyUserBoostEmissionLastINTEGRAL (userNum) = makeString(["%s%d__userBoostEmissionLastIntV2", toString(userNum)], SEP)
268268
269269
270270 func keyUserLpBoostEmissionLastINTEGRAL (userNum,lpAssetId) = makeString(["%s%d__userBoostEmissionLastIntV2", toString(userNum), lpAssetId], SEP)
271271
272272
273273 func keyUserMaxBoostINTEGRAL (userNum) = makeString(["%s%d__maxBoostInt", toString(userNum)], SEP)
274274
275275
276276 func keyTotalMaxBoostINTEGRAL () = "%s%s__maxBoostInt__total"
277277
278278
279279 func keyUserBoostAvalaibleToClaimTotal (userNum) = makeString(["%s%d__userBoostAvaliableToClaimTotal", toString(userNum)], SEP)
280280
281281
282282 func keyUserBoostClaimed (userNum) = makeString(["%s%d__userBoostClaimed", toString(userNum)], SEP)
283283
284284
285285 func keyGwxTotal () = "%s%s__gwx__total"
286286
287287
288288 func keyVote (amountAssetId,priceAssetId,address,epoch) = makeString(["%s%s%s%s%d", "vote", amountAssetId, priceAssetId, toString(address), toString(epoch)], SEP)
289289
290290
291291 func keyStartHeightByEpoch (epoch) = makeString(["%s%d", "startHeight", toString(epoch)], SEP)
292292
293293
294294 func keyCurrentEpochUi () = makeString(["%s", "currentEpochUi"], SEP)
295295
296296
297297 func keyVotingResultStaked (lpAssetIdStr,epoch) = makeString(["%s%s%d", "votingResultStaked", lpAssetIdStr, toString(epoch)], SEP)
298298
299299
300300 func keyVotingResultStakedIntegral (lpAssetIdStr,epoch) = makeString(["%s%s%d", "votingResultStakedIntegral", lpAssetIdStr, toString(epoch)], SEP)
301301
302302
303303 func keyVotingResultStakedLastUpdateHeight (lpAssetIdStr,epoch) = makeString(["%s%s%d", "votingResultStakedIntegralLastUpdateHeight", lpAssetIdStr, toString(epoch)], SEP)
304304
305305
306306 func keyVotingResultStakedIntegralLast (lpAssetIdStr,address,epoch) = makeString(["%s%s%s%d", "votingResultStakedIntegralLast", lpAssetIdStr, toString(address), toString(epoch)], SEP)
307307
308308
309309 func keyVoteStakedIntegral (lpAssetIdStr,address,epoch) = makeString(["%s%s%s%d", "voteStakedIntegral", lpAssetIdStr, toString(address), toString(epoch)], SEP)
310310
311311
312312 func keyVoteStakedLastUpdateHeight (lpAssetIdStr,address,epoch) = makeString(["%s%s%s%d", "voteStakedIntegralLastUpdateHeight", lpAssetIdStr, toString(address), toString(epoch)], SEP)
313313
314314
315315 func keyVoteStakedIntegralLast (lpAssetIdStr,address,epoch) = makeString(["%s%s%s%d", "voteStakedIntegralLast", lpAssetIdStr, toString(address), toString(epoch)], SEP)
316316
317317
318318 func keyStakedByUser (userAddressStr,lpAssetIdStr) = makeString(["%s%s%s", "staked", userAddressStr, lpAssetIdStr], SEP)
319319
320320
321321 let factoryContract = readFactoryAddressOrFail()
322322
323323 let factoryCfg = readFactoryCfgOrFail(factoryContract)
324324
325325 let emissionContract = getEmissionAddressOrFail(factoryCfg)
326326
327327 let stakingContract = getStakingAddressOrFail(factoryCfg)
328328
329329 let gwxRewardContract = getGwxRewardAddressOrFail(factoryCfg)
330330
331331 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"))
332332
333333 let keyVotingEmissionContract = makeString(["%s", "votingEmissionContract"], SEP)
334334
335335 let votingEmissionContract = addressFromStringValue(getStringValue(factoryContract, keyVotingEmissionContract))
336336
337337 let keyVotingEmissionRateContract = makeString(["%s", "votingEmissionRateContract"], SEP)
338338
339339 let boostCoeff = {
340340 let @ = invoke(emissionContract, "getBoostCoeffREADONLY", nil, nil)
341341 if ($isInstanceOf(@, "Int"))
342342 then @
343343 else throw(($getType(@) + " couldn't be cast to Int"))
344344 }
345345
346346 func userNumberByAddressOrFail (userAddress) = match getString(this, keyUser2NumMapping(toString(userAddress))) {
347347 case s: String =>
348348 valueOrErrorMessage(parseInt(s), wrapErr("invalid user number"))
349349 case _: Unit =>
350350 throwErr("invalid user")
351351 case _ =>
352352 throw("Match error")
353353 }
354354
355355
356356 func getGwxAmountTotal () = valueOrElse(getInteger(this, keyGwxTotal()), 0)
357357
358358
359359 func getLockedGwxAmount (userAddress) = {
360360 let functionName = "getLockedGwxAmount"
361361 let votingEmissionRateContract = valueOrErrorMessage( match getString(votingEmissionContract, keyVotingEmissionRateContract) {
362362 case _: Unit =>
363363 unit
364364 case s: String =>
365365 addressFromString(s)
366366 case _ =>
367367 throw("Match error")
368368 }, wrapErr("invalid voting emission rate address"))
369369 let lockedVotingEmissionRate = {
370370 let @ = invoke(votingEmissionContract, functionName, [toString(userAddress)], nil)
371371 if ($isInstanceOf(@, "Int"))
372372 then @
373373 else throw(($getType(@) + " couldn't be cast to Int"))
374374 }
375375 let lockedVotingEmission = {
376376 let @ = invoke(votingEmissionRateContract, functionName, [toString(userAddress)], nil)
377377 if ($isInstanceOf(@, "Int"))
378378 then @
379379 else throw(($getType(@) + " couldn't be cast to Int"))
380380 }
381381 let locked = max([lockedVotingEmissionRate, lockedVotingEmission])
382382 locked
383383 }
384384
385385
386386 func HistoryEntry (type,user,amount,lockStart,duration,gwxAmount,i) = {
387387 let historyKEY = makeString(["%s%s%s%s__history", type, user, toBase58String(i.transactionId)], SEP)
388388 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)
389389 StringEntry(historyKEY, historyDATA)
390390 }
391391
392392
393393 func StatsEntry (totalLockedInc,durationInc,lockCountInc,usersCountInc) = {
394394 let locksDurationSumInBlocksKEY = keyStatsLocksDurationSumInBlocks()
395395 let locksCountKEY = keyStatsLocksCount()
396396 let usersCountKEY = keyStatsUsersCount()
397397 let totalAmountKEY = keyLockParamTotalAmount()
398398 let locksDurationSumInBlocks = getIntOrZero(this, locksDurationSumInBlocksKEY)
399399 let locksCount = getIntOrZero(this, locksCountKEY)
400400 let usersCount = getIntOrZero(this, usersCountKEY)
401401 let totalAmount = getIntOrZero(this, totalAmountKEY)
402402 [IntegerEntry(locksDurationSumInBlocksKEY, (locksDurationSumInBlocks + durationInc)), IntegerEntry(locksCountKEY, (locksCount + lockCountInc)), IntegerEntry(usersCountKEY, (usersCount + usersCountInc)), IntegerEntry(totalAmountKEY, (totalAmount + totalLockedInc))]
403403 }
404404
405405
406406 func LockParamsEntry (userAddress,txId,amount,start,duration,gwxAmount,wxClaimed) = [StringEntry(keyLockParamsRecord(userAddress, txId), formatLockParamsRecord(amount, start, duration, gwxAmount, wxClaimed))]
407407
408408
409409 func extractOptionalPaymentAmountOrFail (i,expectedAssetId) = if ((size(i.payments) > 1))
410410 then throwErr("only one payment is allowed")
411411 else if ((size(i.payments) == 0))
412412 then 0
413413 else {
414414 let pmt = i.payments[0]
415415 if ((value(pmt.assetId) != expectedAssetId))
416416 then throwErr("invalid asset id in payment")
417417 else pmt.amount
418418 }
419419
420420
421421 func getUserGwxAmountTotal (userAddress) = valueOrElse(getInteger(this, keyUserGwxAmountTotal(userAddress)), 0)
422422
423423
424424 func getVotingEmissionEpochInfo () = {
425425 let $t01449314783 = {
426426 let currentEpochUi = value(getInteger(votingEmissionContract, keyCurrentEpochUi()))
427427 let lastFinalizedEpoch = (currentEpochUi - 1)
428428 if ((0 > lastFinalizedEpoch))
429429 then throwErr("invalid epoch")
430430 else $Tuple2(currentEpochUi, lastFinalizedEpoch)
431431 }
432432 let currentEpochUi = $t01449314783._1
433433 let lastFinalizedEpoch = $t01449314783._2
434434 let currentEpochStartHeight = value(getInteger(votingEmissionContract, keyStartHeightByEpoch(currentEpochUi)))
435435 $Tuple2(lastFinalizedEpoch, currentEpochStartHeight)
436436 }
437437
438438
439439 func getPoolAssetsByLpAssetId (lpAssetIdStr) = {
440440 let idxAmountAssetId = 4
441441 let idxPriceAssetId = 5
442442 let poolCfg = {
443443 let @ = invoke(factoryContract, "getPoolConfigByLpAssetIdREADONLY", [lpAssetIdStr], nil)
444444 if ($isInstanceOf(@, "List[Any]"))
445445 then @
446446 else throw(($getType(@) + " couldn't be cast to List[Any]"))
447447 }
448448 let amountAssetId = {
449449 let @ = poolCfg[idxAmountAssetId]
450450 if ($isInstanceOf(@, "String"))
451451 then @
452452 else throw(($getType(@) + " couldn't be cast to String"))
453453 }
454454 let priceAssetId = {
455455 let @ = poolCfg[idxPriceAssetId]
456456 if ($isInstanceOf(@, "String"))
457457 then @
458458 else throw(($getType(@) + " couldn't be cast to String"))
459459 }
460460 $Tuple2(amountAssetId, priceAssetId)
461461 }
462462
463463
464464 func getUserVoteFinalized (lpAssetIdStr,userAddressStr) = {
465465 let userAddress = addressFromStringValue(userAddressStr)
466466 let $t01547415554 = getVotingEmissionEpochInfo()
467467 let lastFinalizedEpoch = $t01547415554._1
468468 let currentEpochStartHeight = $t01547415554._2
469469 let $t01555715632 = getPoolAssetsByLpAssetId(lpAssetIdStr)
470470 let amountAssetId = $t01555715632._1
471471 let priceAssetId = $t01555715632._2
472472 let userVoteKey = keyVote(amountAssetId, priceAssetId, userAddress, lastFinalizedEpoch)
473473 let userVote = valueOrElse(getInteger(votingEmissionContract, userVoteKey), 0)
474474 userVote
475475 }
476476
477477
478478 func getUserVoteStaked (lpAssetIdStr,userAddressStr) = {
479479 let stakedByUser = valueOrElse(getInteger(stakingContract, keyStakedByUser(userAddressStr, lpAssetIdStr)), 0)
480480 let userVote = getUserVoteFinalized(lpAssetIdStr, userAddressStr)
481481 if ((stakedByUser == 0))
482482 then 0
483483 else userVote
484484 }
485485
486486
487487 func getVotingResultStaked (lpAssetIdStr) = {
488488 let $t01617616256 = getVotingEmissionEpochInfo()
489489 let lastFinalizedEpoch = $t01617616256._1
490490 let currentEpochStartHeight = $t01617616256._2
491491 let votingResultStakedStart = valueOrElse(getInteger(votingEmissionContract, keyVotingResultStaked(lpAssetIdStr, lastFinalizedEpoch)), 0)
492492 let votingResultStaked = valueOrElse(getInteger(this, keyVotingResultStaked(lpAssetIdStr, lastFinalizedEpoch)), votingResultStakedStart)
493493 votingResultStaked
494494 }
495495
496496
497497 func getVotingResultStakedIntegral (lpAssetIdStr) = {
498498 let $t01661816698 = getVotingEmissionEpochInfo()
499499 let lastFinalizedEpoch = $t01661816698._1
500500 let currentEpochStartHeight = $t01661816698._2
501501 let votingResultStaked = getVotingResultStaked(lpAssetIdStr)
502502 let votingResultStakedIntegralPrev = valueOrElse(getInteger(this, keyVotingResultStakedIntegral(lpAssetIdStr, lastFinalizedEpoch)), 0)
503503 let votingResultStakedLastUpdateHeight = valueOrElse(getInteger(this, keyVotingResultStakedLastUpdateHeight(lpAssetIdStr, lastFinalizedEpoch)), currentEpochStartHeight)
504504 let votingResultStakedIntegralDh = (height - votingResultStakedLastUpdateHeight)
505505 let votingResultStakedIntegral = ((votingResultStakedIntegralDh * votingResultStaked) + votingResultStakedIntegralPrev)
506506 votingResultStakedIntegral
507507 }
508508
509509
510510 func refreshVotingResultStakedIntegral (lpAssetIdStr,stakedVoteDelta) = {
511511 let $t01753517615 = getVotingEmissionEpochInfo()
512512 let lastFinalizedEpoch = $t01753517615._1
513513 let currentEpochStartHeight = $t01753517615._2
514514 let votingResultStaked = getVotingResultStaked(lpAssetIdStr)
515515 let votingResultStakedNew = (votingResultStaked + stakedVoteDelta)
516516 let votingResultStakedIntegral = getVotingResultStakedIntegral(lpAssetIdStr)
517517 [IntegerEntry(keyVotingResultStaked(lpAssetIdStr, lastFinalizedEpoch), votingResultStakedNew), IntegerEntry(keyVotingResultStakedLastUpdateHeight(lpAssetIdStr, lastFinalizedEpoch), height), IntegerEntry(keyVotingResultStakedIntegral(lpAssetIdStr, lastFinalizedEpoch), votingResultStakedIntegral)]
518518 }
519519
520520
521521 func getUserVoteStakedIntegral (lpAssetIdStr,userAddressStr) = {
522522 let $t01822618306 = getVotingEmissionEpochInfo()
523523 let lastFinalizedEpoch = $t01822618306._1
524524 let currentEpochStartHeight = $t01822618306._2
525525 let userAddress = addressFromStringValue(userAddressStr)
526526 let userVoteStaked = getUserVoteStaked(lpAssetIdStr, userAddressStr)
527527 let userVoteStakedIntegralPrev = valueOrElse(getInteger(this, keyVoteStakedIntegral(lpAssetIdStr, userAddress, lastFinalizedEpoch)), 0)
528528 let userVoteStakedLastUpdateHeight = valueOrElse(getInteger(this, keyVoteStakedLastUpdateHeight(lpAssetIdStr, userAddress, lastFinalizedEpoch)), currentEpochStartHeight)
529529 let userVoteStakedIntegralDh = (height - userVoteStakedLastUpdateHeight)
530530 let userVoteStakedIntegral = ((userVoteStakedIntegralDh * userVoteStaked) + userVoteStakedIntegralPrev)
531531 userVoteStakedIntegral
532532 }
533533
534534
535535 func refreshVoteStakedIntegral (lpAssetIdStr,userAddressStr,edge) = {
536536 let $t01909419174 = getVotingEmissionEpochInfo()
537537 let lastFinalizedEpoch = $t01909419174._1
538538 let currentEpochStartHeight = $t01909419174._2
539539 let userAddress = addressFromStringValue(userAddressStr)
540540 let userVoteFinalized = getUserVoteFinalized(lpAssetIdStr, userAddressStr)
541541 let actions = if ((userVoteFinalized == 0))
542542 then nil
543543 else {
544544 let stakedVoteDelta = if (edge)
545545 then userVoteFinalized
546546 else -(userVoteFinalized)
547547 let votingResultActions = refreshVotingResultStakedIntegral(lpAssetIdStr, stakedVoteDelta)
548548 let userVoteStakedIntegral = getUserVoteStakedIntegral(lpAssetIdStr, userAddressStr)
549549 let voteActions = [IntegerEntry(keyVoteStakedLastUpdateHeight(lpAssetIdStr, userAddress, lastFinalizedEpoch), height), IntegerEntry(keyVoteStakedIntegral(lpAssetIdStr, userAddress, lastFinalizedEpoch), userVoteStakedIntegral)]
550550 (votingResultActions ++ voteActions)
551551 }
552552 actions
553553 }
554554
555555
556556 func getStakedVotesIntegralsDiff (lpAssetIdStr,userAddressStr) = {
557557 let $t02002820108 = getVotingEmissionEpochInfo()
558558 let lastFinalizedEpoch = $t02002820108._1
559559 let currentEpochStartHeight = $t02002820108._2
560560 let userAddress = addressFromStringValue(userAddressStr)
561561 let userVoteStakedIntegralLastKey = keyVoteStakedIntegralLast(lpAssetIdStr, userAddress, lastFinalizedEpoch)
562562 let userVoteStakedIntegralLast = valueOrElse(getInteger(this, userVoteStakedIntegralLastKey), 0)
563563 let votingResultStakedIntegralLastKey = keyVotingResultStakedIntegralLast(lpAssetIdStr, userAddress, lastFinalizedEpoch)
564564 let votingResultStakedIntegralLast = valueOrElse(getInteger(this, votingResultStakedIntegralLastKey), 0)
565565 let userVoteStakedIntegral = getUserVoteStakedIntegral(lpAssetIdStr, userAddressStr)
566566 let votingResultStakedIntegral = getVotingResultStakedIntegral(lpAssetIdStr)
567567 let userVoteStakedIntegralDiff = (userVoteStakedIntegral - userVoteStakedIntegralLast)
568568 let votingResultStakedIntegralDiff = (votingResultStakedIntegral - votingResultStakedIntegralLast)
569569 $Tuple3([IntegerEntry(userVoteStakedIntegralLastKey, userVoteStakedIntegral), IntegerEntry(votingResultStakedIntegralLastKey, votingResultStakedIntegral)], userVoteStakedIntegralDiff, votingResultStakedIntegralDiff)
570570 }
571571
572572
573573 func refreshBoostEmissionIntegral () = {
574574 let wxEmissionPerBlock = getIntOrFail(emissionContract, keyEmissionRatePerBlockCurrent())
575575 let boostingV2LastUpdateHeightOption = getInteger(this, keyBoostingV2LastUpdateHeight())
576576 let boostingV2IngergalOption = getInteger(this, keyBoostingV2Integral())
577577 let emissionEnd = getIntOrFail(emissionContract, keyEmissionEndBlock())
578578 let h = if ((height > emissionEnd))
579579 then emissionEnd
580580 else height
581581 let dh = match boostingV2LastUpdateHeightOption {
582582 case lastUpdateHeight: Int =>
583583 max([(h - lastUpdateHeight), 0])
584584 case _: Unit =>
585585 0
586586 case _ =>
587587 throw("Match error")
588588 }
589589 let boostEmissionPerBlock = ((wxEmissionPerBlock * (boostCoeff - 1)) / boostCoeff)
590590 let boostEmissionIntegralPrev = valueOrElse(boostingV2IngergalOption, 0)
591591 let boostEmissionIntegral = ((boostEmissionPerBlock * dh) + boostEmissionIntegralPrev)
592592 $Tuple2([IntegerEntry(keyBoostingV2Integral(), boostEmissionIntegral), IntegerEntry(keyBoostingV2LastUpdateHeight(), height)], boostEmissionIntegral)
593593 }
594594
595595
596596 func internalClaimWxBoost (lpAssetIdStr,userAddressStr,readOnly) = {
597597 let userAddress = valueOrErrorMessage(addressFromString(userAddressStr), wrapErr("invalid user address"))
598598 let userNum = userNumberByAddressOrFail(userAddress)
599599 if ((userNum == userNum))
600600 then {
601601 let EMPTYSTR = "empty"
602602 let poolWeight = if ((lpAssetIdStr != EMPTYSTR))
603603 then {
604604 let poolAddressStr = valueOrErrorMessage(getString(factoryContract, keyFactoryLpAssetToPoolContractAddress(lpAssetIdStr)), wrapErr(("unsupported lp asset " + lpAssetIdStr)))
605605 getIntegerValue(factoryContract, keyFactoryPoolWeight(poolAddressStr))
606606 }
607607 else if (readOnly)
608608 then 0
609609 else throwErr(("not readonly mode: unsupported lp asset " + lpAssetIdStr))
610610 let userLpBoostEmissionLastIntegralKEY = keyUserLpBoostEmissionLastINTEGRAL(userNum, lpAssetIdStr)
611611 let userBoostEmissionLastIntegralKEY = keyUserBoostEmissionLastINTEGRAL(userNum)
612612 let userBoostEmissionLastIntegral = valueOrElse(getInteger(this, userLpBoostEmissionLastIntegralKEY), getIntOrZero(this, userBoostEmissionLastIntegralKEY))
613613 let boostEmissionIntegral = refreshBoostEmissionIntegral()._2
614614 let userBoostEmissionIntegral = (boostEmissionIntegral - userBoostEmissionLastIntegral)
615615 if ((0 > userBoostEmissionIntegral))
616616 then throwErr("wrong calculations")
617617 else {
618618 let $t02365023789 = getStakedVotesIntegralsDiff(lpAssetIdStr, userAddressStr)
619619 let stakedVotesIntegralsActions = $t02365023789._1
620620 let userVoteIntegralDiff = $t02365023789._2
621621 let totalVotesIntegralDiff = $t02365023789._3
622622 let poolUserBoostEmissionIntegral = fraction(userBoostEmissionIntegral, poolWeight, POOLWEIGHTMULT)
623623 let userBoostAvaliableToClaimTotalNew = if ((totalVotesIntegralDiff == 0))
624624 then 0
625625 else fraction(poolUserBoostEmissionIntegral, userVoteIntegralDiff, totalVotesIntegralDiff)
626626 let dataState = ([IntegerEntry(userLpBoostEmissionLastIntegralKEY, boostEmissionIntegral)] ++ stakedVotesIntegralsActions)
627627 let debug = makeString([toString(userBoostEmissionLastIntegral), toString(userBoostEmissionIntegral), toString(poolWeight), toString(userVoteIntegralDiff), toString(totalVotesIntegralDiff)], ":")
628628 $Tuple3(userBoostAvaliableToClaimTotalNew, dataState, debug)
629629 }
630630 }
631631 else throw("Strict value is not equal to itself.")
632632 }
633633
634634
635635 func lockActions (i,duration) = {
636636 let assetIdStr = toBase58String(assetId)
637637 if ((size(i.payments) != 1))
638638 then throwErr("invalid payment - exact one payment must be attached")
639639 else {
640640 let pmt = i.payments[0]
641641 let pmtAmount = pmt.amount
642642 if ((assetId != value(pmt.assetId)))
643643 then throwErr((("invalid asset is in payment - " + assetIdStr) + " is expected"))
644644 else {
645645 let nextUserNumKEY = keyNextUserNum()
646646 let userAddress = i.caller
647647 let userAddressStr = toString(userAddress)
648648 let userIsExisting = isDefined(getString(keyUser2NumMapping(userAddressStr)))
649649 let userNumStr = if (userIsExisting)
650650 then value(getString(keyUser2NumMapping(userAddressStr)))
651651 else toString(getIntOrFail(this, nextUserNumKEY))
652652 let userNum = parseIntValue(userNumStr)
653653 let lockStart = height
654654 if (if ((minLockAmount > pmtAmount))
655655 then (userAddress != lpStakingPoolsContract)
656656 else false)
657657 then throwErr(("amount is less then minLockAmount=" + toString(minLockAmount)))
658658 else if ((minLockDuration > duration))
659659 then throwErr(("passed duration is less then minLockDuration=" + toString(minLockDuration)))
660660 else if ((duration > maxLockDuration))
661661 then throwErr(("passed duration is greater then maxLockDuration=" + toString(maxLockDuration)))
662662 else if (((duration % lockStepBlocks) != 0))
663663 then throwErr(("duration must be multiple of lockStepBlocks=" + toString(lockStepBlocks)))
664664 else {
665665 let gWxAmountStart = fraction(pmtAmount, duration, maxLockDuration)
666666 let gwxAmountTotal = getGwxAmountTotal()
667667 let userBoostEmissionLastIntegralKEY = keyUserBoostEmissionLastINTEGRAL(userNum)
668668 let boostEmissionIntegral = refreshBoostEmissionIntegral()._2
669669 let userGwxAmountTotal = getUserGwxAmountTotal(userAddress)
670670 let gwxRewardInv = invoke(gwxRewardContract, "refreshUserReward", [userAddress.bytes, userNum], nil)
671671 if ((gwxRewardInv == gwxRewardInv))
672672 then {
673673 let arr = if (userIsExisting)
674674 then nil
675675 else [IntegerEntry(nextUserNumKEY, (userNum + 1)), StringEntry(keyUser2NumMapping(userAddressStr), userNumStr), StringEntry(keyNum2UserMapping(userNumStr), userAddressStr)]
676676 $Tuple2(((((arr ++ LockParamsEntry(userAddress, i.transactionId, pmtAmount, lockStart, duration, gWxAmountStart, 0)) ++ StatsEntry(pmtAmount, duration, 1, if (userIsExisting)
677677 then 0
678678 else 1)) :+ HistoryEntry("lock", userAddressStr, pmtAmount, lockStart, duration, gWxAmountStart, i)) ++ [IntegerEntry(userBoostEmissionLastIntegralKEY, boostEmissionIntegral), IntegerEntry(keyGwxTotal(), (gwxAmountTotal + gWxAmountStart)), IntegerEntry(keyUserGwxAmountTotal(userAddress), (userGwxAmountTotal + gWxAmountStart))]), gWxAmountStart)
679679 }
680680 else throw("Strict value is not equal to itself.")
681681 }
682682 }
683683 }
684684 }
685685
686686
687687 func getWxWithdrawable (userAddress,txIdOption) = {
688688 let userRecordArray = readLockParamsRecordOrFail(userAddress, txIdOption)
689689 let userAmount = parseIntValue(userRecordArray[IdxLockAmount])
690690 let lockStart = parseIntValue(userRecordArray[IdxLockStart])
691691 let lockDuration = parseIntValue(userRecordArray[IdxLockDuration])
692692 let lockEnd = (lockStart + lockDuration)
693693 let wxClaimed = parseIntValue(userRecordArray[IdxLockWxClaimed])
694694 let t = ((height - lockStart) / blocksInPeriod)
695695 let exponent = fraction(toBigInt(t), (toBigInt((8 * blocksInPeriod)) * MULT18BI), toBigInt(lockDuration))
696696 let wxWithdrawable = if ((height > lockEnd))
697697 then userAmount
698698 else (toInt(fraction(toBigInt(userAmount), (MULT18BI - pow(toBigInt(5), 1, exponent, SCALE18, SCALE18, DOWN)), MULT18BI)) - wxClaimed)
699699 wxWithdrawable
700700 }
701701
702702
703703 @Callable(i)
704704 func lockRef (duration,referrerAddress,signature) = {
705705 let $t02810028165 = lockActions(i, duration)
706706 let lockActionsResult = $t02810028165._1
707707 let gWxAmountStart = $t02810028165._2
708708 let referralAddress = toString(i.caller)
709709 let refInv = if (if ((referrerAddress == ""))
710710 then true
711711 else (signature == base58''))
712712 then unit
713713 else invoke(referralsContractAddressOrFail, "createPair", [referralProgramName, referrerAddress, referralAddress, signature], nil)
714714 if ((refInv == refInv))
715715 then {
716716 let updateRefActivity = invoke(mathContract, "updateReferralActivity", [toString(i.caller), gWxAmountStart], nil)
717717 if ((updateRefActivity == updateRefActivity))
718718 then $Tuple2(lockActionsResult, unit)
719719 else throw("Strict value is not equal to itself.")
720720 }
721721 else throw("Strict value is not equal to itself.")
722722 }
723723
724724
725725
726726 @Callable(i)
727727 func lock (duration) = {
728728 let $t02862328688 = lockActions(i, duration)
729729 let lockActionsResult = $t02862328688._1
730730 let gWxAmountStart = $t02862328688._2
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
737737
738738
739739 @Callable(i)
740740 func claimWxBoost (lpAssetIdStr,userAddressStr) = if ((stakingContract != i.caller))
741741 then throwErr("permissions denied")
742742 else {
743743 let $t02899829100 = internalClaimWxBoost(lpAssetIdStr, userAddressStr, false)
744744 let userBoostAvailable = $t02899829100._1
745745 let dataState = $t02899829100._2
746746 let debug = $t02899829100._3
747747 $Tuple2(dataState, [userBoostAvailable])
748748 }
749749
750750
751751
752752 @Callable(i)
753753 func claimWxBoostREADONLY (lpAssetIdStr,userAddressStr) = {
754754 let $t02923229333 = internalClaimWxBoost(lpAssetIdStr, userAddressStr, true)
755755 let userBoostAvailable = $t02923229333._1
756756 let dataState = $t02923229333._2
757757 let debug = $t02923229333._3
758758 $Tuple2(nil, [userBoostAvailable, debug])
759759 }
760760
761761
762762
763763 @Callable(i)
764764 func unlock (txIdStr) = {
765765 let userAddress = i.caller
766766 let userAddressStr = toString(userAddress)
767767 let txIdOption = if ((txIdStr == ""))
768768 then unit
769769 else fromBase58String(txIdStr)
770770 let userRecordArray = readLockParamsRecordOrFail(userAddress, txIdOption)
771771 let userAmount = parseIntValue(userRecordArray[IdxLockAmount])
772772 let lockStart = parseIntValue(userRecordArray[IdxLockStart])
773773 let lockDuration = parseIntValue(userRecordArray[IdxLockDuration])
774774 let wxClaimed = parseIntValue(userRecordArray[IdxLockWxClaimed])
775775 let gwxAmount = parseIntValue(userRecordArray[IdxLockGwxAmount])
776776 let t = ((height - lockStart) / blocksInPeriod)
777777 let wxWithdrawable = getWxWithdrawable(userAddress, txIdOption)
778778 let gWxAmountStart = fraction(userAmount, lockDuration, maxLockDuration)
779779 let gwxBurned = min([fraction((t * blocksInPeriod), gWxAmountStart, maxLockDuration), gwxAmount])
780780 let gwxRemaining = ensurePositive((gwxAmount - gwxBurned), "gwxRemaining")
781781 let lockedGwxAmount = getLockedGwxAmount(userAddress)
782- if ((0 >= userAmount))
782+ if ((0 >= wxWithdrawable))
783783 then throwErr("nothing to unlock")
784784 else {
785785 let gwxAmountTotal = getGwxAmountTotal()
786786 let userGwxAmountTotal = getUserGwxAmountTotal(userAddress)
787787 let userGwxAmountTotalNew = ensurePositive((userGwxAmountTotal - gwxBurned), "userGwxAmountTotalNew")
788788 if ((lockedGwxAmount > userGwxAmountTotalNew))
789789 then throwErr(("locked gwx amount: " + toString(lockedGwxAmount)))
790790 else {
791791 let userNum = parseIntValue(valueOrErrorMessage(getString(keyUser2NumMapping(userAddressStr)), wrapErr("invalid user number")))
792792 let gwxRewardInv = invoke(gwxRewardContract, "refreshUserReward", [userAddress.bytes, userNum], nil)
793793 if ((gwxRewardInv == gwxRewardInv))
794794 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)])
795795 else throw("Strict value is not equal to itself.")
796796 }
797797 }
798798 }
799799
800800
801801
802802 @Callable(i)
803803 func gwxUserInfoREADONLY (userAddressStr) = {
804804 let userAddress = valueOrErrorMessage(addressFromString(userAddressStr), wrapErr("invalid user address"))
805805 let gwxAmount = getUserGwxAmountTotal(userAddress)
806806 $Tuple2(nil, [gwxAmount])
807807 }
808808
809809
810810
811811 @Callable(i)
812812 func userMaxDurationREADONLY (userAddressStr) = $Tuple2(nil, $Tuple2("lock", maxLockDuration))
813813
814814
815815
816816 @Callable(i)
817817 func getUserGwxAmountAtHeightREADONLY (userAddressStr,targetHeight) = {
818818 let userAddress = valueOrErrorMessage(addressFromString(userAddressStr), wrapErr("invalid user address"))
819819 let gwxAmount = getUserGwxAmountTotal(userAddress)
820820 $Tuple2(nil, gwxAmount)
821821 }
822822
823823
824824
825825 @Callable(i)
826826 func getUserGwxAmount (userAddressStr) = {
827827 let userAddress = valueOrErrorMessage(addressFromString(userAddressStr), wrapErr("invalid user address"))
828828 let gwxAmount = getUserGwxAmountTotal(userAddress)
829829 $Tuple2(nil, gwxAmount)
830830 }
831831
832832
833833
834834 @Callable(i)
835835 func getGwxTotalREADONLY () = $Tuple2(nil, getGwxAmountTotal())
836836
837837
838838
839839 @Callable(i)
840840 func onBoostEmissionUpdate () = {
841841 let checkCaller = if ((i.caller == emissionContract))
842842 then true
843843 else mustManager(i)
844844 if ((checkCaller == checkCaller))
845845 then refreshBoostEmissionIntegral()
846846 else throw("Strict value is not equal to itself.")
847847 }
848848
849849
850850
851851 @Callable(i)
852852 func onStakedVoteUpdate (lpAssetIdStr,userAddressStr,edge) = {
853853 let checkCaller = if ((i.caller == stakingContract))
854854 then true
855855 else mustManager(i)
856856 if ((checkCaller == checkCaller))
857857 then {
858858 let actions = refreshVoteStakedIntegral(lpAssetIdStr, userAddressStr, edge)
859859 $Tuple2(actions, unit)
860860 }
861861 else throw("Strict value is not equal to itself.")
862862 }
863863
864864
865865
866866 @Callable(i)
867867 func getVotingResultStakedREADONLY (lpAssetIdStr) = $Tuple2(nil, getVotingResultStaked(lpAssetIdStr))
868868
869869
870870
871871 @Callable(i)
872872 func getVotingResultStakedIntegralREADONLY (lpAssetIdStr) = $Tuple2(nil, getVotingResultStakedIntegral(lpAssetIdStr))
873873
874874
875875
876876 @Callable(i)
877877 func getUserVoteFinalizedREADONLY (lpAssetIdStr,userAddressStr) = $Tuple2(nil, getUserVoteFinalized(lpAssetIdStr, userAddressStr))
878878
879879
880880
881881 @Callable(i)
882882 func getUserVoteStakedIntegralREADONLY (lpAssetIdStr,userAddressStr) = $Tuple2(nil, getUserVoteStakedIntegral(lpAssetIdStr, userAddressStr))
883883
884884
885885 @Verifier(tx)
886886 func verify () = {
887887 let targetPublicKey = match managerPublicKeyOrUnit() {
888888 case pk: ByteVector =>
889889 pk
890890 case _: Unit =>
891891 tx.senderPublicKey
892892 case _ =>
893893 throw("Match error")
894894 }
895895 sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey)
896896 }
897897

github/deemru/w8io/026f985 
131.35 ms