Skip to content

Commit 9cc2150

Browse files
authored
Merge pull request #82 from morpho-org/refactor/hardcode-steth
Hardcode stETH address
2 parents ad5e168 + c46887b commit 9cc2150

File tree

3 files changed

+2
-27
lines changed

3 files changed

+2
-27
lines changed

src/wsteth-exchange-rate-adapter/WstEthEthExchangeRateChainlinkAdapter.sol

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

7-
import {ErrorsLib} from "./libraries/ErrorsLib.sol";
8-
97
/// @title WstEthEthExchangeRateChainlinkAdapter
108
/// @author Morpho Labs
119
/// @custom:contact security@morpho.org
@@ -15,14 +13,7 @@ contract WstEthEthExchangeRateChainlinkAdapter is MinimalAggregatorV3Interface {
1513
// @dev The calculated price has 18 decimals precision, whatever the value of `decimals`.
1614
uint8 public constant decimals = 18;
1715
string public constant description = "wstETH/ETH exchange rate";
18-
19-
IStEth public immutable ST_ETH;
20-
21-
constructor(address stEth) {
22-
require(stEth != address(0), ErrorsLib.ZERO_ADDRESS);
23-
24-
ST_ETH = IStEth(stEth);
25-
}
16+
IStEth public constant ST_ETH = IStEth(0xae7ab96520DE3A18E5e111B5EaAb095312D7fE84);
2617

2718
/// @dev Silently overflows if `getPooledEthByShares`'s return value is greater than `type(int256).max`.
2819
function latestRoundData() external view returns (uint80, int256, uint256, uint256, uint80) {

src/wsteth-exchange-rate-adapter/libraries/ErrorsLib.sol

Lines changed: 0 additions & 11 deletions
This file was deleted.

test/WstEthEthExchangeRateChainlinkAdapterTest.sol

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ contract WstEthEthExchangeRateChainlinkAdapterTest is Test {
1414

1515
function setUp() public {
1616
vm.createSelectFork(vm.envString("ETH_RPC_URL"));
17-
oracle = new WstEthEthExchangeRateChainlinkAdapter(address(ST_ETH));
17+
oracle = new WstEthEthExchangeRateChainlinkAdapter();
1818
chainlinkOracle = new ChainlinkOracle(
1919
vaultZero, AggregatorV3Interface(address(oracle)), feedZero, feedZero, feedZero, 1, 18, 18
2020
);
@@ -28,11 +28,6 @@ contract WstEthEthExchangeRateChainlinkAdapterTest is Test {
2828
assertEq(oracle.description(), "wstETH/ETH exchange rate");
2929
}
3030

31-
function testDeployZeroAddress() public {
32-
vm.expectRevert(bytes(ErrorsLib.ZERO_ADDRESS));
33-
new WstEthEthExchangeRateChainlinkAdapter(address(0));
34-
}
35-
3631
function testLatestRoundData() public {
3732
(uint80 roundId, int256 answer, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound) =
3833
oracle.latestRoundData();

0 commit comments

Comments
 (0)