@pendle/core-v2 0.5.1-beta-3 → 0.5.1-beta-5
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.
- package/contracts/core/RouterStatic.sol +15 -19
- package/contracts/interfaces/IPRouterStatic.sol +4 -4
- package/package.json +1 -1
- package/typechain-types/ActionCallback.ts +5 -5
- package/typechain-types/ActionCore.ts +312 -234
- package/typechain-types/ActionRedeem.ts +125 -0
- package/typechain-types/ActionSCYAndPYBase.ts +223 -0
- package/typechain-types/ActionSCYAndYOBase.ts +129 -3
- package/typechain-types/ActionSCYAndYTBase.ts +149 -3
- package/typechain-types/ActionYT.ts +192 -94
- package/typechain-types/IPActionCore.ts +183 -231
- package/typechain-types/IPActionRedeem.ts +125 -0
- package/typechain-types/IPActionYT.ts +43 -91
- package/typechain-types/IPAllAction.ts +258 -321
- package/typechain-types/IPMarket.ts +150 -50
- package/typechain-types/IPMarketAddRemoveCallback.ts +10 -10
- package/typechain-types/IPMarketFactory.ts +28 -6
- package/typechain-types/IPMarketSwapCallback.ts +5 -5
- package/typechain-types/{IPOwnershipToken.ts → IPPrincipalToken.ts} +5 -5
- package/typechain-types/IPRouterStatic.ts +50 -533
- package/typechain-types/IPYieldContractFactory.ts +85 -19
- package/typechain-types/IPYieldToken.ts +138 -37
- package/typechain-types/ISuperComposableYield.ts +13 -0
- package/typechain-types/IWstETH.ts +149 -0
- package/typechain-types/PendleAaveV3SCY.ts +110 -0
- package/typechain-types/PendleBaseToken.ts +1 -1
- package/typechain-types/PendleBenQiErc20SCY.ts +55 -12
- package/typechain-types/PendleBtrflyScy.ts +27 -23
- package/typechain-types/PendleGovernanceManager.ts +5 -5
- package/typechain-types/PendleMarket.ts +197 -100
- package/typechain-types/PendleMarketFactory.ts +96 -34
- package/typechain-types/{PendleOwnershipToken.ts → PendlePrincipalToken.ts} +15 -6
- package/typechain-types/PendleRouter.ts +19 -0
- package/typechain-types/PendleRouterRedeemUpg.ts +125 -0
- package/typechain-types/PendleStEthSCY.ts +872 -0
- package/typechain-types/PendleYearnVaultScy.ts +27 -23
- package/typechain-types/PendleYieldContractFactory.ts +94 -28
- package/typechain-types/PendleYieldToken.ts +142 -57
- package/typechain-types/RewardManager.ts +21 -0
- package/typechain-types/RouterStatic.ts +50 -533
- package/typechain-types/SCYBase.ts +25 -0
- package/typechain-types/SCYBaseWithRewards.ts +64 -0
- package/typechain-types/factories/ActionCallback__factory.ts +2 -2
- package/typechain-types/factories/ActionCore__factory.ts +263 -79
- package/typechain-types/factories/ActionRedeem__factory.ts +105 -0
- package/typechain-types/factories/ActionSCYAndPYBase__factory.ts +200 -0
- package/typechain-types/factories/ActionSCYAndYOBase__factory.ts +148 -0
- package/typechain-types/factories/ActionSCYAndYTBase__factory.ts +173 -0
- package/typechain-types/factories/ActionYT__factory.ts +265 -56
- package/typechain-types/factories/IPActionCore__factory.ts +114 -78
- package/typechain-types/factories/IPActionRedeem__factory.ts +70 -0
- package/typechain-types/factories/IPActionYT__factory.ts +90 -54
- package/typechain-types/factories/IPAllAction__factory.ts +254 -138
- package/typechain-types/factories/IPMarketAddRemoveCallback__factory.ts +2 -2
- package/typechain-types/factories/IPMarketFactory__factory.ts +26 -1
- package/typechain-types/factories/IPMarketSwapCallback__factory.ts +1 -1
- package/typechain-types/factories/IPMarket__factory.ts +125 -13
- package/typechain-types/factories/{IPOwnershipToken__factory.ts → IPPrincipalToken__factory.ts} +8 -8
- package/typechain-types/factories/IPRouterStatic__factory.ts +12 -628
- package/typechain-types/factories/IPYieldContractFactory__factory.ts +72 -2
- package/typechain-types/factories/IPYieldToken__factory.ts +93 -7
- package/typechain-types/factories/ISuperComposableYield__factory.ts +13 -0
- package/typechain-types/factories/IWstETH__factory.ts +74 -0
- package/typechain-types/factories/PendleAaveV3SCY__factory.ts +97 -3
- package/typechain-types/factories/PendleBaseToken__factory.ts +1 -1
- package/typechain-types/factories/PendleBenQiErc20SCY__factory.ts +62 -7
- package/typechain-types/factories/PendleBtrflyScy__factory.ts +42 -19
- package/typechain-types/factories/PendleGovernanceManager__factory.ts +2 -2
- package/typechain-types/factories/PendleMarketFactory__factory.ts +66 -15
- package/typechain-types/factories/PendleMarket__factory.ts +170 -53
- package/typechain-types/factories/PendlePrincipalToken__factory.ts +540 -0
- package/typechain-types/factories/PendleRouterRedeemUpg__factory.ts +112 -0
- package/typechain-types/factories/PendleRouter__factory.ts +23 -1
- package/typechain-types/factories/PendleStEthSCY__factory.ts +716 -0
- package/typechain-types/factories/PendleYearnVaultScy__factory.ts +41 -18
- package/typechain-types/factories/PendleYieldContractFactory__factory.ts +75 -5
- package/typechain-types/factories/PendleYieldToken__factory.ts +102 -33
- package/typechain-types/factories/RewardManager__factory.ts +13 -0
- package/typechain-types/factories/RouterStatic__factory.ts +13 -629
- package/typechain-types/factories/SCYBaseWithRewards__factory.ts +60 -2
- package/typechain-types/factories/SCYBase__factory.ts +28 -2
- package/typechain-types/hardhat.d.ts +52 -16
- package/typechain-types/index.ts +14 -6
- package/typechain-types/factories/PendleOwnershipToken__factory.ts +0 -527
|
@@ -107,12 +107,12 @@ contract RouterStatic is IPRouterStatic {
|
|
|
107
107
|
else if (marketFactory.isValidMarket(token)) isMarket = true;
|
|
108
108
|
}
|
|
109
109
|
|
|
110
|
-
function getUserYOInfo(address
|
|
110
|
+
function getUserYOInfo(address yo, address user)
|
|
111
111
|
public
|
|
112
112
|
view
|
|
113
113
|
returns (UserYOInfo memory userYOInfo)
|
|
114
114
|
{
|
|
115
|
-
(userYOInfo.yt, userYOInfo.ot) = getYO(
|
|
115
|
+
(userYOInfo.yt, userYOInfo.ot) = getYO(yo);
|
|
116
116
|
IPYieldToken YT = IPYieldToken(userYOInfo.yt);
|
|
117
117
|
userYOInfo.ytBalance = YT.balanceOf(user);
|
|
118
118
|
userYOInfo.otBalance = IPOwnershipToken(userYOInfo.ot).balanceOf(user);
|
|
@@ -136,7 +136,7 @@ contract RouterStatic is IPRouterStatic {
|
|
|
136
136
|
}
|
|
137
137
|
}
|
|
138
138
|
|
|
139
|
-
function getYOInfo(address
|
|
139
|
+
function getYOInfo(address yo)
|
|
140
140
|
external
|
|
141
141
|
returns (
|
|
142
142
|
uint256 exchangeRate,
|
|
@@ -144,7 +144,7 @@ contract RouterStatic is IPRouterStatic {
|
|
|
144
144
|
RewardIndex[] memory rewardIndexes
|
|
145
145
|
)
|
|
146
146
|
{
|
|
147
|
-
(address yt, ) = getYO(
|
|
147
|
+
(address yt, ) = getYO(yo);
|
|
148
148
|
IPYieldToken YT = IPYieldToken(yt);
|
|
149
149
|
exchangeRate = YT.getScyIndexBeforeExpiry();
|
|
150
150
|
totalSupply = YT.totalSupply();
|
|
@@ -157,16 +157,13 @@ contract RouterStatic is IPRouterStatic {
|
|
|
157
157
|
}
|
|
158
158
|
}
|
|
159
159
|
|
|
160
|
-
function getYO(address
|
|
161
|
-
if (yieldContractFactory.
|
|
162
|
-
yt =
|
|
163
|
-
ot =
|
|
164
|
-
} else
|
|
165
|
-
yt =
|
|
166
|
-
ot =
|
|
167
|
-
} else if (marketFactory.isValidMarket(token)) {
|
|
168
|
-
yt = IPMarket(token).YT();
|
|
169
|
-
ot = IPMarket(token).OT();
|
|
160
|
+
function getYO(address yo) public view returns (address ot, address yt) {
|
|
161
|
+
if (yieldContractFactory.isYT(yo)) {
|
|
162
|
+
yt = yo;
|
|
163
|
+
ot = IPYieldToken(yo).OT();
|
|
164
|
+
} else {
|
|
165
|
+
yt = IPOwnershipToken(yo).YT();
|
|
166
|
+
ot = yo;
|
|
170
167
|
}
|
|
171
168
|
}
|
|
172
169
|
|
|
@@ -196,7 +193,6 @@ contract RouterStatic is IPRouterStatic {
|
|
|
196
193
|
{
|
|
197
194
|
IPMarket _market = IPMarket(market);
|
|
198
195
|
userMarketInfo.market = market;
|
|
199
|
-
// TODO: What will this return if the user's balance is staked?
|
|
200
196
|
userMarketInfo.lpBalance = _market.balanceOf(user);
|
|
201
197
|
// TODO: Is there a way to convert LP to OT and SCY?
|
|
202
198
|
userMarketInfo.otBalance = TokenAmount(_market.OT(), 0);
|
|
@@ -205,14 +201,14 @@ contract RouterStatic is IPRouterStatic {
|
|
|
205
201
|
userMarketInfo.assetBalance = TokenAmount(address(0), 0);
|
|
206
202
|
}
|
|
207
203
|
|
|
208
|
-
function
|
|
204
|
+
function getUserYOPositionsByYOs(address user, address[] calldata yos)
|
|
209
205
|
external
|
|
210
206
|
view
|
|
211
207
|
returns (UserYOInfo[] memory userYOPositions)
|
|
212
208
|
{
|
|
213
|
-
userYOPositions = new UserYOInfo[](
|
|
214
|
-
for (uint256 i = 0; i <
|
|
215
|
-
userYOPositions[i] = getUserYOInfo(
|
|
209
|
+
userYOPositions = new UserYOInfo[](yos.length);
|
|
210
|
+
for (uint256 i = 0; i < yos.length; ++i) {
|
|
211
|
+
userYOPositions[i] = getUserYOInfo(yos[i], user);
|
|
216
212
|
}
|
|
217
213
|
}
|
|
218
214
|
|
|
@@ -69,12 +69,12 @@ interface IPRouterStatic {
|
|
|
69
69
|
bool isMarket
|
|
70
70
|
);
|
|
71
71
|
|
|
72
|
-
function getUserYOInfo(address
|
|
72
|
+
function getUserYOInfo(address yo, address user)
|
|
73
73
|
external
|
|
74
74
|
view
|
|
75
75
|
returns (UserYOInfo memory userYOInfo);
|
|
76
76
|
|
|
77
|
-
function getYOInfo(address
|
|
77
|
+
function getYOInfo(address yo)
|
|
78
78
|
external
|
|
79
79
|
returns (
|
|
80
80
|
uint256 exchangeRate,
|
|
@@ -82,7 +82,7 @@ interface IPRouterStatic {
|
|
|
82
82
|
RewardIndex[] memory rewardIndexes
|
|
83
83
|
);
|
|
84
84
|
|
|
85
|
-
function getYO(address
|
|
85
|
+
function getYO(address yo) external view returns (address yt, address ot);
|
|
86
86
|
|
|
87
87
|
function getMarketInfo(address market)
|
|
88
88
|
external
|
|
@@ -100,7 +100,7 @@ interface IPRouterStatic {
|
|
|
100
100
|
view
|
|
101
101
|
returns (UserMarketInfo memory userMarketInfo);
|
|
102
102
|
|
|
103
|
-
function
|
|
103
|
+
function getUserYOPositionsByYOs(address user, address[] calldata yos)
|
|
104
104
|
external
|
|
105
105
|
view
|
|
106
106
|
returns (UserYOInfo[] memory userYOPositions);
|
package/package.json
CHANGED
|
@@ -81,7 +81,7 @@ export interface ActionCallback extends BaseContract {
|
|
|
81
81
|
marketFactory(overrides?: CallOverrides): Promise<[string]>;
|
|
82
82
|
|
|
83
83
|
swapCallback(
|
|
84
|
-
|
|
84
|
+
ptToAccount: BigNumberish,
|
|
85
85
|
scyToAccount: BigNumberish,
|
|
86
86
|
data: BytesLike,
|
|
87
87
|
overrides?: Overrides & { from?: string | Promise<string> }
|
|
@@ -91,7 +91,7 @@ export interface ActionCallback extends BaseContract {
|
|
|
91
91
|
marketFactory(overrides?: CallOverrides): Promise<string>;
|
|
92
92
|
|
|
93
93
|
swapCallback(
|
|
94
|
-
|
|
94
|
+
ptToAccount: BigNumberish,
|
|
95
95
|
scyToAccount: BigNumberish,
|
|
96
96
|
data: BytesLike,
|
|
97
97
|
overrides?: Overrides & { from?: string | Promise<string> }
|
|
@@ -101,7 +101,7 @@ export interface ActionCallback extends BaseContract {
|
|
|
101
101
|
marketFactory(overrides?: CallOverrides): Promise<string>;
|
|
102
102
|
|
|
103
103
|
swapCallback(
|
|
104
|
-
|
|
104
|
+
ptToAccount: BigNumberish,
|
|
105
105
|
scyToAccount: BigNumberish,
|
|
106
106
|
data: BytesLike,
|
|
107
107
|
overrides?: CallOverrides
|
|
@@ -114,7 +114,7 @@ export interface ActionCallback extends BaseContract {
|
|
|
114
114
|
marketFactory(overrides?: CallOverrides): Promise<BigNumber>;
|
|
115
115
|
|
|
116
116
|
swapCallback(
|
|
117
|
-
|
|
117
|
+
ptToAccount: BigNumberish,
|
|
118
118
|
scyToAccount: BigNumberish,
|
|
119
119
|
data: BytesLike,
|
|
120
120
|
overrides?: Overrides & { from?: string | Promise<string> }
|
|
@@ -125,7 +125,7 @@ export interface ActionCallback extends BaseContract {
|
|
|
125
125
|
marketFactory(overrides?: CallOverrides): Promise<PopulatedTransaction>;
|
|
126
126
|
|
|
127
127
|
swapCallback(
|
|
128
|
-
|
|
128
|
+
ptToAccount: BigNumberish,
|
|
129
129
|
scyToAccount: BigNumberish,
|
|
130
130
|
data: BytesLike,
|
|
131
131
|
overrides?: Overrides & { from?: string | Promise<string> }
|