Skip to content

Commit

Permalink
use amount
Browse files Browse the repository at this point in the history
  • Loading branch information
snreynolds committed Oct 21, 2024
1 parent f8bde43 commit 30267f6
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/base/DeltaResolver.sol
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ abstract contract DeltaResolver is ImmutableState {
function _mapWrapUnwrapAmount(Currency inputCurrency, uint256 amount, Currency outputCurrency)
internal
view
returns (uint256 _amount)
returns (uint256)
{
// if wrapping, the balance in this contract is in ETH
// if unwrapping, the balance in this contract is in WETH
Expand All @@ -110,10 +110,9 @@ abstract contract DeltaResolver is ImmutableState {
// if wrapping, the open currency on the PoolManager is WETH.
// if unwrapping, the open currency on the PoolManager is ETH.
// note that we use the DEBT amount. positive deltas can be taken and then wrapped.
_amount = _getFullDebt(outputCurrency);
} else {
_amount = amount;
amount = _getFullDebt(outputCurrency);
}
if (_amount > balance) revert InsufficientBalance();
if (amount > balance) revert InsufficientBalance();
return amount;
}
}

0 comments on commit 30267f6

Please sign in to comment.