Skip to content

Commit 5d2a173

Browse files
committed
refactor: clarify exchange rate
1 parent c46887b commit 5d2a173

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

src/wsteth-exchange-rate-adapter/WstEthEthExchangeRateChainlinkAdapter.sol renamed to src/wsteth-exchange-rate-adapter/WstEthStEthExchangeRateChainlinkAdapter.sol

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@ pragma solidity 0.8.21;
44
import {IStEth} from "./interfaces/IStEth.sol";
55
import {MinimalAggregatorV3Interface} from "./interfaces/MinimalAggregatorV3Interface.sol";
66

7-
/// @title WstEthEthExchangeRateChainlinkAdapter
7+
/// @title WstEthStEthExchangeRateChainlinkAdapter
88
/// @author Morpho Labs
99
/// @custom:contact security@morpho.org
10-
/// @notice wstETH/ETH exchange rate price feed.
10+
/// @notice wstETH/stETH exchange rate price feed.
1111
/// @dev This contract should only be used as price feed for `ChainlinkOracle`.
12-
contract WstEthEthExchangeRateChainlinkAdapter is MinimalAggregatorV3Interface {
12+
contract WstEthStEthExchangeRateChainlinkAdapter is MinimalAggregatorV3Interface {
1313
uint8 public constant decimals = 18;
14-
string public constant description = "wstETH/ETH exchange rate";
14+
string public constant description = "wstETH/stETH exchange rate";
1515
IStEth public constant ST_ETH = IStEth(0xae7ab96520DE3A18E5e111B5EaAb095312D7fE84);
1616

1717
/// @dev Silently overflows if `getPooledEthByShares`'s return value is greater than `type(int256).max`.

test/WstEthEthExchangeRateChainlinkAdapterTest.sol renamed to test/WstEthStEthExchangeRateChainlinkAdapterTest.sol

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,17 @@ pragma solidity ^0.8.0;
44
import "./helpers/Constants.sol";
55
import "../lib/forge-std/src/Test.sol";
66
import {ChainlinkOracle} from "../src/morpho-chainlink-v1/ChainlinkOracle.sol";
7-
import "../src/wsteth-exchange-rate-adapter/WstEthEthExchangeRateChainlinkAdapter.sol";
7+
import "../src/wsteth-exchange-rate-adapter/WstEthStEthExchangeRateChainlinkAdapter.sol";
88

9-
contract WstEthEthExchangeRateChainlinkAdapterTest is Test {
9+
contract WstEthStEthExchangeRateChainlinkAdapterTest is Test {
1010
IStEth internal constant ST_ETH = IStEth(0xae7ab96520DE3A18E5e111B5EaAb095312D7fE84);
1111

12-
WstEthEthExchangeRateChainlinkAdapter internal oracle;
12+
WstEthStEthExchangeRateChainlinkAdapter internal oracle;
1313
ChainlinkOracle internal chainlinkOracle;
1414

1515
function setUp() public {
1616
vm.createSelectFork(vm.envString("ETH_RPC_URL"));
17-
oracle = new WstEthEthExchangeRateChainlinkAdapter();
17+
oracle = new WstEthStEthExchangeRateChainlinkAdapter();
1818
chainlinkOracle = new ChainlinkOracle(
1919
vaultZero, AggregatorV3Interface(address(oracle)), feedZero, feedZero, feedZero, 1, 18, 18
2020
);
@@ -25,7 +25,7 @@ contract WstEthEthExchangeRateChainlinkAdapterTest is Test {
2525
}
2626

2727
function testDescription() public {
28-
assertEq(oracle.description(), "wstETH/ETH exchange rate");
28+
assertEq(oracle.description(), "wstETH/stETH exchange rate");
2929
}
3030

3131
function testLatestRoundData() public {
@@ -44,7 +44,7 @@ contract WstEthEthExchangeRateChainlinkAdapterTest is Test {
4444
assertLe(uint256(answer), 1.5e18); // Max bounds of the exchange rate. Should work for a long enough time.
4545
}
4646

47-
function testOracleWstEthEthExchangeRate() public {
47+
function testOracleWstEthStEthExchangeRate() public {
4848
(, int256 expectedPrice,,,) = oracle.latestRoundData();
4949
assertEq(chainlinkOracle.price(), uint256(expectedPrice) * 10 ** (36 + 18 - 18 - 18));
5050
}

0 commit comments

Comments
 (0)