@pendle/core-v2 0.16.2-testnet → 0.16.3-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 +15 -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 +15 -2
- package/build/artifacts/contracts/LiquidityMining/CrossChainMsg/PendleMsgSenderAppUpg.sol/PendleMsgSenderAppUpg.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/CrossChainMsg/PendleMsgSenderAppUpg.sol/PendleMsgSenderAppUpg.json +13 -0
- package/build/artifacts/contracts/LiquidityMining/FeeDistributor/EpochResultManager.sol/EpochResultManager.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/FeeDistributor/PendleFeeDistributor.sol/PendleFeeDistributor.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/FeeDistributor/PendleFeeDistributor.sol/PendleFeeDistributor.json +15 -2
- package/build/artifacts/contracts/LiquidityMining/FeeDistributor/PendleFeeDistributorFactory.sol/PendleFeeDistributorFactory.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/FeeDistributor/PendleFeeDistributorFactory.sol/PendleFeeDistributorFactory.json +15 -2
- package/build/artifacts/contracts/LiquidityMining/GaugeController/PendleGaugeControllerBaseUpg.sol/PendleGaugeControllerBaseUpg.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/GaugeController/PendleGaugeControllerBaseUpg.sol/PendleGaugeControllerBaseUpg.json +13 -0
- package/build/artifacts/contracts/LiquidityMining/GaugeController/PendleGaugeControllerMainchainUpg.sol/PendleGaugeControllerMainchainUpg.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/GaugeController/PendleGaugeControllerMainchainUpg.sol/PendleGaugeControllerMainchainUpg.json +15 -2
- package/build/artifacts/contracts/LiquidityMining/GaugeController/PendleGaugeControllerSidechainUpg.sol/PendleGaugeControllerSidechainUpg.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/GaugeController/PendleGaugeControllerSidechainUpg.sol/PendleGaugeControllerSidechainUpg.json +15 -2
- package/build/artifacts/contracts/LiquidityMining/VotingController/PendleVotingControllerUpg.sol/PendleVotingControllerUpg.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/VotingController/PendleVotingControllerUpg.sol/PendleVotingControllerUpg.json +15 -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 +15 -2
- package/build/artifacts/contracts/LiquidityMining/VotingEscrow/VotingEscrowPendleSidechain.sol/VotingEscrowPendleSidechain.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/VotingEscrow/VotingEscrowPendleSidechain.sol/VotingEscrowPendleSidechain.json +15 -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/LiquidityMining/libraries/WeekMath.sol/WeekMath.dbg.json +1 -1
- package/build/artifacts/contracts/core/BulkSeller/BulkSeller.sol/BulkSeller.dbg.json +4 -0
- package/build/artifacts/contracts/core/BulkSeller/BulkSeller.sol/BulkSeller.json +695 -0
- package/build/artifacts/contracts/core/BulkSeller/BulkSellerFactory.sol/BulkSellerFactory.dbg.json +4 -0
- package/build/artifacts/contracts/core/BulkSeller/BulkSellerFactory.sol/BulkSellerFactory.json +531 -0
- package/build/artifacts/contracts/core/BulkSeller/BulkSellerMathCore.sol/BulkSellerMathCore.dbg.json +4 -0
- package/build/artifacts/contracts/core/BulkSeller/BulkSellerMathCore.sol/BulkSellerMathCore.json +10 -0
- 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 +15 -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/PYIndex.sol/PYIndexLib.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/PYIndex.sol/PYIndexLib.json +2 -2
- 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/ConvexCurveLP/PendleConvexLPSY.sol/PendleConvexLPSY.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Convex/base/CurveFraxUsdcPoolHelper.sol/CurveFraxUsdcPoolHelper.dbg.json +4 -0
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Convex/base/CurveFraxUsdcPoolHelper.sol/CurveFraxUsdcPoolHelper.json +89 -0
- 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 +15 -2
- package/build/artifacts/contracts/core/YieldContracts/PendleYieldContractFactory.sol/PendleYieldContractFactory.dbg.json +1 -1
- package/build/artifacts/contracts/core/YieldContracts/PendleYieldContractFactory.sol/PendleYieldContractFactory.json +15 -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/PendleERC20.sol/PendleERC20.json +2 -2
- package/build/artifacts/contracts/core/erc20/PendleERC20Permit.sol/PendleERC20Permit.dbg.json +1 -1
- package/build/artifacts/contracts/core/erc20/PendleERC20Permit.sol/PendleERC20Permit.json +2 -2
- package/build/artifacts/contracts/core/libraries/BaseSplitCodeFactory.sol/BaseSplitCodeFactory.dbg.json +1 -1
- package/build/artifacts/contracts/core/libraries/BaseSplitCodeFactory.sol/BaseSplitCodeFactory.json +2 -2
- package/build/artifacts/contracts/core/libraries/BaseSplitCodeFactory.sol/CodeDeployer.dbg.json +1 -1
- package/build/artifacts/contracts/core/libraries/BaseSplitCodeFactory.sol/CodeDeployer.json +2 -2
- package/build/artifacts/contracts/core/libraries/BoringOwnableUpgradeable.sol/BoringOwnableUpgradeable.dbg.json +1 -1
- package/build/artifacts/contracts/core/libraries/BoringOwnableUpgradeable.sol/BoringOwnableUpgradeable.json +13 -0
- package/build/artifacts/contracts/core/libraries/BoringOwnableUpgradeable.sol/BoringOwnableUpgradeableData.dbg.json +1 -1
- package/build/artifacts/contracts/core/libraries/BoringOwnableUpgradeable.sol/BoringOwnableUpgradeableData.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 +208 -2
- package/build/artifacts/contracts/core/libraries/TokenHelper.sol/TokenHelper.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/ConvexCurve/IBooster.sol/IBooster.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/Curve/ICrvPool.sol/ICrvPool.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/Curve/ICrvPool.sol/ICrvPool.json +30 -83
- package/build/artifacts/contracts/interfaces/IAToken.sol/IAToken.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IERC4626.sol/IERC4626.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 +91 -17
- package/build/artifacts/contracts/interfaces/IPActionMintRedeem.sol/IPActionMintRedeem.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPActionMintRedeem.sol/IPActionMintRedeem.json +50 -0
- package/build/artifacts/contracts/interfaces/IPActionSwapPT.sol/IPActionSwapPT.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPActionSwapPT.sol/IPActionSwapPT.json +20 -0
- 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 +20 -0
- package/build/artifacts/contracts/interfaces/IPAllAction.sol/IPAllAction.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPAllAction.sol/IPAllAction.json +181 -17
- package/build/artifacts/contracts/interfaces/IPBulkSeller.sol/IPBulkSeller.dbg.json +4 -0
- package/build/artifacts/contracts/interfaces/IPBulkSeller.sol/IPBulkSeller.json +173 -0
- package/build/artifacts/contracts/interfaces/IPBulkSellerFactory.sol/IPBulkSellerFactory.dbg.json +4 -0
- package/build/artifacts/contracts/interfaces/IPBulkSellerFactory.sol/IPBulkSellerFactory.json +86 -0
- package/build/artifacts/contracts/interfaces/IPBulkSellerSYCallback.sol/IPBulkSellerCallback.dbg.json +4 -0
- package/build/artifacts/contracts/interfaces/IPBulkSellerSYCallback.sol/IPBulkSellerCallback.json +34 -0
- package/build/artifacts/contracts/interfaces/IPMarket.sol/IPMarket.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPPrincipalToken.sol/IPPrincipalToken.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/IPYieldContractFactory.sol/IPYieldContractFactory.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPYieldToken.sol/IPYieldToken.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IQiAvax.sol/IQiAvax.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IQiErc20.sol/IQiErc20.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IQiToken.sol/IQiToken.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/ISJoe.sol/ISJoe.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IStETH.sol/IStETH.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IStETH.sol/IStETH.json +45 -0
- package/build/artifacts/contracts/interfaces/IStandardizedYield.sol/IStandardizedYield.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IWAvax.sol/IWAvax.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IWETH.sol/IWETH.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/BaseSplitCodeFactoryContract.sol/BaseSplitCodeFactoryContract.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/BaseSplitCodeFactoryContract.sol/BaseSplitCodeFactoryContract.json +15 -2
- package/build/artifacts/contracts/offchain-helpers/BulkSellerOffchain.sol/BulkSellerOffchain.dbg.json +4 -0
- package/build/artifacts/contracts/offchain-helpers/BulkSellerOffchain.sol/BulkSellerOffchain.json +67 -0
- package/build/artifacts/contracts/offchain-helpers/ImplicitSwapfeeContract.sol/ImplicitSwapfeeContract.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/ImplicitSwapfeeContract.sol/ImplicitSwapfeeContract.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 -36
- package/build/artifacts/contracts/offchain-helpers/RouterStatic.sol/RouterStatic.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/RouterStatic.sol/RouterStatic.json +237 -61
- package/build/artifacts/contracts/router/ActionAddRemoveLiq.sol/ActionAddRemoveLiq.dbg.json +1 -1
- package/build/artifacts/contracts/router/ActionAddRemoveLiq.sol/ActionAddRemoveLiq.json +120 -41
- 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 +79 -24
- 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 +49 -24
- 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 +49 -24
- package/build/artifacts/contracts/router/PendleRouter.sol/PendleRouter.dbg.json +1 -1
- package/build/artifacts/contracts/router/PendleRouter.sol/PendleRouter.json +15 -2
- package/build/artifacts/contracts/router/base/ActionBaseMintRedeem.sol/ActionBaseMintRedeem.dbg.json +1 -1
- package/build/artifacts/contracts/router/base/ActionBaseMintRedeem.sol/ActionBaseMintRedeem.json +14 -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 +1 -1
- package/build/artifacts/contracts/router/kyberswap/AggregationRouterHelper.sol/AggregationRouterHelper.json +191 -2
- 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/KyberSwapHelper.sol/KyberSwapHelper.dbg.json +1 -1
- package/build/artifacts/contracts/router/kyberswap/KyberSwapHelper.sol/KyberSwapHelper.json +1 -1
- package/contracts/core/BulkSeller/BulkSeller.sol +250 -0
- package/contracts/core/BulkSeller/BulkSellerFactory.sol +89 -0
- package/contracts/core/BulkSeller/BulkSellerMathCore.sol +143 -0
- package/contracts/core/StandardizedYield/implementations/Convex/ConvexCurveLP/PendleConvexLPSY.sol +2 -4
- package/contracts/core/StandardizedYield/implementations/Convex/base/CurveFraxUsdcPoolHelper.sol +107 -0
- package/contracts/core/StandardizedYield/implementations/PendleWstEthSY.sol +19 -4
- package/contracts/core/libraries/Errors.sol +17 -0
- package/contracts/interfaces/Curve/ICrvPool.sol +9 -27
- package/contracts/interfaces/IPActionAddRemoveLiq.sol +3 -5
- package/contracts/interfaces/IPActionMintRedeem.sol +2 -0
- package/contracts/interfaces/IPBulkSeller.sol +28 -0
- package/contracts/interfaces/IPBulkSellerFactory.sol +12 -0
- package/contracts/interfaces/IPBulkSellerSYCallback.sol +10 -0
- package/contracts/interfaces/IStETH.sol +6 -0
- package/contracts/offchain-helpers/BulkSellerOffchain.sol +43 -0
- package/contracts/offchain-helpers/MarketMathStatic.sol +0 -144
- package/contracts/offchain-helpers/RouterStatic.sol +167 -51
- package/contracts/router/ActionAddRemoveLiq.sol +60 -44
- package/contracts/router/ActionMintRedeem.sol +19 -15
- package/contracts/router/ActionSwapPT.sol +3 -3
- package/contracts/router/ActionSwapYT.sol +11 -4
- package/contracts/router/base/ActionBaseMintRedeem.sol +73 -74
- package/contracts/router/kyberswap/AggregationRouterHelper.sol +17 -1
- package/contracts/router/kyberswap/IAggregatorRouterHelper.sol +10 -0
- package/contracts/router/kyberswap/KyberSwapHelper.sol +17 -8
- package/deployments/43113-core.json +3 -2
- package/deployments/43113-markets/benqi-market-QI-AVAX-FEB-2ND.json +9 -0
- package/deployments/80001-core.json +3 -2
- package/package.json +3 -2
- package/typechain-types/AccessControl.ts +360 -0
- package/typechain-types/ActionAddRemoveLiq.ts +83 -52
- package/typechain-types/ActionBaseMintRedeem.ts +27 -8
- package/typechain-types/ActionMintRedeem.ts +68 -17
- package/typechain-types/ActionSwapPT.ts +53 -12
- package/typechain-types/ActionSwapYT.ts +53 -12
- package/typechain-types/AggregationRouterHelper.ts +287 -3
- package/typechain-types/BaseSplitCodeFactoryContract.ts +9 -0
- package/typechain-types/BeaconProxy.ts +97 -0
- package/typechain-types/BoringOwnableUpgradeable.ts +9 -0
- package/typechain-types/BulkSeller.ts +776 -0
- package/typechain-types/BulkSellerFactory.ts +707 -0
- package/typechain-types/BulkSellerOffchain.ts +117 -0
- package/typechain-types/Curve3CrvPoolHelper.ts +236 -0
- package/typechain-types/CurveFraxUsdcPoolHelper.ts +158 -0
- package/typechain-types/CurveUsdd3CrvPoolHelper.ts +184 -0
- package/typechain-types/ERC165.ts +102 -0
- package/typechain-types/IAccessControl.ts +305 -0
- package/typechain-types/IAggregationRouterHelper.ts +108 -0
- package/typechain-types/ICrvPool.ts +66 -164
- package/typechain-types/IERC165.ts +102 -0
- package/typechain-types/IPActionAddRemoveLiq.ts +56 -44
- package/typechain-types/IPActionMintRedeem.ts +41 -9
- package/typechain-types/IPActionSwapPT.ts +26 -4
- package/typechain-types/IPActionSwapYT.ts +26 -4
- package/typechain-types/IPAllAction.ts +77 -55
- package/typechain-types/IPBulkSeller.ts +290 -0
- package/typechain-types/IPBulkSellerCallback.ts +115 -0
- package/typechain-types/IPBulkSellerFactory.ts +147 -0
- package/typechain-types/IStETH.ts +56 -0
- package/typechain-types/ITriCrvPool.ts +345 -0
- package/typechain-types/Initializable.ts +68 -0
- package/typechain-types/KyberSwapHelper.ts +8 -8
- package/typechain-types/MarketMathStatic.ts +0 -50
- package/typechain-types/PendleCurveFraxUsdcSY.ts +1228 -0
- package/typechain-types/PendleCurveUsdd3CrvSY.ts +1299 -0
- package/typechain-types/PendleFeeDistributor.ts +9 -0
- package/typechain-types/PendleFeeDistributorFactory.ts +9 -0
- package/typechain-types/PendleGaugeControllerBaseUpg.ts +9 -0
- package/typechain-types/PendleGaugeControllerMainchainUpg.ts +9 -0
- package/typechain-types/PendleGaugeControllerSidechainUpg.ts +9 -0
- package/typechain-types/PendleMarketFactory.ts +9 -0
- package/typechain-types/PendleMsgReceiveEndpointUpg.ts +9 -0
- package/typechain-types/PendleMsgSendEndpointUpg.ts +9 -0
- package/typechain-types/PendleMsgSenderAppUpg.ts +9 -0
- package/typechain-types/PendlePrincipalToken.ts +9 -0
- package/typechain-types/PendleRouter.ts +9 -0
- package/typechain-types/PendleVotingControllerUpg.ts +9 -0
- package/typechain-types/PendleYieldContractFactory.ts +9 -0
- package/typechain-types/ReentrancyGuardUpgradeable.ts +68 -0
- package/typechain-types/RouterStatic.ts +203 -22
- package/typechain-types/VotingEscrowPendleMainchain.ts +9 -0
- package/typechain-types/VotingEscrowPendleSidechain.ts +9 -0
- package/typechain-types/factories/AccessControl__factory.ts +227 -0
- package/typechain-types/factories/ActionAddRemoveLiq__factory.ts +131 -59
- package/typechain-types/factories/ActionBaseMintRedeem__factory.ts +14 -1
- package/typechain-types/factories/ActionCallback__factory.ts +1 -1
- package/typechain-types/factories/ActionMintRedeem__factory.ts +90 -42
- 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 +60 -42
- package/typechain-types/factories/ActionSwapYT__factory.ts +60 -42
- package/typechain-types/factories/AggregationRouterHelper__factory.ts +190 -1
- package/typechain-types/factories/BaseSplitCodeFactoryContract__factory.ts +14 -1
- package/typechain-types/factories/BaseSplitCodeFactory__factory.ts +1 -1
- package/typechain-types/factories/BeaconProxy__factory.ts +141 -0
- package/typechain-types/factories/BoringOwnableUpgradeableData__factory.ts +1 -1
- package/typechain-types/factories/BoringOwnableUpgradeable__factory.ts +13 -0
- package/typechain-types/factories/BulkSellerFactory__factory.ts +584 -0
- package/typechain-types/factories/BulkSellerOffchain__factory.ts +120 -0
- package/typechain-types/factories/BulkSeller__factory.ts +745 -0
- package/typechain-types/factories/Curve3CrvPoolHelper__factory.ts +220 -0
- package/typechain-types/factories/CurveFraxUsdcPoolHelper__factory.ts +146 -0
- package/typechain-types/factories/CurveUsdd3CrvPoolHelper__factory.ts +172 -0
- package/typechain-types/factories/ERC165__factory.ts +39 -0
- package/typechain-types/factories/ERC20__factory.ts +1 -1
- package/typechain-types/factories/Errors__factory.ts +207 -1
- package/typechain-types/factories/IAccessControl__factory.ts +198 -0
- package/typechain-types/factories/IAggregationRouterHelper__factory.ts +54 -0
- package/typechain-types/factories/ICrvPool__factory.ts +30 -83
- package/typechain-types/factories/IERC165__factory.ts +42 -0
- package/typechain-types/factories/IPActionAddRemoveLiq__factory.ts +91 -17
- package/typechain-types/factories/IPActionMintRedeem__factory.ts +50 -0
- package/typechain-types/factories/IPActionSwapPT__factory.ts +20 -0
- package/typechain-types/factories/IPActionSwapYT__factory.ts +20 -0
- package/typechain-types/factories/IPAllAction__factory.ts +181 -17
- package/typechain-types/factories/IPBulkSellerCallback__factory.ts +53 -0
- package/typechain-types/factories/IPBulkSellerFactory__factory.ts +101 -0
- package/typechain-types/factories/IPBulkSeller__factory.ts +185 -0
- package/typechain-types/factories/IStETH__factory.ts +45 -0
- package/typechain-types/factories/ITriCrvPool__factory.ts +225 -0
- package/typechain-types/factories/ImplicitSwapfeeContract__factory.ts +1 -1
- package/typechain-types/factories/Initializable__factory.ts +36 -0
- package/typechain-types/factories/KyberSwapHelper__factory.ts +1 -1
- package/typechain-types/factories/MarketMathStatic__factory.ts +1 -35
- package/typechain-types/factories/OracleLib__factory.ts +1 -1
- package/typechain-types/factories/PendleCurveFraxUsdcSY__factory.ts +1068 -0
- package/typechain-types/factories/PendleCurveUsdd3CrvSY__factory.ts +1168 -0
- package/typechain-types/factories/PendleERC20Permit__factory.ts +1 -1
- package/typechain-types/factories/PendleERC20__factory.ts +1 -1
- package/typechain-types/factories/PendleFeeDistributorFactory__factory.ts +14 -1
- package/typechain-types/factories/PendleFeeDistributor__factory.ts +14 -1
- package/typechain-types/factories/PendleGaugeControllerBaseUpg__factory.ts +13 -0
- package/typechain-types/factories/PendleGaugeControllerMainchainUpg__factory.ts +14 -1
- package/typechain-types/factories/PendleGaugeControllerSidechainUpg__factory.ts +14 -1
- package/typechain-types/factories/PendleMarketFactory__factory.ts +14 -1
- package/typechain-types/factories/PendleMarket__factory.ts +1 -1
- package/typechain-types/factories/PendleMsgReceiveEndpointUpg__factory.ts +14 -1
- package/typechain-types/factories/PendleMsgSendEndpointUpg__factory.ts +14 -1
- package/typechain-types/factories/PendleMsgSenderAppUpg__factory.ts +13 -0
- package/typechain-types/factories/PendlePrincipalToken__factory.ts +14 -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 +14 -1
- package/typechain-types/factories/PendleVotingControllerUpg__factory.ts +14 -1
- package/typechain-types/factories/PendleWstEthSY__factory.ts +1 -1
- package/typechain-types/factories/PendleYieldContractFactory__factory.ts +14 -1
- package/typechain-types/factories/PendleYieldToken__factory.ts +1 -1
- package/typechain-types/factories/ReentrancyGuardUpgradeable__factory.ts +43 -0
- package/typechain-types/factories/RouterStatic__factory.ts +182 -2
- package/typechain-types/factories/VotingEscrowPendleMainchain__factory.ts +14 -1
- package/typechain-types/factories/VotingEscrowPendleSidechain__factory.ts +14 -1
- package/typechain-types/hardhat.d.ts +139 -13
- package/typechain-types/index.ts +30 -4
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Convex/ConvexCurveLP/Pendle3CrvAndTokenSY.sol/Pendle3CrvAndTokenSY.dbg.json +0 -4
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Convex/ConvexCurveLP/Pendle3CrvAndTokenSY.sol/Pendle3CrvAndTokenSY.json +0 -1018
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Convex/Pendle3CrvHelper.sol/Pendle3CrvHelper.dbg.json +0 -4
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Convex/Pendle3CrvHelper.sol/Pendle3CrvHelper.json +0 -76
- package/contracts/core/StandardizedYield/implementations/Convex/ConvexCurveLP/Pendle3CrvAndTokenSY.sol +0 -167
- package/contracts/core/StandardizedYield/implementations/Convex/Pendle3CrvHelper.sol +0 -83
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"_format": "hh-sol-artifact-1",
|
|
3
|
-
"contractName": "Pendle3CrvHelper",
|
|
4
|
-
"sourceName": "contracts/core/StandardizedYield/implementations/Convex/Pendle3CrvHelper.sol",
|
|
5
|
-
"abi": [
|
|
6
|
-
{
|
|
7
|
-
"inputs": [],
|
|
8
|
-
"name": "DAI",
|
|
9
|
-
"outputs": [
|
|
10
|
-
{
|
|
11
|
-
"internalType": "address",
|
|
12
|
-
"name": "",
|
|
13
|
-
"type": "address"
|
|
14
|
-
}
|
|
15
|
-
],
|
|
16
|
-
"stateMutability": "view",
|
|
17
|
-
"type": "function"
|
|
18
|
-
},
|
|
19
|
-
{
|
|
20
|
-
"inputs": [],
|
|
21
|
-
"name": "LP",
|
|
22
|
-
"outputs": [
|
|
23
|
-
{
|
|
24
|
-
"internalType": "address",
|
|
25
|
-
"name": "",
|
|
26
|
-
"type": "address"
|
|
27
|
-
}
|
|
28
|
-
],
|
|
29
|
-
"stateMutability": "view",
|
|
30
|
-
"type": "function"
|
|
31
|
-
},
|
|
32
|
-
{
|
|
33
|
-
"inputs": [],
|
|
34
|
-
"name": "POOL",
|
|
35
|
-
"outputs": [
|
|
36
|
-
{
|
|
37
|
-
"internalType": "address",
|
|
38
|
-
"name": "",
|
|
39
|
-
"type": "address"
|
|
40
|
-
}
|
|
41
|
-
],
|
|
42
|
-
"stateMutability": "view",
|
|
43
|
-
"type": "function"
|
|
44
|
-
},
|
|
45
|
-
{
|
|
46
|
-
"inputs": [],
|
|
47
|
-
"name": "USDC",
|
|
48
|
-
"outputs": [
|
|
49
|
-
{
|
|
50
|
-
"internalType": "address",
|
|
51
|
-
"name": "",
|
|
52
|
-
"type": "address"
|
|
53
|
-
}
|
|
54
|
-
],
|
|
55
|
-
"stateMutability": "view",
|
|
56
|
-
"type": "function"
|
|
57
|
-
},
|
|
58
|
-
{
|
|
59
|
-
"inputs": [],
|
|
60
|
-
"name": "USDT",
|
|
61
|
-
"outputs": [
|
|
62
|
-
{
|
|
63
|
-
"internalType": "address",
|
|
64
|
-
"name": "",
|
|
65
|
-
"type": "address"
|
|
66
|
-
}
|
|
67
|
-
],
|
|
68
|
-
"stateMutability": "view",
|
|
69
|
-
"type": "function"
|
|
70
|
-
}
|
|
71
|
-
],
|
|
72
|
-
"bytecode": "0x61013461003a600b82828239805160001a60731461002d57634e487b7160e01b600052600060045260246000fd5b30600052607381538281f3fe7300000000000000000000000000000000000000003014608060405260043610605b5760003560e01c80637535d24614606057806389a30271146096578063b6fccf8a1460b0578063c54e44eb1460ca578063e0bab4c41460e4575b600080fd5b607a73bebc44782c7db0a1a60cb6fe97d0b483032ff1c781565b6040516001600160a01b03909116815260200160405180910390f35b607a73a0b86991c6218b36c1d19d4a2e9eb0ce3606eb4881565b607a736c3f90f043a72fa612cbac8115ee7e52bde6e49081565b607a73dac17f958d2ee523a2206206994597c13d831ec781565b607a736b175474e89094c44da98b954eedeac495271d0f8156fea264697066735822122043d73d998859be25d4dc2df67fa033a35b8ebb20dc45601848bba49b66ccf30664736f6c63430008110033",
|
|
73
|
-
"deployedBytecode": "0x7300000000000000000000000000000000000000003014608060405260043610605b5760003560e01c80637535d24614606057806389a30271146096578063b6fccf8a1460b0578063c54e44eb1460ca578063e0bab4c41460e4575b600080fd5b607a73bebc44782c7db0a1a60cb6fe97d0b483032ff1c781565b6040516001600160a01b03909116815260200160405180910390f35b607a73a0b86991c6218b36c1d19d4a2e9eb0ce3606eb4881565b607a736c3f90f043a72fa612cbac8115ee7e52bde6e49081565b607a73dac17f958d2ee523a2206206994597c13d831ec781565b607a736b175474e89094c44da98b954eedeac495271d0f8156fea264697066735822122043d73d998859be25d4dc2df67fa033a35b8ebb20dc45601848bba49b66ccf30664736f6c63430008110033",
|
|
74
|
-
"linkReferences": {},
|
|
75
|
-
"deployedLinkReferences": {}
|
|
76
|
-
}
|
|
@@ -1,167 +0,0 @@
|
|
|
1
|
-
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
2
|
-
pragma solidity 0.8.17;
|
|
3
|
-
|
|
4
|
-
import "./PendleConvexLPSY.sol";
|
|
5
|
-
import "../Pendle3CrvHelper.sol";
|
|
6
|
-
import "../../../../libraries/ArrayLib.sol";
|
|
7
|
-
|
|
8
|
-
contract Pendle3CrvAndTokenSY is PendleConvexLPSY {
|
|
9
|
-
using ArrayLib for address[];
|
|
10
|
-
|
|
11
|
-
uint256 public immutable indexOf3Crv;
|
|
12
|
-
uint256 public immutable indexOfOther;
|
|
13
|
-
address public immutable otherToken;
|
|
14
|
-
|
|
15
|
-
constructor(
|
|
16
|
-
string memory _name,
|
|
17
|
-
string memory _symbol,
|
|
18
|
-
uint256 _cvxPid,
|
|
19
|
-
address _crvLp,
|
|
20
|
-
address _crvPool
|
|
21
|
-
) PendleConvexLPSY(_name, _symbol, _cvxPid, _crvLp, _crvPool) {
|
|
22
|
-
indexOf3Crv = ICrvPool(_crvPool).coins(0) == Pendle3CrvHelper.LP ? 0 : 1;
|
|
23
|
-
indexOfOther = 1 - indexOf3Crv;
|
|
24
|
-
otherToken = ICrvPool(_crvPool).coins(indexOfOther);
|
|
25
|
-
|
|
26
|
-
_safeApproveInf(Pendle3CrvHelper.LP, crvPool);
|
|
27
|
-
_safeApproveInf(otherToken, crvPool);
|
|
28
|
-
|
|
29
|
-
_safeApproveInf(Pendle3CrvHelper.DAI, Pendle3CrvHelper.POOL);
|
|
30
|
-
_safeApproveInf(Pendle3CrvHelper.USDC, Pendle3CrvHelper.POOL);
|
|
31
|
-
_safeApproveInf(Pendle3CrvHelper.USDT, Pendle3CrvHelper.POOL);
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
function _depositToCurve(address tokenIn, uint256 amountTokenToDeposit)
|
|
35
|
-
internal
|
|
36
|
-
virtual
|
|
37
|
-
override
|
|
38
|
-
returns (uint256 amountLpOut)
|
|
39
|
-
{
|
|
40
|
-
uint256 preBalanceLp = _selfBalance(crvLp);
|
|
41
|
-
|
|
42
|
-
uint256[2] memory amounts;
|
|
43
|
-
|
|
44
|
-
if (Pendle3CrvHelper.is3CrvToken(tokenIn)) {
|
|
45
|
-
uint256 amount3CrvLp = Pendle3CrvHelper.deposit3Crv(tokenIn, amountTokenToDeposit);
|
|
46
|
-
amounts[indexOf3Crv] = amount3CrvLp;
|
|
47
|
-
} else {
|
|
48
|
-
// one of the 2 LP
|
|
49
|
-
amounts[_getIndex(tokenIn)] = amountTokenToDeposit;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
ICrvPool(crvPool).add_liquidity(amounts, 0);
|
|
53
|
-
|
|
54
|
-
amountLpOut = _selfBalance(crvLp) - preBalanceLp;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
function _redeemFromCurve(address tokenOut, uint256 amountLpToRedeem)
|
|
58
|
-
internal
|
|
59
|
-
virtual
|
|
60
|
-
override
|
|
61
|
-
returns (uint256 amountTokenOut)
|
|
62
|
-
{
|
|
63
|
-
address tokenToRemove = (tokenOut == otherToken) ? otherToken : Pendle3CrvHelper.LP;
|
|
64
|
-
|
|
65
|
-
uint256 preBalanceToken = _selfBalance(tokenToRemove);
|
|
66
|
-
|
|
67
|
-
ICrvPool(crvPool).remove_liquidity_one_coin(
|
|
68
|
-
amountLpToRedeem,
|
|
69
|
-
Math.Int128(_getIndex(tokenToRemove)),
|
|
70
|
-
0
|
|
71
|
-
);
|
|
72
|
-
|
|
73
|
-
uint256 amountTokenRemoved = _selfBalance(tokenToRemove) - preBalanceToken;
|
|
74
|
-
|
|
75
|
-
if (Pendle3CrvHelper.is3CrvToken(tokenOut)) {
|
|
76
|
-
amountTokenOut = Pendle3CrvHelper.redeem3Crv(tokenOut, amountTokenRemoved);
|
|
77
|
-
} else {
|
|
78
|
-
// one of the 2 LP
|
|
79
|
-
amountTokenOut = amountTokenRemoved;
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
function _previewDepositToCurve(address tokenIn, uint256 amountTokenToDeposit)
|
|
84
|
-
internal
|
|
85
|
-
view
|
|
86
|
-
virtual
|
|
87
|
-
override
|
|
88
|
-
returns (uint256)
|
|
89
|
-
{
|
|
90
|
-
uint256[2] memory amounts;
|
|
91
|
-
|
|
92
|
-
if (Pendle3CrvHelper.is3CrvToken(tokenIn)) {
|
|
93
|
-
uint256 amount3CrvLp = Pendle3CrvHelper.preview3CrvDeposit(
|
|
94
|
-
tokenIn,
|
|
95
|
-
amountTokenToDeposit
|
|
96
|
-
);
|
|
97
|
-
amounts[indexOf3Crv] = amount3CrvLp;
|
|
98
|
-
} else {
|
|
99
|
-
// one of the 2 LP
|
|
100
|
-
amounts[_getIndex(tokenIn)] = amountTokenToDeposit;
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
return ICrvPool(crvPool).calc_token_amount(amounts, true);
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
function _previewRedeemFromCurve(address tokenOut, uint256 amountLpToRedeem)
|
|
107
|
-
internal
|
|
108
|
-
view
|
|
109
|
-
virtual
|
|
110
|
-
override
|
|
111
|
-
returns (uint256)
|
|
112
|
-
{
|
|
113
|
-
uint256 amountTokenRemoved = ICrvPool(crvPool).calc_withdraw_one_coin(
|
|
114
|
-
amountLpToRedeem,
|
|
115
|
-
Math.Int128(_getIndex(tokenOut))
|
|
116
|
-
);
|
|
117
|
-
|
|
118
|
-
if (Pendle3CrvHelper.is3CrvToken(tokenOut)) {
|
|
119
|
-
return Pendle3CrvHelper.preview3CrvRedeem(tokenOut, amountTokenRemoved);
|
|
120
|
-
} else {
|
|
121
|
-
// one of the 2 LP
|
|
122
|
-
return amountTokenRemoved;
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
function _getIndex(address token) internal view returns (uint256) {
|
|
127
|
-
if (token == Pendle3CrvHelper.LP || Pendle3CrvHelper.is3CrvToken(token)) {
|
|
128
|
-
return indexOf3Crv;
|
|
129
|
-
} else {
|
|
130
|
-
return indexOfOther;
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
function getTokensIn() public view virtual override returns (address[] memory res) {
|
|
135
|
-
res = new address[](6);
|
|
136
|
-
res[0] = crvLp;
|
|
137
|
-
res[1] = otherToken;
|
|
138
|
-
res[2] = Pendle3CrvHelper.LP;
|
|
139
|
-
res[3] = Pendle3CrvHelper.DAI;
|
|
140
|
-
res[4] = Pendle3CrvHelper.USDC;
|
|
141
|
-
res[5] = Pendle3CrvHelper.USDT;
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
function getTokensOut() public view virtual override returns (address[] memory res) {
|
|
145
|
-
res = new address[](6);
|
|
146
|
-
res[0] = crvLp;
|
|
147
|
-
res[1] = otherToken;
|
|
148
|
-
res[2] = Pendle3CrvHelper.LP;
|
|
149
|
-
res[3] = Pendle3CrvHelper.DAI;
|
|
150
|
-
res[4] = Pendle3CrvHelper.USDC;
|
|
151
|
-
res[5] = Pendle3CrvHelper.USDT;
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
function isValidTokenIn(address token) public view virtual override returns (bool res) {
|
|
155
|
-
res = (token == crvLp ||
|
|
156
|
-
token == otherToken ||
|
|
157
|
-
token == Pendle3CrvHelper.LP ||
|
|
158
|
-
Pendle3CrvHelper.is3CrvToken(token));
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
function isValidTokenOut(address token) public view override returns (bool res) {
|
|
162
|
-
res = (token == crvLp ||
|
|
163
|
-
token == otherToken ||
|
|
164
|
-
token == Pendle3CrvHelper.LP ||
|
|
165
|
-
Pendle3CrvHelper.is3CrvToken(token));
|
|
166
|
-
}
|
|
167
|
-
}
|
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
2
|
-
pragma solidity 0.8.17;
|
|
3
|
-
|
|
4
|
-
import "../../../../interfaces/Curve/ICrvPool.sol";
|
|
5
|
-
import "../../../libraries/math/Math.sol";
|
|
6
|
-
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
|
|
7
|
-
|
|
8
|
-
library Pendle3CrvHelper {
|
|
9
|
-
using Math for uint256;
|
|
10
|
-
|
|
11
|
-
address public constant LP = 0x6c3F90f043a72FA612cbac8115EE7e52BDe6E490;
|
|
12
|
-
address public constant POOL = 0xbEbc44782C7dB0a1A60Cb6fe97d0b483032FF1C7;
|
|
13
|
-
address public constant DAI = 0x6B175474E89094C44Da98b954EedeAC495271d0F;
|
|
14
|
-
address public constant USDC = 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48;
|
|
15
|
-
address public constant USDT = 0xdAC17F958D2ee523a2206206994597C13D831ec7;
|
|
16
|
-
|
|
17
|
-
function preview3CrvDeposit(address tokenIn, uint256 amountTokenToDeposit)
|
|
18
|
-
internal
|
|
19
|
-
view
|
|
20
|
-
returns (uint256)
|
|
21
|
-
{
|
|
22
|
-
return
|
|
23
|
-
ICrvPool(POOL).calc_token_amount(
|
|
24
|
-
_getTokenAmounts(tokenIn, amountTokenToDeposit),
|
|
25
|
-
true
|
|
26
|
-
);
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
function preview3CrvRedeem(address tokenOut, uint256 amountSharesToRedeem)
|
|
30
|
-
internal
|
|
31
|
-
view
|
|
32
|
-
returns (uint256)
|
|
33
|
-
{
|
|
34
|
-
return
|
|
35
|
-
ICrvPool(POOL).calc_withdraw_one_coin(
|
|
36
|
-
amountSharesToRedeem,
|
|
37
|
-
_get3CrvTokenIndex(tokenOut).Int128()
|
|
38
|
-
);
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
function deposit3Crv(address tokenIn, uint256 amountTokenToDeposit)
|
|
42
|
-
internal
|
|
43
|
-
returns (uint256)
|
|
44
|
-
{
|
|
45
|
-
uint256 balBefore = IERC20(LP).balanceOf(address(this));
|
|
46
|
-
ICrvPool(POOL).add_liquidity(_getTokenAmounts(tokenIn, amountTokenToDeposit), 0);
|
|
47
|
-
uint256 balAfter = IERC20(LP).balanceOf(address(this));
|
|
48
|
-
return balAfter - balBefore;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
function redeem3Crv(address tokenOut, uint256 amountSharesToRedeem)
|
|
52
|
-
internal
|
|
53
|
-
returns (uint256)
|
|
54
|
-
{
|
|
55
|
-
uint256 balBefore = IERC20(tokenOut).balanceOf(address(this));
|
|
56
|
-
ICrvPool(POOL).remove_liquidity_one_coin(
|
|
57
|
-
amountSharesToRedeem,
|
|
58
|
-
_get3CrvTokenIndex(tokenOut).Int128(),
|
|
59
|
-
0
|
|
60
|
-
);
|
|
61
|
-
uint256 balAfter = IERC20(tokenOut).balanceOf(address(this));
|
|
62
|
-
return balAfter - balBefore;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
function _getTokenAmounts(address token, uint256 amount)
|
|
66
|
-
internal
|
|
67
|
-
pure
|
|
68
|
-
returns (uint256[3] memory res)
|
|
69
|
-
{
|
|
70
|
-
res[_get3CrvTokenIndex(token)] = amount;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
function _get3CrvTokenIndex(address token) internal pure returns (uint256) {
|
|
74
|
-
if (token == DAI) return 0;
|
|
75
|
-
if (token == USDC) return 1;
|
|
76
|
-
if (token == USDT) return 2;
|
|
77
|
-
revert("Pendle3CrvHelper: not valid token");
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
function is3CrvToken(address token) internal pure returns (bool) {
|
|
81
|
-
return (token == DAI || token == USDC || token == USDT);
|
|
82
|
-
}
|
|
83
|
-
}
|