@pendle/core-v2 0.13.0-testnet → 0.14.0-testnet
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/artifacts/contracts/LiquidityMining/CrossChainMsg/PendleMsgReceiveEndpointUpg.sol/PendleMsgReceiveEndpointUpg.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/CrossChainMsg/PendleMsgReceiveEndpointUpg.sol/PendleMsgReceiveEndpointUpg.json +2 -2
- package/build/artifacts/contracts/LiquidityMining/CrossChainMsg/PendleMsgReceiverAppUpg.sol/PendleMsgReceiverAppUpg.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/CrossChainMsg/PendleMsgSendEndpointUpg.sol/PendleMsgSendEndpointUpg.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/CrossChainMsg/PendleMsgSendEndpointUpg.sol/PendleMsgSendEndpointUpg.json +2 -2
- package/build/artifacts/contracts/LiquidityMining/CrossChainMsg/PendleMsgSenderAppUpg.sol/PendleMsgSenderAppUpg.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/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 +2 -2
- package/build/artifacts/contracts/LiquidityMining/FeeDistributor/PendleFeeDistributorFactory.sol/PendleFeeDistributorFactory.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/FeeDistributor/PendleFeeDistributorFactory.sol/PendleFeeDistributorFactory.json +2 -2
- package/build/artifacts/contracts/LiquidityMining/GaugeController/PendleGaugeControllerBaseUpg.sol/PendleGaugeControllerBaseUpg.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/GaugeController/PendleGaugeControllerBaseUpg.sol/PendleGaugeControllerBaseUpg.json +89 -0
- package/build/artifacts/contracts/LiquidityMining/GaugeController/PendleGaugeControllerMainchainUpg.sol/PendleGaugeControllerMainchainUpg.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/GaugeController/PendleGaugeControllerMainchainUpg.sol/PendleGaugeControllerMainchainUpg.json +91 -2
- package/build/artifacts/contracts/LiquidityMining/GaugeController/PendleGaugeControllerSidechainUpg.sol/PendleGaugeControllerSidechainUpg.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/GaugeController/PendleGaugeControllerSidechainUpg.sol/PendleGaugeControllerSidechainUpg.json +91 -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/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 +26 -26
- 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/StandardizedYield/PYIndex.sol/PYIndexLib.dbg.json +4 -0
- package/build/artifacts/contracts/core/{SuperComposableYield → StandardizedYield}/PYIndex.sol/PYIndexLib.json +3 -3
- package/build/artifacts/contracts/core/StandardizedYield/SYBase.sol/SYBase.dbg.json +4 -0
- package/build/artifacts/contracts/core/{SuperComposableYield/SCYBase.sol/SCYBase.json → StandardizedYield/SYBase.sol/SYBase.json} +11 -11
- package/build/artifacts/contracts/core/StandardizedYield/SYBaseWithRewards.sol/SYBaseWithRewards.dbg.json +4 -0
- package/build/artifacts/contracts/core/{SuperComposableYield/SCYBaseWithRewards.sol/SCYBaseWithRewards.json → StandardizedYield/SYBaseWithRewards.sol/SYBaseWithRewards.json} +11 -11
- package/build/artifacts/contracts/core/StandardizedYield/SYUtils.sol/SYUtils.dbg.json +4 -0
- package/build/artifacts/contracts/core/{SuperComposableYield/SCYUtils.sol/SCYUtils.json → StandardizedYield/SYUtils.sol/SYUtils.json} +4 -4
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BenQi/PendleQiTokenHelper.sol/PendleQiTokenHelper.dbg.json +4 -0
- package/build/artifacts/contracts/core/{SuperComposableYield → StandardizedYield}/implementations/BenQi/PendleQiTokenHelper.sol/PendleQiTokenHelper.json +3 -3
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BenQi/PendleQiTokenSY.sol/PendleQiTokenSY.dbg.json +4 -0
- package/build/artifacts/contracts/core/{SuperComposableYield/implementations/BenQi/PendleQiTokenSCY.sol/PendleQiTokenSCY.json → StandardizedYield/implementations/BenQi/PendleQiTokenSY.sol/PendleQiTokenSY.json} +17 -17
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Convex/ConvexCurveLP/Pendle3CrvAndTokenSY.sol/Pendle3CrvAndTokenSY.dbg.json +4 -0
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Convex/ConvexCurveLP/Pendle3CrvAndTokenSY.sol/Pendle3CrvAndTokenSY.json +1028 -0
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Convex/ConvexCurveLP/PendleConvexLPSY.sol/PendleConvexLPSY.dbg.json +4 -0
- package/build/artifacts/contracts/core/{SuperComposableYield/implementations/Convex/ConvexCurveLP/PendleConvexCurveLPSCY.sol/PendleConvexCurveLPSCY.json → StandardizedYield/implementations/Convex/ConvexCurveLP/PendleConvexLPSY.sol/PendleConvexLPSY.json} +47 -47
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Convex/Pendle3CrvHelper.sol/Pendle3CrvHelper.dbg.json +4 -0
- package/build/artifacts/contracts/core/{SuperComposableYield → StandardizedYield}/implementations/Convex/Pendle3CrvHelper.sol/Pendle3CrvHelper.json +5 -5
- package/build/artifacts/contracts/core/StandardizedYield/implementations/PendleWstEthSY.sol/PendleWstEthSY.dbg.json +4 -0
- package/build/artifacts/contracts/core/{SuperComposableYield/implementations/PendleWstEthSCY.sol/PendleWstEthSCY.json → StandardizedYield/implementations/PendleWstEthSY.sol/PendleWstEthSY.json} +13 -13
- 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 +4 -4
- package/build/artifacts/contracts/core/YieldContracts/PendleYieldContractFactory.sol/PendleYieldContractFactory.dbg.json +1 -1
- package/build/artifacts/contracts/core/YieldContracts/PendleYieldContractFactory.sol/PendleYieldContractFactory.json +4 -4
- package/build/artifacts/contracts/core/YieldContracts/PendleYieldToken.sol/PendleYieldToken.dbg.json +1 -1
- package/build/artifacts/contracts/core/YieldContracts/PendleYieldToken.sol/PendleYieldToken.json +24 -24
- package/build/artifacts/contracts/core/libraries/Errors.sol/Errors.dbg.json +1 -1
- package/build/artifacts/contracts/core/libraries/Errors.sol/Errors.json +28 -28
- package/build/artifacts/contracts/interfaces/IPActionAddRemoveLiq.sol/IPActionAddRemoveLiq.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPActionAddRemoveLiq.sol/IPActionAddRemoveLiq.json +30 -30
- package/build/artifacts/contracts/interfaces/IPActionMintRedeem.sol/IPActionMintRedeem.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPActionMintRedeem.sol/IPActionMintRedeem.json +34 -34
- package/build/artifacts/contracts/interfaces/IPActionSwapPT.sol/IPActionSwapPT.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPActionSwapPT.sol/IPActionSwapPT.json +20 -20
- package/build/artifacts/contracts/interfaces/IPActionSwapPTYT.sol/IPActionSwapPTYT.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPActionSwapPTYT.sol/IPActionSwapPTYT.json +2 -2
- package/build/artifacts/contracts/interfaces/IPActionSwapYT.sol/IPActionSwapYT.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPActionSwapYT.sol/IPActionSwapYT.json +20 -20
- package/build/artifacts/contracts/interfaces/IPAllAction.sol/IPAllAction.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPAllAction.sol/IPAllAction.json +106 -106
- package/build/artifacts/contracts/interfaces/IPMarket.sol/IPMarket.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPMarket.sol/IPMarket.json +18 -18
- package/build/artifacts/contracts/interfaces/IPMarketSwapCallback.sol/IPMarketSwapCallback.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPMarketSwapCallback.sol/IPMarketSwapCallback.json +1 -1
- package/build/artifacts/contracts/interfaces/IPPrincipalToken.sol/IPPrincipalToken.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPPrincipalToken.sol/IPPrincipalToken.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/IPYieldContractFactory.sol/IPYieldContractFactory.json +3 -3
- package/build/artifacts/contracts/interfaces/IPYieldToken.sol/IPYieldToken.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPYieldToken.sol/IPYieldToken.json +6 -6
- package/build/artifacts/contracts/interfaces/IStandardizedYield.sol/IStandardizedYield.dbg.json +4 -0
- package/build/artifacts/contracts/interfaces/{ISuperComposableYield.sol/ISuperComposableYield.json → IStandardizedYield.sol/IStandardizedYield.json} +5 -5
- package/build/artifacts/contracts/offchain-helpers/MarketMathStatic.sol/MarketMathStatic.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/MarketMathStatic.sol/MarketMathStatic.json +7 -7
- package/build/artifacts/contracts/offchain-helpers/RouterStatic.sol/RouterStatic.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/RouterStatic.sol/RouterStatic.json +116 -116
- package/build/artifacts/contracts/router/ActionAddRemoveLiq.sol/ActionAddRemoveLiq.dbg.json +1 -1
- package/build/artifacts/contracts/router/ActionAddRemoveLiq.sol/ActionAddRemoveLiq.json +35 -35
- package/build/artifacts/contracts/router/ActionCallback.sol/ActionCallback.dbg.json +1 -1
- package/build/artifacts/contracts/router/ActionCallback.sol/ActionCallback.json +12 -12
- package/build/artifacts/contracts/router/ActionMintRedeem.sol/ActionMintRedeem.dbg.json +1 -1
- package/build/artifacts/contracts/router/ActionMintRedeem.sol/ActionMintRedeem.json +41 -41
- 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 +28 -28
- package/build/artifacts/contracts/router/ActionSwapPTYT.sol/ActionSwapPTYT.dbg.json +1 -1
- package/build/artifacts/contracts/router/ActionSwapPTYT.sol/ActionSwapPTYT.json +4 -4
- package/build/artifacts/contracts/router/ActionSwapYT.sol/ActionSwapYT.dbg.json +1 -1
- package/build/artifacts/contracts/router/ActionSwapYT.sol/ActionSwapYT.json +22 -22
- 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/CallbackHelper.sol/CallbackHelper.dbg.json +1 -1
- package/build/artifacts/contracts/router/base/MarketApproxLib.sol/MarketApproxPtInLib.dbg.json +1 -1
- package/build/artifacts/contracts/router/base/MarketApproxLib.sol/MarketApproxPtInLib.json +2 -2
- package/build/artifacts/contracts/router/base/MarketApproxLib.sol/MarketApproxPtOutLib.dbg.json +1 -1
- package/build/artifacts/contracts/router/base/MarketApproxLib.sol/MarketApproxPtOutLib.json +2 -2
- package/build/artifacts/contracts/router/kyberswap/KyberSwapHelper.sol/KyberSwapHelper.dbg.json +1 -1
- package/contracts/LiquidityMining/CrossChainMsg/PendleMsgReceiveEndpointUpg.sol +96 -27
- package/contracts/LiquidityMining/CrossChainMsg/PendleMsgSendEndpointUpg.sol +40 -12
- package/contracts/LiquidityMining/CrossChainMsg/PendleMsgSenderAppUpg.sol +24 -5
- package/contracts/LiquidityMining/CrossChainMsg/libraries/ExcessivelySafeCall.sol +133 -0
- package/contracts/LiquidityMining/CrossChainMsg/libraries/LayerZeroHelper.sol +33 -0
- package/contracts/LiquidityMining/GaugeController/PendleGaugeControllerBaseUpg.sol +8 -1
- package/contracts/LiquidityMining/VotingController/PendleVotingControllerUpg.sol +3 -3
- package/contracts/LiquidityMining/VotingEscrow/VotingEscrowPendleMainchain.sol +2 -7
- package/contracts/core/Market/MarketMathCore.sol +50 -53
- package/contracts/core/Market/PendleGauge.sol +8 -8
- package/contracts/core/Market/PendleMarket.sol +49 -49
- package/contracts/core/Market/PendleMarketFactory.sol +1 -1
- package/contracts/core/RewardManager/RewardManager.sol +1 -1
- package/contracts/core/{SuperComposableYield → StandardizedYield}/PYIndex.sol +16 -16
- package/contracts/core/{SuperComposableYield/SCYBase.sol → StandardizedYield/SYBase.sol} +17 -17
- package/contracts/core/{SuperComposableYield/SCYBaseWithRewards.sol → StandardizedYield/SYBaseWithRewards.sol} +9 -9
- package/contracts/core/StandardizedYield/SYUtils.sol +26 -0
- package/contracts/core/{SuperComposableYield → StandardizedYield}/implementations/BenQi/PendleQiTokenHelper.sol +1 -1
- package/contracts/core/{SuperComposableYield/implementations/BenQi/PendleQiTokenSCY.sol → StandardizedYield/implementations/BenQi/PendleQiTokenSY.sol} +10 -10
- package/contracts/core/StandardizedYield/implementations/Convex/ConvexCurveLP/Pendle3CrvAndTokenSY.sol +167 -0
- package/contracts/core/{SuperComposableYield/implementations/Convex/ConvexCurveLP/PendleConvexCurveLPSCY.sol → StandardizedYield/implementations/Convex/ConvexCurveLP/PendleConvexLPSY.sol} +51 -70
- package/contracts/core/{SuperComposableYield → StandardizedYield}/implementations/Convex/Pendle3CrvHelper.sol +7 -7
- package/contracts/core/{SuperComposableYield/implementations/PendleWstEthSCY.sol → StandardizedYield/implementations/PendleWstEthSY.sol} +5 -5
- package/contracts/core/YieldContracts/InterestManagerYT.sol +7 -7
- package/contracts/core/YieldContracts/PendlePrincipalToken.sol +3 -3
- package/contracts/core/YieldContracts/PendleYieldContractFactory.sol +15 -15
- package/contracts/core/YieldContracts/PendleYieldToken.sol +71 -71
- package/contracts/core/libraries/Errors.sol +23 -21
- package/contracts/core/libraries/TokenHelper.sol +0 -33
- package/contracts/interfaces/Curve/ICrvPool.sol +2 -0
- package/contracts/interfaces/ILayerZeroEndpoint.sol +39 -0
- package/contracts/interfaces/ILayerZeroReceiver.sol +12 -0
- package/contracts/interfaces/IPActionAddRemoveLiq.sol +27 -27
- package/contracts/interfaces/IPActionMintRedeem.sol +30 -30
- package/contracts/interfaces/IPActionSwapPT.sol +16 -16
- package/contracts/interfaces/IPActionSwapPTYT.sol +2 -2
- package/contracts/interfaces/IPActionSwapYT.sol +16 -16
- package/contracts/interfaces/IPMarket.sol +14 -19
- package/contracts/interfaces/IPMarketSwapCallback.sol +1 -1
- package/contracts/interfaces/IPMsgSendEndpoint.sol +4 -2
- package/contracts/interfaces/IPPrincipalToken.sol +1 -1
- package/contracts/interfaces/IPYieldContractFactory.sol +3 -3
- package/contracts/interfaces/IPYieldToken.sol +7 -9
- package/contracts/interfaces/{ISuperComposableYield.sol → IStandardizedYield.sol} +6 -6
- package/contracts/offchain-helpers/MarketMathStatic.sol +116 -131
- package/contracts/offchain-helpers/RouterStatic.sol +80 -93
- package/contracts/router/ActionAddRemoveLiq.sol +99 -111
- package/contracts/router/ActionCallback.sol +46 -46
- package/contracts/router/ActionMintRedeem.sol +58 -58
- package/contracts/router/ActionSwapPT.sol +61 -69
- package/contracts/router/ActionSwapPTYT.sol +7 -7
- package/contracts/router/ActionSwapYT.sol +72 -79
- package/contracts/router/PendleRouter.sol +16 -16
- package/contracts/router/base/ActionBaseMintRedeem.sol +43 -43
- package/contracts/router/base/CallbackHelper.sol +20 -20
- package/contracts/router/base/MarketApproxLib.sol +166 -143
- package/contracts/router/kyberswap/KyberSwapHelper.sol +2 -2
- package/deployments/43113-core.json +16 -0
- package/deployments/43113-helper.json +3 -0
- package/deployments/43113-markets/benqi-market-QI-USDC-FEB-2ND.json +8 -0
- package/deployments/43113-markets/benqi-market-QI-WETH-DEC-1ST.json +8 -0
- package/deployments/43113-testenv.json +22 -0
- package/deployments/80001-core.json +15 -0
- package/deployments/80001-testenv.json +22 -0
- package/package.json +2 -2
- package/typechain-types/ActionAddRemoveLiq.ts +127 -129
- package/typechain-types/ActionCallback.ts +5 -5
- package/typechain-types/ActionMintRedeem.ts +139 -141
- package/typechain-types/ActionSwapPT.ts +73 -73
- package/typechain-types/ActionSwapPTYT.ts +2 -2
- package/typechain-types/ActionSwapYT.ts +73 -73
- package/typechain-types/IPActionAddRemoveLiq.ts +127 -129
- package/typechain-types/IPActionMintRedeem.ts +139 -141
- package/typechain-types/IPActionSwapPT.ts +73 -73
- package/typechain-types/IPActionSwapPTYT.ts +2 -2
- package/typechain-types/IPActionSwapYT.ts +73 -73
- package/typechain-types/IPAllAction.ts +402 -406
- package/typechain-types/IPMarket.ts +51 -54
- package/typechain-types/IPMarketSwapCallback.ts +5 -5
- package/typechain-types/IPPrincipalToken.ts +8 -8
- package/typechain-types/IPYieldContractFactory.ts +13 -13
- package/typechain-types/IPYieldToken.ts +17 -17
- package/typechain-types/IStandardizedYield.ts +895 -0
- package/typechain-types/ImplicitSwapfeeContract.ts +157 -0
- package/typechain-types/MarketMathStatic.ts +27 -27
- package/typechain-types/Pendle3CrvAndTokenSY.ts +1243 -0
- package/typechain-types/Pendle3CrvHelper.ts +13 -13
- package/typechain-types/PendleConvexLPSY.ts +1189 -0
- package/typechain-types/PendleGaugeControllerBaseUpg.ts +125 -0
- package/typechain-types/PendleGaugeControllerMainchainUpg.ts +125 -0
- package/typechain-types/PendleGaugeControllerSidechainUpg.ts +124 -0
- package/typechain-types/PendleMarket.ts +54 -57
- package/typechain-types/PendlePrincipalToken.ts +8 -8
- package/typechain-types/PendleQiTokenSY.ts +1166 -0
- package/typechain-types/PendleWstEthSY.ts +1040 -0
- package/typechain-types/PendleYieldContractFactory.ts +8 -8
- package/typechain-types/PendleYieldToken.ts +41 -44
- package/typechain-types/RouterStatic.ts +196 -196
- package/typechain-types/SYBase.ts +1001 -0
- package/typechain-types/SYBaseWithRewards.ts +1094 -0
- package/typechain-types/factories/ActionAddRemoveLiq__factory.ts +34 -34
- package/typechain-types/factories/ActionCallback__factory.ts +11 -11
- package/typechain-types/factories/ActionMintRedeem__factory.ts +38 -38
- package/typechain-types/factories/ActionMisc__factory.ts +1 -1
- package/typechain-types/factories/ActionSwapPTYT__factory.ts +3 -3
- package/typechain-types/factories/ActionSwapPT__factory.ts +27 -27
- package/typechain-types/factories/ActionSwapYT__factory.ts +21 -21
- package/typechain-types/factories/Errors__factory.ts +27 -27
- package/typechain-types/factories/IPActionAddRemoveLiq__factory.ts +30 -30
- package/typechain-types/factories/IPActionMintRedeem__factory.ts +34 -34
- package/typechain-types/factories/IPActionSwapPTYT__factory.ts +2 -2
- package/typechain-types/factories/IPActionSwapPT__factory.ts +20 -20
- package/typechain-types/factories/IPActionSwapYT__factory.ts +20 -20
- package/typechain-types/factories/IPAllAction__factory.ts +106 -106
- package/typechain-types/factories/IPMarketSwapCallback__factory.ts +1 -1
- package/typechain-types/factories/IPMarket__factory.ts +18 -18
- package/typechain-types/factories/IPPrincipalToken__factory.ts +1 -1
- package/typechain-types/factories/IPYieldContractFactory__factory.ts +3 -3
- package/typechain-types/factories/IPYieldToken__factory.ts +6 -6
- package/typechain-types/factories/IStandardizedYield__factory.ts +658 -0
- package/typechain-types/factories/ImplicitSwapfeeContract__factory.ts +247 -0
- package/typechain-types/factories/MarketMathStatic__factory.ts +6 -6
- package/typechain-types/factories/OracleLib__factory.ts +1 -1
- package/typechain-types/factories/Pendle3CrvAndTokenSY__factory.ts +1124 -0
- package/typechain-types/factories/Pendle3CrvHelper__factory.ts +3 -3
- package/typechain-types/factories/PendleConvexLPSY__factory.ts +963 -0
- package/typechain-types/factories/PendleFeeDistributorFactory__factory.ts +1 -1
- package/typechain-types/factories/PendleFeeDistributor__factory.ts +1 -1
- package/typechain-types/factories/PendleGaugeControllerBaseUpg__factory.ts +89 -0
- package/typechain-types/factories/PendleGaugeControllerMainchainUpg__factory.ts +90 -1
- package/typechain-types/factories/PendleGaugeControllerSidechainUpg__factory.ts +90 -1
- package/typechain-types/factories/PendleMarketFactory__factory.ts +1 -1
- package/typechain-types/factories/PendleMarket__factory.ts +21 -21
- 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 +7 -7
- package/typechain-types/factories/PendleQiTokenHelper__factory.ts +1 -1
- package/typechain-types/factories/PendleQiTokenSY__factory.ts +1095 -0
- 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 +924 -0
- package/typechain-types/factories/PendleYieldContractFactory__factory.ts +3 -3
- package/typechain-types/factories/PendleYieldToken__factory.ts +27 -27
- package/typechain-types/factories/RouterStatic__factory.ts +57 -57
- package/typechain-types/factories/SYBaseWithRewards__factory.ts +867 -0
- package/typechain-types/factories/SYBase__factory.ts +795 -0
- package/typechain-types/factories/VotingEscrowPendleMainchain__factory.ts +1 -1
- package/typechain-types/factories/VotingEscrowPendleSidechain__factory.ts +1 -1
- package/typechain-types/hardhat.d.ts +33 -42
- package/typechain-types/index.ts +14 -16
- package/build/artifacts/contracts/core/SuperComposableYield/PYIndex.sol/PYIndexLib.dbg.json +0 -4
- package/build/artifacts/contracts/core/SuperComposableYield/SCYBase.sol/SCYBase.dbg.json +0 -4
- package/build/artifacts/contracts/core/SuperComposableYield/SCYBaseWithRewards.sol/SCYBaseWithRewards.dbg.json +0 -4
- package/build/artifacts/contracts/core/SuperComposableYield/SCYUtils.sol/SCYUtils.dbg.json +0 -4
- package/build/artifacts/contracts/core/SuperComposableYield/implementations/BenQi/PendleQiTokenHelper.sol/PendleQiTokenHelper.dbg.json +0 -4
- package/build/artifacts/contracts/core/SuperComposableYield/implementations/BenQi/PendleQiTokenSCY.sol/PendleQiTokenSCY.dbg.json +0 -4
- package/build/artifacts/contracts/core/SuperComposableYield/implementations/Convex/ConvexCurveLP/Pendle3CrvAndTokenSCY.sol/Pendle3CrvAndTokenSCY.dbg.json +0 -4
- package/build/artifacts/contracts/core/SuperComposableYield/implementations/Convex/ConvexCurveLP/Pendle3CrvAndTokenSCY.sol/Pendle3CrvAndTokenSCY.json +0 -1030
- package/build/artifacts/contracts/core/SuperComposableYield/implementations/Convex/ConvexCurveLP/PendleConvexCurveLP2PoolSCY.sol/PendleConvexCurveLP2PoolSCY.dbg.json +0 -4
- package/build/artifacts/contracts/core/SuperComposableYield/implementations/Convex/ConvexCurveLP/PendleConvexCurveLP2PoolSCY.sol/PendleConvexCurveLP2PoolSCY.json +0 -1025
- package/build/artifacts/contracts/core/SuperComposableYield/implementations/Convex/ConvexCurveLP/PendleConvexCurveLPSCY.sol/PendleConvexCurveLPSCY.dbg.json +0 -4
- package/build/artifacts/contracts/core/SuperComposableYield/implementations/Convex/Pendle3CrvHelper.sol/Pendle3CrvHelper.dbg.json +0 -4
- package/build/artifacts/contracts/core/SuperComposableYield/implementations/PendleWstEthSCY.sol/PendleWstEthSCY.dbg.json +0 -4
- package/build/artifacts/contracts/interfaces/ISuperComposableYield.sol/ISuperComposableYield.dbg.json +0 -4
- package/contracts/core/SuperComposableYield/SCYUtils.sol +0 -34
- package/contracts/core/SuperComposableYield/implementations/Convex/ConvexCurveLP/Pendle3CrvAndTokenSCY.sol +0 -135
- package/contracts/core/SuperComposableYield/implementations/Convex/ConvexCurveLP/PendleConvexCurveLP2PoolSCY.sol +0 -96
- package/contracts/interfaces/ICelerMessageBus.sol +0 -28
- package/contracts/interfaces/ICelerMessageReceiverApp.sol +0 -25
- package/deployments/kovan.json +0 -31
|
@@ -1,57 +1,48 @@
|
|
|
1
1
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
2
2
|
pragma solidity 0.8.17;
|
|
3
3
|
|
|
4
|
-
import "../../../
|
|
4
|
+
import "../../../SYBaseWithRewards.sol";
|
|
5
5
|
import "../../../../../interfaces/ConvexCurve/IBooster.sol";
|
|
6
6
|
import "../../../../../interfaces/ConvexCurve/IRewards.sol";
|
|
7
7
|
import "../../../../../interfaces/Curve/ICrvPool.sol";
|
|
8
8
|
|
|
9
|
-
abstract contract
|
|
9
|
+
abstract contract PendleConvexLPSY is SYBaseWithRewards {
|
|
10
10
|
using SafeERC20 for IERC20;
|
|
11
11
|
|
|
12
|
-
uint256 public immutable
|
|
13
|
-
address public immutable
|
|
14
|
-
|
|
12
|
+
uint256 public immutable cvxPid;
|
|
13
|
+
address public immutable cvxRewardManager;
|
|
14
|
+
|
|
15
15
|
address public immutable crvPool;
|
|
16
|
+
address public immutable crvLp;
|
|
16
17
|
|
|
17
|
-
address public
|
|
18
|
-
address public
|
|
19
|
-
address public
|
|
18
|
+
address public constant BOOSTER = 0xF403C135812408BFbE8713b5A23a04b3D48AAE31;
|
|
19
|
+
address public constant CRV = 0xD533a949740bb3306d119CC777fa900bA034cd52;
|
|
20
|
+
address public constant CVX = 0x4e3FBD56CD56c3e72c1403e103b45Db9da5B9D2B;
|
|
20
21
|
|
|
21
22
|
constructor(
|
|
22
23
|
string memory _name,
|
|
23
24
|
string memory _symbol,
|
|
24
|
-
uint256
|
|
25
|
-
address
|
|
26
|
-
address
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
(LP, baseRewards, CRV) = _getPoolInfo(pid);
|
|
37
|
-
if (LP != _crvLpToken) revert Errors.SCYCurveInvalidPid();
|
|
38
|
-
|
|
39
|
-
_safeApprove(LP, booster, type(uint256).max);
|
|
25
|
+
uint256 _cvxPid,
|
|
26
|
+
address _crvLp,
|
|
27
|
+
address _crvPool
|
|
28
|
+
) SYBaseWithRewards(_name, _symbol, _crvLp) {
|
|
29
|
+
cvxPid = _cvxPid;
|
|
30
|
+
crvPool = _crvPool;
|
|
31
|
+
|
|
32
|
+
(crvLp, cvxRewardManager) = _getPoolInfo(cvxPid);
|
|
33
|
+
if (crvLp != _crvLp) revert Errors.SYCurveInvalidPid();
|
|
34
|
+
|
|
35
|
+
_safeApprove(crvLp, BOOSTER, type(uint256).max);
|
|
40
36
|
}
|
|
41
37
|
|
|
42
|
-
function _getPoolInfo(uint256
|
|
38
|
+
function _getPoolInfo(uint256 _cvxPid)
|
|
43
39
|
internal
|
|
44
40
|
view
|
|
45
|
-
returns (
|
|
46
|
-
address lptoken,
|
|
47
|
-
address crvRewards,
|
|
48
|
-
address crv
|
|
49
|
-
)
|
|
41
|
+
returns (address _crvLp, address _cvxRewardManager)
|
|
50
42
|
{
|
|
51
|
-
if (
|
|
43
|
+
if (_cvxPid > IBooster(BOOSTER).poolLength()) revert Errors.SYCurveInvalidPid();
|
|
52
44
|
|
|
53
|
-
(
|
|
54
|
-
crv = IBooster(booster).crv();
|
|
45
|
+
(_crvLp, , , _cvxRewardManager, , ) = IBooster(BOOSTER).poolInfo(_cvxPid);
|
|
55
46
|
}
|
|
56
47
|
|
|
57
48
|
/*///////////////////////////////////////////////////////////////
|
|
@@ -68,17 +59,13 @@ abstract contract PendleConvexCurveLPSCY is SCYBaseWithRewards {
|
|
|
68
59
|
override
|
|
69
60
|
returns (uint256 amountSharesOut)
|
|
70
61
|
{
|
|
71
|
-
if (tokenIn ==
|
|
72
|
-
IBooster(booster).deposit(pid, amount, true);
|
|
62
|
+
if (tokenIn == crvLp) {
|
|
73
63
|
amountSharesOut = amount;
|
|
74
64
|
} else {
|
|
75
|
-
|
|
76
|
-
_depositToCurve(tokenIn, amount);
|
|
77
|
-
amountSharesOut = _selfBalance(LP) - prevLpBalance;
|
|
78
|
-
|
|
79
|
-
// Deposit LP Token received into Convex Booster
|
|
80
|
-
IBooster(booster).deposit(pid, amountSharesOut, true);
|
|
65
|
+
amountSharesOut = _depositToCurve(tokenIn, amount);
|
|
81
66
|
}
|
|
67
|
+
|
|
68
|
+
IBooster(BOOSTER).deposit(cvxPid, amountSharesOut, true);
|
|
82
69
|
}
|
|
83
70
|
|
|
84
71
|
/**
|
|
@@ -90,21 +77,14 @@ abstract contract PendleConvexCurveLPSCY is SCYBaseWithRewards {
|
|
|
90
77
|
address tokenOut,
|
|
91
78
|
uint256 amountSharesToRedeem
|
|
92
79
|
) internal virtual override returns (uint256 amountTokenOut) {
|
|
93
|
-
IRewards(
|
|
94
|
-
|
|
95
|
-
if (
|
|
96
|
-
uint256 prevBal = _selfBalance(tokenOut);
|
|
97
|
-
ICrvPool(crvPool).remove_liquidity_one_coin(
|
|
98
|
-
amountSharesToRedeem,
|
|
99
|
-
Math.Int128(_getBaseTokenIndex(tokenOut)),
|
|
100
|
-
0
|
|
101
|
-
);
|
|
102
|
-
amountTokenOut = _selfBalance(tokenOut) - prevBal;
|
|
103
|
-
} else {
|
|
104
|
-
// 'tokenOut' is LP
|
|
80
|
+
IRewards(cvxRewardManager).withdrawAndUnwrap(amountSharesToRedeem, false);
|
|
81
|
+
|
|
82
|
+
if (tokenOut == crvLp) {
|
|
105
83
|
amountTokenOut = amountSharesToRedeem;
|
|
84
|
+
} else {
|
|
85
|
+
amountTokenOut = _redeemFromCurve(tokenOut, amountSharesToRedeem);
|
|
106
86
|
}
|
|
107
|
-
|
|
87
|
+
_transferOut(tokenOut, receiver, amountTokenOut);
|
|
108
88
|
}
|
|
109
89
|
|
|
110
90
|
/*///////////////////////////////////////////////////////////////
|
|
@@ -135,7 +115,7 @@ abstract contract PendleConvexCurveLPSCY is SCYBaseWithRewards {
|
|
|
135
115
|
|
|
136
116
|
function _redeemExternalReward() internal virtual override {
|
|
137
117
|
// Redeem all extra rewards from the curve pool
|
|
138
|
-
IRewards(
|
|
118
|
+
IRewards(cvxRewardManager).getReward();
|
|
139
119
|
}
|
|
140
120
|
|
|
141
121
|
/*///////////////////////////////////////////////////////////////
|
|
@@ -149,10 +129,9 @@ abstract contract PendleConvexCurveLPSCY is SCYBaseWithRewards {
|
|
|
149
129
|
override
|
|
150
130
|
returns (uint256 amountSharesOut)
|
|
151
131
|
{
|
|
152
|
-
if (tokenIn ==
|
|
132
|
+
if (tokenIn == crvLp) {
|
|
153
133
|
amountSharesOut = amountTokenToDeposit;
|
|
154
134
|
} else {
|
|
155
|
-
// Calculate expected amount of LpToken to receive
|
|
156
135
|
amountSharesOut = _previewDepositToCurve(tokenIn, amountTokenToDeposit);
|
|
157
136
|
}
|
|
158
137
|
}
|
|
@@ -166,14 +145,10 @@ abstract contract PendleConvexCurveLPSCY is SCYBaseWithRewards {
|
|
|
166
145
|
{
|
|
167
146
|
uint256 amountLpTokenToReceive = (amountSharesToRedeem * exchangeRate()) / 1e18;
|
|
168
147
|
|
|
169
|
-
if (tokenOut ==
|
|
148
|
+
if (tokenOut == crvLp) {
|
|
170
149
|
amountTokenOut = amountLpTokenToReceive;
|
|
171
150
|
} else {
|
|
172
|
-
|
|
173
|
-
amountTokenOut = ICrvPool(crvPool).calc_withdraw_one_coin(
|
|
174
|
-
amountLpTokenToReceive,
|
|
175
|
-
Math.Int128(_getBaseTokenIndex(tokenOut))
|
|
176
|
-
);
|
|
151
|
+
amountTokenOut = _previewRedeemFromCurve(tokenOut, amountLpTokenToReceive);
|
|
177
152
|
}
|
|
178
153
|
}
|
|
179
154
|
|
|
@@ -185,21 +160,27 @@ abstract contract PendleConvexCurveLPSCY is SCYBaseWithRewards {
|
|
|
185
160
|
|
|
186
161
|
function isValidTokenOut(address token) public view virtual override returns (bool);
|
|
187
162
|
|
|
188
|
-
function _depositToCurve(address
|
|
163
|
+
function _depositToCurve(address tokenIn, uint256 amountTokenToDeposit)
|
|
164
|
+
internal
|
|
165
|
+
virtual
|
|
166
|
+
returns (uint256);
|
|
167
|
+
|
|
168
|
+
function _redeemFromCurve(address tokenOut, uint256 amountLpToRedeem)
|
|
169
|
+
internal
|
|
170
|
+
virtual
|
|
171
|
+
returns (uint256);
|
|
189
172
|
|
|
190
|
-
function _previewDepositToCurve(address token, uint256
|
|
173
|
+
function _previewDepositToCurve(address token, uint256 amountTokenToDeposit)
|
|
191
174
|
internal
|
|
192
175
|
view
|
|
193
176
|
virtual
|
|
194
177
|
returns (uint256 amountLpOut);
|
|
195
178
|
|
|
196
|
-
function
|
|
179
|
+
function _previewRedeemFromCurve(address token, uint256 amountLpToRedeem)
|
|
197
180
|
internal
|
|
198
181
|
view
|
|
199
182
|
virtual
|
|
200
|
-
returns (uint256
|
|
201
|
-
|
|
202
|
-
function _isBaseToken(address token) internal view virtual returns (bool res);
|
|
183
|
+
returns (uint256 amountTokenOut);
|
|
203
184
|
|
|
204
185
|
function assetInfo()
|
|
205
186
|
external
|
|
@@ -210,6 +191,6 @@ abstract contract PendleConvexCurveLPSCY is SCYBaseWithRewards {
|
|
|
210
191
|
uint8 assetDecimals
|
|
211
192
|
)
|
|
212
193
|
{
|
|
213
|
-
return (AssetType.LIQUIDITY,
|
|
194
|
+
return (AssetType.LIQUIDITY, crvLp, IERC20Metadata(crvLp).decimals());
|
|
214
195
|
}
|
|
215
196
|
}
|
|
@@ -8,11 +8,11 @@ import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
|
|
|
8
8
|
library Pendle3CrvHelper {
|
|
9
9
|
using Math for uint256;
|
|
10
10
|
|
|
11
|
-
address public constant
|
|
12
|
-
address public constant POOL =
|
|
13
|
-
address public constant DAI =
|
|
14
|
-
address public constant USDC =
|
|
15
|
-
address public constant USDT =
|
|
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
16
|
|
|
17
17
|
function preview3CrvDeposit(address tokenIn, uint256 amountTokenToDeposit)
|
|
18
18
|
internal
|
|
@@ -42,9 +42,9 @@ library Pendle3CrvHelper {
|
|
|
42
42
|
internal
|
|
43
43
|
returns (uint256)
|
|
44
44
|
{
|
|
45
|
-
uint256 balBefore = IERC20(
|
|
45
|
+
uint256 balBefore = IERC20(LP).balanceOf(address(this));
|
|
46
46
|
ICrvPool(POOL).add_liquidity(_getTokenAmounts(tokenIn, amountTokenToDeposit), 0);
|
|
47
|
-
uint256 balAfter = IERC20(
|
|
47
|
+
uint256 balAfter = IERC20(LP).balanceOf(address(this));
|
|
48
48
|
return balAfter - balBefore;
|
|
49
49
|
}
|
|
50
50
|
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
2
2
|
pragma solidity 0.8.17;
|
|
3
3
|
|
|
4
|
-
import "../
|
|
4
|
+
import "../SYBase.sol";
|
|
5
5
|
import "../../../interfaces/IWstETH.sol";
|
|
6
6
|
import "../../../interfaces/IWETH.sol";
|
|
7
7
|
import "../../../interfaces/IStETH.sol";
|
|
8
8
|
|
|
9
|
-
contract
|
|
9
|
+
contract PendleWstEthSY is SYBase {
|
|
10
10
|
address public immutable wETH;
|
|
11
11
|
address public immutable stETH;
|
|
12
12
|
address public immutable wstETH;
|
|
@@ -16,7 +16,7 @@ contract PendleWstEthSCY is SCYBase {
|
|
|
16
16
|
string memory _symbol,
|
|
17
17
|
address _wETH,
|
|
18
18
|
address _wstETH
|
|
19
|
-
)
|
|
19
|
+
) SYBase(_name, _symbol, _wstETH) {
|
|
20
20
|
wETH = _wETH;
|
|
21
21
|
wstETH = _wstETH;
|
|
22
22
|
stETH = IWstETH(wstETH).stETH();
|
|
@@ -28,7 +28,7 @@ contract PendleWstEthSCY is SCYBase {
|
|
|
28
28
|
//////////////////////////////////////////////////////////////*/
|
|
29
29
|
|
|
30
30
|
/**
|
|
31
|
-
* @dev See {
|
|
31
|
+
* @dev See {SYBase-_deposit}
|
|
32
32
|
*
|
|
33
33
|
* The underlying yield token is wstETH. If the base token deposited is stETH, the function wraps
|
|
34
34
|
* it into wstETH first. Then the corresponding amount of shares is returned.
|
|
@@ -56,7 +56,7 @@ contract PendleWstEthSCY is SCYBase {
|
|
|
56
56
|
}
|
|
57
57
|
|
|
58
58
|
/**
|
|
59
|
-
* @dev See {
|
|
59
|
+
* @dev See {SYBase-_redeem}
|
|
60
60
|
*
|
|
61
61
|
* The shares are redeemed into the same amount of wstETH. If `tokenOut` is stETH, the function also
|
|
62
62
|
* unwraps said amount of wstETH into stETH for redemption.
|
|
@@ -10,13 +10,13 @@ import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
|
|
|
10
10
|
|
|
11
11
|
import "../libraries/math/Math.sol";
|
|
12
12
|
import "../libraries/TokenHelper.sol";
|
|
13
|
-
import "../
|
|
13
|
+
import "../StandardizedYield/SYUtils.sol";
|
|
14
14
|
|
|
15
15
|
/*
|
|
16
|
-
With YT yielding more
|
|
17
|
-
be based on the amount of
|
|
16
|
+
With YT yielding more SYs overtime, which is allowed to be redeemed by users, the reward distribution should
|
|
17
|
+
be based on the amount of SYs that their YT currently represent, plus with their dueInterest.
|
|
18
18
|
|
|
19
|
-
It has been proven and tested that
|
|
19
|
+
It has been proven and tested that totalSyRedeemable will not change over time, unless users redeem their interest or redeemPY.
|
|
20
20
|
|
|
21
21
|
Due to this, it is required to update users' accruedReward STRICTLY BEFORE redeeming their interest.
|
|
22
22
|
*/
|
|
@@ -44,7 +44,7 @@ abstract contract InterestManagerYT is TokenHelper, IPInterestManagerYT {
|
|
|
44
44
|
|
|
45
45
|
function _doTransferOutInterest(
|
|
46
46
|
address user,
|
|
47
|
-
address
|
|
47
|
+
address SY,
|
|
48
48
|
address factory
|
|
49
49
|
) internal returns (uint256 interestAmount) {
|
|
50
50
|
address treasury = IPYieldContractFactory(factory).treasury();
|
|
@@ -56,8 +56,8 @@ abstract contract InterestManagerYT is TokenHelper, IPInterestManagerYT {
|
|
|
56
56
|
uint256 feeAmount = interestPreFee.mulDown(feeRate);
|
|
57
57
|
interestAmount = interestPreFee - feeAmount;
|
|
58
58
|
|
|
59
|
-
_transferOut(
|
|
60
|
-
_transferOut(
|
|
59
|
+
_transferOut(SY, treasury, feeAmount);
|
|
60
|
+
_transferOut(SY, user, interestAmount);
|
|
61
61
|
}
|
|
62
62
|
|
|
63
63
|
// should only be callable from `_distributeInterestForTwo` & make sure user != address(0) && user != address(this)
|
|
@@ -12,7 +12,7 @@ import "../erc20/PendleERC20Permit.sol";
|
|
|
12
12
|
import "@openzeppelin/contracts/proxy/utils/Initializable.sol";
|
|
13
13
|
|
|
14
14
|
contract PendlePrincipalToken is PendleERC20Permit, Initializable, IPPrincipalToken {
|
|
15
|
-
address public immutable
|
|
15
|
+
address public immutable SY;
|
|
16
16
|
address public immutable factory;
|
|
17
17
|
uint256 public immutable expiry;
|
|
18
18
|
address public YT;
|
|
@@ -28,13 +28,13 @@ contract PendlePrincipalToken is PendleERC20Permit, Initializable, IPPrincipalTo
|
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
constructor(
|
|
31
|
-
address
|
|
31
|
+
address _SY,
|
|
32
32
|
string memory _name,
|
|
33
33
|
string memory _symbol,
|
|
34
34
|
uint8 __decimals,
|
|
35
35
|
uint256 _expiry
|
|
36
36
|
) PendleERC20Permit(_name, _symbol, __decimals) {
|
|
37
|
-
|
|
37
|
+
SY = _SY;
|
|
38
38
|
expiry = _expiry;
|
|
39
39
|
factory = msg.sender;
|
|
40
40
|
}
|
|
@@ -57,7 +57,7 @@ contract PendleYieldContractFactory is BoringOwnableUpgradeable, IPYieldContract
|
|
|
57
57
|
address public treasury;
|
|
58
58
|
uint96 public expiryDivisor;
|
|
59
59
|
|
|
60
|
-
//
|
|
60
|
+
// SY => expiry => address
|
|
61
61
|
mapping(address => mapping(uint256 => address)) public getPT;
|
|
62
62
|
mapping(address => mapping(uint256 => address)) public getYT;
|
|
63
63
|
mapping(address => bool) public isPT;
|
|
@@ -89,21 +89,21 @@ contract PendleYieldContractFactory is BoringOwnableUpgradeable, IPYieldContract
|
|
|
89
89
|
}
|
|
90
90
|
|
|
91
91
|
/**
|
|
92
|
-
* @notice Create a pair of (PT, YT) from any
|
|
92
|
+
* @notice Create a pair of (PT, YT) from any SY and valid expiry. Anyone can create a yield contract
|
|
93
93
|
* @dev It's intentional to make expiry an uint32 to guard against fat fingers. uint32.max is year 2106
|
|
94
94
|
*/
|
|
95
|
-
function createYieldContract(address
|
|
95
|
+
function createYieldContract(address SY, uint32 expiry)
|
|
96
96
|
external
|
|
97
97
|
returns (address PT, address YT)
|
|
98
98
|
{
|
|
99
99
|
if (MiniHelpers.isTimeInThePast(expiry) || expiry % expiryDivisor != 0)
|
|
100
100
|
revert Errors.YCFactoryInvalidExpiry();
|
|
101
101
|
|
|
102
|
-
if (getPT[
|
|
102
|
+
if (getPT[SY][expiry] != address(0)) revert Errors.YCFactoryYieldContractExisted();
|
|
103
103
|
|
|
104
|
-
|
|
104
|
+
IStandardizedYield _SY = IStandardizedYield(SY);
|
|
105
105
|
|
|
106
|
-
(, , uint8 assetDecimals) =
|
|
106
|
+
(, , uint8 assetDecimals) = _SY.assetInfo();
|
|
107
107
|
|
|
108
108
|
PT = Create2.deploy(
|
|
109
109
|
0,
|
|
@@ -111,9 +111,9 @@ contract PendleYieldContractFactory is BoringOwnableUpgradeable, IPYieldContract
|
|
|
111
111
|
abi.encodePacked(
|
|
112
112
|
type(PendlePrincipalToken).creationCode,
|
|
113
113
|
abi.encode(
|
|
114
|
-
|
|
115
|
-
PT_PREFIX.concat(
|
|
116
|
-
PT_PREFIX.concat(
|
|
114
|
+
SY,
|
|
115
|
+
PT_PREFIX.concat(_SY.name(), expiry, " "),
|
|
116
|
+
PT_PREFIX.concat(_SY.symbol(), expiry, "-"),
|
|
117
117
|
assetDecimals,
|
|
118
118
|
expiry
|
|
119
119
|
)
|
|
@@ -124,10 +124,10 @@ contract PendleYieldContractFactory is BoringOwnableUpgradeable, IPYieldContract
|
|
|
124
124
|
0,
|
|
125
125
|
bytes32(block.chainid),
|
|
126
126
|
abi.encode(
|
|
127
|
-
|
|
127
|
+
SY,
|
|
128
128
|
PT,
|
|
129
|
-
YT_PREFIX.concat(
|
|
130
|
-
YT_PREFIX.concat(
|
|
129
|
+
YT_PREFIX.concat(_SY.name(), expiry, " "),
|
|
130
|
+
YT_PREFIX.concat(_SY.symbol(), expiry, "-"),
|
|
131
131
|
assetDecimals,
|
|
132
132
|
expiry
|
|
133
133
|
),
|
|
@@ -139,12 +139,12 @@ contract PendleYieldContractFactory is BoringOwnableUpgradeable, IPYieldContract
|
|
|
139
139
|
|
|
140
140
|
IPPrincipalToken(PT).initialize(YT);
|
|
141
141
|
|
|
142
|
-
getPT[
|
|
143
|
-
getYT[
|
|
142
|
+
getPT[SY][expiry] = PT;
|
|
143
|
+
getYT[SY][expiry] = YT;
|
|
144
144
|
isPT[PT] = true;
|
|
145
145
|
isYT[YT] = true;
|
|
146
146
|
|
|
147
|
-
emit CreateYieldContract(
|
|
147
|
+
emit CreateYieldContract(SY, PT, YT, expiry);
|
|
148
148
|
}
|
|
149
149
|
|
|
150
150
|
function setExpiryDivisor(uint96 newExpiryDivisor) public onlyOwner {
|