# Compiling Contracts

Let's first create a contract

```bash
zeus create contract compiler
```

This places an EOSIO contract in `/contracts/eos`Now let's compile it.

```bash
zeus compile compiler # if using an old cdt --legacy-cdt
```

{% hint style="info" %}
If you want to use docker add `--docker=true`. EOSIO (now leap) and eosio.cdt (now cdt) only supports Ubuntu 18, 22, 24, so Docker must be used for the latest versions
{% endhint %}

If you wanted to compile all contracts within the`./contracts` directory, you can run

{% tabs %}
{% tab title="Compile" %}

```
zeus compile
```

{% endtab %}

{% tab title="Options" %}

```bash
zeus compile [contract]

compile contracts

Options:
  --version       Show version number                                  [boolean]
  --storage-path  path for persistent storage    [default: "/home/ubuntu/.zeus"]
  --rc-file       use rc file to load options from
                                     [default: "/home/ubuntu/.zeus/zeusrc.json"]
  --rc-ignore     ignore rc file                                [default: false]
  --verbose, -v                                                 [default: false]
  -h, --help      Show help                                            [boolean]
  --all           compile all contracts                          [default: true]
  --chain         chain to work on                              [default: "eos"]
  --sidechain     sidechain name to use for liquidx                [default: ""]
  --phase         select compile option [dapp-services-eos, eos]   [default: ""]
  --docker        enable to use docker                          [default: false]
  --legacy-cdt    unbox cmake files using cdt version < 3.0.0   [default: false]

Examples:
  zeus compile --all
  zeus compile helloworld
```

{% endtab %}
{% endtabs %}

To compile an ETH contract run:

{% tabs %}
{% tab title="Zeus" %}

```bash
zeus compile link --phase eth
# to compile all
zeus compile --phase eth
```

{% endtab %}

{% tab title="Truffle" %}

```bash
npx truffle compile
# run any truffle command
```

{% endtab %}
{% endtabs %}

If you wish to add your own ethereum contract, you can place it in the `./contracts/eth` directory.&#x20;

{% hint style="info" %}
If you want to change the compiler version, or any truffle settings, see the `./truffle-config.js` file.
{% endhint %}


---

# 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.liquidapps.io/liquidapps-documentation/working-with-zeus-sdk/zeus-basics/compiling-contracts.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.
