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

Fix pausing functionality #156

Merged
merged 2 commits into from
Sep 13, 2023
Merged

Fix pausing functionality #156

merged 2 commits into from
Sep 13, 2023

Conversation

haydenshively
Copy link
Member

@haydenshively haydenshively commented Sep 11, 2023

The if (isSus) FACTORY.pause line was kinda useless before, because if isSus was true, it would revert. Probably should've been caught in the audit, but at least I found it now.

I removed that line from modify (and reorganized that stuff a bit). Now to do a pause, anyone can call the function in the Factory. It'll double check whether the prices are legit or not, and if they aren't, it'll pause the market.

Comment on lines -17 to -21
function deploySingleBorrower(IUniswapV3Pool pool, Lender lender0, Lender lender1) returns (Borrower) {
address oracleMock = address(new VolatilityOracleMock());
return new Borrower(VolatilityOracle(oracleMock), pool, lender0, lender1);
}

Copy link
Member Author

Choose a reason for hiding this comment

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

Unused code

contract BalanceSheetTest is Test {
function setUp() public {}

function test_alwaysHealthyWhenLiabilitiesAre0(
Copy link
Member Author

Choose a reason for hiding this comment

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

Since I moved the isHealthy check inside of the liabilities0 > 0 || liabilities1 > 0 conditional, I wanted to double check that no debt does, in fact, imply you're healthy. This test proves that.

Copy link

@aneesh1 aneesh1 left a comment

Choose a reason for hiding this comment

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

LGTM. Also, looks like we have some major gas savings on repay!

core/src/Borrower.sol Show resolved Hide resolved
core/src/Borrower.sol Show resolved Hide resolved
core/src/Borrower.sol Show resolved Hide resolved
core/src/Borrower.sol Show resolved Hide resolved
core/src/libraries/BalanceSheet.sol Show resolved Hide resolved
core/src/Factory.sol Show resolved Hide resolved
@haydenshively haydenshively merged commit 31925e2 into master Sep 13, 2023
3 of 7 checks passed
@haydenshively haydenshively deleted the get-prices-in-factory2 branch September 13, 2023 23:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants