Skip to content

Commit

Permalink
fix: Re-add getUserCurrentDebtMemory()
Browse files Browse the repository at this point in the history
  • Loading branch information
LHerskind committed Dec 17, 2021
1 parent 78cfee5 commit 7742985
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions contracts/protocol/libraries/helpers/Helpers.sol
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,24 @@ library Helpers {
);
}

/**
* @notice Fetches the user current stable and variable debt balances
* @param user The user address
* @param reserve The reserve data object
* @return The stable debt balance
* @return The variable debt balance
**/
function getUserCurrentDebtMemory(address user, DataTypes.ReserveData memory reserve)
internal
view
returns (uint256, uint256)
{
return (
IERC20(reserve.stableDebtTokenAddress).balanceOf(user),
IERC20(reserve.variableDebtTokenAddress).balanceOf(user)
);
}

function castUint128(uint256 input) internal pure returns (uint128) {
require(input <= type(uint128).max, Errors.HLP_UINT128_OVERFLOW);
return uint128(input);
Expand Down

0 comments on commit 7742985

Please sign in to comment.