tx · GREoUiztZu1cjmLjvssmYUBdRkwga58j37QTkEQdByUJ

3MzYrKxGR6BZcwdHQDDXDRGn7c63zQsqyu3:  -0.03400000 Waves

2023.05.04 13:13 [2562879] smart account 3MzYrKxGR6BZcwdHQDDXDRGn7c63zQsqyu3 > SELF 0.00000000 Waves

{ "type": 13, "id": "GREoUiztZu1cjmLjvssmYUBdRkwga58j37QTkEQdByUJ", "fee": 3400000, "feeAssetId": null, "timestamp": 1683195245403, "version": 2, "chainId": 84, "sender": "3MzYrKxGR6BZcwdHQDDXDRGn7c63zQsqyu3", "senderPublicKey": "7GvzKupc5EwAeuw6BXayiGswG3LEmw6artCvXaZzaGKp", "proofs": [ "4UpwrRVj6HVgcPURjFbXyH74xzmJj5NTeDAzHq9UJzG4pUGdrTWhKoPHd8SS4t2Wok74cUne3EaCQRhT2NT7N9tt" ], "script": "base64:BgJjCAISAwoBCBIDCgEIEgMKAQgSABIAEgMKAQgSBAoCCAESBgoEAgECAhIDCgEIEgMKAQgSBQoDCAgEEgYKBAEYCBgSBAoCGAgSBAoCCAgSBAoCCAgSAwoBCBIDCgEIEgQKAggIYwAGU0NBTEU4AAgABU1VTFQzAOgHAAVNVUxUOACAwtcvAAdTQ0FMRTE4ABIABk1VTFQxOAkAtgIBAICAkLu61q3wDQADU0VQAgJfXwAOUE9PTFdFSUdIVE1VTFQFBU1VTFQ4AAp6ZXJvQmlnSW50CQC2AgEAAAAJb25lQmlnSW50CQC2AgEAAQEHd3JhcEVycgEDbXNnCQC5CQIJAMwIAgINc3Rha2luZy5yaWRlOgkAzAgCCQClCAEFBHRoaXMJAMwIAgUDbXNnBQNuaWwCASABCHRocm93RXJyAQNtc2cJAAIBCQEHd3JhcEVycgEFA21zZwEJYXNBbnlMaXN0AQN2YWwEByRtYXRjaDAFA3ZhbAMJAAECBQckbWF0Y2gwAglMaXN0W0FueV0ECnZhbEFueUx5c3QFByRtYXRjaDAFCnZhbEFueUx5c3QJAQh0aHJvd0VycgECG2ZhaWwg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c1N0cgMJAQIhPQIIBQFpBmNhbGxlcgUPZmFjdG9yeUNvbnRyYWN0CQEIdGhyb3dFcnIBAhJwZXJtaXNzaW9ucyBkZW5pZWQEDSR0MDMzMDYyMzMxNzIJARRyZWZyZXNoUG9vbElOVEVHUkFMUwMFDGxwQXNzZXRJZFN0cgUOcG9vbEFkZHJlc3NTdHIAAAQSd3hQZXJMcEludGVncmFsTmV3CAUNJHQwMzMwNjIzMzE3MgJfMQQRcG9vbEludGVncmFsU1RBVEUIBQ0kdDAzMzA2MjMzMTcyAl8yBAlwb29sREVCVUcIBQ0kdDAzMzA2MjMzMTcyAl8zBRFwb29sSW50ZWdyYWxTVEFURQECdHgBBnZlcmlmeQAED3RhcmdldFB1YmxpY0tleQQHJG1hdGNoMAkBFm1hbmFnZXJQdWJsaWNLZXlPclVuaXQAAwkAAQIFByRtYXRjaDACCkJ5dGVWZWN0b3IEAnBrBQckbWF0Y2gwBQJwawMJAAECBQckbWF0Y2gwAgRVbml0CAUCdHgPc2VuZGVyUHVibGljS2V5CQACAQILTWF0Y2ggZXJyb3IJAPQDAwgFAnR4CWJvZHlCeXRlcwkAkQMCCAUCdHgGcHJvb2ZzAAAFD3RhcmdldFB1YmxpY0tleQvtHdQ=", "height": 2562879, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: UaHE4eEWLGBCjSmRa3Fx43KGDiCXqnu34e2z1mv5hB1 Next: 46dKdHSxZHcrD88CEobzHgCg2WYXTWUBMCFM8K2CwZxi Diff:
OldNewDifferences
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let SCALE8 = 8
5+
6+let MULT3 = 1000
57
68 let MULT8 = 100000000
79
2729 case valAnyLyst: List[Any] =>
2830 valAnyLyst
2931 case _ =>
30- throw("fail to cast into List[Any]")
32+ throwErr("fail to cast into List[Any]")
3133 }
3234
3335
3537 case valInt: Int =>
3638 valInt
3739 case _ =>
38- throw("fail to cast into Int")
40+ throwErr("fail to cast into Int")
3941 }
4042
4143
4345 case valStr: String =>
4446 valStr
4547 case _ =>
46- throw("fail to cast into Int")
48+ throwErr("fail to cast into Int")
4749 }
4850
4951
5153 case valBin: ByteVector =>
5254 valBin
5355 case _ =>
54- throw("fail to cast into Int")
56+ throwErr("fail to cast into Int")
5557 }
5658
5759
58-func getStringOrFail (address,key) = valueOrErrorMessage(getString(address, key), (("mandatory this." + key) + " is not defined"))
60+func getStringOrFail (address,key) = valueOrErrorMessage(getString(address, key), wrapErr((("mandatory this." + key) + " is not defined")))
5961
6062
61-func getStringByAddressOrFail (address,key) = valueOrErrorMessage(getString(address, key), (((("mandatory " + toString(address)) + ".") + key) + " is not defined"))
63+func getStringByAddressOrFail (address,key) = valueOrErrorMessage(getString(address, key), wrapErr((((("mandatory " + toString(address)) + ".") + key) + " is not defined")))
6264
6365
6466 func getIntOrZero (address,key) = valueOrElse(getInteger(address, key), 0)
6769 func getIntOrDefault (address,key,defaultVal) = valueOrElse(getInteger(address, key), defaultVal)
6870
6971
70-func getIntOrFail (address,key) = valueOrErrorMessage(getInteger(address, key), (("mandatory this." + key) + " is not defined"))
72+func getIntOrFail (address,key) = valueOrErrorMessage(getInteger(address, key), wrapErr((("mandatory this." + key) + " is not defined")))
7173
7274
7375 func getBigIntFromStringOrZero (address,key) = value(parseBigInt(valueOrElse(getString(address, key), "0")))
116118
117119
118120 func keyPendingManagerPublicKey () = "%s__pendingManagerPublicKey"
119-
120-
121-func keyStablePoolAddonAddr () = "%s__stablePoolAddonAddr"
122-
123-
124-func keyAddonAddr () = "%s__addonAddr"
125121
126122
127123 func keyFactoryLp2AssetsMapping (lpAssetStr) = makeString(["%s%s%s", lpAssetStr, "mappings__lpAsset2PoolContract"], SEP)
245241
246242 let boostingContract = getBoostingAddressOrFail(factoryCfg)
247243
244+let boostCoeff = {
245+ let @ = invoke(emissionContract, "getBoostCoeffREADONLY", nil, nil)
246+ if ($isInstanceOf(@, "Int"))
247+ then @
248+ else throw(($getType(@) + " couldn't be cast to Int"))
249+ }
250+
248251 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"))
249252
250253 func keyNextUser (lpAssetId) = makeString(["%s%s", lpAssetId, "nextUser"], SEP)
282285 let listSize = valueOrElse(getInteger(this, keyListSize(listName)), 0)
283286 let checkNode = if (!(containsNode(listName, id)))
284287 then true
285- else throw("Node exists")
288+ else throwErr("Node exists")
286289 if ((checkNode == checkNode))
287290 then (([IntegerEntry(keyListSize(listName), (listSize + 1))] ++ (if ((headOrUnit != unit))
288291 then [StringEntry(keyListNext(listName, id), value(headOrUnit)), StringEntry(keyListPrev(listName, value(headOrUnit)), id)]
306309 then [DeleteEntry(keyListPrev(listName, id)), DeleteEntry(keyListNext(listName, value(prevOrUnit)))]
307310 else if ((id == valueOrElse(headOrUnit, "")))
308311 then [DeleteEntry(keyListHead(listName))]
309- else throw(((("invalid node: " + listName) + ".") + id))))
312+ else throwErr(((("invalid node: " + listName) + ".") + id))))
310313 }
311314
312315
320323 then (stakedByUser > zeroBigInt)
321324 else false)
322325 then value(parseBigInt(getStringOrFail(this, wxPerLpIntegralUserLastKEY)))
323- else throw("calcWxPerLpIntegralUserLast: unexpected state")
326+ else throwErr("calcWxPerLpIntegralUserLast: unexpected state")
324327
325328
326329 func refreshPoolINTEGRALS (lpAssetIdStr,poolAddressStr,lpDeltaAmount) = {
331334 else stakedTotal
332335 let poolWeight = getIntegerValue(factoryContract, keyFactoryPoolWeight(poolAddressStr))
333336 let emissionStartBlock = getIntOrFail(emissionContract, keyEmissionStartBlock())
334- let MULT3 = 1000
335337 let wxEmissionPerBlockX3 = (getIntOrFail(emissionContract, keyEmissionRatePerBlockCurrent()) * MULT3)
336- let poolWxEmissionPerBlockX3 = fraction(wxEmissionPerBlockX3, poolWeight, (POOLWEIGHTMULT * 3))
338+ let poolWxEmissionPerBlockX3 = fraction(wxEmissionPerBlockX3, poolWeight, (POOLWEIGHTMULT * boostCoeff))
337339 let wxPerLpIntegralKEY = keyWxPerLpIntegral(lpAssetIdStr)
338340 let wxPerLpIntegralLastUpdHeightKEY = keyWxPerLpIntegralLastUpdHeight(lpAssetIdStr)
339341 let wxPerLpKEY = keyWxPerLp(lpAssetIdStr)
357359
358360
359361 func refreshINTEGRALS (lpAssetIdStr,userAddressStr,poolAddressStr,lpDeltaAmount) = {
360- let $t01475014872 = refreshPoolINTEGRALS(lpAssetIdStr, poolAddressStr, lpDeltaAmount)
361- let wxPerLpIntegralNew = $t01475014872._1
362- let poolIntegralSTATE = $t01475014872._2
363- let poolDEBUG = $t01475014872._3
364- let MULT3 = 1000
362+ let $t01472314845 = refreshPoolINTEGRALS(lpAssetIdStr, poolAddressStr, lpDeltaAmount)
363+ let wxPerLpIntegralNew = $t01472314845._1
364+ let poolIntegralSTATE = $t01472314845._2
365+ let poolDEBUG = $t01472314845._3
365366 let stakedByUserKEY = keyStakedByUser(userAddressStr, lpAssetIdStr)
366367 let stakedByUser = readStaked(stakedByUserKEY)
367368 let wxToClaimUserKEY = keyWxToClaimUser(lpAssetIdStr, userAddressStr)
399400 }
400401
401402
402-let permissionDeniedError = throw("Permission denied")
403+let permissionDeniedError = throwErr("Permission denied")
403404
404405 func mustThis (i) = if ((i.caller == this))
405406 then true
418419 case _ =>
419420 throw("Match error")
420421 }
422+
423+
424+func stakeActions (i,lpAssetId,poolAddress,userAddress,amount) = {
425+ let userAddressStr = toString(userAddress)
426+ let lpAssetIdStr = toBase58String(lpAssetId)
427+ let poolAddressStr = toString(poolAddress)
428+ let stakedByUserKEY = keyStakedByUser(userAddressStr, lpAssetIdStr)
429+ let stakedTotalKEY = keyStakedTotal(lpAssetIdStr)
430+ let stakedByUser = readStaked(stakedByUserKEY)
431+ let refreshStakedVote = if ((stakedByUser == 0))
432+ then invoke(boostingContract, "onStakedVoteUpdate", [lpAssetIdStr, userAddressStr, true], nil)
433+ else unit
434+ if ((refreshStakedVote == refreshStakedVote))
435+ then {
436+ let stakedTotal = readStaked(stakedTotalKEY)
437+ let $t01806418181 = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, amount)
438+ let wxToClaimUserNew = $t01806418181._1
439+ let integralSTATE = $t01806418181._2
440+ let debug = $t01806418181._3
441+ let listName = getUsersListName(lpAssetIdStr)
442+ let listActions = if (containsNode(listName, userAddressStr))
443+ then nil
444+ else insertNodeActions(listName, userAddressStr)
445+ (([IntegerEntry(stakedByUserKEY, (stakedByUser + amount)), IntegerEntry(stakedTotalKEY, (stakedTotal + amount)), OperationHistoryEntry("stake", userAddressStr, lpAssetIdStr, amount, i.transactionId)] ++ integralSTATE) ++ listActions)
446+ }
447+ else throw("Strict value is not equal to itself.")
448+ }
421449
422450
423451 func unstakeActions (i,lpAssetId,poolAddress,userAddress,lpAssetRecipientAddress,amount) = {
449477 else unit
450478 if ((r == r))
451479 then if ((amount > stakedByUser))
452- then throw(((((((("passed amount=" + toString(amount)) + " is greater than available=") + toString(stakedByUser)) + ". lpAssetId=") + lpAssetIdStr) + ". stakedByUserKEY=") + stakedByUserKEY))
480+ then throwErr(((((((("passed amount=" + toString(amount)) + " is greater than available=") + toString(stakedByUser)) + ". lpAssetId=") + lpAssetIdStr) + ". stakedByUserKEY=") + stakedByUserKEY))
453481 else (([IntegerEntry(stakedByUserKEY, (stakedByUser - amount)), IntegerEntry(stakedTotalKEY, (stakedTotal - amount)), ScriptTransfer(lpAssetRecipientAddress, amount, lpAssetId), OperationHistoryEntry("unstake", userAddressStr, lpAssetIdStr, amount, i.transactionId)] ++ integralSTATE) ++ listActions)
454482 else throw("Strict value is not equal to itself.")
455483 }
499527 let pm = pendingManagerPublicKeyOrUnit()
500528 let hasPM = if (isDefined(pm))
501529 then true
502- else throw("No pending manager")
530+ else throwErr("No pending manager")
503531 if ((hasPM == hasPM))
504532 then {
505533 let checkPM = if ((i.callerPublicKey == value(pm)))
506534 then true
507- else throw("You are not pending manager")
535+ else throwErr("You are not pending manager")
508536 if ((checkPM == checkPM))
509537 then [StringEntry(keyManagerPublicKey(), toBase58String(value(pm))), DeleteEntry(keyPendingManagerPublicKey())]
510538 else throw("Strict value is not equal to itself.")
516544
517545 @Callable(i)
518546 func stake () = if ((size(i.payments) != 1))
519- then throw("invalid payment - exact one payment must be attached")
547+ then throwErr("invalid payment - exact one payment must be attached")
520548 else {
521549 let pmt = i.payments[0]
522550 let lpAssetId = value(pmt.assetId)
523551 let lpAssetIdStr = toBase58String(lpAssetId)
524552 let amount = pmt.amount
525- let poolAddressStr = valueOrErrorMessage(getString(factoryContract, keyFactoryLp2AssetsMapping(lpAssetIdStr)), ("unsupported lp asset " + lpAssetIdStr))
526- let callerStr = toString(i.caller)
527- let userAddressStr = if ((callerStr == poolAddressStr))
528- then toString(i.originCaller)
529- else callerStr
530- let stakedByUserKEY = keyStakedByUser(userAddressStr, lpAssetIdStr)
531- let stakedTotalKEY = keyStakedTotal(lpAssetIdStr)
532- let stakedByUser = readStaked(stakedByUserKEY)
533- let refreshStakedVote = if ((stakedByUser == 0))
534- then invoke(boostingContract, "onStakedVoteUpdate", [lpAssetIdStr, userAddressStr, true], nil)
535- else unit
536- if ((refreshStakedVote == refreshStakedVote))
537- then {
538- let stakedTotal = readStaked(stakedTotalKEY)
539- let $t02161321730 = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, amount)
540- let wxToClaimUserNew = $t02161321730._1
541- let integralSTATE = $t02161321730._2
542- let debug = $t02161321730._3
543- let listName = getUsersListName(lpAssetIdStr)
544- let listActions = if (containsNode(listName, userAddressStr))
545- then nil
546- else insertNodeActions(listName, userAddressStr)
547- (([IntegerEntry(stakedByUserKEY, (stakedByUser + amount)), IntegerEntry(stakedTotalKEY, (stakedTotal + amount)), OperationHistoryEntry("stake", userAddressStr, lpAssetIdStr, amount, i.transactionId)] ++ integralSTATE) ++ listActions)
548- }
549- else throw("Strict value is not equal to itself.")
553+ let poolAddressStr = valueOrErrorMessage(getString(factoryContract, keyFactoryLp2AssetsMapping(lpAssetIdStr)), wrapErr(("unsupported lp asset " + lpAssetIdStr)))
554+ let poolAddress = addressFromStringValue(poolAddressStr)
555+ let userAddress = if ((i.caller == poolAddress))
556+ then i.originCaller
557+ else i.caller
558+ stakeActions(i, lpAssetId, poolAddress, userAddress, amount)
559+ }
560+
561+
562+
563+@Callable(i)
564+func stakeFor (userAddressStr) = if ((size(i.payments) != 1))
565+ then throwErr("invalid payment - exact one payment must be attached")
566+ else {
567+ let pmt = i.payments[0]
568+ let lpAssetId = value(pmt.assetId)
569+ let lpAssetIdStr = toBase58String(lpAssetId)
570+ let amount = pmt.amount
571+ let poolAddressStr = valueOrErrorMessage(getString(factoryContract, keyFactoryLp2AssetsMapping(lpAssetIdStr)), wrapErr(("unsupported lp asset " + lpAssetIdStr)))
572+ let poolAddress = addressFromStringValue(poolAddressStr)
573+ let userAddress = valueOrErrorMessage(addressFromString(userAddressStr), wrapErr("invalid user address"))
574+ stakeActions(i, lpAssetId, poolAddress, userAddress, amount)
550575 }
551576
552577
554579 @Callable(i)
555580 func unstake (lpAssetIdStr,amount) = {
556581 let lpAssetId = fromBase58String(lpAssetIdStr)
557- let poolAddressStr = valueOrErrorMessage(getString(factoryContract, keyFactoryLp2AssetsMapping(lpAssetIdStr)), ("unsupported lp asset " + lpAssetIdStr))
582+ let poolAddressStr = valueOrErrorMessage(getString(factoryContract, keyFactoryLp2AssetsMapping(lpAssetIdStr)), wrapErr(("unsupported lp asset " + lpAssetIdStr)))
558583 let poolAddress = addressFromStringValue(poolAddressStr)
559- let poolAddon = valueOrElse(getString(poolAddress, keyAddonAddr()), poolAddressStr)
560584 let callerStr = toString(i.caller)
561- let userAddress = if (if ((callerStr == poolAddressStr))
562- then true
563- else (callerStr == poolAddon))
585+ let userAddress = if ((callerStr == poolAddressStr))
564586 then i.originCaller
565587 else i.caller
566588 let lpAssetRecipientAddress = i.caller
572594 @Callable(i)
573595 func unstakeINTERNAL (lpAssetId,amount,userAddress,lpAssetRecipientAddress) = {
574596 let lpAssetIdStr = toBase58String(lpAssetId)
575- let poolAddress = addressFromStringValue(valueOrErrorMessage(getString(factoryContract, keyFactoryLp2AssetsMapping(lpAssetIdStr)), ("unsupported lp asset " + lpAssetIdStr)))
597+ let poolAddress = addressFromStringValue(valueOrErrorMessage(getString(factoryContract, keyFactoryLp2AssetsMapping(lpAssetIdStr)), wrapErr(("unsupported lp asset " + lpAssetIdStr))))
576598 let checkCaller = if ((i.caller == poolAddress))
577599 then true
578600 else permissionDeniedError
608630 let checkCaller = mustThis(i)
609631 if ((checkCaller == checkCaller))
610632 then {
611- let userAddress = valueOrErrorMessage(addressFromString(userAddressStr), "claimWxINTERNAL: invalid user address")
633+ let userAddress = valueOrErrorMessage(addressFromString(userAddressStr), wrapErr("claimWxINTERNAL: invalid user address"))
612634 let poolAddressStr = getStringByAddressOrFail(factoryContract, keyFactoryLpAssetToPoolContractAddress(lpAssetIdStr))
613635 let claimedByUserKEY = keyClaimedByUser(lpAssetIdStr, userAddressStr)
614636 let claimedTotalKEY = keyClaimedTotal(lpAssetIdStr)
618640 let claimedByUserMinReward = getBigIntFromStringOrZero(this, claimedByUserMinRewardKEY)
619641 let claimedByUserBoostReward = getBigIntFromStringOrZero(this, claimedByUserBoostRewardKEY)
620642 let claimedTotal = getBigIntFromStringOrZero(this, claimedTotalKEY)
621- let $t02511625228 = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, 0)
622- let wxToClaimUserNew = $t02511625228._1
623- let integralSTATE = $t02511625228._2
624- let debug = $t02511625228._3
643+ let $t02599726109 = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, 0)
644+ let wxToClaimUserNew = $t02599726109._1
645+ let integralSTATE = $t02599726109._2
646+ let debug = $t02599726109._3
625647 let availableToClaim = max([(wxToClaimUserNew - claimedByUserMinReward), zeroBigInt])
626648 if ((zeroBigInt >= availableToClaim))
627649 then if (throwIfNothingToClaim)
628- then throw("nothing to claim")
650+ then throwErr("nothing to claim")
629651 else $Tuple2(nil, 0)
630652 else {
631653 let wxAmountBoostTotal = max([asInt(asAnyList(invoke(boostingContract, "claimWxBoost", [lpAssetIdStr, userAddressStr], nil))[0]), 0])
632654 let minRewardPart = availableToClaim
633- let boostRewardPart = min([(minRewardPart * toBigInt(2)), toBigInt(wxAmountBoostTotal)])
655+ let boostRewardPart = min([(minRewardPart * toBigInt((boostCoeff - 1))), toBigInt(wxAmountBoostTotal)])
634656 let totalReward = (minRewardPart + boostRewardPart)
635657 let wxAssetId = asByteVector(asAnyList(invoke(emissionContract, "emit", [toInt(minRewardPart)], nil))[0])
636658 let emitBoost = asAnyList(invoke(emissionContract, "emit", [toInt(boostRewardPart)], nil))
663685 }, SEP)
664686 let unclaimed = info[3]
665687 let claimed = info[4]
666- let res = (resAcc :+ makeString(["%d%d", unclaimed, claimed], SEP))
688+ let userVoteFinalized = {
689+ let @ = invoke(boostingContract, "getUserVoteFinalizedREADONLY", [lpAssetId, userAddressStr], nil)
690+ if ($isInstanceOf(@, "Int"))
691+ then @
692+ else throw(($getType(@) + " couldn't be cast to Int"))
693+ }
694+ let res = (resAcc :+ makeString(["%d%d%d", unclaimed, claimed, toString(userVoteFinalized)], SEP))
667695 let inv = {
668696 let @ = invoke(this, "claimWxBulkInternalREADONLY", [(currentIter + 1), lpAssetIds, userAddressStr, res], nil)
669697 if ($isInstanceOf(@, "List[Any]"))
704732 else (height - emissionStartBlock)
705733 let poolWxEmission = fraction((wxEmissionPerBlock * passedBlocks), poolWeight, POOLWEIGHTMULT)
706734 let userWxReward = fraction(poolWxEmission, stakedByUser, stakedTotal)
707- let $t02903729149 = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, 0)
708- let wxToClaimUserNew = $t02903729149._1
709- let integralSTATE = $t02903729149._2
710- let debug = $t02903729149._3
735+ let $t03016030272 = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, 0)
736+ let wxToClaimUserNew = $t03016030272._1
737+ let integralSTATE = $t03016030272._2
738+ let debug = $t03016030272._3
711739 let availableToClaim = max([(wxToClaimUserNew - claimedByUserMinReward), zeroBigInt])
712740 let boostInvResult = asAnyList(invoke(boostingContract, "claimWxBoostREADONLY", [lpAssetIdStr, userAddressStr], nil))
713741 let wxAmountBoostTotal = max([asInt(boostInvResult[0]), 0])
714742 let boostDebug = asString(boostInvResult[1])
715743 let minRewardPart = availableToClaim
716- let boostRewardPart = min([(minRewardPart * toBigInt(2)), toBigInt(wxAmountBoostTotal)])
744+ let boostRewardPart = min([(minRewardPart * toBigInt((boostCoeff - 1))), toBigInt(wxAmountBoostTotal)])
717745 let totalReward = (minRewardPart + boostRewardPart)
718746 $Tuple2(nil, makeString(["%s%s%d%d%d%d%s", lpAssetIdStr, userAddressStr, toString(totalReward), toString(claimedByUser), toString(minRewardPart), toString(boostRewardPart), "soon"], SEP))
719747 }
724752 func stakedByUserREADONLY (lpAssetIdStr,userAddressStr) = {
725753 let stakedByUser = valueOrElse(getInteger(keyStakedByUser(userAddressStr, lpAssetIdStr)), 0)
726754 $Tuple2(nil, stakedByUser)
755+ }
756+
757+
758+
759+@Callable(i)
760+func stakedTotalREADONLY (lpAssetIdStr) = {
761+ let stakedTotal = valueOrElse(getInteger(keyStakedTotal(lpAssetIdStr)), 0)
762+ $Tuple2(nil, stakedTotal)
727763 }
728764
729765
781817
782818 @Callable(i)
783819 func onModifyWeight (lpAssetIdStr,poolAddressStr) = if ((i.caller != factoryContract))
784- then throw("permissions denied")
820+ then throwErr("permissions denied")
785821 else {
786- let $t03175531865 = refreshPoolINTEGRALS(lpAssetIdStr, poolAddressStr, 0)
787- let wxPerLpIntegralNew = $t03175531865._1
788- let poolIntegralSTATE = $t03175531865._2
789- let poolDEBUG = $t03175531865._3
822+ let $t03306233172 = refreshPoolINTEGRALS(lpAssetIdStr, poolAddressStr, 0)
823+ let wxPerLpIntegralNew = $t03306233172._1
824+ let poolIntegralSTATE = $t03306233172._2
825+ let poolDEBUG = $t03306233172._3
790826 poolIntegralSTATE
791827 }
792828
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let SCALE8 = 8
5+
6+let MULT3 = 1000
57
68 let MULT8 = 100000000
79
810 let SCALE18 = 18
911
1012 let MULT18 = toBigInt(1000000000000000000)
1113
1214 let SEP = "__"
1315
1416 let POOLWEIGHTMULT = MULT8
1517
1618 let zeroBigInt = toBigInt(0)
1719
1820 let oneBigInt = toBigInt(1)
1921
2022 func wrapErr (msg) = makeString(["staking.ride:", toString(this), msg], " ")
2123
2224
2325 func throwErr (msg) = throw(wrapErr(msg))
2426
2527
2628 func asAnyList (val) = match val {
2729 case valAnyLyst: List[Any] =>
2830 valAnyLyst
2931 case _ =>
30- throw("fail to cast into List[Any]")
32+ throwErr("fail to cast into List[Any]")
3133 }
3234
3335
3436 func asInt (val) = match val {
3537 case valInt: Int =>
3638 valInt
3739 case _ =>
38- throw("fail to cast into Int")
40+ throwErr("fail to cast into Int")
3941 }
4042
4143
4244 func asString (val) = match val {
4345 case valStr: String =>
4446 valStr
4547 case _ =>
46- throw("fail to cast into Int")
48+ throwErr("fail to cast into Int")
4749 }
4850
4951
5052 func asByteVector (val) = match val {
5153 case valBin: ByteVector =>
5254 valBin
5355 case _ =>
54- throw("fail to cast into Int")
56+ throwErr("fail to cast into Int")
5557 }
5658
5759
58-func getStringOrFail (address,key) = valueOrErrorMessage(getString(address, key), (("mandatory this." + key) + " is not defined"))
60+func getStringOrFail (address,key) = valueOrErrorMessage(getString(address, key), wrapErr((("mandatory this." + key) + " is not defined")))
5961
6062
61-func getStringByAddressOrFail (address,key) = valueOrErrorMessage(getString(address, key), (((("mandatory " + toString(address)) + ".") + key) + " is not defined"))
63+func getStringByAddressOrFail (address,key) = valueOrErrorMessage(getString(address, key), wrapErr((((("mandatory " + toString(address)) + ".") + key) + " is not defined")))
6264
6365
6466 func getIntOrZero (address,key) = valueOrElse(getInteger(address, key), 0)
6567
6668
6769 func getIntOrDefault (address,key,defaultVal) = valueOrElse(getInteger(address, key), defaultVal)
6870
6971
70-func getIntOrFail (address,key) = valueOrErrorMessage(getInteger(address, key), (("mandatory this." + key) + " is not defined"))
72+func getIntOrFail (address,key) = valueOrErrorMessage(getInteger(address, key), wrapErr((("mandatory this." + key) + " is not defined")))
7173
7274
7375 func getBigIntFromStringOrZero (address,key) = value(parseBigInt(valueOrElse(getString(address, key), "0")))
7476
7577
7678 func getBigIntFromStringOrDefault (address,key,defaultVal) = match getString(address, key) {
7779 case s: String =>
7880 value(parseBigInt(s))
7981 case _: Unit =>
8082 defaultVal
8183 case _ =>
8284 throw("Match error")
8385 }
8486
8587
8688 func toX18 (origVal,origScaleMult) = fraction(toBigInt(origVal), MULT18, toBigInt(origScaleMult))
8789
8890
8991 func fromX18 (val,resultScaleMult) = toInt(fraction(val, toBigInt(resultScaleMult), MULT18))
9092
9193
9294 func keyFactoryAddress () = "%s%s__config__factoryAddress"
9395
9496
9597 func keyVotingEmissionContract () = "%s__votingEmissionContract"
9698
9799
98100 let IdxFactoryCfgStakingDapp = 1
99101
100102 let IdxFactoryCfgBoostingDapp = 2
101103
102104 let IdxFactoryCfgIdoDapp = 3
103105
104106 let IdxFactoryCfgTeamDapp = 4
105107
106108 let IdxFactoryCfgEmissionDapp = 5
107109
108110 let IdxFactoryCfgRestDapp = 6
109111
110112 let IdxFactoryCfgSlippageDapp = 7
111113
112114 func keyFactoryCfg () = "%s__factoryConfig"
113115
114116
115117 func keyManagerPublicKey () = "%s__managerPublicKey"
116118
117119
118120 func keyPendingManagerPublicKey () = "%s__pendingManagerPublicKey"
119-
120-
121-func keyStablePoolAddonAddr () = "%s__stablePoolAddonAddr"
122-
123-
124-func keyAddonAddr () = "%s__addonAddr"
125121
126122
127123 func keyFactoryLp2AssetsMapping (lpAssetStr) = makeString(["%s%s%s", lpAssetStr, "mappings__lpAsset2PoolContract"], SEP)
128124
129125
130126 func keyFactoryLpList () = "%s__lpTokensList"
131127
132128
133129 func keyFactoryLpAssetToPoolContractAddress (lpAssetStr) = makeString(["%s%s%s", lpAssetStr, "mappings__lpAsset2PoolContract"], SEP)
134130
135131
136132 func keyFactoryPoolWeight (contractAddress) = makeString(["%s%s", "poolWeight", contractAddress], SEP)
137133
138134
139135 func readLpList (factory) = split(valueOrElse(getString(factory, keyFactoryLpList()), ""), SEP)
140136
141137
142138 func readFactoryCfgOrFail (factory) = split(getStringByAddressOrFail(factory, keyFactoryCfg()), SEP)
143139
144140
145141 func getBoostingAddressOrFail (factoryCfg) = addressFromStringValue(factoryCfg[IdxFactoryCfgBoostingDapp])
146142
147143
148144 func getEmissionAddressOrFail (factoryCfg) = addressFromStringValue(factoryCfg[IdxFactoryCfgEmissionDapp])
149145
150146
151147 func getStakingAddressOrFail (factoryCfg) = addressFromStringValue(factoryCfg[IdxFactoryCfgStakingDapp])
152148
153149
154150 func keyEmissionRatePerBlockCurrent () = "%s%s__ratePerBlock__current"
155151
156152
157153 func keyEmissionRatePerBlockMaxCurrent () = "%s%s__ratePerBlockMax__current"
158154
159155
160156 func keyEmissionStartBlock () = "%s%s__emission__startBlock"
161157
162158
163159 func keyEmissionDurationInBlocks () = "%s%s__emission__duration"
164160
165161
166162 func keyEmissionEndBlock () = "%s%s__emission__endBlock"
167163
168164
169165 func keyStakedByUser (userAddressStr,lpAssetIdStr) = makeString(["%s%s%s__staked", userAddressStr, lpAssetIdStr], SEP)
170166
171167
172168 func keyStakedTotal (lpAssetIdStr) = ("%s%s%s__staked__total__" + lpAssetIdStr)
173169
174170
175171 func keyClaimedByUser (lpAssetIdStr,userAddressStr) = makeString(["%s%s%s__claimed", userAddressStr, lpAssetIdStr], SEP)
176172
177173
178174 func keyClaimedByUserMinReward (lpAssetIdStr,userAddressStr) = makeString(["%s%s%s__claimedMinReward", userAddressStr, lpAssetIdStr], SEP)
179175
180176
181177 func keyClaimedByUserBoostReward (lpAssetIdStr,userAddressStr) = makeString(["%s%s%s__claimedBoostReward", userAddressStr, lpAssetIdStr], SEP)
182178
183179
184180 func keyClaimedTotal (lpAssetIdStr) = makeString(["%s%s%s__claimed__total", lpAssetIdStr], SEP)
185181
186182
187183 func readStaked (key) = valueOrElse(getInteger(this, key), 0)
188184
189185
190186 func keyLastTotalLpBalance (lpAssetId) = makeString(["%s%s%s", lpAssetId, "total", "bal"], SEP)
191187
192188
193189 func keyLastUserLpBalance (lpAssetId,userAddress) = makeString(["%s%s%s", lpAssetId, userAddress, "bal"], SEP)
194190
195191
196192 func keyTotalLpBalanceIntegral (lpAssetId) = makeString(["%s%s%s", lpAssetId, "total", "balINT"], SEP)
197193
198194
199195 func keyUserLpBalanceIntegral (lpAssetId,userAddress) = makeString(["%s%s%s", lpAssetId, userAddress, "balINT"], SEP)
200196
201197
202198 func keyTotalLpBalanceIntegralLastUpdHeight (lpAssetId) = makeString(["%s%s%s", lpAssetId, "total", "lastUpd"], SEP)
203199
204200
205201 func keyUserLpBalanceIntegralLastUpdHeight (lpAssetId,userAddress) = makeString(["%s%s%s", lpAssetId, userAddress, "lastUpd"], SEP)
206202
207203
208204 func keyWxPerLpIntegral (lpAssetId) = makeString(["%s%s%s%s", lpAssetId, "common", "lpInt"], SEP)
209205
210206
211207 func keyWxPerLpIntegralLastUpdHeight (lpAssetId) = makeString(["%s%s%s%s", lpAssetId, "common", "lpIntH"], SEP)
212208
213209
214210 func keyWxToClaimUser (lpAssetId,userAddress) = makeString(["%s%s%s%s", lpAssetId, userAddress, "lpInt"], SEP)
215211
216212
217213 func keyWxPerLpIntegralUserLastUpdHeight (lpAssetId,userAddress) = makeString(["%s%s%s%s", lpAssetId, userAddress, "lpIntH"], SEP)
218214
219215
220216 func keyWxPerLp (lpAssetId) = makeString(["%s", lpAssetId, "wxPerLp"], SEP)
221217
222218
223219 func keyWxPerLpX18 (lpAssetId) = makeString(["%s", lpAssetId, "wxPerLpX18"], SEP)
224220
225221
226222 func keyWxPerLpIntegralUserLast (lpAssetId,userAddress) = makeString(["%s%s%s%s", lpAssetId, userAddress, "uIntL"], SEP)
227223
228224
229225 func keyOperationHistoryRecord (type,userAddress,txId58) = makeString(["%s%s%s%s__history", type, userAddress, txId58], SEP)
230226
231227
232228 func formatHistoryRecord (userAddress,lpAssetId,type,amount) = makeString(["%s%s%s%d%d%d", userAddress, lpAssetId, type, toString(height), toString(lastBlock.timestamp), toString(amount)], SEP)
233229
234230
235231 func OperationHistoryEntry (type,userAddress,lpAssetId,amount,txId) = StringEntry(keyOperationHistoryRecord(type, userAddress, toBase58String(txId)), formatHistoryRecord(userAddress, lpAssetId, type, amount))
236232
237233
238234 let factoryAddress = getStringOrFail(this, keyFactoryAddress())
239235
240236 let factoryContract = addressFromStringValue(factoryAddress)
241237
242238 let factoryCfg = readFactoryCfgOrFail(factoryContract)
243239
244240 let emissionContract = getEmissionAddressOrFail(factoryCfg)
245241
246242 let boostingContract = getBoostingAddressOrFail(factoryCfg)
247243
244+let boostCoeff = {
245+ let @ = invoke(emissionContract, "getBoostCoeffREADONLY", nil, nil)
246+ if ($isInstanceOf(@, "Int"))
247+ then @
248+ else throw(($getType(@) + " couldn't be cast to Int"))
249+ }
250+
248251 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"))
249252
250253 func keyNextUser (lpAssetId) = makeString(["%s%s", lpAssetId, "nextUser"], SEP)
251254
252255
253256 func getUsersListName (lpAssetId) = makeString(["users", lpAssetId], SEP)
254257
255258
256259 func keyListHead (listName) = makeString(["%s%s%s", listName, "head"], SEP)
257260
258261
259262 func keyListSize (listName) = makeString(["%s%s%s", listName, "size"], SEP)
260263
261264
262265 func keyListPrev (listName,id) = makeString(["%s%s%s%s", listName, id, "prev"], SEP)
263266
264267
265268 func keyListNext (listName,id) = makeString(["%s%s%s%s", listName, id, "next"], SEP)
266269
267270
268271 func containsNode (listName,id) = {
269272 let headOrUnit = getString(this, keyListHead(listName))
270273 let prevOrUnit = getString(this, keyListPrev(listName, id))
271274 let nextOrUnit = getString(this, keyListNext(listName, id))
272275 if (if ((id == valueOrElse(headOrUnit, "")))
273276 then true
274277 else (prevOrUnit != unit))
275278 then true
276279 else (nextOrUnit != unit)
277280 }
278281
279282
280283 func insertNodeActions (listName,id) = {
281284 let headOrUnit = getString(this, keyListHead(listName))
282285 let listSize = valueOrElse(getInteger(this, keyListSize(listName)), 0)
283286 let checkNode = if (!(containsNode(listName, id)))
284287 then true
285- else throw("Node exists")
288+ else throwErr("Node exists")
286289 if ((checkNode == checkNode))
287290 then (([IntegerEntry(keyListSize(listName), (listSize + 1))] ++ (if ((headOrUnit != unit))
288291 then [StringEntry(keyListNext(listName, id), value(headOrUnit)), StringEntry(keyListPrev(listName, value(headOrUnit)), id)]
289292 else nil)) ++ [StringEntry(keyListHead(listName), id)])
290293 else throw("Strict value is not equal to itself.")
291294 }
292295
293296
294297 func deleteNodeActions (listName,id) = {
295298 let headOrUnit = getString(this, keyListHead(listName))
296299 let listSize = valueOrElse(getInteger(this, keyListSize(listName)), 0)
297300 let prevOrUnit = getString(this, keyListPrev(listName, id))
298301 let nextOrUnit = getString(this, keyListNext(listName, id))
299302 ([IntegerEntry(keyListSize(listName), (listSize - 1))] ++ (if (if ((prevOrUnit != unit))
300303 then (nextOrUnit != unit)
301304 else false)
302305 then [StringEntry(keyListNext(listName, value(prevOrUnit)), value(nextOrUnit)), StringEntry(keyListPrev(listName, value(nextOrUnit)), value(prevOrUnit)), DeleteEntry(keyListPrev(listName, id)), DeleteEntry(keyListNext(listName, id))]
303306 else if ((nextOrUnit != unit))
304307 then [StringEntry(keyListHead(listName), value(nextOrUnit)), DeleteEntry(keyListNext(listName, id)), DeleteEntry(keyListPrev(listName, value(nextOrUnit)))]
305308 else if ((prevOrUnit != unit))
306309 then [DeleteEntry(keyListPrev(listName, id)), DeleteEntry(keyListNext(listName, value(prevOrUnit)))]
307310 else if ((id == valueOrElse(headOrUnit, "")))
308311 then [DeleteEntry(keyListHead(listName))]
309- else throw(((("invalid node: " + listName) + ".") + id))))
312+ else throwErr(((("invalid node: " + listName) + ".") + id))))
310313 }
311314
312315
313316 func calcWxPerLpIntegralUserLast (stakedByUser,wxPerLpIntegralUserLastUpdHeightOrZero,wxPerLpIntegralNew,wxPerLpIntegralUserLastKEY) = if (if ((wxPerLpIntegralUserLastUpdHeightOrZero == zeroBigInt))
314317 then (stakedByUser > zeroBigInt)
315318 else false)
316319 then zeroBigInt
317320 else if ((stakedByUser == zeroBigInt))
318321 then wxPerLpIntegralNew
319322 else if (if ((wxPerLpIntegralUserLastUpdHeightOrZero > zeroBigInt))
320323 then (stakedByUser > zeroBigInt)
321324 else false)
322325 then value(parseBigInt(getStringOrFail(this, wxPerLpIntegralUserLastKEY)))
323- else throw("calcWxPerLpIntegralUserLast: unexpected state")
326+ else throwErr("calcWxPerLpIntegralUserLast: unexpected state")
324327
325328
326329 func refreshPoolINTEGRALS (lpAssetIdStr,poolAddressStr,lpDeltaAmount) = {
327330 let stakedTotalKEY = keyStakedTotal(lpAssetIdStr)
328331 let stakedTotal = toBigInt(readStaked(stakedTotalKEY))
329332 let nonZeroStakedTotal = if ((stakedTotal == zeroBigInt))
330333 then oneBigInt
331334 else stakedTotal
332335 let poolWeight = getIntegerValue(factoryContract, keyFactoryPoolWeight(poolAddressStr))
333336 let emissionStartBlock = getIntOrFail(emissionContract, keyEmissionStartBlock())
334- let MULT3 = 1000
335337 let wxEmissionPerBlockX3 = (getIntOrFail(emissionContract, keyEmissionRatePerBlockCurrent()) * MULT3)
336- let poolWxEmissionPerBlockX3 = fraction(wxEmissionPerBlockX3, poolWeight, (POOLWEIGHTMULT * 3))
338+ let poolWxEmissionPerBlockX3 = fraction(wxEmissionPerBlockX3, poolWeight, (POOLWEIGHTMULT * boostCoeff))
337339 let wxPerLpIntegralKEY = keyWxPerLpIntegral(lpAssetIdStr)
338340 let wxPerLpIntegralLastUpdHeightKEY = keyWxPerLpIntegralLastUpdHeight(lpAssetIdStr)
339341 let wxPerLpKEY = keyWxPerLp(lpAssetIdStr)
340342 let wxPerLpIntegralLastUpdHeight = getIntOrDefault(this, wxPerLpIntegralLastUpdHeightKEY, emissionStartBlock)
341343 let wxPerLpIntegral = getBigIntFromStringOrZero(this, wxPerLpIntegralKEY)
342344 let wxPerLpOrZeroX3 = 0
343345 let dh = max([(height - wxPerLpIntegralLastUpdHeight), 0])
344346 let wxPerLpX3 = if ((wxPerLpOrZeroX3 != 0))
345347 then toBigInt(wxPerLpOrZeroX3)
346348 else fraction(toBigInt(poolWxEmissionPerBlockX3), toBigInt(MULT8), nonZeroStakedTotal)
347349 let stakedTotalNew = (stakedTotal + toBigInt(lpDeltaAmount))
348350 let nonZeroStakedTotalNew = if ((stakedTotalNew == zeroBigInt))
349351 then oneBigInt
350352 else stakedTotalNew
351353 let wxPerLpIntegralNew = (wxPerLpIntegral + (wxPerLpX3 * toBigInt(dh)))
352354 let wxPerLpX3New = (toBigInt(poolWxEmissionPerBlockX3) / nonZeroStakedTotalNew)
353355 let wxPerLpIntegralLastUpdHeightNew = height
354356 let debug = makeString([toString(wxPerLpIntegralNew), toString(dh), toString(wxPerLpX3), toString(stakedTotal), toString(poolWxEmissionPerBlockX3), toString(wxEmissionPerBlockX3), toString(poolWeight)], "::")
355357 $Tuple3(wxPerLpIntegralNew, [StringEntry(wxPerLpIntegralKEY, toString(wxPerLpIntegralNew)), IntegerEntry(wxPerLpIntegralLastUpdHeightKEY, wxPerLpIntegralLastUpdHeightNew), StringEntry(wxPerLpKEY, toString(wxPerLpX3New))], debug)
356358 }
357359
358360
359361 func refreshINTEGRALS (lpAssetIdStr,userAddressStr,poolAddressStr,lpDeltaAmount) = {
360- let $t01475014872 = refreshPoolINTEGRALS(lpAssetIdStr, poolAddressStr, lpDeltaAmount)
361- let wxPerLpIntegralNew = $t01475014872._1
362- let poolIntegralSTATE = $t01475014872._2
363- let poolDEBUG = $t01475014872._3
364- let MULT3 = 1000
362+ let $t01472314845 = refreshPoolINTEGRALS(lpAssetIdStr, poolAddressStr, lpDeltaAmount)
363+ let wxPerLpIntegralNew = $t01472314845._1
364+ let poolIntegralSTATE = $t01472314845._2
365+ let poolDEBUG = $t01472314845._3
365366 let stakedByUserKEY = keyStakedByUser(userAddressStr, lpAssetIdStr)
366367 let stakedByUser = readStaked(stakedByUserKEY)
367368 let wxToClaimUserKEY = keyWxToClaimUser(lpAssetIdStr, userAddressStr)
368369 let wxPerLpIntegralUserLastUpdHeightKEY = keyWxPerLpIntegralUserLastUpdHeight(lpAssetIdStr, userAddressStr)
369370 let wxPerLpIntegralUserLastKEY = keyWxPerLpIntegralUserLast(lpAssetIdStr, userAddressStr)
370371 let wxToClaimUser = getBigIntFromStringOrZero(this, wxToClaimUserKEY)
371372 let wxPerLpIntegralUserLastUpdHeightOrZero = getIntOrZero(this, wxPerLpIntegralUserLastUpdHeightKEY)
372373 let wxPerLpIntegralUserLast = calcWxPerLpIntegralUserLast(toBigInt(stakedByUser), toBigInt(wxPerLpIntegralUserLastUpdHeightOrZero), wxPerLpIntegralNew, wxPerLpIntegralUserLastKEY)
373374 let MULT11 = (MULT8 * MULT3)
374375 let wxToClaimUserNew = max([(wxToClaimUser + fraction((wxPerLpIntegralNew - wxPerLpIntegralUserLast), toBigInt(stakedByUser), toBigInt(MULT11))), zeroBigInt])
375376 let wxPerLpIntegralUserLastNew = wxPerLpIntegralNew
376377 let wxPerLpIntegralUserLastUpdHeightNew = height
377378 let debug = makeString([toString(wxToClaimUser), toString(wxPerLpIntegralUserLast), toString(stakedByUser), poolDEBUG, toString(height)], "::")
378379 $Tuple3(wxToClaimUserNew, (poolIntegralSTATE ++ [StringEntry(wxToClaimUserKEY, toString(wxToClaimUserNew)), IntegerEntry(wxPerLpIntegralUserLastUpdHeightKEY, wxPerLpIntegralUserLastUpdHeightNew), StringEntry(wxPerLpIntegralUserLastKEY, toString(wxPerLpIntegralUserLastNew))]), debug)
379380 }
380381
381382
382383 func managerPublicKeyOrUnit () = match getString(keyManagerPublicKey()) {
383384 case s: String =>
384385 fromBase58String(s)
385386 case _: Unit =>
386387 unit
387388 case _ =>
388389 throw("Match error")
389390 }
390391
391392
392393 func pendingManagerPublicKeyOrUnit () = match getString(keyPendingManagerPublicKey()) {
393394 case s: String =>
394395 fromBase58String(s)
395396 case _: Unit =>
396397 unit
397398 case _ =>
398399 throw("Match error")
399400 }
400401
401402
402-let permissionDeniedError = throw("Permission denied")
403+let permissionDeniedError = throwErr("Permission denied")
403404
404405 func mustThis (i) = if ((i.caller == this))
405406 then true
406407 else permissionDeniedError
407408
408409
409410 func mustManager (i) = match managerPublicKeyOrUnit() {
410411 case pk: ByteVector =>
411412 if ((i.callerPublicKey == pk))
412413 then true
413414 else permissionDeniedError
414415 case _: Unit =>
415416 if ((i.caller == this))
416417 then true
417418 else permissionDeniedError
418419 case _ =>
419420 throw("Match error")
420421 }
422+
423+
424+func stakeActions (i,lpAssetId,poolAddress,userAddress,amount) = {
425+ let userAddressStr = toString(userAddress)
426+ let lpAssetIdStr = toBase58String(lpAssetId)
427+ let poolAddressStr = toString(poolAddress)
428+ let stakedByUserKEY = keyStakedByUser(userAddressStr, lpAssetIdStr)
429+ let stakedTotalKEY = keyStakedTotal(lpAssetIdStr)
430+ let stakedByUser = readStaked(stakedByUserKEY)
431+ let refreshStakedVote = if ((stakedByUser == 0))
432+ then invoke(boostingContract, "onStakedVoteUpdate", [lpAssetIdStr, userAddressStr, true], nil)
433+ else unit
434+ if ((refreshStakedVote == refreshStakedVote))
435+ then {
436+ let stakedTotal = readStaked(stakedTotalKEY)
437+ let $t01806418181 = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, amount)
438+ let wxToClaimUserNew = $t01806418181._1
439+ let integralSTATE = $t01806418181._2
440+ let debug = $t01806418181._3
441+ let listName = getUsersListName(lpAssetIdStr)
442+ let listActions = if (containsNode(listName, userAddressStr))
443+ then nil
444+ else insertNodeActions(listName, userAddressStr)
445+ (([IntegerEntry(stakedByUserKEY, (stakedByUser + amount)), IntegerEntry(stakedTotalKEY, (stakedTotal + amount)), OperationHistoryEntry("stake", userAddressStr, lpAssetIdStr, amount, i.transactionId)] ++ integralSTATE) ++ listActions)
446+ }
447+ else throw("Strict value is not equal to itself.")
448+ }
421449
422450
423451 func unstakeActions (i,lpAssetId,poolAddress,userAddress,lpAssetRecipientAddress,amount) = {
424452 let userAddressStr = toString(userAddress)
425453 let lpAssetIdStr = toBase58String(lpAssetId)
426454 let poolAddressStr = toString(poolAddress)
427455 let stakedByUserKEY = keyStakedByUser(userAddressStr, lpAssetIdStr)
428456 let stakedTotalKEY = keyStakedTotal(lpAssetIdStr)
429457 let stakedByUser = readStaked(stakedByUserKEY)
430458 let stakedTotal = readStaked(stakedTotalKEY)
431459 let integralSTATE = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, -(amount))._2
432460 let listName = getUsersListName(lpAssetIdStr)
433461 let listActions = if (if (containsNode(listName, userAddressStr))
434462 then (amount == stakedByUser)
435463 else false)
436464 then deleteNodeActions(listName, userAddressStr)
437465 else nil
438466 let refreshStakedVote = if ((amount == stakedByUser))
439467 then invoke(boostingContract, "onStakedVoteUpdate", [lpAssetIdStr, userAddressStr, false], nil)
440468 else unit
441469 if ((refreshStakedVote == refreshStakedVote))
442470 then {
443471 let claimedByUserMinReward = getBigIntFromStringOrZero(this, keyClaimedByUserMinReward(lpAssetIdStr, userAddressStr))
444472 let wxToClaimUserNew = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, 0)._1
445473 let availableToClaim = (wxToClaimUserNew - claimedByUserMinReward)
446474 let throwIfNothingToClaim = true
447475 let r = if ((availableToClaim > zeroBigInt))
448476 then invoke(this, "claimWxINTERNAL", [lpAssetIdStr, userAddressStr, throwIfNothingToClaim], nil)
449477 else unit
450478 if ((r == r))
451479 then if ((amount > stakedByUser))
452- then throw(((((((("passed amount=" + toString(amount)) + " is greater than available=") + toString(stakedByUser)) + ". lpAssetId=") + lpAssetIdStr) + ". stakedByUserKEY=") + stakedByUserKEY))
480+ then throwErr(((((((("passed amount=" + toString(amount)) + " is greater than available=") + toString(stakedByUser)) + ". lpAssetId=") + lpAssetIdStr) + ". stakedByUserKEY=") + stakedByUserKEY))
453481 else (([IntegerEntry(stakedByUserKEY, (stakedByUser - amount)), IntegerEntry(stakedTotalKEY, (stakedTotal - amount)), ScriptTransfer(lpAssetRecipientAddress, amount, lpAssetId), OperationHistoryEntry("unstake", userAddressStr, lpAssetIdStr, amount, i.transactionId)] ++ integralSTATE) ++ listActions)
454482 else throw("Strict value is not equal to itself.")
455483 }
456484 else throw("Strict value is not equal to itself.")
457485 }
458486
459487
460488 @Callable(i)
461489 func constructor (factoryAddressStr) = {
462490 let checkCaller = mustManager(i)
463491 if ((checkCaller == checkCaller))
464492 then [StringEntry(keyFactoryAddress(), factoryAddressStr)]
465493 else throw("Strict value is not equal to itself.")
466494 }
467495
468496
469497
470498 @Callable(i)
471499 func constructorV2 (votingEmissionContract) = {
472500 let cheks = [mustManager(i), if ((addressFromString(votingEmissionContract) != unit))
473501 then true
474502 else "invalid voting emission contract address"]
475503 if ((cheks == cheks))
476504 then [StringEntry(keyVotingEmissionContract(), votingEmissionContract)]
477505 else throw("Strict value is not equal to itself.")
478506 }
479507
480508
481509
482510 @Callable(i)
483511 func setManager (pendingManagerPublicKey) = {
484512 let checkCaller = mustManager(i)
485513 if ((checkCaller == checkCaller))
486514 then {
487515 let checkManagerPublicKey = fromBase58String(pendingManagerPublicKey)
488516 if ((checkManagerPublicKey == checkManagerPublicKey))
489517 then [StringEntry(keyPendingManagerPublicKey(), pendingManagerPublicKey)]
490518 else throw("Strict value is not equal to itself.")
491519 }
492520 else throw("Strict value is not equal to itself.")
493521 }
494522
495523
496524
497525 @Callable(i)
498526 func confirmManager () = {
499527 let pm = pendingManagerPublicKeyOrUnit()
500528 let hasPM = if (isDefined(pm))
501529 then true
502- else throw("No pending manager")
530+ else throwErr("No pending manager")
503531 if ((hasPM == hasPM))
504532 then {
505533 let checkPM = if ((i.callerPublicKey == value(pm)))
506534 then true
507- else throw("You are not pending manager")
535+ else throwErr("You are not pending manager")
508536 if ((checkPM == checkPM))
509537 then [StringEntry(keyManagerPublicKey(), toBase58String(value(pm))), DeleteEntry(keyPendingManagerPublicKey())]
510538 else throw("Strict value is not equal to itself.")
511539 }
512540 else throw("Strict value is not equal to itself.")
513541 }
514542
515543
516544
517545 @Callable(i)
518546 func stake () = if ((size(i.payments) != 1))
519- then throw("invalid payment - exact one payment must be attached")
547+ then throwErr("invalid payment - exact one payment must be attached")
520548 else {
521549 let pmt = i.payments[0]
522550 let lpAssetId = value(pmt.assetId)
523551 let lpAssetIdStr = toBase58String(lpAssetId)
524552 let amount = pmt.amount
525- let poolAddressStr = valueOrErrorMessage(getString(factoryContract, keyFactoryLp2AssetsMapping(lpAssetIdStr)), ("unsupported lp asset " + lpAssetIdStr))
526- let callerStr = toString(i.caller)
527- let userAddressStr = if ((callerStr == poolAddressStr))
528- then toString(i.originCaller)
529- else callerStr
530- let stakedByUserKEY = keyStakedByUser(userAddressStr, lpAssetIdStr)
531- let stakedTotalKEY = keyStakedTotal(lpAssetIdStr)
532- let stakedByUser = readStaked(stakedByUserKEY)
533- let refreshStakedVote = if ((stakedByUser == 0))
534- then invoke(boostingContract, "onStakedVoteUpdate", [lpAssetIdStr, userAddressStr, true], nil)
535- else unit
536- if ((refreshStakedVote == refreshStakedVote))
537- then {
538- let stakedTotal = readStaked(stakedTotalKEY)
539- let $t02161321730 = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, amount)
540- let wxToClaimUserNew = $t02161321730._1
541- let integralSTATE = $t02161321730._2
542- let debug = $t02161321730._3
543- let listName = getUsersListName(lpAssetIdStr)
544- let listActions = if (containsNode(listName, userAddressStr))
545- then nil
546- else insertNodeActions(listName, userAddressStr)
547- (([IntegerEntry(stakedByUserKEY, (stakedByUser + amount)), IntegerEntry(stakedTotalKEY, (stakedTotal + amount)), OperationHistoryEntry("stake", userAddressStr, lpAssetIdStr, amount, i.transactionId)] ++ integralSTATE) ++ listActions)
548- }
549- else throw("Strict value is not equal to itself.")
553+ let poolAddressStr = valueOrErrorMessage(getString(factoryContract, keyFactoryLp2AssetsMapping(lpAssetIdStr)), wrapErr(("unsupported lp asset " + lpAssetIdStr)))
554+ let poolAddress = addressFromStringValue(poolAddressStr)
555+ let userAddress = if ((i.caller == poolAddress))
556+ then i.originCaller
557+ else i.caller
558+ stakeActions(i, lpAssetId, poolAddress, userAddress, amount)
559+ }
560+
561+
562+
563+@Callable(i)
564+func stakeFor (userAddressStr) = if ((size(i.payments) != 1))
565+ then throwErr("invalid payment - exact one payment must be attached")
566+ else {
567+ let pmt = i.payments[0]
568+ let lpAssetId = value(pmt.assetId)
569+ let lpAssetIdStr = toBase58String(lpAssetId)
570+ let amount = pmt.amount
571+ let poolAddressStr = valueOrErrorMessage(getString(factoryContract, keyFactoryLp2AssetsMapping(lpAssetIdStr)), wrapErr(("unsupported lp asset " + lpAssetIdStr)))
572+ let poolAddress = addressFromStringValue(poolAddressStr)
573+ let userAddress = valueOrErrorMessage(addressFromString(userAddressStr), wrapErr("invalid user address"))
574+ stakeActions(i, lpAssetId, poolAddress, userAddress, amount)
550575 }
551576
552577
553578
554579 @Callable(i)
555580 func unstake (lpAssetIdStr,amount) = {
556581 let lpAssetId = fromBase58String(lpAssetIdStr)
557- let poolAddressStr = valueOrErrorMessage(getString(factoryContract, keyFactoryLp2AssetsMapping(lpAssetIdStr)), ("unsupported lp asset " + lpAssetIdStr))
582+ let poolAddressStr = valueOrErrorMessage(getString(factoryContract, keyFactoryLp2AssetsMapping(lpAssetIdStr)), wrapErr(("unsupported lp asset " + lpAssetIdStr)))
558583 let poolAddress = addressFromStringValue(poolAddressStr)
559- let poolAddon = valueOrElse(getString(poolAddress, keyAddonAddr()), poolAddressStr)
560584 let callerStr = toString(i.caller)
561- let userAddress = if (if ((callerStr == poolAddressStr))
562- then true
563- else (callerStr == poolAddon))
585+ let userAddress = if ((callerStr == poolAddressStr))
564586 then i.originCaller
565587 else i.caller
566588 let lpAssetRecipientAddress = i.caller
567589 unstakeActions(i, lpAssetId, poolAddress, userAddress, lpAssetRecipientAddress, amount)
568590 }
569591
570592
571593
572594 @Callable(i)
573595 func unstakeINTERNAL (lpAssetId,amount,userAddress,lpAssetRecipientAddress) = {
574596 let lpAssetIdStr = toBase58String(lpAssetId)
575- let poolAddress = addressFromStringValue(valueOrErrorMessage(getString(factoryContract, keyFactoryLp2AssetsMapping(lpAssetIdStr)), ("unsupported lp asset " + lpAssetIdStr)))
597+ let poolAddress = addressFromStringValue(valueOrErrorMessage(getString(factoryContract, keyFactoryLp2AssetsMapping(lpAssetIdStr)), wrapErr(("unsupported lp asset " + lpAssetIdStr))))
576598 let checkCaller = if ((i.caller == poolAddress))
577599 then true
578600 else permissionDeniedError
579601 if ((checkCaller == checkCaller))
580602 then unstakeActions(i, lpAssetId, poolAddress, Address(userAddress), Address(lpAssetRecipientAddress), amount)
581603 else throw("Strict value is not equal to itself.")
582604 }
583605
584606
585607
586608 @Callable(i)
587609 func claimWx (lpAssetIdStr) = {
588610 let userAddressStr = toString(i.caller)
589611 let throwIfNothingToClaim = true
590612 let result = invoke(this, "claimWxINTERNAL", [lpAssetIdStr, userAddressStr, throwIfNothingToClaim], nil)
591613 $Tuple2(nil, result)
592614 }
593615
594616
595617
596618 @Callable(i)
597619 func claimWxDoNotThrow (lpAssetIdStr) = {
598620 let userAddressStr = toString(i.caller)
599621 let throwIfNothingToClaim = false
600622 let result = invoke(this, "claimWxINTERNAL", [lpAssetIdStr, userAddressStr, throwIfNothingToClaim], nil)
601623 $Tuple2(nil, result)
602624 }
603625
604626
605627
606628 @Callable(i)
607629 func claimWxINTERNAL (lpAssetIdStr,userAddressStr,throwIfNothingToClaim) = {
608630 let checkCaller = mustThis(i)
609631 if ((checkCaller == checkCaller))
610632 then {
611- let userAddress = valueOrErrorMessage(addressFromString(userAddressStr), "claimWxINTERNAL: invalid user address")
633+ let userAddress = valueOrErrorMessage(addressFromString(userAddressStr), wrapErr("claimWxINTERNAL: invalid user address"))
612634 let poolAddressStr = getStringByAddressOrFail(factoryContract, keyFactoryLpAssetToPoolContractAddress(lpAssetIdStr))
613635 let claimedByUserKEY = keyClaimedByUser(lpAssetIdStr, userAddressStr)
614636 let claimedTotalKEY = keyClaimedTotal(lpAssetIdStr)
615637 let claimedByUserMinRewardKEY = keyClaimedByUserMinReward(lpAssetIdStr, userAddressStr)
616638 let claimedByUserBoostRewardKEY = keyClaimedByUserBoostReward(lpAssetIdStr, userAddressStr)
617639 let claimedByUser = getBigIntFromStringOrZero(this, claimedByUserKEY)
618640 let claimedByUserMinReward = getBigIntFromStringOrZero(this, claimedByUserMinRewardKEY)
619641 let claimedByUserBoostReward = getBigIntFromStringOrZero(this, claimedByUserBoostRewardKEY)
620642 let claimedTotal = getBigIntFromStringOrZero(this, claimedTotalKEY)
621- let $t02511625228 = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, 0)
622- let wxToClaimUserNew = $t02511625228._1
623- let integralSTATE = $t02511625228._2
624- let debug = $t02511625228._3
643+ let $t02599726109 = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, 0)
644+ let wxToClaimUserNew = $t02599726109._1
645+ let integralSTATE = $t02599726109._2
646+ let debug = $t02599726109._3
625647 let availableToClaim = max([(wxToClaimUserNew - claimedByUserMinReward), zeroBigInt])
626648 if ((zeroBigInt >= availableToClaim))
627649 then if (throwIfNothingToClaim)
628- then throw("nothing to claim")
650+ then throwErr("nothing to claim")
629651 else $Tuple2(nil, 0)
630652 else {
631653 let wxAmountBoostTotal = max([asInt(asAnyList(invoke(boostingContract, "claimWxBoost", [lpAssetIdStr, userAddressStr], nil))[0]), 0])
632654 let minRewardPart = availableToClaim
633- let boostRewardPart = min([(minRewardPart * toBigInt(2)), toBigInt(wxAmountBoostTotal)])
655+ let boostRewardPart = min([(minRewardPart * toBigInt((boostCoeff - 1))), toBigInt(wxAmountBoostTotal)])
634656 let totalReward = (minRewardPart + boostRewardPart)
635657 let wxAssetId = asByteVector(asAnyList(invoke(emissionContract, "emit", [toInt(minRewardPart)], nil))[0])
636658 let emitBoost = asAnyList(invoke(emissionContract, "emit", [toInt(boostRewardPart)], nil))
637659 if ((emitBoost == emitBoost))
638660 then {
639661 let claimedByUserValue = ((claimedByUser + minRewardPart) + boostRewardPart)
640662 let claimedByUserMinRewardPlusPart = (claimedByUserMinReward + minRewardPart)
641663 let claimedByUserBoostRewardPlusBoostRewardPart = (claimedByUserBoostReward + boostRewardPart)
642664 let claimedTotalPlusAvailableToClaim = (claimedTotal + availableToClaim)
643665 $Tuple2([StringEntry(claimedByUserKEY, toString(claimedByUserValue)), StringEntry(claimedByUserMinRewardKEY, toString(claimedByUserMinRewardPlusPart)), StringEntry(claimedByUserBoostRewardKEY, toString(claimedByUserBoostRewardPlusBoostRewardPart)), StringEntry(claimedTotalKEY, toString(claimedTotalPlusAvailableToClaim)), ScriptTransfer(userAddress, toInt(minRewardPart), wxAssetId), ScriptTransfer(userAddress, toInt(boostRewardPart), wxAssetId), OperationHistoryEntry("claim", userAddressStr, lpAssetIdStr, toInt(availableToClaim), i.transactionId)], toInt(totalReward))
644666 }
645667 else throw("Strict value is not equal to itself.")
646668 }
647669 }
648670 else throw("Strict value is not equal to itself.")
649671 }
650672
651673
652674
653675 @Callable(i)
654676 func claimWxBulkInternalREADONLY (currentIter,lpAssetIds,userAddressStr,resAcc) = if ((currentIter == size(lpAssetIds)))
655677 then $Tuple2(nil, resAcc)
656678 else {
657679 let lpAssetId = lpAssetIds[currentIter]
658680 let info = split({
659681 let @ = invoke(this, "claimWxREADONLY", [lpAssetId, userAddressStr], nil)
660682 if ($isInstanceOf(@, "String"))
661683 then @
662684 else throw(($getType(@) + " couldn't be cast to String"))
663685 }, SEP)
664686 let unclaimed = info[3]
665687 let claimed = info[4]
666- let res = (resAcc :+ makeString(["%d%d", unclaimed, claimed], SEP))
688+ let userVoteFinalized = {
689+ let @ = invoke(boostingContract, "getUserVoteFinalizedREADONLY", [lpAssetId, userAddressStr], nil)
690+ if ($isInstanceOf(@, "Int"))
691+ then @
692+ else throw(($getType(@) + " couldn't be cast to Int"))
693+ }
694+ let res = (resAcc :+ makeString(["%d%d%d", unclaimed, claimed, toString(userVoteFinalized)], SEP))
667695 let inv = {
668696 let @ = invoke(this, "claimWxBulkInternalREADONLY", [(currentIter + 1), lpAssetIds, userAddressStr, res], nil)
669697 if ($isInstanceOf(@, "List[Any]"))
670698 then @
671699 else throw(($getType(@) + " couldn't be cast to List[Any]"))
672700 }
673701 if ((inv == inv))
674702 then $Tuple2(nil, inv)
675703 else throw("Strict value is not equal to itself.")
676704 }
677705
678706
679707
680708 @Callable(i)
681709 func claimWxBulkREADONLY (lpAssetIds,userAddressStr) = {
682710 let res = invoke(this, "claimWxBulkInternalREADONLY", [0, lpAssetIds, userAddressStr, nil], nil)
683711 $Tuple2(nil, res)
684712 }
685713
686714
687715
688716 @Callable(i)
689717 func claimWxREADONLY (lpAssetIdStr,userAddressStr) = {
690718 let stakedByUserKEY = keyStakedByUser(userAddressStr, lpAssetIdStr)
691719 let stakedTotalKEY = keyStakedTotal(lpAssetIdStr)
692720 let claimedByUserKEY = keyClaimedByUser(lpAssetIdStr, userAddressStr)
693721 let claimedByUserMinRewardKEY = keyClaimedByUserMinReward(lpAssetIdStr, userAddressStr)
694722 let stakedByUser = readStaked(stakedByUserKEY)
695723 let stakedTotal = readStaked(stakedTotalKEY)
696724 let claimedByUser = getBigIntFromStringOrZero(this, claimedByUserKEY)
697725 let claimedByUserMinReward = getBigIntFromStringOrZero(this, claimedByUserMinRewardKEY)
698726 let poolAddressStr = getStringByAddressOrFail(factoryContract, keyFactoryLpAssetToPoolContractAddress(lpAssetIdStr))
699727 let poolWeight = getIntegerValue(factoryContract, keyFactoryPoolWeight(poolAddressStr))
700728 let wxEmissionPerBlock = getIntOrFail(emissionContract, keyEmissionRatePerBlockCurrent())
701729 let emissionStartBlock = getIntOrFail(emissionContract, keyEmissionStartBlock())
702730 let passedBlocks = if ((emissionStartBlock > height))
703731 then 0
704732 else (height - emissionStartBlock)
705733 let poolWxEmission = fraction((wxEmissionPerBlock * passedBlocks), poolWeight, POOLWEIGHTMULT)
706734 let userWxReward = fraction(poolWxEmission, stakedByUser, stakedTotal)
707- let $t02903729149 = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, 0)
708- let wxToClaimUserNew = $t02903729149._1
709- let integralSTATE = $t02903729149._2
710- let debug = $t02903729149._3
735+ let $t03016030272 = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, 0)
736+ let wxToClaimUserNew = $t03016030272._1
737+ let integralSTATE = $t03016030272._2
738+ let debug = $t03016030272._3
711739 let availableToClaim = max([(wxToClaimUserNew - claimedByUserMinReward), zeroBigInt])
712740 let boostInvResult = asAnyList(invoke(boostingContract, "claimWxBoostREADONLY", [lpAssetIdStr, userAddressStr], nil))
713741 let wxAmountBoostTotal = max([asInt(boostInvResult[0]), 0])
714742 let boostDebug = asString(boostInvResult[1])
715743 let minRewardPart = availableToClaim
716- let boostRewardPart = min([(minRewardPart * toBigInt(2)), toBigInt(wxAmountBoostTotal)])
744+ let boostRewardPart = min([(minRewardPart * toBigInt((boostCoeff - 1))), toBigInt(wxAmountBoostTotal)])
717745 let totalReward = (minRewardPart + boostRewardPart)
718746 $Tuple2(nil, makeString(["%s%s%d%d%d%d%s", lpAssetIdStr, userAddressStr, toString(totalReward), toString(claimedByUser), toString(minRewardPart), toString(boostRewardPart), "soon"], SEP))
719747 }
720748
721749
722750
723751 @Callable(i)
724752 func stakedByUserREADONLY (lpAssetIdStr,userAddressStr) = {
725753 let stakedByUser = valueOrElse(getInteger(keyStakedByUser(userAddressStr, lpAssetIdStr)), 0)
726754 $Tuple2(nil, stakedByUser)
755+ }
756+
757+
758+
759+@Callable(i)
760+func stakedTotalREADONLY (lpAssetIdStr) = {
761+ let stakedTotal = valueOrElse(getInteger(keyStakedTotal(lpAssetIdStr)), 0)
762+ $Tuple2(nil, stakedTotal)
727763 }
728764
729765
730766
731767 @Callable(i)
732768 func usersListTraversal (lpAssetId) = {
733769 let checkCaller = if ((toBase58String(i.caller.bytes) == valueOrElse(getString(this, keyVotingEmissionContract()), "")))
734770 then true
735771 else mustManager(i)
736772 if ((checkCaller == checkCaller))
737773 then {
738774 let listName = getUsersListName(lpAssetId)
739775 let userOrUnit = getString(keyNextUser(lpAssetId))
740776 let headOrUnit = getString(keyListHead(listName))
741777 match userOrUnit {
742778 case _: Unit =>
743779 match headOrUnit {
744780 case _: Unit =>
745781 $Tuple2(nil, false)
746782 case head: String =>
747783 $Tuple2([StringEntry(keyNextUser(lpAssetId), head)], true)
748784 case _ =>
749785 throw("Match error")
750786 }
751787 case userAddress: String =>
752788 let claimedByUserMinReward = getBigIntFromStringOrZero(this, keyClaimedByUserMinReward(lpAssetId, userAddress))
753789 let poolAddress = getStringByAddressOrFail(factoryContract, keyFactoryLpAssetToPoolContractAddress(lpAssetId))
754790 let wxToClaimUserNew = refreshINTEGRALS(lpAssetId, userAddress, poolAddress, 0)._1
755791 let availableToClaim = (wxToClaimUserNew - claimedByUserMinReward)
756792 let throwIfNothingToClaim = true
757793 let r = if ((availableToClaim > zeroBigInt))
758794 then invoke(this, "claimWxINTERNAL", [lpAssetId, userAddress, throwIfNothingToClaim], nil)
759795 else unit
760796 if ((r == r))
761797 then {
762798 let nextUserOrUnit = getString(keyListNext(listName, userAddress))
763799 match nextUserOrUnit {
764800 case _: Unit =>
765801 $Tuple2([DeleteEntry(keyNextUser(lpAssetId))], false)
766802 case nextUser: String =>
767803 $Tuple2([StringEntry(keyNextUser(lpAssetId), nextUser)], true)
768804 case _ =>
769805 throw("Match error")
770806 }
771807 }
772808 else throw("Strict value is not equal to itself.")
773809 case _ =>
774810 throw("Match error")
775811 }
776812 }
777813 else throw("Strict value is not equal to itself.")
778814 }
779815
780816
781817
782818 @Callable(i)
783819 func onModifyWeight (lpAssetIdStr,poolAddressStr) = if ((i.caller != factoryContract))
784- then throw("permissions denied")
820+ then throwErr("permissions denied")
785821 else {
786- let $t03175531865 = refreshPoolINTEGRALS(lpAssetIdStr, poolAddressStr, 0)
787- let wxPerLpIntegralNew = $t03175531865._1
788- let poolIntegralSTATE = $t03175531865._2
789- let poolDEBUG = $t03175531865._3
822+ let $t03306233172 = refreshPoolINTEGRALS(lpAssetIdStr, poolAddressStr, 0)
823+ let wxPerLpIntegralNew = $t03306233172._1
824+ let poolIntegralSTATE = $t03306233172._2
825+ let poolDEBUG = $t03306233172._3
790826 poolIntegralSTATE
791827 }
792828
793829
794830 @Verifier(tx)
795831 func verify () = {
796832 let targetPublicKey = match managerPublicKeyOrUnit() {
797833 case pk: ByteVector =>
798834 pk
799835 case _: Unit =>
800836 tx.senderPublicKey
801837 case _ =>
802838 throw("Match error")
803839 }
804840 sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey)
805841 }
806842

github/deemru/w8io/169f3d6 
136.59 ms