Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
nebula
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
exchain
nebula
Commits
2a805a9e
Unverified
Commit
2a805a9e
authored
May 24, 2024
by
Maurelian
Committed by
GitHub
May 24, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ctb: Deploy separate foundation ops and upgrade safes (#10647)
parent
388bd0ba
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
13 deletions
+31
-13
DeployOwnership.s.sol
packages/contracts-bedrock/scripts/DeployOwnership.s.sol
+18
-7
DeployOwnership.t.sol
packages/contracts-bedrock/test/Safe/DeployOwnership.t.sol
+13
-6
No files found.
packages/contracts-bedrock/scripts/DeployOwnership.s.sol
View file @
2a805a9e
...
@@ -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("Foundation
Operations
Safe"),
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:
2
4 weeks,
livenessInterval:
1
4 weeks,
thresholdPercentage: 75,
thresholdPercentage: 75,
minOwners: 8,
minOwners: 8,
fallbackOwner: mustGetAddress("FoundationSafe")
fallbackOwner: mustGetAddress("Foundation
Upgrade
Safe")
})
})
});
});
}
}
/// @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 deployFoundation
Operations
Safe() 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.
...
...
packages/contracts-bedrock/test/Safe/DeployOwnership.t.sol
View file @
2a805a9e
...
@@ -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");
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment