Skip to content

fix: restrict repay asset selection with zero-LTV collateral#2920

Open
vickyshaw29 wants to merge 1 commit intoaave:mainfrom
vickyshaw29:fix/2873-zero-ltv-repay-restriction
Open

fix: restrict repay asset selection with zero-LTV collateral#2920
vickyshaw29 wants to merge 1 commit intoaave:mainfrom
vickyshaw29:fix/2873-zero-ltv-repay-restriction

Conversation

@vickyshaw29
Copy link
Copy Markdown

@vickyshaw29 vickyshaw29 commented Mar 29, 2026

General Changes

  • Restricts repay with aTokens and repay with collateral when user has zero-LTV assets enabled as collateral
  • Prevents LtvValidationFailed contract revert by blocking collateral-modifying repay paths at the UI level
  • Wallet balance repay remains unaffected

Closes #2873

Developer Notes

  • New RepayError.tsx hook follows the existing WithdrawError.tsx pattern
  • RepayModal.tsx blocks the collateral repay tab (ParaSwap swap path) and shows a warning banner
  • RepayModalContent.tsx blocks the aToken repay path and disables the submit button via blocked prop
  • RepayTypeSelector.tsx adds collateralDisabled prop and a null guard on MUI ToggleButtonGroup onChange
  • Uses existing useZeroLTVBlockingWithdraw hook which already handles e-mode edge cases
  • Enum value 0 handled with !== undefined check to avoid JS falsy trap

Reviewer Checklist

  • End-to-end tests passing
  • No significant bundle size increase
  • 3rd party packages vetted
  • Env vars added to .env.example
  • No CI changes

@vercel
Copy link
Copy Markdown

vercel bot commented Mar 29, 2026

@vickyshaw29 is attempting to deploy a commit to the Aave Team on Vercel.

A member of the Team first needs to authorize it.

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.

Restrict repay asset selection when user has LTV=0 collateral

1 participant