IWstETH
Inherits: IERC20Metadata, IERC20Permit
Functions
wrap
Exchanges stETH to wstETH
*Requirements:
_stETHAmount
must be non-zero- msg.sender must approve at least
_stETHAmount
stETH to this contract - msg.sender must have at least
_stETHAmount
of stETH User should first approve_stETHAmount
to the wstETH contract*
function wrap(uint256 _stETHAmount) external returns (uint256);
Parameters
Name | Type | Description |
---|---|---|
_stETHAmount | uint256 | The amount of stETH to wrap in exchange for wstETH |
Returns
Name | Type | Description |
---|---|---|
<none> | uint256 | Amount of wstETH user receives after wrap |
unwrap
Exchanges wstETH to stETH
*Requirements:
_wstETHAmount
must be non-zero- msg.sender must have at least
_wstETHAmount
wstETH*
function unwrap(uint256 _wstETHAmount) external returns (uint256);
Parameters
Name | Type | Description |
---|---|---|
_wstETHAmount | uint256 | The amount of wstETH to unwrap in exchange for stETH |
Returns
Name | Type | Description |
---|---|---|
<none> | uint256 | The amount of stETH user receives after unwrap |
getWstETHByStETH
Get the amount of wstETH for a given amount of stETH
function getWstETHByStETH(uint256 _stETHAmount) external view returns (uint256);
Parameters
Name | Type | Description |
---|---|---|
_stETHAmount | uint256 | The amount of stETH |
Returns
Name | Type | Description |
---|---|---|
<none> | uint256 | The amount of wstETH for a given stETH amount |
getStETHByWstETH
Get the amount of stETH for a given amount of wstETH
function getStETHByWstETH(uint256 _wstETHAmount) external view returns (uint256);
Parameters
Name | Type | Description |
---|---|---|
_wstETHAmount | uint256 | The amount of wstETH |
Returns
Name | Type | Description |
---|---|---|
<none> | uint256 | The amount of stETH for a given wstETH amount |
stEthPerToken
Get the amount of stETH for a one wstETH
function stEthPerToken() external view returns (uint256);
Returns
Name | Type | Description |
---|---|---|
<none> | uint256 | The amount of stETH for 1 wstETH |
tokensPerStEth
Get the amount of wstETH for a one stETH
function tokensPerStEth() external view returns (uint256);
Returns
Name | Type | Description |
---|---|---|
<none> | uint256 | The amount of wstETH for a 1 stETH |
stETH
Get the address of stETH
function stETH() external view returns (address);
Returns
Name | Type | Description |
---|---|---|
<none> | address | The address of stETH |