> For the complete documentation index, see [llms.txt](https://mars-protocol.gitbook.io/mars-protocol/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://mars-protocol.gitbook.io/mars-protocol/contracts-core/tokenomics/mars-token.md).

# MARS Token

The MARS token is a simple [CW20](https://github.com/CosmWasm/cw-plus/tree/main/contracts/cw20-base) token fork. More details about MARS tokenomics can be found [here](broken://pages/el1DdoF2A7I0pm5Fg4fC).

## QueryMsg

### `Balance`

Returns the current balance of the given address, 0 if unset.

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

```rust
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
#[serde(rename_all = "snake_case")]
pub enum QueryMsg {
    Balance {
        address: String
    }
}
```

{% endtab %}

{% tab title="JSON" %}

```json
{
  "balance": {
    "address": "terra..."
  }
}
```

{% endtab %}
{% endtabs %}

| Key       | Type   | Description                            |
| --------- | ------ | -------------------------------------- |
| `address` | String | Address to return current balance from |

### `TokenInfo`

Returns metadata on the contract - name, decimals, supply, etc.

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

```rust
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
#[serde(rename_all = "snake_case")]
pub enum QueryMsg {
    TokenInfo {}
}
```

{% endtab %}

{% tab title="JSON" %}

```json
 {
  "token_info": {}
}
```

{% endtab %}
{% endtabs %}

### `Minter`

Returns the minter of the contract.

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

```rust
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
#[serde(rename_all = "snake_case")]
pub enum QueryMsg {
    Minter {}
}
```

{% endtab %}

{% tab title="JSON" %}

```json
 {
  "minter": {}
}
```

{% endtab %}
{% endtabs %}

### `Allowance`

Only with "allowance" extension. Returns how much spender can use from owner account, 0 if unset.

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

```rust
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
#[serde(rename_all = "snake_case")]
pub enum QueryMsg {
    Allowance {
        owner: String,
        spender: String
    }
}
```

{% endtab %}

{% tab title="JSON" %}

```json
{
  "allowance": {
    "owner": "terra...",
    "spender": "terra..."
  }
}
```

{% endtab %}
{% endtabs %}

| Key       | Type   | Description              |
| --------- | ------ | ------------------------ |
| `owner`   | String | Owner contract address   |
| `spender` | String | Spender contract address |

### `AllAllowances`

Only with "enumerable" extension (and "allowances"). Returns all allowances this owner has approved. Supports pagination.

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

```rust
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
#[serde(rename_all = "snake_case")]
pub enum QueryMsg {
    AllAllowances {
        owner: String,
        start_after: Option<String>,
        limit: Option<u32>
    }
}
```

{% endtab %}

{% tab title="JSON" %}

```json
{
  "all_allowances": {
    "owner": "terra...",
    "start_after": "terra...",
    "limit": 10
  }
}
```

{% endtab %}
{% endtabs %}

| Key             | Type   | Description                                       |
| --------------- | ------ | ------------------------------------------------- |
| `owner`         | String | Owner address to return  approved allowances from |
| `start_after`\* | String | Address to start after                            |
| `limit`\*       | u32    | Limit of query return                             |

\* = optional

### `AllAccounts`

Only with "enumerable" extension. Returns all accounts that have balances. Supports pagination.

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

```rust
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
#[serde(rename_all = "snake_case")]
pub enum QueryMsg {
    AllAccounts {
        start_after: Option<String>,
        limit: Option<u32>
    }
}
```

{% endtab %}

{% tab title="JSON" %}

```json
{
  "all_accounts": {
    "start_after": "terra...",
    "limit": 10
  }
}
```

{% endtab %}
{% endtabs %}

| Key             | Type   | Description            |
| --------------- | ------ | ---------------------- |
| `start_after`\* | String | Address to start after |
| `limit`\*       | u32    | Limit of query return  |

\* = optional

### `MarketingInfo`

Only with "marketing" extension. Returns more metadata on the contract to display in the client: description, logo, project url, etc.

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

```rust
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
#[serde(rename_all = "snake_case")]
pub enum QueryMsg {
    MarketingInfo {}
}
```

{% endtab %}

{% tab title="JSON" %}

```json
 {
  "marketing_info": {}
}
```

{% endtab %}
{% endtabs %}

### `DownloadLogo`

Only with "marketing" extension. ownloads the mbeded logo data (if stored on chain). Errors if no logo data ftored for this contract.

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

```rust
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
#[serde(rename_all = "snake_case")]
pub enum QueryMsg {
    DownloadLogo {}
}
```

{% endtab %}

{% tab title="JSON" %}

```json
 {
  "download_logo": {}
}
```

{% endtab %}
{% endtabs %}
