> For the complete documentation index, see [llms.txt](https://learn.onpop.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://learn.onpop.io/contracts/guides/build-your-contract.md).

# Build

Before we compile your smart contract, make sure to take a look at what an ink! contract consists of in the [documentation](https://use.ink/docs/v6/getting-started/building-your-contract).

To build your ink! smart contract, make sure you are inside your ink! smart contract directory and run the following command:

```shell
pop build
```

or

```
pop build --release
```

## Build options

Most common flags:

| Flag                     | Description                                                                                            |
| ------------------------ | ------------------------------------------------------------------------------------------------------ |
| `PATH` / `--path <path>` | Project directory (defaults to the current directory).                                                 |
| `-r, --release`          | Build in release mode. Conflicts with `--profile`.                                                     |
| \`--profile \<debug      | release                                                                                                |
| `--features <list>`      | Comma-separated feature list.                                                                          |
| `--metadata <spec>`      | Choose the contract metadata spec (run `pop build --help` for supported values).                       |
| `--verifiable`           | Build a verifiable contract (deterministic release build). Conflicts with `--release` and `--profile`. |
| `--image <image>`        | Use a custom image for verifiable builds (requires `--verifiable`).                                    |

### JSON output

Use global `--json` for structured output in scripts:

```shell
pop --json build --path ./my_contract --profile release
```

> \[!NOTE] Verifiable builds require Docker to be running.

**Need help?**

Ask on [Polkadot Stack Exchange](https://polkadot.stackexchange.com/) (tag it [`pop`](https://substrate.stackexchange.com/tags/pop/info)) or drop by [our Telegram](https://t.me/onpopio). We're here to help!


---

# 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://learn.onpop.io/contracts/guides/build-your-contract.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.
