mirror of
https://github.com/Instadapp/aave-protocol-v2.git
synced 2024-07-29 21:47:30 +00:00
refactor: created internal approve delegation function
This commit is contained in:
parent
76a141cd36
commit
fce470cfb7
|
@ -38,8 +38,7 @@ abstract contract DebtTokenBase is
|
|||
* force a delegator HF to go below 1)
|
||||
**/
|
||||
function approveDelegation(address delegatee, uint256 amount) external override {
|
||||
_borrowAllowances[_msgSender()][delegatee] = amount;
|
||||
emit BorrowAllowanceDelegated(_msgSender(), delegatee, _getUnderlyingAssetAddress(), amount);
|
||||
_approveDelegation(_msgSender(), delegatee, amount);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -118,6 +117,15 @@ abstract contract DebtTokenBase is
|
|||
revert('ALLOWANCE_NOT_SUPPORTED');
|
||||
}
|
||||
|
||||
function _approveDelegation(
|
||||
address delegator,
|
||||
address delegatee,
|
||||
uint256 amount
|
||||
) internal {
|
||||
_borrowAllowances[delegator][delegatee] = amount;
|
||||
emit BorrowAllowanceDelegated(delegator, delegatee, _getUnderlyingAssetAddress(), amount);
|
||||
}
|
||||
|
||||
function _decreaseBorrowAllowance(
|
||||
address delegator,
|
||||
address delegatee,
|
||||
|
|
Loading…
Reference in New Issue
Block a user