@pendle/core-v2 0.9.2-beta → 0.9.4-beta

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 (138) hide show
  1. package/build/artifacts/contracts/SuperComposableYield/SCY-implementations/AaveV3/PendleAaveV3SCY.sol/PendleAaveV3SCY.dbg.json +1 -1
  2. package/build/artifacts/contracts/SuperComposableYield/SCY-implementations/AaveV3/PendleAaveV3SCY.sol/PendleAaveV3SCY.json +2 -2
  3. package/build/artifacts/contracts/SuperComposableYield/SCY-implementations/AaveV3/WadRayMath.sol/WadRayMath.dbg.json +1 -1
  4. package/build/artifacts/contracts/SuperComposableYield/SCY-implementations/BenQi/PendleQiSAvaxSCY.sol/PendleQiSAvaxSCY.dbg.json +1 -1
  5. package/build/artifacts/contracts/SuperComposableYield/SCY-implementations/BenQi/PendleQiSAvaxSCY.sol/PendleQiSAvaxSCY.json +2 -2
  6. package/build/artifacts/contracts/SuperComposableYield/SCY-implementations/BenQi/PendleQiTokenHelper.sol/PendleQiTokenHelper.dbg.json +1 -1
  7. package/build/artifacts/contracts/SuperComposableYield/SCY-implementations/BenQi/PendleQiTokenSCY.sol/PendleQiTokenSCY.dbg.json +1 -1
  8. package/build/artifacts/contracts/SuperComposableYield/SCY-implementations/BenQi/PendleQiTokenSCY.sol/PendleQiTokenSCY.json +2 -2
  9. package/build/artifacts/contracts/SuperComposableYield/SCY-implementations/BenQi/PendleSAvaxSCY.sol/PendleSAvaxSCY.dbg.json +1 -1
  10. package/build/artifacts/contracts/SuperComposableYield/SCY-implementations/Euler/PendleEulerSCY.sol/PendleEulerSCY.dbg.json +1 -1
  11. package/build/artifacts/contracts/SuperComposableYield/SCY-implementations/PendleERC4626SCY.sol/PendleERC4626SCY.dbg.json +1 -1
  12. package/build/artifacts/contracts/SuperComposableYield/SCY-implementations/PendleStargateSCY.sol/PendleStargateSCY.dbg.json +1 -1
  13. package/build/artifacts/contracts/SuperComposableYield/SCY-implementations/PendleStargateSCY.sol/PendleStargateSCY.json +2 -2
  14. package/build/artifacts/contracts/SuperComposableYield/SCY-implementations/PendleWstEthSCY.sol/PendleWstEthSCY.dbg.json +1 -1
  15. package/build/artifacts/contracts/SuperComposableYield/SCY-implementations/PendleYearnVaultScy.sol/PendleYearnVaultSCY.dbg.json +1 -1
  16. package/build/artifacts/contracts/SuperComposableYield/SCY-implementations/TraderJoe/PendleSJoeSCY.sol/PendleSJoeSCY.dbg.json +1 -1
  17. package/build/artifacts/contracts/SuperComposableYield/SCY-implementations/TraderJoe/PendleSJoeSCY.sol/PendleSJoeSCY.json +2 -2
  18. package/build/artifacts/contracts/SuperComposableYield/base-implementations/SCYBase.sol/SCYBase.dbg.json +1 -1
  19. package/build/artifacts/contracts/SuperComposableYield/base-implementations/SCYBaseWithRewards.sol/SCYBaseWithRewards.dbg.json +1 -1
  20. package/build/artifacts/contracts/core/LiquidityMining/CelerAbstracts/CelerReceiverUpg.sol/CelerReceiverUpg.dbg.json +1 -1
  21. package/build/artifacts/contracts/core/LiquidityMining/CelerAbstracts/CelerSenderUpg.sol/CelerSenderUpg.dbg.json +1 -1
  22. package/build/artifacts/contracts/core/LiquidityMining/GaugeController/PendleGaugeControllerBaseUpg.sol/PendleGaugeControllerBaseUpg.dbg.json +1 -1
  23. package/build/artifacts/contracts/core/LiquidityMining/GaugeController/PendleGaugeControllerMainchainUpg.sol/PendleGaugeControllerMainchainUpg.dbg.json +1 -1
  24. package/build/artifacts/contracts/core/LiquidityMining/GaugeController/PendleGaugeControllerSidechainUpg.sol/PendleGaugeControllerSidechainUpg.dbg.json +1 -1
  25. package/build/artifacts/contracts/core/LiquidityMining/PendleGauge.sol/PendleGauge.dbg.json +1 -1
  26. package/build/artifacts/contracts/core/LiquidityMining/VotingController/PendleVotingControllerUpg.sol/PendleVotingControllerUpg.dbg.json +1 -1
  27. package/build/artifacts/contracts/core/LiquidityMining/VotingController/VotingControllerStorageUpg.sol/VotingControllerStorageUpg.dbg.json +1 -1
  28. package/build/artifacts/contracts/core/LiquidityMining/VotingEscrow/VotingEscrowPendleMainchain.sol/VotingEscrowPendleMainchain.dbg.json +1 -1
  29. package/build/artifacts/contracts/core/LiquidityMining/VotingEscrow/VotingEscrowPendleSidechain.sol/VotingEscrowPendleSidechain.dbg.json +1 -1
  30. package/build/artifacts/contracts/core/LiquidityMining/VotingEscrow/VotingEscrowTokenBase.sol/VotingEscrowTokenBase.dbg.json +1 -1
  31. package/build/artifacts/contracts/core/Market/PendleMarket.sol/PendleMarket.dbg.json +1 -1
  32. package/build/artifacts/contracts/core/Market/PendleMarketFactory.sol/PendleMarketFactory.dbg.json +1 -1
  33. package/build/artifacts/contracts/core/PendleERC20.sol/PendleERC20.dbg.json +1 -1
  34. package/build/artifacts/contracts/core/PendleRouter.sol/PendleRouter.dbg.json +1 -1
  35. package/build/artifacts/contracts/core/PendleRouter.sol/PendleRouter.json +2 -2
  36. package/build/artifacts/contracts/core/YieldContracts/InterestManagerYT.sol/InterestManagerYT.dbg.json +1 -1
  37. package/build/artifacts/contracts/core/YieldContracts/PendlePrincipalToken.sol/PendlePrincipalToken.dbg.json +1 -1
  38. package/build/artifacts/contracts/core/YieldContracts/PendleYieldContractFactory.sol/PendleYieldContractFactory.dbg.json +1 -1
  39. package/build/artifacts/contracts/core/YieldContracts/PendleYieldToken.sol/PendleYieldToken.dbg.json +1 -1
  40. package/build/artifacts/contracts/core/actions/ActionCallback.sol/ActionCallback.dbg.json +1 -1
  41. package/build/artifacts/contracts/core/actions/ActionCore.sol/ActionCore.dbg.json +1 -1
  42. package/build/artifacts/contracts/core/actions/ActionCore.sol/ActionCore.json +35 -19
  43. package/build/artifacts/contracts/core/actions/ActionYT.sol/ActionYT.dbg.json +1 -1
  44. package/build/artifacts/contracts/core/actions/base/ActionSCYAndPTBase.sol/ActionSCYAndPTBase.dbg.json +1 -1
  45. package/build/artifacts/contracts/core/actions/base/ActionSCYAndPYBase.sol/ActionSCYAndPYBase.dbg.json +1 -1
  46. package/build/artifacts/contracts/core/actions/base/ActionSCYAndYTBase.sol/ActionSCYAndYTBase.dbg.json +1 -1
  47. package/build/artifacts/contracts/core/actions/base/CallbackHelper.sol/CallbackHelper.dbg.json +1 -1
  48. package/build/artifacts/contracts/interfaces/IAToken.sol/IAToken.dbg.json +1 -1
  49. package/build/artifacts/contracts/interfaces/IAavePool.sol/IAavePool.dbg.json +1 -1
  50. package/build/artifacts/contracts/interfaces/IAaveRewardsController.sol/IAaveRewardsController.dbg.json +1 -1
  51. package/build/artifacts/contracts/interfaces/IBenQiComptroller.sol/IBenQiComptroller.dbg.json +1 -1
  52. package/build/artifacts/contracts/interfaces/IBenQiInterestRateModel.sol/IBenQiInterestRateModel.dbg.json +1 -1
  53. package/build/artifacts/contracts/interfaces/ICelerMessageBus.sol/ICelerMessageBus.dbg.json +1 -1
  54. package/build/artifacts/contracts/interfaces/ICelerMessageReceiverApp.sol/ICelerMessageReceiverApp.dbg.json +1 -1
  55. package/build/artifacts/contracts/interfaces/IERC4626.sol/IERC4626.dbg.json +1 -1
  56. package/build/artifacts/contracts/interfaces/IEulerEToken.sol/IEulerEToken.dbg.json +1 -1
  57. package/build/artifacts/contracts/interfaces/IEulerMarkets.sol/IEulerMarkets.dbg.json +1 -1
  58. package/build/artifacts/contracts/interfaces/IPActionCore.sol/IPActionCore.dbg.json +1 -1
  59. package/build/artifacts/contracts/interfaces/IPActionCore.sol/IPActionCore.json +33 -17
  60. package/build/artifacts/contracts/interfaces/IPActionYT.sol/IPActionYT.dbg.json +1 -1
  61. package/build/artifacts/contracts/interfaces/IPAllAction.sol/IPAllAction.dbg.json +1 -1
  62. package/build/artifacts/contracts/interfaces/IPAllAction.sol/IPAllAction.json +33 -17
  63. package/build/artifacts/contracts/interfaces/IPGaugeController.sol/IPGaugeController.dbg.json +1 -1
  64. package/build/artifacts/contracts/interfaces/IPGaugeControllerMainchain.sol/IPGaugeControllerMainchain.dbg.json +1 -1
  65. package/build/artifacts/contracts/interfaces/IPGovernanceManager.sol/IPGovernanceManager.dbg.json +1 -1
  66. package/build/artifacts/contracts/interfaces/IPInterestManagerYT.sol/IPInterestManagerYT.dbg.json +1 -1
  67. package/build/artifacts/contracts/interfaces/IPMarket.sol/IPMarket.dbg.json +1 -1
  68. package/build/artifacts/contracts/interfaces/IPMarketFactory.sol/IPMarketFactory.dbg.json +1 -1
  69. package/build/artifacts/contracts/interfaces/IPMarketSwapCallback.sol/IPMarketSwapCallback.dbg.json +1 -1
  70. package/build/artifacts/contracts/interfaces/IPPermissionsV2Upg.sol/IPermissionsV2Upg.dbg.json +1 -1
  71. package/build/artifacts/contracts/interfaces/IPPrincipalToken.sol/IPPrincipalToken.dbg.json +1 -1
  72. package/build/artifacts/contracts/interfaces/IPRouterStatic.sol/IPRouterStatic.dbg.json +1 -1
  73. package/build/artifacts/contracts/interfaces/IPVeToken.sol/IPVeToken.dbg.json +1 -1
  74. package/build/artifacts/contracts/interfaces/IPVotingController.sol/IPVotingController.dbg.json +1 -1
  75. package/build/artifacts/contracts/interfaces/IPVotingEscrow.sol/IPVotingEscrow.dbg.json +1 -1
  76. package/build/artifacts/contracts/interfaces/IPYieldContractFactory.sol/IPYieldContractFactory.dbg.json +1 -1
  77. package/build/artifacts/contracts/interfaces/IPYieldToken.sol/IPYieldToken.dbg.json +1 -1
  78. package/build/artifacts/contracts/interfaces/IQiAvax.sol/IQiAvax.dbg.json +1 -1
  79. package/build/artifacts/contracts/interfaces/IQiErc20.sol/IQiErc20.dbg.json +1 -1
  80. package/build/artifacts/contracts/interfaces/IQiToken.sol/IQiToken.dbg.json +1 -1
  81. package/build/artifacts/contracts/interfaces/IRewardManager.sol/IRewardManager.dbg.json +1 -1
  82. package/build/artifacts/contracts/interfaces/ISAvax.sol/ISAvax.dbg.json +1 -1
  83. package/build/artifacts/contracts/interfaces/ISJoe.sol/ISJoe.dbg.json +1 -1
  84. package/build/artifacts/contracts/interfaces/IStETH.sol/IStETH.dbg.json +1 -1
  85. package/build/artifacts/contracts/interfaces/IStargateLPStaking.sol/IStargateLPStaking.dbg.json +1 -1
  86. package/build/artifacts/contracts/interfaces/IStargatePool.sol/IStargatePool.dbg.json +1 -1
  87. package/build/artifacts/contracts/interfaces/IStargateRouter.sol/IStargateRouter.dbg.json +1 -1
  88. package/build/artifacts/contracts/interfaces/ISuperComposableYield.sol/ISuperComposableYield.dbg.json +1 -1
  89. package/build/artifacts/contracts/interfaces/IWAvax.sol/IWAvax.dbg.json +1 -1
  90. package/build/artifacts/contracts/interfaces/IWETH.sol/IWETH.dbg.json +1 -1
  91. package/build/artifacts/contracts/interfaces/IWstETH.sol/IWstETH.dbg.json +1 -1
  92. package/build/artifacts/contracts/interfaces/IYearnVault.sol/IYearnVault.dbg.json +1 -1
  93. package/build/artifacts/contracts/libraries/RewardManager.sol/RewardManager.dbg.json +1 -1
  94. package/build/artifacts/contracts/libraries/RewardManagerAbstract.sol/RewardManagerAbstract.dbg.json +1 -1
  95. package/build/artifacts/contracts/libraries/SCY/SCYUtils.sol/SCYUtils.dbg.json +1 -1
  96. package/build/artifacts/contracts/libraries/VeBalanceLib.sol/VeBalanceLib.dbg.json +1 -1
  97. package/build/artifacts/contracts/libraries/VeHistoryLib.sol/Checkpoints.dbg.json +1 -1
  98. package/build/artifacts/contracts/libraries/helpers/ArrayLib.sol/ArrayLib.dbg.json +1 -1
  99. package/build/artifacts/contracts/libraries/helpers/ExpiryUtilsLib.sol/ExpiryUtils.dbg.json +1 -1
  100. package/build/artifacts/contracts/libraries/helpers/MiniHelpers.sol/MiniHelpers.dbg.json +1 -1
  101. package/build/artifacts/contracts/libraries/helpers/PYIndex.sol/PYIndexLib.dbg.json +1 -1
  102. package/build/artifacts/contracts/libraries/helpers/SSTORE2Deployer.sol/SSTORE2Deployer.dbg.json +1 -1
  103. package/build/artifacts/contracts/libraries/helpers/TokenHelper.sol/TokenHelper.dbg.json +1 -1
  104. package/build/artifacts/contracts/libraries/kyberswap/KyberSwapHelper.sol/KyberSwapHelper.dbg.json +1 -1
  105. package/build/artifacts/contracts/libraries/math/LogExpMath.sol/LogExpMath.dbg.json +1 -1
  106. package/build/artifacts/contracts/libraries/math/MarketApproxLib.sol/MarketApproxLib.dbg.json +1 -1
  107. package/build/artifacts/contracts/libraries/math/MarketMathCore.sol/MarketMathCore.dbg.json +1 -1
  108. package/build/artifacts/contracts/libraries/math/Math.sol/Math.dbg.json +1 -1
  109. package/build/artifacts/contracts/libraries/math/WeekMath.sol/WeekMath.dbg.json +1 -1
  110. package/build/artifacts/contracts/libraries/solmate/SSTORE2.sol/SSTORE2.dbg.json +1 -1
  111. package/build/artifacts/contracts/offchain-helpers/RouterStatic.sol/RouterStatic.dbg.json +1 -1
  112. package/build/artifacts/contracts/offchain-helpers/RouterStatic.sol/RouterStatic.json +48 -9
  113. package/build/artifacts/contracts/periphery/PermissionsV2Upg.sol/PermissionsV2Upg.dbg.json +1 -1
  114. package/contracts/SuperComposableYield/base-implementations/SCYBaseWithRewards.sol +1 -1
  115. package/contracts/core/PendleRouter.sol +2 -2
  116. package/contracts/core/actions/ActionCore.sol +18 -13
  117. package/contracts/core/actions/base/ActionSCYAndPTBase.sol +15 -15
  118. package/contracts/interfaces/IPActionCore.sol +12 -11
  119. package/contracts/offchain-helpers/RouterStatic.sol +17 -10
  120. package/deployments/43113-benqi.json +2 -2
  121. package/deployments/43113-core.json +1 -1
  122. package/deployments/43113-markets/benqi-market-95E744.json +7 -0
  123. package/deployments/43113-markets/benqi-market-D91a3F.json +7 -0
  124. package/package.json +1 -1
  125. package/typechain-types/ActionCore.ts +95 -84
  126. package/typechain-types/IPActionCore.ts +95 -84
  127. package/typechain-types/IPAllAction.ts +95 -84
  128. package/typechain-types/RouterStatic.ts +86 -31
  129. package/typechain-types/factories/ActionCore__factory.ts +34 -18
  130. package/typechain-types/factories/IPActionCore__factory.ts +33 -17
  131. package/typechain-types/factories/IPAllAction__factory.ts +33 -17
  132. package/typechain-types/factories/PendleAaveV3SCY__factory.ts +1 -1
  133. package/typechain-types/factories/PendleQiSAvaxSCY__factory.ts +1 -1
  134. package/typechain-types/factories/PendleQiTokenSCY__factory.ts +1 -1
  135. package/typechain-types/factories/PendleRouter__factory.ts +1 -1
  136. package/typechain-types/factories/PendleSJoeSCY__factory.ts +1 -1
  137. package/typechain-types/factories/PendleStargateSCY__factory.ts +1 -1
  138. package/typechain-types/factories/RouterStatic__factory.ts +47 -8
@@ -44,32 +44,35 @@ contract ActionCore is IPActionCore, ActionSCYAndPTBase {
44
44
  }
45
45
 
46
46
  /// @dev refer to the internal function
47
- function addLiquidityDualIbTokenAndPt(
47
+ function addLiquidityDualTokenAndPt(
48
48
  address receiver,
49
49
  address market,
50
- uint256 ibTokenDesired,
50
+ address tokenIn,
51
+ uint256 tokenDesired,
51
52
  uint256 ptDesired,
52
53
  uint256 minLpOut
53
54
  )
54
55
  external
55
56
  returns (
56
57
  uint256 netLpOut,
57
- uint256 ibTokenUsed,
58
+ uint256 tokenUsed,
58
59
  uint256 ptUsed
59
60
  )
60
61
  {
61
- (netLpOut, ibTokenUsed, ptUsed) = _addLiquidityDualIbTokenAndPt(
62
+ (netLpOut, tokenUsed, ptUsed) = _addLiquidityDualTokenAndPt(
62
63
  receiver,
63
64
  market,
64
- ibTokenDesired,
65
+ tokenIn,
66
+ tokenDesired,
65
67
  ptDesired,
66
68
  minLpOut
67
69
  );
68
- emit AddLiquidityDualIbTokenAndPt(
70
+ emit AddLiquidityDualTokenAndPt(
69
71
  msg.sender,
70
72
  market,
71
73
  receiver,
72
- ibTokenDesired,
74
+ tokenIn,
75
+ tokenDesired,
73
76
  ptUsed,
74
77
  netLpOut
75
78
  );
@@ -131,18 +134,20 @@ contract ActionCore is IPActionCore, ActionSCYAndPTBase {
131
134
  }
132
135
 
133
136
  /// @dev refer to the internal function
134
- function removeLiquidityDualIbTokenAndPt(
137
+ function removeLiquidityDualTokenAndPt(
135
138
  address receiver,
136
139
  address market,
137
140
  uint256 lpToRemove,
138
- uint256 ibTokenMin,
141
+ address tokenOut,
142
+ uint256 tokenOutMin,
139
143
  uint256 ptOutMin
140
- ) external returns (uint256 netIbTokenOut, uint256 netPtOut) {
141
- (netIbTokenOut, netPtOut) = _removeLiquidityDualIbTokenAndPt(
144
+ ) external returns (uint256 netTokenOut, uint256 netPtOut) {
145
+ (netTokenOut, netPtOut) = _removeLiquidityDualTokenAndPt(
142
146
  receiver,
143
147
  market,
144
148
  lpToRemove,
145
- ibTokenMin,
149
+ tokenOut,
150
+ tokenOutMin,
146
151
  ptOutMin
147
152
  );
148
153
  emit RemoveLiquidityDualIbTokenAndPt(
@@ -151,7 +156,7 @@ contract ActionCore is IPActionCore, ActionSCYAndPTBase {
151
156
  receiver,
152
157
  lpToRemove,
153
158
  netPtOut,
154
- netIbTokenOut
159
+ netTokenOut
155
160
  );
156
161
  }
157
162
 
@@ -63,25 +63,25 @@ abstract contract ActionSCYAndPTBase is ActionSCYAndPYBase {
63
63
  require(netLpOut >= minLpOut, "FS insufficient lp out");
64
64
  }
65
65
 
66
- function _addLiquidityDualIbTokenAndPt(
66
+ function _addLiquidityDualTokenAndPt(
67
67
  address receiver,
68
68
  address market,
69
- uint256 ibTokenDesired,
69
+ address tokenIn,
70
+ uint256 tokenDesired,
70
71
  uint256 ptDesired,
71
72
  uint256 minLpOut
72
73
  )
73
74
  internal
74
75
  returns (
75
76
  uint256 netLpOut,
76
- uint256 ibTokenUsed,
77
+ uint256 tokenUsed,
77
78
  uint256 ptUsed
78
79
  )
79
80
  {
80
81
  (ISuperComposableYield SCY, IPPrincipalToken PT, IPYieldToken YT) = IPMarket(market)
81
82
  .readTokens();
82
83
 
83
- address ibToken = SCY.yieldToken();
84
- uint256 scyDesired = SCY.previewDeposit(ibToken, ibTokenDesired);
84
+ uint256 scyDesired = SCY.previewDeposit(tokenIn, tokenDesired);
85
85
  uint256 scyUsed;
86
86
 
87
87
  {
@@ -99,14 +99,14 @@ abstract contract ActionSCYAndPTBase is ActionSCYAndPYBase {
99
99
 
100
100
  IERC20(PT).safeTransferFrom(msg.sender, market, ptUsed);
101
101
 
102
- // convert ibToken to SCY to deposit
103
- ibTokenUsed = (ibTokenDesired * scyUsed).rawDivUp(scyDesired);
102
+ // convert tokenIn to SCY to deposit
103
+ tokenUsed = (tokenDesired * scyUsed).rawDivUp(scyDesired);
104
104
 
105
- IERC20(ibToken).safeTransferFrom(msg.sender, address(this), ibTokenUsed);
105
+ IERC20(tokenIn).safeTransferFrom(msg.sender, address(this), tokenUsed);
106
106
 
107
- _safeApproveInf(ibToken, address(SCY));
107
+ _safeApproveInf(tokenIn, address(SCY));
108
108
 
109
- SCY.deposit(market, ibToken, ibTokenUsed, scyDesired);
109
+ SCY.deposit(market, tokenIn, tokenUsed, scyUsed);
110
110
 
111
111
  netLpOut = IPMarket(market).mint(receiver);
112
112
  // fail-safe
@@ -128,21 +128,21 @@ abstract contract ActionSCYAndPTBase is ActionSCYAndPYBase {
128
128
  require(netPtOut >= ptOutMin, "insufficient PT out");
129
129
  }
130
130
 
131
- function _removeLiquidityDualIbTokenAndPt(
131
+ function _removeLiquidityDualTokenAndPt(
132
132
  address receiver,
133
133
  address market,
134
134
  uint256 lpToRemove,
135
- uint256 ibTokenOutMin,
135
+ address tokenOut,
136
+ uint256 tokenOutMin,
136
137
  uint256 ptOutMin
137
- ) internal returns (uint256 netIbTokenOut, uint256 netPtOut) {
138
+ ) internal returns (uint256 netTokenOut, uint256 netPtOut) {
138
139
  (ISuperComposableYield SCY, , ) = IPMarket(market).readTokens();
139
- address ibToken = SCY.yieldToken();
140
140
 
141
141
  IERC20(market).safeTransferFrom(msg.sender, market, lpToRemove);
142
142
 
143
143
  (, netPtOut) = IPMarket(market).burn(address(SCY), receiver);
144
144
 
145
- netIbTokenOut = SCY.redeemAfterTransfer(receiver, ibToken, ibTokenOutMin);
145
+ netTokenOut = SCY.redeemAfterTransfer(receiver, tokenOut, tokenOutMin);
146
146
 
147
147
  require(netPtOut >= ptOutMin, "insufficient PT out");
148
148
  }
@@ -14,11 +14,12 @@ interface IPActionCore {
14
14
  uint256 lpOut
15
15
  );
16
16
 
17
- event AddLiquidityDualIbTokenAndPt(
17
+ event AddLiquidityDualTokenAndPt(
18
18
  address indexed caller,
19
19
  address indexed market,
20
20
  address indexed receiver,
21
- uint256 ibTokenUsed,
21
+ address tokenIn,
22
+ uint256 tokenUsed,
22
23
  uint256 ptUsed,
23
24
  uint256 lpOut
24
25
  );
@@ -27,7 +28,7 @@ interface IPActionCore {
27
28
  address indexed caller,
28
29
  address indexed market,
29
30
  address receiver,
30
- uint256 lpIn,
31
+ uint256 netlpIn,
31
32
  uint256 amountPTOut,
32
33
  uint256 amountSCYOut
33
34
  );
@@ -124,18 +125,18 @@ interface IPActionCore {
124
125
  uint256 ptUsed
125
126
  );
126
127
 
127
- /// @dev refer to the internal function
128
- function addLiquidityDualIbTokenAndPt(
128
+ function addLiquidityDualTokenAndPt(
129
129
  address receiver,
130
130
  address market,
131
- uint256 ibTokenDesired,
131
+ address tokenIn,
132
+ uint256 tokenDesired,
132
133
  uint256 ptDesired,
133
134
  uint256 minLpOut
134
135
  )
135
136
  external
136
137
  returns (
137
138
  uint256 netLpOut,
138
- uint256 ibTokenUsed,
139
+ uint256 tokenUsed,
139
140
  uint256 ptUsed
140
141
  );
141
142
 
@@ -171,14 +172,14 @@ interface IPActionCore {
171
172
  uint256 ptOutMin
172
173
  ) external returns (uint256 netScyOut, uint256 netPtOut);
173
174
 
174
- /// @dev refer to the internal function
175
- function removeLiquidityDualIbTokenAndPt(
175
+ function removeLiquidityDualTokenAndPt(
176
176
  address receiver,
177
177
  address market,
178
178
  uint256 lpToRemove,
179
- uint256 ibTokenMin,
179
+ address tokenOut,
180
+ uint256 tokenOutMin,
180
181
  uint256 ptOutMin
181
- ) external returns (uint256 netIbTokenOut, uint256 netPtOut);
182
+ ) external returns (uint256 netTokenOut, uint256 netPtOut);
182
183
 
183
184
  function removeLiquiditySinglePt(
184
185
  address receiver,
@@ -160,22 +160,22 @@ contract RouterStatic is IPRouterStatic {
160
160
  );
161
161
  }
162
162
 
163
- function addLiquidityDualIbTokenAndPtStatic(
163
+ function addLiquidityDualTokenAndPtStatic(
164
164
  address market,
165
- uint256 ibTokenDesired,
165
+ address tokenIn,
166
+ uint256 tokenDesired,
166
167
  uint256 ptDesired
167
168
  )
168
169
  external
169
170
  returns (
170
171
  uint256 netLpOut,
171
- uint256 ibTokenUsed,
172
+ uint256 tokenUsed,
172
173
  uint256 ptUsed
173
174
  )
174
175
  {
175
176
  (ISuperComposableYield SCY, , ) = IPMarket(market).readTokens();
176
177
 
177
- address ibToken = SCY.yieldToken();
178
- uint256 scyDesired = SCY.previewDeposit(ibToken, ibTokenDesired);
178
+ uint256 scyDesired = SCY.previewDeposit(tokenIn, tokenDesired);
179
179
  uint256 scyUsed;
180
180
 
181
181
  MarketState memory state = IPMarket(market).readState(false);
@@ -186,7 +186,7 @@ contract RouterStatic is IPRouterStatic {
186
186
  block.timestamp
187
187
  );
188
188
 
189
- ibTokenUsed = (ibTokenDesired * scyUsed).rawDivUp(scyDesired);
189
+ tokenUsed = (tokenDesired * scyUsed).rawDivUp(scyDesired);
190
190
  }
191
191
 
192
192
  function addLiquiditySinglePtStatic(address market, uint256 netPtIn)
@@ -229,17 +229,24 @@ contract RouterStatic is IPRouterStatic {
229
229
  function removeLiquidityDualScyAndPtStatic(address market, uint256 lpToRemove)
230
230
  external
231
231
  view
232
- returns (uint256 netIbTokenOut, uint256 netPtOut)
232
+ returns (uint256 netScyOut, uint256 netPtOut)
233
233
  {
234
- (ISuperComposableYield SCY, , ) = IPMarket(market).readTokens();
234
+ MarketState memory state = IPMarket(market).readState(false);
235
+ (netScyOut, netPtOut) = state.removeLiquidity(lpToRemove);
236
+ }
235
237
 
236
- address ibToken = SCY.yieldToken();
238
+ function removeLiquidityDualTokenAndPtStatic(
239
+ address market,
240
+ uint256 lpToRemove,
241
+ address tokenOut
242
+ ) external view returns (uint256 netTokenOut, uint256 netPtOut) {
243
+ (ISuperComposableYield SCY, , ) = IPMarket(market).readTokens();
237
244
 
238
245
  uint256 netScyOut;
239
246
  MarketState memory state = IPMarket(market).readState(false);
240
247
  (netScyOut, netPtOut) = state.removeLiquidity(lpToRemove);
241
248
 
242
- netIbTokenOut = SCY.previewRedeem(ibToken, netScyOut);
249
+ netTokenOut = SCY.previewRedeem(tokenOut, netScyOut);
243
250
  }
244
251
 
245
252
  function removeLiquiditySinglePtStatic(address market, uint256 lpToRemove)
@@ -3,8 +3,8 @@
3
3
  "QI": "0x09Fe18C4C0cFE929a6CD40903129F9bA3C837866",
4
4
  "USD": "0x2018ecc38fbca2ce3A62f96f9F0D38F0DEE2f99D",
5
5
  "qiUSD": "0x884f8d66862b03434E11f4Bd5527A1119c115D83",
6
- "scyQiUSD": "0xc68Fe29C91a5611e332A57d4FC091eDe7fD5156d",
6
+ "scyQiUSD": "0xb58DAE6a0d929beE1C873C666D1958870e308a98",
7
7
  "WAVAX": "0xD323E5337713D2e01fb341D960BC31e1FB42348d",
8
8
  "qiAVAX": "0xABD65178Aa35051277b062327A70644F10D3cB9d",
9
- "scyQiAVAX": "0x60e235D9836Ecf533966E2ef94795C83FcB5E7e3"
9
+ "scyQiAVAX": "0xA58dD1b2aCa656C1A6FA281C7CAeC22eb66aE449"
10
10
  }
@@ -8,7 +8,7 @@
8
8
  "yieldContractFactory": "0xf9397B3b93d118587c29bA2a166c0192251fc758",
9
9
  "marketFactory": "0x2FfdD5E68ce0F668498029c1219Db39f79ebD5bd",
10
10
  "router": "0xFEdBED4682D136925d30FFb9B8977CC9b3a6c406",
11
- "routerStatic": "0x501E089e6BD6b78e6E435C15118E52c665931850",
11
+ "routerStatic": "0xfe2d379117895Fa6144B209C13894A17aB18C86c",
12
12
  "startTime": 1657756800,
13
13
  "vePendle": "0xa94936409d9B0633dB6271Fc2789aBa9C74bD729",
14
14
  "votingController": "0x676A97883D396b21f3a7554A73F30187752c7C45",
@@ -0,0 +1,7 @@
1
+ {
2
+ "SCY": "0xA58dD1b2aCa656C1A6FA281C7CAeC22eb66aE449",
3
+ "expiry": 1688860800,
4
+ "PT": "0x575e427500ab3B4Ae09A63cceD578aef9E1FE9fB",
5
+ "YT": "0x7f0D1F2d613675e19C79fE63F496D9d95Af57e04",
6
+ "market": "0x7a0B5Afa018Fe67eAB9EeE83722253b82a95E744"
7
+ }
@@ -0,0 +1,7 @@
1
+ {
2
+ "SCY": "0xb58DAE6a0d929beE1C873C666D1958870e308a98",
3
+ "expiry": 1688860800,
4
+ "PT": "0xe42d01507eF472C1BaAaa9F8338D281D8A722767",
5
+ "YT": "0xFC33Be0752D20981c4c3C35C41465161a058Ceb9",
6
+ "market": "0x185B71bA09654752D4E12292419363D821D91a3F"
7
+ }
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@pendle/core-v2",
3
3
  "description": "Core smart contracts of Pendle Protocol.",
4
4
  "license": "BUSL-1.1",
5
- "version": "0.9.2-beta",
5
+ "version": "0.9.4-beta",
6
6
  "homepage": "https://pendle.finance",
7
7
  "keywords": [
8
8
  "pendle",