@pendle/core-v2 6.4.4-unichain → 6.5.0-swaphubtest
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/artifacts/contracts/LiquidityMining/CrossChainMsg/PendleMsgReceiveEndpointUpg.sol/PendleMsgReceiveEndpointUpg.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/CrossChainMsg/PendleMsgReceiveEndpointUpg.sol/PendleMsgReceiveEndpointUpg.json +2 -2
- package/build/artifacts/contracts/LiquidityMining/CrossChainMsg/PendleMsgReceiverAppUpg.sol/PendleMsgReceiverAppUpg.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/CrossChainMsg/PendleMsgSendEndpointUpg.sol/PendleMsgSendEndpointUpg.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/CrossChainMsg/PendleMsgSendEndpointUpg.sol/PendleMsgSendEndpointUpg.json +2 -2
- package/build/artifacts/contracts/LiquidityMining/CrossChainMsg/PendleMsgSenderAppUpg.sol/PendleMsgSenderAppUpg.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/CrossChainMsg/libraries/ExcessivelySafeCall.sol/ExcessivelySafeCall.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/CrossChainMsg/libraries/LayerZeroHelper.sol/LayerZeroHelper.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/GaugeController/PendleGaugeControllerUpg.sol/PendleGaugeControllerUpg.dbg.json +4 -0
- package/build/artifacts/contracts/LiquidityMining/GaugeController/PendleGaugeControllerUpg.sol/PendleGaugeControllerUpg.json +457 -0
- package/build/artifacts/contracts/LiquidityMining/PendleMerkleDistributor.sol/PendleMerkleDistributor.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/PendleMerkleDistributor.sol/PendleMerkleDistributor.json +2 -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/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/LiquidityMining/libraries/WeekMath.sol/WeekMath.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/sPendle/StakedPendle.sol/StakedPendle.dbg.json +4 -0
- package/build/artifacts/contracts/LiquidityMining/sPendle/StakedPendle.sol/StakedPendle.json +733 -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/PendleGauge.sol/PendleGauge.json +0 -51
- package/build/artifacts/contracts/core/Market/PendleMarketFactoryV7Upg.sol/PendleMarketFactoryV7Upg.dbg.json +4 -0
- package/build/artifacts/contracts/core/Market/PendleMarketFactoryV7Upg.sol/PendleMarketFactoryV7Upg.json +618 -0
- package/build/artifacts/contracts/core/Market/PendleMarketV7.sol/PendleMarketV7.dbg.json +4 -0
- package/build/artifacts/contracts/core/Market/PendleMarketV7.sol/PendleMarketV7.json +1157 -0
- 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/SYUtils.sol/SYUtils.dbg.json +1 -1
- 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 +2 -2
- package/build/artifacts/contracts/core/YieldContracts/PendleYieldContractFactoryUpg.sol/PendleYieldContractFactoryUpg.dbg.json +1 -1
- package/build/artifacts/contracts/core/YieldContracts/PendleYieldContractFactoryUpg.sol/PendleYieldContractFactoryUpg.json +2 -2
- package/build/artifacts/contracts/core/YieldContracts/PendleYieldToken.sol/PendleYieldToken.dbg.json +1 -1
- package/build/artifacts/contracts/core/YieldContracts/PendleYieldToken.sol/PendleYieldToken.json +2 -2
- package/build/artifacts/contracts/core/erc20/PendleERC20.sol/PendleERC20.dbg.json +1 -1
- package/build/artifacts/contracts/core/libraries/ArrayLib.sol/ArrayLib.dbg.json +1 -1
- package/build/artifacts/contracts/core/libraries/BaseSplitCodeFactory.sol/BaseSplitCodeFactory.dbg.json +1 -1
- package/build/artifacts/contracts/core/libraries/BaseSplitCodeFactory.sol/CodeDeployer.dbg.json +1 -1
- package/build/artifacts/contracts/core/libraries/BoringOwnableUpgradeableV2.sol/BoringOwnableUpgradeableData.dbg.json +1 -1
- package/build/artifacts/contracts/core/libraries/BoringOwnableUpgradeableV2.sol/BoringOwnableUpgradeableV2.dbg.json +1 -1
- package/build/artifacts/contracts/core/libraries/Errors.sol/Errors.dbg.json +1 -1
- package/build/artifacts/contracts/core/libraries/Errors.sol/Errors.json +3 -3
- package/build/artifacts/contracts/core/libraries/ExpiryUtilsLib.sol/ExpiryUtils.dbg.json +1 -1
- package/build/artifacts/contracts/core/libraries/MiniHelpers.sol/MiniHelpers.dbg.json +1 -1
- package/build/artifacts/contracts/core/libraries/StringLib.sol/StringLib.dbg.json +1 -1
- package/build/artifacts/contracts/core/libraries/TokenHelper.sol/TokenHelper.dbg.json +1 -1
- package/build/artifacts/contracts/core/libraries/math/LogExpMath.sol/LogExpMath.dbg.json +1 -1
- package/build/artifacts/contracts/core/libraries/math/PMath.sol/PMath.dbg.json +1 -1
- package/build/artifacts/contracts/core/libraries/math/PMath.sol/PMath.json +2 -2
- package/build/artifacts/contracts/cross-chain/FixedPricePTAMM.sol/FixedPricePTAMM.dbg.json +1 -1
- package/build/artifacts/contracts/cross-chain/FixedPricePTAMM.sol/FixedPricePTAMM.json +2 -2
- package/build/artifacts/contracts/cross-chain/deposit-box/DepositBox.sol/DepositBox.dbg.json +4 -0
- package/build/artifacts/contracts/cross-chain/deposit-box/DepositBox.sol/DepositBox.json +170 -0
- package/build/artifacts/contracts/cross-chain/deposit-box/DepositBoxFactory.sol/DepositBoxFactory.dbg.json +4 -0
- package/build/artifacts/contracts/cross-chain/deposit-box/DepositBoxFactory.sol/DepositBoxFactory.json +124 -0
- package/build/artifacts/contracts/cross-chain/factory/hub/PendlePTOFTAdapterFactory.sol/PendlePTOFTAdapterFactory.dbg.json +1 -1
- package/build/artifacts/contracts/cross-chain/oftImpl/hub/OFTAdapterImpl.sol/OFTAdapterImpl.dbg.json +1 -1
- package/build/artifacts/contracts/cross-chain/oftImpl/spoke/PendleBridgedPrincipalToken.sol/PendleBridgedPrincipalToken.dbg.json +1 -1
- package/build/artifacts/contracts/cross-chain/swap-hub/PendleCrossChainSwapHub.sol/PendleCrossChainSwapHub.dbg.json +4 -0
- package/build/artifacts/contracts/cross-chain/swap-hub/PendleCrossChainSwapHub.sol/PendleCrossChainSwapHub.json +1005 -0
- package/build/artifacts/contracts/cross-chain/swap-hub/SwapHubBase.sol/SwapHubBase.dbg.json +4 -0
- package/build/artifacts/contracts/cross-chain/swap-hub/SwapHubBase.sol/SwapHubBase.json +976 -0
- 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/IAddressProvider.sol/IAddressProvider.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/ILPWrapper.sol/ILPWrapper.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/ILayerZeroEndpoint.sol/ILayerZeroEndpoint.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/ILayerZeroReceiver.sol/ILayerZeroReceiver.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IMarketSweed.sol/IMarketSweed.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IOwnable.sol/IOwnable.dbg.json +1 -1
- 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/IPActionCrossChain.sol/IPActionCrossChain.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPActionInfoStatic.sol/IPActionInfoStatic.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/IPActionMintRedeemStatic.sol/IPActionMintRedeemStatic.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/IPActionVePendleStatic.sol/IPActionVePendleStatic.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/IPBridgedPrincipalToken.sol/IPBridgedPrincipalToken.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPChainlinkOracle.sol/IPChainlinkOracle.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPChainlinkOracleEssential.sol/IPChainlinkOracleEssential.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPChainlinkOracleFactory.sol/IPChainlinkOracleFactory.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPChainlinkOracleWithQuote.sol/IPChainlinkOracleWithQuote.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPCommonPoolDeployHelperV2.sol/IPCommonPoolDeployHelperV2.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPCommonSYFactory.sol/IPCommonSYFactory.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPCrossChainSwapHub.sol/IPCrossChainSwapHub.dbg.json +4 -0
- package/build/artifacts/contracts/interfaces/IPCrossChainSwapHub.sol/IPCrossChainSwapHub.json +813 -0
- package/build/artifacts/contracts/interfaces/IPDepositBox.sol/IPDepositBox.dbg.json +4 -0
- package/build/artifacts/contracts/interfaces/IPDepositBox.sol/IPDepositBox.json +124 -0
- package/build/artifacts/contracts/interfaces/IPDepositBoxFactory.sol/IPDepositBoxFactory.dbg.json +4 -0
- package/build/artifacts/contracts/interfaces/IPDepositBoxFactory.sol/IPDepositBoxFactory.json +108 -0
- package/build/artifacts/contracts/interfaces/IPExchangeRateOracle.sol/IPExchangeRateOracle.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPExchangeRateOracleApp.sol/IPExchangeRateOracleApp.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPFeeDistributor.sol/IPFeeDistributor.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPFeeDistributorV2.sol/IPFeeDistributorV2.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPFixedPricePTAMM.sol/IPFixedPricePTAMM.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPFixedPricePTAMM.sol/IPFixedPricePTAMMSwapCallback.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPGauge.sol/IPGauge.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPGauge.sol/IPGauge.json +0 -51
- package/build/artifacts/contracts/interfaces/IPGaugeController.sol/IPGaugeController.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPGaugeController.sol/IPGaugeController.json +102 -11
- package/build/artifacts/contracts/interfaces/IPGovernanceProxy.sol/IPGovernanceProxy.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPInterestManagerYT.sol/IPInterestManagerYT.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPInterestManagerYTV2.sol/IPInterestManagerYTV2.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPLPWrapperFactory.sol/IPLPWrapperFactory.dbg.json +1 -1
- 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/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 +0 -19
- package/build/artifacts/contracts/interfaces/IPMarketFactory.sol/IPMarketFactory.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPMarketSwapCallback.sol/IPMarketSwapCallback.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPMerkleDistributor.sol/IPMerkleDistributor.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPMiniDiamond.sol/IPMiniDiamond.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPMsgReceiverApp.sol/IPMsgReceiverApp.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPMsgSendEndpoint.sol/IPMsgSendEndpoint.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPMultiTokenMerkleDistributor.sol/IPMultiTokenMerkleDistributor.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPOffchainStorage.sol/IPOffchainStorage.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPOracleForSy.sol/IPOracleForSy.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPPTOFTAdapterFactory.sol/IPPTOFTAdapterFactory.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPPYLpOracle.sol/IPPYLpOracle.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPPausingInterface.sol/IPPausingInterface.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPPoolDeployHelperV2.sol/IPPoolDeployHelperV2.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPPriceFeed.sol/IPPriceFeed.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPPrincipalToken.sol/IPPrincipalToken.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPReflector.sol/IPReflector.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPRouterStatic.sol/IPRouterStatic.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPStakedPendle.sol/IPStakedPendle.dbg.json +4 -0
- package/build/artifacts/contracts/interfaces/IPStakedPendle.sol/IPStakedPendle.json +351 -0
- package/build/artifacts/contracts/interfaces/IPTokenWithSupplyCap.sol/IPTokenWithSupplyCap.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPVeToken.sol/IPVeToken.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/IPYieldToken.sol/IPYieldToken.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPYieldTokenV2.sol/IPYieldTokenV2.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IRedstonePriceFeed.sol/IRedstonePriceFeed.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IRewardManager.sol/IRewardManager.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IStandardizedYield.sol/IStandardizedYield.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IWETH.sol/IWETH.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IWstETH.sol/IWstETH.dbg.json +1 -1
- 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/limit/helpers/NonceManager.sol/NonceManager.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/AddressProvider.sol/AddressProvider.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/AutomateReady.sol/AutomateReady.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/AutomateReady.sol/IAutomate.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/AutomateReady.sol/IOpsProxyFactory.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/AutomateReady.sol/ITaskTreasuryUpgradable.dbg.json +1 -1
- 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/BalanceReader.sol/ILegacyMarket.dbg.json +4 -0
- package/build/artifacts/contracts/offchain-helpers/BalanceReader.sol/ILegacyMarket.json +30 -0
- package/build/artifacts/contracts/offchain-helpers/BaseSplitCodeFactoryContract.sol/BaseSplitCodeFactoryContract.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/BytesLib.sol/BytesLib.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/EmptyUUPS.sol/EmptyUUPS.dbg.json +1 -1
- 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/LegacyNFTHelper.sol/LegacyNFTHelper.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/LegacyNFTHelper.sol/StarNFTV1.dbg.json +1 -1
- 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/MarketSweed.sol/MarketSweed.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/MarketSweed.sol/MarketSweed.json +2 -2
- package/build/artifacts/contracts/offchain-helpers/Multicall2.sol/Multicall2.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/PendleAPIFeeDepositor.sol/PendleAPIFeeDepositor.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/PendleAPIFeeDepositor.sol/PendleAPIFeeDepositor.json +2 -2
- package/build/artifacts/contracts/offchain-helpers/PendleExchangeRateOracle.sol/PendleExchangeRateOracle.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/PendleExchangeRateOracle.sol/PendleExchangeRateOracle.json +2 -2
- package/build/artifacts/contracts/offchain-helpers/PendleFeeSetter.sol/PendleFeeSetter.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/PendleFeeSetter.sol/PendleFeeSetter.json +2 -2
- package/build/artifacts/contracts/offchain-helpers/PendleGovernanceProxy.sol/PendleGovernanceProxy.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/PendleLPWrapper.sol/PendleLPWrapper.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/PendleLPWrapper.sol/PendleLPWrapper.json +2 -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/PendleMerkleDepositor.sol/PendleMerkleDepositor.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/PendleMerkleDepositor.sol/PendleMerkleDepositor.json +2 -2
- package/build/artifacts/contracts/offchain-helpers/PendleMulticallOwnerV1.sol/PendleMulticallOwnerV1.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/PendleMulticallV1.sol/PendleMulticallV1.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/PendleMulticallV2.sol/PendleMulticallV2.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/PendleOffchainStorage.sol/PendleOffchainStorage.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/PendleWstETHPriceFeed.sol/PendleWstETHPriceFeed.dbg.json +1 -1
- 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/SupplyCapReader.sol/IPossibleSupplyCapInterface.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/SupplyCapReader.sol/SupplyCapReader.dbg.json +1 -1
- 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 +2 -2
- package/build/artifacts/contracts/offchain-helpers/deploy/PendleCommonSYFactory.sol/PendleCommonSYFactory.dbg.json +1 -1
- 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/deploy/lib/MarketDeployLib.sol/MarketDeployLib.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/deploy/lib/MarketDeployLib.sol/MarketDeployLib.json +2 -2
- package/build/artifacts/contracts/offchain-helpers/errors/SDKErrorsDirectory.sol/SDKErrorsDirectory.dbg.json +1 -1
- 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 +1 -1
- package/build/artifacts/contracts/oracles/CrossChainOracle/exchangeRate/PendleExchangeRateOracleApp.sol/PendleExchangeRateOracleApp.dbg.json +1 -1
- package/build/artifacts/contracts/oracles/CrossChainOracle/exchangeRate/PendleExchangeRateOracleApp.sol/PendleExchangeRateOracleApp.json +2 -2
- package/build/artifacts/contracts/oracles/CrossChainOracle/exchangeRate/PendleExchangeRateOracleV2.sol/PendleExchangeRateOracleV2.dbg.json +1 -1
- package/build/artifacts/contracts/oracles/CrossChainOracle/libraries/ExchangeRateMsgCodec.sol/ExchangeRateMsgCodec.dbg.json +1 -1
- package/build/artifacts/contracts/oracles/CrossChainOracle/libraries/ExchangeRateMsgCodec.sol/ExchangeRateMsgCodec.json +2 -2
- 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/PendleLinearDiscountOracleWrapper.sol/PendleLinearDiscountOracleWrapper.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/PendleBoringOneracle.sol/PendleBoringOneracle.dbg.json +1 -1
- package/build/artifacts/contracts/oracles/internal/PendleBoringOneracle.sol/PendleBoringOneracle.json +2 -2
- package/build/artifacts/contracts/oracles/internal/PendleBoringSolvBTCOneracle.sol/PendleBoringSolvBTCOneracle.dbg.json +1 -1
- package/build/artifacts/contracts/oracles/internal/PendleBoringSolvBTCOneracle.sol/PendleBoringSolvBTCOneracle.json +2 -2
- package/build/artifacts/contracts/oracles/internal/PendleLpLinearDiscountOracle.sol/LPExpiry.dbg.json +1 -1
- package/build/artifacts/contracts/oracles/internal/PendleLpLinearDiscountOracle.sol/PendleLpLinearDiscountOracle.dbg.json +1 -1
- package/build/artifacts/contracts/oracles/internal/PendleLpLinearDiscountOracleFactory.sol/PendleLpLinearDiscountOracleFactory.dbg.json +1 -1
- package/build/artifacts/contracts/oracles/internal/PendleRedStoneRateOracleAdapter.sol/PendleRedStoneRateOracleAdapter.dbg.json +1 -1
- package/build/artifacts/contracts/oracles/internal/PendleRedStoneRateOracleAdapter.sol/PendleRedStoneRateOracleAdapter.json +2 -2
- package/build/artifacts/contracts/oracles/internal/PendleSparkLinearDiscountOracle.sol/PTExpiry.dbg.json +1 -1
- package/build/artifacts/contracts/oracles/internal/PendleSparkLinearDiscountOracle.sol/PendleSparkLinearDiscountOracle.dbg.json +1 -1
- 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/ActionCrossChain.sol/ActionCrossChain.dbg.json +1 -1
- package/build/artifacts/contracts/router/ActionCrossChain.sol/ActionCrossChain.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/RouterStorage.sol/RouterStorage.dbg.json +1 -1
- 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/IPSwapAggregator.sol/IPSwapAggregator.dbg.json +1 -1
- 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/ParaswapScaleHelper.sol/IAugustusV6.dbg.json +1 -1
- package/build/artifacts/contracts/router/swap-aggregator/ParaswapScaleHelper.sol/ParaswapScaleHelper.dbg.json +1 -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 +2 -2
- package/contracts/LiquidityMining/GaugeController/PendleGaugeControllerUpg.sol +122 -0
- package/contracts/LiquidityMining/sPendle/StakedPendle.sol +129 -0
- package/contracts/core/Market/PendleGauge.sol +1 -76
- package/contracts/core/Market/{PendleMarketFactoryV6Upg.sol → PendleMarketFactoryV7Upg.sol} +3 -6
- package/contracts/core/Market/{PendleMarketV6.sol → PendleMarketV7.sol} +16 -16
- package/contracts/core/libraries/Errors.sol +1 -1
- package/contracts/core/libraries/TokenHelper.sol +6 -2
- package/contracts/core/libraries/math/PMath.sol +5 -0
- package/contracts/cross-chain/deposit-box/DepositBox.sol +66 -0
- package/contracts/cross-chain/deposit-box/DepositBoxFactory.sol +44 -0
- package/contracts/cross-chain/swap-hub/PendleCrossChainSwapHub.sol +101 -0
- package/contracts/cross-chain/swap-hub/SwapHubBase.sol +184 -0
- package/contracts/interfaces/IPCrossChainSwapHub.sol +108 -0
- package/contracts/interfaces/IPDepositBox.sol +22 -0
- package/contracts/interfaces/IPDepositBoxFactory.sol +19 -0
- package/contracts/interfaces/IPGauge.sol +0 -6
- package/contracts/interfaces/IPGaugeController.sol +20 -3
- package/contracts/interfaces/IPMarket.sol +12 -0
- package/contracts/interfaces/IPStakedPendle.sol +69 -0
- package/contracts/offchain-helpers/BalanceReader.sol +11 -1
- package/contracts/offchain-helpers/MarketSweed.sol +46 -54
- package/contracts/offchain-helpers/PendleMerkleDepositor.sol +5 -6
- package/contracts/router/ActionCrossChain.sol +14 -18
- package/contracts/router/Reflector.sol +19 -2
- package/deployments/1-core.json +3 -2
- package/deployments/10-core.json +1 -1
- package/deployments/130-core.json +2 -1
- package/deployments/146-core.json +1 -1
- package/deployments/42161-core.json +1 -1
- package/deployments/5000-core.json +1 -1
- package/deployments/56-core.json +1 -1
- package/deployments/80094-core.json +1 -1
- package/deployments/8453-core.json +1 -1
- package/deployments/9745-core.json +4 -3
- package/deployments/999-core.json +6 -6
- package/package.json +2 -2
- package/typechain-types/DepositBox.ts +260 -0
- package/typechain-types/DepositBoxFactory.ts +226 -0
- package/typechain-types/{PendleERC20PermitUpg.ts → ERC20Upgradeable.ts} +61 -152
- package/typechain-types/{PendleERC20Upg.ts → IERC20MetadataUpgradeable.ts} +5 -14
- package/typechain-types/{PendleERC20Permit.ts → IERC20Upgradeable.ts} +5 -213
- package/typechain-types/{OverfillMathLib.ts → ILegacyMarket.ts} +25 -13
- package/typechain-types/IPCrossChainSwapHub.ts +656 -0
- package/typechain-types/IPDepositBox.ts +213 -0
- package/typechain-types/IPDepositBoxFactory.ts +226 -0
- package/typechain-types/IPGauge.ts +7 -81
- package/typechain-types/IPGaugeController.ts +168 -38
- package/typechain-types/IPMarket.ts +0 -19
- package/typechain-types/IPStakedPendle.ts +558 -0
- package/typechain-types/PendleCrossChainSwapHub.ts +911 -0
- package/typechain-types/PendleGauge.ts +0 -63
- package/typechain-types/PendleGaugeControllerUpg.ts +686 -0
- package/typechain-types/{PendleMarketFactoryV3.ts → PendleMarketFactoryV7Upg.ts} +59 -18
- package/typechain-types/{PendleMarketV3.ts → PendleMarketV7.ts} +44 -10
- package/typechain-types/StakedPendle.ts +1058 -0
- package/typechain-types/SwapHubBase.ts +886 -0
- package/typechain-types/factories/ActionAddRemoveLiqV3__factory.ts +1 -1
- package/typechain-types/factories/ActionCallbackV3__factory.ts +1 -1
- package/typechain-types/factories/ActionCrossChain__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/DepositBoxFactory__factory.ts +189 -0
- package/typechain-types/factories/DepositBox__factory.ts +222 -0
- package/typechain-types/factories/ERC20Upgradeable__factory.ts +347 -0
- package/typechain-types/factories/Errors__factory.ts +2 -2
- package/typechain-types/factories/ExchangeRateMsgCodec__factory.ts +1 -1
- package/typechain-types/factories/ExpiredLpPtRedeemer__factory.ts +1 -1
- package/typechain-types/factories/FixedPricePTAMM__factory.ts +1 -1
- package/typechain-types/factories/{PendleERC20Upg__factory.ts → IERC20MetadataUpgradeable__factory.ts} +12 -21
- package/typechain-types/factories/{IPMarketFactoryV3__factory.ts → IERC20Upgradeable__factory.ts} +78 -86
- package/typechain-types/factories/ILegacyMarket__factory.ts +42 -0
- package/typechain-types/factories/IPCrossChainSwapHub__factory.ts +828 -0
- package/typechain-types/factories/IPDepositBoxFactory__factory.ts +123 -0
- package/typechain-types/factories/IPDepositBox__factory.ts +136 -0
- package/typechain-types/factories/IPGaugeController__factory.ts +102 -11
- package/typechain-types/factories/IPGauge__factory.ts +0 -51
- package/typechain-types/factories/IPMarket__factory.ts +0 -19
- package/typechain-types/factories/{PendleERC20PermitUpg__factory.ts → IPStakedPendle__factory.ts} +166 -189
- package/typechain-types/factories/LimitBackendHelperV2__factory.ts +1 -1
- package/typechain-types/factories/MarketSweed__factory.ts +1 -1
- package/typechain-types/factories/OracleLib__factory.ts +1 -1
- package/typechain-types/factories/PendleAPIFeeDepositor__factory.ts +1 -1
- package/typechain-types/factories/PendleBoringOneracle__factory.ts +1 -1
- package/typechain-types/factories/PendleBoringSolvBTCOneracle__factory.ts +1 -1
- 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 +1 -1
- package/typechain-types/factories/PendleCrossChainSwapHub__factory.ts +1074 -0
- package/typechain-types/factories/PendleExchangeRateOracleApp__factory.ts +1 -1
- package/typechain-types/factories/PendleExchangeRateOracle__factory.ts +1 -1
- package/typechain-types/factories/PendleFeeDistributorV2__factory.ts +1 -1
- package/typechain-types/factories/PendleFeeSetter__factory.ts +1 -1
- package/typechain-types/factories/PendleGaugeControllerUpg__factory.ts +519 -0
- package/typechain-types/factories/PendleGauge__factory.ts +0 -51
- package/typechain-types/factories/PendleLPWrapperFactory__factory.ts +1 -1
- package/typechain-types/factories/PendleLPWrapper__factory.ts +1 -1
- package/typechain-types/factories/PendleLimitRouter__factory.ts +1 -1
- package/typechain-types/factories/PendleMarketFactoryV7Upg__factory.ts +710 -0
- package/typechain-types/factories/PendleMarketV6__factory.ts +1 -1
- package/typechain-types/factories/PendleMarketV7__factory.ts +1233 -0
- package/typechain-types/factories/PendleMerkleDepositor__factory.ts +1 -1
- package/typechain-types/factories/PendleMerkleDistributor__factory.ts +1 -1
- package/typechain-types/factories/PendleMsgReceiveEndpointUpg__factory.ts +1 -1
- package/typechain-types/factories/PendleMsgSendEndpointUpg__factory.ts +1 -1
- package/typechain-types/factories/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 +1 -1
- package/typechain-types/factories/PendleRedStoneRateOracleAdapter__factory.ts +1 -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 +1 -1
- package/typechain-types/factories/PendleYieldContractFactoryUpg__factory.ts +1 -1
- package/typechain-types/factories/PendleYieldToken__factory.ts +1 -1
- package/typechain-types/factories/Reflector__factory.ts +1 -1
- package/typechain-types/factories/SimulateHelper__factory.ts +1 -1
- package/typechain-types/factories/StakedPendle__factory.ts +785 -0
- package/typechain-types/factories/SwapHubBase__factory.ts +988 -0
- package/typechain-types/factories/VotingEscrowPendleMainchain__factory.ts +1 -1
- package/typechain-types/factories/VotingEscrowPendleSidechain__factory.ts +1 -1
- package/typechain-types/hardhat.d.ts +127 -109
- package/typechain-types/index.ts +32 -30
- package/build/artifacts/contracts/LiquidityMining/GaugeController/PendleGaugeControllerBaseUpg.sol/PendleGaugeControllerBaseUpg.dbg.json +0 -4
- package/build/artifacts/contracts/LiquidityMining/GaugeController/PendleGaugeControllerBaseUpg.sol/PendleGaugeControllerBaseUpg.json +0 -451
- package/build/artifacts/contracts/LiquidityMining/GaugeController/PendleGaugeControllerMainchainUpg.sol/PendleGaugeControllerMainchainUpg.dbg.json +0 -4
- package/build/artifacts/contracts/LiquidityMining/GaugeController/PendleGaugeControllerMainchainUpg.sol/PendleGaugeControllerMainchainUpg.json +0 -557
- package/build/artifacts/contracts/LiquidityMining/GaugeController/PendleGaugeControllerSidechainUpg.sol/PendleGaugeControllerSidechainUpg.dbg.json +0 -4
- package/build/artifacts/contracts/LiquidityMining/GaugeController/PendleGaugeControllerSidechainUpg.sol/PendleGaugeControllerSidechainUpg.json +0 -547
- package/build/artifacts/contracts/LiquidityMining/VotingController/PendleVotingControllerUpg.sol/PendleVotingControllerUpg.dbg.json +0 -4
- package/build/artifacts/contracts/LiquidityMining/VotingController/PendleVotingControllerUpg.sol/PendleVotingControllerUpg.json +0 -1311
- package/build/artifacts/contracts/LiquidityMining/VotingController/VotingControllerStorageUpg.sol/VotingControllerStorageUpg.dbg.json +0 -4
- package/build/artifacts/contracts/LiquidityMining/VotingController/VotingControllerStorageUpg.sol/VotingControllerStorageUpg.json +0 -764
- package/build/artifacts/contracts/core/Market/PendleMarketFactoryV6Upg.sol/PendleMarketFactoryV6Upg.dbg.json +0 -4
- package/build/artifacts/contracts/core/Market/PendleMarketFactoryV6Upg.sol/PendleMarketFactoryV6Upg.json +0 -636
- package/build/artifacts/contracts/core/Market/PendleMarketV6.sol/PendleMarketV6.dbg.json +0 -4
- package/build/artifacts/contracts/core/Market/PendleMarketV6.sol/PendleMarketV6.json +0 -1181
- package/build/artifacts/contracts/deprecated/VeDistributor/PendleFeeDistributor.sol/PendleFeeDistributor.dbg.json +0 -4
- package/build/artifacts/contracts/deprecated/VeDistributor/PendleFeeDistributor.sol/PendleFeeDistributor.json +0 -598
- package/build/artifacts/contracts/interfaces/IPGaugeControllerMainchain.sol/IPGaugeControllerMainchain.dbg.json +0 -4
- package/build/artifacts/contracts/interfaces/IPGaugeControllerMainchain.sol/IPGaugeControllerMainchain.json +0 -183
- package/build/artifacts/contracts/interfaces/IPVotingController.sol/IPVotingController.dbg.json +0 -4
- package/build/artifacts/contracts/interfaces/IPVotingController.sol/IPVotingController.json +0 -380
- package/build/artifacts/contracts/offchain-helpers/Broadcaster.sol/Broadcaster.dbg.json +0 -4
- package/build/artifacts/contracts/offchain-helpers/Broadcaster.sol/Broadcaster.json +0 -262
- package/contracts/LiquidityMining/GaugeController/PendleGaugeControllerBaseUpg.sol +0 -164
- package/contracts/LiquidityMining/GaugeController/PendleGaugeControllerMainchainUpg.sol +0 -42
- package/contracts/LiquidityMining/GaugeController/PendleGaugeControllerSidechainUpg.sol +0 -36
- package/contracts/LiquidityMining/VotingController/PendleVotingControllerUpg.sol +0 -304
- package/contracts/LiquidityMining/VotingController/VotingControllerStorageUpg.sol +0 -301
- package/contracts/deprecated/VeDistributor/PendleFeeDistributor.sol +0 -204
- package/contracts/interfaces/IPGaugeControllerMainchain.sol +0 -8
- package/contracts/interfaces/IPVotingController.sol +0 -43
- package/contracts/offchain-helpers/Broadcaster.sol +0 -48
- package/typechain-types/ActionDelegateBase.ts +0 -57
- package/typechain-types/BasePendleBridgedPrincipalToken.ts +0 -1689
- package/typechain-types/EIP712.ts +0 -135
- package/typechain-types/ERC20Permit.ts +0 -586
- package/typechain-types/IERC5267.ts +0 -135
- package/typechain-types/IPMarketFactoryV3.ts +0 -321
- package/typechain-types/IPMarketV3.ts +0 -1068
- package/typechain-types/LimitBackendHelper.ts +0 -287
- package/typechain-types/PendleBridgedPrincipalToken_18Decimals.ts +0 -1689
- package/typechain-types/PendleBridgedPrincipalToken_6Decimals.ts +0 -1689
- package/typechain-types/PendleBridgedPrincipalToken_8Decimals.ts +0 -1689
- package/typechain-types/PendleYieldContractFactory.ts +0 -801
- package/typechain-types/ShortStrings.ts +0 -57
- package/typechain-types/factories/ActionDelegateBase__factory.ts +0 -80
- package/typechain-types/factories/BasePendleBridgedPrincipalToken__factory.ts +0 -1548
- package/typechain-types/factories/EIP712__factory.ts +0 -85
- package/typechain-types/factories/ERC20Permit__factory.ts +0 -433
- package/typechain-types/factories/IERC5267__factory.ts +0 -72
- package/typechain-types/factories/IPMarketV3__factory.ts +0 -845
- package/typechain-types/factories/LimitBackendHelper__factory.ts +0 -232
- package/typechain-types/factories/OverfillMathLib__factory.ts +0 -77
- package/typechain-types/factories/PendleBridgedPrincipalToken_18Decimals__factory.ts +0 -1652
- package/typechain-types/factories/PendleBridgedPrincipalToken_6Decimals__factory.ts +0 -1650
- package/typechain-types/factories/PendleBridgedPrincipalToken_8Decimals__factory.ts +0 -1650
- package/typechain-types/factories/PendleERC20Permit__factory.ts +0 -470
- package/typechain-types/factories/PendleMarketFactoryV3__factory.ts +0 -714
- package/typechain-types/factories/PendleMarketV3__factory.ts +0 -1211
- package/typechain-types/factories/PendleYieldContractFactory__factory.ts +0 -674
- package/typechain-types/factories/ShortStrings__factory.ts +0 -77
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
2
|
+
pragma solidity ^0.8.17;
|
|
3
|
+
|
|
4
|
+
import {BoringOwnableUpgradeableV2} from "../../core/libraries/BoringOwnableUpgradeableV2.sol";
|
|
5
|
+
import {TokenHelper} from "../../core/libraries/TokenHelper.sol";
|
|
6
|
+
import {PMath} from "../../core/libraries/math/PMath.sol";
|
|
7
|
+
import {IPStakedPendle} from "../../interfaces/IPStakedPendle.sol";
|
|
8
|
+
import {ERC20Upgradeable} from "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol";
|
|
9
|
+
|
|
10
|
+
contract StakedPendle is IPStakedPendle, ERC20Upgradeable, BoringOwnableUpgradeableV2, TokenHelper {
|
|
11
|
+
using PMath for uint256;
|
|
12
|
+
|
|
13
|
+
address public feeReceiver;
|
|
14
|
+
address public immutable PENDLE;
|
|
15
|
+
|
|
16
|
+
mapping(address user => UserCooldown) public userCooldown;
|
|
17
|
+
|
|
18
|
+
uint24 public cooldownDuration;
|
|
19
|
+
uint64 public instantUnstakeFeeRate; // base 1e18. 5e16 means instant unstake will have to pay 5% of the amount.
|
|
20
|
+
|
|
21
|
+
constructor(address pendle) {
|
|
22
|
+
PENDLE = pendle;
|
|
23
|
+
_disableInitializers();
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/// @dev reminder to also call setFeeReceiver & setCooldownDurationAndFee
|
|
27
|
+
function initialize(address _owner) external initializer {
|
|
28
|
+
__ERC20_init("StakedPendle", "sPENDLE");
|
|
29
|
+
__BoringOwnableV2_init(_owner);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
function stake(uint256 amount) external {
|
|
33
|
+
require(amount > 0, "sPendle: invalid amount");
|
|
34
|
+
|
|
35
|
+
_transferIn(PENDLE, msg.sender, amount);
|
|
36
|
+
_mint(msg.sender, amount);
|
|
37
|
+
|
|
38
|
+
emit Staked(msg.sender, amount);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
function cooldown(uint256 amount) external {
|
|
42
|
+
require(amount > 0, "sPendle: invalid amount");
|
|
43
|
+
require(userCooldown[msg.sender].amount == 0, "sPendle: already in cooldown");
|
|
44
|
+
|
|
45
|
+
userCooldown[msg.sender] = UserCooldown({cooldownStart: uint104(block.timestamp), amount: amount.Uint152()});
|
|
46
|
+
_burn(msg.sender, amount);
|
|
47
|
+
|
|
48
|
+
emit CooldownInitiated(msg.sender, amount, block.timestamp);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
function cancelCooldown() external {
|
|
52
|
+
UserCooldown memory data = userCooldown[msg.sender];
|
|
53
|
+
require(data.amount > 0, "sPendle: no cooldown");
|
|
54
|
+
|
|
55
|
+
delete userCooldown[msg.sender];
|
|
56
|
+
_mint(msg.sender, data.amount);
|
|
57
|
+
|
|
58
|
+
emit CooldownCanceled(msg.sender, data.amount);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
function finalizeCooldown() external returns (uint256 /*amount*/) {
|
|
62
|
+
UserCooldown memory data = userCooldown[msg.sender];
|
|
63
|
+
require(data.amount > 0, "sPendle: no cooldown");
|
|
64
|
+
|
|
65
|
+
uint256 cooldownEnd = data.cooldownStart + cooldownDuration;
|
|
66
|
+
require(block.timestamp >= cooldownEnd, "sPendle: redeem not ready");
|
|
67
|
+
|
|
68
|
+
delete userCooldown[msg.sender];
|
|
69
|
+
_transferOut(PENDLE, msg.sender, data.amount);
|
|
70
|
+
|
|
71
|
+
emit Unstaked(msg.sender, data.amount, 0);
|
|
72
|
+
|
|
73
|
+
return data.amount;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
function instantUnstake(uint256 amount) external returns (uint256 amountAfterFee, uint256 fee) {
|
|
77
|
+
require(amount > 0, "sPendle: invalid amount");
|
|
78
|
+
|
|
79
|
+
fee = PMath.rawDivUp(amount * instantUnstakeFeeRate, PMath.ONE);
|
|
80
|
+
amountAfterFee = amount - fee;
|
|
81
|
+
|
|
82
|
+
_burn(msg.sender, amount);
|
|
83
|
+
_transferOut(PENDLE, msg.sender, amountAfterFee);
|
|
84
|
+
_transferOut(PENDLE, feeReceiver, fee);
|
|
85
|
+
|
|
86
|
+
emit Unstaked(msg.sender, amountAfterFee, fee);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
// ======== Misc helper functions =======
|
|
90
|
+
|
|
91
|
+
function multicall(Call3[] calldata calls) external returns (Result[] memory res) {
|
|
92
|
+
uint256 length = calls.length;
|
|
93
|
+
res = new Result[](length);
|
|
94
|
+
for (uint256 i = 0; i < length; i++) {
|
|
95
|
+
(bool success, bytes memory result) = _delegateToSelf(calls[i].callData, calls[i].allowFailure);
|
|
96
|
+
res[i] = Result(success, result);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
function _delegateToSelf(
|
|
101
|
+
bytes memory data,
|
|
102
|
+
bool allowFailure
|
|
103
|
+
) internal returns (bool success, bytes memory result) {
|
|
104
|
+
(success, result) = address(this).delegatecall(data);
|
|
105
|
+
|
|
106
|
+
if (!success && !allowFailure) {
|
|
107
|
+
assembly {
|
|
108
|
+
// We use Yul's revert() to bubble up errors from the target contract.
|
|
109
|
+
revert(add(32, result), mload(result))
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
// ======== Admin functions ========
|
|
115
|
+
|
|
116
|
+
function setFeeReceiver(address newFeeReceiver) external onlyOwner {
|
|
117
|
+
require(newFeeReceiver != address(0), "sPendle: invalid fee receiver");
|
|
118
|
+
|
|
119
|
+
feeReceiver = newFeeReceiver;
|
|
120
|
+
emit FeeReceiverUpdated(newFeeReceiver);
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
function setCooldownDurationAndFee(uint24 newDuration, uint64 newInstantUnstakeFeeRate) external onlyOwner {
|
|
124
|
+
require(newInstantUnstakeFeeRate <= PMath.ONE, "sPendle: invalid fee factor");
|
|
125
|
+
cooldownDuration = newDuration;
|
|
126
|
+
instantUnstakeFeeRate = newInstantUnstakeFeeRate;
|
|
127
|
+
emit CooldownDurationAndFeeUpdated(newDuration, newInstantUnstakeFeeRate);
|
|
128
|
+
}
|
|
129
|
+
}
|
|
@@ -3,105 +3,34 @@ pragma solidity ^0.8.0;
|
|
|
3
3
|
|
|
4
4
|
import "../../interfaces/IPGauge.sol";
|
|
5
5
|
import "../../interfaces/IPGaugeController.sol";
|
|
6
|
-
import "../../interfaces/IPVeToken.sol";
|
|
7
6
|
import "../../interfaces/IStandardizedYield.sol";
|
|
8
7
|
|
|
9
8
|
import "../RewardManager/RewardManager.sol";
|
|
10
9
|
|
|
11
|
-
/**
|
|
12
|
-
* Invariants to maintain:
|
|
13
|
-
* - before any changes to active balance, updateAndDistributeRewards() must be called
|
|
14
|
-
*/
|
|
15
10
|
abstract contract PendleGauge is RewardManager, IPGauge {
|
|
16
|
-
using PMath for uint256;
|
|
17
|
-
using SafeERC20 for IERC20;
|
|
18
11
|
using ArrayLib for address[];
|
|
19
12
|
|
|
20
13
|
address private immutable SY;
|
|
21
|
-
|
|
22
|
-
uint256 internal constant TOKENLESS_PRODUCTION = 40;
|
|
23
|
-
|
|
24
14
|
address internal immutable PENDLE;
|
|
25
|
-
IPVeToken internal immutable vePENDLE;
|
|
26
15
|
address internal immutable gaugeController;
|
|
27
16
|
|
|
28
|
-
|
|
29
|
-
mapping(address => uint256) public activeBalance;
|
|
30
|
-
|
|
31
|
-
constructor(address _SY, address _vePendle, address _gaugeController) {
|
|
17
|
+
constructor(address _SY, address _gaugeController) {
|
|
32
18
|
SY = _SY;
|
|
33
|
-
vePENDLE = IPVeToken(_vePendle);
|
|
34
19
|
gaugeController = _gaugeController;
|
|
35
20
|
PENDLE = IPGaugeController(gaugeController).pendle();
|
|
36
21
|
}
|
|
37
22
|
|
|
38
|
-
/**
|
|
39
|
-
* @dev Since rewardShares is based on activeBalance, user's activeBalance must be updated AFTER
|
|
40
|
-
* rewards is updated
|
|
41
|
-
* @dev It's intended to have user's activeBalance updated when rewards is redeemed
|
|
42
|
-
*/
|
|
43
23
|
function _redeemRewards(address user) internal virtual returns (uint256[] memory rewardsOut) {
|
|
44
24
|
_updateAndDistributeRewards(user);
|
|
45
|
-
_updateUserActiveBalance(user);
|
|
46
25
|
rewardsOut = _doTransferOutRewards(user, user);
|
|
47
26
|
emit RedeemRewards(user, rewardsOut);
|
|
48
27
|
}
|
|
49
28
|
|
|
50
|
-
function _updateUserActiveBalance(address user) internal virtual {
|
|
51
|
-
_updateUserActiveBalanceForTwo(user, address(0));
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
function _updateUserActiveBalanceForTwo(address user1, address user2) internal virtual {
|
|
55
|
-
if (user1 != address(0) && user1 != address(this)) _updateUserActiveBalancePrivate(user1);
|
|
56
|
-
if (user2 != address(0) && user2 != address(this)) _updateUserActiveBalancePrivate(user2);
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
/**
|
|
60
|
-
* @dev should only be callable from `_updateUserActiveBalanceForTwo` to guarantee user != address(0) && user !=
|
|
61
|
-
* address(this)
|
|
62
|
-
*/
|
|
63
|
-
function _updateUserActiveBalancePrivate(address user) private {
|
|
64
|
-
assert(user != address(0) && user != address(this));
|
|
65
|
-
|
|
66
|
-
uint256 lpBalance = _stakedBalance(user);
|
|
67
|
-
uint256 veBoostedLpBalance = _calcVeBoostedLpBalance(user, lpBalance);
|
|
68
|
-
|
|
69
|
-
uint256 newActiveBalance = PMath.min(veBoostedLpBalance, lpBalance);
|
|
70
|
-
|
|
71
|
-
totalActiveSupply = totalActiveSupply - activeBalance[user] + newActiveBalance;
|
|
72
|
-
activeBalance[user] = newActiveBalance;
|
|
73
|
-
|
|
74
|
-
emit UpdateActiveBalance(user, newActiveBalance);
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
function _calcVeBoostedLpBalance(address user, uint256 lpBalance) internal virtual returns (uint256) {
|
|
78
|
-
(uint256 vePendleSupply, uint256 vePendleBalance) = vePENDLE.totalSupplyAndBalanceCurrent(user);
|
|
79
|
-
// Inspired by Curve's Gauge
|
|
80
|
-
uint256 veBoostedLpBalance = (lpBalance * TOKENLESS_PRODUCTION) / 100;
|
|
81
|
-
if (vePendleSupply > 0) {
|
|
82
|
-
veBoostedLpBalance += (((_totalStaked() * vePendleBalance) / vePendleSupply) * (100 - TOKENLESS_PRODUCTION))
|
|
83
|
-
/ 100;
|
|
84
|
-
}
|
|
85
|
-
return veBoostedLpBalance;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
29
|
function _redeemExternalReward() internal virtual override {
|
|
89
30
|
IStandardizedYield(SY).claimRewards(address(this));
|
|
90
31
|
IPGaugeController(gaugeController).redeemMarketReward();
|
|
91
32
|
}
|
|
92
33
|
|
|
93
|
-
function _stakedBalance(address user) internal view virtual returns (uint256);
|
|
94
|
-
|
|
95
|
-
function _totalStaked() internal view virtual returns (uint256);
|
|
96
|
-
|
|
97
|
-
function _rewardSharesTotal() internal view virtual override returns (uint256) {
|
|
98
|
-
return totalActiveSupply;
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
function _rewardSharesUser(address user) internal view virtual override returns (uint256) {
|
|
102
|
-
return activeBalance[user];
|
|
103
|
-
}
|
|
104
|
-
|
|
105
34
|
function _getRewardTokens() internal view virtual override returns (address[] memory) {
|
|
106
35
|
address[] memory SYRewards = IStandardizedYield(SY).getRewardTokens();
|
|
107
36
|
if (SYRewards.contains(PENDLE)) return SYRewards;
|
|
@@ -111,8 +40,4 @@ abstract contract PendleGauge is RewardManager, IPGauge {
|
|
|
111
40
|
function _beforeTokenTransfer(address from, address to, uint256) internal virtual {
|
|
112
41
|
_updateAndDistributeRewardsForTwo(from, to);
|
|
113
42
|
}
|
|
114
|
-
|
|
115
|
-
function _afterTokenTransfer(address from, address to, uint256) internal virtual {
|
|
116
|
-
_updateUserActiveBalanceForTwo(from, to);
|
|
117
|
-
}
|
|
118
43
|
}
|
|
@@ -10,10 +10,10 @@ import "../libraries/BaseSplitCodeFactory.sol";
|
|
|
10
10
|
import "../libraries/BoringOwnableUpgradeableV2.sol";
|
|
11
11
|
import "../libraries/Errors.sol";
|
|
12
12
|
|
|
13
|
-
contract
|
|
13
|
+
contract PendleMarketFactoryV7Upg is BoringOwnableUpgradeableV2, IPMarketFactory {
|
|
14
14
|
using EnumerableSet for EnumerableSet.AddressSet;
|
|
15
15
|
|
|
16
|
-
uint256 public constant VERSION =
|
|
16
|
+
uint256 public constant VERSION = 7;
|
|
17
17
|
|
|
18
18
|
address public immutable marketCreationCodeContractA;
|
|
19
19
|
uint256 public immutable marketCreationCodeSizeA;
|
|
@@ -21,7 +21,6 @@ contract PendleMarketFactoryV6Upg is BoringOwnableUpgradeableV2, IPMarketFactory
|
|
|
21
21
|
uint256 public immutable marketCreationCodeSizeB;
|
|
22
22
|
|
|
23
23
|
address public immutable yieldContractFactory;
|
|
24
|
-
address public immutable vePendle;
|
|
25
24
|
address public immutable gaugeController;
|
|
26
25
|
|
|
27
26
|
uint256 public immutable maxLnFeeRateRoot;
|
|
@@ -44,7 +43,6 @@ contract PendleMarketFactoryV6Upg is BoringOwnableUpgradeableV2, IPMarketFactory
|
|
|
44
43
|
uint256 _marketCreationCodeSizeA,
|
|
45
44
|
address _marketCreationCodeContractB,
|
|
46
45
|
uint256 _marketCreationCodeSizeB,
|
|
47
|
-
address _vePendle,
|
|
48
46
|
address _gaugeController
|
|
49
47
|
) {
|
|
50
48
|
yieldContractFactory = _yieldContractFactory;
|
|
@@ -55,7 +53,6 @@ contract PendleMarketFactoryV6Upg is BoringOwnableUpgradeableV2, IPMarketFactory
|
|
|
55
53
|
marketCreationCodeContractB = _marketCreationCodeContractB;
|
|
56
54
|
marketCreationCodeSizeB = _marketCreationCodeSizeB;
|
|
57
55
|
|
|
58
|
-
vePendle = _vePendle;
|
|
59
56
|
gaugeController = _gaugeController;
|
|
60
57
|
|
|
61
58
|
_disableInitializers();
|
|
@@ -91,7 +88,7 @@ contract PendleMarketFactoryV6Upg is BoringOwnableUpgradeableV2, IPMarketFactory
|
|
|
91
88
|
market = BaseSplitCodeFactory._create2(
|
|
92
89
|
0,
|
|
93
90
|
bytes32(block.chainid),
|
|
94
|
-
abi.encode(PT, scalarRoot, initialAnchor, lnFeeRateRoot,
|
|
91
|
+
abi.encode(PT, scalarRoot, initialAnchor, lnFeeRateRoot, gaugeController),
|
|
95
92
|
marketCreationCodeContractA,
|
|
96
93
|
marketCreationCodeSizeA,
|
|
97
94
|
marketCreationCodeContractB,
|
|
@@ -16,7 +16,7 @@ import "./PendleGauge.sol";
|
|
|
16
16
|
* - address(0) & address(this) should never have any rewards & activeBalance accounting done. This is
|
|
17
17
|
* guaranteed by address(0) & address(this) check in each updateForTwo function
|
|
18
18
|
*/
|
|
19
|
-
contract
|
|
19
|
+
contract PendleMarketV7 is PendleERC20, PendleGauge, IPMarket {
|
|
20
20
|
using PMath for uint256;
|
|
21
21
|
using PMath for int256;
|
|
22
22
|
using MarketMathCore for MarketState;
|
|
@@ -44,7 +44,7 @@ contract PendleMarketV6 is PendleERC20, PendleGauge, IPMarket {
|
|
|
44
44
|
string private constant LP_NAME_PREF = "PLP ";
|
|
45
45
|
string private constant LP_SYMBOL_PREF = "PLP-";
|
|
46
46
|
|
|
47
|
-
uint256 public constant VERSION =
|
|
47
|
+
uint256 public constant VERSION = 7;
|
|
48
48
|
|
|
49
49
|
IPPrincipalToken internal immutable PT;
|
|
50
50
|
IStandardizedYield internal immutable SY;
|
|
@@ -66,16 +66,9 @@ contract PendleMarketV6 is PendleERC20, PendleGauge, IPMarket {
|
|
|
66
66
|
_;
|
|
67
67
|
}
|
|
68
68
|
|
|
69
|
-
constructor(
|
|
70
|
-
address _PT,
|
|
71
|
-
int256 _scalarRoot,
|
|
72
|
-
int256 _initialAnchor,
|
|
73
|
-
uint80 _lnFeeRateRoot,
|
|
74
|
-
address _vePendle,
|
|
75
|
-
address _gaugeController
|
|
76
|
-
)
|
|
69
|
+
constructor(address _PT, int256 _scalarRoot, int256 _initialAnchor, uint80 _lnFeeRateRoot, address _gaugeController)
|
|
77
70
|
PendleERC20(_getLPName(_PT), _getLPSymbol(_PT), 18)
|
|
78
|
-
PendleGauge(IPPrincipalToken(_PT).SY(),
|
|
71
|
+
PendleGauge(IPPrincipalToken(_PT).SY(), _gaugeController)
|
|
79
72
|
{
|
|
80
73
|
PT = IPPrincipalToken(_PT);
|
|
81
74
|
SY = IStandardizedYield(PT.SY());
|
|
@@ -370,11 +363,11 @@ contract PendleMarketV6 is PendleERC20, PendleGauge, IPMarket {
|
|
|
370
363
|
PENDLE GAUGE - RELATED
|
|
371
364
|
//////////////////////////////////////////////////////////////*/
|
|
372
365
|
|
|
373
|
-
function
|
|
366
|
+
function _rewardSharesUser(address user) internal view override returns (uint256) {
|
|
374
367
|
return balanceOf(user);
|
|
375
368
|
}
|
|
376
369
|
|
|
377
|
-
function
|
|
370
|
+
function _rewardSharesTotal() internal view override returns (uint256) {
|
|
378
371
|
return totalSupply();
|
|
379
372
|
}
|
|
380
373
|
|
|
@@ -386,8 +379,15 @@ contract PendleMarketV6 is PendleERC20, PendleGauge, IPMarket {
|
|
|
386
379
|
PendleGauge._beforeTokenTransfer(from, to, amount);
|
|
387
380
|
}
|
|
388
381
|
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
382
|
+
/*///////////////////////////////////////////////////////////////
|
|
383
|
+
LEGACY FUNCTIONS
|
|
384
|
+
//////////////////////////////////////////////////////////////*/
|
|
385
|
+
|
|
386
|
+
function totalActiveSupply() external view returns (uint256) {
|
|
387
|
+
return totalSupply();
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
function activeBalance(address user) external view returns (uint256) {
|
|
391
|
+
return balanceOf(user);
|
|
392
392
|
}
|
|
393
393
|
}
|
|
@@ -138,7 +138,7 @@ library Errors {
|
|
|
138
138
|
error VEReceiveOldSupply(uint256 msgTime);
|
|
139
139
|
|
|
140
140
|
error GCNotPendleMarket(address caller);
|
|
141
|
-
error
|
|
141
|
+
error GCNotRewardDataUpdater(address caller);
|
|
142
142
|
|
|
143
143
|
error InvalidWTime(uint256 wTime);
|
|
144
144
|
error ExpiryInThePast(uint256 expiry);
|
|
@@ -21,7 +21,7 @@ abstract contract TokenHelper {
|
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
function _transferOut(address token, address to, uint256 amount) internal {
|
|
24
|
-
if (amount == 0) return;
|
|
24
|
+
if (amount == 0 || to == address(this)) return;
|
|
25
25
|
if (token == NATIVE) {
|
|
26
26
|
(bool success,) = to.call{value: amount}("");
|
|
27
27
|
require(success, "eth send failed");
|
|
@@ -41,8 +41,12 @@ abstract contract TokenHelper {
|
|
|
41
41
|
}
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
+
function _balanceOf(address addr, address token) internal view returns (uint256) {
|
|
45
|
+
return (token == NATIVE) ? addr.balance : IERC20(token).balanceOf(addr);
|
|
46
|
+
}
|
|
47
|
+
|
|
44
48
|
function _selfBalance(address token) internal view returns (uint256) {
|
|
45
|
-
return (
|
|
49
|
+
return _balanceOf(address(this), token);
|
|
46
50
|
}
|
|
47
51
|
|
|
48
52
|
function _selfBalance(IERC20 token) internal view returns (uint256) {
|
|
@@ -211,6 +211,11 @@ library PMath {
|
|
|
211
211
|
return uint80(x);
|
|
212
212
|
}
|
|
213
213
|
|
|
214
|
+
function Uint152(uint256 x) internal pure returns (uint152) {
|
|
215
|
+
require(x <= type(uint152).max);
|
|
216
|
+
return uint152(x);
|
|
217
|
+
}
|
|
218
|
+
|
|
214
219
|
function isAApproxB(uint256 a, uint256 b, uint256 eps) internal pure returns (bool) {
|
|
215
220
|
return mulDown(b, ONE - eps) <= a && a <= mulDown(b, ONE + eps);
|
|
216
221
|
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
2
|
+
pragma solidity ^0.8.30;
|
|
3
|
+
|
|
4
|
+
import {Initializable} from "@openzeppelin/contracts/proxy/utils/Initializable.sol";
|
|
5
|
+
import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
|
|
6
|
+
import {SafeERC20} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
|
|
7
|
+
import {Address} from "@openzeppelin/contracts/utils/Address.sol";
|
|
8
|
+
import {TokenHelper} from "../../core/libraries/TokenHelper.sol";
|
|
9
|
+
import {ApprovedCall, IPDepositBox} from "../../interfaces/IPDepositBox.sol";
|
|
10
|
+
|
|
11
|
+
contract DepositBox is IPDepositBox, TokenHelper, Initializable {
|
|
12
|
+
using Address for address;
|
|
13
|
+
using SafeERC20 for IERC20;
|
|
14
|
+
|
|
15
|
+
address public immutable MANAGER;
|
|
16
|
+
address public OWNER;
|
|
17
|
+
uint32 public BOX_ID;
|
|
18
|
+
|
|
19
|
+
constructor(address manager_) {
|
|
20
|
+
_disableInitializers();
|
|
21
|
+
MANAGER = manager_;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
modifier onlyManager() {
|
|
25
|
+
require(msg.sender == MANAGER, "DepositBox: caller is not manager");
|
|
26
|
+
_;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
function initialize(address owner_, uint32 boxId_) external initializer {
|
|
30
|
+
OWNER = owner_;
|
|
31
|
+
BOX_ID = boxId_;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
function withdrawTo(address to, address token, uint256 amount) external onlyManager {
|
|
35
|
+
_transferOut(token, to, amount);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
function approveAndCall(ApprovedCall memory call, address nativeRefund)
|
|
39
|
+
external
|
|
40
|
+
payable
|
|
41
|
+
onlyManager
|
|
42
|
+
returns (bytes memory result)
|
|
43
|
+
{
|
|
44
|
+
uint256 nativeAmount = call.token == NATIVE ? call.amount : 0;
|
|
45
|
+
uint256 nativeFee = msg.value;
|
|
46
|
+
|
|
47
|
+
uint256 initialNativeBalance = _selfBalance(NATIVE) - nativeAmount - nativeFee;
|
|
48
|
+
|
|
49
|
+
_approveForExtRouter(call.token, call.approveTo, call.amount);
|
|
50
|
+
result = call.callTo.functionCallWithValue(call.data, nativeAmount + nativeFee);
|
|
51
|
+
_approveForExtRouter(call.token, call.approveTo, 0);
|
|
52
|
+
|
|
53
|
+
uint256 finalNativeBalance = _selfBalance(NATIVE);
|
|
54
|
+
|
|
55
|
+
if (finalNativeBalance > initialNativeBalance) {
|
|
56
|
+
_transferOut(NATIVE, nativeRefund, finalNativeBalance - initialNativeBalance);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
function _approveForExtRouter(address token, address extRouter, uint256 amount) internal {
|
|
61
|
+
if (token == NATIVE) return;
|
|
62
|
+
IERC20(token).forceApprove(extRouter, amount);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
receive() external payable {}
|
|
66
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
2
|
+
pragma solidity ^0.8.30;
|
|
3
|
+
|
|
4
|
+
import {Create2} from "@openzeppelin/contracts/utils/Create2.sol";
|
|
5
|
+
|
|
6
|
+
import {IPDepositBox} from "../../interfaces/IPDepositBox.sol";
|
|
7
|
+
import {IPDepositBoxFactory} from "../../interfaces/IPDepositBoxFactory.sol";
|
|
8
|
+
import {DepositBox} from "./DepositBox.sol";
|
|
9
|
+
|
|
10
|
+
contract DepositBoxFactory is IPDepositBoxFactory {
|
|
11
|
+
/// @dev creation code of OpenZeppelin's BeaconProxy
|
|
12
|
+
address public immutable BEACON_PROXY_CODE_CONTRACT;
|
|
13
|
+
address public immutable DEPOSIT_BOX_BEACON;
|
|
14
|
+
bytes32 public immutable DEPOSIT_BOX_CODE_HASH;
|
|
15
|
+
|
|
16
|
+
constructor(address beaconProxyCodeContract_, address depositBoxBeacon_) {
|
|
17
|
+
BEACON_PROXY_CODE_CONTRACT = beaconProxyCodeContract_;
|
|
18
|
+
DEPOSIT_BOX_BEACON = depositBoxBeacon_;
|
|
19
|
+
DEPOSIT_BOX_CODE_HASH =
|
|
20
|
+
keccak256(abi.encodePacked(beaconProxyCodeContract_.code, abi.encode(depositBoxBeacon_, "")));
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
function computeDepositBox(address owner, uint32 boxId)
|
|
24
|
+
public
|
|
25
|
+
view
|
|
26
|
+
returns (address box, bytes32 salt, bool deployed)
|
|
27
|
+
{
|
|
28
|
+
salt = keccak256(abi.encode(owner, boxId));
|
|
29
|
+
box = Create2.computeAddress(salt, DEPOSIT_BOX_CODE_HASH);
|
|
30
|
+
deployed = box.code.length > 0;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
function deployDepositBox(address owner, uint32 boxId) external returns (IPDepositBox) {
|
|
34
|
+
(address box, bytes32 salt, bool deployed) = computeDepositBox(owner, boxId);
|
|
35
|
+
if (deployed) {
|
|
36
|
+
return IPDepositBox(box);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
bytes memory bytecode = abi.encodePacked(BEACON_PROXY_CODE_CONTRACT.code, abi.encode(DEPOSIT_BOX_BEACON, ""));
|
|
40
|
+
assert(Create2.deploy(0, salt, bytecode) == box);
|
|
41
|
+
DepositBox(payable(box)).initialize(owner, boxId);
|
|
42
|
+
return IPDepositBox(box);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
2
|
+
pragma solidity ^0.8.30;
|
|
3
|
+
|
|
4
|
+
import {ApprovedCall, IPDepositBox} from "../../interfaces/IPDepositBox.sol";
|
|
5
|
+
import {SwapHubBase} from "./SwapHubBase.sol";
|
|
6
|
+
|
|
7
|
+
contract PendleCrossChainSwapHub is SwapHubBase {
|
|
8
|
+
constructor(address treasury_, address depositBoxFactory_) SwapHubBase(treasury_, depositBoxFactory_) {
|
|
9
|
+
_disableInitializers();
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
function initialize(address _owner) external initializer {
|
|
13
|
+
__EIP712_init("Pendle Cross Chain Swap Hub", "1");
|
|
14
|
+
__BoringOwnableV2_init(_owner);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
function withdrawToken(WithdrawTokenMessage memory ms, bytes memory sig) external onlyExecutor {
|
|
18
|
+
IPDepositBox box = _checkBoxPermit(ms.permit, hashTypedData(ms), sig);
|
|
19
|
+
_payTreasury(box, ms.token, ms.amountFee);
|
|
20
|
+
_withdrawToken(ms, box);
|
|
21
|
+
|
|
22
|
+
emit WithdrawToken(
|
|
23
|
+
ms.permit.owner,
|
|
24
|
+
ms.permit.boxId,
|
|
25
|
+
ms.permit.requestId,
|
|
26
|
+
ms.permit.nonce,
|
|
27
|
+
ms.token,
|
|
28
|
+
ms.amountWithdraw,
|
|
29
|
+
ms.amountFee
|
|
30
|
+
);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
function bridgeToken(BridgeTokenMessage memory ms, bytes memory sig) external payable onlyExecutor {
|
|
34
|
+
IPDepositBox box = _checkBoxPermit(ms.permit, hashTypedData(ms), sig);
|
|
35
|
+
_payTreasury(box, ms.token, ms.amountFee);
|
|
36
|
+
_bridgeToken(ms, box, msg.value);
|
|
37
|
+
|
|
38
|
+
emit BridgeToken(
|
|
39
|
+
ms.permit.owner,
|
|
40
|
+
ms.permit.boxId,
|
|
41
|
+
ms.permit.requestId,
|
|
42
|
+
ms.permit.nonce,
|
|
43
|
+
ms.bridgeExtRouter,
|
|
44
|
+
ms.token,
|
|
45
|
+
ms.amountBridge,
|
|
46
|
+
ms.amountFee
|
|
47
|
+
);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
function swapToken(SwapTokenMessage memory ms, bytes memory sig) external onlyExecutor {
|
|
51
|
+
IPDepositBox box = _checkBoxPermit(ms.permit, hashTypedData(ms), sig);
|
|
52
|
+
// swapToken does not pay treasury
|
|
53
|
+
|
|
54
|
+
uint256 netTokenReceived = _swapToken(ms, box);
|
|
55
|
+
require(netTokenReceived >= ms.minReceived, InsufficientTokenReceived());
|
|
56
|
+
|
|
57
|
+
emit SwapToken(
|
|
58
|
+
ms.permit.owner,
|
|
59
|
+
ms.permit.boxId,
|
|
60
|
+
ms.permit.requestId,
|
|
61
|
+
ms.permit.nonce,
|
|
62
|
+
ms.tokenSpent,
|
|
63
|
+
ms.amountSpent,
|
|
64
|
+
ms.tokenReceived,
|
|
65
|
+
netTokenReceived
|
|
66
|
+
);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
function _payTreasury(IPDepositBox box, address token, uint256 amount) internal {
|
|
70
|
+
box.withdrawTo(TREASURY, token, amount);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
function _withdrawToken(WithdrawTokenMessage memory ms, IPDepositBox box) internal {
|
|
74
|
+
box.withdrawTo(ms.permit.owner, ms.token, ms.amountWithdraw);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
function _bridgeToken(BridgeTokenMessage memory ms, IPDepositBox box, uint256 nativeFee) internal {
|
|
78
|
+
ApprovedCall memory call = ApprovedCall({
|
|
79
|
+
token: ms.token,
|
|
80
|
+
amount: ms.amountBridge,
|
|
81
|
+
approveTo: ms.bridgeApprove,
|
|
82
|
+
callTo: ms.bridgeExtRouter,
|
|
83
|
+
data: ms.bridgeCalldata
|
|
84
|
+
});
|
|
85
|
+
box.approveAndCall{value: nativeFee}(call, msg.sender);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
function _swapToken(SwapTokenMessage memory ms, IPDepositBox box) internal returns (uint256 rawTokenReceived) {
|
|
89
|
+
ApprovedCall memory call = ApprovedCall({
|
|
90
|
+
token: ms.tokenSpent,
|
|
91
|
+
amount: ms.amountSpent,
|
|
92
|
+
approveTo: ms.swapApprove,
|
|
93
|
+
callTo: ms.swapExtRouter,
|
|
94
|
+
data: ms.swapCalldata
|
|
95
|
+
});
|
|
96
|
+
|
|
97
|
+
uint256 preBalance = _balanceOf(address(box), ms.tokenReceived);
|
|
98
|
+
box.approveAndCall(call, address(box));
|
|
99
|
+
rawTokenReceived = _balanceOf(address(box), ms.tokenReceived) - preBalance;
|
|
100
|
+
}
|
|
101
|
+
}
|