mirror of
https://github.com/Instadapp/aave-protocol-v2.git
synced 2024-07-29 21:47:30 +00:00
rename: renamed flashloaner => flashBorrower
This commit is contained in:
parent
ccad06fc94
commit
5a1e87ae09
|
@ -459,9 +459,9 @@ interface ILendingPool {
|
|||
|
||||
function paused() external view returns (bool);
|
||||
|
||||
function authorizeFlashloaner(address flashloaner) external;
|
||||
function authorizeFlashBorrower(address flashBorrower) external;
|
||||
|
||||
function unauthorizeFlashloaner(address flashloaner) external;
|
||||
function unauthorizeFlashBorrower(address flashBorrower) external;
|
||||
|
||||
function isFlashloanerAuthorized(address flashloaner) external view returns (bool);
|
||||
function isFlashBorrowerAuthorized(address flashBorrower) external view returns (bool);
|
||||
}
|
||||
|
|
|
@ -207,17 +207,17 @@ interface ILendingPoolConfigurator {
|
|||
|
||||
event RiskAdminUnregistered(address indexed admin);
|
||||
|
||||
event FlashloanerAuthorized(address indexed flashloaner);
|
||||
event FlashBorrowerAuthorized(address indexed flashBorrower);
|
||||
|
||||
event FlashloanerUnauthorized(address indexed flashloaner);
|
||||
event FlashBorrowerUnauthorized(address indexed flashBorrower);
|
||||
|
||||
function registerRiskAdmin(address admin) external;
|
||||
|
||||
function unregisterRiskAdmin(address admin) external;
|
||||
|
||||
function authorizeFlashloaner(address flashloaner) external;
|
||||
function authorizeFlashBorrower(address flashBorrower) external;
|
||||
|
||||
function unauthorizeFlashloaner(address flashloaner) external;
|
||||
function unauthorizeFlashBorrower(address flashBorrower) external;
|
||||
|
||||
function isRiskAdmin(address admin) external view returns (bool);
|
||||
}
|
||||
|
|
|
@ -471,7 +471,7 @@ contract LendingPool is VersionedInitializable, ILendingPool, LendingPoolStorage
|
|||
address[] memory aTokenAddresses = new address[](assets.length);
|
||||
uint256[] memory premiums = new uint256[](assets.length);
|
||||
vars.receiver = IFlashLoanReceiver(receiverAddress);
|
||||
vars.flashloanPremiumTotal = _authorizedFlashloaners[msg.sender] ? 0 : _flashLoanPremiumTotal;
|
||||
vars.flashloanPremiumTotal = _authorizedFlashBorrowers[msg.sender] ? 0 : _flashLoanPremiumTotal;
|
||||
|
||||
for (vars.i = 0; vars.i < assets.length; vars.i++) {
|
||||
aTokenAddresses[vars.i] = _reserves[assets[vars.i]].aTokenAddress;
|
||||
|
@ -822,20 +822,24 @@ contract LendingPool is VersionedInitializable, ILendingPool, LendingPoolStorage
|
|||
}
|
||||
}
|
||||
|
||||
function authorizeFlashloaner(address flashloaner) external override onlyLendingPoolConfigurator {
|
||||
_authorizedFlashloaners[flashloaner] = true;
|
||||
}
|
||||
|
||||
function unauthorizeFlashloaner(address flashloaner)
|
||||
function authorizeFlashBorrower(address flashBorrower)
|
||||
external
|
||||
override
|
||||
onlyLendingPoolConfigurator
|
||||
{
|
||||
_authorizedFlashloaners[flashloaner] = false;
|
||||
_authorizedFlashBorrowers[flashBorrower] = true;
|
||||
}
|
||||
|
||||
function isFlashloanerAuthorized(address flashloaner) external view override returns (bool) {
|
||||
return _authorizedFlashloaners[flashloaner];
|
||||
function unauthorizeFlashBorrower(address flashBorrower)
|
||||
external
|
||||
override
|
||||
onlyLendingPoolConfigurator
|
||||
{
|
||||
_authorizedFlashBorrowers[flashBorrower] = false;
|
||||
}
|
||||
|
||||
function isFlashBorrowerAuthorized(address flashBorrower) external view override returns (bool) {
|
||||
return _authorizedFlashBorrowers[flashBorrower];
|
||||
}
|
||||
|
||||
struct ExecuteBorrowParams {
|
||||
|
|
|
@ -537,14 +537,14 @@ contract LendingPoolConfigurator is VersionedInitializable, ILendingPoolConfigur
|
|||
emit RiskAdminUnregistered(admin);
|
||||
}
|
||||
|
||||
function authorizeFlashloaner(address flashloaner) external override onlyPoolAdmin {
|
||||
pool.authorizeFlashloaner(flashloaner);
|
||||
emit FlashloanerAuthorized(flashloaner);
|
||||
function authorizeFlashBorrower(address flashBorrower) external override onlyPoolAdmin {
|
||||
pool.authorizeFlashBorrower(flashBorrower);
|
||||
emit FlashBorrowerAuthorized(flashBorrower);
|
||||
}
|
||||
|
||||
function unauthorizeFlashloaner(address flashloaner) external override onlyPoolAdmin {
|
||||
pool.unauthorizeFlashloaner(flashloaner);
|
||||
emit FlashloanerUnauthorized(flashloaner);
|
||||
function unauthorizeFlashBorrower(address flashBorrower) external override onlyPoolAdmin {
|
||||
pool.unauthorizeFlashBorrower(flashBorrower);
|
||||
emit FlashBorrowerUnauthorized(flashBorrower);
|
||||
}
|
||||
|
||||
function isRiskAdmin(address admin) external view override onlyPoolAdmin returns (bool) {
|
||||
|
|
|
@ -30,5 +30,5 @@ contract LendingPoolStorage {
|
|||
|
||||
uint256 internal _maxNumberOfReserves;
|
||||
|
||||
mapping(address => bool) _authorizedFlashloaners;
|
||||
mapping(address => bool) _authorizedFlashBorrowers;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user