@pendle/core-v2 0.21.0-testnet → 1.0.1-mainnet
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/artifacts/contracts/LiquidityMining/CrossChainMsg/PendleMsgReceiveEndpointUpg.sol/PendleMsgReceiveEndpointUpg.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/CrossChainMsg/PendleMsgReceiveEndpointUpg.sol/PendleMsgReceiveEndpointUpg.json +2 -2
- package/build/artifacts/contracts/LiquidityMining/CrossChainMsg/PendleMsgReceiverAppUpg.sol/PendleMsgReceiverAppUpg.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/CrossChainMsg/PendleMsgSendEndpointUpg.sol/PendleMsgSendEndpointUpg.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/CrossChainMsg/PendleMsgSendEndpointUpg.sol/PendleMsgSendEndpointUpg.json +2 -2
- package/build/artifacts/contracts/LiquidityMining/CrossChainMsg/PendleMsgSenderAppUpg.sol/PendleMsgSenderAppUpg.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/CrossChainMsg/libraries/LayerZeroHelper.sol/LayerZeroHelper.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/CrossChainMsg/libraries/LayerZeroHelper.sol/LayerZeroHelper.json +2 -2
- package/build/artifacts/contracts/LiquidityMining/FeeDistributor/EpochResultManager.sol/EpochResultManager.dbg.json +4 -0
- package/build/artifacts/contracts/{interfaces/IApeStaking.sol/IApeStaking.json → LiquidityMining/FeeDistributor/EpochResultManager.sol/EpochResultManager.json} +52 -70
- package/build/artifacts/contracts/LiquidityMining/FeeDistributor/PendleFeeDistributor.sol/PendleFeeDistributor.dbg.json +4 -0
- package/build/artifacts/contracts/LiquidityMining/FeeDistributor/PendleFeeDistributor.sol/PendleFeeDistributor.json +310 -0
- package/build/artifacts/contracts/LiquidityMining/FeeDistributor/PendleFeeDistributorFactory.sol/PendleFeeDistributorFactory.dbg.json +4 -0
- package/build/artifacts/contracts/LiquidityMining/FeeDistributor/PendleFeeDistributorFactory.sol/PendleFeeDistributorFactory.json +389 -0
- package/build/artifacts/contracts/LiquidityMining/GaugeController/PendleGaugeControllerBaseUpg.sol/PendleGaugeControllerBaseUpg.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/GaugeController/PendleGaugeControllerMainchainUpg.sol/PendleGaugeControllerMainchainUpg.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/GaugeController/PendleGaugeControllerMainchainUpg.sol/PendleGaugeControllerMainchainUpg.json +2 -2
- package/build/artifacts/contracts/LiquidityMining/GaugeController/PendleGaugeControllerSidechainUpg.sol/PendleGaugeControllerSidechainUpg.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/GaugeController/PendleGaugeControllerSidechainUpg.sol/PendleGaugeControllerSidechainUpg.json +2 -2
- package/build/artifacts/contracts/LiquidityMining/VotingController/PendleVotingControllerUpg.sol/PendleVotingControllerUpg.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/VotingController/PendleVotingControllerUpg.sol/PendleVotingControllerUpg.json +2 -2
- package/build/artifacts/contracts/LiquidityMining/VotingController/VotingControllerStorageUpg.sol/VotingControllerStorageUpg.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/VotingEscrow/VotingEscrowPendleMainchain.sol/VotingEscrowPendleMainchain.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/VotingEscrow/VotingEscrowPendleMainchain.sol/VotingEscrowPendleMainchain.json +2 -2
- package/build/artifacts/contracts/LiquidityMining/VotingEscrow/VotingEscrowPendleSidechain.sol/VotingEscrowPendleSidechain.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/VotingEscrow/VotingEscrowPendleSidechain.sol/VotingEscrowPendleSidechain.json +2 -2
- package/build/artifacts/contracts/LiquidityMining/VotingEscrow/VotingEscrowTokenBase.sol/VotingEscrowTokenBase.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/libraries/VeBalanceLib.sol/VeBalanceLib.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/libraries/VeBalanceLib.sol/VeBalanceLib.json +2 -2
- package/build/artifacts/contracts/LiquidityMining/libraries/VeHistoryLib.sol/CheckpointHelper.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/libraries/VeHistoryLib.sol/CheckpointHelper.json +2 -2
- package/build/artifacts/contracts/LiquidityMining/libraries/VeHistoryLib.sol/Checkpoints.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/libraries/VeHistoryLib.sol/Checkpoints.json +2 -2
- package/build/artifacts/contracts/core/BulkSeller/BulkSeller.sol/BulkSeller.dbg.json +1 -1
- package/build/artifacts/contracts/core/BulkSeller/BulkSeller.sol/BulkSeller.json +2 -2
- package/build/artifacts/contracts/core/BulkSeller/BulkSellerFactory.sol/BulkSellerFactory.dbg.json +1 -1
- package/build/artifacts/contracts/core/BulkSeller/BulkSellerFactory.sol/BulkSellerFactory.json +2 -2
- package/build/artifacts/contracts/core/BulkSeller/BulkSellerMathCore.sol/BulkSellerMathCore.dbg.json +1 -1
- package/build/artifacts/contracts/core/BulkSeller/BulkSellerMathCore.sol/BulkSellerMathCore.json +2 -2
- package/build/artifacts/contracts/core/Market/MarketMathCore.sol/MarketMathCore.dbg.json +1 -1
- package/build/artifacts/contracts/core/Market/MarketMathCore.sol/MarketMathCore.json +2 -2
- package/build/artifacts/contracts/core/Market/OracleLib.sol/OracleLib.dbg.json +1 -1
- package/build/artifacts/contracts/core/Market/OracleLib.sol/OracleLib.json +2 -2
- package/build/artifacts/contracts/core/Market/PendleGauge.sol/PendleGauge.dbg.json +1 -1
- package/build/artifacts/contracts/core/Market/PendleMarket.sol/PendleMarket.dbg.json +1 -1
- package/build/artifacts/contracts/core/Market/PendleMarket.sol/PendleMarket.json +2 -2
- package/build/artifacts/contracts/core/Market/PendleMarketFactory.sol/PendleMarketFactory.dbg.json +1 -1
- package/build/artifacts/contracts/core/Market/PendleMarketFactory.sol/PendleMarketFactory.json +2 -2
- package/build/artifacts/contracts/core/RewardManager/RewardManager.sol/RewardManager.dbg.json +1 -1
- package/build/artifacts/contracts/core/RewardManager/RewardManagerAbstract.sol/RewardManagerAbstract.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/SYBase.sol/SYBase.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/SYBaseWithRewards.sol/SYBaseWithRewards.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BenQi/PendleQiTokenHelper.sol/PendleQiTokenHelper.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BenQi/PendleQiTokenHelper.sol/PendleQiTokenHelper.json +2 -2
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BenQi/PendleQiTokenSY.sol/PendleQiTokenSY.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BenQi/PendleQiTokenSY.sol/PendleQiTokenSY.json +2 -2
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Convex/PendleCurveFraxUsdcSY.sol/PendleCurveFraxUsdcSY.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Convex/PendleCurveFraxUsdcSY.sol/PendleCurveFraxUsdcSY.json +2 -2
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Convex/PendleCurveUsdd3CrvSY.sol/PendleCurveUsdd3CrvSY.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Convex/PendleCurveUsdd3CrvSY.sol/PendleCurveUsdd3CrvSY.json +2 -2
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Convex/base/PendleConvexLPSY.sol/PendleConvexLPSY.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/PendleLooksStakingSY.sol/PendleLooksStakingSY.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/PendleLooksStakingSY.sol/PendleLooksStakingSY.json +2 -2
- package/build/artifacts/contracts/core/StandardizedYield/implementations/PendleWstEthSY.sol/PendleWstEthSY.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/PendleWstEthSY.sol/PendleWstEthSY.json +2 -2
- package/build/artifacts/contracts/core/YieldContracts/PendlePrincipalToken.sol/PendlePrincipalToken.dbg.json +1 -1
- package/build/artifacts/contracts/core/YieldContracts/PendlePrincipalToken.sol/PendlePrincipalToken.json +2 -2
- package/build/artifacts/contracts/core/YieldContracts/PendleYieldContractFactory.sol/PendleYieldContractFactory.dbg.json +1 -1
- package/build/artifacts/contracts/core/YieldContracts/PendleYieldContractFactory.sol/PendleYieldContractFactory.json +2 -2
- package/build/artifacts/contracts/core/YieldContracts/PendleYieldToken.sol/PendleYieldToken.dbg.json +1 -1
- package/build/artifacts/contracts/core/YieldContracts/PendleYieldToken.sol/PendleYieldToken.json +2 -2
- package/build/artifacts/contracts/core/libraries/ArrayLib.sol/ArrayLib.dbg.json +1 -1
- package/build/artifacts/contracts/core/libraries/ArrayLib.sol/ArrayLib.json +2 -2
- package/build/artifacts/contracts/core/libraries/Errors.sol/Errors.dbg.json +1 -1
- package/build/artifacts/contracts/core/libraries/Errors.sol/Errors.json +5 -134
- package/build/artifacts/contracts/interfaces/ConvexCurve/IRewards.sol/IRewards.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/ConvexCurve/IRewards.sol/IRewards.json +0 -18
- package/build/artifacts/contracts/interfaces/IPActionAddRemoveLiq.sol/IPActionAddRemoveLiq.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPActionMintRedeem.sol/IPActionMintRedeem.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPActionSwapPT.sol/IPActionSwapPT.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPActionSwapPTYT.sol/IPActionSwapPTYT.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPActionSwapYT.sol/IPActionSwapYT.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPAllAction.sol/IPAllAction.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPBulkSeller.sol/IPBulkSeller.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPFeeDistributor.sol/IPFeeDistributor.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPFeeDistributor.sol/IPFeeDistributor.json +32 -43
- package/build/artifacts/contracts/interfaces/IPFeeDistributorFactory.sol/IPFeeDistributorFactory.dbg.json +4 -0
- package/build/artifacts/contracts/interfaces/{Balancer/IGauge.sol/IGauge.json → IPFeeDistributorFactory.sol/IPFeeDistributorFactory.json} +33 -18
- package/build/artifacts/contracts/interfaces/IPMarket.sol/IPMarket.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPVotingController.sol/IPVotingController.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPVotingEscrowMainchain.sol/IPVotingEscrowMainchain.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/BulkSellerOffchain.sol/BulkSellerOffchain.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/BulkSellerOffchain.sol/BulkSellerOffchain.json +2 -2
- package/build/artifacts/contracts/offchain-helpers/MarketMathStatic.sol/MarketMathStatic.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/MarketMathStatic.sol/MarketMathStatic.json +2 -42
- package/build/artifacts/contracts/offchain-helpers/RouterStatic.sol/RouterStatic.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/RouterStatic.sol/RouterStatic.json +100 -73
- package/build/artifacts/contracts/router/ActionAddRemoveLiq.sol/ActionAddRemoveLiq.dbg.json +1 -1
- package/build/artifacts/contracts/router/ActionAddRemoveLiq.sol/ActionAddRemoveLiq.json +2 -2
- package/build/artifacts/contracts/router/ActionCallback.sol/ActionCallback.dbg.json +1 -1
- package/build/artifacts/contracts/router/ActionCallback.sol/ActionCallback.json +2 -2
- package/build/artifacts/contracts/router/ActionMintRedeem.sol/ActionMintRedeem.dbg.json +1 -1
- package/build/artifacts/contracts/router/ActionMintRedeem.sol/ActionMintRedeem.json +2 -2
- 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 +2 -2
- package/build/artifacts/contracts/router/ActionSwapPTYT.sol/ActionSwapPTYT.dbg.json +1 -1
- package/build/artifacts/contracts/router/ActionSwapPTYT.sol/ActionSwapPTYT.json +2 -2
- package/build/artifacts/contracts/router/ActionSwapYT.sol/ActionSwapYT.dbg.json +1 -1
- package/build/artifacts/contracts/router/ActionSwapYT.sol/ActionSwapYT.json +2 -2
- 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/MarketApproxLib.sol/MarketApproxPtInLib.dbg.json +1 -1
- package/build/artifacts/contracts/router/base/MarketApproxLib.sol/MarketApproxPtInLib.json +2 -2
- package/build/artifacts/contracts/router/base/MarketApproxLib.sol/MarketApproxPtOutLib.dbg.json +1 -1
- package/build/artifacts/contracts/router/base/MarketApproxLib.sol/MarketApproxPtOutLib.json +2 -2
- package/build/artifacts/contracts/router/kyberswap/AggregationRouterHelper.sol/AggregationRouterHelper.dbg.json +1 -1
- package/build/artifacts/contracts/router/kyberswap/AggregationRouterHelper.sol/AggregationRouterHelper.json +2 -2
- package/build/artifacts/contracts/router/kyberswap/IAggregatorRouterHelper.sol/IAggregationRouterHelper.dbg.json +1 -1
- package/build/artifacts/contracts/router/kyberswap/IMultihopRouter.sol/IMultihopRouter.dbg.json +4 -0
- package/build/artifacts/contracts/router/kyberswap/IMultihopRouter.sol/IMultihopRouter.json +136 -0
- package/build/artifacts/contracts/router/kyberswap/KyberSwapHelper.sol/KyberSwapHelper.dbg.json +1 -1
- package/contracts/LiquidityMining/CrossChainMsg/libraries/LayerZeroHelper.sol +9 -7
- package/contracts/LiquidityMining/FeeDistributor/EpochResultManager.sol +159 -0
- package/contracts/LiquidityMining/FeeDistributor/PendleFeeDistributor.sol +99 -0
- package/contracts/LiquidityMining/FeeDistributor/PendleFeeDistributorFactory.sol +70 -0
- package/contracts/core/BulkSeller/BulkSeller.sol +1 -1
- package/contracts/core/StandardizedYield/SYBaseWithRewards.sol +3 -1
- package/contracts/core/libraries/ArrayLib.sol +0 -12
- package/contracts/core/libraries/Errors.sol +2 -15
- package/contracts/interfaces/ConvexCurve/IRewards.sol +0 -5
- package/contracts/interfaces/IPFeeDistributor.sol +10 -12
- package/contracts/interfaces/IPFeeDistributorFactory.sol +14 -0
- package/contracts/offchain-helpers/MarketMathStatic.sol +1 -1
- package/contracts/router/kyberswap/AggregationRouterHelper.sol +192 -194
- package/contracts/router/kyberswap/IMultihopRouter.sol +139 -0
- package/deployments/1-core.json +29 -0
- package/deployments/1-markets/FRAXUSDC-CURVELP-MARCH30.json +11 -0
- package/deployments/1-markets/LOOKS-STAKING-MARCH30.json +10 -0
- package/deployments/1-markets/STETH-JUNE29.json +10 -0
- package/deployments/1-markets/STETH-MARCH30.json +10 -0
- package/package.json +6 -6
- package/typechain-types/IApeStaking.ts +0 -31
- package/typechain-types/IPFeeDistributor.ts +78 -61
- package/typechain-types/IPFeeDistributorFactory.ts +139 -53
- package/typechain-types/IRewards.ts +5 -35
- package/typechain-types/MarketMathStatic.ts +0 -49
- package/typechain-types/PendleApeStakingSY.ts +204 -88
- package/typechain-types/PendleFeeDistributor.ts +117 -409
- package/typechain-types/RouterStatic.ts +49 -0
- package/typechain-types/factories/ActionAddRemoveLiq__factory.ts +1 -1
- package/typechain-types/factories/ActionCallback__factory.ts +1 -1
- package/typechain-types/factories/ActionMintRedeem__factory.ts +1 -1
- package/typechain-types/factories/ActionMisc__factory.ts +1 -1
- package/typechain-types/factories/ActionSwapPTYT__factory.ts +1 -1
- package/typechain-types/factories/ActionSwapPT__factory.ts +1 -1
- package/typechain-types/factories/ActionSwapYT__factory.ts +1 -1
- package/typechain-types/factories/AggregationRouterHelper__factory.ts +1 -1
- package/typechain-types/factories/BulkSellerFactory__factory.ts +1 -1
- package/typechain-types/factories/BulkSellerOffchain__factory.ts +1 -1
- package/typechain-types/factories/BulkSeller__factory.ts +1 -1
- package/typechain-types/factories/Errors__factory.ts +4 -133
- package/typechain-types/factories/IApeStaking__factory.ts +0 -34
- package/typechain-types/factories/IPFeeDistributorFactory__factory.ts +34 -25
- package/typechain-types/factories/IPFeeDistributor__factory.ts +31 -42
- package/typechain-types/factories/IRewards__factory.ts +0 -18
- package/typechain-types/factories/MarketMathStatic__factory.ts +1 -41
- package/typechain-types/factories/OracleLib__factory.ts +1 -1
- package/typechain-types/factories/PendleApeStakingSY__factory.ts +141 -57
- package/typechain-types/factories/PendleCurveFraxUsdcSY__factory.ts +1 -1
- package/typechain-types/factories/PendleCurveUsdd3CrvSY__factory.ts +1 -1
- package/typechain-types/factories/PendleFeeDistributorFactory__factory.ts +1 -1
- package/typechain-types/factories/PendleFeeDistributor__factory.ts +66 -341
- package/typechain-types/factories/PendleGaugeControllerMainchainUpg__factory.ts +1 -1
- package/typechain-types/factories/PendleGaugeControllerSidechainUpg__factory.ts +1 -1
- package/typechain-types/factories/PendleLooksStakingSY__factory.ts +1 -1
- package/typechain-types/factories/PendleMarketFactory__factory.ts +1 -1
- package/typechain-types/factories/PendleMarket__factory.ts +1 -1
- package/typechain-types/factories/PendleMsgReceiveEndpointUpg__factory.ts +1 -1
- package/typechain-types/factories/PendleMsgSendEndpointUpg__factory.ts +1 -1
- package/typechain-types/factories/PendlePrincipalToken__factory.ts +1 -1
- package/typechain-types/factories/PendleQiTokenHelper__factory.ts +1 -1
- package/typechain-types/factories/PendleQiTokenSY__factory.ts +1 -1
- package/typechain-types/factories/PendleRouter__factory.ts +1 -1
- package/typechain-types/factories/PendleVotingControllerUpg__factory.ts +1 -1
- package/typechain-types/factories/PendleWstEthSY__factory.ts +1 -1
- package/typechain-types/factories/PendleYieldContractFactory__factory.ts +1 -1
- package/typechain-types/factories/PendleYieldToken__factory.ts +1 -1
- package/typechain-types/factories/RouterStatic__factory.ts +41 -18
- package/typechain-types/factories/VotingEscrowPendleMainchain__factory.ts +1 -1
- package/typechain-types/factories/VotingEscrowPendleSidechain__factory.ts +1 -1
- package/typechain-types/hardhat.d.ts +40 -301
- package/typechain-types/index.ts +10 -68
- package/build/artifacts/contracts/LiquidityMining/VeDistributor/PendleFeeDistributor.sol/PendleFeeDistributor.dbg.json +0 -4
- package/build/artifacts/contracts/LiquidityMining/VeDistributor/PendleFeeDistributor.sol/PendleFeeDistributor.json +0 -592
- package/build/artifacts/contracts/core/StandardizedYield/StEthHelper.sol/StEthHelper.dbg.json +0 -4
- package/build/artifacts/contracts/core/StandardizedYield/StEthHelper.sol/StEthHelper.json +0 -10
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Ape/sAPE.sol/sAPE.dbg.json +0 -4
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Ape/sAPE.sol/sAPE.json +0 -1075
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/PendleAura3EthSY.sol/PendleAura3EthSY.dbg.json +0 -4
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/PendleAura3EthSY.sol/PendleAura3EthSY.json +0 -1257
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/PendleAuraCbethWstethSY.sol/PendleAuraCbethWstethSY.dbg.json +0 -4
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/PendleAuraCbethWstethSY.sol/PendleAuraCbethWstethSY.json +0 -1244
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/PendleAuraWethRethSY.sol/PendleAuraWethRethSY.dbg.json +0 -4
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/PendleAuraWethRethSY.sol/PendleAuraWethRethSY.json +0 -1218
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/PendleAuraWethWstethSY.sol/PendleAuraWethWstethSY.dbg.json +0 -4
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/PendleAuraWethWstethSY.sol/PendleAuraWethWstethSY.json +0 -1192
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/base/ComposableStable/ComposableStableMath.sol/ComposableStableMath.dbg.json +0 -4
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/base/ComposableStable/ComposableStableMath.sol/ComposableStableMath.json +0 -10
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/base/ComposableStable/ComposableStablePreview.sol/ComposableStablePreview.dbg.json +0 -4
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/base/ComposableStable/ComposableStablePreview.sol/ComposableStablePreview.json +0 -133
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/base/FixedPoint.sol/FixedPoint.dbg.json +0 -4
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/base/FixedPoint.sol/FixedPoint.json +0 -10
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/base/MetaStable/MetaStableMath.sol/MetaStableMath.dbg.json +0 -4
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/base/MetaStable/MetaStableMath.sol/MetaStableMath.json +0 -40
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/base/MetaStable/MetaStablePreview.sol/MetaStablePreview.dbg.json +0 -4
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/base/MetaStable/MetaStablePreview.sol/MetaStablePreview.json +0 -322
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/base/PendleAuraBalancerStableLPSY.sol/PendleAuraBalancerStableLPSY.dbg.json +0 -4
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/base/PendleAuraBalancerStableLPSY.sol/PendleAuraBalancerStableLPSY.json +0 -1171
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/base/StablePoolUserData.sol/StablePoolUserData.dbg.json +0 -4
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/base/StablePoolUserData.sol/StablePoolUserData.json +0 -10
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/base/StablePreviewBase.sol/StablePreviewBase.dbg.json +0 -4
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/base/StablePreviewBase.sol/StablePreviewBase.json +0 -133
- package/build/artifacts/contracts/interfaces/Balancer/IAsset.sol/IAsset.dbg.json +0 -4
- package/build/artifacts/contracts/interfaces/Balancer/IAsset.sol/IAsset.json +0 -10
- package/build/artifacts/contracts/interfaces/Balancer/IBalancerFees.sol/IBalancerFees.dbg.json +0 -4
- package/build/artifacts/contracts/interfaces/Balancer/IBalancerFees.sol/IBalancerFees.json +0 -24
- package/build/artifacts/contracts/interfaces/Balancer/IBalancerStablePreview.sol/IBalancerStablePreview.dbg.json +0 -4
- package/build/artifacts/contracts/interfaces/Balancer/IBalancerStablePreview.sol/IBalancerStablePreview.json +0 -133
- package/build/artifacts/contracts/interfaces/Balancer/IBasePool.sol/IBasePool.dbg.json +0 -4
- package/build/artifacts/contracts/interfaces/Balancer/IBasePool.sol/IBasePool.json +0 -328
- package/build/artifacts/contracts/interfaces/Balancer/IComposableStable.sol/IComposableStable.dbg.json +0 -4
- package/build/artifacts/contracts/interfaces/Balancer/IComposableStable.sol/IComposableStable.json +0 -467
- package/build/artifacts/contracts/interfaces/Balancer/IGauge.sol/IGauge.dbg.json +0 -4
- package/build/artifacts/contracts/interfaces/Balancer/ILiquidityGaugeFactory.sol/ILiquidityGaugeFactory.dbg.json +0 -4
- package/build/artifacts/contracts/interfaces/Balancer/ILiquidityGaugeFactory.sol/ILiquidityGaugeFactory.json +0 -30
- package/build/artifacts/contracts/interfaces/Balancer/IMetaStablePool.sol/IMetaStablePool.dbg.json +0 -4
- package/build/artifacts/contracts/interfaces/Balancer/IMetaStablePool.sol/IMetaStablePool.json +0 -398
- package/build/artifacts/contracts/interfaces/Balancer/IRateProvider.sol/IRateProvider.dbg.json +0 -4
- package/build/artifacts/contracts/interfaces/Balancer/IRateProvider.sol/IRateProvider.json +0 -24
- package/build/artifacts/contracts/interfaces/Balancer/IVault.sol/IVault.dbg.json +0 -4
- package/build/artifacts/contracts/interfaces/Balancer/IVault.sol/IVault.json +0 -278
- package/build/artifacts/contracts/interfaces/IApeStaking.sol/IApeStaking.dbg.json +0 -4
- package/build/artifacts/contracts/offchain-helpers/Multicall2.sol/Multicall2.dbg.json +0 -4
- package/build/artifacts/contracts/offchain-helpers/Multicall2.sol/Multicall2.json +0 -322
- package/build/artifacts/contracts/offchain-helpers/PendleMulticall.sol/PendleMulticall.dbg.json +0 -4
- package/build/artifacts/contracts/offchain-helpers/PendleMulticall.sol/PendleMulticall.json +0 -47
- package/build/artifacts/contracts/router/kyberswap/ScaleDataHelperEthereum1.sol/ScaleDataHelperEthereum1.dbg.json +0 -4
- package/build/artifacts/contracts/router/kyberswap/ScaleDataHelperEthereum1.sol/ScaleDataHelperEthereum1.json +0 -10
- package/build/artifacts/contracts/router/kyberswap/interfaces/IAggregationExecutor.sol/IAggregationExecutor.dbg.json +0 -4
- package/build/artifacts/contracts/router/kyberswap/interfaces/IAggregationExecutor.sol/IAggregationExecutor.json +0 -65
- package/build/artifacts/contracts/router/kyberswap/interfaces/IExecutorHelperEthereum1.sol/IExecutorHelperEthereum1.dbg.json +0 -4
- package/build/artifacts/contracts/router/kyberswap/interfaces/IExecutorHelperEthereum1.sol/IExecutorHelperEthereum1.json +0 -388
- package/build/artifacts/contracts/router/kyberswap/interfaces/IHashflow.sol/IHashflow.dbg.json +0 -4
- package/build/artifacts/contracts/router/kyberswap/interfaces/IHashflow.sol/IHashflow.json +0 -101
- package/build/artifacts/contracts/router/kyberswap/interfaces/IMetaAggregationRouter.sol/IMetaAggregationRouter.dbg.json +0 -4
- package/build/artifacts/contracts/router/kyberswap/interfaces/IMetaAggregationRouter.sol/IMetaAggregationRouter.json +0 -183
- package/build/artifacts/contracts/router/kyberswap/interfaces/IMetaAggregationRouterV2.sol/IMetaAggregationRouterV2.dbg.json +0 -4
- package/build/artifacts/contracts/router/kyberswap/interfaces/IMetaAggregationRouterV2.sol/IMetaAggregationRouterV2.json +0 -215
- package/contracts/LiquidityMining/VeDistributor/PendleFeeDistributor.sol +0 -224
- package/contracts/core/StandardizedYield/StEthHelper.sol +0 -71
- package/contracts/core/StandardizedYield/implementations/Ape/sAPE.sol +0 -197
- package/contracts/core/StandardizedYield/implementations/BalancerStable/PendleAura3EthSY.sol +0 -170
- package/contracts/core/StandardizedYield/implementations/BalancerStable/PendleAuraCbethWstethSY.sol +0 -162
- package/contracts/core/StandardizedYield/implementations/BalancerStable/PendleAuraWethRethSY.sol +0 -134
- package/contracts/core/StandardizedYield/implementations/BalancerStable/PendleAuraWethWstethSY.sol +0 -154
- package/contracts/core/StandardizedYield/implementations/BalancerStable/base/ComposableStable/ComposableStableMath.sol +0 -289
- package/contracts/core/StandardizedYield/implementations/BalancerStable/base/ComposableStable/ComposableStablePreview.sol +0 -618
- package/contracts/core/StandardizedYield/implementations/BalancerStable/base/FixedPoint.sol +0 -68
- package/contracts/core/StandardizedYield/implementations/BalancerStable/base/MetaStable/MetaStableMath.sol +0 -322
- package/contracts/core/StandardizedYield/implementations/BalancerStable/base/MetaStable/MetaStablePreview.sol +0 -390
- package/contracts/core/StandardizedYield/implementations/BalancerStable/base/PendleAuraBalancerStableLPSY.sol +0 -329
- package/contracts/core/StandardizedYield/implementations/BalancerStable/base/StablePoolUserData.sol +0 -30
- package/contracts/core/StandardizedYield/implementations/BalancerStable/base/StablePreviewBase.sol +0 -189
- package/contracts/interfaces/Balancer/IAsset.sol +0 -4
- package/contracts/interfaces/Balancer/IBalancerFees.sol +0 -6
- package/contracts/interfaces/Balancer/IBalancerStablePreview.sol +0 -22
- package/contracts/interfaces/Balancer/IBasePool.sol +0 -30
- package/contracts/interfaces/Balancer/IComposableStable.sol +0 -39
- package/contracts/interfaces/Balancer/IGauge.sol +0 -10
- package/contracts/interfaces/Balancer/ILiquidityGaugeFactory.sol +0 -6
- package/contracts/interfaces/Balancer/IMetaStablePool.sol +0 -31
- package/contracts/interfaces/Balancer/IRateProvider.sol +0 -6
- package/contracts/interfaces/Balancer/IVault.sol +0 -78
- package/contracts/interfaces/IApeStaking.sol +0 -30
- package/contracts/offchain-helpers/Multicall2.sol +0 -103
- package/contracts/offchain-helpers/PendleMulticall.sol +0 -26
- package/contracts/router/kyberswap/ScaleDataHelperEthereum1.sol +0 -147
- package/contracts/router/kyberswap/interfaces/IAggregationExecutor.sol +0 -17
- package/contracts/router/kyberswap/interfaces/IExecutorHelperEthereum1.sol +0 -191
- package/contracts/router/kyberswap/interfaces/IHashflow.sol +0 -30
- package/contracts/router/kyberswap/interfaces/IMetaAggregationRouter.sol +0 -33
- package/contracts/router/kyberswap/interfaces/IMetaAggregationRouterV2.sol +0 -42
- package/deployments/43113-core.json +0 -29
- package/deployments/43113-helper.json +0 -4
- package/deployments/43113-markets/APE-30-MARCH.json +0 -10
- package/deployments/43113-markets/USDC-FEB-2ND.json +0 -10
- package/deployments/43113-markets/USDC-FEB-4TH.json +0 -10
- package/deployments/43113-markets/WETH-FEB-2ND.json +0 -11
- package/deployments/43113-markets/WETH-FEB-4TH.json +0 -11
- package/deployments/43113-testenv.json +0 -22
- package/deployments/80001-core.json +0 -28
- package/deployments/80001-helper.json +0 -4
- package/deployments/80001-markets/USDC-DEC-8TH.json +0 -10
- package/deployments/80001-markets/USDC-FEB-4TH.json +0 -10
- package/deployments/80001-markets/WETH-FEB-4TH.json +0 -11
- package/deployments/80001-testenv.json +0 -22
- package/typechain-types/BribeDistributor.ts +0 -363
- package/typechain-types/ComposableStablePreview.ts +0 -217
- package/typechain-types/DistributorBase.ts +0 -363
- package/typechain-types/FeeDistributor.ts +0 -416
- package/typechain-types/GMXPreviewHelper.ts +0 -134
- package/typechain-types/I1inchAggregationRouterV5.ts +0 -257
- package/typechain-types/IAggregationExecutor.ts +0 -182
- package/typechain-types/IBalancerFees.ts +0 -89
- package/typechain-types/IBalancerStablePreview.ts +0 -217
- package/typechain-types/IBasePool.ts +0 -482
- package/typechain-types/IComposableStable.ts +0 -730
- package/typechain-types/IExecutorHelperEthereum1.ts +0 -643
- package/typechain-types/IGMXVault.ts +0 -494
- package/typechain-types/IGauge.ts +0 -160
- package/typechain-types/IGlpManager.ts +0 -115
- package/typechain-types/IHashflow.ts +0 -159
- package/typechain-types/IKyberSwapAggregationRouterHelper.ts +0 -109
- package/typechain-types/ILiquidityGaugeFactory.ts +0 -99
- package/typechain-types/IMetaAggregationRouter.ts +0 -213
- package/typechain-types/IMetaAggregationRouterV2.ts +0 -221
- package/typechain-types/IMetaStablePool.ts +0 -619
- package/typechain-types/IMultihopRouterEthereum.ts +0 -209
- package/typechain-types/IPYieldTokenV2.ts +0 -915
- package/typechain-types/IRateProvider.ts +0 -81
- package/typechain-types/IRewardRouterV2.ts +0 -303
- package/typechain-types/ISwapAggregator.ts +0 -124
- package/typechain-types/IVault.ts +0 -410
- package/typechain-types/IVaultPriceFeed.ts +0 -114
- package/typechain-types/InterestManagerYTV2.ts +0 -124
- package/typechain-types/MetaStableMath.ts +0 -113
- package/typechain-types/MetaStablePreview.ts +0 -501
- package/typechain-types/Multicall2.ts +0 -437
- package/typechain-types/PendleAura3EthSY.ts +0 -1600
- package/typechain-types/PendleAuraBalancerStableLPSY.ts +0 -1523
- package/typechain-types/PendleAuraCbethWstethSY.ts +0 -1587
- package/typechain-types/PendleAuraWethRethSY.ts +0 -1549
- package/typechain-types/PendleAuraWethWstethSY.ts +0 -1523
- package/typechain-types/PendleGlpSY.ts +0 -1449
- package/typechain-types/PendleMulticall.ts +0 -110
- package/typechain-types/PendlePrincipalTokenV2.ts +0 -614
- package/typechain-types/PendleYieldContractFactoryV2.ts +0 -801
- package/typechain-types/PendleYieldTokenV2.ts +0 -1304
- package/typechain-types/SAPE.ts +0 -1395
- package/typechain-types/StEthHelper.ts +0 -107
- package/typechain-types/StablePreviewBase.ts +0 -217
- package/typechain-types/SwapAggregator.ts +0 -406
- package/typechain-types/factories/BribeDistributor__factory.ts +0 -303
- package/typechain-types/factories/ComposableStablePreview__factory.ts +0 -190
- package/typechain-types/factories/DistributorBase__factory.ts +0 -249
- package/typechain-types/factories/FeeDistributor__factory.ts +0 -339
- package/typechain-types/factories/GMXPreviewHelper__factory.ts +0 -78
- package/typechain-types/factories/I1inchAggregationRouterV5__factory.ts +0 -179
- package/typechain-types/factories/IAggregationExecutor__factory.ts +0 -84
- package/typechain-types/factories/IBalancerFees__factory.ts +0 -36
- package/typechain-types/factories/IBalancerStablePreview__factory.ts +0 -152
- package/typechain-types/factories/IBasePool__factory.ts +0 -340
- package/typechain-types/factories/IComposableStable__factory.ts +0 -482
- package/typechain-types/factories/IExecutorHelperEthereum1__factory.ts +0 -407
- package/typechain-types/factories/IGMXVault__factory.ts +0 -320
- package/typechain-types/factories/IGauge__factory.ts +0 -70
- package/typechain-types/factories/IGlpManager__factory.ts +0 -55
- package/typechain-types/factories/IHashflow__factory.ts +0 -113
- package/typechain-types/factories/IKyberSwapAggregationRouterHelper__factory.ts +0 -56
- package/typechain-types/factories/ILiquidityGaugeFactory__factory.ts +0 -49
- package/typechain-types/factories/IMetaAggregationRouterV2__factory.ts +0 -234
- package/typechain-types/factories/IMetaAggregationRouter__factory.ts +0 -202
- package/typechain-types/factories/IMetaStablePool__factory.ts +0 -413
- package/typechain-types/factories/IMultihopRouterEthereum__factory.ts +0 -155
- package/typechain-types/factories/IPYieldTokenV2__factory.ts +0 -702
- package/typechain-types/factories/IRateProvider__factory.ts +0 -36
- package/typechain-types/factories/IRewardRouterV2__factory.ts +0 -180
- package/typechain-types/factories/ISwapAggregator__factory.ts +0 -66
- package/typechain-types/factories/IVaultPriceFeed__factory.ts +0 -60
- package/typechain-types/factories/IVault__factory.ts +0 -287
- package/typechain-types/factories/InterestManagerYTV2__factory.ts +0 -63
- package/typechain-types/factories/MetaStableMath__factory.ts +0 -93
- package/typechain-types/factories/MetaStablePreview__factory.ts +0 -375
- package/typechain-types/factories/Multicall2__factory.ts +0 -372
- package/typechain-types/factories/PendleAura3EthSY__factory.ts +0 -1326
- package/typechain-types/factories/PendleAuraBalancerStableLPSY__factory.ts +0 -1190
- package/typechain-types/factories/PendleAuraCbethWstethSY__factory.ts +0 -1317
- package/typechain-types/factories/PendleAuraWethRethSY__factory.ts +0 -1291
- package/typechain-types/factories/PendleAuraWethWstethSY__factory.ts +0 -1265
- package/typechain-types/factories/PendleGlpSY__factory.ts +0 -1255
- package/typechain-types/factories/PendleMulticall__factory.ts +0 -100
- package/typechain-types/factories/PendlePrincipalTokenV2__factory.ts +0 -564
- package/typechain-types/factories/PendleYieldContractFactoryV2__factory.ts +0 -674
- package/typechain-types/factories/PendleYieldTokenV2__factory.ts +0 -1122
- package/typechain-types/factories/SAPE__factory.ts +0 -1142
- package/typechain-types/factories/StEthHelper__factory.ts +0 -62
- package/typechain-types/factories/StablePreviewBase__factory.ts +0 -148
- package/typechain-types/factories/SwapAggregator__factory.ts +0 -309
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
2
|
+
pragma solidity 0.8.17;
|
|
3
|
+
|
|
4
|
+
import "../../core/libraries/math/Math.sol";
|
|
5
|
+
import "../../core/libraries/ArrayLib.sol";
|
|
6
|
+
import "../../core/libraries/MiniHelpers.sol";
|
|
7
|
+
import "../../core/libraries/Errors.sol";
|
|
8
|
+
import "../../core/libraries/BoringOwnableUpgradeable.sol";
|
|
9
|
+
|
|
10
|
+
import "../libraries/WeekMath.sol";
|
|
11
|
+
import "../libraries/VeHistoryLib.sol";
|
|
12
|
+
|
|
13
|
+
import "../../interfaces/IPFeeDistributor.sol";
|
|
14
|
+
import "../../interfaces/IPFeeDistributorFactory.sol";
|
|
15
|
+
|
|
16
|
+
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
|
|
17
|
+
|
|
18
|
+
contract PendleFeeDistributor is IPFeeDistributor, BoringOwnableUpgradeable {
|
|
19
|
+
using Math for uint256;
|
|
20
|
+
using SafeERC20 for IERC20;
|
|
21
|
+
using ArrayLib for address[];
|
|
22
|
+
using VeBalanceLib for VeBalance;
|
|
23
|
+
|
|
24
|
+
address public immutable factory;
|
|
25
|
+
address public immutable pool;
|
|
26
|
+
address public immutable rewardToken;
|
|
27
|
+
uint256 public immutable startEpoch;
|
|
28
|
+
|
|
29
|
+
uint256 public lastFinishedEpoch;
|
|
30
|
+
|
|
31
|
+
// [user] => [epoch]
|
|
32
|
+
mapping(address => uint256) public userLastClaimedEpoch;
|
|
33
|
+
|
|
34
|
+
// [epoch] => [incentive]
|
|
35
|
+
mapping(uint256 => uint256) public incentivesForEpoch;
|
|
36
|
+
|
|
37
|
+
constructor(
|
|
38
|
+
address _pool,
|
|
39
|
+
address _rewardToken,
|
|
40
|
+
uint256 _startEpoch
|
|
41
|
+
) initializer {
|
|
42
|
+
pool = _pool;
|
|
43
|
+
factory = msg.sender;
|
|
44
|
+
rewardToken = _rewardToken;
|
|
45
|
+
startEpoch = _startEpoch;
|
|
46
|
+
lastFinishedEpoch = _startEpoch;
|
|
47
|
+
__BoringOwnable_init();
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
function fund(uint256[] calldata rewardsForEpoch) external onlyOwner {
|
|
51
|
+
uint256 epoch = lastFinishedEpoch;
|
|
52
|
+
uint256 totalRewardFunding = 0;
|
|
53
|
+
for (uint256 i = 0; i < rewardsForEpoch.length; ++i) {
|
|
54
|
+
epoch += WeekMath.WEEK;
|
|
55
|
+
uint256 incentive = rewardsForEpoch[i];
|
|
56
|
+
|
|
57
|
+
incentivesForEpoch[epoch] += incentive;
|
|
58
|
+
totalRewardFunding += incentive;
|
|
59
|
+
|
|
60
|
+
emit Fund(epoch, incentive);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
if (epoch > WeekMath.getCurrentWeekStart()) revert Errors.FDCantFundFutureEpoch();
|
|
64
|
+
|
|
65
|
+
IERC20(rewardToken).transferFrom(msg.sender, address(this), totalRewardFunding);
|
|
66
|
+
lastFinishedEpoch = epoch;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
function claimReward(address user) external returns (uint256 amountRewardOut) {
|
|
70
|
+
IPFeeDistributorFactory(factory).updateUserShare(user, pool);
|
|
71
|
+
|
|
72
|
+
uint256 finishedEpoch = lastFinishedEpoch;
|
|
73
|
+
uint256 userEpoch = userLastClaimedEpoch[user];
|
|
74
|
+
|
|
75
|
+
if (userEpoch == finishedEpoch) return 0;
|
|
76
|
+
if (userEpoch == 0) userEpoch = startEpoch;
|
|
77
|
+
|
|
78
|
+
while (userEpoch < finishedEpoch) {
|
|
79
|
+
userEpoch += WeekMath.WEEK;
|
|
80
|
+
|
|
81
|
+
uint256 incentive = incentivesForEpoch[userEpoch];
|
|
82
|
+
if (incentive == 0) continue;
|
|
83
|
+
|
|
84
|
+
(uint256 userShare, uint256 totalShare) = IPFeeDistributorFactory(factory)
|
|
85
|
+
.getUserAndTotalSharesAt(user, pool, userEpoch);
|
|
86
|
+
|
|
87
|
+
if (userShare == 0) continue;
|
|
88
|
+
|
|
89
|
+
amountRewardOut += (userShare * incentive) / totalShare;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
userLastClaimedEpoch[user] = finishedEpoch;
|
|
93
|
+
if (amountRewardOut > 0) {
|
|
94
|
+
IERC20(rewardToken).safeTransfer(user, amountRewardOut);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
emit ClaimReward(user, rewardToken, finishedEpoch, amountRewardOut);
|
|
98
|
+
}
|
|
99
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
2
|
+
pragma solidity 0.8.17;
|
|
3
|
+
|
|
4
|
+
import "./PendleFeeDistributor.sol";
|
|
5
|
+
import "./EpochResultManager.sol";
|
|
6
|
+
|
|
7
|
+
import "../../core/libraries/BaseSplitCodeFactory.sol";
|
|
8
|
+
|
|
9
|
+
import "../../interfaces/IBoringOwnableUpgradeable.sol";
|
|
10
|
+
import "../../interfaces/IPFeeDistributorFactory.sol";
|
|
11
|
+
|
|
12
|
+
contract PendleFeeDistributorFactory is BoringOwnableUpgradeable, EpochResultManager {
|
|
13
|
+
using Math for uint256;
|
|
14
|
+
|
|
15
|
+
struct PoolInfo {
|
|
16
|
+
address distributor;
|
|
17
|
+
uint64 startTime;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
address public immutable feeDistributorCreationCodeContractA;
|
|
21
|
+
uint256 public immutable feeDistributorCreationCodeSizeA;
|
|
22
|
+
address public immutable feeDistributorCreationCodeContractB;
|
|
23
|
+
uint256 public immutable feeDistributorCreationCodeSizeB;
|
|
24
|
+
|
|
25
|
+
address public immutable rewardToken;
|
|
26
|
+
uint256 public lastFinishedEpoch;
|
|
27
|
+
mapping(address => PoolInfo) public poolInfos;
|
|
28
|
+
|
|
29
|
+
constructor(
|
|
30
|
+
address _rewardToken,
|
|
31
|
+
address _votingController,
|
|
32
|
+
address _vePendle,
|
|
33
|
+
address _feeDistributorCreationCodeContractA,
|
|
34
|
+
uint256 _feeDistributorCreationCodeSizeA,
|
|
35
|
+
address _feeDistributorCreationCodeContractB,
|
|
36
|
+
uint256 _feeDistributorCreationCodeSizeB
|
|
37
|
+
) EpochResultManager(_votingController, _vePendle) initializer {
|
|
38
|
+
__BoringOwnable_init();
|
|
39
|
+
rewardToken = _rewardToken;
|
|
40
|
+
feeDistributorCreationCodeContractA = _feeDistributorCreationCodeContractA;
|
|
41
|
+
feeDistributorCreationCodeSizeA = _feeDistributorCreationCodeSizeA;
|
|
42
|
+
feeDistributorCreationCodeContractB = _feeDistributorCreationCodeContractB;
|
|
43
|
+
feeDistributorCreationCodeSizeB = _feeDistributorCreationCodeSizeB;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
function createFeeDistributor(address pool, uint64 startTime)
|
|
47
|
+
external
|
|
48
|
+
onlyOwner
|
|
49
|
+
returns (address distributor)
|
|
50
|
+
{
|
|
51
|
+
if (poolInfos[pool].distributor != address(0))
|
|
52
|
+
revert Errors.FDFactoryDistributorAlreadyExisted(pool, poolInfos[pool].distributor);
|
|
53
|
+
|
|
54
|
+
distributor = BaseSplitCodeFactory._create2(
|
|
55
|
+
0,
|
|
56
|
+
bytes32(""),
|
|
57
|
+
abi.encode(pool, rewardToken, uint256(startTime)),
|
|
58
|
+
feeDistributorCreationCodeContractA,
|
|
59
|
+
feeDistributorCreationCodeSizeA,
|
|
60
|
+
feeDistributorCreationCodeContractB,
|
|
61
|
+
feeDistributorCreationCodeSizeB
|
|
62
|
+
);
|
|
63
|
+
IBoringOwnableUpgradeable(distributor).transferOwnership(msg.sender, true, false);
|
|
64
|
+
poolInfos[pool] = PoolInfo({ distributor: distributor, startTime: startTime });
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
function _getPoolStartTime(address pool) internal view virtual override returns (uint64) {
|
|
68
|
+
return poolInfos[pool].startTime;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
@@ -83,7 +83,7 @@ contract BulkSeller is IPBulkSeller, Initializable, TokenHelper, ReentrancyGuard
|
|
|
83
83
|
else {
|
|
84
84
|
uint256 netSyReceived = _selfBalance(SY) - state.totalSy;
|
|
85
85
|
if (netSyReceived < exactSyIn)
|
|
86
|
-
revert Errors.BulkInsufficientSyReceived(
|
|
86
|
+
revert Errors.BulkInsufficientSyReceived(exactSyIn, netSyReceived);
|
|
87
87
|
}
|
|
88
88
|
|
|
89
89
|
netTokenOut = state.swapExactSyForToken(exactSyIn);
|
|
@@ -29,6 +29,7 @@ abstract contract SYBaseWithRewards is SYBase, RewardManager {
|
|
|
29
29
|
virtual
|
|
30
30
|
override
|
|
31
31
|
nonReentrant
|
|
32
|
+
whenNotPaused
|
|
32
33
|
returns (uint256[] memory rewardAmounts)
|
|
33
34
|
{
|
|
34
35
|
_updateAndDistributeRewards(user);
|
|
@@ -73,6 +74,7 @@ abstract contract SYBaseWithRewards is SYBase, RewardManager {
|
|
|
73
74
|
function rewardIndexesCurrent()
|
|
74
75
|
external
|
|
75
76
|
override
|
|
77
|
+
whenNotPaused
|
|
76
78
|
nonReentrant
|
|
77
79
|
returns (uint256[] memory indexes)
|
|
78
80
|
{
|
|
@@ -120,7 +122,7 @@ abstract contract SYBaseWithRewards is SYBase, RewardManager {
|
|
|
120
122
|
address from,
|
|
121
123
|
address to,
|
|
122
124
|
uint256
|
|
123
|
-
) internal virtual override {
|
|
125
|
+
) internal virtual override whenNotPaused {
|
|
124
126
|
_updateAndDistributeRewardsForTwo(from, to);
|
|
125
127
|
}
|
|
126
128
|
}
|
|
@@ -13,18 +13,6 @@ library ArrayLib {
|
|
|
13
13
|
return value;
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
-
/// @notice return index of the element if found, else return uint256.max
|
|
17
|
-
function find(address[] memory array, address element) internal pure returns (uint256 index) {
|
|
18
|
-
uint256 length = array.length;
|
|
19
|
-
for (uint256 i = 0; i < length; ) {
|
|
20
|
-
if (array[i] == element) return i;
|
|
21
|
-
unchecked {
|
|
22
|
-
i++;
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
return type(uint256).max;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
16
|
function contains(address[] memory array, address element) internal pure returns (bool) {
|
|
29
17
|
uint256 length = array.length;
|
|
30
18
|
for (uint256 i = 0; i < length; ) {
|
|
@@ -111,10 +111,6 @@ library Errors {
|
|
|
111
111
|
error SYCurveInvalidPid();
|
|
112
112
|
error SYCurve3crvPoolNotFound();
|
|
113
113
|
|
|
114
|
-
error SYApeDepositAmountTooSmall(uint256 amountDeposited);
|
|
115
|
-
error SYBalancerInvalidPid();
|
|
116
|
-
error SYInvalidRewardToken(address token);
|
|
117
|
-
|
|
118
114
|
// Liquidity Mining
|
|
119
115
|
error VCInactivePool(address pool);
|
|
120
116
|
error VCPoolAlreadyActive(address pool);
|
|
@@ -140,16 +136,8 @@ library Errors {
|
|
|
140
136
|
error ExpiryInThePast(uint256 expiry);
|
|
141
137
|
error ChainNotSupported(uint256 chainId);
|
|
142
138
|
|
|
143
|
-
error
|
|
144
|
-
error
|
|
145
|
-
error FDInvalidPool(address pool);
|
|
146
|
-
error FDPoolAlreadyExists(address pool);
|
|
147
|
-
error FDInvalidNewFinishedEpoch(uint256 oldFinishedEpoch, uint256 newFinishedEpoch);
|
|
148
|
-
error FDInvalidStartEpoch(uint256 startEpoch);
|
|
149
|
-
error FDInvalidWTimeFund(uint256 lastFunded, uint256 wTime);
|
|
150
|
-
error FDFutureFunding(uint256 lastFunded, uint256 currentWTime);
|
|
151
|
-
|
|
152
|
-
error BDInvalidEpoch(uint256 epoch, uint256 startTime);
|
|
139
|
+
error FDCantFundFutureEpoch();
|
|
140
|
+
error FDFactoryDistributorAlreadyExisted(address pool, address distributor);
|
|
153
141
|
|
|
154
142
|
// Cross-Chain
|
|
155
143
|
error MsgNotFromSendEndpoint(uint16 srcChainId, bytes path);
|
|
@@ -163,7 +151,6 @@ library Errors {
|
|
|
163
151
|
error ArrayEmpty();
|
|
164
152
|
error ArrayOutOfBounds();
|
|
165
153
|
error ZeroAddress();
|
|
166
|
-
error FailedToSendEther();
|
|
167
154
|
|
|
168
155
|
error OnlyLayerZeroEndpoint();
|
|
169
156
|
error OnlyYT();
|
|
@@ -2,20 +2,18 @@
|
|
|
2
2
|
pragma solidity 0.8.17;
|
|
3
3
|
|
|
4
4
|
interface IPFeeDistributor {
|
|
5
|
-
event
|
|
5
|
+
event Fund(uint256 indexed epoch, uint256 incentive);
|
|
6
6
|
|
|
7
|
-
event ClaimReward(
|
|
7
|
+
event ClaimReward(
|
|
8
|
+
address indexed user,
|
|
9
|
+
address indexed rewardToken,
|
|
10
|
+
uint256 lastEpochClaimed,
|
|
11
|
+
uint256 totalReward
|
|
12
|
+
);
|
|
8
13
|
|
|
9
|
-
|
|
14
|
+
function fund(uint256[] calldata rewardsForEpoch) external;
|
|
10
15
|
|
|
11
|
-
|
|
12
|
-
uint128 firstUnclaimedWeek;
|
|
13
|
-
uint128 iter;
|
|
14
|
-
}
|
|
16
|
+
function claimReward(address user) external returns (uint256 amountRewardOut);
|
|
15
17
|
|
|
16
|
-
function
|
|
17
|
-
external
|
|
18
|
-
returns (uint256[] memory amountRewardOut);
|
|
19
|
-
|
|
20
|
-
function getAllPools() external view returns (address[] memory);
|
|
18
|
+
function incentivesForEpoch(uint256 epoch) external returns (uint256);
|
|
21
19
|
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
2
|
+
pragma solidity 0.8.17;
|
|
3
|
+
|
|
4
|
+
interface IPFeeDistributorFactory {
|
|
5
|
+
function lastFinishedEpoch() external returns (uint256);
|
|
6
|
+
|
|
7
|
+
function updateUserShare(address user, address pool) external;
|
|
8
|
+
|
|
9
|
+
function getUserAndTotalSharesAt(
|
|
10
|
+
address user,
|
|
11
|
+
address pool,
|
|
12
|
+
uint256 epoch
|
|
13
|
+
) external view returns (uint256 userShare, uint256 totalShare);
|
|
14
|
+
}
|
|
@@ -322,7 +322,7 @@ library MarketMathStatic {
|
|
|
322
322
|
priceImpact = calcPriceImpactYt(market, netYtOut.neg());
|
|
323
323
|
|
|
324
324
|
// Execute swap to calculate exchangeRateAfter
|
|
325
|
-
state.
|
|
325
|
+
state.swapSyForExactPt(index, netYtOut, block.timestamp);
|
|
326
326
|
exchangeRateAfter = _getTradeExchangeRateExcludeFee(market, state);
|
|
327
327
|
}
|
|
328
328
|
|