@pendle/core-v2 0.13.1-testnet → 0.14.0-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 (299) 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 +26 -26
  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/StandardizedYield/PYIndex.sol/PYIndexLib.dbg.json +4 -0
  43. package/build/artifacts/contracts/core/{SuperComposableYield → StandardizedYield}/PYIndex.sol/PYIndexLib.json +3 -3
  44. package/build/artifacts/contracts/core/StandardizedYield/SYBase.sol/SYBase.dbg.json +4 -0
  45. package/build/artifacts/contracts/core/{SuperComposableYield/SCYBase.sol/SCYBase.json → StandardizedYield/SYBase.sol/SYBase.json} +11 -11
  46. package/build/artifacts/contracts/core/StandardizedYield/SYBaseWithRewards.sol/SYBaseWithRewards.dbg.json +4 -0
  47. package/build/artifacts/contracts/core/{SuperComposableYield/SCYBaseWithRewards.sol/SCYBaseWithRewards.json → StandardizedYield/SYBaseWithRewards.sol/SYBaseWithRewards.json} +11 -11
  48. package/build/artifacts/contracts/core/StandardizedYield/SYUtils.sol/SYUtils.dbg.json +4 -0
  49. package/build/artifacts/contracts/core/{SuperComposableYield/SCYUtils.sol/SCYUtils.json → StandardizedYield/SYUtils.sol/SYUtils.json} +4 -4
  50. package/build/artifacts/contracts/core/StandardizedYield/implementations/BenQi/PendleQiTokenHelper.sol/PendleQiTokenHelper.dbg.json +4 -0
  51. package/build/artifacts/contracts/core/{SuperComposableYield → StandardizedYield}/implementations/BenQi/PendleQiTokenHelper.sol/PendleQiTokenHelper.json +3 -3
  52. package/build/artifacts/contracts/core/StandardizedYield/implementations/BenQi/PendleQiTokenSY.sol/PendleQiTokenSY.dbg.json +4 -0
  53. package/build/artifacts/contracts/core/{SuperComposableYield/implementations/BenQi/PendleQiTokenSCY.sol/PendleQiTokenSCY.json → StandardizedYield/implementations/BenQi/PendleQiTokenSY.sol/PendleQiTokenSY.json} +17 -17
  54. package/build/artifacts/contracts/core/StandardizedYield/implementations/Convex/ConvexCurveLP/Pendle3CrvAndTokenSY.sol/Pendle3CrvAndTokenSY.dbg.json +4 -0
  55. package/build/artifacts/contracts/core/StandardizedYield/implementations/Convex/ConvexCurveLP/Pendle3CrvAndTokenSY.sol/Pendle3CrvAndTokenSY.json +1028 -0
  56. package/build/artifacts/contracts/core/StandardizedYield/implementations/Convex/ConvexCurveLP/PendleConvexLPSY.sol/PendleConvexLPSY.dbg.json +4 -0
  57. package/build/artifacts/contracts/core/{SuperComposableYield/implementations/Convex/ConvexCurveLP/PendleConvexCurveLPSCY.sol/PendleConvexCurveLPSCY.json → StandardizedYield/implementations/Convex/ConvexCurveLP/PendleConvexLPSY.sol/PendleConvexLPSY.json} +47 -47
  58. package/build/artifacts/contracts/core/StandardizedYield/implementations/Convex/Pendle3CrvHelper.sol/Pendle3CrvHelper.dbg.json +4 -0
  59. package/build/artifacts/contracts/core/{SuperComposableYield → StandardizedYield}/implementations/Convex/Pendle3CrvHelper.sol/Pendle3CrvHelper.json +5 -5
  60. package/build/artifacts/contracts/core/StandardizedYield/implementations/PendleWstEthSY.sol/PendleWstEthSY.dbg.json +4 -0
  61. package/build/artifacts/contracts/core/{SuperComposableYield/implementations/PendleWstEthSCY.sol/PendleWstEthSCY.json → StandardizedYield/implementations/PendleWstEthSY.sol/PendleWstEthSY.json} +13 -13
  62. package/build/artifacts/contracts/core/YieldContracts/InterestManagerYT.sol/InterestManagerYT.dbg.json +1 -1
  63. package/build/artifacts/contracts/core/YieldContracts/PendlePrincipalToken.sol/PendlePrincipalToken.dbg.json +1 -1
  64. package/build/artifacts/contracts/core/YieldContracts/PendlePrincipalToken.sol/PendlePrincipalToken.json +4 -4
  65. package/build/artifacts/contracts/core/YieldContracts/PendleYieldContractFactory.sol/PendleYieldContractFactory.dbg.json +1 -1
  66. package/build/artifacts/contracts/core/YieldContracts/PendleYieldContractFactory.sol/PendleYieldContractFactory.json +4 -4
  67. package/build/artifacts/contracts/core/YieldContracts/PendleYieldToken.sol/PendleYieldToken.dbg.json +1 -1
  68. package/build/artifacts/contracts/core/YieldContracts/PendleYieldToken.sol/PendleYieldToken.json +24 -24
  69. package/build/artifacts/contracts/core/libraries/Errors.sol/Errors.dbg.json +1 -1
  70. package/build/artifacts/contracts/core/libraries/Errors.sol/Errors.json +28 -28
  71. package/build/artifacts/contracts/interfaces/IPActionAddRemoveLiq.sol/IPActionAddRemoveLiq.dbg.json +1 -1
  72. package/build/artifacts/contracts/interfaces/IPActionAddRemoveLiq.sol/IPActionAddRemoveLiq.json +30 -30
  73. package/build/artifacts/contracts/interfaces/IPActionMintRedeem.sol/IPActionMintRedeem.dbg.json +1 -1
  74. package/build/artifacts/contracts/interfaces/IPActionMintRedeem.sol/IPActionMintRedeem.json +34 -34
  75. package/build/artifacts/contracts/interfaces/IPActionSwapPT.sol/IPActionSwapPT.dbg.json +1 -1
  76. package/build/artifacts/contracts/interfaces/IPActionSwapPT.sol/IPActionSwapPT.json +20 -20
  77. package/build/artifacts/contracts/interfaces/IPActionSwapPTYT.sol/IPActionSwapPTYT.dbg.json +1 -1
  78. package/build/artifacts/contracts/interfaces/IPActionSwapPTYT.sol/IPActionSwapPTYT.json +2 -2
  79. package/build/artifacts/contracts/interfaces/IPActionSwapYT.sol/IPActionSwapYT.dbg.json +1 -1
  80. package/build/artifacts/contracts/interfaces/IPActionSwapYT.sol/IPActionSwapYT.json +20 -20
  81. package/build/artifacts/contracts/interfaces/IPAllAction.sol/IPAllAction.dbg.json +1 -1
  82. package/build/artifacts/contracts/interfaces/IPAllAction.sol/IPAllAction.json +106 -106
  83. package/build/artifacts/contracts/interfaces/IPMarket.sol/IPMarket.dbg.json +1 -1
  84. package/build/artifacts/contracts/interfaces/IPMarket.sol/IPMarket.json +18 -18
  85. package/build/artifacts/contracts/interfaces/IPMarketSwapCallback.sol/IPMarketSwapCallback.dbg.json +1 -1
  86. package/build/artifacts/contracts/interfaces/IPMarketSwapCallback.sol/IPMarketSwapCallback.json +1 -1
  87. package/build/artifacts/contracts/interfaces/IPPrincipalToken.sol/IPPrincipalToken.dbg.json +1 -1
  88. package/build/artifacts/contracts/interfaces/IPPrincipalToken.sol/IPPrincipalToken.json +1 -1
  89. package/build/artifacts/contracts/interfaces/IPVotingController.sol/IPVotingController.dbg.json +1 -1
  90. package/build/artifacts/contracts/interfaces/IPVotingEscrowMainchain.sol/IPVotingEscrowMainchain.dbg.json +1 -1
  91. package/build/artifacts/contracts/interfaces/IPYieldContractFactory.sol/IPYieldContractFactory.dbg.json +1 -1
  92. package/build/artifacts/contracts/interfaces/IPYieldContractFactory.sol/IPYieldContractFactory.json +3 -3
  93. package/build/artifacts/contracts/interfaces/IPYieldToken.sol/IPYieldToken.dbg.json +1 -1
  94. package/build/artifacts/contracts/interfaces/IPYieldToken.sol/IPYieldToken.json +6 -6
  95. package/build/artifacts/contracts/interfaces/IStandardizedYield.sol/IStandardizedYield.dbg.json +4 -0
  96. package/build/artifacts/contracts/interfaces/{ISuperComposableYield.sol/ISuperComposableYield.json → IStandardizedYield.sol/IStandardizedYield.json} +5 -5
  97. package/build/artifacts/contracts/offchain-helpers/MarketMathStatic.sol/MarketMathStatic.dbg.json +1 -1
  98. package/build/artifacts/contracts/offchain-helpers/MarketMathStatic.sol/MarketMathStatic.json +7 -7
  99. package/build/artifacts/contracts/offchain-helpers/RouterStatic.sol/RouterStatic.dbg.json +1 -1
  100. package/build/artifacts/contracts/offchain-helpers/RouterStatic.sol/RouterStatic.json +116 -116
  101. package/build/artifacts/contracts/router/ActionAddRemoveLiq.sol/ActionAddRemoveLiq.dbg.json +1 -1
  102. package/build/artifacts/contracts/router/ActionAddRemoveLiq.sol/ActionAddRemoveLiq.json +35 -35
  103. package/build/artifacts/contracts/router/ActionCallback.sol/ActionCallback.dbg.json +1 -1
  104. package/build/artifacts/contracts/router/ActionCallback.sol/ActionCallback.json +12 -12
  105. package/build/artifacts/contracts/router/ActionMintRedeem.sol/ActionMintRedeem.dbg.json +1 -1
  106. package/build/artifacts/contracts/router/ActionMintRedeem.sol/ActionMintRedeem.json +41 -41
  107. package/build/artifacts/contracts/router/ActionMisc.sol/ActionMisc.dbg.json +1 -1
  108. package/build/artifacts/contracts/router/ActionMisc.sol/ActionMisc.json +2 -2
  109. package/build/artifacts/contracts/router/ActionSwapPT.sol/ActionSwapPT.dbg.json +1 -1
  110. package/build/artifacts/contracts/router/ActionSwapPT.sol/ActionSwapPT.json +28 -28
  111. package/build/artifacts/contracts/router/ActionSwapPTYT.sol/ActionSwapPTYT.dbg.json +1 -1
  112. package/build/artifacts/contracts/router/ActionSwapPTYT.sol/ActionSwapPTYT.json +4 -4
  113. package/build/artifacts/contracts/router/ActionSwapYT.sol/ActionSwapYT.dbg.json +1 -1
  114. package/build/artifacts/contracts/router/ActionSwapYT.sol/ActionSwapYT.json +22 -22
  115. package/build/artifacts/contracts/router/PendleRouter.sol/PendleRouter.dbg.json +1 -1
  116. package/build/artifacts/contracts/router/PendleRouter.sol/PendleRouter.json +2 -2
  117. package/build/artifacts/contracts/router/base/ActionBaseMintRedeem.sol/ActionBaseMintRedeem.dbg.json +1 -1
  118. package/build/artifacts/contracts/router/base/CallbackHelper.sol/CallbackHelper.dbg.json +1 -1
  119. package/build/artifacts/contracts/router/base/MarketApproxLib.sol/MarketApproxPtInLib.dbg.json +1 -1
  120. package/build/artifacts/contracts/router/base/MarketApproxLib.sol/MarketApproxPtInLib.json +2 -2
  121. package/build/artifacts/contracts/router/base/MarketApproxLib.sol/MarketApproxPtOutLib.dbg.json +1 -1
  122. package/build/artifacts/contracts/router/base/MarketApproxLib.sol/MarketApproxPtOutLib.json +2 -2
  123. package/build/artifacts/contracts/router/kyberswap/KyberSwapHelper.sol/KyberSwapHelper.dbg.json +1 -1
  124. package/contracts/LiquidityMining/CrossChainMsg/PendleMsgReceiveEndpointUpg.sol +96 -27
  125. package/contracts/LiquidityMining/CrossChainMsg/PendleMsgSendEndpointUpg.sol +40 -12
  126. package/contracts/LiquidityMining/CrossChainMsg/PendleMsgSenderAppUpg.sol +24 -5
  127. package/contracts/LiquidityMining/CrossChainMsg/libraries/ExcessivelySafeCall.sol +133 -0
  128. package/contracts/LiquidityMining/CrossChainMsg/libraries/LayerZeroHelper.sol +33 -0
  129. package/contracts/LiquidityMining/GaugeController/PendleGaugeControllerBaseUpg.sol +8 -1
  130. package/contracts/LiquidityMining/VotingController/PendleVotingControllerUpg.sol +3 -3
  131. package/contracts/LiquidityMining/VotingEscrow/VotingEscrowPendleMainchain.sol +2 -7
  132. package/contracts/core/Market/MarketMathCore.sol +50 -53
  133. package/contracts/core/Market/PendleGauge.sol +8 -8
  134. package/contracts/core/Market/PendleMarket.sol +49 -49
  135. package/contracts/core/Market/PendleMarketFactory.sol +1 -1
  136. package/contracts/core/RewardManager/RewardManager.sol +1 -1
  137. package/contracts/core/{SuperComposableYield → StandardizedYield}/PYIndex.sol +16 -16
  138. package/contracts/core/{SuperComposableYield/SCYBase.sol → StandardizedYield/SYBase.sol} +17 -17
  139. package/contracts/core/{SuperComposableYield/SCYBaseWithRewards.sol → StandardizedYield/SYBaseWithRewards.sol} +9 -9
  140. package/contracts/core/StandardizedYield/SYUtils.sol +26 -0
  141. package/contracts/core/{SuperComposableYield → StandardizedYield}/implementations/BenQi/PendleQiTokenHelper.sol +1 -1
  142. package/contracts/core/{SuperComposableYield/implementations/BenQi/PendleQiTokenSCY.sol → StandardizedYield/implementations/BenQi/PendleQiTokenSY.sol} +10 -10
  143. package/contracts/core/StandardizedYield/implementations/Convex/ConvexCurveLP/Pendle3CrvAndTokenSY.sol +167 -0
  144. package/contracts/core/{SuperComposableYield/implementations/Convex/ConvexCurveLP/PendleConvexCurveLPSCY.sol → StandardizedYield/implementations/Convex/ConvexCurveLP/PendleConvexLPSY.sol} +51 -70
  145. package/contracts/core/{SuperComposableYield → StandardizedYield}/implementations/Convex/Pendle3CrvHelper.sol +7 -7
  146. package/contracts/core/{SuperComposableYield/implementations/PendleWstEthSCY.sol → StandardizedYield/implementations/PendleWstEthSY.sol} +5 -5
  147. package/contracts/core/YieldContracts/InterestManagerYT.sol +7 -7
  148. package/contracts/core/YieldContracts/PendlePrincipalToken.sol +3 -3
  149. package/contracts/core/YieldContracts/PendleYieldContractFactory.sol +15 -15
  150. package/contracts/core/YieldContracts/PendleYieldToken.sol +71 -71
  151. package/contracts/core/libraries/Errors.sol +23 -21
  152. package/contracts/core/libraries/TokenHelper.sol +0 -33
  153. package/contracts/interfaces/Curve/ICrvPool.sol +2 -0
  154. package/contracts/interfaces/ILayerZeroEndpoint.sol +39 -0
  155. package/contracts/interfaces/ILayerZeroReceiver.sol +12 -0
  156. package/contracts/interfaces/IPActionAddRemoveLiq.sol +27 -27
  157. package/contracts/interfaces/IPActionMintRedeem.sol +30 -30
  158. package/contracts/interfaces/IPActionSwapPT.sol +16 -16
  159. package/contracts/interfaces/IPActionSwapPTYT.sol +2 -2
  160. package/contracts/interfaces/IPActionSwapYT.sol +16 -16
  161. package/contracts/interfaces/IPMarket.sol +14 -19
  162. package/contracts/interfaces/IPMarketSwapCallback.sol +1 -1
  163. package/contracts/interfaces/IPMsgSendEndpoint.sol +4 -2
  164. package/contracts/interfaces/IPPrincipalToken.sol +1 -1
  165. package/contracts/interfaces/IPYieldContractFactory.sol +3 -3
  166. package/contracts/interfaces/IPYieldToken.sol +7 -9
  167. package/contracts/interfaces/{ISuperComposableYield.sol → IStandardizedYield.sol} +6 -6
  168. package/contracts/offchain-helpers/MarketMathStatic.sol +116 -131
  169. package/contracts/offchain-helpers/RouterStatic.sol +80 -93
  170. package/contracts/router/ActionAddRemoveLiq.sol +99 -111
  171. package/contracts/router/ActionCallback.sol +46 -46
  172. package/contracts/router/ActionMintRedeem.sol +58 -58
  173. package/contracts/router/ActionSwapPT.sol +61 -69
  174. package/contracts/router/ActionSwapPTYT.sol +7 -7
  175. package/contracts/router/ActionSwapYT.sol +72 -79
  176. package/contracts/router/PendleRouter.sol +16 -16
  177. package/contracts/router/base/ActionBaseMintRedeem.sol +43 -43
  178. package/contracts/router/base/CallbackHelper.sol +20 -20
  179. package/contracts/router/base/MarketApproxLib.sol +166 -143
  180. package/contracts/router/kyberswap/KyberSwapHelper.sol +2 -2
  181. package/deployments/43113-core.json +16 -0
  182. package/{contracts/deployments → deployments}/43113-helper.json +0 -0
  183. package/deployments/43113-markets/benqi-market-QI-USDC-FEB-2ND.json +8 -0
  184. package/deployments/43113-markets/benqi-market-QI-WETH-DEC-1ST.json +8 -0
  185. package/{contracts/deployments → deployments}/43113-testenv.json +0 -0
  186. package/deployments/80001-core.json +15 -0
  187. package/{contracts/deployments → deployments}/80001-testenv.json +0 -0
  188. package/package.json +2 -2
  189. package/typechain-types/ActionAddRemoveLiq.ts +127 -129
  190. package/typechain-types/ActionCallback.ts +5 -5
  191. package/typechain-types/ActionMintRedeem.ts +139 -141
  192. package/typechain-types/ActionSwapPT.ts +73 -73
  193. package/typechain-types/ActionSwapPTYT.ts +2 -2
  194. package/typechain-types/ActionSwapYT.ts +73 -73
  195. package/typechain-types/IPActionAddRemoveLiq.ts +127 -129
  196. package/typechain-types/IPActionMintRedeem.ts +139 -141
  197. package/typechain-types/IPActionSwapPT.ts +73 -73
  198. package/typechain-types/IPActionSwapPTYT.ts +2 -2
  199. package/typechain-types/IPActionSwapYT.ts +73 -73
  200. package/typechain-types/IPAllAction.ts +402 -406
  201. package/typechain-types/IPMarket.ts +51 -54
  202. package/typechain-types/IPMarketSwapCallback.ts +5 -5
  203. package/typechain-types/IPPrincipalToken.ts +8 -8
  204. package/typechain-types/IPYieldContractFactory.ts +13 -13
  205. package/typechain-types/IPYieldToken.ts +17 -17
  206. package/typechain-types/IStandardizedYield.ts +895 -0
  207. package/typechain-types/MarketMathStatic.ts +27 -27
  208. package/typechain-types/Pendle3CrvAndTokenSY.ts +1243 -0
  209. package/typechain-types/Pendle3CrvHelper.ts +13 -13
  210. package/typechain-types/PendleConvexLPSY.ts +1189 -0
  211. package/typechain-types/PendleGaugeControllerBaseUpg.ts +125 -0
  212. package/typechain-types/PendleGaugeControllerMainchainUpg.ts +125 -0
  213. package/typechain-types/PendleGaugeControllerSidechainUpg.ts +124 -0
  214. package/typechain-types/PendleMarket.ts +54 -57
  215. package/typechain-types/PendlePrincipalToken.ts +8 -8
  216. package/typechain-types/PendleQiTokenSY.ts +1166 -0
  217. package/typechain-types/PendleWstEthSY.ts +1040 -0
  218. package/typechain-types/PendleYieldContractFactory.ts +8 -8
  219. package/typechain-types/PendleYieldToken.ts +41 -44
  220. package/typechain-types/RouterStatic.ts +196 -196
  221. package/typechain-types/SYBase.ts +1001 -0
  222. package/typechain-types/SYBaseWithRewards.ts +1094 -0
  223. package/typechain-types/factories/ActionAddRemoveLiq__factory.ts +34 -34
  224. package/typechain-types/factories/ActionCallback__factory.ts +11 -11
  225. package/typechain-types/factories/ActionMintRedeem__factory.ts +38 -38
  226. package/typechain-types/factories/ActionMisc__factory.ts +1 -1
  227. package/typechain-types/factories/ActionSwapPTYT__factory.ts +3 -3
  228. package/typechain-types/factories/ActionSwapPT__factory.ts +27 -27
  229. package/typechain-types/factories/ActionSwapYT__factory.ts +21 -21
  230. package/typechain-types/factories/Errors__factory.ts +27 -27
  231. package/typechain-types/factories/IPActionAddRemoveLiq__factory.ts +30 -30
  232. package/typechain-types/factories/IPActionMintRedeem__factory.ts +34 -34
  233. package/typechain-types/factories/IPActionSwapPTYT__factory.ts +2 -2
  234. package/typechain-types/factories/IPActionSwapPT__factory.ts +20 -20
  235. package/typechain-types/factories/IPActionSwapYT__factory.ts +20 -20
  236. package/typechain-types/factories/IPAllAction__factory.ts +106 -106
  237. package/typechain-types/factories/IPMarketSwapCallback__factory.ts +1 -1
  238. package/typechain-types/factories/IPMarket__factory.ts +18 -18
  239. package/typechain-types/factories/IPPrincipalToken__factory.ts +1 -1
  240. package/typechain-types/factories/IPYieldContractFactory__factory.ts +3 -3
  241. package/typechain-types/factories/IPYieldToken__factory.ts +6 -6
  242. package/typechain-types/factories/IStandardizedYield__factory.ts +658 -0
  243. package/typechain-types/factories/MarketMathStatic__factory.ts +6 -6
  244. package/typechain-types/factories/OracleLib__factory.ts +1 -1
  245. package/typechain-types/factories/Pendle3CrvAndTokenSY__factory.ts +1124 -0
  246. package/typechain-types/factories/Pendle3CrvHelper__factory.ts +3 -3
  247. package/typechain-types/factories/PendleConvexLPSY__factory.ts +963 -0
  248. package/typechain-types/factories/PendleFeeDistributorFactory__factory.ts +1 -1
  249. package/typechain-types/factories/PendleFeeDistributor__factory.ts +1 -1
  250. package/typechain-types/factories/PendleGaugeControllerBaseUpg__factory.ts +89 -0
  251. package/typechain-types/factories/PendleGaugeControllerMainchainUpg__factory.ts +90 -1
  252. package/typechain-types/factories/PendleGaugeControllerSidechainUpg__factory.ts +90 -1
  253. package/typechain-types/factories/PendleMarketFactory__factory.ts +1 -1
  254. package/typechain-types/factories/PendleMarket__factory.ts +21 -21
  255. package/typechain-types/factories/PendleMsgReceiveEndpointUpg__factory.ts +1 -1
  256. package/typechain-types/factories/PendleMsgSendEndpointUpg__factory.ts +1 -1
  257. package/typechain-types/factories/PendlePrincipalToken__factory.ts +7 -7
  258. package/typechain-types/factories/PendleQiTokenHelper__factory.ts +1 -1
  259. package/typechain-types/factories/PendleQiTokenSY__factory.ts +1095 -0
  260. package/typechain-types/factories/PendleRouter__factory.ts +1 -1
  261. package/typechain-types/factories/PendleVotingControllerUpg__factory.ts +1 -1
  262. package/typechain-types/factories/PendleWstEthSY__factory.ts +924 -0
  263. package/typechain-types/factories/PendleYieldContractFactory__factory.ts +3 -3
  264. package/typechain-types/factories/PendleYieldToken__factory.ts +27 -27
  265. package/typechain-types/factories/RouterStatic__factory.ts +57 -57
  266. package/typechain-types/factories/SYBaseWithRewards__factory.ts +867 -0
  267. package/typechain-types/factories/SYBase__factory.ts +795 -0
  268. package/typechain-types/factories/VotingEscrowPendleMainchain__factory.ts +1 -1
  269. package/typechain-types/factories/VotingEscrowPendleSidechain__factory.ts +1 -1
  270. package/typechain-types/hardhat.d.ts +33 -51
  271. package/typechain-types/index.ts +14 -18
  272. package/build/artifacts/contracts/core/SuperComposableYield/PYIndex.sol/PYIndexLib.dbg.json +0 -4
  273. package/build/artifacts/contracts/core/SuperComposableYield/SCYBase.sol/SCYBase.dbg.json +0 -4
  274. package/build/artifacts/contracts/core/SuperComposableYield/SCYBaseWithRewards.sol/SCYBaseWithRewards.dbg.json +0 -4
  275. package/build/artifacts/contracts/core/SuperComposableYield/SCYUtils.sol/SCYUtils.dbg.json +0 -4
  276. package/build/artifacts/contracts/core/SuperComposableYield/implementations/BenQi/PendleQiTokenHelper.sol/PendleQiTokenHelper.dbg.json +0 -4
  277. package/build/artifacts/contracts/core/SuperComposableYield/implementations/BenQi/PendleQiTokenSCY.sol/PendleQiTokenSCY.dbg.json +0 -4
  278. package/build/artifacts/contracts/core/SuperComposableYield/implementations/Convex/ConvexCurveLP/Pendle3CrvAndTokenSCY.sol/Pendle3CrvAndTokenSCY.dbg.json +0 -4
  279. package/build/artifacts/contracts/core/SuperComposableYield/implementations/Convex/ConvexCurveLP/Pendle3CrvAndTokenSCY.sol/Pendle3CrvAndTokenSCY.json +0 -1030
  280. package/build/artifacts/contracts/core/SuperComposableYield/implementations/Convex/ConvexCurveLP/PendleConvexCurveLP2PoolSCY.sol/PendleConvexCurveLP2PoolSCY.dbg.json +0 -4
  281. package/build/artifacts/contracts/core/SuperComposableYield/implementations/Convex/ConvexCurveLP/PendleConvexCurveLP2PoolSCY.sol/PendleConvexCurveLP2PoolSCY.json +0 -1025
  282. package/build/artifacts/contracts/core/SuperComposableYield/implementations/Convex/ConvexCurveLP/PendleConvexCurveLPSCY.sol/PendleConvexCurveLPSCY.dbg.json +0 -4
  283. package/build/artifacts/contracts/core/SuperComposableYield/implementations/Convex/Pendle3CrvHelper.sol/Pendle3CrvHelper.dbg.json +0 -4
  284. package/build/artifacts/contracts/core/SuperComposableYield/implementations/PendleWstEthSCY.sol/PendleWstEthSCY.dbg.json +0 -4
  285. package/build/artifacts/contracts/interfaces/ISuperComposableYield.sol/ISuperComposableYield.dbg.json +0 -4
  286. package/build/artifacts/contracts/offchain-helpers/ImplicitSwapfeeContract.sol/ImplicitSwapfeeContract.dbg.json +0 -4
  287. package/build/artifacts/contracts/offchain-helpers/ImplicitSwapfeeContract.sol/ImplicitSwapfeeContract.json +0 -190
  288. package/contracts/core/SuperComposableYield/SCYUtils.sol +0 -34
  289. package/contracts/core/SuperComposableYield/implementations/Convex/ConvexCurveLP/Pendle3CrvAndTokenSCY.sol +0 -135
  290. package/contracts/core/SuperComposableYield/implementations/Convex/ConvexCurveLP/PendleConvexCurveLP2PoolSCY.sol +0 -96
  291. package/contracts/deployments/43113-core.json +0 -16
  292. package/contracts/deployments/43113-markets/benqi-market-QI-USDC-FEB-2ND.json +0 -8
  293. package/contracts/deployments/43113-markets/benqi-market-QI-WETH-DEC-1ST.json +0 -8
  294. package/contracts/deployments/80001-core.json +0 -15
  295. package/contracts/deployments/80001-markets/benqi-market-QI-USDC-FEB-2ND.json +0 -8
  296. package/contracts/deployments/80001-markets/benqi-market-QI-WETH-DEC-1ST.json +0 -8
  297. package/contracts/interfaces/ICelerMessageBus.sol +0 -28
  298. package/contracts/interfaces/ICelerMessageReceiverApp.sol +0 -25
  299. 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
  }
@@ -3,7 +3,7 @@ pragma solidity 0.8.17;
3
3
  import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
4
4
  import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
5
5
 
6
- import "../../interfaces/ISuperComposableYield.sol";
6
+ import "../../interfaces/IStandardizedYield.sol";
7
7
 
8
8
  import "../erc20/PendleERC20Permit.sol";
9
9
 
@@ -11,9 +11,9 @@ import "../RewardManager/RewardManager.sol";
11
11
  import "../libraries/math/Math.sol";
12
12
  import "../libraries/TokenHelper.sol";
13
13
  import "../libraries/Errors.sol";
14
- import "./SCYUtils.sol";
14
+ import "./SYUtils.sol";
15
15
 
16
- abstract contract SCYBase is ISuperComposableYield, PendleERC20Permit, TokenHelper {
16
+ abstract contract SYBase is IStandardizedYield, PendleERC20Permit, TokenHelper {
17
17
  using Math for uint256;
18
18
 
19
19
  address public immutable yieldToken;
@@ -34,7 +34,7 @@ abstract contract SCYBase is ISuperComposableYield, PendleERC20Permit, TokenHelp
34
34
  //////////////////////////////////////////////////////////////*/
35
35
 
36
36
  /**
37
- * @dev See {ISuperComposableYield-deposit}
37
+ * @dev See {IStandardizedYield-deposit}
38
38
  */
39
39
  function deposit(
40
40
  address receiver,
@@ -42,21 +42,21 @@ abstract contract SCYBase is ISuperComposableYield, PendleERC20Permit, TokenHelp
42
42
  uint256 amountTokenToDeposit,
43
43
  uint256 minSharesOut
44
44
  ) external payable nonReentrant returns (uint256 amountSharesOut) {
45
- if (!isValidTokenIn(tokenIn)) revert Errors.SCYInvalidTokenIn(tokenIn);
46
- if (amountTokenToDeposit == 0) revert Errors.SCYZeroDeposit();
45
+ if (!isValidTokenIn(tokenIn)) revert Errors.SYInvalidTokenIn(tokenIn);
46
+ if (amountTokenToDeposit == 0) revert Errors.SYZeroDeposit();
47
47
 
48
48
  _transferIn(tokenIn, msg.sender, amountTokenToDeposit);
49
49
 
50
50
  amountSharesOut = _deposit(tokenIn, amountTokenToDeposit);
51
51
  if (amountSharesOut < minSharesOut)
52
- revert Errors.SCYInsufficientSharesOut(amountSharesOut, minSharesOut);
52
+ revert Errors.SYInsufficientSharesOut(amountSharesOut, minSharesOut);
53
53
 
54
54
  _mint(receiver, amountSharesOut);
55
55
  emit Deposit(msg.sender, receiver, tokenIn, amountTokenToDeposit, amountSharesOut);
56
56
  }
57
57
 
58
58
  /**
59
- * @dev See {ISuperComposableYield-redeem}
59
+ * @dev See {IStandardizedYield-redeem}
60
60
  */
61
61
  function redeem(
62
62
  address receiver,
@@ -65,8 +65,8 @@ abstract contract SCYBase is ISuperComposableYield, PendleERC20Permit, TokenHelp
65
65
  uint256 minTokenOut,
66
66
  bool burnFromInternalBalance
67
67
  ) external nonReentrant returns (uint256 amountTokenOut) {
68
- if (!isValidTokenOut(tokenOut)) revert Errors.SCYInvalidTokenOut(tokenOut);
69
- if (amountSharesToRedeem == 0) revert Errors.SCYZeroRedeem();
68
+ if (!isValidTokenOut(tokenOut)) revert Errors.SYInvalidTokenOut(tokenOut);
69
+ if (amountSharesToRedeem == 0) revert Errors.SYZeroRedeem();
70
70
 
71
71
  if (burnFromInternalBalance) {
72
72
  _burn(address(this), amountSharesToRedeem);
@@ -76,7 +76,7 @@ abstract contract SCYBase is ISuperComposableYield, PendleERC20Permit, TokenHelp
76
76
 
77
77
  amountTokenOut = _redeem(receiver, tokenOut, amountSharesToRedeem);
78
78
  if (amountTokenOut < minTokenOut)
79
- revert Errors.SCYInsufficientTokenOut(amountTokenOut, minTokenOut);
79
+ revert Errors.SYInsufficientTokenOut(amountTokenOut, minTokenOut);
80
80
  emit Redeem(msg.sender, receiver, tokenOut, amountSharesToRedeem, amountTokenOut);
81
81
  }
82
82
 
@@ -108,7 +108,7 @@ abstract contract SCYBase is ISuperComposableYield, PendleERC20Permit, TokenHelp
108
108
  //////////////////////////////////////////////////////////////*/
109
109
 
110
110
  /**
111
- * @dev See {ISuperComposableYield-exchangeRate}
111
+ * @dev See {IStandardizedYield-exchangeRate}
112
112
  */
113
113
  function exchangeRate() external view virtual override returns (uint256 res);
114
114
 
@@ -117,7 +117,7 @@ abstract contract SCYBase is ISuperComposableYield, PendleERC20Permit, TokenHelp
117
117
  //////////////////////////////////////////////////////////////*/
118
118
 
119
119
  /**
120
- * @dev See {ISuperComposableYield-claimRewards}
120
+ * @dev See {IStandardizedYield-claimRewards}
121
121
  */
122
122
  function claimRewards(
123
123
  address /*user*/
@@ -126,7 +126,7 @@ abstract contract SCYBase is ISuperComposableYield, PendleERC20Permit, TokenHelp
126
126
  }
127
127
 
128
128
  /**
129
- * @dev See {ISuperComposableYield-getRewardTokens}
129
+ * @dev See {IStandardizedYield-getRewardTokens}
130
130
  */
131
131
  function getRewardTokens()
132
132
  external
@@ -139,7 +139,7 @@ abstract contract SCYBase is ISuperComposableYield, PendleERC20Permit, TokenHelp
139
139
  }
140
140
 
141
141
  /**
142
- * @dev See {ISuperComposableYield-accruedRewards}
142
+ * @dev See {IStandardizedYield-accruedRewards}
143
143
  */
144
144
  function accruedRewards(
145
145
  address /*user*/
@@ -171,7 +171,7 @@ abstract contract SCYBase is ISuperComposableYield, PendleERC20Permit, TokenHelp
171
171
  virtual
172
172
  returns (uint256 amountSharesOut)
173
173
  {
174
- if (!isValidTokenIn(tokenIn)) revert Errors.SCYInvalidTokenIn(tokenIn);
174
+ if (!isValidTokenIn(tokenIn)) revert Errors.SYInvalidTokenIn(tokenIn);
175
175
  return _previewDeposit(tokenIn, amountTokenToDeposit);
176
176
  }
177
177
 
@@ -181,7 +181,7 @@ abstract contract SCYBase is ISuperComposableYield, PendleERC20Permit, TokenHelp
181
181
  virtual
182
182
  returns (uint256 amountTokenOut)
183
183
  {
184
- if (!isValidTokenOut(tokenOut)) revert Errors.SCYInvalidTokenOut(tokenOut);
184
+ if (!isValidTokenOut(tokenOut)) revert Errors.SYInvalidTokenOut(tokenOut);
185
185
  return _previewRedeem(tokenOut, amountSharesToRedeem);
186
186
  }
187
187
 
@@ -2,13 +2,13 @@
2
2
  pragma solidity 0.8.17;
3
3
  import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
4
4
 
5
- import "../../interfaces/ISuperComposableYield.sol";
5
+ import "../../interfaces/IStandardizedYield.sol";
6
6
 
7
7
  import "../libraries/math/Math.sol";
8
- import "./SCYBase.sol";
8
+ import "./SYBase.sol";
9
9
 
10
10
  /// NOTE: yieldToken MUST NEVER BE a rewardToken, else the rewardManager will behave erroneously
11
- abstract contract SCYBaseWithRewards is SCYBase, RewardManager {
11
+ abstract contract SYBaseWithRewards is SYBase, RewardManager {
12
12
  using Math for uint256;
13
13
  using ArrayLib for address[];
14
14
 
@@ -17,7 +17,7 @@ abstract contract SCYBaseWithRewards is SCYBase, RewardManager {
17
17
  string memory _symbol,
18
18
  address _yieldToken
19
19
  )
20
- SCYBase(_name, _symbol, _yieldToken) // solhint-disable-next-line no-empty-blocks
20
+ SYBase(_name, _symbol, _yieldToken) // solhint-disable-next-line no-empty-blocks
21
21
  {}
22
22
 
23
23
  /*///////////////////////////////////////////////////////////////
@@ -25,7 +25,7 @@ abstract contract SCYBaseWithRewards is SCYBase, RewardManager {
25
25
  //////////////////////////////////////////////////////////////*/
26
26
 
27
27
  /**
28
- * @dev See {ISuperComposableYield-claimRewards}
28
+ * @dev See {IStandardizedYield-claimRewards}
29
29
  */
30
30
  function claimRewards(address user)
31
31
  external
@@ -41,7 +41,7 @@ abstract contract SCYBaseWithRewards is SCYBase, RewardManager {
41
41
  }
42
42
 
43
43
  /**
44
- * @dev See {ISuperComposableYield-getRewardTokens}
44
+ * @dev See {IStandardizedYield-getRewardTokens}
45
45
  */
46
46
  function getRewardTokens()
47
47
  external
@@ -54,7 +54,7 @@ abstract contract SCYBaseWithRewards is SCYBase, RewardManager {
54
54
  }
55
55
 
56
56
  /**
57
- * @dev See {ISuperComposableYield-accruedRewards}
57
+ * @dev See {IStandardizedYield-accruedRewards}
58
58
  */
59
59
  function accruedRewards(address user)
60
60
  external
@@ -102,7 +102,7 @@ abstract contract SCYBaseWithRewards is SCYBase, RewardManager {
102
102
 
103
103
  /**
104
104
  * @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
105
+ * @dev this is simply the total supply of shares, as rewards shares are equivalent to SY shares
106
106
  */
107
107
  function _rewardSharesTotal() internal view virtual override returns (uint256) {
108
108
  return totalSupply();
@@ -110,7 +110,7 @@ abstract contract SCYBaseWithRewards is SCYBase, RewardManager {
110
110
 
111
111
  /**
112
112
  * @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
113
+ * @dev this is simply the SY balance of (`user`), as rewards shares are equivalent to SY shares
114
114
  */
115
115
  function _rewardSharesUser(address user) internal view virtual override returns (uint256) {
116
116
  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
+ }