> **Can't find what you're looking for?** Use `search_docs` on the docs MCP server at `https://sdk.railnet.org/api/mcp` to find what you need.

# Roles

Role constants used for access control across the Railnet protocol. These are precomputed `keccak256` hashes that match the roles defined in the Solidity `Roles.sol` contract.

## Import

```ts
import { VEHICLE_STEAM_DEPOSIT, MULTI_VEHICLE_SET_QUEUES } from '@railnetorg/railnet-sdk'
```

## All Constants

### Factories

| Constant | Description |
| --- | --- |
| `FACTORY_SPAWN` | Permission to deploy new instances through a factory |
| `FACTORY_DEPRECATE` | Permission to disable a factory and block future deployments |
| `CONDUIT_SPAWN` | Permission to spawn conduits through the ConduitFactory |

### Asset Registry

| Constant | Description |
| --- | --- |
| `ASSET_REGISTRY_SET_ASSET` | Permission to configure assets, including their initial deposit amount |

### Beacon and proxies

| Constant | Description |
| --- | --- |
| `BEACON_FREEZE` | Permission to freeze a beacon, blocking further upgrades |
| `BEACON_PAUSE` | Permission to pause the contracts behind a beacon |
| `BEACON_UNPAUSE` | Permission to unpause them |
| `BEACON_UPGRADE` | Permission to point a beacon at a new implementation |

### Vehicle

| Constant | Description |
| --- | --- |
| `VEHICLE_STEAM_DEPOSIT` | Permission to run STEAM deposit operations on a vehicle |
| `VEHICLE_STEAM_REDEEM` | Permission to run STEAM redeem operations on a vehicle |
| `VEHICLE_SET_INTERCEPTIONS` | Permission to set interceptions |
| `VEHICLE_ALLOW` | Permission to allow operations on a vehicle |
| `VEHICLE_EXEC` | Permission to execute arbitrary calls from a vehicle |

### Conduit

| Constant | Description |
| --- | --- |
| `CONDUIT_PROCESS` | Permission to process queries on a conduit |
| `CONDUIT_FORCE_REDEEM` | Permission to force-redeem a holder's shares |
| `CONDUIT_SET_INTERCEPTIONS` | Permission to set interceptions on a conduit |
| `CONDUIT_SET_TRANSFER_ENABLED` | Permission to enable or disable share transfers |

### Fee Manager

| Constant | Description |
| --- | --- |
| `FEE_MANAGER_SET_FEES` | Permission to set fee configuration |
| `FEE_MANAGER_SET_FEE_RECIPIENTS` | Permission to set fee recipients |
| `FEE_MANAGER_DISPATCH_ERC20` | Permission to dispatch ERC20 tokens |

### MultiVehicle

| Constant | Description |
| --- | --- |
| `MULTI_VEHICLE_FEED_QUERY_REDEEM_QUEUE` | Permission to feed the query redeem queue |
| `MULTI_VEHICLE_RETRIEVE_QUERY_REDEEM_QUEUE_ASSETS` | Permission to retrieve query redeem queue assets |
| `MULTI_VEHICLE_SET_QUEUES` | Permission to set deposit/redeem queues |
| `MULTI_VEHICLE_SET_VEHICLE_AUTHORIZATION` | Permission to authorize/deauthorize vehicles |
| `MULTI_VEHICLE_MOVE` | Permission to move assets or shares between sectors |
| `MULTI_VEHICLE_DEPOSIT` | Permission to deposit into the MultiVehicle |
| `MULTI_VEHICLE_DISPATCH` | Permission to dispatch operations |
| `MULTI_VEHICLE_PROGRESS_QUERY` | Permission to progress queries |
| `MULTI_VEHICLE_SET_THRESHOLDS` | Permission to set thresholds |

### Modules and account list

| Constant | Description |
| --- | --- |
| `MODULE_MANAGER` | Permission to manage modules on the ModulesManager |
| `ACCOUNT_LIST_MANAGER` | Permission to manage the account list |

### Keepers and jobs

| Constant | Description |
| --- | --- |
| `JOB_LISTING_REGISTER` | Permission to register a keeper job |
| `JOB_LISTING_UNREGISTER` | Permission to unregister a keeper job |
| `JOB_LISTING_EXECUTE` | Permission to execute a listed job |
| `KEEPER_ON_REPORT` | Permission to report keeper execution results |

### Admin

| Constant | Description |
| --- | --- |
| `DEFAULT_ADMIN_ROLE` | `bytes32(0)`, the OpenZeppelin default admin role |

## The registry

Use the individual constants when you know the role you want, and `ROLES` / `roleName` when you need
the whole set — labelling a hash read from chain, or building a role picker.

```ts
import { ROLES, roleName, VEHICLE_STEAM_DEPOSIT } from '@railnetorg/railnet-sdk'

ROLES.length // every role the protocol defines
ROLES[0]     // { name: 'FACTORY_SPAWN', hash: '0x...' }

const options = ROLES.map((role) => ({ label: role.name, value: role.hash }))

roleName(VEHICLE_STEAM_DEPOSIT) // 'VEHICLE_STEAM_DEPOSIT'
roleName('0xdead')              // null
```

### ROLES

* **Type:** `readonly { name: string; hash: Hex }[]`

Every role, including `DEFAULT_ADMIN_ROLE`.

### roleName

* **Type:** `(hash: Hex) => string | null`

Resolves a hash back to its name, or `null` when the hash is not a protocol role.
