🦥
Cozy Safety Module
  • User Guides
    • Introduction
    • User FAQs
  • Developer Guides
    • Creating a Safety Module
      • Define Safety Module Configuration
      • Deploy a Safety Module
    • Manage a Safety Module
      • Replacing Triggers
    • Safety Module Deposits
    • Safety Module Redemptions / Withdrawals
    • Safety Module States
    • Safety Module Fees
    • Safety Module Slashing
    • Shared Safety Module Functionality
    • Create a Rewards Manager
      • Define a Rewards Manager Configuration
      • Deploy a Rewards Manager
      • Reward Pool Drip Models
    • Manage a Rewards Manager
      • Deposit Rewards
      • Update a Rewards Manager Configuration
    • Stake into a Rewards Manager
      • Stake
      • Claim Rewards
      • Unstake
    • Rewards Manager Accounting
    • Rewards Manager States
    • Create a Trigger
      • UMA Trigger Factory
      • Chainlink Trigger Factory
      • Ownable Trigger Factory
    • Permissions and Authorization
    • Token Integration Guidelines
    • Contract Deployments Registry
    • Payout Vaults
  • FAQ
    • Security FAQ
Powered by GitBook
On this page
  1. Developer Guides

Manage a Safety Module

PreviousDeploy a Safety ModuleNextReplacing Triggers

Last updated 12 days ago

As the owner of a Safety Module, it is possible to update the configuration in order to:

  • Add new reserve pools

  • Update the max slash percentages of reserve pools

  • Add/remove triggers that are allowed to be used to trigger the Safety Module

  • Update delays

Configuration updates follows a two-step process:

  1. Configuration updates are queued with SafetyModule.updateConfigs:

    /// @notice Parameters for configuration updates.
    struct UpdateConfigsCalldataParams {
      // The new reserve pool configs.
      ReservePoolConfig[] reservePoolConfigs;
      // The new trigger configs.
      TriggerConfig[] triggerConfigUpdates;
      // The new delays config.
      Delays delaysConfig;
    }
    
    /// @notice Signal an update to the safety module configs. Existing queued updates are overwritten.
    /// @param configUpdates_ The new configs. Includes:
    /// - reservePoolConfigs: The array of new reserve pool configs, sorted by associated ID. The array may also
    /// include config for new reserve pools.
    /// - triggerConfigUpdates: The array of trigger config updates. It only needs to include config for updates to
    /// existing triggers or new triggers.
    /// - delaysConfig: The new delays config.
      function updateConfigs(UpdateConfigsCalldataParams calldata configUpdates_)
        external
        onlySharedSafetyModuleIfSetElseOwner;
  2. Configuration updates can be applied after the has elapsed and within the with SafetyModule.finalizeUpdateConfigs:

    /// @notice Parameters for configuration updates.
    struct UpdateConfigsCalldataParams {
      // The new reserve pool configs.
      ReservePoolConfig[] reservePoolConfigs;
      // The new trigger configs.
      TriggerConfig[] triggerConfigUpdates;
      // The new delays config.
      Delays delaysConfig;
    }
    
    /// @notice Execute queued updates to the safety module configs.
    /// @param configUpdates_ The new configs. Includes:
    /// - reservePoolConfigs: The array of new reserve pool configs, sorted by associated ID. The array may also
    /// include config for new reserve pools.
    /// - triggerConfigUpdates: The array of trigger config updates. It only needs to include config for updates to
    /// existing triggers or new triggers.
    /// - delaysConfig: The new delays config.
    function finalizeUpdateConfigs(UpdateConfigsCalldataParams calldata configUpdates_) external;

Also, it is not possible to remove reserve pools, so existing reserve pools must be included at the start of the ReservePoolConfig[] sorted by the associated reserve pool IDs. Any new reserve pools come after the existing reserve pools and the reserve pool IDs assigned to them respect the order of the array.

Note: If a configuration update is queued but not finalized before a Safety Module enters the TRIGGERED state, the queued update is cleared and may be requeued when the Safety Module returns to either the ACTIVE or PAUSED states.

The reserve pool configs for the update must obey the general requirements for creating a Safety Module (see ).

Note: When a Safety Module is part of a Shared Safety Module, the sharedSafetyModule is the address authorized to do configuration updates, not the owner. See for more details.

Define Safety Module Configuration
here
config update delay
config update grace period