# Creating a Sale

The SALE module defines entry functions that enable the creation, management, and closure of NFT sales, as well as the purchase and withdrawal of proceeds. These functions integrate closely with ART20 NFTs, ensuring proper authorization, deny list checks, and event emission.

**`create_nft_sale<CURRENCY>(...)`**\
**Purpose**: Initialize a new sale by selecting a batch of NFTs, specifying a fixed price, and linking it to a collection.

**Key Parameters**:

* `nfts`: A vector of `NFT` objects to be listed.
* `nft_amount`: How many NFTs to include in the sale.
* `price_per_nft`: The cost of each NFT in the sale.
* `collection_cap`: Reference to the collection capabilities (ensuring the caller is the creator or authorized party).
* `ctx`: The transaction context.

**Process**:

1. Validate that `price_per_nft` is within allowed limits.
2. Ensure `nft_amount` does not exceed batch limits and that the user has sufficient `UserBalance`.
3. Lock the NFTs into the sale object and set `is_active = true`.
4. Emit a `SaleCreated` event.

**Use Cases**:

* A creator wants to list the first 100 NFTs of their new collection at a fixed price.
* An artist sets up a single sale object for the entire collection mint.


---

# 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/creating-a-sale.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.
