IWstETH
IWstETH
getWstETHByStETH
function getWstETHByStETH(uint256 _stETHAmount) external view returns (uint256)
Get amount of wstETH for a given amount of stETH
Parameters
| Name | Type | Description |
|---|---|---|
| _stETHAmount | uint256 | amount of stETH |
Return Values
| Name | Type | Description |
|---|---|---|
| [0] | uint256 | Amount of wstETH for a given stETH amount |
getStETHByWstETH
function getStETHByWstETH(uint256 _wstETHAmount) external view returns (uint256)
Get amount of stETH for a given amount of wstETH
Parameters
| Name | Type | Description |
|---|---|---|
| _wstETHAmount | uint256 | amount of wstETH |
Return Values
| Name | Type | Description |
|---|---|---|
| [0] | uint256 | Amount of stETH for a given wstETH amount |
stEthPerToken
function stEthPerToken() external view returns (uint256)
Get amount of stETH for a one wstETH
Return Values
| Name | Type | Description |
|---|---|---|
| [0] | uint256 | Amount of stETH for 1 wstETH |
tokensPerStEth
function tokensPerStEth() external view returns (uint256)
Get amount of wstETH for a one stETH
Return Values
| Name | Type | Description |
|---|---|---|
| [0] | uint256 | Amount of wstETH for a 1 stETH |
wrap
function wrap(uint256 _stETHAmount) external returns (uint256)
Exchanges stETH to wstETH
Requirements:
_stETHAmountmust be non-zero- msg.sender must approve at least
_stETHAmountstETH to this contract. - msg.sender must have at least
_stETHAmountof stETH. User should first approve _stETHAmount to the WstETH contract
Parameters
| Name | Type | Description |
|---|---|---|
| _stETHAmount | uint256 | amount of stETH to wrap in exchange for wstETH |
Return Values
| Name | Type | Description |
|---|---|---|
| [0] | uint256 | Amount of wstETH user receives after wrap |
unwrap
function unwrap(uint256 _wstETHAmount) external returns (uint256)
Exchanges wstETH to stETH
Requirements:
_wstETHAmountmust be non-zero- msg.sender must have at least
_wstETHAmountwstETH.
Parameters
| Name | Type | Description |
|---|---|---|
| _wstETHAmount | uint256 | amount of wstETH to uwrap in exchange for stETH |
Return Values
| Name | Type | Description |
|---|---|---|
| [0] | uint256 | Amount of stETH user receives after unwrap |