Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add freeze all assets spell, integration for all assets (SC-243) #3

Merged
merged 49 commits into from
Nov 23, 2023

Conversation

lucas-manuel
Copy link
Contributor

No description provided.

Copy link

linear bot commented Nov 14, 2023

@lucas-manuel lucas-manuel changed the base branch from master to sc-239-add-spells-and-tests November 14, 2023 21:23
Copy link

@barrutko barrutko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

src/spells/EmergencySpell_SparkLend_FreezeAllAssets.sol looks good.

I couldn't finish tests review. I'll come back to it asap.

Comment on lines +209 to 210
assertTrue(authority.hat() != address(freezeAssetSpell));
assertTrue(

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of assertTrue and ! why not just use assertFalse?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(in all of the cases with this pattern)

Comment on lines 406 to 407
poolConfig.setSupplyCap(asset, 68_719_476_735); // MAX_SUPPLY_CAP
poolConfig.setBorrowCap(asset, 68_719_476_735); // MAX_BORROW_CAP

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where these numbers exactly come from?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Base automatically changed from sc-239-add-spells-and-tests to master November 17, 2023 14:39
Copy link
Contributor

@hexonaut hexonaut left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some changes, but also just realized both spells should have a flag set so that it can only be fired once. We will deploy a new spell for each time we want to use this. Otherwise users can freeze the market over and over until the hat changes. Additional tests should be added to ensure the precrafted spells can only execute at most once.

Also, the spell unfreezing wbtc and dai ltv to 0 will execute tomorrow, so let's get those changes added before merging this as well.

test/IntegrationTests.t.sol Outdated Show resolved Hide resolved
test/IntegrationTests.t.sol Outdated Show resolved Hide resolved
Copy link
Contributor

@hexonaut hexonaut left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small change then good to merge.

Copy link

Coverage after merging sc-243-add-freeze-all into master will be

100.00%

Coverage Report
FileStmtsBranchesFuncsLinesUncovered Lines
src
   SparkLendFreezerMom.sol100%100%100%100%
src/spells
   EmergencySpell_SparkLend_FreezeAllAssets.sol100%100%100%100%
   EmergencySpell_SparkLend_FreezeSingleAsset.sol100%100%100%100%

Copy link
Contributor

@hexonaut hexonaut left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good to merge.

@lucas-manuel lucas-manuel merged commit b1680ee into master Nov 23, 2023
3 checks passed
@lucas-manuel lucas-manuel deleted the sc-243-add-freeze-all branch November 23, 2023 18:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants