Skip to content

Commit

Permalink
readme and doc fixing
Browse files Browse the repository at this point in the history
  • Loading branch information
hexonaut committed Dec 2, 2023
1 parent fb9b050 commit c6b2e16
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 11 deletions.
20 changes: 14 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,26 @@

## Overview

This repo contains three contracts:
This repo contains five contracts:

### `src/SparkLendFreezerMom.sol`
A contract that will have `RISK_ADMIN_ROLE` in SparkLend, and has two functions:
- `freezeAllMarkets`: Freezes all markets in SparkLend, callable by the `hat` in the Chief or by the PauseProxy in MakerDAO.
- `freezeMarket`: Freezes a single market in SparkLend, callable by the `hat` in the Chief or by the PauseProxy in MakerDAO.
A contract that will have `RISK_ADMIN_ROLE` in SparkLend, and has four functions:
- `freezeAllMarkets`: Freezes all markets in SparkLend, callable by the `hat` in the Chief, an authorized contract (ward) or by the PauseProxy in MakerDAO.
- `freezeMarket`: Freezes a single market in SparkLend, callable by the `hat` in the Chief, an authorized contract (ward) or by the PauseProxy in MakerDAO.
- `pauseAllMarkets`: Pauses all markets in SparkLend, callable by the `hat` in the Chief, an authorized contract (ward) or by the PauseProxy in MakerDAO.
- `pauseMarket`: Pauses a single market in SparkLend, callable by the `hat` in the Chief, an authorized contract (ward) or by the PauseProxy in MakerDAO.

### `src/spells/EmergencySpell_SparkLend_FreezeAllAssets.sol`
A spell that can be set as the `hat` in the Chief to freeze all markets in SparkLend by calling `freezeAllMarkets` in `SparkLendFreezerMom`.
A spell that can be set as the `hat` in the Chief to freeze all markets in SparkLend by calling `freezeAllMarkets(true)` in `SparkLendFreezerMom`.

### `src/spells/EmergencySpell_SparkLend_FreezeSingleAsset.sol`
A spell that can be set as the `hat` in the Chief to freeze all markets in SparkLend by calling `freezeMarket` in `SparkLendFreezerMom`. A separate spell is needed for each market, with the reserve being declared in the constructor.
A spell that can be set as the `hat` in the Chief to freeze a specific market in SparkLend by calling `freezeMarket(reserve, true)` in `SparkLendFreezerMom`. A separate spell is needed for each market, with the reserve being declared in the constructor.

### `src/spells/EmergencySpell_SparkLend_PauseAllAssets.sol`
A spell that can be set as the `hat` in the Chief to pauses all markets in SparkLend by calling `pauseAllMarkets(true)` in `SparkLendFreezerMom`.

### `src/spells/EmergencySpell_SparkLend_PauseSingleAsset.sol`
A spell that can be set as the `hat` in the Chief to pause a specific market in SparkLend by calling `pauseMarket(reserve, true)` in `SparkLendFreezerMom`. A separate spell is needed for each market, with the reserve being declared in the constructor.

## Testing
To run the tests, run `forge test`.
Expand Down
8 changes: 4 additions & 4 deletions src/interfaces/ISparkLendFreezerMom.sol
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ interface ISparkLendFreezerMom {

/**
* @dev Function to freeze a specified market. Permissioned using the isAuthorized function
* which allows the owner, the freezer contract itself, or the `hat` in the Chief
* which allows the owner, a ward, the freezer contract itself, or the `hat` in the Chief
* to call the function. Note that the `authority` in this contract is assumed to be
* the Chief in the MakerDAO protocol.
* @param reserve The address of the market to freeze.
Expand All @@ -127,7 +127,7 @@ interface ISparkLendFreezerMom {

/**
* @dev Function to freeze all markets. Permissioned using the isAuthorized function
* which allows the owner, the freezer contract itself, or the `hat` in the Chief
* which allows the owner, a ward, the freezer contract itself, or the `hat` in the Chief
* to call the function. Note that the `authority` in this contract is assumed to be
* the Chief in the MakerDAO protocol.
* @param freeze A boolean indicating whether to freeze or unfreeze the market.
Expand All @@ -136,7 +136,7 @@ interface ISparkLendFreezerMom {

/**
* @dev Function to pause a specified market. Permissioned using the isAuthorized function
* which allows the owner, the freezer contract itself, or the `hat` in the Chief
* which allows the owner, a ward, the freezer contract itself, or the `hat` in the Chief
* to call the function. Note that the `authority` in this contract is assumed to be
* the Chief in the MakerDAO protocol.
* @param reserve The address of the market to pause.
Expand All @@ -146,7 +146,7 @@ interface ISparkLendFreezerMom {

/**
* @dev Function to pause all markets. Permissioned using the isAuthorized function
* which allows the owner, the freezer contract itself, or the `hat` in the Chief
* which allows the owner, a ward, the freezer contract itself, or the `hat` in the Chief
* to call the function. Note that the `authority` in this contract is assumed to be
* the Chief in the MakerDAO protocol.
* @param pause A boolean indicating whether to pause or unpause the market.
Expand Down
2 changes: 1 addition & 1 deletion src/spells/EmergencySpell_SparkLend_PauseAllAssets.sol
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ contract EmergencySpell_SparkLend_PauseAllAssets {
sparkLendFreezerMom = sparklendFreezerMom_;
}

function freeze() external {
function execute() external {
require(!executed, "PauseAllAssetsSpell/already-executed");
executed = true;
ISparkLendFreezerMom(sparkLendFreezerMom).pauseAllMarkets(true);
Expand Down

0 comments on commit c6b2e16

Please sign in to comment.