@pendle/core-v2 0.1.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 (182) hide show
  1. package/LICENSE +100 -0
  2. package/contracts/SuperComposableYield/ISuperComposableYield.sol +68 -0
  3. package/contracts/SuperComposableYield/SCYUtils.sol +14 -0
  4. package/contracts/SuperComposableYield/implementations/RewardManager.sol +117 -0
  5. package/contracts/SuperComposableYield/implementations/SCYBase.sol +126 -0
  6. package/contracts/SuperComposableYield/implementations/SCYBaseWithRewards.sol +79 -0
  7. package/contracts/core/PendleBaseToken.sol +39 -0
  8. package/contracts/core/PendleMarket.sol +248 -0
  9. package/contracts/core/PendleMarketFactory.sol +60 -0
  10. package/contracts/core/PendleOwnershipToken.sol +44 -0
  11. package/contracts/core/PendleSCYImpl/AaveV3/PendleAaveV3SCY.sol +139 -0
  12. package/contracts/core/PendleSCYImpl/AaveV3/WadRayMath.sol +126 -0
  13. package/contracts/core/PendleSCYImpl/PendleBenQiErc20SCY.sol +127 -0
  14. package/contracts/core/PendleSCYImpl/PendleBtrflySCY.sol +125 -0
  15. package/contracts/core/PendleSCYImpl/PendleYearnVaultSCY.sol +115 -0
  16. package/contracts/core/PendleYieldContractFactory.sol +109 -0
  17. package/contracts/core/PendleYieldToken.sol +240 -0
  18. package/contracts/core/misc/BoringOwnable.sol +62 -0
  19. package/contracts/core/misc/BoringOwnableUpg.sol +64 -0
  20. package/contracts/core/misc/PendleJoeSwapHelperUpg.sol +82 -0
  21. package/contracts/core/router/PendleRouterCoreUpg.sol +219 -0
  22. package/contracts/core/router/PendleRouterProxy.sol +64 -0
  23. package/contracts/core/router/PendleRouterYTUpg.sol +134 -0
  24. package/contracts/core/router/base/PendleRouterOTBaseUpg.sol +218 -0
  25. package/contracts/core/router/base/PendleRouterSCYAndForgeBaseUpg.sol +141 -0
  26. package/contracts/core/router/base/PendleRouterYTBaseUpg.sol +212 -0
  27. package/contracts/interfaces/IAToken.sol +34 -0
  28. package/contracts/interfaces/IAavePool.sol +41 -0
  29. package/contracts/interfaces/IAaveRewardsController.sol +32 -0
  30. package/contracts/interfaces/IBenQiComptroller.sol +33 -0
  31. package/contracts/interfaces/IJoePair.sol +98 -0
  32. package/contracts/interfaces/IJoeRouter01.sol +162 -0
  33. package/contracts/interfaces/IPBaseToken.sol +9 -0
  34. package/contracts/interfaces/IPFlashCallBack.sol +10 -0
  35. package/contracts/interfaces/IPGovernanceManager.sol +28 -0
  36. package/contracts/interfaces/IPMarket.sol +57 -0
  37. package/contracts/interfaces/IPMarketAddRemoveCallback.sol +18 -0
  38. package/contracts/interfaces/IPMarketFactory.sol +8 -0
  39. package/contracts/interfaces/IPMarketSwapCallback.sol +10 -0
  40. package/contracts/interfaces/IPOwnershipToken.sol +15 -0
  41. package/contracts/interfaces/IPPermissionsV2.sol +28 -0
  42. package/contracts/interfaces/IPRouterCore.sol +108 -0
  43. package/contracts/interfaces/IPRouterYT.sol +47 -0
  44. package/contracts/interfaces/IPYieldContractFactory.sol +36 -0
  45. package/contracts/interfaces/IPYieldToken.sol +19 -0
  46. package/contracts/interfaces/IQiErc20.sol +35 -0
  47. package/contracts/interfaces/IQiToken.sol +29 -0
  48. package/contracts/interfaces/IREDACTEDStaking.sol +35 -0
  49. package/contracts/interfaces/IWETH.sol +34 -0
  50. package/contracts/interfaces/IWXBTRFLY.sol +37 -0
  51. package/contracts/interfaces/IYearnVault.sol +32 -0
  52. package/contracts/libraries/JoeLibrary.sol +121 -0
  53. package/contracts/libraries/SCYIndex.sol +55 -0
  54. package/contracts/libraries/helpers/ExpiryUtilsLib.sol +166 -0
  55. package/contracts/libraries/math/FixedPoint.sol +208 -0
  56. package/contracts/libraries/math/LogExpMath.sol +515 -0
  57. package/contracts/libraries/math/MarketApproxLib.sol +140 -0
  58. package/contracts/libraries/math/MarketMathLib.sol +606 -0
  59. package/contracts/periphery/PendleGovernanceManager.sol +36 -0
  60. package/contracts/periphery/PermissionsV2.sol +23 -0
  61. package/package.json +76 -0
  62. package/typechain-types/BoringOwnable.ts +194 -0
  63. package/typechain-types/BoringOwnableData.ts +100 -0
  64. package/typechain-types/BoringOwnableUpg.ts +194 -0
  65. package/typechain-types/BoringOwnableUpgData.ts +100 -0
  66. package/typechain-types/ERC1967UpgradeUpgradeable.ts +97 -0
  67. package/typechain-types/ERC20.ts +417 -0
  68. package/typechain-types/IAToken.ts +331 -0
  69. package/typechain-types/IAavePool.ts +192 -0
  70. package/typechain-types/IAaveRewardsController.ts +148 -0
  71. package/typechain-types/IBeaconUpgradeable.ts +87 -0
  72. package/typechain-types/IBenQiComptroller.ts +125 -0
  73. package/typechain-types/IERC1822ProxiableUpgradeable.ts +87 -0
  74. package/typechain-types/IERC20.ts +300 -0
  75. package/typechain-types/IERC20Metadata.ts +339 -0
  76. package/typechain-types/IJoePair.ts +888 -0
  77. package/typechain-types/IJoeRouter01.ts +1107 -0
  78. package/typechain-types/IPBaseToken.ts +365 -0
  79. package/typechain-types/IPFlashCallback.ts +115 -0
  80. package/typechain-types/IPGovernanceManager.ts +84 -0
  81. package/typechain-types/IPMarket.ts +701 -0
  82. package/typechain-types/IPMarketAddRemoveCallback.ts +169 -0
  83. package/typechain-types/IPMarketFactory.ts +109 -0
  84. package/typechain-types/IPMarketSwapCallback.ts +115 -0
  85. package/typechain-types/IPOwnershipToken.ts +488 -0
  86. package/typechain-types/IPRouterCore.ts +759 -0
  87. package/typechain-types/IPRouterYT.ts +405 -0
  88. package/typechain-types/IPYieldContractFactory.ts +192 -0
  89. package/typechain-types/IPYieldToken.ts +525 -0
  90. package/typechain-types/IPermissionsV2.ts +87 -0
  91. package/typechain-types/IQiErc20.ts +402 -0
  92. package/typechain-types/IQiToken.ts +327 -0
  93. package/typechain-types/IREDACTEDStaking.ts +216 -0
  94. package/typechain-types/ISuperComposableYield.ts +652 -0
  95. package/typechain-types/IWETH.ts +380 -0
  96. package/typechain-types/IWXBTRFLY.ts +254 -0
  97. package/typechain-types/IYearnVault.ts +152 -0
  98. package/typechain-types/PendleAaveV3SCY.ts +901 -0
  99. package/typechain-types/PendleBaseToken.ts +505 -0
  100. package/typechain-types/PendleBenQiErc20SCY.ts +914 -0
  101. package/typechain-types/PendleBtrflyScy.ts +794 -0
  102. package/typechain-types/PendleGovernanceManager.ts +187 -0
  103. package/typechain-types/PendleJoeSwapHelperUpg.ts +97 -0
  104. package/typechain-types/PendleMarket.ts +1008 -0
  105. package/typechain-types/PendleMarketFactory.ts +246 -0
  106. package/typechain-types/PendleOwnershipToken.ts +628 -0
  107. package/typechain-types/PendleRouterCoreUpg.ts +780 -0
  108. package/typechain-types/PendleRouterProxy.ts +417 -0
  109. package/typechain-types/PendleRouterSCYAndForgeBaseUpg.ts +98 -0
  110. package/typechain-types/PendleRouterYTBaseUpg.ts +134 -0
  111. package/typechain-types/PendleRouterYTUpg.ts +453 -0
  112. package/typechain-types/PendleYearnVaultScy.ts +784 -0
  113. package/typechain-types/PendleYieldContractFactory.ts +479 -0
  114. package/typechain-types/PendleYieldToken.ts +1030 -0
  115. package/typechain-types/PermissionsV2.ts +87 -0
  116. package/typechain-types/Proxy.ts +57 -0
  117. package/typechain-types/RewardManager.ts +172 -0
  118. package/typechain-types/SCYBase.ts +734 -0
  119. package/typechain-types/SCYBaseWithRewards.ts +819 -0
  120. package/typechain-types/UUPSUpgradeable.ts +197 -0
  121. package/typechain-types/common.ts +44 -0
  122. package/typechain-types/factories/BoringOwnableData__factory.ts +90 -0
  123. package/typechain-types/factories/BoringOwnableUpgData__factory.ts +94 -0
  124. package/typechain-types/factories/BoringOwnableUpg__factory.ts +139 -0
  125. package/typechain-types/factories/BoringOwnable__factory.ts +149 -0
  126. package/typechain-types/factories/ERC1967UpgradeUpgradeable__factory.ts +75 -0
  127. package/typechain-types/factories/ERC20__factory.ts +348 -0
  128. package/typechain-types/factories/IAToken__factory.ts +225 -0
  129. package/typechain-types/factories/IAavePool__factory.ts +99 -0
  130. package/typechain-types/factories/IAaveRewardsController__factory.ts +78 -0
  131. package/typechain-types/factories/IBeaconUpgradeable__factory.ts +39 -0
  132. package/typechain-types/factories/IBenQiComptroller__factory.ts +59 -0
  133. package/typechain-types/factories/IERC1822ProxiableUpgradeable__factory.ts +43 -0
  134. package/typechain-types/factories/IERC20Metadata__factory.ts +248 -0
  135. package/typechain-types/factories/IERC20__factory.ts +203 -0
  136. package/typechain-types/factories/IJoePair__factory.ts +674 -0
  137. package/typechain-types/factories/IJoeRouter01__factory.ts +772 -0
  138. package/typechain-types/factories/IPBaseToken__factory.ts +271 -0
  139. package/typechain-types/factories/IPFlashCallback__factory.ts +49 -0
  140. package/typechain-types/factories/IPGovernanceManager__factory.ts +39 -0
  141. package/typechain-types/factories/IPMarketAddRemoveCallback__factory.ts +86 -0
  142. package/typechain-types/factories/IPMarketFactory__factory.ts +58 -0
  143. package/typechain-types/factories/IPMarketSwapCallback__factory.ts +53 -0
  144. package/typechain-types/factories/IPMarket__factory.ts +559 -0
  145. package/typechain-types/factories/IPOwnershipToken__factory.ts +349 -0
  146. package/typechain-types/factories/IPRouterCore__factory.ts +516 -0
  147. package/typechain-types/factories/IPRouterYT__factory.ts +246 -0
  148. package/typechain-types/factories/IPYieldContractFactory__factory.ts +117 -0
  149. package/typechain-types/factories/IPYieldToken__factory.ts +383 -0
  150. package/typechain-types/factories/IPermissionsV2__factory.ts +39 -0
  151. package/typechain-types/factories/IQiErc20__factory.ts +270 -0
  152. package/typechain-types/factories/IQiToken__factory.ts +219 -0
  153. package/typechain-types/factories/IREDACTEDStaking__factory.ts +107 -0
  154. package/typechain-types/factories/ISuperComposableYield__factory.ts +438 -0
  155. package/typechain-types/factories/IWETH__factory.ts +261 -0
  156. package/typechain-types/factories/IWXBTRFLY__factory.ts +131 -0
  157. package/typechain-types/factories/IYearnVault__factory.ts +74 -0
  158. package/typechain-types/factories/PendleAaveV3SCY__factory.ts +727 -0
  159. package/typechain-types/factories/PendleBaseToken__factory.ts +386 -0
  160. package/typechain-types/factories/PendleBenQiErc20SCY__factory.ts +753 -0
  161. package/typechain-types/factories/PendleBtrflyScy__factory.ts +652 -0
  162. package/typechain-types/factories/PendleGovernanceManager__factory.ts +149 -0
  163. package/typechain-types/factories/PendleJoeSwapHelperUpg__factory.ts +56 -0
  164. package/typechain-types/factories/PendleMarketFactory__factory.ts +207 -0
  165. package/typechain-types/factories/PendleMarket__factory.ts +891 -0
  166. package/typechain-types/factories/PendleOwnershipToken__factory.ts +565 -0
  167. package/typechain-types/factories/PendleRouterCoreUpg__factory.ts +620 -0
  168. package/typechain-types/factories/PendleRouterProxy__factory.ts +316 -0
  169. package/typechain-types/factories/PendleRouterSCYAndForgeBaseUpg__factory.ts +56 -0
  170. package/typechain-types/factories/PendleRouterYTBaseUpg__factory.ts +66 -0
  171. package/typechain-types/factories/PendleRouterYTUpg__factory.ts +363 -0
  172. package/typechain-types/factories/PendleYearnVaultScy__factory.ts +630 -0
  173. package/typechain-types/factories/PendleYieldContractFactory__factory.ts +368 -0
  174. package/typechain-types/factories/PendleYieldToken__factory.ts +814 -0
  175. package/typechain-types/factories/PermissionsV2__factory.ts +36 -0
  176. package/typechain-types/factories/Proxy__factory.ts +28 -0
  177. package/typechain-types/factories/RewardManager__factory.ts +89 -0
  178. package/typechain-types/factories/SCYBaseWithRewards__factory.ts +535 -0
  179. package/typechain-types/factories/SCYBase__factory.ts +479 -0
  180. package/typechain-types/factories/UUPSUpgradeable__factory.ts +115 -0
  181. package/typechain-types/hardhat.d.ts +564 -0
  182. package/typechain-types/index.ts +122 -0
@@ -0,0 +1,246 @@
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 { IPRouterYT, IPRouterYTInterface } from "../IPRouterYT";
8
+
9
+ const _abi = [
10
+ {
11
+ inputs: [
12
+ {
13
+ internalType: "int256",
14
+ name: "otToAccount",
15
+ type: "int256",
16
+ },
17
+ {
18
+ internalType: "int256",
19
+ name: "scyToAccount",
20
+ type: "int256",
21
+ },
22
+ {
23
+ internalType: "bytes",
24
+ name: "data",
25
+ type: "bytes",
26
+ },
27
+ ],
28
+ name: "swapCallback",
29
+ outputs: [],
30
+ stateMutability: "nonpayable",
31
+ type: "function",
32
+ },
33
+ {
34
+ inputs: [
35
+ {
36
+ internalType: "uint256",
37
+ name: "exactRawTokenIn",
38
+ type: "uint256",
39
+ },
40
+ {
41
+ internalType: "address",
42
+ name: "receiver",
43
+ type: "address",
44
+ },
45
+ {
46
+ internalType: "address[]",
47
+ name: "path",
48
+ type: "address[]",
49
+ },
50
+ {
51
+ internalType: "address",
52
+ name: "market",
53
+ type: "address",
54
+ },
55
+ {
56
+ internalType: "uint256",
57
+ name: "minYtOut",
58
+ type: "uint256",
59
+ },
60
+ {
61
+ internalType: "uint256",
62
+ name: "netYtOutGuessMin",
63
+ type: "uint256",
64
+ },
65
+ {
66
+ internalType: "uint256",
67
+ name: "netYtOutGuessMax",
68
+ type: "uint256",
69
+ },
70
+ ],
71
+ name: "swapExactRawTokenForYt",
72
+ outputs: [
73
+ {
74
+ internalType: "uint256",
75
+ name: "netYtOut",
76
+ type: "uint256",
77
+ },
78
+ ],
79
+ stateMutability: "nonpayable",
80
+ type: "function",
81
+ },
82
+ {
83
+ inputs: [
84
+ {
85
+ internalType: "address",
86
+ name: "receiver",
87
+ type: "address",
88
+ },
89
+ {
90
+ internalType: "address",
91
+ name: "market",
92
+ type: "address",
93
+ },
94
+ {
95
+ internalType: "uint256",
96
+ name: "exactScyIn",
97
+ type: "uint256",
98
+ },
99
+ {
100
+ internalType: "uint256",
101
+ name: "minYtOut",
102
+ type: "uint256",
103
+ },
104
+ {
105
+ internalType: "uint256",
106
+ name: "netYtOutGuessMin",
107
+ type: "uint256",
108
+ },
109
+ {
110
+ internalType: "uint256",
111
+ name: "netYtOutGuessMax",
112
+ type: "uint256",
113
+ },
114
+ ],
115
+ name: "swapExactScyForYt",
116
+ outputs: [
117
+ {
118
+ internalType: "uint256",
119
+ name: "netYtOut",
120
+ type: "uint256",
121
+ },
122
+ ],
123
+ stateMutability: "nonpayable",
124
+ type: "function",
125
+ },
126
+ {
127
+ inputs: [
128
+ {
129
+ internalType: "uint256",
130
+ name: "exactYtIn",
131
+ type: "uint256",
132
+ },
133
+ {
134
+ internalType: "address",
135
+ name: "receiver",
136
+ type: "address",
137
+ },
138
+ {
139
+ internalType: "address[]",
140
+ name: "path",
141
+ type: "address[]",
142
+ },
143
+ {
144
+ internalType: "address",
145
+ name: "market",
146
+ type: "address",
147
+ },
148
+ {
149
+ internalType: "uint256",
150
+ name: "minRawTokenOut",
151
+ type: "uint256",
152
+ },
153
+ ],
154
+ name: "swapExactYtForRawToken",
155
+ outputs: [
156
+ {
157
+ internalType: "uint256",
158
+ name: "netRawTokenOut",
159
+ type: "uint256",
160
+ },
161
+ ],
162
+ stateMutability: "nonpayable",
163
+ type: "function",
164
+ },
165
+ {
166
+ inputs: [
167
+ {
168
+ internalType: "address",
169
+ name: "receiver",
170
+ type: "address",
171
+ },
172
+ {
173
+ internalType: "address",
174
+ name: "market",
175
+ type: "address",
176
+ },
177
+ {
178
+ internalType: "uint256",
179
+ name: "exactYtIn",
180
+ type: "uint256",
181
+ },
182
+ {
183
+ internalType: "uint256",
184
+ name: "minScyOut",
185
+ type: "uint256",
186
+ },
187
+ ],
188
+ name: "swapExactYtForScy",
189
+ outputs: [
190
+ {
191
+ internalType: "uint256",
192
+ name: "netScyOut",
193
+ type: "uint256",
194
+ },
195
+ ],
196
+ stateMutability: "nonpayable",
197
+ type: "function",
198
+ },
199
+ {
200
+ inputs: [
201
+ {
202
+ internalType: "address",
203
+ name: "receiver",
204
+ type: "address",
205
+ },
206
+ {
207
+ internalType: "address",
208
+ name: "market",
209
+ type: "address",
210
+ },
211
+ {
212
+ internalType: "uint256",
213
+ name: "exactYtOut",
214
+ type: "uint256",
215
+ },
216
+ {
217
+ internalType: "uint256",
218
+ name: "maxScyIn",
219
+ type: "uint256",
220
+ },
221
+ ],
222
+ name: "swapScyForExactYt",
223
+ outputs: [
224
+ {
225
+ internalType: "uint256",
226
+ name: "netScyIn",
227
+ type: "uint256",
228
+ },
229
+ ],
230
+ stateMutability: "nonpayable",
231
+ type: "function",
232
+ },
233
+ ];
234
+
235
+ export class IPRouterYT__factory {
236
+ static readonly abi = _abi;
237
+ static createInterface(): IPRouterYTInterface {
238
+ return new utils.Interface(_abi) as IPRouterYTInterface;
239
+ }
240
+ static connect(
241
+ address: string,
242
+ signerOrProvider: Signer | Provider
243
+ ): IPRouterYT {
244
+ return new Contract(address, _abi, signerOrProvider) as IPRouterYT;
245
+ }
246
+ }
@@ -0,0 +1,117 @@
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
+ IPYieldContractFactory,
9
+ IPYieldContractFactoryInterface,
10
+ } from "../IPYieldContractFactory";
11
+
12
+ const _abi = [
13
+ {
14
+ inputs: [],
15
+ name: "expiryDivisor",
16
+ outputs: [
17
+ {
18
+ internalType: "uint256",
19
+ name: "",
20
+ type: "uint256",
21
+ },
22
+ ],
23
+ stateMutability: "view",
24
+ type: "function",
25
+ },
26
+ {
27
+ inputs: [
28
+ {
29
+ internalType: "address",
30
+ name: "SCY",
31
+ type: "address",
32
+ },
33
+ {
34
+ internalType: "uint256",
35
+ name: "expiry",
36
+ type: "uint256",
37
+ },
38
+ ],
39
+ name: "getOT",
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: "SCY",
55
+ type: "address",
56
+ },
57
+ {
58
+ internalType: "uint256",
59
+ name: "expiry",
60
+ type: "uint256",
61
+ },
62
+ ],
63
+ name: "getYT",
64
+ outputs: [
65
+ {
66
+ internalType: "address",
67
+ name: "",
68
+ type: "address",
69
+ },
70
+ ],
71
+ stateMutability: "view",
72
+ type: "function",
73
+ },
74
+ {
75
+ inputs: [],
76
+ name: "interestFeeRate",
77
+ outputs: [
78
+ {
79
+ internalType: "uint256",
80
+ name: "",
81
+ type: "uint256",
82
+ },
83
+ ],
84
+ stateMutability: "view",
85
+ type: "function",
86
+ },
87
+ {
88
+ inputs: [],
89
+ name: "treasury",
90
+ outputs: [
91
+ {
92
+ internalType: "address",
93
+ name: "",
94
+ type: "address",
95
+ },
96
+ ],
97
+ stateMutability: "view",
98
+ type: "function",
99
+ },
100
+ ];
101
+
102
+ export class IPYieldContractFactory__factory {
103
+ static readonly abi = _abi;
104
+ static createInterface(): IPYieldContractFactoryInterface {
105
+ return new utils.Interface(_abi) as IPYieldContractFactoryInterface;
106
+ }
107
+ static connect(
108
+ address: string,
109
+ signerOrProvider: Signer | Provider
110
+ ): IPYieldContractFactory {
111
+ return new Contract(
112
+ address,
113
+ _abi,
114
+ signerOrProvider
115
+ ) as IPYieldContractFactory;
116
+ }
117
+ }