@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
@@ -4,13 +4,13 @@ pragma solidity 0.8.17;
4
4
  import "../libraries/math/Math.sol";
5
5
  import "../libraries/math/LogExpMath.sol";
6
6
 
7
- import "../SuperComposableYield/PYIndex.sol";
7
+ import "../StandardizedYield/PYIndex.sol";
8
8
  import "../libraries/MiniHelpers.sol";
9
9
  import "../libraries/Errors.sol";
10
10
 
11
11
  struct MarketState {
12
12
  int256 totalPt;
13
- int256 totalScy;
13
+ int256 totalSy;
14
14
  int256 totalLp;
15
15
  address treasury;
16
16
  /// immutable variables ///
@@ -53,7 +53,7 @@ library MarketMathCore {
53
53
 
54
54
  function addLiquidity(
55
55
  MarketState memory market,
56
- uint256 scyDesired,
56
+ uint256 syDesired,
57
57
  uint256 ptDesired,
58
58
  uint256 blockTime
59
59
  )
@@ -62,69 +62,66 @@ library MarketMathCore {
62
62
  returns (
63
63
  uint256 lpToReserve,
64
64
  uint256 lpToAccount,
65
- uint256 scyUsed,
65
+ uint256 syUsed,
66
66
  uint256 ptUsed
67
67
  )
68
68
  {
69
69
  (
70
70
  int256 _lpToReserve,
71
71
  int256 _lpToAccount,
72
- int256 _scyUsed,
72
+ int256 _syUsed,
73
73
  int256 _ptUsed
74
- ) = addLiquidityCore(market, scyDesired.Int(), ptDesired.Int(), blockTime);
74
+ ) = addLiquidityCore(market, syDesired.Int(), ptDesired.Int(), blockTime);
75
75
 
76
76
  lpToReserve = _lpToReserve.Uint();
77
77
  lpToAccount = _lpToAccount.Uint();
78
- scyUsed = _scyUsed.Uint();
78
+ syUsed = _syUsed.Uint();
79
79
  ptUsed = _ptUsed.Uint();
80
80
  }
81
81
 
82
82
  function removeLiquidity(MarketState memory market, uint256 lpToRemove)
83
83
  internal
84
84
  pure
85
- returns (uint256 scyToAccount, uint256 netPtToAccount)
85
+ returns (uint256 syToAccount, uint256 netPtToAccount)
86
86
  {
87
- (int256 _scyToAccount, int256 _ptToAccount) = removeLiquidityCore(
88
- market,
89
- lpToRemove.Int()
90
- );
87
+ (int256 _syToAccount, int256 _ptToAccount) = removeLiquidityCore(market, lpToRemove.Int());
91
88
 
92
- scyToAccount = _scyToAccount.Uint();
89
+ syToAccount = _syToAccount.Uint();
93
90
  netPtToAccount = _ptToAccount.Uint();
94
91
  }
95
92
 
96
- function swapExactPtForScy(
93
+ function swapExactPtForSy(
97
94
  MarketState memory market,
98
95
  PYIndex index,
99
96
  uint256 exactPtToMarket,
100
97
  uint256 blockTime
101
- ) internal pure returns (uint256 netScyToAccount, uint256 netScyToReserve) {
102
- (int256 _netScyToAccount, int256 _netScyToReserve) = executeTradeCore(
98
+ ) internal pure returns (uint256 netSyToAccount, uint256 netSyToReserve) {
99
+ (int256 _netSyToAccount, int256 _netSyToReserve) = executeTradeCore(
103
100
  market,
104
101
  index,
105
102
  exactPtToMarket.neg(),
106
103
  blockTime
107
104
  );
108
105
 
109
- netScyToAccount = _netScyToAccount.Uint();
110
- netScyToReserve = _netScyToReserve.Uint();
106
+ netSyToAccount = _netSyToAccount.Uint();
107
+ netSyToReserve = _netSyToReserve.Uint();
111
108
  }
112
109
 
113
- function swapScyForExactPt(
110
+ function swapSyForExactPt(
114
111
  MarketState memory market,
115
112
  PYIndex index,
116
113
  uint256 exactPtToAccount,
117
114
  uint256 blockTime
118
- ) internal pure returns (uint256 netScyToMarket, uint256 netScyToReserve) {
119
- (int256 _netScyToAccount, int256 _netScyToReserve) = executeTradeCore(
115
+ ) internal pure returns (uint256 netSyToMarket, uint256 netSyToReserve) {
116
+ (int256 _netSyToAccount, int256 _netSyToReserve) = executeTradeCore(
120
117
  market,
121
118
  index,
122
119
  exactPtToAccount.Int(),
123
120
  blockTime
124
121
  );
125
122
 
126
- netScyToMarket = _netScyToAccount.neg().Uint();
127
- netScyToReserve = _netScyToReserve.Uint();
123
+ netSyToMarket = _netSyToAccount.neg().Uint();
124
+ netSyToReserve = _netSyToReserve.Uint();
128
125
  }
129
126
 
130
127
  /*///////////////////////////////////////////////////////////////
@@ -133,7 +130,7 @@ library MarketMathCore {
133
130
 
134
131
  function addLiquidityCore(
135
132
  MarketState memory market,
136
- int256 scyDesired,
133
+ int256 syDesired,
137
134
  int256 ptDesired,
138
135
  uint256 blockTime
139
136
  )
@@ -142,34 +139,34 @@ library MarketMathCore {
142
139
  returns (
143
140
  int256 lpToReserve,
144
141
  int256 lpToAccount,
145
- int256 scyUsed,
142
+ int256 syUsed,
146
143
  int256 ptUsed
147
144
  )
148
145
  {
149
146
  /// ------------------------------------------------------------
150
147
  /// CHECKS
151
148
  /// ------------------------------------------------------------
152
- if (scyDesired == 0 || ptDesired == 0) revert Errors.MarketZeroAmountsInput();
149
+ if (syDesired == 0 || ptDesired == 0) revert Errors.MarketZeroAmountsInput();
153
150
  if (MiniHelpers.isExpired(market.expiry, blockTime)) revert Errors.MarketExpired();
154
151
 
155
152
  /// ------------------------------------------------------------
156
153
  /// MATH
157
154
  /// ------------------------------------------------------------
158
155
  if (market.totalLp == 0) {
159
- lpToAccount = Math.sqrt((scyDesired * ptDesired).Uint()).Int() - MINIMUM_LIQUIDITY;
156
+ lpToAccount = Math.sqrt((syDesired * ptDesired).Uint()).Int() - MINIMUM_LIQUIDITY;
160
157
  lpToReserve = MINIMUM_LIQUIDITY;
161
- scyUsed = scyDesired;
158
+ syUsed = syDesired;
162
159
  ptUsed = ptDesired;
163
160
  } else {
164
161
  int256 netLpByPt = (ptDesired * market.totalLp) / market.totalPt;
165
- int256 netLpByScy = (scyDesired * market.totalLp) / market.totalScy;
166
- if (netLpByPt < netLpByScy) {
162
+ int256 netLpBySy = (syDesired * market.totalLp) / market.totalSy;
163
+ if (netLpByPt < netLpBySy) {
167
164
  lpToAccount = netLpByPt;
168
165
  ptUsed = ptDesired;
169
- scyUsed = (market.totalScy * lpToAccount) / market.totalLp;
166
+ syUsed = (market.totalSy * lpToAccount) / market.totalLp;
170
167
  } else {
171
- lpToAccount = netLpByScy;
172
- scyUsed = scyDesired;
168
+ lpToAccount = netLpBySy;
169
+ syUsed = syDesired;
173
170
  ptUsed = (market.totalPt * lpToAccount) / market.totalLp;
174
171
  }
175
172
  }
@@ -179,7 +176,7 @@ library MarketMathCore {
179
176
  /// ------------------------------------------------------------
180
177
  /// WRITE
181
178
  /// ------------------------------------------------------------
182
- market.totalScy += scyUsed;
179
+ market.totalSy += syUsed;
183
180
  market.totalPt += ptUsed;
184
181
  market.totalLp += lpToAccount + lpToReserve;
185
182
  }
@@ -187,7 +184,7 @@ library MarketMathCore {
187
184
  function removeLiquidityCore(MarketState memory market, int256 lpToRemove)
188
185
  internal
189
186
  pure
190
- returns (int256 netScyToAccount, int256 netPtToAccount)
187
+ returns (int256 netSyToAccount, int256 netPtToAccount)
191
188
  {
192
189
  /// ------------------------------------------------------------
193
190
  /// CHECKS
@@ -197,17 +194,17 @@ library MarketMathCore {
197
194
  /// ------------------------------------------------------------
198
195
  /// MATH
199
196
  /// ------------------------------------------------------------
200
- netScyToAccount = (lpToRemove * market.totalScy) / market.totalLp;
197
+ netSyToAccount = (lpToRemove * market.totalSy) / market.totalLp;
201
198
  netPtToAccount = (lpToRemove * market.totalPt) / market.totalLp;
202
199
 
203
- if (netScyToAccount == 0 || netPtToAccount == 0) revert Errors.MarketZeroAmountsOutput();
200
+ if (netSyToAccount == 0 || netPtToAccount == 0) revert Errors.MarketZeroAmountsOutput();
204
201
 
205
202
  /// ------------------------------------------------------------
206
203
  /// WRITE
207
204
  /// ------------------------------------------------------------
208
205
  market.totalLp = market.totalLp.subNoNeg(lpToRemove);
209
206
  market.totalPt = market.totalPt.subNoNeg(netPtToAccount);
210
- market.totalScy = market.totalScy.subNoNeg(netScyToAccount);
207
+ market.totalSy = market.totalSy.subNoNeg(netSyToAccount);
211
208
  }
212
209
 
213
210
  function executeTradeCore(
@@ -215,7 +212,7 @@ library MarketMathCore {
215
212
  PYIndex index,
216
213
  int256 netPtToAccount,
217
214
  uint256 blockTime
218
- ) internal pure returns (int256 netScyToAccount, int256 netScyToReserve) {
215
+ ) internal pure returns (int256 netSyToAccount, int256 netSyToReserve) {
219
216
  /// ------------------------------------------------------------
220
217
  /// CHECKS
221
218
  /// ------------------------------------------------------------
@@ -228,7 +225,7 @@ library MarketMathCore {
228
225
  /// ------------------------------------------------------------
229
226
  MarketPreCompute memory comp = getMarketPreCompute(market, index, blockTime);
230
227
 
231
- (netScyToAccount, netScyToReserve) = calcTrade(market, comp, index, netPtToAccount);
228
+ (netSyToAccount, netSyToReserve) = calcTrade(market, comp, index, netPtToAccount);
232
229
 
233
230
  /// ------------------------------------------------------------
234
231
  /// WRITE
@@ -238,8 +235,8 @@ library MarketMathCore {
238
235
  comp,
239
236
  index,
240
237
  netPtToAccount,
241
- netScyToAccount,
242
- netScyToReserve,
238
+ netSyToAccount,
239
+ netSyToReserve,
243
240
  blockTime
244
241
  );
245
242
  }
@@ -254,7 +251,7 @@ library MarketMathCore {
254
251
  uint256 timeToExpiry = market.expiry - blockTime;
255
252
 
256
253
  res.rateScalar = _getRateScalar(market, timeToExpiry);
257
- res.totalAsset = index.scyToAsset(market.totalScy);
254
+ res.totalAsset = index.syToAsset(market.totalSy);
258
255
 
259
256
  if (market.totalPt == 0 || res.totalAsset == 0)
260
257
  revert Errors.MarketZeroTotalPtOrTotalAsset(market.totalPt, res.totalAsset);
@@ -274,7 +271,7 @@ library MarketMathCore {
274
271
  MarketPreCompute memory comp,
275
272
  PYIndex index,
276
273
  int256 netPtToAccount
277
- ) internal pure returns (int256 netScyToAccount, int256 netScyToReserve) {
274
+ ) internal pure returns (int256 netSyToAccount, int256 netSyToReserve) {
278
275
  int256 preFeeExchangeRate = _getExchangeRate(
279
276
  market.totalPt,
280
277
  comp.totalAsset,
@@ -299,10 +296,10 @@ library MarketMathCore {
299
296
  int256 netAssetToReserve = (fee * market.reserveFeePercent.Int()) / PERCENTAGE_DECIMALS;
300
297
  int256 netAssetToAccount = preFeeAssetToAccount - fee;
301
298
 
302
- netScyToAccount = netAssetToAccount < 0
303
- ? index.assetToScyUp(netAssetToAccount)
304
- : index.assetToScy(netAssetToAccount);
305
- netScyToReserve = index.assetToScy(netAssetToReserve);
299
+ netSyToAccount = netAssetToAccount < 0
300
+ ? index.assetToSyUp(netAssetToAccount)
301
+ : index.assetToSy(netAssetToAccount);
302
+ netSyToReserve = index.assetToSy(netAssetToReserve);
306
303
  }
307
304
 
308
305
  function _setNewMarketStateTrade(
@@ -310,18 +307,18 @@ library MarketMathCore {
310
307
  MarketPreCompute memory comp,
311
308
  PYIndex index,
312
309
  int256 netPtToAccount,
313
- int256 netScyToAccount,
314
- int256 netScyToReserve,
310
+ int256 netSyToAccount,
311
+ int256 netSyToReserve,
315
312
  uint256 blockTime
316
313
  ) internal pure {
317
314
  uint256 timeToExpiry = market.expiry - blockTime;
318
315
 
319
316
  market.totalPt = market.totalPt.subNoNeg(netPtToAccount);
320
- market.totalScy = market.totalScy.subNoNeg(netScyToAccount + netScyToReserve);
317
+ market.totalSy = market.totalSy.subNoNeg(netSyToAccount + netSyToReserve);
321
318
 
322
319
  market.lastLnImpliedRate = _getLnImpliedRate(
323
320
  market.totalPt,
324
- index.scyToAsset(market.totalScy),
321
+ index.syToAsset(market.totalSy),
325
322
  comp.rateScalar,
326
323
  comp.rateAnchor,
327
324
  timeToExpiry
@@ -432,7 +429,7 @@ library MarketMathCore {
432
429
  /// ------------------------------------------------------------
433
430
  /// MATH
434
431
  /// ------------------------------------------------------------
435
- int256 totalAsset = index.scyToAsset(market.totalScy);
432
+ int256 totalAsset = index.syToAsset(market.totalSy);
436
433
  uint256 timeToExpiry = market.expiry - blockTime;
437
434
  int256 rateScalar = _getRateScalar(market, timeToExpiry);
438
435
 
@@ -4,7 +4,7 @@ pragma solidity 0.8.17;
4
4
  import "../../interfaces/IPGauge.sol";
5
5
  import "../../interfaces/IPVeToken.sol";
6
6
  import "../../interfaces/IPGaugeController.sol";
7
- import "../../interfaces/ISuperComposableYield.sol";
7
+ import "../../interfaces/IStandardizedYield.sol";
8
8
 
9
9
  import "../RewardManager/RewardManager.sol";
10
10
 
@@ -17,7 +17,7 @@ abstract contract PendleGauge is RewardManager, IPGauge {
17
17
  using SafeERC20 for IERC20;
18
18
  using ArrayLib for address[];
19
19
 
20
- address private immutable SCY;
20
+ address private immutable SY;
21
21
 
22
22
  uint256 internal constant TOKENLESS_PRODUCTION = 40;
23
23
 
@@ -29,11 +29,11 @@ abstract contract PendleGauge is RewardManager, IPGauge {
29
29
  mapping(address => uint256) public activeBalance;
30
30
 
31
31
  constructor(
32
- address _SCY,
32
+ address _SY,
33
33
  address _vePendle,
34
34
  address _gaugeController
35
35
  ) {
36
- SCY = _SCY;
36
+ SY = _SY;
37
37
  vePENDLE = IPVeToken(_vePendle);
38
38
  gaugeController = _gaugeController;
39
39
  PENDLE = IPGaugeController(gaugeController).pendle();
@@ -94,7 +94,7 @@ abstract contract PendleGauge is RewardManager, IPGauge {
94
94
  }
95
95
 
96
96
  function _redeemExternalReward() internal virtual override {
97
- ISuperComposableYield(SCY).claimRewards(address(this));
97
+ IStandardizedYield(SY).claimRewards(address(this));
98
98
  IPGaugeController(gaugeController).redeemMarketReward();
99
99
  }
100
100
 
@@ -111,9 +111,9 @@ abstract contract PendleGauge is RewardManager, IPGauge {
111
111
  }
112
112
 
113
113
  function _getRewardTokens() internal view virtual override returns (address[] memory) {
114
- address[] memory SCYRewards = ISuperComposableYield(SCY).getRewardTokens();
115
- if (SCYRewards.contains(PENDLE)) return SCYRewards;
116
- return SCYRewards.append(PENDLE);
114
+ address[] memory SYRewards = IStandardizedYield(SY).getRewardTokens();
115
+ if (SYRewards.contains(PENDLE)) return SYRewards;
116
+ return SYRewards.append(PENDLE);
117
117
  }
118
118
 
119
119
  function _beforeTokenTransfer(
@@ -11,7 +11,7 @@ import "./OracleLib.sol";
11
11
 
12
12
  /**
13
13
  Invariance to maintain:
14
- - Internal balances totalPt & totalScy not interfered by people transferring tokens in directly
14
+ - Internal balances totalPt & totalSy not interfered by people transferring tokens in directly
15
15
  - address(0) & address(this) should never have any rewards & activeBalance accounting done. This is
16
16
  guaranteed by address(0) & address(this) check in each updateForTwo function
17
17
  */
@@ -25,7 +25,7 @@ contract PendleMarket is PendleERC20Permit, PendleGauge, IPMarket {
25
25
 
26
26
  struct MarketStorage {
27
27
  int128 totalPt;
28
- int128 totalScy;
28
+ int128 totalSy;
29
29
  // 1 SLOT = 256 bits
30
30
  uint96 lastLnImpliedRate;
31
31
  uint16 observationIndex;
@@ -38,7 +38,7 @@ contract PendleMarket is PendleERC20Permit, PendleGauge, IPMarket {
38
38
  string private constant SYMBOL = "PENDLE-LPT";
39
39
 
40
40
  IPPrincipalToken internal immutable PT;
41
- ISuperComposableYield internal immutable SCY;
41
+ IStandardizedYield internal immutable SY;
42
42
  IPYieldToken internal immutable YT;
43
43
 
44
44
  address public immutable factory;
@@ -63,10 +63,10 @@ contract PendleMarket is PendleERC20Permit, PendleGauge, IPMarket {
63
63
  address _gaugeController
64
64
  )
65
65
  PendleERC20Permit(NAME, SYMBOL, 18)
66
- PendleGauge(IPPrincipalToken(_PT).SCY(), _vePendle, _gaugeController)
66
+ PendleGauge(IPPrincipalToken(_PT).SY(), _vePendle, _gaugeController)
67
67
  {
68
68
  PT = IPPrincipalToken(_PT);
69
- SCY = ISuperComposableYield(PT.SCY());
69
+ SY = IStandardizedYield(PT.SY());
70
70
  YT = IPYieldToken(PT.YT());
71
71
 
72
72
  (_storage.observationCardinality, _storage.observationCardinalityNext) = observations
@@ -81,12 +81,12 @@ contract PendleMarket is PendleERC20Permit, PendleGauge, IPMarket {
81
81
  }
82
82
 
83
83
  /**
84
- * @notice PendleMarket allows users to provide in PT & SCY in exchange for LPs, which
84
+ * @notice PendleMarket allows users to provide in PT & SY in exchange for LPs, which
85
85
  * will grant LP holders more exchange fee over time
86
86
  */
87
87
  function mint(
88
88
  address receiver,
89
- uint256 netScyDesired,
89
+ uint256 netSyDesired,
90
90
  uint256 netPtDesired
91
91
  )
92
92
  external
@@ -94,7 +94,7 @@ contract PendleMarket is PendleERC20Permit, PendleGauge, IPMarket {
94
94
  notExpired
95
95
  returns (
96
96
  uint256 netLpOut,
97
- uint256 netScyUsed,
97
+ uint256 netSyUsed,
98
98
  uint256 netPtUsed
99
99
  )
100
100
  {
@@ -103,8 +103,8 @@ contract PendleMarket is PendleERC20Permit, PendleGauge, IPMarket {
103
103
 
104
104
  uint256 lpToReserve;
105
105
 
106
- (lpToReserve, netLpOut, netScyUsed, netPtUsed) = market.addLiquidity(
107
- netScyDesired,
106
+ (lpToReserve, netLpOut, netSyUsed, netPtUsed) = market.addLiquidity(
107
+ netSyDesired,
108
108
  netPtDesired,
109
109
  block.timestamp
110
110
  );
@@ -119,120 +119,120 @@ contract PendleMarket is PendleERC20Permit, PendleGauge, IPMarket {
119
119
 
120
120
  _writeState(market);
121
121
 
122
- if (_selfBalance(SCY) < market.totalScy.Uint())
123
- revert Errors.MarketInsufficientScyReceived(_selfBalance(SCY), market.totalScy.Uint());
122
+ if (_selfBalance(SY) < market.totalSy.Uint())
123
+ revert Errors.MarketInsufficientSyReceived(_selfBalance(SY), market.totalSy.Uint());
124
124
  if (_selfBalance(PT) < market.totalPt.Uint())
125
125
  revert Errors.MarketInsufficientPtReceived(_selfBalance(PT), market.totalPt.Uint());
126
126
 
127
- emit Mint(receiver, netLpOut, netScyUsed, netPtUsed);
127
+ emit Mint(receiver, netLpOut, netSyUsed, netPtUsed);
128
128
  }
129
129
 
130
130
  /**
131
- * @notice LP Holders can burn their LP to receive back SCY & PT proportionally
131
+ * @notice LP Holders can burn their LP to receive back SY & PT proportionally
132
132
  * to their share of market
133
133
  */
134
134
  function burn(
135
- address receiverScy,
135
+ address receiverSy,
136
136
  address receiverPt,
137
137
  uint256 netLpToBurn
138
- ) external nonReentrant returns (uint256 netScyOut, uint256 netPtOut) {
138
+ ) external nonReentrant returns (uint256 netSyOut, uint256 netPtOut) {
139
139
  MarketState memory market = readState();
140
140
 
141
141
  _burn(address(this), netLpToBurn);
142
142
 
143
- (netScyOut, netPtOut) = market.removeLiquidity(netLpToBurn);
143
+ (netSyOut, netPtOut) = market.removeLiquidity(netLpToBurn);
144
144
 
145
- if (receiverScy != address(this)) IERC20(SCY).safeTransfer(receiverScy, netScyOut);
145
+ if (receiverSy != address(this)) IERC20(SY).safeTransfer(receiverSy, netSyOut);
146
146
  if (receiverPt != address(this)) IERC20(PT).safeTransfer(receiverPt, netPtOut);
147
147
 
148
148
  _writeState(market);
149
149
 
150
- emit Burn(receiverScy, receiverPt, netLpToBurn, netScyOut, netPtOut);
150
+ emit Burn(receiverSy, receiverPt, netLpToBurn, netSyOut, netPtOut);
151
151
  }
152
152
 
153
153
  /**
154
- * @notice Pendle Market allows swaps between PT & SCY it is holding. This function
155
- * aims to swap an exact amount of PT to SCY.
154
+ * @notice Pendle Market allows swaps between PT & SY it is holding. This function
155
+ * aims to swap an exact amount of PT to SY.
156
156
  * @dev steps working of this contract
157
- - The outcome amount of SCY will be precomputed by MarketMathLib
158
- - Release the calculated amount of SCY to receiver
157
+ - The outcome amount of SY will be precomputed by MarketMathLib
158
+ - Release the calculated amount of SY to receiver
159
159
  - Callback to msg.sender if data.length > 0
160
160
  - Ensure exactPtIn amount of PT has been transferred to this address
161
161
  * @param data bytes data to be sent in the callback
162
162
  */
163
- function swapExactPtForScy(
163
+ function swapExactPtForSy(
164
164
  address receiver,
165
165
  uint256 exactPtIn,
166
166
  bytes calldata data
167
- ) external nonReentrant notExpired returns (uint256 netScyOut, uint256 netScyToReserve) {
167
+ ) external nonReentrant notExpired returns (uint256 netSyOut, uint256 netSyToReserve) {
168
168
  MarketState memory market = readState();
169
169
 
170
- (netScyOut, netScyToReserve) = market.swapExactPtForScy(
170
+ (netSyOut, netSyToReserve) = market.swapExactPtForSy(
171
171
  YT.newIndex(),
172
172
  exactPtIn,
173
173
  block.timestamp
174
174
  );
175
175
 
176
- if (receiver != address(this)) IERC20(SCY).safeTransfer(receiver, netScyOut);
177
- IERC20(SCY).safeTransfer(market.treasury, netScyToReserve);
176
+ if (receiver != address(this)) IERC20(SY).safeTransfer(receiver, netSyOut);
177
+ IERC20(SY).safeTransfer(market.treasury, netSyToReserve);
178
178
 
179
179
  _writeState(market);
180
180
 
181
181
  if (data.length > 0) {
182
- IPMarketSwapCallback(msg.sender).swapCallback(exactPtIn.neg(), netScyOut.Int(), data);
182
+ IPMarketSwapCallback(msg.sender).swapCallback(exactPtIn.neg(), netSyOut.Int(), data);
183
183
  }
184
184
 
185
185
  if (_selfBalance(PT) < market.totalPt.Uint())
186
186
  revert Errors.MarketInsufficientPtReceived(_selfBalance(PT), market.totalPt.Uint());
187
187
 
188
- emit Swap(receiver, exactPtIn.neg(), netScyOut.Int(), netScyToReserve);
188
+ emit Swap(receiver, exactPtIn.neg(), netSyOut.Int(), netSyToReserve);
189
189
  }
190
190
 
191
191
  /**
192
- * @notice Pendle Market allows swaps between PT & SCY it is holding. This function
193
- * aims to swap an exact amount of SCY to PT.
192
+ * @notice Pendle Market allows swaps between PT & SY it is holding. This function
193
+ * aims to swap an exact amount of SY to PT.
194
194
  * @dev steps working of this function
195
195
  - The exact outcome amount of PT will be transferred to receiver
196
196
  - Callback to msg.sender if data.length > 0
197
- - Ensure the calculated required amount of SCY is transferred to this address
197
+ - Ensure the calculated required amount of SY is transferred to this address
198
198
  * @param data bytes data to be sent in the callback
199
199
  */
200
- function swapScyForExactPt(
200
+ function swapSyForExactPt(
201
201
  address receiver,
202
202
  uint256 exactPtOut,
203
203
  bytes calldata data
204
- ) external nonReentrant notExpired returns (uint256 netScyIn, uint256 netScyToReserve) {
204
+ ) external nonReentrant notExpired returns (uint256 netSyIn, uint256 netSyToReserve) {
205
205
  MarketState memory market = readState();
206
206
 
207
- (netScyIn, netScyToReserve) = market.swapScyForExactPt(
207
+ (netSyIn, netSyToReserve) = market.swapSyForExactPt(
208
208
  YT.newIndex(),
209
209
  exactPtOut,
210
210
  block.timestamp
211
211
  );
212
212
 
213
213
  if (receiver != address(this)) IERC20(PT).safeTransfer(receiver, exactPtOut);
214
- IERC20(SCY).safeTransfer(market.treasury, netScyToReserve);
214
+ IERC20(SY).safeTransfer(market.treasury, netSyToReserve);
215
215
 
216
216
  _writeState(market);
217
217
 
218
218
  if (data.length > 0) {
219
- IPMarketSwapCallback(msg.sender).swapCallback(exactPtOut.Int(), netScyIn.neg(), data);
219
+ IPMarketSwapCallback(msg.sender).swapCallback(exactPtOut.Int(), netSyIn.neg(), data);
220
220
  }
221
221
 
222
- // have received enough SCY
223
- if (_selfBalance(SCY) < market.totalScy.Uint())
224
- revert Errors.MarketInsufficientScyReceived(_selfBalance(SCY), market.totalScy.Uint());
222
+ // have received enough SY
223
+ if (_selfBalance(SY) < market.totalSy.Uint())
224
+ revert Errors.MarketInsufficientSyReceived(_selfBalance(SY), market.totalSy.Uint());
225
225
 
226
- emit Swap(receiver, exactPtOut.Int(), netScyIn.neg(), netScyToReserve);
226
+ emit Swap(receiver, exactPtOut.Int(), netSyIn.neg(), netSyToReserve);
227
227
  }
228
228
 
229
229
  /// @notice force balances to match reserves
230
230
  function skim() external nonReentrant {
231
231
  MarketState memory market = readState();
232
232
  uint256 excessPt = _selfBalance(PT) - market.totalPt.Uint();
233
- uint256 excessScy = _selfBalance(SCY) - market.totalScy.Uint();
233
+ uint256 excessSy = _selfBalance(SY) - market.totalSy.Uint();
234
234
  IERC20(PT).safeTransfer(market.treasury, excessPt);
235
- IERC20(SCY).safeTransfer(market.treasury, excessScy);
235
+ IERC20(SY).safeTransfer(market.treasury, excessSy);
236
236
  }
237
237
 
238
238
  function redeemRewards(address user) external nonReentrant returns (uint256[] memory) {
@@ -280,7 +280,7 @@ contract PendleMarket is PendleERC20Permit, PendleGauge, IPMarket {
280
280
  */
281
281
  function readState() public view returns (MarketState memory market) {
282
282
  market.totalPt = _storage.totalPt;
283
- market.totalScy = _storage.totalScy;
283
+ market.totalSy = _storage.totalSy;
284
284
  market.totalLp = totalSupply().Int();
285
285
 
286
286
  (market.treasury, market.lnFeeRateRoot, market.reserveFeePercent) = IPMarketFactory(
@@ -297,7 +297,7 @@ contract PendleMarket is PendleERC20Permit, PendleGauge, IPMarket {
297
297
  function _writeState(MarketState memory market) internal {
298
298
  uint96 lastLnImpliedRate96 = market.lastLnImpliedRate.Uint96();
299
299
  int128 totalPt128 = market.totalPt.Int128();
300
- int128 totalScy128 = market.totalScy.Int128();
300
+ int128 totalSy128 = market.totalSy.Int128();
301
301
 
302
302
  (uint16 observationIndex, uint16 observationCardinality) = observations.write(
303
303
  _storage.observationIndex,
@@ -308,7 +308,7 @@ contract PendleMarket is PendleERC20Permit, PendleGauge, IPMarket {
308
308
  );
309
309
 
310
310
  _storage.totalPt = totalPt128;
311
- _storage.totalScy = totalScy128;
311
+ _storage.totalSy = totalSy128;
312
312
  _storage.lastLnImpliedRate = lastLnImpliedRate96;
313
313
  _storage.observationIndex = observationIndex;
314
314
  _storage.observationCardinality = observationCardinality;
@@ -324,12 +324,12 @@ contract PendleMarket is PendleERC20Permit, PendleGauge, IPMarket {
324
324
  external
325
325
  view
326
326
  returns (
327
- ISuperComposableYield _SCY,
327
+ IStandardizedYield _SY,
328
328
  IPPrincipalToken _PT,
329
329
  IPYieldToken _YT
330
330
  )
331
331
  {
332
- _SCY = SCY;
332
+ _SY = SY;
333
333
  _PT = PT;
334
334
  _YT = YT;
335
335
  }
@@ -72,7 +72,7 @@ contract PendleMarketFactory is BoringOwnableUpgradeable, IPMarketFactory {
72
72
  }
73
73
 
74
74
  /**
75
- * @notice Create a market between PT and its corresponding SCY
75
+ * @notice Create a market between PT and its corresponding SY
76
76
  * with scalar & anchor config. Anyone is allowed to create a market on their own.
77
77
  */
78
78
  function createNewMarket(
@@ -3,7 +3,7 @@ pragma solidity 0.8.17;
3
3
 
4
4
  import "./RewardManagerAbstract.sol";
5
5
 
6
- /// NOTE: This RewardManager is used with PendleMarket & SCY. For YT, it will use RewardManagerAbstract
6
+ /// NOTE: This RewardManager is used with PendleMarket & SY. For YT, it will use RewardManagerAbstract
7
7
  /// NOTE: RewardManager must not have duplicated rewardTokens
8
8
  abstract contract RewardManager is RewardManagerAbstract {
9
9
  using Math for uint256;