diff --git a/contracts/src/instances/lseth/LsETHTarget0.sol b/contracts/src/instances/lseth/LsETHTarget0.sol index d40dd06ea..c6dce81a3 100644 --- a/contracts/src/instances/lseth/LsETHTarget0.sol +++ b/contracts/src/instances/lseth/LsETHTarget0.sol @@ -30,6 +30,12 @@ contract LsETHTarget0 is HyperdriveTarget0, LsETHBase { /// Getters /// + /// @notice Gets the LsETH token contract. + /// @return The LsETH token contract. + function lsEth() external view returns (IRiverV1) { + _revert(abi.encode(_river)); + } + /// @notice Returns the MultiToken's decimals. /// @return The MultiToken's decimals. function decimals() external pure override returns (uint8) { diff --git a/contracts/src/instances/reth/RETHTarget0.sol b/contracts/src/instances/reth/RETHTarget0.sol index 51477f57d..033c06d2d 100644 --- a/contracts/src/instances/reth/RETHTarget0.sol +++ b/contracts/src/instances/reth/RETHTarget0.sol @@ -31,6 +31,18 @@ contract RETHTarget0 is HyperdriveTarget0, RETHBase { /// Getters /// + /// @notice Gets the Rocket Storage contract. + /// @return The Rocket Storage contract. + function rocketStorage() external view returns (IRocketStorage) { + _revert(abi.encode(_rocketStorage)); + } + + /// @notice Gets the Rocket Token rETH contract. + /// @return The Rocket Token rETH contract. + function rocketTokenRETH() external view returns (IRocketTokenRETH) { + _revert(abi.encode(_rocketTokenReth)); + } + /// @notice Returns the MultiToken's decimals. /// @return The MultiToken's decimals. function decimals() external pure override returns (uint8) { diff --git a/contracts/src/interfaces/IRETHHyperdrive.sol b/contracts/src/interfaces/IRETHHyperdrive.sol new file mode 100644 index 000000000..c46c7cc3a --- /dev/null +++ b/contracts/src/interfaces/IRETHHyperdrive.sol @@ -0,0 +1,7 @@ +// SPDX-License-Identifier: Apache-2.0 +pragma solidity 0.8.20; + +import { IHyperdrive } from "./IHyperdrive.sol"; +import { IRETHHyperdriveRead } from "./IRETHHyperdriveRead.sol"; + +interface IRETHHyperdrive is IHyperdrive, IRETHHyperdriveRead {} diff --git a/contracts/src/interfaces/IRETHHyperdriveRead.sol b/contracts/src/interfaces/IRETHHyperdriveRead.sol new file mode 100644 index 000000000..3e6b20660 --- /dev/null +++ b/contracts/src/interfaces/IRETHHyperdriveRead.sol @@ -0,0 +1,16 @@ +// SPDX-License-Identifier: Apache-2.0 +pragma solidity 0.8.20; + +import { IHyperdriveRead } from "./IHyperdriveRead.sol"; +import { IRocketStorage } from "./IRocketStorage.sol"; +import { IRocketTokenRETH } from "./IRocketTokenRETH.sol"; + +interface IRETHHyperdriveRead is IHyperdriveRead { + /// @notice Gets the Rocket Storage contract. + /// @return The Rocket Storage contract. + function rocketStorage() external view returns (IRocketStorage); + + /// @notice Gets the Rocket Token rETH contract. + /// @return The Rocket Token rETH contract. + function rocketTokenRETH() external view returns (IRocketTokenRETH); +} diff --git a/contracts/src/interfaces/lseth/ILsETHHyperdrive.sol b/contracts/src/interfaces/lseth/ILsETHHyperdrive.sol new file mode 100644 index 000000000..237ee62fa --- /dev/null +++ b/contracts/src/interfaces/lseth/ILsETHHyperdrive.sol @@ -0,0 +1,7 @@ +// SPDX-License-Identifier: Apache-2.0 +pragma solidity 0.8.20; + +import { IHyperdrive } from "../IHyperdrive.sol"; +import { ILsETHHyperdriveRead } from "./ILsETHHyperdriveRead.sol"; + +interface ILsETHHyperdrive is IHyperdrive, ILsETHHyperdriveRead {} diff --git a/contracts/src/interfaces/lseth/ILsETHHyperdriveRead.sol b/contracts/src/interfaces/lseth/ILsETHHyperdriveRead.sol new file mode 100644 index 000000000..dd83efca0 --- /dev/null +++ b/contracts/src/interfaces/lseth/ILsETHHyperdriveRead.sol @@ -0,0 +1,11 @@ +// SPDX-License-Identifier: Apache-2.0 +pragma solidity 0.8.20; + +import { IHyperdriveRead } from "../IHyperdriveRead.sol"; +import { IRiverV1 } from "./IRiverV1.sol"; + +interface ILsETHHyperdriveRead is IHyperdriveRead { + /// @notice Gets the LsETH token contract. + /// @return The LsETH token contract. + function lsEth() external view returns (IRiverV1); +} diff --git a/test/instances/lseth/LsETHHyperdrive.t.sol b/test/instances/lseth/LsETHHyperdrive.t.sol index 7601e19fc..765c1ef3e 100644 --- a/test/instances/lseth/LsETHHyperdrive.t.sol +++ b/test/instances/lseth/LsETHHyperdrive.t.sol @@ -13,6 +13,7 @@ import { LsETHTarget3Deployer } from "contracts/src/deployers/lseth/LsETHTarget3 import { LsETHTarget4Deployer } from "contracts/src/deployers/lseth/LsETHTarget4Deployer.sol"; import { IERC20 } from "contracts/src/interfaces/IERC20.sol"; import { IHyperdrive } from "contracts/src/interfaces/IHyperdrive.sol"; +import { ILsETHHyperdrive } from "contracts/src/interfaces/lseth/ILsETHHyperdrive.sol"; import { IRiverV1 } from "contracts/src/interfaces/lseth/IRiverV1.sol"; import { AssetId } from "contracts/src/libraries/AssetId.sol"; import { ETH } from "contracts/src/libraries/Constants.sol"; @@ -220,6 +221,15 @@ contract LsETHHyperdriveTest is HyperdriveTest { vm.recordLogs(); } + /// Getters /// + + function test_getters() external { + assertEq( + address(ILsETHHyperdrive(address(hyperdrive)).lsEth()), + address(RIVER) + ); + } + /// Deploy and Initialize /// function test__lseth__deployAndInitialize() external { diff --git a/test/instances/reth/RETHHyperdrive.t.sol b/test/instances/reth/RETHHyperdrive.t.sol index 06fcedf1f..f69bb1e64 100644 --- a/test/instances/reth/RETHHyperdrive.t.sol +++ b/test/instances/reth/RETHHyperdrive.t.sol @@ -12,9 +12,10 @@ import { HyperdriveTest } from "test/utils/HyperdriveTest.sol"; import { HyperdriveUtils } from "test/utils/HyperdriveUtils.sol"; import { IERC20 } from "contracts/src/interfaces/IERC20.sol"; import { IHyperdrive } from "contracts/src/interfaces/IHyperdrive.sol"; -import { IRocketPoolDAOProtocolSettingsDeposit } from "contracts/src/interfaces/IRocketPoolDAOProtocolSettingsDeposit.sol"; +import { IRETHHyperdrive } from "contracts/src/interfaces/IRETHHyperdrive.sol"; import { IRocketDepositPool } from "contracts/src/interfaces/IRocketDepositPool.sol"; import { IRocketNetworkBalances } from "contracts/src/interfaces/IRocketNetworkBalances.sol"; +import { IRocketPoolDAOProtocolSettingsDeposit } from "contracts/src/interfaces/IRocketPoolDAOProtocolSettingsDeposit.sol"; import { IRocketStorage } from "contracts/src/interfaces/IRocketStorage.sol"; import { IRocketTokenRETH } from "contracts/src/interfaces/IRocketTokenRETH.sol"; import { Lib } from "test/utils/Lib.sol"; @@ -247,6 +248,19 @@ contract RETHHyperdriveTest is HyperdriveTest { vm.recordLogs(); } + /// Getters /// + + function test_getters() external { + assertEq( + address(IRETHHyperdrive(address(hyperdrive)).rocketStorage()), + address(ROCKET_STORAGE) + ); + assertEq( + address(IRETHHyperdrive(address(hyperdrive)).rocketTokenRETH()), + address(rocketTokenRETH) + ); + } + /// Deploy and Initialize /// function test__reth__deployAndInitialize() external { diff --git a/test/instances/steth/StETHHyperdrive.t.sol b/test/instances/steth/StETHHyperdrive.t.sol index 90a984206..dbda405d3 100644 --- a/test/instances/steth/StETHHyperdrive.t.sol +++ b/test/instances/steth/StETHHyperdrive.t.sol @@ -13,6 +13,7 @@ import { HyperdriveFactory } from "contracts/src/factory/HyperdriveFactory.sol"; import { IERC20 } from "contracts/src/interfaces/IERC20.sol"; import { IHyperdrive } from "contracts/src/interfaces/IHyperdrive.sol"; import { ILido } from "contracts/src/interfaces/ILido.sol"; +import { IStETHHyperdrive } from "contracts/src/interfaces/IStETHHyperdrive.sol"; import { AssetId } from "contracts/src/libraries/AssetId.sol"; import { ETH } from "contracts/src/libraries/Constants.sol"; import { FixedPointMath, ONE } from "contracts/src/libraries/FixedPointMath.sol"; @@ -216,6 +217,15 @@ contract StETHHyperdriveTest is HyperdriveTest { vm.recordLogs(); } + /// Getters /// + + function test_getters() external { + assertEq( + address(IStETHHyperdrive(address(hyperdrive)).lido()), + address(LIDO) + ); + } + /// Deploy and Initialize /// function test__steth__deployAndInitialize__asBase() external {