Skip to content

Commit

Permalink
feat: Add freeze all assets spell, integration for all assets (SC-243) (
Browse files Browse the repository at this point in the history
#3)

* feat: add outline for sparklend pauser

* fix: rm certora files

* feat: add test coverage for wards ACL functions

* feat: add pool mock, use freeze instead of pause

* feat: add test coverage for freeze

* feat: get to 100% unit test coverage

* fix: rm counter.s.sol

* fix: add pragma and remove unused interface

* fix: add double underscore

* feat: add reserve freezes, update test structure

* feat: add freeze and freeze all coverage

* feat: set up test

* forge install: erc20-helpers

* feat: get initial freeze tests working

* forge install: aave-v3-core

* feat: all tests passing

* chore: improve test comments

* fix: update README

* fix: update to standard structure

* feat: get to full natspec

* feat: add natspec and overrides

* feat: get to full coverage

* fix: rm authority from constructor

* fix: update comments

* fix: update to use specified caller, uniform tests

* feat: update to add freeze market events, events testing

* fix: alignment

* fix: update as per review

* fix: update to use constuctor param, update tests

* fix: update comments

* fix: use immutable

* fix: update natspec

* fix: update naming

* feat: add freeze all spell

* feat: test all assets

* feat: refactor tests to use internal functions

* feat: add failure tests for all asset spell

* feat: all tests passing

* fix: cleanup

* feat: update to use zero supply caps and updated protocol state

* feat: update to add executed boolean

* fix: update to use cei
  • Loading branch information
lucas-manuel authored Nov 23, 2023
1 parent 6544a9a commit b1680ee
Show file tree
Hide file tree
Showing 3 changed files with 428 additions and 73 deletions.
22 changes: 22 additions & 0 deletions src/spells/EmergencySpell_SparkLend_FreezeAllAssets.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
pragma solidity ^0.8.13;

import { ISparkLendFreezerMom } from "src/interfaces/ISparkLendFreezerMom.sol";

contract EmergencySpell_SparkLend_FreezeAllAssets {

address public immutable sparkLendFreezerMom;

bool public executed;

constructor(address sparklendFreezerMom_) {
sparkLendFreezerMom = sparklendFreezerMom_;
}

function freeze() external {
require(!executed, "FreezeAllAssetsSpell/already-executed");
executed = true;
ISparkLendFreezerMom(sparkLendFreezerMom).freezeAllMarkets();
}

}
4 changes: 4 additions & 0 deletions src/spells/EmergencySpell_SparkLend_FreezeSingleAsset.sol
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,16 @@ contract EmergencySpell_SparkLend_FreezeSingleAsset {
address public immutable sparkLendFreezerMom;
address public immutable reserve;

bool public executed;

constructor(address sparklendFreezerMom_, address reserve_) {
sparkLendFreezerMom = sparklendFreezerMom_;
reserve = reserve_;
}

function freeze() external {
require(!executed, "FreezeSingleAssetSpell/already-executed");
executed = true;
ISparkLendFreezerMom(sparkLendFreezerMom).freezeMarket(reserve);
}

Expand Down
Loading

0 comments on commit b1680ee

Please sign in to comment.