@pendle/core-v2 6.3.2-swaphubtest3 → 6.3.2-swaphubtest4

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 (263) 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 +1 -1
  52. package/build/artifacts/contracts/cross-chain/swap-hub/DepositBox.sol/DepositBox.json +10 -41
  53. package/build/artifacts/contracts/cross-chain/swap-hub/PendleCrossChainSwapHub.sol/PendleCrossChainSwapHub.dbg.json +1 -1
  54. package/build/artifacts/contracts/cross-chain/swap-hub/PendleCrossChainSwapHub.sol/PendleCrossChainSwapHub.json +42 -10
  55. package/build/artifacts/contracts/cross-chain/swap-hub/SwapHubBase.sol/SwapHubBase.dbg.json +1 -1
  56. package/build/artifacts/contracts/cross-chain/swap-hub/SwapHubBase.sol/SwapHubBase.json +31 -8
  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/IPActionInfoStatic.sol/IPActionInfoStatic.dbg.json +1 -1
  68. package/build/artifacts/contracts/interfaces/IPActionMarketAuxStatic.sol/IPActionMarketAuxStatic.dbg.json +1 -1
  69. package/build/artifacts/contracts/interfaces/IPActionMarketCoreStatic.sol/IPActionMarketCoreStatic.dbg.json +1 -1
  70. package/build/artifacts/contracts/interfaces/IPActionMintRedeemStatic.sol/IPActionMintRedeemStatic.dbg.json +1 -1
  71. package/build/artifacts/contracts/interfaces/IPActionMiscV3.sol/IPActionMiscV3.dbg.json +1 -1
  72. package/build/artifacts/contracts/interfaces/IPActionSimple.sol/IPActionSimple.dbg.json +1 -1
  73. package/build/artifacts/contracts/interfaces/IPActionStorageStatic.sol/IPActionStorageStatic.dbg.json +1 -1
  74. package/build/artifacts/contracts/interfaces/IPActionStorageV4.sol/IPActionStorageV4.dbg.json +1 -1
  75. package/build/artifacts/contracts/interfaces/IPActionSwapPTV3.sol/IPActionSwapPTV3.dbg.json +1 -1
  76. package/build/artifacts/contracts/interfaces/IPActionSwapYTV3.sol/IPActionSwapYTV3.dbg.json +1 -1
  77. package/build/artifacts/contracts/interfaces/IPActionVePendleStatic.sol/IPActionVePendleStatic.dbg.json +1 -1
  78. package/build/artifacts/contracts/interfaces/IPAllActionV3.sol/IPAllActionV3.dbg.json +1 -1
  79. package/build/artifacts/contracts/interfaces/IPAllEventsV3.sol/IPActionAddRemoveLiqV3Events.dbg.json +1 -1
  80. package/build/artifacts/contracts/interfaces/IPAllEventsV3.sol/IPActionMiscV3Events.dbg.json +1 -1
  81. package/build/artifacts/contracts/interfaces/IPAllEventsV3.sol/IPActionStorageEvents.dbg.json +1 -1
  82. package/build/artifacts/contracts/interfaces/IPAllEventsV3.sol/IPActionSwapPTV3Events.dbg.json +1 -1
  83. package/build/artifacts/contracts/interfaces/IPAllEventsV3.sol/IPActionSwapYTV3Events.dbg.json +1 -1
  84. package/build/artifacts/contracts/interfaces/IPAllEventsV3.sol/IPAllEventsV3.dbg.json +1 -1
  85. package/build/artifacts/contracts/interfaces/IPBridgedPrincipalToken.sol/IPBridgedPrincipalToken.dbg.json +1 -1
  86. package/build/artifacts/contracts/interfaces/IPChainlinkOracle.sol/IPChainlinkOracle.dbg.json +1 -1
  87. package/build/artifacts/contracts/interfaces/IPChainlinkOracleEssential.sol/IPChainlinkOracleEssential.dbg.json +1 -1
  88. package/build/artifacts/contracts/interfaces/IPChainlinkOracleFactory.sol/IPChainlinkOracleFactory.dbg.json +1 -1
  89. package/build/artifacts/contracts/interfaces/IPChainlinkOracleWithQuote.sol/IPChainlinkOracleWithQuote.dbg.json +1 -1
  90. package/build/artifacts/contracts/interfaces/IPCommonPoolDeployHelperV2.sol/IPCommonPoolDeployHelperV2.dbg.json +1 -1
  91. package/build/artifacts/contracts/interfaces/IPCommonSYFactory.sol/IPCommonSYFactory.dbg.json +1 -1
  92. package/build/artifacts/contracts/interfaces/IPCrossChainSwapHub.sol/IPCrossChainSwapHub.dbg.json +1 -1
  93. package/build/artifacts/contracts/interfaces/IPCrossChainSwapHub.sol/IPCrossChainSwapHub.json +18 -8
  94. package/build/artifacts/contracts/interfaces/IPDepositBox.sol/IPDepositBox.dbg.json +1 -1
  95. package/build/artifacts/contracts/interfaces/IPDepositBox.sol/IPDepositBox.json +7 -33
  96. package/build/artifacts/contracts/interfaces/IPExchangeRateOracle.sol/IPExchangeRateOracle.dbg.json +1 -1
  97. package/build/artifacts/contracts/interfaces/IPExchangeRateOracleApp.sol/IPExchangeRateOracleApp.dbg.json +1 -1
  98. package/build/artifacts/contracts/interfaces/IPFeeDistributor.sol/IPFeeDistributor.dbg.json +1 -1
  99. package/build/artifacts/contracts/interfaces/IPFeeDistributorV2.sol/IPFeeDistributorV2.dbg.json +1 -1
  100. package/build/artifacts/contracts/interfaces/IPFixedPricePTAMM.sol/IPFixedPricePTAMM.dbg.json +1 -1
  101. package/build/artifacts/contracts/interfaces/IPFixedPricePTAMM.sol/IPFixedPricePTAMMSwapCallback.dbg.json +1 -1
  102. package/build/artifacts/contracts/interfaces/IPGauge.sol/IPGauge.dbg.json +1 -1
  103. package/build/artifacts/contracts/interfaces/IPGaugeController.sol/IPGaugeController.dbg.json +1 -1
  104. package/build/artifacts/contracts/interfaces/IPGaugeControllerMainchain.sol/IPGaugeControllerMainchain.dbg.json +1 -1
  105. package/build/artifacts/contracts/interfaces/IPGovernanceProxy.sol/IPGovernanceProxy.dbg.json +1 -1
  106. package/build/artifacts/contracts/interfaces/IPInterestManagerYT.sol/IPInterestManagerYT.dbg.json +1 -1
  107. package/build/artifacts/contracts/interfaces/IPInterestManagerYTV2.sol/IPInterestManagerYTV2.dbg.json +1 -1
  108. package/build/artifacts/contracts/interfaces/IPLPWrapperFactory.sol/IPLPWrapperFactory.dbg.json +1 -1
  109. package/build/artifacts/contracts/interfaces/IPLimitRouter.sol/IPLimitOrderType.dbg.json +1 -1
  110. package/build/artifacts/contracts/interfaces/IPLimitRouter.sol/IPLimitRouter.dbg.json +1 -1
  111. package/build/artifacts/contracts/interfaces/IPLimitRouter.sol/IPLimitRouterCallback.dbg.json +1 -1
  112. package/build/artifacts/contracts/interfaces/IPMarket.sol/IPMarket.dbg.json +1 -1
  113. package/build/artifacts/contracts/interfaces/IPMarketFactory.sol/IPMarketFactory.dbg.json +1 -1
  114. package/build/artifacts/contracts/interfaces/IPMarketSwapCallback.sol/IPMarketSwapCallback.dbg.json +1 -1
  115. package/build/artifacts/contracts/interfaces/IPMerkleDistributor.sol/IPMerkleDistributor.dbg.json +1 -1
  116. package/build/artifacts/contracts/interfaces/IPMiniDiamond.sol/IPMiniDiamond.dbg.json +1 -1
  117. package/build/artifacts/contracts/interfaces/IPMsgReceiverApp.sol/IPMsgReceiverApp.dbg.json +1 -1
  118. package/build/artifacts/contracts/interfaces/IPMsgSendEndpoint.sol/IPMsgSendEndpoint.dbg.json +1 -1
  119. package/build/artifacts/contracts/interfaces/IPMultiTokenMerkleDistributor.sol/IPMultiTokenMerkleDistributor.dbg.json +1 -1
  120. package/build/artifacts/contracts/interfaces/IPOffchainStorage.sol/IPOffchainStorage.dbg.json +1 -1
  121. package/build/artifacts/contracts/interfaces/IPOracleForSy.sol/IPOracleForSy.dbg.json +1 -1
  122. package/build/artifacts/contracts/interfaces/IPPTOFTAdapterFactory.sol/IPPTOFTAdapterFactory.dbg.json +1 -1
  123. package/build/artifacts/contracts/interfaces/IPPYLpOracle.sol/IPPYLpOracle.dbg.json +1 -1
  124. package/build/artifacts/contracts/interfaces/IPPausingInterface.sol/IPPausingInterface.dbg.json +1 -1
  125. package/build/artifacts/contracts/interfaces/IPPoolDeployHelperV2.sol/IPPoolDeployHelperV2.dbg.json +1 -1
  126. package/build/artifacts/contracts/interfaces/IPPriceFeed.sol/IPPriceFeed.dbg.json +1 -1
  127. package/build/artifacts/contracts/interfaces/IPPrincipalToken.sol/IPPrincipalToken.dbg.json +1 -1
  128. package/build/artifacts/contracts/interfaces/IPReflector.sol/IPReflector.dbg.json +1 -1
  129. package/build/artifacts/contracts/interfaces/IPRouterStatic.sol/IPRouterStatic.dbg.json +1 -1
  130. package/build/artifacts/contracts/interfaces/IPTokenWithSupplyCap.sol/IPTokenWithSupplyCap.dbg.json +1 -1
  131. package/build/artifacts/contracts/interfaces/IPVeToken.sol/IPVeToken.dbg.json +1 -1
  132. package/build/artifacts/contracts/interfaces/IPVotingController.sol/IPVotingController.dbg.json +1 -1
  133. package/build/artifacts/contracts/interfaces/IPVotingEscrowMainchain.sol/IPVotingEscrowMainchain.dbg.json +1 -1
  134. package/build/artifacts/contracts/interfaces/IPYieldContractFactory.sol/IPYieldContractFactory.dbg.json +1 -1
  135. package/build/artifacts/contracts/interfaces/IPYieldToken.sol/IPYieldToken.dbg.json +1 -1
  136. package/build/artifacts/contracts/interfaces/IPYieldTokenV2.sol/IPYieldTokenV2.dbg.json +1 -1
  137. package/build/artifacts/contracts/interfaces/IRedstonePriceFeed.sol/IRedstonePriceFeed.dbg.json +1 -1
  138. package/build/artifacts/contracts/interfaces/IRewardManager.sol/IRewardManager.dbg.json +1 -1
  139. package/build/artifacts/contracts/interfaces/IStandardizedYield.sol/IStandardizedYield.dbg.json +1 -1
  140. package/build/artifacts/contracts/interfaces/IWETH.sol/IWETH.dbg.json +1 -1
  141. package/build/artifacts/contracts/interfaces/IWstETH.sol/IWstETH.dbg.json +1 -1
  142. package/build/artifacts/contracts/limit/LimitMathCore.sol/LimitMathCore.dbg.json +1 -1
  143. package/build/artifacts/contracts/limit/LimitRouterBase.sol/LimitRouterBase.dbg.json +1 -1
  144. package/build/artifacts/contracts/limit/helpers/NonceManager.sol/NonceManager.dbg.json +1 -1
  145. package/build/artifacts/contracts/offchain-helpers/AddressProvider.sol/AddressProvider.dbg.json +1 -1
  146. package/build/artifacts/contracts/offchain-helpers/AutomateReady.sol/AutomateReady.dbg.json +1 -1
  147. package/build/artifacts/contracts/offchain-helpers/AutomateReady.sol/IAutomate.dbg.json +1 -1
  148. package/build/artifacts/contracts/offchain-helpers/AutomateReady.sol/IOpsProxyFactory.dbg.json +1 -1
  149. package/build/artifacts/contracts/offchain-helpers/AutomateReady.sol/ITaskTreasuryUpgradable.dbg.json +1 -1
  150. package/build/artifacts/contracts/offchain-helpers/BalanceReader.sol/BalanceReader.dbg.json +1 -1
  151. package/build/artifacts/contracts/offchain-helpers/BaseSplitCodeFactoryContract.sol/BaseSplitCodeFactoryContract.dbg.json +1 -1
  152. package/build/artifacts/contracts/offchain-helpers/Broadcaster.sol/Broadcaster.dbg.json +1 -1
  153. package/build/artifacts/contracts/offchain-helpers/BytesLib.sol/BytesLib.dbg.json +1 -1
  154. package/build/artifacts/contracts/offchain-helpers/EmptyUUPS.sol/EmptyUUPS.dbg.json +1 -1
  155. package/build/artifacts/contracts/offchain-helpers/ExpiredLpPtRedeemer.sol/ExpiredLpPtRedeemer.dbg.json +1 -1
  156. package/build/artifacts/contracts/offchain-helpers/LegacyNFTHelper.sol/LegacyNFTHelper.dbg.json +1 -1
  157. package/build/artifacts/contracts/offchain-helpers/LegacyNFTHelper.sol/StarNFTV1.dbg.json +1 -1
  158. package/build/artifacts/contracts/offchain-helpers/LimitBackendHelperV2.sol/LimitBackendHelperV2.dbg.json +1 -1
  159. package/build/artifacts/contracts/offchain-helpers/MarketSweed.sol/MarketSweed.dbg.json +1 -1
  160. package/build/artifacts/contracts/offchain-helpers/Multicall2.sol/Multicall2.dbg.json +1 -1
  161. package/build/artifacts/contracts/offchain-helpers/PendleExchangeRateOracle.sol/PendleExchangeRateOracle.dbg.json +1 -1
  162. package/build/artifacts/contracts/offchain-helpers/PendleFeeSetter.sol/PendleFeeSetter.dbg.json +1 -1
  163. package/build/artifacts/contracts/offchain-helpers/PendleGovernanceProxy.sol/PendleGovernanceProxy.dbg.json +1 -1
  164. package/build/artifacts/contracts/offchain-helpers/PendleLPWrapper.sol/PendleLPWrapper.dbg.json +1 -1
  165. package/build/artifacts/contracts/offchain-helpers/PendleLPWrapperFactory.sol/PendleLPWrapperFactory.dbg.json +1 -1
  166. package/build/artifacts/contracts/offchain-helpers/PendleMulticallOwnerV1.sol/PendleMulticallOwnerV1.dbg.json +1 -1
  167. package/build/artifacts/contracts/offchain-helpers/PendleMulticallV1.sol/PendleMulticallV1.dbg.json +1 -1
  168. package/build/artifacts/contracts/offchain-helpers/PendleMulticallV2.sol/PendleMulticallV2.dbg.json +1 -1
  169. package/build/artifacts/contracts/offchain-helpers/PendleOffchainStorage.sol/PendleOffchainStorage.dbg.json +1 -1
  170. package/build/artifacts/contracts/offchain-helpers/PendleWstETHPriceFeed.sol/PendleWstETHPriceFeed.dbg.json +1 -1
  171. package/build/artifacts/contracts/offchain-helpers/SimulateHelper.sol/SimulateHelper.dbg.json +1 -1
  172. package/build/artifacts/contracts/offchain-helpers/SupplyCapReader.sol/IPossibleSupplyCapInterface.dbg.json +1 -1
  173. package/build/artifacts/contracts/offchain-helpers/SupplyCapReader.sol/SupplyCapReader.dbg.json +1 -1
  174. package/build/artifacts/contracts/offchain-helpers/deploy/PendleCommonPoolDeployHelperV2.sol/PendleCommonPoolDeployHelperV2.dbg.json +1 -1
  175. package/build/artifacts/contracts/offchain-helpers/deploy/PendleCommonSYFactory.sol/PendleCommonSYFactory.dbg.json +1 -1
  176. package/build/artifacts/contracts/offchain-helpers/deploy/PendlePoolDeployHelper.sol/PendlePoolDeployHelper.dbg.json +1 -1
  177. package/build/artifacts/contracts/offchain-helpers/deploy/PendlePoolDeployHelperV2.sol/PendlePoolDeployHelperV2.dbg.json +1 -1
  178. package/build/artifacts/contracts/offchain-helpers/deploy/lib/MarketDeployLib.sol/MarketDeployLib.dbg.json +1 -1
  179. package/build/artifacts/contracts/offchain-helpers/errors/SDKErrorsDirectory.sol/SDKErrorsDirectory.dbg.json +1 -1
  180. package/build/artifacts/contracts/offchain-helpers/router-static/PendleRouterStatic.sol/PendleRouterStatic.dbg.json +1 -1
  181. package/build/artifacts/contracts/offchain-helpers/router-static/base/ActionInfoStatic.sol/ActionInfoStatic.dbg.json +1 -1
  182. package/build/artifacts/contracts/offchain-helpers/router-static/base/ActionMarketAuxStatic.sol/ActionMarketAuxStatic.dbg.json +1 -1
  183. package/build/artifacts/contracts/offchain-helpers/router-static/base/ActionMarketCoreStatic.sol/ActionMarketCoreStatic.dbg.json +1 -1
  184. package/build/artifacts/contracts/offchain-helpers/router-static/base/ActionMintRedeemStatic.sol/ActionMintRedeemStatic.dbg.json +1 -1
  185. package/build/artifacts/contracts/offchain-helpers/router-static/base/ActionStorageStatic.sol/ActionStorageStatic.dbg.json +1 -1
  186. package/build/artifacts/contracts/offchain-helpers/router-static/base/ActionVePendleStatic.sol/ActionVePendleStatic.dbg.json +1 -1
  187. package/build/artifacts/contracts/offchain-helpers/router-static/base/MarketApproxLibV1.sol/MarketApproxPtInLibV1.dbg.json +1 -1
  188. package/build/artifacts/contracts/offchain-helpers/router-static/base/MarketApproxLibV1.sol/MarketApproxPtOutLibV1.dbg.json +1 -1
  189. package/build/artifacts/contracts/offchain-helpers/router-static/base/StorageLayout.sol/StorageLayout.dbg.json +1 -1
  190. package/build/artifacts/contracts/oracles/CrossChainOracle/base/PendleCrossChainOracleBaseApp_Init.sol/PendleCrossChainOracleBaseApp_Init.dbg.json +1 -1
  191. package/build/artifacts/contracts/oracles/CrossChainOracle/exchangeRate/PendleExchangeRateOracleApp.sol/PendleExchangeRateOracleApp.dbg.json +1 -1
  192. package/build/artifacts/contracts/oracles/CrossChainOracle/exchangeRate/PendleExchangeRateOracleV2.sol/PendleExchangeRateOracleV2.dbg.json +1 -1
  193. package/build/artifacts/contracts/oracles/CrossChainOracle/libraries/ExchangeRateMsgCodec.sol/ExchangeRateMsgCodec.dbg.json +1 -1
  194. package/build/artifacts/contracts/oracles/PtYtLpOracle/PendleLpOracleLib.sol/PendleLpOracleLib.dbg.json +1 -1
  195. package/build/artifacts/contracts/oracles/PtYtLpOracle/PendlePYLpOracle.sol/PendlePYLpOracle.dbg.json +1 -1
  196. package/build/artifacts/contracts/oracles/PtYtLpOracle/PendlePYOracleLib.sol/PendlePYOracleLib.dbg.json +1 -1
  197. package/build/artifacts/contracts/oracles/PtYtLpOracle/chainlink/PendleChainlinkOracle.sol/PendleChainlinkOracle.dbg.json +1 -1
  198. package/build/artifacts/contracts/oracles/PtYtLpOracle/chainlink/PendleChainlinkOracleFactory.sol/PendleChainlinkOracleFactory.dbg.json +1 -1
  199. package/build/artifacts/contracts/oracles/PtYtLpOracle/chainlink/PendleChainlinkOracleWithQuote.sol/PendleChainlinkOracleWithQuote.dbg.json +1 -1
  200. package/build/artifacts/contracts/oracles/PtYtLpOracle/samples/BoringLpSeller.sol/BoringLpSeller.dbg.json +1 -1
  201. package/build/artifacts/contracts/oracles/PtYtLpOracle/samples/BoringPYUsdChainlinkAssetOracle.sol/BoringPYUsdChainlinkAssetOracle.dbg.json +1 -1
  202. package/build/artifacts/contracts/oracles/PtYtLpOracle/samples/BoringPYUsdChainlinkSYOracle.sol/BoringPYUsdChainlinkSYOracle.dbg.json +1 -1
  203. package/build/artifacts/contracts/oracles/PtYtLpOracle/samples/BoringPtSeller.sol/BoringPtSeller.dbg.json +1 -1
  204. package/build/artifacts/contracts/oracles/StatelessWrapper/PendleLinearDiscountOracleWrapper.sol/PendleLinearDiscountOracleWrapper.dbg.json +1 -1
  205. package/build/artifacts/contracts/oracles/StatelessWrapper/PendleSparkLinearDiscountOracleFactoryWrapper.sol/PendleSparkLinearDiscountOracleFactoryWrapper.dbg.json +1 -1
  206. package/build/artifacts/contracts/oracles/internal/PendleBoringOneracle.sol/PendleBoringOneracle.dbg.json +1 -1
  207. package/build/artifacts/contracts/oracles/internal/PendleBoringSolvBTCOneracle.sol/PendleBoringSolvBTCOneracle.dbg.json +1 -1
  208. package/build/artifacts/contracts/oracles/internal/PendleLpLinearDiscountOracle.sol/LPExpiry.dbg.json +1 -1
  209. package/build/artifacts/contracts/oracles/internal/PendleLpLinearDiscountOracle.sol/PendleLpLinearDiscountOracle.dbg.json +1 -1
  210. package/build/artifacts/contracts/oracles/internal/PendleLpLinearDiscountOracleFactory.sol/PendleLpLinearDiscountOracleFactory.dbg.json +1 -1
  211. package/build/artifacts/contracts/oracles/internal/PendleRedStoneRateOracleAdapter.sol/PendleRedStoneRateOracleAdapter.dbg.json +1 -1
  212. package/build/artifacts/contracts/oracles/internal/PendleSparkLinearDiscountOracle.sol/PTExpiry.dbg.json +1 -1
  213. package/build/artifacts/contracts/oracles/internal/PendleSparkLinearDiscountOracle.sol/PendleSparkLinearDiscountOracle.dbg.json +1 -1
  214. package/build/artifacts/contracts/oracles/internal/PendleSparkLinearDiscountOracleFactory.sol/PendleSparkLinearDiscountOracleFactory.dbg.json +1 -1
  215. package/build/artifacts/contracts/router/ActionStorageV4.sol/ActionStorageV4.dbg.json +1 -1
  216. package/build/artifacts/contracts/router/PendleRouterV4.sol/PendleRouterV4.dbg.json +1 -1
  217. package/build/artifacts/contracts/router/Reflector.sol/Reflector.dbg.json +1 -1
  218. package/build/artifacts/contracts/router/RouterStorage.sol/RouterStorage.dbg.json +1 -1
  219. package/build/artifacts/contracts/router/base/ActionBase.sol/ActionBase.dbg.json +1 -1
  220. package/build/artifacts/contracts/router/base/ActionDelegateBase.sol/ActionDelegateBase.dbg.json +1 -1
  221. package/build/artifacts/contracts/router/base/CallbackHelper.sol/CallbackHelper.dbg.json +1 -1
  222. package/build/artifacts/contracts/router/math/ApproxStateLib.sol/ApproxStateLib.dbg.json +1 -1
  223. package/build/artifacts/contracts/router/math/MarketApproxEstimateLib.sol/MarketApproxEstimateLib.dbg.json +1 -1
  224. package/build/artifacts/contracts/router/math/MarketApproxLibOnchain.sol/MarketApproxPtInLibOnchain.dbg.json +1 -1
  225. package/build/artifacts/contracts/router/math/MarketApproxLibOnchain.sol/MarketApproxPtOutLibOnchain.dbg.json +1 -1
  226. package/build/artifacts/contracts/router/math/MarketApproxLibV2.sol/MarketApproxPtInLibV2.dbg.json +1 -1
  227. package/build/artifacts/contracts/router/math/MarketApproxLibV2.sol/MarketApproxPtOutLibV2.dbg.json +1 -1
  228. package/build/artifacts/contracts/router/swap-aggregator/IPSwapAggregator.sol/IPSwapAggregator.dbg.json +1 -1
  229. package/build/artifacts/contracts/router/swap-aggregator/OKXScaleHelper.sol/IOKXDexRouter.dbg.json +1 -1
  230. package/build/artifacts/contracts/router/swap-aggregator/OKXScaleHelper.sol/OKXScaleHelper.dbg.json +1 -1
  231. package/build/artifacts/contracts/router/swap-aggregator/ParaswapScaleHelper.sol/IAugustusV6.dbg.json +1 -1
  232. package/build/artifacts/contracts/router/swap-aggregator/ParaswapScaleHelper.sol/ParaswapScaleHelper.dbg.json +1 -1
  233. package/build/artifacts/contracts/router/swap-aggregator/PendleSwap.sol/IKyberScalingHelper.dbg.json +1 -1
  234. package/build/artifacts/contracts/router/swap-aggregator/PendleSwap.sol/IOdosRouterV2.dbg.json +1 -1
  235. package/build/artifacts/contracts/router/swap-aggregator/PendleSwap.sol/PendleSwap.dbg.json +1 -1
  236. package/contracts/cross-chain/swap-hub/DepositBox.sol +11 -17
  237. package/contracts/cross-chain/swap-hub/PendleCrossChainSwapHub.sol +36 -33
  238. package/contracts/cross-chain/swap-hub/SwapHubBase.sol +37 -26
  239. package/contracts/interfaces/IPCrossChainSwapHub.sol +3 -2
  240. package/contracts/interfaces/IPDepositBox.sol +3 -6
  241. package/package.json +1 -1
  242. package/typechain-types/DepositBox.ts +20 -64
  243. package/typechain-types/IPCrossChainSwapHub.ts +13 -10
  244. package/typechain-types/IPDepositBox.ts +20 -64
  245. package/typechain-types/PendleCrossChainSwapHub.ts +26 -10
  246. package/typechain-types/SwapHubBase.ts +26 -10
  247. package/typechain-types/factories/DepositBox__factory.ts +13 -50
  248. package/typechain-types/factories/IPCrossChainSwapHub__factory.ts +18 -8
  249. package/typechain-types/factories/IPDepositBox__factory.ts +7 -33
  250. package/typechain-types/factories/PendleCrossChainSwapHub__factory.ts +45 -9
  251. package/typechain-types/factories/SwapHubBase__factory.ts +31 -8
  252. package/typechain-types/hardhat.d.ts +0 -18
  253. package/typechain-types/index.ts +0 -4
  254. package/build/artifacts/contracts/cross-chain/swap-hub/swap/IPSwapExecutor.sol/IPSwapExecutor.dbg.json +0 -4
  255. package/build/artifacts/contracts/cross-chain/swap-hub/swap/IPSwapExecutor.sol/IPSwapExecutor.json +0 -56
  256. package/build/artifacts/contracts/cross-chain/swap-hub/swap/SwapExecutor.sol/SwapExecutor.dbg.json +0 -4
  257. package/build/artifacts/contracts/cross-chain/swap-hub/swap/SwapExecutor.sol/SwapExecutor.json +0 -60
  258. package/contracts/cross-chain/swap-hub/swap/IPSwapExecutor.sol +0 -14
  259. package/contracts/cross-chain/swap-hub/swap/SwapExecutor.sol +0 -28
  260. package/typechain-types/IPSwapExecutor.ts +0 -129
  261. package/typechain-types/SwapExecutor.ts +0 -129
  262. package/typechain-types/factories/IPSwapExecutor__factory.ts +0 -71
  263. package/typechain-types/factories/SwapExecutor__factory.ts +0 -110
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "_format": "hh-sol-dbg-1",
3
- "buildInfo": "../../../build-info/66e0858ea21b3c1487f6bd95dbfa6609.json"
3
+ "buildInfo": "../../../build-info/949599013beec0a4878ddcdc09f27bb0.json"
4
4
  }
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "_format": "hh-sol-dbg-1",
3
- "buildInfo": "../../../build-info/66e0858ea21b3c1487f6bd95dbfa6609.json"
3
+ "buildInfo": "../../../build-info/949599013beec0a4878ddcdc09f27bb0.json"
4
4
  }
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "_format": "hh-sol-dbg-1",
3
- "buildInfo": "../../../build-info/66e0858ea21b3c1487f6bd95dbfa6609.json"
3
+ "buildInfo": "../../../build-info/949599013beec0a4878ddcdc09f27bb0.json"
4
4
  }
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "_format": "hh-sol-dbg-1",
3
- "buildInfo": "../../../build-info/66e0858ea21b3c1487f6bd95dbfa6609.json"
3
+ "buildInfo": "../../../build-info/949599013beec0a4878ddcdc09f27bb0.json"
4
4
  }
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "_format": "hh-sol-dbg-1",
3
- "buildInfo": "../../../../build-info/66e0858ea21b3c1487f6bd95dbfa6609.json"
3
+ "buildInfo": "../../../../build-info/949599013beec0a4878ddcdc09f27bb0.json"
4
4
  }
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "_format": "hh-sol-dbg-1",
3
- "buildInfo": "../../../../build-info/66e0858ea21b3c1487f6bd95dbfa6609.json"
3
+ "buildInfo": "../../../../build-info/949599013beec0a4878ddcdc09f27bb0.json"
4
4
  }
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "_format": "hh-sol-dbg-1",
3
- "buildInfo": "../../../../build-info/66e0858ea21b3c1487f6bd95dbfa6609.json"
3
+ "buildInfo": "../../../../build-info/949599013beec0a4878ddcdc09f27bb0.json"
4
4
  }
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "_format": "hh-sol-dbg-1",
3
- "buildInfo": "../../../../build-info/66e0858ea21b3c1487f6bd95dbfa6609.json"
3
+ "buildInfo": "../../../../build-info/949599013beec0a4878ddcdc09f27bb0.json"
4
4
  }
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "_format": "hh-sol-dbg-1",
3
- "buildInfo": "../../../../build-info/66e0858ea21b3c1487f6bd95dbfa6609.json"
3
+ "buildInfo": "../../../../build-info/949599013beec0a4878ddcdc09f27bb0.json"
4
4
  }
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "_format": "hh-sol-dbg-1",
3
- "buildInfo": "../../../../build-info/66e0858ea21b3c1487f6bd95dbfa6609.json"
3
+ "buildInfo": "../../../../build-info/949599013beec0a4878ddcdc09f27bb0.json"
4
4
  }
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "_format": "hh-sol-dbg-1",
3
- "buildInfo": "../../../../build-info/66e0858ea21b3c1487f6bd95dbfa6609.json"
3
+ "buildInfo": "../../../../build-info/949599013beec0a4878ddcdc09f27bb0.json"
4
4
  }
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "_format": "hh-sol-dbg-1",
3
- "buildInfo": "../../../../build-info/66e0858ea21b3c1487f6bd95dbfa6609.json"
3
+ "buildInfo": "../../../../build-info/949599013beec0a4878ddcdc09f27bb0.json"
4
4
  }
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "_format": "hh-sol-dbg-1",
3
- "buildInfo": "../../../../build-info/66e0858ea21b3c1487f6bd95dbfa6609.json"
3
+ "buildInfo": "../../../../build-info/949599013beec0a4878ddcdc09f27bb0.json"
4
4
  }
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "_format": "hh-sol-dbg-1",
3
- "buildInfo": "../../../../build-info/66e0858ea21b3c1487f6bd95dbfa6609.json"
3
+ "buildInfo": "../../../../build-info/949599013beec0a4878ddcdc09f27bb0.json"
4
4
  }
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "_format": "hh-sol-dbg-1",
3
- "buildInfo": "../../../../build-info/66e0858ea21b3c1487f6bd95dbfa6609.json"
3
+ "buildInfo": "../../../../build-info/949599013beec0a4878ddcdc09f27bb0.json"
4
4
  }
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "_format": "hh-sol-dbg-1",
3
- "buildInfo": "../../../../build-info/66e0858ea21b3c1487f6bd95dbfa6609.json"
3
+ "buildInfo": "../../../../build-info/949599013beec0a4878ddcdc09f27bb0.json"
4
4
  }
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "_format": "hh-sol-dbg-1",
3
- "buildInfo": "../../../../build-info/66e0858ea21b3c1487f6bd95dbfa6609.json"
3
+ "buildInfo": "../../../../build-info/949599013beec0a4878ddcdc09f27bb0.json"
4
4
  }
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "_format": "hh-sol-dbg-1",
3
- "buildInfo": "../../../../build-info/66e0858ea21b3c1487f6bd95dbfa6609.json"
3
+ "buildInfo": "../../../../build-info/949599013beec0a4878ddcdc09f27bb0.json"
4
4
  }
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "_format": "hh-sol-dbg-1",
3
- "buildInfo": "../../../../build-info/66e0858ea21b3c1487f6bd95dbfa6609.json"
3
+ "buildInfo": "../../../../build-info/949599013beec0a4878ddcdc09f27bb0.json"
4
4
  }
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "_format": "hh-sol-dbg-1",
3
- "buildInfo": "../../../../build-info/66e0858ea21b3c1487f6bd95dbfa6609.json"
3
+ "buildInfo": "../../../../build-info/949599013beec0a4878ddcdc09f27bb0.json"
4
4
  }
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "_format": "hh-sol-dbg-1",
3
- "buildInfo": "../../../../build-info/66e0858ea21b3c1487f6bd95dbfa6609.json"
3
+ "buildInfo": "../../../../build-info/949599013beec0a4878ddcdc09f27bb0.json"
4
4
  }
@@ -12,39 +12,33 @@ contract DepositBox is IPDepositBox, TokenHelper, Initializable {
12
12
  using Address for address;
13
13
  using SafeERC20 for IERC20;
14
14
 
15
- address public immutable HUB;
16
- address public immutable TREASURY;
15
+ address public immutable MANAGER;
17
16
  address public OWNER;
18
17
  uint32 public BOX_ID;
19
18
 
20
- constructor(address hub_, address treasury_) {
19
+ constructor(address manager_) {
21
20
  _disableInitializers();
22
- HUB = hub_;
23
- TREASURY = treasury_;
21
+ MANAGER = manager_;
24
22
  }
25
23
 
26
- modifier onlyHub() {
27
- require(msg.sender == HUB, "DepositBox: caller is not hub");
24
+ modifier onlyManager() {
25
+ require(msg.sender == MANAGER, "DepositBox: caller is not manager");
28
26
  _;
29
27
  }
30
28
 
31
- function initialize(address owner_, uint32 boxId_) external initializer onlyHub {
29
+ function initialize(address owner_, uint32 boxId_) external initializer {
32
30
  OWNER = owner_;
33
31
  BOX_ID = boxId_;
34
32
  }
35
33
 
36
- function payTreasury(address token, uint256 amount) external onlyHub {
37
- _transferOut(token, TREASURY, amount);
38
- }
39
-
40
- function withdrawTo(address to, address token, uint256 amount) external onlyHub {
34
+ function withdrawTo(address to, address token, uint256 amount) external onlyManager {
41
35
  _transferOut(token, to, amount);
42
36
  }
43
37
 
44
38
  function approveAndCall(ApprovedCall memory call, address nativeRefund)
45
39
  external
46
40
  payable
47
- onlyHub
41
+ onlyManager
48
42
  returns (bytes memory result)
49
43
  {
50
44
  uint256 nativeAmount = call.token == NATIVE ? call.amount : 0;
@@ -52,9 +46,9 @@ contract DepositBox is IPDepositBox, TokenHelper, Initializable {
52
46
 
53
47
  uint256 initialNativeBalance = _selfBalance(NATIVE) - nativeAmount - nativeFee;
54
48
 
55
- _approveForExtRouter(call.token, call.spender, call.amount);
56
- result = call.spender.functionCallWithValue(call.data, nativeAmount + nativeFee);
57
- _approveForExtRouter(call.token, call.spender, 0);
49
+ _approveForExtRouter(call.token, call.approveTo, call.amount);
50
+ result = call.callTo.functionCallWithValue(call.data, nativeAmount + nativeFee);
51
+ _approveForExtRouter(call.token, call.approveTo, 0);
58
52
 
59
53
  uint256 finalNativeBalance = _selfBalance(NATIVE);
60
54
 
@@ -10,12 +10,11 @@ import {
10
10
  } from "@layerzerolabs/oft-evm/contracts/interfaces/IOFT.sol";
11
11
  import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
12
12
  import {ApprovedCall, IPDepositBox} from "../../interfaces/IPDepositBox.sol";
13
- import {SwapData} from "./swap/IPSwapExecutor.sol";
14
13
  import {SwapHubBase} from "./SwapHubBase.sol";
15
14
 
16
15
  contract PendleCrossChainSwapHub is SwapHubBase {
17
- constructor(address beaconProxyCodeContract_, address depositBoxBeacon_)
18
- SwapHubBase(beaconProxyCodeContract_, depositBoxBeacon_)
16
+ constructor(address treasury_, address beaconProxyCodeContract_, address depositBoxBeacon_)
17
+ SwapHubBase(treasury_, beaconProxyCodeContract_, depositBoxBeacon_)
19
18
  {
20
19
  _disableInitializers();
21
20
  }
@@ -79,7 +78,7 @@ contract PendleCrossChainSwapHub is SwapHubBase {
79
78
  _payTreasury(box, ms.tokenSpent, ms.amountFee);
80
79
 
81
80
  address pt = IOFT(ms.ptAdapter).token();
82
- uint256 netPtReceived = _buyPtAndBridge(ms, box, pt, msg.value);
81
+ uint256 netPtReceived = _buyPtAndBridge(ms, box, pt, msg.value, msg.sender);
83
82
  require(netPtReceived >= ms.minPtReceived, InsufficientTokenReceived());
84
83
 
85
84
  emit BuyCrossChainPt(
@@ -102,7 +101,7 @@ contract PendleCrossChainSwapHub is SwapHubBase {
102
101
  }
103
102
 
104
103
  function _payTreasury(IPDepositBox box, address token, uint256 amount) internal {
105
- box.payTreasury(token, amount);
104
+ box.withdrawTo(TREASURY, token, amount);
106
105
  }
107
106
 
108
107
  function _withdrawToken(WithdrawTokenMessage memory ms, IPDepositBox box) internal {
@@ -110,43 +109,48 @@ contract PendleCrossChainSwapHub is SwapHubBase {
110
109
  }
111
110
 
112
111
  function _bridgeToken(BridgeTokenMessage memory ms, IPDepositBox box, uint256 nativeFee) internal {
113
- // forgefmt: disable-next-item
114
112
  ApprovedCall memory call = ApprovedCall({
115
113
  token: ms.token,
116
114
  amount: ms.amountBridge,
117
- spender: ms.bridgeExtRouter,
115
+ approveTo: ms.bridgeApprove,
116
+ callTo: ms.bridgeExtRouter,
118
117
  data: ms.bridgeCalldata
119
118
  });
120
119
  box.approveAndCall{value: nativeFee}(call, msg.sender);
121
120
  }
122
121
 
123
122
  function _swapToken(SwapTokenMessage memory ms, IPDepositBox box) internal returns (uint256 rawTokenReceived) {
124
- SwapData memory swapData = SwapData({
125
- tokenIn: ms.tokenSpent,
126
- amountIn: ms.amountSpent,
127
- tokenOut: ms.tokenReceived,
128
- extRouter: ms.swapExtRouter,
129
- extCalldata: ms.swapCalldata
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)
130
132
  });
131
-
132
- address receiver = ms.sendToOwner ? ms.owner : address(box);
133
- rawTokenReceived = _swapFromBox(box, ms.swapExecutor, swapData, receiver);
134
133
  }
135
134
 
136
- function _buyPtAndBridge(BuyCrossChainPtMessage memory ms, IPDepositBox box, address pt, uint256 nativeFee)
137
- internal
138
- returns (uint256 netPtReceived)
139
- {
135
+ function _buyPtAndBridge(
136
+ BuyCrossChainPtMessage memory ms,
137
+ IPDepositBox box,
138
+ address pt,
139
+ uint256 nativeFee,
140
+ address nativeRefund
141
+ ) internal returns (uint256 netPtReceived) {
140
142
  require(ms.receiver == _addressToBytes32(ms.owner), InvalidReceiver());
141
143
 
142
- SwapData memory swapData = SwapData({
143
- tokenIn: ms.tokenSpent,
144
- amountIn: ms.amountSpent,
145
- tokenOut: pt,
146
- extRouter: ms.swapExtRouter,
147
- extCalldata: ms.swapCalldata
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)
148
153
  });
149
- uint256 rawPtReceived = _swapFromBox(box, ms.swapExecutor, swapData, address(box));
150
154
 
151
155
  SendParam memory sendParam = SendParam({
152
156
  dstEid: ms.dstEid,
@@ -161,15 +165,14 @@ contract PendleCrossChainSwapHub is SwapHubBase {
161
165
  ApprovedCall memory call = ApprovedCall({
162
166
  token: pt,
163
167
  amount: rawPtReceived,
164
- spender: ms.ptAdapter,
165
- data: abi.encodeCall(IOFT.send, (sendParam, sendFee, msg.sender))
168
+ approveTo: ms.ptAdapter,
169
+ callTo: ms.ptAdapter,
170
+ data: abi.encodeCall(IOFT.send, (sendParam, sendFee, nativeRefund))
166
171
  });
167
172
  (, OFTReceipt memory oftReceipt) =
168
- abi.decode(box.approveAndCall{value: nativeFee}(call, msg.sender), (MessagingReceipt, OFTReceipt));
173
+ abi.decode(box.approveAndCall{value: nativeFee}(call, nativeRefund), (MessagingReceipt, OFTReceipt));
169
174
  netPtReceived = oftReceipt.amountReceivedLD;
170
175
  }
171
176
 
172
- function _addressToBytes32(address addr) internal pure returns (bytes32) {
173
- return bytes32(uint256(uint160(addr)));
174
- }
177
+ receive() external payable {}
175
178
  }
@@ -8,8 +8,7 @@ import {EIP712Upgradeable} from "@openzeppelin/contracts-upgradeable/utils/crypt
8
8
  import {BoringOwnableUpgradeableV2} from "../../core/libraries/BoringOwnableUpgradeableV2.sol";
9
9
  import {TokenHelper} from "../../core/libraries/TokenHelper.sol";
10
10
  import {IPCrossChainSwapHub} from "../../interfaces/IPCrossChainSwapHub.sol";
11
- import {IPDepositBox} from "../../interfaces/IPDepositBox.sol";
12
- import {IPSwapExecutor, SwapData} from "./swap/IPSwapExecutor.sol";
11
+ import {ApprovedCall, IPDepositBox} from "../../interfaces/IPDepositBox.sol";
13
12
  import {DepositBox} from "./DepositBox.sol";
14
13
 
15
14
  abstract contract SwapHubBase is IPCrossChainSwapHub, EIP712Upgradeable, BoringOwnableUpgradeableV2, TokenHelper {
@@ -41,6 +40,7 @@ abstract contract SwapHubBase is IPCrossChainSwapHub, EIP712Upgradeable, BoringO
41
40
  "bool pullFromOwner,"
42
41
  //
43
42
  "address bridgeExtRouter,"
43
+ "address bridgeApprove,"
44
44
  "bytes bridgeCalldata"
45
45
  ")"
46
46
  );
@@ -61,8 +61,8 @@ abstract contract SwapHubBase is IPCrossChainSwapHub, EIP712Upgradeable, BoringO
61
61
  "bool pullFromOwner,"
62
62
  "bool sendToOwner,"
63
63
  //
64
- "address swapExecutor,"
65
64
  "address swapExtRouter,"
65
+ "address swapApprove,"
66
66
  "bytes swapCalldata"
67
67
  ")"
68
68
  );
@@ -84,12 +84,14 @@ abstract contract SwapHubBase is IPCrossChainSwapHub, EIP712Upgradeable, BoringO
84
84
  "bytes32 receiver,"
85
85
  "bool pullFromOwner,"
86
86
  //
87
- "address swapExecutor,"
88
87
  "address swapExtRouter,"
88
+ "address swapApprove,"
89
89
  "bytes swapCalldata"
90
90
  ")"
91
91
  );
92
92
 
93
+ address public immutable TREASURY;
94
+
93
95
  /// @dev creation code of OpenZeppelin's BeaconProxy
94
96
  address public immutable BEACON_PROXY_CODE_CONTRACT;
95
97
  address public immutable DEPOSIT_BOX_BEACON;
@@ -98,7 +100,8 @@ abstract contract SwapHubBase is IPCrossChainSwapHub, EIP712Upgradeable, BoringO
98
100
  mapping(address owner => uint256 nonce) public ownerNonce;
99
101
  mapping(address executor => bool) public isExecutor;
100
102
 
101
- constructor(address beaconProxyCodeContract_, address depositBoxBeacon_) {
103
+ constructor(address treasury_, address beaconProxyCodeContract_, address depositBoxBeacon_) {
104
+ TREASURY = treasury_;
102
105
  BEACON_PROXY_CODE_CONTRACT = beaconProxyCodeContract_;
103
106
  DEPOSIT_BOX_BEACON = depositBoxBeacon_;
104
107
  DEPOSIT_BOX_CODE_HASH =
@@ -171,6 +174,7 @@ abstract contract SwapHubBase is IPCrossChainSwapHub, EIP712Upgradeable, BoringO
171
174
  message.pullFromOwner,
172
175
  //
173
176
  message.bridgeExtRouter,
177
+ message.bridgeApprove,
174
178
  keccak256(message.bridgeCalldata)
175
179
  )
176
180
  )
@@ -195,8 +199,8 @@ abstract contract SwapHubBase is IPCrossChainSwapHub, EIP712Upgradeable, BoringO
195
199
  message.pullFromOwner,
196
200
  message.sendToOwner,
197
201
  //
198
- message.swapExecutor,
199
202
  message.swapExtRouter,
203
+ message.swapApprove,
200
204
  keccak256(message.swapCalldata)
201
205
  )
202
206
  )
@@ -222,8 +226,8 @@ abstract contract SwapHubBase is IPCrossChainSwapHub, EIP712Upgradeable, BoringO
222
226
  message.receiver,
223
227
  message.pullFromOwner,
224
228
  //
225
- message.swapExecutor,
226
229
  message.swapExtRouter,
230
+ message.swapApprove,
227
231
  keccak256(message.swapCalldata)
228
232
  )
229
233
  )
@@ -233,32 +237,39 @@ abstract contract SwapHubBase is IPCrossChainSwapHub, EIP712Upgradeable, BoringO
233
237
  function _verifyOwnerSig(address owner, uint256 expiry, uint256 nonce, bytes32 messageHash, bytes memory signature)
234
238
  internal
235
239
  {
236
- _verifyOwnerSig(owner, expiry, messageHash, signature);
237
- _verifyAndIncreaseNonce(owner, nonce);
238
- }
239
-
240
- function _verifyOwnerSig(address owner, uint256 expiry, bytes32 messageHash, bytes memory signature) internal view {
241
240
  require(SignatureChecker.isValidSignatureNow(owner, messageHash, signature), InvalidSignature());
242
241
  require(expiry > block.timestamp, MessageExpired());
243
- }
244
-
245
- function _verifyAndIncreaseNonce(address owner, uint256 nonce) internal {
246
242
  require(ownerNonce[owner] < nonce, InvalidNonce());
247
243
  ownerNonce[owner] = nonce;
248
244
  }
249
245
 
250
- function _balanceOf(address addr, address token) internal view returns (uint256) {
251
- return (token == NATIVE) ? addr.balance : IERC20(token).balanceOf(addr);
252
- }
246
+ function _swapFromBox(
247
+ IPDepositBox box,
248
+ address tokenSpent,
249
+ uint256 amountSpent,
250
+ address tokenReceived,
251
+ address swapExtRouter,
252
+ address swapApprove,
253
+ bytes memory swapCalldata,
254
+ address receiver
255
+ ) internal returns (uint256 rawTokenReceived) {
256
+ // forgefmt: disable-next-item
257
+ ApprovedCall memory call = ApprovedCall({
258
+ token: tokenSpent,
259
+ amount: amountSpent,
260
+ approveTo: swapApprove,
261
+ callTo: swapExtRouter,
262
+ data: swapCalldata
263
+ });
253
264
 
254
- function _swapFromBox(IPDepositBox box, address swapExecutor, SwapData memory swapData, address receiver)
255
- internal
256
- returns (uint256 rawTokenOut)
257
- {
258
- box.withdrawTo(swapExecutor, swapData.tokenIn, swapData.amountIn);
265
+ uint256 preBalance = _selfBalance(tokenReceived);
266
+ box.approveAndCall(call, address(box));
267
+ rawTokenReceived = _selfBalance(tokenReceived) - preBalance;
268
+
269
+ _transferOut(tokenReceived, receiver, rawTokenReceived);
270
+ }
259
271
 
260
- uint256 preBalance = _balanceOf(receiver, swapData.tokenOut);
261
- IPSwapExecutor(swapExecutor).swap(receiver, swapData);
262
- rawTokenOut = _balanceOf(receiver, swapData.tokenOut) - preBalance;
272
+ function _addressToBytes32(address addr) internal pure returns (bytes32) {
273
+ return bytes32(uint256(uint160(addr)));
263
274
  }
264
275
  }
@@ -31,6 +31,7 @@ interface IPCrossChainSwapHub {
31
31
  bool pullFromOwner;
32
32
  //
33
33
  address bridgeExtRouter;
34
+ address bridgeApprove;
34
35
  bytes bridgeCalldata;
35
36
  }
36
37
 
@@ -48,8 +49,8 @@ interface IPCrossChainSwapHub {
48
49
  bool pullFromOwner;
49
50
  bool sendToOwner;
50
51
  //
51
- address swapExecutor;
52
52
  address swapExtRouter;
53
+ address swapApprove;
53
54
  bytes swapCalldata;
54
55
  }
55
56
 
@@ -68,8 +69,8 @@ interface IPCrossChainSwapHub {
68
69
  bytes32 receiver;
69
70
  bool pullFromOwner;
70
71
  //
71
- address swapExecutor;
72
72
  address swapExtRouter;
73
+ address swapApprove;
73
74
  bytes swapCalldata;
74
75
  }
75
76
 
@@ -4,21 +4,18 @@ pragma solidity ^0.8.0;
4
4
  struct ApprovedCall {
5
5
  address token;
6
6
  uint256 amount;
7
- address spender;
7
+ address approveTo;
8
+ address callTo;
8
9
  bytes data;
9
10
  }
10
11
 
11
12
  interface IPDepositBox {
12
- function HUB() external view returns (address);
13
-
14
- function TREASURY() external view returns (address);
13
+ function MANAGER() external view returns (address);
15
14
 
16
15
  function OWNER() external view returns (address);
17
16
 
18
17
  function BOX_ID() external view returns (uint32);
19
18
 
20
- function payTreasury(address token, uint256 amount) external;
21
-
22
19
  function withdrawTo(address to, address token, uint256 amount) external;
23
20
 
24
21
  function approveAndCall(ApprovedCall memory call, address nativeRefund) external payable returns (bytes memory);
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@pendle/core-v2",
3
3
  "description": "Core smart contracts of Pendle Protocol.",
4
4
  "license": "BUSL-1.1",
5
- "version": "6.3.2-swaphubtest3",
5
+ "version": "6.3.2-swaphubtest4",
6
6
  "homepage": "https://pendle.finance",
7
7
  "keywords": [
8
8
  "pendle",