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 paused() external view returns (bool);
|
||||||
|
|
||||||
function authorizeFlashBorrower(address flashBorrower) external;
|
function updateFlashBorrowerAuthorization(address flashBorrower, bool authorized) external;
|
||||||
|
|
||||||
function unauthorizeFlashBorrower(address flashBorrower) external;
|
|
||||||
|
|
||||||
function isFlashBorrowerAuthorized(address flashBorrower) external view returns (bool);
|
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
|
external
|
||||||
override
|
override
|
||||||
onlyLendingPoolConfigurator
|
onlyLendingPoolConfigurator
|
||||||
{
|
{
|
||||||
_authorizedFlashBorrowers[flashBorrower] = true;
|
_authorizedFlashBorrowers[flashBorrower] = authorized;
|
||||||
}
|
|
||||||
|
|
||||||
function unauthorizeFlashBorrower(address flashBorrower)
|
|
||||||
external
|
|
||||||
override
|
|
||||||
onlyLendingPoolConfigurator
|
|
||||||
{
|
|
||||||
_authorizedFlashBorrowers[flashBorrower] = false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function isFlashBorrowerAuthorized(address flashBorrower) external view override returns (bool) {
|
function isFlashBorrowerAuthorized(address flashBorrower) external view override returns (bool) {
|
||||||
|
|
|
@ -487,13 +487,13 @@ contract LendingPoolConfigurator is VersionedInitializable, ILendingPoolConfigur
|
||||||
|
|
||||||
/// @inheritdoc ILendingPoolConfigurator
|
/// @inheritdoc ILendingPoolConfigurator
|
||||||
function authorizeFlashBorrower(address flashBorrower) external override onlyPoolAdmin {
|
function authorizeFlashBorrower(address flashBorrower) external override onlyPoolAdmin {
|
||||||
_pool.authorizeFlashBorrower(flashBorrower);
|
_pool.updateFlashBorrowerAuthorization(flashBorrower, true);
|
||||||
emit FlashBorrowerAuthorized(flashBorrower);
|
emit FlashBorrowerAuthorized(flashBorrower);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// @inheritdoc ILendingPoolConfigurator
|
/// @inheritdoc ILendingPoolConfigurator
|
||||||
function unauthorizeFlashBorrower(address flashBorrower) external override onlyPoolAdmin {
|
function unauthorizeFlashBorrower(address flashBorrower) external override onlyPoolAdmin {
|
||||||
_pool.unauthorizeFlashBorrower(flashBorrower);
|
_pool.updateFlashBorrowerAuthorization(flashBorrower, false);
|
||||||
emit FlashBorrowerUnauthorized(flashBorrower);
|
emit FlashBorrowerUnauthorized(flashBorrower);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user