mirror of
https://github.com/Instadapp/aave-protocol-v2.git
synced 2024-07-29 21:47:30 +00:00
Added handleRepayment() function
This commit is contained in:
parent
e735d40a3b
commit
bc1a237f34
|
@ -82,12 +82,19 @@ interface IAToken is IERC20, IScaledBalanceToken, IInitializableAToken {
|
|||
/**
|
||||
* @dev Transfers the underlying asset to `target`. Used by the LendingPool to transfer
|
||||
* assets in borrow(), withdraw() and flashLoan()
|
||||
* @param user The recipient of the aTokens
|
||||
* @param user The recipient of the underlying
|
||||
* @param amount The amount getting transferred
|
||||
* @return The amount transferred
|
||||
**/
|
||||
function transferUnderlyingTo(address user, uint256 amount) external returns (uint256);
|
||||
|
||||
/**
|
||||
* @dev Invoked to execute actions on the aToken side after a repayment.
|
||||
* @param user The user executing the repayment
|
||||
* @param amount The amount getting repaid
|
||||
**/
|
||||
function handleRepayment(address user, uint256 amount) external;
|
||||
|
||||
/**
|
||||
* @dev Returns the address of the incentives controller contract
|
||||
**/
|
||||
|
|
|
@ -282,6 +282,8 @@ contract LendingPool is VersionedInitializable, ILendingPool, LendingPoolStorage
|
|||
|
||||
IERC20(asset).safeTransferFrom(msg.sender, aToken, paybackAmount);
|
||||
|
||||
IAToken(aToken).handleRepayment(msg.sender, paybackAmount);
|
||||
|
||||
emit Repay(asset, onBehalfOf, msg.sender, paybackAmount);
|
||||
|
||||
return paybackAmount;
|
||||
|
|
|
@ -304,6 +304,13 @@ contract AToken is
|
|||
return amount;
|
||||
}
|
||||
|
||||
/**
|
||||
* @dev Invoked to execute actions on the aToken side after a repayment.
|
||||
* @param user The user executing the repayment
|
||||
* @param amount The amount getting repaid
|
||||
**/
|
||||
function handleRepayment(address user, uint256 amount) external override onlyLendingPool {}
|
||||
|
||||
/**
|
||||
* @dev implements the permit function as for
|
||||
* https://github.com/ethereum/EIPs/blob/8a34d644aacf0f9f8f00815307fd7dd5da07655f/EIPS/eip-2612.md
|
||||
|
|
Loading…
Reference in New Issue
Block a user