@pendle/core-v2 0.3.0 → 0.5.0

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 (104) hide show
  1. package/contracts/SuperComposableYield/ISuperComposableYield.sol +14 -0
  2. package/contracts/SuperComposableYield/implementations/IRewardManager.sol +16 -0
  3. package/contracts/SuperComposableYield/implementations/RewardManager.sol +24 -5
  4. package/contracts/SuperComposableYield/implementations/SCYBase.sol +21 -1
  5. package/contracts/core/PendleMarket.sol +10 -18
  6. package/contracts/core/PendleMarketFactory.sol +49 -22
  7. package/contracts/core/PendleRouter.sol +74 -0
  8. package/contracts/core/PendleYieldToken.sol +20 -12
  9. package/contracts/core/{router/PendleRouterStaticUpg.sol → RouterStatic.sol} +6 -6
  10. package/contracts/core/actions/ActionCallback.sol +101 -0
  11. package/contracts/core/{router/PendleRouterCoreUpg.sol → actions/ActionCore.sol} +6 -10
  12. package/contracts/core/{router/PendleRouterYTUpg.sol → actions/ActionYT.sol} +6 -11
  13. package/contracts/core/{router/base/PendleRouterOTBaseUpg.sol → actions/base/ActionSCYAndOTBase.sol} +1 -5
  14. package/contracts/core/{router/base/PendleRouterSCYAndForgeBaseUpg.sol → actions/base/ActionSCYAndYOBase.sol} +6 -8
  15. package/contracts/core/{router/base/PendleRouterYTBaseUpg.sol → actions/base/ActionSCYAndYTBase.sol} +7 -99
  16. package/contracts/core/actions/base/ActionType.sol +11 -0
  17. package/contracts/interfaces/{IPRouterCore.sol → IPActionCore.sol} +1 -1
  18. package/contracts/interfaces/{IPRouterYT.sol → IPActionYT.sol} +1 -3
  19. package/contracts/interfaces/IPAllAction.sol +9 -0
  20. package/contracts/interfaces/IPMarketFactory.sol +11 -0
  21. package/contracts/interfaces/IPYieldToken.sol +21 -3
  22. package/contracts/libraries/math/MarketMathCore.sol +3 -2
  23. package/package.json +1 -1
  24. package/typechain-types/{PendleRouterYTBaseUpg.ts → ActionCallback.ts} +5 -5
  25. package/typechain-types/{PendleRouterCoreUpg.ts → ActionCore.ts} +5 -5
  26. package/typechain-types/{PendleRouterSCYAndForgeBaseUpg.ts → ActionSCYAndYOBase.ts} +5 -6
  27. package/typechain-types/{BoringOwnableData.ts → ActionSCYAndYTBase.ts} +21 -24
  28. package/typechain-types/{PendleRouterStaticUpg.ts → ActionStatic.ts} +5 -5
  29. package/typechain-types/{IPRouterYT.ts → ActionYT.ts} +27 -42
  30. package/typechain-types/IPActionAll.ts +1431 -0
  31. package/typechain-types/{IPRouterCore.ts → IPActionCore.ts} +5 -5
  32. package/typechain-types/{IPRouterView.ts → IPActionStatic.ts} +57 -5
  33. package/typechain-types/{PendleRouterYTUpg.ts → IPActionYT.ts} +5 -97
  34. package/typechain-types/IPAllAction.ts +1431 -0
  35. package/typechain-types/IPMarket.ts +3 -0
  36. package/typechain-types/IPMarketFactory.ts +46 -0
  37. package/typechain-types/IPYieldToken.ts +342 -14
  38. package/typechain-types/IRewardManager.ts +178 -0
  39. package/typechain-types/ISuperComposableYield.ts +97 -2
  40. package/typechain-types/PendleAaveV3SCY.ts +167 -66
  41. package/typechain-types/PendleBenQiErc20SCY.ts +167 -66
  42. package/typechain-types/PendleBtrflyScy.ts +97 -2
  43. package/typechain-types/PendleMarket.ts +3 -59
  44. package/typechain-types/PendleMarketFactory.ts +150 -24
  45. package/typechain-types/{PendleRouterProxy.ts → PendleRouter.ts} +29 -39
  46. package/typechain-types/PendleYearnVaultScy.ts +97 -2
  47. package/typechain-types/PendleYieldToken.ts +116 -101
  48. package/typechain-types/RewardManager.ts +48 -42
  49. package/typechain-types/RouterStatic.ts +828 -0
  50. package/typechain-types/SCYBase.ts +97 -2
  51. package/typechain-types/SCYBaseWithRewards.ts +167 -66
  52. package/typechain-types/factories/ActionCallback__factory.ts +116 -0
  53. package/typechain-types/factories/ActionCore__factory.ts +632 -0
  54. package/typechain-types/factories/{PendleRouterSCYAndForgeBaseUpg__factory.ts → ActionSCYAndYOBase__factory.ts} +8 -12
  55. package/typechain-types/factories/ActionSCYAndYTBase__factory.ts +52 -0
  56. package/typechain-types/factories/ActionStatic__factory.ts +308 -0
  57. package/typechain-types/factories/ActionYT__factory.ts +370 -0
  58. package/typechain-types/factories/IPActionAll__factory.ts +983 -0
  59. package/typechain-types/factories/{IPRouterCore__factory.ts → IPActionCore__factory.ts} +6 -6
  60. package/typechain-types/factories/{IPRouterView__factory.ts → IPActionStatic__factory.ts} +38 -6
  61. package/typechain-types/factories/{IPRouterYT__factory.ts → IPActionYT__factory.ts} +6 -29
  62. package/typechain-types/factories/IPAllAction__factory.ts +983 -0
  63. package/typechain-types/factories/IPMarketFactory__factory.ts +28 -0
  64. package/typechain-types/factories/IPMarket__factory.ts +7 -2
  65. package/typechain-types/factories/IPYieldToken__factory.ts +158 -1
  66. package/typechain-types/factories/IRewardManager__factory.ts +92 -0
  67. package/typechain-types/factories/ISuperComposableYield__factory.ts +68 -0
  68. package/typechain-types/factories/PendleAaveV3SCY__factory.ts +102 -34
  69. package/typechain-types/factories/PendleBenQiErc20SCY__factory.ts +102 -34
  70. package/typechain-types/factories/PendleBtrflyScy__factory.ts +69 -1
  71. package/typechain-types/factories/PendleMarketFactory__factory.ts +112 -17
  72. package/typechain-types/factories/PendleMarket__factory.ts +8 -69
  73. package/typechain-types/factories/PendleRouter__factory.ts +282 -0
  74. package/typechain-types/factories/PendleYearnVaultScy__factory.ts +69 -1
  75. package/typechain-types/factories/PendleYieldContractFactory__factory.ts +1 -1
  76. package/typechain-types/factories/PendleYieldToken__factory.ts +58 -58
  77. package/typechain-types/factories/RewardManager__factory.ts +18 -18
  78. package/typechain-types/factories/RouterStatic__factory.ts +883 -0
  79. package/typechain-types/factories/SCYBaseWithRewards__factory.ts +101 -33
  80. package/typechain-types/factories/SCYBase__factory.ts +68 -0
  81. package/typechain-types/hardhat.d.ts +93 -75
  82. package/typechain-types/index.ts +22 -18
  83. package/contracts/core/router/PendleRouterProxy.sol +0 -84
  84. package/contracts/interfaces/IPFlashCallBack.sol +0 -10
  85. package/typechain-types/BoringOwnable.ts +0 -194
  86. package/typechain-types/BoringOwnableUpg.ts +0 -194
  87. package/typechain-types/BoringOwnableUpgData.ts +0 -100
  88. package/typechain-types/IPFlashCallback.ts +0 -115
  89. package/typechain-types/IPermissionsV2.ts +0 -87
  90. package/typechain-types/PendleRouterViewUpg.ts +0 -307
  91. package/typechain-types/PermissionsV2.ts +0 -87
  92. package/typechain-types/factories/BoringOwnableData__factory.ts +0 -90
  93. package/typechain-types/factories/BoringOwnableUpgData__factory.ts +0 -94
  94. package/typechain-types/factories/BoringOwnableUpg__factory.ts +0 -139
  95. package/typechain-types/factories/BoringOwnable__factory.ts +0 -149
  96. package/typechain-types/factories/IPFlashCallback__factory.ts +0 -49
  97. package/typechain-types/factories/IPermissionsV2__factory.ts +0 -39
  98. package/typechain-types/factories/PendleRouterCoreUpg__factory.ts +0 -635
  99. package/typechain-types/factories/PendleRouterProxy__factory.ts +0 -285
  100. package/typechain-types/factories/PendleRouterStaticUpg__factory.ts +0 -315
  101. package/typechain-types/factories/PendleRouterViewUpg__factory.ts +0 -265
  102. package/typechain-types/factories/PendleRouterYTBaseUpg__factory.ts +0 -66
  103. package/typechain-types/factories/PendleRouterYTUpg__factory.ts +0 -422
  104. package/typechain-types/factories/PermissionsV2__factory.ts +0 -36
@@ -29,6 +29,34 @@ const _abi = [
29
29
  stateMutability: "view",
30
30
  type: "function",
31
31
  },
32
+ {
33
+ inputs: [],
34
+ name: "marketConfig",
35
+ outputs: [
36
+ {
37
+ internalType: "address",
38
+ name: "treasury",
39
+ type: "address",
40
+ },
41
+ {
42
+ internalType: "uint96",
43
+ name: "feeRateRoot",
44
+ type: "uint96",
45
+ },
46
+ {
47
+ internalType: "uint32",
48
+ name: "rateOracleTimeWindow",
49
+ type: "uint32",
50
+ },
51
+ {
52
+ internalType: "uint8",
53
+ name: "reserveFeePercent",
54
+ type: "uint8",
55
+ },
56
+ ],
57
+ stateMutability: "view",
58
+ type: "function",
59
+ },
32
60
  {
33
61
  inputs: [],
34
62
  name: "treasury",
@@ -291,6 +291,11 @@ const _abi = [
291
291
  name: "oracleRate",
292
292
  type: "uint256",
293
293
  },
294
+ {
295
+ internalType: "address",
296
+ name: "treasury",
297
+ type: "address",
298
+ },
294
299
  {
295
300
  internalType: "int256",
296
301
  name: "scalarRoot",
@@ -312,9 +317,9 @@ const _abi = [
312
317
  type: "uint256",
313
318
  },
314
319
  {
315
- internalType: "int256",
320
+ internalType: "uint256",
316
321
  name: "reserveFeePercent",
317
- type: "int256",
322
+ type: "uint256",
318
323
  },
319
324
  {
320
325
  internalType: "uint256",
@@ -176,6 +176,109 @@ const _abi = [
176
176
  stateMutability: "view",
177
177
  type: "function",
178
178
  },
179
+ {
180
+ inputs: [
181
+ {
182
+ internalType: "address",
183
+ name: "rewardToken",
184
+ type: "address",
185
+ },
186
+ ],
187
+ name: "getGlobalReward",
188
+ outputs: [
189
+ {
190
+ internalType: "uint256",
191
+ name: "index",
192
+ type: "uint256",
193
+ },
194
+ {
195
+ internalType: "uint256",
196
+ name: "lastBalance",
197
+ type: "uint256",
198
+ },
199
+ ],
200
+ stateMutability: "view",
201
+ type: "function",
202
+ },
203
+ {
204
+ inputs: [
205
+ {
206
+ internalType: "address",
207
+ name: "user",
208
+ type: "address",
209
+ },
210
+ ],
211
+ name: "getInterestData",
212
+ outputs: [
213
+ {
214
+ internalType: "uint256",
215
+ name: "lastScyIndex",
216
+ type: "uint256",
217
+ },
218
+ {
219
+ internalType: "uint256",
220
+ name: "dueInterest",
221
+ type: "uint256",
222
+ },
223
+ ],
224
+ stateMutability: "view",
225
+ type: "function",
226
+ },
227
+ {
228
+ inputs: [],
229
+ name: "getRewardTokens",
230
+ outputs: [
231
+ {
232
+ internalType: "address[]",
233
+ name: "",
234
+ type: "address[]",
235
+ },
236
+ ],
237
+ stateMutability: "view",
238
+ type: "function",
239
+ },
240
+ {
241
+ inputs: [],
242
+ name: "getScyIndexBeforeExpiry",
243
+ outputs: [
244
+ {
245
+ internalType: "uint256",
246
+ name: "res",
247
+ type: "uint256",
248
+ },
249
+ ],
250
+ stateMutability: "nonpayable",
251
+ type: "function",
252
+ },
253
+ {
254
+ inputs: [
255
+ {
256
+ internalType: "address",
257
+ name: "user",
258
+ type: "address",
259
+ },
260
+ {
261
+ internalType: "address",
262
+ name: "rewardToken",
263
+ type: "address",
264
+ },
265
+ ],
266
+ name: "getUserReward",
267
+ outputs: [
268
+ {
269
+ internalType: "uint256",
270
+ name: "lastIndex",
271
+ type: "uint256",
272
+ },
273
+ {
274
+ internalType: "uint256",
275
+ name: "accruedReward",
276
+ type: "uint256",
277
+ },
278
+ ],
279
+ stateMutability: "view",
280
+ type: "function",
281
+ },
179
282
  {
180
283
  inputs: [],
181
284
  name: "isExpired",
@@ -234,13 +337,27 @@ const _abi = [
234
337
  type: "address",
235
338
  },
236
339
  ],
237
- name: "redeemDueInterestAndRewards",
340
+ name: "redeemDueInterest",
238
341
  outputs: [
239
342
  {
240
343
  internalType: "uint256",
241
344
  name: "interestOut",
242
345
  type: "uint256",
243
346
  },
347
+ ],
348
+ stateMutability: "nonpayable",
349
+ type: "function",
350
+ },
351
+ {
352
+ inputs: [
353
+ {
354
+ internalType: "address",
355
+ name: "user",
356
+ type: "address",
357
+ },
358
+ ],
359
+ name: "redeemDueRewards",
360
+ outputs: [
244
361
  {
245
362
  internalType: "uint256[]",
246
363
  name: "rewardsOut",
@@ -348,6 +465,46 @@ const _abi = [
348
465
  stateMutability: "nonpayable",
349
466
  type: "function",
350
467
  },
468
+ {
469
+ inputs: [],
470
+ name: "updateGlobalReward",
471
+ outputs: [],
472
+ stateMutability: "nonpayable",
473
+ type: "function",
474
+ },
475
+ {
476
+ inputs: [
477
+ {
478
+ internalType: "address",
479
+ name: "user",
480
+ type: "address",
481
+ },
482
+ ],
483
+ name: "updateUserInterest",
484
+ outputs: [],
485
+ stateMutability: "nonpayable",
486
+ type: "function",
487
+ },
488
+ {
489
+ inputs: [
490
+ {
491
+ internalType: "address",
492
+ name: "user",
493
+ type: "address",
494
+ },
495
+ ],
496
+ name: "updateUserReward",
497
+ outputs: [],
498
+ stateMutability: "nonpayable",
499
+ type: "function",
500
+ },
501
+ {
502
+ inputs: [],
503
+ name: "withdrawFeeToTreasury",
504
+ outputs: [],
505
+ stateMutability: "nonpayable",
506
+ type: "function",
507
+ },
351
508
  ];
352
509
 
353
510
  export class IPYieldToken__factory {
@@ -0,0 +1,92 @@
1
+ /* Autogenerated file. Do not edit manually. */
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+
5
+ import { Contract, Signer, utils } from "ethers";
6
+ import { Provider } from "@ethersproject/providers";
7
+ import type {
8
+ IRewardManager,
9
+ IRewardManagerInterface,
10
+ } from "../IRewardManager";
11
+
12
+ const _abi = [
13
+ {
14
+ inputs: [
15
+ {
16
+ internalType: "address",
17
+ name: "rewardToken",
18
+ type: "address",
19
+ },
20
+ ],
21
+ name: "getGlobalReward",
22
+ outputs: [
23
+ {
24
+ internalType: "uint256",
25
+ name: "index",
26
+ type: "uint256",
27
+ },
28
+ {
29
+ internalType: "uint256",
30
+ name: "lastBalance",
31
+ type: "uint256",
32
+ },
33
+ ],
34
+ stateMutability: "view",
35
+ type: "function",
36
+ },
37
+ {
38
+ inputs: [],
39
+ name: "getRewardTokens",
40
+ outputs: [
41
+ {
42
+ internalType: "address[]",
43
+ name: "",
44
+ type: "address[]",
45
+ },
46
+ ],
47
+ stateMutability: "view",
48
+ type: "function",
49
+ },
50
+ {
51
+ inputs: [
52
+ {
53
+ internalType: "address",
54
+ name: "user",
55
+ type: "address",
56
+ },
57
+ {
58
+ internalType: "address",
59
+ name: "rewardToken",
60
+ type: "address",
61
+ },
62
+ ],
63
+ name: "getUserReward",
64
+ outputs: [
65
+ {
66
+ internalType: "uint256",
67
+ name: "lastIndex",
68
+ type: "uint256",
69
+ },
70
+ {
71
+ internalType: "uint256",
72
+ name: "accruedReward",
73
+ type: "uint256",
74
+ },
75
+ ],
76
+ stateMutability: "view",
77
+ type: "function",
78
+ },
79
+ ];
80
+
81
+ export class IRewardManager__factory {
82
+ static readonly abi = _abi;
83
+ static createInterface(): IRewardManagerInterface {
84
+ return new utils.Interface(_abi) as IRewardManagerInterface;
85
+ }
86
+ static connect(
87
+ address: string,
88
+ signerOrProvider: Signer | Provider
89
+ ): IRewardManager {
90
+ return new Contract(address, _abi, signerOrProvider) as IRewardManager;
91
+ }
92
+ }
@@ -210,6 +210,11 @@ const _abi = [
210
210
  name: "baseTokenIn",
211
211
  type: "address",
212
212
  },
213
+ {
214
+ internalType: "uint256",
215
+ name: "amountBaseToPull",
216
+ type: "uint256",
217
+ },
213
218
  {
214
219
  internalType: "uint256",
215
220
  name: "minAmountScyOut",
@@ -227,6 +232,35 @@ const _abi = [
227
232
  stateMutability: "nonpayable",
228
233
  type: "function",
229
234
  },
235
+ {
236
+ inputs: [
237
+ {
238
+ internalType: "address",
239
+ name: "receiver",
240
+ type: "address",
241
+ },
242
+ {
243
+ internalType: "address",
244
+ name: "baseTokenIn",
245
+ type: "address",
246
+ },
247
+ {
248
+ internalType: "uint256",
249
+ name: "minAmountScyOut",
250
+ type: "uint256",
251
+ },
252
+ ],
253
+ name: "mintNoPull",
254
+ outputs: [
255
+ {
256
+ internalType: "uint256",
257
+ name: "amountScyOut",
258
+ type: "uint256",
259
+ },
260
+ ],
261
+ stateMutability: "nonpayable",
262
+ type: "function",
263
+ },
230
264
  {
231
265
  inputs: [],
232
266
  name: "name",
@@ -252,6 +286,11 @@ const _abi = [
252
286
  name: "baseTokenOut",
253
287
  type: "address",
254
288
  },
289
+ {
290
+ internalType: "uint256",
291
+ name: "amountScyToPull",
292
+ type: "uint256",
293
+ },
255
294
  {
256
295
  internalType: "uint256",
257
296
  name: "minAmountBaseOut",
@@ -269,6 +308,35 @@ const _abi = [
269
308
  stateMutability: "nonpayable",
270
309
  type: "function",
271
310
  },
311
+ {
312
+ inputs: [
313
+ {
314
+ internalType: "address",
315
+ name: "receiver",
316
+ type: "address",
317
+ },
318
+ {
319
+ internalType: "address",
320
+ name: "baseTokenOut",
321
+ type: "address",
322
+ },
323
+ {
324
+ internalType: "uint256",
325
+ name: "minAmountBaseOut",
326
+ type: "uint256",
327
+ },
328
+ ],
329
+ name: "redeemNoPull",
330
+ outputs: [
331
+ {
332
+ internalType: "uint256",
333
+ name: "amountBaseOut",
334
+ type: "uint256",
335
+ },
336
+ ],
337
+ stateMutability: "nonpayable",
338
+ type: "function",
339
+ },
272
340
  {
273
341
  inputs: [
274
342
  {