-
Notifications
You must be signed in to change notification settings - Fork 14
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
Conversation
62f0d06
to
37333e5
Compare
function deploySingleBorrower(IUniswapV3Pool pool, Lender lender0, Lender lender1) returns (Borrower) { | ||
address oracleMock = address(new VolatilityOracleMock()); | ||
return new Borrower(VolatilityOracle(oracleMock), pool, lender0, lender1); | ||
} | ||
|
There was a problem hiding this comment.
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( |
There was a problem hiding this comment.
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.
There was a problem hiding this 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
!
The
if (isSus) FACTORY.pause
line was kinda useless before, because ifisSus
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 apause
, anyone can call the function in theFactory
. It'll double check whether the prices are legit or not, and if they aren't, it'll pause the market.