IWstETH

Git Source

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

NameTypeDescription
_stETHAmountuint256The amount of stETH to wrap in exchange for wstETH

Returns

NameTypeDescription
<none>uint256Amount 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

NameTypeDescription
_wstETHAmountuint256The amount of wstETH to unwrap in exchange for stETH

Returns

NameTypeDescription
<none>uint256The 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

NameTypeDescription
_stETHAmountuint256The amount of stETH

Returns

NameTypeDescription
<none>uint256The 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

NameTypeDescription
_wstETHAmountuint256The amount of wstETH

Returns

NameTypeDescription
<none>uint256The 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

NameTypeDescription
<none>uint256The amount of stETH for 1 wstETH

tokensPerStEth

Get the amount of wstETH for a one stETH

function tokensPerStEth() external view returns (uint256);

Returns

NameTypeDescription
<none>uint256The amount of wstETH for a 1 stETH

stETH

Get the address of stETH

function stETH() external view returns (address);

Returns

NameTypeDescription
<none>addressThe address of stETH