tx · 9wdw25zHJFRAv4HbHsdQntcoacSpWEMTi5Ue4KoWDW6m

3Mx3zmXrMcLFCafMuPtXAzR4ZPVeZYb6qLz:  -0.02200000 Waves

2023.03.06 11:07 [2477968] smart account 3Mx3zmXrMcLFCafMuPtXAzR4ZPVeZYb6qLz > SELF 0.00000000 Waves

{ "type": 13, "id": "9wdw25zHJFRAv4HbHsdQntcoacSpWEMTi5Ue4KoWDW6m", "fee": 2200000, "feeAssetId": null, "timestamp": 1678090038745, "version": 2, "chainId": 84, "sender": "3Mx3zmXrMcLFCafMuPtXAzR4ZPVeZYb6qLz", "senderPublicKey": "D28XoueZWsMfm8Y5pa6C5ZFuYoWgre2Wm8tzJANJgMnq", "proofs": [ "21DFLgUraJxQ24aRGrN8L6rRp9Grow25UVeGM6gr6mrs72d53cKec4i4W1zQJFdh7Lyq1kESAXqovUgyZeL6s7Xf" ], "script": "base64:BgKnHwgCEgMKAQgSAwoBCBIDCgEIEgASABIECgIIARIDCgEIEgQKAggIEgYKBAEYCBgSBAoCGAgSBAoCCAgSAwoBCBIECgIICCIGU0NBTEU4IgVNVUxUMyIFTVVMVDgiB1NDQUxFMTgiBk1VTFQxOCIDU0VQIg5QT09MV0VJR0hUTVVMVCIKemVyb0JpZ0ludCIJb25lQmlnSW50Iglhc0FueUxpc3QiA3ZhbCIHJG1hdGNoMCIKdmFsQW55THlzdCIFYXNJbnQiBnZhbEludCIIYXNTdHJpbmciBnZhbFN0ciIMYXNCeXRlVmVjdG9yIgZ2YWxCaW4iD2dldFN0cmluZ09yRmFpbCIHYWRkcmVzcyIDa2V5IhhnZXRTdHJpbmdCeUFkZHJlc3NPckZhaWwiDGdldEludE9yWmVybyIPZ2V0SW50T3JEZWZhdWx0IgpkZWZhdWx0VmFsIgxnZXRJbnRPckZhaWwiGWdldEJpZ0ludEZyb21TdHJpbmdPclplcm8iHGdldEJpZ0ludEZyb21TdHJpbmdPckRlZmF1bHQiAXMiBXRvWDE4IgdvcmlnVmFsIg1vcml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AmFCBAJkcQUCZHMDCQABAgUCZHECBFVuaXQJAJQKAgkAzAgCCQELRGVsZXRlRW50cnkBCQECYmEBBQJhegUDbmlsBwMJAAECBQJkcQIGU3RyaW5nBAJkdAUCZHEJAJQKAgkAzAgCCQELU3RyaW5nRW50cnkCCQECYmEBBQJhegUCZHQFA25pbAYJAAIBAgtNYXRjaCBlcnJvcgkAAgECJFN0cmljdCB2YWx1ZSBpcyBub3QgZXF1YWwgdG8gaXRzZWxmLgkAAgECC01hdGNoIGVycm9yCQACAQIkU3RyaWN0IHZhbHVlIGlzIG5vdCBlcXVhbCB0byBpdHNlbGYuAmNqAQ5vbk1vZGlmeVdlaWdodAICYXICYncDCQECIT0CCAUCY2oGY2FsbGVyBQJhVgkAAgECEnBlcm1pc3Npb25zIGRlbmllZAQCZHUJAQJidgMFAmFyBQJidwAABAJidAgFAmR1Al8xBAJiVQgFAmR1Al8yBAJiVggFAmR1Al8zBQJiVQECZHYBAmR3AAQCZHgEAWwJAQJjZgADCQABAgUBbAIKQnl0ZVZlY3RvcgQCY2wFAWwFAmNsAwkAAQIFAWwCBFVuaXQIBQJkdg9zZW5kZXJQdWJsaWNLZXkJAAIBAgtNYXRjaCBlcnJvcgkA9AMDCAUCZHYJYm9keUJ5dGVzCQCRAwIIBQJkdgZwcm9vZnMAAAUCZHiCe9vh", "height": 2477968, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: DNvSMRFDobjtEsCMh7HiyYVbXfbMeNsc8TdmnjMo3Fyq Next: 2BxzSun9bdECvdFx65B5UjpGouhuFGnnfqE3JdhFLXd6 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
1618 let zeroBigInt = toBigInt(0)
1719
1820 let oneBigInt = toBigInt(1)
19-
20-func wrapErr (msg) = makeString(["staking.ride:", toString(this), msg], " ")
21-
22-
23-func throwErr (msg) = throw(wrapErr(msg))
24-
2521
2622 func asAnyList (val) = match val {
2723 case valAnyLyst: List[Any] =>
245241
246242 let boostingContract = getBoostingAddressOrFail(factoryCfg)
247243
248-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"))
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+ }
249250
250251 func keyNextUser (lpAssetId) = makeString(["%s%s", lpAssetId, "nextUser"], SEP)
251252
331332 else stakedTotal
332333 let poolWeight = getIntegerValue(factoryContract, keyFactoryPoolWeight(poolAddressStr))
333334 let emissionStartBlock = getIntOrFail(emissionContract, keyEmissionStartBlock())
334- let MULT3 = 1000
335335 let wxEmissionPerBlockX3 = (getIntOrFail(emissionContract, keyEmissionRatePerBlockCurrent()) * MULT3)
336- let poolWxEmissionPerBlockX3 = fraction(wxEmissionPerBlockX3, poolWeight, (POOLWEIGHTMULT * 3))
336+ let poolWxEmissionPerBlockX3 = fraction(wxEmissionPerBlockX3, poolWeight, (POOLWEIGHTMULT * boostCoeff))
337337 let wxPerLpIntegralKEY = keyWxPerLpIntegral(lpAssetIdStr)
338338 let wxPerLpIntegralLastUpdHeightKEY = keyWxPerLpIntegralLastUpdHeight(lpAssetIdStr)
339339 let wxPerLpKEY = keyWxPerLp(lpAssetIdStr)
357357
358358
359359 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
360+ let $t01428614408 = refreshPoolINTEGRALS(lpAssetIdStr, poolAddressStr, lpDeltaAmount)
361+ let wxPerLpIntegralNew = $t01428614408._1
362+ let poolIntegralSTATE = $t01428614408._2
363+ let poolDEBUG = $t01428614408._3
365364 let stakedByUserKEY = keyStakedByUser(userAddressStr, lpAssetIdStr)
366365 let stakedByUser = readStaked(stakedByUserKEY)
367366 let wxToClaimUserKEY = keyWxToClaimUser(lpAssetIdStr, userAddressStr)
418417 case _ =>
419418 throw("Match error")
420419 }
421-
422-
423-func unstakeActions (i,lpAssetId,poolAddress,userAddress,lpAssetRecipientAddress,amount) = {
424- let userAddressStr = toString(userAddress)
425- let lpAssetIdStr = toBase58String(lpAssetId)
426- let poolAddressStr = toString(poolAddress)
427- let stakedByUserKEY = keyStakedByUser(userAddressStr, lpAssetIdStr)
428- let stakedTotalKEY = keyStakedTotal(lpAssetIdStr)
429- let stakedByUser = readStaked(stakedByUserKEY)
430- let stakedTotal = readStaked(stakedTotalKEY)
431- let integralSTATE = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, -(amount))._2
432- let listName = getUsersListName(lpAssetIdStr)
433- let listActions = if (if (containsNode(listName, userAddressStr))
434- then (amount == stakedByUser)
435- else false)
436- then deleteNodeActions(listName, userAddressStr)
437- else nil
438- let claimedByUserMinReward = getBigIntFromStringOrZero(this, keyClaimedByUserMinReward(lpAssetIdStr, userAddressStr))
439- let wxToClaimUserNew = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, 0)._1
440- let availableToClaim = (wxToClaimUserNew - claimedByUserMinReward)
441- let throwIfNothingToClaim = true
442- let r = if ((availableToClaim > zeroBigInt))
443- then invoke(this, "claimWxINTERNAL", [lpAssetIdStr, userAddressStr, throwIfNothingToClaim], nil)
444- else unit
445- if ((r == r))
446- then if ((amount > stakedByUser))
447- then throw(((((((("passed amount=" + toString(amount)) + " is greater than available=") + toString(stakedByUser)) + ". lpAssetId=") + lpAssetIdStr) + ". stakedByUserKEY=") + stakedByUserKEY))
448- else (([IntegerEntry(stakedByUserKEY, (stakedByUser - amount)), IntegerEntry(stakedTotalKEY, (stakedTotal - amount)), ScriptTransfer(lpAssetRecipientAddress, amount, lpAssetId), OperationHistoryEntry("unstake", userAddressStr, lpAssetIdStr, amount, i.transactionId)] ++ integralSTATE) ++ listActions)
449- else throw("Strict value is not equal to itself.")
450- }
451420
452421
453422 @Callable(i)
523492 let stakedByUserKEY = keyStakedByUser(userAddressStr, lpAssetIdStr)
524493 let stakedTotalKEY = keyStakedTotal(lpAssetIdStr)
525494 let stakedByUser = readStaked(stakedByUserKEY)
526- let stakedTotal = readStaked(stakedTotalKEY)
527- let $t02127621393 = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, amount)
528- let wxToClaimUserNew = $t02127621393._1
529- let integralSTATE = $t02127621393._2
530- let debug = $t02127621393._3
531- let listName = getUsersListName(lpAssetIdStr)
532- let listActions = if (containsNode(listName, userAddressStr))
533- then nil
534- else insertNodeActions(listName, userAddressStr)
535- (([IntegerEntry(stakedByUserKEY, (stakedByUser + amount)), IntegerEntry(stakedTotalKEY, (stakedTotal + amount)), OperationHistoryEntry("stake", userAddressStr, lpAssetIdStr, amount, i.transactionId)] ++ integralSTATE) ++ listActions)
495+ let refreshStakedVote = if ((stakedByUser == 0))
496+ then invoke(boostingContract, "onStakedVoteUpdate", [lpAssetIdStr, userAddressStr, true], nil)
497+ else unit
498+ if ((refreshStakedVote == refreshStakedVote))
499+ then {
500+ let stakedTotal = readStaked(stakedTotalKEY)
501+ let $t01899019107 = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, amount)
502+ let wxToClaimUserNew = $t01899019107._1
503+ let integralSTATE = $t01899019107._2
504+ let debug = $t01899019107._3
505+ let listName = getUsersListName(lpAssetIdStr)
506+ let listActions = if (containsNode(listName, userAddressStr))
507+ then nil
508+ else insertNodeActions(listName, userAddressStr)
509+ (([IntegerEntry(stakedByUserKEY, (stakedByUser + amount)), IntegerEntry(stakedTotalKEY, (stakedTotal + amount)), OperationHistoryEntry("stake", userAddressStr, lpAssetIdStr, amount, i.transactionId)] ++ integralSTATE) ++ listActions)
510+ }
511+ else throw("Strict value is not equal to itself.")
536512 }
537513
538514
541517 func unstake (lpAssetIdStr,amount) = {
542518 let lpAssetId = fromBase58String(lpAssetIdStr)
543519 let poolAddressStr = valueOrErrorMessage(getString(factoryContract, keyFactoryLp2AssetsMapping(lpAssetIdStr)), ("unsupported lp asset " + lpAssetIdStr))
544- let poolAddress = addressFromStringValue(poolAddressStr)
545- let poolAddon = valueOrElse(getString(poolAddress, keyAddonAddr()), poolAddressStr)
520+ let poolAddon = valueOrElse(getString(addressFromStringValue(poolAddressStr), keyAddonAddr()), poolAddressStr)
546521 let callerStr = toString(i.caller)
547- let userAddress = if (if ((callerStr == poolAddressStr))
522+ let userAddressStr = if (if ((callerStr == poolAddressStr))
548523 then true
549524 else (callerStr == poolAddon))
550- then i.originCaller
551- else i.caller
552- let lpAssetRecipientAddress = i.caller
553- unstakeActions(i, lpAssetId, poolAddress, userAddress, lpAssetRecipientAddress, amount)
554- }
555-
556-
557-
558-@Callable(i)
559-func unstakeINTERNAL (lpAssetId,amount,userAddress,lpAssetRecipientAddress) = {
560- let lpAssetIdStr = toBase58String(lpAssetId)
561- let poolAddress = addressFromStringValue(valueOrErrorMessage(getString(factoryContract, keyFactoryLp2AssetsMapping(lpAssetIdStr)), ("unsupported lp asset " + lpAssetIdStr)))
562- let checkCaller = if ((i.caller == poolAddress))
563- then true
564- else permissionDeniedError
565- if ((checkCaller == checkCaller))
566- then unstakeActions(i, lpAssetId, poolAddress, Address(userAddress), Address(lpAssetRecipientAddress), amount)
525+ then toString(i.originCaller)
526+ else callerStr
527+ let stakedByUserKEY = keyStakedByUser(userAddressStr, lpAssetIdStr)
528+ let stakedTotalKEY = keyStakedTotal(lpAssetIdStr)
529+ let stakedByUser = readStaked(stakedByUserKEY)
530+ let stakedTotal = readStaked(stakedTotalKEY)
531+ let integralSTATE = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, -(amount))._2
532+ let listName = getUsersListName(lpAssetIdStr)
533+ let listActions = if (if (containsNode(listName, userAddressStr))
534+ then (amount == stakedByUser)
535+ else false)
536+ then deleteNodeActions(listName, userAddressStr)
537+ else nil
538+ let refreshStakedVote = if ((amount == stakedByUser))
539+ then invoke(boostingContract, "onStakedVoteUpdate", [lpAssetIdStr, userAddressStr, false], nil)
540+ else unit
541+ if ((refreshStakedVote == refreshStakedVote))
542+ then {
543+ let claimedByUserMinReward = getBigIntFromStringOrZero(this, keyClaimedByUserMinReward(lpAssetIdStr, userAddressStr))
544+ let poolAddress = getStringByAddressOrFail(factoryContract, keyFactoryLpAssetToPoolContractAddress(lpAssetIdStr))
545+ let wxToClaimUserNew = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddress, 0)._1
546+ let availableToClaim = (wxToClaimUserNew - claimedByUserMinReward)
547+ let r = if ((availableToClaim > zeroBigInt))
548+ then invoke(this, "claimWxINTERNAL", [lpAssetIdStr, userAddressStr], nil)
549+ else unit
550+ if ((r == r))
551+ then if ((amount > stakedByUser))
552+ then throw(((((((("passed amount=" + toString(amount)) + " is greater than available=") + toString(stakedByUser)) + ". lpAssetId=") + lpAssetIdStr) + ". stakedByUserKEY=") + stakedByUserKEY))
553+ else (([IntegerEntry(stakedByUserKEY, (stakedByUser - amount)), IntegerEntry(stakedTotalKEY, (stakedTotal - amount)), ScriptTransfer(i.caller, amount, lpAssetId), OperationHistoryEntry("unstake", userAddressStr, lpAssetIdStr, amount, i.transactionId)] ++ integralSTATE) ++ listActions)
554+ else throw("Strict value is not equal to itself.")
555+ }
567556 else throw("Strict value is not equal to itself.")
568557 }
569558
572561 @Callable(i)
573562 func claimWx (lpAssetIdStr) = {
574563 let userAddressStr = toString(i.caller)
575- let throwIfNothingToClaim = true
576- let result = invoke(this, "claimWxINTERNAL", [lpAssetIdStr, userAddressStr, throwIfNothingToClaim], nil)
564+ let result = invoke(this, "claimWxINTERNAL", [lpAssetIdStr, userAddressStr], nil)
577565 $Tuple2(nil, result)
578566 }
579567
580568
581569
582570 @Callable(i)
583-func claimWxDoNotThrow (lpAssetIdStr) = {
584- let userAddressStr = toString(i.caller)
585- let throwIfNothingToClaim = false
586- let result = invoke(this, "claimWxINTERNAL", [lpAssetIdStr, userAddressStr, throwIfNothingToClaim], nil)
587- $Tuple2(nil, result)
588- }
589-
590-
591-
592-@Callable(i)
593-func claimWxINTERNAL (lpAssetIdStr,userAddressStr,throwIfNothingToClaim) = {
571+func claimWxINTERNAL (lpAssetIdStr,userAddressStr) = {
594572 let checkCaller = mustThis(i)
595573 if ((checkCaller == checkCaller))
596574 then {
604582 let claimedByUserMinReward = getBigIntFromStringOrZero(this, claimedByUserMinRewardKEY)
605583 let claimedByUserBoostReward = getBigIntFromStringOrZero(this, claimedByUserBoostRewardKEY)
606584 let claimedTotal = getBigIntFromStringOrZero(this, claimedTotalKEY)
607- let $t02477924891 = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, 0)
608- let wxToClaimUserNew = $t02477924891._1
609- let integralSTATE = $t02477924891._2
610- let debug = $t02477924891._3
585+ let $t02314423256 = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, 0)
586+ let wxToClaimUserNew = $t02314423256._1
587+ let integralSTATE = $t02314423256._2
588+ let debug = $t02314423256._3
611589 let availableToClaim = max([(wxToClaimUserNew - claimedByUserMinReward), zeroBigInt])
612590 if ((zeroBigInt >= availableToClaim))
613- then if (throwIfNothingToClaim)
614- then throw("nothing to claim")
615- else $Tuple2(nil, 0)
591+ then throw("nothing to claim")
616592 else {
617593 let wxAmountBoostTotal = max([asInt(asAnyList(invoke(boostingContract, "claimWxBoost", [lpAssetIdStr, userAddressStr], nil))[0]), 0])
618594 let minRewardPart = availableToClaim
619- let boostRewardPart = min([(minRewardPart * toBigInt(2)), toBigInt(wxAmountBoostTotal)])
620- let totalReward = (minRewardPart + boostRewardPart)
595+ let boostRewardPart = min([(minRewardPart * toBigInt((boostCoeff - 1))), toBigInt(wxAmountBoostTotal)])
621596 let wxAssetId = asByteVector(asAnyList(invoke(emissionContract, "emit", [toInt(minRewardPart)], nil))[0])
622597 let emitBoost = asAnyList(invoke(emissionContract, "emit", [toInt(boostRewardPart)], nil))
623598 if ((emitBoost == emitBoost))
626601 let claimedByUserMinRewardPlusPart = (claimedByUserMinReward + minRewardPart)
627602 let claimedByUserBoostRewardPlusBoostRewardPart = (claimedByUserBoostReward + boostRewardPart)
628603 let claimedTotalPlusAvailableToClaim = (claimedTotal + availableToClaim)
629- $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))
604+[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)]
630605 }
631606 else throw("Strict value is not equal to itself.")
632607 }
649624 }, SEP)
650625 let unclaimed = info[3]
651626 let claimed = info[4]
652- let res = (resAcc :+ makeString(["%d%d", unclaimed, claimed], SEP))
627+ let userVoteFinalized = {
628+ let @ = invoke(boostingContract, "getUserVoteFinalizedREADONLY", [lpAssetId, userAddressStr], nil)
629+ if ($isInstanceOf(@, "Int"))
630+ then @
631+ else throw(($getType(@) + " couldn't be cast to Int"))
632+ }
633+ let res = (resAcc :+ makeString(["%d%d%d", unclaimed, claimed, toString(userVoteFinalized)], SEP))
653634 let inv = {
654635 let @ = invoke(this, "claimWxBulkInternalREADONLY", [(currentIter + 1), lpAssetIds, userAddressStr, res], nil)
655636 if ($isInstanceOf(@, "List[Any]"))
690671 else (height - emissionStartBlock)
691672 let poolWxEmission = fraction((wxEmissionPerBlock * passedBlocks), poolWeight, POOLWEIGHTMULT)
692673 let userWxReward = fraction(poolWxEmission, stakedByUser, stakedTotal)
693- let $t02870028812 = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, 0)
694- let wxToClaimUserNew = $t02870028812._1
695- let integralSTATE = $t02870028812._2
696- let debug = $t02870028812._3
674+ let $t02715327265 = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, 0)
675+ let wxToClaimUserNew = $t02715327265._1
676+ let integralSTATE = $t02715327265._2
677+ let debug = $t02715327265._3
697678 let availableToClaim = max([(wxToClaimUserNew - claimedByUserMinReward), zeroBigInt])
698679 let boostInvResult = asAnyList(invoke(boostingContract, "claimWxBoostREADONLY", [lpAssetIdStr, userAddressStr], nil))
699680 let wxAmountBoostTotal = max([asInt(boostInvResult[0]), 0])
700681 let boostDebug = asString(boostInvResult[1])
701682 let minRewardPart = availableToClaim
702- let boostRewardPart = min([(minRewardPart * toBigInt(2)), toBigInt(wxAmountBoostTotal)])
683+ let boostRewardPart = min([(minRewardPart * toBigInt((boostCoeff - 1))), toBigInt(wxAmountBoostTotal)])
703684 let totalReward = (minRewardPart + boostRewardPart)
704685 $Tuple2(nil, makeString(["%s%s%d%d%d%d%s", lpAssetIdStr, userAddressStr, toString(totalReward), toString(claimedByUser), toString(minRewardPart), toString(boostRewardPart), "soon"], SEP))
705- }
706-
707-
708-
709-@Callable(i)
710-func stakedByUserREADONLY (lpAssetIdStr,userAddressStr) = {
711- let stakedByUser = valueOrElse(getInteger(keyStakedByUser(userAddressStr, lpAssetIdStr)), 0)
712- $Tuple2(nil, stakedByUser)
713686 }
714687
715688
739712 let poolAddress = getStringByAddressOrFail(factoryContract, keyFactoryLpAssetToPoolContractAddress(lpAssetId))
740713 let wxToClaimUserNew = refreshINTEGRALS(lpAssetId, userAddress, poolAddress, 0)._1
741714 let availableToClaim = (wxToClaimUserNew - claimedByUserMinReward)
742- let throwIfNothingToClaim = true
743715 let r = if ((availableToClaim > zeroBigInt))
744- then invoke(this, "claimWxINTERNAL", [lpAssetId, userAddress, throwIfNothingToClaim], nil)
716+ then invoke(this, "claimWxINTERNAL", [lpAssetId, userAddress], nil)
745717 else unit
746718 if ((r == r))
747719 then {
769741 func onModifyWeight (lpAssetIdStr,poolAddressStr) = if ((i.caller != factoryContract))
770742 then throw("permissions denied")
771743 else {
772- let $t03141831528 = refreshPoolINTEGRALS(lpAssetIdStr, poolAddressStr, 0)
773- let wxPerLpIntegralNew = $t03141831528._1
774- let poolIntegralSTATE = $t03141831528._2
775- let poolDEBUG = $t03141831528._3
744+ let $t02961629726 = refreshPoolINTEGRALS(lpAssetIdStr, poolAddressStr, 0)
745+ let wxPerLpIntegralNew = $t02961629726._1
746+ let poolIntegralSTATE = $t02961629726._2
747+ let poolDEBUG = $t02961629726._3
776748 poolIntegralSTATE
777749 }
778750
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)
19-
20-func wrapErr (msg) = makeString(["staking.ride:", toString(this), msg], " ")
21-
22-
23-func throwErr (msg) = throw(wrapErr(msg))
24-
2521
2622 func asAnyList (val) = match val {
2723 case valAnyLyst: List[Any] =>
2824 valAnyLyst
2925 case _ =>
3026 throw("fail to cast into List[Any]")
3127 }
3228
3329
3430 func asInt (val) = match val {
3531 case valInt: Int =>
3632 valInt
3733 case _ =>
3834 throw("fail to cast into Int")
3935 }
4036
4137
4238 func asString (val) = match val {
4339 case valStr: String =>
4440 valStr
4541 case _ =>
4642 throw("fail to cast into Int")
4743 }
4844
4945
5046 func asByteVector (val) = match val {
5147 case valBin: ByteVector =>
5248 valBin
5349 case _ =>
5450 throw("fail to cast into Int")
5551 }
5652
5753
5854 func getStringOrFail (address,key) = valueOrErrorMessage(getString(address, key), (("mandatory this." + key) + " is not defined"))
5955
6056
6157 func getStringByAddressOrFail (address,key) = valueOrErrorMessage(getString(address, key), (((("mandatory " + toString(address)) + ".") + key) + " is not defined"))
6258
6359
6460 func getIntOrZero (address,key) = valueOrElse(getInteger(address, key), 0)
6561
6662
6763 func getIntOrDefault (address,key,defaultVal) = valueOrElse(getInteger(address, key), defaultVal)
6864
6965
7066 func getIntOrFail (address,key) = valueOrErrorMessage(getInteger(address, key), (("mandatory this." + key) + " is not defined"))
7167
7268
7369 func getBigIntFromStringOrZero (address,key) = value(parseBigInt(valueOrElse(getString(address, key), "0")))
7470
7571
7672 func getBigIntFromStringOrDefault (address,key,defaultVal) = match getString(address, key) {
7773 case s: String =>
7874 value(parseBigInt(s))
7975 case _: Unit =>
8076 defaultVal
8177 case _ =>
8278 throw("Match error")
8379 }
8480
8581
8682 func toX18 (origVal,origScaleMult) = fraction(toBigInt(origVal), MULT18, toBigInt(origScaleMult))
8783
8884
8985 func fromX18 (val,resultScaleMult) = toInt(fraction(val, toBigInt(resultScaleMult), MULT18))
9086
9187
9288 func keyFactoryAddress () = "%s%s__config__factoryAddress"
9389
9490
9591 func keyVotingEmissionContract () = "%s__votingEmissionContract"
9692
9793
9894 let IdxFactoryCfgStakingDapp = 1
9995
10096 let IdxFactoryCfgBoostingDapp = 2
10197
10298 let IdxFactoryCfgIdoDapp = 3
10399
104100 let IdxFactoryCfgTeamDapp = 4
105101
106102 let IdxFactoryCfgEmissionDapp = 5
107103
108104 let IdxFactoryCfgRestDapp = 6
109105
110106 let IdxFactoryCfgSlippageDapp = 7
111107
112108 func keyFactoryCfg () = "%s__factoryConfig"
113109
114110
115111 func keyManagerPublicKey () = "%s__managerPublicKey"
116112
117113
118114 func keyPendingManagerPublicKey () = "%s__pendingManagerPublicKey"
119115
120116
121117 func keyStablePoolAddonAddr () = "%s__stablePoolAddonAddr"
122118
123119
124120 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
248-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"))
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+ }
249250
250251 func keyNextUser (lpAssetId) = makeString(["%s%s", lpAssetId, "nextUser"], SEP)
251252
252253
253254 func getUsersListName (lpAssetId) = makeString(["users", lpAssetId], SEP)
254255
255256
256257 func keyListHead (listName) = makeString(["%s%s%s", listName, "head"], SEP)
257258
258259
259260 func keyListSize (listName) = makeString(["%s%s%s", listName, "size"], SEP)
260261
261262
262263 func keyListPrev (listName,id) = makeString(["%s%s%s%s", listName, id, "prev"], SEP)
263264
264265
265266 func keyListNext (listName,id) = makeString(["%s%s%s%s", listName, id, "next"], SEP)
266267
267268
268269 func containsNode (listName,id) = {
269270 let headOrUnit = getString(this, keyListHead(listName))
270271 let prevOrUnit = getString(this, keyListPrev(listName, id))
271272 let nextOrUnit = getString(this, keyListNext(listName, id))
272273 if (if ((id == valueOrElse(headOrUnit, "")))
273274 then true
274275 else (prevOrUnit != unit))
275276 then true
276277 else (nextOrUnit != unit)
277278 }
278279
279280
280281 func insertNodeActions (listName,id) = {
281282 let headOrUnit = getString(this, keyListHead(listName))
282283 let listSize = valueOrElse(getInteger(this, keyListSize(listName)), 0)
283284 let checkNode = if (!(containsNode(listName, id)))
284285 then true
285286 else throw("Node exists")
286287 if ((checkNode == checkNode))
287288 then (([IntegerEntry(keyListSize(listName), (listSize + 1))] ++ (if ((headOrUnit != unit))
288289 then [StringEntry(keyListNext(listName, id), value(headOrUnit)), StringEntry(keyListPrev(listName, value(headOrUnit)), id)]
289290 else nil)) ++ [StringEntry(keyListHead(listName), id)])
290291 else throw("Strict value is not equal to itself.")
291292 }
292293
293294
294295 func deleteNodeActions (listName,id) = {
295296 let headOrUnit = getString(this, keyListHead(listName))
296297 let listSize = valueOrElse(getInteger(this, keyListSize(listName)), 0)
297298 let prevOrUnit = getString(this, keyListPrev(listName, id))
298299 let nextOrUnit = getString(this, keyListNext(listName, id))
299300 ([IntegerEntry(keyListSize(listName), (listSize - 1))] ++ (if (if ((prevOrUnit != unit))
300301 then (nextOrUnit != unit)
301302 else false)
302303 then [StringEntry(keyListNext(listName, value(prevOrUnit)), value(nextOrUnit)), StringEntry(keyListPrev(listName, value(nextOrUnit)), value(prevOrUnit)), DeleteEntry(keyListPrev(listName, id)), DeleteEntry(keyListNext(listName, id))]
303304 else if ((nextOrUnit != unit))
304305 then [StringEntry(keyListHead(listName), value(nextOrUnit)), DeleteEntry(keyListNext(listName, id)), DeleteEntry(keyListPrev(listName, value(nextOrUnit)))]
305306 else if ((prevOrUnit != unit))
306307 then [DeleteEntry(keyListPrev(listName, id)), DeleteEntry(keyListNext(listName, value(prevOrUnit)))]
307308 else if ((id == valueOrElse(headOrUnit, "")))
308309 then [DeleteEntry(keyListHead(listName))]
309310 else throw(((("invalid node: " + listName) + ".") + id))))
310311 }
311312
312313
313314 func calcWxPerLpIntegralUserLast (stakedByUser,wxPerLpIntegralUserLastUpdHeightOrZero,wxPerLpIntegralNew,wxPerLpIntegralUserLastKEY) = if (if ((wxPerLpIntegralUserLastUpdHeightOrZero == zeroBigInt))
314315 then (stakedByUser > zeroBigInt)
315316 else false)
316317 then zeroBigInt
317318 else if ((stakedByUser == zeroBigInt))
318319 then wxPerLpIntegralNew
319320 else if (if ((wxPerLpIntegralUserLastUpdHeightOrZero > zeroBigInt))
320321 then (stakedByUser > zeroBigInt)
321322 else false)
322323 then value(parseBigInt(getStringOrFail(this, wxPerLpIntegralUserLastKEY)))
323324 else throw("calcWxPerLpIntegralUserLast: unexpected state")
324325
325326
326327 func refreshPoolINTEGRALS (lpAssetIdStr,poolAddressStr,lpDeltaAmount) = {
327328 let stakedTotalKEY = keyStakedTotal(lpAssetIdStr)
328329 let stakedTotal = toBigInt(readStaked(stakedTotalKEY))
329330 let nonZeroStakedTotal = if ((stakedTotal == zeroBigInt))
330331 then oneBigInt
331332 else stakedTotal
332333 let poolWeight = getIntegerValue(factoryContract, keyFactoryPoolWeight(poolAddressStr))
333334 let emissionStartBlock = getIntOrFail(emissionContract, keyEmissionStartBlock())
334- let MULT3 = 1000
335335 let wxEmissionPerBlockX3 = (getIntOrFail(emissionContract, keyEmissionRatePerBlockCurrent()) * MULT3)
336- let poolWxEmissionPerBlockX3 = fraction(wxEmissionPerBlockX3, poolWeight, (POOLWEIGHTMULT * 3))
336+ let poolWxEmissionPerBlockX3 = fraction(wxEmissionPerBlockX3, poolWeight, (POOLWEIGHTMULT * boostCoeff))
337337 let wxPerLpIntegralKEY = keyWxPerLpIntegral(lpAssetIdStr)
338338 let wxPerLpIntegralLastUpdHeightKEY = keyWxPerLpIntegralLastUpdHeight(lpAssetIdStr)
339339 let wxPerLpKEY = keyWxPerLp(lpAssetIdStr)
340340 let wxPerLpIntegralLastUpdHeight = getIntOrDefault(this, wxPerLpIntegralLastUpdHeightKEY, emissionStartBlock)
341341 let wxPerLpIntegral = getBigIntFromStringOrZero(this, wxPerLpIntegralKEY)
342342 let wxPerLpOrZeroX3 = 0
343343 let dh = max([(height - wxPerLpIntegralLastUpdHeight), 0])
344344 let wxPerLpX3 = if ((wxPerLpOrZeroX3 != 0))
345345 then toBigInt(wxPerLpOrZeroX3)
346346 else fraction(toBigInt(poolWxEmissionPerBlockX3), toBigInt(MULT8), nonZeroStakedTotal)
347347 let stakedTotalNew = (stakedTotal + toBigInt(lpDeltaAmount))
348348 let nonZeroStakedTotalNew = if ((stakedTotalNew == zeroBigInt))
349349 then oneBigInt
350350 else stakedTotalNew
351351 let wxPerLpIntegralNew = (wxPerLpIntegral + (wxPerLpX3 * toBigInt(dh)))
352352 let wxPerLpX3New = (toBigInt(poolWxEmissionPerBlockX3) / nonZeroStakedTotalNew)
353353 let wxPerLpIntegralLastUpdHeightNew = height
354354 let debug = makeString([toString(wxPerLpIntegralNew), toString(dh), toString(wxPerLpX3), toString(stakedTotal), toString(poolWxEmissionPerBlockX3), toString(wxEmissionPerBlockX3), toString(poolWeight)], "::")
355355 $Tuple3(wxPerLpIntegralNew, [StringEntry(wxPerLpIntegralKEY, toString(wxPerLpIntegralNew)), IntegerEntry(wxPerLpIntegralLastUpdHeightKEY, wxPerLpIntegralLastUpdHeightNew), StringEntry(wxPerLpKEY, toString(wxPerLpX3New))], debug)
356356 }
357357
358358
359359 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
360+ let $t01428614408 = refreshPoolINTEGRALS(lpAssetIdStr, poolAddressStr, lpDeltaAmount)
361+ let wxPerLpIntegralNew = $t01428614408._1
362+ let poolIntegralSTATE = $t01428614408._2
363+ let poolDEBUG = $t01428614408._3
365364 let stakedByUserKEY = keyStakedByUser(userAddressStr, lpAssetIdStr)
366365 let stakedByUser = readStaked(stakedByUserKEY)
367366 let wxToClaimUserKEY = keyWxToClaimUser(lpAssetIdStr, userAddressStr)
368367 let wxPerLpIntegralUserLastUpdHeightKEY = keyWxPerLpIntegralUserLastUpdHeight(lpAssetIdStr, userAddressStr)
369368 let wxPerLpIntegralUserLastKEY = keyWxPerLpIntegralUserLast(lpAssetIdStr, userAddressStr)
370369 let wxToClaimUser = getBigIntFromStringOrZero(this, wxToClaimUserKEY)
371370 let wxPerLpIntegralUserLastUpdHeightOrZero = getIntOrZero(this, wxPerLpIntegralUserLastUpdHeightKEY)
372371 let wxPerLpIntegralUserLast = calcWxPerLpIntegralUserLast(toBigInt(stakedByUser), toBigInt(wxPerLpIntegralUserLastUpdHeightOrZero), wxPerLpIntegralNew, wxPerLpIntegralUserLastKEY)
373372 let MULT11 = (MULT8 * MULT3)
374373 let wxToClaimUserNew = max([(wxToClaimUser + fraction((wxPerLpIntegralNew - wxPerLpIntegralUserLast), toBigInt(stakedByUser), toBigInt(MULT11))), zeroBigInt])
375374 let wxPerLpIntegralUserLastNew = wxPerLpIntegralNew
376375 let wxPerLpIntegralUserLastUpdHeightNew = height
377376 let debug = makeString([toString(wxToClaimUser), toString(wxPerLpIntegralUserLast), toString(stakedByUser), poolDEBUG, toString(height)], "::")
378377 $Tuple3(wxToClaimUserNew, (poolIntegralSTATE ++ [StringEntry(wxToClaimUserKEY, toString(wxToClaimUserNew)), IntegerEntry(wxPerLpIntegralUserLastUpdHeightKEY, wxPerLpIntegralUserLastUpdHeightNew), StringEntry(wxPerLpIntegralUserLastKEY, toString(wxPerLpIntegralUserLastNew))]), debug)
379378 }
380379
381380
382381 func managerPublicKeyOrUnit () = match getString(keyManagerPublicKey()) {
383382 case s: String =>
384383 fromBase58String(s)
385384 case _: Unit =>
386385 unit
387386 case _ =>
388387 throw("Match error")
389388 }
390389
391390
392391 func pendingManagerPublicKeyOrUnit () = match getString(keyPendingManagerPublicKey()) {
393392 case s: String =>
394393 fromBase58String(s)
395394 case _: Unit =>
396395 unit
397396 case _ =>
398397 throw("Match error")
399398 }
400399
401400
402401 let permissionDeniedError = throw("Permission denied")
403402
404403 func mustThis (i) = if ((i.caller == this))
405404 then true
406405 else permissionDeniedError
407406
408407
409408 func mustManager (i) = match managerPublicKeyOrUnit() {
410409 case pk: ByteVector =>
411410 if ((i.callerPublicKey == pk))
412411 then true
413412 else permissionDeniedError
414413 case _: Unit =>
415414 if ((i.caller == this))
416415 then true
417416 else permissionDeniedError
418417 case _ =>
419418 throw("Match error")
420419 }
421-
422-
423-func unstakeActions (i,lpAssetId,poolAddress,userAddress,lpAssetRecipientAddress,amount) = {
424- let userAddressStr = toString(userAddress)
425- let lpAssetIdStr = toBase58String(lpAssetId)
426- let poolAddressStr = toString(poolAddress)
427- let stakedByUserKEY = keyStakedByUser(userAddressStr, lpAssetIdStr)
428- let stakedTotalKEY = keyStakedTotal(lpAssetIdStr)
429- let stakedByUser = readStaked(stakedByUserKEY)
430- let stakedTotal = readStaked(stakedTotalKEY)
431- let integralSTATE = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, -(amount))._2
432- let listName = getUsersListName(lpAssetIdStr)
433- let listActions = if (if (containsNode(listName, userAddressStr))
434- then (amount == stakedByUser)
435- else false)
436- then deleteNodeActions(listName, userAddressStr)
437- else nil
438- let claimedByUserMinReward = getBigIntFromStringOrZero(this, keyClaimedByUserMinReward(lpAssetIdStr, userAddressStr))
439- let wxToClaimUserNew = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, 0)._1
440- let availableToClaim = (wxToClaimUserNew - claimedByUserMinReward)
441- let throwIfNothingToClaim = true
442- let r = if ((availableToClaim > zeroBigInt))
443- then invoke(this, "claimWxINTERNAL", [lpAssetIdStr, userAddressStr, throwIfNothingToClaim], nil)
444- else unit
445- if ((r == r))
446- then if ((amount > stakedByUser))
447- then throw(((((((("passed amount=" + toString(amount)) + " is greater than available=") + toString(stakedByUser)) + ". lpAssetId=") + lpAssetIdStr) + ". stakedByUserKEY=") + stakedByUserKEY))
448- else (([IntegerEntry(stakedByUserKEY, (stakedByUser - amount)), IntegerEntry(stakedTotalKEY, (stakedTotal - amount)), ScriptTransfer(lpAssetRecipientAddress, amount, lpAssetId), OperationHistoryEntry("unstake", userAddressStr, lpAssetIdStr, amount, i.transactionId)] ++ integralSTATE) ++ listActions)
449- else throw("Strict value is not equal to itself.")
450- }
451420
452421
453422 @Callable(i)
454423 func constructor (factoryAddressStr) = {
455424 let checkCaller = mustManager(i)
456425 if ((checkCaller == checkCaller))
457426 then [StringEntry(keyFactoryAddress(), factoryAddressStr)]
458427 else throw("Strict value is not equal to itself.")
459428 }
460429
461430
462431
463432 @Callable(i)
464433 func constructorV2 (votingEmissionContract) = {
465434 let cheks = [mustManager(i), if ((addressFromString(votingEmissionContract) != unit))
466435 then true
467436 else "invalid voting emission contract address"]
468437 if ((cheks == cheks))
469438 then [StringEntry(keyVotingEmissionContract(), votingEmissionContract)]
470439 else throw("Strict value is not equal to itself.")
471440 }
472441
473442
474443
475444 @Callable(i)
476445 func setManager (pendingManagerPublicKey) = {
477446 let checkCaller = mustManager(i)
478447 if ((checkCaller == checkCaller))
479448 then {
480449 let checkManagerPublicKey = fromBase58String(pendingManagerPublicKey)
481450 if ((checkManagerPublicKey == checkManagerPublicKey))
482451 then [StringEntry(keyPendingManagerPublicKey(), pendingManagerPublicKey)]
483452 else throw("Strict value is not equal to itself.")
484453 }
485454 else throw("Strict value is not equal to itself.")
486455 }
487456
488457
489458
490459 @Callable(i)
491460 func confirmManager () = {
492461 let pm = pendingManagerPublicKeyOrUnit()
493462 let hasPM = if (isDefined(pm))
494463 then true
495464 else throw("No pending manager")
496465 if ((hasPM == hasPM))
497466 then {
498467 let checkPM = if ((i.callerPublicKey == value(pm)))
499468 then true
500469 else throw("You are not pending manager")
501470 if ((checkPM == checkPM))
502471 then [StringEntry(keyManagerPublicKey(), toBase58String(value(pm))), DeleteEntry(keyPendingManagerPublicKey())]
503472 else throw("Strict value is not equal to itself.")
504473 }
505474 else throw("Strict value is not equal to itself.")
506475 }
507476
508477
509478
510479 @Callable(i)
511480 func stake () = if ((size(i.payments) != 1))
512481 then throw("invalid payment - exact one payment must be attached")
513482 else {
514483 let pmt = i.payments[0]
515484 let lpAssetId = value(pmt.assetId)
516485 let lpAssetIdStr = toBase58String(lpAssetId)
517486 let amount = pmt.amount
518487 let poolAddressStr = valueOrErrorMessage(getString(factoryContract, keyFactoryLp2AssetsMapping(lpAssetIdStr)), ("unsupported lp asset " + lpAssetIdStr))
519488 let callerStr = toString(i.caller)
520489 let userAddressStr = if ((callerStr == poolAddressStr))
521490 then toString(i.originCaller)
522491 else callerStr
523492 let stakedByUserKEY = keyStakedByUser(userAddressStr, lpAssetIdStr)
524493 let stakedTotalKEY = keyStakedTotal(lpAssetIdStr)
525494 let stakedByUser = readStaked(stakedByUserKEY)
526- let stakedTotal = readStaked(stakedTotalKEY)
527- let $t02127621393 = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, amount)
528- let wxToClaimUserNew = $t02127621393._1
529- let integralSTATE = $t02127621393._2
530- let debug = $t02127621393._3
531- let listName = getUsersListName(lpAssetIdStr)
532- let listActions = if (containsNode(listName, userAddressStr))
533- then nil
534- else insertNodeActions(listName, userAddressStr)
535- (([IntegerEntry(stakedByUserKEY, (stakedByUser + amount)), IntegerEntry(stakedTotalKEY, (stakedTotal + amount)), OperationHistoryEntry("stake", userAddressStr, lpAssetIdStr, amount, i.transactionId)] ++ integralSTATE) ++ listActions)
495+ let refreshStakedVote = if ((stakedByUser == 0))
496+ then invoke(boostingContract, "onStakedVoteUpdate", [lpAssetIdStr, userAddressStr, true], nil)
497+ else unit
498+ if ((refreshStakedVote == refreshStakedVote))
499+ then {
500+ let stakedTotal = readStaked(stakedTotalKEY)
501+ let $t01899019107 = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, amount)
502+ let wxToClaimUserNew = $t01899019107._1
503+ let integralSTATE = $t01899019107._2
504+ let debug = $t01899019107._3
505+ let listName = getUsersListName(lpAssetIdStr)
506+ let listActions = if (containsNode(listName, userAddressStr))
507+ then nil
508+ else insertNodeActions(listName, userAddressStr)
509+ (([IntegerEntry(stakedByUserKEY, (stakedByUser + amount)), IntegerEntry(stakedTotalKEY, (stakedTotal + amount)), OperationHistoryEntry("stake", userAddressStr, lpAssetIdStr, amount, i.transactionId)] ++ integralSTATE) ++ listActions)
510+ }
511+ else throw("Strict value is not equal to itself.")
536512 }
537513
538514
539515
540516 @Callable(i)
541517 func unstake (lpAssetIdStr,amount) = {
542518 let lpAssetId = fromBase58String(lpAssetIdStr)
543519 let poolAddressStr = valueOrErrorMessage(getString(factoryContract, keyFactoryLp2AssetsMapping(lpAssetIdStr)), ("unsupported lp asset " + lpAssetIdStr))
544- let poolAddress = addressFromStringValue(poolAddressStr)
545- let poolAddon = valueOrElse(getString(poolAddress, keyAddonAddr()), poolAddressStr)
520+ let poolAddon = valueOrElse(getString(addressFromStringValue(poolAddressStr), keyAddonAddr()), poolAddressStr)
546521 let callerStr = toString(i.caller)
547- let userAddress = if (if ((callerStr == poolAddressStr))
522+ let userAddressStr = if (if ((callerStr == poolAddressStr))
548523 then true
549524 else (callerStr == poolAddon))
550- then i.originCaller
551- else i.caller
552- let lpAssetRecipientAddress = i.caller
553- unstakeActions(i, lpAssetId, poolAddress, userAddress, lpAssetRecipientAddress, amount)
554- }
555-
556-
557-
558-@Callable(i)
559-func unstakeINTERNAL (lpAssetId,amount,userAddress,lpAssetRecipientAddress) = {
560- let lpAssetIdStr = toBase58String(lpAssetId)
561- let poolAddress = addressFromStringValue(valueOrErrorMessage(getString(factoryContract, keyFactoryLp2AssetsMapping(lpAssetIdStr)), ("unsupported lp asset " + lpAssetIdStr)))
562- let checkCaller = if ((i.caller == poolAddress))
563- then true
564- else permissionDeniedError
565- if ((checkCaller == checkCaller))
566- then unstakeActions(i, lpAssetId, poolAddress, Address(userAddress), Address(lpAssetRecipientAddress), amount)
525+ then toString(i.originCaller)
526+ else callerStr
527+ let stakedByUserKEY = keyStakedByUser(userAddressStr, lpAssetIdStr)
528+ let stakedTotalKEY = keyStakedTotal(lpAssetIdStr)
529+ let stakedByUser = readStaked(stakedByUserKEY)
530+ let stakedTotal = readStaked(stakedTotalKEY)
531+ let integralSTATE = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, -(amount))._2
532+ let listName = getUsersListName(lpAssetIdStr)
533+ let listActions = if (if (containsNode(listName, userAddressStr))
534+ then (amount == stakedByUser)
535+ else false)
536+ then deleteNodeActions(listName, userAddressStr)
537+ else nil
538+ let refreshStakedVote = if ((amount == stakedByUser))
539+ then invoke(boostingContract, "onStakedVoteUpdate", [lpAssetIdStr, userAddressStr, false], nil)
540+ else unit
541+ if ((refreshStakedVote == refreshStakedVote))
542+ then {
543+ let claimedByUserMinReward = getBigIntFromStringOrZero(this, keyClaimedByUserMinReward(lpAssetIdStr, userAddressStr))
544+ let poolAddress = getStringByAddressOrFail(factoryContract, keyFactoryLpAssetToPoolContractAddress(lpAssetIdStr))
545+ let wxToClaimUserNew = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddress, 0)._1
546+ let availableToClaim = (wxToClaimUserNew - claimedByUserMinReward)
547+ let r = if ((availableToClaim > zeroBigInt))
548+ then invoke(this, "claimWxINTERNAL", [lpAssetIdStr, userAddressStr], nil)
549+ else unit
550+ if ((r == r))
551+ then if ((amount > stakedByUser))
552+ then throw(((((((("passed amount=" + toString(amount)) + " is greater than available=") + toString(stakedByUser)) + ". lpAssetId=") + lpAssetIdStr) + ". stakedByUserKEY=") + stakedByUserKEY))
553+ else (([IntegerEntry(stakedByUserKEY, (stakedByUser - amount)), IntegerEntry(stakedTotalKEY, (stakedTotal - amount)), ScriptTransfer(i.caller, amount, lpAssetId), OperationHistoryEntry("unstake", userAddressStr, lpAssetIdStr, amount, i.transactionId)] ++ integralSTATE) ++ listActions)
554+ else throw("Strict value is not equal to itself.")
555+ }
567556 else throw("Strict value is not equal to itself.")
568557 }
569558
570559
571560
572561 @Callable(i)
573562 func claimWx (lpAssetIdStr) = {
574563 let userAddressStr = toString(i.caller)
575- let throwIfNothingToClaim = true
576- let result = invoke(this, "claimWxINTERNAL", [lpAssetIdStr, userAddressStr, throwIfNothingToClaim], nil)
564+ let result = invoke(this, "claimWxINTERNAL", [lpAssetIdStr, userAddressStr], nil)
577565 $Tuple2(nil, result)
578566 }
579567
580568
581569
582570 @Callable(i)
583-func claimWxDoNotThrow (lpAssetIdStr) = {
584- let userAddressStr = toString(i.caller)
585- let throwIfNothingToClaim = false
586- let result = invoke(this, "claimWxINTERNAL", [lpAssetIdStr, userAddressStr, throwIfNothingToClaim], nil)
587- $Tuple2(nil, result)
588- }
589-
590-
591-
592-@Callable(i)
593-func claimWxINTERNAL (lpAssetIdStr,userAddressStr,throwIfNothingToClaim) = {
571+func claimWxINTERNAL (lpAssetIdStr,userAddressStr) = {
594572 let checkCaller = mustThis(i)
595573 if ((checkCaller == checkCaller))
596574 then {
597575 let userAddress = valueOrErrorMessage(addressFromString(userAddressStr), "claimWxINTERNAL: invalid user address")
598576 let poolAddressStr = getStringByAddressOrFail(factoryContract, keyFactoryLpAssetToPoolContractAddress(lpAssetIdStr))
599577 let claimedByUserKEY = keyClaimedByUser(lpAssetIdStr, userAddressStr)
600578 let claimedTotalKEY = keyClaimedTotal(lpAssetIdStr)
601579 let claimedByUserMinRewardKEY = keyClaimedByUserMinReward(lpAssetIdStr, userAddressStr)
602580 let claimedByUserBoostRewardKEY = keyClaimedByUserBoostReward(lpAssetIdStr, userAddressStr)
603581 let claimedByUser = getBigIntFromStringOrZero(this, claimedByUserKEY)
604582 let claimedByUserMinReward = getBigIntFromStringOrZero(this, claimedByUserMinRewardKEY)
605583 let claimedByUserBoostReward = getBigIntFromStringOrZero(this, claimedByUserBoostRewardKEY)
606584 let claimedTotal = getBigIntFromStringOrZero(this, claimedTotalKEY)
607- let $t02477924891 = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, 0)
608- let wxToClaimUserNew = $t02477924891._1
609- let integralSTATE = $t02477924891._2
610- let debug = $t02477924891._3
585+ let $t02314423256 = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, 0)
586+ let wxToClaimUserNew = $t02314423256._1
587+ let integralSTATE = $t02314423256._2
588+ let debug = $t02314423256._3
611589 let availableToClaim = max([(wxToClaimUserNew - claimedByUserMinReward), zeroBigInt])
612590 if ((zeroBigInt >= availableToClaim))
613- then if (throwIfNothingToClaim)
614- then throw("nothing to claim")
615- else $Tuple2(nil, 0)
591+ then throw("nothing to claim")
616592 else {
617593 let wxAmountBoostTotal = max([asInt(asAnyList(invoke(boostingContract, "claimWxBoost", [lpAssetIdStr, userAddressStr], nil))[0]), 0])
618594 let minRewardPart = availableToClaim
619- let boostRewardPart = min([(minRewardPart * toBigInt(2)), toBigInt(wxAmountBoostTotal)])
620- let totalReward = (minRewardPart + boostRewardPart)
595+ let boostRewardPart = min([(minRewardPart * toBigInt((boostCoeff - 1))), toBigInt(wxAmountBoostTotal)])
621596 let wxAssetId = asByteVector(asAnyList(invoke(emissionContract, "emit", [toInt(minRewardPart)], nil))[0])
622597 let emitBoost = asAnyList(invoke(emissionContract, "emit", [toInt(boostRewardPart)], nil))
623598 if ((emitBoost == emitBoost))
624599 then {
625600 let claimedByUserValue = ((claimedByUser + minRewardPart) + boostRewardPart)
626601 let claimedByUserMinRewardPlusPart = (claimedByUserMinReward + minRewardPart)
627602 let claimedByUserBoostRewardPlusBoostRewardPart = (claimedByUserBoostReward + boostRewardPart)
628603 let claimedTotalPlusAvailableToClaim = (claimedTotal + availableToClaim)
629- $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))
604+[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)]
630605 }
631606 else throw("Strict value is not equal to itself.")
632607 }
633608 }
634609 else throw("Strict value is not equal to itself.")
635610 }
636611
637612
638613
639614 @Callable(i)
640615 func claimWxBulkInternalREADONLY (currentIter,lpAssetIds,userAddressStr,resAcc) = if ((currentIter == size(lpAssetIds)))
641616 then $Tuple2(nil, resAcc)
642617 else {
643618 let lpAssetId = lpAssetIds[currentIter]
644619 let info = split({
645620 let @ = invoke(this, "claimWxREADONLY", [lpAssetId, userAddressStr], nil)
646621 if ($isInstanceOf(@, "String"))
647622 then @
648623 else throw(($getType(@) + " couldn't be cast to String"))
649624 }, SEP)
650625 let unclaimed = info[3]
651626 let claimed = info[4]
652- let res = (resAcc :+ makeString(["%d%d", unclaimed, claimed], SEP))
627+ let userVoteFinalized = {
628+ let @ = invoke(boostingContract, "getUserVoteFinalizedREADONLY", [lpAssetId, userAddressStr], nil)
629+ if ($isInstanceOf(@, "Int"))
630+ then @
631+ else throw(($getType(@) + " couldn't be cast to Int"))
632+ }
633+ let res = (resAcc :+ makeString(["%d%d%d", unclaimed, claimed, toString(userVoteFinalized)], SEP))
653634 let inv = {
654635 let @ = invoke(this, "claimWxBulkInternalREADONLY", [(currentIter + 1), lpAssetIds, userAddressStr, res], nil)
655636 if ($isInstanceOf(@, "List[Any]"))
656637 then @
657638 else throw(($getType(@) + " couldn't be cast to List[Any]"))
658639 }
659640 if ((inv == inv))
660641 then $Tuple2(nil, inv)
661642 else throw("Strict value is not equal to itself.")
662643 }
663644
664645
665646
666647 @Callable(i)
667648 func claimWxBulkREADONLY (lpAssetIds,userAddressStr) = {
668649 let res = invoke(this, "claimWxBulkInternalREADONLY", [0, lpAssetIds, userAddressStr, nil], nil)
669650 $Tuple2(nil, res)
670651 }
671652
672653
673654
674655 @Callable(i)
675656 func claimWxREADONLY (lpAssetIdStr,userAddressStr) = {
676657 let stakedByUserKEY = keyStakedByUser(userAddressStr, lpAssetIdStr)
677658 let stakedTotalKEY = keyStakedTotal(lpAssetIdStr)
678659 let claimedByUserKEY = keyClaimedByUser(lpAssetIdStr, userAddressStr)
679660 let claimedByUserMinRewardKEY = keyClaimedByUserMinReward(lpAssetIdStr, userAddressStr)
680661 let stakedByUser = readStaked(stakedByUserKEY)
681662 let stakedTotal = readStaked(stakedTotalKEY)
682663 let claimedByUser = getBigIntFromStringOrZero(this, claimedByUserKEY)
683664 let claimedByUserMinReward = getBigIntFromStringOrZero(this, claimedByUserMinRewardKEY)
684665 let poolAddressStr = getStringByAddressOrFail(factoryContract, keyFactoryLpAssetToPoolContractAddress(lpAssetIdStr))
685666 let poolWeight = getIntegerValue(factoryContract, keyFactoryPoolWeight(poolAddressStr))
686667 let wxEmissionPerBlock = getIntOrFail(emissionContract, keyEmissionRatePerBlockCurrent())
687668 let emissionStartBlock = getIntOrFail(emissionContract, keyEmissionStartBlock())
688669 let passedBlocks = if ((emissionStartBlock > height))
689670 then 0
690671 else (height - emissionStartBlock)
691672 let poolWxEmission = fraction((wxEmissionPerBlock * passedBlocks), poolWeight, POOLWEIGHTMULT)
692673 let userWxReward = fraction(poolWxEmission, stakedByUser, stakedTotal)
693- let $t02870028812 = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, 0)
694- let wxToClaimUserNew = $t02870028812._1
695- let integralSTATE = $t02870028812._2
696- let debug = $t02870028812._3
674+ let $t02715327265 = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, 0)
675+ let wxToClaimUserNew = $t02715327265._1
676+ let integralSTATE = $t02715327265._2
677+ let debug = $t02715327265._3
697678 let availableToClaim = max([(wxToClaimUserNew - claimedByUserMinReward), zeroBigInt])
698679 let boostInvResult = asAnyList(invoke(boostingContract, "claimWxBoostREADONLY", [lpAssetIdStr, userAddressStr], nil))
699680 let wxAmountBoostTotal = max([asInt(boostInvResult[0]), 0])
700681 let boostDebug = asString(boostInvResult[1])
701682 let minRewardPart = availableToClaim
702- let boostRewardPart = min([(minRewardPart * toBigInt(2)), toBigInt(wxAmountBoostTotal)])
683+ let boostRewardPart = min([(minRewardPart * toBigInt((boostCoeff - 1))), toBigInt(wxAmountBoostTotal)])
703684 let totalReward = (minRewardPart + boostRewardPart)
704685 $Tuple2(nil, makeString(["%s%s%d%d%d%d%s", lpAssetIdStr, userAddressStr, toString(totalReward), toString(claimedByUser), toString(minRewardPart), toString(boostRewardPart), "soon"], SEP))
705- }
706-
707-
708-
709-@Callable(i)
710-func stakedByUserREADONLY (lpAssetIdStr,userAddressStr) = {
711- let stakedByUser = valueOrElse(getInteger(keyStakedByUser(userAddressStr, lpAssetIdStr)), 0)
712- $Tuple2(nil, stakedByUser)
713686 }
714687
715688
716689
717690 @Callable(i)
718691 func usersListTraversal (lpAssetId) = {
719692 let checkCaller = if ((toBase58String(i.caller.bytes) == valueOrElse(getString(this, keyVotingEmissionContract()), "")))
720693 then true
721694 else mustManager(i)
722695 if ((checkCaller == checkCaller))
723696 then {
724697 let listName = getUsersListName(lpAssetId)
725698 let userOrUnit = getString(keyNextUser(lpAssetId))
726699 let headOrUnit = getString(keyListHead(listName))
727700 match userOrUnit {
728701 case _: Unit =>
729702 match headOrUnit {
730703 case _: Unit =>
731704 $Tuple2(nil, false)
732705 case head: String =>
733706 $Tuple2([StringEntry(keyNextUser(lpAssetId), head)], true)
734707 case _ =>
735708 throw("Match error")
736709 }
737710 case userAddress: String =>
738711 let claimedByUserMinReward = getBigIntFromStringOrZero(this, keyClaimedByUserMinReward(lpAssetId, userAddress))
739712 let poolAddress = getStringByAddressOrFail(factoryContract, keyFactoryLpAssetToPoolContractAddress(lpAssetId))
740713 let wxToClaimUserNew = refreshINTEGRALS(lpAssetId, userAddress, poolAddress, 0)._1
741714 let availableToClaim = (wxToClaimUserNew - claimedByUserMinReward)
742- let throwIfNothingToClaim = true
743715 let r = if ((availableToClaim > zeroBigInt))
744- then invoke(this, "claimWxINTERNAL", [lpAssetId, userAddress, throwIfNothingToClaim], nil)
716+ then invoke(this, "claimWxINTERNAL", [lpAssetId, userAddress], nil)
745717 else unit
746718 if ((r == r))
747719 then {
748720 let nextUserOrUnit = getString(keyListNext(listName, userAddress))
749721 match nextUserOrUnit {
750722 case _: Unit =>
751723 $Tuple2([DeleteEntry(keyNextUser(lpAssetId))], false)
752724 case nextUser: String =>
753725 $Tuple2([StringEntry(keyNextUser(lpAssetId), nextUser)], true)
754726 case _ =>
755727 throw("Match error")
756728 }
757729 }
758730 else throw("Strict value is not equal to itself.")
759731 case _ =>
760732 throw("Match error")
761733 }
762734 }
763735 else throw("Strict value is not equal to itself.")
764736 }
765737
766738
767739
768740 @Callable(i)
769741 func onModifyWeight (lpAssetIdStr,poolAddressStr) = if ((i.caller != factoryContract))
770742 then throw("permissions denied")
771743 else {
772- let $t03141831528 = refreshPoolINTEGRALS(lpAssetIdStr, poolAddressStr, 0)
773- let wxPerLpIntegralNew = $t03141831528._1
774- let poolIntegralSTATE = $t03141831528._2
775- let poolDEBUG = $t03141831528._3
744+ let $t02961629726 = refreshPoolINTEGRALS(lpAssetIdStr, poolAddressStr, 0)
745+ let wxPerLpIntegralNew = $t02961629726._1
746+ let poolIntegralSTATE = $t02961629726._2
747+ let poolDEBUG = $t02961629726._3
776748 poolIntegralSTATE
777749 }
778750
779751
780752 @Verifier(tx)
781753 func verify () = {
782754 let targetPublicKey = match managerPublicKeyOrUnit() {
783755 case pk: ByteVector =>
784756 pk
785757 case _: Unit =>
786758 tx.senderPublicKey
787759 case _ =>
788760 throw("Match error")
789761 }
790762 sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey)
791763 }
792764

github/deemru/w8io/fabc49c 
117.52 ms