@pendle/core-v2 6.3.2-swaphubtest2 → 6.3.3
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/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/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/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/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/Multicall2.sol/Multicall2.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/PendleAPIFeeDepositor.sol/PendleAPIFeeDepositor.dbg.json +4 -0
- package/build/artifacts/contracts/offchain-helpers/PendleAPIFeeDepositor.sol/PendleAPIFeeDepositor.json +102 -0
- 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 +4 -0
- package/build/artifacts/contracts/offchain-helpers/PendleMerkleDepositor.sol/PendleMerkleDepositor.json +102 -0
- 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/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/PendlePoolDeployHelperV2.sol/PendlePoolDeployHelperV2.dbg.json +1 -1
- 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/ActionStorageV4.sol/ActionStorageV4.dbg.json +1 -1
- 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/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/contracts/offchain-helpers/PendleAPIFeeDepositor.sol +33 -0
- package/contracts/offchain-helpers/PendleMerkleDepositor.sol +64 -0
- package/deployments/1-core.json +2 -1
- package/deployments/10-core.json +2 -1
- package/deployments/146-core.json +2 -1
- package/deployments/42161-core.json +2 -1
- package/deployments/42161-offchain-helper.json +2 -1
- package/deployments/5000-core.json +2 -1
- package/deployments/56-core.json +2 -1
- package/deployments/80094-core.json +2 -1
- package/deployments/8453-core.json +2 -1
- package/deployments/9745-core.json +2 -1
- package/deployments/999-core.json +2 -1
- package/package.json +2 -2
- package/typechain-types/ActionCrossChain.ts +161 -0
- package/typechain-types/ActionDelegateBase.ts +57 -0
- package/typechain-types/BasePendleBridgedPrincipalToken.ts +1689 -0
- package/typechain-types/EIP712.ts +135 -0
- package/typechain-types/ERC20Permit.ts +586 -0
- package/typechain-types/IERC5267.ts +135 -0
- package/typechain-types/IPActionCrossChain.ts +161 -0
- package/typechain-types/IPMarketFactoryV3.ts +321 -0
- package/typechain-types/IPMarketV3.ts +1068 -0
- package/typechain-types/LimitBackendHelper.ts +287 -0
- package/typechain-types/OverfillMathLib.ts +81 -0
- package/typechain-types/PendleAPIFeeDepositor.ts +181 -0
- package/typechain-types/PendleBridgedPrincipalToken_18Decimals.ts +1689 -0
- package/typechain-types/PendleBridgedPrincipalToken_6Decimals.ts +1689 -0
- package/typechain-types/PendleBridgedPrincipalToken_8Decimals.ts +1689 -0
- package/typechain-types/PendleERC20Permit.ts +508 -0
- package/typechain-types/PendleERC20PermitUpg.ts +517 -0
- package/typechain-types/PendleERC20Upg.ts +348 -0
- package/typechain-types/PendleMarketFactoryV3.ts +719 -0
- package/typechain-types/PendleMarketV3.ts +1195 -0
- package/typechain-types/PendleMerkleDepositor.ts +171 -0
- package/typechain-types/PendleYieldContractFactory.ts +801 -0
- package/typechain-types/ShortStrings.ts +57 -0
- package/typechain-types/factories/ActionCrossChain__factory.ts +152 -0
- package/typechain-types/factories/ActionDelegateBase__factory.ts +80 -0
- package/typechain-types/factories/BasePendleBridgedPrincipalToken__factory.ts +1548 -0
- package/typechain-types/factories/EIP712__factory.ts +85 -0
- package/typechain-types/factories/ERC20Permit__factory.ts +433 -0
- package/typechain-types/factories/IERC5267__factory.ts +72 -0
- package/typechain-types/factories/IPActionCrossChain__factory.ts +114 -0
- package/typechain-types/factories/IPMarketFactoryV3__factory.ts +217 -0
- package/typechain-types/factories/IPMarketV3__factory.ts +845 -0
- package/typechain-types/factories/LimitBackendHelper__factory.ts +232 -0
- package/typechain-types/factories/OverfillMathLib__factory.ts +77 -0
- package/typechain-types/factories/PendleAPIFeeDepositor__factory.ts +164 -0
- package/typechain-types/factories/PendleBridgedPrincipalToken_18Decimals__factory.ts +1652 -0
- package/typechain-types/factories/PendleBridgedPrincipalToken_6Decimals__factory.ts +1650 -0
- package/typechain-types/factories/PendleBridgedPrincipalToken_8Decimals__factory.ts +1650 -0
- package/typechain-types/factories/PendleERC20PermitUpg__factory.ts +389 -0
- package/typechain-types/factories/PendleERC20Permit__factory.ts +470 -0
- package/typechain-types/factories/PendleERC20Upg__factory.ts +261 -0
- package/typechain-types/factories/PendleMarketFactoryV3__factory.ts +714 -0
- package/typechain-types/factories/PendleMarketV3__factory.ts +1211 -0
- package/typechain-types/factories/PendleMerkleDepositor__factory.ts +164 -0
- package/typechain-types/factories/PendleYieldContractFactory__factory.ts +674 -0
- package/typechain-types/factories/ShortStrings__factory.ts +77 -0
- package/typechain-types/hardhat.d.ts +54 -72
- package/typechain-types/index.ts +12 -14
- 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 -201
- package/build/artifacts/contracts/cross-chain/swap-hub/PendleCrossChainSwapHub.sol/PendleCrossChainSwapHub.dbg.json +0 -4
- package/build/artifacts/contracts/cross-chain/swap-hub/PendleCrossChainSwapHub.sol/PendleCrossChainSwapHub.json +0 -1519
- package/build/artifacts/contracts/cross-chain/swap-hub/SwapHubBase.sol/SwapHubBase.dbg.json +0 -4
- package/build/artifacts/contracts/cross-chain/swap-hub/SwapHubBase.sol/SwapHubBase.json +0 -1490
- package/build/artifacts/contracts/cross-chain/swap-hub/swap/IPSwapExecutor.sol/IPSwapExecutor.dbg.json +0 -4
- package/build/artifacts/contracts/cross-chain/swap-hub/swap/IPSwapExecutor.sol/IPSwapExecutor.json +0 -56
- package/build/artifacts/contracts/cross-chain/swap-hub/swap/SwapExecutor.sol/SwapExecutor.dbg.json +0 -4
- package/build/artifacts/contracts/cross-chain/swap-hub/swap/SwapExecutor.sol/SwapExecutor.json +0 -60
- package/build/artifacts/contracts/interfaces/IPCrossChainSwapHub.sol/IPCrossChainSwapHub.dbg.json +0 -4
- package/build/artifacts/contracts/interfaces/IPCrossChainSwapHub.sol/IPCrossChainSwapHub.json +0 -1353
- package/build/artifacts/contracts/interfaces/IPDepositBox.sol/IPDepositBox.dbg.json +0 -4
- package/build/artifacts/contracts/interfaces/IPDepositBox.sol/IPDepositBox.json +0 -150
- package/contracts/cross-chain/swap-hub/DepositBox.sol +0 -72
- package/contracts/cross-chain/swap-hub/PendleCrossChainSwapHub.sol +0 -206
- package/contracts/cross-chain/swap-hub/SwapHubBase.sol +0 -273
- package/contracts/cross-chain/swap-hub/swap/IPSwapExecutor.sol +0 -14
- package/contracts/cross-chain/swap-hub/swap/SwapExecutor.sol +0 -33
- package/contracts/interfaces/IPCrossChainSwapHub.sol +0 -168
- package/contracts/interfaces/IPDepositBox.sol +0 -25
- package/typechain-types/DepositBox.ts +0 -304
- package/typechain-types/IPCrossChainSwapHub.ts +0 -1043
- package/typechain-types/IPDepositBox.ts +0 -257
- package/typechain-types/IPSwapExecutor.ts +0 -129
- package/typechain-types/PendleCrossChainSwapHub.ts +0 -1267
- package/typechain-types/SwapExecutor.ts +0 -129
- package/typechain-types/SwapHubBase.ts +0 -1242
- package/typechain-types/factories/DepositBox__factory.ts +0 -259
- package/typechain-types/factories/IPCrossChainSwapHub__factory.ts +0 -1368
- package/typechain-types/factories/IPDepositBox__factory.ts +0 -162
- package/typechain-types/factories/IPSwapExecutor__factory.ts +0 -71
- package/typechain-types/factories/PendleCrossChainSwapHub__factory.ts +0 -1588
- package/typechain-types/factories/SwapExecutor__factory.ts +0 -110
- package/typechain-types/factories/SwapHubBase__factory.ts +0 -1502
|
@@ -1,273 +0,0 @@
|
|
|
1
|
-
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
2
|
-
pragma solidity ^0.8.30;
|
|
3
|
-
|
|
4
|
-
import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
|
|
5
|
-
import {Create2} from "@openzeppelin/contracts/utils/Create2.sol";
|
|
6
|
-
import {SignatureChecker} from "@openzeppelin/contracts/utils/cryptography/SignatureChecker.sol";
|
|
7
|
-
import {EIP712Upgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/EIP712Upgradeable.sol";
|
|
8
|
-
import {BoringOwnableUpgradeableV2} from "../../core/libraries/BoringOwnableUpgradeableV2.sol";
|
|
9
|
-
import {TokenHelper} from "../../core/libraries/TokenHelper.sol";
|
|
10
|
-
import {IPCrossChainSwapHub} from "../../interfaces/IPCrossChainSwapHub.sol";
|
|
11
|
-
import {IPDepositBox} from "../../interfaces/IPDepositBox.sol";
|
|
12
|
-
import {IPSwapExecutor, SwapData} from "./swap/IPSwapExecutor.sol";
|
|
13
|
-
import {DepositBox} from "./DepositBox.sol";
|
|
14
|
-
|
|
15
|
-
abstract contract SwapHubBase is IPCrossChainSwapHub, EIP712Upgradeable, BoringOwnableUpgradeableV2, TokenHelper {
|
|
16
|
-
// forgefmt: disable-next-item
|
|
17
|
-
bytes32 internal constant WITHDRAW_TOKEN_MESSAGE_TYPEHASH = keccak256(
|
|
18
|
-
"WithdrawTokenMessage("
|
|
19
|
-
"address owner,"
|
|
20
|
-
"uint32 boxId,"
|
|
21
|
-
"uint256 expiry,"
|
|
22
|
-
"uint256 nonce,"
|
|
23
|
-
//
|
|
24
|
-
"address receiver,"
|
|
25
|
-
"address token,"
|
|
26
|
-
"uint256 amountWithdraw,"
|
|
27
|
-
"uint256 amountFee"
|
|
28
|
-
")"
|
|
29
|
-
);
|
|
30
|
-
|
|
31
|
-
// forgefmt: disable-next-item
|
|
32
|
-
bytes32 internal constant BRIDGE_TOKEN_MESSAGE_TYPEHASH = keccak256(
|
|
33
|
-
"BridgeTokenMessage("
|
|
34
|
-
"address owner,"
|
|
35
|
-
"uint32 boxId,"
|
|
36
|
-
"uint256 expiry,"
|
|
37
|
-
"uint256 nonce,"
|
|
38
|
-
//
|
|
39
|
-
"address token,"
|
|
40
|
-
"uint256 amountBridge,"
|
|
41
|
-
"uint256 amountFee,"
|
|
42
|
-
//
|
|
43
|
-
"address bridgeExtRouter,"
|
|
44
|
-
"bytes bridgeCalldata"
|
|
45
|
-
")"
|
|
46
|
-
);
|
|
47
|
-
|
|
48
|
-
// forgefmt: disable-next-item
|
|
49
|
-
bytes32 internal constant SWAP_TOKEN_MESSAGE_TYPEHASH = keccak256(
|
|
50
|
-
"SwapTokenMessage("
|
|
51
|
-
"address owner,"
|
|
52
|
-
"uint32 boxId,"
|
|
53
|
-
"uint256 expiry,"
|
|
54
|
-
"uint256 nonce,"
|
|
55
|
-
//
|
|
56
|
-
"address tokenSpent,"
|
|
57
|
-
"uint256 amountSpent,"
|
|
58
|
-
"uint256 amountFee,"
|
|
59
|
-
"address tokenReceived,"
|
|
60
|
-
"uint256 minReceived,"
|
|
61
|
-
"address receiver,"
|
|
62
|
-
//
|
|
63
|
-
"address swapExecutor,"
|
|
64
|
-
"address swapExtRouter,"
|
|
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
|
-
//
|
|
85
|
-
"address swapExecutor,"
|
|
86
|
-
"address swapExtRouter,"
|
|
87
|
-
"bytes swapCalldata"
|
|
88
|
-
")"
|
|
89
|
-
);
|
|
90
|
-
|
|
91
|
-
/// @dev creation code of OpenZeppelin's BeaconProxy
|
|
92
|
-
address public immutable BEACON_PROXY_CODE_CONTRACT;
|
|
93
|
-
address public immutable DEPOSIT_BOX_BEACON;
|
|
94
|
-
bytes32 public immutable DEPOSIT_BOX_CODE_HASH;
|
|
95
|
-
|
|
96
|
-
mapping(address owner => uint256 nonce) public ownerNonce;
|
|
97
|
-
mapping(bytes32 actionStatus => ActionStatus) public actionStatus;
|
|
98
|
-
mapping(address executor => bool) public isExecutor;
|
|
99
|
-
|
|
100
|
-
constructor(address beaconProxyCodeContract_, address depositBoxBeacon_) {
|
|
101
|
-
BEACON_PROXY_CODE_CONTRACT = beaconProxyCodeContract_;
|
|
102
|
-
DEPOSIT_BOX_BEACON = depositBoxBeacon_;
|
|
103
|
-
DEPOSIT_BOX_CODE_HASH =
|
|
104
|
-
keccak256(abi.encodePacked(beaconProxyCodeContract_.code, abi.encode(depositBoxBeacon_, "")));
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
modifier onlyExecutor() {
|
|
108
|
-
require(isExecutor[msg.sender], "SwapHub: caller is not executor");
|
|
109
|
-
_;
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
function setExecutor(address executor, bool isExecutor_) external onlyOwner {
|
|
113
|
-
isExecutor[executor] = isExecutor_;
|
|
114
|
-
emit SetExecutor(executor, isExecutor_);
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
function computeDepositBox(address owner, uint32 boxId) public view returns (address box, bytes32 salt) {
|
|
118
|
-
salt = keccak256(abi.encode(owner, boxId));
|
|
119
|
-
box = Create2.computeAddress(salt, DEPOSIT_BOX_CODE_HASH);
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
function _checkAndDeployBox(address owner, uint32 boxId) internal returns (IPDepositBox) {
|
|
123
|
-
(address box, bytes32 salt) = computeDepositBox(owner, boxId);
|
|
124
|
-
if (box.code.length > 0) {
|
|
125
|
-
return IPDepositBox(box);
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
bytes memory bytecode = abi.encodePacked(BEACON_PROXY_CODE_CONTRACT.code, abi.encode(DEPOSIT_BOX_BEACON, ""));
|
|
129
|
-
assert(Create2.deploy(0, salt, bytecode) == box);
|
|
130
|
-
DepositBox(payable(box)).initialize(owner, boxId);
|
|
131
|
-
return IPDepositBox(box);
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
function hashTypedData(WithdrawTokenMessage memory message) public view returns (bytes32) {
|
|
135
|
-
return _hashTypedDataV4(
|
|
136
|
-
keccak256(
|
|
137
|
-
abi.encode(
|
|
138
|
-
WITHDRAW_TOKEN_MESSAGE_TYPEHASH,
|
|
139
|
-
message.owner,
|
|
140
|
-
message.boxId,
|
|
141
|
-
message.expiry,
|
|
142
|
-
message.nonce,
|
|
143
|
-
//
|
|
144
|
-
message.receiver,
|
|
145
|
-
message.token,
|
|
146
|
-
message.amountWithdraw,
|
|
147
|
-
message.amountFee
|
|
148
|
-
)
|
|
149
|
-
)
|
|
150
|
-
);
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
function hashTypedData(BridgeTokenMessage memory message) public view returns (bytes32) {
|
|
154
|
-
return _hashTypedDataV4(
|
|
155
|
-
keccak256(
|
|
156
|
-
abi.encode(
|
|
157
|
-
BRIDGE_TOKEN_MESSAGE_TYPEHASH,
|
|
158
|
-
message.owner,
|
|
159
|
-
message.boxId,
|
|
160
|
-
message.expiry,
|
|
161
|
-
message.nonce,
|
|
162
|
-
//
|
|
163
|
-
message.token,
|
|
164
|
-
message.amountBridge,
|
|
165
|
-
message.amountFee,
|
|
166
|
-
//
|
|
167
|
-
message.bridgeExtRouter,
|
|
168
|
-
keccak256(message.bridgeCalldata)
|
|
169
|
-
)
|
|
170
|
-
)
|
|
171
|
-
);
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
function hashTypedData(SwapTokenMessage memory message) public view returns (bytes32) {
|
|
175
|
-
return _hashTypedDataV4(
|
|
176
|
-
keccak256(
|
|
177
|
-
abi.encode(
|
|
178
|
-
SWAP_TOKEN_MESSAGE_TYPEHASH,
|
|
179
|
-
message.owner,
|
|
180
|
-
message.boxId,
|
|
181
|
-
message.expiry,
|
|
182
|
-
message.nonce,
|
|
183
|
-
//
|
|
184
|
-
message.tokenSpent,
|
|
185
|
-
message.amountSpent,
|
|
186
|
-
message.amountFee,
|
|
187
|
-
message.tokenReceived,
|
|
188
|
-
message.minReceived,
|
|
189
|
-
message.receiver,
|
|
190
|
-
//
|
|
191
|
-
message.swapExecutor,
|
|
192
|
-
message.swapExtRouter,
|
|
193
|
-
keccak256(message.swapCalldata)
|
|
194
|
-
)
|
|
195
|
-
)
|
|
196
|
-
);
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
function hashTypedData(BuyCrossChainPtMessage memory message) public view returns (bytes32) {
|
|
200
|
-
return _hashTypedDataV4(
|
|
201
|
-
keccak256(
|
|
202
|
-
abi.encode(
|
|
203
|
-
BUY_CROSS_CHAIN_PT_MESSAGE_TYPEHASH,
|
|
204
|
-
message.owner,
|
|
205
|
-
message.boxId,
|
|
206
|
-
message.expiry,
|
|
207
|
-
message.nonce,
|
|
208
|
-
//
|
|
209
|
-
message.tokenSpent,
|
|
210
|
-
message.amountSpent,
|
|
211
|
-
message.amountFee,
|
|
212
|
-
message.ptAdapter,
|
|
213
|
-
message.minPtReceived,
|
|
214
|
-
message.dstEid,
|
|
215
|
-
message.receiver,
|
|
216
|
-
//
|
|
217
|
-
message.swapExecutor,
|
|
218
|
-
message.swapExtRouter,
|
|
219
|
-
keccak256(message.swapCalldata)
|
|
220
|
-
)
|
|
221
|
-
)
|
|
222
|
-
);
|
|
223
|
-
}
|
|
224
|
-
|
|
225
|
-
function _verifyOwnerSig(
|
|
226
|
-
address owner,
|
|
227
|
-
uint256 expiry,
|
|
228
|
-
uint256 nonce,
|
|
229
|
-
bytes32 messageHash,
|
|
230
|
-
bytes memory signature,
|
|
231
|
-
bool verifyNonce
|
|
232
|
-
) internal {
|
|
233
|
-
_verifyOwnerSig(owner, expiry, messageHash, signature);
|
|
234
|
-
if (verifyNonce) _verifyAndIncreaseNonce(owner, nonce);
|
|
235
|
-
}
|
|
236
|
-
|
|
237
|
-
function _verifyOwnerSig(address owner, uint256 expiry, bytes32 messageHash, bytes memory signature) internal view {
|
|
238
|
-
require(SignatureChecker.isValidSignatureNow(owner, messageHash, signature), InvalidSignature());
|
|
239
|
-
require(expiry > block.timestamp, MessageExpired());
|
|
240
|
-
}
|
|
241
|
-
|
|
242
|
-
function _verifyAndIncreaseNonce(address owner, uint256 nonce) internal {
|
|
243
|
-
require(ownerNonce[owner] < nonce, InvalidNonce());
|
|
244
|
-
ownerNonce[owner] = nonce;
|
|
245
|
-
}
|
|
246
|
-
|
|
247
|
-
function _balanceOf(address addr, address token) internal view returns (uint256) {
|
|
248
|
-
return (token == NATIVE) ? addr.balance : IERC20(token).balanceOf(addr);
|
|
249
|
-
}
|
|
250
|
-
|
|
251
|
-
function _markSucceededAndTakeFee(bytes32 actionHash, IPDepositBox box, address token, uint256 amount) internal {
|
|
252
|
-
require(actionStatus[actionHash] == ActionStatus.NOT_EXECUTED, ActionExecuted());
|
|
253
|
-
actionStatus[actionHash] = ActionStatus.SUCCEEDED;
|
|
254
|
-
box.payTreasury(token, amount);
|
|
255
|
-
}
|
|
256
|
-
|
|
257
|
-
function _markFailedAndTakeFee(bytes32 actionHash, IPDepositBox box, address token, uint256 amount) internal {
|
|
258
|
-
require(actionStatus[actionHash] == ActionStatus.NOT_EXECUTED, ActionExecuted());
|
|
259
|
-
actionStatus[actionHash] = ActionStatus.FAILED;
|
|
260
|
-
box.payTreasury(token, amount);
|
|
261
|
-
}
|
|
262
|
-
|
|
263
|
-
function _swapFromBox(IPDepositBox box, address swapExecutor, SwapData memory swapData, address receiver)
|
|
264
|
-
internal
|
|
265
|
-
returns (uint256 rawTokenOut)
|
|
266
|
-
{
|
|
267
|
-
box.withdrawTo(swapExecutor, swapData.tokenIn, swapData.amountIn);
|
|
268
|
-
|
|
269
|
-
uint256 preBalance = _balanceOf(receiver, swapData.tokenOut);
|
|
270
|
-
IPSwapExecutor(swapExecutor).swap(receiver, swapData);
|
|
271
|
-
rawTokenOut = _balanceOf(receiver, swapData.tokenOut) - preBalance;
|
|
272
|
-
}
|
|
273
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
2
|
-
pragma solidity ^0.8.0;
|
|
3
|
-
|
|
4
|
-
struct SwapData {
|
|
5
|
-
address tokenIn;
|
|
6
|
-
uint256 amountIn;
|
|
7
|
-
address tokenOut;
|
|
8
|
-
address extRouter;
|
|
9
|
-
bytes extCalldata;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
interface IPSwapExecutor {
|
|
13
|
-
function swap(address receiver, SwapData memory swapData) external payable;
|
|
14
|
-
}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
2
|
-
pragma solidity ^0.8.30;
|
|
3
|
-
|
|
4
|
-
import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
|
|
5
|
-
import {Address} from "@openzeppelin/contracts/utils/Address.sol";
|
|
6
|
-
import {SafeERC20} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
|
|
7
|
-
import {TokenHelper} from "../../../core/libraries/TokenHelper.sol";
|
|
8
|
-
import {IPSwapExecutor, SwapData} from "./IPSwapExecutor.sol";
|
|
9
|
-
|
|
10
|
-
contract SwapExecutor is IPSwapExecutor, TokenHelper {
|
|
11
|
-
using Address for address;
|
|
12
|
-
using SafeERC20 for IERC20;
|
|
13
|
-
|
|
14
|
-
function swap(address receiver, SwapData memory $) external payable {
|
|
15
|
-
_approveForExtRouter($.tokenIn, $.extRouter);
|
|
16
|
-
$.extRouter.functionCallWithValue($.extCalldata, $.tokenIn == NATIVE ? $.amountIn : 0);
|
|
17
|
-
_transferOut($.tokenOut, receiver, _selfBalance($.tokenOut));
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
function _approveForExtRouter(address token, address extRouter) internal {
|
|
21
|
-
if (token == NATIVE) return;
|
|
22
|
-
|
|
23
|
-
_safeApproveInfV2(IERC20(token), extRouter);
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
function _safeApproveInfV2(IERC20 token, address spender) internal {
|
|
27
|
-
if (token.allowance(address(this), spender) < type(uint256).max) {
|
|
28
|
-
token.forceApprove(spender, type(uint256).max);
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
receive() external payable {}
|
|
33
|
-
}
|
|
@@ -1,168 +0,0 @@
|
|
|
1
|
-
// SPDX-License-Identifier: MIT
|
|
2
|
-
pragma solidity ^0.8.0;
|
|
3
|
-
|
|
4
|
-
interface IPCrossChainSwapHub {
|
|
5
|
-
error ActionExecuted();
|
|
6
|
-
error InsufficientTokenReceived();
|
|
7
|
-
error InvalidNonce();
|
|
8
|
-
error InvalidSignature();
|
|
9
|
-
error MessageExpired();
|
|
10
|
-
|
|
11
|
-
enum ActionStatus {
|
|
12
|
-
NOT_EXECUTED,
|
|
13
|
-
SUCCEEDED,
|
|
14
|
-
FAILED
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
struct WithdrawTokenMessage {
|
|
18
|
-
address owner;
|
|
19
|
-
uint32 boxId;
|
|
20
|
-
uint256 expiry;
|
|
21
|
-
uint256 nonce;
|
|
22
|
-
//
|
|
23
|
-
address receiver;
|
|
24
|
-
address token;
|
|
25
|
-
uint256 amountWithdraw;
|
|
26
|
-
uint256 amountFee;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
struct BridgeTokenMessage {
|
|
30
|
-
address owner;
|
|
31
|
-
uint32 boxId;
|
|
32
|
-
uint256 expiry;
|
|
33
|
-
uint256 nonce;
|
|
34
|
-
//
|
|
35
|
-
address token;
|
|
36
|
-
uint256 amountBridge;
|
|
37
|
-
uint256 amountFee;
|
|
38
|
-
//
|
|
39
|
-
address bridgeExtRouter;
|
|
40
|
-
bytes bridgeCalldata;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
struct SwapTokenMessage {
|
|
44
|
-
address owner;
|
|
45
|
-
uint32 boxId;
|
|
46
|
-
uint256 expiry;
|
|
47
|
-
uint256 nonce;
|
|
48
|
-
//
|
|
49
|
-
address tokenSpent;
|
|
50
|
-
uint256 amountSpent;
|
|
51
|
-
uint256 amountFee;
|
|
52
|
-
address tokenReceived;
|
|
53
|
-
uint256 minReceived;
|
|
54
|
-
address receiver;
|
|
55
|
-
//
|
|
56
|
-
address swapExecutor;
|
|
57
|
-
address swapExtRouter;
|
|
58
|
-
bytes swapCalldata;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
struct BuyCrossChainPtMessage {
|
|
62
|
-
address owner;
|
|
63
|
-
uint32 boxId;
|
|
64
|
-
uint256 expiry;
|
|
65
|
-
uint256 nonce;
|
|
66
|
-
//
|
|
67
|
-
address tokenSpent;
|
|
68
|
-
uint256 amountSpent;
|
|
69
|
-
uint256 amountFee;
|
|
70
|
-
address ptAdapter;
|
|
71
|
-
uint256 minPtReceived;
|
|
72
|
-
uint32 dstEid;
|
|
73
|
-
bytes32 receiver;
|
|
74
|
-
//
|
|
75
|
-
address swapExecutor;
|
|
76
|
-
address swapExtRouter;
|
|
77
|
-
bytes swapCalldata;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
event WithdrawToken(
|
|
81
|
-
address indexed owner,
|
|
82
|
-
uint32 boxId,
|
|
83
|
-
bytes32 actionHash,
|
|
84
|
-
address receiver,
|
|
85
|
-
address token,
|
|
86
|
-
uint256 amountWithdraw,
|
|
87
|
-
uint256 amountFee
|
|
88
|
-
);
|
|
89
|
-
|
|
90
|
-
event BridgeToken(
|
|
91
|
-
address indexed owner,
|
|
92
|
-
uint32 boxId,
|
|
93
|
-
bytes32 actionHash,
|
|
94
|
-
address bridgeExtRouter,
|
|
95
|
-
address token,
|
|
96
|
-
uint256 amountBridge,
|
|
97
|
-
uint256 amountFee
|
|
98
|
-
);
|
|
99
|
-
|
|
100
|
-
event SwapToken(
|
|
101
|
-
address indexed owner,
|
|
102
|
-
uint32 boxId,
|
|
103
|
-
bytes32 actionHash,
|
|
104
|
-
address tokenSpent,
|
|
105
|
-
uint256 amountSpent,
|
|
106
|
-
uint256 amountFee,
|
|
107
|
-
address tokenReceived,
|
|
108
|
-
uint256 netTokenReceived
|
|
109
|
-
);
|
|
110
|
-
|
|
111
|
-
event BuyCrossChainPt(
|
|
112
|
-
address indexed owner,
|
|
113
|
-
uint32 boxId,
|
|
114
|
-
bytes32 actionHash,
|
|
115
|
-
address tokenSpent,
|
|
116
|
-
uint256 amountSpent,
|
|
117
|
-
uint256 amountFee,
|
|
118
|
-
address ptAdapter,
|
|
119
|
-
address pt,
|
|
120
|
-
uint256 netPtReceived
|
|
121
|
-
);
|
|
122
|
-
|
|
123
|
-
event ClaimFeeForFailedAction(
|
|
124
|
-
address indexed owner, uint32 boxId, bytes32 actionHash, address token, uint256 amount
|
|
125
|
-
);
|
|
126
|
-
|
|
127
|
-
event SetExecutor(address indexed executor, bool isExecutor);
|
|
128
|
-
|
|
129
|
-
function BEACON_PROXY_CODE_CONTRACT() external view returns (address);
|
|
130
|
-
|
|
131
|
-
function DEPOSIT_BOX_BEACON() external view returns (address);
|
|
132
|
-
|
|
133
|
-
function DEPOSIT_BOX_CODE_HASH() external view returns (bytes32);
|
|
134
|
-
|
|
135
|
-
function ownerNonce(address owner) external view returns (uint256);
|
|
136
|
-
|
|
137
|
-
function actionStatus(bytes32 actionHash) external view returns (ActionStatus);
|
|
138
|
-
|
|
139
|
-
function isExecutor(address executor) external view returns (bool);
|
|
140
|
-
|
|
141
|
-
function computeDepositBox(address owner, uint32 boxId) external view returns (address box, bytes32 salt);
|
|
142
|
-
|
|
143
|
-
function hashTypedData(WithdrawTokenMessage memory message) external view returns (bytes32);
|
|
144
|
-
|
|
145
|
-
function hashTypedData(BridgeTokenMessage memory message) external view returns (bytes32);
|
|
146
|
-
|
|
147
|
-
function hashTypedData(SwapTokenMessage memory message) external view returns (bytes32);
|
|
148
|
-
|
|
149
|
-
function hashTypedData(BuyCrossChainPtMessage memory message) external view returns (bytes32);
|
|
150
|
-
|
|
151
|
-
function withdrawToken(WithdrawTokenMessage memory message, bytes memory signature) external;
|
|
152
|
-
|
|
153
|
-
function bridgeToken(BridgeTokenMessage memory message, bytes memory signature) external payable;
|
|
154
|
-
|
|
155
|
-
function swapToken(SwapTokenMessage memory message, bytes memory signature) external;
|
|
156
|
-
|
|
157
|
-
function buyCrossChainPt(BuyCrossChainPtMessage memory message, bytes memory signature) external payable;
|
|
158
|
-
|
|
159
|
-
function claimFee(WithdrawTokenMessage memory message, bytes memory signature) external;
|
|
160
|
-
|
|
161
|
-
function claimFee(BridgeTokenMessage memory message, bytes memory signature) external;
|
|
162
|
-
|
|
163
|
-
function claimFee(SwapTokenMessage memory message, bytes memory signature) external;
|
|
164
|
-
|
|
165
|
-
function claimFee(BuyCrossChainPtMessage memory message, bytes memory signature) external;
|
|
166
|
-
|
|
167
|
-
function setExecutor(address executor, bool isExecutor) external;
|
|
168
|
-
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
// SPDX-License-Identifier: MIT
|
|
2
|
-
pragma solidity ^0.8.0;
|
|
3
|
-
|
|
4
|
-
struct ApprovedCall {
|
|
5
|
-
address token;
|
|
6
|
-
uint256 amount;
|
|
7
|
-
address spender;
|
|
8
|
-
bytes data;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
interface IPDepositBox {
|
|
12
|
-
function HUB() external view returns (address);
|
|
13
|
-
|
|
14
|
-
function TREASURY() external view returns (address);
|
|
15
|
-
|
|
16
|
-
function OWNER() external view returns (address);
|
|
17
|
-
|
|
18
|
-
function BOX_ID() external view returns (uint32);
|
|
19
|
-
|
|
20
|
-
function payTreasury(address token, uint256 amount) external;
|
|
21
|
-
|
|
22
|
-
function withdrawTo(address to, address token, uint256 amount) external;
|
|
23
|
-
|
|
24
|
-
function approveAndCall(ApprovedCall memory call, address nativeRefund) external payable returns (bytes memory);
|
|
25
|
-
}
|