@pendle/core-v2 0.13.1-testnet → 0.15.0-mainnet

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 (296) hide show
  1. package/build/artifacts/contracts/LiquidityMining/CrossChainMsg/PendleMsgReceiveEndpointUpg.sol/PendleMsgReceiveEndpointUpg.dbg.json +1 -1
  2. package/build/artifacts/contracts/LiquidityMining/CrossChainMsg/PendleMsgReceiveEndpointUpg.sol/PendleMsgReceiveEndpointUpg.json +2 -2
  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/PendleMsgSendEndpointUpg.sol/PendleMsgSendEndpointUpg.json +2 -2
  6. package/build/artifacts/contracts/LiquidityMining/CrossChainMsg/PendleMsgSenderAppUpg.sol/PendleMsgSenderAppUpg.dbg.json +1 -1
  7. package/build/artifacts/contracts/LiquidityMining/FeeDistributor/EpochResultManager.sol/EpochResultManager.dbg.json +1 -1
  8. package/build/artifacts/contracts/LiquidityMining/FeeDistributor/PendleFeeDistributor.sol/PendleFeeDistributor.dbg.json +1 -1
  9. package/build/artifacts/contracts/LiquidityMining/FeeDistributor/PendleFeeDistributor.sol/PendleFeeDistributor.json +2 -2
  10. package/build/artifacts/contracts/LiquidityMining/FeeDistributor/PendleFeeDistributorFactory.sol/PendleFeeDistributorFactory.dbg.json +1 -1
  11. package/build/artifacts/contracts/LiquidityMining/FeeDistributor/PendleFeeDistributorFactory.sol/PendleFeeDistributorFactory.json +2 -2
  12. package/build/artifacts/contracts/LiquidityMining/GaugeController/PendleGaugeControllerBaseUpg.sol/PendleGaugeControllerBaseUpg.dbg.json +1 -1
  13. package/build/artifacts/contracts/LiquidityMining/GaugeController/PendleGaugeControllerBaseUpg.sol/PendleGaugeControllerBaseUpg.json +89 -0
  14. package/build/artifacts/contracts/LiquidityMining/GaugeController/PendleGaugeControllerMainchainUpg.sol/PendleGaugeControllerMainchainUpg.dbg.json +1 -1
  15. package/build/artifacts/contracts/LiquidityMining/GaugeController/PendleGaugeControllerMainchainUpg.sol/PendleGaugeControllerMainchainUpg.json +91 -2
  16. package/build/artifacts/contracts/LiquidityMining/GaugeController/PendleGaugeControllerSidechainUpg.sol/PendleGaugeControllerSidechainUpg.dbg.json +1 -1
  17. package/build/artifacts/contracts/LiquidityMining/GaugeController/PendleGaugeControllerSidechainUpg.sol/PendleGaugeControllerSidechainUpg.json +91 -2
  18. package/build/artifacts/contracts/LiquidityMining/VotingController/PendleVotingControllerUpg.sol/PendleVotingControllerUpg.dbg.json +1 -1
  19. package/build/artifacts/contracts/LiquidityMining/VotingController/PendleVotingControllerUpg.sol/PendleVotingControllerUpg.json +2 -2
  20. package/build/artifacts/contracts/LiquidityMining/VotingController/VotingControllerStorageUpg.sol/VotingControllerStorageUpg.dbg.json +1 -1
  21. package/build/artifacts/contracts/LiquidityMining/VotingEscrow/VotingEscrowPendleMainchain.sol/VotingEscrowPendleMainchain.dbg.json +1 -1
  22. package/build/artifacts/contracts/LiquidityMining/VotingEscrow/VotingEscrowPendleMainchain.sol/VotingEscrowPendleMainchain.json +2 -2
  23. package/build/artifacts/contracts/LiquidityMining/VotingEscrow/VotingEscrowPendleSidechain.sol/VotingEscrowPendleSidechain.dbg.json +1 -1
  24. package/build/artifacts/contracts/LiquidityMining/VotingEscrow/VotingEscrowPendleSidechain.sol/VotingEscrowPendleSidechain.json +2 -2
  25. package/build/artifacts/contracts/LiquidityMining/VotingEscrow/VotingEscrowTokenBase.sol/VotingEscrowTokenBase.dbg.json +1 -1
  26. package/build/artifacts/contracts/LiquidityMining/libraries/VeBalanceLib.sol/VeBalanceLib.dbg.json +1 -1
  27. package/build/artifacts/contracts/LiquidityMining/libraries/VeBalanceLib.sol/VeBalanceLib.json +2 -2
  28. package/build/artifacts/contracts/LiquidityMining/libraries/VeHistoryLib.sol/CheckpointHelper.dbg.json +1 -1
  29. package/build/artifacts/contracts/LiquidityMining/libraries/VeHistoryLib.sol/CheckpointHelper.json +2 -2
  30. package/build/artifacts/contracts/LiquidityMining/libraries/VeHistoryLib.sol/Checkpoints.dbg.json +1 -1
  31. package/build/artifacts/contracts/LiquidityMining/libraries/VeHistoryLib.sol/Checkpoints.json +2 -2
  32. package/build/artifacts/contracts/core/Market/MarketMathCore.sol/MarketMathCore.dbg.json +1 -1
  33. package/build/artifacts/contracts/core/Market/MarketMathCore.sol/MarketMathCore.json +2 -2
  34. package/build/artifacts/contracts/core/Market/OracleLib.sol/OracleLib.dbg.json +1 -1
  35. package/build/artifacts/contracts/core/Market/OracleLib.sol/OracleLib.json +2 -2
  36. package/build/artifacts/contracts/core/Market/PendleGauge.sol/PendleGauge.dbg.json +1 -1
  37. package/build/artifacts/contracts/core/Market/PendleMarket.sol/PendleMarket.dbg.json +1 -1
  38. package/build/artifacts/contracts/core/Market/PendleMarket.sol/PendleMarket.json +28 -28
  39. package/build/artifacts/contracts/core/Market/PendleMarketFactory.sol/PendleMarketFactory.dbg.json +1 -1
  40. package/build/artifacts/contracts/core/Market/PendleMarketFactory.sol/PendleMarketFactory.json +2 -2
  41. package/build/artifacts/contracts/core/RewardManager/RewardManager.sol/RewardManager.dbg.json +1 -1
  42. package/build/artifacts/contracts/core/RewardManager/RewardManagerAbstract.sol/RewardManagerAbstract.dbg.json +1 -1
  43. package/build/artifacts/contracts/core/StandardizedYield/PYIndex.sol/PYIndexLib.dbg.json +4 -0
  44. package/build/artifacts/contracts/core/{SuperComposableYield → StandardizedYield}/PYIndex.sol/PYIndexLib.json +3 -3
  45. package/build/artifacts/contracts/core/StandardizedYield/SYBase.sol/SYBase.dbg.json +4 -0
  46. package/build/artifacts/contracts/core/{SuperComposableYield/SCYBase.sol/SCYBase.json → StandardizedYield/SYBase.sol/SYBase.json} +11 -11
  47. package/build/artifacts/contracts/core/StandardizedYield/SYBaseWithRewards.sol/SYBaseWithRewards.dbg.json +4 -0
  48. package/build/artifacts/contracts/core/{SuperComposableYield/SCYBaseWithRewards.sol/SCYBaseWithRewards.json → StandardizedYield/SYBaseWithRewards.sol/SYBaseWithRewards.json} +11 -11
  49. package/build/artifacts/contracts/core/StandardizedYield/SYUtils.sol/SYUtils.dbg.json +4 -0
  50. package/build/artifacts/contracts/core/{SuperComposableYield/SCYUtils.sol/SCYUtils.json → StandardizedYield/SYUtils.sol/SYUtils.json} +4 -4
  51. package/build/artifacts/contracts/core/StandardizedYield/implementations/BenQi/PendleQiTokenHelper.sol/PendleQiTokenHelper.dbg.json +4 -0
  52. package/build/artifacts/contracts/core/{SuperComposableYield → StandardizedYield}/implementations/BenQi/PendleQiTokenHelper.sol/PendleQiTokenHelper.json +3 -3
  53. package/build/artifacts/contracts/core/StandardizedYield/implementations/BenQi/PendleQiTokenSY.sol/PendleQiTokenSY.dbg.json +4 -0
  54. package/build/artifacts/contracts/core/{SuperComposableYield/implementations/BenQi/PendleQiTokenSCY.sol/PendleQiTokenSCY.json → StandardizedYield/implementations/BenQi/PendleQiTokenSY.sol/PendleQiTokenSY.json} +17 -17
  55. package/build/artifacts/contracts/core/StandardizedYield/implementations/Convex/ConvexCurveLP/Pendle3CrvAndTokenSY.sol/Pendle3CrvAndTokenSY.dbg.json +4 -0
  56. package/build/artifacts/contracts/core/StandardizedYield/implementations/Convex/ConvexCurveLP/Pendle3CrvAndTokenSY.sol/Pendle3CrvAndTokenSY.json +1018 -0
  57. package/build/artifacts/contracts/core/StandardizedYield/implementations/Convex/ConvexCurveLP/PendleConvexLPSY.sol/PendleConvexLPSY.dbg.json +4 -0
  58. package/build/artifacts/contracts/core/{SuperComposableYield/implementations/Convex/ConvexCurveLP/PendleConvexCurveLPSCY.sol/PendleConvexCurveLPSCY.json → StandardizedYield/implementations/Convex/ConvexCurveLP/PendleConvexLPSY.sol/PendleConvexLPSY.json} +47 -47
  59. package/build/artifacts/contracts/core/StandardizedYield/implementations/Convex/Pendle3CrvHelper.sol/Pendle3CrvHelper.dbg.json +4 -0
  60. package/build/artifacts/contracts/core/{SuperComposableYield → StandardizedYield}/implementations/Convex/Pendle3CrvHelper.sol/Pendle3CrvHelper.json +5 -5
  61. package/build/artifacts/contracts/core/StandardizedYield/implementations/PendleWstEthSY.sol/PendleWstEthSY.dbg.json +4 -0
  62. package/build/artifacts/contracts/core/StandardizedYield/implementations/PendleWstEthSY.sol/PendleWstEthSY.json +851 -0
  63. package/build/artifacts/contracts/core/YieldContracts/InterestManagerYT.sol/InterestManagerYT.dbg.json +1 -1
  64. package/build/artifacts/contracts/core/YieldContracts/PendlePrincipalToken.sol/PendlePrincipalToken.dbg.json +1 -1
  65. package/build/artifacts/contracts/core/YieldContracts/PendlePrincipalToken.sol/PendlePrincipalToken.json +4 -4
  66. package/build/artifacts/contracts/core/YieldContracts/PendleYieldContractFactory.sol/PendleYieldContractFactory.dbg.json +1 -1
  67. package/build/artifacts/contracts/core/YieldContracts/PendleYieldContractFactory.sol/PendleYieldContractFactory.json +4 -4
  68. package/build/artifacts/contracts/core/YieldContracts/PendleYieldToken.sol/PendleYieldToken.dbg.json +1 -1
  69. package/build/artifacts/contracts/core/YieldContracts/PendleYieldToken.sol/PendleYieldToken.json +24 -24
  70. package/build/artifacts/contracts/core/erc20/PendleERC20Permit.sol/PendleERC20Permit.dbg.json +1 -1
  71. package/build/artifacts/contracts/core/erc20/PendleERC20Permit.sol/PendleERC20Permit.json +2 -2
  72. package/build/artifacts/contracts/core/libraries/Errors.sol/Errors.dbg.json +1 -1
  73. package/build/artifacts/contracts/core/libraries/Errors.sol/Errors.json +28 -28
  74. package/build/artifacts/contracts/core/libraries/TokenHelper.sol/TokenHelper.dbg.json +1 -1
  75. package/build/artifacts/contracts/interfaces/Curve/ICrvPool.sol/ICrvPool.dbg.json +1 -1
  76. package/build/artifacts/contracts/interfaces/Curve/ICrvPool.sol/ICrvPool.json +19 -0
  77. package/build/artifacts/contracts/interfaces/IPActionAddRemoveLiq.sol/IPActionAddRemoveLiq.dbg.json +1 -1
  78. package/build/artifacts/contracts/interfaces/IPActionAddRemoveLiq.sol/IPActionAddRemoveLiq.json +30 -30
  79. package/build/artifacts/contracts/interfaces/IPActionMintRedeem.sol/IPActionMintRedeem.dbg.json +1 -1
  80. package/build/artifacts/contracts/interfaces/IPActionMintRedeem.sol/IPActionMintRedeem.json +34 -34
  81. package/build/artifacts/contracts/interfaces/IPActionSwapPT.sol/IPActionSwapPT.dbg.json +1 -1
  82. package/build/artifacts/contracts/interfaces/IPActionSwapPT.sol/IPActionSwapPT.json +20 -20
  83. package/build/artifacts/contracts/interfaces/IPActionSwapPTYT.sol/IPActionSwapPTYT.dbg.json +1 -1
  84. package/build/artifacts/contracts/interfaces/IPActionSwapPTYT.sol/IPActionSwapPTYT.json +2 -2
  85. package/build/artifacts/contracts/interfaces/IPActionSwapYT.sol/IPActionSwapYT.dbg.json +1 -1
  86. package/build/artifacts/contracts/interfaces/IPActionSwapYT.sol/IPActionSwapYT.json +20 -20
  87. package/build/artifacts/contracts/interfaces/IPAllAction.sol/IPAllAction.dbg.json +1 -1
  88. package/build/artifacts/contracts/interfaces/IPAllAction.sol/IPAllAction.json +106 -106
  89. package/build/artifacts/contracts/interfaces/IPMarket.sol/IPMarket.dbg.json +1 -1
  90. package/build/artifacts/contracts/interfaces/IPMarket.sol/IPMarket.json +18 -18
  91. package/build/artifacts/contracts/interfaces/IPMarketSwapCallback.sol/IPMarketSwapCallback.dbg.json +1 -1
  92. package/build/artifacts/contracts/interfaces/IPMarketSwapCallback.sol/IPMarketSwapCallback.json +1 -1
  93. package/build/artifacts/contracts/interfaces/IPPrincipalToken.sol/IPPrincipalToken.dbg.json +1 -1
  94. package/build/artifacts/contracts/interfaces/IPPrincipalToken.sol/IPPrincipalToken.json +1 -1
  95. package/build/artifacts/contracts/interfaces/IPVotingController.sol/IPVotingController.dbg.json +1 -1
  96. package/build/artifacts/contracts/interfaces/IPVotingEscrowMainchain.sol/IPVotingEscrowMainchain.dbg.json +1 -1
  97. package/build/artifacts/contracts/interfaces/IPYieldContractFactory.sol/IPYieldContractFactory.dbg.json +1 -1
  98. package/build/artifacts/contracts/interfaces/IPYieldContractFactory.sol/IPYieldContractFactory.json +3 -3
  99. package/build/artifacts/contracts/interfaces/IPYieldToken.sol/IPYieldToken.dbg.json +1 -1
  100. package/build/artifacts/contracts/interfaces/IPYieldToken.sol/IPYieldToken.json +6 -6
  101. package/build/artifacts/contracts/interfaces/IStandardizedYield.sol/IStandardizedYield.dbg.json +4 -0
  102. package/build/artifacts/contracts/interfaces/{ISuperComposableYield.sol/ISuperComposableYield.json → IStandardizedYield.sol/IStandardizedYield.json} +5 -5
  103. package/build/artifacts/contracts/offchain-helpers/MarketMathStatic.sol/MarketMathStatic.dbg.json +1 -1
  104. package/build/artifacts/contracts/offchain-helpers/MarketMathStatic.sol/MarketMathStatic.json +7 -7
  105. package/build/artifacts/contracts/offchain-helpers/RouterStatic.sol/RouterStatic.dbg.json +1 -1
  106. package/build/artifacts/contracts/offchain-helpers/RouterStatic.sol/RouterStatic.json +116 -116
  107. package/build/artifacts/contracts/router/ActionAddRemoveLiq.sol/ActionAddRemoveLiq.dbg.json +1 -1
  108. package/build/artifacts/contracts/router/ActionAddRemoveLiq.sol/ActionAddRemoveLiq.json +35 -35
  109. package/build/artifacts/contracts/router/ActionCallback.sol/ActionCallback.dbg.json +1 -1
  110. package/build/artifacts/contracts/router/ActionCallback.sol/ActionCallback.json +12 -12
  111. package/build/artifacts/contracts/router/ActionMintRedeem.sol/ActionMintRedeem.dbg.json +1 -1
  112. package/build/artifacts/contracts/router/ActionMintRedeem.sol/ActionMintRedeem.json +41 -41
  113. package/build/artifacts/contracts/router/ActionMisc.sol/ActionMisc.dbg.json +1 -1
  114. package/build/artifacts/contracts/router/ActionMisc.sol/ActionMisc.json +2 -2
  115. package/build/artifacts/contracts/router/ActionSwapPT.sol/ActionSwapPT.dbg.json +1 -1
  116. package/build/artifacts/contracts/router/ActionSwapPT.sol/ActionSwapPT.json +28 -28
  117. package/build/artifacts/contracts/router/ActionSwapPTYT.sol/ActionSwapPTYT.dbg.json +1 -1
  118. package/build/artifacts/contracts/router/ActionSwapPTYT.sol/ActionSwapPTYT.json +4 -4
  119. package/build/artifacts/contracts/router/ActionSwapYT.sol/ActionSwapYT.dbg.json +1 -1
  120. package/build/artifacts/contracts/router/ActionSwapYT.sol/ActionSwapYT.json +22 -22
  121. package/build/artifacts/contracts/router/PendleRouter.sol/PendleRouter.dbg.json +1 -1
  122. package/build/artifacts/contracts/router/PendleRouter.sol/PendleRouter.json +2 -2
  123. package/build/artifacts/contracts/router/base/ActionBaseMintRedeem.sol/ActionBaseMintRedeem.dbg.json +1 -1
  124. package/build/artifacts/contracts/router/base/CallbackHelper.sol/CallbackHelper.dbg.json +1 -1
  125. package/build/artifacts/contracts/router/base/MarketApproxLib.sol/MarketApproxPtInLib.dbg.json +1 -1
  126. package/build/artifacts/contracts/router/base/MarketApproxLib.sol/MarketApproxPtInLib.json +2 -2
  127. package/build/artifacts/contracts/router/base/MarketApproxLib.sol/MarketApproxPtOutLib.dbg.json +1 -1
  128. package/build/artifacts/contracts/router/base/MarketApproxLib.sol/MarketApproxPtOutLib.json +2 -2
  129. package/build/artifacts/contracts/router/kyberswap/KyberSwapHelper.sol/KyberSwapHelper.dbg.json +1 -1
  130. package/contracts/LiquidityMining/GaugeController/PendleGaugeControllerBaseUpg.sol +8 -1
  131. package/contracts/core/Market/MarketMathCore.sol +51 -54
  132. package/contracts/core/Market/PendleGauge.sol +8 -8
  133. package/contracts/core/Market/PendleMarket.sol +49 -49
  134. package/contracts/core/Market/PendleMarketFactory.sol +1 -1
  135. package/contracts/core/RewardManager/RewardManager.sol +1 -1
  136. package/contracts/core/{SuperComposableYield → StandardizedYield}/PYIndex.sol +16 -16
  137. package/contracts/core/{SuperComposableYield/SCYBase.sol → StandardizedYield/SYBase.sol} +16 -21
  138. package/contracts/core/{SuperComposableYield/SCYBaseWithRewards.sol → StandardizedYield/SYBaseWithRewards.sol} +9 -12
  139. package/contracts/core/StandardizedYield/SYUtils.sol +26 -0
  140. package/contracts/core/{SuperComposableYield → StandardizedYield}/implementations/BenQi/PendleQiTokenHelper.sol +1 -1
  141. package/contracts/core/{SuperComposableYield/implementations/BenQi/PendleQiTokenSCY.sol → StandardizedYield/implementations/BenQi/PendleQiTokenSY.sol} +10 -10
  142. package/contracts/core/StandardizedYield/implementations/Convex/ConvexCurveLP/Pendle3CrvAndTokenSY.sol +167 -0
  143. package/contracts/core/{SuperComposableYield/implementations/Convex/ConvexCurveLP/PendleConvexCurveLPSCY.sol → StandardizedYield/implementations/Convex/ConvexCurveLP/PendleConvexLPSY.sol} +51 -70
  144. package/contracts/core/{SuperComposableYield → StandardizedYield}/implementations/Convex/Pendle3CrvHelper.sol +7 -7
  145. package/contracts/core/{SuperComposableYield/implementations/PendleWstEthSCY.sol → StandardizedYield/implementations/PendleWstEthSY.sol} +13 -10
  146. package/contracts/core/YieldContracts/InterestManagerYT.sol +7 -7
  147. package/contracts/core/YieldContracts/PendlePrincipalToken.sol +3 -3
  148. package/contracts/core/YieldContracts/PendleYieldContractFactory.sol +15 -15
  149. package/contracts/core/YieldContracts/PendleYieldToken.sol +72 -72
  150. package/contracts/core/erc20/PendleERC20Permit.sol +1 -1
  151. package/contracts/core/libraries/Errors.sol +22 -22
  152. package/contracts/core/libraries/TokenHelper.sol +0 -33
  153. package/contracts/interfaces/Curve/ICrvPool.sol +2 -0
  154. package/contracts/interfaces/IPActionAddRemoveLiq.sol +27 -27
  155. package/contracts/interfaces/IPActionMintRedeem.sol +30 -30
  156. package/contracts/interfaces/IPActionSwapPT.sol +16 -16
  157. package/contracts/interfaces/IPActionSwapPTYT.sol +2 -2
  158. package/contracts/interfaces/IPActionSwapYT.sol +16 -16
  159. package/contracts/interfaces/IPMarket.sol +14 -19
  160. package/contracts/interfaces/IPMarketSwapCallback.sol +1 -1
  161. package/contracts/interfaces/IPPrincipalToken.sol +1 -1
  162. package/contracts/interfaces/IPYieldContractFactory.sol +3 -3
  163. package/contracts/interfaces/IPYieldToken.sol +7 -9
  164. package/contracts/interfaces/{ISuperComposableYield.sol → IStandardizedYield.sol} +6 -6
  165. package/contracts/offchain-helpers/MarketMathStatic.sol +116 -131
  166. package/contracts/offchain-helpers/RouterStatic.sol +80 -93
  167. package/contracts/router/ActionAddRemoveLiq.sol +99 -111
  168. package/contracts/router/ActionCallback.sol +46 -46
  169. package/contracts/router/ActionMintRedeem.sol +58 -58
  170. package/contracts/router/ActionSwapPT.sol +61 -69
  171. package/contracts/router/ActionSwapPTYT.sol +7 -7
  172. package/contracts/router/ActionSwapYT.sol +72 -79
  173. package/contracts/router/PendleRouter.sol +16 -16
  174. package/contracts/router/base/ActionBaseMintRedeem.sol +43 -43
  175. package/contracts/router/base/CallbackHelper.sol +20 -20
  176. package/contracts/router/base/MarketApproxLib.sol +166 -143
  177. package/contracts/router/kyberswap/KyberSwapHelper.sol +2 -2
  178. package/deployments/1-core.json +16 -0
  179. package/deployments/1-markets/STETH_MARCH_30.json +8 -0
  180. package/package.json +3 -3
  181. package/typechain-types/ActionAddRemoveLiq.ts +127 -129
  182. package/typechain-types/ActionCallback.ts +5 -5
  183. package/typechain-types/ActionMintRedeem.ts +139 -141
  184. package/typechain-types/ActionSwapPT.ts +73 -73
  185. package/typechain-types/ActionSwapPTYT.ts +2 -2
  186. package/typechain-types/ActionSwapYT.ts +73 -73
  187. package/typechain-types/ICrvPool.ts +16 -0
  188. package/typechain-types/IPActionAddRemoveLiq.ts +127 -129
  189. package/typechain-types/IPActionMintRedeem.ts +139 -141
  190. package/typechain-types/IPActionSwapPT.ts +73 -73
  191. package/typechain-types/IPActionSwapPTYT.ts +2 -2
  192. package/typechain-types/IPActionSwapYT.ts +73 -73
  193. package/typechain-types/IPAllAction.ts +402 -406
  194. package/typechain-types/IPMarket.ts +51 -54
  195. package/typechain-types/IPMarketSwapCallback.ts +5 -5
  196. package/typechain-types/IPPrincipalToken.ts +8 -8
  197. package/typechain-types/IPYieldContractFactory.ts +13 -13
  198. package/typechain-types/IPYieldToken.ts +17 -17
  199. package/typechain-types/IStandardizedYield.ts +895 -0
  200. package/typechain-types/MarketMathStatic.ts +27 -27
  201. package/typechain-types/Pendle3CrvAndTokenSY.ts +1243 -0
  202. package/typechain-types/Pendle3CrvHelper.ts +13 -13
  203. package/typechain-types/PendleConvexLPSY.ts +1189 -0
  204. package/typechain-types/PendleGaugeControllerBaseUpg.ts +125 -0
  205. package/typechain-types/PendleGaugeControllerMainchainUpg.ts +125 -0
  206. package/typechain-types/PendleGaugeControllerSidechainUpg.ts +124 -0
  207. package/typechain-types/PendleMarket.ts +54 -57
  208. package/typechain-types/PendlePrincipalToken.ts +8 -8
  209. package/typechain-types/PendleQiTokenSY.ts +1166 -0
  210. package/typechain-types/PendleWstEthSY.ts +1038 -0
  211. package/typechain-types/PendleYieldContractFactory.ts +8 -8
  212. package/typechain-types/PendleYieldToken.ts +41 -44
  213. package/typechain-types/RouterStatic.ts +196 -196
  214. package/typechain-types/SYBase.ts +1001 -0
  215. package/typechain-types/SYBaseWithRewards.ts +1094 -0
  216. package/typechain-types/factories/ActionAddRemoveLiq__factory.ts +34 -34
  217. package/typechain-types/factories/ActionCallback__factory.ts +11 -11
  218. package/typechain-types/factories/ActionMintRedeem__factory.ts +38 -38
  219. package/typechain-types/factories/ActionMisc__factory.ts +1 -1
  220. package/typechain-types/factories/ActionSwapPTYT__factory.ts +3 -3
  221. package/typechain-types/factories/ActionSwapPT__factory.ts +27 -27
  222. package/typechain-types/factories/ActionSwapYT__factory.ts +21 -21
  223. package/typechain-types/factories/Errors__factory.ts +27 -27
  224. package/typechain-types/factories/ICrvPool__factory.ts +19 -0
  225. package/typechain-types/factories/IPActionAddRemoveLiq__factory.ts +30 -30
  226. package/typechain-types/factories/IPActionMintRedeem__factory.ts +34 -34
  227. package/typechain-types/factories/IPActionSwapPTYT__factory.ts +2 -2
  228. package/typechain-types/factories/IPActionSwapPT__factory.ts +20 -20
  229. package/typechain-types/factories/IPActionSwapYT__factory.ts +20 -20
  230. package/typechain-types/factories/IPAllAction__factory.ts +106 -106
  231. package/typechain-types/factories/IPMarketSwapCallback__factory.ts +1 -1
  232. package/typechain-types/factories/IPMarket__factory.ts +18 -18
  233. package/typechain-types/factories/IPPrincipalToken__factory.ts +1 -1
  234. package/typechain-types/factories/IPYieldContractFactory__factory.ts +3 -3
  235. package/typechain-types/factories/IPYieldToken__factory.ts +6 -6
  236. package/typechain-types/factories/IStandardizedYield__factory.ts +658 -0
  237. package/typechain-types/factories/MarketMathStatic__factory.ts +6 -6
  238. package/typechain-types/factories/OracleLib__factory.ts +1 -1
  239. package/typechain-types/factories/Pendle3CrvAndTokenSY__factory.ts +1106 -0
  240. package/typechain-types/factories/Pendle3CrvHelper__factory.ts +3 -3
  241. package/typechain-types/factories/PendleConvexLPSY__factory.ts +963 -0
  242. package/typechain-types/factories/PendleERC20Permit__factory.ts +1 -1
  243. package/typechain-types/factories/PendleFeeDistributorFactory__factory.ts +1 -1
  244. package/typechain-types/factories/PendleFeeDistributor__factory.ts +1 -1
  245. package/typechain-types/factories/PendleGaugeControllerBaseUpg__factory.ts +89 -0
  246. package/typechain-types/factories/PendleGaugeControllerMainchainUpg__factory.ts +90 -1
  247. package/typechain-types/factories/PendleGaugeControllerSidechainUpg__factory.ts +90 -1
  248. package/typechain-types/factories/PendleMarketFactory__factory.ts +1 -1
  249. package/typechain-types/factories/PendleMarket__factory.ts +21 -21
  250. package/typechain-types/factories/PendleMsgReceiveEndpointUpg__factory.ts +1 -1
  251. package/typechain-types/factories/PendleMsgSendEndpointUpg__factory.ts +1 -1
  252. package/typechain-types/factories/PendlePrincipalToken__factory.ts +7 -7
  253. package/typechain-types/factories/PendleQiTokenHelper__factory.ts +1 -1
  254. package/typechain-types/factories/PendleQiTokenSY__factory.ts +1095 -0
  255. package/typechain-types/factories/PendleRouter__factory.ts +1 -1
  256. package/typechain-types/factories/PendleVotingControllerUpg__factory.ts +1 -1
  257. package/typechain-types/factories/PendleWstEthSY__factory.ts +924 -0
  258. package/typechain-types/factories/PendleYieldContractFactory__factory.ts +3 -3
  259. package/typechain-types/factories/PendleYieldToken__factory.ts +27 -27
  260. package/typechain-types/factories/RouterStatic__factory.ts +57 -57
  261. package/typechain-types/factories/SYBaseWithRewards__factory.ts +867 -0
  262. package/typechain-types/factories/SYBase__factory.ts +795 -0
  263. package/typechain-types/factories/VotingEscrowPendleMainchain__factory.ts +1 -1
  264. package/typechain-types/factories/VotingEscrowPendleSidechain__factory.ts +1 -1
  265. package/typechain-types/hardhat.d.ts +33 -51
  266. package/typechain-types/index.ts +14 -18
  267. package/build/artifacts/contracts/core/SuperComposableYield/PYIndex.sol/PYIndexLib.dbg.json +0 -4
  268. package/build/artifacts/contracts/core/SuperComposableYield/SCYBase.sol/SCYBase.dbg.json +0 -4
  269. package/build/artifacts/contracts/core/SuperComposableYield/SCYBaseWithRewards.sol/SCYBaseWithRewards.dbg.json +0 -4
  270. package/build/artifacts/contracts/core/SuperComposableYield/SCYUtils.sol/SCYUtils.dbg.json +0 -4
  271. package/build/artifacts/contracts/core/SuperComposableYield/implementations/BenQi/PendleQiTokenHelper.sol/PendleQiTokenHelper.dbg.json +0 -4
  272. package/build/artifacts/contracts/core/SuperComposableYield/implementations/BenQi/PendleQiTokenSCY.sol/PendleQiTokenSCY.dbg.json +0 -4
  273. package/build/artifacts/contracts/core/SuperComposableYield/implementations/Convex/ConvexCurveLP/Pendle3CrvAndTokenSCY.sol/Pendle3CrvAndTokenSCY.dbg.json +0 -4
  274. package/build/artifacts/contracts/core/SuperComposableYield/implementations/Convex/ConvexCurveLP/Pendle3CrvAndTokenSCY.sol/Pendle3CrvAndTokenSCY.json +0 -1030
  275. package/build/artifacts/contracts/core/SuperComposableYield/implementations/Convex/ConvexCurveLP/PendleConvexCurveLP2PoolSCY.sol/PendleConvexCurveLP2PoolSCY.dbg.json +0 -4
  276. package/build/artifacts/contracts/core/SuperComposableYield/implementations/Convex/ConvexCurveLP/PendleConvexCurveLP2PoolSCY.sol/PendleConvexCurveLP2PoolSCY.json +0 -1025
  277. package/build/artifacts/contracts/core/SuperComposableYield/implementations/Convex/ConvexCurveLP/PendleConvexCurveLPSCY.sol/PendleConvexCurveLPSCY.dbg.json +0 -4
  278. package/build/artifacts/contracts/core/SuperComposableYield/implementations/Convex/Pendle3CrvHelper.sol/Pendle3CrvHelper.dbg.json +0 -4
  279. package/build/artifacts/contracts/core/SuperComposableYield/implementations/PendleWstEthSCY.sol/PendleWstEthSCY.dbg.json +0 -4
  280. package/build/artifacts/contracts/core/SuperComposableYield/implementations/PendleWstEthSCY.sol/PendleWstEthSCY.json +0 -851
  281. package/build/artifacts/contracts/interfaces/ISuperComposableYield.sol/ISuperComposableYield.dbg.json +0 -4
  282. package/build/artifacts/contracts/offchain-helpers/ImplicitSwapfeeContract.sol/ImplicitSwapfeeContract.dbg.json +0 -4
  283. package/build/artifacts/contracts/offchain-helpers/ImplicitSwapfeeContract.sol/ImplicitSwapfeeContract.json +0 -190
  284. package/contracts/core/SuperComposableYield/SCYUtils.sol +0 -34
  285. package/contracts/core/SuperComposableYield/implementations/Convex/ConvexCurveLP/Pendle3CrvAndTokenSCY.sol +0 -135
  286. package/contracts/core/SuperComposableYield/implementations/Convex/ConvexCurveLP/PendleConvexCurveLP2PoolSCY.sol +0 -96
  287. package/contracts/deployments/43113-core.json +0 -16
  288. package/contracts/deployments/43113-helper.json +0 -3
  289. package/contracts/deployments/43113-markets/benqi-market-QI-USDC-FEB-2ND.json +0 -8
  290. package/contracts/deployments/43113-markets/benqi-market-QI-WETH-DEC-1ST.json +0 -8
  291. package/contracts/deployments/43113-testenv.json +0 -22
  292. package/contracts/deployments/80001-core.json +0 -15
  293. package/contracts/deployments/80001-markets/benqi-market-QI-USDC-FEB-2ND.json +0 -8
  294. package/contracts/deployments/80001-markets/benqi-market-QI-WETH-DEC-1ST.json +0 -8
  295. package/contracts/deployments/80001-testenv.json +0 -22
  296. package/contracts/offchain-helpers/ImplicitSwapfeeContract.sol +0 -26
@@ -3,7 +3,7 @@ pragma solidity 0.8.17;
3
3
  import "../../interfaces/IPYieldToken.sol";
4
4
  import "../../interfaces/IPPrincipalToken.sol";
5
5
 
6
- import "./SCYUtils.sol";
6
+ import "./SYUtils.sol";
7
7
  import "../libraries/math/Math.sol";
8
8
 
9
9
  type PYIndex is uint256;
@@ -16,64 +16,64 @@ library PYIndexLib {
16
16
  return PYIndex.wrap(YT.pyIndexCurrent());
17
17
  }
18
18
 
19
- function scyToAsset(PYIndex index, uint256 scyAmount)
19
+ function syToAsset(PYIndex index, uint256 syAmount)
20
20
  internal
21
21
  pure
22
22
  returns (uint256)
23
23
  {
24
- return SCYUtils.scyToAsset(PYIndex.unwrap(index), scyAmount);
24
+ return SYUtils.syToAsset(PYIndex.unwrap(index), syAmount);
25
25
  }
26
26
 
27
- function assetToScy(PYIndex index, uint256 assetAmount)
27
+ function assetToSy(PYIndex index, uint256 assetAmount)
28
28
  internal
29
29
  pure
30
30
  returns (uint256)
31
31
  {
32
- return SCYUtils.assetToScy(PYIndex.unwrap(index), assetAmount);
32
+ return SYUtils.assetToSy(PYIndex.unwrap(index), assetAmount);
33
33
  }
34
34
 
35
- function assetToScyUp(PYIndex index, uint256 assetAmount)
35
+ function assetToSyUp(PYIndex index, uint256 assetAmount)
36
36
  internal
37
37
  pure
38
38
  returns (uint256)
39
39
  {
40
- return SCYUtils.assetToScyUp(PYIndex.unwrap(index), assetAmount);
40
+ return SYUtils.assetToSyUp(PYIndex.unwrap(index), assetAmount);
41
41
  }
42
42
 
43
- function scyToAssetUp(PYIndex index, uint256 scyAmount)
43
+ function syToAssetUp(PYIndex index, uint256 syAmount)
44
44
  internal
45
45
  pure
46
46
  returns (uint256)
47
47
  {
48
48
  uint256 _index = PYIndex.unwrap(index);
49
- return SCYUtils.scyToAssetUp(_index, scyAmount);
49
+ return SYUtils.syToAssetUp(_index, syAmount);
50
50
  }
51
51
 
52
- function scyToAsset(PYIndex index, int256 scyAmount)
52
+ function syToAsset(PYIndex index, int256 syAmount)
53
53
  internal
54
54
  pure
55
55
  returns (int256)
56
56
  {
57
- int256 sign = scyAmount < 0 ? int256(-1) : int256(1);
58
- return sign * (SCYUtils.scyToAsset(PYIndex.unwrap(index), scyAmount.abs())).Int();
57
+ int256 sign = syAmount < 0 ? int256(-1) : int256(1);
58
+ return sign * (SYUtils.syToAsset(PYIndex.unwrap(index), syAmount.abs())).Int();
59
59
  }
60
60
 
61
- function assetToScy(PYIndex index, int256 assetAmount)
61
+ function assetToSy(PYIndex index, int256 assetAmount)
62
62
  internal
63
63
  pure
64
64
  returns (int256)
65
65
  {
66
66
  int256 sign = assetAmount < 0 ? int256(-1) : int256(1);
67
- return sign * (SCYUtils.assetToScy(PYIndex.unwrap(index), assetAmount.abs())).Int();
67
+ return sign * (SYUtils.assetToSy(PYIndex.unwrap(index), assetAmount.abs())).Int();
68
68
  }
69
69
 
70
- function assetToScyUp(PYIndex index, int256 assetAmount)
70
+ function assetToSyUp(PYIndex index, int256 assetAmount)
71
71
  internal
72
72
  pure
73
73
  returns (int256)
74
74
  {
75
75
  int256 sign = assetAmount < 0 ? int256(-1) : int256(1);
76
- return sign * (SCYUtils.assetToScyUp(PYIndex.unwrap(index), assetAmount.abs())).Int();
76
+ return sign * (SYUtils.assetToSyUp(PYIndex.unwrap(index), assetAmount.abs())).Int();
77
77
  }
78
78
 
79
79
  }
@@ -1,19 +1,14 @@
1
1
  // SPDX-License-Identifier: GPL-3.0-or-later
2
2
  pragma solidity 0.8.17;
3
- import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
4
- import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
5
-
6
- import "../../interfaces/ISuperComposableYield.sol";
3
+ import "../../interfaces/IStandardizedYield.sol";
7
4
 
8
5
  import "../erc20/PendleERC20Permit.sol";
9
6
 
10
- import "../RewardManager/RewardManager.sol";
11
7
  import "../libraries/math/Math.sol";
12
8
  import "../libraries/TokenHelper.sol";
13
9
  import "../libraries/Errors.sol";
14
- import "./SCYUtils.sol";
15
10
 
16
- abstract contract SCYBase is ISuperComposableYield, PendleERC20Permit, TokenHelper {
11
+ abstract contract SYBase is IStandardizedYield, PendleERC20Permit, TokenHelper {
17
12
  using Math for uint256;
18
13
 
19
14
  address public immutable yieldToken;
@@ -34,7 +29,7 @@ abstract contract SCYBase is ISuperComposableYield, PendleERC20Permit, TokenHelp
34
29
  //////////////////////////////////////////////////////////////*/
35
30
 
36
31
  /**
37
- * @dev See {ISuperComposableYield-deposit}
32
+ * @dev See {IStandardizedYield-deposit}
38
33
  */
39
34
  function deposit(
40
35
  address receiver,
@@ -42,21 +37,21 @@ abstract contract SCYBase is ISuperComposableYield, PendleERC20Permit, TokenHelp
42
37
  uint256 amountTokenToDeposit,
43
38
  uint256 minSharesOut
44
39
  ) external payable nonReentrant returns (uint256 amountSharesOut) {
45
- if (!isValidTokenIn(tokenIn)) revert Errors.SCYInvalidTokenIn(tokenIn);
46
- if (amountTokenToDeposit == 0) revert Errors.SCYZeroDeposit();
40
+ if (!isValidTokenIn(tokenIn)) revert Errors.SYInvalidTokenIn(tokenIn);
41
+ if (amountTokenToDeposit == 0) revert Errors.SYZeroDeposit();
47
42
 
48
43
  _transferIn(tokenIn, msg.sender, amountTokenToDeposit);
49
44
 
50
45
  amountSharesOut = _deposit(tokenIn, amountTokenToDeposit);
51
46
  if (amountSharesOut < minSharesOut)
52
- revert Errors.SCYInsufficientSharesOut(amountSharesOut, minSharesOut);
47
+ revert Errors.SYInsufficientSharesOut(amountSharesOut, minSharesOut);
53
48
 
54
49
  _mint(receiver, amountSharesOut);
55
50
  emit Deposit(msg.sender, receiver, tokenIn, amountTokenToDeposit, amountSharesOut);
56
51
  }
57
52
 
58
53
  /**
59
- * @dev See {ISuperComposableYield-redeem}
54
+ * @dev See {IStandardizedYield-redeem}
60
55
  */
61
56
  function redeem(
62
57
  address receiver,
@@ -65,8 +60,8 @@ abstract contract SCYBase is ISuperComposableYield, PendleERC20Permit, TokenHelp
65
60
  uint256 minTokenOut,
66
61
  bool burnFromInternalBalance
67
62
  ) external nonReentrant returns (uint256 amountTokenOut) {
68
- if (!isValidTokenOut(tokenOut)) revert Errors.SCYInvalidTokenOut(tokenOut);
69
- if (amountSharesToRedeem == 0) revert Errors.SCYZeroRedeem();
63
+ if (!isValidTokenOut(tokenOut)) revert Errors.SYInvalidTokenOut(tokenOut);
64
+ if (amountSharesToRedeem == 0) revert Errors.SYZeroRedeem();
70
65
 
71
66
  if (burnFromInternalBalance) {
72
67
  _burn(address(this), amountSharesToRedeem);
@@ -76,7 +71,7 @@ abstract contract SCYBase is ISuperComposableYield, PendleERC20Permit, TokenHelp
76
71
 
77
72
  amountTokenOut = _redeem(receiver, tokenOut, amountSharesToRedeem);
78
73
  if (amountTokenOut < minTokenOut)
79
- revert Errors.SCYInsufficientTokenOut(amountTokenOut, minTokenOut);
74
+ revert Errors.SYInsufficientTokenOut(amountTokenOut, minTokenOut);
80
75
  emit Redeem(msg.sender, receiver, tokenOut, amountSharesToRedeem, amountTokenOut);
81
76
  }
82
77
 
@@ -108,7 +103,7 @@ abstract contract SCYBase is ISuperComposableYield, PendleERC20Permit, TokenHelp
108
103
  //////////////////////////////////////////////////////////////*/
109
104
 
110
105
  /**
111
- * @dev See {ISuperComposableYield-exchangeRate}
106
+ * @dev See {IStandardizedYield-exchangeRate}
112
107
  */
113
108
  function exchangeRate() external view virtual override returns (uint256 res);
114
109
 
@@ -117,7 +112,7 @@ abstract contract SCYBase is ISuperComposableYield, PendleERC20Permit, TokenHelp
117
112
  //////////////////////////////////////////////////////////////*/
118
113
 
119
114
  /**
120
- * @dev See {ISuperComposableYield-claimRewards}
115
+ * @dev See {IStandardizedYield-claimRewards}
121
116
  */
122
117
  function claimRewards(
123
118
  address /*user*/
@@ -126,7 +121,7 @@ abstract contract SCYBase is ISuperComposableYield, PendleERC20Permit, TokenHelp
126
121
  }
127
122
 
128
123
  /**
129
- * @dev See {ISuperComposableYield-getRewardTokens}
124
+ * @dev See {IStandardizedYield-getRewardTokens}
130
125
  */
131
126
  function getRewardTokens()
132
127
  external
@@ -139,7 +134,7 @@ abstract contract SCYBase is ISuperComposableYield, PendleERC20Permit, TokenHelp
139
134
  }
140
135
 
141
136
  /**
142
- * @dev See {ISuperComposableYield-accruedRewards}
137
+ * @dev See {IStandardizedYield-accruedRewards}
143
138
  */
144
139
  function accruedRewards(
145
140
  address /*user*/
@@ -171,7 +166,7 @@ abstract contract SCYBase is ISuperComposableYield, PendleERC20Permit, TokenHelp
171
166
  virtual
172
167
  returns (uint256 amountSharesOut)
173
168
  {
174
- if (!isValidTokenIn(tokenIn)) revert Errors.SCYInvalidTokenIn(tokenIn);
169
+ if (!isValidTokenIn(tokenIn)) revert Errors.SYInvalidTokenIn(tokenIn);
175
170
  return _previewDeposit(tokenIn, amountTokenToDeposit);
176
171
  }
177
172
 
@@ -181,7 +176,7 @@ abstract contract SCYBase is ISuperComposableYield, PendleERC20Permit, TokenHelp
181
176
  virtual
182
177
  returns (uint256 amountTokenOut)
183
178
  {
184
- if (!isValidTokenOut(tokenOut)) revert Errors.SCYInvalidTokenOut(tokenOut);
179
+ if (!isValidTokenOut(tokenOut)) revert Errors.SYInvalidTokenOut(tokenOut);
185
180
  return _previewRedeem(tokenOut, amountSharesToRedeem);
186
181
  }
187
182
 
@@ -1,14 +1,11 @@
1
1
  // SPDX-License-Identifier: GPL-3.0-or-later
2
2
  pragma solidity 0.8.17;
3
- import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
4
3
 
5
- import "../../interfaces/ISuperComposableYield.sol";
6
-
7
- import "../libraries/math/Math.sol";
8
- import "./SCYBase.sol";
4
+ import "../RewardManager/RewardManager.sol";
5
+ import "./SYBase.sol";
9
6
 
10
7
  /// NOTE: yieldToken MUST NEVER BE a rewardToken, else the rewardManager will behave erroneously
11
- abstract contract SCYBaseWithRewards is SCYBase, RewardManager {
8
+ abstract contract SYBaseWithRewards is SYBase, RewardManager {
12
9
  using Math for uint256;
13
10
  using ArrayLib for address[];
14
11
 
@@ -17,7 +14,7 @@ abstract contract SCYBaseWithRewards is SCYBase, RewardManager {
17
14
  string memory _symbol,
18
15
  address _yieldToken
19
16
  )
20
- SCYBase(_name, _symbol, _yieldToken) // solhint-disable-next-line no-empty-blocks
17
+ SYBase(_name, _symbol, _yieldToken) // solhint-disable-next-line no-empty-blocks
21
18
  {}
22
19
 
23
20
  /*///////////////////////////////////////////////////////////////
@@ -25,7 +22,7 @@ abstract contract SCYBaseWithRewards is SCYBase, RewardManager {
25
22
  //////////////////////////////////////////////////////////////*/
26
23
 
27
24
  /**
28
- * @dev See {ISuperComposableYield-claimRewards}
25
+ * @dev See {IStandardizedYield-claimRewards}
29
26
  */
30
27
  function claimRewards(address user)
31
28
  external
@@ -41,7 +38,7 @@ abstract contract SCYBaseWithRewards is SCYBase, RewardManager {
41
38
  }
42
39
 
43
40
  /**
44
- * @dev See {ISuperComposableYield-getRewardTokens}
41
+ * @dev See {IStandardizedYield-getRewardTokens}
45
42
  */
46
43
  function getRewardTokens()
47
44
  external
@@ -54,7 +51,7 @@ abstract contract SCYBaseWithRewards is SCYBase, RewardManager {
54
51
  }
55
52
 
56
53
  /**
57
- * @dev See {ISuperComposableYield-accruedRewards}
54
+ * @dev See {IStandardizedYield-accruedRewards}
58
55
  */
59
56
  function accruedRewards(address user)
60
57
  external
@@ -102,7 +99,7 @@ abstract contract SCYBaseWithRewards is SCYBase, RewardManager {
102
99
 
103
100
  /**
104
101
  * @notice returns the total number of reward shares
105
- * @dev this is simply the total supply of shares, as rewards shares are equivalent to SCY shares
102
+ * @dev this is simply the total supply of shares, as rewards shares are equivalent to SY shares
106
103
  */
107
104
  function _rewardSharesTotal() internal view virtual override returns (uint256) {
108
105
  return totalSupply();
@@ -110,7 +107,7 @@ abstract contract SCYBaseWithRewards is SCYBase, RewardManager {
110
107
 
111
108
  /**
112
109
  * @notice returns the reward shares of (`user`)
113
- * @dev this is simply the SCY balance of (`user`), as rewards shares are equivalent to SCY shares
110
+ * @dev this is simply the SY balance of (`user`), as rewards shares are equivalent to SY shares
114
111
  */
115
112
  function _rewardSharesUser(address user) internal view virtual override returns (uint256) {
116
113
  return balanceOf(user);
@@ -0,0 +1,26 @@
1
+ // SPDX-License-Identifier: GPL-3.0-or-later
2
+ pragma solidity 0.8.17;
3
+
4
+ library SYUtils {
5
+ uint256 internal constant ONE = 1e18;
6
+
7
+ function syToAsset(uint256 exchangeRate, uint256 syAmount) internal pure returns (uint256) {
8
+ return (syAmount * exchangeRate) / ONE;
9
+ }
10
+
11
+ function syToAssetUp(uint256 exchangeRate, uint256 syAmount) internal pure returns (uint256) {
12
+ return (syAmount * exchangeRate + ONE - 1) / ONE;
13
+ }
14
+
15
+ function assetToSy(uint256 exchangeRate, uint256 assetAmount) internal pure returns (uint256) {
16
+ return (assetAmount * ONE) / exchangeRate;
17
+ }
18
+
19
+ function assetToSyUp(uint256 exchangeRate, uint256 assetAmount)
20
+ internal
21
+ pure
22
+ returns (uint256)
23
+ {
24
+ return (assetAmount * ONE + exchangeRate - 1) / exchangeRate;
25
+ }
26
+ }
@@ -35,7 +35,7 @@ contract PendleQiTokenHelper {
35
35
  );
36
36
 
37
37
  if (borrowRateMantissa > borrowRateMaxMantissa)
38
- revert Errors.SCYQiTokenBorrowRateTooHigh(borrowRateMantissa, borrowRateMaxMantissa);
38
+ revert Errors.SYQiTokenBorrowRateTooHigh(borrowRateMantissa, borrowRateMaxMantissa);
39
39
 
40
40
  uint256 timestampDelta = currentBlockTimestamp - accrualBlockTimestampPrior;
41
41
 
@@ -1,7 +1,7 @@
1
1
  // SPDX-License-Identifier: GPL-3.0-or-later
2
2
  pragma solidity 0.8.17;
3
3
 
4
- import "../../SCYBaseWithRewards.sol";
4
+ import "../../SYBaseWithRewards.sol";
5
5
  import "../../../../interfaces/IQiErc20.sol";
6
6
  import "../../../../interfaces/IQiAvax.sol";
7
7
  import "../../../../interfaces/IBenQiComptroller.sol";
@@ -9,7 +9,7 @@ import "../../../../interfaces/IWETH.sol";
9
9
 
10
10
  import "./PendleQiTokenHelper.sol";
11
11
 
12
- contract PendleQiTokenSCY is SCYBaseWithRewards, PendleQiTokenHelper {
12
+ contract PendleQiTokenSY is SYBaseWithRewards, PendleQiTokenHelper {
13
13
  address public immutable underlying;
14
14
  address public immutable QI;
15
15
  address public immutable WAVAX;
@@ -24,7 +24,7 @@ contract PendleQiTokenSCY is SCYBaseWithRewards, PendleQiTokenHelper {
24
24
  address _WAVAX,
25
25
  uint256 _initialExchangeRateMantissa
26
26
  )
27
- SCYBaseWithRewards(_name, _symbol, _qiToken)
27
+ SYBaseWithRewards(_name, _symbol, _qiToken)
28
28
  PendleQiTokenHelper(_qiToken, _initialExchangeRateMantissa)
29
29
  {
30
30
  qiToken = _qiToken;
@@ -45,7 +45,7 @@ contract PendleQiTokenSCY is SCYBaseWithRewards, PendleQiTokenHelper {
45
45
  //////////////////////////////////////////////////////////////*/
46
46
 
47
47
  /**
48
- * @dev See {SCYBase-_deposit}
48
+ * @dev See {SYBase-_deposit}
49
49
  *
50
50
  * The underlying yield token is qiToken. If the base token deposited is underlying asset, the function
51
51
  * first convert those deposited into qiToken. Then the corresponding amount of shares is returned.
@@ -67,7 +67,7 @@ contract PendleQiTokenSCY is SCYBaseWithRewards, PendleQiTokenHelper {
67
67
  IQiAvax(qiToken).mint{ value: amount }();
68
68
  } else {
69
69
  uint256 errCode = IQiErc20(qiToken).mint(amount);
70
- if (errCode != 0) revert Errors.SCYQiTokenMintFailed(errCode);
70
+ if (errCode != 0) revert Errors.SYQiTokenMintFailed(errCode);
71
71
  }
72
72
 
73
73
  amountSharesOut = _selfBalance(qiToken) - preBalanceQiToken;
@@ -75,7 +75,7 @@ contract PendleQiTokenSCY is SCYBaseWithRewards, PendleQiTokenHelper {
75
75
  }
76
76
 
77
77
  /**
78
- * @dev See {SCYBase-_redeem}
78
+ * @dev See {SYBase-_redeem}
79
79
  *
80
80
  * The shares are redeemed into the same amount of qiTokens. If `tokenOut` is the underlying asset,
81
81
  * the function also redeems said asset from the corresponding amount of qiToken.
@@ -92,10 +92,10 @@ contract PendleQiTokenSCY is SCYBaseWithRewards, PendleQiTokenHelper {
92
92
 
93
93
  if (underlying == NATIVE) {
94
94
  uint256 errCode = IQiAvax(qiToken).redeem(amountSharesToRedeem);
95
- if (errCode != 0) revert Errors.SCYQiTokenRedeemFailed(errCode);
95
+ if (errCode != 0) revert Errors.SYQiTokenRedeemFailed(errCode);
96
96
  } else {
97
97
  uint256 errCode = IQiErc20(qiToken).redeem(amountSharesToRedeem);
98
- if (errCode != 0) revert Errors.SCYQiTokenRedeemFailed(errCode);
98
+ if (errCode != 0) revert Errors.SYQiTokenRedeemFailed(errCode);
99
99
  }
100
100
 
101
101
  // underlying is potentially also rewardToken, hence we need to manually track the balance here
@@ -121,7 +121,7 @@ contract PendleQiTokenSCY is SCYBaseWithRewards, PendleQiTokenHelper {
121
121
  //////////////////////////////////////////////////////////////*/
122
122
 
123
123
  /**
124
- * @dev See {ISuperComposableYield-getRewardTokens}
124
+ * @dev See {IStandardizedYield-getRewardTokens}
125
125
  */
126
126
  function _getRewardTokens() internal view override returns (address[] memory res) {
127
127
  res = new address[](2);
@@ -148,7 +148,7 @@ contract PendleQiTokenSCY is SCYBaseWithRewards, PendleQiTokenHelper {
148
148
  );
149
149
 
150
150
  if (rewardAccruedType0 > 0 || rewardAccruedType1 > 0)
151
- revert Errors.SCYQiTokenRedeemRewardsFailed(rewardAccruedType0, rewardAccruedType1);
151
+ revert Errors.SYQiTokenRedeemRewardsFailed(rewardAccruedType0, rewardAccruedType1);
152
152
 
153
153
  if (address(this).balance != 0) IWETH(WAVAX).deposit{ value: address(this).balance }();
154
154
  }
@@ -0,0 +1,167 @@
1
+ // SPDX-License-Identifier: GPL-3.0-or-later
2
+ pragma solidity 0.8.17;
3
+
4
+ import "./PendleConvexLPSY.sol";
5
+ import "../Pendle3CrvHelper.sol";
6
+ import "../../../../libraries/ArrayLib.sol";
7
+
8
+ contract Pendle3CrvAndTokenSY is PendleConvexLPSY {
9
+ using ArrayLib for address[];
10
+
11
+ uint256 public immutable indexOf3Crv;
12
+ uint256 public immutable indexOfOther;
13
+ address public immutable otherToken;
14
+
15
+ constructor(
16
+ string memory _name,
17
+ string memory _symbol,
18
+ uint256 _cvxPid,
19
+ address _crvLp,
20
+ address _crvPool
21
+ ) PendleConvexLPSY(_name, _symbol, _cvxPid, _crvLp, _crvPool) {
22
+ indexOf3Crv = ICrvPool(_crvPool).coins(0) == Pendle3CrvHelper.LP ? 0 : 1;
23
+ indexOfOther = 1 - indexOf3Crv;
24
+ otherToken = ICrvPool(_crvPool).coins(indexOfOther);
25
+
26
+ _safeApproveInf(Pendle3CrvHelper.LP, crvPool);
27
+ _safeApproveInf(otherToken, crvPool);
28
+
29
+ _safeApproveInf(Pendle3CrvHelper.DAI, Pendle3CrvHelper.POOL);
30
+ _safeApproveInf(Pendle3CrvHelper.USDC, Pendle3CrvHelper.POOL);
31
+ _safeApproveInf(Pendle3CrvHelper.USDT, Pendle3CrvHelper.POOL);
32
+ }
33
+
34
+ function _depositToCurve(address tokenIn, uint256 amountTokenToDeposit)
35
+ internal
36
+ virtual
37
+ override
38
+ returns (uint256 amountLpOut)
39
+ {
40
+ uint256 preBalanceLp = _selfBalance(crvLp);
41
+
42
+ uint256[2] memory amounts;
43
+
44
+ if (Pendle3CrvHelper.is3CrvToken(tokenIn)) {
45
+ uint256 amount3CrvLp = Pendle3CrvHelper.deposit3Crv(tokenIn, amountTokenToDeposit);
46
+ amounts[indexOf3Crv] = amount3CrvLp;
47
+ } else {
48
+ // one of the 2 LP
49
+ amounts[_getIndex(tokenIn)] = amountTokenToDeposit;
50
+ }
51
+
52
+ ICrvPool(crvPool).add_liquidity(amounts, 0);
53
+
54
+ amountLpOut = _selfBalance(crvLp) - preBalanceLp;
55
+ }
56
+
57
+ function _redeemFromCurve(address tokenOut, uint256 amountLpToRedeem)
58
+ internal
59
+ virtual
60
+ override
61
+ returns (uint256 amountTokenOut)
62
+ {
63
+ address tokenToRemove = (tokenOut == otherToken) ? otherToken : Pendle3CrvHelper.LP;
64
+
65
+ uint256 preBalanceToken = _selfBalance(tokenToRemove);
66
+
67
+ ICrvPool(crvPool).remove_liquidity_one_coin(
68
+ amountLpToRedeem,
69
+ Math.Int128(_getIndex(tokenToRemove)),
70
+ 0
71
+ );
72
+
73
+ uint256 amountTokenRemoved = _selfBalance(tokenToRemove) - preBalanceToken;
74
+
75
+ if (Pendle3CrvHelper.is3CrvToken(tokenOut)) {
76
+ amountTokenOut = Pendle3CrvHelper.redeem3Crv(tokenOut, amountTokenRemoved);
77
+ } else {
78
+ // one of the 2 LP
79
+ amountTokenOut = amountTokenRemoved;
80
+ }
81
+ }
82
+
83
+ function _previewDepositToCurve(address tokenIn, uint256 amountTokenToDeposit)
84
+ internal
85
+ view
86
+ virtual
87
+ override
88
+ returns (uint256)
89
+ {
90
+ uint256[2] memory amounts;
91
+
92
+ if (Pendle3CrvHelper.is3CrvToken(tokenIn)) {
93
+ uint256 amount3CrvLp = Pendle3CrvHelper.preview3CrvDeposit(
94
+ tokenIn,
95
+ amountTokenToDeposit
96
+ );
97
+ amounts[indexOf3Crv] = amount3CrvLp;
98
+ } else {
99
+ // one of the 2 LP
100
+ amounts[_getIndex(tokenIn)] = amountTokenToDeposit;
101
+ }
102
+
103
+ return ICrvPool(crvPool).calc_token_amount(amounts, true);
104
+ }
105
+
106
+ function _previewRedeemFromCurve(address tokenOut, uint256 amountLpToRedeem)
107
+ internal
108
+ view
109
+ virtual
110
+ override
111
+ returns (uint256)
112
+ {
113
+ uint256 amountTokenRemoved = ICrvPool(crvPool).calc_withdraw_one_coin(
114
+ amountLpToRedeem,
115
+ Math.Int128(_getIndex(tokenOut))
116
+ );
117
+
118
+ if (Pendle3CrvHelper.is3CrvToken(tokenOut)) {
119
+ return Pendle3CrvHelper.preview3CrvRedeem(tokenOut, amountTokenRemoved);
120
+ } else {
121
+ // one of the 2 LP
122
+ return amountTokenRemoved;
123
+ }
124
+ }
125
+
126
+ function _getIndex(address token) internal view returns (uint256) {
127
+ if (token == Pendle3CrvHelper.LP || Pendle3CrvHelper.is3CrvToken(token)) {
128
+ return indexOf3Crv;
129
+ } else {
130
+ return indexOfOther;
131
+ }
132
+ }
133
+
134
+ function getTokensIn() public view virtual override returns (address[] memory res) {
135
+ res = new address[](6);
136
+ res[0] = crvLp;
137
+ res[1] = otherToken;
138
+ res[2] = Pendle3CrvHelper.LP;
139
+ res[3] = Pendle3CrvHelper.DAI;
140
+ res[4] = Pendle3CrvHelper.USDC;
141
+ res[5] = Pendle3CrvHelper.USDT;
142
+ }
143
+
144
+ function getTokensOut() public view virtual override returns (address[] memory res) {
145
+ res = new address[](6);
146
+ res[0] = crvLp;
147
+ res[1] = otherToken;
148
+ res[2] = Pendle3CrvHelper.LP;
149
+ res[3] = Pendle3CrvHelper.DAI;
150
+ res[4] = Pendle3CrvHelper.USDC;
151
+ res[5] = Pendle3CrvHelper.USDT;
152
+ }
153
+
154
+ function isValidTokenIn(address token) public view virtual override returns (bool res) {
155
+ res = (token == crvLp ||
156
+ token == otherToken ||
157
+ token == Pendle3CrvHelper.LP ||
158
+ Pendle3CrvHelper.is3CrvToken(token));
159
+ }
160
+
161
+ function isValidTokenOut(address token) public view override returns (bool res) {
162
+ res = (token == crvLp ||
163
+ token == otherToken ||
164
+ token == Pendle3CrvHelper.LP ||
165
+ Pendle3CrvHelper.is3CrvToken(token));
166
+ }
167
+ }