# Declarations

> The declarations of a moat file: version, default pass or drop, and constants, plus the warnings moat check gives about unused names and rules that never match.

Source: https://moatfw.dev/docs/declarations

```moat
version 1
default drop

const game_ports = {27015, 27020-27030}
```

`version 1` must be the first declaration and appear once.

`default pass` or `default drop` is required, once. It decides packets
that no rule decides.

`const NAME = VALUE` names a literal, a range or a list. Names share one
namespace with sets and rules, and cannot reuse a protocol name or a TCP
flag name.

The other declarations have pages of their own:
[sets and variables](https://moatfw.dev/docs/sets-and-variables), [modules](https://moatfw.dev/docs/modules)
and [rules](https://moatfw.dev/docs/rules).

## Diagnostics

Errors stop compilation. Warnings do not, unless `moat check
--deny-warnings` is used. The checker warns about:

- constants and sets that are never used;
- conditions that can never be true;
- rules that never match because an earlier `pass` or `drop` rule already
  handles every packet they could match;
- `not` around a comparison on a header some packets lack;
- a `limit` burst smaller than one second of its rate.
