@pendle/core-v2 6.5.0 → 6.6.1

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 (470) hide show
  1. package/LICENSE +12 -82
  2. package/build/artifacts/contracts/LiquidityMining/CrossChainMsg/PendleMsgReceiveEndpointUpg.sol/PendleMsgReceiveEndpointUpg.dbg.json +1 -1
  3. package/build/artifacts/contracts/LiquidityMining/CrossChainMsg/PendleMsgReceiverAppUpg.sol/PendleMsgReceiverAppUpg.dbg.json +1 -1
  4. package/build/artifacts/contracts/LiquidityMining/CrossChainMsg/PendleMsgSendEndpointUpg.sol/PendleMsgSendEndpointUpg.dbg.json +1 -1
  5. package/build/artifacts/contracts/LiquidityMining/CrossChainMsg/PendleMsgSenderAppUpg.sol/PendleMsgSenderAppUpg.dbg.json +1 -1
  6. package/build/artifacts/contracts/LiquidityMining/CrossChainMsg/libraries/ExcessivelySafeCall.sol/ExcessivelySafeCall.dbg.json +1 -1
  7. package/build/artifacts/contracts/LiquidityMining/CrossChainMsg/libraries/LayerZeroHelper.sol/LayerZeroHelper.dbg.json +1 -1
  8. package/build/artifacts/contracts/LiquidityMining/GaugeController/PendleGaugeControllerUpg.sol/PendleGaugeControllerUpg.dbg.json +1 -1
  9. package/build/artifacts/contracts/LiquidityMining/GaugeController/PendleGaugeControllerUpg.sol/PendleGaugeControllerUpg.json +58 -2
  10. package/build/artifacts/contracts/LiquidityMining/PendleMerkleDistributor.sol/PendleMerkleDistributor.dbg.json +1 -1
  11. package/build/artifacts/contracts/LiquidityMining/PendleMerkleDistributor.sol/PendleMerkleDistributor.json +2 -2
  12. package/build/artifacts/contracts/LiquidityMining/PendleMultiTokenMerkleDistributor.sol/PendleMultiTokenMerkleDistributor.dbg.json +1 -1
  13. package/build/artifacts/contracts/LiquidityMining/PendleMultiTokenMerkleDistributor.sol/PendleMultiTokenMerkleDistributor.json +2 -2
  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/LiquidityMining/sPendle/StakedPendle.sol/StakedPendle.dbg.json +1 -1
  22. package/build/artifacts/contracts/LiquidityMining/sPendle/StakedPendle.sol/StakedPendle.json +2 -2
  23. package/build/artifacts/contracts/core/Market/MarketMathCore.sol/MarketMathCore.dbg.json +1 -1
  24. package/build/artifacts/contracts/core/Market/OracleLib.sol/OracleLib.dbg.json +1 -1
  25. package/build/artifacts/contracts/core/Market/PendleGauge.sol/PendleGauge.dbg.json +1 -1
  26. package/build/artifacts/contracts/core/Market/PendleMarketFactoryV7Upg.sol/PendleMarketFactoryV7Upg.dbg.json +1 -1
  27. package/build/artifacts/contracts/core/Market/PendleMarketV7.sol/PendleMarketV7.dbg.json +1 -1
  28. package/build/artifacts/contracts/core/Market/PendleMarketV7.sol/PendleMarketV7.json +2 -2
  29. package/build/artifacts/contracts/core/RewardManager/RewardManager.sol/RewardManager.dbg.json +1 -1
  30. package/build/artifacts/contracts/core/RewardManager/RewardManagerAbstract.sol/RewardManagerAbstract.dbg.json +1 -1
  31. package/build/artifacts/contracts/core/StandardizedYield/PYIndex.sol/PYIndexLib.dbg.json +1 -1
  32. package/build/artifacts/contracts/core/StandardizedYield/SYUtils.sol/SYUtils.dbg.json +1 -1
  33. package/build/artifacts/contracts/core/YieldContracts/InterestManagerYT.sol/InterestManagerYT.dbg.json +1 -1
  34. package/build/artifacts/contracts/core/YieldContracts/PendlePrincipalToken.sol/PendlePrincipalToken.dbg.json +1 -1
  35. package/build/artifacts/contracts/core/YieldContracts/PendleYieldContractFactoryUpg.sol/PendleYieldContractFactoryUpg.dbg.json +1 -1
  36. package/build/artifacts/contracts/core/YieldContracts/PendleYieldContractFactoryUpg.sol/PendleYieldContractFactoryUpg.json +2 -2
  37. package/build/artifacts/contracts/core/YieldContracts/PendleYieldToken.sol/PendleYieldToken.dbg.json +1 -1
  38. package/build/artifacts/contracts/core/YieldContracts/PendleYieldToken.sol/PendleYieldToken.json +2 -2
  39. package/build/artifacts/contracts/core/erc20/PendleERC20.sol/PendleERC20.dbg.json +1 -1
  40. package/build/artifacts/contracts/core/libraries/ArrayLib.sol/ArrayLib.dbg.json +1 -1
  41. package/build/artifacts/contracts/core/libraries/BaseSplitCodeFactory.sol/BaseSplitCodeFactory.dbg.json +1 -1
  42. package/build/artifacts/contracts/core/libraries/BaseSplitCodeFactory.sol/CodeDeployer.dbg.json +1 -1
  43. package/build/artifacts/contracts/core/libraries/BoringOwnableUpgradeableV2.sol/BoringOwnableUpgradeableData.dbg.json +1 -1
  44. package/build/artifacts/contracts/core/libraries/BoringOwnableUpgradeableV2.sol/BoringOwnableUpgradeableV2.dbg.json +1 -1
  45. package/build/artifacts/contracts/core/libraries/Errors.sol/Errors.dbg.json +1 -1
  46. package/build/artifacts/contracts/core/libraries/ExpiryUtilsLib.sol/ExpiryUtils.dbg.json +1 -1
  47. package/build/artifacts/contracts/core/libraries/MiniHelpers.sol/MiniHelpers.dbg.json +1 -1
  48. package/build/artifacts/contracts/core/libraries/StringLib.sol/StringLib.dbg.json +1 -1
  49. package/build/artifacts/contracts/core/libraries/TokenHelper.sol/TokenHelper.dbg.json +1 -1
  50. package/build/artifacts/contracts/core/libraries/math/LogExpMath.sol/LogExpMath.dbg.json +1 -1
  51. package/build/artifacts/contracts/core/libraries/math/PMath.sol/PMath.dbg.json +1 -1
  52. package/build/artifacts/contracts/cross-chain/FixedPricePTAMMV2.sol/FixedPricePTAMMV2.dbg.json +4 -0
  53. package/build/artifacts/contracts/cross-chain/FixedPricePTAMMV2.sol/FixedPricePTAMMV2.json +766 -0
  54. package/build/artifacts/contracts/cross-chain/PendleSwapHelper.sol/PendleSwapHelper.dbg.json +4 -0
  55. package/build/artifacts/contracts/cross-chain/PendleSwapHelper.sol/PendleSwapHelper.json +99 -0
  56. package/build/artifacts/contracts/cross-chain/deposit-box/DepositBox.sol/DepositBox.dbg.json +4 -0
  57. package/build/artifacts/contracts/cross-chain/deposit-box/DepositBox.sol/DepositBox.json +170 -0
  58. package/build/artifacts/contracts/cross-chain/deposit-box/DepositBoxFactory.sol/DepositBoxFactory.dbg.json +4 -0
  59. package/build/artifacts/contracts/cross-chain/deposit-box/DepositBoxFactory.sol/DepositBoxFactory.json +124 -0
  60. package/build/artifacts/contracts/cross-chain/factory/hub/PendlePTOFTAdapterFactory.sol/PendlePTOFTAdapterFactory.dbg.json +1 -1
  61. package/build/artifacts/contracts/cross-chain/funder/BridgeFunder.sol/BridgeFunder.dbg.json +4 -0
  62. package/build/artifacts/contracts/cross-chain/funder/BridgeFunder.sol/BridgeFunder.json +210 -0
  63. package/build/artifacts/contracts/cross-chain/oftImpl/hub/OFTAdapterAltImpl.sol/OFTAdapterAltImpl.dbg.json +4 -0
  64. package/build/artifacts/contracts/cross-chain/oftImpl/hub/OFTAdapterAltImpl.sol/OFTAdapterAltImpl.json +1294 -0
  65. package/build/artifacts/contracts/cross-chain/oftImpl/hub/OFTAdapterImpl.sol/OFTAdapterImpl.dbg.json +1 -1
  66. package/build/artifacts/contracts/cross-chain/oftImpl/spoke/PendleBridgedPrincipalToken.sol/PendleBridgedPrincipalToken.dbg.json +1 -1
  67. package/build/artifacts/contracts/cross-chain/oftImpl/spoke/PendleBridgedPrincipalTokenAlt.sol/PendleBridgedPrincipalTokenAlt.dbg.json +4 -0
  68. package/build/artifacts/contracts/cross-chain/oftImpl/spoke/PendleBridgedPrincipalTokenAlt.sol/PendleBridgedPrincipalTokenAlt.json +1602 -0
  69. package/build/artifacts/contracts/cross-chain/swap-hub/PendleCrossChainSwapHub.sol/PendleCrossChainSwapHub.dbg.json +4 -0
  70. package/build/artifacts/contracts/cross-chain/swap-hub/PendleCrossChainSwapHub.sol/PendleCrossChainSwapHub.json +1005 -0
  71. package/build/artifacts/contracts/cross-chain/swap-hub/SwapHubBase.sol/SwapHubBase.dbg.json +4 -0
  72. package/build/artifacts/contracts/cross-chain/swap-hub/SwapHubBase.sol/SwapHubBase.json +976 -0
  73. package/build/artifacts/contracts/deprecated/VeDistributor/PendleFeeDistributorV2.sol/PendleFeeDistributorV2.dbg.json +1 -1
  74. package/build/artifacts/contracts/deprecated/VeDistributor/PendleFeeDistributorV2.sol/PendleFeeDistributorV2.json +2 -2
  75. package/build/artifacts/contracts/interfaces/IAddressProvider.sol/IAddressProvider.dbg.json +1 -1
  76. package/build/artifacts/contracts/interfaces/ILPWrapper.sol/ILPWrapper.dbg.json +1 -1
  77. package/build/artifacts/contracts/interfaces/ILayerZeroEndpoint.sol/ILayerZeroEndpoint.dbg.json +1 -1
  78. package/build/artifacts/contracts/interfaces/ILayerZeroReceiver.sol/ILayerZeroReceiver.dbg.json +1 -1
  79. package/build/artifacts/contracts/interfaces/IMarketSweed.sol/IMarketSweed.dbg.json +1 -1
  80. package/build/artifacts/contracts/interfaces/IOwnable.sol/IOwnable.dbg.json +1 -1
  81. package/build/artifacts/contracts/interfaces/IPActionAddRemoveLiqV3.sol/IPActionAddRemoveLiqV3.dbg.json +1 -1
  82. package/build/artifacts/contracts/interfaces/IPActionCallbackV3.sol/IPActionCallbackV3.dbg.json +1 -1
  83. package/build/artifacts/contracts/interfaces/IPActionInfoStatic.sol/IPActionInfoStatic.dbg.json +1 -1
  84. package/build/artifacts/contracts/interfaces/IPActionMarketAuxStatic.sol/IPActionMarketAuxStatic.dbg.json +1 -1
  85. package/build/artifacts/contracts/interfaces/IPActionMarketCoreStatic.sol/IPActionMarketCoreStatic.dbg.json +1 -1
  86. package/build/artifacts/contracts/interfaces/IPActionMintRedeemStatic.sol/IPActionMintRedeemStatic.dbg.json +1 -1
  87. package/build/artifacts/contracts/interfaces/IPActionMiscV3.sol/IPActionMiscV3.dbg.json +1 -1
  88. package/build/artifacts/contracts/interfaces/IPActionSimple.sol/IPActionSimple.dbg.json +1 -1
  89. package/build/artifacts/contracts/interfaces/IPActionStorageStatic.sol/IPActionStorageStatic.dbg.json +1 -1
  90. package/build/artifacts/contracts/interfaces/IPActionStorageV4.sol/IPActionStorageV4.dbg.json +1 -1
  91. package/build/artifacts/contracts/interfaces/IPActionSwapPTV3.sol/IPActionSwapPTV3.dbg.json +1 -1
  92. package/build/artifacts/contracts/interfaces/IPActionSwapYTV3.sol/IPActionSwapYTV3.dbg.json +1 -1
  93. package/build/artifacts/contracts/interfaces/IPActionVePendleStatic.sol/IPActionVePendleStatic.dbg.json +1 -1
  94. package/build/artifacts/contracts/interfaces/IPAllActionV3.sol/IPAllActionV3.dbg.json +1 -1
  95. package/build/artifacts/contracts/interfaces/IPAllActionV3.sol/IPAllActionV3.json +0 -88
  96. package/build/artifacts/contracts/interfaces/IPAllEventsV3.sol/IPActionAddRemoveLiqV3Events.dbg.json +1 -1
  97. package/build/artifacts/contracts/interfaces/IPAllEventsV3.sol/IPActionMiscV3Events.dbg.json +1 -1
  98. package/build/artifacts/contracts/interfaces/IPAllEventsV3.sol/IPActionStorageEvents.dbg.json +1 -1
  99. package/build/artifacts/contracts/interfaces/IPAllEventsV3.sol/IPActionSwapPTV3Events.dbg.json +1 -1
  100. package/build/artifacts/contracts/interfaces/IPAllEventsV3.sol/IPActionSwapYTV3Events.dbg.json +1 -1
  101. package/build/artifacts/contracts/interfaces/IPAllEventsV3.sol/IPAllEventsV3.dbg.json +1 -1
  102. package/build/artifacts/contracts/interfaces/IPBridgeFunder.sol/IPBridgeFunder.dbg.json +4 -0
  103. package/build/artifacts/contracts/interfaces/IPBridgeFunder.sol/IPBridgeFunder.json +85 -0
  104. package/build/artifacts/contracts/interfaces/IPBridgedPrincipalToken.sol/IPBridgedPrincipalToken.dbg.json +1 -1
  105. package/build/artifacts/contracts/interfaces/IPChainlinkOracle.sol/IPChainlinkOracle.dbg.json +1 -1
  106. package/build/artifacts/contracts/interfaces/IPChainlinkOracleEssential.sol/IPChainlinkOracleEssential.dbg.json +1 -1
  107. package/build/artifacts/contracts/interfaces/IPChainlinkOracleFactory.sol/IPChainlinkOracleFactory.dbg.json +1 -1
  108. package/build/artifacts/contracts/interfaces/IPChainlinkOracleWithQuote.sol/IPChainlinkOracleWithQuote.dbg.json +1 -1
  109. package/build/artifacts/contracts/interfaces/IPCommonPoolDeployHelperV2.sol/IPCommonPoolDeployHelperV2.dbg.json +1 -1
  110. package/build/artifacts/contracts/interfaces/IPCommonSYFactory.sol/IPCommonSYFactory.dbg.json +1 -1
  111. package/build/artifacts/contracts/interfaces/IPCrossChainSwapHub.sol/IPCrossChainSwapHub.dbg.json +4 -0
  112. package/build/artifacts/contracts/interfaces/IPCrossChainSwapHub.sol/IPCrossChainSwapHub.json +813 -0
  113. package/build/artifacts/contracts/interfaces/IPDepositBox.sol/IPDepositBox.dbg.json +4 -0
  114. package/build/artifacts/contracts/interfaces/IPDepositBox.sol/IPDepositBox.json +124 -0
  115. package/build/artifacts/contracts/interfaces/IPDepositBoxFactory.sol/IPDepositBoxFactory.dbg.json +4 -0
  116. package/build/artifacts/contracts/interfaces/IPDepositBoxFactory.sol/IPDepositBoxFactory.json +108 -0
  117. package/build/artifacts/contracts/interfaces/IPExchangeRateOracle.sol/IPExchangeRateOracle.dbg.json +1 -1
  118. package/build/artifacts/contracts/interfaces/IPExchangeRateOracleApp.sol/IPExchangeRateOracleApp.dbg.json +1 -1
  119. package/build/artifacts/contracts/interfaces/IPFeeDistributor.sol/IPFeeDistributor.dbg.json +1 -1
  120. package/build/artifacts/contracts/interfaces/IPFeeDistributorV2.sol/IPFeeDistributorV2.dbg.json +1 -1
  121. package/build/artifacts/contracts/interfaces/IPFixedPricePTAMMV2.sol/IPFixedPricePTAMMSwapCallback.dbg.json +4 -0
  122. package/build/artifacts/contracts/interfaces/{IPFixedPricePTAMM.sol → IPFixedPricePTAMMV2.sol}/IPFixedPricePTAMMSwapCallback.json +1 -1
  123. package/build/artifacts/contracts/interfaces/IPFixedPricePTAMMV2.sol/IPFixedPricePTAMMV2.dbg.json +4 -0
  124. package/build/artifacts/contracts/interfaces/{IPFixedPricePTAMM.sol/IPFixedPricePTAMM.json → IPFixedPricePTAMMV2.sol/IPFixedPricePTAMMV2.json} +285 -93
  125. package/build/artifacts/contracts/interfaces/IPGauge.sol/IPGauge.dbg.json +1 -1
  126. package/build/artifacts/contracts/interfaces/IPGaugeController.sol/IPGaugeController.dbg.json +1 -1
  127. package/build/artifacts/contracts/interfaces/IPGaugeController.sol/IPGaugeController.json +56 -0
  128. package/build/artifacts/contracts/interfaces/IPGovernanceProxy.sol/IPGovernanceProxy.dbg.json +1 -1
  129. package/build/artifacts/contracts/interfaces/IPInterestManagerYT.sol/IPInterestManagerYT.dbg.json +1 -1
  130. package/build/artifacts/contracts/interfaces/IPInterestManagerYTV2.sol/IPInterestManagerYTV2.dbg.json +1 -1
  131. package/build/artifacts/contracts/interfaces/IPLPWrapperFactory.sol/IPLPWrapperFactory.dbg.json +1 -1
  132. package/build/artifacts/contracts/interfaces/IPLimitRouter.sol/IPLimitOrderType.dbg.json +1 -1
  133. package/build/artifacts/contracts/interfaces/IPLimitRouter.sol/IPLimitRouter.dbg.json +1 -1
  134. package/build/artifacts/contracts/interfaces/IPLimitRouter.sol/IPLimitRouter.json +387 -0
  135. package/build/artifacts/contracts/interfaces/IPLimitRouter.sol/IPLimitRouterCallback.dbg.json +1 -1
  136. package/build/artifacts/contracts/interfaces/IPMarket.sol/IPMarket.dbg.json +1 -1
  137. package/build/artifacts/contracts/interfaces/IPMarketFactory.sol/IPMarketFactory.dbg.json +1 -1
  138. package/build/artifacts/contracts/interfaces/IPMarketSwapCallback.sol/IPMarketSwapCallback.dbg.json +1 -1
  139. package/build/artifacts/contracts/interfaces/IPMerkleDistributor.sol/IPMerkleDistributor.dbg.json +1 -1
  140. package/build/artifacts/contracts/interfaces/IPMiniDiamond.sol/IPMiniDiamond.dbg.json +1 -1
  141. package/build/artifacts/contracts/interfaces/IPMsgReceiverApp.sol/IPMsgReceiverApp.dbg.json +1 -1
  142. package/build/artifacts/contracts/interfaces/IPMsgSendEndpoint.sol/IPMsgSendEndpoint.dbg.json +1 -1
  143. package/build/artifacts/contracts/interfaces/IPMultiTokenMerkleDistributor.sol/IPMultiTokenMerkleDistributor.dbg.json +1 -1
  144. package/build/artifacts/contracts/interfaces/IPOffchainStorage.sol/IPOffchainStorage.dbg.json +1 -1
  145. package/build/artifacts/contracts/interfaces/IPOracleForSy.sol/IPOracleForSy.dbg.json +1 -1
  146. package/build/artifacts/contracts/interfaces/IPPTOFTAdapterFactory.sol/IPPTOFTAdapterFactory.dbg.json +1 -1
  147. package/build/artifacts/contracts/interfaces/IPPYLpOracle.sol/IPPYLpOracle.dbg.json +1 -1
  148. package/build/artifacts/contracts/interfaces/IPPausingInterface.sol/IPPausingInterface.dbg.json +1 -1
  149. package/build/artifacts/contracts/interfaces/IPPoolDeployHelperV2.sol/IPPoolDeployHelperV2.dbg.json +1 -1
  150. package/build/artifacts/contracts/interfaces/IPPriceFeed.sol/IPPriceFeed.dbg.json +1 -1
  151. package/build/artifacts/contracts/interfaces/IPPrincipalToken.sol/IPPrincipalToken.dbg.json +1 -1
  152. package/build/artifacts/contracts/interfaces/IPReflector.sol/IPReflector.dbg.json +1 -1
  153. package/build/artifacts/contracts/interfaces/IPRouterStatic.sol/IPRouterStatic.dbg.json +1 -1
  154. package/build/artifacts/contracts/interfaces/IPStakedPendle.sol/IPStakedPendle.dbg.json +1 -1
  155. package/build/artifacts/contracts/interfaces/IPSwapHelper.sol/IPSwapHelper.dbg.json +4 -0
  156. package/build/artifacts/contracts/interfaces/{IPActionCrossChain.sol/IPActionCrossChain.json → IPSwapHelper.sol/IPSwapHelper.json} +2 -2
  157. package/build/artifacts/contracts/interfaces/IPTokenWithSupplyCap.sol/IPTokenWithSupplyCap.dbg.json +1 -1
  158. package/build/artifacts/contracts/interfaces/IPVeToken.sol/IPVeToken.dbg.json +1 -1
  159. package/build/artifacts/contracts/interfaces/IPVotingEscrowMainchain.sol/IPVotingEscrowMainchain.dbg.json +1 -1
  160. package/build/artifacts/contracts/interfaces/IPYieldContractFactory.sol/IPYieldContractFactory.dbg.json +1 -1
  161. package/build/artifacts/contracts/interfaces/IPYieldToken.sol/IPYieldToken.dbg.json +1 -1
  162. package/build/artifacts/contracts/interfaces/IPYieldTokenV2.sol/IPYieldTokenV2.dbg.json +1 -1
  163. package/build/artifacts/contracts/interfaces/IRedstonePriceFeed.sol/IRedstonePriceFeed.dbg.json +1 -1
  164. package/build/artifacts/contracts/interfaces/IRewardManager.sol/IRewardManager.dbg.json +1 -1
  165. package/build/artifacts/contracts/interfaces/IStandardizedYield.sol/IStandardizedYield.dbg.json +1 -1
  166. package/build/artifacts/contracts/interfaces/IWETH.sol/IWETH.dbg.json +1 -1
  167. package/build/artifacts/contracts/interfaces/IWstETH.sol/IWstETH.dbg.json +1 -1
  168. package/build/artifacts/contracts/limit/LimitMathCore.sol/LimitMathCore.dbg.json +1 -1
  169. package/build/artifacts/contracts/limit/LimitMathCore.sol/LimitMathCore.json +2 -2
  170. package/build/artifacts/contracts/limit/LimitRouterBase.sol/LimitRouterBase.dbg.json +1 -1
  171. package/build/artifacts/contracts/limit/LimitRouterBase.sol/LimitRouterBase.json +473 -11
  172. package/build/artifacts/contracts/limit/PendleLimitRouter.sol/PendleLimitRouter.dbg.json +1 -1
  173. package/build/artifacts/contracts/limit/PendleLimitRouter.sol/PendleLimitRouter.json +480 -13
  174. package/build/artifacts/contracts/limit/helpers/MintSyHelper.sol/MintSyHelper.dbg.json +4 -0
  175. package/build/artifacts/contracts/limit/helpers/MintSyHelper.sol/MintSyHelper.json +156 -0
  176. package/build/artifacts/contracts/limit/helpers/NonceManager.sol/NonceManager.dbg.json +1 -1
  177. package/build/artifacts/contracts/offchain-helpers/AddressProvider.sol/AddressProvider.dbg.json +1 -1
  178. package/build/artifacts/contracts/offchain-helpers/AutomateReady.sol/AutomateReady.dbg.json +1 -1
  179. package/build/artifacts/contracts/offchain-helpers/AutomateReady.sol/IAutomate.dbg.json +1 -1
  180. package/build/artifacts/contracts/offchain-helpers/AutomateReady.sol/IOpsProxyFactory.dbg.json +1 -1
  181. package/build/artifacts/contracts/offchain-helpers/AutomateReady.sol/ITaskTreasuryUpgradable.dbg.json +1 -1
  182. package/build/artifacts/contracts/offchain-helpers/BalanceReader.sol/BalanceReader.dbg.json +1 -1
  183. package/build/artifacts/contracts/offchain-helpers/BalanceReader.sol/ILegacyMarket.dbg.json +1 -1
  184. package/build/artifacts/contracts/offchain-helpers/BaseSplitCodeFactoryContract.sol/BaseSplitCodeFactoryContract.dbg.json +1 -1
  185. package/build/artifacts/contracts/offchain-helpers/BytesLib.sol/BytesLib.dbg.json +1 -1
  186. package/build/artifacts/contracts/offchain-helpers/EmptyUUPS.sol/EmptyUUPS.dbg.json +1 -1
  187. package/build/artifacts/contracts/offchain-helpers/ExpiredLpPtRedeemer.sol/ExpiredLpPtRedeemer.dbg.json +1 -1
  188. package/build/artifacts/contracts/offchain-helpers/ExpiredLpPtRedeemer.sol/ExpiredLpPtRedeemer.json +2 -2
  189. package/build/artifacts/contracts/offchain-helpers/LegacyNFTHelper.sol/LegacyNFTHelper.dbg.json +1 -1
  190. package/build/artifacts/contracts/offchain-helpers/LegacyNFTHelper.sol/StarNFTV1.dbg.json +1 -1
  191. package/build/artifacts/contracts/offchain-helpers/LimitBackendHelperV2.sol/LimitBackendHelperV2.dbg.json +1 -1
  192. package/build/artifacts/contracts/offchain-helpers/LimitBackendHelperV2.sol/LimitBackendHelperV2.json +2 -2
  193. package/build/artifacts/contracts/offchain-helpers/MarketSweed.sol/MarketSweed.dbg.json +1 -1
  194. package/build/artifacts/contracts/offchain-helpers/MarketSweed.sol/MarketSweed.json +2 -2
  195. package/build/artifacts/contracts/offchain-helpers/Multicall2.sol/Multicall2.dbg.json +1 -1
  196. package/build/artifacts/contracts/offchain-helpers/PendleAPIFeeDepositor.sol/PendleAPIFeeDepositor.dbg.json +1 -1
  197. package/build/artifacts/contracts/offchain-helpers/PendleAPIFeeDepositor.sol/PendleAPIFeeDepositor.json +2 -2
  198. package/build/artifacts/contracts/offchain-helpers/PendleExchangeRateOracle.sol/PendleExchangeRateOracle.dbg.json +1 -1
  199. package/build/artifacts/contracts/offchain-helpers/PendleFeeSetter.sol/PendleFeeSetter.dbg.json +1 -1
  200. package/build/artifacts/contracts/offchain-helpers/PendleFeeSetter.sol/PendleFeeSetter.json +33 -2
  201. package/build/artifacts/contracts/offchain-helpers/PendleGovernanceProxy.sol/PendleGovernanceProxy.dbg.json +1 -1
  202. package/build/artifacts/contracts/offchain-helpers/PendleLPWrapper.sol/PendleLPWrapper.dbg.json +1 -1
  203. package/build/artifacts/contracts/offchain-helpers/PendleLPWrapper.sol/PendleLPWrapper.json +2 -2
  204. package/build/artifacts/contracts/offchain-helpers/PendleLPWrapperFactory.sol/PendleLPWrapperFactory.dbg.json +1 -1
  205. package/build/artifacts/contracts/offchain-helpers/PendleLPWrapperFactory.sol/PendleLPWrapperFactory.json +2 -2
  206. package/build/artifacts/contracts/offchain-helpers/PendleMerkleDepositor.sol/PendleMerkleDepositor.dbg.json +1 -1
  207. package/build/artifacts/contracts/offchain-helpers/PendleMulticallOwnerV1.sol/PendleMulticallOwnerV1.dbg.json +1 -1
  208. package/build/artifacts/contracts/offchain-helpers/PendleMulticallV1.sol/PendleMulticallV1.dbg.json +1 -1
  209. package/build/artifacts/contracts/offchain-helpers/PendleMulticallV2.sol/PendleMulticallV2.dbg.json +1 -1
  210. package/build/artifacts/contracts/offchain-helpers/PendleOffchainStorage.sol/PendleOffchainStorage.dbg.json +1 -1
  211. package/build/artifacts/contracts/offchain-helpers/PendleProxyAdmin.sol/PendleProxyAdmin.dbg.json +4 -0
  212. package/build/artifacts/contracts/offchain-helpers/PendleProxyAdmin.sol/PendleProxyAdmin.json +171 -0
  213. package/build/artifacts/contracts/offchain-helpers/PendleWstETHPriceFeed.sol/PendleWstETHPriceFeed.dbg.json +1 -1
  214. package/build/artifacts/contracts/offchain-helpers/SimulateHelper.sol/SimulateHelper.dbg.json +1 -1
  215. package/build/artifacts/contracts/offchain-helpers/SupplyCapReader.sol/IPossibleSupplyCapInterface.dbg.json +1 -1
  216. package/build/artifacts/contracts/offchain-helpers/SupplyCapReader.sol/SupplyCapReader.dbg.json +1 -1
  217. package/build/artifacts/contracts/offchain-helpers/deploy/PendleCommonPoolDeployHelperV2.sol/PendleCommonPoolDeployHelperV2.dbg.json +1 -1
  218. package/build/artifacts/contracts/offchain-helpers/deploy/PendleCommonPoolDeployHelperV2.sol/PendleCommonPoolDeployHelperV2.json +2 -2
  219. package/build/artifacts/contracts/offchain-helpers/deploy/PendleCommonSYFactory.sol/PendleCommonSYFactory.dbg.json +1 -1
  220. package/build/artifacts/contracts/offchain-helpers/deploy/PendlePoolDeployHelper.sol/PendlePoolDeployHelper.dbg.json +1 -1
  221. package/build/artifacts/contracts/offchain-helpers/deploy/PendlePoolDeployHelper.sol/PendlePoolDeployHelper.json +2 -2
  222. package/build/artifacts/contracts/offchain-helpers/deploy/PendlePoolDeployHelperV2.sol/PendlePoolDeployHelperV2.dbg.json +1 -1
  223. package/build/artifacts/contracts/offchain-helpers/deploy/PendlePoolDeployHelperV2.sol/PendlePoolDeployHelperV2.json +2 -2
  224. package/build/artifacts/contracts/offchain-helpers/deploy/lib/MarketDeployLib.sol/MarketDeployLib.dbg.json +1 -1
  225. package/build/artifacts/contracts/offchain-helpers/errors/SDKErrorsDirectory.sol/SDKErrorsDirectory.dbg.json +1 -1
  226. package/build/artifacts/contracts/offchain-helpers/router-static/PendleRouterStatic.sol/PendleRouterStatic.dbg.json +1 -1
  227. package/build/artifacts/contracts/offchain-helpers/router-static/PendleRouterStatic.sol/PendleRouterStatic.json +2 -2
  228. package/build/artifacts/contracts/offchain-helpers/router-static/base/ActionInfoStatic.sol/ActionInfoStatic.dbg.json +1 -1
  229. package/build/artifacts/contracts/offchain-helpers/router-static/base/ActionInfoStatic.sol/ActionInfoStatic.json +2 -2
  230. package/build/artifacts/contracts/offchain-helpers/router-static/base/ActionMarketAuxStatic.sol/ActionMarketAuxStatic.dbg.json +1 -1
  231. package/build/artifacts/contracts/offchain-helpers/router-static/base/ActionMarketAuxStatic.sol/ActionMarketAuxStatic.json +2 -2
  232. package/build/artifacts/contracts/offchain-helpers/router-static/base/ActionMarketCoreStatic.sol/ActionMarketCoreStatic.dbg.json +1 -1
  233. package/build/artifacts/contracts/offchain-helpers/router-static/base/ActionMarketCoreStatic.sol/ActionMarketCoreStatic.json +2 -2
  234. package/build/artifacts/contracts/offchain-helpers/router-static/base/ActionMintRedeemStatic.sol/ActionMintRedeemStatic.dbg.json +1 -1
  235. package/build/artifacts/contracts/offchain-helpers/router-static/base/ActionMintRedeemStatic.sol/ActionMintRedeemStatic.json +2 -2
  236. package/build/artifacts/contracts/offchain-helpers/router-static/base/ActionStorageStatic.sol/ActionStorageStatic.dbg.json +1 -1
  237. package/build/artifacts/contracts/offchain-helpers/router-static/base/ActionStorageStatic.sol/ActionStorageStatic.json +2 -2
  238. package/build/artifacts/contracts/offchain-helpers/router-static/base/ActionVePendleStatic.sol/ActionVePendleStatic.dbg.json +1 -1
  239. package/build/artifacts/contracts/offchain-helpers/router-static/base/ActionVePendleStatic.sol/ActionVePendleStatic.json +2 -2
  240. package/build/artifacts/contracts/offchain-helpers/router-static/base/MarketApproxLibV1.sol/MarketApproxPtInLibV1.dbg.json +1 -1
  241. package/build/artifacts/contracts/offchain-helpers/router-static/base/MarketApproxLibV1.sol/MarketApproxPtInLibV1.json +2 -2
  242. package/build/artifacts/contracts/offchain-helpers/router-static/base/MarketApproxLibV1.sol/MarketApproxPtOutLibV1.dbg.json +1 -1
  243. package/build/artifacts/contracts/offchain-helpers/router-static/base/MarketApproxLibV1.sol/MarketApproxPtOutLibV1.json +2 -2
  244. package/build/artifacts/contracts/offchain-helpers/router-static/base/StorageLayout.sol/StorageLayout.dbg.json +1 -1
  245. package/build/artifacts/contracts/oracles/CrossChainOracle/base/PendleCrossChainOracleBaseApp_Init.sol/PendleCrossChainOracleBaseApp_Init.dbg.json +1 -1
  246. package/build/artifacts/contracts/oracles/CrossChainOracle/exchangeRate/PendleExchangeRateOracleApp.sol/PendleExchangeRateOracleApp.dbg.json +1 -1
  247. package/build/artifacts/contracts/oracles/CrossChainOracle/exchangeRate/PendleExchangeRateOracleV2.sol/PendleExchangeRateOracleV2.dbg.json +1 -1
  248. package/build/artifacts/contracts/oracles/CrossChainOracle/libraries/ExchangeRateMsgCodec.sol/ExchangeRateMsgCodec.dbg.json +1 -1
  249. package/build/artifacts/contracts/oracles/PtYtLpOracle/PendleLpOracleLib.sol/PendleLpOracleLib.dbg.json +1 -1
  250. package/build/artifacts/contracts/oracles/PtYtLpOracle/PendlePYLpOracle.sol/PendlePYLpOracle.dbg.json +1 -1
  251. package/build/artifacts/contracts/oracles/PtYtLpOracle/PendlePYOracleLib.sol/PendlePYOracleLib.dbg.json +1 -1
  252. package/build/artifacts/contracts/oracles/PtYtLpOracle/chainlink/PendleChainlinkOracle.sol/PendleChainlinkOracle.dbg.json +1 -1
  253. package/build/artifacts/contracts/oracles/PtYtLpOracle/chainlink/PendleChainlinkOracleFactory.sol/PendleChainlinkOracleFactory.dbg.json +1 -1
  254. package/build/artifacts/contracts/oracles/PtYtLpOracle/chainlink/PendleChainlinkOracleWithQuote.sol/PendleChainlinkOracleWithQuote.dbg.json +1 -1
  255. package/build/artifacts/contracts/oracles/PtYtLpOracle/samples/BoringLpSeller.sol/BoringLpSeller.dbg.json +1 -1
  256. package/build/artifacts/contracts/oracles/PtYtLpOracle/samples/BoringPYUsdChainlinkAssetOracle.sol/BoringPYUsdChainlinkAssetOracle.dbg.json +1 -1
  257. package/build/artifacts/contracts/oracles/PtYtLpOracle/samples/BoringPYUsdChainlinkSYOracle.sol/BoringPYUsdChainlinkSYOracle.dbg.json +1 -1
  258. package/build/artifacts/contracts/oracles/PtYtLpOracle/samples/BoringPtSeller.sol/BoringPtSeller.dbg.json +1 -1
  259. package/build/artifacts/contracts/oracles/StatelessWrapper/PendleLinearDiscountOracleWrapper.sol/PendleLinearDiscountOracleWrapper.dbg.json +1 -1
  260. package/build/artifacts/contracts/oracles/StatelessWrapper/PendleSparkLinearDiscountOracleFactoryWrapper.sol/PendleSparkLinearDiscountOracleFactoryWrapper.dbg.json +1 -1
  261. package/build/artifacts/contracts/oracles/internal/PendleBoringOneracle.sol/PendleBoringOneracle.dbg.json +1 -1
  262. package/build/artifacts/contracts/oracles/internal/PendleBoringSolvBTCOneracle.sol/PendleBoringSolvBTCOneracle.dbg.json +1 -1
  263. package/build/artifacts/contracts/oracles/internal/PendleLpLinearDiscountOracle.sol/LPExpiry.dbg.json +1 -1
  264. package/build/artifacts/contracts/oracles/internal/PendleLpLinearDiscountOracle.sol/PendleLpLinearDiscountOracle.dbg.json +1 -1
  265. package/build/artifacts/contracts/oracles/internal/PendleLpLinearDiscountOracleFactory.sol/PendleLpLinearDiscountOracleFactory.dbg.json +1 -1
  266. package/build/artifacts/contracts/oracles/internal/PendleRedStoneRateOracleAdapter.sol/PendleRedStoneRateOracleAdapter.dbg.json +1 -1
  267. package/build/artifacts/contracts/oracles/internal/PendleSparkLinearDiscountOracle.sol/PTExpiry.dbg.json +1 -1
  268. package/build/artifacts/contracts/oracles/internal/PendleSparkLinearDiscountOracle.sol/PendleSparkLinearDiscountOracle.dbg.json +1 -1
  269. package/build/artifacts/contracts/oracles/internal/PendleSparkLinearDiscountOracleFactory.sol/PendleSparkLinearDiscountOracleFactory.dbg.json +1 -1
  270. package/build/artifacts/contracts/router/ActionAddRemoveLiqV3.sol/ActionAddRemoveLiqV3.dbg.json +1 -1
  271. package/build/artifacts/contracts/router/ActionAddRemoveLiqV3.sol/ActionAddRemoveLiqV3.json +2 -2
  272. package/build/artifacts/contracts/router/ActionCallbackV3.sol/ActionCallbackV3.dbg.json +1 -1
  273. package/build/artifacts/contracts/router/ActionCallbackV3.sol/ActionCallbackV3.json +2 -2
  274. package/build/artifacts/contracts/router/ActionMiscV3.sol/ActionMiscV3.dbg.json +1 -1
  275. package/build/artifacts/contracts/router/ActionMiscV3.sol/ActionMiscV3.json +2 -2
  276. package/build/artifacts/contracts/router/ActionSimple.sol/ActionSimple.dbg.json +1 -1
  277. package/build/artifacts/contracts/router/ActionSimple.sol/ActionSimple.json +2 -2
  278. package/build/artifacts/contracts/router/ActionStorageV4.sol/ActionStorageV4.dbg.json +1 -1
  279. package/build/artifacts/contracts/router/ActionStorageV4.sol/ActionStorageV4.json +2 -2
  280. package/build/artifacts/contracts/router/ActionSwapPTV3.sol/ActionSwapPTV3.dbg.json +1 -1
  281. package/build/artifacts/contracts/router/ActionSwapPTV3.sol/ActionSwapPTV3.json +2 -2
  282. package/build/artifacts/contracts/router/ActionSwapYTV3.sol/ActionSwapYTV3.dbg.json +1 -1
  283. package/build/artifacts/contracts/router/ActionSwapYTV3.sol/ActionSwapYTV3.json +2 -2
  284. package/build/artifacts/contracts/router/PendleRouterV4.sol/PendleRouterV4.dbg.json +1 -1
  285. package/build/artifacts/contracts/router/PendleRouterV4.sol/PendleRouterV4.json +2 -2
  286. package/build/artifacts/contracts/router/Reflector.sol/Reflector.dbg.json +1 -1
  287. package/build/artifacts/contracts/router/Reflector.sol/Reflector.json +2 -2
  288. package/build/artifacts/contracts/router/RouterStorage.sol/RouterStorage.dbg.json +1 -1
  289. package/build/artifacts/contracts/router/base/ActionBase.sol/ActionBase.dbg.json +1 -1
  290. package/build/artifacts/contracts/router/base/ActionDelegateBase.sol/ActionDelegateBase.dbg.json +1 -1
  291. package/build/artifacts/contracts/router/base/ActionDelegateBase.sol/ActionDelegateBase.json +2 -2
  292. package/build/artifacts/contracts/router/base/CallbackHelper.sol/CallbackHelper.dbg.json +1 -1
  293. package/build/artifacts/contracts/router/math/ApproxStateLib.sol/ApproxStateLib.dbg.json +1 -1
  294. package/build/artifacts/contracts/router/math/ApproxStateLib.sol/ApproxStateLib.json +2 -2
  295. package/build/artifacts/contracts/router/math/MarketApproxEstimateLib.sol/MarketApproxEstimateLib.dbg.json +1 -1
  296. package/build/artifacts/contracts/router/math/MarketApproxLibOnchain.sol/MarketApproxPtInLibOnchain.dbg.json +1 -1
  297. package/build/artifacts/contracts/router/math/MarketApproxLibOnchain.sol/MarketApproxPtInLibOnchain.json +2 -2
  298. package/build/artifacts/contracts/router/math/MarketApproxLibOnchain.sol/MarketApproxPtOutLibOnchain.dbg.json +1 -1
  299. package/build/artifacts/contracts/router/math/MarketApproxLibOnchain.sol/MarketApproxPtOutLibOnchain.json +2 -2
  300. package/build/artifacts/contracts/router/math/MarketApproxLibV2.sol/MarketApproxPtInLibV2.dbg.json +1 -1
  301. package/build/artifacts/contracts/router/math/MarketApproxLibV2.sol/MarketApproxPtInLibV2.json +2 -2
  302. package/build/artifacts/contracts/router/math/MarketApproxLibV2.sol/MarketApproxPtOutLibV2.dbg.json +1 -1
  303. package/build/artifacts/contracts/router/math/MarketApproxLibV2.sol/MarketApproxPtOutLibV2.json +2 -2
  304. package/build/artifacts/contracts/router/swap-aggregator/IPSwapAggregator.sol/IPSwapAggregator.dbg.json +1 -1
  305. package/build/artifacts/contracts/router/swap-aggregator/OKXScaleHelper.sol/IOKXDexRouter.dbg.json +1 -1
  306. package/build/artifacts/contracts/router/swap-aggregator/OKXScaleHelper.sol/OKXScaleHelper.dbg.json +1 -1
  307. package/build/artifacts/contracts/router/swap-aggregator/ParaswapScaleHelper.sol/IAugustusV6.dbg.json +1 -1
  308. package/build/artifacts/contracts/router/swap-aggregator/ParaswapScaleHelper.sol/ParaswapScaleHelper.dbg.json +1 -1
  309. package/build/artifacts/contracts/router/swap-aggregator/PendleSwap.sol/IKyberScalingHelper.dbg.json +1 -1
  310. package/build/artifacts/contracts/router/swap-aggregator/PendleSwap.sol/IOdosRouterV2.dbg.json +1 -1
  311. package/build/artifacts/contracts/router/swap-aggregator/PendleSwap.sol/PendleSwap.dbg.json +1 -1
  312. package/build/artifacts/contracts/router/swap-aggregator/PendleSwap.sol/PendleSwap.json +2 -2
  313. package/contracts/LiquidityMining/GaugeController/PendleGaugeControllerUpg.sol +12 -2
  314. package/contracts/core/libraries/TokenHelper.sol +6 -2
  315. package/contracts/cross-chain/FixedPricePTAMMV2.sol +162 -0
  316. package/contracts/{router/ActionCrossChain.sol → cross-chain/PendleSwapHelper.sol} +11 -7
  317. package/contracts/cross-chain/deposit-box/DepositBox.sol +66 -0
  318. package/contracts/cross-chain/deposit-box/DepositBoxFactory.sol +44 -0
  319. package/contracts/cross-chain/funder/BridgeFunder.sol +61 -0
  320. package/contracts/cross-chain/oftImpl/hub/OFTAdapterAltImpl.sol +55 -0
  321. package/contracts/cross-chain/oftImpl/spoke/PendleBridgedPrincipalTokenAlt.sol +64 -0
  322. package/contracts/cross-chain/swap-hub/PendleCrossChainSwapHub.sol +101 -0
  323. package/contracts/cross-chain/swap-hub/SwapHubBase.sol +184 -0
  324. package/contracts/interfaces/IPAllActionTypeV3.sol +1 -0
  325. package/contracts/interfaces/IPAllActionV3.sol +1 -3
  326. package/contracts/interfaces/IPBridgeFunder.sol +17 -0
  327. package/contracts/interfaces/IPCrossChainSwapHub.sol +108 -0
  328. package/contracts/interfaces/IPDepositBox.sol +22 -0
  329. package/contracts/interfaces/IPDepositBoxFactory.sol +19 -0
  330. package/contracts/interfaces/IPFixedPricePTAMMV2.sol +58 -0
  331. package/contracts/interfaces/IPGaugeController.sol +7 -3
  332. package/contracts/interfaces/IPLimitRouter.sol +29 -0
  333. package/contracts/interfaces/{IPActionCrossChain.sol → IPSwapHelper.sol} +1 -1
  334. package/contracts/limit/LimitRouterBase.sol +100 -55
  335. package/contracts/limit/PendleLimitRouter.sol +24 -2
  336. package/contracts/limit/helpers/MintSyHelper.sol +114 -0
  337. package/contracts/offchain-helpers/PendleFeeSetter.sol +19 -1
  338. package/contracts/offchain-helpers/PendleProxyAdmin.sol +11 -0
  339. package/contracts/router/base/ActionBase.sol +16 -2
  340. package/deployments/1-core.json +11 -6
  341. package/deployments/1-offchain-helper.json +1 -1
  342. package/deployments/10-core.json +9 -4
  343. package/deployments/10-offchain-helper.json +1 -1
  344. package/deployments/130-core.json +9 -2
  345. package/deployments/143-core.json +19 -0
  346. package/deployments/146-core.json +9 -4
  347. package/deployments/146-offchain-helper.json +1 -1
  348. package/deployments/42161-core.json +9 -4
  349. package/deployments/42161-offchain-helper.json +1 -1
  350. package/deployments/4217-core.json +14 -0
  351. package/deployments/43114-core.json +6 -2
  352. package/deployments/43114-offchain-helper.json +3 -0
  353. package/deployments/5000-core.json +9 -4
  354. package/deployments/5000-offchain-helper.json +1 -1
  355. package/deployments/56-core.json +9 -4
  356. package/deployments/56-offchain-helper.json +1 -1
  357. package/deployments/57073-core.json +19 -0
  358. package/deployments/747474-core.json +19 -0
  359. package/deployments/80094-core.json +9 -4
  360. package/deployments/80094-offchain-helper.json +1 -1
  361. package/deployments/8453-core.json +9 -4
  362. package/deployments/8453-offchain-helper.json +1 -1
  363. package/deployments/9745-core.json +8 -3
  364. package/deployments/9745-offchain-helper.json +1 -1
  365. package/deployments/999-core.json +8 -3
  366. package/deployments/999-offchain-helper.json +1 -1
  367. package/package.json +2 -2
  368. package/typechain-types/BridgeFunder.ts +344 -0
  369. package/typechain-types/DepositBox.ts +260 -0
  370. package/typechain-types/DepositBoxFactory.ts +226 -0
  371. package/typechain-types/FixedPricePTAMMV2.ts +1104 -0
  372. package/typechain-types/IPAllActionV3.ts +0 -54
  373. package/typechain-types/IPBridgeFunder.ts +165 -0
  374. package/typechain-types/IPCrossChainSwapHub.ts +656 -0
  375. package/typechain-types/IPDepositBox.ts +213 -0
  376. package/typechain-types/IPDepositBoxFactory.ts +226 -0
  377. package/typechain-types/IPFixedPricePTAMMV2.ts +864 -0
  378. package/typechain-types/IPGaugeController.ts +86 -0
  379. package/typechain-types/IPLimitRouter.ts +187 -0
  380. package/typechain-types/IPSwapHelper.ts +161 -0
  381. package/typechain-types/LimitRouterBase.ts +295 -34
  382. package/typechain-types/MintSyHelper.ts +230 -0
  383. package/typechain-types/OFTAdapterAltImpl.ts +1350 -0
  384. package/typechain-types/PendleBridgedPrincipalTokenAlt.ts +1708 -0
  385. package/typechain-types/PendleCrossChainSwapHub.ts +911 -0
  386. package/typechain-types/PendleFeeSetter.ts +53 -0
  387. package/typechain-types/PendleGaugeControllerUpg.ts +86 -0
  388. package/typechain-types/PendleLimitRouter.ts +295 -34
  389. package/typechain-types/PendleProxyAdmin.ts +341 -0
  390. package/typechain-types/PendleSwapHelper.ts +161 -0
  391. package/typechain-types/ProxyAdmin.ts +341 -0
  392. package/typechain-types/SwapHubBase.ts +886 -0
  393. package/typechain-types/factories/ActionAddRemoveLiqV3__factory.ts +1 -1
  394. package/typechain-types/factories/ActionCallbackV3__factory.ts +1 -1
  395. package/typechain-types/factories/ActionCrossChain__factory.ts +1 -1
  396. package/typechain-types/factories/ActionInfoStatic__factory.ts +1 -1
  397. package/typechain-types/factories/ActionMarketAuxStatic__factory.ts +1 -1
  398. package/typechain-types/factories/ActionMarketCoreStatic__factory.ts +1 -1
  399. package/typechain-types/factories/ActionMintRedeemStatic__factory.ts +1 -1
  400. package/typechain-types/factories/ActionMiscV3__factory.ts +1 -1
  401. package/typechain-types/factories/ActionSimple__factory.ts +1 -1
  402. package/typechain-types/factories/ActionStorageStatic__factory.ts +1 -1
  403. package/typechain-types/factories/ActionStorageV4__factory.ts +1 -1
  404. package/typechain-types/factories/ActionSwapPTV3__factory.ts +1 -1
  405. package/typechain-types/factories/ActionSwapYTV3__factory.ts +1 -1
  406. package/typechain-types/factories/ActionVePendleStatic__factory.ts +1 -1
  407. package/typechain-types/factories/BridgeFunder__factory.ts +265 -0
  408. package/typechain-types/factories/DepositBoxFactory__factory.ts +189 -0
  409. package/typechain-types/factories/DepositBox__factory.ts +222 -0
  410. package/typechain-types/factories/ExpiredLpPtRedeemer__factory.ts +1 -1
  411. package/typechain-types/factories/FixedPricePTAMMV2__factory.ts +824 -0
  412. package/typechain-types/factories/FixedPricePTAMM__factory.ts +1 -1
  413. package/typechain-types/factories/IPAllActionV3__factory.ts +0 -88
  414. package/typechain-types/factories/IPBridgeFunder__factory.ts +100 -0
  415. package/typechain-types/factories/IPCrossChainSwapHub__factory.ts +828 -0
  416. package/typechain-types/factories/IPDepositBoxFactory__factory.ts +123 -0
  417. package/typechain-types/factories/IPDepositBox__factory.ts +136 -0
  418. package/typechain-types/factories/IPFixedPricePTAMMV2__factory.ts +621 -0
  419. package/typechain-types/factories/IPGaugeController__factory.ts +56 -0
  420. package/typechain-types/factories/IPLimitRouter__factory.ts +387 -0
  421. package/typechain-types/factories/IPSwapHelper__factory.ts +111 -0
  422. package/typechain-types/factories/LimitBackendHelperV2__factory.ts +1 -1
  423. package/typechain-types/factories/LimitRouterBase__factory.ts +473 -11
  424. package/typechain-types/factories/MarketSweed__factory.ts +1 -1
  425. package/typechain-types/factories/MintSyHelper__factory.ts +168 -0
  426. package/typechain-types/factories/OFTAdapterAltImpl__factory.ts +1363 -0
  427. package/typechain-types/factories/PendleAPIFeeDepositor__factory.ts +1 -1
  428. package/typechain-types/factories/PendleBridgedPrincipalTokenAlt__factory.ts +1702 -0
  429. package/typechain-types/factories/PendleCommonPoolDeployHelperV2__factory.ts +1 -1
  430. package/typechain-types/factories/PendleCrossChainSwapHub__factory.ts +1074 -0
  431. package/typechain-types/factories/PendleFeeDistributorV2__factory.ts +1 -1
  432. package/typechain-types/factories/PendleFeeSetter__factory.ts +36 -1
  433. package/typechain-types/factories/PendleGaugeControllerUpg__factory.ts +57 -1
  434. package/typechain-types/factories/PendleLPWrapperFactory__factory.ts +1 -1
  435. package/typechain-types/factories/PendleLPWrapper__factory.ts +1 -1
  436. package/typechain-types/factories/PendleLimitRouter__factory.ts +483 -13
  437. package/typechain-types/factories/PendleMarketV7__factory.ts +1 -1
  438. package/typechain-types/factories/PendleMerkleDistributor__factory.ts +1 -1
  439. package/typechain-types/factories/PendleMultiTokenMerkleDistributor__factory.ts +1 -1
  440. package/typechain-types/factories/PendlePoolDeployHelperV2__factory.ts +1 -1
  441. package/typechain-types/factories/PendlePoolDeployHelper__factory.ts +1 -1
  442. package/typechain-types/factories/PendleProxyAdmin__factory.ts +229 -0
  443. package/typechain-types/factories/PendleRouterStatic__factory.ts +1 -1
  444. package/typechain-types/factories/PendleRouterV4__factory.ts +1 -1
  445. package/typechain-types/factories/PendleSwapHelper__factory.ts +152 -0
  446. package/typechain-types/factories/PendleSwap__factory.ts +1 -1
  447. package/typechain-types/factories/PendleYieldContractFactoryUpg__factory.ts +1 -1
  448. package/typechain-types/factories/PendleYieldToken__factory.ts +1 -1
  449. package/typechain-types/factories/ProxyAdmin__factory.ts +210 -0
  450. package/typechain-types/factories/Reflector__factory.ts +1 -1
  451. package/typechain-types/factories/StakedPendle__factory.ts +1 -1
  452. package/typechain-types/factories/SwapHubBase__factory.ts +988 -0
  453. package/typechain-types/hardhat.d.ts +180 -9
  454. package/typechain-types/index.ts +36 -2
  455. package/build/artifacts/contracts/StPendle.sol/RoundDataLib.dbg.json +0 -4
  456. package/build/artifacts/contracts/StPendle.sol/RoundDataLib.json +0 -10
  457. package/build/artifacts/contracts/StPendle.sol/StPendle.dbg.json +0 -4
  458. package/build/artifacts/contracts/StPendle.sol/StPendle.json +0 -228
  459. package/build/artifacts/contracts/cross-chain/FixedPricePTAMM.sol/FixedPricePTAMM.dbg.json +0 -4
  460. package/build/artifacts/contracts/cross-chain/FixedPricePTAMM.sol/FixedPricePTAMM.json +0 -667
  461. package/build/artifacts/contracts/interfaces/IPActionCrossChain.sol/IPActionCrossChain.dbg.json +0 -4
  462. package/build/artifacts/contracts/interfaces/IPFixedPricePTAMM.sol/IPFixedPricePTAMM.dbg.json +0 -4
  463. package/build/artifacts/contracts/interfaces/IPFixedPricePTAMM.sol/IPFixedPricePTAMMSwapCallback.dbg.json +0 -4
  464. package/build/artifacts/contracts/router/ActionCrossChain.sol/ActionCrossChain.dbg.json +0 -4
  465. package/build/artifacts/contracts/router/ActionCrossChain.sol/ActionCrossChain.json +0 -99
  466. package/contracts/StPendle.sol +0 -121
  467. package/contracts/cross-chain/FixedPricePTAMM.sol +0 -200
  468. package/contracts/interfaces/IPFixedPricePTAMM.sol +0 -69
  469. package/typechain-types/StPendle.ts +0 -362
  470. package/typechain-types/factories/StPendle__factory.ts +0 -260
@@ -4,18 +4,18 @@ pragma solidity ^0.8.17;
4
4
 
5
5
  import "../core/libraries/BoringOwnableUpgradeableV2.sol";
6
6
  import "../core/libraries/TokenHelper.sol";
7
+ import "../interfaces/IPAllActionV3.sol";
7
8
  import "../interfaces/IPLimitRouter.sol";
8
9
  import "../interfaces/IStandardizedYield.sol";
9
- import "../interfaces/IWETH.sol";
10
10
  import {LimitMathCore as LimitMath} from "./LimitMathCore.sol";
11
+ import "./helpers/MintSyHelper.sol";
11
12
  import "./helpers/NonceManager.sol";
12
- import "@openzeppelin/contracts-upgradeable/utils/cryptography/draft-EIP712Upgradeable.sol";
13
13
  import "@openzeppelin/contracts/utils/cryptography/SignatureChecker.sol";
14
14
 
15
15
  abstract contract LimitRouterBase is
16
- EIP712Upgradeable,
17
16
  IPLimitRouter,
18
17
  BoringOwnableUpgradeableV2,
18
+ MintSyHelper,
19
19
  NonceManager,
20
20
  TokenHelper
21
21
  {
@@ -28,31 +28,28 @@ abstract contract LimitRouterBase is
28
28
 
29
29
  uint128 internal constant _ORDER_DOES_NOT_EXIST = 0;
30
30
  uint128 internal constant _ORDER_FILLED = 1;
31
- uint256 internal constant NEW_PRIME = 12_421;
32
31
  uint256 internal constant MAX_LN_FEE_RATE_ROOT = 48_790_164_169_432_003; // ln(1.05)
33
32
 
34
- bytes private constant EMPTY_BYTES = abi.encode();
35
-
36
33
  address public feeRecipient;
37
34
 
38
35
  // YT => lnFeeRateRoot // not to be accessed directly
39
36
  mapping(address => uint256) internal __lnFeeRateRoot;
40
37
 
41
38
  address public immutable WNATIVE;
39
+ address public immutable ROUTER;
42
40
 
43
41
  mapping(bytes32 => OrderStatus) internal _status;
44
42
 
45
- address public ownerHelper;
43
+ address private __deprecated__ownerHelper;
46
44
 
47
- uint256[99] private __gap;
45
+ address public mintSySigner1;
46
+ address public mintSySigner2;
48
47
 
49
- modifier onlyHelperAndOwner() {
50
- require(msg.sender == ownerHelper || msg.sender == owner, "not allowed");
51
- _;
52
- }
48
+ uint256[97] private __gap;
53
49
 
54
- constructor(address _WNATIVE) {
50
+ constructor(address _WNATIVE, address _ROUTER) {
55
51
  WNATIVE = _WNATIVE;
52
+ ROUTER = _ROUTER;
56
53
  }
57
54
 
58
55
  // solhint-disable-next-line no-empty-blocks
@@ -69,18 +66,20 @@ abstract contract LimitRouterBase is
69
66
  FillOrderParams[] memory params,
70
67
  address receiver,
71
68
  uint256 maxTaking,
72
- bytes calldata,
73
- /*optData*/
69
+ bytes memory optData,
74
70
  bytes memory callback
75
71
  ) external returns (uint256 actualMaking, uint256 actualTaking, uint256 totalFee, bytes memory callbackReturn) {
76
- params = _validateSkipSigAndFilterOrders(params);
72
+ OptionalArgs memory oArgs = _decodeAndVerifySigOpt_prePrune(params, optData);
73
+
74
+ _validateSkipSigAndPruneOrders(params);
77
75
  if (params.length == 0) return fillNoOrders(callback);
78
76
 
79
77
  OrderType orderType = params[0].order.orderType;
78
+ Args memory a = Args(orderType, params, receiver, maxTaking, callback, oArgs);
80
79
  if (orderType == OrderType.SY_FOR_PT || orderType == OrderType.SY_FOR_YT) {
81
- return fillTokenForPY(Args(orderType, params, receiver, maxTaking, callback));
80
+ return fillTokenForPY(a);
82
81
  } else {
83
- return fillPYForToken(Args(orderType, params, receiver, maxTaking, callback));
82
+ return fillPYForToken(a);
84
83
  }
85
84
  }
86
85
 
@@ -92,6 +91,11 @@ abstract contract LimitRouterBase is
92
91
  address receiver;
93
92
  uint256 maxTaking;
94
93
  bytes callback;
94
+ OptionalArgs oArgs;
95
+ }
96
+
97
+ struct OptionalArgs {
98
+ MintSyData mintSyData;
95
99
  }
96
100
 
97
101
  function fillNoOrders(bytes memory callback)
@@ -109,7 +113,7 @@ abstract contract LimitRouterBase is
109
113
  (address SY, address PT, address YT, bytes32[] memory orderHashes) = _checkSig_updMakingAndStatus(a.params);
110
114
 
111
115
  // Token => This
112
- uint256[] memory fromMakers = _transferFromMakers_mintSy_updMakings(SY, a.params);
116
+ uint256[] memory fromMakers = _transferFromMakers_mintSy_updMakings(SY, a.params, a.oArgs.mintSyData);
113
117
 
114
118
  FillResults memory out = LimitMath.calcBatch(a.params, YT, getLnFeeRateRoot(YT));
115
119
  (actualMaking, actualTaking, totalFee) = (out.totalMaking - out.totalFee, out.totalTaking, out.totalFee);
@@ -165,35 +169,43 @@ abstract contract LimitRouterBase is
165
169
  }
166
170
 
167
171
  // ----------------- verify & convert functions -----------------
168
- function _validateSkipSigAndFilterOrders(FillOrderParams[] memory params)
172
+
173
+ function _decodeAndVerifySigOpt_prePrune(FillOrderParams[] memory params, bytes memory optData)
169
174
  internal
170
175
  view
171
- returns (FillOrderParams[] memory res)
176
+ returns (OptionalArgs memory oArgs)
172
177
  {
178
+ if (optData.length != 0) {
179
+ (uint256 version, bytes memory payload) = abi.decode(optData, (uint256, bytes));
180
+ require(version == 1, "LOP: invalid version");
181
+
182
+ oArgs.mintSyData = abi.decode(payload, (MintSyData));
183
+ _verifyMintSyData(oArgs.mintSyData, hashFillParams(params), mintSySigner1, mintSySigner2);
184
+ }
185
+ }
186
+
187
+ function _validateSkipSigAndPruneOrders(FillOrderParams[] memory params) internal view {
173
188
  uint256 len = params.length;
174
189
  require(len != 0, "LOP: empty batch");
175
190
 
176
191
  (address YT, OrderType orderType) = (params[0].order.YT, params[0].order.orderType);
177
192
  require(block.timestamp < IPYieldToken(YT).expiry(), "LOP: PY expired");
178
193
 
179
- uint256 skipped = 0;
194
+ uint256 keep = 0;
180
195
  for (uint256 i = 0; i < len; i++) {
181
196
  Order memory order = params[i].order;
197
+
198
+ require(i == 0 || order.token >= params[i - 1].order.token, "LOP: invalid ordering");
182
199
  require(order.orderType == orderType && order.YT == YT, "LOP: mismatch types");
183
200
 
184
- if (!(block.timestamp < order.expiry && order.nonce >= nonce[order.maker])) {
185
- skipped++;
186
- params[i].signature = EMPTY_BYTES;
187
- }
201
+ if (!(block.timestamp < order.expiry && order.nonce >= nonce[order.maker])) continue;
202
+
203
+ params[keep] = params[i];
204
+ keep++;
188
205
  }
189
206
 
190
- res = new FillOrderParams[](len - skipped);
191
- uint256 iter = 0;
192
- for (uint256 i = 0; i < len; i++) {
193
- if (params[i].signature.length != 0) {
194
- res[iter] = params[i];
195
- iter++;
196
- }
207
+ assembly ("memory-safe") {
208
+ mstore(params, keep)
197
209
  }
198
210
  }
199
211
 
@@ -294,12 +306,13 @@ abstract contract LimitRouterBase is
294
306
  return (orderHash, remainingMakerAmount, filledMakerAmount);
295
307
  }
296
308
 
297
- // ----------------- simple helper functions functions -----------------
309
+ // ----------------- simple helper functions -----------------
298
310
 
299
- function _transferFromMakers_mintSy_updMakings(address SY, FillOrderParams[] memory params)
300
- internal
301
- returns (uint256[] memory fromMakers)
302
- {
311
+ function _transferFromMakers_mintSy_updMakings(
312
+ address SY,
313
+ FillOrderParams[] memory params,
314
+ MintSyData memory mintSyData
315
+ ) internal returns (uint256[] memory fromMakers) {
303
316
  uint256 len = params.length;
304
317
  fromMakers = new uint256[](len);
305
318
 
@@ -314,21 +327,54 @@ abstract contract LimitRouterBase is
314
327
 
315
328
  if (sharedToken == SY || totalMaking == 0) continue;
316
329
 
317
- uint256 totalSy = __mintSy_Single(SY, sharedToken, totalMaking);
330
+ uint256 totalSy = __mintSy_Single(SY, sharedToken, totalMaking, mintSyData.inps, mintSyData.minSyOuts);
318
331
  for (uint256 i = l; i < r; i++) {
319
332
  uint256 netToken = params[i].makingAmount;
320
333
  uint256 netSy = (netToken * totalSy) / totalMaking;
321
-
322
- if (_isNewOrder(params[i].order)) {
323
- require(netToken.mulDown(params[i].order.failSafeRate) <= netSy, "LOP: fail safe");
324
- }
334
+ require(netToken.mulDown(params[i].order.failSafeRate) <= netSy, "LOP: fail safe");
325
335
 
326
336
  params[i].makingAmount = netSy;
327
337
  }
328
338
  }
329
339
  }
330
340
 
331
- function __mintSy_Single(address SY, address token, uint256 netTokenIn) private returns (uint256 netSyOut) {
341
+ /// @dev each token group appears at most once because params are sorted by token
342
+ function __mintSy_Single(
343
+ address SY,
344
+ address token,
345
+ uint256 netTokenIn,
346
+ TokenInput[] memory inps,
347
+ uint256[] memory minSyOuts
348
+ ) private returns (uint256 netSyOut) {
349
+ for (uint256 i = 0; i < inps.length; i++) {
350
+ if (inps[i].tokenIn == token) {
351
+ return __mintSy_Single_viaRouter(SY, token, netTokenIn, inps[i], minSyOuts[i]);
352
+ }
353
+ }
354
+ return __mintSy_Single_direct(SY, token, netTokenIn);
355
+ }
356
+
357
+ function __mintSy_Single_viaRouter(
358
+ address SY,
359
+ address token,
360
+ uint256 netTokenIn,
361
+ TokenInput memory inp,
362
+ uint256 minSyOut
363
+ ) private returns (uint256 netSyOut) {
364
+ require(inp.swapData.needScale, "LOP: need scale");
365
+ require(netTokenIn <= inp.netTokenIn, "LOP: only scale down");
366
+
367
+ // Scale down input
368
+ uint256 scaledMinSyOut = (minSyOut * netTokenIn) / inp.netTokenIn;
369
+ require(scaledMinSyOut > 0, "LOP: zero scaledMinSy");
370
+ inp.netTokenIn = netTokenIn;
371
+
372
+ // Approve and mint via router
373
+ _safeApproveInf(token, ROUTER);
374
+ netSyOut = IPAllActionV3(ROUTER).mintSyFromToken(address(this), SY, scaledMinSyOut, inp);
375
+ }
376
+
377
+ function __mintSy_Single_direct(address SY, address token, uint256 netTokenIn) private returns (uint256 netSyOut) {
332
378
  if (token == WNATIVE && !IStandardizedYield(SY).isValidTokenIn(WNATIVE)) {
333
379
  _wrap_unwrap_ETH(WNATIVE, NATIVE, netTokenIn);
334
380
  token = NATIVE;
@@ -379,12 +425,9 @@ abstract contract LimitRouterBase is
379
425
  }
380
426
 
381
427
  for (uint256 i = l; i < r; i++) {
382
- if (_isNewOrder(params[i].order)) {
383
- uint256 netSy = netSyOuts[i];
384
- uint256 netToken = toMakers[i];
385
-
386
- require(netSy.mulDown(params[i].order.failSafeRate) <= netToken, "LOP: fail safe");
387
- }
428
+ uint256 netSy = netSyOuts[i];
429
+ uint256 netToken = toMakers[i];
430
+ require(netSy.mulDown(params[i].order.failSafeRate) <= netToken, "LOP: fail safe");
388
431
  }
389
432
  }
390
433
  }
@@ -437,8 +480,8 @@ abstract contract LimitRouterBase is
437
480
  }
438
481
  }
439
482
 
440
- function _isNewOrder(Order memory order) internal pure returns (bool) {
441
- return order.salt % NEW_PRIME == 0;
483
+ function hashFillParams(FillOrderParams[] memory params) public pure returns (bytes32) {
484
+ return keccak256(abi.encode(params));
442
485
  }
443
486
 
444
487
  function hashOrder(Order memory order) public view returns (bytes32) {
@@ -460,14 +503,16 @@ abstract contract LimitRouterBase is
460
503
  feeRecipient = _feeRecipient;
461
504
  }
462
505
 
463
- function setOwnerHelper(address _helper) public onlyOwner {
464
- ownerHelper = _helper;
506
+ function setMintSySigners(address _signer1, address _signer2) public onlyOwner {
507
+ mintSySigner1 = _signer1;
508
+ mintSySigner2 = _signer2;
509
+ emit MintSySignersSet(_signer1, _signer2);
465
510
  }
466
511
 
467
512
  /// @dev if zero fees are intended, it must be explicitly allowed again
468
513
  function setLnFeeRateRoots(address[] memory YTs, uint256[] memory lnFeeRateRoots, bool allowZeroFees)
469
514
  public
470
- onlyHelperAndOwner
515
+ onlyOwner
471
516
  {
472
517
  uint256 len = YTs.length;
473
518
  require(len == lnFeeRateRoots.length, "LOP: length mismatch");
@@ -6,11 +6,33 @@ import "./LimitRouterBase.sol";
6
6
 
7
7
  contract PendleLimitRouter is LimitRouterBase {
8
8
  using Address for address;
9
+ using PMath for uint256;
9
10
 
10
- constructor(address _WNATIVE) LimitRouterBase(_WNATIVE) {
11
+ constructor(address _WNATIVE, address _ROUTER) LimitRouterBase(_WNATIVE, _ROUTER) {
11
12
  _disableInitializers();
12
13
  }
13
14
 
15
+ /// @notice Pre-sign multiple orders on-chain by setting remaining amount to makingAmount
16
+ function preSignBatch(Order[] calldata orders) external {
17
+ for (uint256 i = 0; i < orders.length; ++i) {
18
+ preSignSingle(orders[i]);
19
+ }
20
+ }
21
+
22
+ /// @notice Pre-sign order by setting remaining amount to makingAmount
23
+ /// @dev Allow bypassing EIP-712 signature validation during fill
24
+ function preSignSingle(Order calldata order) public {
25
+ require(order.maker == msg.sender, "LOP: Access denied");
26
+ require(order.nonce >= nonce[order.maker], "LOP: invalid nonce");
27
+ require(block.timestamp < order.expiry && order.expiry < IPYieldToken(order.YT).expiry(), "LOP: invalid expiry");
28
+
29
+ bytes32 orderHash = hashOrder(order);
30
+ require(_status[orderHash].remaining == _ORDER_DOES_NOT_EXIST, "LOP: already exist");
31
+ _status[orderHash].remaining = (order.makingAmount + 1).Uint128();
32
+
33
+ emit OrderPreSigned(orderHash, order);
34
+ }
35
+
14
36
  /// @notice Cancels multiple orders by setting remaining amount to zero
15
37
  function cancelBatch(Order[] calldata orders) external {
16
38
  for (uint256 i = 0; i < orders.length; ++i) {
@@ -30,7 +52,7 @@ contract PendleLimitRouter is LimitRouterBase {
30
52
  }
31
53
 
32
54
  /// @dev auto skip cancelled orders to avoid race conditions
33
- function forceCancel(bytes32[] calldata orderHashes) public onlyHelperAndOwner {
55
+ function forceCancel(bytes32[] calldata orderHashes) public onlyOwner {
34
56
  for (uint256 i = 0; i < orderHashes.length; ++i) {
35
57
  if (_status[orderHashes[i]].remaining == _ORDER_FILLED) continue;
36
58
 
@@ -0,0 +1,114 @@
1
+ // SPDX-License-Identifier: MIT
2
+ pragma solidity ^0.8.17;
3
+
4
+ import "../../interfaces/IPLimitRouter.sol";
5
+ import "../../interfaces/IPAllActionTypeV3.sol";
6
+ import "@openzeppelin/contracts/utils/cryptography/SignatureChecker.sol";
7
+ import "@openzeppelin/contracts-upgradeable/utils/cryptography/draft-EIP712Upgradeable.sol";
8
+
9
+ abstract contract MintSyHelper is EIP712Upgradeable {
10
+ // forgefmt: disable-next-item
11
+ bytes32 internal constant SWAP_DATA_TYPEHASH = keccak256(
12
+ "SwapData("
13
+ "uint8 swapType,"
14
+ "address extRouter,"
15
+ "bytes extCalldata,"
16
+ "bool needScale"
17
+ ")"
18
+ );
19
+
20
+ // forgefmt: disable-next-item
21
+ bytes32 internal constant TOKEN_INPUT_TYPEHASH = keccak256(
22
+ "TokenInput("
23
+ "address tokenIn,"
24
+ "uint256 netTokenIn,"
25
+ "address tokenMintSy,"
26
+ "address pendleSwap,"
27
+ "SwapData swapData"
28
+ ")"
29
+ "SwapData("
30
+ "uint8 swapType,"
31
+ "address extRouter,"
32
+ "bytes extCalldata,"
33
+ "bool needScale"
34
+ ")"
35
+ );
36
+
37
+ // forgefmt: disable-next-item
38
+ bytes32 internal constant MINT_SY_PAYLOAD_TYPEHASH = keccak256(
39
+ "MintSyPayload("
40
+ "TokenInput[] inps,"
41
+ "uint256[] minSyOuts,"
42
+ "uint256 expiry,"
43
+ "bytes32 fillParamsHash"
44
+ ")"
45
+ "SwapData("
46
+ "uint8 swapType,"
47
+ "address extRouter,"
48
+ "bytes extCalldata,"
49
+ "bool needScale"
50
+ ")"
51
+ "TokenInput("
52
+ "address tokenIn,"
53
+ "uint256 netTokenIn,"
54
+ "address tokenMintSy,"
55
+ "address pendleSwap,"
56
+ "SwapData swapData"
57
+ ")"
58
+ );
59
+
60
+ function _verifyMintSyData(MintSyData memory mintSyData, bytes32 fillParamsHash, address signer1, address signer2)
61
+ internal
62
+ view
63
+ {
64
+ require(block.timestamp < mintSyData.expiry, "LOP: mintSy expired");
65
+ require(mintSyData.fillParamsHash == fillParamsHash, "LOP: mintSy params mismatch");
66
+ require(mintSyData.inps.length == mintSyData.minSyOuts.length, "LOP: length mismatch");
67
+
68
+ bytes32 digest =
69
+ hashMintSyPayload(mintSyData.inps, mintSyData.minSyOuts, mintSyData.expiry, mintSyData.fillParamsHash);
70
+
71
+ require(SignatureChecker.isValidSignatureNow(signer1, digest, mintSyData.sig1), "LOP: bad mintSy sig1");
72
+ require(SignatureChecker.isValidSignatureNow(signer2, digest, mintSyData.sig2), "LOP: bad mintSy sig2");
73
+ }
74
+
75
+ function _hashSwapData(SwapData memory d) internal pure returns (bytes32) {
76
+ return keccak256(abi.encode(SWAP_DATA_TYPEHASH, d.swapType, d.extRouter, keccak256(d.extCalldata), d.needScale));
77
+ }
78
+
79
+ function _hashTokenInput(TokenInput memory inp) internal pure returns (bytes32) {
80
+ return keccak256(
81
+ abi.encode(
82
+ TOKEN_INPUT_TYPEHASH,
83
+ inp.tokenIn,
84
+ inp.netTokenIn,
85
+ inp.tokenMintSy,
86
+ inp.pendleSwap,
87
+ _hashSwapData(inp.swapData)
88
+ )
89
+ );
90
+ }
91
+
92
+ function hashMintSyPayload(
93
+ TokenInput[] memory inps,
94
+ uint256[] memory minSyOuts,
95
+ uint256 expiry,
96
+ bytes32 fillParamsHash
97
+ ) public view returns (bytes32) {
98
+ bytes32[] memory inpHashes = new bytes32[](inps.length);
99
+ for (uint256 i = 0; i < inps.length; i++) {
100
+ inpHashes[i] = _hashTokenInput(inps[i]);
101
+ }
102
+ return _hashTypedDataV4(
103
+ keccak256(
104
+ abi.encode(
105
+ MINT_SY_PAYLOAD_TYPEHASH,
106
+ keccak256(abi.encodePacked(inpHashes)),
107
+ keccak256(abi.encodePacked(minSyOuts)),
108
+ expiry,
109
+ fillParamsHash
110
+ )
111
+ )
112
+ );
113
+ }
114
+ }
@@ -21,8 +21,10 @@ contract PendleFeeSetter is BoringOwnableUpgradeableV2 {
21
21
  event SetterSet(address indexed setter);
22
22
 
23
23
  uint256 internal constant LIMIT_MAX_LN_FEE_RATE_ROOT = 48_790_164_169_432_003; // ln(1.05)
24
+ uint256 internal constant POST_FILL_AMM_LN_FEE_RATE_ROOT = 999_999_500_000; // ln(1.000001)
24
25
 
25
26
  address public immutable router;
27
+ address public immutable postFillRouter;
26
28
  IPLimitRouter public immutable limitRouter;
27
29
  IPGovernanceProxy public immutable govProxy;
28
30
 
@@ -35,9 +37,10 @@ contract PendleFeeSetter is BoringOwnableUpgradeableV2 {
35
37
  _;
36
38
  }
37
39
 
38
- constructor(address _router, address _limitRouter, address _govProxy) {
40
+ constructor(address _router, address _postFillRouter, address _limitRouter, address _govProxy) {
39
41
  _disableInitializers();
40
42
  router = _router;
43
+ postFillRouter = _postFillRouter;
41
44
  limitRouter = IPLimitRouter(_limitRouter);
42
45
  govProxy = IPGovernanceProxy(_govProxy);
43
46
  }
@@ -50,6 +53,21 @@ contract PendleFeeSetter is BoringOwnableUpgradeableV2 {
50
53
  _setFeeFactors(_impliedRateToFeeFactor, _routerLnFeeToLimitLnFeeFactor);
51
54
  }
52
55
 
56
+ function setPostFillRouterAMMFee(address[] memory markets) external onlyOwnerOrSetter {
57
+ uint256 n = markets.length;
58
+
59
+ IPGovernanceProxy.Call[] memory calls = new IPGovernanceProxy.Call[](n);
60
+
61
+ for (uint256 i = 0; i < n; ++i) {
62
+ calls[i].target = IPMarket(markets[i]).factory();
63
+ calls[i].callData = abi.encodeCall(
64
+ IPMarketFactory.setOverriddenFee, (postFillRouter, markets[i], POST_FILL_AMM_LN_FEE_RATE_ROOT.Uint80())
65
+ );
66
+ }
67
+
68
+ govProxy.aggregateWithScopedAccess(calls);
69
+ }
70
+
53
71
  function setFees(address[] memory markets) external onlyOwnerOrSetter {
54
72
  uint256 n = markets.length;
55
73
 
@@ -0,0 +1,11 @@
1
+ // SPDX-License-Identifier: GPL-3.0-or-later
2
+ pragma solidity ^0.8.0;
3
+
4
+ import {ProxyAdmin} from "@openzeppelin/contracts/proxy/transparent/ProxyAdmin.sol";
5
+
6
+ /// @dev ProxyAdmin with configurable initial owner, since OZ's ProxyAdmin doesn't support setting owner in constructor.
7
+ contract PendleProxyAdmin is ProxyAdmin {
8
+ constructor(address initialOwner) {
9
+ _transferOwnership(initialOwner);
10
+ }
11
+ }
@@ -323,10 +323,12 @@ abstract contract ActionBase is TokenHelper, CallbackHelper, IPLimitOrderType {
323
323
  IPLimitRouter router = IPLimitRouter(lim.limitRouter);
324
324
  netLeft = netInput;
325
325
 
326
+ (bytes memory normalOptData, bytes memory flashOptData) = _decodeLimOptData(lim.optData);
327
+
326
328
  if (lim.normalFills.length != 0) {
327
329
  _safeApproveInf(address(tokenIn), lim.limitRouter);
328
330
  (uint256 actualMaking, uint256 actualTaking, uint256 totalFee,) =
329
- router.fill(lim.normalFills, receiver, netLeft, lim.optData, EMPTY_BYTES);
331
+ router.fill(lim.normalFills, receiver, netLeft, normalOptData, EMPTY_BYTES);
330
332
  netOut += actualMaking;
331
333
  netLeft -= actualTaking;
332
334
  netSyFee += totalFee;
@@ -337,7 +339,7 @@ abstract contract ActionBase is TokenHelper, CallbackHelper, IPLimitOrderType {
337
339
  OrderType orderType = lim.flashFills[0].order.orderType;
338
340
 
339
341
  (,, uint256 totalFee, bytes memory ret) = router.fill(
340
- lim.flashFills, YT, type(uint256).max, lim.optData, abi.encode(orderType, YT, netLeft, receiver)
342
+ lim.flashFills, YT, type(uint256).max, flashOptData, abi.encode(orderType, YT, netLeft, receiver)
341
343
  );
342
344
  (uint256 netUse, uint256 netReceived) = abi.decode(ret, (uint256, uint256));
343
345
 
@@ -349,6 +351,18 @@ abstract contract ActionBase is TokenHelper, CallbackHelper, IPLimitOrderType {
349
351
  doMarketOrder = netLeft > netInput.mulDown(lim.epsSkipMarket);
350
352
  }
351
353
 
354
+ function _decodeLimOptData(bytes memory limOptData)
355
+ internal
356
+ pure
357
+ returns (bytes memory normalOptData, bytes memory flashOptData)
358
+ {
359
+ if (limOptData.length != 0) {
360
+ (uint256 version, bytes memory payload) = abi.decode(limOptData, (uint256, bytes));
361
+ require(version == 1, "invalid version");
362
+ (normalOptData, flashOptData) = abi.decode(payload, (bytes, bytes));
363
+ }
364
+ }
365
+
352
366
  function _isEmptyLimit(LimitOrderData calldata a) internal pure returns (bool) {
353
367
  return a.normalFills.length == 0 && a.flashFills.length == 0;
354
368
  }
@@ -46,24 +46,21 @@
46
46
  "poolDeployHelperV2": "0xF642d8Daa026B8aEd6dFE82FACbA2E077AF199E2",
47
47
  "limitRouter": "0x000000000000c9B3E2C3Ec88B1B4c0cD853f4321",
48
48
  "proxyAdmin": "0xA28c08f165116587D4F3E708743B4dEe155c5E64",
49
+ "devProxyAdmin": "0xD37eB2E6DE40a33ba68BaD94427723b66c954EA9",
49
50
  "reflector": "0x30544e00Cf296B34A9eE59E5540Ae2f9CCCD55DD",
50
51
  "commonDeploy": "0x2Ed473F528E5B320f850d17ADfe0e558f0298aA9",
51
52
  "syFactory": "0x466CeD3b33045Ea986B2f306C8D0aA8067961CF8",
52
53
  "sparkLinearDiscountOracleFactory": "0x34C91651A070664279866E5f3d6B4d5F65cbbFFb",
54
+ "PendleChainlinkOracleFactory": "0x6502cda86f9110f3655512237C9FF2B9CE247c69",
53
55
  "experimental": {
54
- "PendleChainlinkOracleFactory": "0x6502cda86f9110f3655512237C9FF2B9CE247c69",
55
56
  "PendleSparkLinearDiscountOracleFactoryWrapper": "0x9E80e2525c7289ebd6352B428f2beC53b5A4e579",
56
57
  "MarketSweed": "0x9205aCD8A2fFD56917d4b9139bA423b4f2a70EE5"
57
58
  },
58
- "vePendle": "0x4f30A9D41B80ecC5B94306AB4364951AE3170210",
59
59
  "sPendle": "0x999999999991E178D52Cd95AFd4b00d066664144",
60
60
  "senderEndpoint": "0x07b1014c88f14C9E910092526db57A20052E989F",
61
- "votingController": "0x44087E105137a5095c008AaB6a6530182821F2F0",
62
61
  "gaugeController": "0x47D74516B33eD5D70ddE7119A40839f6Fcc24e57",
63
62
  "vePendleAirdropDistributor": "0x3942F7B55094250644cFfDa7160226Caa349A38E",
64
63
  "externalRewardsDistributor": "0x33305665f69B4642D1275f4Ce81c23651674D21C",
65
- "feeDistributor": "0xd7b34a6fDCb2A7ceD2115FF7f5fdD72aa6aA4dE2",
66
- "feeDistributorV2": "0x8C237520a8E14D658170A633D96F8e80764433b9",
67
64
  "lpWrapperFactory": "0x12930Bd944bb34B0A21CCc2E7d32a6834Bd58e19",
68
65
  "decimalsFactory": "0x992ec6a490a4b7f256bd59e63746951d98b29be9",
69
66
  "lpLinearDiscountOracleFactory": "0x44fb16d078e9c39b65d6c15e78ede9736a9f2df5",
@@ -71,5 +68,13 @@
71
68
  "exchangeRateOracle": "0xA914c44E960cC95D996969BDf0ab5D6f4f2B5870",
72
69
  "ptOftAdapterFactory": "0x905aF80C4DE82E0075a19fDE2f5777f1A6636732"
73
70
  },
74
- "merkleDepositor": "0x3dAe3d1734cA3C7B3089D4DD03C9876e0A0102b4"
71
+ "merkleDepositor": "0x3dAe3d1734cA3C7B3089D4DD03C9876e0A0102b4",
72
+ "deprecated": {
73
+ "vePendle": "0x4f30A9D41B80ecC5B94306AB4364951AE3170210",
74
+ "feeDistributor": "0xd7b34a6fDCb2A7ceD2115FF7f5fdD72aa6aA4dE2",
75
+ "feeDistributorV2": "0x8C237520a8E14D658170A633D96F8e80764433b9",
76
+ "votingController": "0x44087E105137a5095c008AaB6a6530182821F2F0"
77
+ },
78
+ "crossChainSwapHub": "0xd41c99760f4A7e27E736ED25cd6915110948Ea8a",
79
+ "depositBoxFactory": "0x15Ff9D268ef3300a3fcCe5DE4bc4326316c5dD6D"
75
80
  }
@@ -8,5 +8,5 @@
8
8
  "limitBackendHelperV2": "0xf02CdbD8F6A18c73B73331FEe3C2110e74508977",
9
9
  "checkSolvent": "0x1dE943933417D50738557Ac98FF96405CeeeeCD5",
10
10
  "externalCapGate": "0x65E04a3b2af7716B7f0765dE62Fa2f1B3290C23F",
11
- "feeSetter": "0x0185921C7C6A21F1f5c45A34456C379c9bEC6A81"
11
+ "feeSetter": "0x95e9FC738e9C94E730536C6f28c88295d3374466"
12
12
  }
@@ -44,19 +44,19 @@
44
44
  "poolDeployHelper": "0x439B4d66255eFf74e621FBacb00D7162b588Ff4b",
45
45
  "limitRouter": "0x000000000000c9B3E2C3Ec88B1B4c0cD853f4321",
46
46
  "proxyAdmin": "0xA28c08f165116587D4F3E708743B4dEe155c5E64",
47
+ "devProxyAdmin": "0xD37eB2E6DE40a33ba68BaD94427723b66c954EA9",
47
48
  "reflector": "0x30544e00Cf296B34A9eE59E5540Ae2f9CCCD55DD",
48
49
  "vePendleAirdropDistributor": "0x3942F7B55094250644cFfDa7160226Caa349A38E",
49
50
  "externalRewardsDistributor": "0x33305665f69B4642D1275f4Ce81c23651674D21C",
50
51
  "commonDeploy": "0x2Ed473F528E5B320f850d17ADfe0e558f0298aA9",
51
52
  "syFactory": "0x466CeD3b33045Ea986B2f306C8D0aA8067961CF8",
52
53
  "sparkLinearDiscountOracleFactory": "0x34C91651A070664279866E5f3d6B4d5F65cbbFFb",
54
+ "PendleChainlinkOracleFactory": "0x6502cda86f9110f3655512237C9FF2B9CE247c69",
53
55
  "experimental": {
54
- "PendleChainlinkOracleFactory": "0x6502cda86f9110f3655512237C9FF2B9CE247c69",
55
56
  "PendleSparkLinearDiscountOracleFactoryWrapper": "0x9E80e2525c7289ebd6352B428f2beC53b5A4e579",
56
57
  "MarketSweed": "0x9205aCD8A2fFD56917d4b9139bA423b4f2a70EE5"
57
58
  },
58
59
  "receiverEndpoint": "0xED18de5442297a4Ec1ce59C7c7d9427Adc2A012b",
59
- "vePendle": "0xd5C47D2383Fddc19596489280C0A33AC42b2bB18",
60
60
  "gaugeController": "0x6875e4A945E498FE1B90BbB13CFbAF0b68658C9C",
61
61
  "expiredRedeemer": "0x8267fdabd1b8C8645138f2dE5B0fe24988DC9820",
62
62
  "lpWrapperFactory": "0xeCfEB97D7F070DA5b93c5DC274183F1D7f68532F",
@@ -66,5 +66,10 @@
66
66
  "exchangeRateOracle": "0xA914c44E960cC95D996969BDf0ab5D6f4f2B5870",
67
67
  "ptOftAdapterFactory": "0x45Dd4aEcc425b01bf98C567407aB4a4fF3C7d349"
68
68
  },
69
- "merkleDepositor": "0x3dAe3d1734cA3C7B3089D4DD03C9876e0A0102b4"
70
- }
69
+ "merkleDepositor": "0x3dAe3d1734cA3C7B3089D4DD03C9876e0A0102b4",
70
+ "deprecated": {
71
+ "vePendle": "0xd5C47D2383Fddc19596489280C0A33AC42b2bB18"
72
+ },
73
+ "crossChainSwapHub": "0xd41c99760f4A7e27E736ED25cd6915110948Ea8a",
74
+ "depositBoxFactory": "0x15Ff9D268ef3300a3fcCe5DE4bc4326316c5dD6D"
75
+ }
@@ -7,5 +7,5 @@
7
7
  "limitBackendHelperV2": "0xf02CdbD8F6A18c73B73331FEe3C2110e74508977",
8
8
  "checkSolvent": "0x1dE943933417D50738557Ac98FF96405CeeeeCD5",
9
9
  "externalCapGate": "0x65E04a3b2af7716B7f0765dE62Fa2f1B3290C23F",
10
- "feeSetter": "0x0185921C7C6A21F1f5c45A34456C379c9bEC6A81"
10
+ "feeSetter": "0x95e9FC738e9C94E730536C6f28c88295d3374466"
11
11
  }
@@ -3,8 +3,11 @@
3
3
  "network": {
4
4
  "chainId": 130,
5
5
  "wrappedNative": "0x4200000000000000000000000000000000000006",
6
- "governance": "0x7877AdFaDEd756f3248a0EBfe8Ac2E2eF87b75Ac"
6
+ "governance": "0x7877AdFaDEd756f3248a0EBfe8Ac2E2eF87b75Ac",
7
+ "devMultisig": "0xE6F0489ED91dc27f40f9dbe8f81fccbFC16b9cb1",
8
+ "hardwareDeployer": "0xeea6F790F18563E91b18DF00B89d9f79b2E6761F"
7
9
  },
10
+ "governanceProxy": "0x2aD631F72fB16d91c4953A7f4260A97C2fE2f31e",
8
11
  "router": "0x888888888889758F76e7103c6CbF23ABbF58F946",
9
12
  "routerFacets": {
10
13
  "ActionAddRemoveLiqV3": "0x663C21103915B68e9dA797CfdF3cAb01a037D5Ff",
@@ -17,5 +20,9 @@
17
20
  "ActionCrossChain": "0x7C082f4c2790F04F62923243Db85A1c60f768857"
18
21
  },
19
22
  "pendleSwap": "0xd4F480965D2347d421F1bEC7F545682E5Ec2151D",
20
- "sparkLinearDiscountOracleFactory": "0x34C91651A070664279866E5f3d6B4d5F65cbbFFb"
23
+ "proxyAdmin": "0xA28c08f165116587D4F3E708743B4dEe155c5E64",
24
+ "devProxyAdmin": "0xD37eB2E6DE40a33ba68BaD94427723b66c954EA9",
25
+ "sparkLinearDiscountOracleFactory": "0x34C91651A070664279866E5f3d6B4d5F65cbbFFb",
26
+ "crossChainSwapHub": "0xd41c99760f4A7e27E736ED25cd6915110948Ea8a",
27
+ "depositBoxFactory": "0x15Ff9D268ef3300a3fcCe5DE4bc4326316c5dD6D"
21
28
  }