@pendle/core-v2 0.17.5-testnet → 0.17.7-testnet

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 (271) hide show
  1. package/README.md +28 -0
  2. package/build/artifacts/contracts/LiquidityMining/CrossChainMsg/PendleMsgReceiveEndpointUpg.sol/PendleMsgReceiveEndpointUpg.dbg.json +1 -1
  3. package/build/artifacts/contracts/LiquidityMining/CrossChainMsg/PendleMsgReceiveEndpointUpg.sol/PendleMsgReceiveEndpointUpg.json +2 -2
  4. package/build/artifacts/contracts/LiquidityMining/CrossChainMsg/PendleMsgReceiverAppUpg.sol/PendleMsgReceiverAppUpg.dbg.json +1 -1
  5. package/build/artifacts/contracts/LiquidityMining/CrossChainMsg/PendleMsgSendEndpointUpg.sol/PendleMsgSendEndpointUpg.dbg.json +1 -1
  6. package/build/artifacts/contracts/LiquidityMining/CrossChainMsg/PendleMsgSendEndpointUpg.sol/PendleMsgSendEndpointUpg.json +2 -2
  7. package/build/artifacts/contracts/LiquidityMining/CrossChainMsg/PendleMsgSenderAppUpg.sol/PendleMsgSenderAppUpg.dbg.json +1 -1
  8. package/build/artifacts/contracts/LiquidityMining/CrossChainMsg/libraries/ExcessivelySafeCall.sol/ExcessivelySafeCall.dbg.json +1 -1
  9. package/build/artifacts/contracts/LiquidityMining/CrossChainMsg/libraries/ExcessivelySafeCall.sol/ExcessivelySafeCall.json +2 -2
  10. package/build/artifacts/contracts/LiquidityMining/CrossChainMsg/libraries/LayerZeroHelper.sol/LayerZeroHelper.dbg.json +1 -1
  11. package/build/artifacts/contracts/LiquidityMining/CrossChainMsg/libraries/LayerZeroHelper.sol/LayerZeroHelper.json +2 -2
  12. package/build/artifacts/contracts/LiquidityMining/FeeDistributor/EpochResultManager.sol/EpochResultManager.dbg.json +1 -1
  13. package/build/artifacts/contracts/LiquidityMining/FeeDistributor/PendleFeeDistributor.sol/PendleFeeDistributor.dbg.json +1 -1
  14. package/build/artifacts/contracts/LiquidityMining/FeeDistributor/PendleFeeDistributor.sol/PendleFeeDistributor.json +2 -2
  15. package/build/artifacts/contracts/LiquidityMining/FeeDistributor/PendleFeeDistributorFactory.sol/PendleFeeDistributorFactory.dbg.json +1 -1
  16. package/build/artifacts/contracts/LiquidityMining/FeeDistributor/PendleFeeDistributorFactory.sol/PendleFeeDistributorFactory.json +2 -2
  17. package/build/artifacts/contracts/LiquidityMining/GaugeController/PendleGaugeControllerBaseUpg.sol/PendleGaugeControllerBaseUpg.dbg.json +1 -1
  18. package/build/artifacts/contracts/LiquidityMining/GaugeController/PendleGaugeControllerMainchainUpg.sol/PendleGaugeControllerMainchainUpg.dbg.json +1 -1
  19. package/build/artifacts/contracts/LiquidityMining/GaugeController/PendleGaugeControllerMainchainUpg.sol/PendleGaugeControllerMainchainUpg.json +2 -2
  20. package/build/artifacts/contracts/LiquidityMining/GaugeController/PendleGaugeControllerSidechainUpg.sol/PendleGaugeControllerSidechainUpg.dbg.json +1 -1
  21. package/build/artifacts/contracts/LiquidityMining/GaugeController/PendleGaugeControllerSidechainUpg.sol/PendleGaugeControllerSidechainUpg.json +2 -2
  22. package/build/artifacts/contracts/LiquidityMining/VotingController/PendleVotingControllerUpg.sol/PendleVotingControllerUpg.dbg.json +1 -1
  23. package/build/artifacts/contracts/LiquidityMining/VotingController/PendleVotingControllerUpg.sol/PendleVotingControllerUpg.json +2 -2
  24. package/build/artifacts/contracts/LiquidityMining/VotingController/VotingControllerStorageUpg.sol/VotingControllerStorageUpg.dbg.json +1 -1
  25. package/build/artifacts/contracts/LiquidityMining/VotingEscrow/VotingEscrowPendleMainchain.sol/VotingEscrowPendleMainchain.dbg.json +1 -1
  26. package/build/artifacts/contracts/LiquidityMining/VotingEscrow/VotingEscrowPendleMainchain.sol/VotingEscrowPendleMainchain.json +2 -2
  27. package/build/artifacts/contracts/LiquidityMining/VotingEscrow/VotingEscrowPendleSidechain.sol/VotingEscrowPendleSidechain.dbg.json +1 -1
  28. package/build/artifacts/contracts/LiquidityMining/VotingEscrow/VotingEscrowPendleSidechain.sol/VotingEscrowPendleSidechain.json +2 -2
  29. package/build/artifacts/contracts/LiquidityMining/VotingEscrow/VotingEscrowTokenBase.sol/VotingEscrowTokenBase.dbg.json +1 -1
  30. package/build/artifacts/contracts/LiquidityMining/libraries/VeBalanceLib.sol/VeBalanceLib.dbg.json +1 -1
  31. package/build/artifacts/contracts/LiquidityMining/libraries/VeBalanceLib.sol/VeBalanceLib.json +2 -2
  32. package/build/artifacts/contracts/LiquidityMining/libraries/VeHistoryLib.sol/CheckpointHelper.dbg.json +1 -1
  33. package/build/artifacts/contracts/LiquidityMining/libraries/VeHistoryLib.sol/CheckpointHelper.json +2 -2
  34. package/build/artifacts/contracts/LiquidityMining/libraries/VeHistoryLib.sol/Checkpoints.dbg.json +1 -1
  35. package/build/artifacts/contracts/LiquidityMining/libraries/VeHistoryLib.sol/Checkpoints.json +2 -2
  36. package/build/artifacts/contracts/core/BulkSeller/BulkSeller.sol/BulkSeller.dbg.json +1 -1
  37. package/build/artifacts/contracts/core/BulkSeller/BulkSeller.sol/BulkSeller.json +22 -28
  38. package/build/artifacts/contracts/core/BulkSeller/BulkSellerFactory.sol/BulkSellerFactory.dbg.json +1 -1
  39. package/build/artifacts/contracts/core/BulkSeller/BulkSellerFactory.sol/BulkSellerFactory.json +3 -22
  40. package/build/artifacts/contracts/core/BulkSeller/BulkSellerMathCore.sol/BulkSellerMathCore.dbg.json +1 -1
  41. package/build/artifacts/contracts/core/BulkSeller/BulkSellerMathCore.sol/BulkSellerMathCore.json +2 -2
  42. package/build/artifacts/contracts/core/Market/MarketMathCore.sol/MarketMathCore.dbg.json +1 -1
  43. package/build/artifacts/contracts/core/Market/MarketMathCore.sol/MarketMathCore.json +2 -2
  44. package/build/artifacts/contracts/core/Market/OracleLib.sol/OracleLib.dbg.json +1 -1
  45. package/build/artifacts/contracts/core/Market/OracleLib.sol/OracleLib.json +2 -2
  46. package/build/artifacts/contracts/core/Market/PendleGauge.sol/PendleGauge.dbg.json +1 -1
  47. package/build/artifacts/contracts/core/Market/PendleMarket.sol/PendleMarket.dbg.json +1 -1
  48. package/build/artifacts/contracts/core/Market/PendleMarket.sol/PendleMarket.json +2 -2
  49. package/build/artifacts/contracts/core/Market/PendleMarketFactory.sol/PendleMarketFactory.dbg.json +1 -1
  50. package/build/artifacts/contracts/core/Market/PendleMarketFactory.sol/PendleMarketFactory.json +2 -2
  51. package/build/artifacts/contracts/core/RewardManager/RewardManager.sol/RewardManager.dbg.json +1 -1
  52. package/build/artifacts/contracts/core/RewardManager/RewardManagerAbstract.sol/RewardManagerAbstract.dbg.json +1 -1
  53. package/build/artifacts/contracts/core/StandardizedYield/SYBase.sol/SYBase.dbg.json +1 -1
  54. package/build/artifacts/contracts/core/StandardizedYield/SYBaseWithRewards.sol/SYBaseWithRewards.dbg.json +1 -1
  55. package/build/artifacts/contracts/core/StandardizedYield/implementations/BenQi/PendleQiTokenHelper.sol/PendleQiTokenHelper.dbg.json +1 -1
  56. package/build/artifacts/contracts/core/StandardizedYield/implementations/BenQi/PendleQiTokenHelper.sol/PendleQiTokenHelper.json +2 -2
  57. package/build/artifacts/contracts/core/StandardizedYield/implementations/BenQi/PendleQiTokenSY.sol/PendleQiTokenSY.dbg.json +1 -1
  58. package/build/artifacts/contracts/core/StandardizedYield/implementations/BenQi/PendleQiTokenSY.sol/PendleQiTokenSY.json +2 -2
  59. package/build/artifacts/contracts/core/StandardizedYield/implementations/Convex/PendleCurveFraxUsdcSY.sol/PendleCurveFraxUsdcSY.dbg.json +1 -1
  60. package/build/artifacts/contracts/core/StandardizedYield/implementations/Convex/PendleCurveFraxUsdcSY.sol/PendleCurveFraxUsdcSY.json +2 -2
  61. package/build/artifacts/contracts/core/StandardizedYield/implementations/Convex/PendleCurveUsdd3CrvSY.sol/PendleCurveUsdd3CrvSY.dbg.json +1 -1
  62. package/build/artifacts/contracts/core/StandardizedYield/implementations/Convex/PendleCurveUsdd3CrvSY.sol/PendleCurveUsdd3CrvSY.json +2 -2
  63. package/build/artifacts/contracts/core/StandardizedYield/implementations/Convex/base/Curve3CrvPoolHelper.sol/Curve3CrvPoolHelper.dbg.json +1 -1
  64. package/build/artifacts/contracts/core/StandardizedYield/implementations/Convex/base/Curve3CrvPoolHelper.sol/Curve3CrvPoolHelper.json +2 -2
  65. package/build/artifacts/contracts/core/StandardizedYield/implementations/Convex/base/CurveFraxUsdcPoolHelper.sol/CurveFraxUsdcPoolHelper.dbg.json +1 -1
  66. package/build/artifacts/contracts/core/StandardizedYield/implementations/Convex/base/CurveFraxUsdcPoolHelper.sol/CurveFraxUsdcPoolHelper.json +2 -2
  67. package/build/artifacts/contracts/core/StandardizedYield/implementations/Convex/base/CurveUsdd3CrvPoolHelper.sol/CurveUsdd3CrvPoolHelper.dbg.json +1 -1
  68. package/build/artifacts/contracts/core/StandardizedYield/implementations/Convex/base/CurveUsdd3CrvPoolHelper.sol/CurveUsdd3CrvPoolHelper.json +2 -2
  69. package/build/artifacts/contracts/core/StandardizedYield/implementations/Convex/base/PendleConvexLPSY.sol/PendleConvexLPSY.dbg.json +1 -1
  70. package/build/artifacts/contracts/core/StandardizedYield/implementations/PendleLooksStakingSY.sol/PendleLooksStakingSY.dbg.json +1 -1
  71. package/build/artifacts/contracts/core/StandardizedYield/implementations/PendleLooksStakingSY.sol/PendleLooksStakingSY.json +2 -2
  72. package/build/artifacts/contracts/core/StandardizedYield/implementations/PendleWstEthSY.sol/PendleWstEthSY.dbg.json +1 -1
  73. package/build/artifacts/contracts/core/StandardizedYield/implementations/PendleWstEthSY.sol/PendleWstEthSY.json +2 -2
  74. package/build/artifacts/contracts/core/YieldContracts/InterestManagerYT.sol/InterestManagerYT.dbg.json +1 -1
  75. package/build/artifacts/contracts/core/YieldContracts/PendlePrincipalToken.sol/PendlePrincipalToken.dbg.json +1 -1
  76. package/build/artifacts/contracts/core/YieldContracts/PendlePrincipalToken.sol/PendlePrincipalToken.json +2 -2
  77. package/build/artifacts/contracts/core/YieldContracts/PendleYieldContractFactory.sol/PendleYieldContractFactory.dbg.json +1 -1
  78. package/build/artifacts/contracts/core/YieldContracts/PendleYieldContractFactory.sol/PendleYieldContractFactory.json +2 -2
  79. package/build/artifacts/contracts/core/YieldContracts/PendleYieldToken.sol/PendleYieldToken.dbg.json +1 -1
  80. package/build/artifacts/contracts/core/YieldContracts/PendleYieldToken.sol/PendleYieldToken.json +2 -2
  81. package/build/artifacts/contracts/core/erc20/PendleERC20.sol/PendleERC20.dbg.json +1 -1
  82. package/build/artifacts/contracts/core/erc20/PendleERC20.sol/PendleERC20.json +2 -2
  83. package/build/artifacts/contracts/core/erc20/PendleERC20Permit.sol/PendleERC20Permit.dbg.json +1 -1
  84. package/build/artifacts/contracts/core/erc20/PendleERC20Permit.sol/PendleERC20Permit.json +2 -2
  85. package/build/artifacts/contracts/core/libraries/ArrayLib.sol/ArrayLib.dbg.json +1 -1
  86. package/build/artifacts/contracts/core/libraries/ArrayLib.sol/ArrayLib.json +2 -2
  87. package/build/artifacts/contracts/core/libraries/BoringOwnableUpgradeable.sol/BoringOwnableUpgradeable.dbg.json +1 -1
  88. package/build/artifacts/contracts/core/libraries/BoringOwnableUpgradeable.sol/BoringOwnableUpgradeableData.dbg.json +1 -1
  89. package/build/artifacts/contracts/core/libraries/BoringOwnableUpgradeable.sol/BoringOwnableUpgradeableData.json +2 -2
  90. package/build/artifacts/contracts/core/libraries/Errors.sol/Errors.dbg.json +1 -1
  91. package/build/artifacts/contracts/core/libraries/Errors.sol/Errors.json +2 -18
  92. package/build/artifacts/contracts/core/libraries/MiniHelpers.sol/MiniHelpers.dbg.json +1 -1
  93. package/build/artifacts/contracts/core/libraries/MiniHelpers.sol/MiniHelpers.json +2 -2
  94. package/build/artifacts/contracts/core/libraries/TokenHelper.sol/TokenHelper.dbg.json +1 -1
  95. package/build/artifacts/contracts/interfaces/Curve/ICrvPool.sol/ICrvPool.dbg.json +1 -1
  96. package/build/artifacts/contracts/interfaces/Curve/ITriCrvPool.sol/ITriCrvPool.dbg.json +1 -1
  97. package/build/artifacts/contracts/interfaces/IBoringOwnableUpgradeable.sol/IBoringOwnableUpgradeable.dbg.json +1 -1
  98. package/build/artifacts/contracts/interfaces/ILayerZeroEndpoint.sol/ILayerZeroEndpoint.dbg.json +1 -1
  99. package/build/artifacts/contracts/interfaces/ILayerZeroReceiver.sol/ILayerZeroReceiver.dbg.json +1 -1
  100. package/build/artifacts/contracts/interfaces/IPActionAddRemoveLiq.sol/IPActionAddRemoveLiq.dbg.json +1 -1
  101. package/build/artifacts/contracts/interfaces/IPActionMintRedeem.sol/IPActionMintRedeem.dbg.json +1 -1
  102. package/build/artifacts/contracts/interfaces/IPActionSwapPT.sol/IPActionSwapPT.dbg.json +1 -1
  103. package/build/artifacts/contracts/interfaces/IPActionSwapPTYT.sol/IPActionSwapPTYT.dbg.json +1 -1
  104. package/build/artifacts/contracts/interfaces/IPActionSwapYT.sol/IPActionSwapYT.dbg.json +1 -1
  105. package/build/artifacts/contracts/interfaces/IPAllAction.sol/IPAllAction.dbg.json +1 -1
  106. package/build/artifacts/contracts/interfaces/IPBulkSeller.sol/IPBulkSeller.dbg.json +1 -1
  107. package/build/artifacts/contracts/interfaces/IPBulkSeller.sol/IPBulkSeller.json +187 -1
  108. package/build/artifacts/contracts/interfaces/IPBulkSellerFactory.sol/IPBulkSellerFactory.dbg.json +1 -1
  109. package/build/artifacts/contracts/interfaces/IPBulkSellerFactory.sol/IPBulkSellerFactory.json +0 -19
  110. package/build/artifacts/contracts/interfaces/IPMarket.sol/IPMarket.dbg.json +1 -1
  111. package/build/artifacts/contracts/interfaces/IPMsgReceiverApp.sol/IPMsgReceiverApp.dbg.json +1 -1
  112. package/build/artifacts/contracts/interfaces/IPMsgSendEndpoint.sol/IPMsgSendEndpoint.dbg.json +1 -1
  113. package/build/artifacts/contracts/interfaces/IPVeToken.sol/IPVeToken.dbg.json +1 -1
  114. package/build/artifacts/contracts/interfaces/IPVotingController.sol/IPVotingController.dbg.json +1 -1
  115. package/build/artifacts/contracts/interfaces/IPVotingEscrowMainchain.sol/IPVotingEscrowMainchain.dbg.json +1 -1
  116. package/build/artifacts/contracts/interfaces/IREDACTEDStaking.sol/IREDACTEDStaking.dbg.json +1 -1
  117. package/build/artifacts/contracts/interfaces/IStETH.sol/IStETH.dbg.json +1 -1
  118. package/build/artifacts/contracts/interfaces/IStargateLPStaking.sol/IStargateLPStaking.dbg.json +1 -1
  119. package/build/artifacts/contracts/interfaces/IStargatePool.sol/IStargatePool.dbg.json +1 -1
  120. package/build/artifacts/contracts/interfaces/IStargateRouter.sol/IStargateRouter.dbg.json +1 -1
  121. package/build/artifacts/contracts/interfaces/IWXBTRFLY.sol/IWXBTRFLY.dbg.json +1 -1
  122. package/build/artifacts/contracts/offchain-helpers/BaseSplitCodeFactoryContract.sol/BaseSplitCodeFactoryContract.dbg.json +1 -1
  123. package/build/artifacts/contracts/offchain-helpers/BaseSplitCodeFactoryContract.sol/BaseSplitCodeFactoryContract.json +2 -2
  124. package/build/artifacts/contracts/offchain-helpers/BulkSellerOffchain.sol/BulkSellerOffchain.dbg.json +1 -1
  125. package/build/artifacts/contracts/offchain-helpers/BulkSellerOffchain.sol/BulkSellerOffchain.json +2 -2
  126. package/build/artifacts/contracts/offchain-helpers/MarketMathStatic.sol/MarketMathStatic.dbg.json +1 -1
  127. package/build/artifacts/contracts/offchain-helpers/MarketMathStatic.sol/MarketMathStatic.json +2 -2
  128. package/build/artifacts/contracts/offchain-helpers/RouterStatic.sol/RouterStatic.dbg.json +1 -1
  129. package/build/artifacts/contracts/offchain-helpers/RouterStatic.sol/RouterStatic.json +160 -60
  130. package/build/artifacts/contracts/router/ActionAddRemoveLiq.sol/ActionAddRemoveLiq.dbg.json +1 -1
  131. package/build/artifacts/contracts/router/ActionAddRemoveLiq.sol/ActionAddRemoveLiq.json +2 -2
  132. package/build/artifacts/contracts/router/ActionCallback.sol/ActionCallback.dbg.json +1 -1
  133. package/build/artifacts/contracts/router/ActionCallback.sol/ActionCallback.json +2 -2
  134. package/build/artifacts/contracts/router/ActionMintRedeem.sol/ActionMintRedeem.dbg.json +1 -1
  135. package/build/artifacts/contracts/router/ActionMintRedeem.sol/ActionMintRedeem.json +2 -2
  136. package/build/artifacts/contracts/router/ActionMisc.sol/ActionMisc.dbg.json +1 -1
  137. package/build/artifacts/contracts/router/ActionMisc.sol/ActionMisc.json +2 -2
  138. package/build/artifacts/contracts/router/ActionSwapPT.sol/ActionSwapPT.dbg.json +1 -1
  139. package/build/artifacts/contracts/router/ActionSwapPT.sol/ActionSwapPT.json +2 -2
  140. package/build/artifacts/contracts/router/ActionSwapPTYT.sol/ActionSwapPTYT.dbg.json +1 -1
  141. package/build/artifacts/contracts/router/ActionSwapPTYT.sol/ActionSwapPTYT.json +2 -2
  142. package/build/artifacts/contracts/router/ActionSwapYT.sol/ActionSwapYT.dbg.json +1 -1
  143. package/build/artifacts/contracts/router/ActionSwapYT.sol/ActionSwapYT.json +2 -2
  144. package/build/artifacts/contracts/router/PendleRouter.sol/PendleRouter.dbg.json +1 -1
  145. package/build/artifacts/contracts/router/PendleRouter.sol/PendleRouter.json +2 -2
  146. package/build/artifacts/contracts/router/base/ActionBaseMintRedeem.sol/ActionBaseMintRedeem.dbg.json +1 -1
  147. package/build/artifacts/contracts/router/base/MarketApproxLib.sol/MarketApproxPtInLib.dbg.json +1 -1
  148. package/build/artifacts/contracts/router/base/MarketApproxLib.sol/MarketApproxPtInLib.json +2 -2
  149. package/build/artifacts/contracts/router/base/MarketApproxLib.sol/MarketApproxPtOutLib.dbg.json +1 -1
  150. package/build/artifacts/contracts/router/base/MarketApproxLib.sol/MarketApproxPtOutLib.json +2 -2
  151. package/build/artifacts/contracts/router/kyberswap/AggregationRouterHelper.sol/AggregationRouterHelper.dbg.json +1 -1
  152. package/build/artifacts/contracts/router/kyberswap/AggregationRouterHelper.sol/AggregationRouterHelper.json +2 -2
  153. package/build/artifacts/contracts/router/kyberswap/IAggregatorRouterHelper.sol/IAggregationRouterHelper.dbg.json +1 -1
  154. package/build/artifacts/contracts/router/kyberswap/IMultihopRouter.sol/IMultihopRouter.dbg.json +1 -1
  155. package/build/artifacts/contracts/router/kyberswap/KyberSwapHelper.sol/KyberSwapHelper.dbg.json +1 -1
  156. package/contracts/LiquidityMining/CrossChainMsg/PendleMsgReceiverAppUpg.sol +1 -4
  157. package/contracts/LiquidityMining/CrossChainMsg/PendleMsgSendEndpointUpg.sol +6 -5
  158. package/contracts/LiquidityMining/CrossChainMsg/PendleMsgSenderAppUpg.sol +1 -4
  159. package/contracts/LiquidityMining/CrossChainMsg/libraries/ExcessivelySafeCall.sol +1 -1
  160. package/contracts/LiquidityMining/CrossChainMsg/libraries/LayerZeroHelper.sol +9 -6
  161. package/contracts/LiquidityMining/GaugeController/PendleGaugeControllerBaseUpg.sol +9 -21
  162. package/contracts/LiquidityMining/GaugeController/PendleGaugeControllerMainchainUpg.sol +0 -3
  163. package/contracts/LiquidityMining/GaugeController/PendleGaugeControllerSidechainUpg.sol +0 -3
  164. package/contracts/LiquidityMining/VotingController/PendleVotingControllerUpg.sol +34 -54
  165. package/contracts/LiquidityMining/VotingController/VotingControllerStorageUpg.sol +6 -25
  166. package/contracts/LiquidityMining/VotingEscrow/VotingEscrowPendleMainchain.sol +20 -38
  167. package/contracts/LiquidityMining/libraries/VeHistoryLib.sol +1 -1
  168. package/contracts/core/BulkSeller/BulkSeller.sol +35 -42
  169. package/contracts/core/BulkSeller/BulkSellerFactory.sol +5 -9
  170. package/contracts/core/BulkSeller/BulkSellerMathCore.sol +6 -5
  171. package/contracts/core/StandardizedYield/SYBase.sol +5 -23
  172. package/contracts/core/StandardizedYield/SYBaseWithRewards.sol +1 -3
  173. package/contracts/core/StandardizedYield/implementations/Ape/PendleApeStakingSY.sol +184 -0
  174. package/contracts/core/StandardizedYield/implementations/BenQi/PendleQiTokenSY.sol +1 -3
  175. package/contracts/core/StandardizedYield/implementations/Convex/base/CurveUsdd3CrvPoolHelper.sol +1 -1
  176. package/contracts/core/StandardizedYield/implementations/Convex/base/PendleConvexLPSY.sol +1 -1
  177. package/contracts/core/StandardizedYield/implementations/PendleWstEthSY.sol +1 -1
  178. package/contracts/core/YieldContracts/PendleYieldToken.sol +6 -6
  179. package/contracts/core/erc20/PendleERC20.sol +2 -2
  180. package/contracts/core/erc20/PendleERC20Permit.sol +1 -1
  181. package/contracts/core/libraries/ArrayLib.sol +1 -1
  182. package/contracts/core/libraries/BoringOwnableUpgradeable.sol +1 -1
  183. package/contracts/core/libraries/Errors.sol +2 -1
  184. package/contracts/core/libraries/MiniHelpers.sol +1 -0
  185. package/contracts/core/libraries/TokenHelper.sol +4 -5
  186. package/contracts/interfaces/Curve/ICrvPool.sol +3 -4
  187. package/contracts/interfaces/Curve/ITriCrvPool.sol +1 -4
  188. package/contracts/interfaces/IApeStaking.sol +27 -0
  189. package/contracts/interfaces/IBoringOwnableUpgradeable.sol +2 -2
  190. package/contracts/interfaces/ILayerZeroEndpoint.sol +1 -1
  191. package/contracts/interfaces/ILayerZeroReceiver.sol +8 -3
  192. package/contracts/interfaces/IPBulkSeller.sol +30 -6
  193. package/contracts/interfaces/IPBulkSellerFactory.sol +0 -2
  194. package/contracts/interfaces/IPMarket.sol +2 -12
  195. package/contracts/interfaces/IPMsgReceiverApp.sol +1 -1
  196. package/contracts/interfaces/IPMsgSendEndpoint.sol +1 -1
  197. package/contracts/interfaces/IPVeToken.sol +1 -1
  198. package/contracts/interfaces/IREDACTEDStaking.sol +1 -1
  199. package/contracts/interfaces/IStETH.sol +1 -1
  200. package/contracts/interfaces/IStargateLPStaking.sol +1 -1
  201. package/contracts/interfaces/IStargatePool.sol +1 -1
  202. package/contracts/interfaces/IStargateRouter.sol +1 -1
  203. package/contracts/interfaces/IWXBTRFLY.sol +1 -1
  204. package/contracts/offchain-helpers/MarketMathStatic.sol +140 -37
  205. package/contracts/offchain-helpers/RouterStatic.sol +48 -27
  206. package/contracts/router/ActionAddRemoveLiq.sol +2 -2
  207. package/contracts/router/ActionMintRedeem.sol +4 -4
  208. package/contracts/router/ActionSwapPT.sol +4 -4
  209. package/contracts/router/ActionSwapPTYT.sol +1 -1
  210. package/contracts/router/ActionSwapYT.sol +8 -8
  211. package/contracts/router/base/ActionBaseMintRedeem.sol +6 -7
  212. package/contracts/router/base/MarketApproxLib.sol +14 -8
  213. package/contracts/router/kyberswap/AggregationRouterHelper.sol +1 -1
  214. package/contracts/router/kyberswap/IAggregatorRouterHelper.sol +1 -1
  215. package/contracts/router/kyberswap/IMultihopRouter.sol +1 -1
  216. package/deployments/43113-core.json +1 -1
  217. package/deployments/43113-markets/APE-30-MARCH.json +10 -0
  218. package/package.json +1 -1
  219. package/typechain-types/BulkSeller.ts +59 -6
  220. package/typechain-types/BulkSellerFactory.ts +0 -16
  221. package/typechain-types/IApeStaking.ts +274 -0
  222. package/typechain-types/IPBulkSeller.ts +178 -9
  223. package/typechain-types/IPBulkSellerFactory.ts +0 -16
  224. package/typechain-types/PendleApeStakingSY.ts +1251 -0
  225. package/typechain-types/RouterStatic.ts +40 -20
  226. package/typechain-types/SYBaseAutoCompound.ts +1203 -0
  227. package/typechain-types/factories/ActionAddRemoveLiq__factory.ts +1 -1
  228. package/typechain-types/factories/ActionCallback__factory.ts +1 -1
  229. package/typechain-types/factories/ActionMintRedeem__factory.ts +1 -1
  230. package/typechain-types/factories/ActionMisc__factory.ts +1 -1
  231. package/typechain-types/factories/ActionSwapPTYT__factory.ts +1 -1
  232. package/typechain-types/factories/ActionSwapPT__factory.ts +1 -1
  233. package/typechain-types/factories/ActionSwapYT__factory.ts +1 -1
  234. package/typechain-types/factories/AggregationRouterHelper__factory.ts +1 -1
  235. package/typechain-types/factories/BaseSplitCodeFactoryContract__factory.ts +1 -1
  236. package/typechain-types/factories/BoringOwnableUpgradeableData__factory.ts +1 -1
  237. package/typechain-types/factories/BulkSellerFactory__factory.ts +2 -21
  238. package/typechain-types/factories/BulkSellerOffchain__factory.ts +1 -1
  239. package/typechain-types/factories/BulkSeller__factory.ts +21 -27
  240. package/typechain-types/factories/Errors__factory.ts +1 -17
  241. package/typechain-types/factories/IApeStaking__factory.ts +127 -0
  242. package/typechain-types/factories/IPBulkSellerFactory__factory.ts +0 -19
  243. package/typechain-types/factories/IPBulkSeller__factory.ts +187 -1
  244. package/typechain-types/factories/MarketMathStatic__factory.ts +1 -1
  245. package/typechain-types/factories/OracleLib__factory.ts +1 -1
  246. package/typechain-types/factories/PendleApeStakingSY__factory.ts +1065 -0
  247. package/typechain-types/factories/PendleCurveFraxUsdcSY__factory.ts +1 -1
  248. package/typechain-types/factories/PendleCurveUsdd3CrvSY__factory.ts +1 -1
  249. package/typechain-types/factories/PendleERC20Permit__factory.ts +1 -1
  250. package/typechain-types/factories/PendleERC20__factory.ts +1 -1
  251. package/typechain-types/factories/PendleFeeDistributorFactory__factory.ts +1 -1
  252. package/typechain-types/factories/PendleFeeDistributor__factory.ts +1 -1
  253. package/typechain-types/factories/PendleGaugeControllerMainchainUpg__factory.ts +1 -1
  254. package/typechain-types/factories/PendleGaugeControllerSidechainUpg__factory.ts +1 -1
  255. package/typechain-types/factories/PendleLooksStakingSY__factory.ts +1 -1
  256. package/typechain-types/factories/PendleMarketFactory__factory.ts +1 -1
  257. package/typechain-types/factories/PendleMarket__factory.ts +1 -1
  258. package/typechain-types/factories/PendleMsgReceiveEndpointUpg__factory.ts +1 -1
  259. package/typechain-types/factories/PendleMsgSendEndpointUpg__factory.ts +1 -1
  260. package/typechain-types/factories/PendlePrincipalToken__factory.ts +1 -1
  261. package/typechain-types/factories/PendleQiTokenHelper__factory.ts +1 -1
  262. package/typechain-types/factories/PendleQiTokenSY__factory.ts +1 -1
  263. package/typechain-types/factories/PendleRouter__factory.ts +1 -1
  264. package/typechain-types/factories/PendleVotingControllerUpg__factory.ts +1 -1
  265. package/typechain-types/factories/PendleWstEthSY__factory.ts +1 -1
  266. package/typechain-types/factories/PendleYieldContractFactory__factory.ts +1 -1
  267. package/typechain-types/factories/PendleYieldToken__factory.ts +1 -1
  268. package/typechain-types/factories/RouterStatic__factory.ts +101 -1
  269. package/typechain-types/factories/SYBaseAutoCompound__factory.ts +942 -0
  270. package/typechain-types/factories/VotingEscrowPendleMainchain__factory.ts +1 -1
  271. package/typechain-types/factories/VotingEscrowPendleSidechain__factory.ts +1 -1
@@ -0,0 +1,184 @@
1
+ // SPDX-License-Identifier: GPL-3.0-or-later
2
+ pragma solidity 0.8.17;
3
+
4
+ import "../../SYBase.sol";
5
+ import "../../../../interfaces/IApeStaking.sol";
6
+
7
+ contract PendleApeStakingSY is SYBase {
8
+ using Math for uint256;
9
+
10
+ uint256 public constant APE_COIN_POOL_ID = 0;
11
+ uint256 public constant MIN_APE_DEPOSIT = 10**18;
12
+ uint256 public constant EPOCH_LENGTH = 1 hours;
13
+
14
+ address public immutable apeStaking;
15
+ address public immutable apeCoin;
16
+
17
+ uint256 private lastRewardClaimedEpoch;
18
+
19
+ constructor(
20
+ string memory _name,
21
+ string memory _symbol,
22
+ address _apeCoin,
23
+ address _apeStaking
24
+ )
25
+ SYBase(_name, _symbol, _apeCoin)
26
+ {
27
+ apeStaking = _apeStaking;
28
+ apeCoin = _apeCoin;
29
+ lastRewardClaimedEpoch = _getCurrentEpochId();
30
+ _safeApproveInf(apeCoin, apeStaking);
31
+ }
32
+
33
+ function _deposit(address, uint256 amountDeposited)
34
+ internal
35
+ virtual
36
+ override
37
+ returns (uint256 amountSharesOut)
38
+ {
39
+ // Respecting APE's deposit invariant & prevent frontrunning on deployment
40
+ if (amountDeposited < MIN_APE_DEPOSIT) {
41
+ revert Errors.SYApeDepositAmountTooSmall(amountDeposited);
42
+ }
43
+
44
+ _harvestAndCompound();
45
+
46
+ // As SY Base is pulling the tokenIn first, the totalAsset should exclude user's deposit
47
+ uint256 priorTotalAssetOwned = getTotalAssetOwned() - amountDeposited;
48
+
49
+ if (totalSupply() == 0) {
50
+ amountSharesOut = amountDeposited;
51
+ } else {
52
+ // The upcoming calculation can be reduced to amountDeposited.divDown(exchangeRate())
53
+ // The following calculation is choosen instead to minimize precision error
54
+ amountSharesOut = (amountDeposited * totalSupply()) / priorTotalAssetOwned;
55
+ }
56
+ }
57
+
58
+ function _redeem(
59
+ address receiver,
60
+ address,
61
+ uint256 amountSharesToRedeem
62
+ ) internal virtual override returns (uint256 amountTokenOut) {
63
+ _harvestAndCompound();
64
+
65
+ // As SY is burned before calling _redeem(), we should account for priorSupply
66
+ uint256 priorTotalSupply = totalSupply() + amountSharesToRedeem;
67
+
68
+ if (amountSharesToRedeem == priorTotalSupply) {
69
+ amountTokenOut = getTotalAssetOwned();
70
+ } else {
71
+ // The upcoming calculation can be reduced to amountSharesToRedeem.mulDown(exchangeRate())
72
+ // The following calculation is choosen instead to minimize precision error
73
+ amountTokenOut = (amountSharesToRedeem * getTotalAssetOwned()) / priorTotalSupply;
74
+ }
75
+
76
+ // There might be case when the contract is holding < 1 APE reward and user is withdrawing everything out of it
77
+ if (amountTokenOut > _selfBalance(apeCoin)) {
78
+ IApeStaking(apeStaking).withdrawApeCoin(
79
+ amountTokenOut - _selfBalance(apeCoin),
80
+ address(this)
81
+ );
82
+ }
83
+ _transferOut(apeCoin, receiver, amountTokenOut);
84
+ }
85
+
86
+ function exchangeRate() public view virtual override returns (uint256) {
87
+ return getTotalAssetOwned().divDown(totalSupply());
88
+ }
89
+
90
+ /*///////////////////////////////////////////////////////////////
91
+ AUTOCOMPOUND FEATURE
92
+ //////////////////////////////////////////////////////////////*/
93
+
94
+ function harvestAndCompound() external {
95
+ _harvestAndCompound();
96
+ }
97
+
98
+ function getTotalAssetOwned() public view returns (uint256 totalAssetOwned) {
99
+ (uint256 stakedAmount, ) = IApeStaking(apeStaking).addressPosition(address(this));
100
+ uint256 unclaimedAmount = IApeStaking(apeStaking).pendingRewards(
101
+ APE_COIN_POOL_ID,
102
+ address(this),
103
+ 0
104
+ );
105
+ uint256 floatingAmount = _selfBalance(apeCoin);
106
+ totalAssetOwned = stakedAmount + unclaimedAmount + floatingAmount;
107
+ }
108
+
109
+ function _harvestAndCompound() internal {
110
+ // Claim reward
111
+ uint256 currentEpochId = _getCurrentEpochId();
112
+ if (currentEpochId != lastRewardClaimedEpoch) {
113
+ IApeStaking(apeStaking).claimSelfApeCoin();
114
+ lastRewardClaimedEpoch = currentEpochId;
115
+ }
116
+
117
+ // Deposit APE
118
+ uint256 amountAssetToCompound = _selfBalance(apeCoin);
119
+ if (amountAssetToCompound >= MIN_APE_DEPOSIT) {
120
+ IApeStaking(apeStaking).depositSelfApeCoin(amountAssetToCompound);
121
+ }
122
+ }
123
+
124
+ /*///////////////////////////////////////////////////////////////
125
+ MISC FUNCTIONS FOR METADATA
126
+ //////////////////////////////////////////////////////////////*/
127
+
128
+ function _previewDeposit(address, uint256 amountTokenToDeposit)
129
+ internal
130
+ view
131
+ override
132
+ returns (uint256 amountSharesOut)
133
+ {
134
+ if (totalSupply() == 0) {
135
+ amountSharesOut = amountTokenToDeposit;
136
+ } else {
137
+ amountSharesOut = (amountTokenToDeposit * totalSupply()) / getTotalAssetOwned();
138
+ }
139
+ }
140
+
141
+ function _previewRedeem(address, uint256 amountSharesToRedeem)
142
+ internal
143
+ view
144
+ override
145
+ returns (uint256 amountTokenOut)
146
+ {
147
+ amountTokenOut = (amountSharesToRedeem * getTotalAssetOwned()) / totalSupply();
148
+ }
149
+
150
+
151
+ function _getCurrentEpochId() private view returns (uint256) {
152
+ return block.timestamp / EPOCH_LENGTH;
153
+ }
154
+
155
+ function getTokensIn() public view virtual override returns (address[] memory res) {
156
+ res = new address[](1);
157
+ res[0] = apeCoin;
158
+ }
159
+
160
+ function getTokensOut() public view virtual override returns (address[] memory res) {
161
+ res = new address[](1);
162
+ res[0] = apeCoin;
163
+ }
164
+
165
+ function isValidTokenIn(address token) public view virtual override returns (bool) {
166
+ return token == apeCoin;
167
+ }
168
+
169
+ function isValidTokenOut(address token) public view virtual override returns (bool) {
170
+ return token == apeCoin;
171
+ }
172
+
173
+ function assetInfo()
174
+ external
175
+ view
176
+ returns (
177
+ AssetType assetType,
178
+ address assetAddress,
179
+ uint8 assetDecimals
180
+ )
181
+ {
182
+ return (AssetType.TOKEN, apeCoin, IERC20Metadata(apeCoin).decimals());
183
+ }
184
+ }
@@ -35,9 +35,7 @@ contract PendleQiTokenSY is SYBaseWithRewards, PendleQiTokenHelper {
35
35
  QI = IBenQiComptroller(comptroller).qiAddress();
36
36
  WAVAX = _WAVAX;
37
37
 
38
- if (underlying != NATIVE) {
39
- _safeApprove(underlying, qiToken, type(uint256).max);
40
- }
38
+ _safeApproveInf(underlying, qiToken);
41
39
  }
42
40
 
43
41
  /*///////////////////////////////////////////////////////////////
@@ -102,7 +102,7 @@ library CurveUsdd3CrvPoolHelper {
102
102
  {
103
103
  uint256[N_COINS] memory result;
104
104
  for (uint256 i = 0; i < N_COINS; ++i) {
105
- result[i] = balances[i] * _rates[i] / PRECISION;
105
+ result[i] = (balances[i] * _rates[i]) / PRECISION;
106
106
  }
107
107
  return result;
108
108
  }
@@ -32,7 +32,7 @@ abstract contract PendleConvexLPSY is SYBaseWithRewards {
32
32
  (crvLp, cvxRewardManager) = _getPoolInfo(cvxPid);
33
33
  if (crvLp != _crvLp) revert Errors.SYCurveInvalidPid();
34
34
 
35
- _safeApprove(crvLp, BOOSTER, type(uint256).max);
35
+ _safeApproveInf(crvLp, BOOSTER);
36
36
  }
37
37
 
38
38
  function _getPoolInfo(uint256 _cvxPid)
@@ -20,7 +20,7 @@ contract PendleWstEthSY is SYBase {
20
20
  wETH = _wETH;
21
21
  wstETH = _wstETH;
22
22
  stETH = IWstETH(wstETH).stETH();
23
- _safeApprove(stETH, wstETH, type(uint256).max);
23
+ _safeApproveInf(stETH, wstETH);
24
24
  }
25
25
 
26
26
  /*///////////////////////////////////////////////////////////////
@@ -66,8 +66,8 @@ contract PendleYieldToken is
66
66
  }
67
67
 
68
68
  /**
69
- * @param _doCacheIndexSameBlock if true, the PY index is cached for each block, and thus is
70
- * constant for all txs within the same block. Otherwise, the PY index is recalculated for
69
+ * @param _doCacheIndexSameBlock if true, the PY index is cached for each block, and thus is
70
+ * constant for all txs within the same block. Otherwise, the PY index is recalculated for
71
71
  * every tx.
72
72
  */
73
73
  constructor(
@@ -131,7 +131,7 @@ contract PendleYieldToken is
131
131
  }
132
132
 
133
133
  /**
134
- * @notice converts PT(+YT) tokens into SY, but interests & rewards are not redeemed at the
134
+ * @notice converts PT(+YT) tokens into SY, but interests & rewards are not redeemed at the
135
135
  * same time
136
136
  * @dev PT/YT must be transferred to this contract prior to calling
137
137
  */
@@ -172,9 +172,9 @@ contract PendleYieldToken is
172
172
  * @param redeemInterest will only transfer out interest for user if true
173
173
  * @param redeemRewards will only transfer out rewards for user if true
174
174
  * @dev With YT yielding interest in the form of SY, which is redeemable by users, the reward
175
- * distribution should be based on the amount of SYs that their YT currently represent, plus
176
- * their dueInterest. It has been proven and tested that _rewardSharesUser will not change over
177
- * time, unless users redeem their dueInterest or redeemPY. Due to this, it is required to
175
+ * distribution should be based on the amount of SYs that their YT currently represent, plus
176
+ * their dueInterest. It has been proven and tested that _rewardSharesUser will not change over
177
+ * time, unless users redeem their dueInterest or redeemPY. Due to this, it is required to
178
178
  * update users' accruedReward STRICTLY BEFORE transferring out their interest.
179
179
  */
180
180
  function redeemDueInterestAndRewards(
@@ -1,4 +1,4 @@
1
- // SPDX-License-Identifier: MIT
1
+ // SPDX-License-Identifier: GPL-3.0-or-later
2
2
  // OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/ERC20.sol)
3
3
 
4
4
  pragma solidity ^0.8.0;
@@ -26,7 +26,7 @@ contract PendleERC20 is Context, IERC20, IERC20Metadata {
26
26
  mapping(address => mapping(address => uint256)) private _allowances;
27
27
 
28
28
  uint248 private _totalSupply;
29
- uint8 private _status;
29
+ uint8 private _status;
30
30
 
31
31
  string private _name;
32
32
  string private _symbol;
@@ -1,4 +1,4 @@
1
- // SPDX-License-Identifier: MIT
1
+ // SPDX-License-Identifier: GPL-3.0-or-later
2
2
  // OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/ERC20.sol)
3
3
 
4
4
  pragma solidity ^0.8.0;
@@ -1,4 +1,4 @@
1
- // SPDX-License-Identifier: AGPL-3.0-only
1
+ // SPDX-License-Identifier: GPL-3.0-or-later
2
2
  pragma solidity >=0.8.0;
3
3
 
4
4
  library ArrayLib {
@@ -1,4 +1,4 @@
1
- // SPDX-License-Identifier: MIT
1
+ // SPDX-License-Identifier: GPL-3.0-or-later
2
2
  pragma solidity 0.8.17;
3
3
 
4
4
  import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
@@ -9,7 +9,6 @@ library Errors {
9
9
  error BulkInsufficientTokenForTrade(uint256 currentAmount, uint256 requiredAmount);
10
10
  error BulkInSufficientSyOut(uint256 actualSyOut, uint256 requiredSyOut);
11
11
  error BulkInSufficientTokenOut(uint256 actualTokenOut, uint256 requiredTokenOut);
12
- error BulkInsufficientTokenReceived(uint256 actualBalance, uint256 requiredBalance);
13
12
  error BulkInsufficientSyReceived(uint256 actualBalance, uint256 requiredBalance);
14
13
  error BulkNotMaintainer();
15
14
  error BulkNotAdmin();
@@ -112,6 +111,8 @@ library Errors {
112
111
  error SYCurveInvalidPid();
113
112
  error SYCurve3crvPoolNotFound();
114
113
 
114
+ error SYApeDepositAmountTooSmall(uint256 amountDeposited);
115
+
115
116
  // Liquidity Mining
116
117
  error VCInactivePool(address pool);
117
118
  error VCPoolAlreadyActive(address pool);
@@ -1,3 +1,4 @@
1
+ // SPDX-License-Identifier: GPL-3.0-or-later
1
2
  pragma solidity 0.8.17;
2
3
 
3
4
  library MiniHelpers {
@@ -64,10 +64,7 @@ abstract contract TokenHelper {
64
64
  }
65
65
 
66
66
  /// @notice Approves the stipulated contract to spend the given allowance in the given token
67
- /// @dev Errors with 'SA' if transfer fails
68
- /// @param token The contract address of the token to be approved
69
- /// @param to The target of the approval
70
- /// @param value The amount of the given token the target will be allowed to spend
67
+ /// @dev PLS PAY ATTENTION to tokens that requires the approval to be set to 0 before changing it
71
68
  function _safeApprove(
72
69
  address token,
73
70
  address to,
@@ -81,7 +78,9 @@ abstract contract TokenHelper {
81
78
 
82
79
  function _safeApproveInf(address token, address to) internal {
83
80
  if (token == NATIVE) return;
84
- if (IERC20(token).allowance(address(this), to) < LOWER_BOUND_APPROVAL)
81
+ if (IERC20(token).allowance(address(this), to) < LOWER_BOUND_APPROVAL) {
82
+ _safeApprove(token, to, 0);
85
83
  _safeApprove(token, to, type(uint256).max);
84
+ }
86
85
  }
87
86
  }
@@ -25,10 +25,9 @@ interface ICrvPool {
25
25
  uint256 min_dy // The amount of i being exchanged.
26
26
  ) external returns (uint256);
27
27
 
28
- function add_liquidity(
29
- uint256[2] memory _deposit_amount,
30
- uint256 _min_amount
31
- ) external returns (uint256 lpOut);
28
+ function add_liquidity(uint256[2] memory _deposit_amount, uint256 _min_amount)
29
+ external
30
+ returns (uint256 lpOut);
32
31
 
33
32
  function remove_liquidity_one_coin(
34
33
  uint256 _burn_amount,
@@ -19,10 +19,7 @@ interface ITriCrvPool {
19
19
  uint256 min_dy // The amount of i being exchanged.
20
20
  ) external returns (uint256);
21
21
 
22
- function add_liquidity(
23
- uint256[3] memory _deposit_amount,
24
- uint256 _min_amount
25
- ) external;
22
+ function add_liquidity(uint256[3] memory _deposit_amount, uint256 _min_amount) external;
26
23
 
27
24
  function remove_liquidity_one_coin(
28
25
  uint256 _burn_amount,
@@ -0,0 +1,27 @@
1
+ // SPDX-License-Identifier: GPL-3.0-or-later
2
+
3
+ pragma solidity 0.8.17;
4
+
5
+ interface IApeStaking {
6
+ function apeCoin() external view returns (address);
7
+
8
+ function depositSelfApeCoin(uint256 _amount) external;
9
+
10
+ function withdrawApeCoin(uint256 _amount, address _recipient) external;
11
+
12
+ function claimSelfApeCoin() external;
13
+
14
+ /**
15
+ * @notice when poolId is set to 0, tokenId's value does not matter
16
+ */
17
+ function pendingRewards(
18
+ uint256 _poolId,
19
+ address _address,
20
+ uint256 _tokenId
21
+ ) external view returns (uint256);
22
+
23
+ function addressPosition(address addr)
24
+ external
25
+ view
26
+ returns (uint256 stakedAmount, int256 rewardsDebt);
27
+ }
@@ -1,4 +1,4 @@
1
- // SPDX-License-Identifier: MIT
1
+ // SPDX-License-Identifier: GPL-3.0-or-later
2
2
  pragma solidity 0.8.17;
3
3
 
4
4
  interface IBoringOwnableUpgradeable {
@@ -7,4 +7,4 @@ interface IBoringOwnableUpgradeable {
7
7
  bool direct,
8
8
  bool renounce
9
9
  ) external;
10
- }
10
+ }
@@ -1,4 +1,4 @@
1
- // SPDX-License-Identifier: MIT
1
+ // SPDX-License-Identifier: GPL-3.0-or-later
2
2
 
3
3
  pragma solidity >=0.5.0;
4
4
 
@@ -1,4 +1,4 @@
1
- // SPDX-License-Identifier: BUSL-1.1
1
+ // SPDX-License-Identifier: GPL-3.0-or-later
2
2
 
3
3
  pragma solidity >=0.5.0;
4
4
 
@@ -8,5 +8,10 @@ interface ILayerZeroReceiver {
8
8
  // @param _srcAddress - the source sending contract address from the source chain
9
9
  // @param _nonce - the ordered message nonce
10
10
  // @param _payload - the signed payload is the UA bytes has encoded to be sent
11
- function lzReceive(uint16 _srcChainId, bytes calldata _srcAddress, uint64 _nonce, bytes calldata _payload) external;
12
- }
11
+ function lzReceive(
12
+ uint16 _srcChainId,
13
+ bytes calldata _srcAddress,
14
+ uint64 _nonce,
15
+ bytes calldata _payload
16
+ ) external;
17
+ }
@@ -4,17 +4,41 @@ pragma solidity 0.8.17;
4
4
  import "../core/BulkSeller/BulkSellerMathCore.sol";
5
5
 
6
6
  interface IPBulkSeller {
7
- function swapExactSyForToken(
8
- address receiver,
9
- uint256 exactSyIn,
10
- uint256 minTokenOut
11
- ) external returns (uint256 netTokenOut);
7
+ event SwapExactTokenForSy(address receiver, uint256 netTokenIn, uint256 netSyOut);
8
+ event SwapExactSyForToken(address receiver, uint256 netSyIn, uint256 netTokenOut);
9
+ event RateUpdated(
10
+ uint256 newRateTokenToSy,
11
+ uint256 newRateSyToToken,
12
+ uint256 oldRateTokenToSy,
13
+ uint256 oldRateSyToToken
14
+ );
15
+ event ReBalanceTokenToSy(
16
+ uint256 netTokenDeposit,
17
+ uint256 netSyFromToken,
18
+ uint256 newTokenProp,
19
+ uint256 oldTokenProp
20
+ );
21
+ event ReBalanceSyToToken(
22
+ uint256 netSyRedeem,
23
+ uint256 netTokenFromSy,
24
+ uint256 newTokenProp,
25
+ uint256 oldTokenProp
26
+ );
27
+ event ReserveUpdated(uint256 totalToken, uint256 totalSy);
28
+ event FeeRateUpdated(uint256 newFeeRate, uint256 oldFeeRate);
12
29
 
13
30
  function swapExactTokenForSy(
14
31
  address receiver,
15
32
  uint256 netTokenIn,
16
33
  uint256 minSyOut
17
- ) external returns (uint256 netSyOut);
34
+ ) external payable returns (uint256 netSyOut);
35
+
36
+ function swapExactSyForToken(
37
+ address receiver,
38
+ uint256 exactSyIn,
39
+ uint256 minTokenOut,
40
+ bool swapFromInternalBalance
41
+ ) external returns (uint256 netTokenOut);
18
42
 
19
43
  function SY() external view returns (address);
20
44
 
@@ -9,6 +9,4 @@ interface IPBulkSellerFactory {
9
9
  function get(address token, address SY) external view returns (address);
10
10
 
11
11
  function isMaintainer(address addr) external view returns (bool);
12
-
13
- function isAdmin(address addr) external view returns (bool);
14
12
  }
@@ -62,23 +62,13 @@ interface IPMarket is IERC20Metadata, IPGauge {
62
62
  address receiver,
63
63
  uint256 exactPtIn,
64
64
  bytes calldata data
65
- )
66
- external
67
- returns (
68
- uint256 netSyOut,
69
- uint256 netSyFee
70
- );
65
+ ) external returns (uint256 netSyOut, uint256 netSyFee);
71
66
 
72
67
  function swapSyForExactPt(
73
68
  address receiver,
74
69
  uint256 exactPtOut,
75
70
  bytes calldata data
76
- )
77
- external
78
- returns (
79
- uint256 netSyIn,
80
- uint256 netSyFee
81
- );
71
+ ) external returns (uint256 netSyIn, uint256 netSyFee);
82
72
 
83
73
  function redeemRewards(address user) external returns (uint256[] memory);
84
74
 
@@ -1,4 +1,4 @@
1
- // SPDX-License-Identifier: GPL-3.0-only
1
+ // SPDX-License-Identifier: GPL-3.0-or-later
2
2
 
3
3
  pragma solidity >=0.8.0;
4
4
 
@@ -1,4 +1,4 @@
1
- // SPDX-License-Identifier: GPL-3.0-only
1
+ // SPDX-License-Identifier: GPL-3.0-or-later
2
2
 
3
3
  pragma solidity >=0.8.0;
4
4
 
@@ -1,4 +1,4 @@
1
- // SPDX-License-Identifier: MIT
1
+ // SPDX-License-Identifier: GPL-3.0-or-later
2
2
 
3
3
  pragma solidity 0.8.17;
4
4
 
@@ -1,4 +1,4 @@
1
- // SPDX-License-Identifier: MIT
1
+ // SPDX-License-Identifier: GPL-3.0-or-later
2
2
  /*
3
3
  * MIT License
4
4
  * ===========
@@ -11,7 +11,7 @@ interface IStETH {
11
11
  function burnShares(address _account, uint256 _sharesAmount)
12
12
  external
13
13
  returns (uint256 newTotalShares);
14
-
14
+
15
15
  function sharesOf(address account) external view returns (uint256);
16
16
 
17
17
  function getTotalShares() external view returns (uint256);
@@ -1,4 +1,4 @@
1
- // SPDX-License-Identifier: MIT
1
+ // SPDX-License-Identifier: GPL-3.0-or-later
2
2
  /*
3
3
  * MIT License
4
4
  * ===========
@@ -1,4 +1,4 @@
1
- // SPDX-License-Identifier: MIT
1
+ // SPDX-License-Identifier: GPL-3.0-or-later
2
2
  /*
3
3
  * MIT License
4
4
  * ===========
@@ -1,4 +1,4 @@
1
- // SPDX-License-Identifier: MIT
1
+ // SPDX-License-Identifier: GPL-3.0-or-later
2
2
  /*
3
3
  * MIT License
4
4
  * ===========
@@ -1,4 +1,4 @@
1
- // SPDX-License-Identifier: MIT
1
+ // SPDX-License-Identifier: GPL-3.0-or-later
2
2
  /*
3
3
  * MIT License
4
4
  * ===========