mirror of
https://github.com/Instadapp/aave-protocol-v2.git
synced 2024-07-29 21:47:30 +00:00
updated validation of validateRepay
This commit is contained in:
parent
4b750850a2
commit
65dace0054
|
@ -262,15 +262,6 @@ contract LendingPool is VersionedInitializable, ILendingPool, LendingPoolStorage
|
||||||
|
|
||||||
ReserveLogic.InterestRateMode interestRateMode = ReserveLogic.InterestRateMode(rateMode);
|
ReserveLogic.InterestRateMode interestRateMode = ReserveLogic.InterestRateMode(rateMode);
|
||||||
|
|
||||||
//default to max amount
|
|
||||||
uint256 paybackAmount = interestRateMode == ReserveLogic.InterestRateMode.STABLE
|
|
||||||
? stableDebt
|
|
||||||
: variableDebt;
|
|
||||||
|
|
||||||
if (amount < paybackAmount) {
|
|
||||||
paybackAmount = amount;
|
|
||||||
}
|
|
||||||
|
|
||||||
ValidationLogic.validateRepay(
|
ValidationLogic.validateRepay(
|
||||||
reserve,
|
reserve,
|
||||||
amount,
|
amount,
|
||||||
|
@ -280,6 +271,15 @@ contract LendingPool is VersionedInitializable, ILendingPool, LendingPoolStorage
|
||||||
variableDebt
|
variableDebt
|
||||||
);
|
);
|
||||||
|
|
||||||
|
//default to max amount
|
||||||
|
uint256 paybackAmount = interestRateMode == ReserveLogic.InterestRateMode.STABLE
|
||||||
|
? stableDebt
|
||||||
|
: variableDebt;
|
||||||
|
|
||||||
|
if (amount < paybackAmount) {
|
||||||
|
paybackAmount = amount;
|
||||||
|
}
|
||||||
|
|
||||||
reserve.updateState();
|
reserve.updateState();
|
||||||
|
|
||||||
//burns an equivalent amount of debt tokens
|
//burns an equivalent amount of debt tokens
|
||||||
|
|
Loading…
Reference in New Issue
Block a user