@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
@@ -3,14 +3,14 @@ pragma solidity 0.8.17;
3
3
 
4
4
  import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
5
5
 
6
- import "../../interfaces/ISuperComposableYield.sol";
6
+ import "../../interfaces/IStandardizedYield.sol";
7
7
  import "../../interfaces/IPYieldToken.sol";
8
8
  import "../../interfaces/IPPrincipalToken.sol";
9
9
 
10
10
  import "../libraries/math/Math.sol";
11
11
  import "../libraries/ArrayLib.sol";
12
12
  import "../../interfaces/IPYieldContractFactory.sol";
13
- import "../SuperComposableYield/SCYUtils.sol";
13
+ import "../StandardizedYield/SYUtils.sol";
14
14
  import "../libraries/Errors.sol";
15
15
  import "../libraries/MiniHelpers.sol";
16
16
 
@@ -35,17 +35,17 @@ contract PendleYieldToken is
35
35
 
36
36
  struct PostExpiryData {
37
37
  uint128 firstPYIndex;
38
- uint128 totalScyInterestForTreasury;
38
+ uint128 totalSyInterestForTreasury;
39
39
  mapping(address => uint256) firstRewardIndex;
40
40
  mapping(address => uint256) userRewardOwed;
41
41
  }
42
42
 
43
- address public immutable SCY;
43
+ address public immutable SY;
44
44
  address public immutable PT;
45
45
  address public immutable factory;
46
46
  uint256 public immutable expiry;
47
47
 
48
- uint128 public scyReserve;
48
+ uint128 public syReserve;
49
49
  uint128 internal _pyIndexStored;
50
50
 
51
51
  PostExpiryData public postExpiry;
@@ -53,7 +53,7 @@ contract PendleYieldToken is
53
53
  modifier updateData() {
54
54
  if (isExpired()) _setPostExpiryData();
55
55
  _;
56
- _updateScyReserve();
56
+ _updateSyReserve();
57
57
  }
58
58
 
59
59
  modifier notExpired() {
@@ -62,20 +62,20 @@ contract PendleYieldToken is
62
62
  }
63
63
 
64
64
  constructor(
65
- address _SCY,
65
+ address _SY,
66
66
  address _PT,
67
67
  string memory _name,
68
68
  string memory _symbol,
69
69
  uint8 __decimals,
70
70
  uint256 _expiry
71
71
  ) PendleERC20Permit(_name, _symbol, __decimals) {
72
- SCY = _SCY;
72
+ SY = _SY;
73
73
  PT = _PT;
74
74
  expiry = _expiry;
75
75
  factory = msg.sender;
76
76
  }
77
77
 
78
- /// @notice Tokenize SCY into PT + YT of equal qty. Every unit of underlying of SCY will create 1 PT + 1 YT
78
+ /// @notice Tokenize SY into PT + YT of equal qty. Every unit of underlying of SY will create 1 PT + 1 YT
79
79
  function mintPY(address receiverPT, address receiverYT)
80
80
  external
81
81
  nonReentrant
@@ -85,52 +85,52 @@ contract PendleYieldToken is
85
85
  {
86
86
  address[] memory receiverPTs = new address[](1);
87
87
  address[] memory receiverYTs = new address[](1);
88
- uint256[] memory amountScyToMints = new uint256[](1);
88
+ uint256[] memory amountSyToMints = new uint256[](1);
89
89
 
90
- (receiverPTs[0], receiverYTs[0], amountScyToMints[0]) = (
90
+ (receiverPTs[0], receiverYTs[0], amountSyToMints[0]) = (
91
91
  receiverPT,
92
92
  receiverYT,
93
- _getFloatingScyAmount()
93
+ _getFloatingSyAmount()
94
94
  );
95
95
 
96
- uint256[] memory amountPYOuts = _mintPY(receiverPTs, receiverYTs, amountScyToMints);
96
+ uint256[] memory amountPYOuts = _mintPY(receiverPTs, receiverYTs, amountSyToMints);
97
97
  amountPYOut = amountPYOuts[0];
98
98
  }
99
99
 
100
- /// @notice Tokenize SCY into PT + YT of equal qty. Every unit of underlying of SCY will create 1 PT + 1 YT
100
+ /// @notice Tokenize SY into PT + YT of equal qty. Every unit of underlying of SY will create 1 PT + 1 YT
101
101
  function mintPYMulti(
102
102
  address[] calldata receiverPTs,
103
103
  address[] calldata receiverYTs,
104
- uint256[] calldata amountScyToMints
104
+ uint256[] calldata amountSyToMints
105
105
  ) external nonReentrant notExpired updateData returns (uint256[] memory amountPYOuts) {
106
106
  uint256 length = receiverPTs.length;
107
107
 
108
- if (receiverYTs.length != length && amountScyToMints.length == length)
108
+ if (receiverYTs.length != length && amountSyToMints.length == length)
109
109
  revert Errors.ArrayLengthMismatch();
110
110
  if (length == 0) revert Errors.ArrayEmpty();
111
111
 
112
- uint256 totalScyToMint = amountScyToMints.sum();
113
- if (totalScyToMint > _getFloatingScyAmount())
114
- revert Errors.YieldContractInsufficientScy(totalScyToMint, _getFloatingScyAmount());
112
+ uint256 totalSyToMint = amountSyToMints.sum();
113
+ if (totalSyToMint > _getFloatingSyAmount())
114
+ revert Errors.YieldContractInsufficientSy(totalSyToMint, _getFloatingSyAmount());
115
115
 
116
- amountPYOuts = _mintPY(receiverPTs, receiverYTs, amountScyToMints);
116
+ amountPYOuts = _mintPY(receiverPTs, receiverYTs, amountSyToMints);
117
117
  }
118
118
 
119
- /// @dev this function converts PY tokens into scy, but interests & rewards are not redeemed at the same time
119
+ /// @dev this function converts PY tokens into sy, but interests & rewards are not redeemed at the same time
120
120
  function redeemPY(address receiver)
121
121
  external
122
122
  nonReentrant
123
123
  updateData
124
- returns (uint256 amountScyOut)
124
+ returns (uint256 amountSyOut)
125
125
  {
126
126
  address[] memory receivers = new address[](1);
127
127
  uint256[] memory amounts = new uint256[](1);
128
128
  (receivers[0], amounts[0]) = (receiver, _getAmountPYToRedeem());
129
129
 
130
- uint256[] memory amountScyOuts;
131
- amountScyOuts = _redeemPY(receivers, amounts);
130
+ uint256[] memory amountSyOuts;
131
+ amountSyOuts = _redeemPY(receivers, amounts);
132
132
 
133
- amountScyOut = amountScyOuts[0];
133
+ amountSyOut = amountSyOuts[0];
134
134
  }
135
135
 
136
136
  /// @dev this function limit how much each receiver will receive. For example, if the totalOut is 100,
@@ -140,16 +140,16 @@ contract PendleYieldToken is
140
140
  external
141
141
  nonReentrant
142
142
  updateData
143
- returns (uint256[] memory amountScyOuts)
143
+ returns (uint256[] memory amountSyOuts)
144
144
  {
145
145
  if (receivers.length != amountPYToRedeems.length) revert Errors.ArrayLengthMismatch();
146
146
  if (receivers.length == 0) revert Errors.ArrayEmpty();
147
- amountScyOuts = _redeemPY(receivers, amountPYToRedeems);
147
+ amountSyOuts = _redeemPY(receivers, amountPYToRedeems);
148
148
  }
149
149
 
150
150
  /**
151
- * @dev With YT yielding interest in the form of SCY, which is redeemable by users, the reward
152
- distribution should be based on the amount of SCYs that their YT currently represent, plus their
151
+ * @dev With YT yielding interest in the form of SY, which is redeemable by users, the reward
152
+ distribution should be based on the amount of SYs that their YT currently represent, plus their
153
153
  dueInterest. It has been proven and tested that _rewardSharesUser will not change over time,
154
154
  unless users redeem their dueInterest or redeemPY. Due to this, it is required to update users'
155
155
  accruedReward STRICTLY BEFORE transferring out their interest.
@@ -175,7 +175,7 @@ contract PendleYieldToken is
175
175
 
176
176
  if (redeemInterest) {
177
177
  _distributeInterest(user);
178
- interestOut = _doTransferOutInterest(user, SCY, factory);
178
+ interestOut = _doTransferOutInterest(user, SY, factory);
179
179
  emit RedeemInterest(user, interestOut);
180
180
  } else {
181
181
  interestOut = 0;
@@ -203,13 +203,13 @@ contract PendleYieldToken is
203
203
 
204
204
  _transferOut(tokens, treasury, rewardsOut);
205
205
 
206
- interestOut = postExpiry.totalScyInterestForTreasury;
207
- postExpiry.totalScyInterestForTreasury = 0;
208
- _transferOut(SCY, treasury, interestOut);
206
+ interestOut = postExpiry.totalSyInterestForTreasury;
207
+ postExpiry.totalSyInterestForTreasury = 0;
208
+ _transferOut(SY, treasury, interestOut);
209
209
  }
210
210
 
211
211
  function rewardIndexesCurrent() external override nonReentrant returns (uint256[] memory) {
212
- return ISuperComposableYield(SCY).rewardIndexesCurrent();
212
+ return IStandardizedYield(SY).rewardIndexesCurrent();
213
213
  }
214
214
 
215
215
  /// @dev maximize the current rate with the previous rate to guarantee non-decreasing rate
@@ -228,7 +228,7 @@ contract PendleYieldToken is
228
228
  view
229
229
  returns (
230
230
  uint256 firstPYIndex,
231
- uint256 totalScyInterestForTreasury,
231
+ uint256 totalSyInterestForTreasury,
232
232
  uint256[] memory firstRewardIndexes,
233
233
  uint256[] memory userRewardOwed
234
234
  )
@@ -236,7 +236,7 @@ contract PendleYieldToken is
236
236
  if (postExpiry.firstPYIndex == 0) revert Errors.YCPostExpiryDataNotSet();
237
237
 
238
238
  firstPYIndex = postExpiry.firstPYIndex;
239
- totalScyInterestForTreasury = postExpiry.totalScyInterestForTreasury;
239
+ totalSyInterestForTreasury = postExpiry.totalSyInterestForTreasury;
240
240
 
241
241
  address[] memory tokens = getRewardTokens();
242
242
  firstRewardIndexes = new uint256[](tokens.length);
@@ -251,14 +251,14 @@ contract PendleYieldToken is
251
251
  function _mintPY(
252
252
  address[] memory receiverPTs,
253
253
  address[] memory receiverYTs,
254
- uint256[] memory amountScyToMints
254
+ uint256[] memory amountSyToMints
255
255
  ) internal returns (uint256[] memory amountPYOuts) {
256
- amountPYOuts = new uint256[](amountScyToMints.length);
256
+ amountPYOuts = new uint256[](amountSyToMints.length);
257
257
 
258
258
  uint256 index = _pyIndexCurrent();
259
259
 
260
- for (uint256 i = 0; i < amountScyToMints.length; i++) {
261
- amountPYOuts[i] = _calcPYToMint(amountScyToMints[i], index);
260
+ for (uint256 i = 0; i < amountSyToMints.length; i++) {
261
+ amountPYOuts[i] = _calcPYToMint(amountSyToMints[i], index);
262
262
 
263
263
  _mint(receiverYTs[i], amountPYOuts[i]);
264
264
  IPPrincipalToken(PT).mintByYT(receiverPTs[i], amountPYOuts[i]);
@@ -267,7 +267,7 @@ contract PendleYieldToken is
267
267
  msg.sender,
268
268
  receiverPTs[i],
269
269
  receiverYTs[i],
270
- amountScyToMints[i],
270
+ amountSyToMints[i],
271
271
  amountPYOuts[i]
272
272
  );
273
273
  }
@@ -283,50 +283,50 @@ contract PendleYieldToken is
283
283
 
284
284
  function _redeemPY(address[] memory receivers, uint256[] memory amountPYToRedeems)
285
285
  internal
286
- returns (uint256[] memory amountScyOuts)
286
+ returns (uint256[] memory amountSyOuts)
287
287
  {
288
288
  uint256 totalAmountPYToRedeem = amountPYToRedeems.sum();
289
289
  IPPrincipalToken(PT).burnByYT(address(this), totalAmountPYToRedeem);
290
290
  if (!isExpired()) _burn(address(this), totalAmountPYToRedeem);
291
291
 
292
292
  uint256 index = _pyIndexCurrent();
293
- uint256 totalScyInterestPostExpiry;
294
- amountScyOuts = new uint256[](receivers.length);
293
+ uint256 totalSyInterestPostExpiry;
294
+ amountSyOuts = new uint256[](receivers.length);
295
295
 
296
296
  for (uint256 i = 0; i < receivers.length; i++) {
297
- uint256 scyInterestPostExpiry;
298
- (amountScyOuts[i], scyInterestPostExpiry) = _calcScyRedeemableFromPY(
297
+ uint256 syInterestPostExpiry;
298
+ (amountSyOuts[i], syInterestPostExpiry) = _calcSyRedeemableFromPY(
299
299
  amountPYToRedeems[i],
300
300
  index
301
301
  );
302
- _transferOut(SCY, receivers[i], amountScyOuts[i]);
303
- totalScyInterestPostExpiry += scyInterestPostExpiry;
302
+ _transferOut(SY, receivers[i], amountSyOuts[i]);
303
+ totalSyInterestPostExpiry += syInterestPostExpiry;
304
304
 
305
- emit Burn(msg.sender, receivers[i], amountPYToRedeems[i], amountScyOuts[i]);
305
+ emit Burn(msg.sender, receivers[i], amountPYToRedeems[i], amountSyOuts[i]);
306
306
  }
307
- if (totalScyInterestPostExpiry != 0) {
308
- postExpiry.totalScyInterestForTreasury += totalScyInterestPostExpiry.Uint128();
307
+ if (totalSyInterestPostExpiry != 0) {
308
+ postExpiry.totalSyInterestForTreasury += totalSyInterestPostExpiry.Uint128();
309
309
  }
310
310
  }
311
311
 
312
- function _calcPYToMint(uint256 amountScy, uint256 indexCurrent)
312
+ function _calcPYToMint(uint256 amountSy, uint256 indexCurrent)
313
313
  internal
314
314
  pure
315
315
  returns (uint256 amountPY)
316
316
  {
317
317
  // doesn't matter before or after expiry, since mintPY is only allowed before expiry
318
- return SCYUtils.scyToAsset(indexCurrent, amountScy);
318
+ return SYUtils.syToAsset(indexCurrent, amountSy);
319
319
  }
320
320
 
321
- function _calcScyRedeemableFromPY(uint256 amountPY, uint256 indexCurrent)
321
+ function _calcSyRedeemableFromPY(uint256 amountPY, uint256 indexCurrent)
322
322
  internal
323
323
  view
324
- returns (uint256 scyToUser, uint256 scyInterestPostExpiry)
324
+ returns (uint256 syToUser, uint256 syInterestPostExpiry)
325
325
  {
326
- scyToUser = SCYUtils.assetToScy(indexCurrent, amountPY);
326
+ syToUser = SYUtils.assetToSy(indexCurrent, amountPY);
327
327
  if (isExpired()) {
328
- uint256 totalScyRedeemable = SCYUtils.assetToScy(postExpiry.firstPYIndex, amountPY);
329
- scyInterestPostExpiry = totalScyRedeemable - scyToUser;
328
+ uint256 totalSyRedeemable = SYUtils.assetToSy(postExpiry.firstPYIndex, amountPY);
329
+ syInterestPostExpiry = totalSyRedeemable - syToUser;
330
330
  }
331
331
  }
332
332
 
@@ -335,13 +335,13 @@ contract PendleYieldToken is
335
335
  else return _selfBalance(PT);
336
336
  }
337
337
 
338
- function _updateScyReserve() internal virtual {
339
- scyReserve = _selfBalance(SCY).Uint128();
338
+ function _updateSyReserve() internal virtual {
339
+ syReserve = _selfBalance(SY).Uint128();
340
340
  }
341
341
 
342
- function _getFloatingScyAmount() internal view returns (uint256 amount) {
343
- amount = _selfBalance(SCY) - scyReserve;
344
- if (amount == 0) revert Errors.YCNoFloatingScy();
342
+ function _getFloatingSyAmount() internal view returns (uint256 amount) {
343
+ amount = _selfBalance(SY) - syReserve;
344
+ if (amount == 0) revert Errors.YCNoFloatingSy();
345
345
  }
346
346
 
347
347
  function _setPostExpiryData() internal {
@@ -351,8 +351,8 @@ contract PendleYieldToken is
351
351
  _redeemExternalReward(); // do a final redeem. All the future reward income will belong to the treasury
352
352
 
353
353
  local.firstPYIndex = _pyIndexCurrent().Uint128();
354
- address[] memory rewardTokens = ISuperComposableYield(SCY).getRewardTokens();
355
- uint256[] memory rewardIndexes = ISuperComposableYield(SCY).rewardIndexesCurrent();
354
+ address[] memory rewardTokens = IStandardizedYield(SY).getRewardTokens();
355
+ uint256[] memory rewardIndexes = IStandardizedYield(SY).rewardIndexesCurrent();
356
356
  for (uint256 i = 0; i < rewardTokens.length; i++) {
357
357
  local.firstRewardIndex[rewardTokens[i]] = rewardIndexes[i];
358
358
  local.userRewardOwed[rewardTokens[i]] = _selfBalance(rewardTokens[i]);
@@ -369,7 +369,7 @@ contract PendleYieldToken is
369
369
  }
370
370
 
371
371
  function _pyIndexCurrent() internal returns (uint256 currentIndex) {
372
- currentIndex = Math.max(ISuperComposableYield(SCY).exchangeRate(), _pyIndexStored);
372
+ currentIndex = Math.max(IStandardizedYield(SY).exchangeRate(), _pyIndexStored);
373
373
  _pyIndexStored = currentIndex.Uint128();
374
374
  emit NewInterestIndex(currentIndex);
375
375
  }
@@ -383,7 +383,7 @@ contract PendleYieldToken is
383
383
  //////////////////////////////////////////////////////////////*/
384
384
 
385
385
  function getRewardTokens() public view returns (address[] memory) {
386
- return ISuperComposableYield(SCY).getRewardTokens();
386
+ return IStandardizedYield(SY).getRewardTokens();
387
387
  }
388
388
 
389
389
  function _doTransferOutRewards(address user, address receiver)
@@ -436,14 +436,14 @@ contract PendleYieldToken is
436
436
  }
437
437
 
438
438
  function _redeemExternalReward() internal virtual override {
439
- ISuperComposableYield(SCY).claimRewards(address(this));
439
+ IStandardizedYield(SY).claimRewards(address(this));
440
440
  }
441
441
 
442
- /// @dev effectively returning the amount of SCY generating rewards for this user
442
+ /// @dev effectively returning the amount of SY generating rewards for this user
443
443
  function _rewardSharesUser(address user) internal view virtual override returns (uint256) {
444
444
  uint256 index = userInterest[user].index;
445
445
  if (index == 0) return 0;
446
- return SCYUtils.assetToScy(index, balanceOf(user)) + userInterest[user].accrued;
446
+ return SYUtils.assetToSy(index, balanceOf(user)) + userInterest[user].accrued;
447
447
  }
448
448
 
449
449
  function _updateRewardIndex()
@@ -457,7 +457,7 @@ contract PendleYieldToken is
457
457
  for (uint256 i = 0; i < tokens.length; i++)
458
458
  indexes[i] = postExpiry.firstRewardIndex[tokens[i]];
459
459
  } else {
460
- indexes = ISuperComposableYield(SCY).rewardIndexesCurrent();
460
+ indexes = IStandardizedYield(SY).rewardIndexesCurrent();
461
461
  }
462
462
  }
463
463
 
@@ -15,7 +15,7 @@ library Errors {
15
15
  error MarketZeroLnImpliedRate();
16
16
  error MarketInsufficientPtForTrade(int256 currentAmount, int256 requiredAmount);
17
17
  error MarketInsufficientPtReceived(uint256 actualBalance, uint256 requiredBalance);
18
- error MarketInsufficientScyReceived(uint256 actualBalance, uint256 requiredBalance);
18
+ error MarketInsufficientSyReceived(uint256 actualBalance, uint256 requiredBalance);
19
19
  error MarketZeroTotalPtOrTotalAsset(int256 totalPt, int256 totalAsset);
20
20
  error MarketExchangeRateBelowOne(int256 exchangeRate);
21
21
  error MarketProportionMustNotEqualOne();
@@ -36,15 +36,15 @@ library Errors {
36
36
 
37
37
  // ROUTER
38
38
  error RouterInsufficientLpOut(uint256 actualLpOut, uint256 requiredLpOut);
39
- error RouterInsufficientScyOut(uint256 actualScyOut, uint256 requiredScyOut);
39
+ error RouterInsufficientSyOut(uint256 actualSyOut, uint256 requiredSyOut);
40
40
  error RouterInsufficientPtOut(uint256 actualPtOut, uint256 requiredPtOut);
41
41
  error RouterInsufficientYtOut(uint256 actualYtOut, uint256 requiredYtOut);
42
42
  error RouterInsufficientPYOut(uint256 actualPYOut, uint256 requiredPYOut);
43
43
  error RouterInsufficientTokenOut(uint256 actualTokenOut, uint256 requiredTokenOut);
44
- error RouterExceededLimitScyIn(uint256 actualScyIn, uint256 limitScyIn);
44
+ error RouterExceededLimitSyIn(uint256 actualSyIn, uint256 limitSyIn);
45
45
  error RouterExceededLimitPtIn(uint256 actualPtIn, uint256 limitPtIn);
46
46
  error RouterExceededLimitYtIn(uint256 actualYtIn, uint256 limitYtIn);
47
- error RouterInsufficientScyRepay(uint256 actualScyRepay, uint256 requiredScyRepay);
47
+ error RouterInsufficientSyRepay(uint256 actualSyRepay, uint256 requiredSyRepay);
48
48
  error RouterInsufficientPtRepay(uint256 actualPtRepay, uint256 requiredPtRepay);
49
49
 
50
50
  error RouterTimeRangeZero();
@@ -54,31 +54,31 @@ library Errors {
54
54
  // YIELD CONTRACT
55
55
  error YCExpired();
56
56
  error YCNotExpired();
57
- error YieldContractInsufficientScy(uint256 actualScy, uint256 requiredScy);
57
+ error YieldContractInsufficientSy(uint256 actualSy, uint256 requiredSy);
58
58
  error YCNothingToRedeem();
59
59
  error YCPostExpiryDataNotSet();
60
- error YCNoFloatingScy();
60
+ error YCNoFloatingSy();
61
61
 
62
62
  // YieldFactory
63
63
  error YCFactoryInvalidExpiry();
64
64
  error YCFactoryYieldContractExisted();
65
65
 
66
- // SCY
67
- error SCYInvalidTokenIn(address token);
68
- error SCYInvalidTokenOut(address token);
69
- error SCYZeroDeposit();
70
- error SCYZeroRedeem();
71
- error SCYInsufficientSharesOut(uint256 actualSharesOut, uint256 requiredSharesOut);
72
- error SCYInsufficientTokenOut(uint256 actualTokenOut, uint256 requiredTokenOut);
66
+ // SY
67
+ error SYInvalidTokenIn(address token);
68
+ error SYInvalidTokenOut(address token);
69
+ error SYZeroDeposit();
70
+ error SYZeroRedeem();
71
+ error SYInsufficientSharesOut(uint256 actualSharesOut, uint256 requiredSharesOut);
72
+ error SYInsufficientTokenOut(uint256 actualTokenOut, uint256 requiredTokenOut);
73
73
 
74
- // SCY-specific
75
- error SCYQiTokenMintFailed(uint256 errCode);
76
- error SCYQiTokenRedeemFailed(uint256 errCode);
77
- error SCYQiTokenRedeemRewardsFailed(uint256 rewardAccruedType0, uint256 rewardAccruedType1);
78
- error SCYQiTokenBorrowRateTooHigh(uint256 borrowRate, uint256 borrowRateMax);
74
+ // SY-specific
75
+ error SYQiTokenMintFailed(uint256 errCode);
76
+ error SYQiTokenRedeemFailed(uint256 errCode);
77
+ error SYQiTokenRedeemRewardsFailed(uint256 rewardAccruedType0, uint256 rewardAccruedType1);
78
+ error SYQiTokenBorrowRateTooHigh(uint256 borrowRate, uint256 borrowRateMax);
79
79
 
80
- error SCYCurveInvalidPid();
81
- error SCYCurve3crvPoolNotFound();
80
+ error SYCurveInvalidPid();
81
+ error SYCurve3crvPoolNotFound();
82
82
 
83
83
  // Liquidity Mining
84
84
  error VCInactivePool(address pool);
@@ -111,6 +111,8 @@ library Errors {
111
111
  error MsgNotFromSendEndpoint(address sender);
112
112
  error MsgNotFromReceiveEndpoint(address sender);
113
113
  error InsufficientFeeToSendMsg(uint256 currentFee, uint256 requiredFee);
114
+ error ApproxDstExecutionGasNotSet();
115
+ error InvalidRetryData();
114
116
 
115
117
  // GENERIC MSG
116
118
  error ArrayLengthMismatch();
@@ -118,7 +120,7 @@ library Errors {
118
120
  error ArrayOutOfBounds();
119
121
  error ZeroAddress();
120
122
 
121
- error OnlyCelerBus();
123
+ error OnlyLayerZeroEndpoint();
122
124
  error OnlyYT();
123
125
  error OnlyYCFactory();
124
126
  error OnlyWhitelisted();
@@ -8,39 +8,6 @@ abstract contract TokenHelper {
8
8
  address internal constant NATIVE = address(0);
9
9
  uint256 internal constant LOWER_BOUND_APPROVAL = type(uint96).max / 2; // some tokens use 96 bits for approval
10
10
 
11
- function _transferFrom(
12
- address token,
13
- address from,
14
- address to,
15
- uint256 amount
16
- ) internal {
17
- if (token == NATIVE) require(msg.value == amount, "eth mismatch");
18
- else if (amount != 0) IERC20(token).safeTransferFrom(from, to, amount);
19
- }
20
-
21
- function _transferFrom(
22
- address[] memory tokens,
23
- address from,
24
- address to,
25
- uint256[] memory amounts
26
- ) internal {
27
- uint256 length = tokens.length;
28
- require(length == amounts.length, "length mismatch");
29
-
30
- for (uint256 i = 0; i < length; ) {
31
- if (amounts[i] > 0) {
32
- if (tokens[i] == NATIVE) {
33
- require(msg.value == amounts[i], "native mismatch");
34
- } else {
35
- IERC20(tokens[i]).safeTransferFrom(from, to, amounts[i]);
36
- }
37
- }
38
- unchecked {
39
- i++;
40
- }
41
- }
42
- }
43
-
44
11
  function _transferIn(
45
12
  address token,
46
13
  address from,
@@ -2,6 +2,8 @@
2
2
  pragma solidity 0.8.17;
3
3
 
4
4
  interface ICrvPool {
5
+ function coins(uint256 i) external view returns (address);
6
+
5
7
  function get_virtual_price() external view returns (uint256);
6
8
 
7
9
  function get_dy(
@@ -0,0 +1,39 @@
1
+ // SPDX-License-Identifier: MIT
2
+
3
+ pragma solidity >=0.5.0;
4
+
5
+ interface ILayerZeroEndpoint {
6
+ // @notice send a LayerZero message to the specified address at a LayerZero endpoint.
7
+ // @param _dstChainId - the destination chain identifier
8
+ // @param _destination - the address on destination chain (in bytes). address length/format may vary by chains
9
+ // @param _payload - a custom bytes payload to send to the destination contract
10
+ // @param _refundAddress - if the source transaction is cheaper than the amount of value passed, refund the additional amount to this address
11
+ // @param _zroPaymentAddress - the address of the ZRO token holder who would pay for the transaction
12
+ // @param _adapterParams - parameters for custom functionality. e.g. receive airdropped native gas from the relayer on destination
13
+ function send(
14
+ uint16 _dstChainId,
15
+ bytes calldata _destination,
16
+ bytes calldata _payload,
17
+ address payable _refundAddress,
18
+ address _zroPaymentAddress,
19
+ bytes calldata _adapterParams
20
+ ) external payable;
21
+
22
+ // @notice gets a quote in source native gas, for the amount that send() requires to pay for message delivery
23
+ // @param _dstChainId - the destination chain identifier
24
+ // @param _userApplication - the user app address on this EVM chain
25
+ // @param _payload - the custom message to send over LayerZero
26
+ // @param _payInZRO - if false, user app pays the protocol fee in native token
27
+ // @param _adapterParam - parameters for the adapter service, e.g. send some dust native token to dstChain
28
+ function estimateFees(
29
+ uint16 _dstChainId,
30
+ address _userApplication,
31
+ bytes calldata _payload,
32
+ bool _payInZRO,
33
+ bytes calldata _adapterParam
34
+ ) external view returns (uint256 nativeFee, uint256 zroFee);
35
+
36
+ function setSendVersion(uint16 _newVersion) external;
37
+
38
+ function setReceiveVersion(uint16 _newVersion) external;
39
+ }
@@ -0,0 +1,12 @@
1
+ // SPDX-License-Identifier: BUSL-1.1
2
+
3
+ pragma solidity >=0.5.0;
4
+
5
+ interface ILayerZeroReceiver {
6
+ // @notice LayerZero endpoint will invoke this function to deliver the message on the destination
7
+ // @param _srcChainId - the source endpoint identifier
8
+ // @param _srcAddress - the source sending contract address from the source chain
9
+ // @param _nonce - the ordered message nonce
10
+ // @param _payload - the signed payload is the UA bytes has encoded to be sent
11
+ function lzReceive(uint16 _srcChainId, bytes calldata _srcAddress, uint64 _nonce, bytes calldata _payload) external;
12
+ }