|
2 | 2 | pragma solidity 0.8.30; |
3 | 3 |
|
4 | 4 | interface IStrategy { |
5 | | - event StrategySupplied(address indexed user, uint256 stv, uint256 stethShares, uint256 stethAmount, bytes data); |
6 | | - event StrategyExitRequested(address indexed user, bytes32 requestId, uint256 stethSharesToBurn, bytes data); |
7 | | - event StrategyExitFinalized(address indexed user, bytes32 requestId, uint256 stethShares); |
| 5 | + event StrategySupplied( |
| 6 | + address indexed user, address indexed referral, uint256 ethAmount, uint256 stv, uint256 wstethToMint, bytes data |
| 7 | + ); |
| 8 | + event StrategyExitRequested(address indexed user, bytes32 requestId, uint256 wsteth, bytes data); |
| 9 | + event StrategyExitFinalized(address indexed user, bytes32 requestId, uint256 wsteth); |
8 | 10 |
|
| 11 | + /** |
| 12 | + * @notice Initializes the strategy |
| 13 | + * @param _admin The admin address |
| 14 | + */ |
| 15 | + function initialize(address _admin) external; |
| 16 | + |
| 17 | + /** |
| 18 | + * @notice Returns the address of the pool |
| 19 | + * @return The address of the pool |
| 20 | + */ |
9 | 21 | function POOL() external view returns (address); |
10 | 22 |
|
11 | | - /// @notice Supplies stETH to the strategy |
12 | | - function supply(address _referral, bytes calldata _params) external payable; |
| 23 | + /** |
| 24 | + * @notice Supplies wstETH to the strategy |
| 25 | + * @param _referral The referral address |
| 26 | + * @param _wstethToMint The amount of wstETH to mint |
| 27 | + * @param _params The parameters for the supply |
| 28 | + * @return stv The minted amount of stv |
| 29 | + */ |
| 30 | + function supply(address _referral, uint256 _wstethToMint, bytes calldata _params) |
| 31 | + external |
| 32 | + payable |
| 33 | + returns (uint256 stv); |
| 34 | + |
| 35 | + /** |
| 36 | + * @notice Returns the remaining minting capacity shares of a user |
| 37 | + * @param _user The user to get the remaining minting capacity shares for |
| 38 | + * @param _ethToFund The amount of ETH to fund |
| 39 | + * @return stethShares The remaining minting capacity shares |
| 40 | + */ |
| 41 | + function remainingMintingCapacitySharesOf(address _user, uint256 _ethToFund) |
| 42 | + external |
| 43 | + view |
| 44 | + returns (uint256 stethShares); |
13 | 45 |
|
14 | | - /// @notice Requests a withdrawal from the Withdrawal Queue |
15 | | - function requestWithdrawal( |
16 | | - uint256 _stvToWithdraw, |
17 | | - uint256 _stethSharesToBurn, |
18 | | - uint256 _stethSharesToRebalance, |
19 | | - address _receiver |
20 | | - ) external returns (uint256 requestId); |
| 46 | + /** |
| 47 | + * @notice Requests exit from the strategy |
| 48 | + * @param _wsteth The amount of wstETH to request exit for |
| 49 | + * @param _params The parameters for the exit |
| 50 | + * @return requestId The Strategy request id |
| 51 | + */ |
| 52 | + function requestExitByWsteth(uint256 _wsteth, bytes calldata _params) external returns (bytes32 requestId); |
21 | 53 |
|
22 | | - /// @notice Requests a withdrawal from the strategy |
23 | | - function requestExitByStethShares(uint256 stethSharesToBurn, bytes calldata params) |
| 54 | + /** |
| 55 | + * @notice Finalizes exit from the strategy |
| 56 | + * @param requestId The Strategy request id |
| 57 | + */ |
| 58 | + function finalizeRequestExit(bytes32 requestId) external; |
| 59 | + |
| 60 | + /** |
| 61 | + * @notice Burns wstETH to reduce the user's minted stETH shares obligation |
| 62 | + * @param _wstethToBurn The amount of wstETH to burn |
| 63 | + */ |
| 64 | + function burnWsteth(uint256 _wstethToBurn) external; |
| 65 | + |
| 66 | + /** |
| 67 | + * @notice Requests a withdrawal from the Withdrawal Queue |
| 68 | + * @param _recipient The address to receive the withdrawal |
| 69 | + * @param _stvToWithdraw The amount of stv to withdraw |
| 70 | + * @param _stethSharesToRebalance The amount of stETH shares to rebalance |
| 71 | + * @return requestId The Withdrawal Queue request ID |
| 72 | + */ |
| 73 | + function requestWithdrawalFromPool(address _recipient, uint256 _stvToWithdraw, uint256 _stethSharesToRebalance) |
24 | 74 | external |
25 | | - returns (bytes32 requestId); |
| 75 | + returns (uint256 requestId); |
| 76 | + |
| 77 | + /** |
| 78 | + * @notice Returns the amount of wstETH of a user |
| 79 | + * @param _user The user to get the wstETH for |
| 80 | + * @return wsteth The amount of wstETH |
| 81 | + */ |
| 82 | + function wstethOf(address _user) external view returns (uint256); |
26 | 83 |
|
27 | | - /// @notice Finalizes a withdrawal from the strategy |
28 | | - function finalizeRequestExit(address receiver, bytes32 requestId) external; |
| 84 | + /** |
| 85 | + * @notice Returns the amount of stv of a user |
| 86 | + * @param _user The user to get the stv for |
| 87 | + * @return stv The amount of stv |
| 88 | + */ |
| 89 | + function stvOf(address _user) external view returns (uint256); |
29 | 90 |
|
30 | | - /// @notice Recovers ERC20 tokens from the strategy |
31 | | - function recoverERC20(address _token, address _recipient, uint256 _amount) external; |
| 91 | + /** |
| 92 | + * @notice Returns the amount of minted stETH shares of a user |
| 93 | + * @param _user The user to get the minted stETH shares for |
| 94 | + * @return mintedStethShares The amount of minted stETH shares |
| 95 | + */ |
| 96 | + function mintedStethSharesOf(address _user) external view returns (uint256 mintedStethShares); |
32 | 97 | } |
0 commit comments