-
Notifications
You must be signed in to change notification settings - Fork 127
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: support @aave/[email protected]
- Loading branch information
Showing
5 changed files
with
49 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// SPDX-License-Identifier: agpl-3.0 | ||
pragma solidity 0.8.10; | ||
|
||
import {IERC20} from '@aave/core-v3/contracts/dependencies/openzeppelin/contracts/IERC20.sol'; | ||
import {DataTypes} from '@aave/core-v3/contracts/protocol/libraries/types/DataTypes.sol'; | ||
|
||
/** | ||
* @title DataTypesHelper | ||
* @author Aave | ||
* @dev Helper library to track user current debt balance, used by WETHGateway | ||
*/ | ||
library DataTypesHelper { | ||
/** | ||
* @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 getUserCurrentDebt(address user, DataTypes.ReserveData memory reserve) | ||
internal | ||
view | ||
returns (uint256, uint256) | ||
{ | ||
return ( | ||
IERC20(reserve.stableDebtTokenAddress).balanceOf(user), | ||
IERC20(reserve.variableDebtTokenAddress).balanceOf(user) | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters