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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (296) hide show
  1. package/build/artifacts/contracts/LiquidityMining/CrossChainMsg/PendleMsgReceiveEndpointUpg.sol/PendleMsgReceiveEndpointUpg.dbg.json +1 -1
  2. package/build/artifacts/contracts/LiquidityMining/CrossChainMsg/PendleMsgReceiveEndpointUpg.sol/PendleMsgReceiveEndpointUpg.json +2 -2
  3. package/build/artifacts/contracts/LiquidityMining/CrossChainMsg/PendleMsgReceiverAppUpg.sol/PendleMsgReceiverAppUpg.dbg.json +1 -1
  4. package/build/artifacts/contracts/LiquidityMining/CrossChainMsg/PendleMsgSendEndpointUpg.sol/PendleMsgSendEndpointUpg.dbg.json +1 -1
  5. package/build/artifacts/contracts/LiquidityMining/CrossChainMsg/PendleMsgSendEndpointUpg.sol/PendleMsgSendEndpointUpg.json +2 -2
  6. package/build/artifacts/contracts/LiquidityMining/CrossChainMsg/PendleMsgSenderAppUpg.sol/PendleMsgSenderAppUpg.dbg.json +1 -1
  7. package/build/artifacts/contracts/LiquidityMining/FeeDistributor/EpochResultManager.sol/EpochResultManager.dbg.json +1 -1
  8. package/build/artifacts/contracts/LiquidityMining/FeeDistributor/PendleFeeDistributor.sol/PendleFeeDistributor.dbg.json +1 -1
  9. package/build/artifacts/contracts/LiquidityMining/FeeDistributor/PendleFeeDistributor.sol/PendleFeeDistributor.json +2 -2
  10. package/build/artifacts/contracts/LiquidityMining/FeeDistributor/PendleFeeDistributorFactory.sol/PendleFeeDistributorFactory.dbg.json +1 -1
  11. package/build/artifacts/contracts/LiquidityMining/FeeDistributor/PendleFeeDistributorFactory.sol/PendleFeeDistributorFactory.json +2 -2
  12. package/build/artifacts/contracts/LiquidityMining/GaugeController/PendleGaugeControllerBaseUpg.sol/PendleGaugeControllerBaseUpg.dbg.json +1 -1
  13. package/build/artifacts/contracts/LiquidityMining/GaugeController/PendleGaugeControllerBaseUpg.sol/PendleGaugeControllerBaseUpg.json +89 -0
  14. package/build/artifacts/contracts/LiquidityMining/GaugeController/PendleGaugeControllerMainchainUpg.sol/PendleGaugeControllerMainchainUpg.dbg.json +1 -1
  15. package/build/artifacts/contracts/LiquidityMining/GaugeController/PendleGaugeControllerMainchainUpg.sol/PendleGaugeControllerMainchainUpg.json +91 -2
  16. package/build/artifacts/contracts/LiquidityMining/GaugeController/PendleGaugeControllerSidechainUpg.sol/PendleGaugeControllerSidechainUpg.dbg.json +1 -1
  17. package/build/artifacts/contracts/LiquidityMining/GaugeController/PendleGaugeControllerSidechainUpg.sol/PendleGaugeControllerSidechainUpg.json +91 -2
  18. package/build/artifacts/contracts/LiquidityMining/VotingController/PendleVotingControllerUpg.sol/PendleVotingControllerUpg.dbg.json +1 -1
  19. package/build/artifacts/contracts/LiquidityMining/VotingController/PendleVotingControllerUpg.sol/PendleVotingControllerUpg.json +2 -2
  20. package/build/artifacts/contracts/LiquidityMining/VotingController/VotingControllerStorageUpg.sol/VotingControllerStorageUpg.dbg.json +1 -1
  21. package/build/artifacts/contracts/LiquidityMining/VotingEscrow/VotingEscrowPendleMainchain.sol/VotingEscrowPendleMainchain.dbg.json +1 -1
  22. package/build/artifacts/contracts/LiquidityMining/VotingEscrow/VotingEscrowPendleMainchain.sol/VotingEscrowPendleMainchain.json +2 -2
  23. package/build/artifacts/contracts/LiquidityMining/VotingEscrow/VotingEscrowPendleSidechain.sol/VotingEscrowPendleSidechain.dbg.json +1 -1
  24. package/build/artifacts/contracts/LiquidityMining/VotingEscrow/VotingEscrowPendleSidechain.sol/VotingEscrowPendleSidechain.json +2 -2
  25. package/build/artifacts/contracts/LiquidityMining/VotingEscrow/VotingEscrowTokenBase.sol/VotingEscrowTokenBase.dbg.json +1 -1
  26. package/build/artifacts/contracts/LiquidityMining/libraries/VeBalanceLib.sol/VeBalanceLib.dbg.json +1 -1
  27. package/build/artifacts/contracts/LiquidityMining/libraries/VeBalanceLib.sol/VeBalanceLib.json +2 -2
  28. package/build/artifacts/contracts/LiquidityMining/libraries/VeHistoryLib.sol/CheckpointHelper.dbg.json +1 -1
  29. package/build/artifacts/contracts/LiquidityMining/libraries/VeHistoryLib.sol/CheckpointHelper.json +2 -2
  30. package/build/artifacts/contracts/LiquidityMining/libraries/VeHistoryLib.sol/Checkpoints.dbg.json +1 -1
  31. package/build/artifacts/contracts/LiquidityMining/libraries/VeHistoryLib.sol/Checkpoints.json +2 -2
  32. package/build/artifacts/contracts/core/Market/MarketMathCore.sol/MarketMathCore.dbg.json +1 -1
  33. package/build/artifacts/contracts/core/Market/MarketMathCore.sol/MarketMathCore.json +2 -2
  34. package/build/artifacts/contracts/core/Market/OracleLib.sol/OracleLib.dbg.json +1 -1
  35. package/build/artifacts/contracts/core/Market/OracleLib.sol/OracleLib.json +2 -2
  36. package/build/artifacts/contracts/core/Market/PendleGauge.sol/PendleGauge.dbg.json +1 -1
  37. package/build/artifacts/contracts/core/Market/PendleMarket.sol/PendleMarket.dbg.json +1 -1
  38. package/build/artifacts/contracts/core/Market/PendleMarket.sol/PendleMarket.json +28 -28
  39. package/build/artifacts/contracts/core/Market/PendleMarketFactory.sol/PendleMarketFactory.dbg.json +1 -1
  40. package/build/artifacts/contracts/core/Market/PendleMarketFactory.sol/PendleMarketFactory.json +2 -2
  41. package/build/artifacts/contracts/core/RewardManager/RewardManager.sol/RewardManager.dbg.json +1 -1
  42. package/build/artifacts/contracts/core/RewardManager/RewardManagerAbstract.sol/RewardManagerAbstract.dbg.json +1 -1
  43. package/build/artifacts/contracts/core/StandardizedYield/PYIndex.sol/PYIndexLib.dbg.json +4 -0
  44. package/build/artifacts/contracts/core/{SuperComposableYield → StandardizedYield}/PYIndex.sol/PYIndexLib.json +3 -3
  45. package/build/artifacts/contracts/core/StandardizedYield/SYBase.sol/SYBase.dbg.json +4 -0
  46. package/build/artifacts/contracts/core/{SuperComposableYield/SCYBase.sol/SCYBase.json → StandardizedYield/SYBase.sol/SYBase.json} +11 -11
  47. package/build/artifacts/contracts/core/StandardizedYield/SYBaseWithRewards.sol/SYBaseWithRewards.dbg.json +4 -0
  48. package/build/artifacts/contracts/core/{SuperComposableYield/SCYBaseWithRewards.sol/SCYBaseWithRewards.json → StandardizedYield/SYBaseWithRewards.sol/SYBaseWithRewards.json} +11 -11
  49. package/build/artifacts/contracts/core/StandardizedYield/SYUtils.sol/SYUtils.dbg.json +4 -0
  50. package/build/artifacts/contracts/core/{SuperComposableYield/SCYUtils.sol/SCYUtils.json → StandardizedYield/SYUtils.sol/SYUtils.json} +4 -4
  51. package/build/artifacts/contracts/core/StandardizedYield/implementations/BenQi/PendleQiTokenHelper.sol/PendleQiTokenHelper.dbg.json +4 -0
  52. package/build/artifacts/contracts/core/{SuperComposableYield → StandardizedYield}/implementations/BenQi/PendleQiTokenHelper.sol/PendleQiTokenHelper.json +3 -3
  53. package/build/artifacts/contracts/core/StandardizedYield/implementations/BenQi/PendleQiTokenSY.sol/PendleQiTokenSY.dbg.json +4 -0
  54. package/build/artifacts/contracts/core/{SuperComposableYield/implementations/BenQi/PendleQiTokenSCY.sol/PendleQiTokenSCY.json → StandardizedYield/implementations/BenQi/PendleQiTokenSY.sol/PendleQiTokenSY.json} +17 -17
  55. package/build/artifacts/contracts/core/StandardizedYield/implementations/Convex/ConvexCurveLP/Pendle3CrvAndTokenSY.sol/Pendle3CrvAndTokenSY.dbg.json +4 -0
  56. package/build/artifacts/contracts/core/StandardizedYield/implementations/Convex/ConvexCurveLP/Pendle3CrvAndTokenSY.sol/Pendle3CrvAndTokenSY.json +1018 -0
  57. package/build/artifacts/contracts/core/StandardizedYield/implementations/Convex/ConvexCurveLP/PendleConvexLPSY.sol/PendleConvexLPSY.dbg.json +4 -0
  58. package/build/artifacts/contracts/core/{SuperComposableYield/implementations/Convex/ConvexCurveLP/PendleConvexCurveLPSCY.sol/PendleConvexCurveLPSCY.json → StandardizedYield/implementations/Convex/ConvexCurveLP/PendleConvexLPSY.sol/PendleConvexLPSY.json} +47 -47
  59. package/build/artifacts/contracts/core/StandardizedYield/implementations/Convex/Pendle3CrvHelper.sol/Pendle3CrvHelper.dbg.json +4 -0
  60. package/build/artifacts/contracts/core/{SuperComposableYield → StandardizedYield}/implementations/Convex/Pendle3CrvHelper.sol/Pendle3CrvHelper.json +5 -5
  61. package/build/artifacts/contracts/core/StandardizedYield/implementations/PendleWstEthSY.sol/PendleWstEthSY.dbg.json +4 -0
  62. package/build/artifacts/contracts/core/StandardizedYield/implementations/PendleWstEthSY.sol/PendleWstEthSY.json +851 -0
  63. package/build/artifacts/contracts/core/YieldContracts/InterestManagerYT.sol/InterestManagerYT.dbg.json +1 -1
  64. package/build/artifacts/contracts/core/YieldContracts/PendlePrincipalToken.sol/PendlePrincipalToken.dbg.json +1 -1
  65. package/build/artifacts/contracts/core/YieldContracts/PendlePrincipalToken.sol/PendlePrincipalToken.json +4 -4
  66. package/build/artifacts/contracts/core/YieldContracts/PendleYieldContractFactory.sol/PendleYieldContractFactory.dbg.json +1 -1
  67. package/build/artifacts/contracts/core/YieldContracts/PendleYieldContractFactory.sol/PendleYieldContractFactory.json +4 -4
  68. package/build/artifacts/contracts/core/YieldContracts/PendleYieldToken.sol/PendleYieldToken.dbg.json +1 -1
  69. package/build/artifacts/contracts/core/YieldContracts/PendleYieldToken.sol/PendleYieldToken.json +24 -24
  70. package/build/artifacts/contracts/core/erc20/PendleERC20Permit.sol/PendleERC20Permit.dbg.json +1 -1
  71. package/build/artifacts/contracts/core/erc20/PendleERC20Permit.sol/PendleERC20Permit.json +2 -2
  72. package/build/artifacts/contracts/core/libraries/Errors.sol/Errors.dbg.json +1 -1
  73. package/build/artifacts/contracts/core/libraries/Errors.sol/Errors.json +28 -28
  74. package/build/artifacts/contracts/core/libraries/TokenHelper.sol/TokenHelper.dbg.json +1 -1
  75. package/build/artifacts/contracts/interfaces/Curve/ICrvPool.sol/ICrvPool.dbg.json +1 -1
  76. package/build/artifacts/contracts/interfaces/Curve/ICrvPool.sol/ICrvPool.json +19 -0
  77. package/build/artifacts/contracts/interfaces/IPActionAddRemoveLiq.sol/IPActionAddRemoveLiq.dbg.json +1 -1
  78. package/build/artifacts/contracts/interfaces/IPActionAddRemoveLiq.sol/IPActionAddRemoveLiq.json +30 -30
  79. package/build/artifacts/contracts/interfaces/IPActionMintRedeem.sol/IPActionMintRedeem.dbg.json +1 -1
  80. package/build/artifacts/contracts/interfaces/IPActionMintRedeem.sol/IPActionMintRedeem.json +34 -34
  81. package/build/artifacts/contracts/interfaces/IPActionSwapPT.sol/IPActionSwapPT.dbg.json +1 -1
  82. package/build/artifacts/contracts/interfaces/IPActionSwapPT.sol/IPActionSwapPT.json +20 -20
  83. package/build/artifacts/contracts/interfaces/IPActionSwapPTYT.sol/IPActionSwapPTYT.dbg.json +1 -1
  84. package/build/artifacts/contracts/interfaces/IPActionSwapPTYT.sol/IPActionSwapPTYT.json +2 -2
  85. package/build/artifacts/contracts/interfaces/IPActionSwapYT.sol/IPActionSwapYT.dbg.json +1 -1
  86. package/build/artifacts/contracts/interfaces/IPActionSwapYT.sol/IPActionSwapYT.json +20 -20
  87. package/build/artifacts/contracts/interfaces/IPAllAction.sol/IPAllAction.dbg.json +1 -1
  88. package/build/artifacts/contracts/interfaces/IPAllAction.sol/IPAllAction.json +106 -106
  89. package/build/artifacts/contracts/interfaces/IPMarket.sol/IPMarket.dbg.json +1 -1
  90. package/build/artifacts/contracts/interfaces/IPMarket.sol/IPMarket.json +18 -18
  91. package/build/artifacts/contracts/interfaces/IPMarketSwapCallback.sol/IPMarketSwapCallback.dbg.json +1 -1
  92. package/build/artifacts/contracts/interfaces/IPMarketSwapCallback.sol/IPMarketSwapCallback.json +1 -1
  93. package/build/artifacts/contracts/interfaces/IPPrincipalToken.sol/IPPrincipalToken.dbg.json +1 -1
  94. package/build/artifacts/contracts/interfaces/IPPrincipalToken.sol/IPPrincipalToken.json +1 -1
  95. package/build/artifacts/contracts/interfaces/IPVotingController.sol/IPVotingController.dbg.json +1 -1
  96. package/build/artifacts/contracts/interfaces/IPVotingEscrowMainchain.sol/IPVotingEscrowMainchain.dbg.json +1 -1
  97. package/build/artifacts/contracts/interfaces/IPYieldContractFactory.sol/IPYieldContractFactory.dbg.json +1 -1
  98. package/build/artifacts/contracts/interfaces/IPYieldContractFactory.sol/IPYieldContractFactory.json +3 -3
  99. package/build/artifacts/contracts/interfaces/IPYieldToken.sol/IPYieldToken.dbg.json +1 -1
  100. package/build/artifacts/contracts/interfaces/IPYieldToken.sol/IPYieldToken.json +6 -6
  101. package/build/artifacts/contracts/interfaces/IStandardizedYield.sol/IStandardizedYield.dbg.json +4 -0
  102. package/build/artifacts/contracts/interfaces/{ISuperComposableYield.sol/ISuperComposableYield.json → IStandardizedYield.sol/IStandardizedYield.json} +5 -5
  103. package/build/artifacts/contracts/offchain-helpers/MarketMathStatic.sol/MarketMathStatic.dbg.json +1 -1
  104. package/build/artifacts/contracts/offchain-helpers/MarketMathStatic.sol/MarketMathStatic.json +7 -7
  105. package/build/artifacts/contracts/offchain-helpers/RouterStatic.sol/RouterStatic.dbg.json +1 -1
  106. package/build/artifacts/contracts/offchain-helpers/RouterStatic.sol/RouterStatic.json +116 -116
  107. package/build/artifacts/contracts/router/ActionAddRemoveLiq.sol/ActionAddRemoveLiq.dbg.json +1 -1
  108. package/build/artifacts/contracts/router/ActionAddRemoveLiq.sol/ActionAddRemoveLiq.json +35 -35
  109. package/build/artifacts/contracts/router/ActionCallback.sol/ActionCallback.dbg.json +1 -1
  110. package/build/artifacts/contracts/router/ActionCallback.sol/ActionCallback.json +12 -12
  111. package/build/artifacts/contracts/router/ActionMintRedeem.sol/ActionMintRedeem.dbg.json +1 -1
  112. package/build/artifacts/contracts/router/ActionMintRedeem.sol/ActionMintRedeem.json +41 -41
  113. package/build/artifacts/contracts/router/ActionMisc.sol/ActionMisc.dbg.json +1 -1
  114. package/build/artifacts/contracts/router/ActionMisc.sol/ActionMisc.json +2 -2
  115. package/build/artifacts/contracts/router/ActionSwapPT.sol/ActionSwapPT.dbg.json +1 -1
  116. package/build/artifacts/contracts/router/ActionSwapPT.sol/ActionSwapPT.json +28 -28
  117. package/build/artifacts/contracts/router/ActionSwapPTYT.sol/ActionSwapPTYT.dbg.json +1 -1
  118. package/build/artifacts/contracts/router/ActionSwapPTYT.sol/ActionSwapPTYT.json +4 -4
  119. package/build/artifacts/contracts/router/ActionSwapYT.sol/ActionSwapYT.dbg.json +1 -1
  120. package/build/artifacts/contracts/router/ActionSwapYT.sol/ActionSwapYT.json +22 -22
  121. package/build/artifacts/contracts/router/PendleRouter.sol/PendleRouter.dbg.json +1 -1
  122. package/build/artifacts/contracts/router/PendleRouter.sol/PendleRouter.json +2 -2
  123. package/build/artifacts/contracts/router/base/ActionBaseMintRedeem.sol/ActionBaseMintRedeem.dbg.json +1 -1
  124. package/build/artifacts/contracts/router/base/CallbackHelper.sol/CallbackHelper.dbg.json +1 -1
  125. package/build/artifacts/contracts/router/base/MarketApproxLib.sol/MarketApproxPtInLib.dbg.json +1 -1
  126. package/build/artifacts/contracts/router/base/MarketApproxLib.sol/MarketApproxPtInLib.json +2 -2
  127. package/build/artifacts/contracts/router/base/MarketApproxLib.sol/MarketApproxPtOutLib.dbg.json +1 -1
  128. package/build/artifacts/contracts/router/base/MarketApproxLib.sol/MarketApproxPtOutLib.json +2 -2
  129. package/build/artifacts/contracts/router/kyberswap/KyberSwapHelper.sol/KyberSwapHelper.dbg.json +1 -1
  130. package/contracts/LiquidityMining/GaugeController/PendleGaugeControllerBaseUpg.sol +8 -1
  131. package/contracts/core/Market/MarketMathCore.sol +51 -54
  132. package/contracts/core/Market/PendleGauge.sol +8 -8
  133. package/contracts/core/Market/PendleMarket.sol +49 -49
  134. package/contracts/core/Market/PendleMarketFactory.sol +1 -1
  135. package/contracts/core/RewardManager/RewardManager.sol +1 -1
  136. package/contracts/core/{SuperComposableYield → StandardizedYield}/PYIndex.sol +16 -16
  137. package/contracts/core/{SuperComposableYield/SCYBase.sol → StandardizedYield/SYBase.sol} +16 -21
  138. package/contracts/core/{SuperComposableYield/SCYBaseWithRewards.sol → StandardizedYield/SYBaseWithRewards.sol} +9 -12
  139. package/contracts/core/StandardizedYield/SYUtils.sol +26 -0
  140. package/contracts/core/{SuperComposableYield → StandardizedYield}/implementations/BenQi/PendleQiTokenHelper.sol +1 -1
  141. package/contracts/core/{SuperComposableYield/implementations/BenQi/PendleQiTokenSCY.sol → StandardizedYield/implementations/BenQi/PendleQiTokenSY.sol} +10 -10
  142. package/contracts/core/StandardizedYield/implementations/Convex/ConvexCurveLP/Pendle3CrvAndTokenSY.sol +167 -0
  143. package/contracts/core/{SuperComposableYield/implementations/Convex/ConvexCurveLP/PendleConvexCurveLPSCY.sol → StandardizedYield/implementations/Convex/ConvexCurveLP/PendleConvexLPSY.sol} +51 -70
  144. package/contracts/core/{SuperComposableYield → StandardizedYield}/implementations/Convex/Pendle3CrvHelper.sol +7 -7
  145. package/contracts/core/{SuperComposableYield/implementations/PendleWstEthSCY.sol → StandardizedYield/implementations/PendleWstEthSY.sol} +13 -10
  146. package/contracts/core/YieldContracts/InterestManagerYT.sol +7 -7
  147. package/contracts/core/YieldContracts/PendlePrincipalToken.sol +3 -3
  148. package/contracts/core/YieldContracts/PendleYieldContractFactory.sol +15 -15
  149. package/contracts/core/YieldContracts/PendleYieldToken.sol +72 -72
  150. package/contracts/core/erc20/PendleERC20Permit.sol +1 -1
  151. package/contracts/core/libraries/Errors.sol +22 -22
  152. package/contracts/core/libraries/TokenHelper.sol +0 -33
  153. package/contracts/interfaces/Curve/ICrvPool.sol +2 -0
  154. package/contracts/interfaces/IPActionAddRemoveLiq.sol +27 -27
  155. package/contracts/interfaces/IPActionMintRedeem.sol +30 -30
  156. package/contracts/interfaces/IPActionSwapPT.sol +16 -16
  157. package/contracts/interfaces/IPActionSwapPTYT.sol +2 -2
  158. package/contracts/interfaces/IPActionSwapYT.sol +16 -16
  159. package/contracts/interfaces/IPMarket.sol +14 -19
  160. package/contracts/interfaces/IPMarketSwapCallback.sol +1 -1
  161. package/contracts/interfaces/IPPrincipalToken.sol +1 -1
  162. package/contracts/interfaces/IPYieldContractFactory.sol +3 -3
  163. package/contracts/interfaces/IPYieldToken.sol +7 -9
  164. package/contracts/interfaces/{ISuperComposableYield.sol → IStandardizedYield.sol} +6 -6
  165. package/contracts/offchain-helpers/MarketMathStatic.sol +116 -131
  166. package/contracts/offchain-helpers/RouterStatic.sol +80 -93
  167. package/contracts/router/ActionAddRemoveLiq.sol +99 -111
  168. package/contracts/router/ActionCallback.sol +46 -46
  169. package/contracts/router/ActionMintRedeem.sol +58 -58
  170. package/contracts/router/ActionSwapPT.sol +61 -69
  171. package/contracts/router/ActionSwapPTYT.sol +7 -7
  172. package/contracts/router/ActionSwapYT.sol +72 -79
  173. package/contracts/router/PendleRouter.sol +16 -16
  174. package/contracts/router/base/ActionBaseMintRedeem.sol +43 -43
  175. package/contracts/router/base/CallbackHelper.sol +20 -20
  176. package/contracts/router/base/MarketApproxLib.sol +166 -143
  177. package/contracts/router/kyberswap/KyberSwapHelper.sol +2 -2
  178. package/deployments/1-core.json +16 -0
  179. package/deployments/1-markets/STETH_MARCH_30.json +8 -0
  180. package/package.json +3 -3
  181. package/typechain-types/ActionAddRemoveLiq.ts +127 -129
  182. package/typechain-types/ActionCallback.ts +5 -5
  183. package/typechain-types/ActionMintRedeem.ts +139 -141
  184. package/typechain-types/ActionSwapPT.ts +73 -73
  185. package/typechain-types/ActionSwapPTYT.ts +2 -2
  186. package/typechain-types/ActionSwapYT.ts +73 -73
  187. package/typechain-types/ICrvPool.ts +16 -0
  188. package/typechain-types/IPActionAddRemoveLiq.ts +127 -129
  189. package/typechain-types/IPActionMintRedeem.ts +139 -141
  190. package/typechain-types/IPActionSwapPT.ts +73 -73
  191. package/typechain-types/IPActionSwapPTYT.ts +2 -2
  192. package/typechain-types/IPActionSwapYT.ts +73 -73
  193. package/typechain-types/IPAllAction.ts +402 -406
  194. package/typechain-types/IPMarket.ts +51 -54
  195. package/typechain-types/IPMarketSwapCallback.ts +5 -5
  196. package/typechain-types/IPPrincipalToken.ts +8 -8
  197. package/typechain-types/IPYieldContractFactory.ts +13 -13
  198. package/typechain-types/IPYieldToken.ts +17 -17
  199. package/typechain-types/IStandardizedYield.ts +895 -0
  200. package/typechain-types/MarketMathStatic.ts +27 -27
  201. package/typechain-types/Pendle3CrvAndTokenSY.ts +1243 -0
  202. package/typechain-types/Pendle3CrvHelper.ts +13 -13
  203. package/typechain-types/PendleConvexLPSY.ts +1189 -0
  204. package/typechain-types/PendleGaugeControllerBaseUpg.ts +125 -0
  205. package/typechain-types/PendleGaugeControllerMainchainUpg.ts +125 -0
  206. package/typechain-types/PendleGaugeControllerSidechainUpg.ts +124 -0
  207. package/typechain-types/PendleMarket.ts +54 -57
  208. package/typechain-types/PendlePrincipalToken.ts +8 -8
  209. package/typechain-types/PendleQiTokenSY.ts +1166 -0
  210. package/typechain-types/PendleWstEthSY.ts +1038 -0
  211. package/typechain-types/PendleYieldContractFactory.ts +8 -8
  212. package/typechain-types/PendleYieldToken.ts +41 -44
  213. package/typechain-types/RouterStatic.ts +196 -196
  214. package/typechain-types/SYBase.ts +1001 -0
  215. package/typechain-types/SYBaseWithRewards.ts +1094 -0
  216. package/typechain-types/factories/ActionAddRemoveLiq__factory.ts +34 -34
  217. package/typechain-types/factories/ActionCallback__factory.ts +11 -11
  218. package/typechain-types/factories/ActionMintRedeem__factory.ts +38 -38
  219. package/typechain-types/factories/ActionMisc__factory.ts +1 -1
  220. package/typechain-types/factories/ActionSwapPTYT__factory.ts +3 -3
  221. package/typechain-types/factories/ActionSwapPT__factory.ts +27 -27
  222. package/typechain-types/factories/ActionSwapYT__factory.ts +21 -21
  223. package/typechain-types/factories/Errors__factory.ts +27 -27
  224. package/typechain-types/factories/ICrvPool__factory.ts +19 -0
  225. package/typechain-types/factories/IPActionAddRemoveLiq__factory.ts +30 -30
  226. package/typechain-types/factories/IPActionMintRedeem__factory.ts +34 -34
  227. package/typechain-types/factories/IPActionSwapPTYT__factory.ts +2 -2
  228. package/typechain-types/factories/IPActionSwapPT__factory.ts +20 -20
  229. package/typechain-types/factories/IPActionSwapYT__factory.ts +20 -20
  230. package/typechain-types/factories/IPAllAction__factory.ts +106 -106
  231. package/typechain-types/factories/IPMarketSwapCallback__factory.ts +1 -1
  232. package/typechain-types/factories/IPMarket__factory.ts +18 -18
  233. package/typechain-types/factories/IPPrincipalToken__factory.ts +1 -1
  234. package/typechain-types/factories/IPYieldContractFactory__factory.ts +3 -3
  235. package/typechain-types/factories/IPYieldToken__factory.ts +6 -6
  236. package/typechain-types/factories/IStandardizedYield__factory.ts +658 -0
  237. package/typechain-types/factories/MarketMathStatic__factory.ts +6 -6
  238. package/typechain-types/factories/OracleLib__factory.ts +1 -1
  239. package/typechain-types/factories/Pendle3CrvAndTokenSY__factory.ts +1106 -0
  240. package/typechain-types/factories/Pendle3CrvHelper__factory.ts +3 -3
  241. package/typechain-types/factories/PendleConvexLPSY__factory.ts +963 -0
  242. package/typechain-types/factories/PendleERC20Permit__factory.ts +1 -1
  243. package/typechain-types/factories/PendleFeeDistributorFactory__factory.ts +1 -1
  244. package/typechain-types/factories/PendleFeeDistributor__factory.ts +1 -1
  245. package/typechain-types/factories/PendleGaugeControllerBaseUpg__factory.ts +89 -0
  246. package/typechain-types/factories/PendleGaugeControllerMainchainUpg__factory.ts +90 -1
  247. package/typechain-types/factories/PendleGaugeControllerSidechainUpg__factory.ts +90 -1
  248. package/typechain-types/factories/PendleMarketFactory__factory.ts +1 -1
  249. package/typechain-types/factories/PendleMarket__factory.ts +21 -21
  250. package/typechain-types/factories/PendleMsgReceiveEndpointUpg__factory.ts +1 -1
  251. package/typechain-types/factories/PendleMsgSendEndpointUpg__factory.ts +1 -1
  252. package/typechain-types/factories/PendlePrincipalToken__factory.ts +7 -7
  253. package/typechain-types/factories/PendleQiTokenHelper__factory.ts +1 -1
  254. package/typechain-types/factories/PendleQiTokenSY__factory.ts +1095 -0
  255. package/typechain-types/factories/PendleRouter__factory.ts +1 -1
  256. package/typechain-types/factories/PendleVotingControllerUpg__factory.ts +1 -1
  257. package/typechain-types/factories/PendleWstEthSY__factory.ts +924 -0
  258. package/typechain-types/factories/PendleYieldContractFactory__factory.ts +3 -3
  259. package/typechain-types/factories/PendleYieldToken__factory.ts +27 -27
  260. package/typechain-types/factories/RouterStatic__factory.ts +57 -57
  261. package/typechain-types/factories/SYBaseWithRewards__factory.ts +867 -0
  262. package/typechain-types/factories/SYBase__factory.ts +795 -0
  263. package/typechain-types/factories/VotingEscrowPendleMainchain__factory.ts +1 -1
  264. package/typechain-types/factories/VotingEscrowPendleSidechain__factory.ts +1 -1
  265. package/typechain-types/hardhat.d.ts +33 -51
  266. package/typechain-types/index.ts +14 -18
  267. package/build/artifacts/contracts/core/SuperComposableYield/PYIndex.sol/PYIndexLib.dbg.json +0 -4
  268. package/build/artifacts/contracts/core/SuperComposableYield/SCYBase.sol/SCYBase.dbg.json +0 -4
  269. package/build/artifacts/contracts/core/SuperComposableYield/SCYBaseWithRewards.sol/SCYBaseWithRewards.dbg.json +0 -4
  270. package/build/artifacts/contracts/core/SuperComposableYield/SCYUtils.sol/SCYUtils.dbg.json +0 -4
  271. package/build/artifacts/contracts/core/SuperComposableYield/implementations/BenQi/PendleQiTokenHelper.sol/PendleQiTokenHelper.dbg.json +0 -4
  272. package/build/artifacts/contracts/core/SuperComposableYield/implementations/BenQi/PendleQiTokenSCY.sol/PendleQiTokenSCY.dbg.json +0 -4
  273. package/build/artifacts/contracts/core/SuperComposableYield/implementations/Convex/ConvexCurveLP/Pendle3CrvAndTokenSCY.sol/Pendle3CrvAndTokenSCY.dbg.json +0 -4
  274. package/build/artifacts/contracts/core/SuperComposableYield/implementations/Convex/ConvexCurveLP/Pendle3CrvAndTokenSCY.sol/Pendle3CrvAndTokenSCY.json +0 -1030
  275. package/build/artifacts/contracts/core/SuperComposableYield/implementations/Convex/ConvexCurveLP/PendleConvexCurveLP2PoolSCY.sol/PendleConvexCurveLP2PoolSCY.dbg.json +0 -4
  276. package/build/artifacts/contracts/core/SuperComposableYield/implementations/Convex/ConvexCurveLP/PendleConvexCurveLP2PoolSCY.sol/PendleConvexCurveLP2PoolSCY.json +0 -1025
  277. package/build/artifacts/contracts/core/SuperComposableYield/implementations/Convex/ConvexCurveLP/PendleConvexCurveLPSCY.sol/PendleConvexCurveLPSCY.dbg.json +0 -4
  278. package/build/artifacts/contracts/core/SuperComposableYield/implementations/Convex/Pendle3CrvHelper.sol/Pendle3CrvHelper.dbg.json +0 -4
  279. package/build/artifacts/contracts/core/SuperComposableYield/implementations/PendleWstEthSCY.sol/PendleWstEthSCY.dbg.json +0 -4
  280. package/build/artifacts/contracts/core/SuperComposableYield/implementations/PendleWstEthSCY.sol/PendleWstEthSCY.json +0 -851
  281. package/build/artifacts/contracts/interfaces/ISuperComposableYield.sol/ISuperComposableYield.dbg.json +0 -4
  282. package/build/artifacts/contracts/offchain-helpers/ImplicitSwapfeeContract.sol/ImplicitSwapfeeContract.dbg.json +0 -4
  283. package/build/artifacts/contracts/offchain-helpers/ImplicitSwapfeeContract.sol/ImplicitSwapfeeContract.json +0 -190
  284. package/contracts/core/SuperComposableYield/SCYUtils.sol +0 -34
  285. package/contracts/core/SuperComposableYield/implementations/Convex/ConvexCurveLP/Pendle3CrvAndTokenSCY.sol +0 -135
  286. package/contracts/core/SuperComposableYield/implementations/Convex/ConvexCurveLP/PendleConvexCurveLP2PoolSCY.sol +0 -96
  287. package/contracts/deployments/43113-core.json +0 -16
  288. package/contracts/deployments/43113-helper.json +0 -3
  289. package/contracts/deployments/43113-markets/benqi-market-QI-USDC-FEB-2ND.json +0 -8
  290. package/contracts/deployments/43113-markets/benqi-market-QI-WETH-DEC-1ST.json +0 -8
  291. package/contracts/deployments/43113-testenv.json +0 -22
  292. package/contracts/deployments/80001-core.json +0 -15
  293. package/contracts/deployments/80001-markets/benqi-market-QI-USDC-FEB-2ND.json +0 -8
  294. package/contracts/deployments/80001-markets/benqi-market-QI-WETH-DEC-1ST.json +0 -8
  295. package/contracts/deployments/80001-testenv.json +0 -22
  296. package/contracts/offchain-helpers/ImplicitSwapfeeContract.sol +0 -26
@@ -3,14 +3,14 @@ pragma solidity 0.8.17;
3
3
 
4
4
  import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
5
5
 
6
- import "../../interfaces/ISuperComposableYield.sol";
6
+ import "../../interfaces/IStandardizedYield.sol";
7
7
  import "../../interfaces/IPYieldToken.sol";
8
8
  import "../../interfaces/IPPrincipalToken.sol";
9
9
 
10
10
  import "../libraries/math/Math.sol";
11
11
  import "../libraries/ArrayLib.sol";
12
12
  import "../../interfaces/IPYieldContractFactory.sol";
13
- import "../SuperComposableYield/SCYUtils.sol";
13
+ import "../StandardizedYield/SYUtils.sol";
14
14
  import "../libraries/Errors.sol";
15
15
  import "../libraries/MiniHelpers.sol";
16
16
 
@@ -35,17 +35,17 @@ contract PendleYieldToken is
35
35
 
36
36
  struct PostExpiryData {
37
37
  uint128 firstPYIndex;
38
- uint128 totalScyInterestForTreasury;
38
+ uint128 totalSyInterestForTreasury;
39
39
  mapping(address => uint256) firstRewardIndex;
40
40
  mapping(address => uint256) userRewardOwed;
41
41
  }
42
42
 
43
- address public immutable SCY;
43
+ address public immutable SY;
44
44
  address public immutable PT;
45
45
  address public immutable factory;
46
46
  uint256 public immutable expiry;
47
47
 
48
- uint128 public scyReserve;
48
+ uint128 public syReserve;
49
49
  uint128 internal _pyIndexStored;
50
50
 
51
51
  PostExpiryData public postExpiry;
@@ -53,7 +53,7 @@ contract PendleYieldToken is
53
53
  modifier updateData() {
54
54
  if (isExpired()) _setPostExpiryData();
55
55
  _;
56
- _updateScyReserve();
56
+ _updateSyReserve();
57
57
  }
58
58
 
59
59
  modifier notExpired() {
@@ -62,20 +62,20 @@ contract PendleYieldToken is
62
62
  }
63
63
 
64
64
  constructor(
65
- address _SCY,
65
+ address _SY,
66
66
  address _PT,
67
67
  string memory _name,
68
68
  string memory _symbol,
69
69
  uint8 __decimals,
70
70
  uint256 _expiry
71
71
  ) PendleERC20Permit(_name, _symbol, __decimals) {
72
- SCY = _SCY;
72
+ SY = _SY;
73
73
  PT = _PT;
74
74
  expiry = _expiry;
75
75
  factory = msg.sender;
76
76
  }
77
77
 
78
- /// @notice Tokenize SCY into PT + YT of equal qty. Every unit of underlying of SCY will create 1 PT + 1 YT
78
+ /// @notice Tokenize SY into PT + YT of equal qty. Every unit of underlying of SY will create 1 PT + 1 YT
79
79
  function mintPY(address receiverPT, address receiverYT)
80
80
  external
81
81
  nonReentrant
@@ -85,52 +85,52 @@ contract PendleYieldToken is
85
85
  {
86
86
  address[] memory receiverPTs = new address[](1);
87
87
  address[] memory receiverYTs = new address[](1);
88
- uint256[] memory amountScyToMints = new uint256[](1);
88
+ uint256[] memory amountSyToMints = new uint256[](1);
89
89
 
90
- (receiverPTs[0], receiverYTs[0], amountScyToMints[0]) = (
90
+ (receiverPTs[0], receiverYTs[0], amountSyToMints[0]) = (
91
91
  receiverPT,
92
92
  receiverYT,
93
- _getFloatingScyAmount()
93
+ _getFloatingSyAmount()
94
94
  );
95
95
 
96
- uint256[] memory amountPYOuts = _mintPY(receiverPTs, receiverYTs, amountScyToMints);
96
+ uint256[] memory amountPYOuts = _mintPY(receiverPTs, receiverYTs, amountSyToMints);
97
97
  amountPYOut = amountPYOuts[0];
98
98
  }
99
99
 
100
- /// @notice Tokenize SCY into PT + YT of equal qty. Every unit of underlying of SCY will create 1 PT + 1 YT
100
+ /// @notice Tokenize SY into PT + YT of equal qty. Every unit of underlying of SY will create 1 PT + 1 YT
101
101
  function mintPYMulti(
102
102
  address[] calldata receiverPTs,
103
103
  address[] calldata receiverYTs,
104
- uint256[] calldata amountScyToMints
104
+ uint256[] calldata amountSyToMints
105
105
  ) external nonReentrant notExpired updateData returns (uint256[] memory amountPYOuts) {
106
106
  uint256 length = receiverPTs.length;
107
107
 
108
- if (receiverYTs.length != length && amountScyToMints.length == length)
109
- revert Errors.ArrayLengthMismatch();
110
108
  if (length == 0) revert Errors.ArrayEmpty();
109
+ if (receiverYTs.length != length || amountSyToMints.length != length)
110
+ revert Errors.ArrayLengthMismatch();
111
111
 
112
- uint256 totalScyToMint = amountScyToMints.sum();
113
- if (totalScyToMint > _getFloatingScyAmount())
114
- revert Errors.YieldContractInsufficientScy(totalScyToMint, _getFloatingScyAmount());
112
+ uint256 totalSyToMint = amountSyToMints.sum();
113
+ if (totalSyToMint > _getFloatingSyAmount())
114
+ revert Errors.YieldContractInsufficientSy(totalSyToMint, _getFloatingSyAmount());
115
115
 
116
- amountPYOuts = _mintPY(receiverPTs, receiverYTs, amountScyToMints);
116
+ amountPYOuts = _mintPY(receiverPTs, receiverYTs, amountSyToMints);
117
117
  }
118
118
 
119
- /// @dev this function converts PY tokens into scy, but interests & rewards are not redeemed at the same time
119
+ /// @dev this function converts PY tokens into sy, but interests & rewards are not redeemed at the same time
120
120
  function redeemPY(address receiver)
121
121
  external
122
122
  nonReentrant
123
123
  updateData
124
- returns (uint256 amountScyOut)
124
+ returns (uint256 amountSyOut)
125
125
  {
126
126
  address[] memory receivers = new address[](1);
127
127
  uint256[] memory amounts = new uint256[](1);
128
128
  (receivers[0], amounts[0]) = (receiver, _getAmountPYToRedeem());
129
129
 
130
- uint256[] memory amountScyOuts;
131
- amountScyOuts = _redeemPY(receivers, amounts);
130
+ uint256[] memory amountSyOuts;
131
+ amountSyOuts = _redeemPY(receivers, amounts);
132
132
 
133
- amountScyOut = amountScyOuts[0];
133
+ amountSyOut = amountSyOuts[0];
134
134
  }
135
135
 
136
136
  /// @dev this function limit how much each receiver will receive. For example, if the totalOut is 100,
@@ -140,16 +140,16 @@ contract PendleYieldToken is
140
140
  external
141
141
  nonReentrant
142
142
  updateData
143
- returns (uint256[] memory amountScyOuts)
143
+ returns (uint256[] memory amountSyOuts)
144
144
  {
145
145
  if (receivers.length != amountPYToRedeems.length) revert Errors.ArrayLengthMismatch();
146
146
  if (receivers.length == 0) revert Errors.ArrayEmpty();
147
- amountScyOuts = _redeemPY(receivers, amountPYToRedeems);
147
+ amountSyOuts = _redeemPY(receivers, amountPYToRedeems);
148
148
  }
149
149
 
150
150
  /**
151
- * @dev With YT yielding interest in the form of SCY, which is redeemable by users, the reward
152
- distribution should be based on the amount of SCYs that their YT currently represent, plus their
151
+ * @dev With YT yielding interest in the form of SY, which is redeemable by users, the reward
152
+ distribution should be based on the amount of SYs that their YT currently represent, plus their
153
153
  dueInterest. It has been proven and tested that _rewardSharesUser will not change over time,
154
154
  unless users redeem their dueInterest or redeemPY. Due to this, it is required to update users'
155
155
  accruedReward STRICTLY BEFORE transferring out their interest.
@@ -175,7 +175,7 @@ contract PendleYieldToken is
175
175
 
176
176
  if (redeemInterest) {
177
177
  _distributeInterest(user);
178
- interestOut = _doTransferOutInterest(user, SCY, factory);
178
+ interestOut = _doTransferOutInterest(user, SY, factory);
179
179
  emit RedeemInterest(user, interestOut);
180
180
  } else {
181
181
  interestOut = 0;
@@ -203,13 +203,13 @@ contract PendleYieldToken is
203
203
 
204
204
  _transferOut(tokens, treasury, rewardsOut);
205
205
 
206
- interestOut = postExpiry.totalScyInterestForTreasury;
207
- postExpiry.totalScyInterestForTreasury = 0;
208
- _transferOut(SCY, treasury, interestOut);
206
+ interestOut = postExpiry.totalSyInterestForTreasury;
207
+ postExpiry.totalSyInterestForTreasury = 0;
208
+ _transferOut(SY, treasury, interestOut);
209
209
  }
210
210
 
211
211
  function rewardIndexesCurrent() external override nonReentrant returns (uint256[] memory) {
212
- return ISuperComposableYield(SCY).rewardIndexesCurrent();
212
+ return IStandardizedYield(SY).rewardIndexesCurrent();
213
213
  }
214
214
 
215
215
  /// @dev maximize the current rate with the previous rate to guarantee non-decreasing rate
@@ -228,7 +228,7 @@ contract PendleYieldToken is
228
228
  view
229
229
  returns (
230
230
  uint256 firstPYIndex,
231
- uint256 totalScyInterestForTreasury,
231
+ uint256 totalSyInterestForTreasury,
232
232
  uint256[] memory firstRewardIndexes,
233
233
  uint256[] memory userRewardOwed
234
234
  )
@@ -236,7 +236,7 @@ contract PendleYieldToken is
236
236
  if (postExpiry.firstPYIndex == 0) revert Errors.YCPostExpiryDataNotSet();
237
237
 
238
238
  firstPYIndex = postExpiry.firstPYIndex;
239
- totalScyInterestForTreasury = postExpiry.totalScyInterestForTreasury;
239
+ totalSyInterestForTreasury = postExpiry.totalSyInterestForTreasury;
240
240
 
241
241
  address[] memory tokens = getRewardTokens();
242
242
  firstRewardIndexes = new uint256[](tokens.length);
@@ -251,14 +251,14 @@ contract PendleYieldToken is
251
251
  function _mintPY(
252
252
  address[] memory receiverPTs,
253
253
  address[] memory receiverYTs,
254
- uint256[] memory amountScyToMints
254
+ uint256[] memory amountSyToMints
255
255
  ) internal returns (uint256[] memory amountPYOuts) {
256
- amountPYOuts = new uint256[](amountScyToMints.length);
256
+ amountPYOuts = new uint256[](amountSyToMints.length);
257
257
 
258
258
  uint256 index = _pyIndexCurrent();
259
259
 
260
- for (uint256 i = 0; i < amountScyToMints.length; i++) {
261
- amountPYOuts[i] = _calcPYToMint(amountScyToMints[i], index);
260
+ for (uint256 i = 0; i < amountSyToMints.length; i++) {
261
+ amountPYOuts[i] = _calcPYToMint(amountSyToMints[i], index);
262
262
 
263
263
  _mint(receiverYTs[i], amountPYOuts[i]);
264
264
  IPPrincipalToken(PT).mintByYT(receiverPTs[i], amountPYOuts[i]);
@@ -267,7 +267,7 @@ contract PendleYieldToken is
267
267
  msg.sender,
268
268
  receiverPTs[i],
269
269
  receiverYTs[i],
270
- amountScyToMints[i],
270
+ amountSyToMints[i],
271
271
  amountPYOuts[i]
272
272
  );
273
273
  }
@@ -283,50 +283,50 @@ contract PendleYieldToken is
283
283
 
284
284
  function _redeemPY(address[] memory receivers, uint256[] memory amountPYToRedeems)
285
285
  internal
286
- returns (uint256[] memory amountScyOuts)
286
+ returns (uint256[] memory amountSyOuts)
287
287
  {
288
288
  uint256 totalAmountPYToRedeem = amountPYToRedeems.sum();
289
289
  IPPrincipalToken(PT).burnByYT(address(this), totalAmountPYToRedeem);
290
290
  if (!isExpired()) _burn(address(this), totalAmountPYToRedeem);
291
291
 
292
292
  uint256 index = _pyIndexCurrent();
293
- uint256 totalScyInterestPostExpiry;
294
- amountScyOuts = new uint256[](receivers.length);
293
+ uint256 totalSyInterestPostExpiry;
294
+ amountSyOuts = new uint256[](receivers.length);
295
295
 
296
296
  for (uint256 i = 0; i < receivers.length; i++) {
297
- uint256 scyInterestPostExpiry;
298
- (amountScyOuts[i], scyInterestPostExpiry) = _calcScyRedeemableFromPY(
297
+ uint256 syInterestPostExpiry;
298
+ (amountSyOuts[i], syInterestPostExpiry) = _calcSyRedeemableFromPY(
299
299
  amountPYToRedeems[i],
300
300
  index
301
301
  );
302
- _transferOut(SCY, receivers[i], amountScyOuts[i]);
303
- totalScyInterestPostExpiry += scyInterestPostExpiry;
302
+ _transferOut(SY, receivers[i], amountSyOuts[i]);
303
+ totalSyInterestPostExpiry += syInterestPostExpiry;
304
304
 
305
- emit Burn(msg.sender, receivers[i], amountPYToRedeems[i], amountScyOuts[i]);
305
+ emit Burn(msg.sender, receivers[i], amountPYToRedeems[i], amountSyOuts[i]);
306
306
  }
307
- if (totalScyInterestPostExpiry != 0) {
308
- postExpiry.totalScyInterestForTreasury += totalScyInterestPostExpiry.Uint128();
307
+ if (totalSyInterestPostExpiry != 0) {
308
+ postExpiry.totalSyInterestForTreasury += totalSyInterestPostExpiry.Uint128();
309
309
  }
310
310
  }
311
311
 
312
- function _calcPYToMint(uint256 amountScy, uint256 indexCurrent)
312
+ function _calcPYToMint(uint256 amountSy, uint256 indexCurrent)
313
313
  internal
314
314
  pure
315
315
  returns (uint256 amountPY)
316
316
  {
317
317
  // doesn't matter before or after expiry, since mintPY is only allowed before expiry
318
- return SCYUtils.scyToAsset(indexCurrent, amountScy);
318
+ return SYUtils.syToAsset(indexCurrent, amountSy);
319
319
  }
320
320
 
321
- function _calcScyRedeemableFromPY(uint256 amountPY, uint256 indexCurrent)
321
+ function _calcSyRedeemableFromPY(uint256 amountPY, uint256 indexCurrent)
322
322
  internal
323
323
  view
324
- returns (uint256 scyToUser, uint256 scyInterestPostExpiry)
324
+ returns (uint256 syToUser, uint256 syInterestPostExpiry)
325
325
  {
326
- scyToUser = SCYUtils.assetToScy(indexCurrent, amountPY);
326
+ syToUser = SYUtils.assetToSy(indexCurrent, amountPY);
327
327
  if (isExpired()) {
328
- uint256 totalScyRedeemable = SCYUtils.assetToScy(postExpiry.firstPYIndex, amountPY);
329
- scyInterestPostExpiry = totalScyRedeemable - scyToUser;
328
+ uint256 totalSyRedeemable = SYUtils.assetToSy(postExpiry.firstPYIndex, amountPY);
329
+ syInterestPostExpiry = totalSyRedeemable - syToUser;
330
330
  }
331
331
  }
332
332
 
@@ -335,13 +335,13 @@ contract PendleYieldToken is
335
335
  else return _selfBalance(PT);
336
336
  }
337
337
 
338
- function _updateScyReserve() internal virtual {
339
- scyReserve = _selfBalance(SCY).Uint128();
338
+ function _updateSyReserve() internal virtual {
339
+ syReserve = _selfBalance(SY).Uint128();
340
340
  }
341
341
 
342
- function _getFloatingScyAmount() internal view returns (uint256 amount) {
343
- amount = _selfBalance(SCY) - scyReserve;
344
- if (amount == 0) revert Errors.YCNoFloatingScy();
342
+ function _getFloatingSyAmount() internal view returns (uint256 amount) {
343
+ amount = _selfBalance(SY) - syReserve;
344
+ if (amount == 0) revert Errors.YCNoFloatingSy();
345
345
  }
346
346
 
347
347
  function _setPostExpiryData() internal {
@@ -351,8 +351,8 @@ contract PendleYieldToken is
351
351
  _redeemExternalReward(); // do a final redeem. All the future reward income will belong to the treasury
352
352
 
353
353
  local.firstPYIndex = _pyIndexCurrent().Uint128();
354
- address[] memory rewardTokens = ISuperComposableYield(SCY).getRewardTokens();
355
- uint256[] memory rewardIndexes = ISuperComposableYield(SCY).rewardIndexesCurrent();
354
+ address[] memory rewardTokens = IStandardizedYield(SY).getRewardTokens();
355
+ uint256[] memory rewardIndexes = IStandardizedYield(SY).rewardIndexesCurrent();
356
356
  for (uint256 i = 0; i < rewardTokens.length; i++) {
357
357
  local.firstRewardIndex[rewardTokens[i]] = rewardIndexes[i];
358
358
  local.userRewardOwed[rewardTokens[i]] = _selfBalance(rewardTokens[i]);
@@ -369,7 +369,7 @@ contract PendleYieldToken is
369
369
  }
370
370
 
371
371
  function _pyIndexCurrent() internal returns (uint256 currentIndex) {
372
- currentIndex = Math.max(ISuperComposableYield(SCY).exchangeRate(), _pyIndexStored);
372
+ currentIndex = Math.max(IStandardizedYield(SY).exchangeRate(), _pyIndexStored);
373
373
  _pyIndexStored = currentIndex.Uint128();
374
374
  emit NewInterestIndex(currentIndex);
375
375
  }
@@ -383,7 +383,7 @@ contract PendleYieldToken is
383
383
  //////////////////////////////////////////////////////////////*/
384
384
 
385
385
  function getRewardTokens() public view returns (address[] memory) {
386
- return ISuperComposableYield(SCY).getRewardTokens();
386
+ return IStandardizedYield(SY).getRewardTokens();
387
387
  }
388
388
 
389
389
  function _doTransferOutRewards(address user, address receiver)
@@ -436,14 +436,14 @@ contract PendleYieldToken is
436
436
  }
437
437
 
438
438
  function _redeemExternalReward() internal virtual override {
439
- ISuperComposableYield(SCY).claimRewards(address(this));
439
+ IStandardizedYield(SY).claimRewards(address(this));
440
440
  }
441
441
 
442
- /// @dev effectively returning the amount of SCY generating rewards for this user
442
+ /// @dev effectively returning the amount of SY generating rewards for this user
443
443
  function _rewardSharesUser(address user) internal view virtual override returns (uint256) {
444
444
  uint256 index = userInterest[user].index;
445
445
  if (index == 0) return 0;
446
- return SCYUtils.assetToScy(index, balanceOf(user)) + userInterest[user].accrued;
446
+ return SYUtils.assetToSy(index, balanceOf(user)) + userInterest[user].accrued;
447
447
  }
448
448
 
449
449
  function _updateRewardIndex()
@@ -457,7 +457,7 @@ contract PendleYieldToken is
457
457
  for (uint256 i = 0; i < tokens.length; i++)
458
458
  indexes[i] = postExpiry.firstRewardIndex[tokens[i]];
459
459
  } else {
460
- indexes = ISuperComposableYield(SCY).rewardIndexesCurrent();
460
+ indexes = IStandardizedYield(SY).rewardIndexesCurrent();
461
461
  }
462
462
  }
463
463
 
@@ -19,7 +19,7 @@ contract PendleERC20Permit is PendleERC20, IERC20Permit, EIP712 {
19
19
  mapping(address => Counters.Counter) private _nonces;
20
20
 
21
21
  // solhint-disable-next-line var-name-mixedcase
22
- bytes32 private immutable _PERMIT_TYPEHASH =
22
+ bytes32 private constant _PERMIT_TYPEHASH =
23
23
  keccak256(
24
24
  "Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)"
25
25
  );
@@ -15,7 +15,7 @@ library Errors {
15
15
  error MarketZeroLnImpliedRate();
16
16
  error MarketInsufficientPtForTrade(int256 currentAmount, int256 requiredAmount);
17
17
  error MarketInsufficientPtReceived(uint256 actualBalance, uint256 requiredBalance);
18
- error MarketInsufficientScyReceived(uint256 actualBalance, uint256 requiredBalance);
18
+ error MarketInsufficientSyReceived(uint256 actualBalance, uint256 requiredBalance);
19
19
  error MarketZeroTotalPtOrTotalAsset(int256 totalPt, int256 totalAsset);
20
20
  error MarketExchangeRateBelowOne(int256 exchangeRate);
21
21
  error MarketProportionMustNotEqualOne();
@@ -36,15 +36,15 @@ library Errors {
36
36
 
37
37
  // ROUTER
38
38
  error RouterInsufficientLpOut(uint256 actualLpOut, uint256 requiredLpOut);
39
- error RouterInsufficientScyOut(uint256 actualScyOut, uint256 requiredScyOut);
39
+ error RouterInsufficientSyOut(uint256 actualSyOut, uint256 requiredSyOut);
40
40
  error RouterInsufficientPtOut(uint256 actualPtOut, uint256 requiredPtOut);
41
41
  error RouterInsufficientYtOut(uint256 actualYtOut, uint256 requiredYtOut);
42
42
  error RouterInsufficientPYOut(uint256 actualPYOut, uint256 requiredPYOut);
43
43
  error RouterInsufficientTokenOut(uint256 actualTokenOut, uint256 requiredTokenOut);
44
- error RouterExceededLimitScyIn(uint256 actualScyIn, uint256 limitScyIn);
44
+ error RouterExceededLimitSyIn(uint256 actualSyIn, uint256 limitSyIn);
45
45
  error RouterExceededLimitPtIn(uint256 actualPtIn, uint256 limitPtIn);
46
46
  error RouterExceededLimitYtIn(uint256 actualYtIn, uint256 limitYtIn);
47
- error RouterInsufficientScyRepay(uint256 actualScyRepay, uint256 requiredScyRepay);
47
+ error RouterInsufficientSyRepay(uint256 actualSyRepay, uint256 requiredSyRepay);
48
48
  error RouterInsufficientPtRepay(uint256 actualPtRepay, uint256 requiredPtRepay);
49
49
 
50
50
  error RouterTimeRangeZero();
@@ -54,31 +54,31 @@ library Errors {
54
54
  // YIELD CONTRACT
55
55
  error YCExpired();
56
56
  error YCNotExpired();
57
- error YieldContractInsufficientScy(uint256 actualScy, uint256 requiredScy);
57
+ error YieldContractInsufficientSy(uint256 actualSy, uint256 requiredSy);
58
58
  error YCNothingToRedeem();
59
59
  error YCPostExpiryDataNotSet();
60
- error YCNoFloatingScy();
60
+ error YCNoFloatingSy();
61
61
 
62
62
  // YieldFactory
63
63
  error YCFactoryInvalidExpiry();
64
64
  error YCFactoryYieldContractExisted();
65
65
 
66
- // SCY
67
- error SCYInvalidTokenIn(address token);
68
- error SCYInvalidTokenOut(address token);
69
- error SCYZeroDeposit();
70
- error SCYZeroRedeem();
71
- error SCYInsufficientSharesOut(uint256 actualSharesOut, uint256 requiredSharesOut);
72
- error SCYInsufficientTokenOut(uint256 actualTokenOut, uint256 requiredTokenOut);
73
-
74
- // SCY-specific
75
- error SCYQiTokenMintFailed(uint256 errCode);
76
- error SCYQiTokenRedeemFailed(uint256 errCode);
77
- error SCYQiTokenRedeemRewardsFailed(uint256 rewardAccruedType0, uint256 rewardAccruedType1);
78
- error SCYQiTokenBorrowRateTooHigh(uint256 borrowRate, uint256 borrowRateMax);
79
-
80
- error SCYCurveInvalidPid();
81
- error SCYCurve3crvPoolNotFound();
66
+ // SY
67
+ error SYInvalidTokenIn(address token);
68
+ error SYInvalidTokenOut(address token);
69
+ error SYZeroDeposit();
70
+ error SYZeroRedeem();
71
+ error SYInsufficientSharesOut(uint256 actualSharesOut, uint256 requiredSharesOut);
72
+ error SYInsufficientTokenOut(uint256 actualTokenOut, uint256 requiredTokenOut);
73
+
74
+ // SY-specific
75
+ error SYQiTokenMintFailed(uint256 errCode);
76
+ error SYQiTokenRedeemFailed(uint256 errCode);
77
+ error SYQiTokenRedeemRewardsFailed(uint256 rewardAccruedType0, uint256 rewardAccruedType1);
78
+ error SYQiTokenBorrowRateTooHigh(uint256 borrowRate, uint256 borrowRateMax);
79
+
80
+ error SYCurveInvalidPid();
81
+ error SYCurve3crvPoolNotFound();
82
82
 
83
83
  // Liquidity Mining
84
84
  error VCInactivePool(address pool);
@@ -8,39 +8,6 @@ abstract contract TokenHelper {
8
8
  address internal constant NATIVE = address(0);
9
9
  uint256 internal constant LOWER_BOUND_APPROVAL = type(uint96).max / 2; // some tokens use 96 bits for approval
10
10
 
11
- function _transferFrom(
12
- address token,
13
- address from,
14
- address to,
15
- uint256 amount
16
- ) internal {
17
- if (token == NATIVE) require(msg.value == amount, "eth mismatch");
18
- else if (amount != 0) IERC20(token).safeTransferFrom(from, to, amount);
19
- }
20
-
21
- function _transferFrom(
22
- address[] memory tokens,
23
- address from,
24
- address to,
25
- uint256[] memory amounts
26
- ) internal {
27
- uint256 length = tokens.length;
28
- require(length == amounts.length, "length mismatch");
29
-
30
- for (uint256 i = 0; i < length; ) {
31
- if (amounts[i] > 0) {
32
- if (tokens[i] == NATIVE) {
33
- require(msg.value == amounts[i], "native mismatch");
34
- } else {
35
- IERC20(tokens[i]).safeTransferFrom(from, to, amounts[i]);
36
- }
37
- }
38
- unchecked {
39
- i++;
40
- }
41
- }
42
- }
43
-
44
11
  function _transferIn(
45
12
  address token,
46
13
  address from,
@@ -2,6 +2,8 @@
2
2
  pragma solidity 0.8.17;
3
3
 
4
4
  interface ICrvPool {
5
+ function coins(uint256 i) external view returns (address);
6
+
5
7
  function get_virtual_price() external view returns (uint256);
6
8
 
7
9
  function get_dy(
@@ -5,11 +5,11 @@ import "../router/base/MarketApproxLib.sol";
5
5
  import "../router/kyberswap/KyberSwapHelper.sol";
6
6
 
7
7
  interface IPActionAddRemoveLiq {
8
- event AddLiquidityDualScyAndPt(
8
+ event AddLiquidityDualSyAndPt(
9
9
  address indexed caller,
10
10
  address indexed market,
11
11
  address indexed receiver,
12
- uint256 netScyUsed,
12
+ uint256 netSyUsed,
13
13
  uint256 netPtUsed,
14
14
  uint256 netLpOut
15
15
  );
@@ -32,11 +32,11 @@ interface IPActionAddRemoveLiq {
32
32
  uint256 netLpOut
33
33
  );
34
34
 
35
- event AddLiquiditySingleScy(
35
+ event AddLiquiditySingleSy(
36
36
  address indexed caller,
37
37
  address indexed market,
38
38
  address indexed receiver,
39
- uint256 netScyIn,
39
+ uint256 netSyIn,
40
40
  uint256 netLpOut
41
41
  );
42
42
 
@@ -49,13 +49,13 @@ interface IPActionAddRemoveLiq {
49
49
  uint256 netLpOut
50
50
  );
51
51
 
52
- event RemoveLiquidityDualScyAndPt(
52
+ event RemoveLiquidityDualSyAndPt(
53
53
  address indexed caller,
54
54
  address indexed market,
55
55
  address indexed receiver,
56
56
  uint256 netLpToRemove,
57
57
  uint256 netPtOut,
58
- uint256 netScyOut
58
+ uint256 netSyOut
59
59
  );
60
60
 
61
61
  event RemoveLiquidityDualTokenAndPt(
@@ -76,12 +76,12 @@ interface IPActionAddRemoveLiq {
76
76
  uint256 netPtOut
77
77
  );
78
78
 
79
- event RemoveLiquiditySingleScy(
79
+ event RemoveLiquiditySingleSy(
80
80
  address indexed caller,
81
81
  address indexed market,
82
82
  address indexed receiver,
83
83
  uint256 netLpToRemove,
84
- uint256 netScyOut
84
+ uint256 netSyOut
85
85
  );
86
86
 
87
87
  event RemoveLiquiditySingleToken(
@@ -93,17 +93,17 @@ interface IPActionAddRemoveLiq {
93
93
  uint256 netTokenOut
94
94
  );
95
95
 
96
- function addLiquidityDualScyAndPt(
96
+ function addLiquidityDualSyAndPt(
97
97
  address receiver,
98
98
  address market,
99
- uint256 netScyDesired,
99
+ uint256 netSyDesired,
100
100
  uint256 netPtDesired,
101
101
  uint256 minLpOut
102
102
  )
103
103
  external
104
104
  returns (
105
105
  uint256 netLpOut,
106
- uint256 netScyUsed,
106
+ uint256 netSyUsed,
107
107
  uint256 netPtUsed
108
108
  );
109
109
 
@@ -128,32 +128,32 @@ interface IPActionAddRemoveLiq {
128
128
  address market,
129
129
  uint256 netPtIn,
130
130
  uint256 minLpOut,
131
- ApproxParams calldata guessPtSwapToScy
132
- ) external returns (uint256 netLpOut, uint256 netScyFee);
131
+ ApproxParams calldata guessPtSwapToSy
132
+ ) external returns (uint256 netLpOut, uint256 netSyFee);
133
133
 
134
- function addLiquiditySingleScy(
134
+ function addLiquiditySingleSy(
135
135
  address receiver,
136
136
  address market,
137
- uint256 netScyIn,
137
+ uint256 netSyIn,
138
138
  uint256 minLpOut,
139
- ApproxParams calldata guessPtReceivedFromScy
140
- ) external returns (uint256 netLpOut, uint256 netScyFee);
139
+ ApproxParams calldata guessPtReceivedFromSy
140
+ ) external returns (uint256 netLpOut, uint256 netSyFee);
141
141
 
142
142
  function addLiquiditySingleToken(
143
143
  address receiver,
144
144
  address market,
145
145
  uint256 minLpOut,
146
- ApproxParams calldata guessPtReceivedFromScy,
146
+ ApproxParams calldata guessPtReceivedFromSy,
147
147
  TokenInput calldata input
148
- ) external payable returns (uint256 netLpOut, uint256 netScyFee);
148
+ ) external payable returns (uint256 netLpOut, uint256 netSyFee);
149
149
 
150
- function removeLiquidityDualScyAndPt(
150
+ function removeLiquidityDualSyAndPt(
151
151
  address receiver,
152
152
  address market,
153
153
  uint256 netLpToRemove,
154
- uint256 minScyOut,
154
+ uint256 minSyOut,
155
155
  uint256 minPtOut
156
- ) external returns (uint256 netScyOut, uint256 netPtOut);
156
+ ) external returns (uint256 netSyOut, uint256 netPtOut);
157
157
 
158
158
  function removeLiquidityDualTokenAndPt(
159
159
  address receiver,
@@ -170,19 +170,19 @@ interface IPActionAddRemoveLiq {
170
170
  uint256 netLpToRemove,
171
171
  uint256 minPtOut,
172
172
  ApproxParams calldata guessPtOut
173
- ) external returns (uint256 netPtOut, uint256 netScyFee);
173
+ ) external returns (uint256 netPtOut, uint256 netSyFee);
174
174
 
175
- function removeLiquiditySingleScy(
175
+ function removeLiquiditySingleSy(
176
176
  address receiver,
177
177
  address market,
178
178
  uint256 netLpToRemove,
179
- uint256 minScyOut
180
- ) external returns (uint256 netScyOut, uint256 netScyFee);
179
+ uint256 minSyOut
180
+ ) external returns (uint256 netSyOut, uint256 netSyFee);
181
181
 
182
182
  function removeLiquiditySingleToken(
183
183
  address receiver,
184
184
  address market,
185
185
  uint256 netLpToRemove,
186
186
  TokenOutput calldata output
187
- ) external returns (uint256 netTokenOut, uint256 netScyFee);
187
+ ) external returns (uint256 netTokenOut, uint256 netSyFee);
188
188
  }