GlobalAccessManagerEmergencyFacet
Emergency controls facet for GlobalAccessManager diamond
Functions
activateEmergencyMode
Activate emergency mode
Only EMERGENCY_ADMIN_ROLE can call this
function activateEmergencyMode() external;
deactivateEmergencyMode
Deactivate emergency mode
Only EMERGENCY_ADMIN_ROLE can call this
function deactivateEmergencyMode() external;
emergencyExecute
Emergency function to execute critical operations immediately
Only EMERGENCY_ADMIN_ROLE can call this
function emergencyExecute(address target, bytes calldata data) external returns (bytes memory);
Parameters
target
address
The target contract
data
bytes
The function call data
configureEmergencyFunction
Configure which functions can be called in emergency mode
Only PROTOCOL_ADMIN_ROLE can call this
function configureEmergencyFunction(bytes4 selector, bool allowed) external;
Parameters
selector
bytes4
The function selector
allowed
bool
Whether the function is allowed in emergency
batchConfigureEmergencyFunctions
Batch configure emergency functions
Only PROTOCOL_ADMIN_ROLE can call this
function batchConfigureEmergencyFunctions(bytes4[] calldata selectors, bool[] calldata allowed) external;
Parameters
selectors
bytes4[]
Array of function selectors
allowed
bool[]
Array of allowed flags
isEmergencyModeActive
Check if emergency mode is active
function isEmergencyModeActive() external view returns (bool active, uint256 activatedAt);
Returns
active
bool
True if emergency mode is active
activatedAt
uint256
Timestamp when emergency mode was activated (0 if not active)
isEmergencyFunctionAllowed
Check if a function is allowed in emergency mode
function isEmergencyFunctionAllowed(bytes4 selector) external view returns (bool allowed);
Parameters
selector
bytes4
The function selector
Returns
allowed
bool
True if the function is allowed in emergency
getEmergencyActionCount
Get emergency action count for an address
function getEmergencyActionCount(address executor) external view returns (uint256 count);
Parameters
executor
address
The executor address
Returns
count
uint256
Number of emergency actions executed
Events
EmergencyModeActivated
event EmergencyModeActivated(address indexed activator, uint256 timestamp);
EmergencyModeDeactivated
event EmergencyModeDeactivated(address indexed deactivator, uint256 timestamp);
EmergencyActionExecuted
event EmergencyActionExecuted(address indexed executor, address indexed target, bytes4 indexed selector);
EmergencyFunctionConfigured
event EmergencyFunctionConfigured(bytes4 indexed selector, bool allowed);
Last updated
Was this helpful?