# Managing Sale State

**`close_sale<CURRENCY>(...)`** and **`reopen_sale<CURRENCY>(...)`**\
**Purpose**: Control the sale state. Closing a sale prevents further purchases; reopening it allows buying again.

**Close Sale Process**:

1. Verify the caller is the sale creator.
2. Ensure the sale is currently active.
3. Set `is_active = false`.
4. Emit a status change event.

**Reopen Sale Process**:

1. Verify the caller is the sale creator.
2. Ensure the sale is inactive.
3. Check that there are still NFTs available in the sale.
4. Set `is_active = true` and emit the appropriate event.

**Use Cases**:

* Temporarily pause sales for maintenance or to adjust prices and then reopen later.
* End the sale permanently once all desired NFTs are sold or no longer for sale.

By leveraging these functions and entry points, the SALE module offers a straightforward, flexible mechanism for launching NFT sales, adjusting inventory, and handling payment flows. Creators gain full control over their selling process, while buyers enjoy a simple, direct purchasing experience.


---

# Agent Instructions: 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:

```
GET https://docs.artinals.com/artinals-protocol/functions-and-entry-points/managing-sale-state.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
