-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #83 from morpho-org/refactor/various-improvements
Various improvements to wstETH adapter
- Loading branch information
Showing
3 changed files
with
22 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,17 +4,24 @@ pragma solidity 0.8.21; | |
import {IStEth} from "./interfaces/IStEth.sol"; | ||
import {MinimalAggregatorV3Interface} from "./interfaces/MinimalAggregatorV3Interface.sol"; | ||
|
||
/// @title WstEthEthExchangeRateChainlinkAdapter | ||
/// @title WstEthStEthExchangeRateChainlinkAdapter | ||
/// @author Morpho Labs | ||
/// @custom:contact [email protected] | ||
/// @notice wstETH/ETH exchange rate price feed. | ||
/// @dev This contract should only be used as price feed for `ChainlinkOracle`. | ||
contract WstEthEthExchangeRateChainlinkAdapter is MinimalAggregatorV3Interface { | ||
/// @notice wstETH/stETH exchange rate price feed. | ||
/// @dev This contract should only be deployed on Ethereum and used as a price feed for Morpho oracles. | ||
contract WstEthStEthExchangeRateChainlinkAdapter is MinimalAggregatorV3Interface { | ||
/// @inheritdoc MinimalAggregatorV3Interface | ||
// @dev The calculated price has 18 decimals precision, whatever the value of `decimals`. | ||
uint8 public constant decimals = 18; | ||
string public constant description = "wstETH/ETH exchange rate"; | ||
|
||
/// @notice The description of the price feed. | ||
string public constant description = "wstETH/stETH exchange rate"; | ||
|
||
/// @notice The address of stETH on Ethereum. | ||
IStEth public constant ST_ETH = IStEth(0xae7ab96520DE3A18E5e111B5EaAb095312D7fE84); | ||
|
||
/// @inheritdoc MinimalAggregatorV3Interface | ||
/// @dev Returns zero for roundId, startedAt, updatedAt and answeredInRound. | ||
/// @dev Silently overflows if `getPooledEthByShares`'s return value is greater than `type(int256).max`. | ||
function latestRoundData() external view returns (uint80, int256, uint256, uint256, uint80) { | ||
// It is assumed that `getPooledEthByShares` returns a price with 18 decimals precision. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters