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

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 (248) 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/PendleCrossChainSwapHub.sol/PendleCrossChainSwapHub.dbg.json +1 -1
  53. package/build/artifacts/contracts/cross-chain/swap-hub/PendleCrossChainSwapHub.sol/PendleCrossChainSwapHub.json +157 -494
  54. package/build/artifacts/contracts/cross-chain/swap-hub/SwapHubBase.sol/SwapHubBase.dbg.json +1 -1
  55. package/build/artifacts/contracts/cross-chain/swap-hub/SwapHubBase.sol/SwapHubBase.json +155 -492
  56. package/build/artifacts/contracts/cross-chain/swap-hub/swap/IPSwapExecutor.sol/IPSwapExecutor.dbg.json +1 -1
  57. package/build/artifacts/contracts/cross-chain/swap-hub/swap/SwapExecutor.sol/SwapExecutor.dbg.json +1 -1
  58. package/build/artifacts/contracts/cross-chain/swap-hub/swap/SwapExecutor.sol/SwapExecutor.json +2 -2
  59. package/build/artifacts/contracts/deprecated/VeDistributor/PendleFeeDistributor.sol/PendleFeeDistributor.dbg.json +1 -1
  60. package/build/artifacts/contracts/deprecated/VeDistributor/PendleFeeDistributorV2.sol/PendleFeeDistributorV2.dbg.json +1 -1
  61. package/build/artifacts/contracts/interfaces/IAddressProvider.sol/IAddressProvider.dbg.json +1 -1
  62. package/build/artifacts/contracts/interfaces/ILPWrapper.sol/ILPWrapper.dbg.json +1 -1
  63. package/build/artifacts/contracts/interfaces/ILayerZeroEndpoint.sol/ILayerZeroEndpoint.dbg.json +1 -1
  64. package/build/artifacts/contracts/interfaces/ILayerZeroReceiver.sol/ILayerZeroReceiver.dbg.json +1 -1
  65. package/build/artifacts/contracts/interfaces/IMarketSweed.sol/IMarketSweed.dbg.json +1 -1
  66. package/build/artifacts/contracts/interfaces/IOwnable.sol/IOwnable.dbg.json +1 -1
  67. package/build/artifacts/contracts/interfaces/IPActionAddRemoveLiqV3.sol/IPActionAddRemoveLiqV3.dbg.json +1 -1
  68. package/build/artifacts/contracts/interfaces/IPActionCallbackV3.sol/IPActionCallbackV3.dbg.json +1 -1
  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/IPAllEventsV3.sol/IPActionAddRemoveLiqV3Events.dbg.json +1 -1
  82. package/build/artifacts/contracts/interfaces/IPAllEventsV3.sol/IPActionMiscV3Events.dbg.json +1 -1
  83. package/build/artifacts/contracts/interfaces/IPAllEventsV3.sol/IPActionStorageEvents.dbg.json +1 -1
  84. package/build/artifacts/contracts/interfaces/IPAllEventsV3.sol/IPActionSwapPTV3Events.dbg.json +1 -1
  85. package/build/artifacts/contracts/interfaces/IPAllEventsV3.sol/IPActionSwapYTV3Events.dbg.json +1 -1
  86. package/build/artifacts/contracts/interfaces/IPAllEventsV3.sol/IPAllEventsV3.dbg.json +1 -1
  87. package/build/artifacts/contracts/interfaces/IPBridgedPrincipalToken.sol/IPBridgedPrincipalToken.dbg.json +1 -1
  88. package/build/artifacts/contracts/interfaces/IPChainlinkOracle.sol/IPChainlinkOracle.dbg.json +1 -1
  89. package/build/artifacts/contracts/interfaces/IPChainlinkOracleEssential.sol/IPChainlinkOracleEssential.dbg.json +1 -1
  90. package/build/artifacts/contracts/interfaces/IPChainlinkOracleFactory.sol/IPChainlinkOracleFactory.dbg.json +1 -1
  91. package/build/artifacts/contracts/interfaces/IPChainlinkOracleWithQuote.sol/IPChainlinkOracleWithQuote.dbg.json +1 -1
  92. package/build/artifacts/contracts/interfaces/IPCommonPoolDeployHelperV2.sol/IPCommonPoolDeployHelperV2.dbg.json +1 -1
  93. package/build/artifacts/contracts/interfaces/IPCommonSYFactory.sol/IPCommonSYFactory.dbg.json +1 -1
  94. package/build/artifacts/contracts/interfaces/IPCrossChainSwapHub.sol/IPCrossChainSwapHub.dbg.json +1 -1
  95. package/build/artifacts/contracts/interfaces/IPCrossChainSwapHub.sol/IPCrossChainSwapHub.json +84 -421
  96. package/build/artifacts/contracts/interfaces/IPDepositBox.sol/IPDepositBox.dbg.json +1 -1
  97. package/build/artifacts/contracts/interfaces/IPExchangeRateOracle.sol/IPExchangeRateOracle.dbg.json +1 -1
  98. package/build/artifacts/contracts/interfaces/IPExchangeRateOracleApp.sol/IPExchangeRateOracleApp.dbg.json +1 -1
  99. package/build/artifacts/contracts/interfaces/IPFeeDistributor.sol/IPFeeDistributor.dbg.json +1 -1
  100. package/build/artifacts/contracts/interfaces/IPFeeDistributorV2.sol/IPFeeDistributorV2.dbg.json +1 -1
  101. package/build/artifacts/contracts/interfaces/IPFixedPricePTAMM.sol/IPFixedPricePTAMM.dbg.json +1 -1
  102. package/build/artifacts/contracts/interfaces/IPFixedPricePTAMM.sol/IPFixedPricePTAMMSwapCallback.dbg.json +1 -1
  103. package/build/artifacts/contracts/interfaces/IPGauge.sol/IPGauge.dbg.json +1 -1
  104. package/build/artifacts/contracts/interfaces/IPGaugeController.sol/IPGaugeController.dbg.json +1 -1
  105. package/build/artifacts/contracts/interfaces/IPGaugeControllerMainchain.sol/IPGaugeControllerMainchain.dbg.json +1 -1
  106. package/build/artifacts/contracts/interfaces/IPGovernanceProxy.sol/IPGovernanceProxy.dbg.json +1 -1
  107. package/build/artifacts/contracts/interfaces/IPInterestManagerYT.sol/IPInterestManagerYT.dbg.json +1 -1
  108. package/build/artifacts/contracts/interfaces/IPInterestManagerYTV2.sol/IPInterestManagerYTV2.dbg.json +1 -1
  109. package/build/artifacts/contracts/interfaces/IPLPWrapperFactory.sol/IPLPWrapperFactory.dbg.json +1 -1
  110. package/build/artifacts/contracts/interfaces/IPLimitRouter.sol/IPLimitOrderType.dbg.json +1 -1
  111. package/build/artifacts/contracts/interfaces/IPLimitRouter.sol/IPLimitRouter.dbg.json +1 -1
  112. package/build/artifacts/contracts/interfaces/IPLimitRouter.sol/IPLimitRouterCallback.dbg.json +1 -1
  113. package/build/artifacts/contracts/interfaces/IPMarket.sol/IPMarket.dbg.json +1 -1
  114. package/build/artifacts/contracts/interfaces/IPMarketFactory.sol/IPMarketFactory.dbg.json +1 -1
  115. package/build/artifacts/contracts/interfaces/IPMarketSwapCallback.sol/IPMarketSwapCallback.dbg.json +1 -1
  116. package/build/artifacts/contracts/interfaces/IPMerkleDistributor.sol/IPMerkleDistributor.dbg.json +1 -1
  117. package/build/artifacts/contracts/interfaces/IPMiniDiamond.sol/IPMiniDiamond.dbg.json +1 -1
  118. package/build/artifacts/contracts/interfaces/IPMsgReceiverApp.sol/IPMsgReceiverApp.dbg.json +1 -1
  119. package/build/artifacts/contracts/interfaces/IPMsgSendEndpoint.sol/IPMsgSendEndpoint.dbg.json +1 -1
  120. package/build/artifacts/contracts/interfaces/IPMultiTokenMerkleDistributor.sol/IPMultiTokenMerkleDistributor.dbg.json +1 -1
  121. package/build/artifacts/contracts/interfaces/IPOffchainStorage.sol/IPOffchainStorage.dbg.json +1 -1
  122. package/build/artifacts/contracts/interfaces/IPOracleForSy.sol/IPOracleForSy.dbg.json +1 -1
  123. package/build/artifacts/contracts/interfaces/IPPTOFTAdapterFactory.sol/IPPTOFTAdapterFactory.dbg.json +1 -1
  124. package/build/artifacts/contracts/interfaces/IPPYLpOracle.sol/IPPYLpOracle.dbg.json +1 -1
  125. package/build/artifacts/contracts/interfaces/IPPausingInterface.sol/IPPausingInterface.dbg.json +1 -1
  126. package/build/artifacts/contracts/interfaces/IPPoolDeployHelperV2.sol/IPPoolDeployHelperV2.dbg.json +1 -1
  127. package/build/artifacts/contracts/interfaces/IPPriceFeed.sol/IPPriceFeed.dbg.json +1 -1
  128. package/build/artifacts/contracts/interfaces/IPPrincipalToken.sol/IPPrincipalToken.dbg.json +1 -1
  129. package/build/artifacts/contracts/interfaces/IPReflector.sol/IPReflector.dbg.json +1 -1
  130. package/build/artifacts/contracts/interfaces/IPRouterStatic.sol/IPRouterStatic.dbg.json +1 -1
  131. package/build/artifacts/contracts/interfaces/IPTokenWithSupplyCap.sol/IPTokenWithSupplyCap.dbg.json +1 -1
  132. package/build/artifacts/contracts/interfaces/IPVeToken.sol/IPVeToken.dbg.json +1 -1
  133. package/build/artifacts/contracts/interfaces/IPVotingController.sol/IPVotingController.dbg.json +1 -1
  134. package/build/artifacts/contracts/interfaces/IPVotingEscrowMainchain.sol/IPVotingEscrowMainchain.dbg.json +1 -1
  135. package/build/artifacts/contracts/interfaces/IPYieldContractFactory.sol/IPYieldContractFactory.dbg.json +1 -1
  136. package/build/artifacts/contracts/interfaces/IPYieldToken.sol/IPYieldToken.dbg.json +1 -1
  137. package/build/artifacts/contracts/interfaces/IPYieldTokenV2.sol/IPYieldTokenV2.dbg.json +1 -1
  138. package/build/artifacts/contracts/interfaces/IRedstonePriceFeed.sol/IRedstonePriceFeed.dbg.json +1 -1
  139. package/build/artifacts/contracts/interfaces/IRewardManager.sol/IRewardManager.dbg.json +1 -1
  140. package/build/artifacts/contracts/interfaces/IStandardizedYield.sol/IStandardizedYield.dbg.json +1 -1
  141. package/build/artifacts/contracts/interfaces/IWETH.sol/IWETH.dbg.json +1 -1
  142. package/build/artifacts/contracts/interfaces/IWstETH.sol/IWstETH.dbg.json +1 -1
  143. package/build/artifacts/contracts/limit/LimitMathCore.sol/LimitMathCore.dbg.json +1 -1
  144. package/build/artifacts/contracts/limit/LimitRouterBase.sol/LimitRouterBase.dbg.json +1 -1
  145. package/build/artifacts/contracts/limit/helpers/NonceManager.sol/NonceManager.dbg.json +1 -1
  146. package/build/artifacts/contracts/offchain-helpers/AddressProvider.sol/AddressProvider.dbg.json +1 -1
  147. package/build/artifacts/contracts/offchain-helpers/AutomateReady.sol/AutomateReady.dbg.json +1 -1
  148. package/build/artifacts/contracts/offchain-helpers/AutomateReady.sol/IAutomate.dbg.json +1 -1
  149. package/build/artifacts/contracts/offchain-helpers/AutomateReady.sol/IOpsProxyFactory.dbg.json +1 -1
  150. package/build/artifacts/contracts/offchain-helpers/AutomateReady.sol/ITaskTreasuryUpgradable.dbg.json +1 -1
  151. package/build/artifacts/contracts/offchain-helpers/BalanceReader.sol/BalanceReader.dbg.json +1 -1
  152. package/build/artifacts/contracts/offchain-helpers/BaseSplitCodeFactoryContract.sol/BaseSplitCodeFactoryContract.dbg.json +1 -1
  153. package/build/artifacts/contracts/offchain-helpers/Broadcaster.sol/Broadcaster.dbg.json +1 -1
  154. package/build/artifacts/contracts/offchain-helpers/BytesLib.sol/BytesLib.dbg.json +1 -1
  155. package/build/artifacts/contracts/offchain-helpers/EmptyUUPS.sol/EmptyUUPS.dbg.json +1 -1
  156. package/build/artifacts/contracts/offchain-helpers/ExpiredLpPtRedeemer.sol/ExpiredLpPtRedeemer.dbg.json +1 -1
  157. package/build/artifacts/contracts/offchain-helpers/LegacyNFTHelper.sol/LegacyNFTHelper.dbg.json +1 -1
  158. package/build/artifacts/contracts/offchain-helpers/LegacyNFTHelper.sol/StarNFTV1.dbg.json +1 -1
  159. package/build/artifacts/contracts/offchain-helpers/LimitBackendHelperV2.sol/LimitBackendHelperV2.dbg.json +1 -1
  160. package/build/artifacts/contracts/offchain-helpers/MarketSweed.sol/MarketSweed.dbg.json +1 -1
  161. package/build/artifacts/contracts/offchain-helpers/Multicall2.sol/Multicall2.dbg.json +1 -1
  162. package/build/artifacts/contracts/offchain-helpers/PendleExchangeRateOracle.sol/PendleExchangeRateOracle.dbg.json +1 -1
  163. package/build/artifacts/contracts/offchain-helpers/PendleFeeSetter.sol/PendleFeeSetter.dbg.json +1 -1
  164. package/build/artifacts/contracts/offchain-helpers/PendleGovernanceProxy.sol/PendleGovernanceProxy.dbg.json +1 -1
  165. package/build/artifacts/contracts/offchain-helpers/PendleLPWrapper.sol/PendleLPWrapper.dbg.json +1 -1
  166. package/build/artifacts/contracts/offchain-helpers/PendleLPWrapperFactory.sol/PendleLPWrapperFactory.dbg.json +1 -1
  167. package/build/artifacts/contracts/offchain-helpers/PendleMulticallOwnerV1.sol/PendleMulticallOwnerV1.dbg.json +1 -1
  168. package/build/artifacts/contracts/offchain-helpers/PendleMulticallV1.sol/PendleMulticallV1.dbg.json +1 -1
  169. package/build/artifacts/contracts/offchain-helpers/PendleMulticallV2.sol/PendleMulticallV2.dbg.json +1 -1
  170. package/build/artifacts/contracts/offchain-helpers/PendleOffchainStorage.sol/PendleOffchainStorage.dbg.json +1 -1
  171. package/build/artifacts/contracts/offchain-helpers/PendleWstETHPriceFeed.sol/PendleWstETHPriceFeed.dbg.json +1 -1
  172. package/build/artifacts/contracts/offchain-helpers/SimulateHelper.sol/SimulateHelper.dbg.json +1 -1
  173. package/build/artifacts/contracts/offchain-helpers/SupplyCapReader.sol/IPossibleSupplyCapInterface.dbg.json +1 -1
  174. package/build/artifacts/contracts/offchain-helpers/SupplyCapReader.sol/SupplyCapReader.dbg.json +1 -1
  175. package/build/artifacts/contracts/offchain-helpers/deploy/PendleCommonPoolDeployHelperV2.sol/PendleCommonPoolDeployHelperV2.dbg.json +1 -1
  176. package/build/artifacts/contracts/offchain-helpers/deploy/PendleCommonSYFactory.sol/PendleCommonSYFactory.dbg.json +1 -1
  177. package/build/artifacts/contracts/offchain-helpers/deploy/PendlePoolDeployHelper.sol/PendlePoolDeployHelper.dbg.json +1 -1
  178. package/build/artifacts/contracts/offchain-helpers/deploy/PendlePoolDeployHelperV2.sol/PendlePoolDeployHelperV2.dbg.json +1 -1
  179. package/build/artifacts/contracts/offchain-helpers/deploy/lib/MarketDeployLib.sol/MarketDeployLib.dbg.json +1 -1
  180. package/build/artifacts/contracts/offchain-helpers/errors/SDKErrorsDirectory.sol/SDKErrorsDirectory.dbg.json +1 -1
  181. package/build/artifacts/contracts/offchain-helpers/router-static/PendleRouterStatic.sol/PendleRouterStatic.dbg.json +1 -1
  182. package/build/artifacts/contracts/offchain-helpers/router-static/base/ActionInfoStatic.sol/ActionInfoStatic.dbg.json +1 -1
  183. package/build/artifacts/contracts/offchain-helpers/router-static/base/ActionMarketAuxStatic.sol/ActionMarketAuxStatic.dbg.json +1 -1
  184. package/build/artifacts/contracts/offchain-helpers/router-static/base/ActionMarketCoreStatic.sol/ActionMarketCoreStatic.dbg.json +1 -1
  185. package/build/artifacts/contracts/offchain-helpers/router-static/base/ActionMintRedeemStatic.sol/ActionMintRedeemStatic.dbg.json +1 -1
  186. package/build/artifacts/contracts/offchain-helpers/router-static/base/ActionStorageStatic.sol/ActionStorageStatic.dbg.json +1 -1
  187. package/build/artifacts/contracts/offchain-helpers/router-static/base/ActionVePendleStatic.sol/ActionVePendleStatic.dbg.json +1 -1
  188. package/build/artifacts/contracts/offchain-helpers/router-static/base/MarketApproxLibV1.sol/MarketApproxPtInLibV1.dbg.json +1 -1
  189. package/build/artifacts/contracts/offchain-helpers/router-static/base/MarketApproxLibV1.sol/MarketApproxPtOutLibV1.dbg.json +1 -1
  190. package/build/artifacts/contracts/offchain-helpers/router-static/base/StorageLayout.sol/StorageLayout.dbg.json +1 -1
  191. package/build/artifacts/contracts/oracles/CrossChainOracle/base/PendleCrossChainOracleBaseApp_Init.sol/PendleCrossChainOracleBaseApp_Init.dbg.json +1 -1
  192. package/build/artifacts/contracts/oracles/CrossChainOracle/exchangeRate/PendleExchangeRateOracleApp.sol/PendleExchangeRateOracleApp.dbg.json +1 -1
  193. package/build/artifacts/contracts/oracles/CrossChainOracle/exchangeRate/PendleExchangeRateOracleV2.sol/PendleExchangeRateOracleV2.dbg.json +1 -1
  194. package/build/artifacts/contracts/oracles/CrossChainOracle/libraries/ExchangeRateMsgCodec.sol/ExchangeRateMsgCodec.dbg.json +1 -1
  195. package/build/artifacts/contracts/oracles/PtYtLpOracle/PendleLpOracleLib.sol/PendleLpOracleLib.dbg.json +1 -1
  196. package/build/artifacts/contracts/oracles/PtYtLpOracle/PendlePYLpOracle.sol/PendlePYLpOracle.dbg.json +1 -1
  197. package/build/artifacts/contracts/oracles/PtYtLpOracle/PendlePYOracleLib.sol/PendlePYOracleLib.dbg.json +1 -1
  198. package/build/artifacts/contracts/oracles/PtYtLpOracle/chainlink/PendleChainlinkOracle.sol/PendleChainlinkOracle.dbg.json +1 -1
  199. package/build/artifacts/contracts/oracles/PtYtLpOracle/chainlink/PendleChainlinkOracleFactory.sol/PendleChainlinkOracleFactory.dbg.json +1 -1
  200. package/build/artifacts/contracts/oracles/PtYtLpOracle/chainlink/PendleChainlinkOracleWithQuote.sol/PendleChainlinkOracleWithQuote.dbg.json +1 -1
  201. package/build/artifacts/contracts/oracles/PtYtLpOracle/samples/BoringLpSeller.sol/BoringLpSeller.dbg.json +1 -1
  202. package/build/artifacts/contracts/oracles/PtYtLpOracle/samples/BoringPYUsdChainlinkAssetOracle.sol/BoringPYUsdChainlinkAssetOracle.dbg.json +1 -1
  203. package/build/artifacts/contracts/oracles/PtYtLpOracle/samples/BoringPYUsdChainlinkSYOracle.sol/BoringPYUsdChainlinkSYOracle.dbg.json +1 -1
  204. package/build/artifacts/contracts/oracles/PtYtLpOracle/samples/BoringPtSeller.sol/BoringPtSeller.dbg.json +1 -1
  205. package/build/artifacts/contracts/oracles/StatelessWrapper/PendleLinearDiscountOracleWrapper.sol/PendleLinearDiscountOracleWrapper.dbg.json +1 -1
  206. package/build/artifacts/contracts/oracles/StatelessWrapper/PendleSparkLinearDiscountOracleFactoryWrapper.sol/PendleSparkLinearDiscountOracleFactoryWrapper.dbg.json +1 -1
  207. package/build/artifacts/contracts/oracles/internal/PendleBoringOneracle.sol/PendleBoringOneracle.dbg.json +1 -1
  208. package/build/artifacts/contracts/oracles/internal/PendleBoringSolvBTCOneracle.sol/PendleBoringSolvBTCOneracle.dbg.json +1 -1
  209. package/build/artifacts/contracts/oracles/internal/PendleLpLinearDiscountOracle.sol/LPExpiry.dbg.json +1 -1
  210. package/build/artifacts/contracts/oracles/internal/PendleLpLinearDiscountOracle.sol/PendleLpLinearDiscountOracle.dbg.json +1 -1
  211. package/build/artifacts/contracts/oracles/internal/PendleLpLinearDiscountOracleFactory.sol/PendleLpLinearDiscountOracleFactory.dbg.json +1 -1
  212. package/build/artifacts/contracts/oracles/internal/PendleRedStoneRateOracleAdapter.sol/PendleRedStoneRateOracleAdapter.dbg.json +1 -1
  213. package/build/artifacts/contracts/oracles/internal/PendleSparkLinearDiscountOracle.sol/PTExpiry.dbg.json +1 -1
  214. package/build/artifacts/contracts/oracles/internal/PendleSparkLinearDiscountOracle.sol/PendleSparkLinearDiscountOracle.dbg.json +1 -1
  215. package/build/artifacts/contracts/oracles/internal/PendleSparkLinearDiscountOracleFactory.sol/PendleSparkLinearDiscountOracleFactory.dbg.json +1 -1
  216. package/build/artifacts/contracts/router/ActionStorageV4.sol/ActionStorageV4.dbg.json +1 -1
  217. package/build/artifacts/contracts/router/PendleRouterV4.sol/PendleRouterV4.dbg.json +1 -1
  218. package/build/artifacts/contracts/router/Reflector.sol/Reflector.dbg.json +1 -1
  219. package/build/artifacts/contracts/router/RouterStorage.sol/RouterStorage.dbg.json +1 -1
  220. package/build/artifacts/contracts/router/base/ActionBase.sol/ActionBase.dbg.json +1 -1
  221. package/build/artifacts/contracts/router/base/ActionDelegateBase.sol/ActionDelegateBase.dbg.json +1 -1
  222. package/build/artifacts/contracts/router/base/CallbackHelper.sol/CallbackHelper.dbg.json +1 -1
  223. package/build/artifacts/contracts/router/math/ApproxStateLib.sol/ApproxStateLib.dbg.json +1 -1
  224. package/build/artifacts/contracts/router/math/MarketApproxEstimateLib.sol/MarketApproxEstimateLib.dbg.json +1 -1
  225. package/build/artifacts/contracts/router/math/MarketApproxLibOnchain.sol/MarketApproxPtInLibOnchain.dbg.json +1 -1
  226. package/build/artifacts/contracts/router/math/MarketApproxLibOnchain.sol/MarketApproxPtOutLibOnchain.dbg.json +1 -1
  227. package/build/artifacts/contracts/router/math/MarketApproxLibV2.sol/MarketApproxPtInLibV2.dbg.json +1 -1
  228. package/build/artifacts/contracts/router/math/MarketApproxLibV2.sol/MarketApproxPtOutLibV2.dbg.json +1 -1
  229. package/build/artifacts/contracts/router/swap-aggregator/IPSwapAggregator.sol/IPSwapAggregator.dbg.json +1 -1
  230. package/build/artifacts/contracts/router/swap-aggregator/OKXScaleHelper.sol/IOKXDexRouter.dbg.json +1 -1
  231. package/build/artifacts/contracts/router/swap-aggregator/OKXScaleHelper.sol/OKXScaleHelper.dbg.json +1 -1
  232. package/build/artifacts/contracts/router/swap-aggregator/ParaswapScaleHelper.sol/IAugustusV6.dbg.json +1 -1
  233. package/build/artifacts/contracts/router/swap-aggregator/ParaswapScaleHelper.sol/ParaswapScaleHelper.dbg.json +1 -1
  234. package/build/artifacts/contracts/router/swap-aggregator/PendleSwap.sol/IKyberScalingHelper.dbg.json +1 -1
  235. package/build/artifacts/contracts/router/swap-aggregator/PendleSwap.sol/IOdosRouterV2.dbg.json +1 -1
  236. package/build/artifacts/contracts/router/swap-aggregator/PendleSwap.sol/PendleSwap.dbg.json +1 -1
  237. package/contracts/cross-chain/swap-hub/PendleCrossChainSwapHub.sol +70 -101
  238. package/contracts/cross-chain/swap-hub/SwapHubBase.sol +20 -29
  239. package/contracts/cross-chain/swap-hub/swap/SwapExecutor.sol +2 -7
  240. package/contracts/interfaces/IPCrossChainSwapHub.sol +17 -39
  241. package/package.json +1 -1
  242. package/typechain-types/IPCrossChainSwapHub.ts +138 -302
  243. package/typechain-types/PendleCrossChainSwapHub.ts +138 -302
  244. package/typechain-types/SwapHubBase.ts +138 -302
  245. package/typechain-types/factories/IPCrossChainSwapHub__factory.ts +84 -421
  246. package/typechain-types/factories/PendleCrossChainSwapHub__factory.ts +156 -493
  247. package/typechain-types/factories/SwapExecutor__factory.ts +1 -1
  248. package/typechain-types/factories/SwapHubBase__factory.ts +155 -492
@@ -8,6 +8,7 @@ import {
8
8
  OFTReceipt,
9
9
  SendParam
10
10
  } from "@layerzerolabs/oft-evm/contracts/interfaces/IOFT.sol";
11
+ import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
11
12
  import {ApprovedCall, IPDepositBox} from "../../interfaces/IPDepositBox.sol";
12
13
  import {SwapData} from "./swap/IPSwapExecutor.sol";
13
14
  import {SwapHubBase} from "./SwapHubBase.sol";
@@ -25,127 +26,87 @@ contract PendleCrossChainSwapHub is SwapHubBase {
25
26
  }
26
27
 
27
28
  function withdrawToken(WithdrawTokenMessage memory ms, bytes memory sig) external onlyExecutor {
28
- _handleWithdrawToken({ms: ms, sig: sig, claimFailed: false});
29
- }
30
-
31
- function bridgeToken(BridgeTokenMessage memory ms, bytes memory sig) external payable onlyExecutor {
32
- _handleBridgeToken({ms: ms, sig: sig, claimFailed: false});
33
- }
34
-
35
- function swapToken(SwapTokenMessage memory ms, bytes memory sig) external onlyExecutor {
36
- _handleSwapToken({ms: ms, sig: sig, claimFailed: false});
37
- }
38
-
39
- function buyCrossChainPt(BuyCrossChainPtMessage memory ms, bytes memory sig) external payable onlyExecutor {
40
- _handleBuyCrossChainPt({ms: ms, sig: sig, claimFailed: false});
41
- }
42
-
43
- function claimFee(WithdrawTokenMessage memory ms, bytes memory sig) external onlyExecutor {
44
- _handleWithdrawToken({ms: ms, sig: sig, claimFailed: true});
45
- }
29
+ _verifyOwnerSig(ms.owner, ms.expiry, ms.nonce, hashTypedData(ms), sig);
46
30
 
47
- function claimFee(BridgeTokenMessage memory ms, bytes memory sig) external onlyExecutor {
48
- _handleBridgeToken({ms: ms, sig: sig, claimFailed: true});
49
- }
50
-
51
- function claimFee(SwapTokenMessage memory ms, bytes memory sig) external onlyExecutor {
52
- _handleSwapToken({ms: ms, sig: sig, claimFailed: true});
53
- }
31
+ IPDepositBox box = _checkAndDeployBox(ms.owner, ms.boxId);
32
+ _payTreasury(box, ms.token, ms.amountFee);
33
+ _withdrawToken(ms, box);
54
34
 
55
- function claimFee(BuyCrossChainPtMessage memory ms, bytes memory sig) external onlyExecutor {
56
- _handleBuyCrossChainPt({ms: ms, sig: sig, claimFailed: true});
35
+ emit WithdrawToken(ms.owner, ms.boxId, ms.token, ms.amountWithdraw, ms.amountFee);
57
36
  }
58
37
 
59
- function _handleWithdrawToken(WithdrawTokenMessage memory ms, bytes memory sig, bool claimFailed) internal {
60
- bytes32 actionHash = hashTypedData(ms);
61
- _verifyOwnerSig(ms.owner, ms.expiry, ms.nonce, actionHash, sig, !claimFailed);
38
+ function bridgeToken(BridgeTokenMessage memory ms, bytes memory sig) external payable onlyExecutor {
39
+ _verifyOwnerSig(ms.owner, ms.expiry, ms.nonce, hashTypedData(ms), sig);
62
40
 
63
41
  IPDepositBox box = _checkAndDeployBox(ms.owner, ms.boxId);
42
+ _pullToken(ms.pullFromOwner, box, ms.owner, ms.token, ms.amountBridge + ms.amountFee);
43
+ _payTreasury(box, ms.token, ms.amountFee);
44
+ _bridgeToken(ms, box, msg.value);
64
45
 
65
- if (claimFailed) {
66
- _markFailedAndTakeFee(actionHash, box, ms.token, ms.amountFee);
67
- emit ClaimFeeForFailedAction(ms.owner, ms.boxId, actionHash, ms.token, ms.amountFee);
68
- } else {
69
- box.withdrawTo(ms.receiver, ms.token, ms.amountWithdraw);
70
-
71
- _markSucceededAndTakeFee(actionHash, box, ms.token, ms.amountFee);
72
- emit WithdrawToken(ms.owner, ms.boxId, actionHash, ms.receiver, ms.token, ms.amountWithdraw, ms.amountFee);
73
- }
46
+ emit BridgeToken(
47
+ ms.owner, ms.boxId, ms.bridgeExtRouter, ms.token, ms.amountBridge, ms.amountFee, ms.pullFromOwner
48
+ );
74
49
  }
75
50
 
76
- function _handleBridgeToken(BridgeTokenMessage memory ms, bytes memory sig, bool claimFailed) internal {
77
- bytes32 actionHash = hashTypedData(ms);
78
- _verifyOwnerSig(ms.owner, ms.expiry, ms.nonce, actionHash, sig, !claimFailed);
51
+ function swapToken(SwapTokenMessage memory ms, bytes memory sig) external onlyExecutor {
52
+ _verifyOwnerSig(ms.owner, ms.expiry, ms.nonce, hashTypedData(ms), sig);
79
53
 
80
54
  IPDepositBox box = _checkAndDeployBox(ms.owner, ms.boxId);
55
+ _pullToken(ms.pullFromOwner, box, ms.owner, ms.tokenSpent, ms.amountSpent + ms.amountFee);
56
+ _payTreasury(box, ms.tokenSpent, ms.amountFee);
81
57
 
82
- if (claimFailed) {
83
- _markFailedAndTakeFee(actionHash, box, ms.token, ms.amountFee);
84
- emit ClaimFeeForFailedAction(ms.owner, ms.boxId, actionHash, ms.token, ms.amountFee);
85
- } else {
86
- _bridgeToken(ms, box, msg.value);
58
+ uint256 netTokenReceived = _swapToken(ms, box);
59
+ require(netTokenReceived >= ms.minReceived, InsufficientTokenReceived());
87
60
 
88
- _markSucceededAndTakeFee(actionHash, box, ms.token, ms.amountFee);
89
- emit BridgeToken(
90
- ms.owner, ms.boxId, actionHash, ms.bridgeExtRouter, ms.token, ms.amountBridge, ms.amountFee
91
- );
92
- }
61
+ emit SwapToken(
62
+ ms.owner,
63
+ ms.boxId,
64
+ ms.tokenSpent,
65
+ ms.amountSpent,
66
+ ms.amountFee,
67
+ ms.tokenReceived,
68
+ netTokenReceived,
69
+ ms.pullFromOwner,
70
+ ms.sendToOwner
71
+ );
93
72
  }
94
73
 
95
- function _handleSwapToken(SwapTokenMessage memory ms, bytes memory sig, bool claimFailed) internal {
96
- bytes32 actionHash = hashTypedData(ms);
97
- _verifyOwnerSig(ms.owner, ms.expiry, ms.nonce, actionHash, sig, !claimFailed);
74
+ function buyCrossChainPt(BuyCrossChainPtMessage memory ms, bytes memory sig) external payable onlyExecutor {
75
+ _verifyOwnerSig(ms.owner, ms.expiry, ms.nonce, hashTypedData(ms), sig);
98
76
 
99
77
  IPDepositBox box = _checkAndDeployBox(ms.owner, ms.boxId);
100
-
101
- if (claimFailed) {
102
- _markFailedAndTakeFee(actionHash, box, ms.tokenSpent, ms.amountFee);
103
- emit ClaimFeeForFailedAction(ms.owner, ms.boxId, actionHash, ms.tokenSpent, ms.amountFee);
104
- } else {
105
- uint256 netTokenReceived = _swapToken(ms, box);
106
- require(netTokenReceived >= ms.minReceived, InsufficientTokenReceived());
107
-
108
- _markSucceededAndTakeFee(actionHash, box, ms.tokenSpent, ms.amountFee);
109
- emit SwapToken(
110
- ms.owner,
111
- ms.boxId,
112
- actionHash,
113
- ms.tokenSpent,
114
- ms.amountSpent,
115
- ms.amountFee,
116
- ms.tokenReceived,
117
- netTokenReceived
118
- );
78
+ _pullToken(ms.pullFromOwner, box, ms.owner, ms.tokenSpent, ms.amountSpent + ms.amountFee);
79
+ _payTreasury(box, ms.tokenSpent, ms.amountFee);
80
+
81
+ address pt = IOFT(ms.ptAdapter).token();
82
+ uint256 netPtReceived = _buyPtAndBridge(ms, box, pt, msg.value);
83
+ require(netPtReceived >= ms.minPtReceived, InsufficientTokenReceived());
84
+
85
+ emit BuyCrossChainPt(
86
+ ms.owner,
87
+ ms.boxId,
88
+ ms.tokenSpent,
89
+ ms.amountSpent,
90
+ ms.amountFee,
91
+ ms.ptAdapter,
92
+ pt,
93
+ netPtReceived,
94
+ ms.pullFromOwner
95
+ );
96
+ }
97
+
98
+ function _pullToken(bool pullFromOwner, IPDepositBox box, address owner, address token, uint256 amount) internal {
99
+ if (pullFromOwner) {
100
+ _transferFrom(IERC20(token), owner, address(box), amount);
119
101
  }
120
102
  }
121
103
 
122
- function _handleBuyCrossChainPt(BuyCrossChainPtMessage memory ms, bytes memory sig, bool claimFailed) internal {
123
- bytes32 actionHash = hashTypedData(ms);
124
- _verifyOwnerSig(ms.owner, ms.expiry, ms.nonce, actionHash, sig, !claimFailed);
125
-
126
- IPDepositBox box = _checkAndDeployBox(ms.owner, ms.boxId);
104
+ function _payTreasury(IPDepositBox box, address token, uint256 amount) internal {
105
+ box.payTreasury(token, amount);
106
+ }
127
107
 
128
- if (claimFailed) {
129
- _markFailedAndTakeFee(actionHash, box, ms.tokenSpent, ms.amountFee);
130
- emit ClaimFeeForFailedAction(ms.owner, ms.boxId, actionHash, ms.tokenSpent, ms.amountFee);
131
- } else {
132
- address pt = IOFT(ms.ptAdapter).token();
133
- uint256 netPtReceived = _buyPtAndBridge(ms, box, pt, msg.value);
134
- require(netPtReceived >= ms.minPtReceived, InsufficientTokenReceived());
135
-
136
- _markSucceededAndTakeFee(actionHash, box, ms.tokenSpent, ms.amountFee);
137
- emit BuyCrossChainPt(
138
- ms.owner,
139
- ms.boxId,
140
- actionHash,
141
- ms.tokenSpent,
142
- ms.amountSpent,
143
- ms.amountFee,
144
- ms.ptAdapter,
145
- pt,
146
- netPtReceived
147
- );
148
- }
108
+ function _withdrawToken(WithdrawTokenMessage memory ms, IPDepositBox box) internal {
109
+ box.withdrawTo(ms.owner, ms.token, ms.amountWithdraw);
149
110
  }
150
111
 
151
112
  function _bridgeToken(BridgeTokenMessage memory ms, IPDepositBox box, uint256 nativeFee) internal {
@@ -167,13 +128,17 @@ contract PendleCrossChainSwapHub is SwapHubBase {
167
128
  extRouter: ms.swapExtRouter,
168
129
  extCalldata: ms.swapCalldata
169
130
  });
170
- rawTokenReceived = _swapFromBox(box, ms.swapExecutor, swapData, ms.receiver);
131
+
132
+ address receiver = ms.sendToOwner ? ms.owner : address(box);
133
+ rawTokenReceived = _swapFromBox(box, ms.swapExecutor, swapData, receiver);
171
134
  }
172
135
 
173
136
  function _buyPtAndBridge(BuyCrossChainPtMessage memory ms, IPDepositBox box, address pt, uint256 nativeFee)
174
137
  internal
175
138
  returns (uint256 netPtReceived)
176
139
  {
140
+ require(ms.receiver == _addressToBytes32(ms.owner), InvalidReceiver());
141
+
177
142
  SwapData memory swapData = SwapData({
178
143
  tokenIn: ms.tokenSpent,
179
144
  amountIn: ms.amountSpent,
@@ -203,4 +168,8 @@ contract PendleCrossChainSwapHub is SwapHubBase {
203
168
  abi.decode(box.approveAndCall{value: nativeFee}(call, msg.sender), (MessagingReceipt, OFTReceipt));
204
169
  netPtReceived = oftReceipt.amountReceivedLD;
205
170
  }
171
+
172
+ function _addressToBytes32(address addr) internal pure returns (bytes32) {
173
+ return bytes32(uint256(uint160(addr)));
174
+ }
206
175
  }
@@ -21,7 +21,6 @@ abstract contract SwapHubBase is IPCrossChainSwapHub, EIP712Upgradeable, BoringO
21
21
  "uint256 expiry,"
22
22
  "uint256 nonce,"
23
23
  //
24
- "address receiver,"
25
24
  "address token,"
26
25
  "uint256 amountWithdraw,"
27
26
  "uint256 amountFee"
@@ -39,6 +38,7 @@ abstract contract SwapHubBase is IPCrossChainSwapHub, EIP712Upgradeable, BoringO
39
38
  "address token,"
40
39
  "uint256 amountBridge,"
41
40
  "uint256 amountFee,"
41
+ "bool pullFromOwner,"
42
42
  //
43
43
  "address bridgeExtRouter,"
44
44
  "bytes bridgeCalldata"
@@ -58,7 +58,8 @@ abstract contract SwapHubBase is IPCrossChainSwapHub, EIP712Upgradeable, BoringO
58
58
  "uint256 amountFee,"
59
59
  "address tokenReceived,"
60
60
  "uint256 minReceived,"
61
- "address receiver,"
61
+ "bool pullFromOwner,"
62
+ "bool sendToOwner,"
62
63
  //
63
64
  "address swapExecutor,"
64
65
  "address swapExtRouter,"
@@ -81,6 +82,7 @@ abstract contract SwapHubBase is IPCrossChainSwapHub, EIP712Upgradeable, BoringO
81
82
  "uint256 minPtReceived,"
82
83
  "uint32 dstEid,"
83
84
  "bytes32 receiver,"
85
+ "bool pullFromOwner,"
84
86
  //
85
87
  "address swapExecutor,"
86
88
  "address swapExtRouter,"
@@ -94,7 +96,6 @@ abstract contract SwapHubBase is IPCrossChainSwapHub, EIP712Upgradeable, BoringO
94
96
  bytes32 public immutable DEPOSIT_BOX_CODE_HASH;
95
97
 
96
98
  mapping(address owner => uint256 nonce) public ownerNonce;
97
- mapping(bytes32 actionStatus => ActionStatus) public actionStatus;
98
99
  mapping(address executor => bool) public isExecutor;
99
100
 
100
101
  constructor(address beaconProxyCodeContract_, address depositBoxBeacon_) {
@@ -114,14 +115,19 @@ abstract contract SwapHubBase is IPCrossChainSwapHub, EIP712Upgradeable, BoringO
114
115
  emit SetExecutor(executor, isExecutor_);
115
116
  }
116
117
 
117
- function computeDepositBox(address owner, uint32 boxId) public view returns (address box, bytes32 salt) {
118
+ function computeDepositBox(address owner, uint32 boxId)
119
+ public
120
+ view
121
+ returns (address box, bytes32 salt, bool deployed)
122
+ {
118
123
  salt = keccak256(abi.encode(owner, boxId));
119
124
  box = Create2.computeAddress(salt, DEPOSIT_BOX_CODE_HASH);
125
+ deployed = box.code.length > 0;
120
126
  }
121
127
 
122
128
  function _checkAndDeployBox(address owner, uint32 boxId) internal returns (IPDepositBox) {
123
- (address box, bytes32 salt) = computeDepositBox(owner, boxId);
124
- if (box.code.length > 0) {
129
+ (address box, bytes32 salt, bool deployed) = computeDepositBox(owner, boxId);
130
+ if (deployed) {
125
131
  return IPDepositBox(box);
126
132
  }
127
133
 
@@ -141,7 +147,6 @@ abstract contract SwapHubBase is IPCrossChainSwapHub, EIP712Upgradeable, BoringO
141
147
  message.expiry,
142
148
  message.nonce,
143
149
  //
144
- message.receiver,
145
150
  message.token,
146
151
  message.amountWithdraw,
147
152
  message.amountFee
@@ -163,6 +168,7 @@ abstract contract SwapHubBase is IPCrossChainSwapHub, EIP712Upgradeable, BoringO
163
168
  message.token,
164
169
  message.amountBridge,
165
170
  message.amountFee,
171
+ message.pullFromOwner,
166
172
  //
167
173
  message.bridgeExtRouter,
168
174
  keccak256(message.bridgeCalldata)
@@ -186,7 +192,8 @@ abstract contract SwapHubBase is IPCrossChainSwapHub, EIP712Upgradeable, BoringO
186
192
  message.amountFee,
187
193
  message.tokenReceived,
188
194
  message.minReceived,
189
- message.receiver,
195
+ message.pullFromOwner,
196
+ message.sendToOwner,
190
197
  //
191
198
  message.swapExecutor,
192
199
  message.swapExtRouter,
@@ -213,6 +220,7 @@ abstract contract SwapHubBase is IPCrossChainSwapHub, EIP712Upgradeable, BoringO
213
220
  message.minPtReceived,
214
221
  message.dstEid,
215
222
  message.receiver,
223
+ message.pullFromOwner,
216
224
  //
217
225
  message.swapExecutor,
218
226
  message.swapExtRouter,
@@ -222,16 +230,11 @@ abstract contract SwapHubBase is IPCrossChainSwapHub, EIP712Upgradeable, BoringO
222
230
  );
223
231
  }
224
232
 
225
- function _verifyOwnerSig(
226
- address owner,
227
- uint256 expiry,
228
- uint256 nonce,
229
- bytes32 messageHash,
230
- bytes memory signature,
231
- bool verifyNonce
232
- ) internal {
233
+ function _verifyOwnerSig(address owner, uint256 expiry, uint256 nonce, bytes32 messageHash, bytes memory signature)
234
+ internal
235
+ {
233
236
  _verifyOwnerSig(owner, expiry, messageHash, signature);
234
- if (verifyNonce) _verifyAndIncreaseNonce(owner, nonce);
237
+ _verifyAndIncreaseNonce(owner, nonce);
235
238
  }
236
239
 
237
240
  function _verifyOwnerSig(address owner, uint256 expiry, bytes32 messageHash, bytes memory signature) internal view {
@@ -248,18 +251,6 @@ abstract contract SwapHubBase is IPCrossChainSwapHub, EIP712Upgradeable, BoringO
248
251
  return (token == NATIVE) ? addr.balance : IERC20(token).balanceOf(addr);
249
252
  }
250
253
 
251
- function _markSucceededAndTakeFee(bytes32 actionHash, IPDepositBox box, address token, uint256 amount) internal {
252
- require(actionStatus[actionHash] == ActionStatus.NOT_EXECUTED, ActionExecuted());
253
- actionStatus[actionHash] = ActionStatus.SUCCEEDED;
254
- box.payTreasury(token, amount);
255
- }
256
-
257
- function _markFailedAndTakeFee(bytes32 actionHash, IPDepositBox box, address token, uint256 amount) internal {
258
- require(actionStatus[actionHash] == ActionStatus.NOT_EXECUTED, ActionExecuted());
259
- actionStatus[actionHash] = ActionStatus.FAILED;
260
- box.payTreasury(token, amount);
261
- }
262
-
263
254
  function _swapFromBox(IPDepositBox box, address swapExecutor, SwapData memory swapData, address receiver)
264
255
  internal
265
256
  returns (uint256 rawTokenOut)
@@ -19,13 +19,8 @@ contract SwapExecutor is IPSwapExecutor, TokenHelper {
19
19
 
20
20
  function _approveForExtRouter(address token, address extRouter) internal {
21
21
  if (token == NATIVE) return;
22
-
23
- _safeApproveInfV2(IERC20(token), extRouter);
24
- }
25
-
26
- function _safeApproveInfV2(IERC20 token, address spender) internal {
27
- if (token.allowance(address(this), spender) < type(uint256).max) {
28
- token.forceApprove(spender, type(uint256).max);
22
+ if (IERC20(token).allowance(address(this), extRouter) < type(uint256).max) {
23
+ IERC20(token).forceApprove(extRouter, type(uint256).max);
29
24
  }
30
25
  }
31
26
 
@@ -2,25 +2,18 @@
2
2
  pragma solidity ^0.8.0;
3
3
 
4
4
  interface IPCrossChainSwapHub {
5
- error ActionExecuted();
6
5
  error InsufficientTokenReceived();
7
6
  error InvalidNonce();
8
7
  error InvalidSignature();
8
+ error InvalidReceiver();
9
9
  error MessageExpired();
10
10
 
11
- enum ActionStatus {
12
- NOT_EXECUTED,
13
- SUCCEEDED,
14
- FAILED
15
- }
16
-
17
11
  struct WithdrawTokenMessage {
18
12
  address owner;
19
13
  uint32 boxId;
20
14
  uint256 expiry;
21
15
  uint256 nonce;
22
16
  //
23
- address receiver;
24
17
  address token;
25
18
  uint256 amountWithdraw;
26
19
  uint256 amountFee;
@@ -35,6 +28,7 @@ interface IPCrossChainSwapHub {
35
28
  address token;
36
29
  uint256 amountBridge;
37
30
  uint256 amountFee;
31
+ bool pullFromOwner;
38
32
  //
39
33
  address bridgeExtRouter;
40
34
  bytes bridgeCalldata;
@@ -51,7 +45,8 @@ interface IPCrossChainSwapHub {
51
45
  uint256 amountFee;
52
46
  address tokenReceived;
53
47
  uint256 minReceived;
54
- address receiver;
48
+ bool pullFromOwner;
49
+ bool sendToOwner;
55
50
  //
56
51
  address swapExecutor;
57
52
  address swapExtRouter;
@@ -71,57 +66,47 @@ interface IPCrossChainSwapHub {
71
66
  uint256 minPtReceived;
72
67
  uint32 dstEid;
73
68
  bytes32 receiver;
69
+ bool pullFromOwner;
74
70
  //
75
71
  address swapExecutor;
76
72
  address swapExtRouter;
77
73
  bytes swapCalldata;
78
74
  }
79
75
 
80
- event WithdrawToken(
81
- address indexed owner,
82
- uint32 boxId,
83
- bytes32 actionHash,
84
- address receiver,
85
- address token,
86
- uint256 amountWithdraw,
87
- uint256 amountFee
88
- );
76
+ event WithdrawToken(address indexed owner, uint32 boxId, address token, uint256 amountWithdraw, uint256 amountFee);
89
77
 
90
78
  event BridgeToken(
91
79
  address indexed owner,
92
80
  uint32 boxId,
93
- bytes32 actionHash,
94
81
  address bridgeExtRouter,
95
82
  address token,
96
83
  uint256 amountBridge,
97
- uint256 amountFee
84
+ uint256 amountFee,
85
+ bool pullFromOwner
98
86
  );
99
87
 
100
88
  event SwapToken(
101
89
  address indexed owner,
102
90
  uint32 boxId,
103
- bytes32 actionHash,
104
91
  address tokenSpent,
105
92
  uint256 amountSpent,
106
93
  uint256 amountFee,
107
94
  address tokenReceived,
108
- uint256 netTokenReceived
95
+ uint256 netTokenReceived,
96
+ bool pullFromOwner,
97
+ bool sendToOwner
109
98
  );
110
99
 
111
100
  event BuyCrossChainPt(
112
101
  address indexed owner,
113
102
  uint32 boxId,
114
- bytes32 actionHash,
115
103
  address tokenSpent,
116
104
  uint256 amountSpent,
117
105
  uint256 amountFee,
118
106
  address ptAdapter,
119
107
  address pt,
120
- uint256 netPtReceived
121
- );
122
-
123
- event ClaimFeeForFailedAction(
124
- address indexed owner, uint32 boxId, bytes32 actionHash, address token, uint256 amount
108
+ uint256 netPtReceived,
109
+ bool pullFromOwner
125
110
  );
126
111
 
127
112
  event SetExecutor(address indexed executor, bool isExecutor);
@@ -134,11 +119,12 @@ interface IPCrossChainSwapHub {
134
119
 
135
120
  function ownerNonce(address owner) external view returns (uint256);
136
121
 
137
- function actionStatus(bytes32 actionHash) external view returns (ActionStatus);
138
-
139
122
  function isExecutor(address executor) external view returns (bool);
140
123
 
141
- function computeDepositBox(address owner, uint32 boxId) external view returns (address box, bytes32 salt);
124
+ function computeDepositBox(address owner, uint32 boxId)
125
+ external
126
+ view
127
+ returns (address box, bytes32 salt, bool deployed);
142
128
 
143
129
  function hashTypedData(WithdrawTokenMessage memory message) external view returns (bytes32);
144
130
 
@@ -156,13 +142,5 @@ interface IPCrossChainSwapHub {
156
142
 
157
143
  function buyCrossChainPt(BuyCrossChainPtMessage memory message, bytes memory signature) external payable;
158
144
 
159
- function claimFee(WithdrawTokenMessage memory message, bytes memory signature) external;
160
-
161
- function claimFee(BridgeTokenMessage memory message, bytes memory signature) external;
162
-
163
- function claimFee(SwapTokenMessage memory message, bytes memory signature) external;
164
-
165
- function claimFee(BuyCrossChainPtMessage memory message, bytes memory signature) external;
166
-
167
145
  function setExecutor(address executor, bool isExecutor) external;
168
146
  }
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-swaphubtest2",
5
+ "version": "6.3.2-swaphubtest3",
6
6
  "homepage": "https://pendle.finance",
7
7
  "keywords": [
8
8
  "pendle",