From 6d96be5f428aff3fe84276a96e5f0896eca4eeee Mon Sep 17 00:00:00 2001 From: eboado Date: Mon, 14 Sep 2020 17:18:57 +0200 Subject: [PATCH] - Added extra natspecs --- contracts/interfaces/ILendingPool.sol | 9 ++++++++- contracts/lendingpool/LendingPool.sol | 9 ++++++++- test/helpers/actions.ts | 2 +- 3 files changed, 17 insertions(+), 3 deletions(-) diff --git a/contracts/interfaces/ILendingPool.sol b/contracts/interfaces/ILendingPool.sol index 177b39df..acd2b9a4 100644 --- a/contracts/interfaces/ILendingPool.sol +++ b/contracts/interfaces/ILendingPool.sol @@ -157,9 +157,16 @@ interface ILendingPool { **/ function withdraw(address reserve, uint256 amount) external; + /** + * @dev Sets allowance to borrow on a certain type of debt asset for a certain user address + * @param asset The underlying asset of the debt token + * @param user The user to give allowance to + * @param interestRateMode Type of debt: 1 for stable, 2 for variable + * @param amount Allowance amount to borrow + **/ function delegateBorrowAllowance( - address user, address asset, + address user, uint256 interestRateMode, uint256 amount ) external; diff --git a/contracts/lendingpool/LendingPool.sol b/contracts/lendingpool/LendingPool.sol index f3fc796b..c494110b 100644 --- a/contracts/lendingpool/LendingPool.sol +++ b/contracts/lendingpool/LendingPool.sol @@ -171,9 +171,16 @@ contract LendingPool is VersionedInitializable, ILendingPool { _borrowAllowance[_reserves[asset].getDebtTokenAddress(interestRateMode)][fromUser][toUser]; } + /** + * @dev Sets allowance to borrow on a certain type of debt asset for a certain user address + * @param asset The underlying asset of the debt token + * @param user The user to give allowance to + * @param interestRateMode Type of debt: 1 for stable, 2 for variable + * @param amount Allowance amount to borrow + **/ function delegateBorrowAllowance( - address user, address asset, + address user, uint256 interestRateMode, uint256 amount ) external override { diff --git a/test/helpers/actions.ts b/test/helpers/actions.ts index c988c106..8c63b05f 100644 --- a/test/helpers/actions.ts +++ b/test/helpers/actions.ts @@ -295,7 +295,7 @@ export const delegateBorrowAllowance = async ( const delegateAllowancePromise = pool .connect(user.signer) - .delegateBorrowAllowance(receiver, reserve, interestRateMode, amountToDelegate.toString()); + .delegateBorrowAllowance(reserve, receiver, interestRateMode, amountToDelegate.toString()); if (expectedResult === 'revert') { await expect(delegateAllowancePromise, revertMessage).to.be.reverted; return;