Skip to content

Commit

Permalink
Merge pull request #115 from bcnmy/fix/security-h03
Browse files Browse the repository at this point in the history
🔒 H-03 - Enforce Registry Calls Before Module Setup to Comply with EIP-7484
  • Loading branch information
livingrockrises authored Aug 5, 2024
2 parents 082591d + 32e12fb commit a1c968d
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions contracts/utils/RegistryBootstrap.sol
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ contract Bootstrap is ModuleManager {
address[] calldata attesters,
uint8 threshold
) external {
_installValidator(address(validator), data);
_configureRegistry(registry, attesters, threshold);
_installValidator(address(validator), data);
}

/// @notice Initializes the Nexus account with multiple modules.
Expand All @@ -61,6 +61,8 @@ contract Bootstrap is ModuleManager {
address[] calldata attesters,
uint8 threshold
) external {
_configureRegistry(registry, attesters, threshold);

// Initialize validators
for (uint256 i = 0; i < validators.length; i++) {
_installValidator(validators[i].module, validators[i].data);
Expand All @@ -82,8 +84,6 @@ contract Bootstrap is ModuleManager {
if (fallbacks[i].module == address(0)) continue;
_installFallbackHandler(fallbacks[i].module, fallbacks[i].data);
}

_configureRegistry(registry, attesters, threshold);
}

/// @notice Initializes the Nexus account with a scoped set of modules.
Expand All @@ -97,6 +97,8 @@ contract Bootstrap is ModuleManager {
address[] calldata attesters,
uint8 threshold
) external {
_configureRegistry(registry, attesters, threshold);

// Initialize validators
for (uint256 i = 0; i < validators.length; i++) {
_installValidator(validators[i].module, validators[i].data);
Expand All @@ -106,8 +108,6 @@ contract Bootstrap is ModuleManager {
if (hook.module != address(0)) {
_installHook(hook.module, hook.data);
}

_configureRegistry(registry, attesters, threshold);
}

/// @notice Prepares calldata for the initNexus function.
Expand Down

0 comments on commit a1c968d

Please sign in to comment.