@pendle/core-v2 2.23.1 → 2.23.3-mantle
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/artifacts/contracts/LiquidityMining/CrossChainMsg/PendleMsgReceiveEndpointUpg.sol/PendleMsgReceiveEndpointUpg.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/CrossChainMsg/PendleMsgReceiverAppUpg.sol/PendleMsgReceiverAppUpg.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/CrossChainMsg/PendleMsgSendEndpointUpg.sol/PendleMsgSendEndpointUpg.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/CrossChainMsg/PendleMsgSenderAppUpg.sol/PendleMsgSenderAppUpg.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/CrossChainMsg/libraries/LayerZeroHelper.sol/LayerZeroHelper.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/GaugeController/PendleGaugeControllerBaseUpg.sol/PendleGaugeControllerBaseUpg.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/GaugeController/PendleGaugeControllerMainchainUpg.sol/PendleGaugeControllerMainchainUpg.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/GaugeController/PendleGaugeControllerSidechainUpg.sol/PendleGaugeControllerSidechainUpg.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/VeDistributor/PendleFeeDistributor.sol/PendleFeeDistributor.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/VeDistributor/PendleFeeDistributor.sol/PendleFeeDistributor.json +2 -2
- package/build/artifacts/contracts/LiquidityMining/VeDistributor/PendleFeeDistributorV2.sol/PendleFeeDistributorV2.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/VotingController/PendleVotingControllerUpg.sol/PendleVotingControllerUpg.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/VotingController/VotingControllerStorageUpg.sol/VotingControllerStorageUpg.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/VotingEscrow/VotingEscrowPendleMainchain.sol/VotingEscrowPendleMainchain.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/VotingEscrow/VotingEscrowPendleSidechain.sol/VotingEscrowPendleSidechain.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/VotingEscrow/VotingEscrowTokenBase.sol/VotingEscrowTokenBase.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/libraries/VeBalanceLib.sol/VeBalanceLib.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/libraries/VeHistoryLib.sol/CheckpointHelper.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/libraries/VeHistoryLib.sol/Checkpoints.dbg.json +1 -1
- package/build/artifacts/contracts/core/BulkSeller/BulkSeller.sol/BulkSeller.dbg.json +1 -1
- package/build/artifacts/contracts/core/BulkSeller/BulkSellerFactory.sol/BulkSellerFactory.dbg.json +1 -1
- package/build/artifacts/contracts/core/BulkSeller/BulkSellerMathCore.sol/BulkSellerMathCore.dbg.json +1 -1
- package/build/artifacts/contracts/core/Market/MarketMathCore.sol/MarketMathCore.dbg.json +1 -1
- package/build/artifacts/contracts/core/Market/OracleLib.sol/OracleLib.dbg.json +1 -1
- package/build/artifacts/contracts/core/Market/PendleExternalRewardDistributor.sol/PendleExternalRewardDistributor.dbg.json +4 -0
- package/build/artifacts/contracts/core/Market/PendleExternalRewardDistributor.sol/PendleExternalRewardDistributor.json +373 -0
- package/build/artifacts/contracts/core/Market/PendleGauge.sol/PendleGauge.dbg.json +1 -1
- package/build/artifacts/contracts/core/Market/PendleMarket.sol/PendleMarket.dbg.json +1 -1
- package/build/artifacts/contracts/core/Market/PendleMarket.sol/PendleMarket.json +2 -2
- package/build/artifacts/contracts/core/Market/PendleMarketFactory.sol/PendleMarketFactory.dbg.json +1 -1
- package/build/artifacts/contracts/core/Market/v2/PendleGaugeV2.sol/PendleGaugeV2.dbg.json +4 -0
- package/build/artifacts/contracts/core/Market/v2/PendleGaugeV2.sol/PendleGaugeV2.json +128 -0
- package/build/artifacts/contracts/core/Market/v2/PendleMarketFactoryV2.sol/PendleMarketFactoryV2.dbg.json +4 -0
- package/build/artifacts/contracts/core/Market/v2/PendleMarketFactoryV2.sol/PendleMarketFactoryV2.json +682 -0
- package/build/artifacts/contracts/core/Market/v2/PendleMarketV2.sol/PendleMarketV2.dbg.json +4 -0
- package/build/artifacts/contracts/core/Market/v2/PendleMarketV2.sol/PendleMarketV2.json +1219 -0
- package/build/artifacts/contracts/core/RewardManager/RewardManager.sol/RewardManager.dbg.json +1 -1
- package/build/artifacts/contracts/core/RewardManager/RewardManagerAbstract.sol/RewardManagerAbstract.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/PYIndex.sol/PYIndexLib.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/SYBase.sol/SYBase.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/SYBaseWithRewards.sol/SYBaseWithRewards.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Ankr/PendleAnkrBNBSY.sol/PendleAnkrBNBSY.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Ape/sAPE.sol/sAPE.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/AuraEthxBbAWethSY.sol/AuraEthxBbAWethSY.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/AuraEthxBbAWethSY.sol/AuraEthxBbAWethSY.json +2 -2
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/PendleAuraBbAWethSwethSY.sol/PendleAuraBbAWethSwethSY.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/PendleAuraBbAWethSwethSY.sol/PendleAuraBbAWethSwethSY.json +2 -2
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/PendleAuraWethAnkrethSYV2.sol/PendleAuraWethAnkrethSYV2.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/PendleAuraWethAnkrethSYV2.sol/PendleAuraWethAnkrethSYV2.json +2 -2
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/PendleAuraWethRocketEthSYV2.sol/PendleAuraWethRocketEthSYV2.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/PendleAuraWethRocketEthSYV2.sol/PendleAuraWethRocketEthSYV2.json +2 -2
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/PendleAuraWethStafiEthSY.sol/PendleAuraWethStafiEthSY.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/PendleAuraWethStafiEthSY.sol/PendleAuraWethStafiEthSY.json +2 -2
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/PendleAuraWethVethSY.sol/PendleAuraWethVethSY.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/PendleAuraWethVethSY.sol/PendleAuraWethVethSY.json +2 -2
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/PendleAuraWethWstethSYV2.sol/PendleAuraWethWstethSYV2.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/PendleAuraWethWstethSYV2.sol/PendleAuraWethWstethSYV2.json +2 -2
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/PendleAuraWstethAnkreth.sol/PendleAuraWstethAnkreth.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/PendleAuraWstethAnkreth.sol/PendleAuraWstethAnkreth.json +2 -2
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/base/ComposableStable/ComposableStableMath.sol/ComposableStableMath.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/base/ComposableStable/ComposableStablePreview.sol/ComposableStablePreview.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/base/FixedPoint.sol/FixedPoint.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/base/Linear/BbAPoolHelper.sol/BbAPoolHelper.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/base/Linear/BbAPoolHelper.sol/BbAWethHelper.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/base/Linear/LinearMath.sol/LinearMath.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/base/Linear/LinearPreview.sol/LinearPreview.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/base/MetaStable/MetaStableMath.sol/MetaStableMath.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/base/MetaStable/MetaStablePreview.sol/MetaStablePreview.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/base/PendleAuraBalancerStableLPSYV2.sol/PendleAuraBalancerStableLPSYV2.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BenQi/PendleQiTokenHelper.sol/PendleQiTokenHelper.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BenQi/PendleQiTokenSY.sol/PendleQiTokenSY.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BenQi/PendleQiTokenSY.sol/PendleQiTokenSY.json +2 -2
- package/build/artifacts/contracts/core/StandardizedYield/implementations/CamelotV1Volatile/CamelotRewardHelper.sol/CamelotRewardHelper.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/CamelotV1Volatile/CamelotV1VolatileCommon.sol/CamelotV1VolatileCommon.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/CamelotV1Volatile/CamelotV1VolatileLpHelper.sol/CamelotV1VolatileLpHelper.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/CamelotV1Volatile/CamelotV1VolatilePreview.sol/CamelotV1VolatilePreview.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/CamelotV1Volatile/PendleCamelotV1VolatileSY.sol/PendleCamelotV1VolatileSY.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/CamelotV1Volatile/PendleCamelotV1VolatileSY.sol/PendleCamelotV1VolatileSY.json +2 -2
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Convex/PendleCurveFraxUsdcSY.sol/PendleCurveFraxUsdcSY.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Convex/PendleCurveFraxUsdcSY.sol/PendleCurveFraxUsdcSY.json +2 -2
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Convex/PendleCurveUsdd3CrvSY.sol/PendleCurveUsdd3CrvSY.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Convex/PendleCurveUsdd3CrvSY.sol/PendleCurveUsdd3CrvSY.json +2 -2
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Convex/base/Curve3CrvPoolHelper.sol/Curve3CrvPoolHelper.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Convex/base/CurveFraxUsdcPoolHelper.sol/CurveFraxUsdcPoolHelper.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Convex/base/CurveUsdd3CrvPoolHelper.sol/CurveUsdd3CrvPoolHelper.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Convex/base/PendleConvexLPSY.sol/PendleConvexLPSY.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/GLP/PendleGlpSY.sol/PendleGlpSY.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/GLP/PendleGlpSY.sol/PendleGlpSY.json +2 -2
- package/build/artifacts/contracts/core/StandardizedYield/implementations/PendleArbitrumStakedEthSY.sol/PendleArbitrumStakedEthSY.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/PendleGdaiSY.sol/PendleGDaiSY.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/PendleLooksStakingSY.sol/PendleLooksStakingSY.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/PendleSfrxEthSY.sol/PendleSfrxEthSY.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/PendleStargateLPSY.sol/PendleStargateLPSY.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/PendleStargateLPSY.sol/PendleStargateLPSY.json +2 -2
- package/build/artifacts/contracts/core/StandardizedYield/implementations/PendleWbEthSY.sol/PendleWbEthSY.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/PendleWstEthSY.sol/PendleWstEthSY.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Swell/PendleSwETH.sol/SwETHSY.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Thena/PendleThenaSY.sol/PendleThenaSY.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Thena/PendleThenaSY.sol/PendleThenaSY.json +2 -2
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Thena/ThenaLpHelper.sol/ThenaLpHelper.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Thena/ThenaMath.sol/ThenaMath.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Thena/ThenaPreview.sol/IThenaSY.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Thena/ThenaPreview.sol/ThenaPreview.dbg.json +1 -1
- package/build/artifacts/contracts/core/YieldContracts/InterestManagerYT.sol/InterestManagerYT.dbg.json +1 -1
- package/build/artifacts/contracts/core/YieldContracts/PendlePrincipalToken.sol/PendlePrincipalToken.dbg.json +1 -1
- package/build/artifacts/contracts/core/YieldContracts/PendleYieldContractFactory.sol/PendleYieldContractFactory.dbg.json +1 -1
- package/build/artifacts/contracts/core/YieldContracts/PendleYieldContractFactory.sol/PendleYieldContractFactory.json +2 -2
- package/build/artifacts/contracts/core/YieldContracts/PendleYieldToken.sol/PendleYieldToken.dbg.json +1 -1
- package/build/artifacts/contracts/core/YieldContracts/PendleYieldToken.sol/PendleYieldToken.json +2 -2
- package/build/artifacts/contracts/core/YieldContractsV2/InterestManagerYTV2.sol/InterestManagerYTV2.dbg.json +1 -1
- package/build/artifacts/contracts/core/YieldContractsV2/PendlePrincipalTokenV2.sol/PendlePrincipalTokenV2.dbg.json +1 -1
- package/build/artifacts/contracts/core/YieldContractsV2/PendleYieldContractFactoryV2.sol/PendleYieldContractFactoryV2.dbg.json +1 -1
- package/build/artifacts/contracts/core/YieldContractsV2/PendleYieldContractFactoryV2.sol/PendleYieldContractFactoryV2.json +2 -2
- package/build/artifacts/contracts/core/YieldContractsV2/PendleYieldTokenV2.sol/PendleYieldTokenV2.dbg.json +1 -1
- package/build/artifacts/contracts/core/YieldContractsV2/PendleYieldTokenV2.sol/PendleYieldTokenV2.json +2 -2
- package/build/artifacts/contracts/core/libraries/ArrayLib.sol/ArrayLib.dbg.json +1 -1
- package/build/artifacts/contracts/core/libraries/ArrayLib.sol/ArrayLib.json +2 -2
- package/build/artifacts/contracts/core/libraries/Errors.sol/Errors.dbg.json +1 -1
- package/build/artifacts/contracts/core/libraries/math/Math.sol/Math.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/Ankr/IAnkrBNB.sol/IAnkrBNB.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/Ankr/IAnkrLiquidStaking.sol/IAnkrLiquidStaking.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/BinanceEth/IWBETH.sol/IWBETH.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/Camelot/ICamelotNFTPool.sol/ICamelotNFTPool.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/Camelot/ICamelotNitroPool.sol/ICamelotNitroPool.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/Camelot/ICamelotPair.sol/ICamelotPair.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPActionAddRemoveLiq.sol/IPActionAddRemoveLiq.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPActionInfoStatic.sol/IPActionInfoStatic.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPActionMarketAuxStatic.sol/IPActionMarketAuxStatic.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPActionMarketCoreStatic.sol/IPActionMarketCoreStatic.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPActionMintRedeem.sol/IPActionMintRedeem.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPActionMintRedeemStatic.sol/IPActionMintRedeemStatic.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPActionStorageStatic.sol/IPActionStorageStatic.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPActionSwapPT.sol/IPActionSwapPT.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPActionSwapYT.sol/IPActionSwapYT.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPAllAction.sol/IPAllAction.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPBulkSeller.sol/IPBulkSeller.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPExternalRewardDistributor.sol/IPExternalRewardDistributor.dbg.json +4 -0
- package/build/artifacts/contracts/interfaces/IPExternalRewardDistributor.sol/IPExternalRewardDistributor.json +109 -0
- package/build/artifacts/contracts/interfaces/IPGauge.sol/IPGauge.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPMarket.sol/IPMarket.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPMarketFactoryV2.sol/IPMarketFactoryV2.dbg.json +4 -0
- package/build/artifacts/contracts/interfaces/IPMarketFactoryV2.sol/IPMarketFactoryV2.json +166 -0
- package/build/artifacts/contracts/interfaces/IPRouterHelper.sol/IPRouterHelper.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPRouterStatic.sol/IPRouterStatic.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPVotingController.sol/IPVotingController.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPVotingEscrowMainchain.sol/IPVotingEscrowMainchain.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPendlePreviewHelper.sol/IPendlePreviewHelper.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IStandardizedYield.sol/IStandardizedYield.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/ISwETH.sol/ISwETH.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/Thena/IThenaFactory.sol/IThenaFactory.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/Thena/IThenaGaugeV2.sol/IThenaGaugeV2.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/Thena/IThenaPair.sol/IThenaPair.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/Thena/IThenaRouter.sol/IThenaRouter.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/BoringLpSeller.sol/BoringLpSeller.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/BoringPtSeller.sol/BoringPtSeller.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/Broadcaster.sol/Broadcaster.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/BulkSellerOffchain.sol/BulkSellerOffchain.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/LegacyNFTHelper.sol/LegacyNFTHelper.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/LegacyNFTHelper.sol/StarNFTV1.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/MarketExchangeRateLib.sol/MarketExchangeRateLib.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/PtAndLpToAsset.sol/PtAndLpToAsset.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/router-static/PendleRouterStatic.sol/PendleRouterStatic.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/router-static/base/ActionInfoStatic.sol/ActionInfoStatic.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/router-static/base/ActionMarketAuxStatic.sol/ActionMarketAuxStatic.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/router-static/base/ActionMarketCoreStatic.sol/ActionMarketCoreStatic.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/router-static/base/ActionMintRedeemStatic.sol/ActionMintRedeemStatic.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/router-static/base/ActionStorageStatic.sol/ActionStorageStatic.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/router-static/base/ActionVePendleStatic.sol/ActionVePendleStatic.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/router-static/base/StorageLayout.sol/StorageLayout.dbg.json +1 -1
- package/build/artifacts/contracts/oracles/PendleLpOracleLib.sol/PendleLpOracleLib.dbg.json +1 -1
- package/build/artifacts/contracts/oracles/PendlePtOracle.sol/PendlePtOracle.dbg.json +1 -1
- package/build/artifacts/contracts/oracles/PendlePtOracleLib.sol/PendlePtOracleLib.dbg.json +1 -1
- package/build/artifacts/contracts/oracles/samples/PendleLpGlpOracle.sol/PendleLpGlpOracle.dbg.json +1 -1
- package/build/artifacts/contracts/oracles/samples/PendlePtGlpOracle.sol/PendlePtGlpOracle.dbg.json +1 -1
- package/build/artifacts/contracts/oracles/samples/PendlePtUsdChainlinkOracle.sol/PendlePtUsdChainlinkOracle.dbg.json +1 -1
- package/build/artifacts/contracts/router/ActionAddRemoveLiq.sol/ActionAddRemoveLiq.dbg.json +1 -1
- package/build/artifacts/contracts/router/ActionMintRedeem.sol/ActionMintRedeem.dbg.json +1 -1
- package/build/artifacts/contracts/router/ActionSwapPT.sol/ActionSwapPT.dbg.json +1 -1
- package/build/artifacts/contracts/router/ActionSwapYT.sol/ActionSwapYT.dbg.json +1 -1
- package/build/artifacts/contracts/router/PendleRouter.sol/PendleRouter.dbg.json +1 -1
- package/build/artifacts/contracts/router/PendleRouterHelper.sol/PendleRouterHelper.dbg.json +1 -1
- package/build/artifacts/contracts/router/base/ActionBaseCallback.sol/ActionBaseCallback.dbg.json +1 -1
- package/build/artifacts/contracts/router/base/ActionBaseMintRedeem.sol/ActionBaseMintRedeem.dbg.json +1 -1
- package/build/artifacts/contracts/router/base/CallbackHelper.sol/CallbackHelper.dbg.json +1 -1
- package/build/artifacts/contracts/router/base/MarketApproxLib.sol/MarketApproxPtInLib.dbg.json +1 -1
- package/build/artifacts/contracts/router/base/MarketApproxLib.sol/MarketApproxPtOutLib.dbg.json +1 -1
- package/build/artifacts/contracts/router/swap-aggregator/1inch/I1inchAggregationRouterV5.sol/I1inchAggregationRouterV5.dbg.json +1 -1
- package/build/artifacts/contracts/router/swap-aggregator/1inch/OneInchAggregationRouterHelper.sol/OneInchAggregationRouterHelper.dbg.json +1 -1
- package/build/artifacts/contracts/router/swap-aggregator/PendleSwap.sol/PendleSwap.dbg.json +1 -1
- package/build/artifacts/contracts/router/swap-aggregator/kyberswap/IExecutorHelper.sol/IExecutorHelper.dbg.json +1 -1
- package/build/artifacts/contracts/router/swap-aggregator/kyberswap/KyberInputScalingHelper.sol/KyberInputScalingHelper.dbg.json +1 -1
- package/build/artifacts/contracts/router/swap-aggregator/kyberswap/ScalingDataLib.sol/ScalingDataLib.dbg.json +1 -1
- package/contracts/LiquidityMining/CrossChainMsg/libraries/LayerZeroHelper.sol +4 -0
- package/contracts/core/Market/PendleExternalRewardDistributor.sol +135 -0
- package/contracts/core/Market/v2/PendleGaugeV2.sol +142 -0
- package/contracts/core/Market/v2/PendleMarketFactoryV2.sol +177 -0
- package/contracts/core/Market/v2/PendleMarketV2.sol +379 -0
- package/contracts/core/RewardManager/RewardManager.sol +0 -1
- package/contracts/core/RewardManager/RewardManagerAbstract.sol +3 -2
- package/contracts/core/StandardizedYield/implementations/BalancerStable/base/ComposableStable/ComposableStablePreview.sol +1 -607
- package/contracts/core/StandardizedYield/implementations/BalancerStable/base/ComposableStable/ComposableStablePreviewProxy.sol +53 -0
- package/contracts/core/StandardizedYield/implementations/BalancerStable/base/ComposableStable/ComposableStablePreviewV4.sol +600 -0
- package/contracts/core/StandardizedYield/implementations/BalancerStable/base/ComposableStable/ComposableStablePreviewV5.sol +621 -0
- package/contracts/core/StandardizedYield/implementations/BalancerStable/base/FixedPoint.sol +8 -0
- package/contracts/core/StandardizedYield/implementations/ChainlinkRelayer/PendleChainlinkReceiver.sol +46 -0
- package/contracts/core/StandardizedYield/implementations/ChainlinkRelayer/PendleChainlinkRelayer.sol +43 -0
- package/contracts/core/StandardizedYield/implementations/MantleStakedEth/PendleMantleStakedEthSY.sol +120 -0
- package/contracts/core/StandardizedYield/implementations/MantleStakedEth/PendleOracleForSyProxy.sol +23 -0
- package/contracts/core/libraries/ArrayLib.sol +32 -0
- package/contracts/core/libraries/Errors.sol +2 -0
- package/contracts/interfaces/Balancer/IPComposableStablePreview.sol +23 -0
- package/contracts/interfaces/Balancer/IVersion.sol +13 -0
- package/contracts/interfaces/IPExternalRewardDistributor.sol +19 -0
- package/contracts/interfaces/IPMarketFactoryV2.sol +8 -0
- package/contracts/interfaces/IPOracleForSy.sol +7 -0
- package/contracts/offchain-helpers/AutomateReady.sol +111 -0
- package/contracts/offchain-helpers/ChainlinkRelayerAutomation.sol +52 -0
- package/contracts/offchain-helpers/ChainlinkRelayerGelato.sol +36 -0
- package/contracts/offchain-helpers/errors/SDKErrorsDirectory.sol +149 -0
- package/contracts/router/swap-aggregator/PendleSwap.sol +7 -2
- package/deployments/5000-core.json +29 -0
- package/deployments/5000-markets/WSTETH-MANTLE-MARCH2024.json +10 -0
- package/package.json +7 -7
- package/typechain-types/AuraSwEthBbAWethSYV2.ts +1532 -0
- package/typechain-types/BotActionCallback.ts +1093 -0
- package/typechain-types/ComposableStablePreviewProxy.ts +352 -0
- package/typechain-types/ComposableStablePreviewV4.ts +217 -0
- package/typechain-types/ComposableStablePreviewV5.ts +217 -0
- package/typechain-types/IPComposableStablePreview.ts +217 -0
- package/typechain-types/IPOracleForSy.ts +87 -0
- package/typechain-types/IVersion.ts +81 -0
- package/typechain-types/LiquiditySeedingHelper.ts +128 -0
- package/typechain-types/LongYieldActionHelper.ts +1093 -0
- package/typechain-types/LongYieldTradingBot.ts +1093 -0
- package/typechain-types/PendleChainlinkReceiver.ts +239 -0
- package/typechain-types/PendleChainlinkRelayer.ts +158 -0
- package/typechain-types/PendleExternalRewardDistributor.ts +49 -0
- package/typechain-types/PendleMantleStakedEthSY.ts +1222 -0
- package/typechain-types/PendleMarketFactoryV2.ts +26 -24
- package/typechain-types/PendleOracleForSyProxy.ts +275 -0
- package/typechain-types/ShortYieldActionHelper.ts +1093 -0
- package/typechain-types/ShortYieldTradingBot.ts +1093 -0
- package/typechain-types/TradingBotBase.ts +1093 -0
- package/typechain-types/factories/AuraEthxBbAWethSY__factory.ts +1 -1
- package/typechain-types/factories/AuraSwEthBbAWethSYV2__factory.ts +1244 -0
- package/typechain-types/factories/BotActionCallback__factory.ts +899 -9
- package/typechain-types/factories/ComposableStablePreviewProxy__factory.ts +288 -0
- package/typechain-types/factories/ComposableStablePreviewV4__factory.ts +190 -0
- package/typechain-types/factories/ComposableStablePreviewV5__factory.ts +190 -0
- package/typechain-types/factories/IPComposableStablePreview__factory.ts +152 -0
- package/typechain-types/factories/IPOracleForSy__factory.ts +36 -0
- package/typechain-types/factories/IVersion__factory.ts +36 -0
- package/typechain-types/factories/LiquiditySeedingHelper__factory.ts +124 -0
- package/typechain-types/factories/LongYieldActionHelper__factory.ts +899 -9
- package/typechain-types/factories/LongYieldTradingBot__factory.ts +923 -33
- package/typechain-types/factories/PendleAuraBbAWethSwethSY__factory.ts +1 -1
- package/typechain-types/factories/PendleAuraWethAnkrethSYV2__factory.ts +1 -1
- package/typechain-types/factories/PendleAuraWethRocketEthSYV2__factory.ts +1 -1
- package/typechain-types/factories/PendleAuraWethStafiEthSY__factory.ts +1 -1
- package/typechain-types/factories/PendleAuraWethVethSY__factory.ts +1 -1
- package/typechain-types/factories/PendleAuraWethWstethSYV2__factory.ts +1 -1
- package/typechain-types/factories/PendleAuraWstethAnkreth__factory.ts +1 -1
- package/typechain-types/factories/PendleCamelotV1VolatileSY__factory.ts +1 -1
- package/typechain-types/factories/PendleChainlinkReceiver__factory.ts +216 -0
- package/typechain-types/factories/PendleChainlinkRelayer__factory.ts +180 -0
- package/typechain-types/factories/PendleCurveFraxUsdcSY__factory.ts +1 -1
- package/typechain-types/factories/PendleCurveUsdd3CrvSY__factory.ts +1 -1
- package/typechain-types/factories/PendleExternalRewardDistributor__factory.ts +29 -1
- package/typechain-types/factories/PendleFeeDistributor__factory.ts +1 -1
- package/typechain-types/factories/PendleGlpSY__factory.ts +1 -1
- package/typechain-types/factories/PendleMantleStakedEthSY__factory.ts +1068 -0
- package/typechain-types/factories/PendleMarketFactoryV2__factory.ts +15 -15
- package/typechain-types/factories/PendleMarketV2__factory.ts +10 -1
- package/typechain-types/factories/PendleMarket__factory.ts +1 -1
- package/typechain-types/factories/PendleOracleForSyProxy__factory.ts +211 -0
- package/typechain-types/factories/PendleQiTokenSY__factory.ts +1 -1
- package/typechain-types/factories/PendleStargateLPSY__factory.ts +1 -1
- package/typechain-types/factories/PendleThenaSY__factory.ts +1 -1
- package/typechain-types/factories/PendleYieldContractFactoryV2__factory.ts +1 -1
- package/typechain-types/factories/PendleYieldContractFactory__factory.ts +1 -1
- package/typechain-types/factories/PendleYieldTokenV2__factory.ts +1 -1
- package/typechain-types/factories/PendleYieldToken__factory.ts +1 -1
- package/typechain-types/factories/ShortYieldActionHelper__factory.ts +899 -9
- package/typechain-types/factories/ShortYieldTradingBot__factory.ts +939 -49
- package/typechain-types/factories/TradingBotBase__factory.ts +899 -9
- package/typechain-types/hardhat.d.ts +162 -9
- package/typechain-types/index.ts +34 -2
- /package/contracts/router/swap-aggregator/{1inch → oneinch}/I1inchAggregationRouterV5.sol +0 -0
- /package/contracts/router/swap-aggregator/{1inch → oneinch}/OneInchAggregationRouterHelper.sol +0 -0
|
@@ -0,0 +1,621 @@
|
|
|
1
|
+
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
2
|
+
pragma solidity 0.8.17;
|
|
3
|
+
|
|
4
|
+
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
|
|
5
|
+
import "../../../../../../interfaces/Balancer/IComposableStable.sol";
|
|
6
|
+
|
|
7
|
+
import "../FixedPoint.sol";
|
|
8
|
+
import "../StablePoolUserData.sol";
|
|
9
|
+
|
|
10
|
+
import "./ComposableStableMath.sol";
|
|
11
|
+
import "./ComposableStablePreview.sol";
|
|
12
|
+
|
|
13
|
+
contract ComposableStablePreviewV5 is ComposableStablePreview {
|
|
14
|
+
using ComposableStableMath for uint256;
|
|
15
|
+
using StablePoolUserData for bytes;
|
|
16
|
+
using FixedPoint for uint256;
|
|
17
|
+
|
|
18
|
+
function onJoinPool(
|
|
19
|
+
bytes32 poolId,
|
|
20
|
+
address sender,
|
|
21
|
+
address recipient,
|
|
22
|
+
uint256[] memory balances,
|
|
23
|
+
uint256 lastChangeBlock,
|
|
24
|
+
uint256 protocolSwapFeePercentage,
|
|
25
|
+
bytes memory userData,
|
|
26
|
+
bytes memory poolImmutableData
|
|
27
|
+
) internal view override returns (uint256 bptAmountOut) {
|
|
28
|
+
ImmutableData memory imd = abi.decode(poolImmutableData, (ImmutableData));
|
|
29
|
+
|
|
30
|
+
TokenRateCache[] memory caches = _beforeSwapJoinExit(imd);
|
|
31
|
+
|
|
32
|
+
uint256[] memory scalingFactors = _scalingFactors(imd, caches);
|
|
33
|
+
|
|
34
|
+
// skip totalSupply == 0 case
|
|
35
|
+
|
|
36
|
+
_upscaleArray(balances, scalingFactors);
|
|
37
|
+
(bptAmountOut, ) = _onJoinPool(
|
|
38
|
+
poolId,
|
|
39
|
+
sender,
|
|
40
|
+
recipient,
|
|
41
|
+
balances,
|
|
42
|
+
lastChangeBlock,
|
|
43
|
+
protocolSwapFeePercentage,
|
|
44
|
+
scalingFactors,
|
|
45
|
+
userData,
|
|
46
|
+
imd,
|
|
47
|
+
caches
|
|
48
|
+
);
|
|
49
|
+
|
|
50
|
+
// skip _mintPoolTokens, _downscaleUpArray
|
|
51
|
+
|
|
52
|
+
// we return bptAmountOut instead of minting
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
function onExitPool(
|
|
56
|
+
bytes32 poolId,
|
|
57
|
+
address sender,
|
|
58
|
+
address recipient,
|
|
59
|
+
uint256[] memory balances,
|
|
60
|
+
uint256 lastChangeBlock,
|
|
61
|
+
uint256 protocolSwapFeePercentage,
|
|
62
|
+
bytes memory userData,
|
|
63
|
+
bytes memory poolImmutableData
|
|
64
|
+
) internal view override returns (uint256 amountTokenOut) {
|
|
65
|
+
ImmutableData memory imd = abi.decode(poolImmutableData, (ImmutableData));
|
|
66
|
+
|
|
67
|
+
uint256 bptAmountIn;
|
|
68
|
+
uint256[] memory amountsOut;
|
|
69
|
+
|
|
70
|
+
// skip recovery mode
|
|
71
|
+
|
|
72
|
+
TokenRateCache[] memory caches = _beforeSwapJoinExit(imd);
|
|
73
|
+
|
|
74
|
+
uint256[] memory scalingFactors = _scalingFactors(imd, caches);
|
|
75
|
+
_upscaleArray(balances, scalingFactors);
|
|
76
|
+
|
|
77
|
+
(bptAmountIn, amountsOut) = _onExitPool(
|
|
78
|
+
poolId,
|
|
79
|
+
sender,
|
|
80
|
+
recipient,
|
|
81
|
+
balances,
|
|
82
|
+
lastChangeBlock,
|
|
83
|
+
protocolSwapFeePercentage, // assume no recovery mode
|
|
84
|
+
scalingFactors,
|
|
85
|
+
userData,
|
|
86
|
+
imd,
|
|
87
|
+
caches
|
|
88
|
+
);
|
|
89
|
+
|
|
90
|
+
_downscaleDownArray(amountsOut, scalingFactors);
|
|
91
|
+
|
|
92
|
+
// skip burnPoolTokens
|
|
93
|
+
|
|
94
|
+
for (uint256 i = 0; i < amountsOut.length; i++) {
|
|
95
|
+
if (amountsOut[i] > 0) return amountsOut[i];
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
function _onJoinPool(
|
|
100
|
+
bytes32,
|
|
101
|
+
address,
|
|
102
|
+
address,
|
|
103
|
+
uint256[] memory registeredBalances,
|
|
104
|
+
uint256,
|
|
105
|
+
uint256,
|
|
106
|
+
uint256[] memory scalingFactors,
|
|
107
|
+
bytes memory userData,
|
|
108
|
+
ImmutableData memory imd,
|
|
109
|
+
TokenRateCache[] memory caches
|
|
110
|
+
) internal view returns (uint256, uint256[] memory) {
|
|
111
|
+
return _onJoinExitPool(true, registeredBalances, scalingFactors, userData, imd, caches);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
function _onExitPool(
|
|
115
|
+
bytes32,
|
|
116
|
+
address,
|
|
117
|
+
address,
|
|
118
|
+
uint256[] memory registeredBalances,
|
|
119
|
+
uint256,
|
|
120
|
+
uint256,
|
|
121
|
+
uint256[] memory scalingFactors,
|
|
122
|
+
bytes memory userData,
|
|
123
|
+
ImmutableData memory imd,
|
|
124
|
+
TokenRateCache[] memory caches
|
|
125
|
+
) internal view returns (uint256, uint256[] memory) {
|
|
126
|
+
return _onJoinExitPool(false, registeredBalances, scalingFactors, userData, imd, caches);
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
* @return bptAmount
|
|
131
|
+
* @return amountsDelta this will not contain bpt item since it will be discarded on the upper level
|
|
132
|
+
*/
|
|
133
|
+
function _onJoinExitPool(
|
|
134
|
+
bool isJoin,
|
|
135
|
+
uint256[] memory registeredBalances,
|
|
136
|
+
uint256[] memory scalingFactors,
|
|
137
|
+
bytes memory userData,
|
|
138
|
+
ImmutableData memory imd,
|
|
139
|
+
TokenRateCache[] memory caches
|
|
140
|
+
) internal view returns (uint256 bptAmount, uint256[] memory amountsDelta) {
|
|
141
|
+
(
|
|
142
|
+
uint256 preJoinExitSupply,
|
|
143
|
+
uint256[] memory balances,
|
|
144
|
+
uint256 currentAmp,
|
|
145
|
+
uint256 preJoinExitInvariant
|
|
146
|
+
) = _beforeJoinExit(registeredBalances, imd, caches);
|
|
147
|
+
|
|
148
|
+
function(
|
|
149
|
+
uint256[] memory,
|
|
150
|
+
uint256,
|
|
151
|
+
uint256,
|
|
152
|
+
uint256,
|
|
153
|
+
uint256[] memory,
|
|
154
|
+
bytes memory,
|
|
155
|
+
ImmutableData memory
|
|
156
|
+
) internal view returns (uint256, uint256[] memory) _doJoinOrExit = (
|
|
157
|
+
isJoin ? _doJoin : _doExit
|
|
158
|
+
);
|
|
159
|
+
|
|
160
|
+
(bptAmount, amountsDelta) = _doJoinOrExit(
|
|
161
|
+
balances,
|
|
162
|
+
currentAmp,
|
|
163
|
+
preJoinExitSupply,
|
|
164
|
+
preJoinExitInvariant,
|
|
165
|
+
scalingFactors,
|
|
166
|
+
userData,
|
|
167
|
+
imd
|
|
168
|
+
);
|
|
169
|
+
amountsDelta = _addBptItem(amountsDelta, 0, imd);
|
|
170
|
+
|
|
171
|
+
// _mutateAmounts
|
|
172
|
+
|
|
173
|
+
// skip _updateInvariantAfterJoinExit here
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
function _addBptItem(
|
|
177
|
+
uint256[] memory amounts,
|
|
178
|
+
uint256 bptAmount,
|
|
179
|
+
ImmutableData memory imd
|
|
180
|
+
) internal pure returns (uint256[] memory registeredTokenAmounts) {
|
|
181
|
+
registeredTokenAmounts = new uint256[](amounts.length + 1);
|
|
182
|
+
for (uint256 i = 0; i < registeredTokenAmounts.length; i++) {
|
|
183
|
+
registeredTokenAmounts[i] = i == imd.bptIndex
|
|
184
|
+
? bptAmount
|
|
185
|
+
: amounts[i < imd.bptIndex ? i : i - 1];
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
function _doJoin(
|
|
190
|
+
uint256[] memory balances,
|
|
191
|
+
uint256 currentAmp,
|
|
192
|
+
uint256 preJoinExitSupply,
|
|
193
|
+
uint256 preJoinExitInvariant,
|
|
194
|
+
uint256[] memory scalingFactors,
|
|
195
|
+
bytes memory userData,
|
|
196
|
+
ImmutableData memory imd
|
|
197
|
+
) internal view returns (uint256, uint256[] memory) {
|
|
198
|
+
// this is always true given Pendle SY context
|
|
199
|
+
return
|
|
200
|
+
_joinExactTokensInForBPTOut(
|
|
201
|
+
preJoinExitSupply,
|
|
202
|
+
preJoinExitInvariant,
|
|
203
|
+
currentAmp,
|
|
204
|
+
balances,
|
|
205
|
+
scalingFactors,
|
|
206
|
+
userData,
|
|
207
|
+
imd
|
|
208
|
+
);
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
function _joinExactTokensInForBPTOut(
|
|
212
|
+
uint256 actualSupply,
|
|
213
|
+
uint256 preJoinExitInvariant,
|
|
214
|
+
uint256 currentAmp,
|
|
215
|
+
uint256[] memory balances,
|
|
216
|
+
uint256[] memory scalingFactors,
|
|
217
|
+
bytes memory userData,
|
|
218
|
+
ImmutableData memory imd
|
|
219
|
+
) private view returns (uint256, uint256[] memory) {
|
|
220
|
+
(uint256[] memory amountsIn, ) = userData.exactTokensInForBptOut();
|
|
221
|
+
|
|
222
|
+
// The user-provided amountsIn is unscaled, so we address that.
|
|
223
|
+
_upscaleArray(amountsIn, _dropBptItem(imd, scalingFactors));
|
|
224
|
+
|
|
225
|
+
uint256 bptAmountOut = currentAmp._calcBptOutGivenExactTokensIn(
|
|
226
|
+
balances,
|
|
227
|
+
amountsIn,
|
|
228
|
+
actualSupply,
|
|
229
|
+
preJoinExitInvariant,
|
|
230
|
+
IBasePool(imd.LP).getSwapFeePercentage()
|
|
231
|
+
);
|
|
232
|
+
return (bptAmountOut, amountsIn);
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
function _doExit(
|
|
236
|
+
uint256[] memory balances,
|
|
237
|
+
uint256 currentAmp,
|
|
238
|
+
uint256 preJoinExitSupply,
|
|
239
|
+
uint256 preJoinExitInvariant,
|
|
240
|
+
uint256[] memory, /*scalingFactors*/
|
|
241
|
+
bytes memory userData,
|
|
242
|
+
ImmutableData memory imd
|
|
243
|
+
) internal view returns (uint256, uint256[] memory) {
|
|
244
|
+
// this is always true given Pendle SY context
|
|
245
|
+
return
|
|
246
|
+
_exitExactBPTInForTokenOut(
|
|
247
|
+
preJoinExitSupply,
|
|
248
|
+
preJoinExitInvariant,
|
|
249
|
+
currentAmp,
|
|
250
|
+
balances,
|
|
251
|
+
userData,
|
|
252
|
+
imd
|
|
253
|
+
);
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
function _exitExactBPTInForTokenOut(
|
|
257
|
+
uint256 actualSupply,
|
|
258
|
+
uint256 preJoinExitInvariant,
|
|
259
|
+
uint256 currentAmp,
|
|
260
|
+
uint256[] memory balances,
|
|
261
|
+
bytes memory userData,
|
|
262
|
+
ImmutableData memory imd
|
|
263
|
+
) private view returns (uint256, uint256[] memory) {
|
|
264
|
+
(uint256 bptAmountIn, uint256 tokenIndex) = userData.exactBptInForTokenOut();
|
|
265
|
+
|
|
266
|
+
uint256[] memory amountsOut = new uint256[](balances.length);
|
|
267
|
+
|
|
268
|
+
amountsOut[tokenIndex] = currentAmp._calcTokenOutGivenExactBptIn(
|
|
269
|
+
balances,
|
|
270
|
+
tokenIndex,
|
|
271
|
+
bptAmountIn,
|
|
272
|
+
actualSupply,
|
|
273
|
+
preJoinExitInvariant,
|
|
274
|
+
IBasePool(imd.LP).getSwapFeePercentage()
|
|
275
|
+
);
|
|
276
|
+
|
|
277
|
+
return (bptAmountIn, amountsOut);
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
function _beforeJoinExit(
|
|
281
|
+
uint256[] memory registeredBalances,
|
|
282
|
+
ImmutableData memory imd,
|
|
283
|
+
TokenRateCache[] memory caches
|
|
284
|
+
)
|
|
285
|
+
internal
|
|
286
|
+
view
|
|
287
|
+
returns (
|
|
288
|
+
uint256,
|
|
289
|
+
uint256[] memory,
|
|
290
|
+
uint256,
|
|
291
|
+
uint256
|
|
292
|
+
)
|
|
293
|
+
{
|
|
294
|
+
(uint256 lastJoinExitAmp, uint256 lastPostJoinExitInvariant) = IComposableStable(imd.LP)
|
|
295
|
+
.getLastJoinExitData();
|
|
296
|
+
|
|
297
|
+
(
|
|
298
|
+
uint256 preJoinExitSupply,
|
|
299
|
+
uint256[] memory balances,
|
|
300
|
+
uint256 oldAmpPreJoinExitInvariant
|
|
301
|
+
) = _payProtocolFeesBeforeJoinExit(
|
|
302
|
+
registeredBalances,
|
|
303
|
+
lastJoinExitAmp,
|
|
304
|
+
lastPostJoinExitInvariant,
|
|
305
|
+
imd,
|
|
306
|
+
caches
|
|
307
|
+
);
|
|
308
|
+
|
|
309
|
+
(uint256 currentAmp, , ) = IComposableStable(imd.LP).getAmplificationParameter();
|
|
310
|
+
uint256 preJoinExitInvariant = currentAmp == lastJoinExitAmp
|
|
311
|
+
? oldAmpPreJoinExitInvariant
|
|
312
|
+
: currentAmp._calculateInvariant(balances);
|
|
313
|
+
|
|
314
|
+
return (preJoinExitSupply, balances, currentAmp, preJoinExitInvariant);
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
function _payProtocolFeesBeforeJoinExit(
|
|
318
|
+
uint256[] memory registeredBalances,
|
|
319
|
+
uint256 lastJoinExitAmp,
|
|
320
|
+
uint256 lastPostJoinExitInvariant,
|
|
321
|
+
ImmutableData memory imd,
|
|
322
|
+
TokenRateCache[] memory caches
|
|
323
|
+
)
|
|
324
|
+
internal
|
|
325
|
+
view
|
|
326
|
+
returns (
|
|
327
|
+
uint256,
|
|
328
|
+
uint256[] memory,
|
|
329
|
+
uint256
|
|
330
|
+
)
|
|
331
|
+
{
|
|
332
|
+
(uint256 virtualSupply, uint256[] memory balances) = _dropBptItemFromBalances(
|
|
333
|
+
imd,
|
|
334
|
+
registeredBalances
|
|
335
|
+
);
|
|
336
|
+
|
|
337
|
+
(
|
|
338
|
+
uint256 expectedProtocolOwnershipPercentage,
|
|
339
|
+
uint256 currentInvariantWithLastJoinExitAmp
|
|
340
|
+
) = _getProtocolPoolOwnershipPercentage(
|
|
341
|
+
balances,
|
|
342
|
+
lastJoinExitAmp,
|
|
343
|
+
lastPostJoinExitInvariant,
|
|
344
|
+
imd,
|
|
345
|
+
caches
|
|
346
|
+
);
|
|
347
|
+
|
|
348
|
+
uint256 protocolFeeAmount = _calculateAdjustedProtocolFeeAmount(
|
|
349
|
+
virtualSupply,
|
|
350
|
+
expectedProtocolOwnershipPercentage
|
|
351
|
+
);
|
|
352
|
+
|
|
353
|
+
// skip _payProtocolFee, which will make the LP balance from this point onwards to be off
|
|
354
|
+
|
|
355
|
+
return (virtualSupply + protocolFeeAmount, balances, currentInvariantWithLastJoinExitAmp);
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
function _getProtocolPoolOwnershipPercentage(
|
|
359
|
+
uint256[] memory balances,
|
|
360
|
+
uint256 lastJoinExitAmp,
|
|
361
|
+
uint256 lastPostJoinExitInvariant,
|
|
362
|
+
ImmutableData memory imd,
|
|
363
|
+
TokenRateCache[] memory caches
|
|
364
|
+
) internal view returns (uint256, uint256) {
|
|
365
|
+
(
|
|
366
|
+
uint256 swapFeeGrowthInvariant,
|
|
367
|
+
uint256 totalNonExemptGrowthInvariant,
|
|
368
|
+
uint256 totalGrowthInvariant
|
|
369
|
+
) = _getGrowthInvariants(
|
|
370
|
+
balances,
|
|
371
|
+
lastJoinExitAmp,
|
|
372
|
+
lastPostJoinExitInvariant,
|
|
373
|
+
imd,
|
|
374
|
+
caches
|
|
375
|
+
);
|
|
376
|
+
|
|
377
|
+
if (totalGrowthInvariant <= lastPostJoinExitInvariant) {
|
|
378
|
+
return (0, totalGrowthInvariant);
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
uint256 swapFeeGrowthInvariantDelta = swapFeeGrowthInvariant - lastPostJoinExitInvariant;
|
|
382
|
+
uint256 nonExemptYieldGrowthInvariantDelta = totalNonExemptGrowthInvariant -
|
|
383
|
+
swapFeeGrowthInvariant;
|
|
384
|
+
|
|
385
|
+
uint256 protocolSwapFeePercentage = swapFeeGrowthInvariantDelta
|
|
386
|
+
.divDown(totalGrowthInvariant)
|
|
387
|
+
.mulDown(
|
|
388
|
+
IComposableStable(imd.LP).getProtocolFeePercentageCache(0) // ProtocolFeeType.SWAP // can't get better
|
|
389
|
+
);
|
|
390
|
+
|
|
391
|
+
uint256 protocolYieldPercentage = nonExemptYieldGrowthInvariantDelta
|
|
392
|
+
.divDown(totalGrowthInvariant)
|
|
393
|
+
.mulDown(
|
|
394
|
+
IComposableStable(imd.LP).getProtocolFeePercentageCache(2) // ProtocolFeeType.YIELD // can't get better
|
|
395
|
+
);
|
|
396
|
+
|
|
397
|
+
// These percentages can then be simply added to compute the total protocol Pool ownership percentage.
|
|
398
|
+
// This is naturally bounded above by FixedPoint.ONE so this addition cannot overflow.
|
|
399
|
+
return (protocolSwapFeePercentage + protocolYieldPercentage, totalGrowthInvariant);
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
function _getGrowthInvariants(
|
|
403
|
+
uint256[] memory balances,
|
|
404
|
+
uint256 lastJoinExitAmp,
|
|
405
|
+
uint256 lastPostJoinExitInvariant,
|
|
406
|
+
ImmutableData memory imd,
|
|
407
|
+
TokenRateCache[] memory caches
|
|
408
|
+
)
|
|
409
|
+
internal
|
|
410
|
+
pure
|
|
411
|
+
returns (
|
|
412
|
+
uint256 swapFeeGrowthInvariant,
|
|
413
|
+
uint256 totalNonExemptGrowthInvariant,
|
|
414
|
+
uint256 totalGrowthInvariant
|
|
415
|
+
)
|
|
416
|
+
{
|
|
417
|
+
// Total growth invariant is always calculated with the current (scaled / unadjusted) balances.
|
|
418
|
+
totalGrowthInvariant = lastJoinExitAmp._calculateInvariant(balances);
|
|
419
|
+
|
|
420
|
+
// If total invariant decreased, calculating the other approximations is unnecessary.
|
|
421
|
+
if (totalGrowthInvariant <= lastPostJoinExitInvariant) {
|
|
422
|
+
return (totalGrowthInvariant, totalGrowthInvariant, totalGrowthInvariant);
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
// Swap fee invariant is calculated with adjusted balances, to discount the yield.
|
|
426
|
+
swapFeeGrowthInvariant = lastJoinExitAmp._calculateInvariant(
|
|
427
|
+
_getAdjustedBalances(balances, imd, caches) // Adjust all token balances with rate providers.
|
|
428
|
+
);
|
|
429
|
+
|
|
430
|
+
// The `swapFeeGrowthInvariant` cannot ever be outside the bounds:
|
|
431
|
+
// totalGrowthInvariant >= swapFeeGrowthInvariant >= lastPostJoinExitInvariant
|
|
432
|
+
swapFeeGrowthInvariant = totalGrowthInvariant.min(swapFeeGrowthInvariant); // Set upper bound.
|
|
433
|
+
swapFeeGrowthInvariant = lastPostJoinExitInvariant.max(swapFeeGrowthInvariant); // Set lower bound.
|
|
434
|
+
|
|
435
|
+
// The only two accepted possibilities are either all tokens exempt, or none tokens exempt.
|
|
436
|
+
// totalNonExemptGrowthInvariant will either be totalGrowthInvariant or swapFeeGrowthInvariant.
|
|
437
|
+
// At this point,
|
|
438
|
+
// - totalGrowthInvariant > lastPostJoinExitInvariant
|
|
439
|
+
// - totalGrowthInvariant >= swapFeeGrowthInvariant >= lastPostJoinExitInvariant
|
|
440
|
+
// So the complete inequality will apply by the end of this function:
|
|
441
|
+
// totalGrowthInvariant >= totalNonExemptGrowthInvariant >= swapFeeGrowthInvariant >= lastPostJoinExitInvariant
|
|
442
|
+
if (imd.allTokensExempt) {
|
|
443
|
+
// If no tokens are charged fees on yield, then the non-exempt growth is equal to the swap fee growth - no
|
|
444
|
+
// yield fees will be collected.
|
|
445
|
+
|
|
446
|
+
totalNonExemptGrowthInvariant = swapFeeGrowthInvariant;
|
|
447
|
+
} else {
|
|
448
|
+
totalNonExemptGrowthInvariant = totalGrowthInvariant;
|
|
449
|
+
}
|
|
450
|
+
}
|
|
451
|
+
|
|
452
|
+
function _getAdjustedBalances(
|
|
453
|
+
uint256[] memory balances,
|
|
454
|
+
ImmutableData memory imd,
|
|
455
|
+
TokenRateCache[] memory tokenRateCaches
|
|
456
|
+
) internal pure returns (uint256[] memory) {
|
|
457
|
+
uint256 totalTokensWithoutBpt = balances.length;
|
|
458
|
+
uint256[] memory adjustedBalances = new uint256[](totalTokensWithoutBpt);
|
|
459
|
+
|
|
460
|
+
for (uint256 i = 0; i < totalTokensWithoutBpt; ++i) {
|
|
461
|
+
uint256 skipBptIndex = i >= imd.bptIndex ? i + 1 : i;
|
|
462
|
+
adjustedBalances[i] = _hasRateProvider(imd, skipBptIndex)
|
|
463
|
+
? _adjustedBalance(balances[i], tokenRateCaches[skipBptIndex])
|
|
464
|
+
: balances[i];
|
|
465
|
+
}
|
|
466
|
+
|
|
467
|
+
return adjustedBalances;
|
|
468
|
+
}
|
|
469
|
+
|
|
470
|
+
function _adjustedBalance(uint256 balance, TokenRateCache memory cache)
|
|
471
|
+
private
|
|
472
|
+
pure
|
|
473
|
+
returns (uint256)
|
|
474
|
+
{
|
|
475
|
+
return (balance * cache.oldRate) / cache.currentRate;
|
|
476
|
+
}
|
|
477
|
+
|
|
478
|
+
function _calculateAdjustedProtocolFeeAmount(uint256 supply, uint256 basePercentage)
|
|
479
|
+
internal
|
|
480
|
+
pure
|
|
481
|
+
returns (uint256)
|
|
482
|
+
{
|
|
483
|
+
return supply.mulDown(basePercentage).divDown(basePercentage.complement());
|
|
484
|
+
}
|
|
485
|
+
|
|
486
|
+
function _dropBptItemFromBalances(
|
|
487
|
+
ImmutableData memory imd,
|
|
488
|
+
uint256[] memory registeredBalances
|
|
489
|
+
) internal view returns (uint256, uint256[] memory) {
|
|
490
|
+
return (
|
|
491
|
+
_getVirtualSupply(imd, registeredBalances[imd.bptIndex]),
|
|
492
|
+
_dropBptItem(imd, registeredBalances)
|
|
493
|
+
);
|
|
494
|
+
}
|
|
495
|
+
|
|
496
|
+
function _dropBptItem(ImmutableData memory imd, uint256[] memory amounts)
|
|
497
|
+
internal
|
|
498
|
+
pure
|
|
499
|
+
returns (uint256[] memory)
|
|
500
|
+
{
|
|
501
|
+
uint256[] memory amountsWithoutBpt = new uint256[](amounts.length - 1);
|
|
502
|
+
for (uint256 i = 0; i < amountsWithoutBpt.length; i++) {
|
|
503
|
+
amountsWithoutBpt[i] = amounts[i < imd.bptIndex ? i : i + 1];
|
|
504
|
+
}
|
|
505
|
+
|
|
506
|
+
return amountsWithoutBpt;
|
|
507
|
+
}
|
|
508
|
+
|
|
509
|
+
function _getVirtualSupply(ImmutableData memory imd, uint256 bptBalance)
|
|
510
|
+
internal
|
|
511
|
+
view
|
|
512
|
+
returns (uint256)
|
|
513
|
+
{
|
|
514
|
+
return (IERC20(imd.LP).totalSupply()).sub(bptBalance); // can't get better
|
|
515
|
+
}
|
|
516
|
+
|
|
517
|
+
function _beforeSwapJoinExit(ImmutableData memory imd)
|
|
518
|
+
internal
|
|
519
|
+
view
|
|
520
|
+
returns (TokenRateCache[] memory tokenRateCaches)
|
|
521
|
+
{
|
|
522
|
+
return _cacheTokenRatesIfNecessary(imd);
|
|
523
|
+
}
|
|
524
|
+
|
|
525
|
+
function _cacheTokenRatesIfNecessary(ImmutableData memory imd)
|
|
526
|
+
internal
|
|
527
|
+
view
|
|
528
|
+
returns (TokenRateCache[] memory tokenRateCaches)
|
|
529
|
+
{
|
|
530
|
+
tokenRateCaches = new TokenRateCache[](imd.totalTokens);
|
|
531
|
+
|
|
532
|
+
for (uint256 i = 0; i < imd.totalTokens; ++i) {
|
|
533
|
+
tokenRateCaches[i] = _cacheTokenRateIfNecessary(i, imd);
|
|
534
|
+
}
|
|
535
|
+
}
|
|
536
|
+
|
|
537
|
+
/**
|
|
538
|
+
* @dev Caches the rate for a token if necessary. It ignores the call if there is no provider set.
|
|
539
|
+
*/
|
|
540
|
+
function _cacheTokenRateIfNecessary(uint256 index, ImmutableData memory imd)
|
|
541
|
+
internal
|
|
542
|
+
view
|
|
543
|
+
returns (TokenRateCache memory res)
|
|
544
|
+
{
|
|
545
|
+
if (index == imd.bptIndex || !_hasRateProvider(imd, index)) return res;
|
|
546
|
+
|
|
547
|
+
uint256 expires;
|
|
548
|
+
(res.currentRate, res.oldRate, , expires) = IComposableStable(imd.LP).getTokenRateCache(
|
|
549
|
+
IERC20(imd.poolTokens[index])
|
|
550
|
+
);
|
|
551
|
+
|
|
552
|
+
if (block.timestamp > expires) {
|
|
553
|
+
res.currentRate = IRateProvider(imd.rateProviders[index]).getRate();
|
|
554
|
+
}
|
|
555
|
+
}
|
|
556
|
+
|
|
557
|
+
function _scalingFactors(ImmutableData memory imd, TokenRateCache[] memory caches)
|
|
558
|
+
internal
|
|
559
|
+
view
|
|
560
|
+
virtual
|
|
561
|
+
returns (uint256[] memory)
|
|
562
|
+
{
|
|
563
|
+
// There is no need to check the arrays length since both are based on `_getTotalTokens`
|
|
564
|
+
uint256[] memory scalingFactors = new uint256[](imd.totalTokens);
|
|
565
|
+
|
|
566
|
+
for (uint256 i = 0; i < imd.totalTokens; ++i) {
|
|
567
|
+
scalingFactors[i] = imd.rawScalingFactors[i].mulDown(_getTokenRate(caches, i));
|
|
568
|
+
}
|
|
569
|
+
|
|
570
|
+
return scalingFactors;
|
|
571
|
+
}
|
|
572
|
+
|
|
573
|
+
function _getTokenRate(TokenRateCache[] memory caches, uint256 index)
|
|
574
|
+
internal
|
|
575
|
+
view
|
|
576
|
+
virtual
|
|
577
|
+
returns (uint256)
|
|
578
|
+
{
|
|
579
|
+
return caches[index].currentRate == 0 ? FixedPoint.ONE : caches[index].currentRate;
|
|
580
|
+
}
|
|
581
|
+
|
|
582
|
+
/*///////////////////////////////////////////////////////////////
|
|
583
|
+
Helpers functions
|
|
584
|
+
//////////////////////////////////////////////////////////////*/
|
|
585
|
+
|
|
586
|
+
function _upscaleArray(uint256[] memory amounts, uint256[] memory scalingFactors)
|
|
587
|
+
internal
|
|
588
|
+
pure
|
|
589
|
+
{
|
|
590
|
+
uint256 length = amounts.length;
|
|
591
|
+
for (uint256 i = 0; i < length; ++i) {
|
|
592
|
+
amounts[i] = FixedPoint.mulDown(amounts[i], scalingFactors[i]);
|
|
593
|
+
}
|
|
594
|
+
}
|
|
595
|
+
|
|
596
|
+
function _downscaleDownArray(uint256[] memory amounts, uint256[] memory scalingFactors)
|
|
597
|
+
internal
|
|
598
|
+
pure
|
|
599
|
+
{
|
|
600
|
+
uint256 length = amounts.length;
|
|
601
|
+
for (uint256 i = 0; i < length; ++i) {
|
|
602
|
+
amounts[i] = FixedPoint.divDown(amounts[i], scalingFactors[i]);
|
|
603
|
+
}
|
|
604
|
+
}
|
|
605
|
+
|
|
606
|
+
function _hasRateProvider(ImmutableData memory imd, uint256 index)
|
|
607
|
+
internal
|
|
608
|
+
pure
|
|
609
|
+
returns (bool)
|
|
610
|
+
{
|
|
611
|
+
return address(imd.rateProviders[index]) != address(0);
|
|
612
|
+
}
|
|
613
|
+
|
|
614
|
+
function _isTokenExemptFromYieldProtocolFee(ImmutableData memory imd, uint256 index)
|
|
615
|
+
internal
|
|
616
|
+
pure
|
|
617
|
+
returns (bool)
|
|
618
|
+
{
|
|
619
|
+
return imd.isExemptFromYieldProtocolFee[index];
|
|
620
|
+
}
|
|
621
|
+
}
|
|
@@ -65,4 +65,12 @@ library FixedPoint {
|
|
|
65
65
|
return (x < ONE) ? (ONE - x) : 0;
|
|
66
66
|
}
|
|
67
67
|
}
|
|
68
|
+
|
|
69
|
+
function max(uint256 x, uint256 y) internal pure returns (uint256) {
|
|
70
|
+
return (x > y ? x : y);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
function min(uint256 x, uint256 y) internal pure returns (uint256) {
|
|
74
|
+
return (x < y ? x : y);
|
|
75
|
+
}
|
|
68
76
|
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
2
|
+
pragma solidity 0.8.17;
|
|
3
|
+
|
|
4
|
+
import "../../../libraries/Errors.sol";
|
|
5
|
+
import "../../../../LiquidityMining/CrossChainMsg/libraries/LayerZeroHelper.sol";
|
|
6
|
+
import "../../../../interfaces/IPOracleForSy.sol";
|
|
7
|
+
import "@openzeppelin/contracts/proxy/utils/Initializable.sol";
|
|
8
|
+
|
|
9
|
+
contract PendleChainlinkReceiver is Initializable {
|
|
10
|
+
address public immutable lzEndpoint;
|
|
11
|
+
address public trustedRemoteAddr;
|
|
12
|
+
uint64 public trustedRemoteChainId;
|
|
13
|
+
int256 public latestAnswer;
|
|
14
|
+
|
|
15
|
+
modifier onlyLzEndpoint() {
|
|
16
|
+
if (msg.sender != address(lzEndpoint)) revert Errors.OnlyLayerZeroEndpoint();
|
|
17
|
+
_;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
modifier mustOriginateFromTrustedRemote(uint16 srcChainId, bytes memory path) {
|
|
21
|
+
if (
|
|
22
|
+
trustedRemoteAddr != LayerZeroHelper._getFirstAddressFromPath(path) ||
|
|
23
|
+
trustedRemoteChainId != LayerZeroHelper._getOriginalChainIds(srcChainId)
|
|
24
|
+
) revert Errors.NotFromTrustedRemote(srcChainId, path);
|
|
25
|
+
_;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
constructor(address _lzEndpoint) {
|
|
29
|
+
lzEndpoint = _lzEndpoint;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
function initialize(address _trustedRemoteAddr, uint64 _trustedRemoteChainId) external initializer {
|
|
33
|
+
trustedRemoteAddr = _trustedRemoteAddr;
|
|
34
|
+
trustedRemoteChainId = _trustedRemoteChainId;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
function lzReceive(
|
|
38
|
+
uint16 _srcChainId,
|
|
39
|
+
bytes calldata _path,
|
|
40
|
+
uint64, /*_nonce*/
|
|
41
|
+
bytes calldata _payload
|
|
42
|
+
) external onlyLzEndpoint mustOriginateFromTrustedRemote(_srcChainId, _path) {
|
|
43
|
+
int256 rate = abi.decode(_payload, (int256));
|
|
44
|
+
latestAnswer = rate;
|
|
45
|
+
}
|
|
46
|
+
}
|