mirror of
https://github.com/Instadapp/aave-protocol-v2.git
synced 2024-07-29 21:47:30 +00:00
Cleaned up validation logic
This commit is contained in:
parent
a419ca9014
commit
926d25dba8
|
@ -8,7 +8,6 @@ import {IPriceOracleGetter} from '../interfaces/IPriceOracleGetter.sol';
|
|||
import {SafeERC20} from '@openzeppelin/contracts/token/ERC20/SafeERC20.sol';
|
||||
import {IStableDebtToken} from '../tokenization/interfaces/IStableDebtToken.sol';
|
||||
import {ReserveConfiguration} from './ReserveConfiguration.sol';
|
||||
|
||||
import {IReserveInterestRateStrategy} from '../interfaces/IReserveInterestRateStrategy.sol';
|
||||
import {WadRayMath} from './WadRayMath.sol';
|
||||
|
||||
|
|
|
@ -36,12 +36,14 @@ library ValidationLogic {
|
|||
* @param _amount the amount to be deposited
|
||||
*/
|
||||
function validateDeposit(ReserveLogic.ReserveData storage _reserve, uint256 _amount)
|
||||
external
|
||||
internal
|
||||
view
|
||||
{
|
||||
(bool isActive, bool isFreezed, , ) = _reserve.configuration.getFlags();
|
||||
|
||||
require(_amount > 0, 'Amount must be greater than 0');
|
||||
require(isActive, 'Action requires an active reserve');
|
||||
require(!isFreezed, 'Action requires an unfreezed reserve');
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue
Block a user