@@ -186,6 +186,14 @@ contract DeployOwnership is Deploy {
186
186
_callViaSafe ({ _safe: safe, _target: address (safe), _data: abi.encodeCall (GuardManager.setGuard, (guard)) });
187
187
console.log ("LivenessGuard setup on SecurityCouncilSafe " );
188
188
189
+ // Deploy and add the Liveness Module.
190
+ address livenessModule = deployLivenessModule ();
191
+ _callViaSafe ({
192
+ _safe: safe,
193
+ _target: address (safe),
194
+ _data: abi.encodeCall (ModuleManager.enableModule, (livenessModule))
195
+ });
196
+
189
197
// Remove the deployer address (msg.sender) which was used to setup the Security Council Safe thus far
190
198
// this call is also used to update the threshold.
191
199
// Because deploySafe() always adds msg.sender first (if keepDeployer is true), we know that the previousOwner
@@ -197,17 +205,11 @@ contract DeployOwnership is Deploy {
197
205
OwnerManager.removeOwner, (SENTINEL_OWNERS, msg .sender , exampleCouncilConfig.safeConfig.threshold)
198
206
)
199
207
});
200
-
201
- // Deploy and add the Liveness Module.
202
- address livenessModule = deployLivenessModule ();
203
- vm.stopBroadcast ();
204
-
205
- // Since we don't have private keys for the safe owners, we instead use 'startBroadcast' to do something
206
- // similar to pranking as the safe. This simulates a quorum of signers executing a transation from the safe to
207
- // call it's own 'enableModule' method.
208
- vm.startBroadcast (address (safe));
209
- safe.enableModule (livenessModule);
210
- vm.stopBroadcast ();
208
+ address [] memory owners = safe.getOwners ();
209
+ require (
210
+ safe.getThreshold () == LivenessModule (livenessModule).getRequiredThreshold (owners.length ),
211
+ "Safe threshold must be equal to the LivenessModule's required threshold "
212
+ );
211
213
addr_ = address (safe);
212
214
console.log ("Deployed and configured the Security Council Safe! " );
213
215
}
0 commit comments