Shared Safety Module Functionality
Last updated
Last updated
A Shared Safety Module is an external module that allows many individual Safety Modules to coordinate, so they can share risk by pooling reserve assets.
When a Safety Module is part of a Shared Safety Module, its ISharedSafetyModule sharedSafetyModule
storage variable will be a non-zero address that is the associated SharedSafetyModule
contract. If sharedSafetyModule == address(0)
, the Safety Module is not part of Shared Safety Module.
Setting a Shared Safety Module follows a two-step process similar to configuration changes (see Module):
The Safety Module owner
first queues a sharedSafetyModule
by calling:
The queued sharedSafetyModule
gets applied after the has elapsed and within the with SafetyModule.finalizeSetSharedSafetyModule
:
The delay period allows Safety Module depositors to withdraw in case they do not wish to be part of the specified Shared Safety Module.
A Shared Safety Module is given certain privileges with respect to the Safety Module, explained below.
A Shared Safety Module is allowed to unilaterally trigger the Safety Module:
This allows the Safety Module to get triggered, in case, a sister Safety Module in the Shared Safety Module is triggered.
Configuration updates that occur while a Safety Module is part of a Shared Safety Module have two unique features:
The Shared Safety Module's config update delay and config update grace period are used
Only the sharedSafetyModule
is authorized to call SafetyModule.finalizeUpdateConfigs
instead of anyone
The Shared Safety Module is the only address authorized to reset the sharedSafetyModule
to address(0)
:
This is intended to be used when the Safety Module leaves the Shared Safety Module.
Note that whenever a Safety Module is triggered, while it is part of a Shared Safety Module, the for that trigger is set to be the sharedSafetyModule
address.
The Shared Safety Module assumes the traditional role of the owner
in Safety Module update. Specifically, it is authorized to call SafetyModule.updateConfigs
: