diff --git a/contracts/protocol/lendingpool/LendingPoolConfigurator.sol b/contracts/protocol/lendingpool/LendingPoolConfigurator.sol index 3c699179..f8b730ee 100644 --- a/contracts/protocol/lendingpool/LendingPoolConfigurator.sol +++ b/contracts/protocol/lendingpool/LendingPoolConfigurator.sol @@ -514,6 +514,14 @@ contract LendingPoolConfigurator is VersionedInitializable, ILendingPoolConfigur override onlyPoolAdmin { + require( + flashloanPremiumTotal < PercentageMath.PERCENTAGE_FACTOR, + Errors.LPC_FLASHLOAN_PREMIUM_INVALID + ); + require( + flashloanPremiumTotal >= _pool.FLASHLOAN_PREMIUM_TO_PROTOCOL(), + Errors.LPC_FLASHLOAN_PREMIUMS_MISMATCH + ); _pool.updateFlashloanPremiums(flashloanPremiumTotal, _pool.FLASHLOAN_PREMIUM_TO_PROTOCOL()); emit FlashloanPremiumTotalUpdated(flashloanPremiumTotal); } @@ -524,6 +532,14 @@ contract LendingPoolConfigurator is VersionedInitializable, ILendingPoolConfigur override onlyPoolAdmin { + require( + flashloanPremiumToProtocol < PercentageMath.PERCENTAGE_FACTOR, + Errors.LPC_FLASHLOAN_PREMIUM_INVALID + ); + require( + flashloanPremiumToProtocol <= _pool.FLASHLOAN_PREMIUM_TOTAL(), + Errors.LPC_FLASHLOAN_PREMIUMS_MISMATCH + ); _pool.updateFlashloanPremiums(_pool.FLASHLOAN_PREMIUM_TOTAL(), flashloanPremiumToProtocol); emit FlashloanPremiumToProcolUpdated(flashloanPremiumToProtocol); } diff --git a/contracts/protocol/libraries/helpers/Errors.sol b/contracts/protocol/libraries/helpers/Errors.sol index e0fea7bb..8f576c40 100644 --- a/contracts/protocol/libraries/helpers/Errors.sol +++ b/contracts/protocol/libraries/helpers/Errors.sol @@ -113,6 +113,8 @@ library Errors { string public constant RL_STABLE_DEBT_NOT_ZERO = '89'; string public constant RL_VARIABLE_DEBT_SUPPLY_NOT_ZERO = '90'; string public constant LP_CALLER_NOT_EOA = '91'; + string public constant LPC_FLASHLOAN_PREMIUMS_MISMATCH = '95'; + string public constant LPC_FLASHLOAN_PREMIUM_INVALID = '96'; enum CollateralManagerErrors { NO_ERROR,