Skip to content

Commit

Permalink
feat: refactored premium to protocol in updateFlashloanPremiumTotal
Browse files Browse the repository at this point in the history
  • Loading branch information
The-3D committed Jan 5, 2022
1 parent 5bb1765 commit 6349f4b
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions contracts/protocol/pool/PoolConfigurator.sol
Original file line number Diff line number Diff line change
Expand Up @@ -400,12 +400,10 @@ contract PoolConfigurator is VersionedInitializable, IPoolConfigurator {
newFlashloanPremiumTotal <= PercentageMath.PERCENTAGE_FACTOR,
Errors.FLASHLOAN_PREMIUM_INVALID
);
require(
newFlashloanPremiumTotal >= _pool.FLASHLOAN_PREMIUM_TO_PROTOCOL(),
Errors.FLASHLOAN_PREMIUMS_MISMATCH
);
uint256 premiumToProtocol = _pool.FLASHLOAN_PREMIUM_TO_PROTOCOL();
require(newFlashloanPremiumTotal >= premiumToProtocol, Errors.FLASHLOAN_PREMIUMS_MISMATCH);
uint256 oldFlashloanPremiumTotal = _pool.FLASHLOAN_PREMIUM_TOTAL();
_pool.updateFlashloanPremiums(newFlashloanPremiumTotal, _pool.FLASHLOAN_PREMIUM_TO_PROTOCOL());
_pool.updateFlashloanPremiums(newFlashloanPremiumTotal, premiumToProtocol);
emit FlashloanPremiumTotalUpdated(oldFlashloanPremiumTotal, newFlashloanPremiumTotal);
}

Expand Down

0 comments on commit 6349f4b

Please sign in to comment.