> ## Documentation Index
> Fetch the complete documentation index at: https://docs.formo.so/llms.txt
> Use this file to discover all available pages before exploring further.

# Contracts

> Register, list, inspect, update, and remove tracked smart contracts from the terminal. Manage ABIs, monitored events, and pipeline inclusion.

The `formo contracts` command group manages smart contracts tracked by your project for decoding and event ingestion.

## `formo contracts list`

List tracked contracts for the project.

<Note>
  Requires `contracts:read` scope on your API key.
</Note>

### Options

| Option   | Type     | Required | Description            |
| -------- | -------- | -------- | ---------------------- |
| `--page` | `number` | ❌        | Page number, 1-indexed |
| `--size` | `number` | ❌        | Page size              |

```bash theme={null}
formo contracts list --size 25
```

***

## `formo contracts get <chain> <address>`

Get a tracked contract by chain ID and address.

<Note>
  Requires `contracts:read` scope on your API key.
</Note>

```bash theme={null}
formo contracts get 1 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48
```

***

## `formo contracts create`

Register a new smart contract to track.

<Note>
  Requires `contracts:write` scope on your API key.
</Note>

### Options

| Option                  | Type      | Required | Description                                                                      |
| ----------------------- | --------- | -------- | -------------------------------------------------------------------------------- |
| `--address`             | `string`  | ✅        | Contract address (`0x...`)                                                       |
| `--chain`               | `number`  | ✅        | Chain ID, for example `1` for Ethereum                                           |
| `--name`                | `string`  | ✅        | Human-readable contract name                                                     |
| `--abi`                 | `string`  | ✅        | Contract ABI as a JSON array string                                              |
| `--events`              | `string`  | ✅        | JSON array of ABI event objects to monitor, max 10                               |
| `--start-block`         | `number`  | ❌        | Optional start block                                                             |
| `--include-in-pipeline` | `boolean` | ❌        | Deploy this contract to the events pipeline. Omit for decode-only (the default). |

<Note>
  Boolean flags do not read a following value. Write `--include-in-pipeline` to enable, and
  `--include-in-pipeline=false` or `--no-include-in-pipeline` to disable. `--include-in-pipeline false` sets it to **true** and
  leaves `false` as a stray argument.
</Note>

### Example

```bash theme={null}
formo contracts create \
  --address 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48 \
  --chain 1 \
  --name "USDC" \
  --abi '[{"anonymous":false,"type":"event","name":"Transfer","inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}]}]' \
  --events '[{"anonymous":false,"type":"event","name":"Transfer","inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}]}]' \
  --start-block 6082465 \
  --include-in-pipeline
```

<Note>
  `--abi` is sent to the API as an ABI JSON string. `--events` is sent as an array of ABI event objects.
</Note>

***

## `formo contracts update <chain> <address>`

Update a tracked contract.

<Note>
  Requires `contracts:write` scope on your API key.
</Note>

### Options

| Option                  | Type      | Required | Description                                                                   |
| ----------------------- | --------- | -------- | ----------------------------------------------------------------------------- |
| `--name`                | `string`  | ✅        | Updated contract name                                                         |
| `--abi`                 | `string`  | ✅        | Updated ABI as a JSON array string                                            |
| `--events`              | `string`  | ✅        | Updated JSON array of ABI event objects to monitor                            |
| `--start-block`         | `number`  | ❌        | Optional start block                                                          |
| `--include-in-pipeline` | `boolean` | ❌        | Deploy this contract to the events pipeline. Omit to keep the stored setting. |

<Note>
  `--include-in-pipeline` is a boolean flag: pass `--include-in-pipeline=false` or `--no-include-in-pipeline` to disable it. See
  [boolean flags](#formo-contracts-create) above.
</Note>

```bash theme={null}
formo contracts update 1 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48 \
  --name "USD Coin" \
  --abi '[{"anonymous":false,"type":"event","name":"Transfer","inputs":[]}]' \
  --events '[{"anonymous":false,"type":"event","name":"Transfer","inputs":[]}]'
```

***

## `formo contracts delete <chain> <address>`

Remove a tracked contract.

<Note>
  Requires `contracts:write` scope on your API key.
</Note>

```bash theme={null}
formo contracts delete 1 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48
```

<Warning>
  Removing a tracked contract is permanent. Historical events already captured are not deleted, but new events will no longer be tracked.
</Warning>
