@pendle/core-v2 1.0.2-mainnet → 1.1.0-testnet
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/PendleMsgReceiveEndpointUpg.sol/PendleMsgReceiveEndpointUpg.json +2 -2
- 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/PendleMsgSendEndpointUpg.sol/PendleMsgSendEndpointUpg.json +2 -2
- 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/CrossChainMsg/libraries/LayerZeroHelper.sol/LayerZeroHelper.json +2 -2
- 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/PendleGaugeControllerMainchainUpg.sol/PendleGaugeControllerMainchainUpg.json +2 -2
- package/build/artifacts/contracts/LiquidityMining/GaugeController/PendleGaugeControllerSidechainUpg.sol/PendleGaugeControllerSidechainUpg.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/GaugeController/PendleGaugeControllerSidechainUpg.sol/PendleGaugeControllerSidechainUpg.json +2 -2
- package/build/artifacts/contracts/LiquidityMining/VeDistributor/PendleFeeDistributor.sol/PendleFeeDistributor.dbg.json +4 -0
- package/build/artifacts/contracts/LiquidityMining/VeDistributor/PendleFeeDistributor.sol/PendleFeeDistributor.json +592 -0
- package/build/artifacts/contracts/LiquidityMining/VotingController/PendleVotingControllerUpg.sol/PendleVotingControllerUpg.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/VotingController/PendleVotingControllerUpg.sol/PendleVotingControllerUpg.json +2 -2
- 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/VotingEscrowPendleMainchain.sol/VotingEscrowPendleMainchain.json +2 -2
- package/build/artifacts/contracts/LiquidityMining/VotingEscrow/VotingEscrowPendleSidechain.sol/VotingEscrowPendleSidechain.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/VotingEscrow/VotingEscrowPendleSidechain.sol/VotingEscrowPendleSidechain.json +2 -2
- 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/VeBalanceLib.sol/VeBalanceLib.json +2 -2
- package/build/artifacts/contracts/LiquidityMining/libraries/VeHistoryLib.sol/CheckpointHelper.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/libraries/VeHistoryLib.sol/CheckpointHelper.json +2 -2
- package/build/artifacts/contracts/LiquidityMining/libraries/VeHistoryLib.sol/Checkpoints.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/libraries/VeHistoryLib.sol/Checkpoints.json +2 -2
- package/build/artifacts/contracts/core/BulkSeller/BulkSeller.sol/BulkSeller.dbg.json +1 -1
- package/build/artifacts/contracts/core/BulkSeller/BulkSeller.sol/BulkSeller.json +2 -2
- package/build/artifacts/contracts/core/BulkSeller/BulkSellerFactory.sol/BulkSellerFactory.dbg.json +1 -1
- package/build/artifacts/contracts/core/BulkSeller/BulkSellerFactory.sol/BulkSellerFactory.json +2 -2
- package/build/artifacts/contracts/core/BulkSeller/BulkSellerMathCore.sol/BulkSellerMathCore.dbg.json +1 -1
- package/build/artifacts/contracts/core/BulkSeller/BulkSellerMathCore.sol/BulkSellerMathCore.json +2 -2
- package/build/artifacts/contracts/core/Market/MarketMathCore.sol/MarketMathCore.dbg.json +1 -1
- package/build/artifacts/contracts/core/Market/MarketMathCore.sol/MarketMathCore.json +2 -2
- package/build/artifacts/contracts/core/Market/OracleLib.sol/OracleLib.dbg.json +1 -1
- package/build/artifacts/contracts/core/Market/OracleLib.sol/OracleLib.json +2 -2
- 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/PendleMarketFactory.sol/PendleMarketFactory.json +2 -2
- 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/SYBase.sol/SYBase.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/SYBase.sol/SYBase.json +141 -0
- package/build/artifacts/contracts/core/StandardizedYield/SYBaseWithRewards.sol/SYBaseWithRewards.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/SYBaseWithRewards.sol/SYBaseWithRewards.json +141 -0
- package/build/artifacts/contracts/core/StandardizedYield/StEthHelper.sol/StEthHelper.dbg.json +4 -0
- package/build/artifacts/contracts/core/StandardizedYield/StEthHelper.sol/StEthHelper.json +10 -0
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Ape/sAPE.sol/sAPE.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Ape/sAPE.sol/sAPE.json +143 -2
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/PendleAura3EthSY.sol/PendleAura3EthSY.dbg.json +4 -0
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/PendleAura3EthSY.sol/PendleAura3EthSY.json +1257 -0
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/PendleAuraCbethWstethSY.sol/PendleAuraCbethWstethSY.dbg.json +4 -0
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/PendleAuraCbethWstethSY.sol/PendleAuraCbethWstethSY.json +1244 -0
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/PendleAuraWethRethSY.sol/PendleAuraWethRethSY.dbg.json +4 -0
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/PendleAuraWethRethSY.sol/PendleAuraWethRethSY.json +1218 -0
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/PendleAuraWethWstethSY.sol/PendleAuraWethWstethSY.dbg.json +4 -0
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/PendleAuraWethWstethSY.sol/PendleAuraWethWstethSY.json +1192 -0
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/base/ComposableStable/ComposableStableMath.sol/ComposableStableMath.dbg.json +4 -0
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/base/ComposableStable/ComposableStableMath.sol/ComposableStableMath.json +10 -0
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/base/ComposableStable/ComposableStablePreview.sol/ComposableStablePreview.dbg.json +4 -0
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/base/ComposableStable/ComposableStablePreview.sol/ComposableStablePreview.json +133 -0
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/base/FixedPoint.sol/FixedPoint.dbg.json +4 -0
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/base/FixedPoint.sol/FixedPoint.json +10 -0
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/base/MetaStable/MetaStableMath.sol/MetaStableMath.dbg.json +4 -0
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/base/MetaStable/MetaStableMath.sol/MetaStableMath.json +40 -0
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/base/MetaStable/MetaStablePreview.sol/MetaStablePreview.dbg.json +4 -0
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/base/MetaStable/MetaStablePreview.sol/MetaStablePreview.json +322 -0
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/base/PendleAuraBalancerStableLPSY.sol/PendleAuraBalancerStableLPSY.dbg.json +4 -0
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/base/PendleAuraBalancerStableLPSY.sol/PendleAuraBalancerStableLPSY.json +1171 -0
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/base/StablePoolUserData.sol/StablePoolUserData.dbg.json +4 -0
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/base/StablePoolUserData.sol/StablePoolUserData.json +10 -0
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/base/StablePreviewBase.sol/StablePreviewBase.dbg.json +4 -0
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/base/StablePreviewBase.sol/StablePreviewBase.json +133 -0
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BenQi/PendleQiTokenHelper.sol/PendleQiTokenHelper.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BenQi/PendleQiTokenHelper.sol/PendleQiTokenHelper.json +2 -2
- 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 +143 -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 +143 -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 +143 -2
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Convex/base/PendleConvexLPSY.sol/PendleConvexLPSY.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Convex/base/PendleConvexLPSY.sol/PendleConvexLPSY.json +141 -0
- package/build/artifacts/contracts/core/StandardizedYield/implementations/GMX/GMXPreviewHelper.sol/GMXPreviewHelper.dbg.json +4 -0
- package/build/artifacts/contracts/core/StandardizedYield/implementations/GMX/GMXPreviewHelper.sol/GMXPreviewHelper.json +50 -0
- package/build/artifacts/contracts/core/StandardizedYield/implementations/GMX/PendleGlpSY.sol/PendleGlpSY.dbg.json +4 -0
- package/build/artifacts/contracts/core/StandardizedYield/implementations/GMX/PendleGlpSY.sol/PendleGlpSY.json +1163 -0
- package/build/artifacts/contracts/core/StandardizedYield/implementations/PendleLooksStakingSY.sol/PendleLooksStakingSY.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/PendleLooksStakingSY.sol/PendleLooksStakingSY.json +143 -2
- package/build/artifacts/contracts/core/StandardizedYield/implementations/PendleWstEthSY.sol/PendleWstEthSY.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/PendleWstEthSY.sol/PendleWstEthSY.json +143 -2
- 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/PendlePrincipalToken.sol/PendlePrincipalToken.json +2 -2
- 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 +4 -0
- package/build/artifacts/contracts/core/YieldContractsV2/InterestManagerYTV2.sol/InterestManagerYTV2.json +66 -0
- package/build/artifacts/contracts/core/YieldContractsV2/PendlePrincipalTokenV2.sol/PendlePrincipalTokenV2.dbg.json +4 -0
- package/build/artifacts/contracts/core/YieldContractsV2/PendlePrincipalTokenV2.sol/PendlePrincipalTokenV2.json +476 -0
- package/build/artifacts/contracts/core/YieldContractsV2/PendleYieldContractFactoryV2.sol/PendleYieldContractFactoryV2.dbg.json +4 -0
- package/build/artifacts/contracts/core/YieldContractsV2/PendleYieldContractFactoryV2.sol/PendleYieldContractFactoryV2.json +590 -0
- package/build/artifacts/contracts/core/YieldContractsV2/PendleYieldTokenV2.sol/PendleYieldTokenV2.dbg.json +4 -0
- package/build/artifacts/contracts/core/YieldContractsV2/PendleYieldTokenV2.sol/PendleYieldTokenV2.json +1017 -0
- 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/Errors.sol/Errors.json +171 -5
- package/build/artifacts/contracts/core/libraries/TokenHelper.sol/TokenHelper.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/Balancer/IAsset.sol/IAsset.dbg.json +4 -0
- package/build/artifacts/contracts/interfaces/Balancer/IAsset.sol/IAsset.json +10 -0
- package/build/artifacts/contracts/interfaces/Balancer/IBalancerFees.sol/IBalancerFees.dbg.json +4 -0
- package/build/artifacts/contracts/interfaces/Balancer/IBalancerFees.sol/IBalancerFees.json +24 -0
- package/build/artifacts/contracts/interfaces/Balancer/IBalancerStablePreview.sol/IBalancerStablePreview.dbg.json +4 -0
- package/build/artifacts/contracts/interfaces/Balancer/IBalancerStablePreview.sol/IBalancerStablePreview.json +133 -0
- package/build/artifacts/contracts/interfaces/Balancer/IBasePool.sol/IBasePool.dbg.json +4 -0
- package/build/artifacts/contracts/interfaces/Balancer/IBasePool.sol/IBasePool.json +328 -0
- package/build/artifacts/contracts/interfaces/Balancer/IComposableStable.sol/IComposableStable.dbg.json +4 -0
- package/build/artifacts/contracts/interfaces/Balancer/IComposableStable.sol/IComposableStable.json +467 -0
- package/build/artifacts/contracts/interfaces/Balancer/IGauge.sol/IGauge.dbg.json +4 -0
- package/build/artifacts/contracts/interfaces/{IPFeeDistributorFactory.sol/IPFeeDistributorFactory.json → Balancer/IGauge.sol/IGauge.json} +18 -33
- package/build/artifacts/contracts/interfaces/Balancer/ILiquidityGaugeFactory.sol/ILiquidityGaugeFactory.dbg.json +4 -0
- package/build/artifacts/contracts/interfaces/Balancer/ILiquidityGaugeFactory.sol/ILiquidityGaugeFactory.json +30 -0
- package/build/artifacts/contracts/interfaces/Balancer/IMetaStablePool.sol/IMetaStablePool.dbg.json +4 -0
- package/build/artifacts/contracts/interfaces/Balancer/IMetaStablePool.sol/IMetaStablePool.json +398 -0
- package/build/artifacts/contracts/interfaces/Balancer/IRateProvider.sol/IRateProvider.dbg.json +4 -0
- package/build/artifacts/contracts/{router/kyberswap/KyberSwapHelper.sol/KyberSwapHelper.json → interfaces/Balancer/IRateProvider.sol/IRateProvider.json} +5 -5
- package/build/artifacts/contracts/interfaces/Balancer/IVault.sol/IVault.dbg.json +4 -0
- package/build/artifacts/contracts/interfaces/Balancer/IVault.sol/IVault.json +278 -0
- package/build/artifacts/contracts/interfaces/ConvexCurve/IRewards.sol/IRewards.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/ConvexCurve/IRewards.sol/IRewards.json +18 -0
- package/build/artifacts/contracts/interfaces/GMX/IGMXVault.sol/IGMXVault.dbg.json +4 -0
- package/build/artifacts/contracts/interfaces/GMX/IGMXVault.sol/IGMXVault.json +308 -0
- package/build/artifacts/contracts/interfaces/GMX/IGlpManager.sol/IGlpManager.dbg.json +4 -0
- package/build/artifacts/contracts/interfaces/GMX/IGlpManager.sol/IGlpManager.json +43 -0
- package/build/artifacts/contracts/interfaces/GMX/IRewardRouterV2.sol/IRewardRouterV2.dbg.json +4 -0
- package/build/artifacts/contracts/{LiquidityMining/FeeDistributor/EpochResultManager.sol/EpochResultManager.json → interfaces/GMX/IRewardRouterV2.sol/IRewardRouterV2.json} +80 -46
- package/build/artifacts/contracts/interfaces/GMX/IVaultPriceFeed.sol/IVaultPriceFeed.dbg.json +4 -0
- package/build/artifacts/contracts/interfaces/GMX/IVaultPriceFeed.sol/IVaultPriceFeed.json +45 -0
- package/build/artifacts/contracts/interfaces/IApeStaking.sol/IApeStaking.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IDiamondCut.sol/IDiamondCut.dbg.json +4 -0
- package/build/artifacts/contracts/interfaces/IDiamondCut.sol/IDiamondCut.json +93 -0
- package/build/artifacts/contracts/interfaces/IDiamondLoupe.sol/IDiamondLoupe.dbg.json +4 -0
- package/build/artifacts/contracts/interfaces/IDiamondLoupe.sol/IDiamondLoupe.json +87 -0
- package/build/artifacts/contracts/interfaces/IPActionAddRemoveLiq.sol/IPActionAddRemoveLiq.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPActionAddRemoveLiq.sol/IPActionAddRemoveLiq.json +338 -16
- package/build/artifacts/contracts/interfaces/IPActionMintRedeem.sol/IPActionMintRedeem.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPActionMintRedeem.sol/IPActionMintRedeem.json +105 -224
- package/build/artifacts/contracts/interfaces/IPActionMisc.sol/IPActionMisc.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPActionMisc.sol/IPActionMisc.json +56 -12
- package/build/artifacts/contracts/interfaces/IPActionSwapPT.sol/IPActionSwapPT.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPActionSwapPT.sol/IPActionSwapPT.json +52 -8
- package/build/artifacts/contracts/interfaces/IPActionSwapYT.sol/IPActionSwapYT.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPActionSwapYT.sol/IPActionSwapYT.json +231 -8
- package/build/artifacts/contracts/interfaces/IPAllAction.sol/IPAllAction.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPAllAction.sol/IPAllAction.json +675 -241
- package/build/artifacts/contracts/interfaces/IPBulkSeller.sol/IPBulkSeller.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPFeeDistributor.sol/IPFeeDistributor.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPFeeDistributor.sol/IPFeeDistributor.json +43 -32
- package/build/artifacts/contracts/interfaces/IPInterestManagerYTV2.sol/IPInterestManagerYTV2.dbg.json +4 -0
- package/build/artifacts/contracts/interfaces/IPInterestManagerYTV2.sol/IPInterestManagerYTV2.json +40 -0
- package/build/artifacts/contracts/interfaces/IPMarket.sol/IPMarket.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/IPYieldTokenV2.sol/IPYieldTokenV2.dbg.json +4 -0
- package/build/artifacts/contracts/interfaces/IPYieldTokenV2.sol/IPYieldTokenV2.json +679 -0
- package/build/artifacts/contracts/offchain-helpers/BulkSellerOffchain.sol/BulkSellerOffchain.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/BulkSellerOffchain.sol/BulkSellerOffchain.json +2 -2
- package/build/artifacts/contracts/offchain-helpers/MarketMathStatic.sol/MarketMathStatic.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/MarketMathStatic.sol/MarketMathStatic.json +2 -28
- package/build/artifacts/contracts/offchain-helpers/Multicall2.sol/Multicall2.dbg.json +4 -0
- package/build/artifacts/contracts/offchain-helpers/Multicall2.sol/Multicall2.json +322 -0
- package/build/artifacts/contracts/offchain-helpers/PendleMulticall.sol/PendleMulticall.dbg.json +4 -0
- package/build/artifacts/contracts/offchain-helpers/PendleMulticall.sol/PendleMulticall.json +47 -0
- package/build/artifacts/contracts/offchain-helpers/RouterStatic.sol/RouterStatic.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/RouterStatic.sol/RouterStatic.json +144 -60
- package/build/artifacts/contracts/router/ActionAddRemoveLiq.sol/ActionAddRemoveLiq.dbg.json +1 -1
- package/build/artifacts/contracts/router/ActionAddRemoveLiq.sol/ActionAddRemoveLiq.json +345 -62
- package/build/artifacts/contracts/router/ActionMintRedeem.sol/ActionMintRedeem.dbg.json +1 -1
- package/build/artifacts/contracts/router/ActionMintRedeem.sol/ActionMintRedeem.json +107 -260
- package/build/artifacts/contracts/router/ActionMisc.sol/ActionMisc.dbg.json +1 -1
- package/build/artifacts/contracts/router/ActionMisc.sol/ActionMisc.json +57 -18
- package/build/artifacts/contracts/router/ActionSwapPT.sol/ActionSwapPT.dbg.json +1 -1
- package/build/artifacts/contracts/router/ActionSwapPT.sol/ActionSwapPT.json +54 -65
- package/build/artifacts/contracts/router/ActionSwapYT.sol/ActionSwapYT.dbg.json +1 -1
- package/build/artifacts/contracts/router/ActionSwapYT.sol/ActionSwapYT.json +338 -45
- package/build/artifacts/contracts/router/PendleRouter.sol/PendleRouter.dbg.json +1 -1
- package/build/artifacts/contracts/router/PendleRouter.sol/PendleRouter.json +76 -67
- package/build/artifacts/contracts/router/base/ActionBaseCallback.sol/ActionBaseCallback.dbg.json +4 -0
- package/build/artifacts/contracts/router/base/ActionBaseCallback.sol/ActionBaseCallback.json +141 -0
- package/build/artifacts/contracts/router/base/ActionBaseMintRedeem.sol/ActionBaseMintRedeem.dbg.json +1 -1
- package/build/artifacts/contracts/router/base/ActionBaseMintRedeem.sol/ActionBaseMintRedeem.json +1 -15
- 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/MarketApproxPtInLib.json +2 -2
- package/build/artifacts/contracts/router/base/MarketApproxLib.sol/MarketApproxPtOutLib.dbg.json +1 -1
- package/build/artifacts/contracts/router/base/MarketApproxLib.sol/MarketApproxPtOutLib.json +2 -2
- package/build/artifacts/contracts/router/swap-aggregator/1inch/I1inchAggregationRouterV5.sol/I1inchAggregationRouterV5.dbg.json +4 -0
- package/build/artifacts/contracts/router/swap-aggregator/1inch/I1inchAggregationRouterV5.sol/I1inchAggregationRouterV5.json +160 -0
- package/build/artifacts/contracts/router/swap-aggregator/1inch/OneInchAggregationRouterHelper.sol/OneInchAggregationRouterHelper.dbg.json +4 -0
- package/build/artifacts/contracts/router/swap-aggregator/1inch/OneInchAggregationRouterHelper.sol/OneInchAggregationRouterHelper.json +10 -0
- package/build/artifacts/contracts/router/swap-aggregator/IPSwapAggregator.sol/IPSwapAggregator.dbg.json +4 -0
- package/build/artifacts/contracts/router/swap-aggregator/IPSwapAggregator.sol/IPSwapAggregator.json +56 -0
- package/build/artifacts/contracts/router/swap-aggregator/PendleSwapAggregator.sol/PendleSwapAggregator.dbg.json +4 -0
- package/build/artifacts/contracts/router/swap-aggregator/PendleSwapAggregator.sol/PendleSwapAggregator.json +97 -0
- package/build/artifacts/contracts/router/swap-aggregator/kyberswap/KyberAggregationRouterHelper.sol/KyberAggregationRouterHelper.dbg.json +4 -0
- package/build/artifacts/contracts/router/swap-aggregator/kyberswap/KyberAggregationRouterHelper.sol/KyberAggregationRouterHelper.json +10 -0
- package/build/artifacts/contracts/router/swap-aggregator/kyberswap/ScaleDataHelperEthereum1.sol/ScaleDataHelperEthereum1.dbg.json +4 -0
- package/build/artifacts/contracts/router/swap-aggregator/kyberswap/ScaleDataHelperEthereum1.sol/ScaleDataHelperEthereum1.json +10 -0
- package/build/artifacts/contracts/router/swap-aggregator/kyberswap/interfaces/IAggregationExecutor.sol/IAggregationExecutor.dbg.json +4 -0
- package/build/artifacts/contracts/router/swap-aggregator/kyberswap/interfaces/IAggregationExecutor.sol/IAggregationExecutor.json +65 -0
- package/build/artifacts/contracts/router/swap-aggregator/kyberswap/interfaces/IExecutorHelperEthereum1.sol/IExecutorHelperEthereum1.dbg.json +4 -0
- package/build/artifacts/contracts/router/swap-aggregator/kyberswap/interfaces/IExecutorHelperEthereum1.sol/IExecutorHelperEthereum1.json +388 -0
- package/build/artifacts/contracts/router/swap-aggregator/kyberswap/interfaces/IHashflow.sol/IHashflow.dbg.json +4 -0
- package/build/artifacts/contracts/router/swap-aggregator/kyberswap/interfaces/IHashflow.sol/IHashflow.json +101 -0
- package/build/artifacts/contracts/router/swap-aggregator/kyberswap/interfaces/IMetaAggregationRouterV2.sol/IMetaAggregationRouterV2.dbg.json +4 -0
- package/build/artifacts/contracts/router/swap-aggregator/kyberswap/interfaces/IMetaAggregationRouterV2.sol/IMetaAggregationRouterV2.json +215 -0
- package/contracts/LiquidityMining/CrossChainMsg/libraries/LayerZeroHelper.sol +7 -9
- package/contracts/LiquidityMining/VeDistributor/PendleFeeDistributor.sol +224 -0
- package/contracts/core/BulkSeller/BulkSeller.sol +1 -1
- package/contracts/core/StandardizedYield/SYBase.sol +23 -5
- package/contracts/core/StandardizedYield/StEthHelper.sol +71 -0
- package/contracts/core/StandardizedYield/implementations/BalancerStable/PendleAura3EthSY.sol +170 -0
- package/contracts/core/StandardizedYield/implementations/BalancerStable/PendleAuraCbethWstethSY.sol +162 -0
- package/contracts/core/StandardizedYield/implementations/BalancerStable/PendleAuraWethRethSY.sol +134 -0
- package/contracts/core/StandardizedYield/implementations/BalancerStable/PendleAuraWethWstethSY.sol +154 -0
- package/contracts/core/StandardizedYield/implementations/BalancerStable/base/ComposableStable/ComposableStableMath.sol +289 -0
- package/contracts/core/StandardizedYield/implementations/BalancerStable/base/ComposableStable/ComposableStablePreview.sol +618 -0
- package/contracts/core/StandardizedYield/implementations/BalancerStable/base/FixedPoint.sol +68 -0
- package/contracts/core/StandardizedYield/implementations/BalancerStable/base/MetaStable/MetaStableMath.sol +322 -0
- package/contracts/core/StandardizedYield/implementations/BalancerStable/base/MetaStable/MetaStablePreview.sol +390 -0
- package/contracts/core/StandardizedYield/implementations/BalancerStable/base/PendleAuraBalancerStableLPSY.sol +329 -0
- package/contracts/core/StandardizedYield/implementations/BalancerStable/base/StablePoolUserData.sol +30 -0
- package/contracts/core/StandardizedYield/implementations/BalancerStable/base/StablePreviewBase.sol +189 -0
- package/contracts/core/StandardizedYield/implementations/GMX/GMXPreviewHelper.sol +142 -0
- package/contracts/core/StandardizedYield/implementations/GMX/PendleGlpSY.sol +244 -0
- package/contracts/core/StandardizedYield/implementations/GMX/README.md +61 -0
- package/contracts/core/YieldContracts/PendleYieldContractFactory.sol +10 -0
- package/contracts/core/YieldContractsV2/InterestManagerYTV2.sol +114 -0
- package/contracts/core/YieldContractsV2/PendlePrincipalTokenV2.sol +63 -0
- package/contracts/core/YieldContractsV2/PendleYieldContractFactoryV2.sol +200 -0
- package/contracts/core/YieldContractsV2/PendleYieldTokenV2.sol +485 -0
- package/contracts/core/libraries/ArrayLib.sol +12 -0
- package/contracts/core/libraries/Errors.sol +18 -2
- package/contracts/core/libraries/TokenHelper.sol +10 -0
- package/contracts/interfaces/Balancer/IAsset.sol +4 -0
- package/contracts/interfaces/Balancer/IBalancerFees.sol +6 -0
- package/contracts/interfaces/Balancer/IBalancerStablePreview.sol +22 -0
- package/contracts/interfaces/Balancer/IBasePool.sol +30 -0
- package/contracts/interfaces/Balancer/IComposableStable.sol +39 -0
- package/contracts/interfaces/Balancer/IGauge.sol +10 -0
- package/contracts/interfaces/Balancer/ILiquidityGaugeFactory.sol +6 -0
- package/contracts/interfaces/Balancer/IMetaStablePool.sol +31 -0
- package/contracts/interfaces/Balancer/IRateProvider.sol +6 -0
- package/contracts/interfaces/Balancer/IVault.sol +78 -0
- package/contracts/interfaces/ConvexCurve/IRewards.sol +5 -0
- package/contracts/interfaces/GMX/IGMXVault.sol +47 -0
- package/contracts/interfaces/GMX/IGlpManager.sol +8 -0
- package/contracts/interfaces/GMX/IRewardRouterV2.sol +35 -0
- package/contracts/interfaces/GMX/IVaultPriceFeed.sol +11 -0
- package/contracts/interfaces/IDiamondCut.sol +36 -0
- package/contracts/interfaces/IDiamondLoupe.sol +38 -0
- package/contracts/interfaces/IPActionAddRemoveLiq.sol +36 -1
- package/contracts/interfaces/IPActionMintRedeem.sol +2 -55
- package/contracts/interfaces/IPActionMisc.sol +20 -3
- package/contracts/interfaces/IPActionSwapPT.sol +1 -1
- package/contracts/interfaces/IPActionSwapYT.sol +28 -4
- package/contracts/interfaces/IPAllAction.sol +5 -3
- package/contracts/interfaces/IPFeeDistributor.sol +12 -10
- package/contracts/interfaces/IPInterestManagerYTV2.sol +13 -0
- package/contracts/interfaces/IPYieldTokenV2.sol +66 -0
- package/contracts/offchain-helpers/MarketMathStatic.sol +16 -1
- package/contracts/offchain-helpers/Multicall2.sol +103 -0
- package/contracts/offchain-helpers/PendleMulticall.sol +26 -0
- package/contracts/offchain-helpers/RouterStatic.sol +22 -0
- package/contracts/router/ActionAddRemoveLiq.sol +116 -6
- package/contracts/router/ActionMintRedeem.sol +12 -202
- package/contracts/router/ActionMisc.sol +45 -19
- package/contracts/router/ActionSwapPT.sol +0 -5
- package/contracts/router/ActionSwapYT.sol +98 -13
- package/contracts/router/PendleRouter.sol +211 -72
- package/contracts/router/{ActionCallback.sol → base/ActionBaseCallback.sol} +47 -47
- package/contracts/router/base/ActionBaseMintRedeem.sol +105 -60
- package/contracts/router/base/CallbackHelper.sol +137 -44
- package/contracts/router/base/MarketApproxLib.sol +227 -350
- package/contracts/router/swap-aggregator/1inch/I1inchAggregationRouterV5.sol +45 -0
- package/contracts/router/swap-aggregator/1inch/OneInchAggregationRouterHelper.sol +69 -0
- package/contracts/router/swap-aggregator/IPSwapAggregator.sol +30 -0
- package/contracts/router/swap-aggregator/PendleSwapAggregator.sol +63 -0
- package/contracts/router/swap-aggregator/kyberswap/KyberAggregationRouterHelper.sol +214 -0
- package/contracts/router/swap-aggregator/kyberswap/ScaleDataHelperEthereum1.sol +147 -0
- package/contracts/router/swap-aggregator/kyberswap/interfaces/IAggregationExecutor.sol +17 -0
- package/contracts/router/swap-aggregator/kyberswap/interfaces/IExecutorHelperEthereum1.sol +191 -0
- package/contracts/router/swap-aggregator/kyberswap/interfaces/IHashflow.sol +30 -0
- package/contracts/router/swap-aggregator/kyberswap/interfaces/IMetaAggregationRouterV2.sol +42 -0
- package/deployments/43113-core.json +30 -0
- package/deployments/43113-markets/APE-30-MARCH.json +10 -0
- package/deployments/43113-markets/USDC-FEB-2ND-2024.json +10 -0
- package/deployments/43113-markets/USDC-FEB-2ND.json +10 -0
- package/deployments/43113-markets/USDC-FEB-4TH.json +10 -0
- package/deployments/43113-markets/WETH-FEB-2ND.json +11 -0
- package/deployments/43113-markets/WETH-FEB-4TH.json +11 -0
- package/deployments/43113-offchain-helper.json +4 -0
- package/deployments/43113-testenv.json +22 -0
- package/deployments/80001-core.json +29 -0
- package/deployments/80001-markets/GLP-DEC-8TH.json +10 -0
- package/deployments/80001-markets/USDC-DEC-8TH.json +10 -0
- package/deployments/80001-markets/USDC-FEB-4TH.json +10 -0
- package/deployments/80001-markets/WETH-FEB-4TH.json +11 -0
- package/deployments/80001-offchain-helper.json +4 -0
- package/deployments/80001-testenv.json +22 -0
- package/package.json +6 -6
- package/typechain-types/ActionAddRemoveLiq.ts +203 -23
- package/typechain-types/ActionBaseCallback.ts +115 -0
- package/typechain-types/ActionMintRedeem.ts +29 -230
- package/typechain-types/ActionMisc.ts +78 -27
- package/typechain-types/ActionSwapPT.ts +26 -31
- package/typechain-types/ActionSwapYT.ts +202 -21
- package/typechain-types/BribeDistributor.ts +363 -0
- package/typechain-types/ComposableStablePreview.ts +217 -0
- package/typechain-types/DistributorBase.ts +363 -0
- package/typechain-types/FeeDistributor.ts +416 -0
- package/typechain-types/GMXPreviewHelper.ts +121 -0
- package/typechain-types/I1inchAggregationRouterV5.ts +257 -0
- package/typechain-types/IAggregationExecutor.ts +182 -0
- package/typechain-types/IBalancerFees.ts +89 -0
- package/typechain-types/IBalancerStablePreview.ts +217 -0
- package/typechain-types/IBasePool.ts +482 -0
- package/typechain-types/IComposableStable.ts +730 -0
- package/typechain-types/IDiamondCut.ts +152 -0
- package/typechain-types/IDiamondLoupe.ts +190 -0
- package/typechain-types/IExecutorHelperEthereum1.ts +643 -0
- package/typechain-types/IGMXVault.ts +494 -0
- package/typechain-types/IGauge.ts +160 -0
- package/typechain-types/IGlpManager.ts +115 -0
- package/typechain-types/IHashflow.ts +159 -0
- package/typechain-types/IKyberSwapAggregationRouterHelper.ts +109 -0
- package/typechain-types/ILiquidityGaugeFactory.ts +99 -0
- package/typechain-types/IMetaAggregationRouter.ts +213 -0
- package/typechain-types/IMetaAggregationRouterV2.ts +221 -0
- package/typechain-types/IMetaStablePool.ts +619 -0
- package/typechain-types/IMultihopRouterEthereum.ts +209 -0
- package/typechain-types/IPActionAddRemoveLiq.ts +213 -14
- package/typechain-types/IPActionMintRedeem.ts +29 -211
- package/typechain-types/IPActionMisc.ts +78 -27
- package/typechain-types/IPActionSwapPT.ts +26 -12
- package/typechain-types/IPActionSwapYT.ts +168 -12
- package/typechain-types/IPAllAction.ts +445 -227
- package/typechain-types/IPFeeDistributor.ts +61 -78
- package/typechain-types/IPFeeDistributorFactory.ts +53 -139
- package/typechain-types/IPInterestManagerYTV2.ts +117 -0
- package/typechain-types/IPSwapAggregator.ts +126 -0
- package/typechain-types/IPYieldTokenV2.ts +901 -0
- package/typechain-types/IRateProvider.ts +81 -0
- package/typechain-types/IRewardRouterV2.ts +303 -0
- package/typechain-types/IRewards.ts +35 -5
- package/typechain-types/ISwapAggregator.ts +124 -0
- package/typechain-types/IVault.ts +410 -0
- package/typechain-types/IVaultPriceFeed.ts +114 -0
- package/typechain-types/InterestManagerYTV2.ts +157 -0
- package/typechain-types/MetaStableMath.ts +113 -0
- package/typechain-types/MetaStablePreview.ts +501 -0
- package/typechain-types/Multicall2.ts +437 -0
- package/typechain-types/PendleAura3EthSY.ts +1600 -0
- package/typechain-types/PendleAuraBalancerStableLPSY.ts +1523 -0
- package/typechain-types/PendleAuraCbethWstethSY.ts +1587 -0
- package/typechain-types/PendleAuraWethRethSY.ts +1549 -0
- package/typechain-types/PendleAuraWethWstethSY.ts +1523 -0
- package/typechain-types/PendleConvexLPSY.ts +204 -0
- package/typechain-types/PendleCurveFraxUsdcSY.ts +204 -0
- package/typechain-types/PendleCurveUsdd3CrvSY.ts +204 -0
- package/typechain-types/PendleFeeDistributor.ts +409 -117
- package/typechain-types/PendleGlpSY.ts +1463 -0
- package/typechain-types/PendleLooksStakingSY.ts +204 -0
- package/typechain-types/PendleMulticall.ts +110 -0
- package/typechain-types/PendlePrincipalTokenV2.ts +614 -0
- package/typechain-types/PendleQiTokenSY.ts +204 -0
- package/typechain-types/PendleRouter.ts +109 -131
- package/typechain-types/PendleSwapAggregator.ts +167 -0
- package/typechain-types/PendleWstEthSY.ts +204 -0
- package/typechain-types/PendleYieldContractFactoryV2.ts +801 -0
- package/typechain-types/PendleYieldTokenV2.ts +1298 -0
- package/typechain-types/RouterStatic.ts +92 -0
- package/typechain-types/SAPE.ts +204 -0
- package/typechain-types/SYBase.ts +204 -0
- package/typechain-types/SYBaseWithRewards.ts +204 -0
- package/typechain-types/StEthHelper.ts +107 -0
- package/typechain-types/StablePreviewBase.ts +217 -0
- package/typechain-types/SwapAggregator.ts +406 -0
- package/typechain-types/factories/ActionAddRemoveLiq__factory.ts +346 -68
- package/typechain-types/factories/ActionBaseCallback__factory.ts +156 -0
- package/typechain-types/factories/ActionCallback__factory.ts +1 -1
- package/typechain-types/factories/ActionMintRedeem__factory.ts +108 -266
- package/typechain-types/factories/ActionMisc__factory.ts +56 -17
- package/typechain-types/factories/ActionSwapPTYT__factory.ts +1 -1
- package/typechain-types/factories/ActionSwapPT__factory.ts +55 -71
- package/typechain-types/factories/ActionSwapYT__factory.ts +341 -48
- package/typechain-types/factories/AggregationRouterHelper__factory.ts +1 -1
- package/typechain-types/factories/BribeDistributor__factory.ts +303 -0
- package/typechain-types/factories/BulkSellerFactory__factory.ts +1 -1
- package/typechain-types/factories/BulkSellerOffchain__factory.ts +1 -1
- package/typechain-types/factories/BulkSeller__factory.ts +1 -1
- package/typechain-types/factories/ComposableStablePreview__factory.ts +190 -0
- package/typechain-types/factories/DistributorBase__factory.ts +249 -0
- package/typechain-types/factories/Errors__factory.ts +170 -4
- package/typechain-types/factories/FeeDistributor__factory.ts +339 -0
- package/typechain-types/factories/GMXPreviewHelper__factory.ts +65 -0
- package/typechain-types/factories/I1inchAggregationRouterV5__factory.ts +179 -0
- package/typechain-types/factories/IAggregationExecutor__factory.ts +84 -0
- package/typechain-types/factories/IBalancerFees__factory.ts +36 -0
- package/typechain-types/factories/IBalancerStablePreview__factory.ts +152 -0
- package/typechain-types/factories/IBasePool__factory.ts +340 -0
- package/typechain-types/factories/IComposableStable__factory.ts +482 -0
- package/typechain-types/factories/IDiamondCut__factory.ts +105 -0
- package/typechain-types/factories/IDiamondLoupe__factory.ts +99 -0
- package/typechain-types/factories/IExecutorHelperEthereum1__factory.ts +407 -0
- package/typechain-types/factories/IGMXVault__factory.ts +320 -0
- package/typechain-types/factories/IGauge__factory.ts +70 -0
- package/typechain-types/factories/IGlpManager__factory.ts +55 -0
- package/typechain-types/factories/IHashflow__factory.ts +113 -0
- package/typechain-types/factories/IKyberSwapAggregationRouterHelper__factory.ts +56 -0
- package/typechain-types/factories/ILiquidityGaugeFactory__factory.ts +49 -0
- package/typechain-types/factories/IMetaAggregationRouterV2__factory.ts +234 -0
- package/typechain-types/factories/IMetaAggregationRouter__factory.ts +202 -0
- package/typechain-types/factories/IMetaStablePool__factory.ts +413 -0
- package/typechain-types/factories/IMultihopRouterEthereum__factory.ts +155 -0
- package/typechain-types/factories/IPActionAddRemoveLiq__factory.ts +338 -16
- package/typechain-types/factories/IPActionMintRedeem__factory.ts +105 -224
- package/typechain-types/factories/IPActionMisc__factory.ts +55 -11
- package/typechain-types/factories/IPActionSwapPT__factory.ts +52 -8
- package/typechain-types/factories/IPActionSwapYT__factory.ts +231 -8
- package/typechain-types/factories/IPAllAction__factory.ts +675 -241
- package/typechain-types/factories/IPFeeDistributorFactory__factory.ts +25 -34
- package/typechain-types/factories/IPFeeDistributor__factory.ts +42 -31
- package/typechain-types/factories/IPInterestManagerYTV2__factory.ts +59 -0
- package/typechain-types/factories/IPSwapAggregator__factory.ts +71 -0
- package/typechain-types/factories/IPYieldTokenV2__factory.ts +694 -0
- package/typechain-types/factories/IRateProvider__factory.ts +36 -0
- package/typechain-types/factories/IRewardRouterV2__factory.ts +180 -0
- package/typechain-types/factories/IRewards__factory.ts +18 -0
- package/typechain-types/factories/ISwapAggregator__factory.ts +66 -0
- package/typechain-types/factories/IVaultPriceFeed__factory.ts +60 -0
- package/typechain-types/factories/IVault__factory.ts +287 -0
- package/typechain-types/factories/InterestManagerYTV2__factory.ts +81 -0
- package/typechain-types/factories/MarketMathStatic__factory.ts +1 -27
- package/typechain-types/factories/MetaStableMath__factory.ts +93 -0
- package/typechain-types/factories/MetaStablePreview__factory.ts +375 -0
- package/typechain-types/factories/Multicall2__factory.ts +372 -0
- package/typechain-types/factories/OracleLib__factory.ts +1 -1
- package/typechain-types/factories/PendleAura3EthSY__factory.ts +1326 -0
- package/typechain-types/factories/PendleAuraBalancerStableLPSY__factory.ts +1190 -0
- package/typechain-types/factories/PendleAuraCbethWstethSY__factory.ts +1317 -0
- package/typechain-types/factories/PendleAuraWethRethSY__factory.ts +1291 -0
- package/typechain-types/factories/PendleAuraWethWstethSY__factory.ts +1265 -0
- package/typechain-types/factories/PendleConvexLPSY__factory.ts +141 -0
- package/typechain-types/factories/PendleCurveFraxUsdcSY__factory.ts +142 -1
- package/typechain-types/factories/PendleCurveUsdd3CrvSY__factory.ts +142 -1
- package/typechain-types/factories/PendleFeeDistributor__factory.ts +341 -66
- package/typechain-types/factories/PendleGaugeControllerMainchainUpg__factory.ts +1 -1
- package/typechain-types/factories/PendleGaugeControllerSidechainUpg__factory.ts +1 -1
- package/typechain-types/factories/PendleGlpSY__factory.ts +1249 -0
- package/typechain-types/factories/PendleLooksStakingSY__factory.ts +142 -1
- package/typechain-types/factories/PendleMarketFactory__factory.ts +1 -1
- package/typechain-types/factories/PendleMarket__factory.ts +1 -1
- package/typechain-types/factories/PendleMsgReceiveEndpointUpg__factory.ts +1 -1
- package/typechain-types/factories/PendleMsgSendEndpointUpg__factory.ts +1 -1
- package/typechain-types/factories/PendleMulticall__factory.ts +100 -0
- package/typechain-types/factories/PendlePrincipalTokenV2__factory.ts +564 -0
- package/typechain-types/factories/PendlePrincipalToken__factory.ts +1 -1
- package/typechain-types/factories/PendleQiTokenHelper__factory.ts +1 -1
- package/typechain-types/factories/PendleQiTokenSY__factory.ts +142 -1
- package/typechain-types/factories/PendleRouter__factory.ts +75 -74
- package/typechain-types/factories/PendleSwapAggregator__factory.ts +154 -0
- package/typechain-types/factories/PendleVotingControllerUpg__factory.ts +1 -1
- package/typechain-types/factories/PendleWstEthSY__factory.ts +142 -1
- package/typechain-types/factories/PendleYieldContractFactoryV2__factory.ts +674 -0
- package/typechain-types/factories/PendleYieldContractFactory__factory.ts +1 -1
- package/typechain-types/factories/PendleYieldTokenV2__factory.ts +1109 -0
- package/typechain-types/factories/PendleYieldToken__factory.ts +1 -1
- package/typechain-types/factories/RouterStatic__factory.ts +69 -1
- package/typechain-types/factories/SAPE__factory.ts +142 -1
- package/typechain-types/factories/SYBaseWithRewards__factory.ts +141 -0
- package/typechain-types/factories/SYBase__factory.ts +141 -0
- package/typechain-types/factories/StEthHelper__factory.ts +62 -0
- package/typechain-types/factories/StablePreviewBase__factory.ts +148 -0
- package/typechain-types/factories/SwapAggregator__factory.ts +309 -0
- package/typechain-types/factories/VotingEscrowPendleMainchain__factory.ts +1 -1
- package/typechain-types/factories/VotingEscrowPendleSidechain__factory.ts +1 -1
- package/typechain-types/hardhat.d.ts +365 -86
- package/typechain-types/index.ts +86 -24
- package/build/artifacts/contracts/LiquidityMining/FeeDistributor/EpochResultManager.sol/EpochResultManager.dbg.json +0 -4
- package/build/artifacts/contracts/LiquidityMining/FeeDistributor/PendleFeeDistributor.sol/PendleFeeDistributor.dbg.json +0 -4
- package/build/artifacts/contracts/LiquidityMining/FeeDistributor/PendleFeeDistributor.sol/PendleFeeDistributor.json +0 -310
- package/build/artifacts/contracts/LiquidityMining/FeeDistributor/PendleFeeDistributorFactory.sol/PendleFeeDistributorFactory.dbg.json +0 -4
- package/build/artifacts/contracts/LiquidityMining/FeeDistributor/PendleFeeDistributorFactory.sol/PendleFeeDistributorFactory.json +0 -389
- package/build/artifacts/contracts/interfaces/IPActionSwapPTYT.sol/IPActionSwapPTYT.dbg.json +0 -4
- package/build/artifacts/contracts/interfaces/IPActionSwapPTYT.sol/IPActionSwapPTYT.json +0 -190
- package/build/artifacts/contracts/interfaces/IPFeeDistributorFactory.sol/IPFeeDistributorFactory.dbg.json +0 -4
- package/build/artifacts/contracts/router/ActionCallback.sol/ActionCallback.dbg.json +0 -4
- package/build/artifacts/contracts/router/ActionCallback.sol/ActionCallback.json +0 -165
- package/build/artifacts/contracts/router/ActionSwapPTYT.sol/ActionSwapPTYT.dbg.json +0 -4
- package/build/artifacts/contracts/router/ActionSwapPTYT.sol/ActionSwapPTYT.json +0 -343
- package/build/artifacts/contracts/router/kyberswap/AggregationRouterHelper.sol/AggregationRouterHelper.dbg.json +0 -4
- package/build/artifacts/contracts/router/kyberswap/AggregationRouterHelper.sol/AggregationRouterHelper.json +0 -224
- package/build/artifacts/contracts/router/kyberswap/IAggregatorRouterHelper.sol/IAggregationRouterHelper.dbg.json +0 -4
- package/build/artifacts/contracts/router/kyberswap/IAggregatorRouterHelper.sol/IAggregationRouterHelper.json +0 -35
- package/build/artifacts/contracts/router/kyberswap/IMultihopRouter.sol/IMultihopRouter.dbg.json +0 -4
- package/build/artifacts/contracts/router/kyberswap/IMultihopRouter.sol/IMultihopRouter.json +0 -136
- package/build/artifacts/contracts/router/kyberswap/KyberSwapHelper.sol/KyberSwapHelper.dbg.json +0 -4
- package/contracts/LiquidityMining/FeeDistributor/EpochResultManager.sol +0 -159
- package/contracts/LiquidityMining/FeeDistributor/PendleFeeDistributor.sol +0 -99
- package/contracts/LiquidityMining/FeeDistributor/PendleFeeDistributorFactory.sol +0 -70
- package/contracts/interfaces/IPActionSwapPTYT.sol +0 -31
- package/contracts/interfaces/IPFeeDistributorFactory.sol +0 -14
- package/contracts/router/ActionSwapPTYT.sol +0 -108
- package/contracts/router/kyberswap/AggregationRouterHelper.sol +0 -317
- package/contracts/router/kyberswap/IAggregatorRouterHelper.sol +0 -10
- package/contracts/router/kyberswap/IMultihopRouter.sol +0 -139
- package/contracts/router/kyberswap/KyberSwapHelper.sol +0 -79
- package/deployments/1-core.json +0 -29
- package/deployments/1-markets/APE-JUNE-29.json +0 -7
- package/deployments/1-markets/FRAXUSDC-CURVELP-MARCH30.json +0 -11
- package/deployments/1-markets/LOOKS-STAKING-MARCH30.json +0 -10
- package/deployments/1-markets/STETH-JUNE29.json +0 -10
- package/deployments/1-markets/STETH-MARCH30.json +0 -10
|
@@ -1,103 +1,242 @@
|
|
|
1
1
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
2
2
|
pragma solidity 0.8.17;
|
|
3
3
|
|
|
4
|
-
import "@openzeppelin/contracts/proxy/utils/UUPSUpgradeable.sol";
|
|
5
4
|
import "@openzeppelin/contracts/proxy/Proxy.sol";
|
|
6
5
|
import "../interfaces/IPAllAction.sol";
|
|
7
|
-
import "../interfaces/
|
|
8
|
-
import "../
|
|
9
|
-
|
|
10
|
-
/// @dev this contract will be deployed behind an ERC1967 proxy
|
|
11
|
-
/// calls to the ERC1967 proxy will be resolved at this contract, and proxied again to the
|
|
12
|
-
/// corresponding implementation contracts
|
|
6
|
+
import "../interfaces/IDiamondLoupe.sol";
|
|
7
|
+
import "../interfaces/IDiamondCut.sol";
|
|
13
8
|
|
|
14
9
|
// solhint-disable no-empty-blocks
|
|
15
|
-
contract PendleRouter is Proxy {
|
|
16
|
-
address
|
|
17
|
-
address
|
|
18
|
-
address
|
|
19
|
-
address
|
|
20
|
-
address
|
|
21
|
-
|
|
22
|
-
address
|
|
10
|
+
contract PendleRouter is Proxy, IDiamondLoupe {
|
|
11
|
+
address internal immutable ACTION_MINT_REDEEM;
|
|
12
|
+
address internal immutable ACTION_ADD_REMOVE_LIQ;
|
|
13
|
+
address internal immutable ACTION_SWAP_PT;
|
|
14
|
+
address internal immutable ACTION_SWAP_YT;
|
|
15
|
+
address internal immutable ACTION_MISC;
|
|
16
|
+
|
|
17
|
+
event DiamondCut(IDiamondCut.FacetCut[] _diamondCut, address _init, bytes _calldata);
|
|
23
18
|
|
|
24
19
|
constructor(
|
|
25
20
|
address _ACTION_MINT_REDEEM,
|
|
26
21
|
address _ACTION_ADD_REMOVE_LIQ,
|
|
27
22
|
address _ACTION_SWAP_PT,
|
|
28
23
|
address _ACTION_SWAP_YT,
|
|
29
|
-
address _ACTION_SWAP_PTYT,
|
|
30
|
-
address _ACTION_CALLBACK,
|
|
31
24
|
address _ACTION_MISC
|
|
32
25
|
) {
|
|
33
26
|
ACTION_MINT_REDEEM = _ACTION_MINT_REDEEM;
|
|
34
27
|
ACTION_ADD_REMOVE_LIQ = _ACTION_ADD_REMOVE_LIQ;
|
|
35
28
|
ACTION_SWAP_PT = _ACTION_SWAP_PT;
|
|
36
29
|
ACTION_SWAP_YT = _ACTION_SWAP_YT;
|
|
37
|
-
ACTION_SWAP_PTYT = _ACTION_SWAP_PTYT;
|
|
38
|
-
ACTION_CALLBACK = _ACTION_CALLBACK;
|
|
39
30
|
ACTION_MISC = _ACTION_MISC;
|
|
31
|
+
_emitEvents();
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
function _emitEvents() internal {
|
|
35
|
+
Facet[] memory facets_ = facets();
|
|
36
|
+
|
|
37
|
+
uint256 nFacets = facets_.length;
|
|
38
|
+
|
|
39
|
+
IDiamondCut.FacetCut[] memory cuts = new IDiamondCut.FacetCut[](nFacets);
|
|
40
|
+
for (uint256 i; i < nFacets; ) {
|
|
41
|
+
cuts[i].facetAddress = facets_[i].facetAddress;
|
|
42
|
+
cuts[i].action = IDiamondCut.FacetCutAction.Add;
|
|
43
|
+
cuts[i].functionSelectors = facets_[i].functionSelectors;
|
|
44
|
+
unchecked {
|
|
45
|
+
++i;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
emit DiamondCut(cuts, address(0), "");
|
|
40
50
|
}
|
|
41
51
|
|
|
42
52
|
receive() external payable virtual override {}
|
|
43
53
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
return
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
54
|
+
/// @notice Gets all facet addresses and their four byte function selectors.
|
|
55
|
+
/// @return facets_ Facet
|
|
56
|
+
function facets() public view returns (Facet[] memory facets_) {
|
|
57
|
+
address[] memory facetAddresses_ = facetAddresses();
|
|
58
|
+
uint256 numFacets = facetAddresses_.length;
|
|
59
|
+
|
|
60
|
+
facets_ = new Facet[](numFacets);
|
|
61
|
+
for (uint256 i; i < numFacets; ) {
|
|
62
|
+
facets_[i].facetAddress = facetAddresses_[i];
|
|
63
|
+
facets_[i].functionSelectors = facetFunctionSelectors(facetAddresses_[i]);
|
|
64
|
+
unchecked {
|
|
65
|
+
i++;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
function facetFunctionSelectors(address facet) public view returns (bytes4[] memory res) {
|
|
71
|
+
if (facet == ACTION_ADD_REMOVE_LIQ) {
|
|
72
|
+
res = new bytes4[](12);
|
|
73
|
+
res[0] = 0x97ee279e; // addLiquidityDualSyAndPt
|
|
74
|
+
res[1] = 0xcb591eb2; // addLiquidityDualTokenAndPt
|
|
75
|
+
res[2] = 0x3af1f329; // addLiquiditySinglePt
|
|
76
|
+
res[3] = 0x409c7a89; // addLiquiditySingleSy
|
|
77
|
+
res[4] = 0x015491d1; // addLiquiditySingleToken
|
|
78
|
+
res[5] = 0xb7d75b8b; // removeLiquidityDualSyAndPt
|
|
79
|
+
res[6] = 0xe6eaba01; // removeLiquidityDualTokenAndPt
|
|
80
|
+
res[7] = 0x694ab559; // removeLiquiditySinglePt
|
|
81
|
+
res[8] = 0x178d29d3; // removeLiquiditySingleSy
|
|
82
|
+
res[9] = 0x690807ad; // removeLiquiditySingleToken
|
|
83
|
+
res[10] = 0xdfbc814e; // addLiquiditySingleTokenKeepYt
|
|
84
|
+
res[11] = 0x844384aa; // addLiquiditySingleSyKeepYt
|
|
85
|
+
return res;
|
|
86
|
+
}
|
|
87
|
+
if (facet == ACTION_MINT_REDEEM) {
|
|
88
|
+
res = new bytes4[](7);
|
|
89
|
+
res[0] = 0x1a8631b2; // mintPyFromSy
|
|
90
|
+
res[1] = 0x46eb2db6; // mintPyFromToken
|
|
91
|
+
res[2] = 0x443e6512; // mintSyFromToken
|
|
92
|
+
res[3] = 0xf7e375e8; // redeemDueInterestAndRewards
|
|
93
|
+
res[4] = 0x339748cb; // redeemPyToSy
|
|
94
|
+
res[5] = 0x527df199; // redeemPyToToken
|
|
95
|
+
res[6] = 0x85b29936; // redeemSyToToken
|
|
96
|
+
return res;
|
|
97
|
+
}
|
|
98
|
+
if (facet == ACTION_SWAP_PT) {
|
|
99
|
+
res = new bytes4[](6);
|
|
100
|
+
res[0] = 0x2032aecd; // swapExactPtForSy
|
|
101
|
+
res[1] = 0xb85f50ba; // swapExactPtForToken
|
|
102
|
+
res[2] = 0x83c71b69; // swapExactSyForPt
|
|
103
|
+
res[3] = 0xa5f9931b; // swapExactTokenForPt
|
|
104
|
+
res[4] = 0xdd371acd; // swapPtForExactSy
|
|
105
|
+
res[5] = 0x6b8bdf32; // swapSyForExactPt
|
|
106
|
+
return res;
|
|
107
|
+
}
|
|
108
|
+
if (facet == ACTION_SWAP_YT) {
|
|
109
|
+
res = new bytes4[](9);
|
|
110
|
+
res[0] = 0xfa483e72; // swapCallback
|
|
111
|
+
res[1] = 0xc861a898; // swapExactPtForYt
|
|
112
|
+
res[2] = 0x448b9b95; // swapExactYtForPt
|
|
113
|
+
res[3] = 0xfdd71f43; // swapExactSyForYt
|
|
114
|
+
res[4] = 0xc4a9c7de; // swapExactTokenForYt
|
|
115
|
+
res[5] = 0x357d6540; // swapExactYtForSy
|
|
116
|
+
res[6] = 0xd6308fa4; // swapExactYtForToken
|
|
117
|
+
res[7] = 0xbf1bd434; // swapSyForExactYt
|
|
118
|
+
res[8] = 0xe15cc098; // swapYtForExactSy
|
|
119
|
+
return res;
|
|
120
|
+
}
|
|
121
|
+
if (facet == ACTION_MISC) {
|
|
122
|
+
res = new bytes4[](2);
|
|
123
|
+
res[0] = 0xacdb32df; // approveInf
|
|
124
|
+
res[1] = 0xd617b03b; // batchExec
|
|
125
|
+
return res;
|
|
126
|
+
}
|
|
127
|
+
if (facet == address(this)) {
|
|
128
|
+
res = new bytes4[](4);
|
|
129
|
+
res[0] = 0xcdffacc6; // facetAddress
|
|
130
|
+
res[1] = 0x52ef6b2c; // facetAddresses
|
|
131
|
+
res[2] = 0xadfca15e; // facetFunctionSelectors
|
|
132
|
+
res[3] = 0x7a0ed627; // facets
|
|
133
|
+
return res;
|
|
134
|
+
}
|
|
135
|
+
revert Errors.RouterInvalidFacet(facet);
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
function facetAddress(bytes4 sig) public view returns (address) {
|
|
139
|
+
if (sig < 0x97ee279e) {
|
|
140
|
+
if (sig < 0x46eb2db6) {
|
|
141
|
+
if (sig < 0x357d6540) {
|
|
142
|
+
if (sig < 0x1a8631b2) {
|
|
143
|
+
if (sig == 0x015491d1) return ACTION_ADD_REMOVE_LIQ; // addLiquiditySingleToken 5
|
|
144
|
+
if (sig == 0x178d29d3) return ACTION_ADD_REMOVE_LIQ; // removeLiquiditySingleSy 6
|
|
145
|
+
} else {
|
|
146
|
+
if (sig == 0x1a8631b2) return ACTION_MINT_REDEEM; // mintPyFromSy 5
|
|
147
|
+
if (sig == 0x2032aecd) return ACTION_SWAP_PT; // swapExactPtForSy 6
|
|
148
|
+
if (sig == 0x339748cb) return ACTION_MINT_REDEEM; // redeemPyToSy 7
|
|
149
|
+
}
|
|
150
|
+
} else {
|
|
151
|
+
if (sig < 0x409c7a89) {
|
|
152
|
+
if (sig == 0x357d6540) return ACTION_SWAP_YT; // swapExactYtForSy 5
|
|
153
|
+
if (sig == 0x3af1f329) return ACTION_ADD_REMOVE_LIQ; // addLiquiditySinglePt 6
|
|
154
|
+
} else {
|
|
155
|
+
if (sig == 0x409c7a89) return ACTION_ADD_REMOVE_LIQ; // addLiquiditySingleSy 5
|
|
156
|
+
if (sig == 0x443e6512) return ACTION_MINT_REDEEM; // mintSyFromToken 6
|
|
157
|
+
if (sig == 0x448b9b95) return ACTION_SWAP_YT; // swapExactYtForPt 7
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
} else {
|
|
161
|
+
if (sig < 0x6b8bdf32) {
|
|
162
|
+
if (sig < 0x52ef6b2c) {
|
|
163
|
+
if (sig == 0x46eb2db6) return ACTION_MINT_REDEEM; // mintPyFromToken 5
|
|
164
|
+
if (sig == 0x527df199) return ACTION_MINT_REDEEM; // redeemPyToToken 6
|
|
165
|
+
} else {
|
|
166
|
+
if (sig == 0x690807ad) return ACTION_ADD_REMOVE_LIQ; // removeLiquiditySingleToken 5
|
|
167
|
+
if (sig == 0x694ab559) return ACTION_ADD_REMOVE_LIQ; // removeLiquiditySinglePt 6
|
|
168
|
+
if (sig == 0x52ef6b2c) return address(this); // facetAddresses 7
|
|
169
|
+
}
|
|
170
|
+
} else {
|
|
171
|
+
if (sig < 0x83c71b69) {
|
|
172
|
+
if (sig == 0x6b8bdf32) return ACTION_SWAP_PT; // swapSyForExactPt 5
|
|
173
|
+
if (sig == 0x7a0ed627) return address(this); // facets 6
|
|
174
|
+
} else {
|
|
175
|
+
if (sig == 0x85b29936) return ACTION_MINT_REDEEM; // redeemSyToToken 5
|
|
176
|
+
if (sig == 0x844384aa) return ACTION_ADD_REMOVE_LIQ; // addLiquiditySingleSyKeepYt 6
|
|
177
|
+
if (sig == 0x83c71b69) return ACTION_SWAP_PT; // swapExactSyForPt 7
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
} else {
|
|
182
|
+
if (sig < 0xcdffacc6) {
|
|
183
|
+
if (sig < 0xb85f50ba) {
|
|
184
|
+
if (sig < 0xacdb32df) {
|
|
185
|
+
if (sig == 0xa5f9931b) return ACTION_SWAP_PT; // swapExactTokenForPt 5
|
|
186
|
+
if (sig == 0x97ee279e) return ACTION_ADD_REMOVE_LIQ; // addLiquidityDualSyAndPt 6
|
|
187
|
+
} else {
|
|
188
|
+
if (sig == 0xb7d75b8b) return ACTION_ADD_REMOVE_LIQ; // removeLiquidityDualSyAndPt 5
|
|
189
|
+
if (sig == 0xacdb32df) return ACTION_MISC; // approveInf 6
|
|
190
|
+
if (sig == 0xadfca15e) return address(this); // facetFunctionSelectors 7
|
|
191
|
+
}
|
|
192
|
+
} else {
|
|
193
|
+
if (sig < 0xc4a9c7de) {
|
|
194
|
+
if (sig == 0xb85f50ba) return ACTION_SWAP_PT; // swapExactPtForToken 5
|
|
195
|
+
if (sig == 0xbf1bd434) return ACTION_SWAP_YT; // swapSyForExactYt 6
|
|
196
|
+
} else {
|
|
197
|
+
if (sig == 0xc4a9c7de) return ACTION_SWAP_YT; // swapExactTokenForYt 5
|
|
198
|
+
if (sig == 0xcb591eb2) return ACTION_ADD_REMOVE_LIQ; // addLiquidityDualTokenAndPt 6
|
|
199
|
+
if (sig == 0xc861a898) return ACTION_SWAP_YT; // swapExactPtForYt 7
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
} else {
|
|
203
|
+
if (sig < 0xe15cc098) {
|
|
204
|
+
if (sig < 0xd6308fa4) {
|
|
205
|
+
if (sig == 0xd617b03b) return ACTION_MISC; // batchExec 5
|
|
206
|
+
if (sig == 0xcdffacc6) return address(this); // facetAddress 6
|
|
207
|
+
} else {
|
|
208
|
+
if (sig == 0xd6308fa4) return ACTION_SWAP_YT; // swapExactYtForToken 5
|
|
209
|
+
if (sig == 0xdfbc814e) return ACTION_ADD_REMOVE_LIQ; // addLiquiditySingleTokenKeepYt 6
|
|
210
|
+
if (sig == 0xdd371acd) return ACTION_SWAP_PT; // swapPtForExactSy 7
|
|
211
|
+
}
|
|
212
|
+
} else {
|
|
213
|
+
if (sig < 0xf7e375e8) {
|
|
214
|
+
if (sig == 0xe6eaba01) return ACTION_ADD_REMOVE_LIQ; // removeLiquidityDualTokenAndPt 5
|
|
215
|
+
if (sig == 0xe15cc098) return ACTION_SWAP_YT; // swapYtForExactSy 6
|
|
216
|
+
} else {
|
|
217
|
+
if (sig == 0xfa483e72) return ACTION_SWAP_YT; // swapCallback 5
|
|
218
|
+
if (sig == 0xf7e375e8) return ACTION_MINT_REDEEM; // redeemDueInterestAndRewards 6
|
|
219
|
+
if (sig == 0xfdd71f43) return ACTION_SWAP_YT; // swapExactSyForYt 7
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
}
|
|
96
223
|
}
|
|
97
224
|
revert Errors.RouterInvalidAction(sig);
|
|
225
|
+
// NUM_FUNC: 40 AVG:5.80 STD:0.75 WORST_CASE:7 STOP_BRANCH:3
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
function facetAddresses() public view returns (address[] memory) {
|
|
229
|
+
address[] memory res = new address[](6);
|
|
230
|
+
res[0] = ACTION_ADD_REMOVE_LIQ;
|
|
231
|
+
res[1] = ACTION_MINT_REDEEM;
|
|
232
|
+
res[2] = ACTION_SWAP_PT;
|
|
233
|
+
res[3] = ACTION_SWAP_YT;
|
|
234
|
+
res[4] = ACTION_MISC;
|
|
235
|
+
res[5] = address(this);
|
|
236
|
+
return res;
|
|
98
237
|
}
|
|
99
238
|
|
|
100
239
|
function _implementation() internal view override returns (address) {
|
|
101
|
-
return
|
|
240
|
+
return facetAddress(msg.sig);
|
|
102
241
|
}
|
|
103
242
|
}
|
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
2
2
|
pragma solidity 0.8.17;
|
|
3
3
|
|
|
4
|
-
import "
|
|
5
|
-
import "
|
|
6
|
-
import "
|
|
7
|
-
import "
|
|
4
|
+
import "../..//interfaces/IPMarketFactory.sol";
|
|
5
|
+
import "../..//interfaces/IPMarket.sol";
|
|
6
|
+
import "../..//interfaces/IPMarketSwapCallback.sol";
|
|
7
|
+
import "../..//core/libraries/Errors.sol";
|
|
8
8
|
|
|
9
|
-
import "./
|
|
10
|
-
import "./
|
|
11
|
-
import "./
|
|
9
|
+
import "./MarketApproxLib.sol";
|
|
10
|
+
import "./ActionBaseMintRedeem.sol";
|
|
11
|
+
import "./CallbackHelper.sol";
|
|
12
12
|
|
|
13
13
|
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
|
|
14
14
|
|
|
15
|
-
contract
|
|
15
|
+
abstract contract ActionBaseCallback is IPMarketSwapCallback, CallbackHelper, TokenHelper {
|
|
16
16
|
using Math for int256;
|
|
17
17
|
using Math for uint256;
|
|
18
18
|
using PYIndexLib for PYIndex;
|
|
19
19
|
using PYIndexLib for IPYieldToken;
|
|
20
20
|
|
|
21
|
-
address
|
|
21
|
+
address internal immutable marketFactory;
|
|
22
22
|
|
|
23
23
|
modifier onlyPendleMarket(address caller) {
|
|
24
24
|
if (!IPMarketFactory(marketFactory).isValidMarket(caller))
|
|
@@ -38,19 +38,18 @@ contract ActionCallback is IPMarketSwapCallback, CallbackHelper, TokenHelper {
|
|
|
38
38
|
int256 ptToAccount,
|
|
39
39
|
int256 syToAccount,
|
|
40
40
|
bytes calldata data
|
|
41
|
-
) external override
|
|
42
|
-
address market = msg.sender;
|
|
41
|
+
) external override {
|
|
43
42
|
ActionType swapType = _getActionType(data);
|
|
44
43
|
if (swapType == ActionType.SwapExactSyForYt) {
|
|
45
|
-
_callbackSwapExactSyForYt(
|
|
44
|
+
_callbackSwapExactSyForYt(ptToAccount, syToAccount, data);
|
|
46
45
|
} else if (swapType == ActionType.SwapSyForExactYt) {
|
|
47
|
-
_callbackSwapSyForExactYt(
|
|
46
|
+
_callbackSwapSyForExactYt(ptToAccount, syToAccount, data);
|
|
48
47
|
} else if (swapType == ActionType.SwapYtForSy) {
|
|
49
|
-
_callbackSwapYtForSy(
|
|
48
|
+
_callbackSwapYtForSy(ptToAccount, syToAccount, data);
|
|
50
49
|
} else if (swapType == ActionType.SwapExactYtForPt) {
|
|
51
|
-
_callbackSwapExactYtForPt(
|
|
50
|
+
_callbackSwapExactYtForPt(ptToAccount, syToAccount, data);
|
|
52
51
|
} else if (swapType == ActionType.SwapExactPtForYt) {
|
|
53
|
-
_callbackSwapExactPtForYt(
|
|
52
|
+
_callbackSwapExactPtForYt(ptToAccount, syToAccount, data);
|
|
54
53
|
} else {
|
|
55
54
|
assert(false);
|
|
56
55
|
}
|
|
@@ -58,37 +57,33 @@ contract ActionCallback is IPMarketSwapCallback, CallbackHelper, TokenHelper {
|
|
|
58
57
|
|
|
59
58
|
/// @dev refer to _swapExactSyForYt
|
|
60
59
|
function _callbackSwapExactSyForYt(
|
|
61
|
-
address market,
|
|
62
60
|
int256 ptToAccount,
|
|
63
61
|
int256, /*syToAccount*/
|
|
64
62
|
bytes calldata data
|
|
65
63
|
) internal {
|
|
66
|
-
(, , IPYieldToken YT) =
|
|
67
|
-
(address receiver, uint256 minYtOut) = _decodeSwapExactSyForYt(data);
|
|
64
|
+
(address receiver, uint256 minYtOut, IPYieldToken YT) = _decodeSwapExactSyForYt(data);
|
|
68
65
|
|
|
69
66
|
uint256 ptOwed = ptToAccount.abs();
|
|
70
|
-
uint256 netPyOut = YT.mintPY(
|
|
67
|
+
uint256 netPyOut = YT.mintPY(msg.sender, receiver);
|
|
71
68
|
|
|
72
69
|
if (netPyOut < ptOwed) revert Errors.RouterInsufficientPtRepay(netPyOut, ptOwed);
|
|
73
70
|
if (netPyOut < minYtOut) revert Errors.RouterInsufficientYtOut(netPyOut, minYtOut);
|
|
74
71
|
}
|
|
75
72
|
|
|
76
|
-
struct VarsSwapSyForExactYt {
|
|
77
|
-
address payer;
|
|
78
|
-
address receiver;
|
|
79
|
-
uint256 maxSyToPull;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
73
|
/// @dev refer to _swapSyForExactYt
|
|
74
|
+
/// @dev we require msg.sender to be market here to make sure payer is the original msg.sender
|
|
83
75
|
function _callbackSwapSyForExactYt(
|
|
84
|
-
address market,
|
|
85
76
|
int256 ptToAccount,
|
|
86
77
|
int256 syToAccount,
|
|
87
78
|
bytes calldata data
|
|
88
|
-
) internal {
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
79
|
+
) internal onlyPendleMarket(msg.sender) {
|
|
80
|
+
(
|
|
81
|
+
address payer,
|
|
82
|
+
address receiver,
|
|
83
|
+
uint256 maxSyToPull,
|
|
84
|
+
IStandardizedYield SY,
|
|
85
|
+
IPYieldToken YT
|
|
86
|
+
) = _decodeSwapSyForExactYt(data);
|
|
92
87
|
|
|
93
88
|
/// ------------------------------------------------------------
|
|
94
89
|
/// calc totalSyNeed
|
|
@@ -103,29 +98,27 @@ contract ActionCallback is IPMarketSwapCallback, CallbackHelper, TokenHelper {
|
|
|
103
98
|
uint256 syReceived = syToAccount.Uint();
|
|
104
99
|
uint256 netSyToPull = totalSyNeed.subMax0(syReceived);
|
|
105
100
|
|
|
106
|
-
if (netSyToPull >
|
|
107
|
-
revert Errors.RouterExceededLimitSyIn(netSyToPull,
|
|
101
|
+
if (netSyToPull > maxSyToPull)
|
|
102
|
+
revert Errors.RouterExceededLimitSyIn(netSyToPull, maxSyToPull);
|
|
108
103
|
|
|
109
104
|
/// ------------------------------------------------------------
|
|
110
105
|
/// mint & transfer
|
|
111
106
|
/// ------------------------------------------------------------
|
|
112
107
|
if (netSyToPull > 0) {
|
|
113
|
-
_transferFrom(IERC20(SY),
|
|
108
|
+
_transferFrom(IERC20(SY), payer, address(YT), netSyToPull);
|
|
114
109
|
}
|
|
115
110
|
|
|
116
|
-
uint256 netPyOut = YT.mintPY(
|
|
111
|
+
uint256 netPyOut = YT.mintPY(msg.sender, receiver);
|
|
117
112
|
if (netPyOut < ptOwed) revert Errors.RouterInsufficientPtRepay(netPyOut, ptOwed);
|
|
118
113
|
}
|
|
119
114
|
|
|
120
115
|
/// @dev refer to _swapExactYtForSy or _swapYtForExactSy
|
|
121
116
|
function _callbackSwapYtForSy(
|
|
122
|
-
address market,
|
|
123
117
|
int256 ptToAccount,
|
|
124
118
|
int256 syToAccount,
|
|
125
119
|
bytes calldata data
|
|
126
120
|
) internal {
|
|
127
|
-
(address receiver, uint256 minSyOut) = _decodeSwapYtForSy(data);
|
|
128
|
-
(, , IPYieldToken YT) = IPMarket(market).readTokens();
|
|
121
|
+
(address receiver, uint256 minSyOut, IPYieldToken YT) = _decodeSwapYtForSy(data);
|
|
129
122
|
PYIndex pyIndex = YT.newIndex();
|
|
130
123
|
|
|
131
124
|
uint256 syOwed = syToAccount.neg().Uint();
|
|
@@ -133,7 +126,7 @@ contract ActionCallback is IPMarketSwapCallback, CallbackHelper, TokenHelper {
|
|
|
133
126
|
address[] memory receivers = new address[](2);
|
|
134
127
|
uint256[] memory amountPYToRedeems = new uint256[](2);
|
|
135
128
|
|
|
136
|
-
(receivers[0], amountPYToRedeems[0]) = (
|
|
129
|
+
(receivers[0], amountPYToRedeems[0]) = (msg.sender, pyIndex.syToAssetUp(syOwed));
|
|
137
130
|
(receivers[1], amountPYToRedeems[1]) = (
|
|
138
131
|
receiver,
|
|
139
132
|
ptToAccount.Uint() - amountPYToRedeems[0]
|
|
@@ -145,34 +138,41 @@ contract ActionCallback is IPMarketSwapCallback, CallbackHelper, TokenHelper {
|
|
|
145
138
|
}
|
|
146
139
|
|
|
147
140
|
function _callbackSwapExactPtForYt(
|
|
148
|
-
address market,
|
|
149
141
|
int256 ptToAccount,
|
|
150
142
|
int256, /*syToAccount*/
|
|
151
143
|
bytes calldata data
|
|
152
144
|
) internal {
|
|
153
|
-
(
|
|
145
|
+
(
|
|
146
|
+
address receiver,
|
|
147
|
+
uint256 exactPtIn,
|
|
148
|
+
uint256 minYtOut,
|
|
149
|
+
IPYieldToken YT
|
|
150
|
+
) = _decodeSwapExactPtForYt(data);
|
|
154
151
|
uint256 netPtOwed = ptToAccount.abs();
|
|
155
|
-
(, , IPYieldToken YT) = IPMarket(market).readTokens();
|
|
156
152
|
|
|
157
|
-
uint256 netPyOut = YT.mintPY(
|
|
153
|
+
uint256 netPyOut = YT.mintPY(msg.sender, receiver);
|
|
158
154
|
if (netPyOut < minYtOut) revert Errors.RouterInsufficientYtOut(netPyOut, minYtOut);
|
|
159
155
|
if (exactPtIn + netPyOut < netPtOwed)
|
|
160
156
|
revert Errors.RouterInsufficientPtRepay(exactPtIn + netPyOut, netPtOwed);
|
|
161
157
|
}
|
|
162
158
|
|
|
163
159
|
function _callbackSwapExactYtForPt(
|
|
164
|
-
address market,
|
|
165
160
|
int256 ptToAccount,
|
|
166
161
|
int256 syToAccount,
|
|
167
162
|
bytes calldata data
|
|
168
163
|
) internal {
|
|
169
|
-
(
|
|
170
|
-
|
|
164
|
+
(
|
|
165
|
+
address receiver,
|
|
166
|
+
uint256 exactYtIn,
|
|
167
|
+
uint256 minPtOut,
|
|
168
|
+
IPPrincipalToken PT,
|
|
169
|
+
IPYieldToken YT
|
|
170
|
+
) = _decodeSwapExactYtForPt(data);
|
|
171
171
|
|
|
172
172
|
uint256 netSyOwed = syToAccount.abs();
|
|
173
173
|
|
|
174
174
|
_transferOut(address(PT), address(YT), exactYtIn);
|
|
175
|
-
uint256 netSyToMarket = YT.redeemPY(
|
|
175
|
+
uint256 netSyToMarket = YT.redeemPY(msg.sender);
|
|
176
176
|
|
|
177
177
|
if (netSyToMarket < netSyOwed)
|
|
178
178
|
revert Errors.RouterInsufficientSyRepay(netSyToMarket, netSyOwed);
|