-
Notifications
You must be signed in to change notification settings - Fork 10
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: Allow borrowing if it brings TCR back up to CCR #527
Conversation
So all along, opening a Trove below CCR was okay as long as it would tip the TCR above CCR? But borrowing against an existing Trove was a no-go. Well, it's good that we're making it consistent then. |
No, I think it was already consistent, see here: The aim is to fix the issue brought up by Alex, where a whale may block borrowing in general (both new and existing troves) by being able to place the system slightly below CCR. |
Ah, I see, I missed the check being removed from |
@@ -1350,26 +1347,14 @@ contract BorrowerOperations is LiquityBase, AddRemoveManagers, IBorrowerOperatio | |||
} | |||
} | |||
|
|||
function _requireNotBelowCriticalThreshold(uint256 _price) internal view { | |||
if (_checkBelowCriticalThreshold(_price, CCR)) { | |||
revert BelowCriticalThreshold(); |
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.
This makes error BelowCriticalThreshold()
unused, I believe.
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.
Oh, right, I removed BorrowingNotPermittedBelowCT
but forgot this one. Thanks for fixing it!
And thanks for fixing the invariant tests too! |
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.
Looks good now!
Fixes #511