@pendle/core-v2 6.2.2 → 6.3.0-fee-setter
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/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 +20 -2
- package/build/artifacts/contracts/LiquidityMining/GaugeController/PendleGaugeControllerSidechainUpg.sol/PendleGaugeControllerSidechainUpg.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/GaugeController/PendleGaugeControllerSidechainUpg.sol/PendleGaugeControllerSidechainUpg.json +20 -2
- package/build/artifacts/contracts/LiquidityMining/PendleMultiTokenMerkleDistributor.sol/PendleMultiTokenMerkleDistributor.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/PendleMultiTokenMerkleDistributor.sol/PendleMultiTokenMerkleDistributor.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 +6 -24
- package/build/artifacts/contracts/LiquidityMining/VotingController/VotingControllerStorageUpg.sol/VotingControllerStorageUpg.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/VotingEscrow/VotingEscrowPendleMainchain.sol/VotingEscrowPendleMainchain.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/VotingEscrow/VotingEscrowPendleMainchain.sol/VotingEscrowPendleMainchain.json +2 -2
- package/build/artifacts/contracts/LiquidityMining/VotingEscrow/VotingEscrowPendleSidechain.sol/VotingEscrowPendleSidechain.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/VotingEscrow/VotingEscrowPendleSidechain.sol/VotingEscrowPendleSidechain.json +2 -2
- package/build/artifacts/contracts/LiquidityMining/VotingEscrow/VotingEscrowTokenBase.sol/VotingEscrowTokenBase.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/libraries/VeBalanceLib.sol/VeBalanceLib.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/libraries/VeBalanceLib.sol/VeBalanceLib.json +2 -2
- package/build/artifacts/contracts/LiquidityMining/libraries/VeHistoryLib.sol/CheckpointHelper.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/libraries/VeHistoryLib.sol/CheckpointHelper.json +2 -2
- package/build/artifacts/contracts/LiquidityMining/libraries/VeHistoryLib.sol/Checkpoints.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/libraries/VeHistoryLib.sol/Checkpoints.json +2 -2
- package/build/artifacts/contracts/core/Market/MarketMathCore.sol/MarketMathCore.dbg.json +1 -1
- package/build/artifacts/contracts/core/Market/MarketMathCore.sol/MarketMathCore.json +2 -2
- package/build/artifacts/contracts/core/Market/OracleLib.sol/OracleLib.dbg.json +1 -1
- package/build/artifacts/contracts/core/Market/OracleLib.sol/OracleLib.json +2 -2
- package/build/artifacts/contracts/core/Market/PendleGauge.sol/PendleGauge.dbg.json +1 -1
- package/build/artifacts/contracts/core/Market/PendleGauge.sol/PendleGauge.json +19 -0
- package/build/artifacts/contracts/core/Market/PendleMarketFactoryV6Upg.sol/PendleMarketFactoryV6Upg.dbg.json +4 -0
- package/build/artifacts/contracts/core/Market/PendleMarketFactoryV6Upg.sol/PendleMarketFactoryV6Upg.json +636 -0
- package/build/artifacts/contracts/core/Market/PendleMarketV6.sol/PendleMarketV6.dbg.json +4 -0
- package/build/artifacts/contracts/core/Market/PendleMarketV6.sol/PendleMarketV6.json +1181 -0
- 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/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 +28 -2
- package/build/artifacts/contracts/core/YieldContracts/PendleYieldContractFactoryUpg.sol/PendleYieldContractFactoryUpg.dbg.json +4 -0
- package/build/artifacts/contracts/core/YieldContracts/PendleYieldContractFactoryUpg.sol/PendleYieldContractFactoryUpg.json +608 -0
- package/build/artifacts/contracts/core/YieldContracts/PendleYieldToken.sol/PendleYieldToken.dbg.json +1 -1
- package/build/artifacts/contracts/core/YieldContracts/PendleYieldToken.sol/PendleYieldToken.json +28 -2
- package/build/artifacts/contracts/core/erc20/PendleERC20.sol/PendleERC20.dbg.json +1 -1
- package/build/artifacts/contracts/core/erc20/PendleERC20.sol/PendleERC20.json +15 -2
- package/build/artifacts/contracts/core/libraries/Errors.sol/Errors.dbg.json +1 -1
- package/build/artifacts/contracts/core/libraries/Errors.sol/Errors.json +27 -2
- package/build/artifacts/contracts/core/libraries/StringLib.sol/StringLib.dbg.json +1 -1
- package/build/artifacts/contracts/core/libraries/StringLib.sol/StringLib.json +2 -2
- package/build/artifacts/contracts/deprecated/VeDistributor/PendleFeeDistributor.sol/PendleFeeDistributor.dbg.json +1 -1
- package/build/artifacts/contracts/deprecated/VeDistributor/PendleFeeDistributor.sol/PendleFeeDistributor.json +2 -2
- package/build/artifacts/contracts/deprecated/VeDistributor/PendleFeeDistributorV2.sol/PendleFeeDistributorV2.dbg.json +1 -1
- package/build/artifacts/contracts/deprecated/VeDistributor/PendleFeeDistributorV2.sol/PendleFeeDistributorV2.json +2 -2
- package/build/artifacts/contracts/interfaces/IPActionAddRemoveLiqV3.sol/IPActionAddRemoveLiqV3.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPActionCallbackV3.sol/IPActionCallbackV3.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPActionMarketAuxStatic.sol/IPActionMarketAuxStatic.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPActionMarketCoreStatic.sol/IPActionMarketCoreStatic.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPActionMiscV3.sol/IPActionMiscV3.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPActionSimple.sol/IPActionSimple.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPActionStorageStatic.sol/IPActionStorageStatic.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPActionStorageV4.sol/IPActionStorageV4.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPActionSwapPTV3.sol/IPActionSwapPTV3.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPActionSwapYTV3.sol/IPActionSwapYTV3.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPAllActionV3.sol/IPAllActionV3.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPAllEventsV3.sol/IPActionAddRemoveLiqV3Events.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPAllEventsV3.sol/IPActionMiscV3Events.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPAllEventsV3.sol/IPActionStorageEvents.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPAllEventsV3.sol/IPActionSwapPTV3Events.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPAllEventsV3.sol/IPActionSwapYTV3Events.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPAllEventsV3.sol/IPAllEventsV3.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPExchangeRateOracleApp.sol/IPExchangeRateOracleApp.dbg.json +4 -0
- package/build/artifacts/contracts/interfaces/IPExchangeRateOracleApp.sol/IPExchangeRateOracleApp.json +282 -0
- package/build/artifacts/contracts/interfaces/IPGauge.sol/IPGauge.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPGauge.sol/IPGauge.json +19 -0
- package/build/artifacts/contracts/interfaces/IPLimitRouter.sol/IPLimitOrderType.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPLimitRouter.sol/IPLimitRouter.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPLimitRouter.sol/IPLimitRouter.json +42 -0
- package/build/artifacts/contracts/interfaces/IPLimitRouter.sol/IPLimitRouterCallback.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPMarket.sol/IPMarket.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPMarket.sol/IPMarket.json +71 -0
- package/build/artifacts/contracts/interfaces/IPMarketFactory.sol/IPMarketFactory.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPMarketFactory.sol/IPMarketFactory.json +81 -19
- package/build/artifacts/contracts/interfaces/IPPrincipalToken.sol/IPPrincipalToken.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPPrincipalToken.sol/IPPrincipalToken.json +26 -0
- package/build/artifacts/contracts/interfaces/IPRouterStatic.sol/IPRouterStatic.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 +13 -0
- package/build/artifacts/contracts/interfaces/IPYieldToken.sol/IPYieldToken.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPYieldToken.sol/IPYieldToken.json +26 -0
- package/build/artifacts/contracts/limit/LimitMathCore.sol/LimitMathCore.dbg.json +1 -1
- package/build/artifacts/contracts/limit/LimitMathCore.sol/LimitMathCore.json +2 -2
- package/build/artifacts/contracts/limit/LimitRouterBase.sol/LimitRouterBase.dbg.json +1 -1
- package/build/artifacts/contracts/limit/PendleLimitRouter.sol/PendleLimitRouter.dbg.json +1 -1
- package/build/artifacts/contracts/limit/PendleLimitRouter.sol/PendleLimitRouter.json +2 -2
- package/build/artifacts/contracts/offchain-helpers/BalanceReader.sol/BalanceReader.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/BalanceReader.sol/BalanceReader.json +2 -2
- package/build/artifacts/contracts/offchain-helpers/Broadcaster.sol/Broadcaster.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/Broadcaster.sol/Broadcaster.json +2 -2
- package/build/artifacts/contracts/offchain-helpers/ExpiredLpPtRedeemer.sol/ExpiredLpPtRedeemer.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/ExpiredLpPtRedeemer.sol/ExpiredLpPtRedeemer.json +2 -2
- package/build/artifacts/contracts/offchain-helpers/LimitBackendHelperV2.sol/LimitBackendHelperV2.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/LimitBackendHelperV2.sol/LimitBackendHelperV2.json +2 -2
- package/build/artifacts/contracts/offchain-helpers/PendleFeeSetter.sol/PendleFeeSetter.dbg.json +4 -0
- package/build/artifacts/contracts/offchain-helpers/PendleFeeSetter.sol/PendleFeeSetter.json +326 -0
- package/build/artifacts/contracts/offchain-helpers/PendleLPWrapper.sol/PendleLPWrapper.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/PendleLPWrapper.sol/PendleLPWrapper.json +15 -2
- package/build/artifacts/contracts/offchain-helpers/PendleLPWrapperFactory.sol/PendleLPWrapperFactory.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/PendleLPWrapperFactory.sol/PendleLPWrapperFactory.json +2 -2
- package/build/artifacts/contracts/offchain-helpers/SimulateHelper.sol/SimulateHelper.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/SimulateHelper.sol/SimulateHelper.json +2 -2
- package/build/artifacts/contracts/offchain-helpers/deploy/PendleCommonPoolDeployHelperV2.sol/PendleCommonPoolDeployHelperV2.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/deploy/PendleCommonPoolDeployHelperV2.sol/PendleCommonPoolDeployHelperV2.json +7 -2
- package/build/artifacts/contracts/offchain-helpers/deploy/PendlePoolDeployHelper.sol/PendlePoolDeployHelper.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/deploy/PendlePoolDeployHelper.sol/PendlePoolDeployHelper.json +2 -2
- package/build/artifacts/contracts/offchain-helpers/deploy/PendlePoolDeployHelperV2.sol/PendlePoolDeployHelperV2.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/deploy/PendlePoolDeployHelperV2.sol/PendlePoolDeployHelperV2.json +2 -2
- package/build/artifacts/contracts/offchain-helpers/router-static/PendleRouterStatic.sol/PendleRouterStatic.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/router-static/PendleRouterStatic.sol/PendleRouterStatic.json +2 -2
- package/build/artifacts/contracts/offchain-helpers/router-static/base/ActionInfoStatic.sol/ActionInfoStatic.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/router-static/base/ActionInfoStatic.sol/ActionInfoStatic.json +2 -2
- package/build/artifacts/contracts/offchain-helpers/router-static/base/ActionMarketAuxStatic.sol/ActionMarketAuxStatic.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/router-static/base/ActionMarketAuxStatic.sol/ActionMarketAuxStatic.json +2 -2
- package/build/artifacts/contracts/offchain-helpers/router-static/base/ActionMarketCoreStatic.sol/ActionMarketCoreStatic.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/router-static/base/ActionMarketCoreStatic.sol/ActionMarketCoreStatic.json +2 -2
- package/build/artifacts/contracts/offchain-helpers/router-static/base/ActionMintRedeemStatic.sol/ActionMintRedeemStatic.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/router-static/base/ActionMintRedeemStatic.sol/ActionMintRedeemStatic.json +2 -2
- package/build/artifacts/contracts/offchain-helpers/router-static/base/ActionStorageStatic.sol/ActionStorageStatic.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/router-static/base/ActionStorageStatic.sol/ActionStorageStatic.json +2 -2
- package/build/artifacts/contracts/offchain-helpers/router-static/base/ActionVePendleStatic.sol/ActionVePendleStatic.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/router-static/base/ActionVePendleStatic.sol/ActionVePendleStatic.json +2 -2
- package/build/artifacts/contracts/offchain-helpers/router-static/base/MarketApproxLibV1.sol/MarketApproxPtInLibV1.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/router-static/base/MarketApproxLibV1.sol/MarketApproxPtInLibV1.json +2 -2
- package/build/artifacts/contracts/offchain-helpers/router-static/base/MarketApproxLibV1.sol/MarketApproxPtOutLibV1.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/router-static/base/MarketApproxLibV1.sol/MarketApproxPtOutLibV1.json +2 -2
- package/build/artifacts/contracts/offchain-helpers/router-static/base/StorageLayout.sol/StorageLayout.dbg.json +1 -1
- package/build/artifacts/contracts/oracles/CrossChainOracle/base/PendleCrossChainOracleBaseApp_Init.sol/PendleCrossChainOracleBaseApp_Init.dbg.json +4 -0
- package/build/artifacts/contracts/oracles/CrossChainOracle/base/PendleCrossChainOracleBaseApp_Init.sol/PendleCrossChainOracleBaseApp_Init.json +533 -0
- package/build/artifacts/contracts/oracles/CrossChainOracle/exchangeRate/PendleExchangeRateOracleApp.sol/PendleExchangeRateOracleApp.dbg.json +4 -0
- package/build/artifacts/contracts/oracles/CrossChainOracle/exchangeRate/PendleExchangeRateOracleApp.sol/PendleExchangeRateOracleApp.json +889 -0
- package/build/artifacts/contracts/oracles/CrossChainOracle/exchangeRate/PendleExchangeRateOracleV2.sol/PendleExchangeRateOracleV2.dbg.json +4 -0
- package/build/artifacts/contracts/oracles/CrossChainOracle/exchangeRate/PendleExchangeRateOracleV2.sol/PendleExchangeRateOracleV2.json +84 -0
- package/build/artifacts/contracts/oracles/CrossChainOracle/libraries/ExchangeRateMsgCodec.sol/ExchangeRateMsgCodec.dbg.json +4 -0
- package/build/artifacts/contracts/oracles/CrossChainOracle/libraries/ExchangeRateMsgCodec.sol/ExchangeRateMsgCodec.json +24 -0
- package/build/artifacts/contracts/oracles/PtYtLpOracle/PendleLpOracleLib.sol/PendleLpOracleLib.dbg.json +1 -1
- package/build/artifacts/contracts/oracles/PtYtLpOracle/PendleLpOracleLib.sol/PendleLpOracleLib.json +2 -2
- package/build/artifacts/contracts/oracles/PtYtLpOracle/PendlePYLpOracle.sol/PendlePYLpOracle.dbg.json +1 -1
- package/build/artifacts/contracts/oracles/PtYtLpOracle/PendlePYLpOracle.sol/PendlePYLpOracle.json +2 -2
- package/build/artifacts/contracts/oracles/PtYtLpOracle/PendlePYOracleLib.sol/PendlePYOracleLib.dbg.json +1 -1
- package/build/artifacts/contracts/oracles/PtYtLpOracle/PendlePYOracleLib.sol/PendlePYOracleLib.json +2 -2
- package/build/artifacts/contracts/oracles/PtYtLpOracle/chainlink/PendleChainlinkOracle.sol/PendleChainlinkOracle.dbg.json +1 -1
- package/build/artifacts/contracts/oracles/PtYtLpOracle/chainlink/PendleChainlinkOracle.sol/PendleChainlinkOracle.json +2 -2
- package/build/artifacts/contracts/oracles/PtYtLpOracle/chainlink/PendleChainlinkOracleFactory.sol/PendleChainlinkOracleFactory.dbg.json +1 -1
- package/build/artifacts/contracts/oracles/PtYtLpOracle/chainlink/PendleChainlinkOracleFactory.sol/PendleChainlinkOracleFactory.json +2 -2
- package/build/artifacts/contracts/oracles/PtYtLpOracle/chainlink/PendleChainlinkOracleWithQuote.sol/PendleChainlinkOracleWithQuote.dbg.json +1 -1
- package/build/artifacts/contracts/oracles/PtYtLpOracle/chainlink/PendleChainlinkOracleWithQuote.sol/PendleChainlinkOracleWithQuote.json +2 -2
- package/build/artifacts/contracts/oracles/PtYtLpOracle/samples/BoringLpSeller.sol/BoringLpSeller.dbg.json +1 -1
- package/build/artifacts/contracts/oracles/PtYtLpOracle/samples/BoringPYUsdChainlinkAssetOracle.sol/BoringPYUsdChainlinkAssetOracle.dbg.json +1 -1
- package/build/artifacts/contracts/oracles/PtYtLpOracle/samples/BoringPYUsdChainlinkAssetOracle.sol/BoringPYUsdChainlinkAssetOracle.json +2 -2
- package/build/artifacts/contracts/oracles/PtYtLpOracle/samples/BoringPYUsdChainlinkSYOracle.sol/BoringPYUsdChainlinkSYOracle.dbg.json +1 -1
- package/build/artifacts/contracts/oracles/PtYtLpOracle/samples/BoringPYUsdChainlinkSYOracle.sol/BoringPYUsdChainlinkSYOracle.json +2 -2
- package/build/artifacts/contracts/oracles/PtYtLpOracle/samples/BoringPtSeller.sol/BoringPtSeller.dbg.json +1 -1
- package/build/artifacts/contracts/oracles/StatelessWrapper/PendleSparkLinearDiscountOracleFactoryWrapper.sol/PendleSparkLinearDiscountOracleFactoryWrapper.dbg.json +1 -1
- package/build/artifacts/contracts/oracles/StatelessWrapper/PendleSparkLinearDiscountOracleFactoryWrapper.sol/PendleSparkLinearDiscountOracleFactoryWrapper.json +2 -2
- package/build/artifacts/contracts/oracles/internal/PendleSparkLinearDiscountOracleFactory.sol/PendleSparkLinearDiscountOracleFactory.dbg.json +1 -1
- package/build/artifacts/contracts/oracles/internal/PendleSparkLinearDiscountOracleFactory.sol/PendleSparkLinearDiscountOracleFactory.json +2 -2
- package/build/artifacts/contracts/router/ActionAddRemoveLiqV3.sol/ActionAddRemoveLiqV3.dbg.json +1 -1
- package/build/artifacts/contracts/router/ActionAddRemoveLiqV3.sol/ActionAddRemoveLiqV3.json +2 -2
- package/build/artifacts/contracts/router/ActionCallbackV3.sol/ActionCallbackV3.dbg.json +1 -1
- package/build/artifacts/contracts/router/ActionCallbackV3.sol/ActionCallbackV3.json +2 -2
- package/build/artifacts/contracts/router/ActionMiscV3.sol/ActionMiscV3.dbg.json +1 -1
- package/build/artifacts/contracts/router/ActionMiscV3.sol/ActionMiscV3.json +2 -2
- package/build/artifacts/contracts/router/ActionSimple.sol/ActionSimple.dbg.json +1 -1
- package/build/artifacts/contracts/router/ActionSimple.sol/ActionSimple.json +2 -2
- package/build/artifacts/contracts/router/ActionStorageV4.sol/ActionStorageV4.dbg.json +1 -1
- package/build/artifacts/contracts/router/ActionStorageV4.sol/ActionStorageV4.json +2 -2
- package/build/artifacts/contracts/router/ActionSwapPTV3.sol/ActionSwapPTV3.dbg.json +1 -1
- package/build/artifacts/contracts/router/ActionSwapPTV3.sol/ActionSwapPTV3.json +2 -2
- package/build/artifacts/contracts/router/ActionSwapYTV3.sol/ActionSwapYTV3.dbg.json +1 -1
- package/build/artifacts/contracts/router/ActionSwapYTV3.sol/ActionSwapYTV3.json +2 -2
- package/build/artifacts/contracts/router/PendleRouterV4.sol/PendleRouterV4.dbg.json +1 -1
- package/build/artifacts/contracts/router/PendleRouterV4.sol/PendleRouterV4.json +2 -2
- package/build/artifacts/contracts/router/Reflector.sol/Reflector.dbg.json +1 -1
- package/build/artifacts/contracts/router/Reflector.sol/Reflector.json +2 -2
- package/build/artifacts/contracts/router/base/ActionBase.sol/ActionBase.dbg.json +1 -1
- package/build/artifacts/contracts/router/base/ActionDelegateBase.sol/ActionDelegateBase.dbg.json +1 -1
- package/build/artifacts/contracts/router/base/ActionDelegateBase.sol/ActionDelegateBase.json +2 -2
- package/build/artifacts/contracts/router/base/CallbackHelper.sol/CallbackHelper.dbg.json +1 -1
- package/build/artifacts/contracts/router/math/ApproxStateLib.sol/ApproxStateLib.dbg.json +1 -1
- package/build/artifacts/contracts/router/math/ApproxStateLib.sol/ApproxStateLib.json +2 -2
- package/build/artifacts/contracts/router/math/MarketApproxEstimateLib.sol/MarketApproxEstimateLib.dbg.json +1 -1
- package/build/artifacts/contracts/router/math/MarketApproxEstimateLib.sol/MarketApproxEstimateLib.json +2 -2
- package/build/artifacts/contracts/router/math/MarketApproxLibOnchain.sol/MarketApproxPtInLibOnchain.dbg.json +1 -1
- package/build/artifacts/contracts/router/math/MarketApproxLibOnchain.sol/MarketApproxPtInLibOnchain.json +2 -2
- package/build/artifacts/contracts/router/math/MarketApproxLibOnchain.sol/MarketApproxPtOutLibOnchain.dbg.json +1 -1
- package/build/artifacts/contracts/router/math/MarketApproxLibOnchain.sol/MarketApproxPtOutLibOnchain.json +2 -2
- package/build/artifacts/contracts/router/math/MarketApproxLibV2.sol/MarketApproxPtInLibV2.dbg.json +1 -1
- package/build/artifacts/contracts/router/math/MarketApproxLibV2.sol/MarketApproxPtInLibV2.json +2 -2
- package/build/artifacts/contracts/router/math/MarketApproxLibV2.sol/MarketApproxPtOutLibV2.dbg.json +1 -1
- package/build/artifacts/contracts/router/math/MarketApproxLibV2.sol/MarketApproxPtOutLibV2.json +2 -2
- package/build/artifacts/contracts/router/swap-aggregator/OKXScaleHelper.sol/IOKXDexRouter.dbg.json +1 -1
- package/build/artifacts/contracts/router/swap-aggregator/OKXScaleHelper.sol/OKXScaleHelper.dbg.json +1 -1
- package/build/artifacts/contracts/router/swap-aggregator/OKXScaleHelper.sol/OKXScaleHelper.json +15 -1
- package/build/artifacts/contracts/router/swap-aggregator/PendleSwap.sol/IKyberScalingHelper.dbg.json +1 -1
- package/build/artifacts/contracts/router/swap-aggregator/PendleSwap.sol/IOdosRouterV2.dbg.json +1 -1
- package/build/artifacts/contracts/router/swap-aggregator/PendleSwap.sol/PendleSwap.dbg.json +1 -1
- package/build/artifacts/contracts/router/swap-aggregator/PendleSwap.sol/PendleSwap.json +22 -3
- package/contracts/LiquidityMining/GaugeController/PendleGaugeControllerBaseUpg.sol +6 -2
- package/contracts/LiquidityMining/GaugeController/PendleGaugeControllerMainchainUpg.sol +12 -2
- package/contracts/LiquidityMining/GaugeController/PendleGaugeControllerSidechainUpg.sol +9 -1
- package/contracts/LiquidityMining/VotingController/PendleVotingControllerUpg.sol +10 -14
- package/contracts/core/Market/PendleGauge.sol +2 -0
- package/contracts/core/Market/{v3/PendleMarketFactoryV3.sol → PendleMarketFactoryV6Upg.sol} +18 -14
- package/contracts/core/Market/{v3/PendleMarketV3.sol → PendleMarketV6.sol} +48 -13
- package/contracts/core/YieldContracts/PendlePrincipalToken.sol +6 -0
- package/contracts/core/YieldContracts/{PendleYieldContractFactory.sol → PendleYieldContractFactoryUpg.sol} +10 -13
- package/contracts/core/YieldContracts/PendleYieldToken.sol +6 -0
- package/contracts/core/erc20/PendleERC20.sol +12 -0
- package/contracts/core/libraries/Errors.sol +7 -0
- package/contracts/core/libraries/StringLib.sol +12 -0
- package/contracts/interfaces/IPExchangeRateOracleApp.sol +86 -0
- package/contracts/interfaces/IPGauge.sol +4 -3
- package/contracts/interfaces/IPLimitRouter.sol +4 -0
- package/contracts/interfaces/IPMarket.sol +10 -2
- package/contracts/interfaces/IPMarketFactory.sol +22 -10
- package/contracts/interfaces/IPPrincipalToken.sol +4 -0
- package/contracts/interfaces/IPYieldContractFactory.sol +2 -0
- package/contracts/interfaces/IPYieldToken.sol +4 -0
- package/contracts/offchain-helpers/PendleFeeSetter.sol +159 -0
- package/contracts/offchain-helpers/deploy/PendleCommonPoolDeployHelperV2.sol +10 -10
- package/contracts/offchain-helpers/deploy/PendlePoolDeployHelper.sol +6 -6
- package/contracts/offchain-helpers/deploy/PendlePoolDeployHelperV2.sol +3 -3
- package/contracts/oracles/CrossChainOracle/base/PendleCrossChainOracleBaseApp_Init.sol +23 -0
- package/contracts/oracles/CrossChainOracle/exchangeRate/PendleExchangeRateOracleApp.sol +160 -0
- package/contracts/oracles/CrossChainOracle/exchangeRate/PendleExchangeRateOracleV2.sol +25 -0
- package/contracts/oracles/CrossChainOracle/libraries/ExchangeRateMsgCodec.sol +36 -0
- package/contracts/oracles/PtYtLpOracle/PendleLpOracleLib.sol +9 -0
- package/contracts/router/swap-aggregator/OKXScaleHelper.sol +14 -1
- package/contracts/router/swap-aggregator/PendleSwap.sol +1 -1
- package/deployments/1-core.json +1 -0
- package/deployments/1-offchain-helper.json +2 -1
- package/deployments/10-core.json +1 -0
- package/deployments/10-offchain-helper.json +2 -1
- package/deployments/146-core.json +4 -1
- package/deployments/146-offchain-helper.json +2 -1
- package/deployments/42161-core.json +4 -1
- package/deployments/42161-offchain-helper.json +2 -1
- package/deployments/5000-core.json +4 -1
- package/deployments/5000-offchain-helper.json +2 -1
- package/deployments/56-core.json +5 -1
- package/deployments/56-offchain-helper.json +2 -1
- package/deployments/80094-core.json +4 -1
- package/deployments/80094-offchain-helper.json +2 -1
- package/deployments/8453-core.json +4 -1
- package/deployments/8453-offchain-helper.json +2 -1
- package/deployments/9745-core.json +4 -1
- package/deployments/9745-offchain-helper.json +2 -1
- package/deployments/999-core.json +4 -1
- package/deployments/999-offchain-helper.json +2 -1
- package/package.json +2 -1
- package/typechain-types/ExchangeRateMsgCodec.ts +89 -0
- package/typechain-types/IPExchangeRateOracleApp.ts +352 -0
- package/typechain-types/IPGauge.ts +19 -0
- package/typechain-types/IPLimitRouter.ts +69 -0
- package/typechain-types/IPMarket.ts +89 -0
- package/typechain-types/IPMarketFactory.ts +146 -46
- package/typechain-types/IPPrincipalToken.ts +34 -0
- package/typechain-types/IPYieldContractFactory.ts +13 -0
- package/typechain-types/IPYieldToken.ts +34 -0
- package/typechain-types/OAppCoreUpgradeable.ts +320 -0
- package/typechain-types/OAppOptionsType3Upgradeable.ts +319 -0
- package/typechain-types/OAppReceiverUpgradeable.ts +498 -0
- package/typechain-types/OAppSenderUpgradeable.ts +320 -0
- package/typechain-types/OAppUpgradeable.ts +498 -0
- package/typechain-types/OKXScaleHelper.ts +87 -0
- package/typechain-types/OwnableUpgradeable.ts +174 -0
- package/typechain-types/PendleCommonPoolDeployHelperV2.ts +7 -1
- package/typechain-types/PendleCrossChainOracleBaseApp_Init.ts +662 -0
- package/typechain-types/PendleERC20.ts +21 -0
- package/typechain-types/PendleExchangeRateOracleApp.ts +1012 -0
- package/typechain-types/PendleExchangeRateOracleV2.ts +142 -0
- package/typechain-types/PendleFeeSetter.ts +188 -3
- package/typechain-types/PendleGauge.ts +19 -0
- package/typechain-types/PendleGaugeControllerBaseUpg.ts +19 -0
- package/typechain-types/PendleGaugeControllerMainchainUpg.ts +19 -0
- package/typechain-types/PendleGaugeControllerSidechainUpg.ts +19 -0
- package/typechain-types/PendleLPWrapper.ts +21 -0
- package/typechain-types/PendleMarketFactoryV6Upg.ts +773 -0
- package/typechain-types/PendleMarketV6.ts +1248 -0
- package/typechain-types/PendlePrincipalToken.ts +34 -0
- package/typechain-types/PendleSwap.ts +19 -0
- package/typechain-types/PendleVotingControllerUpg.ts +18 -48
- package/typechain-types/PendleYieldContractFactoryUpg.ts +820 -0
- package/typechain-types/PendleYieldToken.ts +34 -0
- package/typechain-types/factories/ActionAddRemoveLiqV3__factory.ts +1 -1
- package/typechain-types/factories/ActionCallbackV3__factory.ts +1 -1
- package/typechain-types/factories/ActionInfoStatic__factory.ts +1 -1
- package/typechain-types/factories/ActionMarketAuxStatic__factory.ts +1 -1
- package/typechain-types/factories/ActionMarketCoreStatic__factory.ts +1 -1
- package/typechain-types/factories/ActionMintRedeemStatic__factory.ts +1 -1
- package/typechain-types/factories/ActionMiscV3__factory.ts +1 -1
- package/typechain-types/factories/ActionSimple__factory.ts +1 -1
- package/typechain-types/factories/ActionStorageStatic__factory.ts +1 -1
- package/typechain-types/factories/ActionStorageV4__factory.ts +1 -1
- package/typechain-types/factories/ActionSwapPTV3__factory.ts +1 -1
- package/typechain-types/factories/ActionSwapYTV3__factory.ts +1 -1
- package/typechain-types/factories/ActionVePendleStatic__factory.ts +1 -1
- package/typechain-types/factories/BalanceReader__factory.ts +1 -1
- package/typechain-types/factories/BoringPYUsdChainlinkAssetOracle__factory.ts +1 -1
- package/typechain-types/factories/BoringPYUsdChainlinkSYOracle__factory.ts +1 -1
- package/typechain-types/factories/Broadcaster__factory.ts +1 -1
- package/typechain-types/factories/Errors__factory.ts +26 -1
- package/typechain-types/factories/ExchangeRateMsgCodec__factory.ts +81 -0
- package/typechain-types/factories/ExpiredLpPtRedeemer__factory.ts +1 -1
- package/typechain-types/factories/IPExchangeRateOracleApp__factory.ts +301 -0
- package/typechain-types/factories/IPGauge__factory.ts +19 -0
- package/typechain-types/factories/IPLimitRouter__factory.ts +42 -0
- package/typechain-types/factories/IPMarketFactory__factory.ts +81 -19
- package/typechain-types/factories/IPMarket__factory.ts +71 -0
- package/typechain-types/factories/IPPrincipalToken__factory.ts +26 -0
- package/typechain-types/factories/IPYieldContractFactory__factory.ts +13 -0
- package/typechain-types/factories/IPYieldToken__factory.ts +26 -0
- package/typechain-types/factories/LimitBackendHelperV2__factory.ts +1 -1
- package/typechain-types/factories/OAppCoreUpgradeable__factory.ts +228 -0
- package/typechain-types/factories/OAppOptionsType3Upgradeable__factory.ts +219 -0
- package/typechain-types/factories/OAppReceiverUpgradeable__factory.ts +399 -0
- package/typechain-types/factories/OAppSenderUpgradeable__factory.ts +248 -0
- package/typechain-types/factories/OAppUpgradeable__factory.ts +411 -0
- package/typechain-types/factories/OKXScaleHelper__factory.ts +39 -0
- package/typechain-types/factories/OracleLib__factory.ts +1 -1
- package/typechain-types/factories/OwnableUpgradeable__factory.ts +91 -0
- package/typechain-types/factories/PendleChainlinkOracleFactory__factory.ts +1 -1
- package/typechain-types/factories/PendleChainlinkOracleWithQuote__factory.ts +1 -1
- package/typechain-types/factories/PendleChainlinkOracle__factory.ts +1 -1
- package/typechain-types/factories/PendleCommonPoolDeployHelperV2__factory.ts +6 -1
- package/typechain-types/factories/PendleCrossChainOracleBaseApp_Init__factory.ts +554 -0
- package/typechain-types/factories/PendleERC20__factory.ts +14 -1
- package/typechain-types/factories/PendleExchangeRateOracleApp__factory.ts +958 -0
- package/typechain-types/factories/PendleExchangeRateOracleV2__factory.ts +165 -0
- package/typechain-types/factories/PendleFeeDistributorV2__factory.ts +1 -1
- package/typechain-types/factories/PendleFeeDistributor__factory.ts +1 -1
- package/typechain-types/factories/PendleFeeSetter__factory.ts +140 -2
- package/typechain-types/factories/PendleGaugeControllerBaseUpg__factory.ts +13 -0
- package/typechain-types/factories/PendleGaugeControllerMainchainUpg__factory.ts +23 -1
- package/typechain-types/factories/PendleGaugeControllerSidechainUpg__factory.ts +23 -1
- package/typechain-types/factories/PendleGauge__factory.ts +19 -0
- package/typechain-types/factories/PendleLPWrapperFactory__factory.ts +1 -1
- package/typechain-types/factories/PendleLPWrapper__factory.ts +14 -1
- package/typechain-types/factories/PendleLimitRouter__factory.ts +1 -1
- package/typechain-types/factories/PendleMarketFactoryV6Upg__factory.ts +732 -0
- package/typechain-types/factories/PendleMarketV6__factory.ts +1261 -0
- package/typechain-types/factories/PendleMsgReceiveEndpointUpg__factory.ts +1 -1
- package/typechain-types/factories/PendleMsgSendEndpointUpg__factory.ts +1 -1
- package/typechain-types/factories/PendleMultiTokenMerkleDistributor__factory.ts +1 -1
- package/typechain-types/factories/PendlePYLpOracle__factory.ts +1 -1
- package/typechain-types/factories/PendlePoolDeployHelperV2__factory.ts +1 -1
- package/typechain-types/factories/PendlePoolDeployHelper__factory.ts +1 -1
- package/typechain-types/factories/PendlePrincipalToken__factory.ts +27 -1
- package/typechain-types/factories/PendleRouterStatic__factory.ts +1 -1
- package/typechain-types/factories/PendleRouterV4__factory.ts +1 -1
- package/typechain-types/factories/PendleSparkLinearDiscountOracleFactoryWrapper__factory.ts +1 -1
- package/typechain-types/factories/PendleSparkLinearDiscountOracleFactory__factory.ts +1 -1
- package/typechain-types/factories/PendleSwap__factory.ts +31 -4
- package/typechain-types/factories/PendleVotingControllerUpg__factory.ts +5 -23
- package/typechain-types/factories/PendleYieldContractFactoryUpg__factory.ts +692 -0
- package/typechain-types/factories/PendleYieldToken__factory.ts +27 -1
- package/typechain-types/factories/Reflector__factory.ts +1 -1
- package/typechain-types/factories/SimulateHelper__factory.ts +1 -1
- package/typechain-types/factories/VotingEscrowPendleMainchain__factory.ts +1 -1
- package/typechain-types/factories/VotingEscrowPendleSidechain__factory.ts +1 -1
- package/typechain-types/hardhat.d.ts +129 -57
- package/typechain-types/index.ts +32 -16
- package/build/artifacts/contracts/core/Market/v3/PendleMarketFactoryV3.sol/PendleMarketFactoryV3.dbg.json +0 -4
- package/build/artifacts/contracts/core/Market/v3/PendleMarketFactoryV3.sol/PendleMarketFactoryV3.json +0 -610
- package/build/artifacts/contracts/core/Market/v3/PendleMarketV3.sol/PendleMarketV3.dbg.json +0 -4
- package/build/artifacts/contracts/core/Market/v3/PendleMarketV3.sol/PendleMarketV3.json +0 -1131
- package/build/artifacts/contracts/core/YieldContracts/PendleYieldContractFactory.sol/PendleYieldContractFactory.dbg.json +0 -4
- package/build/artifacts/contracts/core/YieldContracts/PendleYieldContractFactory.sol/PendleYieldContractFactory.json +0 -590
- package/build/artifacts/contracts/core/erc20/PendleERC20Permit.sol/PendleERC20Permit.dbg.json +0 -4
- package/build/artifacts/contracts/core/erc20/PendleERC20Permit.sol/PendleERC20Permit.json +0 -394
- package/build/artifacts/contracts/core/erc20/PendleERC20PermitUpg.sol/PendleERC20PermitUpg.dbg.json +0 -4
- package/build/artifacts/contracts/core/erc20/PendleERC20PermitUpg.sol/PendleERC20PermitUpg.json +0 -370
- package/build/artifacts/contracts/core/erc20/PendleERC20Upg.sol/PendleERC20Upg.dbg.json +0 -4
- package/build/artifacts/contracts/core/erc20/PendleERC20Upg.sol/PendleERC20Upg.json +0 -246
- package/build/artifacts/contracts/interfaces/IPMarketFactoryV3.sol/IPMarketFactoryV3.dbg.json +0 -4
- package/build/artifacts/contracts/interfaces/IPMarketFactoryV3.sol/IPMarketFactoryV3.json +0 -202
- package/build/artifacts/contracts/interfaces/IPMarketV3.sol/IPMarketV3.dbg.json +0 -4
- package/build/artifacts/contracts/interfaces/IPMarketV3.sol/IPMarketV3.json +0 -833
- package/contracts/core/erc20/PendleERC20Permit.sol +0 -80
- package/contracts/core/erc20/PendleERC20PermitUpg.sol +0 -82
- package/contracts/core/erc20/PendleERC20Upg.sol +0 -334
- package/contracts/interfaces/IPMarketFactoryV3.sol +0 -33
- package/contracts/interfaces/IPMarketV3.sol +0 -8
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
2
|
+
pragma solidity ^0.8.0;
|
|
3
|
+
|
|
4
|
+
import {IPLimitRouter} from "../interfaces/IPLimitRouter.sol";
|
|
5
|
+
import {IPMarket, MarketState} from "../interfaces/IPMarket.sol";
|
|
6
|
+
import {IPMarketFactory} from "../interfaces/IPMarketFactory.sol";
|
|
7
|
+
import {IPYieldToken} from "../interfaces/IPYieldToken.sol";
|
|
8
|
+
import {IPGovernanceProxy} from "../interfaces/IPGovernanceProxy.sol";
|
|
9
|
+
|
|
10
|
+
import {PMath} from "../core/libraries/math/PMath.sol";
|
|
11
|
+
import {LogExpMath} from "../core/libraries/math/LogExpMath.sol";
|
|
12
|
+
import {BoringOwnableUpgradeableV2} from "../core/libraries/BoringOwnableUpgradeableV2.sol";
|
|
13
|
+
import {Errors} from "../core/libraries/Errors.sol";
|
|
14
|
+
|
|
15
|
+
contract PendleFeeSetter is BoringOwnableUpgradeableV2 {
|
|
16
|
+
using PMath for uint256;
|
|
17
|
+
using PMath for int256;
|
|
18
|
+
using LogExpMath for int256;
|
|
19
|
+
|
|
20
|
+
event FeeFactorSet(uint128 impliedRateToFeeFactor, uint128 routerLnFeeToLimitLnFeeFactor);
|
|
21
|
+
event SetterSet(address indexed setter);
|
|
22
|
+
|
|
23
|
+
uint256 internal constant LIMIT_MAX_LN_FEE_RATE_ROOT = 48790164169432003; // ln(1.05)
|
|
24
|
+
|
|
25
|
+
address public immutable router;
|
|
26
|
+
IPLimitRouter public immutable limitRouter;
|
|
27
|
+
IPGovernanceProxy public immutable govProxy;
|
|
28
|
+
|
|
29
|
+
uint128 public impliedRateToFeeFactor;
|
|
30
|
+
uint128 public routerLnFeeToLimitLnFeeFactor;
|
|
31
|
+
address public setter;
|
|
32
|
+
|
|
33
|
+
modifier onlyOwnerOrSetter() {
|
|
34
|
+
require(msg.sender == setter || msg.sender == owner, "not setter or owner");
|
|
35
|
+
_;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
constructor(address _router, address _limitRouter, address _govProxy) {
|
|
39
|
+
_disableInitializers();
|
|
40
|
+
router = _router;
|
|
41
|
+
limitRouter = IPLimitRouter(_limitRouter);
|
|
42
|
+
govProxy = IPGovernanceProxy(_govProxy);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
function initialize(
|
|
46
|
+
address _owner,
|
|
47
|
+
uint128 _impliedRateToFeeFactor,
|
|
48
|
+
uint128 _routerLnFeeToLimitLnFeeFactor
|
|
49
|
+
) external initializer {
|
|
50
|
+
__BoringOwnableV2_init(_owner);
|
|
51
|
+
_setFeeFactors(_impliedRateToFeeFactor, _routerLnFeeToLimitLnFeeFactor);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
function setFees(address[] memory markets) external onlyOwnerOrSetter {
|
|
55
|
+
uint256 n = markets.length;
|
|
56
|
+
|
|
57
|
+
IPGovernanceProxy.Call[] memory calls = new IPGovernanceProxy.Call[](n + 1);
|
|
58
|
+
|
|
59
|
+
address[] memory YTs = new address[](n);
|
|
60
|
+
uint256[] memory limitLnFeeRateRoots = new uint256[](n);
|
|
61
|
+
|
|
62
|
+
uint256 _impliedRateToFeeFactor = impliedRateToFeeFactor;
|
|
63
|
+
uint256 _routerLnFeeToLimitLnFeeFactor = routerLnFeeToLimitLnFeeFactor;
|
|
64
|
+
for (uint256 i = 0; i < n; ++i) {
|
|
65
|
+
(, , IPYieldToken yt) = IPMarket(markets[i]).readTokens();
|
|
66
|
+
(uint256 routerLnFeeRateRoot, uint256 limitLnFeeRateRoot) = _calcFee(
|
|
67
|
+
_impliedRateToFeeFactor,
|
|
68
|
+
_routerLnFeeToLimitLnFeeFactor,
|
|
69
|
+
markets[i]
|
|
70
|
+
);
|
|
71
|
+
|
|
72
|
+
YTs[i] = address(yt);
|
|
73
|
+
limitLnFeeRateRoots[i] = limitLnFeeRateRoot;
|
|
74
|
+
|
|
75
|
+
calls[i].target = IPMarket(markets[i]).factory();
|
|
76
|
+
calls[i].callData = abi.encodeCall(
|
|
77
|
+
IPMarketFactory.setOverriddenFee,
|
|
78
|
+
(router, markets[i], routerLnFeeRateRoot.Uint80())
|
|
79
|
+
);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
calls[n].target = address(limitRouter);
|
|
83
|
+
calls[n].callData = abi.encodeCall(
|
|
84
|
+
IPLimitRouter.setLnFeeRateRoots,
|
|
85
|
+
(YTs, limitLnFeeRateRoots, /* allowZeroFees */ false)
|
|
86
|
+
);
|
|
87
|
+
|
|
88
|
+
govProxy.aggregateWithScopedAccess(calls);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
function _calcFee(
|
|
92
|
+
uint256 _impliedRateToFeeFactor,
|
|
93
|
+
uint256 _routerLnFeeToLimitLnFeeFactor,
|
|
94
|
+
address market
|
|
95
|
+
) internal view returns (uint256 routerLnFeeRateRoot, uint256 limitLnFeeRateRoot) {
|
|
96
|
+
uint256 marketLnFee = IPMarket(market).getNonOverrideLnFeeRateRoot();
|
|
97
|
+
MarketState memory state = IPMarket(market).readState(router);
|
|
98
|
+
uint256 impliedRate = state.lastLnImpliedRate.Int().exp().Uint();
|
|
99
|
+
|
|
100
|
+
uint256 newFee = (impliedRate - PMath.ONE).mulDown(_impliedRateToFeeFactor) + PMath.ONE;
|
|
101
|
+
uint256 newLnFeeRateRoot = newFee.Int().ln().Uint();
|
|
102
|
+
|
|
103
|
+
routerLnFeeRateRoot = marketLnFee.min(newLnFeeRateRoot);
|
|
104
|
+
limitLnFeeRateRoot = LIMIT_MAX_LN_FEE_RATE_ROOT.min(
|
|
105
|
+
routerLnFeeRateRoot.mulDown(_routerLnFeeToLimitLnFeeFactor)
|
|
106
|
+
);
|
|
107
|
+
|
|
108
|
+
// Fix up `routerLnFeeRateRoot` for this case: https://github.com/pendle-finance/pendle-core-v2/blob/6169376d0a8c12030307e3d64d02e84b07ffe4f9/contracts/core/Market/v3/PendleMarketFactoryV3.sol#L131-L135
|
|
109
|
+
if (routerLnFeeRateRoot == marketLnFee) routerLnFeeRateRoot = 0;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
function readFeesAndImpliedRate(
|
|
113
|
+
address[] memory markets
|
|
114
|
+
)
|
|
115
|
+
external
|
|
116
|
+
view
|
|
117
|
+
returns (
|
|
118
|
+
uint256[] memory routerLnFeeRateRoots,
|
|
119
|
+
uint256[] memory limitLnFeeRateRoots,
|
|
120
|
+
uint256[] memory lnImpliedRates
|
|
121
|
+
)
|
|
122
|
+
{
|
|
123
|
+
uint256 n = markets.length;
|
|
124
|
+
routerLnFeeRateRoots = new uint256[](n);
|
|
125
|
+
limitLnFeeRateRoots = new uint256[](n);
|
|
126
|
+
lnImpliedRates = new uint256[](n);
|
|
127
|
+
|
|
128
|
+
for (uint256 i = 0; i < n; ++i) {
|
|
129
|
+
MarketState memory state = IPMarket(markets[i]).readState(router);
|
|
130
|
+
routerLnFeeRateRoots[i] = state.lnFeeRateRoot;
|
|
131
|
+
lnImpliedRates[i] = state.lastLnImpliedRate;
|
|
132
|
+
|
|
133
|
+
(, , IPYieldToken yt) = IPMarket(markets[i]).readTokens();
|
|
134
|
+
try limitRouter.getLnFeeRateRoot(address(yt)) returns (uint256 _fee) {
|
|
135
|
+
limitLnFeeRateRoots[i] = _fee;
|
|
136
|
+
} catch {
|
|
137
|
+
limitLnFeeRateRoots[i] = 0;
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
// ============================== Admin functions ==============================
|
|
143
|
+
|
|
144
|
+
function setFeeFactors(uint128 _impliedRateToFeeFactor, uint128 _routerLnFeeToLimitLnFeeFactor) external onlyOwner {
|
|
145
|
+
_setFeeFactors(_impliedRateToFeeFactor, _routerLnFeeToLimitLnFeeFactor);
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
function _setFeeFactors(uint128 _impliedRateToFeeFactor, uint128 _routerLnFeeToLimitLnFeeFactor) internal {
|
|
149
|
+
impliedRateToFeeFactor = _impliedRateToFeeFactor;
|
|
150
|
+
routerLnFeeToLimitLnFeeFactor = _routerLnFeeToLimitLnFeeFactor;
|
|
151
|
+
|
|
152
|
+
emit FeeFactorSet(_impliedRateToFeeFactor, _routerLnFeeToLimitLnFeeFactor);
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
function setSetter(address _setter) external onlyOwner {
|
|
156
|
+
setter = _setter;
|
|
157
|
+
emit SetterSet(setter);
|
|
158
|
+
}
|
|
159
|
+
}
|
|
@@ -7,15 +7,14 @@ import "../../interfaces/IOwnable.sol";
|
|
|
7
7
|
import "../../core/libraries/BoringOwnableUpgradeableV2.sol";
|
|
8
8
|
|
|
9
9
|
contract PendleCommonPoolDeployHelperV2 is PendlePoolDeployHelperV2, BoringOwnableUpgradeableV2 {
|
|
10
|
-
|
|
11
|
-
bytes32 public constant
|
|
12
|
-
bytes32 public constant
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
bytes32 public constant
|
|
16
|
-
bytes32 public constant
|
|
17
|
-
bytes32 public constant
|
|
18
|
-
bytes32 public constant ERC4626_NO_DEPOSIT_NO_REDEEM = keccak256("PendleERC4626NoRedeemNoDepositUpgSY"); // 0x5c1cddc0128e0b02bb711f84a022bf1c13177d4ab028830b702f3a77280025ea
|
|
10
|
+
bytes32 public constant ERC4626_DEPLOY_ID = keccak256("PendleERC4626SYV2"); // 0x1278efc0e6754cd30fef2df25ff5ced072ebb194d348b0b1b9548166d24352ef
|
|
11
|
+
bytes32 public constant ERC4626_NOT_REDEEMABLE_DEPLOY_ID = keccak256("PendleERC4626NotRedeemableToAssetSYV2"); // 0x6f089cd4afdd945c5c26b3f4542d0c294d19ec0e339c6ce4f8eafa94d700d05d
|
|
12
|
+
bytes32 public constant ERC20_DEPLOY_ID = keccak256("PendleERC20SY"); // 0xfcf22a9a515753d83e4f2a81cf368c7226408c64f52411ae95241ebf5ed53304
|
|
13
|
+
|
|
14
|
+
bytes32 public constant ERC4626_WITH_ADAPTER_ID = keccak256("PendleERC4626WithAdapterSY"); // 0x73f41560741d6765943d3c955034291fe23d9141e3a4719bc97422d5bf019adc
|
|
15
|
+
bytes32 public constant ERC4626_NO_REDEEM_WITH_ADAPTER_ID = keccak256("PendleERC4626NoRedeemWithAdapterSY"); // 0x3b8dd2b992f773444e5422ba1db289c4657c57110d740dca7975dc095632ef23
|
|
16
|
+
bytes32 public constant ERC20_WITH_ADAPTER_ID = keccak256("PendleERC20WithAdapterSY"); // 0xe5cce2b1999bf8c2cc4cf6d96d0569a24d8b782ba1647c09a8e1aa8bbfb98996
|
|
17
|
+
bytes32 public constant ERC4626_NO_DEPOSIT_NO_REDEEM = keccak256("PendleERC4626NoRedeemNoDepositUpgSY"); // 0x5c1cddc0128e0b02bb711f84a022bf1c13177d4ab028830b702f3a77280025ea
|
|
19
18
|
|
|
20
19
|
address public immutable syFactory;
|
|
21
20
|
|
|
@@ -36,12 +35,13 @@ contract PendleCommonPoolDeployHelperV2 is PendlePoolDeployHelperV2, BoringOwnab
|
|
|
36
35
|
function deployCommonMarketById(
|
|
37
36
|
bytes32 id,
|
|
38
37
|
bytes memory constructorParams,
|
|
38
|
+
bytes memory initData,
|
|
39
39
|
PoolConfig memory config,
|
|
40
40
|
address tokenToSeedLiqudity,
|
|
41
41
|
uint256 amountToSeed,
|
|
42
42
|
address syOwner
|
|
43
43
|
) external returns (PoolDeploymentAddrs memory) {
|
|
44
|
-
address SY = IPCommonSYFactory(syFactory).
|
|
44
|
+
address SY = IPCommonSYFactory(syFactory).deployUpgradableSY(id, constructorParams, initData, syOwner);
|
|
45
45
|
return deploy5115MarketAndSeedLiquidity(SY, config, tokenToSeedLiqudity, amountToSeed);
|
|
46
46
|
}
|
|
47
47
|
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
pragma solidity ^0.8.17;
|
|
3
3
|
|
|
4
4
|
import "../../interfaces/IPAllActionV3.sol";
|
|
5
|
-
import "../../interfaces/
|
|
5
|
+
import "../../interfaces/IPMarketFactory.sol";
|
|
6
6
|
import "../../interfaces/IPYieldContractFactory.sol";
|
|
7
|
-
import "../../interfaces/
|
|
7
|
+
import "../../interfaces/IPMarket.sol";
|
|
8
8
|
// import "../core/StandardizedYield/implementations/PendleERC4626SY.sol";
|
|
9
9
|
import "../../core/libraries/TokenHelper.sol";
|
|
10
10
|
|
|
@@ -53,7 +53,7 @@ contract PendlePoolDeployHelper is TokenHelper {
|
|
|
53
53
|
params.expiry,
|
|
54
54
|
params.doCacheIndexSameBlock
|
|
55
55
|
);
|
|
56
|
-
market =
|
|
56
|
+
market = IPMarketFactory(marketFactory).createNewMarket(
|
|
57
57
|
PT,
|
|
58
58
|
params.scalarRoot,
|
|
59
59
|
params.initialRateAnchor,
|
|
@@ -120,15 +120,15 @@ contract PendlePoolDeployHelper is TokenHelper {
|
|
|
120
120
|
int256 initialRateAnchor
|
|
121
121
|
) external returns (address newMarket) {
|
|
122
122
|
(, IPPrincipalToken PT, ) = IPMarket(oldMarket).readTokens();
|
|
123
|
-
newMarket =
|
|
123
|
+
newMarket = IPMarketFactory(marketFactory).createNewMarket(
|
|
124
124
|
address(PT),
|
|
125
125
|
scalarRoot,
|
|
126
126
|
initialRateAnchor,
|
|
127
127
|
lnFeeRateRoot
|
|
128
128
|
);
|
|
129
129
|
_transferFrom(IERC20(oldMarket), msg.sender, oldMarket, amountLp);
|
|
130
|
-
(uint256 netSyOut, uint256 netPtOut) =
|
|
131
|
-
|
|
130
|
+
(uint256 netSyOut, uint256 netPtOut) = IPMarket(oldMarket).burn(newMarket, newMarket, amountLp);
|
|
131
|
+
IPMarket(newMarket).mint(msg.sender, netSyOut, netPtOut);
|
|
132
132
|
}
|
|
133
133
|
|
|
134
134
|
receive() external payable {}
|
|
@@ -3,9 +3,9 @@ pragma solidity ^0.8.17;
|
|
|
3
3
|
|
|
4
4
|
import "../../core/libraries/TokenHelper.sol";
|
|
5
5
|
import "../../interfaces/IPAllActionV3.sol";
|
|
6
|
-
import "../../interfaces/
|
|
6
|
+
import "../../interfaces/IPMarketFactory.sol";
|
|
7
7
|
import "../../interfaces/IPYieldContractFactory.sol";
|
|
8
|
-
import "../../interfaces/
|
|
8
|
+
import "../../interfaces/IPMarket.sol";
|
|
9
9
|
import "./lib/MarketDeployLib.sol";
|
|
10
10
|
|
|
11
11
|
contract PendlePoolDeployHelperV2 is TokenHelper {
|
|
@@ -82,7 +82,7 @@ contract PendlePoolDeployHelperV2 is TokenHelper {
|
|
|
82
82
|
addrs.SY = SY;
|
|
83
83
|
(addrs.PT, addrs.YT) = _createPYIfNotExist(SY, params.expiry);
|
|
84
84
|
|
|
85
|
-
addrs.market =
|
|
85
|
+
addrs.market = IPMarketFactory(marketFactory).createNewMarket(
|
|
86
86
|
addrs.PT,
|
|
87
87
|
params.scalarRoot,
|
|
88
88
|
params.initialRateAnchor,
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
// SPDX-License-Identifier: MIT
|
|
2
|
+
pragma solidity ^0.8.0;
|
|
3
|
+
|
|
4
|
+
import {OAppUpgradeable, Origin, MessagingFee, MessagingReceipt} from "@layerzerolabs/oapp-evm-upgradeable/contracts/oapp/OAppUpgradeable.sol";
|
|
5
|
+
import {OAppOptionsType3Upgradeable} from "@layerzerolabs/oapp-evm-upgradeable/contracts/oapp/libs/OAppOptionsType3Upgradeable.sol";
|
|
6
|
+
|
|
7
|
+
abstract contract PendleCrossChainOracleBaseApp_Init is OAppUpgradeable, OAppOptionsType3Upgradeable {
|
|
8
|
+
address payable public immutable refundAddress;
|
|
9
|
+
|
|
10
|
+
uint256[100] private __gap;
|
|
11
|
+
|
|
12
|
+
constructor(address _endpoint, address payable _refundAddress) OAppUpgradeable(_endpoint) {
|
|
13
|
+
refundAddress = _refundAddress;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
function __PendleCrossChainOracleBaseApp_initialize(
|
|
17
|
+
address _owner,
|
|
18
|
+
address _delegate
|
|
19
|
+
) internal virtual onlyInitializing {
|
|
20
|
+
__OApp_init(_delegate);
|
|
21
|
+
_transferOwnership(_owner);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
// SPDX-License-Identifier: MIT
|
|
2
|
+
pragma solidity ^0.8.0;
|
|
3
|
+
|
|
4
|
+
import "../base/PendleCrossChainOracleBaseApp_Init.sol";
|
|
5
|
+
import {ILayerZeroEndpointV2} from "@layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/ILayerZeroEndpointV2.sol";
|
|
6
|
+
import "../../../interfaces/IPExchangeRateOracleApp.sol";
|
|
7
|
+
import {IStandardizedYield} from "../../../interfaces/IStandardizedYield.sol";
|
|
8
|
+
import {ExchangeRateMsgCodec} from "../libraries/ExchangeRateMsgCodec.sol";
|
|
9
|
+
import {Errors} from "../../../core/libraries/Errors.sol";
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* @title PendleExchangeRateOracleApp
|
|
13
|
+
* @notice Cross-chain oracle for Pendle exchange rates using LayerZero
|
|
14
|
+
*/
|
|
15
|
+
contract PendleExchangeRateOracleApp is PendleCrossChainOracleBaseApp_Init, IPExchangeRateOracleApp {
|
|
16
|
+
using ExchangeRateMsgCodec for bytes;
|
|
17
|
+
using ExchangeRateMsgCodec for bytes32;
|
|
18
|
+
|
|
19
|
+
uint32 public immutable eid;
|
|
20
|
+
mapping(uint32 srcEid => mapping(bytes32 source => ExchangeRateData)) private feedData;
|
|
21
|
+
|
|
22
|
+
address public allowedSender;
|
|
23
|
+
|
|
24
|
+
modifier validateDstEid(uint32 dstEid) {
|
|
25
|
+
if (dstEid == eid) revert Errors.InvalidDestinationEid();
|
|
26
|
+
_;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
modifier onlyOwnerOrAllowedSender() {
|
|
30
|
+
require(msg.sender == owner() || msg.sender == allowedSender, "Not authorized");
|
|
31
|
+
_;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
constructor(
|
|
35
|
+
address _endpoint,
|
|
36
|
+
address payable _refundAddress
|
|
37
|
+
) PendleCrossChainOracleBaseApp_Init(_endpoint, _refundAddress) {
|
|
38
|
+
_disableInitializers();
|
|
39
|
+
eid = ILayerZeroEndpointV2(_endpoint).eid();
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
function initialize(address _owner, address _delegate, address _allowedSender) external initializer {
|
|
43
|
+
__PendleCrossChainOracleBaseApp_initialize(_owner, _delegate);
|
|
44
|
+
_setAllowedSender(_allowedSender);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/// @inheritdoc IPExchangeRateOracleApp
|
|
48
|
+
function quoteSendExchangeRate(
|
|
49
|
+
SendExchangeRateParam calldata sendParam,
|
|
50
|
+
bool payInLzToken
|
|
51
|
+
) external view returns (MessagingFee memory fee) {
|
|
52
|
+
uint256 exchangeRate = _getExchangeRateFromSource(sendParam.exchangeRateSource);
|
|
53
|
+
(bytes memory message, bytes memory options) = _buildMsgAndOptions(sendParam, exchangeRate);
|
|
54
|
+
|
|
55
|
+
fee = _quote(sendParam.dstEid, message, options, payInLzToken);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/// @inheritdoc IPExchangeRateOracleApp
|
|
59
|
+
function sendExchangeRate(
|
|
60
|
+
SendExchangeRateParam calldata sendParam,
|
|
61
|
+
MessagingFee calldata fee
|
|
62
|
+
)
|
|
63
|
+
external
|
|
64
|
+
payable
|
|
65
|
+
onlyOwnerOrAllowedSender
|
|
66
|
+
validateDstEid(sendParam.dstEid)
|
|
67
|
+
returns (MessagingReceipt memory receipt)
|
|
68
|
+
{
|
|
69
|
+
uint256 exchangeRate = _getExchangeRateFromSource(sendParam.exchangeRateSource);
|
|
70
|
+
(bytes memory message, bytes memory options) = _buildMsgAndOptions(sendParam, exchangeRate);
|
|
71
|
+
|
|
72
|
+
receipt = _lzSend(sendParam.dstEid, message, options, fee, refundAddress);
|
|
73
|
+
|
|
74
|
+
emit ExchangeRateSent(receipt.guid, sendParam.dstEid, sendParam.exchangeRateSource, exchangeRate);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/// @inheritdoc IPExchangeRateOracleApp
|
|
78
|
+
function getExchangeRate(
|
|
79
|
+
uint32 _srcEid,
|
|
80
|
+
bytes32 exchangeRateSource
|
|
81
|
+
) external view returns (ExchangeRateData memory exchangeRateData) {
|
|
82
|
+
if (_srcEid == eid) {
|
|
83
|
+
uint256 exchangeRate = _getExchangeRateFromSource(exchangeRateSource.bytes32ToAddress());
|
|
84
|
+
return ExchangeRateData(exchangeRate, block.timestamp);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
exchangeRateData = feedData[_srcEid][exchangeRateSource];
|
|
88
|
+
|
|
89
|
+
if (exchangeRateData.updatedAt == 0) revert Errors.FeedNotInitialized();
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
function _lzReceive(
|
|
93
|
+
Origin calldata _origin,
|
|
94
|
+
bytes32 _guid,
|
|
95
|
+
bytes calldata _message,
|
|
96
|
+
address /*_executor*/,
|
|
97
|
+
bytes calldata /*_extraData*/
|
|
98
|
+
) internal override {
|
|
99
|
+
(bytes32 exchangeRateSource, uint256 exchangeRate, uint256 updatedAt) = _message.decodeMessage();
|
|
100
|
+
|
|
101
|
+
bool rateAccepted = _updateExchangeRate(_origin.srcEid, exchangeRateSource, exchangeRate, updatedAt);
|
|
102
|
+
|
|
103
|
+
emit ExchangeRateReceived(_guid, _origin.srcEid, exchangeRateSource, exchangeRate, updatedAt, rateAccepted);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
function _buildMsgAndOptions(
|
|
107
|
+
SendExchangeRateParam calldata sendParam,
|
|
108
|
+
uint256 exchangeRate
|
|
109
|
+
) internal view returns (bytes memory message, bytes memory options) {
|
|
110
|
+
uint16 msgType;
|
|
111
|
+
|
|
112
|
+
(msgType, message) = ExchangeRateMsgCodec.encodeExchangeRateMessage(
|
|
113
|
+
sendParam.exchangeRateSource,
|
|
114
|
+
exchangeRate,
|
|
115
|
+
block.timestamp
|
|
116
|
+
);
|
|
117
|
+
|
|
118
|
+
options = combineOptions(sendParam.dstEid, msgType, sendParam.extraOptions);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
function _getExchangeRateFromSource(address exchangeRateSource) internal view returns (uint256) {
|
|
122
|
+
try IStandardizedYield(exchangeRateSource).exchangeRate() returns (uint256 exchangeRate) {
|
|
123
|
+
return exchangeRate;
|
|
124
|
+
} catch (bytes memory revertData) {
|
|
125
|
+
uint256 length = revertData.length;
|
|
126
|
+
if (length != 0) {
|
|
127
|
+
assembly {
|
|
128
|
+
revert(add(revertData, 32), length)
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
revert Errors.ExchangeRateCallFailed();
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
function _updateExchangeRate(
|
|
136
|
+
uint32 _srcEid,
|
|
137
|
+
bytes32 exchangeRateSource,
|
|
138
|
+
uint256 exchangeRate,
|
|
139
|
+
uint256 updatedAt
|
|
140
|
+
) internal returns (bool rateAccepted) {
|
|
141
|
+
ExchangeRateData storage currentFeedData = feedData[_srcEid][exchangeRateSource];
|
|
142
|
+
|
|
143
|
+
if (updatedAt > currentFeedData.updatedAt) {
|
|
144
|
+
rateAccepted = true;
|
|
145
|
+
currentFeedData.exchangeRate = exchangeRate;
|
|
146
|
+
currentFeedData.updatedAt = updatedAt;
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
// ====== Admin functions ======
|
|
151
|
+
|
|
152
|
+
function setAllowedSender(address _allowedSender) external onlyOwner {
|
|
153
|
+
_setAllowedSender(_allowedSender);
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
function _setAllowedSender(address _allowedSender) internal {
|
|
157
|
+
allowedSender = _allowedSender;
|
|
158
|
+
emit AllowedSenderSet(_allowedSender);
|
|
159
|
+
}
|
|
160
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
// SPDX-License-Identifier: MIT
|
|
2
|
+
pragma solidity ^0.8.0;
|
|
3
|
+
|
|
4
|
+
import {IPExchangeRateOracle} from "../../../interfaces/IPExchangeRateOracle.sol";
|
|
5
|
+
import {IPExchangeRateOracleApp} from "../../../interfaces/IPExchangeRateOracleApp.sol";
|
|
6
|
+
|
|
7
|
+
contract PendleExchangeRateOracleV2 is IPExchangeRateOracle {
|
|
8
|
+
address public immutable exchangeRateOracleApp;
|
|
9
|
+
uint32 public immutable srcEid;
|
|
10
|
+
bytes32 public immutable exchangeRateSource;
|
|
11
|
+
|
|
12
|
+
constructor(address _exchangeRateOracleApp, uint32 _srcEid, bytes32 _exchangeRateSource) {
|
|
13
|
+
exchangeRateOracleApp = _exchangeRateOracleApp;
|
|
14
|
+
srcEid = _srcEid;
|
|
15
|
+
exchangeRateSource = _exchangeRateSource;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
function getExchangeRate() external view returns (uint256) {
|
|
19
|
+
IPExchangeRateOracleApp.ExchangeRateData memory exchangeRateData = IPExchangeRateOracleApp(
|
|
20
|
+
exchangeRateOracleApp
|
|
21
|
+
).getExchangeRate(srcEid, exchangeRateSource);
|
|
22
|
+
|
|
23
|
+
return exchangeRateData.exchangeRate;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
// SPDX-License-Identifier: MIT
|
|
2
|
+
pragma solidity ^0.8.0;
|
|
3
|
+
|
|
4
|
+
import {Errors} from "../../../core/libraries/Errors.sol";
|
|
5
|
+
|
|
6
|
+
library ExchangeRateMsgCodec {
|
|
7
|
+
uint16 public constant SEND_EXCHANGE_RATE = 1;
|
|
8
|
+
|
|
9
|
+
function encodeExchangeRateMessage(
|
|
10
|
+
address exchangeRateSource,
|
|
11
|
+
uint256 exchangeRate,
|
|
12
|
+
uint256 updatedAt
|
|
13
|
+
) internal pure returns (uint16 msgType, bytes memory message) {
|
|
14
|
+
msgType = SEND_EXCHANGE_RATE;
|
|
15
|
+
message = abi.encode(msgType, exchangeRateSource, exchangeRate, updatedAt);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
function decodeMessage(
|
|
19
|
+
bytes calldata message
|
|
20
|
+
) internal pure returns (bytes32 exchangeRateSource, uint256 exchangeRate, uint256 updatedAt) {
|
|
21
|
+
uint16 msgType;
|
|
22
|
+
(msgType, exchangeRateSource, exchangeRate, updatedAt) = abi.decode(
|
|
23
|
+
message,
|
|
24
|
+
(uint16, bytes32, uint256, uint256)
|
|
25
|
+
);
|
|
26
|
+
if (msgType != SEND_EXCHANGE_RATE) revert Errors.InvalidMsgType();
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
function addressToBytes32(address _addr) internal pure returns (bytes32) {
|
|
30
|
+
return bytes32(uint256(uint160(_addr)));
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
function bytes32ToAddress(bytes32 _b) internal pure returns (address) {
|
|
34
|
+
return address(uint160(uint256(_b)));
|
|
35
|
+
}
|
|
36
|
+
}
|
|
@@ -46,6 +46,7 @@ library PendleLpOracleLib {
|
|
|
46
46
|
uint32 duration,
|
|
47
47
|
uint256 pyIndex
|
|
48
48
|
) private view returns (uint256 lpToAssetRateRaw) {
|
|
49
|
+
_checkMarketReentrancy(market);
|
|
49
50
|
MarketState memory state = market.readState(address(0));
|
|
50
51
|
|
|
51
52
|
int256 totalHypotheticalAsset;
|
|
@@ -83,4 +84,12 @@ library PendleLpOracleLib {
|
|
|
83
84
|
int256 rateLastTrade = MarketMathCore._getExchangeRateFromImpliedRate(state.lastLnImpliedRate, timeToExpiry);
|
|
84
85
|
rateHypTrade = (rateLastTrade + rateOracle) / 2;
|
|
85
86
|
}
|
|
87
|
+
|
|
88
|
+
function _checkMarketReentrancy(IPMarket market) internal view {
|
|
89
|
+
try market.reentrancyGuardEntered() returns (bool entered) {
|
|
90
|
+
require(entered == false, "ReentrancyGuard: reentrant call");
|
|
91
|
+
} catch {
|
|
92
|
+
return;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
86
95
|
}
|
|
@@ -6,8 +6,18 @@ import "./IPSwapAggregator.sol";
|
|
|
6
6
|
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
|
|
7
7
|
|
|
8
8
|
abstract contract OKXScaleHelper {
|
|
9
|
-
address
|
|
9
|
+
address public immutable _tokenApprove;
|
|
10
|
+
|
|
11
|
+
// @dev `allowUnsupportedChain` is a safe guard to prevent deploying this contract on unsupported chains by mistake
|
|
12
|
+
// @dev Please add new `__getTokenApproveForChain` entry when deploying to a new chain.
|
|
13
|
+
constructor(bool allowUnsupportedChain) {
|
|
14
|
+
_tokenApprove = __getTokenApproveForChain(block.chainid);
|
|
15
|
+
if (!allowUnsupportedChain) {
|
|
16
|
+
require(_tokenApprove != address(0), "PendleSwap: OKX chain not supported");
|
|
17
|
+
}
|
|
18
|
+
}
|
|
10
19
|
|
|
20
|
+
// https://web3.okx.com/build/dev-docs/dex-api/dex-smart-contract#token-approval
|
|
11
21
|
function __getTokenApproveForChain(uint256 chainid) private pure returns (address) {
|
|
12
22
|
if (chainid == 1) {
|
|
13
23
|
return 0x40aA958dd87FC8305b97f2BA922CDdCa374bcD7f;
|
|
@@ -27,6 +37,9 @@ abstract contract OKXScaleHelper {
|
|
|
27
37
|
if (chainid == 146) {
|
|
28
38
|
return 0xD321ab5589d3E8FA5Df985ccFEf625022E2DD910;
|
|
29
39
|
}
|
|
40
|
+
if (chainid == 9745) {
|
|
41
|
+
return 0x9FD43F5E4c24543b2eBC807321E58e6D350d6a5A;
|
|
42
|
+
}
|
|
30
43
|
return address(0);
|
|
31
44
|
}
|
|
32
45
|
|
|
@@ -23,7 +23,7 @@ contract PendleSwap is
|
|
|
23
23
|
|
|
24
24
|
address private constant KYBER_SCALING_HELPER = 0x2f577A41BeC1BE1152AeEA12e73b7391d15f655D;
|
|
25
25
|
|
|
26
|
-
constructor() {
|
|
26
|
+
constructor(bool okx_allowUnsupportedChain) OKXScaleHelper(okx_allowUnsupportedChain) {
|
|
27
27
|
_disableInitializers();
|
|
28
28
|
}
|
|
29
29
|
|
package/deployments/1-core.json
CHANGED
|
@@ -64,6 +64,7 @@
|
|
|
64
64
|
"decimalsFactory": "0x992ec6a490a4b7f256bd59e63746951d98b29be9",
|
|
65
65
|
"lpLinearDiscountOracleFactory": "0x44fb16d078e9c39b65d6c15e78ede9736a9f2df5",
|
|
66
66
|
"cross-chain": {
|
|
67
|
+
"exchangeRateOracle": "0xA914c44E960cC95D996969BDf0ab5D6f4f2B5870",
|
|
67
68
|
"ptOftAdapterFactory": "0x905aF80C4DE82E0075a19fDE2f5777f1A6636732"
|
|
68
69
|
}
|
|
69
70
|
}
|
|
@@ -7,5 +7,6 @@
|
|
|
7
7
|
"balanceReader": "0x2085F50305f656f96b22ECBfe0A4f5e786Ff0438",
|
|
8
8
|
"limitBackendHelperV2": "0xf02CdbD8F6A18c73B73331FEe3C2110e74508977",
|
|
9
9
|
"checkSolvent": "0x1dE943933417D50738557Ac98FF96405CeeeeCD5",
|
|
10
|
-
"externalCapGate": "0x65E04a3b2af7716B7f0765dE62Fa2f1B3290C23F"
|
|
10
|
+
"externalCapGate": "0x65E04a3b2af7716B7f0765dE62Fa2f1B3290C23F",
|
|
11
|
+
"feeSetter": "0x0185921C7C6A21F1f5c45A34456C379c9bEC6A81"
|
|
11
12
|
}
|
package/deployments/10-core.json
CHANGED
|
@@ -60,6 +60,7 @@
|
|
|
60
60
|
"decimalsFactory": "0x992ec6a490a4b7f256bd59e63746951d98b29be9",
|
|
61
61
|
"lpLinearDiscountOracleFactory": "0x44fb16d078e9c39b65d6c15e78ede9736a9f2df5",
|
|
62
62
|
"cross-chain": {
|
|
63
|
+
"exchangeRateOracle": "0xA914c44E960cC95D996969BDf0ab5D6f4f2B5870",
|
|
63
64
|
"ptOftAdapterFactory": "0x45Dd4aEcc425b01bf98C567407aB4a4fF3C7d349"
|
|
64
65
|
}
|
|
65
66
|
}
|
|
@@ -6,5 +6,6 @@
|
|
|
6
6
|
"balanceReader": "0x2085F50305f656f96b22ECBfe0A4f5e786Ff0438",
|
|
7
7
|
"limitBackendHelperV2": "0xf02CdbD8F6A18c73B73331FEe3C2110e74508977",
|
|
8
8
|
"checkSolvent": "0x1dE943933417D50738557Ac98FF96405CeeeeCD5",
|
|
9
|
-
"externalCapGate": "0x65E04a3b2af7716B7f0765dE62Fa2f1B3290C23F"
|
|
9
|
+
"externalCapGate": "0x65E04a3b2af7716B7f0765dE62Fa2f1B3290C23F",
|
|
10
|
+
"feeSetter": "0x0185921C7C6A21F1f5c45A34456C379c9bEC6A81"
|
|
10
11
|
}
|
|
@@ -50,5 +50,8 @@
|
|
|
50
50
|
},
|
|
51
51
|
"lpWrapperFactory": "0xeCfEB97D7F070DA5b93c5DC274183F1D7f68532F",
|
|
52
52
|
"decimalsFactory": "0x992ec6a490a4b7f256bd59e63746951d98b29be9",
|
|
53
|
-
"lpLinearDiscountOracleFactory": "0x44fb16d078e9c39b65d6c15e78ede9736a9f2df5"
|
|
53
|
+
"lpLinearDiscountOracleFactory": "0x44fb16d078e9c39b65d6c15e78ede9736a9f2df5",
|
|
54
|
+
"cross-chain": {
|
|
55
|
+
"exchangeRateOracle": "0xA914c44E960cC95D996969BDf0ab5D6f4f2B5870"
|
|
56
|
+
}
|
|
54
57
|
}
|
|
@@ -6,5 +6,6 @@
|
|
|
6
6
|
"balanceReader": "0x2085F50305f656f96b22ECBfe0A4f5e786Ff0438",
|
|
7
7
|
"limitBackendHelperV2": "0xf02CdbD8F6A18c73B73331FEe3C2110e74508977",
|
|
8
8
|
"checkSolvent": "0x21332dCAe68b603B9170d25D21fda68f18Da91df",
|
|
9
|
-
"externalCapGate": "0x65E04a3b2af7716B7f0765dE62Fa2f1B3290C23F"
|
|
9
|
+
"externalCapGate": "0x65E04a3b2af7716B7f0765dE62Fa2f1B3290C23F",
|
|
10
|
+
"feeSetter": "0x0185921C7C6A21F1f5c45A34456C379c9bEC6A81"
|
|
10
11
|
}
|
|
@@ -59,5 +59,8 @@
|
|
|
59
59
|
"lpWrapperFactory": "0xdb5dB14819a16642e6736aB0cDFe0156f8E01ddF",
|
|
60
60
|
"decimalsFactory": "0x992ec6a490a4b7f256bd59e63746951d98b29be9",
|
|
61
61
|
"expiredRedeemer": "0x23567b248cd64479384d2e0cbe83522afb8dd446",
|
|
62
|
-
"lpLinearDiscountOracleFactory": "0x44fb16d078e9c39b65d6c15e78ede9736a9f2df5"
|
|
62
|
+
"lpLinearDiscountOracleFactory": "0x44fb16d078e9c39b65d6c15e78ede9736a9f2df5",
|
|
63
|
+
"cross-chain": {
|
|
64
|
+
"exchangeRateOracle": "0xA914c44E960cC95D996969BDf0ab5D6f4f2B5870"
|
|
65
|
+
}
|
|
63
66
|
}
|
|
@@ -7,5 +7,6 @@
|
|
|
7
7
|
"balanceReader": "0x2085F50305f656f96b22ECBfe0A4f5e786Ff0438",
|
|
8
8
|
"limitBackendHelperV2": "0xf02CdbD8F6A18c73B73331FEe3C2110e74508977",
|
|
9
9
|
"checkSolvent": "0x1dE943933417D50738557Ac98FF96405CeeeeCD5",
|
|
10
|
-
"externalCapGate": "0x65E04a3b2af7716B7f0765dE62Fa2f1B3290C23F"
|
|
10
|
+
"externalCapGate": "0x65E04a3b2af7716B7f0765dE62Fa2f1B3290C23F",
|
|
11
|
+
"feeSetter": "0x0185921C7C6A21F1f5c45A34456C379c9bEC6A81"
|
|
11
12
|
}
|
|
@@ -56,5 +56,8 @@
|
|
|
56
56
|
},
|
|
57
57
|
"lpWrapperFactory": "0x6D653C8DAAc8D81c9CE98E038fbF94D7E652e147",
|
|
58
58
|
"decimalsFactory": "0x992ec6a490a4b7f256bd59e63746951d98b29be9",
|
|
59
|
-
"lpLinearDiscountOracleFactory": "0x44fb16d078e9c39b65d6c15e78ede9736a9f2df5"
|
|
59
|
+
"lpLinearDiscountOracleFactory": "0x44fb16d078e9c39b65d6c15e78ede9736a9f2df5",
|
|
60
|
+
"cross-chain": {
|
|
61
|
+
"exchangeRateOracle": "0xA914c44E960cC95D996969BDf0ab5D6f4f2B5870"
|
|
62
|
+
}
|
|
60
63
|
}
|