# Config

## Marble Config&#x20;

The Marble Config is a block of configuration data about the Marble contract itself. It contains information like the contract name, contract version, and admin account.

## Marble Admins

The Marble Admin account has the following roles:

| Role            | Description                                                                                   |
| --------------- | --------------------------------------------------------------------------------------------- |
| Group Creation  | Only the Admin account may create new groups.                                                 |
| Version Updates | The Admin account may call the `setversion()` action to update the contract to a new version. |

## Table Breakdown

**Table Name:** `config`

**Table Scope:** `self`

| Field Name        | Field Type | Description             |
| ----------------- | ---------- | ----------------------- |
| contract\_name    | string     | Contract Name           |
| contract\_version | string     | Contract SemVer version |
| admin             | name       | Contract Admin account  |
| last\_serial      | uint64\_t  | Global Serial counter   |

## Initialize Marble Config

Every Marble contract has a config table created by calling the `init()` action.

**Required Authority:** `self`

### Action Parameters

| Name              | Type   | Example          | Description                                |
| ----------------- | ------ | ---------------- | ------------------------------------------ |
| contract\_name    | string | "Marble Sandbox" | The name of the Marble Contract.           |
| contract\_version | string | "v1.0.0"         | The SemVer version of the Marble Contract. |
| initial\_admin    | name   | testaccount1     | The account name of the admin.             |

### Examples

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

```
cleos push action {account} init '[ {params} ]' -p {account}
```

{% endtab %}

{% tab title="Marble CLI" %}

```
marble init ...
```

{% endtab %}
{% endtabs %}

## Set New Contract Version

Set a new contract version number by calling the `setversion()` action.

**Required Authority:** `admin`

### Action Parameters

| Name         | Type   | Example  | Description                                |
| ------------ | ------ | -------- | ------------------------------------------ |
| new\_version | string | "v1.1.0" | The new contract version in SemVer format. |

### Examples

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

```
cleos push action {account} setversion '[ {params} ]' -p {account}
```

{% endtab %}

{% tab title="Marble CLi" %}

```
marble modify version ...
```

{% endtab %}
{% endtabs %}

## Set New Admin

Set a new contract admin by calling the `setadmin()` action.

**Required Authority:** `admin`

### Action Parameters

| Name       | Type | Example      | Description                               |
| ---------- | ---- | ------------ | ----------------------------------------- |
| new\_admin | name | testaccount2 | The account name to set as the new admin. |

### Examples

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

```
cleos push action {account} setadmin '[ {params} ]' -p {account}
```

{% endtab %}

{% tab title="Marble CLI" %}

```
marble modify admin ...
```

{% endtab %}
{% endtabs %}
