Cleaned up validation logic

This commit is contained in:
The3D 2020-08-19 16:57:49 +02:00
parent a419ca9014
commit 926d25dba8
2 changed files with 3 additions and 2 deletions

View File

@ -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';

View File

@ -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');
}
/**