@pendle/core-v2 6.4.1-unichain → 6.4.2-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/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/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/PendleGaugeControllerBaseUpg.sol/PendleGaugeControllerBaseUpg.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/GaugeController/PendleGaugeControllerMainchainUpg.sol/PendleGaugeControllerMainchainUpg.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/GaugeController/PendleGaugeControllerSidechainUpg.sol/PendleGaugeControllerSidechainUpg.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/PendleMerkleDistributor.sol/PendleMerkleDistributor.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/PendleMultiTokenMerkleDistributor.sol/PendleMultiTokenMerkleDistributor.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/VotingController/PendleVotingControllerUpg.sol/PendleVotingControllerUpg.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/VotingController/VotingControllerStorageUpg.sol/VotingControllerStorageUpg.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/VotingEscrow/VotingEscrowPendleMainchain.sol/VotingEscrowPendleMainchain.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/VotingEscrow/VotingEscrowPendleSidechain.sol/VotingEscrowPendleSidechain.dbg.json +1 -1
- 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/VeHistoryLib.sol/CheckpointHelper.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/libraries/VeHistoryLib.sol/Checkpoints.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/libraries/WeekMath.sol/WeekMath.dbg.json +1 -1
- package/build/artifacts/contracts/core/Market/MarketMathCore.sol/MarketMathCore.dbg.json +1 -1
- package/build/artifacts/contracts/core/Market/OracleLib.sol/OracleLib.dbg.json +1 -1
- package/build/artifacts/contracts/core/Market/PendleGauge.sol/PendleGauge.dbg.json +1 -1
- package/build/artifacts/contracts/core/Market/PendleMarketFactoryV6Upg.sol/PendleMarketFactoryV6Upg.dbg.json +1 -1
- package/build/artifacts/contracts/core/Market/PendleMarketV6.sol/PendleMarketV6.dbg.json +1 -1
- 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/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/PendleYieldContractFactoryUpg.sol/PendleYieldContractFactoryUpg.dbg.json +1 -1
- package/build/artifacts/contracts/core/YieldContracts/PendleYieldToken.sol/PendleYieldToken.dbg.json +1 -1
- 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/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/cross-chain/FixedPricePTAMM.sol/FixedPricePTAMM.dbg.json +1 -1
- 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/DepositBox.sol/DepositBox.dbg.json +4 -0
- package/build/artifacts/contracts/cross-chain/swap-hub/DepositBox.sol/DepositBox.json +170 -0
- 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 +1214 -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 +1176 -0
- package/build/artifacts/contracts/deprecated/VeDistributor/PendleFeeDistributor.sol/PendleFeeDistributor.dbg.json +1 -1
- package/build/artifacts/contracts/deprecated/VeDistributor/PendleFeeDistributorV2.sol/PendleFeeDistributorV2.dbg.json +1 -1
- 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 +4 -0
- package/build/artifacts/contracts/interfaces/IPActionCrossChain.sol/IPActionCrossChain.json +99 -0
- 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/IPAllActionV3.sol/IPAllActionV3.json +88 -0
- 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 +1026 -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/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/IPGaugeController.sol/IPGaugeController.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPGaugeControllerMainchain.sol/IPGaugeControllerMainchain.dbg.json +1 -1
- 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/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/IPTokenWithSupplyCap.sol/IPTokenWithSupplyCap.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPVeToken.sol/IPVeToken.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPVotingController.sol/IPVotingController.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPVotingEscrowMainchain.sol/IPVotingEscrowMainchain.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPYieldContractFactory.sol/IPYieldContractFactory.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/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/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/BaseSplitCodeFactoryContract.sol/BaseSplitCodeFactoryContract.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/Broadcaster.sol/Broadcaster.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/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/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/PendleExchangeRateOracle.sol/PendleExchangeRateOracle.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/PendleFeeSetter.sol/PendleFeeSetter.dbg.json +1 -1
- 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/PendleLPWrapperFactory.sol/PendleLPWrapperFactory.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/PendleMerkleDepositor.sol/PendleMerkleDepositor.dbg.json +1 -1
- 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/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/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/base/ActionInfoStatic.sol/ActionInfoStatic.dbg.json +1 -1
- 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/ActionMarketCoreStatic.sol/ActionMarketCoreStatic.dbg.json +1 -1
- 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/ActionStorageStatic.sol/ActionStorageStatic.dbg.json +1 -1
- 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/MarketApproxLibV1.sol/MarketApproxPtInLibV1.dbg.json +1 -1
- 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/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/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/PtYtLpOracle/PendleLpOracleLib.sol/PendleLpOracleLib.dbg.json +1 -1
- package/build/artifacts/contracts/oracles/PtYtLpOracle/PendlePYLpOracle.sol/PendlePYLpOracle.dbg.json +1 -1
- package/build/artifacts/contracts/oracles/PtYtLpOracle/PendlePYOracleLib.sol/PendlePYOracleLib.dbg.json +1 -1
- package/build/artifacts/contracts/oracles/PtYtLpOracle/chainlink/PendleChainlinkOracle.sol/PendleChainlinkOracle.dbg.json +1 -1
- package/build/artifacts/contracts/oracles/PtYtLpOracle/chainlink/PendleChainlinkOracleFactory.sol/PendleChainlinkOracleFactory.dbg.json +1 -1
- package/build/artifacts/contracts/oracles/PtYtLpOracle/chainlink/PendleChainlinkOracleWithQuote.sol/PendleChainlinkOracleWithQuote.dbg.json +1 -1
- 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/BoringPYUsdChainlinkSYOracle.sol/BoringPYUsdChainlinkSYOracle.dbg.json +1 -1
- 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/internal/PendleBoringOneracle.sol/PendleBoringOneracle.dbg.json +1 -1
- package/build/artifacts/contracts/oracles/internal/PendleBoringSolvBTCOneracle.sol/PendleBoringSolvBTCOneracle.dbg.json +1 -1
- 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/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/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 +4 -0
- package/build/artifacts/contracts/router/ActionCrossChain.sol/ActionCrossChain.json +99 -0
- 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/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/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/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/MarketApproxEstimateLib.sol/MarketApproxEstimateLib.dbg.json +1 -1
- package/build/artifacts/contracts/router/math/MarketApproxLibOnchain.sol/MarketApproxPtInLibOnchain.dbg.json +1 -1
- package/build/artifacts/contracts/router/math/MarketApproxLibOnchain.sol/MarketApproxPtOutLibOnchain.dbg.json +1 -1
- package/build/artifacts/contracts/router/math/MarketApproxLibV2.sol/MarketApproxPtInLibV2.dbg.json +1 -1
- package/build/artifacts/contracts/router/math/MarketApproxLibV2.sol/MarketApproxPtOutLibV2.dbg.json +1 -1
- 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/cross-chain/swap-hub/DepositBox.sol +66 -0
- package/contracts/cross-chain/swap-hub/PendleCrossChainSwapHub.sol +178 -0
- package/contracts/cross-chain/swap-hub/SwapHubBase.sol +274 -0
- package/contracts/interfaces/IPActionCrossChain.sol +14 -0
- package/contracts/interfaces/IPAllActionV3.sol +3 -1
- package/contracts/interfaces/IPCrossChainSwapHub.sol +147 -0
- package/contracts/interfaces/IPDepositBox.sol +22 -0
- package/contracts/router/ActionCrossChain.sol +63 -0
- package/contracts/router/Reflector.sol +19 -2
- package/contracts/router/swap-aggregator/OKXScaleHelper.sol +7 -1
- package/deployments/1-core.json +1 -1
- package/deployments/10-core.json +1 -1
- package/deployments/130-core.json +12 -1
- package/deployments/130-offchain-helper.json +9 -0
- 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 +1 -1
- package/deployments/999-core.json +6 -6
- package/package.json +2 -2
- package/typechain-types/DepositBox.ts +260 -0
- package/typechain-types/IPAllActionV3.ts +54 -0
- package/typechain-types/IPCrossChainSwapHub.ts +882 -0
- package/typechain-types/IPDepositBox.ts +213 -0
- package/typechain-types/PendleCrossChainSwapHub.ts +1119 -0
- package/typechain-types/SwapHubBase.ts +1094 -0
- package/typechain-types/factories/ActionCallbackV3__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/ActionSwapPTV3__factory.ts +1 -1
- package/typechain-types/factories/ActionSwapYTV3__factory.ts +1 -1
- package/typechain-types/factories/DepositBox__factory.ts +222 -0
- package/typechain-types/factories/IPAllActionV3__factory.ts +88 -0
- package/typechain-types/factories/IPCrossChainSwapHub__factory.ts +1041 -0
- package/typechain-types/factories/IPDepositBox__factory.ts +136 -0
- package/typechain-types/factories/MarketSweed__factory.ts +1 -1
- package/typechain-types/factories/PendleCommonPoolDeployHelperV2__factory.ts +1 -1
- package/typechain-types/factories/PendleCrossChainSwapHub__factory.ts +1287 -0
- package/typechain-types/factories/PendleLimitRouter__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/PendleSwap__factory.ts +1 -1
- package/typechain-types/factories/Reflector__factory.ts +1 -1
- package/typechain-types/factories/SwapHubBase__factory.ts +1188 -0
- package/typechain-types/hardhat.d.ts +54 -36
- package/typechain-types/index.ts +10 -8
- 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/OverfillMathLib.ts +0 -81
- 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/PendleERC20Permit.ts +0 -508
- package/typechain-types/PendleERC20PermitUpg.ts +0 -517
- package/typechain-types/PendleERC20Upg.ts +0 -348
- package/typechain-types/PendleMarketFactoryV3.ts +0 -719
- package/typechain-types/PendleMarketV3.ts +0 -1195
- 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/IPMarketFactoryV3__factory.ts +0 -217
- 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/PendleERC20PermitUpg__factory.ts +0 -389
- package/typechain-types/factories/PendleERC20Permit__factory.ts +0 -470
- package/typechain-types/factories/PendleERC20Upg__factory.ts +0 -261
- 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,274 @@
|
|
|
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
|
+
import {SignatureChecker} from "@openzeppelin/contracts/utils/cryptography/SignatureChecker.sol";
|
|
6
|
+
import {EIP712Upgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/EIP712Upgradeable.sol";
|
|
7
|
+
import {BoringOwnableUpgradeableV2} from "../../core/libraries/BoringOwnableUpgradeableV2.sol";
|
|
8
|
+
import {TokenHelper} from "../../core/libraries/TokenHelper.sol";
|
|
9
|
+
import {IPCrossChainSwapHub} from "../../interfaces/IPCrossChainSwapHub.sol";
|
|
10
|
+
import {ApprovedCall, IPDepositBox} from "../../interfaces/IPDepositBox.sol";
|
|
11
|
+
import {DepositBox} from "./DepositBox.sol";
|
|
12
|
+
|
|
13
|
+
abstract contract SwapHubBase is IPCrossChainSwapHub, EIP712Upgradeable, BoringOwnableUpgradeableV2, TokenHelper {
|
|
14
|
+
// forgefmt: disable-next-item
|
|
15
|
+
bytes32 internal constant WITHDRAW_TOKEN_MESSAGE_TYPEHASH = keccak256(
|
|
16
|
+
"WithdrawTokenMessage("
|
|
17
|
+
"address owner,"
|
|
18
|
+
"uint32 boxId,"
|
|
19
|
+
"uint256 expiry,"
|
|
20
|
+
"uint256 nonce,"
|
|
21
|
+
//
|
|
22
|
+
"address token,"
|
|
23
|
+
"uint256 amountWithdraw,"
|
|
24
|
+
"uint256 amountFee"
|
|
25
|
+
")"
|
|
26
|
+
);
|
|
27
|
+
|
|
28
|
+
// forgefmt: disable-next-item
|
|
29
|
+
bytes32 internal constant BRIDGE_TOKEN_MESSAGE_TYPEHASH = keccak256(
|
|
30
|
+
"BridgeTokenMessage("
|
|
31
|
+
"address owner,"
|
|
32
|
+
"uint32 boxId,"
|
|
33
|
+
"uint256 expiry,"
|
|
34
|
+
"uint256 nonce,"
|
|
35
|
+
//
|
|
36
|
+
"address token,"
|
|
37
|
+
"uint256 amountBridge,"
|
|
38
|
+
"uint256 amountFee,"
|
|
39
|
+
"bool pullFromOwner,"
|
|
40
|
+
//
|
|
41
|
+
"address bridgeExtRouter,"
|
|
42
|
+
"address bridgeApprove,"
|
|
43
|
+
"bytes bridgeCalldata"
|
|
44
|
+
")"
|
|
45
|
+
);
|
|
46
|
+
|
|
47
|
+
// forgefmt: disable-next-item
|
|
48
|
+
bytes32 internal constant SWAP_TOKEN_MESSAGE_TYPEHASH = keccak256(
|
|
49
|
+
"SwapTokenMessage("
|
|
50
|
+
"address owner,"
|
|
51
|
+
"uint32 boxId,"
|
|
52
|
+
"uint256 expiry,"
|
|
53
|
+
"uint256 nonce,"
|
|
54
|
+
//
|
|
55
|
+
"address tokenSpent,"
|
|
56
|
+
"uint256 amountSpent,"
|
|
57
|
+
"uint256 amountFee,"
|
|
58
|
+
"address tokenReceived,"
|
|
59
|
+
"uint256 minReceived,"
|
|
60
|
+
"bool pullFromOwner,"
|
|
61
|
+
"bool sendToOwner,"
|
|
62
|
+
//
|
|
63
|
+
"address swapExtRouter,"
|
|
64
|
+
"address swapApprove,"
|
|
65
|
+
"bytes swapCalldata"
|
|
66
|
+
")"
|
|
67
|
+
);
|
|
68
|
+
|
|
69
|
+
// forgefmt: disable-next-item
|
|
70
|
+
bytes32 internal constant BUY_CROSS_CHAIN_PT_MESSAGE_TYPEHASH = keccak256(
|
|
71
|
+
"BuyCrossChainPtMessage("
|
|
72
|
+
"address owner,"
|
|
73
|
+
"uint32 boxId,"
|
|
74
|
+
"uint256 expiry,"
|
|
75
|
+
"uint256 nonce,"
|
|
76
|
+
//
|
|
77
|
+
"address tokenSpent,"
|
|
78
|
+
"uint256 amountSpent,"
|
|
79
|
+
"uint256 amountFee,"
|
|
80
|
+
"address ptAdapter,"
|
|
81
|
+
"uint256 minPtReceived,"
|
|
82
|
+
"uint32 dstEid,"
|
|
83
|
+
"bytes32 receiver,"
|
|
84
|
+
"bool pullFromOwner,"
|
|
85
|
+
//
|
|
86
|
+
"address swapExtRouter,"
|
|
87
|
+
"address swapApprove,"
|
|
88
|
+
"bytes swapCalldata"
|
|
89
|
+
")"
|
|
90
|
+
);
|
|
91
|
+
|
|
92
|
+
address public immutable TREASURY;
|
|
93
|
+
|
|
94
|
+
/// @dev creation code of OpenZeppelin's BeaconProxy
|
|
95
|
+
address public immutable BEACON_PROXY_CODE_CONTRACT;
|
|
96
|
+
address public immutable DEPOSIT_BOX_BEACON;
|
|
97
|
+
bytes32 public immutable DEPOSIT_BOX_CODE_HASH;
|
|
98
|
+
|
|
99
|
+
mapping(address owner => uint256 nonce) public ownerNonce;
|
|
100
|
+
mapping(address executor => bool) public isExecutor;
|
|
101
|
+
|
|
102
|
+
constructor(address treasury_, address beaconProxyCodeContract_, address depositBoxBeacon_) {
|
|
103
|
+
TREASURY = treasury_;
|
|
104
|
+
BEACON_PROXY_CODE_CONTRACT = beaconProxyCodeContract_;
|
|
105
|
+
DEPOSIT_BOX_BEACON = depositBoxBeacon_;
|
|
106
|
+
DEPOSIT_BOX_CODE_HASH =
|
|
107
|
+
keccak256(abi.encodePacked(beaconProxyCodeContract_.code, abi.encode(depositBoxBeacon_, "")));
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
modifier onlyExecutor() {
|
|
111
|
+
require(isExecutor[msg.sender], "SwapHub: caller is not executor");
|
|
112
|
+
_;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
function setExecutor(address executor, bool isExecutor_) external onlyOwner {
|
|
116
|
+
isExecutor[executor] = isExecutor_;
|
|
117
|
+
emit SetExecutor(executor, isExecutor_);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
function computeDepositBox(address owner, uint32 boxId)
|
|
121
|
+
public
|
|
122
|
+
view
|
|
123
|
+
returns (address box, bytes32 salt, bool deployed)
|
|
124
|
+
{
|
|
125
|
+
salt = keccak256(abi.encode(owner, boxId));
|
|
126
|
+
box = Create2.computeAddress(salt, DEPOSIT_BOX_CODE_HASH);
|
|
127
|
+
deployed = box.code.length > 0;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
function _checkAndDeployBox(address owner, uint32 boxId) internal returns (IPDepositBox) {
|
|
131
|
+
(address box, bytes32 salt, bool deployed) = computeDepositBox(owner, boxId);
|
|
132
|
+
if (deployed) {
|
|
133
|
+
return IPDepositBox(box);
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
bytes memory bytecode = abi.encodePacked(BEACON_PROXY_CODE_CONTRACT.code, abi.encode(DEPOSIT_BOX_BEACON, ""));
|
|
137
|
+
assert(Create2.deploy(0, salt, bytecode) == box);
|
|
138
|
+
DepositBox(payable(box)).initialize(owner, boxId);
|
|
139
|
+
return IPDepositBox(box);
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
function hashTypedData(WithdrawTokenMessage memory message) public view returns (bytes32) {
|
|
143
|
+
return _hashTypedDataV4(
|
|
144
|
+
keccak256(
|
|
145
|
+
abi.encode(
|
|
146
|
+
WITHDRAW_TOKEN_MESSAGE_TYPEHASH,
|
|
147
|
+
message.owner,
|
|
148
|
+
message.boxId,
|
|
149
|
+
message.expiry,
|
|
150
|
+
message.nonce,
|
|
151
|
+
//
|
|
152
|
+
message.token,
|
|
153
|
+
message.amountWithdraw,
|
|
154
|
+
message.amountFee
|
|
155
|
+
)
|
|
156
|
+
)
|
|
157
|
+
);
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
function hashTypedData(BridgeTokenMessage memory message) public view returns (bytes32) {
|
|
161
|
+
return _hashTypedDataV4(
|
|
162
|
+
keccak256(
|
|
163
|
+
abi.encode(
|
|
164
|
+
BRIDGE_TOKEN_MESSAGE_TYPEHASH,
|
|
165
|
+
message.owner,
|
|
166
|
+
message.boxId,
|
|
167
|
+
message.expiry,
|
|
168
|
+
message.nonce,
|
|
169
|
+
//
|
|
170
|
+
message.token,
|
|
171
|
+
message.amountBridge,
|
|
172
|
+
message.amountFee,
|
|
173
|
+
message.pullFromOwner,
|
|
174
|
+
//
|
|
175
|
+
message.bridgeExtRouter,
|
|
176
|
+
message.bridgeApprove,
|
|
177
|
+
keccak256(message.bridgeCalldata)
|
|
178
|
+
)
|
|
179
|
+
)
|
|
180
|
+
);
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
function hashTypedData(SwapTokenMessage memory message) public view returns (bytes32) {
|
|
184
|
+
return _hashTypedDataV4(
|
|
185
|
+
keccak256(
|
|
186
|
+
abi.encode(
|
|
187
|
+
SWAP_TOKEN_MESSAGE_TYPEHASH,
|
|
188
|
+
message.owner,
|
|
189
|
+
message.boxId,
|
|
190
|
+
message.expiry,
|
|
191
|
+
message.nonce,
|
|
192
|
+
//
|
|
193
|
+
message.tokenSpent,
|
|
194
|
+
message.amountSpent,
|
|
195
|
+
message.amountFee,
|
|
196
|
+
message.tokenReceived,
|
|
197
|
+
message.minReceived,
|
|
198
|
+
message.pullFromOwner,
|
|
199
|
+
message.sendToOwner,
|
|
200
|
+
//
|
|
201
|
+
message.swapExtRouter,
|
|
202
|
+
message.swapApprove,
|
|
203
|
+
keccak256(message.swapCalldata)
|
|
204
|
+
)
|
|
205
|
+
)
|
|
206
|
+
);
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
function hashTypedData(BuyCrossChainPtMessage memory message) public view returns (bytes32) {
|
|
210
|
+
return _hashTypedDataV4(
|
|
211
|
+
keccak256(
|
|
212
|
+
abi.encode(
|
|
213
|
+
BUY_CROSS_CHAIN_PT_MESSAGE_TYPEHASH,
|
|
214
|
+
message.owner,
|
|
215
|
+
message.boxId,
|
|
216
|
+
message.expiry,
|
|
217
|
+
message.nonce,
|
|
218
|
+
//
|
|
219
|
+
message.tokenSpent,
|
|
220
|
+
message.amountSpent,
|
|
221
|
+
message.amountFee,
|
|
222
|
+
message.ptAdapter,
|
|
223
|
+
message.minPtReceived,
|
|
224
|
+
message.dstEid,
|
|
225
|
+
message.receiver,
|
|
226
|
+
message.pullFromOwner,
|
|
227
|
+
//
|
|
228
|
+
message.swapExtRouter,
|
|
229
|
+
message.swapApprove,
|
|
230
|
+
keccak256(message.swapCalldata)
|
|
231
|
+
)
|
|
232
|
+
)
|
|
233
|
+
);
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
function _verifyOwnerSig(address owner, uint256 expiry, uint256 nonce, bytes32 messageHash, bytes memory signature)
|
|
237
|
+
internal
|
|
238
|
+
{
|
|
239
|
+
require(SignatureChecker.isValidSignatureNow(owner, messageHash, signature), InvalidSignature());
|
|
240
|
+
require(expiry > block.timestamp, MessageExpired());
|
|
241
|
+
require(ownerNonce[owner] < nonce, InvalidNonce());
|
|
242
|
+
ownerNonce[owner] = nonce;
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
function _swapFromBox(
|
|
246
|
+
IPDepositBox box,
|
|
247
|
+
address tokenSpent,
|
|
248
|
+
uint256 amountSpent,
|
|
249
|
+
address tokenReceived,
|
|
250
|
+
address swapExtRouter,
|
|
251
|
+
address swapApprove,
|
|
252
|
+
bytes memory swapCalldata,
|
|
253
|
+
address receiver
|
|
254
|
+
) internal returns (uint256 rawTokenReceived) {
|
|
255
|
+
// forgefmt: disable-next-item
|
|
256
|
+
ApprovedCall memory call = ApprovedCall({
|
|
257
|
+
token: tokenSpent,
|
|
258
|
+
amount: amountSpent,
|
|
259
|
+
approveTo: swapApprove,
|
|
260
|
+
callTo: swapExtRouter,
|
|
261
|
+
data: swapCalldata
|
|
262
|
+
});
|
|
263
|
+
|
|
264
|
+
uint256 preBalance = _selfBalance(tokenReceived);
|
|
265
|
+
box.approveAndCall(call, address(box));
|
|
266
|
+
rawTokenReceived = _selfBalance(tokenReceived) - preBalance;
|
|
267
|
+
|
|
268
|
+
_transferOut(tokenReceived, receiver, rawTokenReceived);
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
function _addressToBytes32(address addr) internal pure returns (bytes32) {
|
|
272
|
+
return bytes32(uint256(uint160(addr)));
|
|
273
|
+
}
|
|
274
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
2
|
+
pragma solidity ^0.8.0;
|
|
3
|
+
|
|
4
|
+
import {TokenOutput} from "./IPAllActionTypeV3.sol";
|
|
5
|
+
|
|
6
|
+
interface IPActionCrossChain {
|
|
7
|
+
function swapWithFixedPricePTAMM(
|
|
8
|
+
address receiver,
|
|
9
|
+
address fixedPricePTAMM,
|
|
10
|
+
address PT,
|
|
11
|
+
uint256 exactPtIn,
|
|
12
|
+
TokenOutput calldata out
|
|
13
|
+
) external returns (uint256 netTokenOut);
|
|
14
|
+
}
|
|
@@ -4,6 +4,7 @@ pragma solidity ^0.8.0;
|
|
|
4
4
|
|
|
5
5
|
import "./IPActionAddRemoveLiqV3.sol";
|
|
6
6
|
import "./IPActionCallbackV3.sol";
|
|
7
|
+
import "./IPActionCrossChain.sol";
|
|
7
8
|
import "./IPActionMiscV3.sol";
|
|
8
9
|
import "./IPActionSimple.sol";
|
|
9
10
|
import "./IPActionStorageV4.sol";
|
|
@@ -17,5 +18,6 @@ interface IPAllActionV3 is
|
|
|
17
18
|
IPActionMiscV3,
|
|
18
19
|
IPActionCallbackV3,
|
|
19
20
|
IPActionStorageV4,
|
|
20
|
-
IPActionSimple
|
|
21
|
+
IPActionSimple,
|
|
22
|
+
IPActionCrossChain
|
|
21
23
|
{}
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
// SPDX-License-Identifier: MIT
|
|
2
|
+
pragma solidity ^0.8.0;
|
|
3
|
+
|
|
4
|
+
interface IPCrossChainSwapHub {
|
|
5
|
+
error InsufficientTokenReceived();
|
|
6
|
+
error InvalidNonce();
|
|
7
|
+
error InvalidSignature();
|
|
8
|
+
error InvalidReceiver();
|
|
9
|
+
error MessageExpired();
|
|
10
|
+
|
|
11
|
+
struct WithdrawTokenMessage {
|
|
12
|
+
address owner;
|
|
13
|
+
uint32 boxId;
|
|
14
|
+
uint256 expiry;
|
|
15
|
+
uint256 nonce;
|
|
16
|
+
//
|
|
17
|
+
address token;
|
|
18
|
+
uint256 amountWithdraw;
|
|
19
|
+
uint256 amountFee;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
struct BridgeTokenMessage {
|
|
23
|
+
address owner;
|
|
24
|
+
uint32 boxId;
|
|
25
|
+
uint256 expiry;
|
|
26
|
+
uint256 nonce;
|
|
27
|
+
//
|
|
28
|
+
address token;
|
|
29
|
+
uint256 amountBridge;
|
|
30
|
+
uint256 amountFee;
|
|
31
|
+
bool pullFromOwner;
|
|
32
|
+
//
|
|
33
|
+
address bridgeExtRouter;
|
|
34
|
+
address bridgeApprove;
|
|
35
|
+
bytes bridgeCalldata;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
struct SwapTokenMessage {
|
|
39
|
+
address owner;
|
|
40
|
+
uint32 boxId;
|
|
41
|
+
uint256 expiry;
|
|
42
|
+
uint256 nonce;
|
|
43
|
+
//
|
|
44
|
+
address tokenSpent;
|
|
45
|
+
uint256 amountSpent;
|
|
46
|
+
uint256 amountFee;
|
|
47
|
+
address tokenReceived;
|
|
48
|
+
uint256 minReceived;
|
|
49
|
+
bool pullFromOwner;
|
|
50
|
+
bool sendToOwner;
|
|
51
|
+
//
|
|
52
|
+
address swapExtRouter;
|
|
53
|
+
address swapApprove;
|
|
54
|
+
bytes swapCalldata;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
struct BuyCrossChainPtMessage {
|
|
58
|
+
address owner;
|
|
59
|
+
uint32 boxId;
|
|
60
|
+
uint256 expiry;
|
|
61
|
+
uint256 nonce;
|
|
62
|
+
//
|
|
63
|
+
address tokenSpent;
|
|
64
|
+
uint256 amountSpent;
|
|
65
|
+
uint256 amountFee;
|
|
66
|
+
address ptAdapter;
|
|
67
|
+
uint256 minPtReceived;
|
|
68
|
+
uint32 dstEid;
|
|
69
|
+
bytes32 receiver;
|
|
70
|
+
bool pullFromOwner;
|
|
71
|
+
//
|
|
72
|
+
address swapExtRouter;
|
|
73
|
+
address swapApprove;
|
|
74
|
+
bytes swapCalldata;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
event WithdrawToken(address indexed owner, uint32 boxId, address token, uint256 amountWithdraw, uint256 amountFee);
|
|
78
|
+
|
|
79
|
+
event BridgeToken(
|
|
80
|
+
address indexed owner,
|
|
81
|
+
uint32 boxId,
|
|
82
|
+
address bridgeExtRouter,
|
|
83
|
+
address token,
|
|
84
|
+
uint256 amountBridge,
|
|
85
|
+
uint256 amountFee,
|
|
86
|
+
bool pullFromOwner
|
|
87
|
+
);
|
|
88
|
+
|
|
89
|
+
event SwapToken(
|
|
90
|
+
address indexed owner,
|
|
91
|
+
uint32 boxId,
|
|
92
|
+
address tokenSpent,
|
|
93
|
+
uint256 amountSpent,
|
|
94
|
+
uint256 amountFee,
|
|
95
|
+
address tokenReceived,
|
|
96
|
+
uint256 netTokenReceived,
|
|
97
|
+
bool pullFromOwner,
|
|
98
|
+
bool sendToOwner
|
|
99
|
+
);
|
|
100
|
+
|
|
101
|
+
event BuyCrossChainPt(
|
|
102
|
+
address indexed owner,
|
|
103
|
+
uint32 boxId,
|
|
104
|
+
address tokenSpent,
|
|
105
|
+
uint256 amountSpent,
|
|
106
|
+
uint256 amountFee,
|
|
107
|
+
address ptAdapter,
|
|
108
|
+
address pt,
|
|
109
|
+
uint256 netPtReceived,
|
|
110
|
+
bool pullFromOwner
|
|
111
|
+
);
|
|
112
|
+
|
|
113
|
+
event SetExecutor(address indexed executor, bool isExecutor);
|
|
114
|
+
|
|
115
|
+
function BEACON_PROXY_CODE_CONTRACT() external view returns (address);
|
|
116
|
+
|
|
117
|
+
function DEPOSIT_BOX_BEACON() external view returns (address);
|
|
118
|
+
|
|
119
|
+
function DEPOSIT_BOX_CODE_HASH() external view returns (bytes32);
|
|
120
|
+
|
|
121
|
+
function ownerNonce(address owner) external view returns (uint256);
|
|
122
|
+
|
|
123
|
+
function isExecutor(address executor) external view returns (bool);
|
|
124
|
+
|
|
125
|
+
function computeDepositBox(address owner, uint32 boxId)
|
|
126
|
+
external
|
|
127
|
+
view
|
|
128
|
+
returns (address box, bytes32 salt, bool deployed);
|
|
129
|
+
|
|
130
|
+
function hashTypedData(WithdrawTokenMessage memory message) external view returns (bytes32);
|
|
131
|
+
|
|
132
|
+
function hashTypedData(BridgeTokenMessage memory message) external view returns (bytes32);
|
|
133
|
+
|
|
134
|
+
function hashTypedData(SwapTokenMessage memory message) external view returns (bytes32);
|
|
135
|
+
|
|
136
|
+
function hashTypedData(BuyCrossChainPtMessage memory message) external view returns (bytes32);
|
|
137
|
+
|
|
138
|
+
function withdrawToken(WithdrawTokenMessage memory message, bytes memory signature) external;
|
|
139
|
+
|
|
140
|
+
function bridgeToken(BridgeTokenMessage memory message, bytes memory signature) external payable;
|
|
141
|
+
|
|
142
|
+
function swapToken(SwapTokenMessage memory message, bytes memory signature) external;
|
|
143
|
+
|
|
144
|
+
function buyCrossChainPt(BuyCrossChainPtMessage memory message, bytes memory signature) external payable;
|
|
145
|
+
|
|
146
|
+
function setExecutor(address executor, bool isExecutor) external;
|
|
147
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
// SPDX-License-Identifier: MIT
|
|
2
|
+
pragma solidity ^0.8.0;
|
|
3
|
+
|
|
4
|
+
struct ApprovedCall {
|
|
5
|
+
address token;
|
|
6
|
+
uint256 amount;
|
|
7
|
+
address approveTo;
|
|
8
|
+
address callTo;
|
|
9
|
+
bytes data;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
interface IPDepositBox {
|
|
13
|
+
function MANAGER() external view returns (address);
|
|
14
|
+
|
|
15
|
+
function OWNER() external view returns (address);
|
|
16
|
+
|
|
17
|
+
function BOX_ID() external view returns (uint32);
|
|
18
|
+
|
|
19
|
+
function withdrawTo(address to, address token, uint256 amount) external;
|
|
20
|
+
|
|
21
|
+
function approveAndCall(ApprovedCall memory call, address nativeRefund) external payable returns (bytes memory);
|
|
22
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
2
|
+
pragma solidity ^0.8.0;
|
|
3
|
+
|
|
4
|
+
import {ActionBase} from "./base/ActionBase.sol";
|
|
5
|
+
import {TokenOutput, IPActionCrossChain} from "../interfaces/IPActionCrossChain.sol";
|
|
6
|
+
import {IPFixedPricePTAMM} from "../interfaces/IPFixedPricePTAMM.sol";
|
|
7
|
+
import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
|
|
8
|
+
import {SwapType, IPSwapAggregator} from "./swap-aggregator/IPSwapAggregator.sol";
|
|
9
|
+
|
|
10
|
+
contract ActionCrossChain is ActionBase, IPActionCrossChain {
|
|
11
|
+
function swapWithFixedPricePTAMM(
|
|
12
|
+
address receiver,
|
|
13
|
+
address fixedPricePTAMM,
|
|
14
|
+
address PT,
|
|
15
|
+
uint256 exactPtIn,
|
|
16
|
+
TokenOutput calldata out
|
|
17
|
+
) external returns (uint256 netTokenOut) {
|
|
18
|
+
_transferFrom(IERC20(PT), msg.sender, fixedPricePTAMM, exactPtIn);
|
|
19
|
+
uint256 tokenOut = IPFixedPricePTAMM(fixedPricePTAMM).swapExactPtForToken(
|
|
20
|
+
__swapDestination(receiver, out),
|
|
21
|
+
PT,
|
|
22
|
+
exactPtIn,
|
|
23
|
+
out.tokenRedeemSy,
|
|
24
|
+
EMPTY_BYTES
|
|
25
|
+
);
|
|
26
|
+
return __handleTokenOutput(receiver, tokenOut, out);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/// @notice __swapDestination and __handleTokenOutput provide an alternative way to implement __redeemSyToToken
|
|
30
|
+
/// ```solidity
|
|
31
|
+
/// SwapType swapType = out.swapData.swapType;
|
|
32
|
+
/// address redeemSyReceiver = __swapDestination(receiver, out);
|
|
33
|
+
/// uint256 netTokenRedeemed = __redeemSy(redeemSyReceiver, SY, netSyIn, out, doPull);
|
|
34
|
+
/// return __handleTokenOutput(receiver, netTokenRedeemed, out);
|
|
35
|
+
/// ```
|
|
36
|
+
/// We keep the old implementation of __redeemSyToToken as a stable implementation
|
|
37
|
+
function __swapDestination(address receiver, TokenOutput calldata out) internal view returns (address) {
|
|
38
|
+
SwapType swapType = out.swapData.swapType;
|
|
39
|
+
if (swapType == SwapType.NONE) return receiver;
|
|
40
|
+
else if (swapType == SwapType.ETH_WETH) return address(this);
|
|
41
|
+
else return out.pendleSwap;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/// @dev The caller must ensure that the address returned by `__swapDestination(...)` has `netTokenRedeemSy` amount of `out.tokenRedeemSy` tokens before calling this function.
|
|
45
|
+
function __handleTokenOutput(
|
|
46
|
+
address receiver,
|
|
47
|
+
uint256 netTokenRedeemSy,
|
|
48
|
+
TokenOutput calldata out
|
|
49
|
+
) internal returns (uint256 netTokenOut) {
|
|
50
|
+
SwapType swapType = out.swapData.swapType;
|
|
51
|
+
if (swapType == SwapType.NONE) netTokenOut = netTokenRedeemSy;
|
|
52
|
+
else if (swapType == SwapType.ETH_WETH) {
|
|
53
|
+
netTokenOut = netTokenRedeemSy; // ETH:WETH is 1:1
|
|
54
|
+
_wrap_unwrap_ETH(out.tokenRedeemSy, out.tokenOut, netTokenOut);
|
|
55
|
+
_transferOut(out.tokenOut, receiver, netTokenOut);
|
|
56
|
+
} else {
|
|
57
|
+
IPSwapAggregator(out.pendleSwap).swap(out.tokenRedeemSy, netTokenRedeemSy, out.swapData);
|
|
58
|
+
netTokenOut = _selfBalance(out.tokenOut);
|
|
59
|
+
_transferOut(out.tokenOut, receiver, netTokenOut);
|
|
60
|
+
}
|
|
61
|
+
if (netTokenOut < out.minTokenOut) revert("Slippage: INSUFFICIENT_TOKEN_OUT");
|
|
62
|
+
}
|
|
63
|
+
}
|
|
@@ -16,7 +16,7 @@ contract Reflector is TokenHelper, IPReflector {
|
|
|
16
16
|
receive() external payable {}
|
|
17
17
|
|
|
18
18
|
function reflect(bytes calldata inputData) external returns (bytes memory result) {
|
|
19
|
-
(uint256 value, bytes memory newCalldata) = _getNewCalldata(inputData);
|
|
19
|
+
(uint256 value, bytes memory newCalldata, address receiver, address market) = _getNewCalldata(inputData);
|
|
20
20
|
bool success;
|
|
21
21
|
|
|
22
22
|
(success, result) = ROUTER.call{value: value}(newCalldata);
|
|
@@ -26,9 +26,14 @@ contract Reflector is TokenHelper, IPReflector {
|
|
|
26
26
|
revert(add(32, result), mload(result))
|
|
27
27
|
}
|
|
28
28
|
}
|
|
29
|
+
|
|
30
|
+
if (market != address(0)) _sweepMarketDustBalance(receiver, market);
|
|
29
31
|
}
|
|
30
32
|
|
|
31
|
-
function _getNewCalldata(bytes calldata inputData)
|
|
33
|
+
function _getNewCalldata(bytes calldata inputData)
|
|
34
|
+
internal
|
|
35
|
+
returns (uint256 value, bytes memory newCalldata, address receiver, address market)
|
|
36
|
+
{
|
|
32
37
|
bytes4 selector = bytes4(inputData[:4]);
|
|
33
38
|
bytes calldata data = inputData[4:];
|
|
34
39
|
|
|
@@ -48,12 +53,14 @@ contract Reflector is TokenHelper, IPReflector {
|
|
|
48
53
|
|
|
49
54
|
value = _scaleTokenInputAndGetValue(v5);
|
|
50
55
|
newCalldata = abi.encodeWithSelector(selector, v1, v2, v3, v4, v5, v6);
|
|
56
|
+
(receiver, market) = (v1, v2);
|
|
51
57
|
} else if (selector == IPActionAddRemoveLiqV3.addLiquiditySingleTokenKeepYt.selector) {
|
|
52
58
|
(address v1, address v2, uint256 v3, uint256 v4, TokenInput memory v5) =
|
|
53
59
|
abi.decode(data, (address, address, uint256, uint256, TokenInput));
|
|
54
60
|
|
|
55
61
|
value = _scaleTokenInputAndGetValue(v5);
|
|
56
62
|
newCalldata = abi.encodeWithSelector(selector, v1, v2, v3, v4, v5);
|
|
63
|
+
(receiver, market) = (v1, v2);
|
|
57
64
|
} else if (
|
|
58
65
|
selector == IPActionAddRemoveLiqV3.addLiquiditySingleSy.selector
|
|
59
66
|
|| selector == IPActionSwapPTV3.swapExactSyForPt.selector
|
|
@@ -63,11 +70,13 @@ contract Reflector is TokenHelper, IPReflector {
|
|
|
63
70
|
abi.decode(data, (address, address, uint256, uint256, ApproxParams, LimitOrderData));
|
|
64
71
|
|
|
65
72
|
newCalldata = abi.encodeWithSelector(selector, v1, v2, _scaleSyInput(v2), v4, v5, v6);
|
|
73
|
+
(receiver, market) = (v1, v2);
|
|
66
74
|
} else if (selector == IPActionAddRemoveLiqV3.addLiquiditySingleSyKeepYt.selector) {
|
|
67
75
|
(address v1, address v2,, uint256 v4, uint256 v5) =
|
|
68
76
|
abi.decode(data, (address, address, uint256, uint256, uint256));
|
|
69
77
|
|
|
70
78
|
newCalldata = abi.encodeWithSelector(selector, v1, v2, _scaleSyInput(v2), v4, v5);
|
|
79
|
+
(receiver, market) = (v1, v2);
|
|
71
80
|
} else {
|
|
72
81
|
revert("UNSUPPORTED_SELECTOR");
|
|
73
82
|
}
|
|
@@ -97,4 +106,12 @@ contract Reflector is TokenHelper, IPReflector {
|
|
|
97
106
|
approved[address(SY)] = true;
|
|
98
107
|
}
|
|
99
108
|
}
|
|
109
|
+
|
|
110
|
+
function _sweepMarketDustBalance(address receiver, address market) internal {
|
|
111
|
+
(IStandardizedYield SY, IPPrincipalToken PT, IPYieldToken YT) = IPMarket(market).readTokens();
|
|
112
|
+
|
|
113
|
+
_transferOut(address(SY), receiver, _selfBalance(SY));
|
|
114
|
+
_transferOut(address(PT), receiver, _selfBalance(PT));
|
|
115
|
+
_transferOut(address(YT), receiver, _selfBalance(YT));
|
|
116
|
+
}
|
|
100
117
|
}
|
|
@@ -45,6 +45,9 @@ abstract contract OKXScaleHelper {
|
|
|
45
45
|
if (chainid == 9745) {
|
|
46
46
|
return 0x9FD43F5E4c24543b2eBC807321E58e6D350d6a5A;
|
|
47
47
|
}
|
|
48
|
+
if (chainid == 130) {
|
|
49
|
+
return 0x2e28281Cf3D58f475cebE27bec4B8a23dFC7782c;
|
|
50
|
+
}
|
|
48
51
|
return address(0);
|
|
49
52
|
}
|
|
50
53
|
|
|
@@ -283,7 +286,10 @@ interface IOKXDexRouter {
|
|
|
283
286
|
uint256 minReturn,
|
|
284
287
|
// solhint-disable-next-line no-unused-vars
|
|
285
288
|
bytes32[] calldata pools
|
|
286
|
-
)
|
|
289
|
+
)
|
|
290
|
+
external
|
|
291
|
+
payable
|
|
292
|
+
returns (uint256 returnAmount);
|
|
287
293
|
|
|
288
294
|
function smartSwapByOrderId(
|
|
289
295
|
uint256 orderId,
|
package/deployments/1-core.json
CHANGED
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"poolDeployHelperV2": "0xF642d8Daa026B8aEd6dFE82FACbA2E077AF199E2",
|
|
47
47
|
"limitRouter": "0x000000000000c9B3E2C3Ec88B1B4c0cD853f4321",
|
|
48
48
|
"proxyAdmin": "0xA28c08f165116587D4F3E708743B4dEe155c5E64",
|
|
49
|
-
"reflector": "
|
|
49
|
+
"reflector": "0x30544e00Cf296B34A9eE59E5540Ae2f9CCCD55DD",
|
|
50
50
|
"commonDeploy": "0x2Ed473F528E5B320f850d17ADfe0e558f0298aA9",
|
|
51
51
|
"syFactory": "0x466CeD3b33045Ea986B2f306C8D0aA8067961CF8",
|
|
52
52
|
"sparkLinearDiscountOracleFactory": "0x34C91651A070664279866E5f3d6B4d5F65cbbFFb",
|
package/deployments/10-core.json
CHANGED
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"poolDeployHelper": "0x439B4d66255eFf74e621FBacb00D7162b588Ff4b",
|
|
45
45
|
"limitRouter": "0x000000000000c9B3E2C3Ec88B1B4c0cD853f4321",
|
|
46
46
|
"proxyAdmin": "0xA28c08f165116587D4F3E708743B4dEe155c5E64",
|
|
47
|
-
"reflector": "
|
|
47
|
+
"reflector": "0x30544e00Cf296B34A9eE59E5540Ae2f9CCCD55DD",
|
|
48
48
|
"vePendleAirdropDistributor": "0x3942F7B55094250644cFfDa7160226Caa349A38E",
|
|
49
49
|
"externalRewardsDistributor": "0x33305665f69B4642D1275f4Ce81c23651674D21C",
|
|
50
50
|
"commonDeploy": "0x2Ed473F528E5B320f850d17ADfe0e558f0298aA9",
|
|
@@ -1,9 +1,20 @@
|
|
|
1
1
|
{
|
|
2
2
|
"deployer": "0x1FcCC097db89A86Bfc474A1028F93958295b1Fb7",
|
|
3
3
|
"network": {
|
|
4
|
-
"chainId": 130
|
|
4
|
+
"chainId": 130,
|
|
5
|
+
"wrappedNative": "0x4200000000000000000000000000000000000006"
|
|
5
6
|
},
|
|
6
7
|
"router": "0x888888888889758F76e7103c6CbF23ABbF58F946",
|
|
8
|
+
"routerFacets": {
|
|
9
|
+
"ActionAddRemoveLiqV3": "0x663C21103915B68e9dA797CfdF3cAb01a037D5Ff",
|
|
10
|
+
"ActionSwapPTV3": "0xd8D200d9A713A1c71cF1e7F694B14E5F1D948b15",
|
|
11
|
+
"ActionSwapYTV3": "0x4a03Ce0a268951d04E187B1CF48075eE69266e27",
|
|
12
|
+
"ActionMiscV3": "0x373Dba2055Ad40cb4815148bC47cd1DC16e92E44",
|
|
13
|
+
"ActionSimple": "0x852e59252c94716F0df19B52b36512f6C9297a96",
|
|
14
|
+
"ActionCallbackV3": "0x7b78F36aBf6cF3C6C0dd54716dFeF0607ae17846",
|
|
15
|
+
"ActionStorageV4": "0xdED51dca2ECED7a0BAab3D9711A87f214769Da0f",
|
|
16
|
+
"ActionCrossChain": "0x7C082f4c2790F04F62923243Db85A1c60f768857"
|
|
17
|
+
},
|
|
7
18
|
"pendleSwap": "0xd4F480965D2347d421F1bEC7F545682E5Ec2151D",
|
|
8
19
|
"sparkLinearDiscountOracleFactory": "0x34C91651A070664279866E5f3d6B4d5F65cbbFFb"
|
|
9
20
|
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
{
|
|
2
|
+
"pendleMulticallV2": "0x1ca3352a55A3D69cA8e5aB06006e08aaF2bD09f1",
|
|
3
|
+
"implicitSwapfeeContract": "0x82Fae57b2A79D893D88488A7D8BdF2AC6bd2C463",
|
|
4
|
+
"simulateHelper": "0xc23Dd2807e51dd1D317e1321CBeEb9ace98531EE",
|
|
5
|
+
"supperCapReader": "0x251CfB4E84CefecA6c1e6a4D8a0cb9c524e7484f",
|
|
6
|
+
"limitBackendHelperV2": "0xE3667BF5a5d8076c7a6e8b57C525150E4aFAe578",
|
|
7
|
+
"balanceReader": "0x2085F50305f656f96b22ECBfe0A4f5e786Ff0438"
|
|
8
|
+
}
|
|
9
|
+
|