@pendle/core-v2 0.11.11-testnet → 0.12.1-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/SuperComposableYield/SCY-implementations/BenQi/PendleQiTokenHelper.sol/PendleQiTokenHelper.dbg.json +1 -1
- package/build/artifacts/contracts/SuperComposableYield/SCY-implementations/BenQi/PendleQiTokenHelper.sol/PendleQiTokenHelper.json +2 -2
- package/build/artifacts/contracts/SuperComposableYield/SCY-implementations/BenQi/PendleQiTokenSCY.sol/PendleQiTokenSCY.dbg.json +1 -1
- package/build/artifacts/contracts/SuperComposableYield/SCY-implementations/BenQi/PendleQiTokenSCY.sol/PendleQiTokenSCY.json +199 -30
- package/build/artifacts/contracts/SuperComposableYield/SCY-implementations/Convex/ConvexCurveLP/Pendle3CrvAndTokenSCY.sol/Pendle3CrvAndTokenSCY.dbg.json +4 -0
- package/build/artifacts/contracts/SuperComposableYield/SCY-implementations/Convex/ConvexCurveLP/Pendle3CrvAndTokenSCY.sol/Pendle3CrvAndTokenSCY.json +1030 -0
- package/build/artifacts/contracts/SuperComposableYield/SCY-implementations/Convex/ConvexCurveLP/PendleConvexCurveLP2PoolSCY.sol/PendleConvexCurveLP2PoolSCY.dbg.json +4 -0
- package/build/artifacts/contracts/SuperComposableYield/SCY-implementations/Convex/ConvexCurveLP/PendleConvexCurveLP2PoolSCY.sol/PendleConvexCurveLP2PoolSCY.json +1025 -0
- package/build/artifacts/contracts/SuperComposableYield/SCY-implementations/Convex/ConvexCurveLP/PendleConvexCurveLPSCY.sol/PendleConvexCurveLPSCY.dbg.json +4 -0
- package/build/artifacts/contracts/SuperComposableYield/SCY-implementations/Convex/ConvexCurveLP/PendleConvexCurveLPSCY.sol/PendleConvexCurveLPSCY.json +948 -0
- package/build/artifacts/contracts/SuperComposableYield/SCY-implementations/Convex/Pendle3CrvHelper.sol/Pendle3CrvHelper.dbg.json +4 -0
- package/build/artifacts/contracts/SuperComposableYield/SCY-implementations/Convex/Pendle3CrvHelper.sol/Pendle3CrvHelper.json +76 -0
- package/build/artifacts/contracts/SuperComposableYield/SCY-implementations/PendleWstEthSCY.sol/PendleWstEthSCY.dbg.json +1 -1
- package/build/artifacts/contracts/SuperComposableYield/SCY-implementations/PendleWstEthSCY.sol/PendleWstEthSCY.json +140 -25
- package/build/artifacts/contracts/SuperComposableYield/base-implementations/SCYBase.sol/SCYBase.dbg.json +1 -1
- package/build/artifacts/contracts/SuperComposableYield/base-implementations/SCYBase.sol/SCYBase.json +138 -23
- package/build/artifacts/contracts/SuperComposableYield/base-implementations/SCYBaseWithRewards.sol/SCYBaseWithRewards.dbg.json +1 -1
- package/build/artifacts/contracts/SuperComposableYield/base-implementations/SCYBaseWithRewards.sol/SCYBaseWithRewards.json +138 -23
- package/build/artifacts/contracts/core/LiquidityMining/CrossChainMsg/PendleMsgReceiveEndpointUpg.sol/PendleMsgReceiveEndpointUpg.dbg.json +4 -0
- package/build/artifacts/contracts/core/LiquidityMining/CrossChainMsg/PendleMsgReceiveEndpointUpg.sol/PendleMsgReceiveEndpointUpg.json +310 -0
- package/build/artifacts/contracts/core/LiquidityMining/CrossChainMsg/PendleMsgReceiverAppUpg.sol/PendleMsgReceiverAppUpg.dbg.json +4 -0
- package/build/artifacts/contracts/core/LiquidityMining/{CelerAbstracts/CelerReceiverUpg.sol/CelerReceiverUpg.json → CrossChainMsg/PendleMsgReceiverAppUpg.sol/PendleMsgReceiverAppUpg.json} +18 -85
- package/build/artifacts/contracts/core/LiquidityMining/CrossChainMsg/PendleMsgSendEndpointUpg.sol/PendleMsgSendEndpointUpg.dbg.json +4 -0
- package/build/artifacts/contracts/core/LiquidityMining/CrossChainMsg/PendleMsgSendEndpointUpg.sol/PendleMsgSendEndpointUpg.json +336 -0
- package/build/artifacts/contracts/core/LiquidityMining/CrossChainMsg/PendleMsgSenderAppUpg.sol/PendleMsgSenderAppUpg.dbg.json +4 -0
- package/build/artifacts/contracts/core/LiquidityMining/{CelerAbstracts/CelerSenderUpg.sol/CelerSenderUpg.json → CrossChainMsg/PendleMsgSenderAppUpg.sol/PendleMsgSenderAppUpg.json} +8 -21
- package/build/artifacts/contracts/core/LiquidityMining/FeeDistributor/EpochResultManager.sol/EpochResultManager.dbg.json +4 -0
- package/build/artifacts/contracts/core/LiquidityMining/FeeDistributor/EpochResultManager.sol/EpochResultManager.json +131 -0
- package/build/artifacts/contracts/core/LiquidityMining/FeeDistributor/PendleFeeDistributor.sol/PendleFeeDistributor.dbg.json +4 -0
- package/build/artifacts/contracts/core/LiquidityMining/FeeDistributor/PendleFeeDistributor.sol/PendleFeeDistributor.json +297 -0
- package/build/artifacts/contracts/core/LiquidityMining/FeeDistributor/PendleFeeDistributorFactory.sol/PendleFeeDistributorFactory.dbg.json +4 -0
- package/build/artifacts/contracts/core/LiquidityMining/FeeDistributor/PendleFeeDistributorFactory.sol/PendleFeeDistributorFactory.json +376 -0
- package/build/artifacts/contracts/core/LiquidityMining/GaugeController/PendleGaugeControllerBaseUpg.sol/PendleGaugeControllerBaseUpg.dbg.json +1 -1
- package/build/artifacts/contracts/core/LiquidityMining/GaugeController/PendleGaugeControllerBaseUpg.sol/PendleGaugeControllerBaseUpg.json +11 -0
- package/build/artifacts/contracts/core/LiquidityMining/GaugeController/PendleGaugeControllerMainchainUpg.sol/PendleGaugeControllerMainchainUpg.dbg.json +1 -1
- package/build/artifacts/contracts/core/LiquidityMining/GaugeController/PendleGaugeControllerMainchainUpg.sol/PendleGaugeControllerMainchainUpg.json +29 -2
- package/build/artifacts/contracts/core/LiquidityMining/GaugeController/PendleGaugeControllerSidechainUpg.sol/PendleGaugeControllerSidechainUpg.dbg.json +1 -1
- package/build/artifacts/contracts/core/LiquidityMining/GaugeController/PendleGaugeControllerSidechainUpg.sol/PendleGaugeControllerSidechainUpg.json +40 -86
- package/build/artifacts/contracts/core/LiquidityMining/PendleGauge.sol/PendleGauge.dbg.json +1 -1
- package/build/artifacts/contracts/core/LiquidityMining/VotingController/PendleVotingControllerUpg.sol/PendleVotingControllerUpg.dbg.json +1 -1
- package/build/artifacts/contracts/core/LiquidityMining/VotingController/PendleVotingControllerUpg.sol/PendleVotingControllerUpg.json +228 -40
- package/build/artifacts/contracts/core/LiquidityMining/VotingController/VotingControllerStorageUpg.sol/VotingControllerStorageUpg.dbg.json +1 -1
- package/build/artifacts/contracts/core/LiquidityMining/VotingController/VotingControllerStorageUpg.sol/VotingControllerStorageUpg.json +232 -12
- package/build/artifacts/contracts/core/LiquidityMining/VotingEscrow/VotingEscrowPendleMainchain.sol/VotingEscrowPendleMainchain.dbg.json +1 -1
- package/build/artifacts/contracts/core/LiquidityMining/VotingEscrow/VotingEscrowPendleMainchain.sol/VotingEscrowPendleMainchain.json +164 -47
- package/build/artifacts/contracts/core/LiquidityMining/VotingEscrow/VotingEscrowPendleSidechain.sol/VotingEscrowPendleSidechain.dbg.json +1 -1
- package/build/artifacts/contracts/core/LiquidityMining/VotingEscrow/VotingEscrowPendleSidechain.sol/VotingEscrowPendleSidechain.json +25 -93
- package/build/artifacts/contracts/core/LiquidityMining/VotingEscrow/VotingEscrowTokenBase.sol/VotingEscrowTokenBase.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 +222 -9
- package/build/artifacts/contracts/core/Market/PendleMarketFactory.sol/PendleMarketFactory.dbg.json +1 -1
- package/build/artifacts/contracts/core/Market/PendleMarketFactory.sol/PendleMarketFactory.json +106 -5
- package/build/artifacts/contracts/core/PendleERC20.sol/PendleERC20.dbg.json +1 -1
- package/build/artifacts/contracts/core/PendleERC20Permit.sol/PendleERC20Permit.dbg.json +4 -0
- package/build/artifacts/contracts/core/PendleERC20Permit.sol/PendleERC20Permit.json +329 -0
- package/build/artifacts/contracts/core/PendleRouter.sol/PendleRouter.dbg.json +1 -1
- package/build/artifacts/contracts/core/PendleRouter.sol/PendleRouter.json +13 -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 +87 -2
- package/build/artifacts/contracts/core/YieldContracts/PendleYieldContractFactory.sol/PendleYieldContractFactory.dbg.json +1 -1
- package/build/artifacts/contracts/core/YieldContracts/PendleYieldContractFactory.sol/PendleYieldContractFactory.json +80 -16
- package/build/artifacts/contracts/core/YieldContracts/PendleYieldToken.sol/PendleYieldToken.dbg.json +1 -1
- package/build/artifacts/contracts/core/YieldContracts/PendleYieldToken.sol/PendleYieldToken.json +164 -2
- package/build/artifacts/contracts/core/actions/ActionAddRemoveLiq.sol/ActionAddRemoveLiq.dbg.json +1 -1
- package/build/artifacts/contracts/core/actions/ActionAddRemoveLiq.sol/ActionAddRemoveLiq.json +172 -4
- package/build/artifacts/contracts/core/actions/ActionCallback.sol/ActionCallback.dbg.json +1 -1
- package/build/artifacts/contracts/core/actions/ActionCallback.sol/ActionCallback.json +109 -2
- package/build/artifacts/contracts/core/actions/ActionMintRedeem.sol/ActionMintRedeem.dbg.json +1 -1
- package/build/artifacts/contracts/core/actions/ActionMintRedeem.sol/ActionMintRedeem.json +57 -4
- package/build/artifacts/contracts/core/actions/ActionMisc.sol/ActionMisc.dbg.json +1 -1
- package/build/artifacts/contracts/core/actions/ActionMisc.sol/ActionMisc.json +7 -2
- package/build/artifacts/contracts/core/actions/ActionSwapPT.sol/ActionSwapPT.dbg.json +1 -1
- package/build/artifacts/contracts/core/actions/ActionSwapPT.sol/ActionSwapPT.json +199 -4
- package/build/artifacts/contracts/core/actions/ActionSwapPTYT.sol/ActionSwapPTYT.dbg.json +1 -1
- package/build/artifacts/contracts/core/actions/ActionSwapPTYT.sol/ActionSwapPTYT.json +108 -2
- package/build/artifacts/contracts/core/actions/ActionSwapYT.sol/ActionSwapYT.dbg.json +1 -1
- package/build/artifacts/contracts/core/actions/ActionSwapYT.sol/ActionSwapYT.json +146 -4
- package/build/artifacts/contracts/core/actions/base/ActionBaseMintRedeem.sol/ActionBaseMintRedeem.dbg.json +1 -1
- package/build/artifacts/contracts/core/actions/base/CallbackHelper.sol/CallbackHelper.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/ConvexCurve/IBooster.sol/IBooster.dbg.json +4 -0
- package/build/artifacts/contracts/interfaces/ConvexCurve/IBooster.sol/IBooster.json +177 -0
- package/build/artifacts/contracts/interfaces/ConvexCurve/ICrvDepositor.sol/ICrvDepositor.dbg.json +4 -0
- package/build/artifacts/contracts/interfaces/ConvexCurve/ICrvDepositor.sol/ICrvDepositor.json +78 -0
- package/build/artifacts/contracts/interfaces/ConvexCurve/ICvxCrv.sol/ICvxCrv.dbg.json +4 -0
- package/build/artifacts/contracts/interfaces/ConvexCurve/ICvxCrv.sol/ICvxCrv.json +24 -0
- package/build/artifacts/contracts/interfaces/ConvexCurve/IRewards.sol/IRewards.dbg.json +4 -0
- package/build/artifacts/contracts/interfaces/ConvexCurve/IRewards.sol/IRewards.json +264 -0
- package/build/artifacts/contracts/interfaces/Curve/ICrvPool.sol/ICrvPool.dbg.json +4 -0
- package/build/artifacts/contracts/interfaces/Curve/ICrvPool.sol/ICrvPool.json +305 -0
- package/build/artifacts/contracts/interfaces/IAToken.sol/IAToken.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IAavePool.sol/IAavePool.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IAaveRewardsController.sol/IAaveRewardsController.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IBenQiComptroller.sol/IBenQiComptroller.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IBenQiInterestRateModel.sol/IBenQiInterestRateModel.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IBoringOwnableUpgradeable.sol/IBoringOwnableUpgradeable.dbg.json +4 -0
- package/build/artifacts/contracts/interfaces/IBoringOwnableUpgradeable.sol/IBoringOwnableUpgradeable.json +34 -0
- package/build/artifacts/contracts/interfaces/ICelerMessageBus.sol/ICelerMessageBus.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/ICelerMessageReceiverApp.sol/ICelerMessageReceiverApp.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IERC4626.sol/IERC4626.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IEulerEToken.sol/IEulerEToken.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IEulerMarkets.sol/IEulerMarkets.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 +31 -1
- package/build/artifacts/contracts/interfaces/IPActionMintRedeem.sol/IPActionMintRedeem.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPActionMisc.sol/IPActionMisc.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPActionSwapPT.sol/IPActionSwapPT.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPActionSwapPT.sol/IPActionSwapPT.json +30 -0
- package/build/artifacts/contracts/interfaces/IPActionSwapPTYT.sol/IPActionSwapPTYT.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPActionSwapPTYT.sol/IPActionSwapPTYT.json +10 -0
- package/build/artifacts/contracts/interfaces/IPActionSwapYT.sol/IPActionSwapYT.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPActionSwapYT.sol/IPActionSwapYT.json +30 -0
- package/build/artifacts/contracts/interfaces/IPAllAction.sol/IPAllAction.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPAllAction.sol/IPAllAction.json +101 -1
- package/build/artifacts/contracts/interfaces/IPFeeDistributor.sol/IPFeeDistributor.dbg.json +4 -0
- package/build/artifacts/contracts/interfaces/IPFeeDistributor.sol/IPFeeDistributor.json +112 -0
- package/build/artifacts/contracts/interfaces/IPFeeDistributorFactory.sol/IPFeeDistributorFactory.dbg.json +4 -0
- package/build/artifacts/contracts/interfaces/IPFeeDistributorFactory.sol/IPFeeDistributorFactory.json +76 -0
- package/build/artifacts/contracts/interfaces/IPGauge.sol/IPGauge.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPGaugeController.sol/IPGaugeController.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPGaugeControllerMainchain.sol/IPGaugeControllerMainchain.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPGovernanceManager.sol/IPGovernanceManager.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPInterestManagerYT.sol/IPInterestManagerYT.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPMarket.sol/IPMarket.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPMarket.sol/IPMarket.json +13 -0
- package/build/artifacts/contracts/interfaces/IPMarketFactory.sol/IPMarketFactory.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPMarketSwapCallback.sol/IPMarketSwapCallback.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPMsgReceiverApp.sol/IPMsgReceiverApp.dbg.json +4 -0
- package/build/artifacts/contracts/interfaces/IPMsgReceiverApp.sol/IPMsgReceiverApp.json +24 -0
- package/build/artifacts/contracts/interfaces/IPMsgSendEndpoint.sol/IPMsgSendEndpoint.dbg.json +4 -0
- package/build/artifacts/contracts/interfaces/IPMsgSendEndpoint.sol/IPMsgSendEndpoint.json +63 -0
- package/build/artifacts/contracts/interfaces/IPPermissionsV2Upg.sol/IPermissionsV2Upg.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPPrincipalToken.sol/IPPrincipalToken.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/IPVotingController.sol/IPVotingController.json +148 -0
- package/build/artifacts/contracts/interfaces/IPVotingEscrowMainchain.sol/IPVotingEscrowMainchain.dbg.json +4 -0
- package/build/artifacts/contracts/interfaces/{IPVotingEscrow.sol/IPVotingEscrow.json → IPVotingEscrowMainchain.sol/IPVotingEscrowMainchain.json} +88 -2
- 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/IREDACTEDStaking.sol/IREDACTEDStaking.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IRewardManager.sol/IRewardManager.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/ISAvax.sol/ISAvax.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/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/ISuperComposableYield.sol/ISuperComposableYield.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/ISuperComposableYield.sol/ISuperComposableYield.json +4 -28
- 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/interfaces/IWXBTRFLY.sol/IWXBTRFLY.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IWstETH.sol/IWstETH.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IYearnVault.sol/IYearnVault.dbg.json +1 -1
- package/build/artifacts/contracts/libraries/Errors.sol/Errors.dbg.json +4 -0
- package/build/artifacts/contracts/libraries/Errors.sol/Errors.json +886 -0
- package/build/artifacts/contracts/libraries/OracleLib.sol/OracleLib.dbg.json +1 -1
- package/build/artifacts/contracts/libraries/OracleLib.sol/OracleLib.json +28 -2
- package/build/artifacts/contracts/libraries/RewardManager.sol/RewardManager.dbg.json +1 -1
- package/build/artifacts/contracts/libraries/RewardManagerAbstract.sol/RewardManagerAbstract.dbg.json +1 -1
- package/build/artifacts/contracts/libraries/SCY/SCYUtils.sol/SCYUtils.dbg.json +1 -1
- package/build/artifacts/contracts/libraries/VeBalanceLib.sol/VeBalanceLib.dbg.json +1 -1
- package/build/artifacts/contracts/libraries/VeBalanceLib.sol/VeBalanceLib.json +2 -2
- package/build/artifacts/contracts/libraries/VeHistoryLib.sol/CheckpointHelper.dbg.json +4 -0
- package/build/artifacts/contracts/libraries/{solmate/SSTORE2.sol/SSTORE2.json → VeHistoryLib.sol/CheckpointHelper.json} +4 -4
- package/build/artifacts/contracts/libraries/VeHistoryLib.sol/Checkpoints.dbg.json +1 -1
- package/build/artifacts/contracts/libraries/VeHistoryLib.sol/Checkpoints.json +2 -2
- package/build/artifacts/contracts/libraries/helpers/ArrayLib.sol/ArrayLib.dbg.json +1 -1
- package/build/artifacts/contracts/libraries/helpers/ArrayLib.sol/ArrayLib.json +2 -2
- package/build/artifacts/contracts/libraries/helpers/BaseSplitCodeFactory.sol/BaseSplitCodeFactory.dbg.json +4 -0
- package/build/artifacts/contracts/libraries/helpers/BaseSplitCodeFactory.sol/BaseSplitCodeFactory.json +45 -0
- package/build/artifacts/contracts/libraries/helpers/BaseSplitCodeFactory.sol/CodeDeployer.dbg.json +4 -0
- package/build/artifacts/contracts/libraries/helpers/{SSTORE2Deployer.sol/SSTORE2Deployer.json → BaseSplitCodeFactory.sol/CodeDeployer.json} +4 -4
- package/build/artifacts/contracts/libraries/helpers/ExpiryUtilsLib.sol/ExpiryUtils.dbg.json +1 -1
- package/build/artifacts/contracts/libraries/helpers/MiniHelpers.sol/MiniHelpers.dbg.json +1 -1
- package/build/artifacts/contracts/libraries/helpers/PYIndex.sol/PYIndexLib.dbg.json +1 -1
- package/build/artifacts/contracts/libraries/helpers/PYIndex.sol/PYIndexLib.json +2 -2
- package/build/artifacts/contracts/libraries/helpers/TokenHelper.sol/TokenHelper.dbg.json +1 -1
- package/build/artifacts/contracts/libraries/kyberswap/AggregationRouterHelper.sol/AggregationRouterHelper.dbg.json +1 -1
- package/build/artifacts/contracts/libraries/kyberswap/AggregationRouterHelper.sol/AggregationRouterHelper.json +2 -2
- package/build/artifacts/contracts/libraries/kyberswap/IMultihopRouter.sol/IMultihopRouter.dbg.json +1 -1
- package/build/artifacts/contracts/libraries/kyberswap/KyberSwapHelper.sol/KyberSwapHelper.dbg.json +1 -1
- package/build/artifacts/contracts/libraries/math/LogExpMath.sol/LogExpMath.dbg.json +1 -1
- package/build/artifacts/contracts/libraries/math/MarketApproxLib.sol/MarketApproxPtInLib.dbg.json +1 -1
- package/build/artifacts/contracts/libraries/math/MarketApproxLib.sol/MarketApproxPtInLib.json +2 -2
- package/build/artifacts/contracts/libraries/math/MarketApproxLib.sol/MarketApproxPtOutLib.dbg.json +1 -1
- package/build/artifacts/contracts/libraries/math/MarketApproxLib.sol/MarketApproxPtOutLib.json +2 -2
- package/build/artifacts/contracts/libraries/math/MarketMathCore.sol/MarketMathCore.dbg.json +1 -1
- package/build/artifacts/contracts/libraries/math/MarketMathCore.sol/MarketMathCore.json +2 -2
- package/build/artifacts/contracts/libraries/math/Math.sol/Math.dbg.json +1 -1
- package/build/artifacts/contracts/libraries/math/Math.sol/Math.json +2 -2
- package/build/artifacts/contracts/libraries/math/WeekMath.sol/WeekMath.dbg.json +1 -1
- package/build/artifacts/contracts/libraries/math/WeekMath.sol/WeekMath.json +2 -2
- package/build/artifacts/contracts/offchain-helpers/BaseSplitCodeFactoryContract.sol/BaseSplitCodeFactoryContract.dbg.json +4 -0
- package/build/artifacts/contracts/offchain-helpers/BaseSplitCodeFactoryContract.sol/BaseSplitCodeFactoryContract.json +167 -0
- package/build/artifacts/contracts/offchain-helpers/MarketMathStatic.sol/MarketMathStatic.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/MarketMathStatic.sol/MarketMathStatic.json +182 -4
- package/build/artifacts/contracts/offchain-helpers/RouterStatic.sol/RouterStatic.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/RouterStatic.sol/RouterStatic.json +142 -66
- package/build/artifacts/contracts/periphery/BoringOwnableUpgradeable.sol/BoringOwnableUpgradeable.dbg.json +1 -1
- package/build/artifacts/contracts/periphery/BoringOwnableUpgradeable.sol/BoringOwnableUpgradeableData.dbg.json +1 -1
- package/contracts/SuperComposableYield/SCY-implementations/BenQi/PendleQiTokenHelper.sol +3 -1
- package/contracts/SuperComposableYield/SCY-implementations/BenQi/PendleQiTokenSCY.sol +19 -16
- package/contracts/SuperComposableYield/SCY-implementations/Convex/ConvexCurveLP/Pendle3CrvAndTokenSCY.sol +135 -0
- package/contracts/SuperComposableYield/SCY-implementations/Convex/ConvexCurveLP/PendleConvexCurveLP2PoolSCY.sol +96 -0
- package/contracts/SuperComposableYield/SCY-implementations/Convex/ConvexCurveLP/PendleConvexCurveLPSCY.sol +215 -0
- package/contracts/SuperComposableYield/SCY-implementations/Convex/Pendle3CrvHelper.sol +83 -0
- package/contracts/SuperComposableYield/SCY-implementations/PendleWstEthSCY.sol +10 -15
- package/contracts/SuperComposableYield/base-implementations/SCYBase.sol +30 -43
- package/contracts/core/LiquidityMining/CrossChainMsg/PendleMsgReceiveEndpointUpg.sol +74 -0
- package/contracts/core/LiquidityMining/CrossChainMsg/PendleMsgReceiverAppUpg.sol +38 -0
- package/contracts/core/LiquidityMining/CrossChainMsg/PendleMsgSendEndpointUpg.sol +83 -0
- package/contracts/core/LiquidityMining/{CelerAbstracts/CelerSenderUpg.sol → CrossChainMsg/PendleMsgSenderAppUpg.sol} +12 -13
- package/contracts/core/LiquidityMining/FeeDistributor/EpochResultManager.sol +159 -0
- package/contracts/core/LiquidityMining/FeeDistributor/PendleFeeDistributor.sol +96 -0
- package/contracts/core/LiquidityMining/FeeDistributor/PendleFeeDistributorFactory.sol +68 -0
- package/contracts/core/LiquidityMining/GaugeController/PendleGaugeControllerBaseUpg.sol +4 -3
- package/contracts/core/LiquidityMining/GaugeController/PendleGaugeControllerMainchainUpg.sol +6 -2
- package/contracts/core/LiquidityMining/GaugeController/PendleGaugeControllerSidechainUpg.sol +12 -4
- package/contracts/core/LiquidityMining/VotingController/PendleVotingControllerUpg.sol +29 -19
- package/contracts/core/LiquidityMining/VotingController/VotingControllerStorageUpg.sol +27 -19
- package/contracts/core/LiquidityMining/VotingEscrow/VotingEscrowPendleMainchain.sol +63 -27
- package/contracts/core/LiquidityMining/VotingEscrow/VotingEscrowPendleSidechain.sol +6 -5
- package/contracts/core/LiquidityMining/VotingEscrow/VotingEscrowTokenBase.sol +2 -2
- package/contracts/core/Market/PendleMarket.sol +26 -24
- package/contracts/core/Market/PendleMarketFactory.sol +41 -20
- package/contracts/core/PendleERC20Permit.sol +84 -0
- package/contracts/core/PendleRouter.sol +2 -1
- package/contracts/core/YieldContracts/PendlePrincipalToken.sol +8 -7
- package/contracts/core/YieldContracts/PendleYieldContractFactory.sol +37 -22
- package/contracts/core/YieldContracts/PendleYieldToken.sol +106 -35
- package/contracts/core/actions/ActionAddRemoveLiq.sol +58 -41
- package/contracts/core/actions/ActionCallback.sol +24 -14
- package/contracts/core/actions/ActionMintRedeem.sol +11 -5
- package/contracts/core/actions/ActionMisc.sol +2 -1
- package/contracts/core/actions/ActionSwapPT.sol +38 -19
- package/contracts/core/actions/ActionSwapPTYT.sol +7 -6
- package/contracts/core/actions/ActionSwapYT.sol +36 -19
- package/contracts/core/actions/base/ActionBaseMintRedeem.sol +15 -8
- package/contracts/interfaces/ConvexCurve/IBooster.sol +32 -0
- package/contracts/interfaces/ConvexCurve/ICrvDepositor.sol +20 -0
- package/contracts/interfaces/ConvexCurve/ICvxCrv.sol +6 -0
- package/contracts/interfaces/ConvexCurve/IRewards.sol +38 -0
- package/contracts/interfaces/Curve/ICrvPool.sol +69 -0
- package/contracts/interfaces/IBoringOwnableUpgradeable.sol +10 -0
- package/contracts/interfaces/IPActionAddRemoveLiq.sol +7 -7
- package/contracts/interfaces/IPActionSwapPT.sol +6 -6
- package/contracts/interfaces/IPActionSwapPTYT.sol +2 -2
- package/contracts/interfaces/IPActionSwapYT.sol +13 -13
- package/contracts/interfaces/IPFeeDistributor.sol +19 -0
- package/contracts/interfaces/IPFeeDistributorFactory.sol +14 -0
- package/contracts/interfaces/IPMarket.sol +2 -0
- package/contracts/interfaces/IPMsgReceiverApp.sol +7 -0
- package/contracts/interfaces/IPMsgSendEndpoint.sol +17 -0
- package/contracts/interfaces/IPVotingController.sol +22 -0
- package/contracts/interfaces/{IPVotingEscrow.sol → IPVotingEscrowMainchain.sol} +11 -1
- package/contracts/interfaces/ISuperComposableYield.sol +2 -7
- package/contracts/libraries/Errors.sol +121 -0
- package/contracts/libraries/OracleLib.sol +6 -3
- package/contracts/libraries/VeBalanceLib.sol +5 -1
- package/contracts/libraries/VeHistoryLib.sol +20 -31
- package/contracts/libraries/helpers/ArrayLib.sol +0 -17
- package/contracts/libraries/helpers/BaseSplitCodeFactory.sol +288 -0
- package/contracts/libraries/helpers/TokenHelper.sol +4 -0
- package/contracts/libraries/kyberswap/AggregationRouterHelper.sol +0 -7
- package/contracts/libraries/math/MarketMathCore.sol +29 -25
- package/contracts/libraries/math/Math.sol +6 -2
- package/contracts/libraries/math/WeekMath.sol +2 -2
- package/contracts/offchain-helpers/BaseSplitCodeFactoryContract.sol +43 -0
- package/contracts/offchain-helpers/MarketMathStatic.sol +36 -36
- package/contracts/offchain-helpers/RouterStatic.sol +53 -37
- package/deployments/43113-core.json +11 -10
- 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 +9 -9
- package/deployments/80001-core.json +10 -9
- package/deployments/80001-markets/benqi-market-QI-USDC-FEB-2ND.json +8 -0
- package/deployments/80001-markets/benqi-market-QI-WETH-DEC-1ST.json +8 -0
- package/deployments/80001-testenv.json +16 -16
- package/package.json +1 -1
- package/typechain-types/ActionAddRemoveLiq.ts +18 -6
- package/typechain-types/ActionSwapPT.ts +18 -6
- package/typechain-types/ActionSwapPTYT.ts +6 -2
- package/typechain-types/ActionSwapYT.ts +18 -6
- package/typechain-types/IPActionAddRemoveLiq.ts +19 -7
- package/typechain-types/IPActionSwapPT.ts +18 -6
- package/typechain-types/IPActionSwapPTYT.ts +6 -2
- package/typechain-types/IPActionSwapYT.ts +18 -6
- package/typechain-types/IPAllAction.ts +61 -21
- package/typechain-types/IPBatchSeller.ts +19 -37
- package/typechain-types/IPMarket.ts +13 -0
- package/typechain-types/IPVotingController.ts +244 -7
- package/typechain-types/ISuperComposableYield.ts +7 -46
- package/typechain-types/MarketMathStatic.ts +139 -10
- package/typechain-types/PendleBatchSeller.ts +72 -50
- package/typechain-types/PendleGaugeControllerSidechainUpg.ts +28 -149
- package/typechain-types/PendleMarket.ts +104 -0
- package/typechain-types/PendleMarketFactory.ts +76 -13
- package/typechain-types/PendlePrincipalToken.ts +104 -0
- package/typechain-types/PendleQiTokenSCY.ts +111 -46
- package/typechain-types/PendleVotingControllerUpg.ts +133 -77
- package/typechain-types/PendleWstEthSCY.ts +111 -46
- package/typechain-types/PendleYieldContractFactory.ts +84 -21
- package/typechain-types/PendleYieldToken.ts +175 -0
- package/typechain-types/RouterStatic.ts +136 -67
- package/typechain-types/SCYBase.ts +111 -46
- package/typechain-types/SCYBaseWithRewards.ts +111 -46
- package/typechain-types/VotingControllerStorageUpg.ts +246 -27
- package/typechain-types/VotingEscrowPendleMainchain.ts +81 -93
- package/typechain-types/VotingEscrowPendleSidechain.ts +26 -171
- package/typechain-types/factories/ActionAddRemoveLiq__factory.ts +169 -1
- package/typechain-types/factories/ActionCallback__factory.ts +108 -1
- package/typechain-types/factories/ActionMintRedeem__factory.ts +54 -1
- package/typechain-types/factories/ActionMisc__factory.ts +6 -1
- package/typechain-types/factories/ActionSwapPTYT__factory.ts +107 -1
- package/typechain-types/factories/ActionSwapPT__factory.ts +196 -1
- package/typechain-types/factories/ActionSwapYT__factory.ts +143 -1
- package/typechain-types/factories/AggregationRouterHelper__factory.ts +1 -1
- package/typechain-types/factories/IPActionAddRemoveLiq__factory.ts +31 -1
- package/typechain-types/factories/IPActionSwapPTYT__factory.ts +10 -0
- package/typechain-types/factories/IPActionSwapPT__factory.ts +30 -0
- package/typechain-types/factories/IPActionSwapYT__factory.ts +30 -0
- package/typechain-types/factories/IPAllAction__factory.ts +101 -1
- package/typechain-types/factories/IPBatchSeller__factory.ts +4 -10
- package/typechain-types/factories/IPMarket__factory.ts +13 -0
- package/typechain-types/factories/IPVotingController__factory.ts +148 -0
- package/typechain-types/factories/ISuperComposableYield__factory.ts +4 -28
- package/typechain-types/factories/MarketMathStatic__factory.ts +181 -3
- package/typechain-types/factories/OracleLib__factory.ts +27 -1
- package/typechain-types/factories/Pendle3CrvAndTokenSCY__factory.ts +1 -1
- package/typechain-types/factories/Pendle3CrvHelper__factory.ts +1 -1
- package/typechain-types/factories/PendleBatchSeller__factory.ts +40 -118
- package/typechain-types/factories/PendleConvexCurveLP2PoolSCY__factory.ts +1 -1
- package/typechain-types/factories/PendleERC20Permit__factory.ts +1 -1
- 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 +11 -0
- package/typechain-types/factories/PendleGaugeControllerMainchainUpg__factory.ts +28 -1
- package/typechain-types/factories/PendleGaugeControllerSidechainUpg__factory.ts +48 -86
- package/typechain-types/factories/PendleMarketFactory__factory.ts +129 -9
- package/typechain-types/factories/PendleMarket__factory.ts +214 -1
- package/typechain-types/factories/PendlePrincipalToken__factory.ts +86 -1
- package/typechain-types/factories/PendleQiTokenHelper__factory.ts +1 -1
- package/typechain-types/factories/PendleQiTokenSCY__factory.ts +198 -29
- package/typechain-types/factories/PendleRouter__factory.ts +12 -1
- package/typechain-types/factories/PendleVotingControllerUpg__factory.ts +235 -40
- package/typechain-types/factories/PendleWstEthSCY__factory.ts +137 -22
- package/typechain-types/factories/PendleYieldContractFactory__factory.ts +103 -20
- package/typechain-types/factories/PendleYieldToken__factory.ts +163 -1
- package/typechain-types/factories/PtAMMArb__factory.ts +1 -1
- package/typechain-types/factories/RouterStatic__factory.ts +95 -19
- package/typechain-types/factories/SCYBaseWithRewards__factory.ts +136 -21
- package/typechain-types/factories/SCYBase__factory.ts +136 -21
- package/typechain-types/factories/VotingControllerStorageUpg__factory.ts +232 -12
- package/typechain-types/factories/VotingEscrowPendleMainchain__factory.ts +171 -47
- package/typechain-types/factories/VotingEscrowPendleSidechain__factory.ts +31 -93
- package/typechain-types/hardhat.d.ts +393 -114
- package/typechain-types/index.ts +36 -66
- package/build/artifacts/contracts/SuperComposableYield/SCY-implementations/AaveV3/PendleAaveV3SCY.sol/PendleAaveV3SCY.dbg.json +0 -4
- package/build/artifacts/contracts/SuperComposableYield/SCY-implementations/AaveV3/PendleAaveV3SCY.sol/PendleAaveV3SCY.json +0 -810
- package/build/artifacts/contracts/SuperComposableYield/SCY-implementations/AaveV3/WadRayMath.sol/WadRayMath.dbg.json +0 -4
- package/build/artifacts/contracts/SuperComposableYield/SCY-implementations/AaveV3/WadRayMath.sol/WadRayMath.json +0 -10
- package/build/artifacts/contracts/SuperComposableYield/SCY-implementations/BenQi/PendleQiSAvaxSCY.sol/PendleQiSAvaxSCY.dbg.json +0 -4
- package/build/artifacts/contracts/SuperComposableYield/SCY-implementations/BenQi/PendleQiSAvaxSCY.sol/PendleQiSAvaxSCY.json +0 -833
- package/build/artifacts/contracts/SuperComposableYield/SCY-implementations/BenQi/PendleSAvaxSCY.sol/PendleSAvaxSCY.dbg.json +0 -4
- package/build/artifacts/contracts/SuperComposableYield/SCY-implementations/BenQi/PendleSAvaxSCY.sol/PendleSAvaxSCY.json +0 -723
- package/build/artifacts/contracts/SuperComposableYield/SCY-implementations/Euler/PendleEulerSCY.sol/PendleEulerSCY.dbg.json +0 -4
- package/build/artifacts/contracts/SuperComposableYield/SCY-implementations/Euler/PendleEulerSCY.sol/PendleEulerSCY.json +0 -728
- package/build/artifacts/contracts/SuperComposableYield/SCY-implementations/PendleERC4626SCY.sol/PendleERC4626SCY.dbg.json +0 -4
- package/build/artifacts/contracts/SuperComposableYield/SCY-implementations/PendleERC4626SCY.sol/PendleERC4626SCY.json +0 -705
- package/build/artifacts/contracts/SuperComposableYield/SCY-implementations/PendleStargateSCY.sol/PendleStargateSCY.dbg.json +0 -4
- package/build/artifacts/contracts/SuperComposableYield/SCY-implementations/PendleStargateSCY.sol/PendleStargateSCY.json +0 -864
- package/build/artifacts/contracts/SuperComposableYield/SCY-implementations/PendleYearnVaultSCY.sol/PendleYearnVaultSCY.dbg.json +0 -4
- package/build/artifacts/contracts/SuperComposableYield/SCY-implementations/PendleYearnVaultSCY.sol/PendleYearnVaultSCY.json +0 -718
- package/build/artifacts/contracts/SuperComposableYield/SCY-implementations/TraderJoe/PendleSJoeSCY.sol/PendleSJoeSCY.dbg.json +0 -4
- package/build/artifacts/contracts/SuperComposableYield/SCY-implementations/TraderJoe/PendleSJoeSCY.sol/PendleSJoeSCY.json +0 -784
- package/build/artifacts/contracts/core/LiquidityMining/CelerAbstracts/CelerReceiverUpg.sol/CelerReceiverUpg.dbg.json +0 -4
- package/build/artifacts/contracts/core/LiquidityMining/CelerAbstracts/CelerSenderUpg.sol/CelerSenderUpg.dbg.json +0 -4
- package/build/artifacts/contracts/interfaces/IPVotingEscrow.sol/IPVotingEscrow.dbg.json +0 -4
- package/build/artifacts/contracts/libraries/helpers/SSTORE2Deployer.sol/SSTORE2Deployer.dbg.json +0 -4
- package/build/artifacts/contracts/libraries/solmate/SSTORE2.sol/SSTORE2.dbg.json +0 -4
- package/build/artifacts/contracts/offchain-helpers/SSTORE2DeployerContract.sol/SSTORE2DeployerContract.dbg.json +0 -4
- package/build/artifacts/contracts/offchain-helpers/SSTORE2DeployerContract.sol/SSTORE2DeployerContract.json +0 -134
- package/contracts/SuperComposableYield/SCY-implementations/AaveV3/PendleAaveV3SCY.sol +0 -161
- package/contracts/SuperComposableYield/SCY-implementations/AaveV3/WadRayMath.sol +0 -126
- package/contracts/SuperComposableYield/SCY-implementations/BenQi/PendleQiSAvaxSCY.sol +0 -242
- package/contracts/SuperComposableYield/SCY-implementations/BenQi/PendleSAvaxSCY.sol +0 -146
- package/contracts/SuperComposableYield/SCY-implementations/Euler/PendleEulerSCY.sol +0 -176
- package/contracts/SuperComposableYield/SCY-implementations/PendleERC4626SCY.sol +0 -129
- package/contracts/SuperComposableYield/SCY-implementations/PendleStargateSCY.sol +0 -193
- package/contracts/SuperComposableYield/SCY-implementations/PendleYearnVaultSCY.sol +0 -155
- package/contracts/SuperComposableYield/SCY-implementations/TraderJoe/PendleSJoeSCY.sol +0 -182
- package/contracts/core/LiquidityMining/CelerAbstracts/CelerReceiverUpg.sol +0 -53
- package/contracts/libraries/helpers/SSTORE2Deployer.sol +0 -30
- package/contracts/libraries/solmate/SSTORE2.sol +0 -99
- package/contracts/offchain-helpers/SSTORE2DeployerContract.sol +0 -21
- package/deployments/43113-markets/benqi-market-10D931.json +0 -8
- package/deployments/43113-markets/benqi-market-9fbD64.json +0 -8
- package/deployments/43113-markets/benqi-market-A12361.json +0 -8
|
@@ -5,10 +5,10 @@ pragma solidity 0.8.15;
|
|
|
5
5
|
import "../../../libraries/VeBalanceLib.sol";
|
|
6
6
|
import "../../../libraries/math/WeekMath.sol";
|
|
7
7
|
import "./VotingEscrowTokenBase.sol";
|
|
8
|
-
import "../
|
|
8
|
+
import "../CrossChainMsg/PendleMsgReceiverAppUpg.sol";
|
|
9
9
|
|
|
10
10
|
// solhint-disable no-empty-blocks
|
|
11
|
-
contract VotingEscrowPendleSidechain is VotingEscrowTokenBase,
|
|
11
|
+
contract VotingEscrowPendleSidechain is VotingEscrowTokenBase, PendleMsgReceiverAppUpg {
|
|
12
12
|
mapping(address => address) internal delegatorOf;
|
|
13
13
|
|
|
14
14
|
event SetNewDelegator(address delegator, address receiver);
|
|
@@ -17,9 +17,10 @@ contract VotingEscrowPendleSidechain is VotingEscrowTokenBase, CelerReceiverUpg
|
|
|
17
17
|
|
|
18
18
|
event SetNewUserPosition(LockedPosition position);
|
|
19
19
|
|
|
20
|
-
constructor()
|
|
21
|
-
|
|
22
|
-
|
|
20
|
+
constructor(address _PendleMsgReceiveEndpointUpg)
|
|
21
|
+
initializer
|
|
22
|
+
PendleMsgReceiverAppUpg(_PendleMsgReceiveEndpointUpg)
|
|
23
|
+
{
|
|
23
24
|
__BoringOwnable_init();
|
|
24
25
|
}
|
|
25
26
|
|
|
@@ -23,9 +23,9 @@ abstract contract VotingEscrowTokenBase is IPVeToken {
|
|
|
23
23
|
using VeBalanceLib for VeBalance;
|
|
24
24
|
using VeBalanceLib for LockedPosition;
|
|
25
25
|
|
|
26
|
-
uint128 public constant WEEK = 1
|
|
26
|
+
uint128 public constant WEEK = 1 days;
|
|
27
27
|
uint128 public constant MAX_LOCK_TIME = 104 weeks;
|
|
28
|
-
uint128 public constant MIN_LOCK_TIME = 1
|
|
28
|
+
uint128 public constant MIN_LOCK_TIME = 1 days;
|
|
29
29
|
|
|
30
30
|
VeBalance internal _totalSupply;
|
|
31
31
|
uint128 public lastSlopeChangeAppliedAt;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
2
2
|
pragma solidity 0.8.15;
|
|
3
3
|
|
|
4
|
-
import "../
|
|
4
|
+
import "../PendleERC20Permit.sol";
|
|
5
5
|
import "../../interfaces/IPPrincipalToken.sol";
|
|
6
6
|
import "../../interfaces/ISuperComposableYield.sol";
|
|
7
7
|
import "../../interfaces/IPMarket.sol";
|
|
@@ -12,6 +12,7 @@ import "../../libraries/OracleLib.sol";
|
|
|
12
12
|
import "../../libraries/math/LogExpMath.sol";
|
|
13
13
|
import "../../libraries/math/Math.sol";
|
|
14
14
|
import "../../libraries/helpers/MiniHelpers.sol";
|
|
15
|
+
import "../../libraries/Errors.sol";
|
|
15
16
|
|
|
16
17
|
import "../LiquidityMining/PendleGauge.sol";
|
|
17
18
|
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
|
|
@@ -22,7 +23,7 @@ Invariance to maintain:
|
|
|
22
23
|
- address(0) & address(this) should never have any rewards & activeBalance accounting done. This is
|
|
23
24
|
guaranteed by address(0) & address(this) check in each updateForTwo function
|
|
24
25
|
*/
|
|
25
|
-
contract PendleMarket is
|
|
26
|
+
contract PendleMarket is PendleERC20Permit, PendleGauge, IPMarket {
|
|
26
27
|
using Math for uint256;
|
|
27
28
|
using Math for int256;
|
|
28
29
|
using MarketMathCore for MarketState;
|
|
@@ -58,7 +59,7 @@ contract PendleMarket is PendleERC20, PendleGauge, IPMarket {
|
|
|
58
59
|
OracleLib.Observation[65535] public observations;
|
|
59
60
|
|
|
60
61
|
modifier notExpired() {
|
|
61
|
-
|
|
62
|
+
if (isExpired()) revert Errors.MarketExpired();
|
|
62
63
|
_;
|
|
63
64
|
}
|
|
64
65
|
|
|
@@ -69,7 +70,7 @@ contract PendleMarket is PendleERC20, PendleGauge, IPMarket {
|
|
|
69
70
|
address _vePendle,
|
|
70
71
|
address _gaugeController
|
|
71
72
|
)
|
|
72
|
-
|
|
73
|
+
PendleERC20Permit(NAME, SYMBOL, 18)
|
|
73
74
|
PendleGauge(IPPrincipalToken(_PT).SCY(), _vePendle, _gaugeController)
|
|
74
75
|
{
|
|
75
76
|
PT = IPPrincipalToken(_PT);
|
|
@@ -79,7 +80,8 @@ contract PendleMarket is PendleERC20, PendleGauge, IPMarket {
|
|
|
79
80
|
(_storage.observationCardinality, _storage.observationCardinalityNext) = observations
|
|
80
81
|
.initialize(uint32(block.timestamp));
|
|
81
82
|
|
|
82
|
-
|
|
83
|
+
if (_scalarRoot <= 0) revert Errors.MarketScalarRootBelowZero(_scalarRoot);
|
|
84
|
+
|
|
83
85
|
scalarRoot = _scalarRoot;
|
|
84
86
|
initialAnchor = _initialAnchor;
|
|
85
87
|
expiry = IPPrincipalToken(_PT).expiry();
|
|
@@ -110,7 +112,6 @@ contract PendleMarket is PendleERC20, PendleGauge, IPMarket {
|
|
|
110
112
|
uint256 lpToReserve;
|
|
111
113
|
|
|
112
114
|
(lpToReserve, netLpOut, netScyUsed, netPtUsed) = market.addLiquidity(
|
|
113
|
-
index,
|
|
114
115
|
netScyDesired,
|
|
115
116
|
netPtDesired,
|
|
116
117
|
block.timestamp
|
|
@@ -126,11 +127,10 @@ contract PendleMarket is PendleERC20, PendleGauge, IPMarket {
|
|
|
126
127
|
|
|
127
128
|
_writeState(market);
|
|
128
129
|
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
require(IERC20(PT).balanceOf(address(this)) >= market.totalPt.Uint(), "insufficient PT");
|
|
130
|
+
if (_selfBalance(SCY) < market.totalScy.Uint())
|
|
131
|
+
revert Errors.MarketInsufficientScyReceived(_selfBalance(SCY), market.totalScy.Uint());
|
|
132
|
+
if (_selfBalance(PT) < market.totalPt.Uint())
|
|
133
|
+
revert Errors.MarketInsufficientPtReceived(_selfBalance(PT), market.totalPt.Uint());
|
|
134
134
|
|
|
135
135
|
emit Mint(receiver, netLpOut, netScyUsed, netPtUsed);
|
|
136
136
|
}
|
|
@@ -190,8 +190,8 @@ contract PendleMarket is PendleERC20, PendleGauge, IPMarket {
|
|
|
190
190
|
IPMarketSwapCallback(msg.sender).swapCallback(exactPtIn.neg(), netScyOut.Int(), data);
|
|
191
191
|
}
|
|
192
192
|
|
|
193
|
-
|
|
194
|
-
|
|
193
|
+
if (_selfBalance(PT) < market.totalPt.Uint())
|
|
194
|
+
revert Errors.MarketInsufficientPtReceived(_selfBalance(PT), market.totalPt.Uint());
|
|
195
195
|
|
|
196
196
|
emit Swap(receiver, exactPtIn.neg(), netScyOut.Int(), netScyToReserve);
|
|
197
197
|
}
|
|
@@ -228,10 +228,8 @@ contract PendleMarket is PendleERC20, PendleGauge, IPMarket {
|
|
|
228
228
|
}
|
|
229
229
|
|
|
230
230
|
// have received enough SCY
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
"insufficient SCY"
|
|
234
|
-
);
|
|
231
|
+
if (_selfBalance(SCY) < market.totalScy.Uint())
|
|
232
|
+
revert Errors.MarketInsufficientScyReceived(_selfBalance(SCY), market.totalScy.Uint());
|
|
235
233
|
|
|
236
234
|
emit Swap(receiver, exactPtOut.Int(), netScyIn.neg(), netScyToReserve);
|
|
237
235
|
}
|
|
@@ -239,8 +237,8 @@ contract PendleMarket is PendleERC20, PendleGauge, IPMarket {
|
|
|
239
237
|
/// @notice force balances to match reserves
|
|
240
238
|
function skim() external nonReentrant {
|
|
241
239
|
MarketState memory market = readState();
|
|
242
|
-
uint256 excessPt =
|
|
243
|
-
uint256 excessScy =
|
|
240
|
+
uint256 excessPt = _selfBalance(PT) - market.totalPt.Uint();
|
|
241
|
+
uint256 excessScy = _selfBalance(SCY) - market.totalScy.Uint();
|
|
244
242
|
IERC20(PT).safeTransfer(market.treasury, excessPt);
|
|
245
243
|
IERC20(SCY).safeTransfer(market.treasury, excessScy);
|
|
246
244
|
}
|
|
@@ -306,12 +304,10 @@ contract PendleMarket is PendleERC20, PendleGauge, IPMarket {
|
|
|
306
304
|
/// @notice write back the state of the market from memory to storage
|
|
307
305
|
function _writeState(MarketState memory market) internal {
|
|
308
306
|
uint96 lastLnImpliedRate96 = market.lastLnImpliedRate.Uint96();
|
|
307
|
+
int128 totalPt128 = market.totalPt.Int128();
|
|
308
|
+
int128 totalScy128 = market.totalScy.Int128();
|
|
309
309
|
|
|
310
|
-
|
|
311
|
-
_storage.totalScy = market.totalScy.Int128();
|
|
312
|
-
_storage.lastLnImpliedRate = lastLnImpliedRate96;
|
|
313
|
-
|
|
314
|
-
(_storage.observationIndex, _storage.observationCardinality) = observations.write(
|
|
310
|
+
(uint16 observationIndex, uint16 observationCardinality) = observations.write(
|
|
315
311
|
_storage.observationIndex,
|
|
316
312
|
uint32(block.timestamp),
|
|
317
313
|
lastLnImpliedRate96,
|
|
@@ -319,6 +315,12 @@ contract PendleMarket is PendleERC20, PendleGauge, IPMarket {
|
|
|
319
315
|
_storage.observationCardinalityNext
|
|
320
316
|
);
|
|
321
317
|
|
|
318
|
+
_storage.totalPt = totalPt128;
|
|
319
|
+
_storage.totalScy = totalScy128;
|
|
320
|
+
_storage.lastLnImpliedRate = lastLnImpliedRate96;
|
|
321
|
+
_storage.observationIndex = observationIndex;
|
|
322
|
+
_storage.observationCardinality = observationCardinality;
|
|
323
|
+
|
|
322
324
|
emit UpdateImpliedRate(block.timestamp, market.lastLnImpliedRate);
|
|
323
325
|
}
|
|
324
326
|
|
|
@@ -6,7 +6,8 @@ import "../../interfaces/IPMarket.sol";
|
|
|
6
6
|
import "../../interfaces/IPYieldContractFactory.sol";
|
|
7
7
|
import "../../interfaces/IPMarketFactory.sol";
|
|
8
8
|
|
|
9
|
-
import "../../libraries/helpers/
|
|
9
|
+
import "../../libraries/helpers/BaseSplitCodeFactory.sol";
|
|
10
|
+
import "../../libraries/Errors.sol";
|
|
10
11
|
import "../../periphery/BoringOwnableUpgradeable.sol";
|
|
11
12
|
|
|
12
13
|
import "./PendleMarket.sol";
|
|
@@ -22,8 +23,12 @@ contract PendleMarketFactory is BoringOwnableUpgradeable, IPMarketFactory {
|
|
|
22
23
|
// 1 SLOT = 256 bits
|
|
23
24
|
}
|
|
24
25
|
|
|
26
|
+
address public immutable marketCreationCodeContractA;
|
|
27
|
+
uint256 public immutable marketCreationCodeSizeA;
|
|
28
|
+
address public immutable marketCreationCodeContractB;
|
|
29
|
+
uint256 public immutable marketCreationCodeSizeB;
|
|
30
|
+
|
|
25
31
|
address public immutable yieldContractFactory;
|
|
26
|
-
address public immutable marketCreationCodePointer;
|
|
27
32
|
uint256 public immutable maxLnFeeRateRoot;
|
|
28
33
|
|
|
29
34
|
// PT -> scalarRoot -> initialAnchor
|
|
@@ -34,12 +39,20 @@ contract PendleMarketFactory is BoringOwnableUpgradeable, IPMarketFactory {
|
|
|
34
39
|
|
|
35
40
|
MarketConfig public marketConfig;
|
|
36
41
|
|
|
37
|
-
constructor(
|
|
38
|
-
|
|
42
|
+
constructor(
|
|
43
|
+
address _yieldContractFactory,
|
|
44
|
+
address _marketCreationCodeContractA,
|
|
45
|
+
uint256 _marketCreationCodeSizeA,
|
|
46
|
+
address _marketCreationCodeContractB,
|
|
47
|
+
uint256 _marketCreationCodeSizeB
|
|
48
|
+
) {
|
|
39
49
|
yieldContractFactory = _yieldContractFactory;
|
|
40
50
|
maxLnFeeRateRoot = uint256(LogExpMath.ln(int256((105 * Math.IONE) / 100))); // ln(1.05)
|
|
41
51
|
|
|
42
|
-
|
|
52
|
+
marketCreationCodeContractA = _marketCreationCodeContractA;
|
|
53
|
+
marketCreationCodeSizeA = _marketCreationCodeSizeA;
|
|
54
|
+
marketCreationCodeContractB = _marketCreationCodeContractB;
|
|
55
|
+
marketCreationCodeSizeB = _marketCreationCodeSizeB;
|
|
43
56
|
}
|
|
44
57
|
|
|
45
58
|
function initialize(
|
|
@@ -49,8 +62,6 @@ contract PendleMarketFactory is BoringOwnableUpgradeable, IPMarketFactory {
|
|
|
49
62
|
address newVePendle,
|
|
50
63
|
address newGaugeController
|
|
51
64
|
) external initializer {
|
|
52
|
-
require(newVePendle != address(0) && newGaugeController != address(0), "zero address");
|
|
53
|
-
|
|
54
65
|
__BoringOwnable_init();
|
|
55
66
|
setTreasury(_treasury);
|
|
56
67
|
setlnFeeRateRoot(_lnFeeRateRoot);
|
|
@@ -69,19 +80,26 @@ contract PendleMarketFactory is BoringOwnableUpgradeable, IPMarketFactory {
|
|
|
69
80
|
int256 scalarRoot,
|
|
70
81
|
int256 initialAnchor
|
|
71
82
|
) external returns (address market) {
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
83
|
+
if (!IPYieldContractFactory(yieldContractFactory).isPT(PT))
|
|
84
|
+
revert Errors.MarketFactoryInvalidPt();
|
|
85
|
+
if (IPPrincipalToken(PT).isExpired()) revert Errors.MarketFactoryExpiredPt();
|
|
86
|
+
|
|
87
|
+
if (markets[PT][scalarRoot][initialAnchor] != address(0))
|
|
88
|
+
revert Errors.MarketFactoryMarketExists();
|
|
75
89
|
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
marketCreationCodePointer,
|
|
90
|
+
market = BaseSplitCodeFactory._create2(
|
|
91
|
+
0,
|
|
79
92
|
bytes32(block.chainid),
|
|
80
|
-
abi.encode(PT, scalarRoot, initialAnchor, vePendle, gaugeController)
|
|
93
|
+
abi.encode(PT, scalarRoot, initialAnchor, vePendle, gaugeController),
|
|
94
|
+
marketCreationCodeContractA,
|
|
95
|
+
marketCreationCodeSizeA,
|
|
96
|
+
marketCreationCodeContractB,
|
|
97
|
+
marketCreationCodeSizeB
|
|
81
98
|
);
|
|
82
99
|
|
|
83
100
|
markets[PT][scalarRoot][initialAnchor] = market;
|
|
84
|
-
|
|
101
|
+
|
|
102
|
+
if (!allMarkets.add(market)) assert(false);
|
|
85
103
|
|
|
86
104
|
emit CreateNewMarket(market, PT, scalarRoot, initialAnchor);
|
|
87
105
|
}
|
|
@@ -96,19 +114,22 @@ contract PendleMarketFactory is BoringOwnableUpgradeable, IPMarketFactory {
|
|
|
96
114
|
}
|
|
97
115
|
|
|
98
116
|
function setTreasury(address newTreasury) public onlyOwner {
|
|
99
|
-
require(newTreasury != address(0), "zero address");
|
|
100
117
|
marketConfig.treasury = newTreasury;
|
|
101
118
|
_emitNewMarketConfigEvent();
|
|
102
119
|
}
|
|
103
120
|
|
|
104
|
-
function setlnFeeRateRoot(uint88
|
|
105
|
-
|
|
106
|
-
|
|
121
|
+
function setlnFeeRateRoot(uint88 newLnFeeRateRoot) public onlyOwner {
|
|
122
|
+
if (newLnFeeRateRoot > maxLnFeeRateRoot)
|
|
123
|
+
revert Errors.MFactoryLnFeeRateRootTooHigh(newLnFeeRateRoot, maxLnFeeRateRoot);
|
|
124
|
+
|
|
125
|
+
marketConfig.lnFeeRateRoot = newLnFeeRateRoot;
|
|
107
126
|
_emitNewMarketConfigEvent();
|
|
108
127
|
}
|
|
109
128
|
|
|
110
129
|
function setReserveFeePercent(uint8 newReserveFeePercent) public onlyOwner {
|
|
111
|
-
|
|
130
|
+
if (newReserveFeePercent > 100)
|
|
131
|
+
revert Errors.MFactoryReserveFeePercentTooHigh(newReserveFeePercent, 100);
|
|
132
|
+
|
|
112
133
|
marketConfig.reserveFeePercent = newReserveFeePercent;
|
|
113
134
|
_emitNewMarketConfigEvent();
|
|
114
135
|
}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
// SPDX-License-Identifier: MIT
|
|
2
|
+
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/ERC20.sol)
|
|
3
|
+
|
|
4
|
+
pragma solidity ^0.8.0;
|
|
5
|
+
|
|
6
|
+
import "./PendleERC20.sol";
|
|
7
|
+
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
|
|
8
|
+
import "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol";
|
|
9
|
+
import "@openzeppelin/contracts/utils/Context.sol";
|
|
10
|
+
import "@openzeppelin/contracts/token/ERC20/extensions/draft-ERC20Permit.sol";
|
|
11
|
+
import "@openzeppelin/contracts/utils/cryptography/draft-EIP712.sol";
|
|
12
|
+
import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
|
|
13
|
+
import "@openzeppelin/contracts/utils/Counters.sol";
|
|
14
|
+
|
|
15
|
+
/// @dev forked from OZ's ERC20Permit
|
|
16
|
+
contract PendleERC20Permit is PendleERC20, IERC20Permit, EIP712 {
|
|
17
|
+
using Counters for Counters.Counter;
|
|
18
|
+
|
|
19
|
+
mapping(address => Counters.Counter) private _nonces;
|
|
20
|
+
|
|
21
|
+
// solhint-disable-next-line var-name-mixedcase
|
|
22
|
+
bytes32 private immutable _PERMIT_TYPEHASH =
|
|
23
|
+
keccak256(
|
|
24
|
+
"Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)"
|
|
25
|
+
);
|
|
26
|
+
|
|
27
|
+
constructor(
|
|
28
|
+
string memory name_,
|
|
29
|
+
string memory symbol_,
|
|
30
|
+
uint8 decimals_
|
|
31
|
+
) PendleERC20(name_, symbol_, decimals_) EIP712(name_, "1") {}
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* @dev See {IERC20Permit-permit}.
|
|
35
|
+
*/
|
|
36
|
+
function permit(
|
|
37
|
+
address owner,
|
|
38
|
+
address spender,
|
|
39
|
+
uint256 value,
|
|
40
|
+
uint256 deadline,
|
|
41
|
+
uint8 v,
|
|
42
|
+
bytes32 r,
|
|
43
|
+
bytes32 s
|
|
44
|
+
) public virtual override {
|
|
45
|
+
require(block.timestamp <= deadline, "ERC20Permit: expired deadline");
|
|
46
|
+
|
|
47
|
+
bytes32 structHash = keccak256(
|
|
48
|
+
abi.encode(_PERMIT_TYPEHASH, owner, spender, value, _useNonce(owner), deadline)
|
|
49
|
+
);
|
|
50
|
+
|
|
51
|
+
bytes32 hash = _hashTypedDataV4(structHash);
|
|
52
|
+
|
|
53
|
+
address signer = ECDSA.recover(hash, v, r, s);
|
|
54
|
+
require(signer == owner, "ERC20Permit: invalid signature");
|
|
55
|
+
|
|
56
|
+
_approve(owner, spender, value);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* @dev See {IERC20Permit-nonces}.
|
|
61
|
+
*/
|
|
62
|
+
function nonces(address owner) public view virtual override returns (uint256) {
|
|
63
|
+
return _nonces[owner].current();
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* @dev See {IERC20Permit-DOMAIN_SEPARATOR}.
|
|
68
|
+
*/
|
|
69
|
+
// solhint-disable-next-line func-name-mixedcase
|
|
70
|
+
function DOMAIN_SEPARATOR() external view override returns (bytes32) {
|
|
71
|
+
return _domainSeparatorV4();
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* @dev "Consume a nonce": return the current value and increment.
|
|
76
|
+
*
|
|
77
|
+
* _Available since v4.1._
|
|
78
|
+
*/
|
|
79
|
+
function _useNonce(address owner) internal virtual returns (uint256 current) {
|
|
80
|
+
Counters.Counter storage nonce = _nonces[owner];
|
|
81
|
+
current = nonce.current();
|
|
82
|
+
nonce.increment();
|
|
83
|
+
}
|
|
84
|
+
}
|
|
@@ -6,6 +6,7 @@ import "@openzeppelin/contracts/proxy/Proxy.sol";
|
|
|
6
6
|
import "../interfaces/IPAllAction.sol";
|
|
7
7
|
import "../interfaces/IPMarketSwapCallback.sol";
|
|
8
8
|
import "../periphery/BoringOwnableUpgradeable.sol";
|
|
9
|
+
import "../libraries/Errors.sol";
|
|
9
10
|
|
|
10
11
|
/// @dev this contract will be deployed behind an ERC1967 proxy
|
|
11
12
|
/// calls to the ERC1967 proxy will be resolved at this contract, and proxied again to the
|
|
@@ -96,7 +97,7 @@ contract PendleRouter is Proxy, Initializable, UUPSUpgradeable, BoringOwnableUpg
|
|
|
96
97
|
} else if (sig == IPActionMisc.consult.selector) {
|
|
97
98
|
return ACTION_MISC;
|
|
98
99
|
}
|
|
99
|
-
|
|
100
|
+
revert Errors.RouterInvalidAction(sig);
|
|
100
101
|
}
|
|
101
102
|
|
|
102
103
|
function _authorizeUpgrade(address newImplementation) internal override onlyOwner {}
|
|
@@ -4,23 +4,24 @@ pragma solidity 0.8.15;
|
|
|
4
4
|
import "../../interfaces/IPPrincipalToken.sol";
|
|
5
5
|
import "../../interfaces/IPYieldToken.sol";
|
|
6
6
|
|
|
7
|
-
import "../
|
|
7
|
+
import "../PendleERC20Permit.sol";
|
|
8
8
|
import "../../libraries/helpers/MiniHelpers.sol";
|
|
9
|
+
import "../../libraries/Errors.sol";
|
|
9
10
|
import "@openzeppelin/contracts/proxy/utils/Initializable.sol";
|
|
10
11
|
|
|
11
|
-
contract PendlePrincipalToken is
|
|
12
|
+
contract PendlePrincipalToken is PendleERC20Permit, Initializable, IPPrincipalToken {
|
|
12
13
|
address public immutable SCY;
|
|
13
14
|
address public immutable factory;
|
|
14
15
|
uint256 public immutable expiry;
|
|
15
16
|
address public YT;
|
|
16
17
|
|
|
17
18
|
modifier onlyYT() {
|
|
18
|
-
|
|
19
|
+
if (msg.sender != YT) revert Errors.OnlyYT();
|
|
19
20
|
_;
|
|
20
21
|
}
|
|
21
22
|
|
|
22
|
-
modifier
|
|
23
|
-
|
|
23
|
+
modifier onlYieldFactory() {
|
|
24
|
+
if (msg.sender != factory) revert Errors.OnlyYCFactory();
|
|
24
25
|
_;
|
|
25
26
|
}
|
|
26
27
|
|
|
@@ -30,13 +31,13 @@ contract PendlePrincipalToken is PendleERC20, Initializable, IPPrincipalToken {
|
|
|
30
31
|
string memory _symbol,
|
|
31
32
|
uint8 __decimals,
|
|
32
33
|
uint256 _expiry
|
|
33
|
-
)
|
|
34
|
+
) PendleERC20Permit(_name, _symbol, __decimals) {
|
|
34
35
|
SCY = _SCY;
|
|
35
36
|
expiry = _expiry;
|
|
36
37
|
factory = msg.sender;
|
|
37
38
|
}
|
|
38
39
|
|
|
39
|
-
function initialize(address _YT) external initializer
|
|
40
|
+
function initialize(address _YT) external initializer onlYieldFactory {
|
|
40
41
|
YT = _YT;
|
|
41
42
|
}
|
|
42
43
|
|
|
@@ -29,8 +29,9 @@ import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
|
|
|
29
29
|
import "@openzeppelin/contracts/utils/structs/EnumerableSet.sol";
|
|
30
30
|
|
|
31
31
|
import "../../libraries/helpers/ExpiryUtilsLib.sol";
|
|
32
|
-
import "../../libraries/helpers/
|
|
32
|
+
import "../../libraries/helpers/BaseSplitCodeFactory.sol";
|
|
33
33
|
import "../../libraries/helpers/MiniHelpers.sol";
|
|
34
|
+
import "../../libraries/Errors.sol";
|
|
34
35
|
|
|
35
36
|
import "../../periphery/BoringOwnableUpgradeable.sol";
|
|
36
37
|
|
|
@@ -44,7 +45,10 @@ contract PendleYieldContractFactory is BoringOwnableUpgradeable, IPYieldContract
|
|
|
44
45
|
string private constant PT_PREFIX = "PT";
|
|
45
46
|
string private constant YT_PREFIX = "YT";
|
|
46
47
|
|
|
47
|
-
address public immutable
|
|
48
|
+
address public immutable ytCreationCodeContractA;
|
|
49
|
+
uint256 public immutable ytCreationCodeSizeA;
|
|
50
|
+
address public immutable ytCreationCodeContractB;
|
|
51
|
+
uint256 public immutable ytCreationCodeSizeB;
|
|
48
52
|
|
|
49
53
|
// 1 SLOT
|
|
50
54
|
uint128 public interestFeeRate; // a fixed point number
|
|
@@ -60,8 +64,16 @@ contract PendleYieldContractFactory is BoringOwnableUpgradeable, IPYieldContract
|
|
|
60
64
|
mapping(address => bool) public isPT;
|
|
61
65
|
mapping(address => bool) public isYT;
|
|
62
66
|
|
|
63
|
-
constructor(
|
|
64
|
-
|
|
67
|
+
constructor(
|
|
68
|
+
address _ytCreationCodeContractA,
|
|
69
|
+
uint256 _ytCreationCodeSizeA,
|
|
70
|
+
address _ytCreationCodeContractB,
|
|
71
|
+
uint256 _ytCreationCodeSizeB
|
|
72
|
+
) {
|
|
73
|
+
ytCreationCodeContractA = _ytCreationCodeContractA;
|
|
74
|
+
ytCreationCodeSizeA = _ytCreationCodeSizeA;
|
|
75
|
+
ytCreationCodeContractB = _ytCreationCodeContractB;
|
|
76
|
+
ytCreationCodeSizeB = _ytCreationCodeSizeB;
|
|
65
77
|
}
|
|
66
78
|
|
|
67
79
|
function initialize(
|
|
@@ -85,31 +97,32 @@ contract PendleYieldContractFactory is BoringOwnableUpgradeable, IPYieldContract
|
|
|
85
97
|
external
|
|
86
98
|
returns (address PT, address YT)
|
|
87
99
|
{
|
|
88
|
-
|
|
100
|
+
if (MiniHelpers.isTimeInThePast(expiry) || expiry % expiryDivisor != 0)
|
|
101
|
+
revert Errors.YCFactoryInvalidExpiry();
|
|
89
102
|
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
require(getPT[SCY][expiry] == address(0), "PT already existed");
|
|
103
|
+
if (getPT[SCY][expiry] != address(0)) revert Errors.YCFactoryYieldContractExisted();
|
|
93
104
|
|
|
94
105
|
ISuperComposableYield _SCY = ISuperComposableYield(SCY);
|
|
95
106
|
|
|
96
107
|
(, , uint8 assetDecimals) = _SCY.assetInfo();
|
|
97
108
|
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
type(PendlePrincipalToken).creationCode,
|
|
109
|
+
PT = Create2.deploy(
|
|
110
|
+
0,
|
|
101
111
|
bytes32(block.chainid),
|
|
102
|
-
abi.
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
112
|
+
abi.encodePacked(
|
|
113
|
+
type(PendlePrincipalToken).creationCode,
|
|
114
|
+
abi.encode(
|
|
115
|
+
SCY,
|
|
116
|
+
PT_PREFIX.concat(_SCY.name(), expiry, " "),
|
|
117
|
+
PT_PREFIX.concat(_SCY.symbol(), expiry, "-"),
|
|
118
|
+
assetDecimals,
|
|
119
|
+
expiry
|
|
120
|
+
)
|
|
108
121
|
)
|
|
109
122
|
);
|
|
110
123
|
|
|
111
|
-
YT =
|
|
112
|
-
|
|
124
|
+
YT = BaseSplitCodeFactory._create2(
|
|
125
|
+
0,
|
|
113
126
|
bytes32(block.chainid),
|
|
114
127
|
abi.encode(
|
|
115
128
|
SCY,
|
|
@@ -118,7 +131,11 @@ contract PendleYieldContractFactory is BoringOwnableUpgradeable, IPYieldContract
|
|
|
118
131
|
YT_PREFIX.concat(_SCY.symbol(), expiry, "-"),
|
|
119
132
|
assetDecimals,
|
|
120
133
|
expiry
|
|
121
|
-
)
|
|
134
|
+
),
|
|
135
|
+
ytCreationCodeContractA,
|
|
136
|
+
ytCreationCodeSizeA,
|
|
137
|
+
ytCreationCodeContractB,
|
|
138
|
+
ytCreationCodeSizeB
|
|
122
139
|
);
|
|
123
140
|
|
|
124
141
|
IPPrincipalToken(PT).initialize(YT);
|
|
@@ -132,7 +149,6 @@ contract PendleYieldContractFactory is BoringOwnableUpgradeable, IPYieldContract
|
|
|
132
149
|
}
|
|
133
150
|
|
|
134
151
|
function setExpiryDivisor(uint96 newExpiryDivisor) public onlyOwner {
|
|
135
|
-
require(newExpiryDivisor != 0, "zero value");
|
|
136
152
|
expiryDivisor = newExpiryDivisor;
|
|
137
153
|
emit SetExpiryDivisor(newExpiryDivisor);
|
|
138
154
|
}
|
|
@@ -148,7 +164,6 @@ contract PendleYieldContractFactory is BoringOwnableUpgradeable, IPYieldContract
|
|
|
148
164
|
}
|
|
149
165
|
|
|
150
166
|
function setTreasury(address newTreasury) public onlyOwner {
|
|
151
|
-
require(newTreasury != address(0), "zero address");
|
|
152
167
|
treasury = newTreasury;
|
|
153
168
|
emit SetTreasury(newTreasury);
|
|
154
169
|
}
|