Skip to content

WstETHOracleImpl ​

Git Source

Inherits: OracleError

This contract is used to get the exchange rate between wstETH and stETH

State Variables ​

_WSTETH_PRICE_SCALER_MULTIPLIER ​

constant value for price scaling to reduce gas usage

solidity
uint256 internal immutable _WSTETH_PRICE_SCALER_MULTIPLIER;

_WSTETH ​

WSTETH contract, e.g. on mainnet 0x7f39c581f595b53c5cb19bd0b3f8da6c935e2ca0

solidity
IWstETH internal immutable _WSTETH;

Functions ​

constructor ​

constructor sets the wstETH wstETH_ token address.

solidity
constructor(IWstETH wstETH_);

_getWstETHExchangeRate ​

Get the exchange rate from wstETH contract

solidity
function _getWstETHExchangeRate() internal view returns (uint256 rate_);

Returns

NameTypeDescription
rate_uint256The exchange rate in OracleUtils.RATE_OUTPUT_DECIMALS

wstETHOracleData ​

returns all wWtETH oracle related data as utility for easy off-chain use / block explorer in a single view method

solidity
function wstETHOracleData() public view returns (uint256 wstETHExchangeRate_, IWstETH wstETH_);