tx · DMr3w4gLRW7PWbGNe9MHbhDbzdC7Gq3HJgk6pGVxANcS

3Mx3zmXrMcLFCafMuPtXAzR4ZPVeZYb6qLz:  -0.02300000 Waves

2023.02.27 12:50 [2467957] smart account 3Mx3zmXrMcLFCafMuPtXAzR4ZPVeZYb6qLz > SELF 0.00000000 Waves

{ "type": 13, "id": "DMr3w4gLRW7PWbGNe9MHbhDbzdC7Gq3HJgk6pGVxANcS", "fee": 2300000, "feeAssetId": null, "timestamp": 1677491419865, "version": 1, "sender": "3Mx3zmXrMcLFCafMuPtXAzR4ZPVeZYb6qLz", "senderPublicKey": "D28XoueZWsMfm8Y5pa6C5ZFuYoWgre2Wm8tzJANJgMnq", "proofs": [ "rwWUBLtwecFUCWEKE543bc2pVQRJu4b7Tg7bZuaK17rDJLEa614Z3KxrEBusq43M6AS2zvsarNyR8V8x4hkGp69" ], "script": "base64:BgL5HwgCEgMKAQgSAwoBCBIDCgEIEgASABIECgIIARIGCgQCAQICEgMKAQgSAwoBCBIFCgMICAQSBgoEARgIGBIECgIYCBIECgIICBIECgIICBIDCgEIEgQKAggIIgZTQ0FMRTgiBU1VTFQ4IgdTQ0FMRTE4IgZNVUxUMTgiA1NFUCIOUE9PTFdFSUdIVE1VTFQiCnplcm9CaWdJbnQiCW9uZUJpZ0ludCIHd3JhcEVyciIDbXNnIgh0aHJvd0VyciIJYXNBbnlMaXN0IgN2YWwiByRtYXRjaDAiCnZhbEFueUx5c3QiBWFzSW50IgZ2YWxJbnQiCGFzU3RyaW5nIgZ2YWxTdHIiDGFzQnl0ZVZlY3RvciIGdmFsQmluIg9nZXRTdHJpbmdPckZhaWwiB2FkZHJlc3MiA2tleSIYZ2V0U3RyaW5nQnlBZGRyZXNzT3JGYWlsIgxnZXRJbnRPclplcm8iD2dldEludE9yRGVmYXVsdCIKZGVmYXVsdFZhbCIMZ2V0SW50T3JGYWlsIhlnZXRCaWdJbnRGcm9tU3RyaW5nT3JaZXJvIhxnZXRCaWdJbnRGcm9tU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vdCBlcXVhbCB0byBpdHNlbGYuAmNsAQ5vbk1vZGlmeVdlaWdodAICYXQCYngDCQECIT0CCAUCY2wGY2FsbGVyBQJhWAkAAgECEnBlcm1pc3Npb25zIGRlbmllZAQCZHkJAQJidwMFAmF0BQJieAAABAJidQgFAmR5Al8xBAJiVwgFAmR5Al8yBAJiWAgFAmR5Al8zBQJiVwECZHoBAmRBAAQCZEIEAW4JAQJjaAADCQABAgUBbgIKQnl0ZVZlY3RvcgQCY24FAW4FAmNuAwkAAQIFAW4CBFVuaXQIBQJkeg9zZW5kZXJQdWJsaWNLZXkJAAIBAgtNYXRjaCBlcnJvcgkA9AMDCAUCZHoJYm9keUJ5dGVzCQCRAwIIBQJkegZwcm9vZnMAAAUCZELLf93Z", "chainId": 84, "height": 2467957, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 9oVUyT3cLf31dHCmNJ6o5GdSfopCswi7KGYxK7DUdxKb Next: 4bAHMDZPDfjo93XqDJejLHZaJBkRXbaNhT6iXn2zzfkZ Diff:
OldNewDifferences
1616 let zeroBigInt = toBigInt(0)
1717
1818 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+
1925
2026 func asAnyList (val) = match val {
2127 case valAnyLyst: List[Any] =>
239245
240246 let boostingContract = getBoostingAddressOrFail(factoryCfg)
241247
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"))
249+
242250 func keyNextUser (lpAssetId) = makeString(["%s%s", lpAssetId, "nextUser"], SEP)
243251
244252
349357
350358
351359 func refreshINTEGRALS (lpAssetIdStr,userAddressStr,poolAddressStr,lpDeltaAmount) = {
352- let $t01427414396 = refreshPoolINTEGRALS(lpAssetIdStr, poolAddressStr, lpDeltaAmount)
353- let wxPerLpIntegralNew = $t01427414396._1
354- let poolIntegralSTATE = $t01427414396._2
355- let poolDEBUG = $t01427414396._3
360+ let $t01475014872 = refreshPoolINTEGRALS(lpAssetIdStr, poolAddressStr, lpDeltaAmount)
361+ let wxPerLpIntegralNew = $t01475014872._1
362+ let poolIntegralSTATE = $t01475014872._2
363+ let poolDEBUG = $t01475014872._3
356364 let MULT3 = 1000
357365 let stakedByUserKEY = keyStakedByUser(userAddressStr, lpAssetIdStr)
358366 let stakedByUser = readStaked(stakedByUserKEY)
410418 case _ =>
411419 throw("Match error")
412420 }
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 claimedByUser = getBigIntFromStringOrZero(this, keyClaimedByUser(lpAssetIdStr, userAddressStr))
439+ let wxToClaimUserNew = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, 0)._1
440+ let availableToClaim = (wxToClaimUserNew - claimedByUser)
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+ }
413451
414452
415453 @Callable(i)
486524 let stakedTotalKEY = keyStakedTotal(lpAssetIdStr)
487525 let stakedByUser = readStaked(stakedByUserKEY)
488526 let stakedTotal = readStaked(stakedTotalKEY)
489- let $t01883218949 = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, amount)
490- let wxToClaimUserNew = $t01883218949._1
491- let integralSTATE = $t01883218949._2
492- let debug = $t01883218949._3
527+ let $t02114621263 = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, amount)
528+ let wxToClaimUserNew = $t02114621263._1
529+ let integralSTATE = $t02114621263._2
530+ let debug = $t02114621263._3
493531 let listName = getUsersListName(lpAssetIdStr)
494532 let listActions = if (containsNode(listName, userAddressStr))
495533 then nil
503541 func unstake (lpAssetIdStr,amount) = {
504542 let lpAssetId = fromBase58String(lpAssetIdStr)
505543 let poolAddressStr = valueOrErrorMessage(getString(factoryContract, keyFactoryLp2AssetsMapping(lpAssetIdStr)), ("unsupported lp asset " + lpAssetIdStr))
506- let poolAddon = valueOrElse(getString(addressFromStringValue(poolAddressStr), keyAddonAddr()), poolAddressStr)
544+ let poolAddress = addressFromStringValue(poolAddressStr)
545+ let poolAddon = valueOrElse(getString(poolAddress, keyAddonAddr()), poolAddressStr)
507546 let callerStr = toString(i.caller)
508- let userAddressStr = if (if ((callerStr == poolAddressStr))
547+ let userAddress = if (if ((callerStr == poolAddressStr))
509548 then true
510549 else (callerStr == poolAddon))
511- then toString(i.originCaller)
512- else callerStr
513- let stakedByUserKEY = keyStakedByUser(userAddressStr, lpAssetIdStr)
514- let stakedTotalKEY = keyStakedTotal(lpAssetIdStr)
515- let stakedByUser = readStaked(stakedByUserKEY)
516- let stakedTotal = readStaked(stakedTotalKEY)
517- let integralSTATE = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, -(amount))._2
518- let listName = getUsersListName(lpAssetIdStr)
519- let listActions = if (if (containsNode(listName, userAddressStr))
520- then (amount == stakedByUser)
521- else false)
522- then deleteNodeActions(listName, userAddressStr)
523- else nil
524- let claimedByUserMinReward = getBigIntFromStringOrZero(this, keyClaimedByUserMinReward(lpAssetIdStr, userAddressStr))
525- let poolAddress = getStringByAddressOrFail(factoryContract, keyFactoryLpAssetToPoolContractAddress(lpAssetIdStr))
526- let wxToClaimUserNew = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddress, 0)._1
527- let availableToClaim = (wxToClaimUserNew - claimedByUserMinReward)
528- let r = if ((availableToClaim > zeroBigInt))
529- then invoke(this, "claimWxINTERNAL", [lpAssetIdStr, userAddressStr], nil)
530- else unit
531- if ((r == r))
532- then if ((amount > stakedByUser))
533- then throw(((((((("passed amount=" + toString(amount)) + " is greater than available=") + toString(stakedByUser)) + ". lpAssetId=") + lpAssetIdStr) + ". stakedByUserKEY=") + stakedByUserKEY))
534- else (([IntegerEntry(stakedByUserKEY, (stakedByUser - amount)), IntegerEntry(stakedTotalKEY, (stakedTotal - amount)), ScriptTransfer(i.caller, amount, lpAssetId), OperationHistoryEntry("unstake", userAddressStr, lpAssetIdStr, amount, i.transactionId)] ++ integralSTATE) ++ listActions)
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)
535567 else throw("Strict value is not equal to itself.")
536568 }
537569
540572 @Callable(i)
541573 func claimWx (lpAssetIdStr) = {
542574 let userAddressStr = toString(i.caller)
543- let result = invoke(this, "claimWxINTERNAL", [lpAssetIdStr, userAddressStr], nil)
575+ let throwIfNothingToClaim = true
576+ let result = invoke(this, "claimWxINTERNAL", [lpAssetIdStr, userAddressStr, throwIfNothingToClaim], nil)
544577 $Tuple2(nil, result)
545578 }
546579
547580
548581
549582 @Callable(i)
550-func claimWxINTERNAL (lpAssetIdStr,userAddressStr) = {
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) = {
551594 let checkCaller = mustThis(i)
552595 if ((checkCaller == checkCaller))
553596 then {
561604 let claimedByUserMinReward = getBigIntFromStringOrZero(this, claimedByUserMinRewardKEY)
562605 let claimedByUserBoostReward = getBigIntFromStringOrZero(this, claimedByUserBoostRewardKEY)
563606 let claimedTotal = getBigIntFromStringOrZero(this, claimedTotalKEY)
564- let $t02281422926 = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, 0)
565- let wxToClaimUserNew = $t02281422926._1
566- let integralSTATE = $t02281422926._2
567- let debug = $t02281422926._3
568- let availableToClaim = max([(wxToClaimUserNew - claimedByUserMinReward), zeroBigInt])
607+ let $t02464924761 = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, 0)
608+ let wxToClaimUserNew = $t02464924761._1
609+ let integralSTATE = $t02464924761._2
610+ let debug = $t02464924761._3
611+ let availableToClaim = max([(wxToClaimUserNew - claimedByUser), zeroBigInt])
569612 if ((zeroBigInt >= availableToClaim))
570- then throw("nothing to claim")
613+ then if (throwIfNothingToClaim)
614+ then throw("nothing to claim")
615+ else $Tuple2(nil, 0)
571616 else {
572617 let wxAmountBoostTotal = max([asInt(asAnyList(invoke(boostingContract, "claimWxBoost", [lpAssetIdStr, userAddressStr], nil))[0]), 0])
573618 let minRewardPart = availableToClaim
574619 let boostRewardPart = min([(minRewardPart * toBigInt(2)), toBigInt(wxAmountBoostTotal)])
620+ let totalReward = (minRewardPart + boostRewardPart)
575621 let wxAssetId = asByteVector(asAnyList(invoke(emissionContract, "emit", [toInt(minRewardPart)], nil))[0])
576622 let emitBoost = asAnyList(invoke(emissionContract, "emit", [toInt(boostRewardPart)], nil))
577623 if ((emitBoost == emitBoost))
578624 then {
579- let claimedByUserValue = ((claimedByUser + minRewardPart) + boostRewardPart)
625+ let claimedByUserValue = (claimedByUser + availableToClaim)
580626 let claimedByUserMinRewardPlusPart = (claimedByUserMinReward + minRewardPart)
581- let claimedByUserBoostRewardPlusBoostRewardPart = (claimedByUserBoostReward + boostRewardPart)
582- let claimedTotalPlusAvailableToClaim = (claimedTotal + availableToClaim)
583-[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)]
627+ let claimedByUserBoostRewardPlusBoostRewardPart = (claimedByUserMinReward + minRewardPart)
628+ let claimedTotalPlusAvailableToClaim = (claimedByUserMinReward + minRewardPart)
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))
584630 }
585631 else throw("Strict value is not equal to itself.")
586632 }
630676 let stakedByUserKEY = keyStakedByUser(userAddressStr, lpAssetIdStr)
631677 let stakedTotalKEY = keyStakedTotal(lpAssetIdStr)
632678 let claimedByUserKEY = keyClaimedByUser(lpAssetIdStr, userAddressStr)
633- let claimedByUserMinRewardKEY = keyClaimedByUserMinReward(lpAssetIdStr, userAddressStr)
634679 let stakedByUser = readStaked(stakedByUserKEY)
635680 let stakedTotal = readStaked(stakedTotalKEY)
636681 let claimedByUser = getBigIntFromStringOrZero(this, claimedByUserKEY)
637- let claimedByUserMinReward = getBigIntFromStringOrZero(this, claimedByUserMinRewardKEY)
638682 let poolAddressStr = getStringByAddressOrFail(factoryContract, keyFactoryLpAssetToPoolContractAddress(lpAssetIdStr))
639683 let poolWeight = getIntegerValue(factoryContract, keyFactoryPoolWeight(poolAddressStr))
640684 let wxEmissionPerBlock = getIntOrFail(emissionContract, keyEmissionRatePerBlockCurrent())
644688 else (height - emissionStartBlock)
645689 let poolWxEmission = fraction((wxEmissionPerBlock * passedBlocks), poolWeight, POOLWEIGHTMULT)
646690 let userWxReward = fraction(poolWxEmission, stakedByUser, stakedTotal)
647- let $t02658426696 = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, 0)
648- let wxToClaimUserNew = $t02658426696._1
649- let integralSTATE = $t02658426696._2
650- let debug = $t02658426696._3
651- let availableToClaim = max([(wxToClaimUserNew - claimedByUserMinReward), zeroBigInt])
691+ let $t02837028482 = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, 0)
692+ let wxToClaimUserNew = $t02837028482._1
693+ let integralSTATE = $t02837028482._2
694+ let debug = $t02837028482._3
695+ let availableToClaim = max([(wxToClaimUserNew - claimedByUser), zeroBigInt])
652696 let boostInvResult = asAnyList(invoke(boostingContract, "claimWxBoostREADONLY", [lpAssetIdStr, userAddressStr], nil))
653697 let wxAmountBoostTotal = max([asInt(boostInvResult[0]), 0])
654698 let boostDebug = asString(boostInvResult[1])
656700 let boostRewardPart = min([(minRewardPart * toBigInt(2)), toBigInt(wxAmountBoostTotal)])
657701 let totalReward = (minRewardPart + boostRewardPart)
658702 $Tuple2(nil, makeString(["%s%s%d%d%d%d%s", lpAssetIdStr, userAddressStr, toString(totalReward), toString(claimedByUser), toString(minRewardPart), toString(boostRewardPart), "soon"], SEP))
703+ }
704+
705+
706+
707+@Callable(i)
708+func stakedByUserREADONLY (lpAssetIdStr,userAddressStr) = {
709+ let stakedByUser = valueOrElse(getInteger(keyStakedByUser(userAddressStr, lpAssetIdStr)), 0)
710+ $Tuple2(nil, stakedByUser)
659711 }
660712
661713
681733 throw("Match error")
682734 }
683735 case userAddress: String =>
684- let claimedByUserMinReward = getBigIntFromStringOrZero(this, keyClaimedByUserMinReward(lpAssetId, userAddress))
736+ let claimedByUser = getBigIntFromStringOrZero(this, keyClaimedByUser(lpAssetId, userAddress))
685737 let poolAddress = getStringByAddressOrFail(factoryContract, keyFactoryLpAssetToPoolContractAddress(lpAssetId))
686738 let wxToClaimUserNew = refreshINTEGRALS(lpAssetId, userAddress, poolAddress, 0)._1
687- let availableToClaim = (wxToClaimUserNew - claimedByUserMinReward)
739+ let availableToClaim = (wxToClaimUserNew - claimedByUser)
740+ let throwIfNothingToClaim = true
688741 let r = if ((availableToClaim > zeroBigInt))
689- then invoke(this, "claimWxINTERNAL", [lpAssetId, userAddress], nil)
742+ then invoke(this, "claimWxINTERNAL", [lpAssetId, userAddress, throwIfNothingToClaim], nil)
690743 else unit
691744 if ((r == r))
692745 then {
714767 func onModifyWeight (lpAssetIdStr,poolAddressStr) = if ((i.caller != factoryContract))
715768 then throw("permissions denied")
716769 else {
717- let $t02903229142 = refreshPoolINTEGRALS(lpAssetIdStr, poolAddressStr, 0)
718- let wxPerLpIntegralNew = $t02903229142._1
719- let poolIntegralSTATE = $t02903229142._2
720- let poolDEBUG = $t02903229142._3
770+ let $t03105231162 = refreshPoolINTEGRALS(lpAssetIdStr, poolAddressStr, 0)
771+ let wxPerLpIntegralNew = $t03105231162._1
772+ let poolIntegralSTATE = $t03105231162._2
773+ let poolDEBUG = $t03105231162._3
721774 poolIntegralSTATE
722775 }
723776
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let SCALE8 = 8
55
66 let MULT8 = 100000000
77
88 let SCALE18 = 18
99
1010 let MULT18 = toBigInt(1000000000000000000)
1111
1212 let SEP = "__"
1313
1414 let POOLWEIGHTMULT = MULT8
1515
1616 let zeroBigInt = toBigInt(0)
1717
1818 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+
1925
2026 func asAnyList (val) = match val {
2127 case valAnyLyst: List[Any] =>
2228 valAnyLyst
2329 case _ =>
2430 throw("fail to cast into List[Any]")
2531 }
2632
2733
2834 func asInt (val) = match val {
2935 case valInt: Int =>
3036 valInt
3137 case _ =>
3238 throw("fail to cast into Int")
3339 }
3440
3541
3642 func asString (val) = match val {
3743 case valStr: String =>
3844 valStr
3945 case _ =>
4046 throw("fail to cast into Int")
4147 }
4248
4349
4450 func asByteVector (val) = match val {
4551 case valBin: ByteVector =>
4652 valBin
4753 case _ =>
4854 throw("fail to cast into Int")
4955 }
5056
5157
5258 func getStringOrFail (address,key) = valueOrErrorMessage(getString(address, key), (("mandatory this." + key) + " is not defined"))
5359
5460
5561 func getStringByAddressOrFail (address,key) = valueOrErrorMessage(getString(address, key), (((("mandatory " + toString(address)) + ".") + key) + " is not defined"))
5662
5763
5864 func getIntOrZero (address,key) = valueOrElse(getInteger(address, key), 0)
5965
6066
6167 func getIntOrDefault (address,key,defaultVal) = valueOrElse(getInteger(address, key), defaultVal)
6268
6369
6470 func getIntOrFail (address,key) = valueOrErrorMessage(getInteger(address, key), (("mandatory this." + key) + " is not defined"))
6571
6672
6773 func getBigIntFromStringOrZero (address,key) = value(parseBigInt(valueOrElse(getString(address, key), "0")))
6874
6975
7076 func getBigIntFromStringOrDefault (address,key,defaultVal) = match getString(address, key) {
7177 case s: String =>
7278 value(parseBigInt(s))
7379 case _: Unit =>
7480 defaultVal
7581 case _ =>
7682 throw("Match error")
7783 }
7884
7985
8086 func toX18 (origVal,origScaleMult) = fraction(toBigInt(origVal), MULT18, toBigInt(origScaleMult))
8187
8288
8389 func fromX18 (val,resultScaleMult) = toInt(fraction(val, toBigInt(resultScaleMult), MULT18))
8490
8591
8692 func keyFactoryAddress () = "%s%s__config__factoryAddress"
8793
8894
8995 func keyVotingEmissionContract () = "%s__votingEmissionContract"
9096
9197
9298 let IdxFactoryCfgStakingDapp = 1
9399
94100 let IdxFactoryCfgBoostingDapp = 2
95101
96102 let IdxFactoryCfgIdoDapp = 3
97103
98104 let IdxFactoryCfgTeamDapp = 4
99105
100106 let IdxFactoryCfgEmissionDapp = 5
101107
102108 let IdxFactoryCfgRestDapp = 6
103109
104110 let IdxFactoryCfgSlippageDapp = 7
105111
106112 func keyFactoryCfg () = "%s__factoryConfig"
107113
108114
109115 func keyManagerPublicKey () = "%s__managerPublicKey"
110116
111117
112118 func keyPendingManagerPublicKey () = "%s__pendingManagerPublicKey"
113119
114120
115121 func keyStablePoolAddonAddr () = "%s__stablePoolAddonAddr"
116122
117123
118124 func keyAddonAddr () = "%s__addonAddr"
119125
120126
121127 func keyFactoryLp2AssetsMapping (lpAssetStr) = makeString(["%s%s%s", lpAssetStr, "mappings__lpAsset2PoolContract"], SEP)
122128
123129
124130 func keyFactoryLpList () = "%s__lpTokensList"
125131
126132
127133 func keyFactoryLpAssetToPoolContractAddress (lpAssetStr) = makeString(["%s%s%s", lpAssetStr, "mappings__lpAsset2PoolContract"], SEP)
128134
129135
130136 func keyFactoryPoolWeight (contractAddress) = makeString(["%s%s", "poolWeight", contractAddress], SEP)
131137
132138
133139 func readLpList (factory) = split(valueOrElse(getString(factory, keyFactoryLpList()), ""), SEP)
134140
135141
136142 func readFactoryCfgOrFail (factory) = split(getStringByAddressOrFail(factory, keyFactoryCfg()), SEP)
137143
138144
139145 func getBoostingAddressOrFail (factoryCfg) = addressFromStringValue(factoryCfg[IdxFactoryCfgBoostingDapp])
140146
141147
142148 func getEmissionAddressOrFail (factoryCfg) = addressFromStringValue(factoryCfg[IdxFactoryCfgEmissionDapp])
143149
144150
145151 func getStakingAddressOrFail (factoryCfg) = addressFromStringValue(factoryCfg[IdxFactoryCfgStakingDapp])
146152
147153
148154 func keyEmissionRatePerBlockCurrent () = "%s%s__ratePerBlock__current"
149155
150156
151157 func keyEmissionRatePerBlockMaxCurrent () = "%s%s__ratePerBlockMax__current"
152158
153159
154160 func keyEmissionStartBlock () = "%s%s__emission__startBlock"
155161
156162
157163 func keyEmissionDurationInBlocks () = "%s%s__emission__duration"
158164
159165
160166 func keyEmissionEndBlock () = "%s%s__emission__endBlock"
161167
162168
163169 func keyStakedByUser (userAddressStr,lpAssetIdStr) = makeString(["%s%s%s__staked", userAddressStr, lpAssetIdStr], SEP)
164170
165171
166172 func keyStakedTotal (lpAssetIdStr) = ("%s%s%s__staked__total__" + lpAssetIdStr)
167173
168174
169175 func keyClaimedByUser (lpAssetIdStr,userAddressStr) = makeString(["%s%s%s__claimed", userAddressStr, lpAssetIdStr], SEP)
170176
171177
172178 func keyClaimedByUserMinReward (lpAssetIdStr,userAddressStr) = makeString(["%s%s%s__claimedMinReward", userAddressStr, lpAssetIdStr], SEP)
173179
174180
175181 func keyClaimedByUserBoostReward (lpAssetIdStr,userAddressStr) = makeString(["%s%s%s__claimedBoostReward", userAddressStr, lpAssetIdStr], SEP)
176182
177183
178184 func keyClaimedTotal (lpAssetIdStr) = makeString(["%s%s%s__claimed__total", lpAssetIdStr], SEP)
179185
180186
181187 func readStaked (key) = valueOrElse(getInteger(this, key), 0)
182188
183189
184190 func keyLastTotalLpBalance (lpAssetId) = makeString(["%s%s%s", lpAssetId, "total", "bal"], SEP)
185191
186192
187193 func keyLastUserLpBalance (lpAssetId,userAddress) = makeString(["%s%s%s", lpAssetId, userAddress, "bal"], SEP)
188194
189195
190196 func keyTotalLpBalanceIntegral (lpAssetId) = makeString(["%s%s%s", lpAssetId, "total", "balINT"], SEP)
191197
192198
193199 func keyUserLpBalanceIntegral (lpAssetId,userAddress) = makeString(["%s%s%s", lpAssetId, userAddress, "balINT"], SEP)
194200
195201
196202 func keyTotalLpBalanceIntegralLastUpdHeight (lpAssetId) = makeString(["%s%s%s", lpAssetId, "total", "lastUpd"], SEP)
197203
198204
199205 func keyUserLpBalanceIntegralLastUpdHeight (lpAssetId,userAddress) = makeString(["%s%s%s", lpAssetId, userAddress, "lastUpd"], SEP)
200206
201207
202208 func keyWxPerLpIntegral (lpAssetId) = makeString(["%s%s%s%s", lpAssetId, "common", "lpInt"], SEP)
203209
204210
205211 func keyWxPerLpIntegralLastUpdHeight (lpAssetId) = makeString(["%s%s%s%s", lpAssetId, "common", "lpIntH"], SEP)
206212
207213
208214 func keyWxToClaimUser (lpAssetId,userAddress) = makeString(["%s%s%s%s", lpAssetId, userAddress, "lpInt"], SEP)
209215
210216
211217 func keyWxPerLpIntegralUserLastUpdHeight (lpAssetId,userAddress) = makeString(["%s%s%s%s", lpAssetId, userAddress, "lpIntH"], SEP)
212218
213219
214220 func keyWxPerLp (lpAssetId) = makeString(["%s", lpAssetId, "wxPerLp"], SEP)
215221
216222
217223 func keyWxPerLpX18 (lpAssetId) = makeString(["%s", lpAssetId, "wxPerLpX18"], SEP)
218224
219225
220226 func keyWxPerLpIntegralUserLast (lpAssetId,userAddress) = makeString(["%s%s%s%s", lpAssetId, userAddress, "uIntL"], SEP)
221227
222228
223229 func keyOperationHistoryRecord (type,userAddress,txId58) = makeString(["%s%s%s%s__history", type, userAddress, txId58], SEP)
224230
225231
226232 func formatHistoryRecord (userAddress,lpAssetId,type,amount) = makeString(["%s%s%s%d%d%d", userAddress, lpAssetId, type, toString(height), toString(lastBlock.timestamp), toString(amount)], SEP)
227233
228234
229235 func OperationHistoryEntry (type,userAddress,lpAssetId,amount,txId) = StringEntry(keyOperationHistoryRecord(type, userAddress, toBase58String(txId)), formatHistoryRecord(userAddress, lpAssetId, type, amount))
230236
231237
232238 let factoryAddress = getStringOrFail(this, keyFactoryAddress())
233239
234240 let factoryContract = addressFromStringValue(factoryAddress)
235241
236242 let factoryCfg = readFactoryCfgOrFail(factoryContract)
237243
238244 let emissionContract = getEmissionAddressOrFail(factoryCfg)
239245
240246 let boostingContract = getBoostingAddressOrFail(factoryCfg)
241247
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"))
249+
242250 func keyNextUser (lpAssetId) = makeString(["%s%s", lpAssetId, "nextUser"], SEP)
243251
244252
245253 func getUsersListName (lpAssetId) = makeString(["users", lpAssetId], SEP)
246254
247255
248256 func keyListHead (listName) = makeString(["%s%s%s", listName, "head"], SEP)
249257
250258
251259 func keyListSize (listName) = makeString(["%s%s%s", listName, "size"], SEP)
252260
253261
254262 func keyListPrev (listName,id) = makeString(["%s%s%s%s", listName, id, "prev"], SEP)
255263
256264
257265 func keyListNext (listName,id) = makeString(["%s%s%s%s", listName, id, "next"], SEP)
258266
259267
260268 func containsNode (listName,id) = {
261269 let headOrUnit = getString(this, keyListHead(listName))
262270 let prevOrUnit = getString(this, keyListPrev(listName, id))
263271 let nextOrUnit = getString(this, keyListNext(listName, id))
264272 if (if ((id == valueOrElse(headOrUnit, "")))
265273 then true
266274 else (prevOrUnit != unit))
267275 then true
268276 else (nextOrUnit != unit)
269277 }
270278
271279
272280 func insertNodeActions (listName,id) = {
273281 let headOrUnit = getString(this, keyListHead(listName))
274282 let listSize = valueOrElse(getInteger(this, keyListSize(listName)), 0)
275283 let checkNode = if (!(containsNode(listName, id)))
276284 then true
277285 else throw("Node exists")
278286 if ((checkNode == checkNode))
279287 then (([IntegerEntry(keyListSize(listName), (listSize + 1))] ++ (if ((headOrUnit != unit))
280288 then [StringEntry(keyListNext(listName, id), value(headOrUnit)), StringEntry(keyListPrev(listName, value(headOrUnit)), id)]
281289 else nil)) ++ [StringEntry(keyListHead(listName), id)])
282290 else throw("Strict value is not equal to itself.")
283291 }
284292
285293
286294 func deleteNodeActions (listName,id) = {
287295 let headOrUnit = getString(this, keyListHead(listName))
288296 let listSize = valueOrElse(getInteger(this, keyListSize(listName)), 0)
289297 let prevOrUnit = getString(this, keyListPrev(listName, id))
290298 let nextOrUnit = getString(this, keyListNext(listName, id))
291299 ([IntegerEntry(keyListSize(listName), (listSize - 1))] ++ (if (if ((prevOrUnit != unit))
292300 then (nextOrUnit != unit)
293301 else false)
294302 then [StringEntry(keyListNext(listName, value(prevOrUnit)), value(nextOrUnit)), StringEntry(keyListPrev(listName, value(nextOrUnit)), value(prevOrUnit)), DeleteEntry(keyListPrev(listName, id)), DeleteEntry(keyListNext(listName, id))]
295303 else if ((nextOrUnit != unit))
296304 then [StringEntry(keyListHead(listName), value(nextOrUnit)), DeleteEntry(keyListNext(listName, id)), DeleteEntry(keyListPrev(listName, value(nextOrUnit)))]
297305 else if ((prevOrUnit != unit))
298306 then [DeleteEntry(keyListPrev(listName, id)), DeleteEntry(keyListNext(listName, value(prevOrUnit)))]
299307 else if ((id == valueOrElse(headOrUnit, "")))
300308 then [DeleteEntry(keyListHead(listName))]
301309 else throw(((("invalid node: " + listName) + ".") + id))))
302310 }
303311
304312
305313 func calcWxPerLpIntegralUserLast (stakedByUser,wxPerLpIntegralUserLastUpdHeightOrZero,wxPerLpIntegralNew,wxPerLpIntegralUserLastKEY) = if (if ((wxPerLpIntegralUserLastUpdHeightOrZero == zeroBigInt))
306314 then (stakedByUser > zeroBigInt)
307315 else false)
308316 then zeroBigInt
309317 else if ((stakedByUser == zeroBigInt))
310318 then wxPerLpIntegralNew
311319 else if (if ((wxPerLpIntegralUserLastUpdHeightOrZero > zeroBigInt))
312320 then (stakedByUser > zeroBigInt)
313321 else false)
314322 then value(parseBigInt(getStringOrFail(this, wxPerLpIntegralUserLastKEY)))
315323 else throw("calcWxPerLpIntegralUserLast: unexpected state")
316324
317325
318326 func refreshPoolINTEGRALS (lpAssetIdStr,poolAddressStr,lpDeltaAmount) = {
319327 let stakedTotalKEY = keyStakedTotal(lpAssetIdStr)
320328 let stakedTotal = toBigInt(readStaked(stakedTotalKEY))
321329 let nonZeroStakedTotal = if ((stakedTotal == zeroBigInt))
322330 then oneBigInt
323331 else stakedTotal
324332 let poolWeight = getIntegerValue(factoryContract, keyFactoryPoolWeight(poolAddressStr))
325333 let emissionStartBlock = getIntOrFail(emissionContract, keyEmissionStartBlock())
326334 let MULT3 = 1000
327335 let wxEmissionPerBlockX3 = (getIntOrFail(emissionContract, keyEmissionRatePerBlockCurrent()) * MULT3)
328336 let poolWxEmissionPerBlockX3 = fraction(wxEmissionPerBlockX3, poolWeight, (POOLWEIGHTMULT * 3))
329337 let wxPerLpIntegralKEY = keyWxPerLpIntegral(lpAssetIdStr)
330338 let wxPerLpIntegralLastUpdHeightKEY = keyWxPerLpIntegralLastUpdHeight(lpAssetIdStr)
331339 let wxPerLpKEY = keyWxPerLp(lpAssetIdStr)
332340 let wxPerLpIntegralLastUpdHeight = getIntOrDefault(this, wxPerLpIntegralLastUpdHeightKEY, emissionStartBlock)
333341 let wxPerLpIntegral = getBigIntFromStringOrZero(this, wxPerLpIntegralKEY)
334342 let wxPerLpOrZeroX3 = 0
335343 let dh = max([(height - wxPerLpIntegralLastUpdHeight), 0])
336344 let wxPerLpX3 = if ((wxPerLpOrZeroX3 != 0))
337345 then toBigInt(wxPerLpOrZeroX3)
338346 else fraction(toBigInt(poolWxEmissionPerBlockX3), toBigInt(MULT8), nonZeroStakedTotal)
339347 let stakedTotalNew = (stakedTotal + toBigInt(lpDeltaAmount))
340348 let nonZeroStakedTotalNew = if ((stakedTotalNew == zeroBigInt))
341349 then oneBigInt
342350 else stakedTotalNew
343351 let wxPerLpIntegralNew = (wxPerLpIntegral + (wxPerLpX3 * toBigInt(dh)))
344352 let wxPerLpX3New = (toBigInt(poolWxEmissionPerBlockX3) / nonZeroStakedTotalNew)
345353 let wxPerLpIntegralLastUpdHeightNew = height
346354 let debug = makeString([toString(wxPerLpIntegralNew), toString(dh), toString(wxPerLpX3), toString(stakedTotal), toString(poolWxEmissionPerBlockX3), toString(wxEmissionPerBlockX3), toString(poolWeight)], "::")
347355 $Tuple3(wxPerLpIntegralNew, [StringEntry(wxPerLpIntegralKEY, toString(wxPerLpIntegralNew)), IntegerEntry(wxPerLpIntegralLastUpdHeightKEY, wxPerLpIntegralLastUpdHeightNew), StringEntry(wxPerLpKEY, toString(wxPerLpX3New))], debug)
348356 }
349357
350358
351359 func refreshINTEGRALS (lpAssetIdStr,userAddressStr,poolAddressStr,lpDeltaAmount) = {
352- let $t01427414396 = refreshPoolINTEGRALS(lpAssetIdStr, poolAddressStr, lpDeltaAmount)
353- let wxPerLpIntegralNew = $t01427414396._1
354- let poolIntegralSTATE = $t01427414396._2
355- let poolDEBUG = $t01427414396._3
360+ let $t01475014872 = refreshPoolINTEGRALS(lpAssetIdStr, poolAddressStr, lpDeltaAmount)
361+ let wxPerLpIntegralNew = $t01475014872._1
362+ let poolIntegralSTATE = $t01475014872._2
363+ let poolDEBUG = $t01475014872._3
356364 let MULT3 = 1000
357365 let stakedByUserKEY = keyStakedByUser(userAddressStr, lpAssetIdStr)
358366 let stakedByUser = readStaked(stakedByUserKEY)
359367 let wxToClaimUserKEY = keyWxToClaimUser(lpAssetIdStr, userAddressStr)
360368 let wxPerLpIntegralUserLastUpdHeightKEY = keyWxPerLpIntegralUserLastUpdHeight(lpAssetIdStr, userAddressStr)
361369 let wxPerLpIntegralUserLastKEY = keyWxPerLpIntegralUserLast(lpAssetIdStr, userAddressStr)
362370 let wxToClaimUser = getBigIntFromStringOrZero(this, wxToClaimUserKEY)
363371 let wxPerLpIntegralUserLastUpdHeightOrZero = getIntOrZero(this, wxPerLpIntegralUserLastUpdHeightKEY)
364372 let wxPerLpIntegralUserLast = calcWxPerLpIntegralUserLast(toBigInt(stakedByUser), toBigInt(wxPerLpIntegralUserLastUpdHeightOrZero), wxPerLpIntegralNew, wxPerLpIntegralUserLastKEY)
365373 let MULT11 = (MULT8 * MULT3)
366374 let wxToClaimUserNew = max([(wxToClaimUser + fraction((wxPerLpIntegralNew - wxPerLpIntegralUserLast), toBigInt(stakedByUser), toBigInt(MULT11))), zeroBigInt])
367375 let wxPerLpIntegralUserLastNew = wxPerLpIntegralNew
368376 let wxPerLpIntegralUserLastUpdHeightNew = height
369377 let debug = makeString([toString(wxToClaimUser), toString(wxPerLpIntegralUserLast), toString(stakedByUser), poolDEBUG, toString(height)], "::")
370378 $Tuple3(wxToClaimUserNew, (poolIntegralSTATE ++ [StringEntry(wxToClaimUserKEY, toString(wxToClaimUserNew)), IntegerEntry(wxPerLpIntegralUserLastUpdHeightKEY, wxPerLpIntegralUserLastUpdHeightNew), StringEntry(wxPerLpIntegralUserLastKEY, toString(wxPerLpIntegralUserLastNew))]), debug)
371379 }
372380
373381
374382 func managerPublicKeyOrUnit () = match getString(keyManagerPublicKey()) {
375383 case s: String =>
376384 fromBase58String(s)
377385 case _: Unit =>
378386 unit
379387 case _ =>
380388 throw("Match error")
381389 }
382390
383391
384392 func pendingManagerPublicKeyOrUnit () = match getString(keyPendingManagerPublicKey()) {
385393 case s: String =>
386394 fromBase58String(s)
387395 case _: Unit =>
388396 unit
389397 case _ =>
390398 throw("Match error")
391399 }
392400
393401
394402 let permissionDeniedError = throw("Permission denied")
395403
396404 func mustThis (i) = if ((i.caller == this))
397405 then true
398406 else permissionDeniedError
399407
400408
401409 func mustManager (i) = match managerPublicKeyOrUnit() {
402410 case pk: ByteVector =>
403411 if ((i.callerPublicKey == pk))
404412 then true
405413 else permissionDeniedError
406414 case _: Unit =>
407415 if ((i.caller == this))
408416 then true
409417 else permissionDeniedError
410418 case _ =>
411419 throw("Match error")
412420 }
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 claimedByUser = getBigIntFromStringOrZero(this, keyClaimedByUser(lpAssetIdStr, userAddressStr))
439+ let wxToClaimUserNew = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, 0)._1
440+ let availableToClaim = (wxToClaimUserNew - claimedByUser)
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+ }
413451
414452
415453 @Callable(i)
416454 func constructor (factoryAddressStr) = {
417455 let checkCaller = mustManager(i)
418456 if ((checkCaller == checkCaller))
419457 then [StringEntry(keyFactoryAddress(), factoryAddressStr)]
420458 else throw("Strict value is not equal to itself.")
421459 }
422460
423461
424462
425463 @Callable(i)
426464 func constructorV2 (votingEmissionContract) = {
427465 let cheks = [mustManager(i), if ((addressFromString(votingEmissionContract) != unit))
428466 then true
429467 else "invalid voting emission contract address"]
430468 if ((cheks == cheks))
431469 then [StringEntry(keyVotingEmissionContract(), votingEmissionContract)]
432470 else throw("Strict value is not equal to itself.")
433471 }
434472
435473
436474
437475 @Callable(i)
438476 func setManager (pendingManagerPublicKey) = {
439477 let checkCaller = mustManager(i)
440478 if ((checkCaller == checkCaller))
441479 then {
442480 let checkManagerPublicKey = fromBase58String(pendingManagerPublicKey)
443481 if ((checkManagerPublicKey == checkManagerPublicKey))
444482 then [StringEntry(keyPendingManagerPublicKey(), pendingManagerPublicKey)]
445483 else throw("Strict value is not equal to itself.")
446484 }
447485 else throw("Strict value is not equal to itself.")
448486 }
449487
450488
451489
452490 @Callable(i)
453491 func confirmManager () = {
454492 let pm = pendingManagerPublicKeyOrUnit()
455493 let hasPM = if (isDefined(pm))
456494 then true
457495 else throw("No pending manager")
458496 if ((hasPM == hasPM))
459497 then {
460498 let checkPM = if ((i.callerPublicKey == value(pm)))
461499 then true
462500 else throw("You are not pending manager")
463501 if ((checkPM == checkPM))
464502 then [StringEntry(keyManagerPublicKey(), toBase58String(value(pm))), DeleteEntry(keyPendingManagerPublicKey())]
465503 else throw("Strict value is not equal to itself.")
466504 }
467505 else throw("Strict value is not equal to itself.")
468506 }
469507
470508
471509
472510 @Callable(i)
473511 func stake () = if ((size(i.payments) != 1))
474512 then throw("invalid payment - exact one payment must be attached")
475513 else {
476514 let pmt = i.payments[0]
477515 let lpAssetId = value(pmt.assetId)
478516 let lpAssetIdStr = toBase58String(lpAssetId)
479517 let amount = pmt.amount
480518 let poolAddressStr = valueOrErrorMessage(getString(factoryContract, keyFactoryLp2AssetsMapping(lpAssetIdStr)), ("unsupported lp asset " + lpAssetIdStr))
481519 let callerStr = toString(i.caller)
482520 let userAddressStr = if ((callerStr == poolAddressStr))
483521 then toString(i.originCaller)
484522 else callerStr
485523 let stakedByUserKEY = keyStakedByUser(userAddressStr, lpAssetIdStr)
486524 let stakedTotalKEY = keyStakedTotal(lpAssetIdStr)
487525 let stakedByUser = readStaked(stakedByUserKEY)
488526 let stakedTotal = readStaked(stakedTotalKEY)
489- let $t01883218949 = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, amount)
490- let wxToClaimUserNew = $t01883218949._1
491- let integralSTATE = $t01883218949._2
492- let debug = $t01883218949._3
527+ let $t02114621263 = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, amount)
528+ let wxToClaimUserNew = $t02114621263._1
529+ let integralSTATE = $t02114621263._2
530+ let debug = $t02114621263._3
493531 let listName = getUsersListName(lpAssetIdStr)
494532 let listActions = if (containsNode(listName, userAddressStr))
495533 then nil
496534 else insertNodeActions(listName, userAddressStr)
497535 (([IntegerEntry(stakedByUserKEY, (stakedByUser + amount)), IntegerEntry(stakedTotalKEY, (stakedTotal + amount)), OperationHistoryEntry("stake", userAddressStr, lpAssetIdStr, amount, i.transactionId)] ++ integralSTATE) ++ listActions)
498536 }
499537
500538
501539
502540 @Callable(i)
503541 func unstake (lpAssetIdStr,amount) = {
504542 let lpAssetId = fromBase58String(lpAssetIdStr)
505543 let poolAddressStr = valueOrErrorMessage(getString(factoryContract, keyFactoryLp2AssetsMapping(lpAssetIdStr)), ("unsupported lp asset " + lpAssetIdStr))
506- let poolAddon = valueOrElse(getString(addressFromStringValue(poolAddressStr), keyAddonAddr()), poolAddressStr)
544+ let poolAddress = addressFromStringValue(poolAddressStr)
545+ let poolAddon = valueOrElse(getString(poolAddress, keyAddonAddr()), poolAddressStr)
507546 let callerStr = toString(i.caller)
508- let userAddressStr = if (if ((callerStr == poolAddressStr))
547+ let userAddress = if (if ((callerStr == poolAddressStr))
509548 then true
510549 else (callerStr == poolAddon))
511- then toString(i.originCaller)
512- else callerStr
513- let stakedByUserKEY = keyStakedByUser(userAddressStr, lpAssetIdStr)
514- let stakedTotalKEY = keyStakedTotal(lpAssetIdStr)
515- let stakedByUser = readStaked(stakedByUserKEY)
516- let stakedTotal = readStaked(stakedTotalKEY)
517- let integralSTATE = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, -(amount))._2
518- let listName = getUsersListName(lpAssetIdStr)
519- let listActions = if (if (containsNode(listName, userAddressStr))
520- then (amount == stakedByUser)
521- else false)
522- then deleteNodeActions(listName, userAddressStr)
523- else nil
524- let claimedByUserMinReward = getBigIntFromStringOrZero(this, keyClaimedByUserMinReward(lpAssetIdStr, userAddressStr))
525- let poolAddress = getStringByAddressOrFail(factoryContract, keyFactoryLpAssetToPoolContractAddress(lpAssetIdStr))
526- let wxToClaimUserNew = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddress, 0)._1
527- let availableToClaim = (wxToClaimUserNew - claimedByUserMinReward)
528- let r = if ((availableToClaim > zeroBigInt))
529- then invoke(this, "claimWxINTERNAL", [lpAssetIdStr, userAddressStr], nil)
530- else unit
531- if ((r == r))
532- then if ((amount > stakedByUser))
533- then throw(((((((("passed amount=" + toString(amount)) + " is greater than available=") + toString(stakedByUser)) + ". lpAssetId=") + lpAssetIdStr) + ". stakedByUserKEY=") + stakedByUserKEY))
534- else (([IntegerEntry(stakedByUserKEY, (stakedByUser - amount)), IntegerEntry(stakedTotalKEY, (stakedTotal - amount)), ScriptTransfer(i.caller, amount, lpAssetId), OperationHistoryEntry("unstake", userAddressStr, lpAssetIdStr, amount, i.transactionId)] ++ integralSTATE) ++ listActions)
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)
535567 else throw("Strict value is not equal to itself.")
536568 }
537569
538570
539571
540572 @Callable(i)
541573 func claimWx (lpAssetIdStr) = {
542574 let userAddressStr = toString(i.caller)
543- let result = invoke(this, "claimWxINTERNAL", [lpAssetIdStr, userAddressStr], nil)
575+ let throwIfNothingToClaim = true
576+ let result = invoke(this, "claimWxINTERNAL", [lpAssetIdStr, userAddressStr, throwIfNothingToClaim], nil)
544577 $Tuple2(nil, result)
545578 }
546579
547580
548581
549582 @Callable(i)
550-func claimWxINTERNAL (lpAssetIdStr,userAddressStr) = {
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) = {
551594 let checkCaller = mustThis(i)
552595 if ((checkCaller == checkCaller))
553596 then {
554597 let userAddress = valueOrErrorMessage(addressFromString(userAddressStr), "claimWxINTERNAL: invalid user address")
555598 let poolAddressStr = getStringByAddressOrFail(factoryContract, keyFactoryLpAssetToPoolContractAddress(lpAssetIdStr))
556599 let claimedByUserKEY = keyClaimedByUser(lpAssetIdStr, userAddressStr)
557600 let claimedTotalKEY = keyClaimedTotal(lpAssetIdStr)
558601 let claimedByUserMinRewardKEY = keyClaimedByUserMinReward(lpAssetIdStr, userAddressStr)
559602 let claimedByUserBoostRewardKEY = keyClaimedByUserBoostReward(lpAssetIdStr, userAddressStr)
560603 let claimedByUser = getBigIntFromStringOrZero(this, claimedByUserKEY)
561604 let claimedByUserMinReward = getBigIntFromStringOrZero(this, claimedByUserMinRewardKEY)
562605 let claimedByUserBoostReward = getBigIntFromStringOrZero(this, claimedByUserBoostRewardKEY)
563606 let claimedTotal = getBigIntFromStringOrZero(this, claimedTotalKEY)
564- let $t02281422926 = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, 0)
565- let wxToClaimUserNew = $t02281422926._1
566- let integralSTATE = $t02281422926._2
567- let debug = $t02281422926._3
568- let availableToClaim = max([(wxToClaimUserNew - claimedByUserMinReward), zeroBigInt])
607+ let $t02464924761 = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, 0)
608+ let wxToClaimUserNew = $t02464924761._1
609+ let integralSTATE = $t02464924761._2
610+ let debug = $t02464924761._3
611+ let availableToClaim = max([(wxToClaimUserNew - claimedByUser), zeroBigInt])
569612 if ((zeroBigInt >= availableToClaim))
570- then throw("nothing to claim")
613+ then if (throwIfNothingToClaim)
614+ then throw("nothing to claim")
615+ else $Tuple2(nil, 0)
571616 else {
572617 let wxAmountBoostTotal = max([asInt(asAnyList(invoke(boostingContract, "claimWxBoost", [lpAssetIdStr, userAddressStr], nil))[0]), 0])
573618 let minRewardPart = availableToClaim
574619 let boostRewardPart = min([(minRewardPart * toBigInt(2)), toBigInt(wxAmountBoostTotal)])
620+ let totalReward = (minRewardPart + boostRewardPart)
575621 let wxAssetId = asByteVector(asAnyList(invoke(emissionContract, "emit", [toInt(minRewardPart)], nil))[0])
576622 let emitBoost = asAnyList(invoke(emissionContract, "emit", [toInt(boostRewardPart)], nil))
577623 if ((emitBoost == emitBoost))
578624 then {
579- let claimedByUserValue = ((claimedByUser + minRewardPart) + boostRewardPart)
625+ let claimedByUserValue = (claimedByUser + availableToClaim)
580626 let claimedByUserMinRewardPlusPart = (claimedByUserMinReward + minRewardPart)
581- let claimedByUserBoostRewardPlusBoostRewardPart = (claimedByUserBoostReward + boostRewardPart)
582- let claimedTotalPlusAvailableToClaim = (claimedTotal + availableToClaim)
583-[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)]
627+ let claimedByUserBoostRewardPlusBoostRewardPart = (claimedByUserMinReward + minRewardPart)
628+ let claimedTotalPlusAvailableToClaim = (claimedByUserMinReward + minRewardPart)
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))
584630 }
585631 else throw("Strict value is not equal to itself.")
586632 }
587633 }
588634 else throw("Strict value is not equal to itself.")
589635 }
590636
591637
592638
593639 @Callable(i)
594640 func claimWxBulkInternalREADONLY (currentIter,lpAssetIds,userAddressStr,resAcc) = if ((currentIter == size(lpAssetIds)))
595641 then $Tuple2(nil, resAcc)
596642 else {
597643 let lpAssetId = lpAssetIds[currentIter]
598644 let info = split({
599645 let @ = invoke(this, "claimWxREADONLY", [lpAssetId, userAddressStr], nil)
600646 if ($isInstanceOf(@, "String"))
601647 then @
602648 else throw(($getType(@) + " couldn't be cast to String"))
603649 }, SEP)
604650 let unclaimed = info[3]
605651 let claimed = info[4]
606652 let res = (resAcc :+ makeString(["%d%d", unclaimed, claimed], SEP))
607653 let inv = {
608654 let @ = invoke(this, "claimWxBulkInternalREADONLY", [(currentIter + 1), lpAssetIds, userAddressStr, res], nil)
609655 if ($isInstanceOf(@, "List[Any]"))
610656 then @
611657 else throw(($getType(@) + " couldn't be cast to List[Any]"))
612658 }
613659 if ((inv == inv))
614660 then $Tuple2(nil, inv)
615661 else throw("Strict value is not equal to itself.")
616662 }
617663
618664
619665
620666 @Callable(i)
621667 func claimWxBulkREADONLY (lpAssetIds,userAddressStr) = {
622668 let res = invoke(this, "claimWxBulkInternalREADONLY", [0, lpAssetIds, userAddressStr, nil], nil)
623669 $Tuple2(nil, res)
624670 }
625671
626672
627673
628674 @Callable(i)
629675 func claimWxREADONLY (lpAssetIdStr,userAddressStr) = {
630676 let stakedByUserKEY = keyStakedByUser(userAddressStr, lpAssetIdStr)
631677 let stakedTotalKEY = keyStakedTotal(lpAssetIdStr)
632678 let claimedByUserKEY = keyClaimedByUser(lpAssetIdStr, userAddressStr)
633- let claimedByUserMinRewardKEY = keyClaimedByUserMinReward(lpAssetIdStr, userAddressStr)
634679 let stakedByUser = readStaked(stakedByUserKEY)
635680 let stakedTotal = readStaked(stakedTotalKEY)
636681 let claimedByUser = getBigIntFromStringOrZero(this, claimedByUserKEY)
637- let claimedByUserMinReward = getBigIntFromStringOrZero(this, claimedByUserMinRewardKEY)
638682 let poolAddressStr = getStringByAddressOrFail(factoryContract, keyFactoryLpAssetToPoolContractAddress(lpAssetIdStr))
639683 let poolWeight = getIntegerValue(factoryContract, keyFactoryPoolWeight(poolAddressStr))
640684 let wxEmissionPerBlock = getIntOrFail(emissionContract, keyEmissionRatePerBlockCurrent())
641685 let emissionStartBlock = getIntOrFail(emissionContract, keyEmissionStartBlock())
642686 let passedBlocks = if ((emissionStartBlock > height))
643687 then 0
644688 else (height - emissionStartBlock)
645689 let poolWxEmission = fraction((wxEmissionPerBlock * passedBlocks), poolWeight, POOLWEIGHTMULT)
646690 let userWxReward = fraction(poolWxEmission, stakedByUser, stakedTotal)
647- let $t02658426696 = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, 0)
648- let wxToClaimUserNew = $t02658426696._1
649- let integralSTATE = $t02658426696._2
650- let debug = $t02658426696._3
651- let availableToClaim = max([(wxToClaimUserNew - claimedByUserMinReward), zeroBigInt])
691+ let $t02837028482 = refreshINTEGRALS(lpAssetIdStr, userAddressStr, poolAddressStr, 0)
692+ let wxToClaimUserNew = $t02837028482._1
693+ let integralSTATE = $t02837028482._2
694+ let debug = $t02837028482._3
695+ let availableToClaim = max([(wxToClaimUserNew - claimedByUser), zeroBigInt])
652696 let boostInvResult = asAnyList(invoke(boostingContract, "claimWxBoostREADONLY", [lpAssetIdStr, userAddressStr], nil))
653697 let wxAmountBoostTotal = max([asInt(boostInvResult[0]), 0])
654698 let boostDebug = asString(boostInvResult[1])
655699 let minRewardPart = availableToClaim
656700 let boostRewardPart = min([(minRewardPart * toBigInt(2)), toBigInt(wxAmountBoostTotal)])
657701 let totalReward = (minRewardPart + boostRewardPart)
658702 $Tuple2(nil, makeString(["%s%s%d%d%d%d%s", lpAssetIdStr, userAddressStr, toString(totalReward), toString(claimedByUser), toString(minRewardPart), toString(boostRewardPart), "soon"], SEP))
703+ }
704+
705+
706+
707+@Callable(i)
708+func stakedByUserREADONLY (lpAssetIdStr,userAddressStr) = {
709+ let stakedByUser = valueOrElse(getInteger(keyStakedByUser(userAddressStr, lpAssetIdStr)), 0)
710+ $Tuple2(nil, stakedByUser)
659711 }
660712
661713
662714
663715 @Callable(i)
664716 func usersListTraversal (lpAssetId) = {
665717 let checkCaller = if ((toBase58String(i.caller.bytes) == valueOrElse(getString(this, keyVotingEmissionContract()), "")))
666718 then true
667719 else mustManager(i)
668720 if ((checkCaller == checkCaller))
669721 then {
670722 let listName = getUsersListName(lpAssetId)
671723 let userOrUnit = getString(keyNextUser(lpAssetId))
672724 let headOrUnit = getString(keyListHead(listName))
673725 match userOrUnit {
674726 case _: Unit =>
675727 match headOrUnit {
676728 case _: Unit =>
677729 $Tuple2(nil, false)
678730 case head: String =>
679731 $Tuple2([StringEntry(keyNextUser(lpAssetId), head)], true)
680732 case _ =>
681733 throw("Match error")
682734 }
683735 case userAddress: String =>
684- let claimedByUserMinReward = getBigIntFromStringOrZero(this, keyClaimedByUserMinReward(lpAssetId, userAddress))
736+ let claimedByUser = getBigIntFromStringOrZero(this, keyClaimedByUser(lpAssetId, userAddress))
685737 let poolAddress = getStringByAddressOrFail(factoryContract, keyFactoryLpAssetToPoolContractAddress(lpAssetId))
686738 let wxToClaimUserNew = refreshINTEGRALS(lpAssetId, userAddress, poolAddress, 0)._1
687- let availableToClaim = (wxToClaimUserNew - claimedByUserMinReward)
739+ let availableToClaim = (wxToClaimUserNew - claimedByUser)
740+ let throwIfNothingToClaim = true
688741 let r = if ((availableToClaim > zeroBigInt))
689- then invoke(this, "claimWxINTERNAL", [lpAssetId, userAddress], nil)
742+ then invoke(this, "claimWxINTERNAL", [lpAssetId, userAddress, throwIfNothingToClaim], nil)
690743 else unit
691744 if ((r == r))
692745 then {
693746 let nextUserOrUnit = getString(keyListNext(listName, userAddress))
694747 match nextUserOrUnit {
695748 case _: Unit =>
696749 $Tuple2([DeleteEntry(keyNextUser(lpAssetId))], false)
697750 case nextUser: String =>
698751 $Tuple2([StringEntry(keyNextUser(lpAssetId), nextUser)], true)
699752 case _ =>
700753 throw("Match error")
701754 }
702755 }
703756 else throw("Strict value is not equal to itself.")
704757 case _ =>
705758 throw("Match error")
706759 }
707760 }
708761 else throw("Strict value is not equal to itself.")
709762 }
710763
711764
712765
713766 @Callable(i)
714767 func onModifyWeight (lpAssetIdStr,poolAddressStr) = if ((i.caller != factoryContract))
715768 then throw("permissions denied")
716769 else {
717- let $t02903229142 = refreshPoolINTEGRALS(lpAssetIdStr, poolAddressStr, 0)
718- let wxPerLpIntegralNew = $t02903229142._1
719- let poolIntegralSTATE = $t02903229142._2
720- let poolDEBUG = $t02903229142._3
770+ let $t03105231162 = refreshPoolINTEGRALS(lpAssetIdStr, poolAddressStr, 0)
771+ let wxPerLpIntegralNew = $t03105231162._1
772+ let poolIntegralSTATE = $t03105231162._2
773+ let poolDEBUG = $t03105231162._3
721774 poolIntegralSTATE
722775 }
723776
724777
725778 @Verifier(tx)
726779 func verify () = {
727780 let targetPublicKey = match managerPublicKeyOrUnit() {
728781 case pk: ByteVector =>
729782 pk
730783 case _: Unit =>
731784 tx.senderPublicKey
732785 case _ =>
733786 throw("Match error")
734787 }
735788 sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey)
736789 }
737790

github/deemru/w8io/026f985 
91.09 ms