@pendle/core-v2 0.13.1-testnet → 0.14.0-testnet

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (299) hide show
  1. package/build/artifacts/contracts/LiquidityMining/CrossChainMsg/PendleMsgReceiveEndpointUpg.sol/PendleMsgReceiveEndpointUpg.dbg.json +1 -1
  2. package/build/artifacts/contracts/LiquidityMining/CrossChainMsg/PendleMsgReceiveEndpointUpg.sol/PendleMsgReceiveEndpointUpg.json +2 -2
  3. package/build/artifacts/contracts/LiquidityMining/CrossChainMsg/PendleMsgReceiverAppUpg.sol/PendleMsgReceiverAppUpg.dbg.json +1 -1
  4. package/build/artifacts/contracts/LiquidityMining/CrossChainMsg/PendleMsgSendEndpointUpg.sol/PendleMsgSendEndpointUpg.dbg.json +1 -1
  5. package/build/artifacts/contracts/LiquidityMining/CrossChainMsg/PendleMsgSendEndpointUpg.sol/PendleMsgSendEndpointUpg.json +2 -2
  6. package/build/artifacts/contracts/LiquidityMining/CrossChainMsg/PendleMsgSenderAppUpg.sol/PendleMsgSenderAppUpg.dbg.json +1 -1
  7. package/build/artifacts/contracts/LiquidityMining/FeeDistributor/EpochResultManager.sol/EpochResultManager.dbg.json +1 -1
  8. package/build/artifacts/contracts/LiquidityMining/FeeDistributor/PendleFeeDistributor.sol/PendleFeeDistributor.dbg.json +1 -1
  9. package/build/artifacts/contracts/LiquidityMining/FeeDistributor/PendleFeeDistributor.sol/PendleFeeDistributor.json +2 -2
  10. package/build/artifacts/contracts/LiquidityMining/FeeDistributor/PendleFeeDistributorFactory.sol/PendleFeeDistributorFactory.dbg.json +1 -1
  11. package/build/artifacts/contracts/LiquidityMining/FeeDistributor/PendleFeeDistributorFactory.sol/PendleFeeDistributorFactory.json +2 -2
  12. package/build/artifacts/contracts/LiquidityMining/GaugeController/PendleGaugeControllerBaseUpg.sol/PendleGaugeControllerBaseUpg.dbg.json +1 -1
  13. package/build/artifacts/contracts/LiquidityMining/GaugeController/PendleGaugeControllerBaseUpg.sol/PendleGaugeControllerBaseUpg.json +89 -0
  14. package/build/artifacts/contracts/LiquidityMining/GaugeController/PendleGaugeControllerMainchainUpg.sol/PendleGaugeControllerMainchainUpg.dbg.json +1 -1
  15. package/build/artifacts/contracts/LiquidityMining/GaugeController/PendleGaugeControllerMainchainUpg.sol/PendleGaugeControllerMainchainUpg.json +91 -2
  16. package/build/artifacts/contracts/LiquidityMining/GaugeController/PendleGaugeControllerSidechainUpg.sol/PendleGaugeControllerSidechainUpg.dbg.json +1 -1
  17. package/build/artifacts/contracts/LiquidityMining/GaugeController/PendleGaugeControllerSidechainUpg.sol/PendleGaugeControllerSidechainUpg.json +91 -2
  18. package/build/artifacts/contracts/LiquidityMining/VotingController/PendleVotingControllerUpg.sol/PendleVotingControllerUpg.dbg.json +1 -1
  19. package/build/artifacts/contracts/LiquidityMining/VotingController/PendleVotingControllerUpg.sol/PendleVotingControllerUpg.json +2 -2
  20. package/build/artifacts/contracts/LiquidityMining/VotingController/VotingControllerStorageUpg.sol/VotingControllerStorageUpg.dbg.json +1 -1
  21. package/build/artifacts/contracts/LiquidityMining/VotingEscrow/VotingEscrowPendleMainchain.sol/VotingEscrowPendleMainchain.dbg.json +1 -1
  22. package/build/artifacts/contracts/LiquidityMining/VotingEscrow/VotingEscrowPendleMainchain.sol/VotingEscrowPendleMainchain.json +2 -2
  23. package/build/artifacts/contracts/LiquidityMining/VotingEscrow/VotingEscrowPendleSidechain.sol/VotingEscrowPendleSidechain.dbg.json +1 -1
  24. package/build/artifacts/contracts/LiquidityMining/VotingEscrow/VotingEscrowPendleSidechain.sol/VotingEscrowPendleSidechain.json +2 -2
  25. package/build/artifacts/contracts/LiquidityMining/VotingEscrow/VotingEscrowTokenBase.sol/VotingEscrowTokenBase.dbg.json +1 -1
  26. package/build/artifacts/contracts/LiquidityMining/libraries/VeBalanceLib.sol/VeBalanceLib.dbg.json +1 -1
  27. package/build/artifacts/contracts/LiquidityMining/libraries/VeBalanceLib.sol/VeBalanceLib.json +2 -2
  28. package/build/artifacts/contracts/LiquidityMining/libraries/VeHistoryLib.sol/CheckpointHelper.dbg.json +1 -1
  29. package/build/artifacts/contracts/LiquidityMining/libraries/VeHistoryLib.sol/CheckpointHelper.json +2 -2
  30. package/build/artifacts/contracts/LiquidityMining/libraries/VeHistoryLib.sol/Checkpoints.dbg.json +1 -1
  31. package/build/artifacts/contracts/LiquidityMining/libraries/VeHistoryLib.sol/Checkpoints.json +2 -2
  32. package/build/artifacts/contracts/core/Market/MarketMathCore.sol/MarketMathCore.dbg.json +1 -1
  33. package/build/artifacts/contracts/core/Market/MarketMathCore.sol/MarketMathCore.json +2 -2
  34. package/build/artifacts/contracts/core/Market/OracleLib.sol/OracleLib.dbg.json +1 -1
  35. package/build/artifacts/contracts/core/Market/OracleLib.sol/OracleLib.json +2 -2
  36. package/build/artifacts/contracts/core/Market/PendleGauge.sol/PendleGauge.dbg.json +1 -1
  37. package/build/artifacts/contracts/core/Market/PendleMarket.sol/PendleMarket.dbg.json +1 -1
  38. package/build/artifacts/contracts/core/Market/PendleMarket.sol/PendleMarket.json +26 -26
  39. package/build/artifacts/contracts/core/Market/PendleMarketFactory.sol/PendleMarketFactory.dbg.json +1 -1
  40. package/build/artifacts/contracts/core/Market/PendleMarketFactory.sol/PendleMarketFactory.json +2 -2
  41. package/build/artifacts/contracts/core/RewardManager/RewardManager.sol/RewardManager.dbg.json +1 -1
  42. package/build/artifacts/contracts/core/StandardizedYield/PYIndex.sol/PYIndexLib.dbg.json +4 -0
  43. package/build/artifacts/contracts/core/{SuperComposableYield → StandardizedYield}/PYIndex.sol/PYIndexLib.json +3 -3
  44. package/build/artifacts/contracts/core/StandardizedYield/SYBase.sol/SYBase.dbg.json +4 -0
  45. package/build/artifacts/contracts/core/{SuperComposableYield/SCYBase.sol/SCYBase.json → StandardizedYield/SYBase.sol/SYBase.json} +11 -11
  46. package/build/artifacts/contracts/core/StandardizedYield/SYBaseWithRewards.sol/SYBaseWithRewards.dbg.json +4 -0
  47. package/build/artifacts/contracts/core/{SuperComposableYield/SCYBaseWithRewards.sol/SCYBaseWithRewards.json → StandardizedYield/SYBaseWithRewards.sol/SYBaseWithRewards.json} +11 -11
  48. package/build/artifacts/contracts/core/StandardizedYield/SYUtils.sol/SYUtils.dbg.json +4 -0
  49. package/build/artifacts/contracts/core/{SuperComposableYield/SCYUtils.sol/SCYUtils.json → StandardizedYield/SYUtils.sol/SYUtils.json} +4 -4
  50. package/build/artifacts/contracts/core/StandardizedYield/implementations/BenQi/PendleQiTokenHelper.sol/PendleQiTokenHelper.dbg.json +4 -0
  51. package/build/artifacts/contracts/core/{SuperComposableYield → StandardizedYield}/implementations/BenQi/PendleQiTokenHelper.sol/PendleQiTokenHelper.json +3 -3
  52. package/build/artifacts/contracts/core/StandardizedYield/implementations/BenQi/PendleQiTokenSY.sol/PendleQiTokenSY.dbg.json +4 -0
  53. package/build/artifacts/contracts/core/{SuperComposableYield/implementations/BenQi/PendleQiTokenSCY.sol/PendleQiTokenSCY.json → StandardizedYield/implementations/BenQi/PendleQiTokenSY.sol/PendleQiTokenSY.json} +17 -17
  54. package/build/artifacts/contracts/core/StandardizedYield/implementations/Convex/ConvexCurveLP/Pendle3CrvAndTokenSY.sol/Pendle3CrvAndTokenSY.dbg.json +4 -0
  55. package/build/artifacts/contracts/core/StandardizedYield/implementations/Convex/ConvexCurveLP/Pendle3CrvAndTokenSY.sol/Pendle3CrvAndTokenSY.json +1028 -0
  56. package/build/artifacts/contracts/core/StandardizedYield/implementations/Convex/ConvexCurveLP/PendleConvexLPSY.sol/PendleConvexLPSY.dbg.json +4 -0
  57. package/build/artifacts/contracts/core/{SuperComposableYield/implementations/Convex/ConvexCurveLP/PendleConvexCurveLPSCY.sol/PendleConvexCurveLPSCY.json → StandardizedYield/implementations/Convex/ConvexCurveLP/PendleConvexLPSY.sol/PendleConvexLPSY.json} +47 -47
  58. package/build/artifacts/contracts/core/StandardizedYield/implementations/Convex/Pendle3CrvHelper.sol/Pendle3CrvHelper.dbg.json +4 -0
  59. package/build/artifacts/contracts/core/{SuperComposableYield → StandardizedYield}/implementations/Convex/Pendle3CrvHelper.sol/Pendle3CrvHelper.json +5 -5
  60. package/build/artifacts/contracts/core/StandardizedYield/implementations/PendleWstEthSY.sol/PendleWstEthSY.dbg.json +4 -0
  61. package/build/artifacts/contracts/core/{SuperComposableYield/implementations/PendleWstEthSCY.sol/PendleWstEthSCY.json → StandardizedYield/implementations/PendleWstEthSY.sol/PendleWstEthSY.json} +13 -13
  62. package/build/artifacts/contracts/core/YieldContracts/InterestManagerYT.sol/InterestManagerYT.dbg.json +1 -1
  63. package/build/artifacts/contracts/core/YieldContracts/PendlePrincipalToken.sol/PendlePrincipalToken.dbg.json +1 -1
  64. package/build/artifacts/contracts/core/YieldContracts/PendlePrincipalToken.sol/PendlePrincipalToken.json +4 -4
  65. package/build/artifacts/contracts/core/YieldContracts/PendleYieldContractFactory.sol/PendleYieldContractFactory.dbg.json +1 -1
  66. package/build/artifacts/contracts/core/YieldContracts/PendleYieldContractFactory.sol/PendleYieldContractFactory.json +4 -4
  67. package/build/artifacts/contracts/core/YieldContracts/PendleYieldToken.sol/PendleYieldToken.dbg.json +1 -1
  68. package/build/artifacts/contracts/core/YieldContracts/PendleYieldToken.sol/PendleYieldToken.json +24 -24
  69. package/build/artifacts/contracts/core/libraries/Errors.sol/Errors.dbg.json +1 -1
  70. package/build/artifacts/contracts/core/libraries/Errors.sol/Errors.json +28 -28
  71. package/build/artifacts/contracts/interfaces/IPActionAddRemoveLiq.sol/IPActionAddRemoveLiq.dbg.json +1 -1
  72. package/build/artifacts/contracts/interfaces/IPActionAddRemoveLiq.sol/IPActionAddRemoveLiq.json +30 -30
  73. package/build/artifacts/contracts/interfaces/IPActionMintRedeem.sol/IPActionMintRedeem.dbg.json +1 -1
  74. package/build/artifacts/contracts/interfaces/IPActionMintRedeem.sol/IPActionMintRedeem.json +34 -34
  75. package/build/artifacts/contracts/interfaces/IPActionSwapPT.sol/IPActionSwapPT.dbg.json +1 -1
  76. package/build/artifacts/contracts/interfaces/IPActionSwapPT.sol/IPActionSwapPT.json +20 -20
  77. package/build/artifacts/contracts/interfaces/IPActionSwapPTYT.sol/IPActionSwapPTYT.dbg.json +1 -1
  78. package/build/artifacts/contracts/interfaces/IPActionSwapPTYT.sol/IPActionSwapPTYT.json +2 -2
  79. package/build/artifacts/contracts/interfaces/IPActionSwapYT.sol/IPActionSwapYT.dbg.json +1 -1
  80. package/build/artifacts/contracts/interfaces/IPActionSwapYT.sol/IPActionSwapYT.json +20 -20
  81. package/build/artifacts/contracts/interfaces/IPAllAction.sol/IPAllAction.dbg.json +1 -1
  82. package/build/artifacts/contracts/interfaces/IPAllAction.sol/IPAllAction.json +106 -106
  83. package/build/artifacts/contracts/interfaces/IPMarket.sol/IPMarket.dbg.json +1 -1
  84. package/build/artifacts/contracts/interfaces/IPMarket.sol/IPMarket.json +18 -18
  85. package/build/artifacts/contracts/interfaces/IPMarketSwapCallback.sol/IPMarketSwapCallback.dbg.json +1 -1
  86. package/build/artifacts/contracts/interfaces/IPMarketSwapCallback.sol/IPMarketSwapCallback.json +1 -1
  87. package/build/artifacts/contracts/interfaces/IPPrincipalToken.sol/IPPrincipalToken.dbg.json +1 -1
  88. package/build/artifacts/contracts/interfaces/IPPrincipalToken.sol/IPPrincipalToken.json +1 -1
  89. package/build/artifacts/contracts/interfaces/IPVotingController.sol/IPVotingController.dbg.json +1 -1
  90. package/build/artifacts/contracts/interfaces/IPVotingEscrowMainchain.sol/IPVotingEscrowMainchain.dbg.json +1 -1
  91. package/build/artifacts/contracts/interfaces/IPYieldContractFactory.sol/IPYieldContractFactory.dbg.json +1 -1
  92. package/build/artifacts/contracts/interfaces/IPYieldContractFactory.sol/IPYieldContractFactory.json +3 -3
  93. package/build/artifacts/contracts/interfaces/IPYieldToken.sol/IPYieldToken.dbg.json +1 -1
  94. package/build/artifacts/contracts/interfaces/IPYieldToken.sol/IPYieldToken.json +6 -6
  95. package/build/artifacts/contracts/interfaces/IStandardizedYield.sol/IStandardizedYield.dbg.json +4 -0
  96. package/build/artifacts/contracts/interfaces/{ISuperComposableYield.sol/ISuperComposableYield.json → IStandardizedYield.sol/IStandardizedYield.json} +5 -5
  97. package/build/artifacts/contracts/offchain-helpers/MarketMathStatic.sol/MarketMathStatic.dbg.json +1 -1
  98. package/build/artifacts/contracts/offchain-helpers/MarketMathStatic.sol/MarketMathStatic.json +7 -7
  99. package/build/artifacts/contracts/offchain-helpers/RouterStatic.sol/RouterStatic.dbg.json +1 -1
  100. package/build/artifacts/contracts/offchain-helpers/RouterStatic.sol/RouterStatic.json +116 -116
  101. package/build/artifacts/contracts/router/ActionAddRemoveLiq.sol/ActionAddRemoveLiq.dbg.json +1 -1
  102. package/build/artifacts/contracts/router/ActionAddRemoveLiq.sol/ActionAddRemoveLiq.json +35 -35
  103. package/build/artifacts/contracts/router/ActionCallback.sol/ActionCallback.dbg.json +1 -1
  104. package/build/artifacts/contracts/router/ActionCallback.sol/ActionCallback.json +12 -12
  105. package/build/artifacts/contracts/router/ActionMintRedeem.sol/ActionMintRedeem.dbg.json +1 -1
  106. package/build/artifacts/contracts/router/ActionMintRedeem.sol/ActionMintRedeem.json +41 -41
  107. package/build/artifacts/contracts/router/ActionMisc.sol/ActionMisc.dbg.json +1 -1
  108. package/build/artifacts/contracts/router/ActionMisc.sol/ActionMisc.json +2 -2
  109. package/build/artifacts/contracts/router/ActionSwapPT.sol/ActionSwapPT.dbg.json +1 -1
  110. package/build/artifacts/contracts/router/ActionSwapPT.sol/ActionSwapPT.json +28 -28
  111. package/build/artifacts/contracts/router/ActionSwapPTYT.sol/ActionSwapPTYT.dbg.json +1 -1
  112. package/build/artifacts/contracts/router/ActionSwapPTYT.sol/ActionSwapPTYT.json +4 -4
  113. package/build/artifacts/contracts/router/ActionSwapYT.sol/ActionSwapYT.dbg.json +1 -1
  114. package/build/artifacts/contracts/router/ActionSwapYT.sol/ActionSwapYT.json +22 -22
  115. package/build/artifacts/contracts/router/PendleRouter.sol/PendleRouter.dbg.json +1 -1
  116. package/build/artifacts/contracts/router/PendleRouter.sol/PendleRouter.json +2 -2
  117. package/build/artifacts/contracts/router/base/ActionBaseMintRedeem.sol/ActionBaseMintRedeem.dbg.json +1 -1
  118. package/build/artifacts/contracts/router/base/CallbackHelper.sol/CallbackHelper.dbg.json +1 -1
  119. package/build/artifacts/contracts/router/base/MarketApproxLib.sol/MarketApproxPtInLib.dbg.json +1 -1
  120. package/build/artifacts/contracts/router/base/MarketApproxLib.sol/MarketApproxPtInLib.json +2 -2
  121. package/build/artifacts/contracts/router/base/MarketApproxLib.sol/MarketApproxPtOutLib.dbg.json +1 -1
  122. package/build/artifacts/contracts/router/base/MarketApproxLib.sol/MarketApproxPtOutLib.json +2 -2
  123. package/build/artifacts/contracts/router/kyberswap/KyberSwapHelper.sol/KyberSwapHelper.dbg.json +1 -1
  124. package/contracts/LiquidityMining/CrossChainMsg/PendleMsgReceiveEndpointUpg.sol +96 -27
  125. package/contracts/LiquidityMining/CrossChainMsg/PendleMsgSendEndpointUpg.sol +40 -12
  126. package/contracts/LiquidityMining/CrossChainMsg/PendleMsgSenderAppUpg.sol +24 -5
  127. package/contracts/LiquidityMining/CrossChainMsg/libraries/ExcessivelySafeCall.sol +133 -0
  128. package/contracts/LiquidityMining/CrossChainMsg/libraries/LayerZeroHelper.sol +33 -0
  129. package/contracts/LiquidityMining/GaugeController/PendleGaugeControllerBaseUpg.sol +8 -1
  130. package/contracts/LiquidityMining/VotingController/PendleVotingControllerUpg.sol +3 -3
  131. package/contracts/LiquidityMining/VotingEscrow/VotingEscrowPendleMainchain.sol +2 -7
  132. package/contracts/core/Market/MarketMathCore.sol +50 -53
  133. package/contracts/core/Market/PendleGauge.sol +8 -8
  134. package/contracts/core/Market/PendleMarket.sol +49 -49
  135. package/contracts/core/Market/PendleMarketFactory.sol +1 -1
  136. package/contracts/core/RewardManager/RewardManager.sol +1 -1
  137. package/contracts/core/{SuperComposableYield → StandardizedYield}/PYIndex.sol +16 -16
  138. package/contracts/core/{SuperComposableYield/SCYBase.sol → StandardizedYield/SYBase.sol} +17 -17
  139. package/contracts/core/{SuperComposableYield/SCYBaseWithRewards.sol → StandardizedYield/SYBaseWithRewards.sol} +9 -9
  140. package/contracts/core/StandardizedYield/SYUtils.sol +26 -0
  141. package/contracts/core/{SuperComposableYield → StandardizedYield}/implementations/BenQi/PendleQiTokenHelper.sol +1 -1
  142. package/contracts/core/{SuperComposableYield/implementations/BenQi/PendleQiTokenSCY.sol → StandardizedYield/implementations/BenQi/PendleQiTokenSY.sol} +10 -10
  143. package/contracts/core/StandardizedYield/implementations/Convex/ConvexCurveLP/Pendle3CrvAndTokenSY.sol +167 -0
  144. package/contracts/core/{SuperComposableYield/implementations/Convex/ConvexCurveLP/PendleConvexCurveLPSCY.sol → StandardizedYield/implementations/Convex/ConvexCurveLP/PendleConvexLPSY.sol} +51 -70
  145. package/contracts/core/{SuperComposableYield → StandardizedYield}/implementations/Convex/Pendle3CrvHelper.sol +7 -7
  146. package/contracts/core/{SuperComposableYield/implementations/PendleWstEthSCY.sol → StandardizedYield/implementations/PendleWstEthSY.sol} +5 -5
  147. package/contracts/core/YieldContracts/InterestManagerYT.sol +7 -7
  148. package/contracts/core/YieldContracts/PendlePrincipalToken.sol +3 -3
  149. package/contracts/core/YieldContracts/PendleYieldContractFactory.sol +15 -15
  150. package/contracts/core/YieldContracts/PendleYieldToken.sol +71 -71
  151. package/contracts/core/libraries/Errors.sol +23 -21
  152. package/contracts/core/libraries/TokenHelper.sol +0 -33
  153. package/contracts/interfaces/Curve/ICrvPool.sol +2 -0
  154. package/contracts/interfaces/ILayerZeroEndpoint.sol +39 -0
  155. package/contracts/interfaces/ILayerZeroReceiver.sol +12 -0
  156. package/contracts/interfaces/IPActionAddRemoveLiq.sol +27 -27
  157. package/contracts/interfaces/IPActionMintRedeem.sol +30 -30
  158. package/contracts/interfaces/IPActionSwapPT.sol +16 -16
  159. package/contracts/interfaces/IPActionSwapPTYT.sol +2 -2
  160. package/contracts/interfaces/IPActionSwapYT.sol +16 -16
  161. package/contracts/interfaces/IPMarket.sol +14 -19
  162. package/contracts/interfaces/IPMarketSwapCallback.sol +1 -1
  163. package/contracts/interfaces/IPMsgSendEndpoint.sol +4 -2
  164. package/contracts/interfaces/IPPrincipalToken.sol +1 -1
  165. package/contracts/interfaces/IPYieldContractFactory.sol +3 -3
  166. package/contracts/interfaces/IPYieldToken.sol +7 -9
  167. package/contracts/interfaces/{ISuperComposableYield.sol → IStandardizedYield.sol} +6 -6
  168. package/contracts/offchain-helpers/MarketMathStatic.sol +116 -131
  169. package/contracts/offchain-helpers/RouterStatic.sol +80 -93
  170. package/contracts/router/ActionAddRemoveLiq.sol +99 -111
  171. package/contracts/router/ActionCallback.sol +46 -46
  172. package/contracts/router/ActionMintRedeem.sol +58 -58
  173. package/contracts/router/ActionSwapPT.sol +61 -69
  174. package/contracts/router/ActionSwapPTYT.sol +7 -7
  175. package/contracts/router/ActionSwapYT.sol +72 -79
  176. package/contracts/router/PendleRouter.sol +16 -16
  177. package/contracts/router/base/ActionBaseMintRedeem.sol +43 -43
  178. package/contracts/router/base/CallbackHelper.sol +20 -20
  179. package/contracts/router/base/MarketApproxLib.sol +166 -143
  180. package/contracts/router/kyberswap/KyberSwapHelper.sol +2 -2
  181. package/deployments/43113-core.json +16 -0
  182. package/{contracts/deployments → deployments}/43113-helper.json +0 -0
  183. package/deployments/43113-markets/benqi-market-QI-USDC-FEB-2ND.json +8 -0
  184. package/deployments/43113-markets/benqi-market-QI-WETH-DEC-1ST.json +8 -0
  185. package/{contracts/deployments → deployments}/43113-testenv.json +0 -0
  186. package/deployments/80001-core.json +15 -0
  187. package/{contracts/deployments → deployments}/80001-testenv.json +0 -0
  188. package/package.json +2 -2
  189. package/typechain-types/ActionAddRemoveLiq.ts +127 -129
  190. package/typechain-types/ActionCallback.ts +5 -5
  191. package/typechain-types/ActionMintRedeem.ts +139 -141
  192. package/typechain-types/ActionSwapPT.ts +73 -73
  193. package/typechain-types/ActionSwapPTYT.ts +2 -2
  194. package/typechain-types/ActionSwapYT.ts +73 -73
  195. package/typechain-types/IPActionAddRemoveLiq.ts +127 -129
  196. package/typechain-types/IPActionMintRedeem.ts +139 -141
  197. package/typechain-types/IPActionSwapPT.ts +73 -73
  198. package/typechain-types/IPActionSwapPTYT.ts +2 -2
  199. package/typechain-types/IPActionSwapYT.ts +73 -73
  200. package/typechain-types/IPAllAction.ts +402 -406
  201. package/typechain-types/IPMarket.ts +51 -54
  202. package/typechain-types/IPMarketSwapCallback.ts +5 -5
  203. package/typechain-types/IPPrincipalToken.ts +8 -8
  204. package/typechain-types/IPYieldContractFactory.ts +13 -13
  205. package/typechain-types/IPYieldToken.ts +17 -17
  206. package/typechain-types/IStandardizedYield.ts +895 -0
  207. package/typechain-types/MarketMathStatic.ts +27 -27
  208. package/typechain-types/Pendle3CrvAndTokenSY.ts +1243 -0
  209. package/typechain-types/Pendle3CrvHelper.ts +13 -13
  210. package/typechain-types/PendleConvexLPSY.ts +1189 -0
  211. package/typechain-types/PendleGaugeControllerBaseUpg.ts +125 -0
  212. package/typechain-types/PendleGaugeControllerMainchainUpg.ts +125 -0
  213. package/typechain-types/PendleGaugeControllerSidechainUpg.ts +124 -0
  214. package/typechain-types/PendleMarket.ts +54 -57
  215. package/typechain-types/PendlePrincipalToken.ts +8 -8
  216. package/typechain-types/PendleQiTokenSY.ts +1166 -0
  217. package/typechain-types/PendleWstEthSY.ts +1040 -0
  218. package/typechain-types/PendleYieldContractFactory.ts +8 -8
  219. package/typechain-types/PendleYieldToken.ts +41 -44
  220. package/typechain-types/RouterStatic.ts +196 -196
  221. package/typechain-types/SYBase.ts +1001 -0
  222. package/typechain-types/SYBaseWithRewards.ts +1094 -0
  223. package/typechain-types/factories/ActionAddRemoveLiq__factory.ts +34 -34
  224. package/typechain-types/factories/ActionCallback__factory.ts +11 -11
  225. package/typechain-types/factories/ActionMintRedeem__factory.ts +38 -38
  226. package/typechain-types/factories/ActionMisc__factory.ts +1 -1
  227. package/typechain-types/factories/ActionSwapPTYT__factory.ts +3 -3
  228. package/typechain-types/factories/ActionSwapPT__factory.ts +27 -27
  229. package/typechain-types/factories/ActionSwapYT__factory.ts +21 -21
  230. package/typechain-types/factories/Errors__factory.ts +27 -27
  231. package/typechain-types/factories/IPActionAddRemoveLiq__factory.ts +30 -30
  232. package/typechain-types/factories/IPActionMintRedeem__factory.ts +34 -34
  233. package/typechain-types/factories/IPActionSwapPTYT__factory.ts +2 -2
  234. package/typechain-types/factories/IPActionSwapPT__factory.ts +20 -20
  235. package/typechain-types/factories/IPActionSwapYT__factory.ts +20 -20
  236. package/typechain-types/factories/IPAllAction__factory.ts +106 -106
  237. package/typechain-types/factories/IPMarketSwapCallback__factory.ts +1 -1
  238. package/typechain-types/factories/IPMarket__factory.ts +18 -18
  239. package/typechain-types/factories/IPPrincipalToken__factory.ts +1 -1
  240. package/typechain-types/factories/IPYieldContractFactory__factory.ts +3 -3
  241. package/typechain-types/factories/IPYieldToken__factory.ts +6 -6
  242. package/typechain-types/factories/IStandardizedYield__factory.ts +658 -0
  243. package/typechain-types/factories/MarketMathStatic__factory.ts +6 -6
  244. package/typechain-types/factories/OracleLib__factory.ts +1 -1
  245. package/typechain-types/factories/Pendle3CrvAndTokenSY__factory.ts +1124 -0
  246. package/typechain-types/factories/Pendle3CrvHelper__factory.ts +3 -3
  247. package/typechain-types/factories/PendleConvexLPSY__factory.ts +963 -0
  248. package/typechain-types/factories/PendleFeeDistributorFactory__factory.ts +1 -1
  249. package/typechain-types/factories/PendleFeeDistributor__factory.ts +1 -1
  250. package/typechain-types/factories/PendleGaugeControllerBaseUpg__factory.ts +89 -0
  251. package/typechain-types/factories/PendleGaugeControllerMainchainUpg__factory.ts +90 -1
  252. package/typechain-types/factories/PendleGaugeControllerSidechainUpg__factory.ts +90 -1
  253. package/typechain-types/factories/PendleMarketFactory__factory.ts +1 -1
  254. package/typechain-types/factories/PendleMarket__factory.ts +21 -21
  255. package/typechain-types/factories/PendleMsgReceiveEndpointUpg__factory.ts +1 -1
  256. package/typechain-types/factories/PendleMsgSendEndpointUpg__factory.ts +1 -1
  257. package/typechain-types/factories/PendlePrincipalToken__factory.ts +7 -7
  258. package/typechain-types/factories/PendleQiTokenHelper__factory.ts +1 -1
  259. package/typechain-types/factories/PendleQiTokenSY__factory.ts +1095 -0
  260. package/typechain-types/factories/PendleRouter__factory.ts +1 -1
  261. package/typechain-types/factories/PendleVotingControllerUpg__factory.ts +1 -1
  262. package/typechain-types/factories/PendleWstEthSY__factory.ts +924 -0
  263. package/typechain-types/factories/PendleYieldContractFactory__factory.ts +3 -3
  264. package/typechain-types/factories/PendleYieldToken__factory.ts +27 -27
  265. package/typechain-types/factories/RouterStatic__factory.ts +57 -57
  266. package/typechain-types/factories/SYBaseWithRewards__factory.ts +867 -0
  267. package/typechain-types/factories/SYBase__factory.ts +795 -0
  268. package/typechain-types/factories/VotingEscrowPendleMainchain__factory.ts +1 -1
  269. package/typechain-types/factories/VotingEscrowPendleSidechain__factory.ts +1 -1
  270. package/typechain-types/hardhat.d.ts +33 -51
  271. package/typechain-types/index.ts +14 -18
  272. package/build/artifacts/contracts/core/SuperComposableYield/PYIndex.sol/PYIndexLib.dbg.json +0 -4
  273. package/build/artifacts/contracts/core/SuperComposableYield/SCYBase.sol/SCYBase.dbg.json +0 -4
  274. package/build/artifacts/contracts/core/SuperComposableYield/SCYBaseWithRewards.sol/SCYBaseWithRewards.dbg.json +0 -4
  275. package/build/artifacts/contracts/core/SuperComposableYield/SCYUtils.sol/SCYUtils.dbg.json +0 -4
  276. package/build/artifacts/contracts/core/SuperComposableYield/implementations/BenQi/PendleQiTokenHelper.sol/PendleQiTokenHelper.dbg.json +0 -4
  277. package/build/artifacts/contracts/core/SuperComposableYield/implementations/BenQi/PendleQiTokenSCY.sol/PendleQiTokenSCY.dbg.json +0 -4
  278. package/build/artifacts/contracts/core/SuperComposableYield/implementations/Convex/ConvexCurveLP/Pendle3CrvAndTokenSCY.sol/Pendle3CrvAndTokenSCY.dbg.json +0 -4
  279. package/build/artifacts/contracts/core/SuperComposableYield/implementations/Convex/ConvexCurveLP/Pendle3CrvAndTokenSCY.sol/Pendle3CrvAndTokenSCY.json +0 -1030
  280. package/build/artifacts/contracts/core/SuperComposableYield/implementations/Convex/ConvexCurveLP/PendleConvexCurveLP2PoolSCY.sol/PendleConvexCurveLP2PoolSCY.dbg.json +0 -4
  281. package/build/artifacts/contracts/core/SuperComposableYield/implementations/Convex/ConvexCurveLP/PendleConvexCurveLP2PoolSCY.sol/PendleConvexCurveLP2PoolSCY.json +0 -1025
  282. package/build/artifacts/contracts/core/SuperComposableYield/implementations/Convex/ConvexCurveLP/PendleConvexCurveLPSCY.sol/PendleConvexCurveLPSCY.dbg.json +0 -4
  283. package/build/artifacts/contracts/core/SuperComposableYield/implementations/Convex/Pendle3CrvHelper.sol/Pendle3CrvHelper.dbg.json +0 -4
  284. package/build/artifacts/contracts/core/SuperComposableYield/implementations/PendleWstEthSCY.sol/PendleWstEthSCY.dbg.json +0 -4
  285. package/build/artifacts/contracts/interfaces/ISuperComposableYield.sol/ISuperComposableYield.dbg.json +0 -4
  286. package/build/artifacts/contracts/offchain-helpers/ImplicitSwapfeeContract.sol/ImplicitSwapfeeContract.dbg.json +0 -4
  287. package/build/artifacts/contracts/offchain-helpers/ImplicitSwapfeeContract.sol/ImplicitSwapfeeContract.json +0 -190
  288. package/contracts/core/SuperComposableYield/SCYUtils.sol +0 -34
  289. package/contracts/core/SuperComposableYield/implementations/Convex/ConvexCurveLP/Pendle3CrvAndTokenSCY.sol +0 -135
  290. package/contracts/core/SuperComposableYield/implementations/Convex/ConvexCurveLP/PendleConvexCurveLP2PoolSCY.sol +0 -96
  291. package/contracts/deployments/43113-core.json +0 -16
  292. package/contracts/deployments/43113-markets/benqi-market-QI-USDC-FEB-2ND.json +0 -8
  293. package/contracts/deployments/43113-markets/benqi-market-QI-WETH-DEC-1ST.json +0 -8
  294. package/contracts/deployments/80001-core.json +0 -15
  295. package/contracts/deployments/80001-markets/benqi-market-QI-USDC-FEB-2ND.json +0 -8
  296. package/contracts/deployments/80001-markets/benqi-market-QI-WETH-DEC-1ST.json +0 -8
  297. package/contracts/interfaces/ICelerMessageBus.sol +0 -28
  298. package/contracts/interfaces/ICelerMessageReceiverApp.sol +0 -25
  299. package/contracts/offchain-helpers/ImplicitSwapfeeContract.sol +0 -26
@@ -20,25 +20,25 @@ contract ActionAddRemoveLiq is IPActionAddRemoveLiq, ActionBaseMintRedeem {
20
20
  ActionBaseMintRedeem(_kyberSwapRouter) //solhint-disable-next-line no-empty-blocks
21
21
  {}
22
22
 
23
- function addLiquidityDualScyAndPt(
23
+ function addLiquidityDualSyAndPt(
24
24
  address receiver,
25
25
  address market,
26
- uint256 netScyDesired,
26
+ uint256 netSyDesired,
27
27
  uint256 netPtDesired,
28
28
  uint256 minLpOut
29
29
  )
30
30
  external
31
31
  returns (
32
32
  uint256 netLpOut,
33
- uint256 netScyUsed,
33
+ uint256 netSyUsed,
34
34
  uint256 netPtUsed
35
35
  )
36
36
  {
37
- (ISuperComposableYield SCY, IPPrincipalToken PT, ) = IPMarket(market).readTokens();
37
+ (IStandardizedYield SY, IPPrincipalToken PT, ) = IPMarket(market).readTokens();
38
38
 
39
39
  MarketState memory state = IPMarket(market).readState();
40
- (, netLpOut, netScyUsed, netPtUsed) = state.addLiquidity(
41
- netScyDesired,
40
+ (, netLpOut, netSyUsed, netPtUsed) = state.addLiquidity(
41
+ netSyDesired,
42
42
  netPtDesired,
43
43
  block.timestamp
44
44
  );
@@ -46,22 +46,15 @@ contract ActionAddRemoveLiq is IPActionAddRemoveLiq, ActionBaseMintRedeem {
46
46
  // early-check
47
47
  if (netLpOut < minLpOut) revert Errors.RouterInsufficientLpOut(netLpOut, minLpOut);
48
48
 
49
- IERC20(SCY).safeTransferFrom(msg.sender, market, netScyUsed);
49
+ IERC20(SY).safeTransferFrom(msg.sender, market, netSyUsed);
50
50
  IERC20(PT).safeTransferFrom(msg.sender, market, netPtUsed);
51
51
 
52
- (netLpOut, , ) = IPMarket(market).mint(receiver, netScyUsed, netPtUsed);
52
+ (netLpOut, , ) = IPMarket(market).mint(receiver, netSyUsed, netPtUsed);
53
53
 
54
54
  // fail-safe
55
55
  if (netLpOut < minLpOut) assert(false);
56
56
 
57
- emit AddLiquidityDualScyAndPt(
58
- msg.sender,
59
- market,
60
- receiver,
61
- netScyUsed,
62
- netPtUsed,
63
- netLpOut
64
- );
57
+ emit AddLiquidityDualSyAndPt(msg.sender, market, receiver, netSyUsed, netPtUsed, netLpOut);
65
58
  }
66
59
 
67
60
  function addLiquidityDualTokenAndPt(
@@ -80,15 +73,15 @@ contract ActionAddRemoveLiq is IPActionAddRemoveLiq, ActionBaseMintRedeem {
80
73
  uint256 netPtUsed
81
74
  )
82
75
  {
83
- (ISuperComposableYield SCY, IPPrincipalToken PT, ) = IPMarket(market).readTokens();
76
+ (IStandardizedYield SY, IPPrincipalToken PT, ) = IPMarket(market).readTokens();
84
77
 
85
- uint256 netScyDesired = SCY.previewDeposit(tokenIn, netTokenDesired);
86
- uint256 netScyUsed;
78
+ uint256 netSyDesired = SY.previewDeposit(tokenIn, netTokenDesired);
79
+ uint256 netSyUsed;
87
80
 
88
81
  {
89
82
  MarketState memory state = IPMarket(market).readState();
90
- (, netLpOut, netScyUsed, netPtUsed) = state.addLiquidity(
91
- netScyDesired,
83
+ (, netLpOut, netSyUsed, netPtUsed) = state.addLiquidity(
84
+ netSyDesired,
92
85
  netPtDesired,
93
86
  block.timestamp
94
87
  );
@@ -98,20 +91,20 @@ contract ActionAddRemoveLiq is IPActionAddRemoveLiq, ActionBaseMintRedeem {
98
91
 
99
92
  IERC20(PT).safeTransferFrom(msg.sender, market, netPtUsed);
100
93
 
101
- // convert tokenIn to SCY to deposit
102
- netTokenUsed = (netTokenDesired * netScyUsed).rawDivUp(netScyDesired);
94
+ // convert tokenIn to SY to deposit
95
+ netTokenUsed = (netTokenDesired * netSyUsed).rawDivUp(netSyDesired);
103
96
 
104
97
  if (tokenIn == NATIVE) {
105
98
  _transferIn(tokenIn, msg.sender, netTokenDesired);
106
- SCY.deposit{ value: netTokenUsed }(market, tokenIn, netTokenUsed, netScyUsed);
99
+ SY.deposit{ value: netTokenUsed }(market, tokenIn, netTokenUsed, netSyUsed);
107
100
  _transferOut(tokenIn, msg.sender, netTokenDesired - netTokenUsed);
108
101
  } else {
109
102
  _transferIn(tokenIn, msg.sender, netTokenUsed);
110
- _safeApproveInf(tokenIn, address(SCY));
111
- SCY.deposit(market, tokenIn, netTokenUsed, netScyUsed);
103
+ _safeApproveInf(tokenIn, address(SY));
104
+ SY.deposit(market, tokenIn, netTokenUsed, netSyUsed);
112
105
  }
113
106
 
114
- (netLpOut, , ) = IPMarket(market).mint(receiver, netScyUsed, netPtUsed);
107
+ (netLpOut, , ) = IPMarket(market).mint(receiver, netSyUsed, netPtUsed);
115
108
 
116
109
  if (netLpOut < minLpOut) assert(false);
117
110
 
@@ -131,8 +124,8 @@ contract ActionAddRemoveLiq is IPActionAddRemoveLiq, ActionBaseMintRedeem {
131
124
  address market,
132
125
  uint256 netPtIn,
133
126
  uint256 minLpOut,
134
- ApproxParams calldata guessPtSwapToScy
135
- ) external returns (uint256 netLpOut, uint256 netScyFee) {
127
+ ApproxParams calldata guessPtSwapToSy
128
+ ) external returns (uint256 netLpOut, uint256 netSyFee) {
136
129
  (, IPPrincipalToken PT, IPYieldToken YT) = IPMarket(market).readTokens();
137
130
 
138
131
  MarketState memory state = IPMarket(market).readState();
@@ -141,66 +134,66 @@ contract ActionAddRemoveLiq is IPActionAddRemoveLiq, ActionBaseMintRedeem {
141
134
  YT.newIndex(),
142
135
  netPtIn,
143
136
  block.timestamp,
144
- guessPtSwapToScy
137
+ guessPtSwapToSy
145
138
  );
146
139
 
147
140
  IERC20(PT).safeTransferFrom(msg.sender, market, netPtIn);
148
141
 
149
- uint256 netScyReceived;
150
- (netScyReceived, netScyFee) = IPMarket(market).swapExactPtForScy(
142
+ uint256 netSyReceived;
143
+ (netSyReceived, netSyFee) = IPMarket(market).swapExactPtForSy(
151
144
  market,
152
145
  netPtSwap,
153
146
  EMPTY_BYTES
154
147
  ); // ignore return, receiver = market
155
148
 
156
- (netLpOut, , ) = IPMarket(market).mint(receiver, netScyReceived, netPtIn - netPtSwap);
149
+ (netLpOut, , ) = IPMarket(market).mint(receiver, netSyReceived, netPtIn - netPtSwap);
157
150
 
158
151
  if (netLpOut < minLpOut) revert Errors.RouterInsufficientLpOut(netLpOut, minLpOut);
159
152
 
160
153
  emit AddLiquiditySinglePt(msg.sender, market, receiver, netPtIn, netLpOut);
161
154
  }
162
155
 
163
- function addLiquiditySingleScy(
156
+ function addLiquiditySingleSy(
164
157
  address receiver,
165
158
  address market,
166
- uint256 netScyIn,
159
+ uint256 netSyIn,
167
160
  uint256 minLpOut,
168
- ApproxParams calldata guessPtReceivedFromScy
169
- ) external returns (uint256 netLpOut, uint256 netScyFee) {
170
- (ISuperComposableYield SCY, , IPYieldToken YT) = IPMarket(market).readTokens();
171
- IERC20(SCY).safeTransferFrom(msg.sender, market, netScyIn);
161
+ ApproxParams calldata guessPtReceivedFromSy
162
+ ) external returns (uint256 netLpOut, uint256 netSyFee) {
163
+ (IStandardizedYield SY, , IPYieldToken YT) = IPMarket(market).readTokens();
164
+ IERC20(SY).safeTransferFrom(msg.sender, market, netSyIn);
172
165
 
173
- (netLpOut, netScyFee) = _addLiquiditySingleScy(
166
+ (netLpOut, netSyFee) = _addLiquiditySingleSy(
174
167
  receiver,
175
168
  market,
176
169
  YT,
177
- netScyIn,
170
+ netSyIn,
178
171
  minLpOut,
179
- guessPtReceivedFromScy
172
+ guessPtReceivedFromSy
180
173
  );
181
174
 
182
- emit AddLiquiditySingleScy(msg.sender, market, receiver, netScyIn, netLpOut);
175
+ emit AddLiquiditySingleSy(msg.sender, market, receiver, netSyIn, netLpOut);
183
176
  }
184
177
 
185
178
  function addLiquiditySingleToken(
186
179
  address receiver,
187
180
  address market,
188
181
  uint256 minLpOut,
189
- ApproxParams calldata guessPtReceivedFromScy,
182
+ ApproxParams calldata guessPtReceivedFromSy,
190
183
  TokenInput calldata input
191
- ) external payable returns (uint256 netLpOut, uint256 netScyFee) {
192
- (ISuperComposableYield SCY, , IPYieldToken YT) = IPMarket(market).readTokens();
184
+ ) external payable returns (uint256 netLpOut, uint256 netSyFee) {
185
+ (IStandardizedYield SY, , IPYieldToken YT) = IPMarket(market).readTokens();
193
186
 
194
- // all output SCY is transferred directly to the market
195
- uint256 netScyUsed = _mintScyFromToken(address(market), address(SCY), 1, input);
187
+ // all output SY is transferred directly to the market
188
+ uint256 netSyUsed = _mintSyFromToken(address(market), address(SY), 1, input);
196
189
 
197
- (netLpOut, netScyFee) = _addLiquiditySingleScy(
190
+ (netLpOut, netSyFee) = _addLiquiditySingleSy(
198
191
  receiver,
199
192
  market,
200
193
  YT,
201
- netScyUsed,
194
+ netSyUsed,
202
195
  minLpOut,
203
- guessPtReceivedFromScy
196
+ guessPtReceivedFromSy
204
197
  );
205
198
 
206
199
  emit AddLiquiditySingleToken(
@@ -213,27 +206,27 @@ contract ActionAddRemoveLiq is IPActionAddRemoveLiq, ActionBaseMintRedeem {
213
206
  );
214
207
  }
215
208
 
216
- function removeLiquidityDualScyAndPt(
209
+ function removeLiquidityDualSyAndPt(
217
210
  address receiver,
218
211
  address market,
219
212
  uint256 netLpToRemove,
220
- uint256 minScyOut,
213
+ uint256 minSyOut,
221
214
  uint256 minPtOut
222
- ) external returns (uint256 netScyOut, uint256 netPtOut) {
215
+ ) external returns (uint256 netSyOut, uint256 netPtOut) {
223
216
  IERC20(market).safeTransferFrom(msg.sender, market, netLpToRemove);
224
217
 
225
- (netScyOut, netPtOut) = IPMarket(market).burn(receiver, receiver, netLpToRemove);
218
+ (netSyOut, netPtOut) = IPMarket(market).burn(receiver, receiver, netLpToRemove);
226
219
 
227
- if (netScyOut < minScyOut) revert Errors.RouterInsufficientScyOut(netScyOut, minScyOut);
220
+ if (netSyOut < minSyOut) revert Errors.RouterInsufficientSyOut(netSyOut, minSyOut);
228
221
  if (netPtOut < minPtOut) revert Errors.RouterInsufficientPtOut(netPtOut, minPtOut);
229
222
 
230
- emit RemoveLiquidityDualScyAndPt(
223
+ emit RemoveLiquidityDualSyAndPt(
231
224
  msg.sender,
232
225
  market,
233
226
  receiver,
234
227
  netLpToRemove,
235
228
  netPtOut,
236
- netScyOut
229
+ netSyOut
237
230
  );
238
231
  }
239
232
 
@@ -245,14 +238,14 @@ contract ActionAddRemoveLiq is IPActionAddRemoveLiq, ActionBaseMintRedeem {
245
238
  uint256 minTokenOut,
246
239
  uint256 minPtOut
247
240
  ) external returns (uint256 netTokenOut, uint256 netPtOut) {
248
- (ISuperComposableYield SCY, , ) = IPMarket(market).readTokens();
241
+ (IStandardizedYield SY, , ) = IPMarket(market).readTokens();
249
242
 
250
243
  IERC20(market).safeTransferFrom(msg.sender, market, netLpToRemove);
251
244
 
252
- uint256 netScyOut;
253
- (netScyOut, netPtOut) = IPMarket(market).burn(address(SCY), receiver, netLpToRemove);
245
+ uint256 netSyOut;
246
+ (netSyOut, netPtOut) = IPMarket(market).burn(address(SY), receiver, netLpToRemove);
254
247
 
255
- netTokenOut = SCY.redeem(receiver, netScyOut, tokenOut, minTokenOut, true);
248
+ netTokenOut = SY.redeem(receiver, netSyOut, tokenOut, minTokenOut, true);
256
249
 
257
250
  if (netPtOut < minPtOut) revert Errors.RouterInsufficientPtOut(netPtOut, minPtOut);
258
251
 
@@ -273,16 +266,16 @@ contract ActionAddRemoveLiq is IPActionAddRemoveLiq, ActionBaseMintRedeem {
273
266
  uint256 netLpToRemove,
274
267
  uint256 minPtOut,
275
268
  ApproxParams calldata guessPtOut
276
- ) external returns (uint256 netPtOut, uint256 netScyFee) {
269
+ ) external returns (uint256 netPtOut, uint256 netSyFee) {
277
270
  (, , IPYieldToken YT) = IPMarket(market).readTokens();
278
271
 
279
272
  IERC20(market).safeTransferFrom(msg.sender, market, netLpToRemove);
280
273
 
281
274
  MarketState memory state = IPMarket(market).readState();
282
- (uint256 scyFromBurn, uint256 ptFromBurn) = state.removeLiquidity(netLpToRemove);
283
- (uint256 ptFromSwap, ) = state.approxSwapExactScyForPt(
275
+ (uint256 syFromBurn, uint256 ptFromBurn) = state.removeLiquidity(netLpToRemove);
276
+ (uint256 ptFromSwap, ) = state.approxSwapExactSyForPt(
284
277
  YT.newIndex(),
285
- scyFromBurn,
278
+ syFromBurn,
286
279
  block.timestamp,
287
280
  guessPtOut
288
281
  );
@@ -291,7 +284,7 @@ contract ActionAddRemoveLiq is IPActionAddRemoveLiq, ActionBaseMintRedeem {
291
284
  revert Errors.RouterInsufficientPtOut(ptFromBurn + ptFromSwap, minPtOut);
292
285
 
293
286
  (, ptFromBurn) = IPMarket(market).burn(market, receiver, netLpToRemove);
294
- (, netScyFee) = IPMarket(market).swapScyForExactPt(receiver, ptFromSwap, EMPTY_BYTES);
287
+ (, netSyFee) = IPMarket(market).swapSyForExactPt(receiver, ptFromSwap, EMPTY_BYTES);
295
288
 
296
289
  // fail-safe
297
290
  if (ptFromBurn + ptFromSwap < minPtOut) assert(false);
@@ -301,20 +294,15 @@ contract ActionAddRemoveLiq is IPActionAddRemoveLiq, ActionBaseMintRedeem {
301
294
  emit RemoveLiquiditySinglePt(msg.sender, market, receiver, netLpToRemove, netPtOut);
302
295
  }
303
296
 
304
- function removeLiquiditySingleScy(
297
+ function removeLiquiditySingleSy(
305
298
  address receiver,
306
299
  address market,
307
300
  uint256 netLpToRemove,
308
- uint256 minScyOut
309
- ) external returns (uint256 netScyOut, uint256 netScyFee) {
301
+ uint256 minSyOut
302
+ ) external returns (uint256 netSyOut, uint256 netSyFee) {
310
303
  IERC20(market).safeTransferFrom(msg.sender, market, netLpToRemove);
311
- (netScyOut, netScyFee) = _removeLiquiditySingleScy(
312
- receiver,
313
- market,
314
- netLpToRemove,
315
- minScyOut
316
- );
317
- emit RemoveLiquiditySingleScy(msg.sender, market, receiver, netLpToRemove, netScyOut);
304
+ (netSyOut, netSyFee) = _removeLiquiditySingleSy(receiver, market, netLpToRemove, minSyOut);
305
+ emit RemoveLiquiditySingleSy(msg.sender, market, receiver, netLpToRemove, netSyOut);
318
306
  }
319
307
 
320
308
  function removeLiquiditySingleToken(
@@ -322,23 +310,23 @@ contract ActionAddRemoveLiq is IPActionAddRemoveLiq, ActionBaseMintRedeem {
322
310
  address market,
323
311
  uint256 netLpToRemove,
324
312
  TokenOutput calldata output
325
- ) external returns (uint256 netTokenOut, uint256 netScyFee) {
326
- (ISuperComposableYield SCY, , ) = IPMarket(market).readTokens();
313
+ ) external returns (uint256 netTokenOut, uint256 netSyFee) {
314
+ (IStandardizedYield SY, , ) = IPMarket(market).readTokens();
327
315
 
328
316
  IERC20(market).safeTransferFrom(msg.sender, market, netLpToRemove);
329
317
 
330
- // all output SCY is directly transferred to the SCY contract
331
- uint256 netScyReceived;
318
+ // all output SY is directly transferred to the SY contract
319
+ uint256 netSyReceived;
332
320
 
333
- (netScyReceived, netScyFee) = _removeLiquiditySingleScy(
334
- address(SCY),
321
+ (netSyReceived, netSyFee) = _removeLiquiditySingleSy(
322
+ address(SY),
335
323
  market,
336
324
  netLpToRemove,
337
325
  1
338
326
  );
339
327
 
340
- // since all SCY is already at the SCY contract, doPull = false
341
- netTokenOut = _redeemScyToToken(receiver, address(SCY), netScyReceived, output, false);
328
+ // since all SY is already at the SY contract, doPull = false
329
+ netTokenOut = _redeemSyToToken(receiver, address(SY), netSyReceived, output, false);
342
330
 
343
331
  emit RemoveLiquiditySingleToken(
344
332
  msg.sender,
@@ -350,76 +338,76 @@ contract ActionAddRemoveLiq is IPActionAddRemoveLiq, ActionBaseMintRedeem {
350
338
  );
351
339
  }
352
340
 
353
- function _addLiquiditySingleScy(
341
+ function _addLiquiditySingleSy(
354
342
  address receiver,
355
343
  address market,
356
344
  IPYieldToken YT,
357
- uint256 netScyIn,
345
+ uint256 netSyIn,
358
346
  uint256 minLpOut,
359
- ApproxParams calldata guessPtReceivedFromScy
360
- ) internal returns (uint256 netLpOut, uint256 netScyFee) {
347
+ ApproxParams calldata guessPtReceivedFromSy
348
+ ) internal returns (uint256 netLpOut, uint256 netSyFee) {
361
349
  MarketState memory state = IPMarket(market).readState();
362
350
 
363
- (uint256 netPtReceived, , ) = state.approxSwapScyToAddLiquidity(
351
+ (uint256 netPtReceived, , ) = state.approxSwapSyToAddLiquidity(
364
352
  YT.newIndex(),
365
- netScyIn,
353
+ netSyIn,
366
354
  block.timestamp,
367
- guessPtReceivedFromScy
355
+ guessPtReceivedFromSy
368
356
  );
369
357
 
370
- uint256 netScySwapped;
371
- (netScySwapped, netScyFee) = IPMarket(market).swapScyForExactPt(
358
+ uint256 netSySwapped;
359
+ (netSySwapped, netSyFee) = IPMarket(market).swapSyForExactPt(
372
360
  market,
373
361
  netPtReceived,
374
362
  EMPTY_BYTES
375
363
  ); // ignore return, receiver = market
376
- (netLpOut, , ) = IPMarket(market).mint(receiver, netScyIn - netScySwapped, netPtReceived);
364
+ (netLpOut, , ) = IPMarket(market).mint(receiver, netSyIn - netSySwapped, netPtReceived);
377
365
 
378
366
  if (netLpOut < minLpOut) revert Errors.RouterInsufficientLpOut(netLpOut, minLpOut);
379
367
  }
380
368
 
381
- function _removeLiquiditySingleScy(
369
+ function _removeLiquiditySingleSy(
382
370
  address receiver,
383
371
  address market,
384
372
  uint256 netLpToRemove,
385
- uint256 minScyOut
386
- ) internal returns (uint256 netScyOut, uint256 netScyFee) {
373
+ uint256 minSyOut
374
+ ) internal returns (uint256 netSyOut, uint256 netSyFee) {
387
375
  if (IPMarket(market).isExpired()) {
388
- netScyOut = __removeLpToScyAfterExpiry(receiver, market, netLpToRemove);
376
+ netSyOut = __removeLpToSyAfterExpiry(receiver, market, netLpToRemove);
389
377
  } else {
390
- (netScyOut, netScyFee) = __removeLpToScyBeforeExpiry(receiver, market, netLpToRemove);
378
+ (netSyOut, netSyFee) = __removeLpToSyBeforeExpiry(receiver, market, netLpToRemove);
391
379
  }
392
380
 
393
- if (netScyOut < minScyOut) revert Errors.RouterInsufficientScyOut(netScyOut, minScyOut);
381
+ if (netSyOut < minSyOut) revert Errors.RouterInsufficientSyOut(netSyOut, minSyOut);
394
382
  }
395
383
 
396
- function __removeLpToScyAfterExpiry(
384
+ function __removeLpToSyAfterExpiry(
397
385
  address receiver,
398
386
  address market,
399
387
  uint256 netLpToRemove
400
- ) internal returns (uint256 netScyOut) {
388
+ ) internal returns (uint256 netSyOut) {
401
389
  (, , IPYieldToken YT) = IPMarket(market).readTokens();
402
- (uint256 scyFromBurn, ) = IPMarket(market).burn(receiver, address(YT), netLpToRemove);
403
- netScyOut = scyFromBurn + IPYieldToken(YT).redeemPY(receiver);
390
+ (uint256 syFromBurn, ) = IPMarket(market).burn(receiver, address(YT), netLpToRemove);
391
+ netSyOut = syFromBurn + IPYieldToken(YT).redeemPY(receiver);
404
392
  }
405
393
 
406
- function __removeLpToScyBeforeExpiry(
394
+ function __removeLpToSyBeforeExpiry(
407
395
  address receiver,
408
396
  address market,
409
397
  uint256 netLpToRemove
410
- ) internal returns (uint256 netScyOut, uint256 netScyFee) {
411
- (uint256 scyFromBurn, uint256 ptFromBurn) = IPMarket(market).burn(
398
+ ) internal returns (uint256 netSyOut, uint256 netSyFee) {
399
+ (uint256 syFromBurn, uint256 ptFromBurn) = IPMarket(market).burn(
412
400
  receiver,
413
401
  market,
414
402
  netLpToRemove
415
403
  );
416
404
 
417
- uint256 scyFromSwap;
418
- (scyFromSwap, netScyFee) = IPMarket(market).swapExactPtForScy(
405
+ uint256 syFromSwap;
406
+ (syFromSwap, netSyFee) = IPMarket(market).swapExactPtForSy(
419
407
  receiver,
420
408
  ptFromBurn,
421
409
  EMPTY_BYTES
422
410
  );
423
- netScyOut = scyFromBurn + scyFromSwap;
411
+ netSyOut = syFromBurn + syFromSwap;
424
412
  }
425
413
  }
@@ -15,7 +15,7 @@ import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
15
15
  contract ActionCallback is IPMarketSwapCallback, CallbackHelper {
16
16
  using Math for int256;
17
17
  using Math for uint256;
18
- using SafeERC20 for ISuperComposableYield;
18
+ using SafeERC20 for IStandardizedYield;
19
19
  using SafeERC20 for IPYieldToken;
20
20
  using SafeERC20 for IPPrincipalToken;
21
21
  using SafeERC20 for IERC20;
@@ -40,35 +40,35 @@ contract ActionCallback is IPMarketSwapCallback, CallbackHelper {
40
40
  */
41
41
  function swapCallback(
42
42
  int256 ptToAccount,
43
- int256 scyToAccount,
43
+ int256 syToAccount,
44
44
  bytes calldata data
45
45
  ) external override onlyPendleMarket(msg.sender) {
46
46
  address market = msg.sender;
47
47
  ActionType swapType = _getActionType(data);
48
- if (swapType == ActionType.SwapExactScyForYt) {
49
- _callbackSwapExactScyForYt(market, ptToAccount, scyToAccount, data);
50
- } else if (swapType == ActionType.SwapScyForExactYt) {
51
- _callbackSwapScyForExactYt(market, ptToAccount, scyToAccount, data);
52
- } else if (swapType == ActionType.SwapYtForScy) {
53
- _callbackSwapYtForScy(market, ptToAccount, scyToAccount, data);
48
+ if (swapType == ActionType.SwapExactSyForYt) {
49
+ _callbackSwapExactSyForYt(market, ptToAccount, syToAccount, data);
50
+ } else if (swapType == ActionType.SwapSyForExactYt) {
51
+ _callbackSwapSyForExactYt(market, ptToAccount, syToAccount, data);
52
+ } else if (swapType == ActionType.SwapYtForSy) {
53
+ _callbackSwapYtForSy(market, ptToAccount, syToAccount, data);
54
54
  } else if (swapType == ActionType.SwapExactYtForPt) {
55
- _callbackSwapExactYtForPt(market, ptToAccount, scyToAccount, data);
55
+ _callbackSwapExactYtForPt(market, ptToAccount, syToAccount, data);
56
56
  } else if (swapType == ActionType.SwapExactPtForYt) {
57
- _callbackSwapExactPtForYt(market, ptToAccount, scyToAccount, data);
57
+ _callbackSwapExactPtForYt(market, ptToAccount, syToAccount, data);
58
58
  } else {
59
59
  assert(false);
60
60
  }
61
61
  }
62
62
 
63
- /// @dev refer to _swapExactScyForYt
64
- function _callbackSwapExactScyForYt(
63
+ /// @dev refer to _swapExactSyForYt
64
+ function _callbackSwapExactSyForYt(
65
65
  address market,
66
66
  int256 ptToAccount,
67
- int256, /*scyToAccount*/
67
+ int256, /*syToAccount*/
68
68
  bytes calldata data
69
69
  ) internal {
70
70
  (, , IPYieldToken YT) = IPMarket(market).readTokens();
71
- (address receiver, uint256 minYtOut) = _decodeSwapExactScyForYt(data);
71
+ (address receiver, uint256 minYtOut) = _decodeSwapExactSyForYt(data);
72
72
 
73
73
  uint256 ptOwed = ptToAccount.abs();
74
74
  uint256 netPyOut = YT.mintPY(market, receiver);
@@ -77,81 +77,81 @@ contract ActionCallback is IPMarketSwapCallback, CallbackHelper {
77
77
  if (netPyOut < minYtOut) revert Errors.RouterInsufficientYtOut(netPyOut, minYtOut);
78
78
  }
79
79
 
80
- struct VarsSwapScyForExactYt {
80
+ struct VarsSwapSyForExactYt {
81
81
  address payer;
82
82
  address receiver;
83
- uint256 maxScyToPull;
83
+ uint256 maxSyToPull;
84
84
  }
85
85
 
86
- /// @dev refer to _swapScyForExactYt
87
- function _callbackSwapScyForExactYt(
86
+ /// @dev refer to _swapSyForExactYt
87
+ function _callbackSwapSyForExactYt(
88
88
  address market,
89
89
  int256 ptToAccount,
90
- int256 scyToAccount,
90
+ int256 syToAccount,
91
91
  bytes calldata data
92
92
  ) internal {
93
- VarsSwapScyForExactYt memory vars;
94
- (vars.payer, vars.receiver, vars.maxScyToPull) = _decodeSwapScyForExactYt(data);
95
- (ISuperComposableYield SCY, , IPYieldToken YT) = IPMarket(market).readTokens();
93
+ VarsSwapSyForExactYt memory vars;
94
+ (vars.payer, vars.receiver, vars.maxSyToPull) = _decodeSwapSyForExactYt(data);
95
+ (IStandardizedYield SY, , IPYieldToken YT) = IPMarket(market).readTokens();
96
96
 
97
97
  /// ------------------------------------------------------------
98
- /// calc totalScyNeed
98
+ /// calc totalSyNeed
99
99
  /// ------------------------------------------------------------
100
100
  PYIndex pyIndex = YT.newIndex();
101
101
  uint256 ptOwed = ptToAccount.abs();
102
- uint256 totalScyNeed = pyIndex.assetToScyUp(ptOwed);
102
+ uint256 totalSyNeed = pyIndex.assetToSyUp(ptOwed);
103
103
 
104
104
  /// ------------------------------------------------------------
105
- /// calc netScyToPull
105
+ /// calc netSyToPull
106
106
  /// ------------------------------------------------------------
107
- uint256 scyReceived = scyToAccount.Uint();
108
- uint256 netScyToPull = totalScyNeed.subMax0(scyReceived);
107
+ uint256 syReceived = syToAccount.Uint();
108
+ uint256 netSyToPull = totalSyNeed.subMax0(syReceived);
109
109
 
110
- if (netScyToPull > vars.maxScyToPull)
111
- revert Errors.RouterExceededLimitScyIn(netScyToPull, vars.maxScyToPull);
110
+ if (netSyToPull > vars.maxSyToPull)
111
+ revert Errors.RouterExceededLimitSyIn(netSyToPull, vars.maxSyToPull);
112
112
 
113
113
  /// ------------------------------------------------------------
114
114
  /// mint & transfer
115
115
  /// ------------------------------------------------------------
116
- if (netScyToPull > 0) {
117
- SCY.safeTransferFrom(vars.payer, address(YT), netScyToPull);
116
+ if (netSyToPull > 0) {
117
+ SY.safeTransferFrom(vars.payer, address(YT), netSyToPull);
118
118
  }
119
119
 
120
120
  uint256 netPyOut = YT.mintPY(market, vars.receiver);
121
121
  if (netPyOut < ptOwed) revert Errors.RouterInsufficientPtRepay(netPyOut, ptOwed);
122
122
  }
123
123
 
124
- /// @dev refer to _swapExactYtForScy or _swapYtForExactScy
125
- function _callbackSwapYtForScy(
124
+ /// @dev refer to _swapExactYtForSy or _swapYtForExactSy
125
+ function _callbackSwapYtForSy(
126
126
  address market,
127
127
  int256 ptToAccount,
128
- int256 scyToAccount,
128
+ int256 syToAccount,
129
129
  bytes calldata data
130
130
  ) internal {
131
- (address receiver, uint256 minScyOut) = _decodeSwapYtForScy(data);
131
+ (address receiver, uint256 minSyOut) = _decodeSwapYtForSy(data);
132
132
  (, , IPYieldToken YT) = IPMarket(market).readTokens();
133
133
  PYIndex pyIndex = YT.newIndex();
134
134
 
135
- uint256 scyOwed = scyToAccount.neg().Uint();
135
+ uint256 syOwed = syToAccount.neg().Uint();
136
136
 
137
137
  address[] memory receivers = new address[](2);
138
138
  uint256[] memory amountPYToRedeems = new uint256[](2);
139
139
 
140
- (receivers[0], amountPYToRedeems[0]) = (market, pyIndex.scyToAssetUp(scyOwed));
140
+ (receivers[0], amountPYToRedeems[0]) = (market, pyIndex.syToAssetUp(syOwed));
141
141
  (receivers[1], amountPYToRedeems[1]) = (
142
142
  receiver,
143
143
  ptToAccount.Uint() - amountPYToRedeems[0]
144
144
  );
145
145
 
146
- uint256[] memory amountScyOuts = YT.redeemPYMulti(receivers, amountPYToRedeems);
147
- if (amountScyOuts[1] < minScyOut)
148
- revert Errors.RouterInsufficientScyOut(amountScyOuts[1], minScyOut);
146
+ uint256[] memory amountSyOuts = YT.redeemPYMulti(receivers, amountPYToRedeems);
147
+ if (amountSyOuts[1] < minSyOut)
148
+ revert Errors.RouterInsufficientSyOut(amountSyOuts[1], minSyOut);
149
149
  }
150
150
 
151
151
  function _callbackSwapExactPtForYt(
152
152
  address market,
153
153
  int256 ptToAccount,
154
- int256, /*scyToAccount*/
154
+ int256, /*syToAccount*/
155
155
  bytes calldata data
156
156
  ) internal {
157
157
  (address receiver, uint256 exactPtIn, uint256 minYtOut) = _decodeSwapExactPtForYt(data);
@@ -167,19 +167,19 @@ contract ActionCallback is IPMarketSwapCallback, CallbackHelper {
167
167
  function _callbackSwapExactYtForPt(
168
168
  address market,
169
169
  int256 ptToAccount,
170
- int256 scyToAccount,
170
+ int256 syToAccount,
171
171
  bytes calldata data
172
172
  ) internal {
173
173
  (address receiver, uint256 exactYtIn, uint256 minPtOut) = _decodeSwapExactYtForPt(data);
174
174
  (, IPPrincipalToken PT, IPYieldToken YT) = IPMarket(market).readTokens();
175
175
 
176
- uint256 netScyOwed = scyToAccount.abs();
176
+ uint256 netSyOwed = syToAccount.abs();
177
177
 
178
178
  PT.safeTransfer(address(YT), exactYtIn);
179
- uint256 netScyToMarket = YT.redeemPY(market);
179
+ uint256 netSyToMarket = YT.redeemPY(market);
180
180
 
181
- if (netScyToMarket < netScyOwed)
182
- revert Errors.RouterInsufficientScyRepay(netScyToMarket, netScyOwed);
181
+ if (netSyToMarket < netSyOwed)
182
+ revert Errors.RouterInsufficientSyRepay(netSyToMarket, netSyOwed);
183
183
 
184
184
  uint256 netPtOut = ptToAccount.Uint() - exactYtIn;
185
185
  if (netPtOut < minPtOut) revert Errors.RouterInsufficientPtOut(netPtOut, minPtOut);