Skip to content

Commit

Permalink
Addressed review feedback from @mcclurejt and @jrhea
Browse files Browse the repository at this point in the history
  • Loading branch information
jalextowle committed Sep 8, 2024
1 parent dd52910 commit ca0f03d
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 38 deletions.
4 changes: 2 additions & 2 deletions .env_template
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# The ethereum rpc endpoints used in fork tests and migration scripts.
# The RPC endpoints used in fork tests and migration scripts.
MAINNET_RPC_URL=
SEPOLIA_RPC_URL=
BASE_SEPOLIA_RPC_URL=
Expand All @@ -12,7 +12,7 @@ HYPERDRIVE_ETHEREUM_URL=
DEPLOYER_PRIVATE_KEY=
PAUSER_PRIVATE_KEY=

# The API key used to verify contracts.
# The API keys used to verify contracts.
ETHERSCAN_API_KEY=
GNOSISSCAN_API_KEY=
LINEASCAN_API_KEY=
Expand Down
25 changes: 5 additions & 20 deletions contracts/src/interfaces/IHyperdriveGovernedRegistry.sol
Original file line number Diff line number Diff line change
@@ -1,28 +1,13 @@
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.20;

import { IHyperdriveGovernedRegistryEvents } from "./IHyperdriveGovernedRegistryEvents.sol";
import { IHyperdriveRegistry } from "./IHyperdriveRegistry.sol";

interface IHyperdriveGovernedRegistry is IHyperdriveRegistry {
/// @notice Emitted when the registry is initialized.
event Initialized(string indexed name, address indexed admin);

/// @notice Emitted when admin is transferred.
event AdminUpdated(address indexed admin);

/// @notice Emitted when Hyperdrive factory info is updated.
event FactoryInfoUpdated(address indexed factory, uint256 indexed data);

/// @notice Emitted when Hyperdrive instance info is updated.
event InstanceInfoUpdated(
address indexed instance,
uint256 indexed data,
address indexed factory
);

/// @notice Emitted when the name is updated.
event NameUpdated(string indexed name);

interface IHyperdriveGovernedRegistry is
IHyperdriveRegistry,
IHyperdriveGovernedRegistryEvents
{
/// @dev The info collected for each Hyperdrive factory.
struct FactoryInfoInternal {
/// @dev Data about the factory. Different registries can utilize
Expand Down
23 changes: 23 additions & 0 deletions contracts/src/interfaces/IHyperdriveGovernedRegistryEvents.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.20;

interface IHyperdriveGovernedRegistryEvents {
/// @notice Emitted when the registry is initialized.
event Initialized(string indexed name, address indexed admin);

/// @notice Emitted when admin is transferred.
event AdminUpdated(address indexed admin);

/// @notice Emitted when Hyperdrive factory info is updated.
event FactoryInfoUpdated(address indexed factory, uint256 indexed data);

/// @notice Emitted when Hyperdrive instance info is updated.
event InstanceInfoUpdated(
address indexed instance,
uint256 indexed data,
address indexed factory
);

/// @notice Emitted when the name is updated.
event NameUpdated(string indexed name);
}
2 changes: 1 addition & 1 deletion contracts/src/registry/HyperdriveRegistry.sol
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ contract HyperdriveRegistry is
revert IHyperdriveGovernedRegistry.RegistryAlreadyInitialized();
}

// Set the initialization flag and set the name and admin.
// Set the initialization flag, name, and admin.
isInitialized = true;
name = _name;
admin = _admin;
Expand Down
20 changes: 5 additions & 15 deletions test/units/registry/HyperdriveRegistry.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import { IHyperdrive } from "../../../contracts/src/interfaces/IHyperdrive.sol";
import { IHyperdriveDeployerCoordinator } from "../../../contracts/src/interfaces/IHyperdriveDeployerCoordinator.sol";
import { IHyperdriveFactory } from "../../../contracts/src/interfaces/IHyperdriveFactory.sol";
import { IHyperdriveGovernedRegistry } from "../../../contracts/src/interfaces/IHyperdriveGovernedRegistry.sol";
import { IHyperdriveGovernedRegistryEvents } from "../../../contracts/src/interfaces/IHyperdriveGovernedRegistryEvents.sol";
import { IHyperdriveRegistry } from "../../../contracts/src/interfaces/IHyperdriveRegistry.sol";
import { VERSION } from "../../../contracts/src/libraries/Constants.sol";
import { ONE } from "../../../contracts/src/libraries/FixedPointMath.sol";
Expand All @@ -24,28 +25,17 @@ import { MockERC4626 } from "../../../contracts/test/MockERC4626.sol";
import { HyperdriveTest } from "../../utils/HyperdriveTest.sol";
import { Lib } from "../../utils/Lib.sol";

contract HyperdriveRegistryTest is HyperdriveTest {
contract HyperdriveRegistryTest is
HyperdriveTest,
IHyperdriveGovernedRegistryEvents
{
using Lib for *;

string internal constant HYPERDRIVE_NAME = "Hyperdrive";
string internal constant COORDINATOR_NAME = "HyperdriveDeployerCoordinator";
string internal constant REGISTRY_NAME = "HyperdriveRegistry";
uint256 internal constant FIXED_RATE = 0.05e18;

event Initialized(string indexed name, address indexed admin);

event AdminUpdated(address indexed admin);

event FactoryInfoUpdated(address indexed factory, uint256 indexed data);

event InstanceInfoUpdated(
address indexed instance,
uint256 indexed data,
address indexed factory
);

event NameUpdated(string indexed name);

IERC4626 internal vaultSharesToken;

function setUp() public override {
Expand Down

0 comments on commit ca0f03d

Please sign in to comment.