Commit 3b374c29 authored by Maurelian's avatar Maurelian Committed by GitHub

ctb: Break out Safe deployment from configuration (#10615)

* ctb: Break out Safe deployment from configuration

* ctb: Natspec fixes
parent 07d7010d
...@@ -24,6 +24,7 @@ struct SafeConfig { ...@@ -24,6 +24,7 @@ struct SafeConfig {
address[] owners; address[] owners;
} }
/// @notice Configuration for the Liveness Module
struct LivenessModuleConfig { struct LivenessModuleConfig {
uint256 livenessInterval; uint256 livenessInterval;
uint256 thresholdPercentage; uint256 thresholdPercentage;
...@@ -31,12 +32,13 @@ struct LivenessModuleConfig { ...@@ -31,12 +32,13 @@ struct LivenessModuleConfig {
address fallbackOwner; address fallbackOwner;
} }
/// @notice Configuration for the Deputy Guardian Module
struct DeputyGuardianModuleConfig { struct DeputyGuardianModuleConfig {
address deputyGuardian; address deputyGuardian;
SuperchainConfig superchainConfig; SuperchainConfig superchainConfig;
} }
/// @notice Configuration for the Security Council Safe.
/// @notice Configuration for the Security Council Safe.
struct SecurityCouncilConfig { struct SecurityCouncilConfig {
SafeConfig safeConfig; SafeConfig safeConfig;
LivenessModuleConfig livenessModuleConfig; LivenessModuleConfig livenessModuleConfig;
...@@ -57,8 +59,10 @@ contract DeployOwnership is Deploy { ...@@ -57,8 +59,10 @@ contract DeployOwnership is Deploy {
console.log("start of Ownership Deployment"); console.log("start of Ownership Deployment");
// 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();
deployAndConfigureFoundationSafe();
deployAndConfigureSecurityCouncilSafe(); deployFoundationSafe();
deploySecurityCouncilSafe();
configureSecurityCouncilSafe();
console.log("Ownership contracts completed"); console.log("Ownership contracts completed");
} }
...@@ -95,7 +99,7 @@ contract DeployOwnership is Deploy { ...@@ -95,7 +99,7 @@ contract DeployOwnership is Deploy {
} }
/// @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 deployAndConfigureFoundationSafe() public returns (address addr_) { function deployFoundationSafe() public broadcast returns (address addr_) {
SafeConfig memory exampleFoundationConfig = _getExampleFoundationConfig(); SafeConfig memory exampleFoundationConfig = _getExampleFoundationConfig();
addr_ = deploySafe({ addr_ = deploySafe({
_name: "FoundationSafe", _name: "FoundationSafe",
...@@ -156,23 +160,25 @@ contract DeployOwnership is Deploy { ...@@ -156,23 +160,25 @@ contract DeployOwnership is Deploy {
console.log("New DeputyGuardianModule deployed at %s", addr_); console.log("New DeputyGuardianModule deployed at %s", addr_);
} }
/// @notice Deploy a Security Council with LivenessModule and LivenessGuard. /// @notice Deploy a Security Council Safe.
function deployAndConfigureSecurityCouncilSafe() public returns (address addr_) { function deploySecurityCouncilSafe() public broadcast returns (address addr_) {
// Deploy the safe with the extra deployer key, and keep the threshold at 1 to allow for further setup. // Deploy the safe with the extra deployer key, and keep the threshold at 1 to allow for further setup.
SecurityCouncilConfig memory exampleCouncilConfig = _getExampleCouncilConfig(); SecurityCouncilConfig memory exampleCouncilConfig = _getExampleCouncilConfig();
Safe safe = Safe( addr_ = payable(
payable( deploySafe({
deploySafe({ _name: "SecurityCouncilSafe",
_name: "SecurityCouncilSafe", _owners: exampleCouncilConfig.safeConfig.owners,
_owners: exampleCouncilConfig.safeConfig.owners, _threshold: 1,
_threshold: 1, _keepDeployer: true
_keepDeployer: true })
})
)
); );
}
vm.startBroadcast(msg.sender); /// @notice Configure the Security Council Safe with the LivenessModule, DeputyGuardianModule, and LivenessGuard.
function configureSecurityCouncilSafe() public broadcast returns (address addr_) {
// Deploy and add the Deputy Guardian Module. // Deploy and add the Deputy Guardian Module.
SecurityCouncilConfig memory exampleCouncilConfig = _getExampleCouncilConfig();
Safe safe = Safe(mustGetAddress("SecurityCouncilSafe"));
address deputyGuardianModule = deployDeputyGuardianModule(); address deputyGuardianModule = deployDeputyGuardianModule();
_callViaSafe({ _callViaSafe({
_safe: safe, _safe: safe,
......
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