refactor: LendingPool: flash loan borrowers authorization functions merged into one

This commit is contained in:
Hadrien Charlanes 2021-06-04 09:55:36 +02:00
parent a0c92d47d0
commit b03710b9dc
3 changed files with 5 additions and 15 deletions

View File

@ -459,9 +459,7 @@ interface ILendingPool {
function paused() external view returns (bool);
function authorizeFlashBorrower(address flashBorrower) external;
function unauthorizeFlashBorrower(address flashBorrower) external;
function updateFlashBorrowerAuthorization(address flashBorrower, bool authorized) external;
function isFlashBorrowerAuthorized(address flashBorrower) external view returns (bool);
}

View File

@ -822,20 +822,12 @@ contract LendingPool is VersionedInitializable, ILendingPool, LendingPoolStorage
}
}
function authorizeFlashBorrower(address flashBorrower)
function updateFlashBorrowerAuthorization(address flashBorrower, bool authorized)
external
override
onlyLendingPoolConfigurator
{
_authorizedFlashBorrowers[flashBorrower] = true;
}
function unauthorizeFlashBorrower(address flashBorrower)
external
override
onlyLendingPoolConfigurator
{
_authorizedFlashBorrowers[flashBorrower] = false;
_authorizedFlashBorrowers[flashBorrower] = authorized;
}
function isFlashBorrowerAuthorized(address flashBorrower) external view override returns (bool) {

View File

@ -487,13 +487,13 @@ contract LendingPoolConfigurator is VersionedInitializable, ILendingPoolConfigur
/// @inheritdoc ILendingPoolConfigurator
function authorizeFlashBorrower(address flashBorrower) external override onlyPoolAdmin {
_pool.authorizeFlashBorrower(flashBorrower);
_pool.updateFlashBorrowerAuthorization(flashBorrower, true);
emit FlashBorrowerAuthorized(flashBorrower);
}
/// @inheritdoc ILendingPoolConfigurator
function unauthorizeFlashBorrower(address flashBorrower) external override onlyPoolAdmin {
_pool.unauthorizeFlashBorrower(flashBorrower);
_pool.updateFlashBorrowerAuthorization(flashBorrower, false);
emit FlashBorrowerUnauthorized(flashBorrower);
}