@@ -22,6 +22,7 @@ contract ejectImplant is BaseImplant {
22
22
address public immutable FAIL_SAFE;
23
23
bool public immutable ALLOW_AUTH_MANAGEMENT;
24
24
bool public immutable ALLOW_AUTH_EJECT;
25
+ bool public immutable ALLOW_AUTH_SELF_EJECT_REDUCE;
25
26
uint256 public failSafeSignerThreshold;
26
27
27
28
// Errors and Events
@@ -40,12 +41,13 @@ contract ejectImplant is BaseImplant {
40
41
41
42
/// @param _auth initialize authorization parameters for this contract, including applicable conditions
42
43
/// @param _borgSafe address of the applicable BORG's Gnosis Safe which is adding this ejectImplant
43
- constructor (BorgAuth _auth , address _borgSafe , address _failSafe , bool _allowManagement , bool _allowEjection ) BaseImplant (_auth, _borgSafe) {
44
+ constructor (BorgAuth _auth , address _borgSafe , address _failSafe , bool _allowManagement , bool _allowEjection , bool _allowSelfEjectReduce ) BaseImplant (_auth, _borgSafe) {
44
45
if (IBaseImplant (_failSafe).IMPLANT_ID () != 0 )
45
46
revert ejectImplant_InvalidFailSafeImplant ();
46
47
FAIL_SAFE = _failSafe;
47
48
ALLOW_AUTH_MANAGEMENT = _allowManagement;
48
49
ALLOW_AUTH_EJECT = _allowEjection;
50
+ ALLOW_AUTH_SELF_EJECT_REDUCE = _allowSelfEjectReduce;
49
51
}
50
52
51
53
/// @notice setFailSafeSignerThreshold for the DAO or oversight BORG to set the maximum threshold for the fail safe to be triggered
@@ -193,6 +195,7 @@ contract ejectImplant is BaseImplant {
193
195
/// @param _reduce boolean to reduce the threshold if the owner is the last to self-eject
194
196
function selfEject (bool _reduce ) public conditionCheck {
195
197
if (! ISafe (BORG_SAFE).isOwner (msg .sender )) revert ejectImplant_NotOwner ();
198
+ if (_reduce && ! ALLOW_AUTH_SELF_EJECT_REDUCE) revert ejectImplant_ActionNotEnabled ();
196
199
197
200
address [] memory owners = ISafe (BORG_SAFE).getOwners ();
198
201
address prevOwner = address (0x1 );
0 commit comments