-
Notifications
You must be signed in to change notification settings - Fork 197
[VPD-233]: Repay logic improvisation #646
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
base: develop
Are you sure you want to change the base?
Conversation
|
fred-venus
left a comment
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
|
I had a question in terms of the saying in the description The existing implementation for liquidator who has provided a bigger (bigger than actual debt) value here, it will get revert because the subsequent overflow check then is the check already unnecessary after we perform this improvement ? |
|
@fred-venus It is advisable to keep a check for safety and clarity. The performance impact is minimal, and it offers valuable protection against edge cases and any future changes. |
f8786ac to
d1378e1
Compare
NOTE: The changes from this PR have already been merged into the liquidation improvements PR #604. Therefore, we will be closing this PR soon.
This PR updates the
repayAmountcalculation of theVToken.From this to this:
vars.repayAmount = repayAmount >= vars.accountBorrows ? vars.accountBorrows : repayAmount;This change will bring the following impacts:
1. Liquidation Process (VToken.sol - liquidateBorrowFresh)
2. Public Repayment Functions (VBep20.sol)
3. RepayBorrow Event Emission
4. Mathematical Calculations in repayBorrowFresh