@pendle/core-v2 0.20.2-testnet → 1.0.0-mainnet
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/ExcessivelySafeCall.sol/ExcessivelySafeCall.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/FeeDistributor/EpochResultManager.sol/EpochResultManager.dbg.json +4 -0
- package/build/artifacts/contracts/{interfaces/IApeStaking.sol/IApeStaking.json → LiquidityMining/FeeDistributor/EpochResultManager.sol/EpochResultManager.json} +52 -70
- package/build/artifacts/contracts/LiquidityMining/FeeDistributor/PendleFeeDistributor.sol/PendleFeeDistributor.dbg.json +4 -0
- package/build/artifacts/contracts/LiquidityMining/FeeDistributor/PendleFeeDistributor.sol/PendleFeeDistributor.json +310 -0
- package/build/artifacts/contracts/LiquidityMining/FeeDistributor/PendleFeeDistributorFactory.sol/PendleFeeDistributorFactory.dbg.json +4 -0
- package/build/artifacts/contracts/LiquidityMining/FeeDistributor/PendleFeeDistributorFactory.sol/PendleFeeDistributorFactory.json +389 -0
- 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/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/SYBaseWithRewards.sol/SYBaseWithRewards.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/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 +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/PendleLooksStakingSY.sol/PendleLooksStakingSY.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/PendleLooksStakingSY.sol/PendleLooksStakingSY.json +2 -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 +2 -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/erc20/PendleERC20.sol/PendleERC20.dbg.json +1 -1
- package/build/artifacts/contracts/core/erc20/PendleERC20Permit.sol/PendleERC20Permit.dbg.json +1 -1
- 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/BoringOwnableUpgradeable.sol/BoringOwnableUpgradeable.dbg.json +1 -1
- package/build/artifacts/contracts/core/libraries/BoringOwnableUpgradeable.sol/BoringOwnableUpgradeableData.dbg.json +1 -1
- package/build/artifacts/contracts/core/libraries/Errors.sol/Errors.dbg.json +1 -1
- package/build/artifacts/contracts/core/libraries/Errors.sol/Errors.json +5 -171
- package/build/artifacts/contracts/core/libraries/MiniHelpers.sol/MiniHelpers.dbg.json +1 -1
- package/build/artifacts/contracts/core/libraries/TokenHelper.sol/TokenHelper.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/ConvexCurve/IRewards.sol/IRewards.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/ConvexCurve/IRewards.sol/IRewards.json +0 -18
- package/build/artifacts/contracts/interfaces/Curve/ICrvPool.sol/ICrvPool.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/Curve/ITriCrvPool.sol/ITriCrvPool.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IBoringOwnableUpgradeable.sol/IBoringOwnableUpgradeable.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/ILayerZeroEndpoint.sol/ILayerZeroEndpoint.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/ILayerZeroReceiver.sol/ILayerZeroReceiver.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPActionAddRemoveLiq.sol/IPActionAddRemoveLiq.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPActionAddRemoveLiq.sol/IPActionAddRemoveLiq.json +32 -80
- package/build/artifacts/contracts/interfaces/IPActionMintRedeem.sol/IPActionMintRedeem.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPActionMintRedeem.sol/IPActionMintRedeem.json +40 -100
- package/build/artifacts/contracts/interfaces/IPActionSwapPT.sol/IPActionSwapPT.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPActionSwapPT.sol/IPActionSwapPT.json +16 -40
- package/build/artifacts/contracts/interfaces/IPActionSwapPTYT.sol/IPActionSwapPTYT.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPActionSwapYT.sol/IPActionSwapYT.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPActionSwapYT.sol/IPActionSwapYT.json +16 -40
- package/build/artifacts/contracts/interfaces/IPAllAction.sol/IPAllAction.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPAllAction.sol/IPAllAction.json +104 -260
- package/build/artifacts/contracts/interfaces/IPBulkSeller.sol/IPBulkSeller.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPBulkSellerFactory.sol/IPBulkSellerFactory.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 +32 -43
- package/build/artifacts/contracts/interfaces/IPFeeDistributorFactory.sol/IPFeeDistributorFactory.dbg.json +4 -0
- package/build/artifacts/contracts/interfaces/{Balancer/IGauge.sol/IGauge.json → IPFeeDistributorFactory.sol/IPFeeDistributorFactory.json} +33 -18
- package/build/artifacts/contracts/interfaces/IPMarket.sol/IPMarket.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPMsgReceiverApp.sol/IPMsgReceiverApp.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPMsgSendEndpoint.sol/IPMsgSendEndpoint.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPVeToken.sol/IPVeToken.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/IREDACTEDStaking.sol/IREDACTEDStaking.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IStETH.sol/IStETH.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IStargateLPStaking.sol/IStargateLPStaking.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IStargatePool.sol/IStargatePool.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IStargateRouter.sol/IStargateRouter.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IWXBTRFLY.sol/IWXBTRFLY.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/BaseSplitCodeFactoryContract.sol/BaseSplitCodeFactoryContract.dbg.json +1 -1
- 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 -42
- package/build/artifacts/contracts/offchain-helpers/RouterStatic.sol/RouterStatic.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/RouterStatic.sol/RouterStatic.json +98 -171
- package/build/artifacts/contracts/router/ActionAddRemoveLiq.sol/ActionAddRemoveLiq.dbg.json +1 -1
- package/build/artifacts/contracts/router/ActionAddRemoveLiq.sol/ActionAddRemoveLiq.json +53 -96
- package/build/artifacts/contracts/router/ActionCallback.sol/ActionCallback.dbg.json +1 -1
- package/build/artifacts/contracts/router/ActionCallback.sol/ActionCallback.json +2 -2
- package/build/artifacts/contracts/router/ActionMintRedeem.sol/ActionMintRedeem.dbg.json +1 -1
- package/build/artifacts/contracts/router/ActionMintRedeem.sol/ActionMintRedeem.json +61 -116
- package/build/artifacts/contracts/router/ActionMisc.sol/ActionMisc.dbg.json +1 -1
- package/build/artifacts/contracts/router/ActionMisc.sol/ActionMisc.json +2 -2
- package/build/artifacts/contracts/router/ActionSwapPT.sol/ActionSwapPT.dbg.json +1 -1
- package/build/artifacts/contracts/router/ActionSwapPT.sol/ActionSwapPT.json +25 -44
- package/build/artifacts/contracts/router/ActionSwapPTYT.sol/ActionSwapPTYT.dbg.json +1 -1
- package/build/artifacts/contracts/router/ActionSwapPTYT.sol/ActionSwapPTYT.json +2 -2
- package/build/artifacts/contracts/router/ActionSwapYT.sol/ActionSwapYT.dbg.json +1 -1
- package/build/artifacts/contracts/router/ActionSwapYT.sol/ActionSwapYT.json +25 -44
- package/build/artifacts/contracts/router/PendleRouter.sol/PendleRouter.dbg.json +1 -1
- package/build/artifacts/contracts/router/PendleRouter.sol/PendleRouter.json +2 -2
- package/build/artifacts/contracts/router/base/ActionBaseMintRedeem.sol/ActionBaseMintRedeem.dbg.json +1 -1
- package/build/artifacts/contracts/router/base/ActionBaseMintRedeem.sol/ActionBaseMintRedeem.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/kyberswap/AggregationRouterHelper.sol/AggregationRouterHelper.dbg.json +4 -0
- package/build/artifacts/contracts/router/kyberswap/AggregationRouterHelper.sol/AggregationRouterHelper.json +224 -0
- package/build/artifacts/contracts/router/kyberswap/IAggregatorRouterHelper.sol/IAggregationRouterHelper.dbg.json +4 -0
- package/build/artifacts/contracts/router/kyberswap/IAggregatorRouterHelper.sol/IAggregationRouterHelper.json +35 -0
- package/build/artifacts/contracts/router/kyberswap/IMultihopRouter.sol/IMultihopRouter.dbg.json +4 -0
- package/build/artifacts/contracts/router/kyberswap/IMultihopRouter.sol/IMultihopRouter.json +136 -0
- package/build/artifacts/contracts/router/kyberswap/KyberSwapHelper.sol/KyberSwapHelper.dbg.json +4 -0
- package/build/artifacts/contracts/{interfaces/Balancer/IRateProvider.sol/IRateProvider.json → router/kyberswap/KyberSwapHelper.sol/KyberSwapHelper.json} +5 -5
- package/contracts/LiquidityMining/CrossChainMsg/libraries/LayerZeroHelper.sol +9 -7
- package/contracts/LiquidityMining/FeeDistributor/EpochResultManager.sol +159 -0
- package/contracts/LiquidityMining/FeeDistributor/PendleFeeDistributor.sol +99 -0
- package/contracts/LiquidityMining/FeeDistributor/PendleFeeDistributorFactory.sol +70 -0
- package/contracts/core/BulkSeller/BulkSeller.sol +1 -1
- package/contracts/core/StandardizedYield/SYBaseWithRewards.sol +3 -1
- package/contracts/core/libraries/ArrayLib.sol +0 -12
- package/contracts/core/libraries/Errors.sol +2 -19
- package/contracts/interfaces/ConvexCurve/IRewards.sol +0 -5
- package/contracts/interfaces/IPActionAddRemoveLiq.sol +1 -1
- package/contracts/interfaces/IPActionMintRedeem.sol +3 -2
- package/contracts/interfaces/IPActionSwapPT.sol +1 -1
- package/contracts/interfaces/IPActionSwapPTYT.sol +1 -1
- package/contracts/interfaces/IPActionSwapYT.sol +1 -1
- package/contracts/interfaces/IPFeeDistributor.sol +10 -12
- package/contracts/interfaces/IPFeeDistributorFactory.sol +14 -0
- package/contracts/offchain-helpers/MarketMathStatic.sol +88 -181
- package/contracts/offchain-helpers/RouterStatic.sol +72 -72
- package/contracts/router/ActionAddRemoveLiq.sol +2 -2
- package/contracts/router/ActionMintRedeem.sol +9 -7
- package/contracts/router/ActionSwapPT.sol +2 -2
- package/contracts/router/ActionSwapYT.sol +2 -2
- package/contracts/router/base/ActionBaseMintRedeem.sol +14 -51
- package/contracts/router/kyberswap/AggregationRouterHelper.sol +317 -0
- package/contracts/router/kyberswap/IAggregatorRouterHelper.sol +10 -0
- package/contracts/router/kyberswap/IMultihopRouter.sol +139 -0
- package/contracts/router/kyberswap/KyberSwapHelper.sol +79 -0
- package/deployments/1-core.json +29 -0
- package/deployments/1-markets/FRAXUSDC-CURVELP-MARCH30.json +11 -0
- package/deployments/1-markets/LOOKS-STAKING-MARCH30.json +10 -0
- package/deployments/1-markets/STETH-JUNE29.json +10 -0
- package/deployments/1-markets/STETH-MARCH30.json +10 -0
- package/package.json +6 -6
- package/typechain-types/ActionAddRemoveLiq.ts +35 -41
- package/typechain-types/ActionBaseMintRedeem.ts +8 -8
- package/typechain-types/ActionMintRedeem.ts +42 -45
- package/typechain-types/ActionSwapPT.ts +22 -28
- package/typechain-types/ActionSwapYT.ts +22 -28
- package/typechain-types/IPActionAddRemoveLiq.ts +16 -22
- package/typechain-types/IPActionMintRedeem.ts +23 -26
- package/typechain-types/IPActionSwapPT.ts +14 -20
- package/typechain-types/IPActionSwapYT.ts +14 -20
- package/typechain-types/IPAllAction.ts +31 -34
- package/typechain-types/IPFeeDistributor.ts +78 -61
- package/typechain-types/IPFeeDistributorFactory.ts +139 -53
- package/typechain-types/IRewards.ts +5 -35
- package/typechain-types/MarketMathStatic.ts +0 -49
- package/typechain-types/PendleFeeDistributor.ts +117 -409
- package/typechain-types/RouterStatic.ts +69 -40
- package/typechain-types/factories/ActionAddRemoveLiq__factory.ts +56 -99
- package/typechain-types/factories/ActionBaseMintRedeem__factory.ts +1 -1
- package/typechain-types/factories/ActionCallback__factory.ts +1 -1
- package/typechain-types/factories/ActionMintRedeem__factory.ts +64 -119
- package/typechain-types/factories/ActionMisc__factory.ts +1 -1
- package/typechain-types/factories/ActionSwapPTYT__factory.ts +1 -1
- package/typechain-types/factories/ActionSwapPT__factory.ts +28 -47
- package/typechain-types/factories/ActionSwapYT__factory.ts +28 -47
- package/typechain-types/factories/AggregationRouterHelper__factory.ts +1 -1
- 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/Errors__factory.ts +4 -170
- package/typechain-types/factories/IPActionAddRemoveLiq__factory.ts +32 -80
- package/typechain-types/factories/IPActionMintRedeem__factory.ts +40 -100
- package/typechain-types/factories/IPActionSwapPT__factory.ts +16 -40
- package/typechain-types/factories/IPActionSwapYT__factory.ts +16 -40
- package/typechain-types/factories/IPAllAction__factory.ts +104 -260
- package/typechain-types/factories/IPFeeDistributorFactory__factory.ts +34 -25
- package/typechain-types/factories/IPFeeDistributor__factory.ts +31 -42
- package/typechain-types/factories/IRewards__factory.ts +0 -18
- package/typechain-types/factories/MarketMathStatic__factory.ts +1 -41
- package/typechain-types/factories/OracleLib__factory.ts +1 -1
- package/typechain-types/factories/PendleCurveFraxUsdcSY__factory.ts +1 -1
- package/typechain-types/factories/PendleCurveUsdd3CrvSY__factory.ts +1 -1
- package/typechain-types/factories/PendleFeeDistributorFactory__factory.ts +1 -1
- package/typechain-types/factories/PendleFeeDistributor__factory.ts +66 -341
- package/typechain-types/factories/PendleGaugeControllerMainchainUpg__factory.ts +1 -1
- package/typechain-types/factories/PendleGaugeControllerSidechainUpg__factory.ts +1 -1
- package/typechain-types/factories/PendleLooksStakingSY__factory.ts +1 -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/PendlePrincipalToken__factory.ts +1 -1
- package/typechain-types/factories/PendleQiTokenHelper__factory.ts +1 -1
- package/typechain-types/factories/PendleQiTokenSY__factory.ts +1 -1
- package/typechain-types/factories/PendleRouter__factory.ts +1 -1
- package/typechain-types/factories/PendleVotingControllerUpg__factory.ts +1 -1
- package/typechain-types/factories/PendleWstEthSY__factory.ts +1 -1
- package/typechain-types/factories/PendleYieldContractFactory__factory.ts +1 -1
- package/typechain-types/factories/PendleYieldToken__factory.ts +1 -1
- package/typechain-types/factories/RouterStatic__factory.ts +41 -118
- package/typechain-types/factories/VotingEscrowPendleMainchain__factory.ts +1 -1
- package/typechain-types/factories/VotingEscrowPendleSidechain__factory.ts +1 -1
- package/typechain-types/hardhat.d.ts +56 -263
- package/typechain-types/index.ts +16 -62
- package/README.md +0 -28
- package/build/artifacts/contracts/LiquidityMining/VeDistributor/PendleFeeDistributor.sol/PendleFeeDistributor.dbg.json +0 -4
- package/build/artifacts/contracts/LiquidityMining/VeDistributor/PendleFeeDistributor.sol/PendleFeeDistributor.json +0 -592
- package/build/artifacts/contracts/core/StandardizedYield/StEthHelper.sol/StEthHelper.dbg.json +0 -4
- package/build/artifacts/contracts/core/StandardizedYield/StEthHelper.sol/StEthHelper.json +0 -50
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Ape/sAPE.sol/sAPE.dbg.json +0 -4
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Ape/sAPE.sol/sAPE.json +0 -1075
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/PendleAura3EthSY.sol/PendleAura3EthSY.dbg.json +0 -4
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/PendleAura3EthSY.sol/PendleAura3EthSY.json +0 -1296
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/PendleAuraCbethWstethSY.sol/PendleAuraCbethWstethSY.dbg.json +0 -4
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/PendleAuraCbethWstethSY.sol/PendleAuraCbethWstethSY.json +0 -1283
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/PendleAuraWethRethSY.sol/PendleAuraWethRethSY.dbg.json +0 -4
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/PendleAuraWethRethSY.sol/PendleAuraWethRethSY.json +0 -1218
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/PendleAuraWethWstethSY.sol/PendleAuraWethWstethSY.dbg.json +0 -4
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/PendleAuraWethWstethSY.sol/PendleAuraWethWstethSY.json +0 -1231
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/base/ComposableStable/ComposableStableMath.sol/ComposableStableMath.dbg.json +0 -4
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/base/ComposableStable/ComposableStableMath.sol/ComposableStableMath.json +0 -10
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/base/ComposableStable/ComposableStablePreview.sol/ComposableStablePreview.dbg.json +0 -4
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/base/ComposableStable/ComposableStablePreview.sol/ComposableStablePreview.json +0 -133
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/base/FixedPoint.sol/FixedPoint.dbg.json +0 -4
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/base/FixedPoint.sol/FixedPoint.json +0 -10
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/base/MetaStable/MetaStableMath.sol/MetaStableMath.dbg.json +0 -4
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/base/MetaStable/MetaStableMath.sol/MetaStableMath.json +0 -40
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/base/MetaStable/MetaStablePreview.sol/MetaStablePreview.dbg.json +0 -4
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/base/MetaStable/MetaStablePreview.sol/MetaStablePreview.json +0 -322
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/base/PendleAuraBalancerStableLPSY.sol/PendleAuraBalancerStableLPSY.dbg.json +0 -4
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/base/PendleAuraBalancerStableLPSY.sol/PendleAuraBalancerStableLPSY.json +0 -1171
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/base/StablePoolUserData.sol/StablePoolUserData.dbg.json +0 -4
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/base/StablePoolUserData.sol/StablePoolUserData.json +0 -10
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/base/StablePreviewBase.sol/StablePreviewBase.dbg.json +0 -4
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/base/StablePreviewBase.sol/StablePreviewBase.json +0 -133
- package/build/artifacts/contracts/interfaces/Balancer/IAsset.sol/IAsset.dbg.json +0 -4
- package/build/artifacts/contracts/interfaces/Balancer/IAsset.sol/IAsset.json +0 -10
- package/build/artifacts/contracts/interfaces/Balancer/IBalancerFees.sol/IBalancerFees.dbg.json +0 -4
- package/build/artifacts/contracts/interfaces/Balancer/IBalancerFees.sol/IBalancerFees.json +0 -24
- package/build/artifacts/contracts/interfaces/Balancer/IBalancerStablePreview.sol/IBalancerStablePreview.dbg.json +0 -4
- package/build/artifacts/contracts/interfaces/Balancer/IBalancerStablePreview.sol/IBalancerStablePreview.json +0 -133
- package/build/artifacts/contracts/interfaces/Balancer/IBasePool.sol/IBasePool.dbg.json +0 -4
- package/build/artifacts/contracts/interfaces/Balancer/IBasePool.sol/IBasePool.json +0 -328
- package/build/artifacts/contracts/interfaces/Balancer/IComposableStable.sol/IComposableStable.dbg.json +0 -4
- package/build/artifacts/contracts/interfaces/Balancer/IComposableStable.sol/IComposableStable.json +0 -467
- package/build/artifacts/contracts/interfaces/Balancer/IGauge.sol/IGauge.dbg.json +0 -4
- package/build/artifacts/contracts/interfaces/Balancer/ILiquidityGaugeFactory.sol/ILiquidityGaugeFactory.dbg.json +0 -4
- package/build/artifacts/contracts/interfaces/Balancer/ILiquidityGaugeFactory.sol/ILiquidityGaugeFactory.json +0 -30
- package/build/artifacts/contracts/interfaces/Balancer/IMetaStablePool.sol/IMetaStablePool.dbg.json +0 -4
- package/build/artifacts/contracts/interfaces/Balancer/IMetaStablePool.sol/IMetaStablePool.json +0 -398
- package/build/artifacts/contracts/interfaces/Balancer/IRateProvider.sol/IRateProvider.dbg.json +0 -4
- package/build/artifacts/contracts/interfaces/Balancer/IVault.sol/IVault.dbg.json +0 -4
- package/build/artifacts/contracts/interfaces/Balancer/IVault.sol/IVault.json +0 -278
- package/build/artifacts/contracts/interfaces/IApeStaking.sol/IApeStaking.dbg.json +0 -4
- package/build/artifacts/contracts/offchain-helpers/Multicall2.sol/Multicall2.dbg.json +0 -4
- package/build/artifacts/contracts/offchain-helpers/Multicall2.sol/Multicall2.json +0 -322
- package/build/artifacts/contracts/router/swap-aggregator/1inch/I1inchAggregationRouterV5.sol/I1inchAggregationRouterV5.dbg.json +0 -4
- package/build/artifacts/contracts/router/swap-aggregator/1inch/I1inchAggregationRouterV5.sol/I1inchAggregationRouterV5.json +0 -160
- package/build/artifacts/contracts/router/swap-aggregator/1inch/OneInchAggregationRouterHelper.sol/OneInchAggregationRouterHelper.dbg.json +0 -4
- package/build/artifacts/contracts/router/swap-aggregator/1inch/OneInchAggregationRouterHelper.sol/OneInchAggregationRouterHelper.json +0 -10
- package/build/artifacts/contracts/router/swap-aggregator/ISwapAggregator.sol/ISwapAggregator.dbg.json +0 -4
- package/build/artifacts/contracts/router/swap-aggregator/ISwapAggregator.sol/ISwapAggregator.json +0 -51
- package/build/artifacts/contracts/router/swap-aggregator/SwapAggregator.sol/SwapAggregator.dbg.json +0 -4
- package/build/artifacts/contracts/router/swap-aggregator/SwapAggregator.sol/SwapAggregator.json +0 -256
- package/build/artifacts/contracts/router/swap-aggregator/kyberswap/KyberAggregationRouterHelper.sol/KyberAggregationRouterHelper.dbg.json +0 -4
- package/build/artifacts/contracts/router/swap-aggregator/kyberswap/KyberAggregationRouterHelper.sol/KyberAggregationRouterHelper.json +0 -10
- package/build/artifacts/contracts/router/swap-aggregator/kyberswap/ScaleDataHelperEthereum1.sol/ScaleDataHelperEthereum1.dbg.json +0 -4
- package/build/artifacts/contracts/router/swap-aggregator/kyberswap/ScaleDataHelperEthereum1.sol/ScaleDataHelperEthereum1.json +0 -10
- package/build/artifacts/contracts/router/swap-aggregator/kyberswap/interfaces/IAggregationExecutor.sol/IAggregationExecutor.dbg.json +0 -4
- package/build/artifacts/contracts/router/swap-aggregator/kyberswap/interfaces/IAggregationExecutor.sol/IAggregationExecutor.json +0 -65
- package/build/artifacts/contracts/router/swap-aggregator/kyberswap/interfaces/IExecutorHelperEthereum1.sol/IExecutorHelperEthereum1.dbg.json +0 -4
- package/build/artifacts/contracts/router/swap-aggregator/kyberswap/interfaces/IExecutorHelperEthereum1.sol/IExecutorHelperEthereum1.json +0 -359
- package/build/artifacts/contracts/router/swap-aggregator/kyberswap/interfaces/IHashflow.sol/IHashflow.dbg.json +0 -4
- package/build/artifacts/contracts/router/swap-aggregator/kyberswap/interfaces/IHashflow.sol/IHashflow.json +0 -101
- package/build/artifacts/contracts/router/swap-aggregator/kyberswap/interfaces/IMetaAggregationRouter.sol/IMetaAggregationRouter.dbg.json +0 -4
- package/build/artifacts/contracts/router/swap-aggregator/kyberswap/interfaces/IMetaAggregationRouter.sol/IMetaAggregationRouter.json +0 -183
- package/build/artifacts/contracts/router/swap-aggregator/kyberswap/interfaces/IMetaAggregationRouterV2.sol/IMetaAggregationRouterV2.dbg.json +0 -4
- package/build/artifacts/contracts/router/swap-aggregator/kyberswap/interfaces/IMetaAggregationRouterV2.sol/IMetaAggregationRouterV2.json +0 -215
- package/contracts/LiquidityMining/VeDistributor/PendleFeeDistributor.sol +0 -224
- package/contracts/core/StandardizedYield/StEthHelper.sol +0 -71
- package/contracts/core/StandardizedYield/implementations/Ape/sAPE.sol +0 -197
- package/contracts/core/StandardizedYield/implementations/BalancerStable/PendleAura3EthSY.sol +0 -170
- package/contracts/core/StandardizedYield/implementations/BalancerStable/PendleAuraCbethWstethSY.sol +0 -162
- package/contracts/core/StandardizedYield/implementations/BalancerStable/PendleAuraWethRethSY.sol +0 -134
- package/contracts/core/StandardizedYield/implementations/BalancerStable/PendleAuraWethWstethSY.sol +0 -154
- package/contracts/core/StandardizedYield/implementations/BalancerStable/base/ComposableStable/ComposableStableMath.sol +0 -289
- package/contracts/core/StandardizedYield/implementations/BalancerStable/base/ComposableStable/ComposableStablePreview.sol +0 -618
- package/contracts/core/StandardizedYield/implementations/BalancerStable/base/FixedPoint.sol +0 -68
- package/contracts/core/StandardizedYield/implementations/BalancerStable/base/MetaStable/MetaStableMath.sol +0 -322
- package/contracts/core/StandardizedYield/implementations/BalancerStable/base/MetaStable/MetaStablePreview.sol +0 -390
- package/contracts/core/StandardizedYield/implementations/BalancerStable/base/PendleAuraBalancerStableLPSY.sol +0 -329
- package/contracts/core/StandardizedYield/implementations/BalancerStable/base/StablePoolUserData.sol +0 -30
- package/contracts/core/StandardizedYield/implementations/BalancerStable/base/StablePreviewBase.sol +0 -189
- package/contracts/interfaces/Balancer/IAsset.sol +0 -4
- package/contracts/interfaces/Balancer/IBalancerFees.sol +0 -6
- package/contracts/interfaces/Balancer/IBalancerStablePreview.sol +0 -22
- package/contracts/interfaces/Balancer/IBasePool.sol +0 -30
- package/contracts/interfaces/Balancer/IComposableStable.sol +0 -39
- package/contracts/interfaces/Balancer/IGauge.sol +0 -10
- package/contracts/interfaces/Balancer/ILiquidityGaugeFactory.sol +0 -6
- package/contracts/interfaces/Balancer/IMetaStablePool.sol +0 -31
- package/contracts/interfaces/Balancer/IRateProvider.sol +0 -6
- package/contracts/interfaces/Balancer/IVault.sol +0 -78
- package/contracts/interfaces/IApeStaking.sol +0 -30
- package/contracts/offchain-helpers/Multicall2.sol +0 -103
- package/contracts/router/swap-aggregator/1inch/I1inchAggregationRouterV5.sol +0 -45
- package/contracts/router/swap-aggregator/1inch/OneInchAggregationRouterHelper.sol +0 -71
- package/contracts/router/swap-aggregator/ISwapAggregator.sol +0 -21
- package/contracts/router/swap-aggregator/SwapAggregator.sol +0 -62
- package/contracts/router/swap-aggregator/kyberswap/KyberAggregationRouterHelper.sol +0 -302
- package/contracts/router/swap-aggregator/kyberswap/ScaleDataHelperEthereum1.sol +0 -134
- package/contracts/router/swap-aggregator/kyberswap/interfaces/IAggregationExecutor.sol +0 -17
- package/contracts/router/swap-aggregator/kyberswap/interfaces/IExecutorHelperEthereum1.sol +0 -185
- package/contracts/router/swap-aggregator/kyberswap/interfaces/IHashflow.sol +0 -30
- package/contracts/router/swap-aggregator/kyberswap/interfaces/IMetaAggregationRouter.sol +0 -33
- package/contracts/router/swap-aggregator/kyberswap/interfaces/IMetaAggregationRouterV2.sol +0 -42
- package/deployments/43113-core.json +0 -29
- package/deployments/43113-helper.json +0 -3
- package/deployments/43113-markets/APE-30-MARCH.json +0 -10
- package/deployments/43113-markets/USDC-FEB-2ND.json +0 -10
- package/deployments/43113-markets/USDC-FEB-4TH.json +0 -10
- package/deployments/43113-markets/WETH-FEB-2ND.json +0 -11
- package/deployments/43113-markets/WETH-FEB-4TH.json +0 -11
- package/deployments/43113-testenv.json +0 -22
- package/deployments/80001-core.json +0 -28
- package/deployments/80001-helper.json +0 -3
- package/deployments/80001-markets/USDC-FEB-4TH.json +0 -10
- package/deployments/80001-markets/WETH-FEB-4TH.json +0 -11
- package/deployments/80001-testenv.json +0 -22
- package/typechain-types/BribeDistributor.ts +0 -363
- package/typechain-types/ComposableStablePreview.ts +0 -217
- package/typechain-types/DistributorBase.ts +0 -363
- package/typechain-types/FeeDistributor.ts +0 -416
- package/typechain-types/I1inchAggregationRouterV5.ts +0 -257
- package/typechain-types/IAggregationExecutor.ts +0 -182
- package/typechain-types/IApeStaking.ts +0 -305
- package/typechain-types/IBalancerFees.ts +0 -89
- package/typechain-types/IBalancerStablePreview.ts +0 -217
- package/typechain-types/IBasePool.ts +0 -482
- package/typechain-types/IComposableStable.ts +0 -730
- package/typechain-types/IExecutorHelperEthereum1.ts +0 -599
- package/typechain-types/IGauge.ts +0 -160
- package/typechain-types/IHashflow.ts +0 -159
- package/typechain-types/IKyberSwapAggregationRouterHelper.ts +0 -109
- package/typechain-types/ILiquidityGaugeFactory.ts +0 -99
- package/typechain-types/IMetaAggregationRouter.ts +0 -213
- package/typechain-types/IMetaAggregationRouterV2.ts +0 -221
- package/typechain-types/IMetaStablePool.ts +0 -619
- package/typechain-types/IMultihopRouterEthereum.ts +0 -209
- package/typechain-types/IRateProvider.ts +0 -81
- package/typechain-types/ISwapAggregator.ts +0 -124
- package/typechain-types/IVault.ts +0 -410
- package/typechain-types/MetaStableMath.ts +0 -113
- package/typechain-types/MetaStablePreview.ts +0 -501
- package/typechain-types/Multicall2.ts +0 -437
- package/typechain-types/PendleApeStakingSY.ts +0 -1135
- package/typechain-types/PendleAura3EthSY.ts +0 -1639
- package/typechain-types/PendleAuraBalancerStableLPSY.ts +0 -1523
- package/typechain-types/PendleAuraCbethWstethSY.ts +0 -1626
- package/typechain-types/PendleAuraWethRethSY.ts +0 -1549
- package/typechain-types/PendleAuraWethWstethSY.ts +0 -1562
- package/typechain-types/SAPE.ts +0 -1395
- package/typechain-types/SYBaseAutoCompound.ts +0 -1203
- package/typechain-types/StEthHelper.ts +0 -107
- package/typechain-types/StablePreviewBase.ts +0 -217
- package/typechain-types/SwapAggregator.ts +0 -406
- package/typechain-types/factories/BribeDistributor__factory.ts +0 -303
- package/typechain-types/factories/ComposableStablePreview__factory.ts +0 -190
- package/typechain-types/factories/DistributorBase__factory.ts +0 -249
- package/typechain-types/factories/FeeDistributor__factory.ts +0 -339
- package/typechain-types/factories/I1inchAggregationRouterV5__factory.ts +0 -179
- package/typechain-types/factories/IAggregationExecutor__factory.ts +0 -84
- package/typechain-types/factories/IApeStaking__factory.ts +0 -161
- package/typechain-types/factories/IBalancerFees__factory.ts +0 -36
- package/typechain-types/factories/IBalancerStablePreview__factory.ts +0 -152
- package/typechain-types/factories/IBasePool__factory.ts +0 -340
- package/typechain-types/factories/IComposableStable__factory.ts +0 -482
- package/typechain-types/factories/IExecutorHelperEthereum1__factory.ts +0 -378
- package/typechain-types/factories/IGauge__factory.ts +0 -70
- package/typechain-types/factories/IHashflow__factory.ts +0 -113
- package/typechain-types/factories/IKyberSwapAggregationRouterHelper__factory.ts +0 -56
- package/typechain-types/factories/ILiquidityGaugeFactory__factory.ts +0 -49
- package/typechain-types/factories/IMetaAggregationRouterV2__factory.ts +0 -234
- package/typechain-types/factories/IMetaAggregationRouter__factory.ts +0 -202
- package/typechain-types/factories/IMetaStablePool__factory.ts +0 -413
- package/typechain-types/factories/IMultihopRouterEthereum__factory.ts +0 -155
- package/typechain-types/factories/IRateProvider__factory.ts +0 -36
- package/typechain-types/factories/ISwapAggregator__factory.ts +0 -66
- package/typechain-types/factories/IVault__factory.ts +0 -287
- package/typechain-types/factories/MetaStableMath__factory.ts +0 -93
- package/typechain-types/factories/MetaStablePreview__factory.ts +0 -375
- package/typechain-types/factories/Multicall2__factory.ts +0 -372
- package/typechain-types/factories/PendleApeStakingSY__factory.ts +0 -981
- package/typechain-types/factories/PendleAura3EthSY__factory.ts +0 -1365
- package/typechain-types/factories/PendleAuraBalancerStableLPSY__factory.ts +0 -1190
- package/typechain-types/factories/PendleAuraCbethWstethSY__factory.ts +0 -1356
- package/typechain-types/factories/PendleAuraWethRethSY__factory.ts +0 -1291
- package/typechain-types/factories/PendleAuraWethWstethSY__factory.ts +0 -1304
- package/typechain-types/factories/SAPE__factory.ts +0 -1142
- package/typechain-types/factories/SYBaseAutoCompound__factory.ts +0 -942
- package/typechain-types/factories/StEthHelper__factory.ts +0 -62
- package/typechain-types/factories/StablePreviewBase__factory.ts +0 -148
- package/typechain-types/factories/SwapAggregator__factory.ts +0 -309
|
@@ -1,215 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"_format": "hh-sol-artifact-1",
|
|
3
|
-
"contractName": "IMetaAggregationRouterV2",
|
|
4
|
-
"sourceName": "contracts/router/swap-aggregator/kyberswap/interfaces/IMetaAggregationRouterV2.sol",
|
|
5
|
-
"abi": [
|
|
6
|
-
{
|
|
7
|
-
"inputs": [
|
|
8
|
-
{
|
|
9
|
-
"components": [
|
|
10
|
-
{
|
|
11
|
-
"internalType": "address",
|
|
12
|
-
"name": "callTarget",
|
|
13
|
-
"type": "address"
|
|
14
|
-
},
|
|
15
|
-
{
|
|
16
|
-
"internalType": "address",
|
|
17
|
-
"name": "approveTarget",
|
|
18
|
-
"type": "address"
|
|
19
|
-
},
|
|
20
|
-
{
|
|
21
|
-
"internalType": "bytes",
|
|
22
|
-
"name": "targetData",
|
|
23
|
-
"type": "bytes"
|
|
24
|
-
},
|
|
25
|
-
{
|
|
26
|
-
"components": [
|
|
27
|
-
{
|
|
28
|
-
"internalType": "contract IERC20",
|
|
29
|
-
"name": "srcToken",
|
|
30
|
-
"type": "address"
|
|
31
|
-
},
|
|
32
|
-
{
|
|
33
|
-
"internalType": "contract IERC20",
|
|
34
|
-
"name": "dstToken",
|
|
35
|
-
"type": "address"
|
|
36
|
-
},
|
|
37
|
-
{
|
|
38
|
-
"internalType": "address[]",
|
|
39
|
-
"name": "srcReceivers",
|
|
40
|
-
"type": "address[]"
|
|
41
|
-
},
|
|
42
|
-
{
|
|
43
|
-
"internalType": "uint256[]",
|
|
44
|
-
"name": "srcAmounts",
|
|
45
|
-
"type": "uint256[]"
|
|
46
|
-
},
|
|
47
|
-
{
|
|
48
|
-
"internalType": "address[]",
|
|
49
|
-
"name": "feeReceivers",
|
|
50
|
-
"type": "address[]"
|
|
51
|
-
},
|
|
52
|
-
{
|
|
53
|
-
"internalType": "uint256[]",
|
|
54
|
-
"name": "feeAmounts",
|
|
55
|
-
"type": "uint256[]"
|
|
56
|
-
},
|
|
57
|
-
{
|
|
58
|
-
"internalType": "address",
|
|
59
|
-
"name": "dstReceiver",
|
|
60
|
-
"type": "address"
|
|
61
|
-
},
|
|
62
|
-
{
|
|
63
|
-
"internalType": "uint256",
|
|
64
|
-
"name": "amount",
|
|
65
|
-
"type": "uint256"
|
|
66
|
-
},
|
|
67
|
-
{
|
|
68
|
-
"internalType": "uint256",
|
|
69
|
-
"name": "minReturnAmount",
|
|
70
|
-
"type": "uint256"
|
|
71
|
-
},
|
|
72
|
-
{
|
|
73
|
-
"internalType": "uint256",
|
|
74
|
-
"name": "flags",
|
|
75
|
-
"type": "uint256"
|
|
76
|
-
},
|
|
77
|
-
{
|
|
78
|
-
"internalType": "bytes",
|
|
79
|
-
"name": "permit",
|
|
80
|
-
"type": "bytes"
|
|
81
|
-
}
|
|
82
|
-
],
|
|
83
|
-
"internalType": "struct IMetaAggregationRouterV2.SwapDescriptionV2",
|
|
84
|
-
"name": "desc",
|
|
85
|
-
"type": "tuple"
|
|
86
|
-
},
|
|
87
|
-
{
|
|
88
|
-
"internalType": "bytes",
|
|
89
|
-
"name": "clientData",
|
|
90
|
-
"type": "bytes"
|
|
91
|
-
}
|
|
92
|
-
],
|
|
93
|
-
"internalType": "struct IMetaAggregationRouterV2.SwapExecutionParams",
|
|
94
|
-
"name": "execution",
|
|
95
|
-
"type": "tuple"
|
|
96
|
-
}
|
|
97
|
-
],
|
|
98
|
-
"name": "swap",
|
|
99
|
-
"outputs": [
|
|
100
|
-
{
|
|
101
|
-
"internalType": "uint256",
|
|
102
|
-
"name": "",
|
|
103
|
-
"type": "uint256"
|
|
104
|
-
},
|
|
105
|
-
{
|
|
106
|
-
"internalType": "uint256",
|
|
107
|
-
"name": "",
|
|
108
|
-
"type": "uint256"
|
|
109
|
-
}
|
|
110
|
-
],
|
|
111
|
-
"stateMutability": "payable",
|
|
112
|
-
"type": "function"
|
|
113
|
-
},
|
|
114
|
-
{
|
|
115
|
-
"inputs": [
|
|
116
|
-
{
|
|
117
|
-
"internalType": "contract IAggregationExecutor",
|
|
118
|
-
"name": "caller",
|
|
119
|
-
"type": "address"
|
|
120
|
-
},
|
|
121
|
-
{
|
|
122
|
-
"components": [
|
|
123
|
-
{
|
|
124
|
-
"internalType": "contract IERC20",
|
|
125
|
-
"name": "srcToken",
|
|
126
|
-
"type": "address"
|
|
127
|
-
},
|
|
128
|
-
{
|
|
129
|
-
"internalType": "contract IERC20",
|
|
130
|
-
"name": "dstToken",
|
|
131
|
-
"type": "address"
|
|
132
|
-
},
|
|
133
|
-
{
|
|
134
|
-
"internalType": "address[]",
|
|
135
|
-
"name": "srcReceivers",
|
|
136
|
-
"type": "address[]"
|
|
137
|
-
},
|
|
138
|
-
{
|
|
139
|
-
"internalType": "uint256[]",
|
|
140
|
-
"name": "srcAmounts",
|
|
141
|
-
"type": "uint256[]"
|
|
142
|
-
},
|
|
143
|
-
{
|
|
144
|
-
"internalType": "address[]",
|
|
145
|
-
"name": "feeReceivers",
|
|
146
|
-
"type": "address[]"
|
|
147
|
-
},
|
|
148
|
-
{
|
|
149
|
-
"internalType": "uint256[]",
|
|
150
|
-
"name": "feeAmounts",
|
|
151
|
-
"type": "uint256[]"
|
|
152
|
-
},
|
|
153
|
-
{
|
|
154
|
-
"internalType": "address",
|
|
155
|
-
"name": "dstReceiver",
|
|
156
|
-
"type": "address"
|
|
157
|
-
},
|
|
158
|
-
{
|
|
159
|
-
"internalType": "uint256",
|
|
160
|
-
"name": "amount",
|
|
161
|
-
"type": "uint256"
|
|
162
|
-
},
|
|
163
|
-
{
|
|
164
|
-
"internalType": "uint256",
|
|
165
|
-
"name": "minReturnAmount",
|
|
166
|
-
"type": "uint256"
|
|
167
|
-
},
|
|
168
|
-
{
|
|
169
|
-
"internalType": "uint256",
|
|
170
|
-
"name": "flags",
|
|
171
|
-
"type": "uint256"
|
|
172
|
-
},
|
|
173
|
-
{
|
|
174
|
-
"internalType": "bytes",
|
|
175
|
-
"name": "permit",
|
|
176
|
-
"type": "bytes"
|
|
177
|
-
}
|
|
178
|
-
],
|
|
179
|
-
"internalType": "struct IMetaAggregationRouterV2.SwapDescriptionV2",
|
|
180
|
-
"name": "desc",
|
|
181
|
-
"type": "tuple"
|
|
182
|
-
},
|
|
183
|
-
{
|
|
184
|
-
"internalType": "bytes",
|
|
185
|
-
"name": "executorData",
|
|
186
|
-
"type": "bytes"
|
|
187
|
-
},
|
|
188
|
-
{
|
|
189
|
-
"internalType": "bytes",
|
|
190
|
-
"name": "clientData",
|
|
191
|
-
"type": "bytes"
|
|
192
|
-
}
|
|
193
|
-
],
|
|
194
|
-
"name": "swapSimpleMode",
|
|
195
|
-
"outputs": [
|
|
196
|
-
{
|
|
197
|
-
"internalType": "uint256",
|
|
198
|
-
"name": "",
|
|
199
|
-
"type": "uint256"
|
|
200
|
-
},
|
|
201
|
-
{
|
|
202
|
-
"internalType": "uint256",
|
|
203
|
-
"name": "",
|
|
204
|
-
"type": "uint256"
|
|
205
|
-
}
|
|
206
|
-
],
|
|
207
|
-
"stateMutability": "nonpayable",
|
|
208
|
-
"type": "function"
|
|
209
|
-
}
|
|
210
|
-
],
|
|
211
|
-
"bytecode": "0x",
|
|
212
|
-
"deployedBytecode": "0x",
|
|
213
|
-
"linkReferences": {},
|
|
214
|
-
"deployedLinkReferences": {}
|
|
215
|
-
}
|
|
@@ -1,224 +0,0 @@
|
|
|
1
|
-
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
2
|
-
pragma solidity 0.8.17;
|
|
3
|
-
|
|
4
|
-
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
|
|
5
|
-
import "@openzeppelin/contracts/proxy/utils/UUPSUpgradeable.sol";
|
|
6
|
-
import "../../core/libraries/BoringOwnableUpgradeable.sol";
|
|
7
|
-
import "../../core/libraries/Errors.sol";
|
|
8
|
-
import "../../interfaces/IPFeeDistributor.sol";
|
|
9
|
-
import "../../interfaces/IPVotingEscrowMainchain.sol";
|
|
10
|
-
import "../../interfaces/IPVotingController.sol";
|
|
11
|
-
import "../libraries/WeekMath.sol";
|
|
12
|
-
import "../libraries/VeHistoryLib.sol";
|
|
13
|
-
import "../../core/libraries/ArrayLib.sol";
|
|
14
|
-
|
|
15
|
-
contract PendleFeeDistributor is UUPSUpgradeable, BoringOwnableUpgradeable, IPFeeDistributor {
|
|
16
|
-
using SafeERC20 for IERC20;
|
|
17
|
-
using VeBalanceLib for VeBalance;
|
|
18
|
-
using ArrayLib for uint256[];
|
|
19
|
-
|
|
20
|
-
address public immutable votingController;
|
|
21
|
-
address public immutable vePendle;
|
|
22
|
-
address public immutable token;
|
|
23
|
-
|
|
24
|
-
address[] public allPools;
|
|
25
|
-
|
|
26
|
-
// [pool] => lastFundedWeek
|
|
27
|
-
mapping(address => uint256) public lastFundedWeek;
|
|
28
|
-
|
|
29
|
-
// [pool, user] => UserInfo
|
|
30
|
-
mapping(address => mapping(address => UserInfo)) public userInfo;
|
|
31
|
-
|
|
32
|
-
// [pool, epoch] => [fee]
|
|
33
|
-
mapping(address => mapping(uint256 => uint256)) public fees;
|
|
34
|
-
|
|
35
|
-
modifier ensureValidPool(address pool) {
|
|
36
|
-
if (lastFundedWeek[pool] == 0) revert Errors.FDInvalidPool(pool);
|
|
37
|
-
_;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
constructor(
|
|
41
|
-
address _votingController,
|
|
42
|
-
address _vePendle,
|
|
43
|
-
address _rewardToken
|
|
44
|
-
) initializer {
|
|
45
|
-
votingController = _votingController;
|
|
46
|
-
vePendle = _vePendle;
|
|
47
|
-
token = _rewardToken;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
function addPool(address pool, uint256 _startWeek) external onlyOwner {
|
|
51
|
-
if (!WeekMath.isValidWTime(_startWeek) || _startWeek == 0)
|
|
52
|
-
revert Errors.FDInvalidStartEpoch(_startWeek);
|
|
53
|
-
|
|
54
|
-
if (lastFundedWeek[pool] != 0) revert Errors.FDPoolAlreadyExists(pool);
|
|
55
|
-
|
|
56
|
-
lastFundedWeek[pool] = _startWeek - WeekMath.WEEK;
|
|
57
|
-
allPools.push(pool);
|
|
58
|
-
|
|
59
|
-
emit PoolAdded(pool, _startWeek);
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
function getAllPools() external view returns (address[] memory) {
|
|
63
|
-
return allPools;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
function fund(
|
|
67
|
-
address[] calldata pools,
|
|
68
|
-
uint256[][] calldata wTimes,
|
|
69
|
-
uint256[][] calldata amounts,
|
|
70
|
-
uint256 totalAmountToFund
|
|
71
|
-
) external onlyOwner {
|
|
72
|
-
uint256 length = pools.length;
|
|
73
|
-
if (wTimes.length != length || amounts.length != length)
|
|
74
|
-
revert Errors.ArrayLengthMismatch();
|
|
75
|
-
|
|
76
|
-
uint256 totalFunded = 0;
|
|
77
|
-
for (uint256 i = 0; i < length; ++i) {
|
|
78
|
-
_fund(pools[i], wTimes[i], amounts[i]);
|
|
79
|
-
totalFunded += amounts[i].sum();
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
if (totalFunded != totalAmountToFund)
|
|
83
|
-
revert Errors.FDTotalAmountFundedNotMatch(totalFunded, totalAmountToFund);
|
|
84
|
-
|
|
85
|
-
IERC20(token).transferFrom(msg.sender, address(this), totalFunded);
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
function _fund(
|
|
89
|
-
address pool,
|
|
90
|
-
uint256[] calldata wTimes,
|
|
91
|
-
uint256[] calldata amounts
|
|
92
|
-
) internal ensureValidPool(pool) {
|
|
93
|
-
if (wTimes.length != amounts.length) revert Errors.FDEpochLengthMismatch();
|
|
94
|
-
|
|
95
|
-
uint256 lastFunded = lastFundedWeek[pool];
|
|
96
|
-
|
|
97
|
-
uint256 curWeek = WeekMath.getCurrentWeekStart();
|
|
98
|
-
|
|
99
|
-
for (uint256 i = 0; i < amounts.length; ++i) {
|
|
100
|
-
uint256 wTime = wTimes[i];
|
|
101
|
-
uint256 amount = amounts[i];
|
|
102
|
-
|
|
103
|
-
if (wTime != lastFunded + WeekMath.WEEK)
|
|
104
|
-
revert Errors.FDInvalidWTimeFund(lastFunded, wTime);
|
|
105
|
-
|
|
106
|
-
fees[pool][wTime] += amount;
|
|
107
|
-
lastFunded += WeekMath.WEEK;
|
|
108
|
-
|
|
109
|
-
emit UpdateFee(pool, wTime, amount);
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
if (lastFunded >= curWeek) revert Errors.FDInvalidWTimeFund(lastFunded, curWeek);
|
|
113
|
-
|
|
114
|
-
lastFundedWeek[pool] = lastFunded;
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
function claimReward(address user, address[] calldata pools)
|
|
118
|
-
external
|
|
119
|
-
returns (uint256[] memory amountRewardOut)
|
|
120
|
-
{
|
|
121
|
-
amountRewardOut = new uint256[](pools.length);
|
|
122
|
-
for (uint256 i = 0; i < pools.length; ) {
|
|
123
|
-
amountRewardOut[i] = _accumulateUserReward(pools[i], user);
|
|
124
|
-
unchecked {
|
|
125
|
-
i++;
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
IERC20(token).safeTransfer(user, amountRewardOut.sum());
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
function getAllActivePools() external view returns (address[] memory) {
|
|
132
|
-
return allPools;
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
function _accumulateUserReward(address pool, address user)
|
|
136
|
-
internal
|
|
137
|
-
ensureValidPool(pool)
|
|
138
|
-
returns (uint256 totalReward)
|
|
139
|
-
{
|
|
140
|
-
uint256 length = _getUserCheckpointLength(pool, user);
|
|
141
|
-
if (length == 0) return 0;
|
|
142
|
-
|
|
143
|
-
uint256 lastWeek = lastFundedWeek[pool];
|
|
144
|
-
uint256 curWeek = userInfo[pool][user].firstUnclaimedWeek;
|
|
145
|
-
uint256 iter = userInfo[pool][user].iter;
|
|
146
|
-
|
|
147
|
-
if (curWeek > lastWeek) return 0; // nothing to account
|
|
148
|
-
|
|
149
|
-
Checkpoint memory checkpoint = _getUserCheckpointAt(pool, user, iter);
|
|
150
|
-
Checkpoint memory nextCheckpoint = checkpoint;
|
|
151
|
-
|
|
152
|
-
if (curWeek == 0) curWeek = checkpoint.timestamp + WeekMath.WEEK;
|
|
153
|
-
|
|
154
|
-
while (curWeek <= lastWeek) {
|
|
155
|
-
// we have at most one checkpoint per week
|
|
156
|
-
if (iter + 1 < length) {
|
|
157
|
-
if (nextCheckpoint.timestamp == checkpoint.timestamp) {
|
|
158
|
-
// next have been assigned to current checkpoint, so we need to get the next one
|
|
159
|
-
nextCheckpoint = _getUserCheckpointAt(pool, user, iter + 1);
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
if (nextCheckpoint.timestamp < curWeek) {
|
|
163
|
-
iter++;
|
|
164
|
-
checkpoint = nextCheckpoint;
|
|
165
|
-
}
|
|
166
|
-
// Important invariant: checkpoint[iter] < curWeek <= checkpoint[iter+1]
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
// assert(checkpoint.timestamp < curWeek); should always hold
|
|
170
|
-
|
|
171
|
-
uint256 userShare = checkpoint.value.getValueAt(uint128(curWeek));
|
|
172
|
-
if (userShare != 0) {
|
|
173
|
-
uint256 totalShare = _getPoolTotalSharesAt(pool, uint128(curWeek));
|
|
174
|
-
// userShare != 0 => totalShare != 0
|
|
175
|
-
uint256 amountRewardOut = (userShare * fees[pool][curWeek]) / totalShare;
|
|
176
|
-
totalReward += amountRewardOut;
|
|
177
|
-
emit ClaimReward(pool, user, curWeek, amountRewardOut);
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
curWeek += WeekMath.WEEK;
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
userInfo[pool][user] = UserInfo({
|
|
184
|
-
firstUnclaimedWeek: uint128(curWeek),
|
|
185
|
-
iter: uint128(iter)
|
|
186
|
-
});
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
function _getPoolTotalSharesAt(address pool, uint128 wTime) internal view returns (uint256) {
|
|
190
|
-
if (pool == vePendle) {
|
|
191
|
-
return IPVotingEscrowMainchain(vePendle).totalSupplyAt(wTime);
|
|
192
|
-
} else {
|
|
193
|
-
return IPVotingController(votingController).getPoolTotalVoteAt(pool, wTime);
|
|
194
|
-
}
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
function _getUserCheckpointAt(
|
|
198
|
-
address pool,
|
|
199
|
-
address user,
|
|
200
|
-
uint256 index
|
|
201
|
-
) internal view returns (Checkpoint memory) {
|
|
202
|
-
if (pool == vePendle) {
|
|
203
|
-
return IPVotingEscrowMainchain(vePendle).getUserHistoryAt(user, index);
|
|
204
|
-
} else {
|
|
205
|
-
return IPVotingController(votingController).getUserPoolHistoryAt(user, pool, index);
|
|
206
|
-
}
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
function _getUserCheckpointLength(address pool, address user) internal view returns (uint256) {
|
|
210
|
-
if (pool == vePendle) {
|
|
211
|
-
return IPVotingEscrowMainchain(vePendle).getUserHistoryLength(user);
|
|
212
|
-
} else {
|
|
213
|
-
return IPVotingController(votingController).getUserPoolHistoryLength(user, pool);
|
|
214
|
-
}
|
|
215
|
-
}
|
|
216
|
-
|
|
217
|
-
function initialize() external initializer {
|
|
218
|
-
__BoringOwnable_init();
|
|
219
|
-
}
|
|
220
|
-
|
|
221
|
-
// ----------------- upgrade-related -----------------
|
|
222
|
-
|
|
223
|
-
function _authorizeUpgrade(address) internal override onlyOwner {}
|
|
224
|
-
}
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
2
|
-
pragma solidity 0.8.17;
|
|
3
|
-
|
|
4
|
-
import "../../interfaces/IWstETH.sol";
|
|
5
|
-
import "../../interfaces/IWETH.sol";
|
|
6
|
-
import "../../interfaces/IStETH.sol";
|
|
7
|
-
import "../libraries/TokenHelper.sol";
|
|
8
|
-
|
|
9
|
-
abstract contract StEthHelper is TokenHelper {
|
|
10
|
-
address public constant WETH = 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2;
|
|
11
|
-
address public constant WSTETH = 0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0;
|
|
12
|
-
address public constant STETH = 0xae7ab96520DE3A18E5e111B5EaAb095312D7fE84;
|
|
13
|
-
|
|
14
|
-
constructor() {
|
|
15
|
-
_safeApproveInf(STETH, WSTETH);
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
/// @dev tokenIn must be either ETH, WETH or STETH
|
|
19
|
-
function _depositWstETH(address tokenIn, uint256 amountDep)
|
|
20
|
-
internal
|
|
21
|
-
virtual
|
|
22
|
-
returns (uint256 amountOut)
|
|
23
|
-
{
|
|
24
|
-
uint256 amountStETH;
|
|
25
|
-
if (tokenIn == STETH) {
|
|
26
|
-
amountStETH = amountDep;
|
|
27
|
-
} else {
|
|
28
|
-
if (tokenIn == WETH) IWETH(WETH).withdraw(amountDep);
|
|
29
|
-
|
|
30
|
-
uint256 amountStEthSharesOut = IStETH(STETH).submit{ value: amountDep }(address(0));
|
|
31
|
-
amountStETH = IStETH(STETH).getPooledEthByShares(amountStEthSharesOut);
|
|
32
|
-
}
|
|
33
|
-
amountOut = IWstETH(WSTETH).wrap(amountStETH);
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
function _redeemWstETH(address receiver, uint256 amountRedeem)
|
|
37
|
-
internal
|
|
38
|
-
virtual
|
|
39
|
-
returns (uint256 amountTokenOut)
|
|
40
|
-
{
|
|
41
|
-
amountTokenOut = IWstETH(WSTETH).unwrap(amountRedeem);
|
|
42
|
-
_transferOut(STETH, receiver, amountTokenOut);
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
/// @dev tokenIn must be either ETH, WETH or STETH
|
|
46
|
-
function _previewDepositWstETH(address tokenIn, uint256 amountDep)
|
|
47
|
-
internal
|
|
48
|
-
view
|
|
49
|
-
virtual
|
|
50
|
-
returns (uint256 amountOut)
|
|
51
|
-
{
|
|
52
|
-
if (tokenIn != STETH) {
|
|
53
|
-
assert(tokenIn == WETH || tokenIn == NATIVE);
|
|
54
|
-
uint256 totalShares = IStETH(STETH).getTotalShares();
|
|
55
|
-
uint256 totalPooledEth = IStETH(STETH).getTotalPooledEther();
|
|
56
|
-
uint256 amountStEthSharesOut = IStETH(STETH).getSharesByPooledEth(amountDep);
|
|
57
|
-
|
|
58
|
-
totalShares += amountStEthSharesOut;
|
|
59
|
-
totalPooledEth += amountDep;
|
|
60
|
-
|
|
61
|
-
uint256 stEthBalance = (amountStEthSharesOut * totalPooledEth) / totalShares;
|
|
62
|
-
amountOut = (stEthBalance * totalShares) / totalPooledEth;
|
|
63
|
-
} else {
|
|
64
|
-
amountOut = IStETH(STETH).getSharesByPooledEth(amountDep);
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
function _previewRedeemWstETH(uint256 amountRedeem) internal view returns (uint256 amountOut) {
|
|
69
|
-
amountOut = IStETH(STETH).getPooledEthByShares(amountRedeem);
|
|
70
|
-
}
|
|
71
|
-
}
|