mirror of
https://github.com/Instadapp/aave-protocol-v2.git
synced 2024-07-29 21:47:30 +00:00
refactor: LendingPool: flash loan borrowers authorization functions merged into one
This commit is contained in:
parent
a0c92d47d0
commit
b03710b9dc
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user