Skip to content

Commit 2a8e115

Browse files
committed
fmt
1 parent e8c7025 commit 2a8e115

3 files changed

Lines changed: 22 additions & 35 deletions

File tree

src/facets/strategies/EthenaStrategy.sol

Lines changed: 10 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -19,27 +19,22 @@ contract EthenaStrategyFacet {
1919
error EthenaCoinNotInPool(address tokenIn, address tokenOut);
2020
error EthenaZeroAddress();
2121

22-
2322
/*====events====*/
2423

25-
event EthenaSetConfig( address indexed usde, address indexed curvePool, address indexed stakedUSDEV2);
24+
event EthenaSetConfig(address indexed usde, address indexed curvePool, address indexed stakedUSDEV2);
2625

2726
// erc7201:vaultrouter.strategy.ethena
28-
bytes32 internal constant ETHENA_STORAGE_SLOT =
29-
//0x79d5a97e8f8d9829cf9573ba239138882c2da3a5eaaa986a771c2ca1596b9500;
30-
27+
bytes32 internal constant ETHENA_STORAGE_SLOT = 0x0000000000000000000000000000000000000000000000000000000000000000;
28+
3129
struct EthenaStorage {
3230
IERC20 usde;
3331
ICurvePool curvePool;
3432
IStakedUSDEV2 stakedUSDEV2;
3533
uint256 maxSlippageBps;
3634
uint256 cooldownDuration;
37-
38-
/*====only for offchain explicit routing ====*/
39-
35+
/*====only for offchain explicit routing ====*/
4036
//mapping (address => bool) allowedRouter;
4137
//mapping (address => bool) allowedSpender;
42-
4338
}
4439

4540
function _es() internal pure returns (EthenaStorage storage s) {
@@ -58,10 +53,7 @@ contract EthenaStrategyFacet {
5853
external
5954
{
6055
LibDiamond.enforceIsContractOwner();
61-
if (
62-
address(usde) == address(0) || address(curvePool) == address(0)
63-
|| address(stakedUSDEV2) == address(0)
64-
) {
56+
if (address(usde) == address(0) || address(curvePool) == address(0) || address(stakedUSDEV2) == address(0)) {
6557
revert EthenaUSDENotConfigured();
6658
}
6759
EthenaStorage storage s = _es();
@@ -80,8 +72,7 @@ contract EthenaStrategyFacet {
8072
function ethenaDeposit(uint256 amount) external {
8173
EthenaStorage storage s = _es();
8274
if (
83-
address(s.usde) == address(0) || address(s.curvePool) == address(0)
84-
|| address(s.stakedUSDEV2) == address(0)
75+
address(s.usde) == address(0) || address(s.curvePool) == address(0) || address(s.stakedUSDEV2) == address(0)
8576
) {
8677
revert EthenaUSDENotConfigured();
8778
}
@@ -110,18 +101,15 @@ contract EthenaStrategyFacet {
110101
return s.stakedUSDEV2.convertToAssets(shares) / 1e12; // USDe(18) -> USDC(6)
111102
}
112103

113-
function ethenaWithdraw () external {
114-
104+
function ethenaWithdraw() external {
105+
115106
//withdraw is gated on the core protocol side
116107
//going asynchronous has lots of variables included and is practically complex
117108

118-
}
109+
}
119110

120111
/*=== cooldown ===*/
121112

122-
123-
124-
125113
/*==== internal swap helper — Curve only, par-floor enforced by caller ====*/
126114

127115
/// @dev Executes tokenIn -> tokenOut on the configured Curve StableSwap pool.
@@ -184,6 +172,4 @@ contract EthenaStrategyFacet {
184172
}
185173
if (!foundIn || !foundOut) revert EthenaCoinNotInPool(tokenIn, tokenOut);
186174
}
187-
188-
189-
}
175+
}
Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,18 @@
11
//SPDX-License-Identifier: MIT
22

3-
43
pragma solidity ^0.8.24;
54

65
interface ICurvePool {
7-
86
function exchange(int128 i, int128 j, uint256 dx, uint256 min_dy, address receiver) external returns (uint256);
9-
function exchange_received(int128 i, int128 j, uint256 _dx, uint256 _min_dy, address _receiver) external returns (uint256);
7+
function exchange_received(
8+
int128 i,
9+
int128 j,
10+
uint256 _dx,
11+
uint256 _min_dy,
12+
address _receiver
13+
)
14+
external
15+
returns (uint256);
1016

1117
function get_dy(int128 i, int128 j, uint256 dx) external view returns (uint256);
1218
function get_dx(int128 i, int128 j, uint256 dy) external view returns (uint256);
@@ -16,8 +22,4 @@ interface ICurvePool {
1622
function balances(uint256 i) external view returns (uint256);
1723
function A() external view returns (uint256);
1824
function fee() external view returns (uint256);
19-
20-
21-
22-
23-
}
25+
}

src/interfaces/external/IStakedUSDEV2.sol

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
pragma solidity ^0.8.24;
44

55
interface IStakedUSDEV2 {
6-
function asset() external view returns (address); // == USDe
6+
function asset() external view returns (address); // == USDe
77
function deposit(uint256 assets, address receiver) external returns (uint256 shares);
88
function convertToAssets(uint256 shares) external view returns (uint256 assets);
99
function balanceOf(address account) external view returns (uint256);
@@ -18,5 +18,4 @@ interface IStakedUSDEV2 {
1818
function cooldownAssets(uint256 assets) external returns (uint256 shares);
1919
function unstake(address receiver) external;
2020
function cooldowns(address account) external view returns (uint104 cooldownEnd, uint152 underlyingAmount);
21-
22-
}
21+
}

0 commit comments

Comments
 (0)