> For the complete documentation index, see [llms.txt](https://docs.mav.xyz/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.mav.xyz/technical-reference/maverick-v2/v2-contracts/maverick-v2-supplemental-contracts/paymentbase/ipayment.md).

# IPayment

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

### 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>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.mav.xyz/technical-reference/maverick-v2/v2-contracts/maverick-v2-supplemental-contracts/paymentbase/ipayment.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
