Skip to content

Commit 03b66f6

Browse files
authored
Add renzoOracle() getter (#857)
* return immutable value * add renzoOracle getter * git publish * fix nits
1 parent f0bb75c commit 03b66f6

File tree

4 files changed

+19
-5
lines changed

4 files changed

+19
-5
lines changed

contracts/src/instances/ezeth/EzETHTarget0.sol

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { SafeERC20 } from "openzeppelin/token/ERC20/utils/SafeERC20.sol";
66
import { HyperdriveTarget0 } from "../../external/HyperdriveTarget0.sol";
77
import { IHyperdrive } from "../../interfaces/IHyperdrive.sol";
88
import { IERC20 } from "../../interfaces/IERC20.sol";
9-
import { IRestakeManager } from "../../interfaces/IRenzo.sol";
9+
import { IRestakeManager, IRenzoOracle } from "../../interfaces/IRenzo.sol";
1010
import { EzETHBase } from "./EzETHBase.sol";
1111

1212
/// @author DELV
@@ -31,15 +31,21 @@ contract EzETHTarget0 is HyperdriveTarget0, EzETHBase {
3131
/// Extras ///
3232

3333
/// @notice Returns the Renzo contract.
34-
/// @return _restakeManager The Renzo contract.
34+
/// @return The Renzo contract.
3535
function renzo() external view returns (IRestakeManager) {
3636
_revert(abi.encode(_restakeManager));
3737
}
3838

3939
/// @notice Gets the ezETH token contract.
4040
/// @return The ezETH token contract.
4141
function ezETH() external view returns (IERC20) {
42-
_revert(abi.encode(_restakeManager.ezETH()));
42+
_revert(abi.encode(_ezETH));
43+
}
44+
45+
/// @notice Gets the RenzoOracle contract.
46+
/// @return The RenzoOracle contract.
47+
function renzoOracle() external view returns (IRenzoOracle) {
48+
_revert(abi.encode(_renzoOracle));
4349
}
4450

4551
/// @notice Returns the MultiToken's decimals.

contracts/src/instances/steth/StETHTarget0.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ contract StETHTarget0 is HyperdriveTarget0, StETHBase {
3131
/// Getters ///
3232

3333
/// @notice Returns the Lido contract.
34-
/// @return lido The Lido contract.
34+
/// @return The Lido contract.
3535
function lido() external view returns (ILido) {
3636
_revert(abi.encode(_lido));
3737
}

contracts/src/interfaces/IEzETHHyperdriveRead.sol

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
pragma solidity 0.8.20;
33

44
import { IHyperdriveRead } from "./IHyperdriveRead.sol";
5-
import { IRestakeManager } from "./IRenzo.sol";
5+
import { IRestakeManager, IRenzoOracle } from "./IRenzo.sol";
66
import { IERC20 } from "contracts/src/interfaces/IERC20.sol";
77

88
interface IEzETHHyperdriveRead is IHyperdriveRead {
@@ -13,4 +13,8 @@ interface IEzETHHyperdriveRead is IHyperdriveRead {
1313
/// @notice Gets the ezETH token contract.
1414
/// @return The ezETH token contract.
1515
function ezETH() external view returns (IERC20);
16+
17+
/// @notice Gets the RenzoOracle contract.
18+
/// @return The RenzoOracle contract.
19+
function renzoOracle() external view returns (IRenzoOracle);
1620
}

test/instances/ezETH/EzETHHyperdrive.t.sol

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,10 @@ contract EzETHHyperdriveTest is HyperdriveTest {
248248
address(IEzETHHyperdriveRead(address(hyperdrive)).ezETH()),
249249
address(EZETH)
250250
);
251+
assertEq(
252+
address(IEzETHHyperdriveRead(address(hyperdrive)).renzoOracle()),
253+
address(RENZO_ORACLE)
254+
);
251255
}
252256

253257
/// Deploy and Initialize ///

0 commit comments

Comments
 (0)