Skip to content

Commit

Permalink
refactor(proxy-target): remove unused "getUnderlyingRequired" function
Browse files Browse the repository at this point in the history
  • Loading branch information
scorpion9979 committed Jan 11, 2023
1 parent 354a0c0 commit 75c6b47
Showing 1 changed file with 0 additions and 14 deletions.
14 changes: 0 additions & 14 deletions packages/proxy-target/contracts/HifiProxyTarget.sol
Original file line number Diff line number Diff line change
Expand Up @@ -639,20 +639,6 @@ contract HifiProxyTarget is IHifiProxyTarget {
hToken.depositUnderlying(underlyingAmount);
}

/// @dev See the documentation for the public functions that call this internal function.
function getUnderlyingRequired(IHifiPool hifiPool, uint256 hTokenOut)
internal
view
returns (uint256 underlyingRequired)
{
// Calculate how much underlying is required to provide "hTokenOut" liquidity to the AMM.
IHToken hToken = hifiPool.hToken();
uint256 normalizedUnderlyingReserves = hifiPool.getNormalizedUnderlyingReserves();
uint256 hTokenReserves = hToken.balanceOf(address(hifiPool));
uint256 normalizedUnderlyingRequired = (normalizedUnderlyingReserves * hTokenOut) / hTokenReserves;
underlyingRequired = denormalize(normalizedUnderlyingRequired, hifiPool.underlyingPrecisionScalar());
}

/// @dev See the documentation for the public functions that call this internal function.
function permitInternal(
IErc20Permit token,
Expand Down

0 comments on commit 75c6b47

Please sign in to comment.