Skip to content

fix: reject undercollateralized refinances - #1437

Open
silentgeckoaudit3801 wants to merge 2 commits into
LabsCrypt:mainfrom
silentgeckoaudit3801:fix-refinance-collateral-check-1309
Open

fix: reject undercollateralized refinances#1437
silentgeckoaudit3801 wants to merge 2 commits into
LabsCrypt:mainfrom
silentgeckoaudit3801:fix-refinance-collateral-check-1309

Conversation

@silentgeckoaudit3801

Copy link
Copy Markdown

Fixes #1309.

This PR updates contracts/loan_manager/src/lib.rs::refinance_loan so the collateral sufficiency guard rejects refinances when the existing collateral is less than the requested new amount, and returns LoanError::InsufficientCollateral instead of the unrelated score error.

It also adds a focused regression test for a loan with 1,500 collateral attempting to refinance to 2,000.

Validation: static GitHub API/source inspection only; local Soroban/Rust tests were not run in this environment to avoid installing or executing additional toolchains.

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.

[Contracts] refinance_loan collateral sufficiency check is inverted

1 participant