Skip to content

Commit

Permalink
added more view functions
Browse files Browse the repository at this point in the history
  • Loading branch information
tusharr1411 committed Sep 27, 2024
1 parent 6df42e7 commit 8815273
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/DSCEngine.sol
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,10 @@ contract DSCEngine is ReentrancyGuard {
return totalAccountCollateralUSDValue;
}

function getAccountCollateralBalance(address user, address collateral) external view returns (uint256) {
return s_CollateralDeposited[user][collateral];
}

function getUsdValue(address token, uint256 amount) public view returns (uint256) {
AggregatorV3Interface priceFeed = AggregatorV3Interface(s_priceFeeds[token]);
(, int256 price,,,) = priceFeed.latestRoundData();
Expand Down Expand Up @@ -355,7 +359,7 @@ contract DSCEngine is ReentrancyGuard {
return MIN_HEALTH_FACTOR;
}

function getCollateralTokens() external view returns( address[] memory ){
function getCollateralTokens() external view returns (address[] memory) {
return s_collateralTokens;
}
}

0 comments on commit 8815273

Please sign in to comment.