Skip to content

Commit

Permalink
Add ECDP Emergency Shutdown Module
Browse files Browse the repository at this point in the history
# ECDP Emergency Shutdown Module

## Overview

Provides an Emergency Shutdown protocol for ECDP Stablecoin on Ethical DeFi. When a black swan occurs such as price plunge or fatal bug, the highest priority is to minimize user losses as much as possible.

The Emergency Shutdown Module enables three types of Emergency Shutdown's which are:
- Setter Emergency Shutdown: To Shutdown the Setter (SETR) Stablecoin ECDP System.
- Slick USD Emergency Shutdown: To Shutdown the Slick USD (USSD) Stablecoin ECDP System.

When the decision to shutdown the system is made, emergency shutdown module needs to trigger all related modules to halt, and start a series of operations including close some user entry, freeze feed prices, run offchain worker to settle CDPs that have debit, cancel all activities in the auctions module, when debits and gaps are settled, the stable currency holders are allowed to refund the remaining collateral assets.
  • Loading branch information
balqaasem committed Mar 2, 2024
1 parent 01fab79 commit e81d0f6
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 0 deletions.
50 changes: 50 additions & 0 deletions blockchain/modules/ecdp-emergency-shutdown/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
[package]
name = "module-ecdp-emergency-shutdown"
version = "0.9.81-dev"
authors = ["Setheum Labs"]
edition = "2021"

[dependencies]
scale-info = { workspace = true }
serde = { workspace = true, optional = true }
parity-scale-codec = { version = "3.0.0", default-features = false, features = ["max-encoded-len"] }
sp-runtime = { workspace = true }
sp-io = { workspace = true }
sp-std = { workspace = true }
frame-support = { workspace = true }
frame-system = { workspace = true }

primitives = { package = "setheum-primitives", path = "../primitives", default-features = false }
support = { package = "module-support", path = "../support", default-features = false }
orml-traits = { path = "../submodules/orml/traits", default-features = false }

[dev-dependencies]
sp-core = { workspace = true, features = ["std"] }
pallet-balances = { workspace = true }
orml-tokens = { workspace = true }

[features]
default = ["std"]
std = [
"scale-info/std",
"serde",
"parity-scale-codec/std",
"sp-runtime/std",
"sp-std/std",
"sp-io/std",
"frame-support/std",
"frame-system/std",
"primitives/std",
"support/std",
"orml-traits/std",
]
runtime-benchmarks = [
"frame-support/runtime-benchmarks",
"frame-system/runtime-benchmarks",
"sp-runtime/runtime-benchmarks",
]
try-runtime = [
"frame-support/try-runtime",
"frame-system/try-runtime",
"sp-runtime/try-runtime",
]
11 changes: 11 additions & 0 deletions blockchain/modules/ecdp-emergency-shutdown/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# ECDP Emergency Shutdown Module

## Overview

Provides an Emergency Shutdown protocol for ECDP Stablecoin on Ethical DeFi. When a black swan occurs such as price plunge or fatal bug, the highest priority is to minimize user losses as much as possible.

The Emergency Shutdown Module enables three types of Emergency Shutdown's which are:
- Setter Emergency Shutdown: To Shutdown the Setter (SETR) Stablecoin ECDP System.
- Slick USD Emergency Shutdown: To Shutdown the Slick USD (USSD) Stablecoin ECDP System.

When the decision to shutdown the system is made, emergency shutdown module needs to trigger all related modules to halt, and start a series of operations including close some user entry, freeze feed prices, run offchain worker to settle CDPs that have debit, cancel all activities in the auctions module, when debits and gaps are settled, the stable currency holders are allowed to refund the remaining collateral assets.

0 comments on commit e81d0f6

Please sign in to comment.