@pendle/core-v2 0.5.1-beta-4 → 0.6.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.
- package/contracts/SuperComposableYield/ISuperComposableYield.sol +2 -0
- package/contracts/SuperComposableYield/implementations/RewardManager.sol +35 -20
- package/contracts/SuperComposableYield/implementations/SCYBase.sol +39 -19
- package/contracts/SuperComposableYield/implementations/SCYBaseWithRewards.sol +26 -14
- package/contracts/core/PendleBaseToken.sol +2 -2
- package/contracts/core/PendleMarket.sol +145 -61
- package/contracts/core/PendleMarketFactory.sol +30 -19
- package/contracts/core/{PendleOwnershipToken.sol → PendlePrincipalToken.sol} +14 -2
- package/contracts/core/PendleRouter.sol +23 -9
- package/contracts/core/PendleSCYImpl/AaveV3/PendleAaveV3SCY.sol +21 -20
- package/contracts/core/PendleSCYImpl/PendleBenQiErc20SCY.sol +22 -16
- package/contracts/core/PendleSCYImpl/PendleBtrflySCY.sol +13 -13
- package/contracts/core/PendleSCYImpl/PendleStETHSCY.sol +107 -0
- package/contracts/core/PendleSCYImpl/PendleYearnVaultSCY.sol +14 -15
- package/contracts/core/PendleYieldContractFactory.sol +29 -14
- package/contracts/core/PendleYieldToken.sol +130 -76
- package/contracts/core/RouterStatic.sol +16 -157
- package/contracts/core/actions/ActionCallback.sol +36 -18
- package/contracts/core/actions/ActionCore.sol +41 -88
- package/contracts/core/actions/ActionRedeem.sol +36 -0
- package/contracts/core/actions/ActionYT.sol +41 -59
- package/contracts/core/actions/base/{ActionSCYAndOTBase.sol → ActionSCYAndPTBase.sol} +59 -45
- package/contracts/core/actions/base/{ActionSCYAndYOBase.sol → ActionSCYAndPYBase.sol} +57 -19
- package/contracts/core/actions/base/ActionSCYAndYTBase.sol +31 -21
- package/contracts/interfaces/IPActionCore.sol +21 -28
- package/contracts/interfaces/IPActionRedeem.sol +17 -0
- package/contracts/interfaces/IPActionYT.sol +5 -12
- package/contracts/interfaces/IPAllAction.sol +2 -2
- package/contracts/interfaces/IPMarket.sol +33 -10
- package/contracts/interfaces/IPMarketAddRemoveCallback.sol +2 -2
- package/contracts/interfaces/IPMarketFactory.sol +3 -1
- package/contracts/interfaces/IPMarketSwapCallback.sol +1 -1
- package/contracts/interfaces/{IPOwnershipToken.sol → IPPrincipalToken.sol} +1 -1
- package/contracts/interfaces/IPRouterStatic.sol +7 -82
- package/contracts/interfaces/IPYieldContractFactory.sol +10 -2
- package/contracts/interfaces/IPYieldToken.sol +14 -5
- package/contracts/interfaces/IWstETH.sol +10 -0
- package/contracts/libraries/JoeLibrary.sol +1 -1
- package/contracts/libraries/math/LogExpMath.sol +1 -1
- package/contracts/libraries/math/MarketApproxLib.sol +128 -88
- package/contracts/libraries/math/MarketMathAux.sol +13 -13
- package/contracts/libraries/math/MarketMathCore.sol +62 -93
- package/contracts/libraries/math/Math.sol +14 -2
- package/contracts/periphery/PendleGovernanceManager.sol +5 -3
- package/package.json +3 -2
- 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 -530
- 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 -530
- 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
|
@@ -4,6 +4,6 @@ pragma solidity 0.8.9;
|
|
|
4
4
|
|
|
5
5
|
import "./IPActionCore.sol";
|
|
6
6
|
import "./IPActionYT.sol";
|
|
7
|
-
import "./
|
|
7
|
+
import "./IPActionRedeem.sol";
|
|
8
8
|
|
|
9
|
-
interface IPAllAction is IPActionCore, IPActionYT {}
|
|
9
|
+
interface IPAllAction is IPActionCore, IPActionYT, IPActionRedeem {}
|
|
@@ -2,47 +2,70 @@
|
|
|
2
2
|
pragma solidity 0.8.9;
|
|
3
3
|
|
|
4
4
|
import "./IPBaseToken.sol";
|
|
5
|
-
import "./
|
|
5
|
+
import "./IPPrincipalToken.sol";
|
|
6
6
|
import "./IPYieldToken.sol";
|
|
7
7
|
import "../libraries/math/MarketMathCore.sol";
|
|
8
8
|
|
|
9
9
|
interface IPMarket is IPBaseToken {
|
|
10
|
+
event AddLiquidity(
|
|
11
|
+
address indexed receiver,
|
|
12
|
+
uint256 lpToAccount,
|
|
13
|
+
uint256 scyUsed,
|
|
14
|
+
uint256 ptUsed
|
|
15
|
+
);
|
|
16
|
+
|
|
17
|
+
event RemoveLiquidity(
|
|
18
|
+
address indexed receiver,
|
|
19
|
+
uint256 lpRemoved,
|
|
20
|
+
uint256 scyToAccount,
|
|
21
|
+
uint256 ptToAccount
|
|
22
|
+
);
|
|
23
|
+
|
|
24
|
+
event Swap(
|
|
25
|
+
address indexed receiver,
|
|
26
|
+
int256 ptToAccount,
|
|
27
|
+
int256 scyToAccount,
|
|
28
|
+
uint256 netScyToReserve
|
|
29
|
+
);
|
|
30
|
+
|
|
31
|
+
event UpdateImpliedRate(uint256 indexed timestamp, uint256 lnLastImpliedRate);
|
|
32
|
+
|
|
10
33
|
function addLiquidity(
|
|
11
34
|
address receiver,
|
|
12
35
|
uint256 scyDesired,
|
|
13
|
-
uint256
|
|
36
|
+
uint256 ptDesired,
|
|
14
37
|
bytes calldata data
|
|
15
38
|
)
|
|
16
39
|
external
|
|
17
40
|
returns (
|
|
18
41
|
uint256 lpToAccount,
|
|
19
42
|
uint256 scyUsed,
|
|
20
|
-
uint256
|
|
43
|
+
uint256 ptUsed
|
|
21
44
|
);
|
|
22
45
|
|
|
23
46
|
function removeLiquidity(
|
|
24
47
|
address receiver,
|
|
25
48
|
uint256 lpToRemove,
|
|
26
49
|
bytes calldata data
|
|
27
|
-
) external returns (uint256 scyToAccount, uint256
|
|
50
|
+
) external returns (uint256 scyToAccount, uint256 ptToAccount);
|
|
28
51
|
|
|
29
|
-
function
|
|
52
|
+
function swapExactPtForScy(
|
|
30
53
|
address receiver,
|
|
31
|
-
uint256
|
|
54
|
+
uint256 exactPtIn,
|
|
32
55
|
uint256 minScyOut,
|
|
33
56
|
bytes calldata data
|
|
34
57
|
) external returns (uint256 netScyOut, uint256 netScyToReserve);
|
|
35
58
|
|
|
36
|
-
function
|
|
59
|
+
function swapScyForExactPt(
|
|
37
60
|
address receiver,
|
|
38
|
-
uint256
|
|
61
|
+
uint256 exactPtOut,
|
|
39
62
|
uint256 maxScyIn,
|
|
40
63
|
bytes calldata data
|
|
41
64
|
) external returns (uint256 netScyIn, uint256 netScyToReserve);
|
|
42
65
|
|
|
43
66
|
function readState(bool updateRateOracle) external view returns (MarketState memory market);
|
|
44
67
|
|
|
45
|
-
function
|
|
68
|
+
function PT() external view returns (address);
|
|
46
69
|
|
|
47
70
|
function YT() external view returns (address);
|
|
48
71
|
|
|
@@ -53,7 +76,7 @@ interface IPMarket is IPBaseToken {
|
|
|
53
76
|
view
|
|
54
77
|
returns (
|
|
55
78
|
ISuperComposableYield _SCY,
|
|
56
|
-
|
|
79
|
+
IPPrincipalToken _PT,
|
|
57
80
|
IPYieldToken _YT
|
|
58
81
|
);
|
|
59
82
|
}
|
|
@@ -5,14 +5,14 @@ interface IPMarketAddRemoveCallback {
|
|
|
5
5
|
function addLiquidityCallback(
|
|
6
6
|
uint256 lpToAccount,
|
|
7
7
|
uint256 scyOwed,
|
|
8
|
-
uint256
|
|
8
|
+
uint256 ptOwed,
|
|
9
9
|
bytes calldata data
|
|
10
10
|
) external;
|
|
11
11
|
|
|
12
12
|
function removeLiquidityCallback(
|
|
13
13
|
uint256 lpOwed,
|
|
14
14
|
uint256 scyToAccount,
|
|
15
|
-
uint256
|
|
15
|
+
uint256 ptToAccount,
|
|
16
16
|
bytes calldata data
|
|
17
17
|
) external;
|
|
18
18
|
}
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
pragma solidity 0.8.9;
|
|
3
3
|
|
|
4
4
|
interface IPMarketFactory {
|
|
5
|
+
event CreateNewMarket(address indexed PT, int256 scalarRoot, int256 initialAnchor);
|
|
6
|
+
|
|
5
7
|
function isValidMarket(address market) external view returns (bool);
|
|
6
8
|
|
|
7
9
|
function treasury() external view returns (address);
|
|
@@ -12,7 +14,7 @@ interface IPMarketFactory {
|
|
|
12
14
|
view
|
|
13
15
|
returns (
|
|
14
16
|
address treasury,
|
|
15
|
-
uint96
|
|
17
|
+
uint96 lnFeeRateRoot,
|
|
16
18
|
uint32 rateOracleTimeWindow,
|
|
17
19
|
uint8 reserveFeePercent
|
|
18
20
|
);
|
|
@@ -4,116 +4,41 @@ pragma solidity 0.8.9;
|
|
|
4
4
|
import "../libraries/math/MarketMathCore.sol";
|
|
5
5
|
|
|
6
6
|
interface IPRouterStatic {
|
|
7
|
-
struct TokenAmount {
|
|
8
|
-
address token;
|
|
9
|
-
uint256 amount;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
struct RewardIndex {
|
|
13
|
-
address rewardToken;
|
|
14
|
-
uint256 index;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
struct UserYOInfo {
|
|
18
|
-
address yt;
|
|
19
|
-
address ot;
|
|
20
|
-
uint256 ytBalance;
|
|
21
|
-
uint256 otBalance;
|
|
22
|
-
TokenAmount unclaimedInterest;
|
|
23
|
-
TokenAmount[] unclaimedRewards;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
struct UserMarketInfo {
|
|
27
|
-
address market;
|
|
28
|
-
uint256 lpBalance;
|
|
29
|
-
TokenAmount otBalance;
|
|
30
|
-
TokenAmount scyBalance;
|
|
31
|
-
TokenAmount assetBalance;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
7
|
function addLiquidityStatic(
|
|
35
8
|
address market,
|
|
36
9
|
uint256 scyDesired,
|
|
37
|
-
uint256
|
|
10
|
+
uint256 ptDesired
|
|
38
11
|
)
|
|
39
12
|
external
|
|
40
13
|
returns (
|
|
41
14
|
uint256 netLpOut,
|
|
42
15
|
uint256 scyUsed,
|
|
43
|
-
uint256
|
|
16
|
+
uint256 ptUsed
|
|
44
17
|
);
|
|
45
18
|
|
|
46
19
|
function removeLiquidityStatic(address market, uint256 lpToRemove)
|
|
47
20
|
external
|
|
48
21
|
view
|
|
49
|
-
returns (uint256 netScyOut, uint256
|
|
22
|
+
returns (uint256 netScyOut, uint256 netPtOut);
|
|
50
23
|
|
|
51
|
-
function
|
|
24
|
+
function swapPtForScyStatic(address market, uint256 exactPtIn)
|
|
52
25
|
external
|
|
53
26
|
returns (uint256 netScyOut, uint256 netScyFee);
|
|
54
27
|
|
|
55
|
-
function
|
|
28
|
+
function swapScyForPtStatic(address market, uint256 exactPtOut)
|
|
56
29
|
external
|
|
57
30
|
returns (uint256 netScyIn, uint256 netScyFee);
|
|
58
31
|
|
|
59
32
|
function scyIndex(address market) external returns (SCYIndex index);
|
|
60
33
|
|
|
61
|
-
function
|
|
34
|
+
function getPtImpliedYield(address market) external view returns (int256);
|
|
62
35
|
|
|
63
36
|
function getPendleTokenType(address token)
|
|
64
37
|
external
|
|
65
38
|
view
|
|
66
39
|
returns (
|
|
67
|
-
bool
|
|
40
|
+
bool isPT,
|
|
68
41
|
bool isYT,
|
|
69
42
|
bool isMarket
|
|
70
43
|
);
|
|
71
|
-
|
|
72
|
-
function getUserYOInfo(address yo, address user)
|
|
73
|
-
external
|
|
74
|
-
view
|
|
75
|
-
returns (UserYOInfo memory userYOInfo);
|
|
76
|
-
|
|
77
|
-
function getYOInfo(address yo)
|
|
78
|
-
external
|
|
79
|
-
returns (
|
|
80
|
-
uint256 exchangeRate,
|
|
81
|
-
uint256 totalSupply,
|
|
82
|
-
RewardIndex[] memory rewardIndexes
|
|
83
|
-
);
|
|
84
|
-
|
|
85
|
-
function getYO(address yo) external view returns (address yt, address ot);
|
|
86
|
-
|
|
87
|
-
function getMarketInfo(address market)
|
|
88
|
-
external
|
|
89
|
-
view
|
|
90
|
-
returns (
|
|
91
|
-
address ot,
|
|
92
|
-
address scy,
|
|
93
|
-
MarketState memory state,
|
|
94
|
-
int256 impliedYield,
|
|
95
|
-
uint256 exchangeRate
|
|
96
|
-
);
|
|
97
|
-
|
|
98
|
-
function getUserMarketInfo(address market, address user)
|
|
99
|
-
external
|
|
100
|
-
view
|
|
101
|
-
returns (UserMarketInfo memory userMarketInfo);
|
|
102
|
-
|
|
103
|
-
function getUserYOPositionsByYOs(address user, address[] calldata yos)
|
|
104
|
-
external
|
|
105
|
-
view
|
|
106
|
-
returns (UserYOInfo[] memory userYOPositions);
|
|
107
|
-
|
|
108
|
-
function getUserMarketPositions(address user, address[] calldata markets)
|
|
109
|
-
external
|
|
110
|
-
view
|
|
111
|
-
returns (UserMarketInfo[] memory userMarketPositions);
|
|
112
|
-
|
|
113
|
-
function hasYOPosition(UserYOInfo memory userYOInfo) external pure returns (bool hasPosition);
|
|
114
|
-
|
|
115
|
-
function getUserSCYInfo(address scy, address user)
|
|
116
|
-
external
|
|
117
|
-
view
|
|
118
|
-
returns (uint256 balance, TokenAmount[] memory rewards);
|
|
119
44
|
}
|
|
@@ -24,7 +24,15 @@
|
|
|
24
24
|
pragma solidity 0.8.9;
|
|
25
25
|
|
|
26
26
|
interface IPYieldContractFactory {
|
|
27
|
-
|
|
27
|
+
event CreateYieldContract(address indexed SCY, address PT, address YT, uint256 expiry);
|
|
28
|
+
|
|
29
|
+
event SetExpiryDivisor(uint256 newExpiryDivisor);
|
|
30
|
+
|
|
31
|
+
event SetInterestFeeRate(uint256 newInterestFeeRate);
|
|
32
|
+
|
|
33
|
+
event SetTreasury(address indexed treasury);
|
|
34
|
+
|
|
35
|
+
function getPT(address SCY, uint256 expiry) external view returns (address);
|
|
28
36
|
|
|
29
37
|
function getYT(address SCY, uint256 expiry) external view returns (address);
|
|
30
38
|
|
|
@@ -34,7 +42,7 @@ interface IPYieldContractFactory {
|
|
|
34
42
|
|
|
35
43
|
function treasury() external view returns (address);
|
|
36
44
|
|
|
37
|
-
function
|
|
45
|
+
function isPT(address) external view returns (bool);
|
|
38
46
|
|
|
39
47
|
function isYT(address) external view returns (bool);
|
|
40
48
|
}
|
|
@@ -4,11 +4,20 @@ import "./IPBaseToken.sol";
|
|
|
4
4
|
import "../SuperComposableYield/implementations/IRewardManager.sol";
|
|
5
5
|
|
|
6
6
|
interface IPYieldToken is IPBaseToken, IRewardManager {
|
|
7
|
-
|
|
7
|
+
event RedeemReward(address indexed user, uint256[] amountRewardsOut);
|
|
8
|
+
event RedeemInterest(address indexed user, uint256 interestOut);
|
|
8
9
|
|
|
9
|
-
|
|
10
|
+
event WithdrawFeeToTreasury(uint256[] amountRewardsOut, uint256 scyOut);
|
|
10
11
|
|
|
11
|
-
|
|
12
|
+
function mintPY(address receiverPT, address receiverYT) external returns (uint256 amountPYOut);
|
|
13
|
+
|
|
14
|
+
function redeemPY(address receiver) external returns (uint256 amountScyOut);
|
|
15
|
+
|
|
16
|
+
// minimum of PT & YT balance
|
|
17
|
+
|
|
18
|
+
function redeemDueInterestAndRewards(address user)
|
|
19
|
+
external
|
|
20
|
+
returns (uint256 interestOut, uint256[] memory rewardsOut);
|
|
12
21
|
|
|
13
22
|
function redeemDueInterest(address user) external returns (uint256 interestOut);
|
|
14
23
|
|
|
@@ -25,11 +34,11 @@ interface IPYieldToken is IPBaseToken, IRewardManager {
|
|
|
25
34
|
view
|
|
26
35
|
returns (uint256 lastScyIndex, uint256 dueInterest);
|
|
27
36
|
|
|
28
|
-
function
|
|
37
|
+
function getScyIndex() external returns (uint256 currentIndex, uint256 lastIndexBeforeExpiry);
|
|
29
38
|
|
|
30
39
|
function withdrawFeeToTreasury() external;
|
|
31
40
|
|
|
32
41
|
function SCY() external view returns (address);
|
|
33
42
|
|
|
34
|
-
function
|
|
43
|
+
function PT() external view returns (address);
|
|
35
44
|
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
2
|
+
pragma solidity 0.8.9;
|
|
3
|
+
|
|
4
|
+
interface IWstETH {
|
|
5
|
+
function wrap(uint256 _stETHAmount) external returns (uint256);
|
|
6
|
+
|
|
7
|
+
function unwrap(uint256 _wstETHAmount) external returns (uint256);
|
|
8
|
+
|
|
9
|
+
function stEthPerToken() external view returns (uint256);
|
|
10
|
+
}
|
|
@@ -98,7 +98,7 @@ library JoeLibrary {
|
|
|
98
98
|
require(path.length >= 2, "JoeLibrary: INVALID_PATH");
|
|
99
99
|
amounts = new uint256[](path.length);
|
|
100
100
|
amounts[0] = amountIn;
|
|
101
|
-
for (uint256 i; i < path.length - 1; i++) {
|
|
101
|
+
for (uint256 i = 0; i < path.length - 1; i++) {
|
|
102
102
|
(uint256 reserveIn, uint256 reserveOut) = getReserves(factory, path[i], path[i + 1]);
|
|
103
103
|
amounts[i + 1] = getAmountOut(amounts[i], reserveIn, reserveOut);
|
|
104
104
|
}
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
// COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
|
13
13
|
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
14
14
|
|
|
15
|
-
pragma solidity
|
|
15
|
+
pragma solidity 0.8.9;
|
|
16
16
|
|
|
17
17
|
/* solhint-disable */
|
|
18
18
|
|