-
Notifications
You must be signed in to change notification settings - Fork 9
/
ProviderInterfaces.sol
85 lines (58 loc) · 2.73 KB
/
ProviderInterfaces.sol
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
// SPDX-License-Identifier: MIT
pragma solidity 0.8.21;
interface IStEth {
function submit(address _referral) external payable returns (uint256);
function getTotalPooledEther() external view returns (uint256);
function getTotalShares() external view returns (uint256);
function getSharesByPooledEth(uint256 _ethAmount) external view returns (uint256);
function getCurrentStakeLimit() external view returns (uint256);
function approve(address spender, uint256 value) external returns (bool);
}
interface IWstEth {
function wrap(uint256 _stETHAmount) external returns (uint256);
/**
* @notice Exchanges wstETH to stETH
* @param _wstETHAmount amount of wstETH to uwrap in exchange for stETH
* @dev Requirements:
* - `_wstETHAmount` must be non-zero
* - msg.sender must have at least `_wstETHAmount` wstETH.
* @return Amount of stETH user receives after unwrap
*/
function unwrap(uint256 _wstETHAmount) external returns (uint256);
function getStETHByWstETH(uint256 _ETHAmount) external view returns (uint256);
function getWstETHByStETH(uint256 _stETHAmount) external view returns (uint256);
function stETH() external view returns (address);
function stEthPerToken() external view returns (uint256);
}
interface IStaderStakePoolsManager {
function deposit(address _receiver) external payable returns (uint256);
function previewDeposit(uint256 _assets) external view returns (uint256);
function previewWithdraw(uint256 _shares) external view returns (uint256);
function getExchangeRate() external view returns (uint256);
function staderConfig() external view returns (IStaderConfig);
function totalAssets() external view returns (uint256);
}
interface IStaderConfig {
function getMinDepositAmount() external view returns (uint256);
function getMaxDepositAmount() external view returns (uint256);
function getStaderOracle() external view returns (address);
}
/// @title ExchangeRate
/// @notice This struct holds data related to the exchange rate between ETH and ETHx.
struct ExchangeRate {
/// @notice The block number when the exchange rate was last updated.
uint256 reportingBlockNumber;
/// @notice The total balance of Ether (ETH) in the system.
uint256 totalETHBalance;
/// @notice The total supply of the liquid staking token (ETHx) in the system.
uint256 totalETHXSupply;
}
interface IStaderOracle {
function getExchangeRate() external view returns (ExchangeRate memory);
}
interface ISwEth {
function deposit() external payable;
function swETHToETHRate() external view returns (uint256);
function ethToSwETHRate() external view returns (uint256);
function getRate() external view returns (uint256);
}