Define Safety Module Configuration
Configuration for a Safety Module consists of ReservePoolConfig[]
, TriggerConfig[]
, and DelaysConfig
. These configs are passed to CozySafetyModuleManager.createSafetyModule
to deploy a new Safety Module.
Reserve Pool Config
Note: The order of the reserve pool configs in the ReservePoolConfig[]
array passed to CozySafetyModuleManager.createSafetyModule
are used to determine the resulting reserve pool IDs in the deployed Safety Module.
Reserve Pool Maximum Slash Percentages
The maxSlashPercentage
configured for a reserve pool allows Safety Module owners to specify the maximum allowed amount of assets that are allowed to be slashed in a single transaction (see Safety Module Slashing). Note, if multiple slashes occur on a reserve pool, they compound and the maxSlashPercentage
is checked pro-actively.
Reserve Pool Assets
Each reserve pool must have an underlying asset. Assets used by the Safety Module must follow the Token Integration Guidelines to avoid any unexpected behaviour.
Trigger Config
Safety Modules contain a list of triggers which are allowed to be used to "trigger" the Safety Module using SafetyModule.trigger(ITrigger trigger_)
, allowing assets from the reserve pools to be slashed (see Safety Module Slashing).
Trigger
The trigger to add to the Safety Module (see Creating a Trigger).
Payout Handler
Each trigger configured for a Safety Module has an assigned payoutHandler
address which is allowed to slash assets from each reserve pool in the case that the trigger is used to trigger the Safety Module. Note, payout handlers do not need to be unique for each trigger.
Exists
A boolean which specifies whether or not the trigger is used by the Safety Module. This is helpful for configuration updates to remove triggers from the list of triggers that are allowed to trigger the Safety Module.
Delays Config
The Delays config is for Safety Module-level delays.
Config Update Delay
The config update delay is the duration between when Safety Module updates are queued and when they can be applied / executed (see Manage a Safety Module). This delay should be longer than the withdraw delay to allow Safety Module depositors to respond to queued config updates before they are applied.
Config Update Grace Period
The config update grace period is the duration after the config update delay that the Safety Module owner is allowed to apply / execute the queued config changes (see Manage a Safety Module). If the owner does not apply the updates by the end of this period, they cannot be applied.
Withdraw Delay
The withdraw delay is for the two-step withdraw process (see Safety Module Deposits). This delay should be shorter than the config update delay to allow Safety Module depositors to respond to queued config updates before they are applied.
Last updated