> For the complete documentation index, see [llms.txt](https://superlouis.gitbook.io/tzombies/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://superlouis.gitbook.io/tzombies/smart-contracts/marketplace-contract/deploying-and-testing.md).

# Deploying and testing

The marketplace contract can be deployed without any parameters, as it's token-agnostic:

```
ccli deploy ./contracts/market.arl
```

To create a sale, the `list_for_sale` entrypoint is called as follows (replace with the correct values):&#x20;

```
ccli set account alice
ccli call market --entry list_for_sale --arg '{"fa2_": "<TZOMBIES MARKET ADDRESS>", "token_id_": 1, "amount_": 1, "price_": 1000000, "expiry_": "2033-01-01 00:00:00"}'
```

Note that the price argument is expressed in mutez, one million-th of a tez. Hence, 1\_000\_000 utez equals 1 ꜩ.

Now let's switch the account and buy the NFT (this will fail):&#x20;

```bash
ccli set account bob
ccli call market --entry buy --arg '{"order_id": 1, "amount_": 1}' --amount 1tz
```

Why did it fail? Remember, the marketplace contract is not allowed to transfer Alice's tokens. She need to first add the marketplace as an approved operator for her tokens. This can be done once for all her tokens with the following call:&#x20;

```bash
ccli set account alice
ccli call tzombies --entry update_operators_for_all --arg '{"upl": [{ "kind": "left", "value": "<MARKET CONTRACT ADDRESS>" }]}'
```

Now, try to buy again, it should work!


---

# 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://superlouis.gitbook.io/tzombies/smart-contracts/marketplace-contract/deploying-and-testing.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.
