Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions contracts/src/instances/lseth/LsETHTarget0.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
12 changes: 12 additions & 0 deletions contracts/src/instances/reth/RETHTarget0.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
7 changes: 7 additions & 0 deletions contracts/src/interfaces/IRETHHyperdrive.sol
Original file line number Diff line number Diff line change
@@ -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 {}
16 changes: 16 additions & 0 deletions contracts/src/interfaces/IRETHHyperdriveRead.sol
Original file line number Diff line number Diff line change
@@ -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);
}
7 changes: 7 additions & 0 deletions contracts/src/interfaces/lseth/ILsETHHyperdrive.sol
Original file line number Diff line number Diff line change
@@ -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 {}
11 changes: 11 additions & 0 deletions contracts/src/interfaces/lseth/ILsETHHyperdriveRead.sol
Original file line number Diff line number Diff line change
@@ -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);
}
10 changes: 10 additions & 0 deletions test/instances/lseth/LsETHHyperdrive.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -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 {
Expand Down
16 changes: 15 additions & 1 deletion test/instances/reth/RETHHyperdrive.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -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 {
Expand Down
10 changes: 10 additions & 0 deletions test/instances/steth/StETHHyperdrive.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -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 {
Expand Down