Skip to content

Commit a9e37df

Browse files
committed
refactor: remove useless oracle
1 parent 801b8bd commit a9e37df

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

src/adapters/WstEthOracle.sol

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,11 @@ import {AggregatorV3Interface} from "../interfaces/AggregatorV3Interface.sol";
88
/// @author Morpho Labs
99
/// @custom:contact [email protected]
1010
/// @notice wstETH/ETH exchange rate price feed.
11+
/// @dev This contract should only be used as price feed for `ChainlinkOracle`.
1112
contract WstEthOracle is AggregatorV3Interface {
12-
uint256 public constant version = 1;
13-
uint8 public constant DECIMALS = uint8(18);
13+
uint8 public constant decimals = uint8(18);
1414
string public constant description = "wstETH/ETH exchange rate price";
15+
uint256 public constant version = 1;
1516

1617
IStETH public immutable ST_ETH;
1718

@@ -20,18 +21,13 @@ contract WstEthOracle is AggregatorV3Interface {
2021
ST_ETH = IStETH(stEth);
2122
}
2223

23-
function decimals() external pure returns (uint8) {
24-
return DECIMALS;
25-
}
26-
2724
function getRoundData(uint80) external view returns (uint80, int256, uint256, uint256, uint80) {
2825
return latestRoundData();
2926
}
3027

3128
function latestRoundData() public view returns (uint80, int256, uint256, uint256, uint80) {
32-
uint256 ethByShares = ST_ETH.getPooledEthByShares(10 ** DECIMALS);
29+
uint256 ethByShares = ST_ETH.getPooledEthByShares(10 ** decimals());
3330
require(ethByShares < type(uint256).max, "WstEthOracle: OVERFLOW");
34-
int256 answer = int256(ethByShares);
35-
return (0, answer, 0, 0, 0);
31+
return (0, int256(ethByShares), 0, 0, 0);
3632
}
3733
}

0 commit comments

Comments
 (0)