@pendle/core-v2 0.15.1-mainnet → 0.15.3-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 +15 -2
- package/build/artifacts/contracts/LiquidityMining/CrossChainMsg/PendleMsgReceiverAppUpg.sol/PendleMsgReceiverAppUpg.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/CrossChainMsg/PendleMsgSendEndpointUpg.sol/PendleMsgSendEndpointUpg.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/CrossChainMsg/PendleMsgSendEndpointUpg.sol/PendleMsgSendEndpointUpg.json +15 -2
- package/build/artifacts/contracts/LiquidityMining/CrossChainMsg/PendleMsgSenderAppUpg.sol/PendleMsgSenderAppUpg.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/CrossChainMsg/PendleMsgSenderAppUpg.sol/PendleMsgSenderAppUpg.json +13 -0
- package/build/artifacts/contracts/LiquidityMining/FeeDistributor/EpochResultManager.sol/EpochResultManager.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/FeeDistributor/PendleFeeDistributor.sol/PendleFeeDistributor.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/FeeDistributor/PendleFeeDistributor.sol/PendleFeeDistributor.json +15 -2
- package/build/artifacts/contracts/LiquidityMining/FeeDistributor/PendleFeeDistributorFactory.sol/PendleFeeDistributorFactory.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/FeeDistributor/PendleFeeDistributorFactory.sol/PendleFeeDistributorFactory.json +15 -2
- package/build/artifacts/contracts/LiquidityMining/GaugeController/PendleGaugeControllerBaseUpg.sol/PendleGaugeControllerBaseUpg.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/GaugeController/PendleGaugeControllerBaseUpg.sol/PendleGaugeControllerBaseUpg.json +13 -0
- package/build/artifacts/contracts/LiquidityMining/GaugeController/PendleGaugeControllerMainchainUpg.sol/PendleGaugeControllerMainchainUpg.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/GaugeController/PendleGaugeControllerMainchainUpg.sol/PendleGaugeControllerMainchainUpg.json +15 -2
- package/build/artifacts/contracts/LiquidityMining/GaugeController/PendleGaugeControllerSidechainUpg.sol/PendleGaugeControllerSidechainUpg.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/GaugeController/PendleGaugeControllerSidechainUpg.sol/PendleGaugeControllerSidechainUpg.json +15 -2
- package/build/artifacts/contracts/LiquidityMining/VotingController/PendleVotingControllerUpg.sol/PendleVotingControllerUpg.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/VotingController/PendleVotingControllerUpg.sol/PendleVotingControllerUpg.json +15 -2
- package/build/artifacts/contracts/LiquidityMining/VotingController/VotingControllerStorageUpg.sol/VotingControllerStorageUpg.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/VotingEscrow/VotingEscrowPendleMainchain.sol/VotingEscrowPendleMainchain.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/VotingEscrow/VotingEscrowPendleMainchain.sol/VotingEscrowPendleMainchain.json +15 -2
- package/build/artifacts/contracts/LiquidityMining/VotingEscrow/VotingEscrowPendleSidechain.sol/VotingEscrowPendleSidechain.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/VotingEscrow/VotingEscrowPendleSidechain.sol/VotingEscrowPendleSidechain.json +15 -2
- package/build/artifacts/contracts/LiquidityMining/VotingEscrow/VotingEscrowTokenBase.sol/VotingEscrowTokenBase.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/libraries/VeBalanceLib.sol/VeBalanceLib.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/libraries/VeBalanceLib.sol/VeBalanceLib.json +2 -2
- package/build/artifacts/contracts/LiquidityMining/libraries/VeHistoryLib.sol/CheckpointHelper.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/libraries/VeHistoryLib.sol/CheckpointHelper.json +2 -2
- package/build/artifacts/contracts/LiquidityMining/libraries/VeHistoryLib.sol/Checkpoints.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/libraries/VeHistoryLib.sol/Checkpoints.json +2 -2
- package/build/artifacts/contracts/LiquidityMining/libraries/WeekMath.sol/WeekMath.dbg.json +1 -1
- package/build/artifacts/contracts/core/BulkSeller/BulkSeller.sol/BulkSeller.dbg.json +4 -0
- package/build/artifacts/contracts/core/BulkSeller/BulkSeller.sol/BulkSeller.json +699 -0
- package/build/artifacts/contracts/core/BulkSeller/BulkSellerFactory.sol/BulkSellerFactory.dbg.json +4 -0
- package/build/artifacts/contracts/core/BulkSeller/BulkSellerFactory.sol/BulkSellerFactory.json +515 -0
- package/build/artifacts/contracts/core/BulkSeller/BulkSellerMathCore.sol/BulkSellerMathCore.dbg.json +4 -0
- package/build/artifacts/contracts/core/BulkSeller/BulkSellerMathCore.sol/BulkSellerMathCore.json +10 -0
- package/build/artifacts/contracts/core/Market/MarketMathCore.sol/MarketMathCore.dbg.json +1 -1
- package/build/artifacts/contracts/core/Market/MarketMathCore.sol/MarketMathCore.json +2 -2
- package/build/artifacts/contracts/core/Market/OracleLib.sol/OracleLib.dbg.json +1 -1
- package/build/artifacts/contracts/core/Market/OracleLib.sol/OracleLib.json +2 -2
- package/build/artifacts/contracts/core/Market/PendleGauge.sol/PendleGauge.dbg.json +1 -1
- package/build/artifacts/contracts/core/Market/PendleMarket.sol/PendleMarket.dbg.json +1 -1
- package/build/artifacts/contracts/core/Market/PendleMarket.sol/PendleMarket.json +2 -2
- package/build/artifacts/contracts/core/Market/PendleMarketFactory.sol/PendleMarketFactory.dbg.json +1 -1
- package/build/artifacts/contracts/core/Market/PendleMarketFactory.sol/PendleMarketFactory.json +77 -17
- package/build/artifacts/contracts/core/RewardManager/RewardManager.sol/RewardManager.dbg.json +1 -1
- package/build/artifacts/contracts/core/RewardManager/RewardManagerAbstract.sol/RewardManagerAbstract.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/PYIndex.sol/PYIndexLib.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/PYIndex.sol/PYIndexLib.json +2 -2
- package/build/artifacts/contracts/core/StandardizedYield/SYBase.sol/SYBase.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/SYBaseWithRewards.sol/SYBaseWithRewards.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BenQi/PendleQiTokenHelper.sol/PendleQiTokenHelper.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BenQi/PendleQiTokenHelper.sol/PendleQiTokenHelper.json +2 -2
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BenQi/PendleQiTokenSY.sol/PendleQiTokenSY.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BenQi/PendleQiTokenSY.sol/PendleQiTokenSY.json +2 -2
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Convex/PendleCurveFraxUsdcSY.sol/PendleCurveFraxUsdcSY.dbg.json +4 -0
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Convex/PendleCurveFraxUsdcSY.sol/PendleCurveFraxUsdcSY.json +1003 -0
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Convex/PendleCurveUsdd3CrvSY.sol/PendleCurveUsdd3CrvSY.dbg.json +4 -0
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Convex/PendleCurveUsdd3CrvSY.sol/PendleCurveUsdd3CrvSY.json +1068 -0
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Convex/base/Curve3CrvPoolHelper.sol/Curve3CrvPoolHelper.dbg.json +4 -0
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Convex/base/Curve3CrvPoolHelper.sol/Curve3CrvPoolHelper.json +10 -0
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Convex/base/CurveFraxUsdcPoolHelper.sol/CurveFraxUsdcPoolHelper.dbg.json +4 -0
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Convex/base/CurveFraxUsdcPoolHelper.sol/CurveFraxUsdcPoolHelper.json +10 -0
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Convex/base/CurveUsdd3CrvPoolHelper.sol/CurveUsdd3CrvPoolHelper.dbg.json +4 -0
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Convex/base/CurveUsdd3CrvPoolHelper.sol/CurveUsdd3CrvPoolHelper.json +10 -0
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Convex/base/PendleConvexLPSY.sol/PendleConvexLPSY.dbg.json +4 -0
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Convex/{ConvexCurveLP → base}/PendleConvexLPSY.sol/PendleConvexLPSY.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/PendleLooksStakingSY.sol/PendleLooksStakingSY.dbg.json +4 -0
- package/build/artifacts/contracts/core/StandardizedYield/implementations/PendleLooksStakingSY.sol/PendleLooksStakingSY.json +856 -0
- package/build/artifacts/contracts/core/StandardizedYield/implementations/PendleWstEthSY.sol/PendleWstEthSY.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/PendleWstEthSY.sol/PendleWstEthSY.json +2 -2
- package/build/artifacts/contracts/core/YieldContracts/InterestManagerYT.sol/InterestManagerYT.dbg.json +1 -1
- package/build/artifacts/contracts/core/YieldContracts/PendlePrincipalToken.sol/PendlePrincipalToken.dbg.json +1 -1
- package/build/artifacts/contracts/core/YieldContracts/PendlePrincipalToken.sol/PendlePrincipalToken.json +15 -2
- package/build/artifacts/contracts/core/YieldContracts/PendleYieldContractFactory.sol/PendleYieldContractFactory.dbg.json +1 -1
- package/build/artifacts/contracts/core/YieldContracts/PendleYieldContractFactory.sol/PendleYieldContractFactory.json +85 -4
- package/build/artifacts/contracts/core/YieldContracts/PendleYieldToken.sol/PendleYieldToken.dbg.json +1 -1
- package/build/artifacts/contracts/core/YieldContracts/PendleYieldToken.sol/PendleYieldToken.json +17 -4
- package/build/artifacts/contracts/core/erc20/PendleERC20.sol/PendleERC20.dbg.json +1 -1
- package/build/artifacts/contracts/core/erc20/PendleERC20.sol/PendleERC20.json +2 -2
- package/build/artifacts/contracts/core/erc20/PendleERC20Permit.sol/PendleERC20Permit.dbg.json +1 -1
- package/build/artifacts/contracts/core/erc20/PendleERC20Permit.sol/PendleERC20Permit.json +2 -2
- package/build/artifacts/contracts/core/libraries/BaseSplitCodeFactory.sol/BaseSplitCodeFactory.dbg.json +1 -1
- package/build/artifacts/contracts/core/libraries/BaseSplitCodeFactory.sol/BaseSplitCodeFactory.json +3 -38
- package/build/artifacts/contracts/core/libraries/BaseSplitCodeFactory.sol/CodeDeployer.dbg.json +1 -1
- package/build/artifacts/contracts/core/libraries/BaseSplitCodeFactory.sol/CodeDeployer.json +2 -2
- package/build/artifacts/contracts/core/libraries/BoringOwnableUpgradeable.sol/BoringOwnableUpgradeable.dbg.json +1 -1
- package/build/artifacts/contracts/core/libraries/BoringOwnableUpgradeable.sol/BoringOwnableUpgradeable.json +13 -0
- package/build/artifacts/contracts/core/libraries/BoringOwnableUpgradeable.sol/BoringOwnableUpgradeableData.dbg.json +1 -1
- package/build/artifacts/contracts/core/libraries/BoringOwnableUpgradeable.sol/BoringOwnableUpgradeableData.json +2 -2
- package/build/artifacts/contracts/core/libraries/Errors.sol/Errors.dbg.json +1 -1
- package/build/artifacts/contracts/core/libraries/Errors.sol/Errors.json +284 -31
- package/build/artifacts/contracts/core/libraries/TokenHelper.sol/TokenHelper.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/ConvexCurve/IBooster.sol/IBooster.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/ConvexCurve/IBooster.sol/IBooster.json +1 -1
- package/build/artifacts/contracts/interfaces/Curve/ICrvPool.sol/ICrvPool.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/Curve/ICrvPool.sol/ICrvPool.json +39 -85
- package/build/artifacts/contracts/interfaces/Curve/ITriCrvPool.sol/ITriCrvPool.dbg.json +4 -0
- package/build/artifacts/contracts/interfaces/Curve/ITriCrvPool.sol/ITriCrvPool.json +213 -0
- package/build/artifacts/contracts/interfaces/IAToken.sol/IAToken.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IERC4626.sol/IERC4626.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/ILooksFeeSharing.sol/ILooksFeeSharing.dbg.json +4 -0
- package/build/artifacts/contracts/interfaces/ILooksFeeSharing.sol/ILooksFeeSharing.json +30 -0
- package/build/artifacts/contracts/interfaces/ILooksStaking.sol/ILooksStaking.dbg.json +4 -0
- package/build/artifacts/contracts/interfaces/ILooksStaking.sol/ILooksStaking.json +76 -0
- package/build/artifacts/contracts/interfaces/IPActionAddRemoveLiq.sol/IPActionAddRemoveLiq.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPActionAddRemoveLiq.sol/IPActionAddRemoveLiq.json +91 -17
- package/build/artifacts/contracts/interfaces/IPActionMintRedeem.sol/IPActionMintRedeem.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPActionMintRedeem.sol/IPActionMintRedeem.json +50 -0
- package/build/artifacts/contracts/interfaces/IPActionSwapPT.sol/IPActionSwapPT.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPActionSwapPT.sol/IPActionSwapPT.json +20 -0
- package/build/artifacts/contracts/interfaces/IPActionSwapPTYT.sol/IPActionSwapPTYT.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPActionSwapYT.sol/IPActionSwapYT.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPActionSwapYT.sol/IPActionSwapYT.json +20 -0
- package/build/artifacts/contracts/interfaces/IPAllAction.sol/IPAllAction.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPAllAction.sol/IPAllAction.json +181 -17
- package/build/artifacts/contracts/interfaces/IPBulkSeller.sol/IPBulkSeller.dbg.json +4 -0
- package/build/artifacts/contracts/interfaces/IPBulkSeller.sol/IPBulkSeller.json +173 -0
- package/build/artifacts/contracts/interfaces/IPBulkSellerFactory.sol/IPBulkSellerFactory.dbg.json +4 -0
- package/build/artifacts/contracts/interfaces/IPBulkSellerFactory.sol/IPBulkSellerFactory.json +86 -0
- package/build/artifacts/contracts/interfaces/IPBulkSellerSYCallback.sol/IPBulkSellerCallback.dbg.json +4 -0
- package/build/artifacts/contracts/interfaces/IPBulkSellerSYCallback.sol/IPBulkSellerCallback.json +34 -0
- package/build/artifacts/contracts/interfaces/IPMarket.sol/IPMarket.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPMarketFactory.sol/IPMarketFactory.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPMarketFactory.sol/IPMarketFactory.json +2 -2
- package/build/artifacts/contracts/interfaces/IPPrincipalToken.sol/IPPrincipalToken.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPVotingController.sol/IPVotingController.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPVotingEscrowMainchain.sol/IPVotingEscrowMainchain.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPYieldContractFactory.sol/IPYieldContractFactory.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPYieldContractFactory.sol/IPYieldContractFactory.json +1 -1
- package/build/artifacts/contracts/interfaces/IPYieldToken.sol/IPYieldToken.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IQiAvax.sol/IQiAvax.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IQiErc20.sol/IQiErc20.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IQiToken.sol/IQiToken.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/ISJoe.sol/ISJoe.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IStETH.sol/IStETH.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IStETH.sol/IStETH.json +45 -0
- package/build/artifacts/contracts/interfaces/IStandardizedYield.sol/IStandardizedYield.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IWAvax.sol/IWAvax.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IWETH.sol/IWETH.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/BaseSplitCodeFactoryContract.sol/BaseSplitCodeFactoryContract.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/BaseSplitCodeFactoryContract.sol/BaseSplitCodeFactoryContract.json +15 -2
- package/build/artifacts/contracts/offchain-helpers/BulkSellerOffchain.sol/BulkSellerOffchain.dbg.json +4 -0
- package/build/artifacts/contracts/offchain-helpers/BulkSellerOffchain.sol/BulkSellerOffchain.json +35 -0
- package/build/artifacts/contracts/offchain-helpers/MarketMathStatic.sol/MarketMathStatic.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/MarketMathStatic.sol/MarketMathStatic.json +2 -80
- package/build/artifacts/contracts/offchain-helpers/RouterStatic.sol/RouterStatic.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/RouterStatic.sol/RouterStatic.json +271 -61
- package/build/artifacts/contracts/router/ActionAddRemoveLiq.sol/ActionAddRemoveLiq.dbg.json +1 -1
- package/build/artifacts/contracts/router/ActionAddRemoveLiq.sol/ActionAddRemoveLiq.json +102 -41
- package/build/artifacts/contracts/router/ActionCallback.sol/ActionCallback.dbg.json +1 -1
- package/build/artifacts/contracts/router/ActionCallback.sol/ActionCallback.json +2 -2
- package/build/artifacts/contracts/router/ActionMintRedeem.sol/ActionMintRedeem.dbg.json +1 -1
- package/build/artifacts/contracts/router/ActionMintRedeem.sol/ActionMintRedeem.json +61 -24
- package/build/artifacts/contracts/router/ActionMisc.sol/ActionMisc.dbg.json +1 -1
- package/build/artifacts/contracts/router/ActionMisc.sol/ActionMisc.json +2 -2
- package/build/artifacts/contracts/router/ActionSwapPT.sol/ActionSwapPT.dbg.json +1 -1
- package/build/artifacts/contracts/router/ActionSwapPT.sol/ActionSwapPT.json +31 -24
- package/build/artifacts/contracts/router/ActionSwapPTYT.sol/ActionSwapPTYT.dbg.json +1 -1
- package/build/artifacts/contracts/router/ActionSwapPTYT.sol/ActionSwapPTYT.json +2 -2
- package/build/artifacts/contracts/router/ActionSwapYT.sol/ActionSwapYT.dbg.json +1 -1
- package/build/artifacts/contracts/router/ActionSwapYT.sol/ActionSwapYT.json +31 -24
- package/build/artifacts/contracts/router/PendleRouter.sol/PendleRouter.dbg.json +1 -1
- package/build/artifacts/contracts/router/PendleRouter.sol/PendleRouter.json +15 -2
- package/build/artifacts/contracts/router/base/ActionBaseMintRedeem.sol/ActionBaseMintRedeem.dbg.json +1 -1
- package/build/artifacts/contracts/router/base/ActionBaseMintRedeem.sol/ActionBaseMintRedeem.json +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 +191 -2
- package/build/artifacts/contracts/router/kyberswap/IAggregatorRouterHelper.sol/IAggregationRouterHelper.dbg.json +4 -0
- package/build/artifacts/contracts/router/kyberswap/IAggregatorRouterHelper.sol/IAggregationRouterHelper.json +35 -0
- package/build/artifacts/contracts/router/kyberswap/KyberSwapHelper.sol/KyberSwapHelper.dbg.json +1 -1
- package/build/artifacts/contracts/router/kyberswap/KyberSwapHelper.sol/KyberSwapHelper.json +1 -1
- package/contracts/LiquidityMining/CrossChainMsg/PendleMsgReceiveEndpointUpg.sol +58 -27
- package/contracts/LiquidityMining/CrossChainMsg/PendleMsgSendEndpointUpg.sol +46 -12
- package/contracts/LiquidityMining/CrossChainMsg/PendleMsgSenderAppUpg.sol +31 -7
- package/contracts/LiquidityMining/CrossChainMsg/libraries/ExcessivelySafeCall.sol +133 -0
- package/contracts/LiquidityMining/CrossChainMsg/libraries/LayerZeroHelper.sol +27 -0
- package/contracts/LiquidityMining/VotingController/PendleVotingControllerUpg.sol +9 -10
- package/contracts/LiquidityMining/VotingEscrow/VotingEscrowPendleMainchain.sol +9 -23
- package/contracts/core/BulkSeller/BulkSeller.sol +259 -0
- package/contracts/core/BulkSeller/BulkSellerFactory.sol +88 -0
- package/contracts/core/BulkSeller/BulkSellerMathCore.sol +143 -0
- package/contracts/core/Market/PendleMarket.sol +18 -7
- package/contracts/core/Market/PendleMarketFactory.sol +15 -5
- package/contracts/core/StandardizedYield/implementations/Convex/PendleCurveFraxUsdcSY.sol +102 -0
- package/contracts/core/StandardizedYield/implementations/Convex/PendleCurveUsdd3CrvSY.sol +160 -0
- package/contracts/core/StandardizedYield/implementations/Convex/README.md +29 -0
- package/contracts/core/StandardizedYield/implementations/Convex/base/Curve3CrvPoolHelper.sol +215 -0
- package/contracts/core/StandardizedYield/implementations/Convex/base/CurveFraxUsdcPoolHelper.sol +127 -0
- package/contracts/core/StandardizedYield/implementations/Convex/base/CurveUsdd3CrvPoolHelper.sol +152 -0
- package/contracts/core/StandardizedYield/implementations/Convex/{ConvexCurveLP → base}/PendleConvexLPSY.sol +2 -4
- package/contracts/core/StandardizedYield/implementations/PendleLooksStakingSY.sol +122 -0
- package/contracts/core/StandardizedYield/implementations/PendleWstEthSY.sol +17 -8
- package/contracts/core/YieldContracts/PendlePrincipalToken.sol +3 -3
- package/contracts/core/YieldContracts/PendleYieldContractFactory.sol +38 -11
- package/contracts/core/YieldContracts/PendleYieldToken.sol +54 -21
- package/contracts/core/erc20/PendleERC20.sol +4 -7
- package/contracts/core/libraries/BaseSplitCodeFactory.sol +1 -1
- package/contracts/core/libraries/BoringOwnableUpgradeable.sol +1 -1
- package/contracts/core/libraries/Errors.sol +32 -4
- package/contracts/core/libraries/StringLib.sol +782 -0
- package/contracts/core/libraries/TokenHelper.sol +9 -0
- package/contracts/interfaces/ConvexCurve/IBooster.sol +1 -1
- package/contracts/interfaces/Curve/ICrvPool.sol +12 -31
- package/contracts/interfaces/Curve/ITriCrvPool.sol +41 -0
- package/contracts/interfaces/ILayerZeroEndpoint.sol +39 -0
- package/contracts/interfaces/ILayerZeroReceiver.sol +12 -0
- package/contracts/interfaces/ILooksFeeSharing.sol +5 -0
- package/contracts/interfaces/ILooksStaking.sol +13 -0
- package/contracts/interfaces/IPActionAddRemoveLiq.sol +3 -5
- package/contracts/interfaces/IPActionMintRedeem.sol +2 -0
- package/contracts/interfaces/IPBulkSeller.sol +28 -0
- package/contracts/interfaces/IPBulkSellerFactory.sol +12 -0
- package/contracts/interfaces/IPBulkSellerSYCallback.sol +10 -0
- package/contracts/interfaces/IPMarketFactory.sol +1 -1
- package/contracts/interfaces/IPMsgSendEndpoint.sol +4 -2
- package/contracts/interfaces/IPYieldContractFactory.sol +1 -1
- package/contracts/interfaces/IStETH.sol +6 -0
- package/contracts/interfaces/IStandardizedYield.sol +15 -10
- package/contracts/offchain-helpers/BulkSellerOffchain.sol +43 -0
- package/contracts/offchain-helpers/MarketMathStatic.sol +0 -173
- package/contracts/offchain-helpers/RouterStatic.sol +189 -50
- package/contracts/router/ActionAddRemoveLiq.sol +71 -52
- package/contracts/router/ActionCallback.sol +4 -8
- package/contracts/router/ActionMintRedeem.sol +27 -18
- package/contracts/router/ActionSwapPT.sol +8 -9
- package/contracts/router/ActionSwapPTYT.sol +3 -7
- package/contracts/router/ActionSwapYT.sol +15 -10
- package/contracts/router/PendleRouter.sol +3 -0
- package/contracts/router/base/ActionBaseMintRedeem.sol +78 -83
- package/contracts/router/base/MarketApproxLib.sol +1 -1
- package/contracts/router/kyberswap/AggregationRouterHelper.sol +17 -1
- package/contracts/router/kyberswap/IAggregatorRouterHelper.sol +10 -0
- package/contracts/router/kyberswap/KyberSwapHelper.sol +21 -8
- package/deployments/1-core.json +1 -0
- package/deployments/1-markets/FRAX_30_MAR_23.json +9 -0
- package/deployments/1-markets/LOOKS_30_MAR_23.json +8 -0
- package/deployments/1-markets/USDD_MARCH_30.json +9 -0
- package/deployments/1-offchain-helper.json +3 -0
- package/package.json +3 -2
- package/typechain-types/AccessControl.ts +360 -0
- package/typechain-types/AccessControlUpgradeable.ts +369 -0
- package/typechain-types/ActionAddRemoveLiq.ts +64 -52
- package/typechain-types/ActionBaseMintRedeem.ts +8 -8
- package/typechain-types/ActionMintRedeem.ts +48 -16
- package/typechain-types/ActionSwapPT.ts +34 -12
- package/typechain-types/ActionSwapYT.ts +34 -12
- package/typechain-types/AggregationRouterHelper.ts +287 -3
- package/typechain-types/BaseSplitCodeFactoryContract.ts +9 -0
- package/typechain-types/BeaconProxy.ts +97 -0
- package/typechain-types/BoringOwnableUpgradeable.ts +9 -0
- package/typechain-types/BulkSeller.ts +777 -0
- package/typechain-types/BulkSellerFactory.ts +707 -0
- package/typechain-types/BulkSellerOffchain.ts +117 -0
- package/typechain-types/ContextUpgradeable.ts +68 -0
- package/typechain-types/Curve3CrvPoolHelper.ts +236 -0
- package/typechain-types/CurveFraxUsdcPoolHelper.ts +158 -0
- package/typechain-types/CurveUsdd3CrvPoolHelper.ts +184 -0
- package/typechain-types/ERC165.ts +102 -0
- package/typechain-types/ERC165Upgradeable.ts +113 -0
- package/typechain-types/IAccessControl.ts +305 -0
- package/typechain-types/IAccessControlUpgradeable.ts +305 -0
- package/typechain-types/IAggregationRouterHelper.ts +108 -0
- package/typechain-types/IBooster.ts +9 -3
- package/typechain-types/ICrvPool.ts +69 -172
- package/typechain-types/IERC165.ts +102 -0
- package/typechain-types/IERC165Upgradeable.ts +102 -0
- package/typechain-types/ILooksStaking.ts +27 -0
- package/typechain-types/IPActionAddRemoveLiq.ts +56 -44
- package/typechain-types/IPActionMintRedeem.ts +40 -8
- package/typechain-types/IPActionSwapPT.ts +26 -4
- package/typechain-types/IPActionSwapYT.ts +26 -4
- package/typechain-types/IPAllAction.ts +76 -54
- package/typechain-types/IPBulkSeller.ts +290 -0
- package/typechain-types/IPBulkSellerCallback.ts +115 -0
- package/typechain-types/IPBulkSellerFactory.ts +147 -0
- package/typechain-types/IPMarketFactory.ts +2 -2
- package/typechain-types/IPYieldContractFactory.ts +3 -3
- package/typechain-types/IStETH.ts +56 -0
- package/typechain-types/ITriCrvPool.ts +345 -0
- package/typechain-types/Initializable.ts +68 -0
- package/typechain-types/KyberSwapHelper.ts +8 -8
- package/typechain-types/MarketMathStatic.ts +0 -117
- package/typechain-types/PendleCurveFraxUsdcSY.ts +1228 -0
- package/typechain-types/PendleCurveUsdd3CrvSY.ts +1299 -0
- package/typechain-types/PendleFeeDistributor.ts +9 -0
- package/typechain-types/PendleFeeDistributorFactory.ts +9 -0
- package/typechain-types/PendleGaugeControllerBaseUpg.ts +9 -0
- package/typechain-types/PendleGaugeControllerMainchainUpg.ts +9 -0
- package/typechain-types/PendleGaugeControllerSidechainUpg.ts +9 -0
- package/typechain-types/PendleLooksStakingSY.ts +1052 -0
- package/typechain-types/PendleMarketFactory.ts +51 -2
- package/typechain-types/PendleMsgReceiveEndpointUpg.ts +9 -0
- package/typechain-types/PendleMsgSendEndpointUpg.ts +9 -0
- package/typechain-types/PendleMsgSenderAppUpg.ts +9 -0
- package/typechain-types/PendlePrincipalToken.ts +9 -0
- package/typechain-types/PendleRouter.ts +9 -0
- package/typechain-types/PendleVotingControllerUpg.ts +9 -0
- package/typechain-types/PendleYieldContractFactory.ts +57 -8
- package/typechain-types/PendleYieldToken.ts +21 -0
- package/typechain-types/ReentrancyGuardUpgradeable.ts +68 -0
- package/typechain-types/RouterStatic.ts +260 -22
- package/typechain-types/VotingEscrowPendleMainchain.ts +9 -0
- package/typechain-types/VotingEscrowPendleSidechain.ts +9 -0
- package/typechain-types/factories/AccessControlUpgradeable__factory.ts +247 -0
- package/typechain-types/factories/AccessControl__factory.ts +227 -0
- package/typechain-types/factories/ActionAddRemoveLiq__factory.ts +106 -59
- package/typechain-types/factories/ActionBaseMintRedeem__factory.ts +1 -1
- package/typechain-types/factories/ActionCallback__factory.ts +1 -1
- package/typechain-types/factories/ActionMintRedeem__factory.ts +65 -42
- package/typechain-types/factories/ActionMisc__factory.ts +1 -1
- package/typechain-types/factories/ActionSwapPTYT__factory.ts +1 -1
- package/typechain-types/factories/ActionSwapPT__factory.ts +35 -42
- package/typechain-types/factories/ActionSwapYT__factory.ts +35 -42
- package/typechain-types/factories/AggregationRouterHelper__factory.ts +190 -1
- package/typechain-types/factories/BaseSplitCodeFactoryContract__factory.ts +14 -1
- package/typechain-types/factories/BaseSplitCodeFactory__factory.ts +1 -1
- package/typechain-types/factories/BeaconProxy__factory.ts +141 -0
- package/typechain-types/factories/BoringOwnableUpgradeableData__factory.ts +1 -1
- package/typechain-types/factories/BoringOwnableUpgradeable__factory.ts +13 -0
- package/typechain-types/factories/BulkSellerFactory__factory.ts +568 -0
- package/typechain-types/factories/BulkSellerOffchain__factory.ts +88 -0
- package/typechain-types/factories/BulkSeller__factory.ts +749 -0
- package/typechain-types/factories/ContextUpgradeable__factory.ts +39 -0
- package/typechain-types/factories/Curve3CrvPoolHelper__factory.ts +220 -0
- package/typechain-types/factories/CurveFraxUsdcPoolHelper__factory.ts +146 -0
- package/typechain-types/factories/CurveUsdd3CrvPoolHelper__factory.ts +172 -0
- package/typechain-types/factories/ERC165Upgradeable__factory.ts +58 -0
- package/typechain-types/factories/ERC165__factory.ts +39 -0
- package/typechain-types/factories/ERC20__factory.ts +1 -1
- package/typechain-types/factories/Errors__factory.ts +283 -30
- package/typechain-types/factories/IAccessControlUpgradeable__factory.ts +202 -0
- package/typechain-types/factories/IAccessControl__factory.ts +198 -0
- package/typechain-types/factories/IAggregationRouterHelper__factory.ts +54 -0
- package/typechain-types/factories/IBooster__factory.ts +1 -1
- package/typechain-types/factories/ICrvPool__factory.ts +39 -85
- package/typechain-types/factories/IERC165Upgradeable__factory.ts +45 -0
- package/typechain-types/factories/IERC165__factory.ts +42 -0
- package/typechain-types/factories/ILooksStaking__factory.ts +7 -0
- package/typechain-types/factories/IPActionAddRemoveLiq__factory.ts +91 -17
- package/typechain-types/factories/IPActionMintRedeem__factory.ts +50 -0
- package/typechain-types/factories/IPActionSwapPT__factory.ts +20 -0
- package/typechain-types/factories/IPActionSwapYT__factory.ts +20 -0
- package/typechain-types/factories/IPAllAction__factory.ts +181 -17
- package/typechain-types/factories/IPBulkSellerCallback__factory.ts +53 -0
- package/typechain-types/factories/IPBulkSellerFactory__factory.ts +101 -0
- package/typechain-types/factories/IPBulkSeller__factory.ts +185 -0
- package/typechain-types/factories/IPMarketFactory__factory.ts +2 -2
- package/typechain-types/factories/IPYieldContractFactory__factory.ts +1 -1
- package/typechain-types/factories/IStETH__factory.ts +45 -0
- package/typechain-types/factories/ITriCrvPool__factory.ts +225 -0
- package/typechain-types/factories/ImplicitSwapfeeContract__factory.ts +1 -1
- package/typechain-types/factories/Initializable__factory.ts +36 -0
- package/typechain-types/factories/KyberSwapHelper__factory.ts +1 -1
- package/typechain-types/factories/MarketMathStatic__factory.ts +1 -79
- package/typechain-types/factories/OracleLib__factory.ts +1 -1
- package/typechain-types/factories/PendleCurveFraxUsdcSY__factory.ts +1068 -0
- package/typechain-types/factories/PendleCurveUsdd3CrvSY__factory.ts +1133 -0
- package/typechain-types/factories/PendleERC20Permit__factory.ts +1 -1
- package/typechain-types/factories/PendleERC20__factory.ts +1 -1
- package/typechain-types/factories/PendleFeeDistributorFactory__factory.ts +14 -1
- package/typechain-types/factories/PendleFeeDistributor__factory.ts +14 -1
- package/typechain-types/factories/PendleGaugeControllerBaseUpg__factory.ts +13 -0
- package/typechain-types/factories/PendleGaugeControllerMainchainUpg__factory.ts +14 -1
- package/typechain-types/factories/PendleGaugeControllerSidechainUpg__factory.ts +14 -1
- package/typechain-types/factories/PendleLooksStakingSY__factory.ts +937 -0
- package/typechain-types/factories/PendleMarketFactory__factory.ts +76 -16
- package/typechain-types/factories/PendleMarket__factory.ts +1 -1
- package/typechain-types/factories/PendleMsgReceiveEndpointUpg__factory.ts +14 -1
- package/typechain-types/factories/PendleMsgSendEndpointUpg__factory.ts +14 -1
- package/typechain-types/factories/PendleMsgSenderAppUpg__factory.ts +13 -0
- package/typechain-types/factories/PendlePrincipalToken__factory.ts +14 -1
- package/typechain-types/factories/PendleQiTokenHelper__factory.ts +1 -1
- package/typechain-types/factories/PendleQiTokenSY__factory.ts +1 -1
- package/typechain-types/factories/PendleRouter__factory.ts +14 -1
- package/typechain-types/factories/PendleVotingControllerUpg__factory.ts +14 -1
- package/typechain-types/factories/PendleWstEthSY__factory.ts +1 -1
- package/typechain-types/factories/PendleYieldContractFactory__factory.ts +84 -3
- package/typechain-types/factories/PendleYieldToken__factory.ts +16 -3
- package/typechain-types/factories/ReentrancyGuardUpgradeable__factory.ts +43 -0
- package/typechain-types/factories/RouterStatic__factory.ts +216 -2
- package/typechain-types/factories/VotingEscrowPendleMainchain__factory.ts +14 -1
- package/typechain-types/factories/VotingEscrowPendleSidechain__factory.ts +14 -1
- package/typechain-types/hardhat.d.ts +233 -17
- package/typechain-types/index.ts +50 -6
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Convex/ConvexCurveLP/Pendle3CrvAndTokenSY.sol/Pendle3CrvAndTokenSY.dbg.json +0 -4
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Convex/ConvexCurveLP/Pendle3CrvAndTokenSY.sol/Pendle3CrvAndTokenSY.json +0 -1018
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Convex/ConvexCurveLP/PendleConvexLPSY.sol/PendleConvexLPSY.dbg.json +0 -4
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Convex/Pendle3CrvHelper.sol/Pendle3CrvHelper.dbg.json +0 -4
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Convex/Pendle3CrvHelper.sol/Pendle3CrvHelper.json +0 -76
- package/build/artifacts/contracts/offchain-helpers/ImplicitSwapfeeContract.sol/ImplicitSwapfeeContract.dbg.json +0 -4
- package/build/artifacts/contracts/offchain-helpers/ImplicitSwapfeeContract.sol/ImplicitSwapfeeContract.json +0 -182
- package/contracts/core/StandardizedYield/implementations/Convex/ConvexCurveLP/Pendle3CrvAndTokenSY.sol +0 -167
- package/contracts/core/StandardizedYield/implementations/Convex/Pendle3CrvHelper.sol +0 -83
- package/contracts/interfaces/ICelerMessageBus.sol +0 -28
- package/contracts/interfaces/ICelerMessageReceiverApp.sol +0 -25
|
@@ -2,12 +2,18 @@
|
|
|
2
2
|
pragma solidity 0.8.17;
|
|
3
3
|
|
|
4
4
|
import "../../interfaces/IPMsgSendEndpoint.sol";
|
|
5
|
-
import "../../interfaces/
|
|
5
|
+
import "../../interfaces/ILayerZeroEndpoint.sol";
|
|
6
6
|
import "../../core/libraries/BoringOwnableUpgradeable.sol";
|
|
7
7
|
import "../../core/libraries/Errors.sol";
|
|
8
|
+
import "./libraries/LayerZeroHelper.sol";
|
|
8
9
|
import "@openzeppelin/contracts/utils/structs/EnumerableMap.sol";
|
|
9
10
|
import "@openzeppelin/contracts/proxy/utils/UUPSUpgradeable.sol";
|
|
10
11
|
|
|
12
|
+
/**
|
|
13
|
+
* @dev Initially, currently we will use layer zero's default send and receive version (which is most updated)
|
|
14
|
+
* So we can leave the configuration unset.
|
|
15
|
+
*/
|
|
16
|
+
|
|
11
17
|
contract PendleMsgSendEndpointUpg is
|
|
12
18
|
IPMsgSendEndpoint,
|
|
13
19
|
Initializable,
|
|
@@ -16,7 +22,9 @@ contract PendleMsgSendEndpointUpg is
|
|
|
16
22
|
{
|
|
17
23
|
using EnumerableMap for EnumerableMap.UintToAddressMap;
|
|
18
24
|
|
|
19
|
-
|
|
25
|
+
address payable public immutable refundAddress;
|
|
26
|
+
ILayerZeroEndpoint public immutable lzEndpoint;
|
|
27
|
+
|
|
20
28
|
EnumerableMap.UintToAddressMap internal receiveEndpoints;
|
|
21
29
|
mapping(address => bool) public isWhitelisted;
|
|
22
30
|
|
|
@@ -25,8 +33,9 @@ contract PendleMsgSendEndpointUpg is
|
|
|
25
33
|
_;
|
|
26
34
|
}
|
|
27
35
|
|
|
28
|
-
constructor(
|
|
29
|
-
|
|
36
|
+
constructor(address _refundAddress, ILayerZeroEndpoint _lzEndpoint) initializer {
|
|
37
|
+
refundAddress = payable(_refundAddress);
|
|
38
|
+
lzEndpoint = _lzEndpoint;
|
|
30
39
|
}
|
|
31
40
|
|
|
32
41
|
function initialize() external initializer {
|
|
@@ -35,21 +44,36 @@ contract PendleMsgSendEndpointUpg is
|
|
|
35
44
|
|
|
36
45
|
function calcFee(
|
|
37
46
|
address dstAddress,
|
|
38
|
-
uint256
|
|
39
|
-
bytes memory
|
|
40
|
-
|
|
41
|
-
|
|
47
|
+
uint256 dstChainId,
|
|
48
|
+
bytes memory payload,
|
|
49
|
+
uint256 estimatedGasAmount
|
|
50
|
+
) external view returns (uint256 fee) {
|
|
51
|
+
(fee, ) = lzEndpoint.estimateFees(
|
|
52
|
+
LayerZeroHelper._getLayerZeroChainIds(dstChainId),
|
|
53
|
+
receiveEndpoints.get(dstChainId),
|
|
54
|
+
abi.encode(dstAddress, payload),
|
|
55
|
+
false,
|
|
56
|
+
_getAdapterParams(estimatedGasAmount)
|
|
57
|
+
);
|
|
42
58
|
}
|
|
43
59
|
|
|
44
60
|
function sendMessage(
|
|
45
61
|
address dstAddress,
|
|
46
62
|
uint256 dstChainId,
|
|
47
|
-
bytes calldata
|
|
63
|
+
bytes calldata payload,
|
|
64
|
+
uint256 estimatedGasAmount
|
|
48
65
|
) external payable onlyWhitelisted {
|
|
49
|
-
|
|
66
|
+
bytes memory path = abi.encodePacked(
|
|
50
67
|
receiveEndpoints.get(dstChainId),
|
|
51
|
-
|
|
52
|
-
|
|
68
|
+
address(this)
|
|
69
|
+
);
|
|
70
|
+
lzEndpoint.send{ value: msg.value }(
|
|
71
|
+
LayerZeroHelper._getLayerZeroChainIds(dstChainId),
|
|
72
|
+
path,
|
|
73
|
+
abi.encode(dstAddress, payload),
|
|
74
|
+
refundAddress,
|
|
75
|
+
address(0),
|
|
76
|
+
_getAdapterParams(estimatedGasAmount)
|
|
53
77
|
);
|
|
54
78
|
}
|
|
55
79
|
|
|
@@ -65,6 +89,10 @@ contract PendleMsgSendEndpointUpg is
|
|
|
65
89
|
isWhitelisted[addr] = status;
|
|
66
90
|
}
|
|
67
91
|
|
|
92
|
+
function setLzSendVersion(uint16 _newVersion) external onlyOwner {
|
|
93
|
+
ILayerZeroEndpoint(lzEndpoint).setSendVersion(_newVersion);
|
|
94
|
+
}
|
|
95
|
+
|
|
68
96
|
function getAllReceiveEndpoints()
|
|
69
97
|
external
|
|
70
98
|
view
|
|
@@ -80,4 +108,10 @@ contract PendleMsgSendEndpointUpg is
|
|
|
80
108
|
}
|
|
81
109
|
|
|
82
110
|
function _authorizeUpgrade(address newImplementation) internal override onlyOwner {}
|
|
111
|
+
|
|
112
|
+
function _getAdapterParams(uint256 estimatedGasAmount) internal pure returns (bytes memory adapterParams) {
|
|
113
|
+
// this is more like "type" rather than version
|
|
114
|
+
// It is the type of adapter params you want to pass to relayer
|
|
115
|
+
adapterParams = abi.encodePacked(uint16(1), estimatedGasAmount);
|
|
116
|
+
}
|
|
83
117
|
}
|
|
@@ -8,12 +8,14 @@ import "@openzeppelin/contracts/utils/structs/EnumerableMap.sol";
|
|
|
8
8
|
|
|
9
9
|
// solhint-disable no-empty-blocks
|
|
10
10
|
/// This contract is upgradable because
|
|
11
|
-
/// - its constructor only sets immutable
|
|
11
|
+
/// - its constructor only sets immutable varia\bles
|
|
12
12
|
/// - it has storage gaps for safe addition of future variables
|
|
13
13
|
/// - it inherits only upgradable contract
|
|
14
14
|
abstract contract PendleMsgSenderAppUpg is BoringOwnableUpgradeable {
|
|
15
15
|
using EnumerableMap for EnumerableMap.UintToAddressMap;
|
|
16
16
|
|
|
17
|
+
uint256 public approxDstExecutionGas;
|
|
18
|
+
|
|
17
19
|
IPMsgSendEndpoint public immutable pendleMsgSendEndpoint;
|
|
18
20
|
|
|
19
21
|
// destinationContracts mapping contains one address for each chainId only
|
|
@@ -24,22 +26,29 @@ abstract contract PendleMsgSenderAppUpg is BoringOwnableUpgradeable {
|
|
|
24
26
|
modifier refundUnusedEth() {
|
|
25
27
|
_;
|
|
26
28
|
if (address(this).balance > 0) {
|
|
27
|
-
|
|
29
|
+
AddressUpgradeable.sendValue(payable(msg.sender), address(this).balance);
|
|
28
30
|
}
|
|
29
31
|
}
|
|
30
32
|
|
|
31
|
-
constructor(address _pendleMsgSendEndpoint) {
|
|
33
|
+
constructor(address _pendleMsgSendEndpoint, uint256 _approxDstExecutionGas) {
|
|
32
34
|
pendleMsgSendEndpoint = IPMsgSendEndpoint(_pendleMsgSendEndpoint);
|
|
35
|
+
approxDstExecutionGas = _approxDstExecutionGas;
|
|
33
36
|
}
|
|
34
37
|
|
|
35
38
|
function _sendMessage(uint256 chainId, bytes memory message) internal {
|
|
36
39
|
assert(destinationContracts.contains(chainId));
|
|
37
40
|
address toAddr = destinationContracts.get(chainId);
|
|
38
|
-
uint256
|
|
41
|
+
uint256 estimatedGasAmount = approxDstExecutionGas;
|
|
42
|
+
uint256 fee = pendleMsgSendEndpoint.calcFee(toAddr, chainId, message, estimatedGasAmount);
|
|
39
43
|
// LM contracts won't hold ETH on its own so this is fine
|
|
40
44
|
if (address(this).balance < fee)
|
|
41
45
|
revert Errors.InsufficientFeeToSendMsg(address(this).balance, fee);
|
|
42
|
-
pendleMsgSendEndpoint.sendMessage{ value: fee }(
|
|
46
|
+
pendleMsgSendEndpoint.sendMessage{ value: fee }(
|
|
47
|
+
toAddr,
|
|
48
|
+
chainId,
|
|
49
|
+
message,
|
|
50
|
+
estimatedGasAmount
|
|
51
|
+
);
|
|
43
52
|
}
|
|
44
53
|
|
|
45
54
|
function addDestinationContract(address _address, uint256 _chainId)
|
|
@@ -48,7 +57,10 @@ abstract contract PendleMsgSenderAppUpg is BoringOwnableUpgradeable {
|
|
|
48
57
|
onlyOwner
|
|
49
58
|
{
|
|
50
59
|
destinationContracts.set(_chainId, _address);
|
|
51
|
-
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
function setApproxDstExecutionGas(uint256 gas) external onlyOwner {
|
|
63
|
+
approxDstExecutionGas = gas;
|
|
52
64
|
}
|
|
53
65
|
|
|
54
66
|
function getAllDestinationContracts()
|
|
@@ -65,5 +77,17 @@ abstract contract PendleMsgSenderAppUpg is BoringOwnableUpgradeable {
|
|
|
65
77
|
}
|
|
66
78
|
}
|
|
67
79
|
|
|
68
|
-
function
|
|
80
|
+
function _getSendMessageFee(uint256 chainId, bytes memory message)
|
|
81
|
+
internal
|
|
82
|
+
view
|
|
83
|
+
returns (uint256)
|
|
84
|
+
{
|
|
85
|
+
return
|
|
86
|
+
pendleMsgSendEndpoint.calcFee(
|
|
87
|
+
destinationContracts.get(chainId),
|
|
88
|
+
chainId,
|
|
89
|
+
message,
|
|
90
|
+
approxDstExecutionGas
|
|
91
|
+
);
|
|
92
|
+
}
|
|
69
93
|
}
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
// SPDX-License-Identifier: MIT OR Apache-2.0
|
|
2
|
+
pragma solidity >=0.7.6;
|
|
3
|
+
|
|
4
|
+
library ExcessivelySafeCall {
|
|
5
|
+
uint256 constant LOW_28_MASK =
|
|
6
|
+
0x00000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffff;
|
|
7
|
+
|
|
8
|
+
/// @notice Use when you _really_ really _really_ don't trust the called
|
|
9
|
+
/// contract. This prevents the called contract from causing reversion of
|
|
10
|
+
/// the caller in as many ways as we can.
|
|
11
|
+
/// @dev The main difference between this and a solidity low-level call is
|
|
12
|
+
/// that we limit the number of bytes that the callee can cause to be
|
|
13
|
+
/// copied to caller memory. This prevents stupid things like malicious
|
|
14
|
+
/// contracts returning 10,000,000 bytes causing a local OOG when copying
|
|
15
|
+
/// to memory.
|
|
16
|
+
/// @param _target The address to call
|
|
17
|
+
/// @param _gas The amount of gas to forward to the remote contract
|
|
18
|
+
/// @param _maxCopy The maximum number of bytes of returndata to copy
|
|
19
|
+
/// to memory.
|
|
20
|
+
/// @param _calldata The data to send to the remote contract
|
|
21
|
+
/// @return success and returndata, as `.call()`. Returndata is capped to
|
|
22
|
+
/// `_maxCopy` bytes.
|
|
23
|
+
function excessivelySafeCall(
|
|
24
|
+
address _target,
|
|
25
|
+
uint256 _gas,
|
|
26
|
+
uint16 _maxCopy,
|
|
27
|
+
bytes memory _calldata
|
|
28
|
+
) internal returns (bool, bytes memory) {
|
|
29
|
+
// set up for assembly call
|
|
30
|
+
uint256 _toCopy;
|
|
31
|
+
bool _success;
|
|
32
|
+
bytes memory _returnData = new bytes(_maxCopy);
|
|
33
|
+
// dispatch message to recipient
|
|
34
|
+
// by assembly calling "handle" function
|
|
35
|
+
// we call via assembly to avoid memcopying a very large returndata
|
|
36
|
+
// returned by a malicious contract
|
|
37
|
+
assembly {
|
|
38
|
+
_success := call(
|
|
39
|
+
_gas, // gas
|
|
40
|
+
_target, // recipient
|
|
41
|
+
0, // ether value
|
|
42
|
+
add(_calldata, 0x20), // inloc
|
|
43
|
+
mload(_calldata), // inlen
|
|
44
|
+
0, // outloc
|
|
45
|
+
0 // outlen
|
|
46
|
+
)
|
|
47
|
+
// limit our copy to 256 bytes
|
|
48
|
+
_toCopy := returndatasize()
|
|
49
|
+
if gt(_toCopy, _maxCopy) {
|
|
50
|
+
_toCopy := _maxCopy
|
|
51
|
+
}
|
|
52
|
+
// Store the length of the copied bytes
|
|
53
|
+
mstore(_returnData, _toCopy)
|
|
54
|
+
// copy the bytes from returndata[0:_toCopy]
|
|
55
|
+
returndatacopy(add(_returnData, 0x20), 0, _toCopy)
|
|
56
|
+
}
|
|
57
|
+
return (_success, _returnData);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/// @notice Use when you _really_ really _really_ don't trust the called
|
|
61
|
+
/// contract. This prevents the called contract from causing reversion of
|
|
62
|
+
/// the caller in as many ways as we can.
|
|
63
|
+
/// @dev The main difference between this and a solidity low-level call is
|
|
64
|
+
/// that we limit the number of bytes that the callee can cause to be
|
|
65
|
+
/// copied to caller memory. This prevents stupid things like malicious
|
|
66
|
+
/// contracts returning 10,000,000 bytes causing a local OOG when copying
|
|
67
|
+
/// to memory.
|
|
68
|
+
/// @param _target The address to call
|
|
69
|
+
/// @param _gas The amount of gas to forward to the remote contract
|
|
70
|
+
/// @param _maxCopy The maximum number of bytes of returndata to copy
|
|
71
|
+
/// to memory.
|
|
72
|
+
/// @param _calldata The data to send to the remote contract
|
|
73
|
+
/// @return success and returndata, as `.call()`. Returndata is capped to
|
|
74
|
+
/// `_maxCopy` bytes.
|
|
75
|
+
function excessivelySafeStaticCall(
|
|
76
|
+
address _target,
|
|
77
|
+
uint256 _gas,
|
|
78
|
+
uint16 _maxCopy,
|
|
79
|
+
bytes memory _calldata
|
|
80
|
+
) internal view returns (bool, bytes memory) {
|
|
81
|
+
// set up for assembly call
|
|
82
|
+
uint256 _toCopy;
|
|
83
|
+
bool _success;
|
|
84
|
+
bytes memory _returnData = new bytes(_maxCopy);
|
|
85
|
+
// dispatch message to recipient
|
|
86
|
+
// by assembly calling "handle" function
|
|
87
|
+
// we call via assembly to avoid memcopying a very large returndata
|
|
88
|
+
// returned by a malicious contract
|
|
89
|
+
assembly {
|
|
90
|
+
_success := staticcall(
|
|
91
|
+
_gas, // gas
|
|
92
|
+
_target, // recipient
|
|
93
|
+
add(_calldata, 0x20), // inloc
|
|
94
|
+
mload(_calldata), // inlen
|
|
95
|
+
0, // outloc
|
|
96
|
+
0 // outlen
|
|
97
|
+
)
|
|
98
|
+
// limit our copy to 256 bytes
|
|
99
|
+
_toCopy := returndatasize()
|
|
100
|
+
if gt(_toCopy, _maxCopy) {
|
|
101
|
+
_toCopy := _maxCopy
|
|
102
|
+
}
|
|
103
|
+
// Store the length of the copied bytes
|
|
104
|
+
mstore(_returnData, _toCopy)
|
|
105
|
+
// copy the bytes from returndata[0:_toCopy]
|
|
106
|
+
returndatacopy(add(_returnData, 0x20), 0, _toCopy)
|
|
107
|
+
}
|
|
108
|
+
return (_success, _returnData);
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* @notice Swaps function selectors in encoded contract calls
|
|
113
|
+
* @dev Allows reuse of encoded calldata for functions with identical
|
|
114
|
+
* argument types but different names. It simply swaps out the first 4 bytes
|
|
115
|
+
* for the new selector. This function modifies memory in place, and should
|
|
116
|
+
* only be used with caution.
|
|
117
|
+
* @param _newSelector The new 4-byte selector
|
|
118
|
+
* @param _buf The encoded contract args
|
|
119
|
+
*/
|
|
120
|
+
function swapSelector(bytes4 _newSelector, bytes memory _buf) internal pure {
|
|
121
|
+
require(_buf.length >= 4);
|
|
122
|
+
uint256 _mask = LOW_28_MASK;
|
|
123
|
+
assembly {
|
|
124
|
+
// load the first word of
|
|
125
|
+
let _word := mload(add(_buf, 0x20))
|
|
126
|
+
// mask out the top 4 bytes
|
|
127
|
+
// /x
|
|
128
|
+
_word := and(_word, _mask)
|
|
129
|
+
_word := or(_newSelector, _word)
|
|
130
|
+
mstore(add(_buf, 0x20), _word)
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
2
|
+
pragma solidity 0.8.17;
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
library LayerZeroHelper {
|
|
6
|
+
uint256 constant EVM_ADDRESS_SIZE = 20;
|
|
7
|
+
|
|
8
|
+
function _getLayerZeroChainIds(uint256 chainId) internal pure returns (uint16) {
|
|
9
|
+
if (chainId == 43113) return 10106; // fuji testnet
|
|
10
|
+
else if (chainId == 80001) return 10109; // mumbai testnet
|
|
11
|
+
else if (chainId == 43114) return 106; // avax mainnet
|
|
12
|
+
assert(false);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
function _getOriginalChainIds(uint16 chainId) internal pure returns (uint256) {
|
|
16
|
+
if (chainId == 10106) return 43113; // fuji testnet
|
|
17
|
+
else if (chainId == 10109) return 80001; // mumbai testnet
|
|
18
|
+
else if (chainId == 106) return 43114; // avax mainnet
|
|
19
|
+
assert(false);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
function _getFirstAddressFromPath(bytes memory path) internal pure returns (address dst) {
|
|
23
|
+
assembly {
|
|
24
|
+
dst := mload(add(add(path, EVM_ADDRESS_SIZE), 0))
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -21,7 +21,7 @@ Voting accounting:
|
|
|
21
21
|
will receive both of the reward pack
|
|
22
22
|
- Each pack of money will has it own id as timestamp, a gauge controller does not
|
|
23
23
|
receive a pack of money with the same id twice, this allow governance to rebroadcast
|
|
24
|
-
in case the last message was corrupted by
|
|
24
|
+
in case the last message was corrupted by LayerZero
|
|
25
25
|
|
|
26
26
|
Pros:
|
|
27
27
|
- If governance does not forget broadcasting the reward on the early of the week,
|
|
@@ -47,9 +47,13 @@ contract PendleVotingControllerUpg is
|
|
|
47
47
|
using EnumerableMap for EnumerableMap.UintToAddressMap;
|
|
48
48
|
using EnumerableSet for EnumerableSet.AddressSet;
|
|
49
49
|
|
|
50
|
-
constructor(
|
|
50
|
+
constructor(
|
|
51
|
+
address _vePendle,
|
|
52
|
+
address _pendleMsgSendEndpoint,
|
|
53
|
+
uint256 initialApproxDestinationGas
|
|
54
|
+
)
|
|
51
55
|
VotingControllerStorageUpg(_vePendle)
|
|
52
|
-
PendleMsgSenderAppUpg(_pendleMsgSendEndpoint) // constructor only set immutable variables
|
|
56
|
+
PendleMsgSenderAppUpg(_pendleMsgSendEndpoint, initialApproxDestinationGas) // constructor only set immutable variables
|
|
53
57
|
initializer
|
|
54
58
|
//solhint-disable-next-line
|
|
55
59
|
{
|
|
@@ -196,7 +200,7 @@ contract PendleVotingControllerUpg is
|
|
|
196
200
|
}
|
|
197
201
|
|
|
198
202
|
/**
|
|
199
|
-
* @notice use the gov-privilege to force broadcast a message in case there are issues with
|
|
203
|
+
* @notice use the gov-privilege to force broadcast a message in case there are issues with LayerZero
|
|
200
204
|
* @dev it's intentional for this function to have minimal checks since we assume gov has done the
|
|
201
205
|
due diligence
|
|
202
206
|
* @dev gov should always call finalizeEpoch beforehand
|
|
@@ -232,12 +236,7 @@ contract PendleVotingControllerUpg is
|
|
|
232
236
|
address[] memory pools = new address[](length);
|
|
233
237
|
uint256[] memory totalPendleAmounts = new uint256[](length);
|
|
234
238
|
|
|
235
|
-
return
|
|
236
|
-
pendleMsgSendEndpoint.calcFee(
|
|
237
|
-
destinationContracts.get(chainId),
|
|
238
|
-
chainId,
|
|
239
|
-
abi.encode(uint128(0), pools, totalPendleAmounts)
|
|
240
|
-
);
|
|
239
|
+
return _getSendMessageFee(chainId, abi.encode(uint128(0), pools, totalPendleAmounts));
|
|
241
240
|
}
|
|
242
241
|
|
|
243
242
|
/*///////////////////////////////////////////////////////////////
|
|
@@ -43,10 +43,11 @@ contract VotingEscrowPendleMainchain is
|
|
|
43
43
|
// to ask for their vePendle balance at any wTime
|
|
44
44
|
mapping(address => Checkpoints.History) internal userHistory;
|
|
45
45
|
|
|
46
|
-
constructor(
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
46
|
+
constructor(
|
|
47
|
+
IERC20 _pendle,
|
|
48
|
+
address _pendleMsgSendEndpoint,
|
|
49
|
+
uint256 initialApproxDestinationGas
|
|
50
|
+
) initializer PendleMsgSenderAppUpg(_pendleMsgSendEndpoint, initialApproxDestinationGas) {
|
|
50
51
|
pendle = _pendle;
|
|
51
52
|
__BoringOwnable_init();
|
|
52
53
|
}
|
|
@@ -177,30 +178,20 @@ contract VotingEscrowPendleMainchain is
|
|
|
177
178
|
function getBroadcastSupplyFee(uint256[] calldata chainIds)
|
|
178
179
|
external
|
|
179
180
|
view
|
|
180
|
-
returns (uint256
|
|
181
|
+
returns (uint256 fee)
|
|
181
182
|
{
|
|
182
|
-
fees = new uint256[](chainIds.length);
|
|
183
183
|
for (uint256 i = 0; i < chainIds.length; i++) {
|
|
184
|
-
|
|
185
|
-
destinationContracts.get(chainIds[i]),
|
|
186
|
-
chainIds[i],
|
|
187
|
-
SAMPLE_SUPPLY_UPDATE_MESSAGE
|
|
188
|
-
);
|
|
184
|
+
fee += _getSendMessageFee(chainIds[i], SAMPLE_SUPPLY_UPDATE_MESSAGE);
|
|
189
185
|
}
|
|
190
186
|
}
|
|
191
187
|
|
|
192
188
|
function getBroadcastPositionFee(uint256[] calldata chainIds)
|
|
193
189
|
external
|
|
194
190
|
view
|
|
195
|
-
returns (uint256
|
|
191
|
+
returns (uint256 fee)
|
|
196
192
|
{
|
|
197
|
-
fees = new uint256[](chainIds.length);
|
|
198
193
|
for (uint256 i = 0; i < chainIds.length; i++) {
|
|
199
|
-
|
|
200
|
-
destinationContracts.get(chainIds[i]),
|
|
201
|
-
chainIds[i],
|
|
202
|
-
SAMPLE_POSITION_UPDATE_MESSAGE
|
|
203
|
-
);
|
|
194
|
+
fee += _getSendMessageFee(chainIds[i], SAMPLE_POSITION_UPDATE_MESSAGE);
|
|
204
195
|
}
|
|
205
196
|
}
|
|
206
197
|
|
|
@@ -295,11 +286,6 @@ contract VotingEscrowPendleMainchain is
|
|
|
295
286
|
emit BroadcastTotalSupply(supply, chainIds);
|
|
296
287
|
}
|
|
297
288
|
|
|
298
|
-
function _afterAddDestinationContract(address, uint256 chainId) internal virtual override {
|
|
299
|
-
(VeBalance memory supply, uint128 wTime) = _applySlopeChange();
|
|
300
|
-
_broadcast(chainId, wTime, supply, EMPTY_BYTES);
|
|
301
|
-
}
|
|
302
|
-
|
|
303
289
|
function _broadcast(
|
|
304
290
|
uint256 chainId,
|
|
305
291
|
uint128 wTime,
|