// SPDX-FileCopyrightText: 2021 Lido // SPDX-License-Identifier: GPL-3.0 pragma solidity ^0.8.10; import {IERC20Metadata} from "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol"; interface IwstETHGetters is IERC20Metadata { function stETH() external view returns (address); /** * @notice Get amount of wstETH for a given amount of stETH * @param _stETHAmount amount of stETH * @return Amount of wstETH for a given stETH amount */ function getWstETHByStETH(uint256 _stETHAmount) external view returns (uint256); /** * @notice Get amount of stETH for a given amount of wstETH * @param _wstETHAmount amount of wstETH * @return Amount of stETH for a given wstETH amount */ function getStETHByWstETH(uint256 _wstETHAmount) external view returns (uint256); /** * @notice Get amount of stETH for a one wstETH * @return Amount of stETH for 1 wstETH */ function stEthPerToken() external view returns (uint256); /** * @notice Get amount of wstETH for a one stETH * @return Amount of wstETH for a 1 stETH */ function tokensPerStEth() external view returns (uint256); } interface IwstETH is IwstETHGetters { /** * @notice Exchanges stETH to wstETH * @param _stETHAmount amount of stETH to wrap in exchange for wstETH * @dev 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 * @return Amount of wstETH user receives after wrap */ function wrap(uint256 _stETHAmount) external returns (uint256); /** * @notice Exchanges wstETH to stETH * @param _wstETHAmount amount of wstETH to uwrap in exchange for stETH * @dev Requirements: * - `_wstETHAmount` must be non-zero * - msg.sender must have at least `_wstETHAmount` wstETH. * @return Amount of stETH user receives after unwrap */ function unwrap(uint256 _wstETHAmount) external returns (uint256); }