From c6b2e16d9fdc4840b656b76564cb8bafdc4bc966 Mon Sep 17 00:00:00 2001 From: Sam MacPherson Date: Sat, 2 Dec 2023 11:20:29 -0500 Subject: [PATCH] readme and doc fixing --- README.md | 20 +++++++++++++------ src/interfaces/ISparkLendFreezerMom.sol | 8 ++++---- ...mergencySpell_SparkLend_PauseAllAssets.sol | 2 +- 3 files changed, 19 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index e6c7110..0368a25 100644 --- a/README.md +++ b/README.md @@ -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`. diff --git a/src/interfaces/ISparkLendFreezerMom.sol b/src/interfaces/ISparkLendFreezerMom.sol index 65defb0..075f2e7 100644 --- a/src/interfaces/ISparkLendFreezerMom.sol +++ b/src/interfaces/ISparkLendFreezerMom.sol @@ -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. @@ -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. @@ -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. @@ -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. diff --git a/src/spells/EmergencySpell_SparkLend_PauseAllAssets.sol b/src/spells/EmergencySpell_SparkLend_PauseAllAssets.sol index f8a016e..6806e7b 100644 --- a/src/spells/EmergencySpell_SparkLend_PauseAllAssets.sol +++ b/src/spells/EmergencySpell_SparkLend_PauseAllAssets.sol @@ -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);