> ## Documentation Index
> Fetch the complete documentation index at: https://base-a060aa97-docs-sync-code-change-91427ab.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# IPolicyRegistry.createPolicy

> Creates a new simple policy with no initial members and returns its assigned policy ID.

## Signature

```solidity IPolicyRegistry.sol theme={null}
function createPolicy(address admin, PolicyType policyType) external returns (uint64 newPolicyId);
```

| Field               | Value                         |
| ------------------- | ----------------------------- |
| Selector            | `0xca5d55f6`                  |
| Canonical signature | `createPolicy(address,uint8)` |

## Description

Creates a new simple policy with no initial members. Permissionless. The registry assigns a new policy ID and returns it. The member set starts empty.

## Parameters

| Name         | Type         | Description                                                                                                    |
| ------------ | ------------ | -------------------------------------------------------------------------------------------------------------- |
| `admin`      | `address`    | Initial admin authorized to modify membership and transfer or renounce administration. Cannot be `address(0)`. |
| `policyType` | `PolicyType` | `ALLOWLIST` or `BLOCKLIST`. Composite types are not valid here.                                                |

## Returns

| Name          | Type     | Description                   |
| ------------- | -------- | ----------------------------- |
| `newPolicyId` | `uint64` | The newly assigned policy ID. |

## Revert Conditions

| Error                    | Condition                                                  |
| ------------------------ | ---------------------------------------------------------- |
| `ZeroAddress`            | `admin` is `address(0)`.                                   |
| `IncompatiblePolicyType` | `policyType` is a composite gate (`UNION` or `INTERSECT`). |

## Access Control

Permissionless. Any caller may create a policy.

## Behavior

Emits `PolicyCreated` and `PolicyAdminUpdated(newPolicyId, address(0), admin)`. After the call, `policyAdmin(newPolicyId)` returns `admin` and `policyExists(newPolicyId)` returns `true`.

To seed members in the same call, use `createPolicyWithAccounts`. To create a composite policy, use `createCompositePolicy`.

A policy ID returned here is a plain (non-inverted) ID. To obtain the inverted form, call `invertedPolicyId(newPolicyId)`, which toggles bit 63. The inverted ID shares the same member set and does not require a separate creation step.

## Example

```solidity Usage Example theme={null}
uint64 policyId = StdPrecompiles.POLICY_REGISTRY.createPolicy(admin, IPolicyRegistry.PolicyType.ALLOWLIST);
```
