@pendle/core-v2 0.13.0-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 (293) 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/deployments/43113-helper.json +3 -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/deployments/43113-testenv.json +22 -0
  186. package/deployments/80001-core.json +15 -0
  187. package/deployments/80001-testenv.json +22 -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/ImplicitSwapfeeContract.ts +157 -0
  208. package/typechain-types/MarketMathStatic.ts +27 -27
  209. package/typechain-types/Pendle3CrvAndTokenSY.ts +1243 -0
  210. package/typechain-types/Pendle3CrvHelper.ts +13 -13
  211. package/typechain-types/PendleConvexLPSY.ts +1189 -0
  212. package/typechain-types/PendleGaugeControllerBaseUpg.ts +125 -0
  213. package/typechain-types/PendleGaugeControllerMainchainUpg.ts +125 -0
  214. package/typechain-types/PendleGaugeControllerSidechainUpg.ts +124 -0
  215. package/typechain-types/PendleMarket.ts +54 -57
  216. package/typechain-types/PendlePrincipalToken.ts +8 -8
  217. package/typechain-types/PendleQiTokenSY.ts +1166 -0
  218. package/typechain-types/PendleWstEthSY.ts +1040 -0
  219. package/typechain-types/PendleYieldContractFactory.ts +8 -8
  220. package/typechain-types/PendleYieldToken.ts +41 -44
  221. package/typechain-types/RouterStatic.ts +196 -196
  222. package/typechain-types/SYBase.ts +1001 -0
  223. package/typechain-types/SYBaseWithRewards.ts +1094 -0
  224. package/typechain-types/factories/ActionAddRemoveLiq__factory.ts +34 -34
  225. package/typechain-types/factories/ActionCallback__factory.ts +11 -11
  226. package/typechain-types/factories/ActionMintRedeem__factory.ts +38 -38
  227. package/typechain-types/factories/ActionMisc__factory.ts +1 -1
  228. package/typechain-types/factories/ActionSwapPTYT__factory.ts +3 -3
  229. package/typechain-types/factories/ActionSwapPT__factory.ts +27 -27
  230. package/typechain-types/factories/ActionSwapYT__factory.ts +21 -21
  231. package/typechain-types/factories/Errors__factory.ts +27 -27
  232. package/typechain-types/factories/IPActionAddRemoveLiq__factory.ts +30 -30
  233. package/typechain-types/factories/IPActionMintRedeem__factory.ts +34 -34
  234. package/typechain-types/factories/IPActionSwapPTYT__factory.ts +2 -2
  235. package/typechain-types/factories/IPActionSwapPT__factory.ts +20 -20
  236. package/typechain-types/factories/IPActionSwapYT__factory.ts +20 -20
  237. package/typechain-types/factories/IPAllAction__factory.ts +106 -106
  238. package/typechain-types/factories/IPMarketSwapCallback__factory.ts +1 -1
  239. package/typechain-types/factories/IPMarket__factory.ts +18 -18
  240. package/typechain-types/factories/IPPrincipalToken__factory.ts +1 -1
  241. package/typechain-types/factories/IPYieldContractFactory__factory.ts +3 -3
  242. package/typechain-types/factories/IPYieldToken__factory.ts +6 -6
  243. package/typechain-types/factories/IStandardizedYield__factory.ts +658 -0
  244. package/typechain-types/factories/ImplicitSwapfeeContract__factory.ts +247 -0
  245. package/typechain-types/factories/MarketMathStatic__factory.ts +6 -6
  246. package/typechain-types/factories/OracleLib__factory.ts +1 -1
  247. package/typechain-types/factories/Pendle3CrvAndTokenSY__factory.ts +1124 -0
  248. package/typechain-types/factories/Pendle3CrvHelper__factory.ts +3 -3
  249. package/typechain-types/factories/PendleConvexLPSY__factory.ts +963 -0
  250. package/typechain-types/factories/PendleFeeDistributorFactory__factory.ts +1 -1
  251. package/typechain-types/factories/PendleFeeDistributor__factory.ts +1 -1
  252. package/typechain-types/factories/PendleGaugeControllerBaseUpg__factory.ts +89 -0
  253. package/typechain-types/factories/PendleGaugeControllerMainchainUpg__factory.ts +90 -1
  254. package/typechain-types/factories/PendleGaugeControllerSidechainUpg__factory.ts +90 -1
  255. package/typechain-types/factories/PendleMarketFactory__factory.ts +1 -1
  256. package/typechain-types/factories/PendleMarket__factory.ts +21 -21
  257. package/typechain-types/factories/PendleMsgReceiveEndpointUpg__factory.ts +1 -1
  258. package/typechain-types/factories/PendleMsgSendEndpointUpg__factory.ts +1 -1
  259. package/typechain-types/factories/PendlePrincipalToken__factory.ts +7 -7
  260. package/typechain-types/factories/PendleQiTokenHelper__factory.ts +1 -1
  261. package/typechain-types/factories/PendleQiTokenSY__factory.ts +1095 -0
  262. package/typechain-types/factories/PendleRouter__factory.ts +1 -1
  263. package/typechain-types/factories/PendleVotingControllerUpg__factory.ts +1 -1
  264. package/typechain-types/factories/PendleWstEthSY__factory.ts +924 -0
  265. package/typechain-types/factories/PendleYieldContractFactory__factory.ts +3 -3
  266. package/typechain-types/factories/PendleYieldToken__factory.ts +27 -27
  267. package/typechain-types/factories/RouterStatic__factory.ts +57 -57
  268. package/typechain-types/factories/SYBaseWithRewards__factory.ts +867 -0
  269. package/typechain-types/factories/SYBase__factory.ts +795 -0
  270. package/typechain-types/factories/VotingEscrowPendleMainchain__factory.ts +1 -1
  271. package/typechain-types/factories/VotingEscrowPendleSidechain__factory.ts +1 -1
  272. package/typechain-types/hardhat.d.ts +33 -42
  273. package/typechain-types/index.ts +14 -16
  274. package/build/artifacts/contracts/core/SuperComposableYield/PYIndex.sol/PYIndexLib.dbg.json +0 -4
  275. package/build/artifacts/contracts/core/SuperComposableYield/SCYBase.sol/SCYBase.dbg.json +0 -4
  276. package/build/artifacts/contracts/core/SuperComposableYield/SCYBaseWithRewards.sol/SCYBaseWithRewards.dbg.json +0 -4
  277. package/build/artifacts/contracts/core/SuperComposableYield/SCYUtils.sol/SCYUtils.dbg.json +0 -4
  278. package/build/artifacts/contracts/core/SuperComposableYield/implementations/BenQi/PendleQiTokenHelper.sol/PendleQiTokenHelper.dbg.json +0 -4
  279. package/build/artifacts/contracts/core/SuperComposableYield/implementations/BenQi/PendleQiTokenSCY.sol/PendleQiTokenSCY.dbg.json +0 -4
  280. package/build/artifacts/contracts/core/SuperComposableYield/implementations/Convex/ConvexCurveLP/Pendle3CrvAndTokenSCY.sol/Pendle3CrvAndTokenSCY.dbg.json +0 -4
  281. package/build/artifacts/contracts/core/SuperComposableYield/implementations/Convex/ConvexCurveLP/Pendle3CrvAndTokenSCY.sol/Pendle3CrvAndTokenSCY.json +0 -1030
  282. package/build/artifacts/contracts/core/SuperComposableYield/implementations/Convex/ConvexCurveLP/PendleConvexCurveLP2PoolSCY.sol/PendleConvexCurveLP2PoolSCY.dbg.json +0 -4
  283. package/build/artifacts/contracts/core/SuperComposableYield/implementations/Convex/ConvexCurveLP/PendleConvexCurveLP2PoolSCY.sol/PendleConvexCurveLP2PoolSCY.json +0 -1025
  284. package/build/artifacts/contracts/core/SuperComposableYield/implementations/Convex/ConvexCurveLP/PendleConvexCurveLPSCY.sol/PendleConvexCurveLPSCY.dbg.json +0 -4
  285. package/build/artifacts/contracts/core/SuperComposableYield/implementations/Convex/Pendle3CrvHelper.sol/Pendle3CrvHelper.dbg.json +0 -4
  286. package/build/artifacts/contracts/core/SuperComposableYield/implementations/PendleWstEthSCY.sol/PendleWstEthSCY.dbg.json +0 -4
  287. package/build/artifacts/contracts/interfaces/ISuperComposableYield.sol/ISuperComposableYield.dbg.json +0 -4
  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/interfaces/ICelerMessageBus.sol +0 -28
  292. package/contracts/interfaces/ICelerMessageReceiverApp.sol +0 -25
  293. package/deployments/kovan.json +0 -31
@@ -13,7 +13,7 @@ contract ActionSwapYT is IPActionSwapYT, ActionBaseMintRedeem, CallbackHelper {
13
13
  using MarketMathCore for MarketState;
14
14
  using MarketApproxPtInLib for MarketState;
15
15
  using MarketApproxPtOutLib for MarketState;
16
- using SafeERC20 for ISuperComposableYield;
16
+ using SafeERC20 for IStandardizedYield;
17
17
  using SafeERC20 for IPYieldToken;
18
18
  using PYIndexLib for IPYieldToken;
19
19
 
@@ -23,123 +23,116 @@ contract ActionSwapYT is IPActionSwapYT, ActionBaseMintRedeem, CallbackHelper {
23
23
  {}
24
24
 
25
25
  /**
26
- * @notice swap exact SCY to YT with the help of flashswaps & YT tokenization / redemption
26
+ * @notice swap exact SY to YT with the help of flashswaps & YT tokenization / redemption
27
27
  * @dev inner working of this function:
28
- - `exactScyIn` SCY is transferred to YT contract
29
- - `market.swapExactPtForScy` is called, which will transfer SCY directly to YT contract & callback is invoked.
28
+ - `exactSyIn` SY is transferred to YT contract
29
+ - `market.swapExactPtForSy` is called, which will transfer SY directly to YT contract & callback is invoked.
30
30
  Note that now we owe PT
31
- - in callback, all SCY in YT contract is used to mint PT + YT, with PT used to pay back the loan, and YT
31
+ - in callback, all SY in YT contract is used to mint PT + YT, with PT used to pay back the loan, and YT
32
32
  transferred to the receiver
33
33
  * @dev this function works in conjunction with ActionCallback
34
34
  */
35
- function swapExactScyForYt(
35
+ function swapExactSyForYt(
36
36
  address receiver,
37
37
  address market,
38
- uint256 exactScyIn,
38
+ uint256 exactSyIn,
39
39
  uint256 minYtOut,
40
40
  ApproxParams memory guessYtOut
41
- ) external returns (uint256 netYtOut, uint256 netScyFee) {
42
- (ISuperComposableYield SCY, , IPYieldToken YT) = IPMarket(market).readTokens();
41
+ ) external returns (uint256 netYtOut, uint256 netSyFee) {
42
+ (IStandardizedYield SY, , IPYieldToken YT) = IPMarket(market).readTokens();
43
43
 
44
- SCY.safeTransferFrom(msg.sender, address(YT), exactScyIn);
44
+ SY.safeTransferFrom(msg.sender, address(YT), exactSyIn);
45
45
 
46
- (netYtOut, netScyFee) = _swapExactScyForYt(
46
+ (netYtOut, netSyFee) = _swapExactSyForYt(
47
47
  receiver,
48
48
  market,
49
49
  YT,
50
- exactScyIn,
50
+ exactSyIn,
51
51
  minYtOut,
52
52
  guessYtOut
53
53
  );
54
54
 
55
- emit SwapYtAndScy(msg.sender, market, receiver, netYtOut.Int(), exactScyIn.neg());
55
+ emit SwapYtAndSy(msg.sender, market, receiver, netYtOut.Int(), exactSyIn.neg());
56
56
  }
57
57
 
58
58
  /**
59
- * @notice swap exact YT to SCY with the help of flashswaps & YT tokenization / redemption
59
+ * @notice swap exact YT to SY with the help of flashswaps & YT tokenization / redemption
60
60
  * @dev inner working of this function:
61
61
  - `exactYtIn` YT is transferred to YT contract
62
- - `market.swapScyForExactPt` is called, which will transfer PT directly to YT contract & callback is invoked.
63
- Note that now we owe SCY
64
- - in callback, all PT + YT in YT contract is used to redeem SCY. A portion of SCY is used to payback the loan,
62
+ - `market.swapSyForExactPt` is called, which will transfer PT directly to YT contract & callback is invoked.
63
+ Note that now we owe SY
64
+ - in callback, all PT + YT in YT contract is used to redeem SY. A portion of SY is used to payback the loan,
65
65
  the rest is transferred to the `receiver`
66
66
  * @dev this function works in conjunction with ActionCallback
67
67
  */
68
- function swapExactYtForScy(
68
+ function swapExactYtForSy(
69
69
  address receiver,
70
70
  address market,
71
71
  uint256 exactYtIn,
72
- uint256 minScyOut
73
- ) external returns (uint256 netScyOut, uint256 netScyFee) {
74
- (ISuperComposableYield SCY, , IPYieldToken YT) = IPMarket(market).readTokens();
72
+ uint256 minSyOut
73
+ ) external returns (uint256 netSyOut, uint256 netSyFee) {
74
+ (IStandardizedYield SY, , IPYieldToken YT) = IPMarket(market).readTokens();
75
75
 
76
76
  YT.safeTransferFrom(msg.sender, address(YT), exactYtIn);
77
77
 
78
- (netScyOut, netScyFee) = _swapExactYtForScy(
79
- receiver,
80
- market,
81
- SCY,
82
- YT,
83
- exactYtIn,
84
- minScyOut
85
- );
78
+ (netSyOut, netSyFee) = _swapExactYtForSy(receiver, market, SY, YT, exactYtIn, minSyOut);
86
79
 
87
- emit SwapYtAndScy(msg.sender, market, receiver, exactYtIn.neg(), netScyOut.Int());
80
+ emit SwapYtAndSy(msg.sender, market, receiver, exactYtIn.neg(), netSyOut.Int());
88
81
  }
89
82
 
90
83
  /**
91
- * @notice swap SCY to exact YT with the help of flashswaps & YT tokenization / redemption
84
+ * @notice swap SY to exact YT with the help of flashswaps & YT tokenization / redemption
92
85
  * @dev inner working of this function:
93
- - `market.swapExactPtForScy` is called, which will transfer SCY directly to YT contract & callback is invoked.
86
+ - `market.swapExactPtForSy` is called, which will transfer SY directly to YT contract & callback is invoked.
94
87
  Note that now we owe PT
95
- - in callback, we will pull in more SCY as needed & mint all SCY to PT + YT. PT is then used to payback the loan
88
+ - in callback, we will pull in more SY as needed & mint all SY to PT + YT. PT is then used to payback the loan
96
89
  while YT is transferred to the user
97
90
  * @dev this function works in conjunction with ActionCallback
98
91
  */
99
- function swapScyForExactYt(
92
+ function swapSyForExactYt(
100
93
  address receiver,
101
94
  address market,
102
95
  uint256 exactYtOut,
103
- uint256 maxScyIn
104
- ) external returns (uint256 netScyIn, uint256 netScyFee) {
105
- (ISuperComposableYield SCY, , IPYieldToken YT) = IPMarket(market).readTokens();
96
+ uint256 maxSyIn
97
+ ) external returns (uint256 netSyIn, uint256 netSyFee) {
98
+ (IStandardizedYield SY, , IPYieldToken YT) = IPMarket(market).readTokens();
106
99
 
107
- uint256 preScyBalance = SCY.balanceOf(msg.sender);
100
+ uint256 preSyBalance = SY.balanceOf(msg.sender);
108
101
 
109
- (, netScyFee) = IPMarket(market).swapExactPtForScy(
102
+ (, netSyFee) = IPMarket(market).swapExactPtForSy(
110
103
  address(YT),
111
104
  exactYtOut, // exactPtIn = exactYtOut
112
- _encodeSwapScyForExactYt(msg.sender, receiver, maxScyIn)
105
+ _encodeSwapSyForExactYt(msg.sender, receiver, maxSyIn)
113
106
  );
114
107
 
115
- netScyIn = preScyBalance - SCY.balanceOf(msg.sender);
108
+ netSyIn = preSyBalance - SY.balanceOf(msg.sender);
116
109
 
117
- emit SwapYtAndScy(msg.sender, market, receiver, exactYtOut.Int(), netScyIn.neg());
110
+ emit SwapYtAndSy(msg.sender, market, receiver, exactYtOut.Int(), netSyIn.neg());
118
111
  }
119
112
 
120
113
  /**
121
- * @notice swap YT to exact SCY with the help of flashswaps & YT tokenization / redemption
114
+ * @notice swap YT to exact SY with the help of flashswaps & YT tokenization / redemption
122
115
  * @dev inner working of this function:
123
116
  - transfer netYtIn (received from approx function) to YT contract
124
- - `market.swapScyForExactPt` is called, which will transfer PT directly to YT contract & callback is invoked.
125
- Note that now we owe SCY
126
- - in callback, we will redeem all PT + YT to get SCY. A portion of it is used to payback the loan. The rest is
117
+ - `market.swapSyForExactPt` is called, which will transfer PT directly to YT contract & callback is invoked.
118
+ Note that now we owe SY
119
+ - in callback, we will redeem all PT + YT to get SY. A portion of it is used to payback the loan. The rest is
127
120
  transferred to `receiver`
128
121
  * @dev this function works in conjunction with ActionCallback
129
122
  */
130
- function swapYtForExactScy(
123
+ function swapYtForExactSy(
131
124
  address receiver,
132
125
  address market,
133
- uint256 exactScyOut,
126
+ uint256 exactSyOut,
134
127
  uint256 maxYtIn,
135
128
  ApproxParams memory guessYtIn
136
- ) external returns (uint256 netYtIn, uint256 netScyFee) {
129
+ ) external returns (uint256 netYtIn, uint256 netSyFee) {
137
130
  MarketState memory state = IPMarket(market).readState();
138
131
  (, , IPYieldToken YT) = IPMarket(market).readTokens();
139
132
 
140
- (netYtIn, , ) = state.approxSwapYtForExactScy(
133
+ (netYtIn, , ) = state.approxSwapYtForExactSy(
141
134
  YT.newIndex(),
142
- exactScyOut,
135
+ exactSyOut,
143
136
  block.timestamp,
144
137
  guessYtIn
145
138
  );
@@ -148,13 +141,13 @@ contract ActionSwapYT is IPActionSwapYT, ActionBaseMintRedeem, CallbackHelper {
148
141
 
149
142
  YT.safeTransferFrom(msg.sender, address(YT), netYtIn);
150
143
 
151
- (, netScyFee) = IPMarket(market).swapScyForExactPt(
144
+ (, netSyFee) = IPMarket(market).swapSyForExactPt(
152
145
  address(YT),
153
146
  netYtIn, // exactPtOut = netYtIn
154
- _encodeSwapYtForScy(receiver, exactScyOut)
147
+ _encodeSwapYtForSy(receiver, exactSyOut)
155
148
  );
156
149
 
157
- emit SwapYtAndScy(msg.sender, market, receiver, netYtIn.neg(), exactScyOut.Int());
150
+ emit SwapYtAndSy(msg.sender, market, receiver, netYtIn.neg(), exactSyOut.Int());
158
151
  }
159
152
 
160
153
  function swapExactTokenForYt(
@@ -163,16 +156,16 @@ contract ActionSwapYT is IPActionSwapYT, ActionBaseMintRedeem, CallbackHelper {
163
156
  uint256 minYtOut,
164
157
  ApproxParams memory guessYtOut,
165
158
  TokenInput calldata input
166
- ) external payable returns (uint256 netYtOut, uint256 netScyFee) {
167
- (ISuperComposableYield SCY, , IPYieldToken YT) = IPMarket(market).readTokens();
159
+ ) external payable returns (uint256 netYtOut, uint256 netSyFee) {
160
+ (IStandardizedYield SY, , IPYieldToken YT) = IPMarket(market).readTokens();
168
161
 
169
- uint256 netScyUsedToBuyYT = _mintScyFromToken(address(YT), address(SCY), 1, input);
162
+ uint256 netSyUsedToBuyYT = _mintSyFromToken(address(YT), address(SY), 1, input);
170
163
 
171
- (netYtOut, netScyFee) = _swapExactScyForYt(
164
+ (netYtOut, netSyFee) = _swapExactSyForYt(
172
165
  receiver,
173
166
  market,
174
167
  YT,
175
- netScyUsedToBuyYT,
168
+ netSyUsedToBuyYT,
176
169
  minYtOut,
177
170
  guessYtOut
178
171
  );
@@ -192,16 +185,16 @@ contract ActionSwapYT is IPActionSwapYT, ActionBaseMintRedeem, CallbackHelper {
192
185
  address market,
193
186
  uint256 netYtIn,
194
187
  TokenOutput calldata output
195
- ) external returns (uint256 netTokenOut, uint256 netScyFee) {
196
- (ISuperComposableYield SCY, , IPYieldToken YT) = IPMarket(market).readTokens();
188
+ ) external returns (uint256 netTokenOut, uint256 netSyFee) {
189
+ (IStandardizedYield SY, , IPYieldToken YT) = IPMarket(market).readTokens();
197
190
 
198
191
  YT.safeTransferFrom(msg.sender, address(YT), netYtIn);
199
192
 
200
- uint256 netScyOut;
193
+ uint256 netSyOut;
201
194
 
202
- (netScyOut, netScyFee) = _swapExactYtForScy(address(SCY), market, SCY, YT, netYtIn, 1);
195
+ (netSyOut, netSyFee) = _swapExactYtForSy(address(SY), market, SY, YT, netYtIn, 1);
203
196
 
204
- netTokenOut = _redeemScyToToken(receiver, address(SCY), netScyOut, output, false);
197
+ netTokenOut = _redeemSyToToken(receiver, address(SY), netSyOut, output, false);
205
198
 
206
199
  emit SwapYtAndToken(
207
200
  msg.sender,
@@ -213,19 +206,19 @@ contract ActionSwapYT is IPActionSwapYT, ActionBaseMintRedeem, CallbackHelper {
213
206
  );
214
207
  }
215
208
 
216
- function _swapExactScyForYt(
209
+ function _swapExactSyForYt(
217
210
  address receiver,
218
211
  address market,
219
212
  IPYieldToken YT,
220
- uint256 exactScyIn,
213
+ uint256 exactSyIn,
221
214
  uint256 minYtOut,
222
215
  ApproxParams memory guessYtOut
223
- ) internal returns (uint256 netYtOut, uint256 netScyFee) {
216
+ ) internal returns (uint256 netYtOut, uint256 netSyFee) {
224
217
  MarketState memory state = IPMarket(market).readState();
225
218
 
226
- (netYtOut, ) = state.approxSwapExactScyForYt(
219
+ (netYtOut, ) = state.approxSwapExactSyForYt(
227
220
  YT.newIndex(),
228
- exactScyIn,
221
+ exactSyIn,
229
222
  block.timestamp,
230
223
  guessYtOut
231
224
  );
@@ -233,29 +226,29 @@ contract ActionSwapYT is IPActionSwapYT, ActionBaseMintRedeem, CallbackHelper {
233
226
  // early-check
234
227
  if (netYtOut < minYtOut) revert Errors.RouterInsufficientYtOut(netYtOut, minYtOut);
235
228
 
236
- (, netScyFee) = IPMarket(market).swapExactPtForScy(
229
+ (, netSyFee) = IPMarket(market).swapExactPtForSy(
237
230
  address(YT),
238
231
  netYtOut, // exactPtIn = netYtOut
239
- _encodeSwapExactScyForYt(receiver, minYtOut)
232
+ _encodeSwapExactSyForYt(receiver, minYtOut)
240
233
  );
241
234
  }
242
235
 
243
- function _swapExactYtForScy(
236
+ function _swapExactYtForSy(
244
237
  address receiver,
245
238
  address market,
246
- ISuperComposableYield SCY,
239
+ IStandardizedYield SY,
247
240
  IPYieldToken YT,
248
241
  uint256 exactYtIn,
249
- uint256 minScyOut
250
- ) internal returns (uint256 netScyOut, uint256 netScyFee) {
251
- uint256 preScyBalance = SCY.balanceOf(receiver);
242
+ uint256 minSyOut
243
+ ) internal returns (uint256 netSyOut, uint256 netSyFee) {
244
+ uint256 preSyBalance = SY.balanceOf(receiver);
252
245
 
253
- (, netScyFee) = IPMarket(market).swapScyForExactPt(
246
+ (, netSyFee) = IPMarket(market).swapSyForExactPt(
254
247
  address(YT),
255
248
  exactYtIn, // exactPtOut = exactYtIn
256
- _encodeSwapYtForScy(receiver, minScyOut)
249
+ _encodeSwapYtForSy(receiver, minSyOut)
257
250
  ); // ignore return
258
251
 
259
- netScyOut = SCY.balanceOf(receiver) - preScyBalance;
252
+ netSyOut = SY.balanceOf(receiver) - preSyBalance;
260
253
  }
261
254
  }
@@ -46,45 +46,45 @@ contract PendleRouter is Proxy, Initializable, UUPSUpgradeable, BoringOwnableUpg
46
46
 
47
47
  function getRouterImplementation(bytes4 sig) public view returns (address) {
48
48
  if (
49
- sig == IPActionMintRedeem.mintScyFromToken.selector ||
50
- sig == IPActionMintRedeem.redeemScyToToken.selector ||
49
+ sig == IPActionMintRedeem.mintSyFromToken.selector ||
50
+ sig == IPActionMintRedeem.redeemSyToToken.selector ||
51
51
  sig == IPActionMintRedeem.mintPyFromToken.selector ||
52
52
  sig == IPActionMintRedeem.redeemPyToToken.selector ||
53
- sig == IPActionMintRedeem.mintPyFromScy.selector ||
54
- sig == IPActionMintRedeem.redeemPyToScy.selector ||
53
+ sig == IPActionMintRedeem.mintPyFromSy.selector ||
54
+ sig == IPActionMintRedeem.redeemPyToSy.selector ||
55
55
  sig == IPActionMintRedeem.redeemDueInterestAndRewards.selector ||
56
56
  sig == IPActionMintRedeem.redeemDueInterestAndRewardsThenSwapAll.selector
57
57
  ) {
58
58
  return ACTION_MINT_REDEEM;
59
59
  } else if (
60
- sig == IPActionAddRemoveLiq.addLiquidityDualScyAndPt.selector ||
60
+ sig == IPActionAddRemoveLiq.addLiquidityDualSyAndPt.selector ||
61
61
  sig == IPActionAddRemoveLiq.addLiquidityDualTokenAndPt.selector ||
62
62
  sig == IPActionAddRemoveLiq.addLiquiditySinglePt.selector ||
63
- sig == IPActionAddRemoveLiq.addLiquiditySingleScy.selector ||
63
+ sig == IPActionAddRemoveLiq.addLiquiditySingleSy.selector ||
64
64
  sig == IPActionAddRemoveLiq.addLiquiditySingleToken.selector ||
65
- sig == IPActionAddRemoveLiq.removeLiquidityDualScyAndPt.selector ||
65
+ sig == IPActionAddRemoveLiq.removeLiquidityDualSyAndPt.selector ||
66
66
  sig == IPActionAddRemoveLiq.removeLiquidityDualTokenAndPt.selector ||
67
67
  sig == IPActionAddRemoveLiq.removeLiquiditySinglePt.selector ||
68
- sig == IPActionAddRemoveLiq.removeLiquiditySingleScy.selector ||
68
+ sig == IPActionAddRemoveLiq.removeLiquiditySingleSy.selector ||
69
69
  sig == IPActionAddRemoveLiq.removeLiquiditySingleToken.selector
70
70
  ) {
71
71
  return ACTION_ADD_REMOVE_LIQ;
72
72
  } else if (
73
- sig == IPActionSwapPT.swapExactPtForScy.selector ||
74
- sig == IPActionSwapPT.swapPtForExactScy.selector ||
75
- sig == IPActionSwapPT.swapScyForExactPt.selector ||
76
- sig == IPActionSwapPT.swapExactScyForPt.selector ||
73
+ sig == IPActionSwapPT.swapExactPtForSy.selector ||
74
+ sig == IPActionSwapPT.swapPtForExactSy.selector ||
75
+ sig == IPActionSwapPT.swapSyForExactPt.selector ||
76
+ sig == IPActionSwapPT.swapExactSyForPt.selector ||
77
77
  sig == IPActionSwapPT.swapExactTokenForPt.selector ||
78
78
  sig == IPActionSwapPT.swapExactPtForToken.selector
79
79
  ) {
80
80
  return ACTION_SWAP_PT;
81
81
  } else if (
82
- sig == IPActionSwapYT.swapExactYtForScy.selector ||
83
- sig == IPActionSwapYT.swapScyForExactYt.selector ||
84
- sig == IPActionSwapYT.swapExactScyForYt.selector ||
82
+ sig == IPActionSwapYT.swapExactYtForSy.selector ||
83
+ sig == IPActionSwapYT.swapSyForExactYt.selector ||
84
+ sig == IPActionSwapYT.swapExactSyForYt.selector ||
85
85
  sig == IPActionSwapYT.swapExactTokenForYt.selector ||
86
86
  sig == IPActionSwapYT.swapExactYtForToken.selector ||
87
- sig == IPActionSwapYT.swapYtForExactScy.selector
87
+ sig == IPActionSwapYT.swapYtForExactSy.selector
88
88
  ) {
89
89
  return ACTION_SWAP_YT;
90
90
  } else if (
@@ -3,7 +3,7 @@ pragma solidity 0.8.17;
3
3
 
4
4
  import "../kyberswap/KyberSwapHelper.sol";
5
5
  import "../../core/libraries/TokenHelper.sol";
6
- import "../../interfaces/ISuperComposableYield.sol";
6
+ import "../../interfaces/IStandardizedYield.sol";
7
7
  import "../../interfaces/IPYieldToken.sol";
8
8
  import "../../core/libraries/Errors.sol";
9
9
 
@@ -17,63 +17,63 @@ abstract contract ActionBaseMintRedeem is TokenHelper, KyberSwapHelper {
17
17
  constructor(address _kyberSwapRouter) KyberSwapHelper(_kyberSwapRouter) {}
18
18
 
19
19
  /**
20
- * @notice swap token to baseToken through Uniswap's forks & use it to mint SCY
20
+ * @notice swap token to baseToken through Uniswap's forks & use it to mint SY
21
21
  */
22
- function _mintScyFromToken(
22
+ function _mintSyFromToken(
23
23
  address receiver,
24
- address SCY,
25
- uint256 minScyOut,
24
+ address SY,
25
+ uint256 minSyOut,
26
26
  TokenInput calldata input
27
- ) internal returns (uint256 netScyOut) {
27
+ ) internal returns (uint256 netSyOut) {
28
28
  _transferIn(input.tokenIn, msg.sender, input.netTokenIn);
29
- if (input.tokenIn != input.tokenMintScy) {
29
+ if (input.tokenIn != input.tokenMintSy) {
30
30
  _kyberswap(input.tokenIn, input.netTokenIn, input.kybercall);
31
31
  }
32
32
 
33
- _safeApproveInf(input.tokenMintScy, SCY);
33
+ _safeApproveInf(input.tokenMintSy, SY);
34
34
 
35
- uint256 tokenMintScyBal = _selfBalance(input.tokenMintScy);
36
- uint256 nativeAmountToAttach = input.tokenMintScy == NATIVE ? tokenMintScyBal : 0;
35
+ uint256 tokenMintSyBal = _selfBalance(input.tokenMintSy);
36
+ uint256 nativeAmountToAttach = input.tokenMintSy == NATIVE ? tokenMintSyBal : 0;
37
37
 
38
- netScyOut = ISuperComposableYield(SCY).deposit{ value: nativeAmountToAttach }(
38
+ netSyOut = IStandardizedYield(SY).deposit{ value: nativeAmountToAttach }(
39
39
  receiver,
40
- input.tokenMintScy,
41
- tokenMintScyBal,
42
- minScyOut
40
+ input.tokenMintSy,
41
+ tokenMintSyBal,
42
+ minSyOut
43
43
  );
44
44
  }
45
45
 
46
46
  /**
47
- * @notice redeem SCY to baseToken -> swap baseToken to token through Uniswap's forks
47
+ * @notice redeem SY to baseToken -> swap baseToken to token through Uniswap's forks
48
48
  */
49
- function _redeemScyToToken(
49
+ function _redeemSyToToken(
50
50
  address receiver,
51
- address SCY,
52
- uint256 netScyIn,
51
+ address SY,
52
+ uint256 netSyIn,
53
53
  TokenOutput calldata output,
54
54
  bool doPull
55
55
  ) internal returns (uint256 netTokenOut) {
56
56
  if (doPull) {
57
- IERC20(SCY).safeTransferFrom(msg.sender, SCY, netScyIn);
57
+ IERC20(SY).safeTransferFrom(msg.sender, SY, netSyIn);
58
58
  }
59
59
 
60
- if (output.tokenRedeemScy == output.tokenOut) {
61
- netTokenOut = ISuperComposableYield(SCY).redeem(
60
+ if (output.tokenRedeemSy == output.tokenOut) {
61
+ netTokenOut = IStandardizedYield(SY).redeem(
62
62
  receiver,
63
- netScyIn,
64
- output.tokenRedeemScy,
63
+ netSyIn,
64
+ output.tokenRedeemSy,
65
65
  output.minTokenOut,
66
66
  true
67
67
  );
68
68
  } else {
69
- uint256 netTokenRedeemed = ISuperComposableYield(SCY).redeem(
69
+ uint256 netTokenRedeemed = IStandardizedYield(SY).redeem(
70
70
  address(this),
71
- netScyIn,
72
- output.tokenRedeemScy,
71
+ netSyIn,
72
+ output.tokenRedeemSy,
73
73
  1,
74
74
  true
75
75
  );
76
- _kyberswap(output.tokenRedeemScy, netTokenRedeemed, output.kybercall);
76
+ _kyberswap(output.tokenRedeemSy, netTokenRedeemed, output.kybercall);
77
77
 
78
78
  netTokenOut = _selfBalance(output.tokenOut);
79
79
 
@@ -85,7 +85,7 @@ abstract contract ActionBaseMintRedeem is TokenHelper, KyberSwapHelper {
85
85
  }
86
86
 
87
87
  /**
88
- * @notice swap token to baseToken through Uniswap's forks -> convert to SCY -> convert to PT + YT
88
+ * @notice swap token to baseToken through Uniswap's forks -> convert to SY -> convert to PT + YT
89
89
  */
90
90
  function _mintPyFromToken(
91
91
  address receiver,
@@ -93,16 +93,16 @@ abstract contract ActionBaseMintRedeem is TokenHelper, KyberSwapHelper {
93
93
  uint256 minPyOut,
94
94
  TokenInput calldata input
95
95
  ) internal returns (uint256 netPyOut) {
96
- address SCY = IPYieldToken(YT).SCY();
96
+ address SY = IPYieldToken(YT).SY();
97
97
 
98
- _mintScyFromToken(YT, SCY, 1, input);
98
+ _mintSyFromToken(YT, SY, 1, input);
99
99
 
100
100
  netPyOut = IPYieldToken(YT).mintPY(receiver, receiver);
101
101
  if (netPyOut < minPyOut) revert Errors.RouterInsufficientPYOut(netPyOut, minPyOut);
102
102
  }
103
103
 
104
104
  /**
105
- * @notice redeem PT + YT to SCY -> redeem SCY to baseToken -> swap baseToken to token through Uniswap's forks.
105
+ * @notice redeem PT + YT to SY -> redeem SY to baseToken -> swap baseToken to token through Uniswap's forks.
106
106
  If the YT hasn't expired, both PT & YT will be needed to redeem. Else, only PT is needed
107
107
  */
108
108
  function _redeemPyToToken(
@@ -113,7 +113,7 @@ abstract contract ActionBaseMintRedeem is TokenHelper, KyberSwapHelper {
113
113
  bool doPull
114
114
  ) internal returns (uint256 netTokenOut) {
115
115
  address PT = IPYieldToken(YT).PT();
116
- address SCY = IPYieldToken(YT).SCY();
116
+ address SY = IPYieldToken(YT).SY();
117
117
 
118
118
  if (doPull) {
119
119
  bool needToBurnYt = (!IPYieldToken(YT).isExpired());
@@ -121,35 +121,35 @@ abstract contract ActionBaseMintRedeem is TokenHelper, KyberSwapHelper {
121
121
  if (needToBurnYt) IERC20(YT).safeTransferFrom(msg.sender, YT, netPyIn);
122
122
  }
123
123
 
124
- uint256 amountScyOut = IPYieldToken(YT).redeemPY(SCY); // ignore return
124
+ uint256 amountSyOut = IPYieldToken(YT).redeemPY(SY); // ignore return
125
125
 
126
- netTokenOut = _redeemScyToToken(receiver, SCY, amountScyOut, output, false);
126
+ netTokenOut = _redeemSyToToken(receiver, SY, amountSyOut, output, false);
127
127
  }
128
128
 
129
- function _mintPyFromScy(
129
+ function _mintPyFromSy(
130
130
  address receiver,
131
131
  address YT,
132
- uint256 netScyIn,
132
+ uint256 netSyIn,
133
133
  uint256 minPyOut,
134
134
  bool doPull
135
135
  ) internal returns (uint256 netPyOut) {
136
- address SCY = IPYieldToken(YT).SCY();
136
+ address SY = IPYieldToken(YT).SY();
137
137
 
138
138
  if (doPull) {
139
- IERC20(SCY).safeTransferFrom(msg.sender, YT, netScyIn);
139
+ IERC20(SY).safeTransferFrom(msg.sender, YT, netSyIn);
140
140
  }
141
141
 
142
142
  netPyOut = IPYieldToken(YT).mintPY(receiver, receiver);
143
143
  if (netPyOut < minPyOut) revert Errors.RouterInsufficientPYOut(netPyOut, minPyOut);
144
144
  }
145
145
 
146
- function _redeemPyToScy(
146
+ function _redeemPyToSy(
147
147
  address receiver,
148
148
  address YT,
149
149
  uint256 netPyIn,
150
- uint256 minScyOut,
150
+ uint256 minSyOut,
151
151
  bool doPull
152
- ) internal returns (uint256 netScyOut) {
152
+ ) internal returns (uint256 netSyOut) {
153
153
  address PT = IPYieldToken(YT).PT();
154
154
 
155
155
  if (doPull) {
@@ -158,7 +158,7 @@ abstract contract ActionBaseMintRedeem is TokenHelper, KyberSwapHelper {
158
158
  if (needToBurnYt) IERC20(YT).safeTransferFrom(msg.sender, YT, netPyIn);
159
159
  }
160
160
 
161
- netScyOut = IPYieldToken(YT).redeemPY(receiver);
162
- if (netScyOut < minScyOut) revert Errors.RouterInsufficientScyOut(netScyOut, minScyOut);
161
+ netSyOut = IPYieldToken(YT).redeemPY(receiver);
162
+ if (netSyOut < minSyOut) revert Errors.RouterInsufficientSyOut(netSyOut, minSyOut);
163
163
  }
164
164
  }
@@ -3,26 +3,26 @@ pragma solidity 0.8.17;
3
3
 
4
4
  abstract contract CallbackHelper {
5
5
  enum ActionType {
6
- SwapScyForExactYt,
7
- SwapExactScyForYt,
8
- SwapYtForScy,
6
+ SwapSyForExactYt,
7
+ SwapExactSyForYt,
8
+ SwapYtForSy,
9
9
  SwapExactYtForPt,
10
10
  SwapExactPtForYt
11
11
  }
12
12
 
13
13
  /// ------------------------------------------------------------
14
- /// SwapExactScyForYt
14
+ /// SwapExactSyForYt
15
15
  /// ------------------------------------------------------------
16
16
 
17
- function _encodeSwapExactScyForYt(address receiver, uint256 minYtOut)
17
+ function _encodeSwapExactSyForYt(address receiver, uint256 minYtOut)
18
18
  internal
19
19
  pure
20
20
  returns (bytes memory)
21
21
  {
22
- return abi.encode(ActionType.SwapExactScyForYt, receiver, minYtOut);
22
+ return abi.encode(ActionType.SwapExactSyForYt, receiver, minYtOut);
23
23
  }
24
24
 
25
- function _decodeSwapExactScyForYt(bytes memory data)
25
+ function _decodeSwapExactSyForYt(bytes memory data)
26
26
  internal
27
27
  pure
28
28
  returns (address receiver, uint256 minYtOut)
@@ -31,47 +31,47 @@ abstract contract CallbackHelper {
31
31
  }
32
32
 
33
33
  /// ------------------------------------------------------------
34
- /// SwapScyForExactYt
34
+ /// SwapSyForExactYt
35
35
  /// ------------------------------------------------------------
36
36
 
37
- function _encodeSwapScyForExactYt(
37
+ function _encodeSwapSyForExactYt(
38
38
  address payer,
39
39
  address receiver,
40
- uint256 maxScyIn
40
+ uint256 maxSyIn
41
41
  ) internal pure returns (bytes memory) {
42
- return abi.encode(ActionType.SwapScyForExactYt, payer, receiver, maxScyIn);
42
+ return abi.encode(ActionType.SwapSyForExactYt, payer, receiver, maxSyIn);
43
43
  }
44
44
 
45
- function _decodeSwapScyForExactYt(bytes memory data)
45
+ function _decodeSwapSyForExactYt(bytes memory data)
46
46
  internal
47
47
  pure
48
48
  returns (
49
49
  address payer,
50
50
  address receiver,
51
- uint256 maxScyIn
51
+ uint256 maxSyIn
52
52
  )
53
53
  {
54
- (, payer, receiver, maxScyIn) = abi.decode(data, (ActionType, address, address, uint256));
54
+ (, payer, receiver, maxSyIn) = abi.decode(data, (ActionType, address, address, uint256));
55
55
  }
56
56
 
57
57
  /// ------------------------------------------------------------
58
- /// SwapYtForScy (common encode & decode)
58
+ /// SwapYtForSy (common encode & decode)
59
59
  /// ------------------------------------------------------------
60
60
 
61
- function _encodeSwapYtForScy(address receiver, uint256 minScyOut)
61
+ function _encodeSwapYtForSy(address receiver, uint256 minSyOut)
62
62
  internal
63
63
  pure
64
64
  returns (bytes memory)
65
65
  {
66
- return abi.encode(ActionType.SwapYtForScy, receiver, minScyOut);
66
+ return abi.encode(ActionType.SwapYtForSy, receiver, minSyOut);
67
67
  }
68
68
 
69
- function _decodeSwapYtForScy(bytes memory data)
69
+ function _decodeSwapYtForSy(bytes memory data)
70
70
  internal
71
71
  pure
72
- returns (address receiver, uint256 minScyOut)
72
+ returns (address receiver, uint256 minSyOut)
73
73
  {
74
- (, receiver, minScyOut) = abi.decode(data, (ActionType, address, uint256));
74
+ (, receiver, minSyOut) = abi.decode(data, (ActionType, address, uint256));
75
75
  }
76
76
 
77
77
  function _encodeSwapExactYtForPt(