@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
@@ -10,6 +10,7 @@ contract ActionMintRedeem is IPActionMintRedeem, ActionBaseMintRedeem {
10
10
  using MarketMathCore for MarketState;
11
11
  using Math for uint256;
12
12
  using Math for int256;
13
+ using SafeERC20 for IERC20;
13
14
 
14
15
  /// @dev since this contract will be proxied, it must not contains non-immutable variables
15
16
  constructor(address _kyberSwapRouter)
@@ -17,33 +18,26 @@ contract ActionMintRedeem is IPActionMintRedeem, ActionBaseMintRedeem {
17
18
  {}
18
19
 
19
20
  /// @dev refer to the internal function
20
- function mintScyFromToken(
21
+ function mintSyFromToken(
21
22
  address receiver,
22
- address SCY,
23
- uint256 minScyOut,
23
+ address SY,
24
+ uint256 minSyOut,
24
25
  TokenInput calldata input
25
- ) external payable returns (uint256 netScyOut) {
26
- netScyOut = _mintScyFromToken(receiver, SCY, minScyOut, input);
26
+ ) external payable returns (uint256 netSyOut) {
27
+ netSyOut = _mintSyFromToken(receiver, SY, minSyOut, input);
27
28
 
28
- emit MintScyFromToken(
29
- msg.sender,
30
- receiver,
31
- SCY,
32
- input.tokenIn,
33
- input.netTokenIn,
34
- netScyOut
35
- );
29
+ emit MintSyFromToken(msg.sender, receiver, SY, input.tokenIn, input.netTokenIn, netSyOut);
36
30
  }
37
31
 
38
32
  /// @dev refer to the internal function
39
- function redeemScyToToken(
33
+ function redeemSyToToken(
40
34
  address receiver,
41
- address SCY,
42
- uint256 netScyIn,
35
+ address SY,
36
+ uint256 netSyIn,
43
37
  TokenOutput calldata output
44
38
  ) external returns (uint256 netTokenOut) {
45
- netTokenOut = _redeemScyToToken(receiver, SCY, netScyIn, output, true);
46
- emit RedeemScyToToken(msg.sender, receiver, SCY, netScyIn, output.tokenOut, netTokenOut);
39
+ netTokenOut = _redeemSyToToken(receiver, SY, netSyIn, output, true);
40
+ emit RedeemSyToToken(msg.sender, receiver, SY, netSyIn, output.tokenOut, netTokenOut);
47
41
  }
48
42
 
49
43
  /// @dev refer to the internal function
@@ -68,43 +62,43 @@ contract ActionMintRedeem is IPActionMintRedeem, ActionBaseMintRedeem {
68
62
  emit RedeemPyToToken(msg.sender, receiver, YT, netPyIn, output.tokenOut, netTokenOut);
69
63
  }
70
64
 
71
- function mintPyFromScy(
65
+ function mintPyFromSy(
72
66
  address receiver,
73
67
  address YT,
74
- uint256 netScyIn,
68
+ uint256 netSyIn,
75
69
  uint256 minPyOut
76
70
  ) external returns (uint256 netPyOut) {
77
- netPyOut = _mintPyFromScy(receiver, YT, netScyIn, minPyOut, true);
78
- emit MintPyFromScy(msg.sender, receiver, YT, netScyIn, netPyOut);
71
+ netPyOut = _mintPyFromSy(receiver, YT, netSyIn, minPyOut, true);
72
+ emit MintPyFromSy(msg.sender, receiver, YT, netSyIn, netPyOut);
79
73
  }
80
74
 
81
- function redeemPyToScy(
75
+ function redeemPyToSy(
82
76
  address receiver,
83
77
  address YT,
84
78
  uint256 netPyIn,
85
- uint256 minScyOut
86
- ) external returns (uint256 netScyOut) {
87
- netScyOut = _redeemPyToScy(receiver, YT, netPyIn, minScyOut, true);
88
- emit RedeemPyToScy(msg.sender, receiver, YT, netPyIn, netScyOut);
79
+ uint256 minSyOut
80
+ ) external returns (uint256 netSyOut) {
81
+ netSyOut = _redeemPyToSy(receiver, YT, netPyIn, minSyOut, true);
82
+ emit RedeemPyToSy(msg.sender, receiver, YT, netPyIn, netSyOut);
89
83
  }
90
84
 
91
85
  function redeemDueInterestAndRewards(
92
86
  address user,
93
- address[] calldata scys,
87
+ address[] calldata sys,
94
88
  address[] calldata yts,
95
89
  address[] calldata markets
96
90
  )
97
91
  external
98
92
  returns (
99
- uint256[][] memory scyRewards,
93
+ uint256[][] memory syRewards,
100
94
  uint256[] memory ytInterests,
101
95
  uint256[][] memory ytRewards,
102
96
  uint256[][] memory marketRewards
103
97
  )
104
98
  {
105
- scyRewards = new uint256[][](scys.length);
106
- for (uint256 i = 0; i < scys.length; ++i) {
107
- scyRewards[i] = ISuperComposableYield(scys[i]).claimRewards(user);
99
+ syRewards = new uint256[][](sys.length);
100
+ for (uint256 i = 0; i < sys.length; ++i) {
101
+ syRewards[i] = IStandardizedYield(sys[i]).claimRewards(user);
108
102
  }
109
103
 
110
104
  ytInterests = new uint256[](yts.length);
@@ -123,10 +117,10 @@ contract ActionMintRedeem is IPActionMintRedeem, ActionBaseMintRedeem {
123
117
  }
124
118
  emit RedeemDueInterestAndRewards(
125
119
  user,
126
- scys,
120
+ sys,
127
121
  yts,
128
122
  markets,
129
- scyRewards,
123
+ syRewards,
130
124
  ytInterests,
131
125
  ytRewards,
132
126
  marketRewards
@@ -139,7 +133,7 @@ contract ActionMintRedeem is IPActionMintRedeem, ActionBaseMintRedeem {
139
133
  }
140
134
 
141
135
  function redeemDueInterestAndRewardsThenSwapAll(
142
- address[] calldata scys,
136
+ address[] calldata sys,
143
137
  RouterYtRedeemStruct calldata dataYT,
144
138
  address[] calldata markets,
145
139
  RouterSwapAllStruct calldata dataSwap
@@ -147,18 +141,18 @@ contract ActionMintRedeem is IPActionMintRedeem, ActionBaseMintRedeem {
147
141
  if (dataSwap.tokens.length != dataSwap.kybercalls.length)
148
142
  revert Errors.ArrayLengthMismatch();
149
143
 
150
- if (dataYT.tokenRedeemScys.length != dataYT.scyAddrs.length)
144
+ if (dataYT.tokenRedeemSys.length != dataYT.syAddrs.length)
151
145
  revert Errors.ArrayLengthMismatch();
152
146
 
153
147
  RouterTokenAmounts memory tokensOut = _newRouterTokenAmounts(dataSwap.tokens);
154
- RouterTokenAmounts memory scysOut = _newRouterTokenAmounts(dataYT.scyAddrs);
148
+ RouterTokenAmounts memory sysOut = _newRouterTokenAmounts(dataYT.syAddrs);
155
149
 
156
- // redeem SCY
157
- for (uint256 i = 0; i < scys.length; ++i) {
158
- ISuperComposableYield SCY = ISuperComposableYield(scys[i]);
150
+ // redeem SY
151
+ for (uint256 i = 0; i < sys.length; ++i) {
152
+ IStandardizedYield SY = IStandardizedYield(sys[i]);
159
153
 
160
- address[] memory rewardTokens = SCY.getRewardTokens();
161
- uint256[] memory rewardAmounts = SCY.claimRewards(msg.sender);
154
+ address[] memory rewardTokens = SY.getRewardTokens();
155
+ uint256[] memory rewardAmounts = SY.claimRewards(msg.sender);
162
156
  _addTokenAmounts(tokensOut, rewardTokens, rewardAmounts);
163
157
  }
164
158
 
@@ -169,10 +163,10 @@ contract ActionMintRedeem is IPActionMintRedeem, ActionBaseMintRedeem {
169
163
  (uint256 interestAmount, uint256[] memory rewardAmounts) = YT
170
164
  .redeemDueInterestAndRewards(msg.sender, true, true);
171
165
 
172
- address scyAddr = YT.SCY();
166
+ address syAddr = YT.SY();
173
167
  address[] memory rewardTokens = YT.getRewardTokens();
174
168
 
175
- _addTokenAmount(scysOut, scyAddr, interestAmount);
169
+ _addTokenAmount(sysOut, syAddr, interestAmount);
176
170
  _addTokenAmounts(tokensOut, rewardTokens, rewardAmounts);
177
171
  }
178
172
 
@@ -186,8 +180,14 @@ contract ActionMintRedeem is IPActionMintRedeem, ActionBaseMintRedeem {
186
180
  }
187
181
 
188
182
  // guaranteed no ETH, all rewards are ERC20
189
- _transferFrom(tokensOut.tokens, msg.sender, address(this), tokensOut.amounts);
190
- _redeemAllScys(scysOut, dataYT.tokenRedeemScys, tokensOut);
183
+ for (uint256 i = 0; i < tokensOut.tokens.length; ++i) {
184
+ IERC20(tokensOut.tokens[i]).safeTransferFrom(
185
+ msg.sender,
186
+ address(this),
187
+ tokensOut.amounts[i]
188
+ );
189
+ }
190
+ _redeemAllSys(sysOut, dataYT.tokenRedeemSys, tokensOut);
191
191
 
192
192
  // now swap all to outputToken
193
193
  netTokenOut = _swapAllToOutputToken(tokensOut, dataSwap);
@@ -199,7 +199,7 @@ contract ActionMintRedeem is IPActionMintRedeem, ActionBaseMintRedeem {
199
199
 
200
200
  emit RedeemDueInterestAndRewardsThenSwapAll(
201
201
  msg.sender,
202
- scys,
202
+ sys,
203
203
  dataYT.yts,
204
204
  markets,
205
205
  dataSwap.outputToken,
@@ -215,25 +215,25 @@ contract ActionMintRedeem is IPActionMintRedeem, ActionBaseMintRedeem {
215
215
  return RouterTokenAmounts(tokens, new uint256[](tokens.length));
216
216
  }
217
217
 
218
- /// @dev pull SCYs from users & redeem them, then add to tokensOut
219
- function _redeemAllScys(
220
- RouterTokenAmounts memory scys,
221
- address[] calldata tokenRedeemScys,
218
+ /// @dev pull SYs from users & redeem them, then add to tokensOut
219
+ function _redeemAllSys(
220
+ RouterTokenAmounts memory sys,
221
+ address[] calldata tokenRedeemSys,
222
222
  RouterTokenAmounts memory tokensOut
223
223
  ) internal {
224
- for (uint256 i = 0; i < scys.tokens.length; ++i) {
225
- if (scys.amounts[i] == 0) continue;
224
+ for (uint256 i = 0; i < sys.tokens.length; ++i) {
225
+ if (sys.amounts[i] == 0) continue;
226
226
 
227
- _transferFrom(scys.tokens[i], msg.sender, scys.tokens[i], scys.amounts[i]);
228
- uint256 amountOut = ISuperComposableYield(scys.tokens[i]).redeem(
227
+ IERC20(sys.tokens[i]).safeTransferFrom(msg.sender, sys.tokens[i], sys.amounts[i]);
228
+ uint256 amountOut = IStandardizedYield(sys.tokens[i]).redeem(
229
229
  address(this),
230
- scys.amounts[i],
231
- tokenRedeemScys[i],
230
+ sys.amounts[i],
231
+ tokenRedeemSys[i],
232
232
  1,
233
233
  true
234
234
  );
235
235
 
236
- _addTokenAmount(tokensOut, tokenRedeemScys[i], amountOut);
236
+ _addTokenAmount(tokensOut, tokenRedeemSys[i], amountOut);
237
237
  }
238
238
  }
239
239
 
@@ -20,43 +20,39 @@ contract ActionSwapPT is IPActionSwapPT, ActionBaseMintRedeem {
20
20
  ActionBaseMintRedeem(_kyberSwapRouter) //solhint-disable-next-line no-empty-blocks
21
21
  {}
22
22
 
23
- function swapExactPtForScy(
23
+ function swapExactPtForSy(
24
24
  address receiver,
25
25
  address market,
26
26
  uint256 exactPtIn,
27
- uint256 minScyOut
28
- ) external returns (uint256 netScyOut, uint256 netScyFee) {
27
+ uint256 minSyOut
28
+ ) external returns (uint256 netSyOut, uint256 netSyFee) {
29
29
  (, IPPrincipalToken PT, ) = IPMarket(market).readTokens();
30
30
  IERC20(address(PT)).safeTransferFrom(msg.sender, market, exactPtIn);
31
31
 
32
- (netScyOut, netScyFee) = IPMarket(market).swapExactPtForScy(
33
- receiver,
34
- exactPtIn,
35
- EMPTY_BYTES
36
- );
32
+ (netSyOut, netSyFee) = IPMarket(market).swapExactPtForSy(receiver, exactPtIn, EMPTY_BYTES);
37
33
 
38
- if (netScyOut < minScyOut) revert Errors.RouterInsufficientScyOut(netScyOut, minScyOut);
34
+ if (netSyOut < minSyOut) revert Errors.RouterInsufficientSyOut(netSyOut, minSyOut);
39
35
 
40
- emit SwapPtAndScy(msg.sender, market, receiver, exactPtIn.neg(), netScyOut.Int());
36
+ emit SwapPtAndSy(msg.sender, market, receiver, exactPtIn.neg(), netSyOut.Int());
41
37
  }
42
38
 
43
39
  /**
44
- * @notice Note that the amount of SCY out will be a bit more than `exactScyOut`, since an approximation is used. It's
45
- guaranteed that the `netScyOut` is at least `exactScyOut`
40
+ * @notice Note that the amount of SY out will be a bit more than `exactSyOut`, since an approximation is used. It's
41
+ guaranteed that the `netSyOut` is at least `exactSyOut`
46
42
  */
47
- function swapPtForExactScy(
43
+ function swapPtForExactSy(
48
44
  address receiver,
49
45
  address market,
50
- uint256 exactScyOut,
46
+ uint256 exactSyOut,
51
47
  uint256 maxPtIn,
52
48
  ApproxParams calldata guessPtIn
53
- ) external returns (uint256 netPtIn, uint256 netScyFee) {
49
+ ) external returns (uint256 netPtIn, uint256 netSyFee) {
54
50
  MarketState memory state = IPMarket(market).readState();
55
51
  (, IPPrincipalToken PT, IPYieldToken YT) = IPMarket(market).readTokens();
56
52
 
57
- (netPtIn, , ) = state.approxSwapPtForExactScy(
53
+ (netPtIn, , ) = state.approxSwapPtForExactSy(
58
54
  YT.newIndex(),
59
- exactScyOut,
55
+ exactSyOut,
60
56
  block.timestamp,
61
57
  guessPtIn
62
58
  );
@@ -65,67 +61,63 @@ contract ActionSwapPT is IPActionSwapPT, ActionBaseMintRedeem {
65
61
 
66
62
  IERC20(PT).safeTransferFrom(msg.sender, market, netPtIn);
67
63
 
68
- uint256 netScyOut;
69
- (netScyOut, netScyFee) = IPMarket(market).swapExactPtForScy(
70
- receiver,
71
- netPtIn,
72
- EMPTY_BYTES
73
- );
64
+ uint256 netSyOut;
65
+ (netSyOut, netSyFee) = IPMarket(market).swapExactPtForSy(receiver, netPtIn, EMPTY_BYTES);
74
66
 
75
67
  // fail-safe
76
- if (netScyOut < exactScyOut) assert(false);
68
+ if (netSyOut < exactSyOut) assert(false);
77
69
 
78
- emit SwapPtAndScy(msg.sender, market, receiver, netPtIn.neg(), exactScyOut.Int());
70
+ emit SwapPtAndSy(msg.sender, market, receiver, netPtIn.neg(), exactSyOut.Int());
79
71
  }
80
72
 
81
- function swapScyForExactPt(
73
+ function swapSyForExactPt(
82
74
  address receiver,
83
75
  address market,
84
76
  uint256 exactPtOut,
85
- uint256 maxScyIn
86
- ) external returns (uint256 netScyIn, uint256 netScyFee) {
77
+ uint256 maxSyIn
78
+ ) external returns (uint256 netSyIn, uint256 netSyFee) {
87
79
  MarketState memory state = IPMarket(market).readState();
88
- (ISuperComposableYield SCY, , IPYieldToken YT) = IPMarket(market).readTokens();
80
+ (IStandardizedYield SY, , IPYieldToken YT) = IPMarket(market).readTokens();
89
81
 
90
- (netScyIn, ) = state.swapScyForExactPt(YT.newIndex(), exactPtOut, block.timestamp);
82
+ (netSyIn, ) = state.swapSyForExactPt(YT.newIndex(), exactPtOut, block.timestamp);
91
83
 
92
- if (netScyIn > maxScyIn) revert Errors.RouterExceededLimitScyIn(netScyIn, maxScyIn);
84
+ if (netSyIn > maxSyIn) revert Errors.RouterExceededLimitSyIn(netSyIn, maxSyIn);
93
85
 
94
- IERC20(SCY).safeTransferFrom(msg.sender, market, netScyIn);
86
+ IERC20(SY).safeTransferFrom(msg.sender, market, netSyIn);
95
87
 
96
- (, netScyFee) = IPMarket(market).swapScyForExactPt(receiver, exactPtOut, EMPTY_BYTES); // ignore return
88
+ (, netSyFee) = IPMarket(market).swapSyForExactPt(receiver, exactPtOut, EMPTY_BYTES); // ignore return
97
89
 
98
- // no fail-safe since exactly netScyIn will go into the market
99
- emit SwapPtAndScy(msg.sender, market, receiver, exactPtOut.Int(), netScyIn.neg());
90
+ // no fail-safe since exactly netSyIn will go into the market
91
+ emit SwapPtAndSy(msg.sender, market, receiver, exactPtOut.Int(), netSyIn.neg());
100
92
  }
101
93
 
102
- function swapExactScyForPt(
94
+ function swapExactSyForPt(
103
95
  address receiver,
104
96
  address market,
105
- uint256 exactScyIn,
97
+ uint256 exactSyIn,
106
98
  uint256 minPtOut,
107
99
  ApproxParams calldata guessPtOut
108
- ) external returns (uint256 netPtOut, uint256 netScyFee) {
109
- (ISuperComposableYield SCY, , IPYieldToken YT) = IPMarket(market).readTokens();
100
+ ) external returns (uint256 netPtOut, uint256 netSyFee) {
101
+ (IStandardizedYield SY, , IPYieldToken YT) = IPMarket(market).readTokens();
110
102
 
111
- IERC20(SCY).safeTransferFrom(msg.sender, market, exactScyIn);
103
+ IERC20(SY).safeTransferFrom(msg.sender, market, exactSyIn);
112
104
 
113
- (netPtOut, netScyFee) = _swapExactScyForPt(
105
+ (netPtOut, netSyFee) = _swapExactSyForPt(
114
106
  receiver,
115
107
  market,
116
108
  YT,
117
- exactScyIn,
109
+ exactSyIn,
118
110
  minPtOut,
119
111
  guessPtOut
120
112
  );
121
113
 
122
- emit SwapPtAndScy(msg.sender, market, receiver, netPtOut.Int(), exactScyIn.neg());
114
+ emit SwapPtAndSy(msg.sender, market, receiver, netPtOut.Int(), exactSyIn.neg());
123
115
  }
124
116
 
125
117
  /**
126
- * @notice swap from any ERC20 tokens, through Uniswap's forks, to get baseTokens to make SCY, then swap
127
- from SCY to PT
128
- * @dev simply a combination of _mintScyFromToken & _swapExactScyForPt
118
+ * @notice swap from any ERC20 tokens, through Uniswap's forks, to get baseTokens to make SY, then swap
119
+ from SY to PT
120
+ * @dev simply a combination of _mintSyFromToken & _swapExactSyForPt
129
121
  */
130
122
  function swapExactTokenForPt(
131
123
  address receiver,
@@ -133,18 +125,18 @@ contract ActionSwapPT is IPActionSwapPT, ActionBaseMintRedeem {
133
125
  uint256 minPtOut,
134
126
  ApproxParams calldata guessPtOut,
135
127
  TokenInput calldata input
136
- ) external payable returns (uint256 netPtOut, uint256 netScyFee) {
137
- (ISuperComposableYield SCY, , IPYieldToken YT) = IPMarket(market).readTokens();
128
+ ) external payable returns (uint256 netPtOut, uint256 netSyFee) {
129
+ (IStandardizedYield SY, , IPYieldToken YT) = IPMarket(market).readTokens();
138
130
 
139
- // all output SCY is transferred directly to the market
140
- uint256 netScyUseToBuyPt = _mintScyFromToken(address(market), address(SCY), 1, input);
131
+ // all output SY is transferred directly to the market
132
+ uint256 netSyUseToBuyPt = _mintSyFromToken(address(market), address(SY), 1, input);
141
133
 
142
- // SCY is already in the market, hence doPull = false
143
- (netPtOut, netScyFee) = _swapExactScyForPt(
134
+ // SY is already in the market, hence doPull = false
135
+ (netPtOut, netSyFee) = _swapExactSyForPt(
144
136
  receiver,
145
137
  market,
146
138
  YT,
147
- netScyUseToBuyPt,
139
+ netSyUseToBuyPt,
148
140
  minPtOut,
149
141
  guessPtOut
150
142
  );
@@ -160,29 +152,29 @@ contract ActionSwapPT is IPActionSwapPT, ActionBaseMintRedeem {
160
152
  }
161
153
 
162
154
  /**
163
- * @notice swap from PT to SCY, then redeem SCY to baseToken & swap through Uniswap's forks to get tokenOut
164
- * @dev simply a combination of _swapExactPtForScy & _redeemScyToToken
155
+ * @notice swap from PT to SY, then redeem SY to baseToken & swap through Uniswap's forks to get tokenOut
156
+ * @dev simply a combination of _swapExactPtForSy & _redeemSyToToken
165
157
  */
166
158
  function swapExactPtForToken(
167
159
  address receiver,
168
160
  address market,
169
161
  uint256 exactPtIn,
170
162
  TokenOutput calldata output
171
- ) external returns (uint256 netTokenOut, uint256 netScyFee) {
172
- (ISuperComposableYield SCY, IPPrincipalToken PT, ) = IPMarket(market).readTokens();
163
+ ) external returns (uint256 netTokenOut, uint256 netSyFee) {
164
+ (IStandardizedYield SY, IPPrincipalToken PT, ) = IPMarket(market).readTokens();
173
165
 
174
166
  IERC20(address(PT)).safeTransferFrom(msg.sender, market, exactPtIn);
175
167
 
176
- // all output SCY is directly transferred to the SCY contract
177
- uint256 netScyReceived;
178
- (netScyReceived, netScyFee) = IPMarket(market).swapExactPtForScy(
179
- address(SCY),
168
+ // all output SY is directly transferred to the SY contract
169
+ uint256 netSyReceived;
170
+ (netSyReceived, netSyFee) = IPMarket(market).swapExactPtForSy(
171
+ address(SY),
180
172
  exactPtIn,
181
173
  EMPTY_BYTES
182
174
  );
183
175
 
184
- // since all SCY is already at the SCY contract, doPull = false
185
- netTokenOut = _redeemScyToToken(receiver, address(SCY), netScyReceived, output, false);
176
+ // since all SY is already at the SY contract, doPull = false
177
+ netTokenOut = _redeemSyToToken(receiver, address(SY), netSyReceived, output, false);
186
178
 
187
179
  emit SwapPtAndToken(
188
180
  msg.sender,
@@ -194,26 +186,26 @@ contract ActionSwapPT is IPActionSwapPT, ActionBaseMintRedeem {
194
186
  );
195
187
  }
196
188
 
197
- function _swapExactScyForPt(
189
+ function _swapExactSyForPt(
198
190
  address receiver,
199
191
  address market,
200
192
  IPYieldToken YT,
201
- uint256 exactScyIn,
193
+ uint256 exactSyIn,
202
194
  uint256 minPtOut,
203
195
  ApproxParams calldata guessPtOut
204
- ) internal returns (uint256 netPtOut, uint256 netScyFee) {
196
+ ) internal returns (uint256 netPtOut, uint256 netSyFee) {
205
197
  MarketState memory state = IPMarket(market).readState();
206
198
 
207
- (netPtOut, ) = state.approxSwapExactScyForPt(
199
+ (netPtOut, ) = state.approxSwapExactSyForPt(
208
200
  YT.newIndex(),
209
- exactScyIn,
201
+ exactSyIn,
210
202
  block.timestamp,
211
203
  guessPtOut
212
204
  );
213
205
 
214
206
  if (netPtOut < minPtOut) revert Errors.RouterInsufficientPtOut(netPtOut, minPtOut);
215
207
 
216
- (, netScyFee) = IPMarket(market).swapScyForExactPt(receiver, netPtOut, EMPTY_BYTES);
208
+ (, netSyFee) = IPMarket(market).swapSyForExactPt(receiver, netPtOut, EMPTY_BYTES);
217
209
  // no fail-safe since exactly netPtOut >= minPtOut will be out
218
210
  }
219
211
  }
@@ -13,7 +13,7 @@ contract ActionSwapPTYT is IPActionSwapPTYT, CallbackHelper {
13
13
  using Math for int256;
14
14
  using SafeERC20 for IERC20;
15
15
  using PYIndexLib for IPYieldToken;
16
- using SafeERC20 for ISuperComposableYield;
16
+ using SafeERC20 for IStandardizedYield;
17
17
  using SafeERC20 for IPYieldToken;
18
18
  using SafeERC20 for IPPrincipalToken;
19
19
 
@@ -29,14 +29,14 @@ contract ActionSwapPTYT is IPActionSwapPTYT, CallbackHelper {
29
29
  uint256 exactPtIn,
30
30
  uint256 minYtOut,
31
31
  ApproxParams calldata guessTotalPtToSwap
32
- ) external returns (uint256 netYtOut, uint256 netScyFee) {
32
+ ) external returns (uint256 netYtOut, uint256 netSyFee) {
33
33
  (, IPPrincipalToken PT, IPYieldToken YT) = IPMarket(market).readTokens();
34
34
  MarketState memory state = IPMarket(market).readState();
35
35
 
36
36
  PT.safeTransferFrom(msg.sender, market, exactPtIn);
37
37
 
38
38
  uint256 totalPtToSwap;
39
- (netYtOut, totalPtToSwap, netScyFee) = state.approxSwapExactPtForYt(
39
+ (netYtOut, totalPtToSwap, netSyFee) = state.approxSwapExactPtForYt(
40
40
  YT.newIndex(),
41
41
  exactPtIn,
42
42
  block.timestamp,
@@ -45,7 +45,7 @@ contract ActionSwapPTYT is IPActionSwapPTYT, CallbackHelper {
45
45
 
46
46
  if (netYtOut < minYtOut) revert Errors.RouterInsufficientYtOut(netYtOut, minYtOut);
47
47
 
48
- IPMarket(market).swapExactPtForScy(
48
+ IPMarket(market).swapExactPtForSy(
49
49
  address(YT),
50
50
  totalPtToSwap,
51
51
  _encodeSwapExactPtForYt(receiver, exactPtIn, minYtOut)
@@ -60,14 +60,14 @@ contract ActionSwapPTYT is IPActionSwapPTYT, CallbackHelper {
60
60
  uint256 exactYtIn,
61
61
  uint256 minPtOut,
62
62
  ApproxParams calldata guessTotalPtSwapped
63
- ) external returns (uint256 netPtOut, uint256 netScyFee) {
63
+ ) external returns (uint256 netPtOut, uint256 netSyFee) {
64
64
  (, , IPYieldToken YT) = IPMarket(market).readTokens();
65
65
  MarketState memory state = IPMarket(market).readState();
66
66
 
67
67
  YT.safeTransferFrom(msg.sender, address(YT), exactYtIn);
68
68
 
69
69
  uint256 totalPtSwapped;
70
- (netPtOut, totalPtSwapped, netScyFee) = state.approxSwapExactYtForPt(
70
+ (netPtOut, totalPtSwapped, netSyFee) = state.approxSwapExactYtForPt(
71
71
  YT.newIndex(),
72
72
  exactYtIn,
73
73
  block.timestamp,
@@ -76,7 +76,7 @@ contract ActionSwapPTYT is IPActionSwapPTYT, CallbackHelper {
76
76
 
77
77
  if (netPtOut < minPtOut) revert Errors.RouterInsufficientPtOut(netPtOut, minPtOut);
78
78
 
79
- IPMarket(market).swapScyForExactPt(
79
+ IPMarket(market).swapSyForExactPt(
80
80
  address(this),
81
81
  totalPtSwapped,
82
82
  _encodeSwapExactYtForPt(receiver, exactYtIn, minPtOut)