@pendle/core-v2 6.3.2 → 6.3.3-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.
Files changed (346) hide show
  1. package/build/artifacts/contracts/LiquidityMining/CrossChainMsg/PendleMsgReceiveEndpointUpg.sol/PendleMsgReceiveEndpointUpg.dbg.json +1 -1
  2. package/build/artifacts/contracts/LiquidityMining/CrossChainMsg/PendleMsgReceiverAppUpg.sol/PendleMsgReceiverAppUpg.dbg.json +1 -1
  3. package/build/artifacts/contracts/LiquidityMining/CrossChainMsg/PendleMsgSendEndpointUpg.sol/PendleMsgSendEndpointUpg.dbg.json +1 -1
  4. package/build/artifacts/contracts/LiquidityMining/CrossChainMsg/PendleMsgSenderAppUpg.sol/PendleMsgSenderAppUpg.dbg.json +1 -1
  5. package/build/artifacts/contracts/LiquidityMining/CrossChainMsg/libraries/ExcessivelySafeCall.sol/ExcessivelySafeCall.dbg.json +1 -1
  6. package/build/artifacts/contracts/LiquidityMining/CrossChainMsg/libraries/LayerZeroHelper.sol/LayerZeroHelper.dbg.json +1 -1
  7. package/build/artifacts/contracts/LiquidityMining/GaugeController/PendleGaugeControllerBaseUpg.sol/PendleGaugeControllerBaseUpg.dbg.json +1 -1
  8. package/build/artifacts/contracts/LiquidityMining/GaugeController/PendleGaugeControllerMainchainUpg.sol/PendleGaugeControllerMainchainUpg.dbg.json +1 -1
  9. package/build/artifacts/contracts/LiquidityMining/GaugeController/PendleGaugeControllerSidechainUpg.sol/PendleGaugeControllerSidechainUpg.dbg.json +1 -1
  10. package/build/artifacts/contracts/LiquidityMining/PendleMerkleDistributor.sol/PendleMerkleDistributor.dbg.json +1 -1
  11. package/build/artifacts/contracts/LiquidityMining/PendleMultiTokenMerkleDistributor.sol/PendleMultiTokenMerkleDistributor.dbg.json +1 -1
  12. package/build/artifacts/contracts/LiquidityMining/VotingController/PendleVotingControllerUpg.sol/PendleVotingControllerUpg.dbg.json +1 -1
  13. package/build/artifacts/contracts/LiquidityMining/VotingController/VotingControllerStorageUpg.sol/VotingControllerStorageUpg.dbg.json +1 -1
  14. package/build/artifacts/contracts/LiquidityMining/VotingEscrow/VotingEscrowPendleMainchain.sol/VotingEscrowPendleMainchain.dbg.json +1 -1
  15. package/build/artifacts/contracts/LiquidityMining/VotingEscrow/VotingEscrowPendleSidechain.sol/VotingEscrowPendleSidechain.dbg.json +1 -1
  16. package/build/artifacts/contracts/LiquidityMining/VotingEscrow/VotingEscrowTokenBase.sol/VotingEscrowTokenBase.dbg.json +1 -1
  17. package/build/artifacts/contracts/LiquidityMining/libraries/VeBalanceLib.sol/VeBalanceLib.dbg.json +1 -1
  18. package/build/artifacts/contracts/LiquidityMining/libraries/VeHistoryLib.sol/CheckpointHelper.dbg.json +1 -1
  19. package/build/artifacts/contracts/LiquidityMining/libraries/VeHistoryLib.sol/Checkpoints.dbg.json +1 -1
  20. package/build/artifacts/contracts/LiquidityMining/libraries/WeekMath.sol/WeekMath.dbg.json +1 -1
  21. package/build/artifacts/contracts/core/Market/MarketMathCore.sol/MarketMathCore.dbg.json +1 -1
  22. package/build/artifacts/contracts/core/Market/OracleLib.sol/OracleLib.dbg.json +1 -1
  23. package/build/artifacts/contracts/core/Market/PendleGauge.sol/PendleGauge.dbg.json +1 -1
  24. package/build/artifacts/contracts/core/Market/PendleMarketFactoryV6Upg.sol/PendleMarketFactoryV6Upg.dbg.json +1 -1
  25. package/build/artifacts/contracts/core/Market/PendleMarketV6.sol/PendleMarketV6.dbg.json +1 -1
  26. package/build/artifacts/contracts/core/RewardManager/RewardManager.sol/RewardManager.dbg.json +1 -1
  27. package/build/artifacts/contracts/core/RewardManager/RewardManagerAbstract.sol/RewardManagerAbstract.dbg.json +1 -1
  28. package/build/artifacts/contracts/core/StandardizedYield/PYIndex.sol/PYIndexLib.dbg.json +1 -1
  29. package/build/artifacts/contracts/core/StandardizedYield/SYUtils.sol/SYUtils.dbg.json +1 -1
  30. package/build/artifacts/contracts/core/YieldContracts/InterestManagerYT.sol/InterestManagerYT.dbg.json +1 -1
  31. package/build/artifacts/contracts/core/YieldContracts/PendlePrincipalToken.sol/PendlePrincipalToken.dbg.json +1 -1
  32. package/build/artifacts/contracts/core/YieldContracts/PendleYieldContractFactoryUpg.sol/PendleYieldContractFactoryUpg.dbg.json +1 -1
  33. package/build/artifacts/contracts/core/YieldContracts/PendleYieldToken.sol/PendleYieldToken.dbg.json +1 -1
  34. package/build/artifacts/contracts/core/erc20/PendleERC20.sol/PendleERC20.dbg.json +1 -1
  35. package/build/artifacts/contracts/core/libraries/ArrayLib.sol/ArrayLib.dbg.json +1 -1
  36. package/build/artifacts/contracts/core/libraries/BaseSplitCodeFactory.sol/BaseSplitCodeFactory.dbg.json +1 -1
  37. package/build/artifacts/contracts/core/libraries/BaseSplitCodeFactory.sol/CodeDeployer.dbg.json +1 -1
  38. package/build/artifacts/contracts/core/libraries/BoringOwnableUpgradeableV2.sol/BoringOwnableUpgradeableData.dbg.json +1 -1
  39. package/build/artifacts/contracts/core/libraries/BoringOwnableUpgradeableV2.sol/BoringOwnableUpgradeableV2.dbg.json +1 -1
  40. package/build/artifacts/contracts/core/libraries/Errors.sol/Errors.dbg.json +1 -1
  41. package/build/artifacts/contracts/core/libraries/ExpiryUtilsLib.sol/ExpiryUtils.dbg.json +1 -1
  42. package/build/artifacts/contracts/core/libraries/MiniHelpers.sol/MiniHelpers.dbg.json +1 -1
  43. package/build/artifacts/contracts/core/libraries/StringLib.sol/StringLib.dbg.json +1 -1
  44. package/build/artifacts/contracts/core/libraries/TokenHelper.sol/TokenHelper.dbg.json +1 -1
  45. package/build/artifacts/contracts/core/libraries/math/LogExpMath.sol/LogExpMath.dbg.json +1 -1
  46. package/build/artifacts/contracts/core/libraries/math/PMath.sol/PMath.dbg.json +1 -1
  47. package/build/artifacts/contracts/cross-chain/FixedPricePTAMM.sol/FixedPricePTAMM.dbg.json +1 -1
  48. package/build/artifacts/contracts/cross-chain/factory/hub/PendlePTOFTAdapterFactory.sol/PendlePTOFTAdapterFactory.dbg.json +1 -1
  49. package/build/artifacts/contracts/cross-chain/oftImpl/hub/OFTAdapterImpl.sol/OFTAdapterImpl.dbg.json +1 -1
  50. package/build/artifacts/contracts/cross-chain/oftImpl/spoke/PendleBridgedPrincipalToken.sol/PendleBridgedPrincipalToken.dbg.json +1 -1
  51. package/build/artifacts/contracts/cross-chain/swap-hub/DepositBox.sol/DepositBox.dbg.json +4 -0
  52. package/build/artifacts/contracts/cross-chain/swap-hub/DepositBox.sol/DepositBox.json +170 -0
  53. package/build/artifacts/contracts/cross-chain/swap-hub/PendleCrossChainSwapHub.sol/PendleCrossChainSwapHub.dbg.json +4 -0
  54. package/build/artifacts/contracts/cross-chain/swap-hub/PendleCrossChainSwapHub.sol/PendleCrossChainSwapHub.json +1214 -0
  55. package/build/artifacts/contracts/cross-chain/swap-hub/SwapHubBase.sol/SwapHubBase.dbg.json +4 -0
  56. package/build/artifacts/contracts/cross-chain/swap-hub/SwapHubBase.sol/SwapHubBase.json +1176 -0
  57. package/build/artifacts/contracts/deprecated/VeDistributor/PendleFeeDistributor.sol/PendleFeeDistributor.dbg.json +1 -1
  58. package/build/artifacts/contracts/deprecated/VeDistributor/PendleFeeDistributorV2.sol/PendleFeeDistributorV2.dbg.json +1 -1
  59. package/build/artifacts/contracts/interfaces/IAddressProvider.sol/IAddressProvider.dbg.json +1 -1
  60. package/build/artifacts/contracts/interfaces/ILPWrapper.sol/ILPWrapper.dbg.json +1 -1
  61. package/build/artifacts/contracts/interfaces/ILayerZeroEndpoint.sol/ILayerZeroEndpoint.dbg.json +1 -1
  62. package/build/artifacts/contracts/interfaces/ILayerZeroReceiver.sol/ILayerZeroReceiver.dbg.json +1 -1
  63. package/build/artifacts/contracts/interfaces/IMarketSweed.sol/IMarketSweed.dbg.json +1 -1
  64. package/build/artifacts/contracts/interfaces/IOwnable.sol/IOwnable.dbg.json +1 -1
  65. package/build/artifacts/contracts/interfaces/IPActionAddRemoveLiqV3.sol/IPActionAddRemoveLiqV3.dbg.json +1 -1
  66. package/build/artifacts/contracts/interfaces/IPActionCallbackV3.sol/IPActionCallbackV3.dbg.json +1 -1
  67. package/build/artifacts/contracts/interfaces/IPActionCrossChain.sol/IPActionCrossChain.dbg.json +4 -0
  68. package/build/artifacts/contracts/interfaces/IPActionCrossChain.sol/IPActionCrossChain.json +99 -0
  69. package/build/artifacts/contracts/interfaces/IPActionInfoStatic.sol/IPActionInfoStatic.dbg.json +1 -1
  70. package/build/artifacts/contracts/interfaces/IPActionMarketAuxStatic.sol/IPActionMarketAuxStatic.dbg.json +1 -1
  71. package/build/artifacts/contracts/interfaces/IPActionMarketCoreStatic.sol/IPActionMarketCoreStatic.dbg.json +1 -1
  72. package/build/artifacts/contracts/interfaces/IPActionMintRedeemStatic.sol/IPActionMintRedeemStatic.dbg.json +1 -1
  73. package/build/artifacts/contracts/interfaces/IPActionMiscV3.sol/IPActionMiscV3.dbg.json +1 -1
  74. package/build/artifacts/contracts/interfaces/IPActionSimple.sol/IPActionSimple.dbg.json +1 -1
  75. package/build/artifacts/contracts/interfaces/IPActionStorageStatic.sol/IPActionStorageStatic.dbg.json +1 -1
  76. package/build/artifacts/contracts/interfaces/IPActionStorageV4.sol/IPActionStorageV4.dbg.json +1 -1
  77. package/build/artifacts/contracts/interfaces/IPActionSwapPTV3.sol/IPActionSwapPTV3.dbg.json +1 -1
  78. package/build/artifacts/contracts/interfaces/IPActionSwapYTV3.sol/IPActionSwapYTV3.dbg.json +1 -1
  79. package/build/artifacts/contracts/interfaces/IPActionVePendleStatic.sol/IPActionVePendleStatic.dbg.json +1 -1
  80. package/build/artifacts/contracts/interfaces/IPAllActionV3.sol/IPAllActionV3.dbg.json +1 -1
  81. package/build/artifacts/contracts/interfaces/IPAllActionV3.sol/IPAllActionV3.json +88 -0
  82. package/build/artifacts/contracts/interfaces/IPAllEventsV3.sol/IPActionAddRemoveLiqV3Events.dbg.json +1 -1
  83. package/build/artifacts/contracts/interfaces/IPAllEventsV3.sol/IPActionMiscV3Events.dbg.json +1 -1
  84. package/build/artifacts/contracts/interfaces/IPAllEventsV3.sol/IPActionStorageEvents.dbg.json +1 -1
  85. package/build/artifacts/contracts/interfaces/IPAllEventsV3.sol/IPActionSwapPTV3Events.dbg.json +1 -1
  86. package/build/artifacts/contracts/interfaces/IPAllEventsV3.sol/IPActionSwapYTV3Events.dbg.json +1 -1
  87. package/build/artifacts/contracts/interfaces/IPAllEventsV3.sol/IPAllEventsV3.dbg.json +1 -1
  88. package/build/artifacts/contracts/interfaces/IPBridgedPrincipalToken.sol/IPBridgedPrincipalToken.dbg.json +1 -1
  89. package/build/artifacts/contracts/interfaces/IPChainlinkOracle.sol/IPChainlinkOracle.dbg.json +1 -1
  90. package/build/artifacts/contracts/interfaces/IPChainlinkOracleEssential.sol/IPChainlinkOracleEssential.dbg.json +1 -1
  91. package/build/artifacts/contracts/interfaces/IPChainlinkOracleFactory.sol/IPChainlinkOracleFactory.dbg.json +1 -1
  92. package/build/artifacts/contracts/interfaces/IPChainlinkOracleWithQuote.sol/IPChainlinkOracleWithQuote.dbg.json +1 -1
  93. package/build/artifacts/contracts/interfaces/IPCommonPoolDeployHelperV2.sol/IPCommonPoolDeployHelperV2.dbg.json +1 -1
  94. package/build/artifacts/contracts/interfaces/IPCommonSYFactory.sol/IPCommonSYFactory.dbg.json +1 -1
  95. package/build/artifacts/contracts/interfaces/IPCrossChainSwapHub.sol/IPCrossChainSwapHub.dbg.json +4 -0
  96. package/build/artifacts/contracts/interfaces/IPCrossChainSwapHub.sol/IPCrossChainSwapHub.json +1026 -0
  97. package/build/artifacts/contracts/interfaces/IPDepositBox.sol/IPDepositBox.dbg.json +4 -0
  98. package/build/artifacts/contracts/interfaces/IPDepositBox.sol/IPDepositBox.json +124 -0
  99. package/build/artifacts/contracts/interfaces/IPExchangeRateOracle.sol/IPExchangeRateOracle.dbg.json +1 -1
  100. package/build/artifacts/contracts/interfaces/IPExchangeRateOracleApp.sol/IPExchangeRateOracleApp.dbg.json +1 -1
  101. package/build/artifacts/contracts/interfaces/IPFeeDistributor.sol/IPFeeDistributor.dbg.json +1 -1
  102. package/build/artifacts/contracts/interfaces/IPFeeDistributorV2.sol/IPFeeDistributorV2.dbg.json +1 -1
  103. package/build/artifacts/contracts/interfaces/IPFixedPricePTAMM.sol/IPFixedPricePTAMM.dbg.json +1 -1
  104. package/build/artifacts/contracts/interfaces/IPFixedPricePTAMM.sol/IPFixedPricePTAMMSwapCallback.dbg.json +1 -1
  105. package/build/artifacts/contracts/interfaces/IPGauge.sol/IPGauge.dbg.json +1 -1
  106. package/build/artifacts/contracts/interfaces/IPGaugeController.sol/IPGaugeController.dbg.json +1 -1
  107. package/build/artifacts/contracts/interfaces/IPGaugeControllerMainchain.sol/IPGaugeControllerMainchain.dbg.json +1 -1
  108. package/build/artifacts/contracts/interfaces/IPGovernanceProxy.sol/IPGovernanceProxy.dbg.json +1 -1
  109. package/build/artifacts/contracts/interfaces/IPInterestManagerYT.sol/IPInterestManagerYT.dbg.json +1 -1
  110. package/build/artifacts/contracts/interfaces/IPInterestManagerYTV2.sol/IPInterestManagerYTV2.dbg.json +1 -1
  111. package/build/artifacts/contracts/interfaces/IPLPWrapperFactory.sol/IPLPWrapperFactory.dbg.json +1 -1
  112. package/build/artifacts/contracts/interfaces/IPLimitRouter.sol/IPLimitOrderType.dbg.json +1 -1
  113. package/build/artifacts/contracts/interfaces/IPLimitRouter.sol/IPLimitRouter.dbg.json +1 -1
  114. package/build/artifacts/contracts/interfaces/IPLimitRouter.sol/IPLimitRouterCallback.dbg.json +1 -1
  115. package/build/artifacts/contracts/interfaces/IPMarket.sol/IPMarket.dbg.json +1 -1
  116. package/build/artifacts/contracts/interfaces/IPMarketFactory.sol/IPMarketFactory.dbg.json +1 -1
  117. package/build/artifacts/contracts/interfaces/IPMarketSwapCallback.sol/IPMarketSwapCallback.dbg.json +1 -1
  118. package/build/artifacts/contracts/interfaces/IPMerkleDistributor.sol/IPMerkleDistributor.dbg.json +1 -1
  119. package/build/artifacts/contracts/interfaces/IPMiniDiamond.sol/IPMiniDiamond.dbg.json +1 -1
  120. package/build/artifacts/contracts/interfaces/IPMsgReceiverApp.sol/IPMsgReceiverApp.dbg.json +1 -1
  121. package/build/artifacts/contracts/interfaces/IPMsgSendEndpoint.sol/IPMsgSendEndpoint.dbg.json +1 -1
  122. package/build/artifacts/contracts/interfaces/IPMultiTokenMerkleDistributor.sol/IPMultiTokenMerkleDistributor.dbg.json +1 -1
  123. package/build/artifacts/contracts/interfaces/IPOffchainStorage.sol/IPOffchainStorage.dbg.json +1 -1
  124. package/build/artifacts/contracts/interfaces/IPOracleForSy.sol/IPOracleForSy.dbg.json +1 -1
  125. package/build/artifacts/contracts/interfaces/IPPTOFTAdapterFactory.sol/IPPTOFTAdapterFactory.dbg.json +1 -1
  126. package/build/artifacts/contracts/interfaces/IPPYLpOracle.sol/IPPYLpOracle.dbg.json +1 -1
  127. package/build/artifacts/contracts/interfaces/IPPausingInterface.sol/IPPausingInterface.dbg.json +1 -1
  128. package/build/artifacts/contracts/interfaces/IPPoolDeployHelperV2.sol/IPPoolDeployHelperV2.dbg.json +1 -1
  129. package/build/artifacts/contracts/interfaces/IPPriceFeed.sol/IPPriceFeed.dbg.json +1 -1
  130. package/build/artifacts/contracts/interfaces/IPPrincipalToken.sol/IPPrincipalToken.dbg.json +1 -1
  131. package/build/artifacts/contracts/interfaces/IPReflector.sol/IPReflector.dbg.json +1 -1
  132. package/build/artifacts/contracts/interfaces/IPRouterStatic.sol/IPRouterStatic.dbg.json +1 -1
  133. package/build/artifacts/contracts/interfaces/IPTokenWithSupplyCap.sol/IPTokenWithSupplyCap.dbg.json +1 -1
  134. package/build/artifacts/contracts/interfaces/IPVeToken.sol/IPVeToken.dbg.json +1 -1
  135. package/build/artifacts/contracts/interfaces/IPVotingController.sol/IPVotingController.dbg.json +1 -1
  136. package/build/artifacts/contracts/interfaces/IPVotingEscrowMainchain.sol/IPVotingEscrowMainchain.dbg.json +1 -1
  137. package/build/artifacts/contracts/interfaces/IPYieldContractFactory.sol/IPYieldContractFactory.dbg.json +1 -1
  138. package/build/artifacts/contracts/interfaces/IPYieldToken.sol/IPYieldToken.dbg.json +1 -1
  139. package/build/artifacts/contracts/interfaces/IPYieldTokenV2.sol/IPYieldTokenV2.dbg.json +1 -1
  140. package/build/artifacts/contracts/interfaces/IRedstonePriceFeed.sol/IRedstonePriceFeed.dbg.json +1 -1
  141. package/build/artifacts/contracts/interfaces/IRewardManager.sol/IRewardManager.dbg.json +1 -1
  142. package/build/artifacts/contracts/interfaces/IStandardizedYield.sol/IStandardizedYield.dbg.json +1 -1
  143. package/build/artifacts/contracts/interfaces/IWETH.sol/IWETH.dbg.json +1 -1
  144. package/build/artifacts/contracts/interfaces/IWstETH.sol/IWstETH.dbg.json +1 -1
  145. package/build/artifacts/contracts/limit/LimitMathCore.sol/LimitMathCore.dbg.json +1 -1
  146. package/build/artifacts/contracts/limit/LimitRouterBase.sol/LimitRouterBase.dbg.json +1 -1
  147. package/build/artifacts/contracts/limit/PendleLimitRouter.sol/PendleLimitRouter.dbg.json +1 -1
  148. package/build/artifacts/contracts/limit/PendleLimitRouter.sol/PendleLimitRouter.json +2 -2
  149. package/build/artifacts/contracts/limit/helpers/NonceManager.sol/NonceManager.dbg.json +1 -1
  150. package/build/artifacts/contracts/offchain-helpers/AddressProvider.sol/AddressProvider.dbg.json +1 -1
  151. package/build/artifacts/contracts/offchain-helpers/AutomateReady.sol/AutomateReady.dbg.json +1 -1
  152. package/build/artifacts/contracts/offchain-helpers/AutomateReady.sol/IAutomate.dbg.json +1 -1
  153. package/build/artifacts/contracts/offchain-helpers/AutomateReady.sol/IOpsProxyFactory.dbg.json +1 -1
  154. package/build/artifacts/contracts/offchain-helpers/AutomateReady.sol/ITaskTreasuryUpgradable.dbg.json +1 -1
  155. package/build/artifacts/contracts/offchain-helpers/BalanceReader.sol/BalanceReader.dbg.json +1 -1
  156. package/build/artifacts/contracts/offchain-helpers/BaseSplitCodeFactoryContract.sol/BaseSplitCodeFactoryContract.dbg.json +1 -1
  157. package/build/artifacts/contracts/offchain-helpers/Broadcaster.sol/Broadcaster.dbg.json +1 -1
  158. package/build/artifacts/contracts/offchain-helpers/BytesLib.sol/BytesLib.dbg.json +1 -1
  159. package/build/artifacts/contracts/offchain-helpers/EmptyUUPS.sol/EmptyUUPS.dbg.json +1 -1
  160. package/build/artifacts/contracts/offchain-helpers/ExpiredLpPtRedeemer.sol/ExpiredLpPtRedeemer.dbg.json +1 -1
  161. package/build/artifacts/contracts/offchain-helpers/LegacyNFTHelper.sol/LegacyNFTHelper.dbg.json +1 -1
  162. package/build/artifacts/contracts/offchain-helpers/LegacyNFTHelper.sol/StarNFTV1.dbg.json +1 -1
  163. package/build/artifacts/contracts/offchain-helpers/LimitBackendHelperV2.sol/LimitBackendHelperV2.dbg.json +1 -1
  164. package/build/artifacts/contracts/offchain-helpers/MarketSweed.sol/MarketSweed.dbg.json +1 -1
  165. package/build/artifacts/contracts/offchain-helpers/MarketSweed.sol/MarketSweed.json +2 -2
  166. package/build/artifacts/contracts/offchain-helpers/Multicall2.sol/Multicall2.dbg.json +1 -1
  167. package/build/artifacts/contracts/offchain-helpers/PendleAPIFeeDepositor.sol/PendleAPIFeeDepositor.dbg.json +4 -0
  168. package/build/artifacts/contracts/offchain-helpers/PendleAPIFeeDepositor.sol/PendleAPIFeeDepositor.json +102 -0
  169. package/build/artifacts/contracts/offchain-helpers/PendleExchangeRateOracle.sol/PendleExchangeRateOracle.dbg.json +1 -1
  170. package/build/artifacts/contracts/offchain-helpers/PendleFeeSetter.sol/PendleFeeSetter.dbg.json +1 -1
  171. package/build/artifacts/contracts/offchain-helpers/PendleGovernanceProxy.sol/PendleGovernanceProxy.dbg.json +1 -1
  172. package/build/artifacts/contracts/offchain-helpers/PendleLPWrapper.sol/PendleLPWrapper.dbg.json +1 -1
  173. package/build/artifacts/contracts/offchain-helpers/PendleLPWrapperFactory.sol/PendleLPWrapperFactory.dbg.json +1 -1
  174. package/build/artifacts/contracts/offchain-helpers/PendleMerkleDepositor.sol/PendleMerkleDepositor.dbg.json +4 -0
  175. package/build/artifacts/contracts/offchain-helpers/PendleMerkleDepositor.sol/PendleMerkleDepositor.json +102 -0
  176. package/build/artifacts/contracts/offchain-helpers/PendleMulticallOwnerV1.sol/PendleMulticallOwnerV1.dbg.json +1 -1
  177. package/build/artifacts/contracts/offchain-helpers/PendleMulticallV1.sol/PendleMulticallV1.dbg.json +1 -1
  178. package/build/artifacts/contracts/offchain-helpers/PendleMulticallV2.sol/PendleMulticallV2.dbg.json +1 -1
  179. package/build/artifacts/contracts/offchain-helpers/PendleOffchainStorage.sol/PendleOffchainStorage.dbg.json +1 -1
  180. package/build/artifacts/contracts/offchain-helpers/PendleWstETHPriceFeed.sol/PendleWstETHPriceFeed.dbg.json +1 -1
  181. package/build/artifacts/contracts/offchain-helpers/SimulateHelper.sol/SimulateHelper.dbg.json +1 -1
  182. package/build/artifacts/contracts/offchain-helpers/SupplyCapReader.sol/IPossibleSupplyCapInterface.dbg.json +1 -1
  183. package/build/artifacts/contracts/offchain-helpers/SupplyCapReader.sol/SupplyCapReader.dbg.json +1 -1
  184. package/build/artifacts/contracts/offchain-helpers/deploy/PendleCommonPoolDeployHelperV2.sol/PendleCommonPoolDeployHelperV2.dbg.json +1 -1
  185. package/build/artifacts/contracts/offchain-helpers/deploy/PendleCommonPoolDeployHelperV2.sol/PendleCommonPoolDeployHelperV2.json +2 -2
  186. package/build/artifacts/contracts/offchain-helpers/deploy/PendleCommonSYFactory.sol/PendleCommonSYFactory.dbg.json +1 -1
  187. package/build/artifacts/contracts/offchain-helpers/deploy/PendlePoolDeployHelper.sol/PendlePoolDeployHelper.dbg.json +1 -1
  188. package/build/artifacts/contracts/offchain-helpers/deploy/PendlePoolDeployHelper.sol/PendlePoolDeployHelper.json +2 -2
  189. package/build/artifacts/contracts/offchain-helpers/deploy/PendlePoolDeployHelperV2.sol/PendlePoolDeployHelperV2.dbg.json +1 -1
  190. package/build/artifacts/contracts/offchain-helpers/deploy/PendlePoolDeployHelperV2.sol/PendlePoolDeployHelperV2.json +2 -2
  191. package/build/artifacts/contracts/offchain-helpers/deploy/lib/MarketDeployLib.sol/MarketDeployLib.dbg.json +1 -1
  192. package/build/artifacts/contracts/offchain-helpers/errors/SDKErrorsDirectory.sol/SDKErrorsDirectory.dbg.json +1 -1
  193. package/build/artifacts/contracts/offchain-helpers/router-static/PendleRouterStatic.sol/PendleRouterStatic.dbg.json +1 -1
  194. package/build/artifacts/contracts/offchain-helpers/router-static/base/ActionInfoStatic.sol/ActionInfoStatic.dbg.json +1 -1
  195. package/build/artifacts/contracts/offchain-helpers/router-static/base/ActionMarketAuxStatic.sol/ActionMarketAuxStatic.dbg.json +1 -1
  196. package/build/artifacts/contracts/offchain-helpers/router-static/base/ActionMarketCoreStatic.sol/ActionMarketCoreStatic.dbg.json +1 -1
  197. package/build/artifacts/contracts/offchain-helpers/router-static/base/ActionMintRedeemStatic.sol/ActionMintRedeemStatic.dbg.json +1 -1
  198. package/build/artifacts/contracts/offchain-helpers/router-static/base/ActionStorageStatic.sol/ActionStorageStatic.dbg.json +1 -1
  199. package/build/artifacts/contracts/offchain-helpers/router-static/base/ActionVePendleStatic.sol/ActionVePendleStatic.dbg.json +1 -1
  200. package/build/artifacts/contracts/offchain-helpers/router-static/base/MarketApproxLibV1.sol/MarketApproxPtInLibV1.dbg.json +1 -1
  201. package/build/artifacts/contracts/offchain-helpers/router-static/base/MarketApproxLibV1.sol/MarketApproxPtOutLibV1.dbg.json +1 -1
  202. package/build/artifacts/contracts/offchain-helpers/router-static/base/StorageLayout.sol/StorageLayout.dbg.json +1 -1
  203. package/build/artifacts/contracts/oracles/CrossChainOracle/base/PendleCrossChainOracleBaseApp_Init.sol/PendleCrossChainOracleBaseApp_Init.dbg.json +1 -1
  204. package/build/artifacts/contracts/oracles/CrossChainOracle/exchangeRate/PendleExchangeRateOracleApp.sol/PendleExchangeRateOracleApp.dbg.json +1 -1
  205. package/build/artifacts/contracts/oracles/CrossChainOracle/exchangeRate/PendleExchangeRateOracleV2.sol/PendleExchangeRateOracleV2.dbg.json +1 -1
  206. package/build/artifacts/contracts/oracles/CrossChainOracle/libraries/ExchangeRateMsgCodec.sol/ExchangeRateMsgCodec.dbg.json +1 -1
  207. package/build/artifacts/contracts/oracles/PtYtLpOracle/PendleLpOracleLib.sol/PendleLpOracleLib.dbg.json +1 -1
  208. package/build/artifacts/contracts/oracles/PtYtLpOracle/PendlePYLpOracle.sol/PendlePYLpOracle.dbg.json +1 -1
  209. package/build/artifacts/contracts/oracles/PtYtLpOracle/PendlePYOracleLib.sol/PendlePYOracleLib.dbg.json +1 -1
  210. package/build/artifacts/contracts/oracles/PtYtLpOracle/chainlink/PendleChainlinkOracle.sol/PendleChainlinkOracle.dbg.json +1 -1
  211. package/build/artifacts/contracts/oracles/PtYtLpOracle/chainlink/PendleChainlinkOracleFactory.sol/PendleChainlinkOracleFactory.dbg.json +1 -1
  212. package/build/artifacts/contracts/oracles/PtYtLpOracle/chainlink/PendleChainlinkOracleWithQuote.sol/PendleChainlinkOracleWithQuote.dbg.json +1 -1
  213. package/build/artifacts/contracts/oracles/PtYtLpOracle/samples/BoringLpSeller.sol/BoringLpSeller.dbg.json +1 -1
  214. package/build/artifacts/contracts/oracles/PtYtLpOracle/samples/BoringPYUsdChainlinkAssetOracle.sol/BoringPYUsdChainlinkAssetOracle.dbg.json +1 -1
  215. package/build/artifacts/contracts/oracles/PtYtLpOracle/samples/BoringPYUsdChainlinkSYOracle.sol/BoringPYUsdChainlinkSYOracle.dbg.json +1 -1
  216. package/build/artifacts/contracts/oracles/PtYtLpOracle/samples/BoringPtSeller.sol/BoringPtSeller.dbg.json +1 -1
  217. package/build/artifacts/contracts/oracles/StatelessWrapper/PendleLinearDiscountOracleWrapper.sol/PendleLinearDiscountOracleWrapper.dbg.json +1 -1
  218. package/build/artifacts/contracts/oracles/StatelessWrapper/PendleSparkLinearDiscountOracleFactoryWrapper.sol/PendleSparkLinearDiscountOracleFactoryWrapper.dbg.json +1 -1
  219. package/build/artifacts/contracts/oracles/internal/PendleBoringOneracle.sol/PendleBoringOneracle.dbg.json +1 -1
  220. package/build/artifacts/contracts/oracles/internal/PendleBoringSolvBTCOneracle.sol/PendleBoringSolvBTCOneracle.dbg.json +1 -1
  221. package/build/artifacts/contracts/oracles/internal/PendleLpLinearDiscountOracle.sol/LPExpiry.dbg.json +1 -1
  222. package/build/artifacts/contracts/oracles/internal/PendleLpLinearDiscountOracle.sol/PendleLpLinearDiscountOracle.dbg.json +1 -1
  223. package/build/artifacts/contracts/oracles/internal/PendleLpLinearDiscountOracleFactory.sol/PendleLpLinearDiscountOracleFactory.dbg.json +1 -1
  224. package/build/artifacts/contracts/oracles/internal/PendleRedStoneRateOracleAdapter.sol/PendleRedStoneRateOracleAdapter.dbg.json +1 -1
  225. package/build/artifacts/contracts/oracles/internal/PendleSparkLinearDiscountOracle.sol/PTExpiry.dbg.json +1 -1
  226. package/build/artifacts/contracts/oracles/internal/PendleSparkLinearDiscountOracle.sol/PendleSparkLinearDiscountOracle.dbg.json +1 -1
  227. package/build/artifacts/contracts/oracles/internal/PendleSparkLinearDiscountOracleFactory.sol/PendleSparkLinearDiscountOracleFactory.dbg.json +1 -1
  228. package/build/artifacts/contracts/router/ActionCallbackV3.sol/ActionCallbackV3.dbg.json +1 -1
  229. package/build/artifacts/contracts/router/ActionCallbackV3.sol/ActionCallbackV3.json +2 -2
  230. package/build/artifacts/contracts/router/ActionCrossChain.sol/ActionCrossChain.dbg.json +4 -0
  231. package/build/artifacts/contracts/router/ActionCrossChain.sol/ActionCrossChain.json +99 -0
  232. package/build/artifacts/contracts/router/ActionMiscV3.sol/ActionMiscV3.dbg.json +1 -1
  233. package/build/artifacts/contracts/router/ActionMiscV3.sol/ActionMiscV3.json +2 -2
  234. package/build/artifacts/contracts/router/ActionSimple.sol/ActionSimple.dbg.json +1 -1
  235. package/build/artifacts/contracts/router/ActionSimple.sol/ActionSimple.json +2 -2
  236. package/build/artifacts/contracts/router/ActionStorageV4.sol/ActionStorageV4.dbg.json +1 -1
  237. package/build/artifacts/contracts/router/ActionSwapPTV3.sol/ActionSwapPTV3.dbg.json +1 -1
  238. package/build/artifacts/contracts/router/ActionSwapPTV3.sol/ActionSwapPTV3.json +2 -2
  239. package/build/artifacts/contracts/router/ActionSwapYTV3.sol/ActionSwapYTV3.dbg.json +1 -1
  240. package/build/artifacts/contracts/router/ActionSwapYTV3.sol/ActionSwapYTV3.json +2 -2
  241. package/build/artifacts/contracts/router/PendleRouterV4.sol/PendleRouterV4.dbg.json +1 -1
  242. package/build/artifacts/contracts/router/Reflector.sol/Reflector.dbg.json +1 -1
  243. package/build/artifacts/contracts/router/Reflector.sol/Reflector.json +2 -2
  244. package/build/artifacts/contracts/router/RouterStorage.sol/RouterStorage.dbg.json +1 -1
  245. package/build/artifacts/contracts/router/base/ActionBase.sol/ActionBase.dbg.json +1 -1
  246. package/build/artifacts/contracts/router/base/ActionDelegateBase.sol/ActionDelegateBase.dbg.json +1 -1
  247. package/build/artifacts/contracts/router/base/CallbackHelper.sol/CallbackHelper.dbg.json +1 -1
  248. package/build/artifacts/contracts/router/math/ApproxStateLib.sol/ApproxStateLib.dbg.json +1 -1
  249. package/build/artifacts/contracts/router/math/MarketApproxEstimateLib.sol/MarketApproxEstimateLib.dbg.json +1 -1
  250. package/build/artifacts/contracts/router/math/MarketApproxLibOnchain.sol/MarketApproxPtInLibOnchain.dbg.json +1 -1
  251. package/build/artifacts/contracts/router/math/MarketApproxLibOnchain.sol/MarketApproxPtOutLibOnchain.dbg.json +1 -1
  252. package/build/artifacts/contracts/router/math/MarketApproxLibV2.sol/MarketApproxPtInLibV2.dbg.json +1 -1
  253. package/build/artifacts/contracts/router/math/MarketApproxLibV2.sol/MarketApproxPtOutLibV2.dbg.json +1 -1
  254. package/build/artifacts/contracts/router/swap-aggregator/IPSwapAggregator.sol/IPSwapAggregator.dbg.json +1 -1
  255. package/build/artifacts/contracts/router/swap-aggregator/OKXScaleHelper.sol/IOKXDexRouter.dbg.json +1 -1
  256. package/build/artifacts/contracts/router/swap-aggregator/OKXScaleHelper.sol/OKXScaleHelper.dbg.json +1 -1
  257. package/build/artifacts/contracts/router/swap-aggregator/ParaswapScaleHelper.sol/IAugustusV6.dbg.json +1 -1
  258. package/build/artifacts/contracts/router/swap-aggregator/ParaswapScaleHelper.sol/ParaswapScaleHelper.dbg.json +1 -1
  259. package/build/artifacts/contracts/router/swap-aggregator/PendleSwap.sol/IKyberScalingHelper.dbg.json +1 -1
  260. package/build/artifacts/contracts/router/swap-aggregator/PendleSwap.sol/IOdosRouterV2.dbg.json +1 -1
  261. package/build/artifacts/contracts/router/swap-aggregator/PendleSwap.sol/PendleSwap.dbg.json +1 -1
  262. package/contracts/cross-chain/swap-hub/DepositBox.sol +66 -0
  263. package/contracts/cross-chain/swap-hub/PendleCrossChainSwapHub.sol +178 -0
  264. package/contracts/cross-chain/swap-hub/SwapHubBase.sol +274 -0
  265. package/contracts/interfaces/IPActionCrossChain.sol +14 -0
  266. package/contracts/interfaces/IPAllActionV3.sol +3 -1
  267. package/contracts/interfaces/IPCrossChainSwapHub.sol +147 -0
  268. package/contracts/interfaces/IPDepositBox.sol +22 -0
  269. package/contracts/offchain-helpers/PendleAPIFeeDepositor.sol +33 -0
  270. package/contracts/offchain-helpers/PendleMerkleDepositor.sol +64 -0
  271. package/contracts/router/ActionCrossChain.sol +63 -0
  272. package/deployments/1-core.json +4 -3
  273. package/deployments/10-core.json +4 -3
  274. package/deployments/146-core.json +4 -3
  275. package/deployments/42161-core.json +4 -3
  276. package/deployments/42161-offchain-helper.json +2 -1
  277. package/deployments/5000-core.json +4 -3
  278. package/deployments/56-core.json +4 -3
  279. package/deployments/80094-core.json +4 -3
  280. package/deployments/8453-core.json +4 -3
  281. package/deployments/9745-core.json +4 -3
  282. package/deployments/999-core.json +4 -3
  283. package/package.json +1 -1
  284. package/typechain-types/ActionCrossChain.ts +161 -0
  285. package/typechain-types/DepositBox.ts +260 -0
  286. package/typechain-types/IPActionCrossChain.ts +161 -0
  287. package/typechain-types/IPAllActionV3.ts +54 -0
  288. package/typechain-types/IPCrossChainSwapHub.ts +882 -0
  289. package/typechain-types/IPDepositBox.ts +213 -0
  290. package/typechain-types/PendleAPIFeeDepositor.ts +181 -0
  291. package/typechain-types/PendleCrossChainSwapHub.ts +1119 -0
  292. package/typechain-types/PendleMerkleDepositor.ts +171 -0
  293. package/typechain-types/SwapHubBase.ts +1094 -0
  294. package/typechain-types/factories/ActionCallbackV3__factory.ts +1 -1
  295. package/typechain-types/factories/ActionCrossChain__factory.ts +152 -0
  296. package/typechain-types/factories/ActionMiscV3__factory.ts +1 -1
  297. package/typechain-types/factories/ActionSimple__factory.ts +1 -1
  298. package/typechain-types/factories/ActionSwapPTV3__factory.ts +1 -1
  299. package/typechain-types/factories/ActionSwapYTV3__factory.ts +1 -1
  300. package/typechain-types/factories/DepositBox__factory.ts +222 -0
  301. package/typechain-types/factories/IPActionCrossChain__factory.ts +114 -0
  302. package/typechain-types/factories/IPAllActionV3__factory.ts +88 -0
  303. package/typechain-types/factories/IPCrossChainSwapHub__factory.ts +1041 -0
  304. package/typechain-types/factories/IPDepositBox__factory.ts +136 -0
  305. package/typechain-types/factories/MarketSweed__factory.ts +1 -1
  306. package/typechain-types/factories/PendleAPIFeeDepositor__factory.ts +164 -0
  307. package/typechain-types/factories/PendleCommonPoolDeployHelperV2__factory.ts +1 -1
  308. package/typechain-types/factories/PendleCrossChainSwapHub__factory.ts +1287 -0
  309. package/typechain-types/factories/PendleLimitRouter__factory.ts +1 -1
  310. package/typechain-types/factories/PendleMerkleDepositor__factory.ts +164 -0
  311. package/typechain-types/factories/PendlePoolDeployHelperV2__factory.ts +1 -1
  312. package/typechain-types/factories/PendlePoolDeployHelper__factory.ts +1 -1
  313. package/typechain-types/factories/Reflector__factory.ts +1 -1
  314. package/typechain-types/factories/SwapHubBase__factory.ts +1188 -0
  315. package/typechain-types/hardhat.d.ts +90 -36
  316. package/typechain-types/index.ts +18 -8
  317. package/typechain-types/ActionDelegateBase.ts +0 -57
  318. package/typechain-types/EIP712.ts +0 -135
  319. package/typechain-types/ERC20Permit.ts +0 -586
  320. package/typechain-types/IERC5267.ts +0 -135
  321. package/typechain-types/IPMarketFactoryV3.ts +0 -321
  322. package/typechain-types/IPMarketV3.ts +0 -1068
  323. package/typechain-types/LimitMathCore.ts +0 -102
  324. package/typechain-types/OverfillMathLib.ts +0 -81
  325. package/typechain-types/PendleERC20Permit.ts +0 -508
  326. package/typechain-types/PendleERC20PermitUpg.ts +0 -517
  327. package/typechain-types/PendleERC20Upg.ts +0 -348
  328. package/typechain-types/PendleMarketFactoryV3.ts +0 -719
  329. package/typechain-types/PendleMarketV3.ts +0 -1195
  330. package/typechain-types/PendleYieldContractFactory.ts +0 -801
  331. package/typechain-types/ShortStrings.ts +0 -57
  332. package/typechain-types/factories/ActionDelegateBase__factory.ts +0 -80
  333. package/typechain-types/factories/EIP712__factory.ts +0 -85
  334. package/typechain-types/factories/ERC20Permit__factory.ts +0 -433
  335. package/typechain-types/factories/IERC5267__factory.ts +0 -72
  336. package/typechain-types/factories/IPMarketFactoryV3__factory.ts +0 -217
  337. package/typechain-types/factories/IPMarketV3__factory.ts +0 -845
  338. package/typechain-types/factories/LimitMathCore__factory.ts +0 -87
  339. package/typechain-types/factories/OverfillMathLib__factory.ts +0 -77
  340. package/typechain-types/factories/PendleERC20PermitUpg__factory.ts +0 -389
  341. package/typechain-types/factories/PendleERC20Permit__factory.ts +0 -470
  342. package/typechain-types/factories/PendleERC20Upg__factory.ts +0 -261
  343. package/typechain-types/factories/PendleMarketFactoryV3__factory.ts +0 -714
  344. package/typechain-types/factories/PendleMarketV3__factory.ts +0 -1211
  345. package/typechain-types/factories/PendleYieldContractFactory__factory.ts +0 -674
  346. package/typechain-types/factories/ShortStrings__factory.ts +0 -77
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "_format": "hh-sol-dbg-1",
3
- "buildInfo": "../../../../build-info/a456d909f37f2aea7e6580dbef4247ea.json"
3
+ "buildInfo": "../../../../build-info/cd49ca587527ef369db0dc2640b32518.json"
4
4
  }
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "_format": "hh-sol-dbg-1",
3
- "buildInfo": "../../../../build-info/c1672e85858a486681abb9aef4674f52.json"
3
+ "buildInfo": "../../../../build-info/cd49ca587527ef369db0dc2640b32518.json"
4
4
  }
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "_format": "hh-sol-dbg-1",
3
- "buildInfo": "../../../../build-info/c1672e85858a486681abb9aef4674f52.json"
3
+ "buildInfo": "../../../../build-info/cd49ca587527ef369db0dc2640b32518.json"
4
4
  }
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "_format": "hh-sol-dbg-1",
3
- "buildInfo": "../../../../build-info/c1672e85858a486681abb9aef4674f52.json"
3
+ "buildInfo": "../../../../build-info/cd49ca587527ef369db0dc2640b32518.json"
4
4
  }
@@ -0,0 +1,66 @@
1
+ // SPDX-License-Identifier: GPL-3.0-or-later
2
+ pragma solidity ^0.8.30;
3
+
4
+ import {Initializable} from "@openzeppelin/contracts/proxy/utils/Initializable.sol";
5
+ import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
6
+ import {SafeERC20} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
7
+ import {Address} from "@openzeppelin/contracts/utils/Address.sol";
8
+ import {TokenHelper} from "../../core/libraries/TokenHelper.sol";
9
+ import {ApprovedCall, IPDepositBox} from "../../interfaces/IPDepositBox.sol";
10
+
11
+ contract DepositBox is IPDepositBox, TokenHelper, Initializable {
12
+ using Address for address;
13
+ using SafeERC20 for IERC20;
14
+
15
+ address public immutable MANAGER;
16
+ address public OWNER;
17
+ uint32 public BOX_ID;
18
+
19
+ constructor(address manager_) {
20
+ _disableInitializers();
21
+ MANAGER = manager_;
22
+ }
23
+
24
+ modifier onlyManager() {
25
+ require(msg.sender == MANAGER, "DepositBox: caller is not manager");
26
+ _;
27
+ }
28
+
29
+ function initialize(address owner_, uint32 boxId_) external initializer {
30
+ OWNER = owner_;
31
+ BOX_ID = boxId_;
32
+ }
33
+
34
+ function withdrawTo(address to, address token, uint256 amount) external onlyManager {
35
+ _transferOut(token, to, amount);
36
+ }
37
+
38
+ function approveAndCall(ApprovedCall memory call, address nativeRefund)
39
+ external
40
+ payable
41
+ onlyManager
42
+ returns (bytes memory result)
43
+ {
44
+ uint256 nativeAmount = call.token == NATIVE ? call.amount : 0;
45
+ uint256 nativeFee = msg.value;
46
+
47
+ uint256 initialNativeBalance = _selfBalance(NATIVE) - nativeAmount - nativeFee;
48
+
49
+ _approveForExtRouter(call.token, call.approveTo, call.amount);
50
+ result = call.callTo.functionCallWithValue(call.data, nativeAmount + nativeFee);
51
+ _approveForExtRouter(call.token, call.approveTo, 0);
52
+
53
+ uint256 finalNativeBalance = _selfBalance(NATIVE);
54
+
55
+ if (finalNativeBalance > initialNativeBalance) {
56
+ _transferOut(NATIVE, nativeRefund, finalNativeBalance - initialNativeBalance);
57
+ }
58
+ }
59
+
60
+ function _approveForExtRouter(address token, address extRouter, uint256 amount) internal {
61
+ if (token == NATIVE) return;
62
+ IERC20(token).forceApprove(extRouter, amount);
63
+ }
64
+
65
+ receive() external payable {}
66
+ }
@@ -0,0 +1,178 @@
1
+ // SPDX-License-Identifier: GPL-3.0-or-later
2
+ pragma solidity ^0.8.30;
3
+
4
+ import {
5
+ IOFT,
6
+ MessagingFee,
7
+ MessagingReceipt,
8
+ OFTReceipt,
9
+ SendParam
10
+ } from "@layerzerolabs/oft-evm/contracts/interfaces/IOFT.sol";
11
+ import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
12
+ import {ApprovedCall, IPDepositBox} from "../../interfaces/IPDepositBox.sol";
13
+ import {SwapHubBase} from "./SwapHubBase.sol";
14
+
15
+ contract PendleCrossChainSwapHub is SwapHubBase {
16
+ constructor(address treasury_, address beaconProxyCodeContract_, address depositBoxBeacon_)
17
+ SwapHubBase(treasury_, beaconProxyCodeContract_, depositBoxBeacon_)
18
+ {
19
+ _disableInitializers();
20
+ }
21
+
22
+ function initialize(address _owner) external initializer {
23
+ __EIP712_init("Pendle Cross Chain Swap Hub", "1");
24
+ __BoringOwnableV2_init(_owner);
25
+ }
26
+
27
+ function withdrawToken(WithdrawTokenMessage memory ms, bytes memory sig) external onlyExecutor {
28
+ _verifyOwnerSig(ms.owner, ms.expiry, ms.nonce, hashTypedData(ms), sig);
29
+
30
+ IPDepositBox box = _checkAndDeployBox(ms.owner, ms.boxId);
31
+ _payTreasury(box, ms.token, ms.amountFee);
32
+ _withdrawToken(ms, box);
33
+
34
+ emit WithdrawToken(ms.owner, ms.boxId, ms.token, ms.amountWithdraw, ms.amountFee);
35
+ }
36
+
37
+ function bridgeToken(BridgeTokenMessage memory ms, bytes memory sig) external payable onlyExecutor {
38
+ _verifyOwnerSig(ms.owner, ms.expiry, ms.nonce, hashTypedData(ms), sig);
39
+
40
+ IPDepositBox box = _checkAndDeployBox(ms.owner, ms.boxId);
41
+ _pullToken(ms.pullFromOwner, box, ms.owner, ms.token, ms.amountBridge + ms.amountFee);
42
+ _payTreasury(box, ms.token, ms.amountFee);
43
+ _bridgeToken(ms, box, msg.value);
44
+
45
+ emit BridgeToken(
46
+ ms.owner, ms.boxId, ms.bridgeExtRouter, ms.token, ms.amountBridge, ms.amountFee, ms.pullFromOwner
47
+ );
48
+ }
49
+
50
+ function swapToken(SwapTokenMessage memory ms, bytes memory sig) external onlyExecutor {
51
+ _verifyOwnerSig(ms.owner, ms.expiry, ms.nonce, hashTypedData(ms), sig);
52
+
53
+ IPDepositBox box = _checkAndDeployBox(ms.owner, ms.boxId);
54
+ _pullToken(ms.pullFromOwner, box, ms.owner, ms.tokenSpent, ms.amountSpent + ms.amountFee);
55
+ _payTreasury(box, ms.tokenSpent, ms.amountFee);
56
+
57
+ uint256 netTokenReceived = _swapToken(ms, box);
58
+ require(netTokenReceived >= ms.minReceived, InsufficientTokenReceived());
59
+
60
+ emit SwapToken(
61
+ ms.owner,
62
+ ms.boxId,
63
+ ms.tokenSpent,
64
+ ms.amountSpent,
65
+ ms.amountFee,
66
+ ms.tokenReceived,
67
+ netTokenReceived,
68
+ ms.pullFromOwner,
69
+ ms.sendToOwner
70
+ );
71
+ }
72
+
73
+ function buyCrossChainPt(BuyCrossChainPtMessage memory ms, bytes memory sig) external payable onlyExecutor {
74
+ _verifyOwnerSig(ms.owner, ms.expiry, ms.nonce, hashTypedData(ms), sig);
75
+
76
+ IPDepositBox box = _checkAndDeployBox(ms.owner, ms.boxId);
77
+ _pullToken(ms.pullFromOwner, box, ms.owner, ms.tokenSpent, ms.amountSpent + ms.amountFee);
78
+ _payTreasury(box, ms.tokenSpent, ms.amountFee);
79
+
80
+ address pt = IOFT(ms.ptAdapter).token();
81
+ uint256 netPtReceived = _buyPtAndBridge(ms, box, pt, msg.value, msg.sender);
82
+ require(netPtReceived >= ms.minPtReceived, InsufficientTokenReceived());
83
+
84
+ emit BuyCrossChainPt(
85
+ ms.owner,
86
+ ms.boxId,
87
+ ms.tokenSpent,
88
+ ms.amountSpent,
89
+ ms.amountFee,
90
+ ms.ptAdapter,
91
+ pt,
92
+ netPtReceived,
93
+ ms.pullFromOwner
94
+ );
95
+ }
96
+
97
+ function _pullToken(bool pullFromOwner, IPDepositBox box, address owner, address token, uint256 amount) internal {
98
+ if (pullFromOwner) {
99
+ _transferFrom(IERC20(token), owner, address(box), amount);
100
+ }
101
+ }
102
+
103
+ function _payTreasury(IPDepositBox box, address token, uint256 amount) internal {
104
+ box.withdrawTo(TREASURY, token, amount);
105
+ }
106
+
107
+ function _withdrawToken(WithdrawTokenMessage memory ms, IPDepositBox box) internal {
108
+ box.withdrawTo(ms.owner, ms.token, ms.amountWithdraw);
109
+ }
110
+
111
+ function _bridgeToken(BridgeTokenMessage memory ms, IPDepositBox box, uint256 nativeFee) internal {
112
+ ApprovedCall memory call = ApprovedCall({
113
+ token: ms.token,
114
+ amount: ms.amountBridge,
115
+ approveTo: ms.bridgeApprove,
116
+ callTo: ms.bridgeExtRouter,
117
+ data: ms.bridgeCalldata
118
+ });
119
+ box.approveAndCall{value: nativeFee}(call, msg.sender);
120
+ }
121
+
122
+ function _swapToken(SwapTokenMessage memory ms, IPDepositBox box) internal returns (uint256 rawTokenReceived) {
123
+ rawTokenReceived = _swapFromBox({
124
+ box: box,
125
+ tokenSpent: ms.tokenSpent,
126
+ amountSpent: ms.amountSpent,
127
+ tokenReceived: ms.tokenReceived,
128
+ swapExtRouter: ms.swapExtRouter,
129
+ swapApprove: ms.swapApprove,
130
+ swapCalldata: ms.swapCalldata,
131
+ receiver: ms.sendToOwner ? ms.owner : address(box)
132
+ });
133
+ }
134
+
135
+ function _buyPtAndBridge(
136
+ BuyCrossChainPtMessage memory ms,
137
+ IPDepositBox box,
138
+ address pt,
139
+ uint256 nativeFee,
140
+ address nativeRefund
141
+ ) internal returns (uint256 netPtReceived) {
142
+ require(ms.receiver == _addressToBytes32(ms.owner), InvalidReceiver());
143
+
144
+ uint256 rawPtReceived = _swapFromBox({
145
+ box: box,
146
+ tokenSpent: ms.tokenSpent,
147
+ amountSpent: ms.amountSpent,
148
+ tokenReceived: pt,
149
+ swapExtRouter: ms.swapExtRouter,
150
+ swapApprove: ms.swapApprove,
151
+ swapCalldata: ms.swapCalldata,
152
+ receiver: address(box)
153
+ });
154
+
155
+ SendParam memory sendParam = SendParam({
156
+ dstEid: ms.dstEid,
157
+ to: ms.receiver,
158
+ amountLD: rawPtReceived,
159
+ minAmountLD: 0,
160
+ extraOptions: "",
161
+ composeMsg: "",
162
+ oftCmd: ""
163
+ });
164
+ MessagingFee memory sendFee = MessagingFee({nativeFee: nativeFee, lzTokenFee: 0});
165
+ ApprovedCall memory call = ApprovedCall({
166
+ token: pt,
167
+ amount: rawPtReceived,
168
+ approveTo: ms.ptAdapter,
169
+ callTo: ms.ptAdapter,
170
+ data: abi.encodeCall(IOFT.send, (sendParam, sendFee, nativeRefund))
171
+ });
172
+ (, OFTReceipt memory oftReceipt) =
173
+ abi.decode(box.approveAndCall{value: nativeFee}(call, nativeRefund), (MessagingReceipt, OFTReceipt));
174
+ netPtReceived = oftReceipt.amountReceivedLD;
175
+ }
176
+
177
+ receive() external payable {}
178
+ }
@@ -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
  {}