@pendle/core-v2 6.4.4-swaphubtest → 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 +1 -1
- package/build/artifacts/contracts/cross-chain/swap-hub/PendleCrossChainSwapHub.sol/PendleCrossChainSwapHub.json +302 -511
- package/build/artifacts/contracts/cross-chain/swap-hub/SwapHubBase.sol/SwapHubBase.dbg.json +1 -1
- package/build/artifacts/contracts/cross-chain/swap-hub/SwapHubBase.sol/SwapHubBase.json +301 -501
- 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 +1 -1
- package/build/artifacts/contracts/interfaces/IPCrossChainSwapHub.sol/IPCrossChainSwapHub.json +265 -478
- package/build/artifacts/contracts/interfaces/IPDepositBox.sol/IPDepositBox.dbg.json +1 -1
- 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/DepositBoxFactory.sol +44 -0
- package/contracts/cross-chain/swap-hub/PendleCrossChainSwapHub.sol +37 -114
- package/contracts/cross-chain/swap-hub/SwapHubBase.sol +82 -172
- package/contracts/interfaces/IPCrossChainSwapHub.sol +34 -73
- 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 +1 -1
- package/typechain-types/DepositBoxFactory.ts +226 -0
- package/typechain-types/ERC20Upgradeable.ts +426 -0
- package/typechain-types/IERC20MetadataUpgradeable.ts +339 -0
- package/typechain-types/IERC20Upgradeable.ts +300 -0
- package/typechain-types/ILegacyMarket.ts +93 -0
- package/typechain-types/IPCrossChainSwapHub.ts +183 -409
- 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 +226 -434
- package/typechain-types/PendleGauge.ts +0 -63
- package/typechain-types/PendleGaugeControllerUpg.ts +686 -0
- package/typechain-types/PendleMarketFactoryV7Upg.ts +760 -0
- package/typechain-types/PendleMarketV7.ts +1229 -0
- package/typechain-types/StakedPendle.ts +1058 -0
- package/typechain-types/SwapHubBase.ts +225 -433
- 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 +1 -1
- 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/IERC20MetadataUpgradeable__factory.ts +252 -0
- package/typechain-types/factories/IERC20Upgradeable__factory.ts +209 -0
- package/typechain-types/factories/ILegacyMarket__factory.ts +42 -0
- package/typechain-types/factories/IPCrossChainSwapHub__factory.ts +264 -477
- package/typechain-types/factories/IPDepositBoxFactory__factory.ts +123 -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/IPStakedPendle__factory.ts +366 -0
- 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 +304 -517
- 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 +300 -500
- package/typechain-types/factories/VotingEscrowPendleMainchain__factory.ts +1 -1
- package/typechain-types/factories/VotingEscrowPendleSidechain__factory.ts +1 -1
- package/typechain-types/hardhat.d.ts +87 -87
- package/typechain-types/index.ts +24 -24
- 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/cross-chain/swap-hub/DepositBox.sol/DepositBox.dbg.json +0 -4
- package/build/artifacts/contracts/cross-chain/swap-hub/DepositBox.sol/DepositBox.json +0 -170
- 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/contracts/cross-chain/{swap-hub → deposit-box}/DepositBox.sol +0 -0
|
@@ -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,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
|
+
}
|
|
@@ -1,21 +1,11 @@
|
|
|
1
1
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
2
2
|
pragma solidity ^0.8.30;
|
|
3
3
|
|
|
4
|
-
import {
|
|
5
|
-
IOFT,
|
|
6
|
-
MessagingFee,
|
|
7
|
-
MessagingReceipt,
|
|
8
|
-
OFTReceipt,
|
|
9
|
-
SendParam
|
|
10
|
-
} from "@layerzerolabs/oft-evm/contracts/interfaces/IOFT.sol";
|
|
11
|
-
import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
|
|
12
4
|
import {ApprovedCall, IPDepositBox} from "../../interfaces/IPDepositBox.sol";
|
|
13
5
|
import {SwapHubBase} from "./SwapHubBase.sol";
|
|
14
6
|
|
|
15
7
|
contract PendleCrossChainSwapHub is SwapHubBase {
|
|
16
|
-
constructor(address treasury_, address
|
|
17
|
-
SwapHubBase(treasury_, beaconProxyCodeContract_, depositBoxBeacon_)
|
|
18
|
-
{
|
|
8
|
+
constructor(address treasury_, address depositBoxFactory_) SwapHubBase(treasury_, depositBoxFactory_) {
|
|
19
9
|
_disableInitializers();
|
|
20
10
|
}
|
|
21
11
|
|
|
@@ -25,87 +15,63 @@ contract PendleCrossChainSwapHub is SwapHubBase {
|
|
|
25
15
|
}
|
|
26
16
|
|
|
27
17
|
function withdrawToken(WithdrawTokenMessage memory ms, bytes memory sig) external onlyExecutor {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
IPDepositBox box = _checkAndDeployBox(ms.owner, ms.boxId);
|
|
18
|
+
IPDepositBox box = _checkBoxPermit(ms.permit, hashTypedData(ms), sig);
|
|
31
19
|
_payTreasury(box, ms.token, ms.amountFee);
|
|
32
20
|
_withdrawToken(ms, box);
|
|
33
21
|
|
|
34
|
-
emit WithdrawToken(
|
|
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
|
+
);
|
|
35
31
|
}
|
|
36
32
|
|
|
37
33
|
function bridgeToken(BridgeTokenMessage memory ms, bytes memory sig) external payable onlyExecutor {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
IPDepositBox box = _checkAndDeployBox(ms.owner, ms.boxId);
|
|
41
|
-
_pullToken(ms.pullFromOwner, box, ms.owner, ms.token, ms.amountBridge + ms.amountFee);
|
|
34
|
+
IPDepositBox box = _checkBoxPermit(ms.permit, hashTypedData(ms), sig);
|
|
42
35
|
_payTreasury(box, ms.token, ms.amountFee);
|
|
43
36
|
_bridgeToken(ms, box, msg.value);
|
|
44
37
|
|
|
45
38
|
emit BridgeToken(
|
|
46
|
-
ms.owner,
|
|
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
47
|
);
|
|
48
48
|
}
|
|
49
49
|
|
|
50
50
|
function swapToken(SwapTokenMessage memory ms, bytes memory sig) external onlyExecutor {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
IPDepositBox box = _checkAndDeployBox(ms.owner, ms.boxId);
|
|
54
|
-
_pullToken(ms.pullFromOwner, box, ms.owner, ms.tokenSpent, ms.amountSpent + ms.amountFee);
|
|
55
|
-
_payTreasury(box, ms.tokenSpent, ms.amountFee);
|
|
51
|
+
IPDepositBox box = _checkBoxPermit(ms.permit, hashTypedData(ms), sig);
|
|
52
|
+
// swapToken does not pay treasury
|
|
56
53
|
|
|
57
54
|
uint256 netTokenReceived = _swapToken(ms, box);
|
|
58
55
|
require(netTokenReceived >= ms.minReceived, InsufficientTokenReceived());
|
|
59
56
|
|
|
60
57
|
emit SwapToken(
|
|
61
|
-
ms.owner,
|
|
62
|
-
ms.boxId,
|
|
58
|
+
ms.permit.owner,
|
|
59
|
+
ms.permit.boxId,
|
|
60
|
+
ms.permit.requestId,
|
|
61
|
+
ms.permit.nonce,
|
|
63
62
|
ms.tokenSpent,
|
|
64
63
|
ms.amountSpent,
|
|
65
|
-
ms.amountFee,
|
|
66
64
|
ms.tokenReceived,
|
|
67
|
-
netTokenReceived
|
|
68
|
-
ms.pullFromOwner,
|
|
69
|
-
ms.sendToOwner
|
|
70
|
-
);
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
function buyCrossChainPt(BuyCrossChainPtMessage memory ms, bytes memory sig) external payable onlyExecutor {
|
|
74
|
-
_verifyOwnerSig(ms.owner, ms.expiry, ms.nonce, hashTypedData(ms), sig);
|
|
75
|
-
|
|
76
|
-
IPDepositBox box = _checkAndDeployBox(ms.owner, ms.boxId);
|
|
77
|
-
_pullToken(ms.pullFromOwner, box, ms.owner, ms.tokenSpent, ms.amountSpent + ms.amountFee);
|
|
78
|
-
_payTreasury(box, ms.tokenSpent, ms.amountFee);
|
|
79
|
-
|
|
80
|
-
address pt = IOFT(ms.ptAdapter).token();
|
|
81
|
-
uint256 netPtReceived = _buyPtAndBridge(ms, box, pt, msg.value, msg.sender);
|
|
82
|
-
require(netPtReceived >= ms.minPtReceived, InsufficientTokenReceived());
|
|
83
|
-
|
|
84
|
-
emit BuyCrossChainPt(
|
|
85
|
-
ms.owner,
|
|
86
|
-
ms.boxId,
|
|
87
|
-
ms.tokenSpent,
|
|
88
|
-
ms.amountSpent,
|
|
89
|
-
ms.amountFee,
|
|
90
|
-
ms.ptAdapter,
|
|
91
|
-
pt,
|
|
92
|
-
netPtReceived,
|
|
93
|
-
ms.pullFromOwner
|
|
65
|
+
netTokenReceived
|
|
94
66
|
);
|
|
95
67
|
}
|
|
96
68
|
|
|
97
|
-
function _pullToken(bool pullFromOwner, IPDepositBox box, address owner, address token, uint256 amount) internal {
|
|
98
|
-
if (pullFromOwner) {
|
|
99
|
-
_transferFrom(IERC20(token), owner, address(box), amount);
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
|
|
103
69
|
function _payTreasury(IPDepositBox box, address token, uint256 amount) internal {
|
|
104
70
|
box.withdrawTo(TREASURY, token, amount);
|
|
105
71
|
}
|
|
106
72
|
|
|
107
73
|
function _withdrawToken(WithdrawTokenMessage memory ms, IPDepositBox box) internal {
|
|
108
|
-
box.withdrawTo(ms.owner, ms.token, ms.amountWithdraw);
|
|
74
|
+
box.withdrawTo(ms.permit.owner, ms.token, ms.amountWithdraw);
|
|
109
75
|
}
|
|
110
76
|
|
|
111
77
|
function _bridgeToken(BridgeTokenMessage memory ms, IPDepositBox box, uint256 nativeFee) internal {
|
|
@@ -120,59 +86,16 @@ contract PendleCrossChainSwapHub is SwapHubBase {
|
|
|
120
86
|
}
|
|
121
87
|
|
|
122
88
|
function _swapToken(SwapTokenMessage memory ms, IPDepositBox box) internal returns (uint256 rawTokenReceived) {
|
|
123
|
-
rawTokenReceived = _swapFromBox({
|
|
124
|
-
box: box,
|
|
125
|
-
tokenSpent: ms.tokenSpent,
|
|
126
|
-
amountSpent: ms.amountSpent,
|
|
127
|
-
tokenReceived: ms.tokenReceived,
|
|
128
|
-
swapExtRouter: ms.swapExtRouter,
|
|
129
|
-
swapApprove: ms.swapApprove,
|
|
130
|
-
swapCalldata: ms.swapCalldata,
|
|
131
|
-
receiver: ms.sendToOwner ? ms.owner : address(box)
|
|
132
|
-
});
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
function _buyPtAndBridge(
|
|
136
|
-
BuyCrossChainPtMessage memory ms,
|
|
137
|
-
IPDepositBox box,
|
|
138
|
-
address pt,
|
|
139
|
-
uint256 nativeFee,
|
|
140
|
-
address nativeRefund
|
|
141
|
-
) internal returns (uint256 netPtReceived) {
|
|
142
|
-
require(ms.receiver == _addressToBytes32(ms.owner), InvalidReceiver());
|
|
143
|
-
|
|
144
|
-
uint256 rawPtReceived = _swapFromBox({
|
|
145
|
-
box: box,
|
|
146
|
-
tokenSpent: ms.tokenSpent,
|
|
147
|
-
amountSpent: ms.amountSpent,
|
|
148
|
-
tokenReceived: pt,
|
|
149
|
-
swapExtRouter: ms.swapExtRouter,
|
|
150
|
-
swapApprove: ms.swapApprove,
|
|
151
|
-
swapCalldata: ms.swapCalldata,
|
|
152
|
-
receiver: address(box)
|
|
153
|
-
});
|
|
154
|
-
|
|
155
|
-
SendParam memory sendParam = SendParam({
|
|
156
|
-
dstEid: ms.dstEid,
|
|
157
|
-
to: ms.receiver,
|
|
158
|
-
amountLD: rawPtReceived,
|
|
159
|
-
minAmountLD: 0,
|
|
160
|
-
extraOptions: "",
|
|
161
|
-
composeMsg: "",
|
|
162
|
-
oftCmd: ""
|
|
163
|
-
});
|
|
164
|
-
MessagingFee memory sendFee = MessagingFee({nativeFee: nativeFee, lzTokenFee: 0});
|
|
165
89
|
ApprovedCall memory call = ApprovedCall({
|
|
166
|
-
token:
|
|
167
|
-
amount:
|
|
168
|
-
approveTo: ms.
|
|
169
|
-
callTo: ms.
|
|
170
|
-
data:
|
|
90
|
+
token: ms.tokenSpent,
|
|
91
|
+
amount: ms.amountSpent,
|
|
92
|
+
approveTo: ms.swapApprove,
|
|
93
|
+
callTo: ms.swapExtRouter,
|
|
94
|
+
data: ms.swapCalldata
|
|
171
95
|
});
|
|
172
|
-
(, OFTReceipt memory oftReceipt) =
|
|
173
|
-
abi.decode(box.approveAndCall{value: nativeFee}(call, nativeRefund), (MessagingReceipt, OFTReceipt));
|
|
174
|
-
netPtReceived = oftReceipt.amountReceivedLD;
|
|
175
|
-
}
|
|
176
96
|
|
|
177
|
-
|
|
97
|
+
uint256 preBalance = _balanceOf(address(box), ms.tokenReceived);
|
|
98
|
+
box.approveAndCall(call, address(box));
|
|
99
|
+
rawTokenReceived = _balanceOf(address(box), ms.tokenReceived) - preBalance;
|
|
100
|
+
}
|
|
178
101
|
}
|