Skip to content

Commit

Permalink
return early for amount=0
Browse files Browse the repository at this point in the history
  • Loading branch information
snreynolds committed Oct 22, 2024
1 parent 0c162a0 commit df5b404
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/base/DeltaResolver.sol
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,9 @@ abstract contract DeltaResolver is ImmutableState {
/// @notice Take an amount of currency out of the PoolManager
/// @param currency Currency to take
/// @param recipient Address to receive the currency
/// @param amount Amount to take
/// @dev Returns early if the amount is 0
function _take(Currency currency, address recipient, uint256 amount) internal {
if (amount == 0) return;
poolManager.take(currency, recipient, amount);
}

Expand All @@ -30,7 +31,9 @@ abstract contract DeltaResolver is ImmutableState {
/// @param currency Currency to settle
/// @param payer Address of the payer
/// @param amount Amount to send
/// @dev Returns early if the amount is 0
function _settle(Currency currency, address payer, uint256 amount) internal {
if (amount == 0) return;
if (currency.isAddressZero()) {
poolManager.settle{value: amount}();
} else {
Expand Down

0 comments on commit df5b404

Please sign in to comment.