# IPayment

**Inherits:** [IPayableMulticall](https://docs.mav.xyz/technical-reference/maverick-v2/v2-contracts/maverick-v2-common-contracts/base/ipayablemulticall), [IState](https://docs.mav.xyz/technical-reference/maverick-v2/v2-contracts/maverick-v2-supplemental-contracts/paymentbase/istate)

### Functions <a href="#functions" id="functions"></a>

#### receive <a href="#receive" id="receive"></a>

```solidity
receive() external payable;
```

#### unwrapWETH9 <a href="#unwrapweth9" id="unwrapweth9"></a>

Unwrap WETH9 tokens into ETH and send that balance to recipient. If less than amountMinimum WETH is avialble, then revert.

```solidity
function unwrapWETH9(uint256 amountMinimum, address recipient) external payable;
```

#### sweepTokenAmount <a href="#sweeptokenamount" id="sweeptokenamount"></a>

Transfers specified token amount to recipient

```solidity
function sweepTokenAmount(IERC20 token, uint256 amount, address recipient) external payable;
```

#### sweepToken <a href="#sweeptoken" id="sweeptoken"></a>

Sweep entire ERC20 token balance on this contract to recipient. If less than amountMinimum balance is avialble, then revert.

```solidity
function sweepToken(IERC20 token, uint256 amountMinimum, address recipient) external payable;
```

#### refundETH <a href="#refundeth" id="refundeth"></a>

Send any ETH on this contract to msg.sender.

```solidity
function refundETH() external payable;
```

#### unwrapAndSweep <a href="#unwrapandsweep" id="unwrapandsweep"></a>

For tokenA and tokenB, sweep all of the non-WETH tokens to msg.sender. Any WETH balance is unwrapped to ETH and then all the ETH on this contract is sent to msg.sender.

```solidity
function unwrapAndSweep(IERC20 tokenA, IERC20 tokenB, uint256 tokenAAmountMin, uint256 tokenBAmountMin)
    external
    payable;
```

### Errors <a href="#errors" id="errors"></a>

#### PaymentSenderNotWETH9 <a href="#paymentsendernotweth9" id="paymentsendernotweth9"></a>

```solidity
error PaymentSenderNotWETH9();
```

#### PaymentInsufficientBalance <a href="#paymentinsufficientbalance" id="paymentinsufficientbalance"></a>

```solidity
error PaymentInsufficientBalance(address token, uint256 amountMinimum, uint256 contractBalance);
```

<br>
