Commit 2a805a9e authored by Maurelian's avatar Maurelian Committed by GitHub

ctb: Deploy separate foundation ops and upgrade safes (#10647)

parent 388bd0ba
...@@ -62,7 +62,8 @@ contract DeployOwnership is Deploy { ...@@ -62,7 +62,8 @@ contract DeployOwnership is Deploy {
// The SuperchainConfig is needed as a constructor argument to the Deputy Guardian Module // The SuperchainConfig is needed as a constructor argument to the Deputy Guardian Module
deploySuperchainConfig(); deploySuperchainConfig();
deployFoundationSafe(); deployFoundationOperationsSafe();
deployFoundationUpgradeSafe();
deploySecurityCouncilSafe(); deploySecurityCouncilSafe();
deployGuardianSafe(); deployGuardianSafe();
configureGuardianSafe(); configureGuardianSafe();
...@@ -87,7 +88,7 @@ contract DeployOwnership is Deploy { ...@@ -87,7 +88,7 @@ contract DeployOwnership is Deploy {
guardianConfig_ = GuardianConfig({ guardianConfig_ = GuardianConfig({
safeConfig: SafeConfig({ threshold: 1, owners: exampleGuardianOwners }), safeConfig: SafeConfig({ threshold: 1, owners: exampleGuardianOwners }),
deputyGuardianModuleConfig: DeputyGuardianModuleConfig({ deputyGuardianModuleConfig: DeputyGuardianModuleConfig({
deputyGuardian: mustGetAddress("FoundationSafe"), deputyGuardian: mustGetAddress("FoundationOperationsSafe"),
superchainConfig: SuperchainConfig(mustGetAddress("SuperchainConfig")) superchainConfig: SuperchainConfig(mustGetAddress("SuperchainConfig"))
}) })
}); });
...@@ -103,24 +104,34 @@ contract DeployOwnership is Deploy { ...@@ -103,24 +104,34 @@ contract DeployOwnership is Deploy {
councilConfig_ = SecurityCouncilConfig({ councilConfig_ = SecurityCouncilConfig({
safeConfig: safeConfig, safeConfig: safeConfig,
livenessModuleConfig: LivenessModuleConfig({ livenessModuleConfig: LivenessModuleConfig({
livenessInterval: 24 weeks, livenessInterval: 14 weeks,
thresholdPercentage: 75, thresholdPercentage: 75,
minOwners: 8, minOwners: 8,
fallbackOwner: mustGetAddress("FoundationSafe") fallbackOwner: mustGetAddress("FoundationUpgradeSafe")
}) })
}); });
} }
/// @notice Deploys a Safe with a configuration similar to that of the Foundation Safe on Mainnet. /// @notice Deploys a Safe with a configuration similar to that of the Foundation Safe on Mainnet.
function deployFoundationSafe() public broadcast returns (address addr_) { function deployFoundationOperationsSafe() public broadcast returns (address addr_) {
SafeConfig memory exampleFoundationConfig = _getExampleFoundationConfig(); SafeConfig memory exampleFoundationConfig = _getExampleFoundationConfig();
addr_ = deploySafe({ addr_ = deploySafe({
_name: "FoundationSafe", _name: "FoundationOperationsSafe",
_owners: exampleFoundationConfig.owners,
_threshold: exampleFoundationConfig.threshold,
_keepDeployer: false
});
}
/// @notice Deploys a Safe with a configuration similar to that of the Foundation Safe on Mainnet.
function deployFoundationUpgradeSafe() public broadcast returns (address addr_) {
SafeConfig memory exampleFoundationConfig = _getExampleFoundationConfig();
addr_ = deploySafe({
_name: "FoundationUpgradeSafe",
_owners: exampleFoundationConfig.owners, _owners: exampleFoundationConfig.owners,
_threshold: exampleFoundationConfig.threshold, _threshold: exampleFoundationConfig.threshold,
_keepDeployer: false _keepDeployer: false
}); });
console.log("Deployed and configured the Foundation Safe!");
} }
/// @notice Deploy a LivenessGuard for use on the Security Council Safe. /// @notice Deploy a LivenessGuard for use on the Security Council Safe.
......
...@@ -42,12 +42,20 @@ contract DeployOwnershipTest is Test, DeployOwnership { ...@@ -42,12 +42,20 @@ contract DeployOwnershipTest is Test, DeployOwnership {
} }
} }
/// @dev Test the example Foundation Safe configuration. /// @dev Test the example Foundation Safe configurations, against the expected configuration, and
function test_exampleFoundationSafe() public { /// check that they both have the same configuration.
Safe foundationSafe = Safe(payable(mustGetAddress("FoundationSafe"))); function test_exampleFoundationSafes() public {
Safe upgradeSafe = Safe(payable(mustGetAddress("FoundationUpgradeSafe")));
Safe operationsSafe = Safe(payable(mustGetAddress("FoundationOperationsSafe")));
SafeConfig memory exampleFoundationConfig = _getExampleFoundationConfig(); SafeConfig memory exampleFoundationConfig = _getExampleFoundationConfig();
_checkSafeConfig(exampleFoundationConfig, foundationSafe); // Ensure the safes both match the example configuration
_checkSafeConfig(exampleFoundationConfig, upgradeSafe);
_checkSafeConfig(exampleFoundationConfig, operationsSafe);
// Sanity check to ensure the safes match each other's configuration
assertEq(upgradeSafe.getThreshold(), operationsSafe.getThreshold());
assertEq(upgradeSafe.getOwners().length, operationsSafe.getOwners().length);
} }
/// @dev Test the example Security Council Safe configuration. /// @dev Test the example Security Council Safe configuration.
...@@ -72,7 +80,6 @@ contract DeployOwnershipTest is Test, DeployOwnership { ...@@ -72,7 +80,6 @@ contract DeployOwnershipTest is Test, DeployOwnership {
// Module Checks // Module Checks
address livenessModule = mustGetAddress("LivenessModule"); address livenessModule = mustGetAddress("LivenessModule");
address deputyGuardianModule = mustGetAddress("DeputyGuardianModule");
(address[] memory modules, address nextModule) = (address[] memory modules, address nextModule) =
ModuleManager(securityCouncilSafe).getModulesPaginated(SENTINEL_MODULES, 2); ModuleManager(securityCouncilSafe).getModulesPaginated(SENTINEL_MODULES, 2);
assertEq(modules.length, 1); assertEq(modules.length, 1);
...@@ -91,7 +98,7 @@ contract DeployOwnershipTest is Test, DeployOwnership { ...@@ -91,7 +98,7 @@ contract DeployOwnershipTest is Test, DeployOwnership {
} }
/// @dev Test the example Guardian Safe configuration. /// @dev Test the example Guardian Safe configuration.
function test_exampleGuardianSafe() public { function test_exampleGuardianSafe() public view {
Safe guardianSafe = Safe(payable(mustGetAddress("GuardianSafe"))); Safe guardianSafe = Safe(payable(mustGetAddress("GuardianSafe")));
address[] memory owners = new address[](1); address[] memory owners = new address[](1);
owners[0] = mustGetAddress("SecurityCouncilSafe"); owners[0] = mustGetAddress("SecurityCouncilSafe");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment