mirror of
https://github.com/Instadapp/aave-protocol-v2.git
synced 2024-07-29 21:47:30 +00:00
adding stack too deep
This commit is contained in:
parent
a869be648b
commit
03103fb63d
|
@ -103,6 +103,7 @@ library Errors {
|
||||||
string public constant LP_NOT_CONTRACT = '78';
|
string public constant LP_NOT_CONTRACT = '78';
|
||||||
string public constant SDT_STABLE_DEBT_OVERFLOW = '79';
|
string public constant SDT_STABLE_DEBT_OVERFLOW = '79';
|
||||||
string public constant SDT_BURN_EXCEEDS_BALANCE = '80';
|
string public constant SDT_BURN_EXCEEDS_BALANCE = '80';
|
||||||
|
string public constant VL_BORROW_CAP_EXCEEDED = '81';
|
||||||
string public constant RC_INVALID_BORROW_CAP = '82';
|
string public constant RC_INVALID_BORROW_CAP = '82';
|
||||||
|
|
||||||
enum CollateralManagerErrors {
|
enum CollateralManagerErrors {
|
||||||
|
|
|
@ -14,6 +14,8 @@ import {UserConfiguration} from '../configuration/UserConfiguration.sol';
|
||||||
import {Errors} from '../helpers/Errors.sol';
|
import {Errors} from '../helpers/Errors.sol';
|
||||||
import {Helpers} from '../helpers/Helpers.sol';
|
import {Helpers} from '../helpers/Helpers.sol';
|
||||||
import {IReserveInterestRateStrategy} from '../../../interfaces/IReserveInterestRateStrategy.sol';
|
import {IReserveInterestRateStrategy} from '../../../interfaces/IReserveInterestRateStrategy.sol';
|
||||||
|
import {IVariableDebtToken} from '../../../interfaces/IVariableDebtToken.sol';
|
||||||
|
import {IStableDebtToken} from '../../../interfaces/IStableDebtToken.sol';
|
||||||
import {DataTypes} from '../types/DataTypes.sol';
|
import {DataTypes} from '../types/DataTypes.sol';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -149,6 +151,20 @@ library ValidationLogic {
|
||||||
uint256(DataTypes.InterestRateMode.STABLE) == interestRateMode,
|
uint256(DataTypes.InterestRateMode.STABLE) == interestRateMode,
|
||||||
Errors.VL_INVALID_INTEREST_RATE_MODE_SELECTED
|
Errors.VL_INVALID_INTEREST_RATE_MODE_SELECTED
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// not using this because stack too deep
|
||||||
|
// uint256 totalStableDebt;
|
||||||
|
// (totalStableDebt, ) = IStableDebtToken(reserve.stableDebtTokenAddress)
|
||||||
|
// .getTotalSupplyAndAvgRate();
|
||||||
|
|
||||||
|
require(
|
||||||
|
IERC20(reserve.stableDebtTokenAddress).totalSupply()
|
||||||
|
.add(IVariableDebtToken(reserve.variableDebtTokenAddress)
|
||||||
|
.scaledTotalSupply()
|
||||||
|
.rayMul(reserve.variableBorrowIndex)
|
||||||
|
).add(amount)
|
||||||
|
< reserve.configuration.getBorrowCap(),
|
||||||
|
Errors.VL_BORROW_CAP_EXCEEDED);
|
||||||
|
|
||||||
(
|
(
|
||||||
vars.userCollateralBalanceETH,
|
vars.userCollateralBalanceETH,
|
||||||
|
|
Loading…
Reference in New Issue
Block a user