Skip to content

Commit

Permalink
Lightening the DAO Factory
Browse files Browse the repository at this point in the history
  • Loading branch information
brickpop committed May 31, 2024
1 parent d5a3d2c commit bb8b3eb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
1 change: 1 addition & 0 deletions script/Deploy.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ contract Deploy is Script {
}

TaikoDaoFactory factory = new TaikoDaoFactory(settings);
factory.deployOnce();
TaikoDaoFactory.Deployment memory deployment = factory.getDeployment();

vm.stopBroadcast();
Expand Down
9 changes: 6 additions & 3 deletions src/factory/TaikoDaoFactory.sol
Original file line number Diff line number Diff line change
Expand Up @@ -65,18 +65,21 @@ contract TaikoDaoFactory {
PublicKeyRegistry publicKeyRegistry;
}

/// @notice Thrown when attempting to call deployOnce() when the DAO is already deployed.
error AlreadyDeployed();

DeploymentSettings settings;
Deployment deployment;

/// @notice Initializes the factory and performs the full deployment. Values become read-only after that.
/// @param _settings The settings of the one-time deployment.
constructor(DeploymentSettings memory _settings) {
settings = _settings;

deploy();
}

function deploy() internal {
function deployOnce() public {
if (address(deployment.dao) != address(0)) revert AlreadyDeployed();

IPluginSetup.PreparedSetupData memory preparedMultisigSetupData;
IPluginSetup.PreparedSetupData memory preparedEmergencyMultisigSetupData;
IPluginSetup.PreparedSetupData memory preparedOptimisticSetupData;
Expand Down

0 comments on commit bb8b3eb

Please sign in to comment.