Skip to main content

IWstETH

IWstETH

getWstETHByStETH

function getWstETHByStETH(uint256 _stETHAmount) external view returns (uint256)

Get amount of wstETH for a given amount of stETH

Parameters

NameTypeDescription
_stETHAmountuint256amount of stETH

Return Values

NameTypeDescription
[0]uint256Amount 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

NameTypeDescription
_wstETHAmountuint256amount of wstETH

Return Values

NameTypeDescription
[0]uint256Amount of stETH for a given wstETH amount

stEthPerToken

function stEthPerToken() external view returns (uint256)

Get amount of stETH for a one wstETH

Return Values

NameTypeDescription
[0]uint256Amount of stETH for 1 wstETH

tokensPerStEth

function tokensPerStEth() external view returns (uint256)

Get amount of wstETH for a one stETH

Return Values

NameTypeDescription
[0]uint256Amount of wstETH for a 1 stETH

wrap

function wrap(uint256 _stETHAmount) external returns (uint256)

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

Parameters

NameTypeDescription
_stETHAmountuint256amount of stETH to wrap in exchange for wstETH

Return Values

NameTypeDescription
[0]uint256Amount of wstETH user receives after wrap

unwrap

function unwrap(uint256 _wstETHAmount) external returns (uint256)

Exchanges wstETH to stETH

Requirements:

  • _wstETHAmount must be non-zero
  • msg.sender must have at least _wstETHAmount wstETH.

Parameters

NameTypeDescription
_wstETHAmountuint256amount of wstETH to uwrap in exchange for stETH

Return Values

NameTypeDescription
[0]uint256Amount of stETH user receives after unwrap