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

UNI-1017 Loan can be written off by anybody before overdue delay expires #64

Merged

Conversation

maxweng
Copy link
Member

@maxweng maxweng commented Nov 22, 2022

No description provided.

accountBorrows[borrower].lastRepay = 0;
} else {
// Still tracking the exisiting loan.
accountBorrows[borrower].lastRepay = getBlockNumber();
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think accountBorrows[borrower].lastRepay = getBlockNumber() should be set without liquidation being complete. Because the borrower still has debts and he has not made repayments, his behavior is still a bad borrower. This will cause other guarantors to be unable to liquidate, because the test is no longer in default

Copy link
Member Author

Choose a reason for hiding this comment

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

I thought the staker could write off a small amount to re-validate the borrower's loan. If that's not the case, I don't know why anyone would want to just write off part of the loan.

Copy link
Contributor

Choose a reason for hiding this comment

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

I mean when there are multiple stakers and one of them liquidates their vouch, other stakers can no longer liquidate their vouch because lastRepay is updated

Copy link
Member Author

Choose a reason for hiding this comment

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

Ok, that makes sense. I've updated it.

@maxweng maxweng requested a review from twygod November 29, 2022 12:06
…/uni-1017-115-loan-can-be-written-off-by-anybody
@maxweng maxweng merged commit f529d46 into master Dec 1, 2022
@maxweng maxweng deleted the findings/uni-1017-115-loan-can-be-written-off-by-anybody branch December 1, 2022 10:38
Copy link

@dmitriia dmitriia left a comment

Choose a reason for hiding this comment

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

Looks ok, although delete accountBorrows[borrower] in L678 can be a safer take.

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.

4 participants