diff --git a/src/wsteth-exchange-rate-adapter/WstEthEthExchangeRateChainlinkAdapter.sol b/src/wsteth-exchange-rate-adapter/WstEthEthExchangeRateChainlinkAdapter.sol index 883e618..f9bd79a 100644 --- a/src/wsteth-exchange-rate-adapter/WstEthEthExchangeRateChainlinkAdapter.sol +++ b/src/wsteth-exchange-rate-adapter/WstEthEthExchangeRateChainlinkAdapter.sol @@ -4,8 +4,6 @@ pragma solidity 0.8.21; import {IStEth} from "./interfaces/IStEth.sol"; import {MinimalAggregatorV3Interface} from "./interfaces/MinimalAggregatorV3Interface.sol"; -import {ErrorsLib} from "./libraries/ErrorsLib.sol"; - /// @title WstEthEthExchangeRateChainlinkAdapter /// @author Morpho Labs /// @custom:contact security@morpho.org @@ -15,14 +13,7 @@ contract WstEthEthExchangeRateChainlinkAdapter is 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"; - - IStEth public immutable ST_ETH; - - constructor(address stEth) { - require(stEth != address(0), ErrorsLib.ZERO_ADDRESS); - - ST_ETH = IStEth(stEth); - } + IStEth public constant ST_ETH = IStEth(0xae7ab96520DE3A18E5e111B5EaAb095312D7fE84); /// @dev Silently overflows if `getPooledEthByShares`'s return value is greater than `type(int256).max`. function latestRoundData() external view returns (uint80, int256, uint256, uint256, uint80) { diff --git a/src/wsteth-exchange-rate-adapter/libraries/ErrorsLib.sol b/src/wsteth-exchange-rate-adapter/libraries/ErrorsLib.sol deleted file mode 100644 index dcb7ab1..0000000 --- a/src/wsteth-exchange-rate-adapter/libraries/ErrorsLib.sol +++ /dev/null @@ -1,11 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0-or-later -pragma solidity ^0.8.0; - -/// @title ErrorsLib -/// @author Morpho Labs -/// @custom:contact security@morpho.org -/// @notice Library exposing error messages. -library ErrorsLib { - /// @notice Thrown when the zero address is passed as argument. - string constant ZERO_ADDRESS = "zero address"; -} diff --git a/test/WstEthEthExchangeRateChainlinkAdapterTest.sol b/test/WstEthEthExchangeRateChainlinkAdapterTest.sol index 9a90420..ec01d42 100644 --- a/test/WstEthEthExchangeRateChainlinkAdapterTest.sol +++ b/test/WstEthEthExchangeRateChainlinkAdapterTest.sol @@ -14,7 +14,7 @@ contract WstEthEthExchangeRateChainlinkAdapterTest is Test { function setUp() public { vm.createSelectFork(vm.envString("ETH_RPC_URL")); - oracle = new WstEthEthExchangeRateChainlinkAdapter(address(ST_ETH)); + oracle = new WstEthEthExchangeRateChainlinkAdapter(); chainlinkOracle = new ChainlinkOracle( vaultZero, AggregatorV3Interface(address(oracle)), feedZero, feedZero, feedZero, 1, 18, 18 ); @@ -28,11 +28,6 @@ contract WstEthEthExchangeRateChainlinkAdapterTest is Test { assertEq(oracle.description(), "wstETH/ETH exchange rate"); } - function testDeployZeroAddress() public { - vm.expectRevert(bytes(ErrorsLib.ZERO_ADDRESS)); - new WstEthEthExchangeRateChainlinkAdapter(address(0)); - } - function testLatestRoundData() public { (uint80 roundId, int256 answer, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound) = oracle.latestRoundData();