Skip to content

Commit

Permalink
Merge pull request #8 from aave-dao/fix/va-borrow-validation
Browse files Browse the repository at this point in the history
Fix borrowing validation for reserves without va active
  • Loading branch information
kyzia551 authored Apr 10, 2024
2 parents 78f38af + 2e01cf7 commit e6a2266
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,8 @@ library ValidationLogic {
require(!vars.isFrozen, Errors.RESERVE_FROZEN);
require(vars.borrowingEnabled, Errors.BORROWING_NOT_ENABLED);
require(
IERC20(params.reserveCache.aTokenAddress).totalSupply() >= params.amount,
!params.reserveCache.reserveConfiguration.getIsVirtualAccActive() ||
IERC20(params.reserveCache.aTokenAddress).totalSupply() >= params.amount,
Errors.INVALID_AMOUNT
);

Expand Down Expand Up @@ -486,7 +487,11 @@ library ValidationLogic {
require(!configuration.getPaused(), Errors.RESERVE_PAUSED);
require(configuration.getActive(), Errors.RESERVE_INACTIVE);
require(configuration.getFlashLoanEnabled(), Errors.FLASHLOAN_DISABLED);
require(IERC20(reserve.aTokenAddress).totalSupply() >= amount, Errors.INVALID_AMOUNT);
require(
!configuration.getIsVirtualAccActive() ||
IERC20(reserve.aTokenAddress).totalSupply() >= amount,
Errors.INVALID_AMOUNT
);
}

struct ValidateLiquidationCallLocalVars {
Expand Down

0 comments on commit e6a2266

Please sign in to comment.