Open
Conversation
|
GitGuru7
approved these changes
Nov 7, 2025
Contributor
|
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 ? |
Contributor
Author
|
@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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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